/* ==========================================================================
   account.css — Account dashboard styles (zh-Hans)
   Depends on index.css for CSS variables, reset, .nav-bar, footer.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.ac-layout {
    display: flex;
    max-width: 1160px;
    margin: 0 auto;
    padding: 36px 24px 80px;
    gap: 32px;
    align-items: flex-start;
}

/* --------------------------------------------------------------------------
   Sidebar nav
   -------------------------------------------------------------------------- */

.ac-sidenav {
    position: sticky;
    top: 88px;
    width: 176px;
    flex-shrink: 0;
}

.ac-sidenav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ac-sidenav a {
    display: block;
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted, #6E6E73);
    text-decoration: none;
    transition: background .15s, color .15s;
}

.ac-sidenav a:hover {
    background: var(--bg-alt, #F5F5F7);
    color: var(--text-main, #1A1A1B);
}

.ac-sidenav a.active {
    background: rgba(255, 126, 95, .08);
    color: var(--brand, #FF7E5F);
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   Main content
   -------------------------------------------------------------------------- */

.ac-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

/* --------------------------------------------------------------------------
   Section
   -------------------------------------------------------------------------- */

.ac-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-margin-top: 96px;
}

.ac-section-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main, #1A1A1B);
    letter-spacing: -.025em;
    margin: 0;
}

.ac-section-desc {
    font-size: 14px;
    color: var(--text-muted, #6E6E73);
    line-height: 1.65;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Hero banner
   -------------------------------------------------------------------------- */

.ac-hero {
    background: linear-gradient(135deg, #1A1A1B 0%, #2C2C2E 100%);
    border-radius: 20px;
    padding: 28px 32px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.ac-hero-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ac-hero-email {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -.03em;
    word-break: break-all;
    color: #fff;
}

.ac-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 100px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    width: fit-content;
    background: rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .75);
}

.ac-hero-badge.has-plan {
    background: rgba(52, 199, 89, .18);
    color: #34C759;
}

.ac-hero-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.ac-hero-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.ac-hero-balance-label {
    font-size: 12px;
    color: rgba(255, 255, 255, .5);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.ac-hero-balance-value {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.04em;
    color: #fff;
}

/* --------------------------------------------------------------------------
   Stats grid
   -------------------------------------------------------------------------- */

.ac-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.ac-stat-card {
    background: var(--bg-card, #fff);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ac-stat-label {
    font-size: 11px;
    color: var(--text-light, #8E8E93);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.ac-stat-value {
    font-size: 19px;
    font-weight: 800;
    color: var(--text-main, #1A1A1B);
    letter-spacing: -.025em;
    word-break: break-word;
}

/* --------------------------------------------------------------------------
   Traffic card
   -------------------------------------------------------------------------- */

.ac-traffic-card {
    background: var(--bg-card, #fff);
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
}

.ac-traffic-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ac-traffic-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main, #1A1A1B);
}

.ac-traffic-pct {
    font-size: 13px;
    font-weight: 700;
    color: var(--brand, #FF7E5F);
}

.ac-traffic-bar-bg {
    height: 8px;
    background: var(--bg-alt, #F5F5F7);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 10px;
}

.ac-traffic-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF7E5F, #FEB47B);
    border-radius: 100px;
    transition: width .6s cubic-bezier(.16,1,.3,1);
}

.ac-traffic-details {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-light, #8E8E93);
}

.ac-traffic-reset {
    font-size: 11px;
    color: var(--text-light, #8E8E93);
    text-align: right;
    margin-top: 6px;
    min-height: 0;
}

/* --------------------------------------------------------------------------
   Plan cards
   -------------------------------------------------------------------------- */

.ac-plans-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.ac-plan-card {
    background: var(--bg-card, #fff);
    border-radius: 16px;
    padding: 20px 22px;
    border: 2px solid var(--border-line, #EDEDF0);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color .2s, box-shadow .2s;
}

.ac-plan-card:hover {
    border-color: var(--brand, #FF7E5F);
    box-shadow: 0 4px 24px rgba(255,126,95,.12);
}

.ac-plan-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main, #1A1A1B);
}

.ac-plan-price {
    font-size: 28px;
    font-weight: 800;
    color: var(--brand, #FF7E5F);
    letter-spacing: -.035em;
}

.ac-plan-price span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted, #6E6E73);
}

.ac-plan-traffic {
    font-size: 13px;
    color: var(--text-muted, #6E6E73);
}

.ac-plan-buy-btn {
    margin-top: 8px;
    width: 100%;
    height: 42px;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    background: var(--brand-gradient, linear-gradient(135deg,#FF7E5F,#FEB47B));
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .01em;
    transition: opacity .18s, transform .12s;
}

.ac-plan-buy-btn:hover  { opacity: .88; transform: translateY(-1px); }
.ac-plan-buy-btn:active { transform: translateY(0); }
.ac-plan-buy-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.ac-plans-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 32px 0;
    font-size: 14px;
    color: var(--text-light, #8E8E93);
}

.ac-balance-note {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 13px;
    color: #15803D;
    line-height: 1.55;
}

/* --------------------------------------------------------------------------
   Download cards
   -------------------------------------------------------------------------- */

.ac-dl-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.ac-dl-card {
    background: var(--bg-card, #fff);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ac-dl-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.ac-dl-platform {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main, #1A1A1B);
}

.ac-dl-sub {
    font-size: 12px;
    color: var(--text-light, #8E8E93);
    margin-top: -4px;
}

.ac-dl-btn {
    margin-top: auto;
    height: 38px;
    border-radius: 100px;
    border: 1.5px solid var(--text-main, #1A1A1B);
    background: transparent;
    color: var(--text-main, #1A1A1B);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
    font-family: inherit;
}

.ac-dl-btn:hover {
    background: var(--text-main, #1A1A1B);
    color: #fff;
}

.ac-dl-btn--primary {
    background: var(--text-main, #1A1A1B);
    color: #fff;
}

.ac-dl-btn--primary:hover { opacity: .85; }

/* --------------------------------------------------------------------------
   Invite section
   -------------------------------------------------------------------------- */

.ac-invite-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.ac-invite-card {
    background: var(--bg-card, #fff);
    border-radius: 16px;
    padding: 22px 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ac-invite-card-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-light, #8E8E93);
}

.ac-invite-code-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ac-invite-code {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main, #1A1A1B);
    font-family: 'SF Mono', 'Fira Code', monospace;
    letter-spacing: .08em;
    flex: 1;
    word-break: break-all;
}

.ac-invite-link-wrap {
    background: var(--bg-alt, #F5F5F7);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12px;
    color: var(--text-muted, #6E6E73);
    word-break: break-all;
    line-height: 1.5;
}

.ac-copy-btn {
    background: none;
    border: 1.5px solid var(--border-line, #EDEDF0);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--brand, #FF7E5F);
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .15s, background .15s;
    font-family: inherit;
}

.ac-copy-btn:hover {
    border-color: var(--brand, #FF7E5F);
    background: rgba(255,126,95,.05);
}

.ac-invite-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.ac-invite-stat {
    background: var(--bg-alt, #F5F5F7);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ac-invite-stat-label {
    font-size: 11px;
    color: var(--text-light, #8E8E93);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ac-invite-stat-value {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-main, #1A1A1B);
}

/* --------------------------------------------------------------------------
   Action buttons
   -------------------------------------------------------------------------- */

.ac-action-btn {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 20px;
    border-radius: 100px;
    border: 1.5px solid var(--border-line, #EDEDF0);
    background: var(--bg-card, #fff);
    color: var(--text-main, #1A1A1B);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
    white-space: nowrap;
}

.ac-action-btn:hover {
    border-color: #AEAEB2;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

/* --------------------------------------------------------------------------
   Security form
   -------------------------------------------------------------------------- */

.ac-form {
    background: var(--bg-card, #fff);
    border-radius: 16px;
    padding: 24px 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
    max-width: 460px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ac-form-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main, #1A1A1B);
    margin: 0;
}

.ac-form-err {
    display: none;
    background: #FFF2F0;
    border: 1px solid #FFD6D0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: #D1382A;
    line-height: 1.5;
}

.ac-form-err.visible { display: block; margin-bottom: 12px; }

.ac-form-ok {
    display: none;
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: #15803D;
    line-height: 1.5;
}

.ac-form-ok.visible { display: block; margin-bottom: 12px; }

.ac-logout-btn {
    height: 44px;
    padding: 0 26px;
    border-radius: 100px;
    border: 1.5px solid #FF3B30;
    background: transparent;
    color: #FF3B30;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, color .15s;
    font-family: inherit;
}

.ac-logout-btn:hover {
    background: #FF3B30;
    color: #fff;
}

/* --------------------------------------------------------------------------
   Entry card (orders / single-action rows)
   -------------------------------------------------------------------------- */

.ac-entry-card {
    background: var(--bg-card, #fff);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow .18s, transform .14s;
    text-decoration: none;
    border: 1px solid transparent;
}

.ac-entry-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.09);
    transform: translateY(-1px);
    border-color: var(--border-line, #EDEDF0);
}

.ac-entry-card-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ac-entry-card-body {
    flex: 1;
    min-width: 0;
}

.ac-entry-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main, #1A1A1B);
    margin-bottom: 3px;
}

.ac-entry-card-desc {
    font-size: 13px;
    color: var(--text-muted, #6E6E73);
    line-height: 1.5;
}

.ac-entry-card-arrow {
    color: #C7C7CC;
    flex-shrink: 0;
    transition: transform .15s;
}

.ac-entry-card:hover .ac-entry-card-arrow {
    transform: translateX(3px);
    color: var(--text-muted, #6E6E73);
}

/* --------------------------------------------------------------------------
   Ticket entry cards
   -------------------------------------------------------------------------- */

.ac-ticket-entry-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.ac-ticket-entry-card {
    background: var(--bg-card, #fff);
    border-radius: 16px;
    padding: 22px 22px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
    border: 1.5px solid var(--border-line, #EDEDF0);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color .18s, box-shadow .18s, transform .14s;
}

.ac-ticket-entry-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.09);
    transform: translateY(-1px);
}

.ac-ticket-entry-card--primary {
    background: var(--brand-gradient, linear-gradient(135deg,#FF7E5F,#FEB47B));
    border-color: transparent;
    color: #fff;
}

.ac-ticket-entry-card--primary .ac-ticket-entry-icon { color: rgba(255,255,255,.9); }
.ac-ticket-entry-card--primary .ac-ticket-entry-title { color: #fff; }
.ac-ticket-entry-card--primary .ac-ticket-entry-desc  { color: rgba(255,255,255,.8); }

.ac-ticket-entry-card--primary:hover {
    opacity: .92;
    box-shadow: 0 6px 24px rgba(255,126,95,.3);
}

.ac-ticket-entry-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: rgba(0,0,0,.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.ac-ticket-entry-card--primary .ac-ticket-entry-icon {
    background: rgba(255,255,255,.2);
}

.ac-ticket-entry-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main, #1A1A1B);
}

.ac-ticket-entry-desc {
    font-size: 13px;
    color: var(--text-muted, #6E6E73);
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Security card (password change)
   -------------------------------------------------------------------------- */

.ac-security-card {
    background: var(--bg-card, #fff);
    border-radius: 20px;
    padding: 24px 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ac-security-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ac-security-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: var(--bg-alt, #F5F5F7);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-main, #1A1A1B);
}

.ac-security-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main, #1A1A1B);
    margin-bottom: 2px;
}

.ac-security-card-subtitle {
    font-size: 13px;
    color: var(--text-muted, #6E6E73);
}

.ac-security-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ac-security-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

.ac-security-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ac-security-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main, #1A1A1B);
}

.ac-security-field input {
    height: 44px;
    border-radius: 12px;
    border: 1.5px solid var(--border-line, #EDEDF0);
    padding: 0 14px;
    font-size: 14px;
    color: var(--text-main, #1A1A1B);
    background: var(--bg-alt, #F5F5F7);
    outline: none;
    width: 100%;
    transition: border-color .18s, background .18s;
    font-family: inherit;
}

.ac-security-field input:focus {
    border-color: var(--brand, #FF7E5F);
    background: #fff;
}

/* --------------------------------------------------------------------------
   Danger zone
   -------------------------------------------------------------------------- */

.ac-account-actions {
    border: 1.5px solid var(--border, #EDEDF0);
    border-radius: 20px;
    overflow: hidden;
}

.ac-account-actions-body {
    background: var(--bg-card, #fff);
    padding: 20px 24px;
}

.ac-danger-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.ac-danger-item-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main, #1A1A1B);
    margin-bottom: 3px;
}

.ac-danger-item-desc {
    font-size: 13px;
    color: var(--text-muted, #6E6E73);
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Modals
   -------------------------------------------------------------------------- */

.ac-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .46);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.ac-modal.open { display: flex; }

.ac-modal-box {
    background: var(--bg-card, #fff);
    border-radius: 20px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.16), 0 4px 16px rgba(0,0,0,.08);
    overflow: hidden;
}

.ac-modal-box--sm { max-width: 440px; }

.ac-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-line, #EDEDF0);
    flex-shrink: 0;
}

.ac-modal-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main, #1A1A1B);
    letter-spacing: -.02em;
}

.ac-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 19px;
    color: var(--text-light, #8E8E93);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
    line-height: 1;
    font-family: inherit;
}

.ac-modal-close:hover {
    background: var(--bg-alt, #F5F5F7);
    color: var(--text-main, #1A1A1B);
}

.ac-modal-body {
    padding: 20px 22px;
    overflow-y: auto;
    max-height: 64vh;
}

.ac-modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border-line, #EDEDF0);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Ticket detail modal layout (§18.3)
   -------------------------------------------------------------------------- */

#modal-ticket-detail .ac-modal-body {
    display: flex;
    flex-direction: column;
    height: 62vh;
    overflow: hidden;
    padding-bottom: 20px;
}

#modal-ticket-detail .ac-messages {
    flex: 1;
    overflow-y: auto;
    max-height: none;
}

#ticket-reply-area {
    flex-shrink: 0;
    padding-top: 8px;
}

/* --------------------------------------------------------------------------
   Shared dark modal header — ac-mhd
   -------------------------------------------------------------------------- */

.ac-mhd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 26px 20px;
    background: linear-gradient(135deg, #1A1A1B 0%, #2C2C2E 100%);
    border-radius: 20px 20px 0 0;
    flex-shrink: 0;
    gap: 12px;
}

.ac-mhd-title {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.03em;
    line-height: 1.2;
}

.ac-mhd-sub {
    font-size: 12px;
    color: rgba(255,255,255,.45);
    margin-top: 3px;
    font-weight: 500;
}

.ac-mhd-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.ac-mhd-btn-danger {
    height: 30px;
    padding: 0 12px;
    border-radius: 100px;
    border: 1.5px solid rgba(255,59,48,.7);
    background: transparent;
    color: rgba(255,100,90,1);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: background .15s, color .15s;
}

.ac-mhd-btn-danger:hover {
    background: #FF3B30;
    border-color: #FF3B30;
    color: #fff;
}

.ac-modal-close--light {
    color: rgba(255,255,255,.55);
}

.ac-modal-close--light:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
}

/* --------------------------------------------------------------------------
   Modal body variants
   -------------------------------------------------------------------------- */

.ac-modal-body--gray {
    padding: 20px 24px 24px;
    background: var(--bg-alt, #F5F5F7);
}

/* --------------------------------------------------------------------------
   Orders modal — premium card layout
   -------------------------------------------------------------------------- */

.ac-modal-box--orders {
    max-width: 780px;
}

.ac-modal-box--md {
    max-width: 600px;
}

.ac-orders-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Order card */
.ac-ocard {
    display: flex;
    align-items: stretch;
    background: var(--bg-card, #fff);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
    transition: box-shadow .18s, transform .14s;
}

.ac-ocard:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.10);
    transform: translateY(-1px);
}

/* Left accent bar — green for paid, orange for pending */
.ac-ocard-accent {
    width: 4px;
    flex-shrink: 0;
    background: #34C759;
}

.ac-ocard--pending .ac-ocard-accent {
    background: linear-gradient(180deg, #FF7E5F, #FEB47B);
}

.ac-ocard-body {
    flex: 1;
    padding: 16px 20px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Top row: plan info left, amount + status right */
.ac-ocard-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.ac-ocard-info {
    flex: 1;
    min-width: 0;
}

.ac-ocard-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main, #1A1A1B);
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.ac-ocard-period {
    font-size: 11px;
    font-weight: 600;
    color: var(--brand, #FF7E5F);
    background: rgba(255,126,95,.10);
    border-radius: 100px;
    padding: 2px 8px;
    letter-spacing: .02em;
}

.ac-ocard-no {
    font-size: 11px;
    color: var(--text-light, #8E8E93);
    font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
    margin-top: 4px;
    word-break: break-all;
    line-height: 1.5;
}

.ac-ocard-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.ac-ocard-amount {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main, #1A1A1B);
    letter-spacing: -.04em;
    line-height: 1;
}

.ac-ocard-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}

.ac-ocard-status--paid {
    background: #F0FDF4;
    color: #15803D;
}

.ac-ocard-status--pending {
    background: #EFF6FF;
    color: #1D4ED8;
}

/* Bottom row: date left, deduct + actions right */
.ac-ocard-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.ac-ocard-date {
    font-size: 12px;
    color: var(--text-light, #8E8E93);
    white-space: nowrap;
}

.ac-ocard-deduct {
    font-size: 12px;
    color: var(--text-light, #8E8E93);
    white-space: nowrap;
    margin-left: auto;
}

.ac-ocard-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.ac-ocard-btn {
    height: 32px;
    padding: 0 16px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid;
    transition: background .15s, color .15s;
    white-space: nowrap;
    font-family: inherit;
}

.ac-ocard-btn--pay {
    border-color: var(--brand, #FF7E5F);
    color: #fff;
    background: var(--brand-gradient, linear-gradient(135deg,#FF7E5F,#FEB47B));
}

.ac-ocard-btn--pay:hover { opacity: .88; }
.ac-ocard-btn--pay:disabled { opacity: .5; cursor: not-allowed; }

.ac-ocard-btn--cancel {
    border-color: var(--border-line, #EDEDF0);
    color: var(--text-muted, #6E6E73);
    background: transparent;
}

.ac-ocard-btn--cancel:hover { border-color: #FF3B30; color: #FF3B30; }
.ac-ocard-btn--cancel:disabled { opacity: .5; cursor: not-allowed; }

/* --------------------------------------------------------------------------
   Table
   -------------------------------------------------------------------------- */

.ac-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ac-table th {
    text-align: left;
    padding: 0 12px 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light, #8E8E93);
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--border-line, #EDEDF0);
    white-space: nowrap;
}

.ac-table td {
    padding: 12px;
    vertical-align: top;
    border-bottom: 1px solid var(--bg-alt, #F5F5F7);
    color: var(--text-main, #1A1A1B);
    font-size: 13px;
}

.ac-table tr:last-child td { border-bottom: none; }

.ac-amount-main {
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

.ac-amount-sub {
    display: block;
    font-size: 11px;
    color: var(--text-light, #8E8E93);
    margin-top: 2px;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}

.badge-paid    { background: #F0FDF4; color: #15803D; }
.badge-pending { background: #FFFBEB; color: #B45309; }
.badge-closed  { background: var(--bg-alt, #F5F5F7); color: var(--text-muted, #6E6E73); }
.badge-waiting { background: #EFF6FF; color: #1D4ED8; }

/* --------------------------------------------------------------------------
   Order action buttons
   -------------------------------------------------------------------------- */

.ac-order-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ac-order-btn {
    height: 30px;
    padding: 0 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid;
    transition: background .15s, color .15s;
    white-space: nowrap;
    font-family: inherit;
}

.ac-order-btn--pay {
    border-color: var(--brand, #FF7E5F);
    color: var(--brand, #FF7E5F);
    background: transparent;
}

.ac-order-btn--pay:hover { background: var(--brand, #FF7E5F); color: #fff; }

.ac-order-btn--cancel {
    border-color: var(--border-line, #EDEDF0);
    color: var(--text-muted, #6E6E73);
    background: transparent;
}

.ac-order-btn--cancel:hover { border-color: #FF3B30; color: #FF3B30; }

/* --------------------------------------------------------------------------
   Ticket list
   -------------------------------------------------------------------------- */

.ac-ticket-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ac-ticket-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s;
}

.ac-ticket-row:hover { background: var(--bg-alt, #F5F5F7); }

.ac-ticket-subject {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main, #1A1A1B);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ac-ticket-meta {
    font-size: 12px;
    color: var(--text-light, #8E8E93);
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Messages (ticket conversation) — §18
   -------------------------------------------------------------------------- */

.ac-messages {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 4px 0 12px;
}

/* §18.1: correct alignment — width:100% + margin-left:auto on child */
.ac-msg {
    display: flex;
    width: 100%;
}

/* User messages pushed right */
.ac-msg.is-me > div {
    margin-left: auto;
}

/* §18.2: max-width in pixels, not percentage */
.ac-msg-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.6;
    max-width: 480px;
    word-break: break-word;
}

.ac-msg:not(.is-me) .ac-msg-bubble {
    background: var(--bg-alt, #F5F5F7);
    color: var(--text-main, #1A1A1B);
    border-bottom-left-radius: 4px;
}

.ac-msg.is-me .ac-msg-bubble {
    background: var(--brand-gradient, linear-gradient(135deg,#FF7E5F,#FEB47B));
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ac-msg-time {
    font-size: 11px;
    color: #AEAEB2;
    margin-top: 4px;
    text-align: right;
}

/* --------------------------------------------------------------------------
   Textarea
   -------------------------------------------------------------------------- */

.ac-textarea {
    width: 100%;
    border: 1.5px solid var(--border-line, #EDEDF0);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    color: var(--text-main, #1A1A1B);
    background: #FAFAFA;
    outline: none;
    resize: vertical;
    min-height: 88px;
    font-family: inherit;
    transition: border-color .18s, background .18s;
    line-height: 1.55;
}

.ac-textarea:focus {
    border-color: var(--brand, #FF7E5F);
    background: #fff;
}

/* --------------------------------------------------------------------------
   Modal buttons
   -------------------------------------------------------------------------- */

.btn-primary {
    height: 40px;
    padding: 0 22px;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    background: var(--brand-gradient, linear-gradient(135deg,#FF7E5F,#FEB47B));
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .01em;
    transition: opacity .18s, transform .12s;
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary:hover  { opacity: .88; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-secondary {
    height: 40px;
    padding: 0 22px;
    border-radius: 100px;
    border: 1.5px solid var(--border-line, #EDEDF0);
    cursor: pointer;
    background: transparent;
    color: var(--text-main, #1A1A1B);
    font-size: 14px;
    font-weight: 600;
    transition: border-color .15s;
    font-family: inherit;
    white-space: nowrap;
}

.btn-secondary:hover         { border-color: #D1D1D6; }
.btn-secondary:focus         { outline: none; border-color: #D1D1D6; }
.btn-secondary:focus-visible {
    outline: none;
    border-color: #D1D1D6;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, .06);
}

.btn-danger {
    height: 34px;
    padding: 0 14px;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    background: #FF3B30;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    transition: opacity .18s;
    font-family: inherit;
    white-space: nowrap;
}

.btn-danger:hover { opacity: .85; }

/* --------------------------------------------------------------------------
   Alert (in modals)
   -------------------------------------------------------------------------- */

.ac-alert {
    display: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.5;
}

.ac-alert.visible { display: block; margin-bottom: 12px; }
.ac-alert.err  { background: #FFF2F0; border: 1px solid #FFD6D0; color: #D1382A; }
.ac-alert.ok   { background: #F0FDF4; border: 1px solid #BBF7D0; color: #15803D; }

/* --------------------------------------------------------------------------
   Loading / empty states
   -------------------------------------------------------------------------- */

.ac-loading {
    text-align: center;
    padding: 24px 0;
    font-size: 14px;
    color: #AEAEB2;
}

.ac-empty {
    text-align: center;
    padding: 28px 0;
    font-size: 14px;
    color: var(--text-light, #8E8E93);
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.ac-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: var(--text-main, #1A1A1B);
    color: #fff;
    padding: 11px 22px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    z-index: 9999;
    white-space: nowrap;
    max-width: calc(100vw - 40px);
}

.ac-toast.show    { opacity: 1; transform: translateX(-50%) translateY(0); }
.ac-toast.success { background: #34C759; }
.ac-toast.error   { background: #FF3B30; }

/* --------------------------------------------------------------------------
   Welcome & confirm modals
   -------------------------------------------------------------------------- */

.ac-welcome-icon  { text-align: center; font-size: 52px; margin-bottom: 14px; }
.ac-welcome-title { text-align: center; font-size: 22px; font-weight: 800; color: var(--text-main,#1A1A1B); letter-spacing:-.03em; margin-bottom: 10px; }
.ac-welcome-msg   { text-align: center; font-size: 14px; color: var(--text-muted,#6E6E73); line-height: 1.7; }
.ac-confirm-msg   { font-size: 15px; color: var(--text-main,#1A1A1B); line-height: 1.65; }

/* --------------------------------------------------------------------------
   Commission (reward) record cards
   -------------------------------------------------------------------------- */

.ac-rcard {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--bg-card, #fff);
    border-radius: 12px;
    padding: 14px 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
    transition: box-shadow .16s, transform .13s;
}

.ac-rcard:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    transform: translateY(-1px);
}

.ac-rcard-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.ac-rcard-email {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main, #1A1A1B);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ac-rcard-time {
    font-size: 11px;
    color: var(--text-light, #8E8E93);
}

.ac-rcard-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    flex-shrink: 0;
}

.ac-rcard-amount {
    font-size: 17px;
    font-weight: 800;
    color: #15803D;
    letter-spacing: -.03em;
    line-height: 1;
}

.ac-rcard-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .03em;
    background: rgba(52,199,89,.12);
    color: #15803D;
    white-space: nowrap;
}

.ac-rcard-type--register {
    background: rgba(59,130,246,.12);
    color: #1D4ED8;
}

/* --------------------------------------------------------------------------
   Ticket list rows — upgraded
   -------------------------------------------------------------------------- */

.ac-ticket-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ac-ticket-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: background .15s, box-shadow .15s, transform .13s;
    background: var(--bg-card, #fff);
    box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
}

.ac-ticket-row:hover {
    background: var(--bg-card, #fff);
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
    .ac-stats-grid  { grid-template-columns: repeat(2, 1fr); }
    .ac-plans-grid  { grid-template-columns: 1fr; }
    .ac-dl-grid     { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
    .ac-security-fields { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .ac-layout {
        flex-direction: column;
        padding: 20px 16px 60px;
        gap: 24px;
    }

    .ac-sidenav {
        position: static;
        width: 100%;
    }

    .ac-sidenav ul {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .ac-sidenav a { padding: 6px 12px; font-size: 13px; }

    .ac-hero { padding: 22px 20px; }
    .ac-hero-email { font-size: 17px; }
    .ac-hero-balance-value { font-size: 24px; }

    .ac-stats-grid  { grid-template-columns: 1fr 1fr; }
    .ac-dl-grid     { grid-template-columns: 1fr 1fr; }
    .ac-invite-grid { grid-template-columns: 1fr; }
    .ac-invite-stats { grid-template-columns: 1fr 1fr; }
    .ac-security-fields { grid-template-columns: 1fr; }
    .ac-ticket-entry-grid { grid-template-columns: 1fr; }
    .ac-danger-item { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 480px) {
    .ac-stats-grid  { grid-template-columns: 1fr; }
    .ac-dl-grid     { grid-template-columns: 1fr; }
    .ac-hero { flex-direction: column; align-items: flex-start; }
    .ac-hero-right { align-items: flex-start; }
}
