/* My account page — app/templates/account.html (feature 032).

   Page-scoped rules only, `acct-` prefix throughout. Every colour is a
   main.css token, so dark mode needs no block of its own here; the only
   literals are the red/gold tints main.css itself uses the same way.

   NO `:root` in this file: partials/head.html injects the white-label brand
   block after main.css and before this sheet, and a page-level redefinition
   would only argue with it.

   Loaded from the template with the repo's ?v=<static_version> cache-buster. */

/* ── Page scaffold ──────────────────────────────────────────────────────── */
body.acct-page { display: flex; flex-direction: column; min-height: 100vh; }
.acct-main { flex: 1; }
.acct-page [hidden] { display: none !important; }
.acct-container { max-width: 1000px; margin: 2.5rem auto 4rem; padding: 0 1.5rem; }

/* The house pattern (.nav-subscribe-btn, main.css): --text-primary, not
   --orange, because it is high-contrast in BOTH themes and an outline survives
   forced-colors mode where box-shadow does not. */
.acct-page :focus-visible {
    outline: 3px solid var(--text-primary);
    outline-offset: 2px;
}
.acct-page :focus:not(:focus-visible) { outline: none; }

/* Visually hidden, still read out: the live region, the button suffixes that
   complete "Add" into "Add your country", and the radio inputs behind the
   segmented controls. */
.acct-sr, .acct-live, .acct-seg-input {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ── Hero (avatar + identity) ───────────────────────────────────────────── */
.acct-hero { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1.5rem; }
.acct-avatar-wrap { position: relative; flex-shrink: 0; }
.acct-avatar {
    width: 64px; height: 64px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; font-weight: 700; color: var(--brand-on-primary);
    background: linear-gradient(135deg, var(--orange), var(--orange-hover));
    box-shadow: var(--card-shadow);
}
.acct-avatar img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.acct-avatar-edit {
    position: absolute; right: -4px; bottom: -4px; width: 28px; height: 28px;
    border-radius: 50%; background: var(--card-bg); border: 1px solid var(--card-border);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    color: var(--text-secondary); box-shadow: var(--card-shadow); padding: 0;
}
.acct-avatar-edit:hover { color: var(--link-on-card); border-color: var(--orange); }
.acct-avatar-edit svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
/* Invisible halo: grows the tap target to 44px without changing looks. */
.acct-avatar-edit::after { content: ''; position: absolute; inset: -8px; border-radius: 50%; }
.acct-hero-info { min-width: 0; }
.acct-hero-info h1 { font-size: 1.75rem; font-weight: 700; color: var(--text-primary); overflow-wrap: anywhere; }
.acct-hero-meta { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.35rem; }
.acct-role-badge {
    display: inline-flex; align-items: center;
    font-size: 0.8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    background: var(--teal-light); color: var(--teal-on-tint);
    padding: 0.3rem 0.7rem; border-radius: 999px;
}
.acct-org-chip {
    display: inline-flex; align-items: center;
    font-size: 0.8125rem; font-weight: 600;
    background: var(--orange-light); color: var(--link-on-card);
    padding: 0.3rem 0.7rem; border-radius: 999px;
    max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.acct-member-since { font-size: 0.8125rem; color: var(--text-secondary); }

/* ── Trial banner ───────────────────────────────────────────────────────── */
.acct-trial-banner {
    display: flex; align-items: center; gap: 0.6rem;
    background: var(--orange-light); border: 1px solid var(--card-border);
    color: var(--text-primary); font-size: 0.9375rem; font-weight: 600;
    border-radius: 12px; padding: 0.5rem 1rem; margin-bottom: 1.25rem;
}
.acct-trial-banner svg { flex-shrink: 0; color: var(--gold); }
/* --link-on-card, NOT --orange: 0.9375rem is normal-size text, and raw
   --orange is 2.80:1 on the light card. The token carries the darkened
   orange in light mode and flips back to --orange in dark. */
.acct-trial-link {
    margin-left: auto; flex-shrink: 0;
    display: inline-flex; align-items: center; min-height: 44px;
    font-size: 0.9375rem; font-weight: 600;
    color: var(--link-on-card); text-decoration: underline; text-underline-offset: 2px;
}
.acct-trial-link:hover { color: var(--link-on-card-hover); }

/* ── Cards ──────────────────────────────────────────────────────────────── */
/* Mobile-first: the DOM order IS the small-screen order. The two-column
   layout is a min-width enhancement further down. */
.acct-grid { display: flex; flex-direction: column; gap: 1.5rem; }
.acct-card {
    background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: 16px; padding: 1.5rem; box-shadow: var(--card-shadow); min-width: 0;
}
.acct-card-head { margin-bottom: 1.25rem; }
.acct-card-head h2 { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); }
.acct-card-head p { font-size: 1rem; color: var(--text-secondary); margin-top: 0.25rem; line-height: 1.45; }
.acct-card-head--row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.acct-btn-primary, .acct-btn-ghost, .acct-btn-danger, .acct-row-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    min-height: 44px; padding: 0.5rem 1.25rem; border-radius: 10px;
    font-family: inherit; font-size: 1rem; font-weight: 600; line-height: 1.2; cursor: pointer;
}
.acct-btn-primary { background: var(--orange); color: var(--brand-on-primary); border: none; }
.acct-btn-primary:hover { background: var(--orange-hover); }
.acct-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.acct-btn-ghost { background: none; border: 1px solid var(--card-border); color: var(--text-secondary); }
.acct-btn-ghost:hover { border-color: var(--orange); color: var(--link-on-card); }
.acct-btn-ghost:disabled { opacity: 0.6; cursor: not-allowed; }
.acct-btn-ghost svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.acct-row-btn {
    min-width: 88px; flex-shrink: 0; margin-left: auto;
    background: none; border: 1px solid var(--card-border); color: var(--text-primary);
}
.acct-row-btn:hover { border-color: var(--orange); color: var(--link-on-card); }
.acct-form-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.25rem; flex-wrap: wrap; }

/* ── Completion meter ───────────────────────────────────────────────────
   Sits inside the Profile card, directly under its head: the number and the
   fix live in the same place. Teal at every percentage — red on this page
   means "delete", nothing else. Count + missing list are server-rendered
   from app/services/profile_options.py and refreshed from the same numbers
   via GET/PATCH /api/me/profile, so this can never disagree with the navbar
   dot. */
.acct-meter {
    margin: 0 0 1.5rem; padding: 1rem 1.15rem; border-radius: 12px;
    background: var(--teal-light); border: 1px solid var(--card-border);
}
.acct-meter-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 0.75rem; margin-bottom: 0.5rem;
}
.acct-meter-count { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.acct-meter-pct { font-size: 1rem; font-weight: 700; color: var(--teal-on-tint); font-variant-numeric: tabular-nums; }
.acct-meter-track { height: 10px; border-radius: 999px; overflow: hidden; background: var(--progress-bg); }
.acct-meter-fill {
    height: 100%; width: 0; border-radius: 999px; background: var(--teal-on-tint);
    transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.acct-meter-done { margin-top: 0.75rem; font-size: 0.9375rem; color: var(--text-secondary); }
.acct-meter--done .acct-meter-count { color: var(--teal-on-tint); }
.acct-meter-todo { margin-top: 0.9rem; display: flex; flex-direction: column; gap: 0.75rem; }
.acct-meter-cta { align-self: flex-start; }
.acct-meter-chips {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
    font-size: 0.9375rem; color: var(--text-secondary);
}
.acct-meter-chips-lead { font-weight: 600; }
.acct-miss-chip {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0.4rem 0.9rem;
    border-radius: 999px; border: 1px solid var(--card-border); background: var(--card-bg);
    color: var(--text-primary); font-family: inherit; font-size: 0.8125rem; font-weight: 600; cursor: pointer;
}
.acct-miss-chip:hover { border-color: var(--orange); color: var(--link-on-card); }

/* ── Refresh-failed notice + live region ────────────────────────────────── */
.acct-notice {
    font-size: 0.9375rem; color: var(--text-primary); line-height: 1.45;
    background: var(--bg); border: 1px solid var(--card-border);
    border-radius: 10px; padding: 0.6rem 0.85rem; margin-bottom: 1.25rem;
}

/* ── Groups and rows ────────────────────────────────────────────────────── */
.acct-group { border: 0; padding: 0; margin: 0 0 1.5rem; min-width: 0; }
.acct-group:last-child { margin-bottom: 0; }
.acct-group legend {
    font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
    color: var(--text-secondary); padding: 0; margin-bottom: 0.25rem;
}
.acct-group-help { font-size: 1rem; color: var(--text-secondary); line-height: 1.45; margin-bottom: 0.25rem; }
.acct-note { font-size: 0.9375rem; color: var(--text-secondary); line-height: 1.45; padding: 0.75rem 0; }
/* Label above value, both left-aligned; the trigger sits at the right. Rows
   inside a group are separated by a 1px rule, groups by whitespace + legend. */
.acct-row {
    display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 1rem;
    padding: 0.75rem 0; border-bottom: 1px solid var(--card-border);
}
.acct-row:last-of-type { border-bottom: none; }
.acct-row-main { flex: 1 1 14rem; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.acct-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.acct-row-label { font-size: 0.9375rem; font-weight: 600; color: var(--text-secondary); }
.acct-row-step { font-size: 0.8125rem; font-weight: 600; color: var(--link-on-card); white-space: nowrap; }
.acct-row-value { font-size: 1.0625rem; font-weight: 500; color: var(--text-primary); overflow-wrap: anywhere; min-height: 1.4em; }
.acct-row--empty .acct-row-value { min-height: 0; }
.acct-row-lock {
    display: inline-flex; align-items: center; gap: 0.35rem; margin-left: auto; flex-shrink: 0;
    font-size: 0.8125rem; font-weight: 600; color: var(--teal-on-tint); white-space: nowrap;
}
.acct-row-lock svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.acct-row[aria-busy="true"] { opacity: 0.85; }

/* ── Row editor (built by account.js on open) ───────────────────────────── */
.acct-row-editor { flex-basis: 100%; width: 100%; display: flex; flex-direction: column; gap: 0.75rem; padding-top: 0.25rem; }
.acct-row-seed { display: flex; flex-direction: column; gap: 0.75rem; }
.acct-input {
    width: 100%; box-sizing: border-box; min-height: 48px; padding: 0.6rem 0.85rem;
    border: 1px solid var(--input-border); border-radius: 10px;
    font-size: 1rem; font-family: inherit;
    background: var(--input-bg); color: var(--text-primary);
}
.acct-input:focus { border-color: var(--orange); }
.acct-input[aria-invalid="true"] { border-color: var(--red-on-card); }
.acct-row-hint { font-size: 0.9375rem; color: var(--text-secondary); line-height: 1.45; }
.acct-row-error {
    flex-basis: 100%; width: 100%;
    font-size: 0.9375rem; font-weight: 600; color: var(--red-on-card); line-height: 1.45;
    background: rgba(231, 76, 60, 0.08); border-left: 4px solid var(--red-on-card);
    border-radius: 8px; padding: 0.6rem 0.85rem;
}
/* Write-once warning: --gold border + icon, --text-primary text on a gold
   tint. Always ABOVE the control it warns about, never below it. */
.acct-row-notice {
    display: flex; align-items: flex-start; gap: 0.6rem;
    font-size: 0.9375rem; color: var(--text-primary); line-height: 1.45;
    background: rgba(240, 165, 0, 0.10); border-left: 4px solid var(--gold);
    border-radius: 8px; padding: 0.6rem 0.85rem;
}
.acct-row-notice svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 0.1rem; fill: none; stroke: var(--gold); stroke-width: 2; }
.acct-row-notice--info { background: var(--teal-light); border-left-color: var(--teal-on-tint); }
.acct-row-notice--info svg { stroke: var(--teal-on-tint); }
.acct-row-actions { display: flex; justify-content: flex-end; gap: 0.6rem; flex-wrap: wrap; }

/* ── Segmented controls (gender, theme): native radios behind labels ───── */
.acct-seg { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.acct-seg-btn {
    flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
    min-height: 44px; padding: 0.55rem 0.9rem; border-radius: 10px;
    border: 1px solid var(--card-border); background: var(--bg); color: var(--text-primary);
    font-weight: 600; font-size: 1rem; font-family: inherit; cursor: pointer; text-align: center;
}
.acct-seg-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.acct-seg-btn:hover { border-color: var(--orange); }
.acct-seg-input:checked + .acct-seg-btn {
    border-color: var(--link-on-card); color: var(--link-on-card); background: var(--orange-light);
}
.acct-seg-input:focus-visible + .acct-seg-btn { outline: 3px solid var(--text-primary); outline-offset: 2px; }

/* ── Radio cards (the two one-time questions) ───────────────────────────── */
.acct-opts { display: flex; flex-direction: column; gap: 0.5rem; }
.acct-opt {
    display: flex; align-items: center; gap: 0.75rem; min-height: 56px; padding: 0.75rem 1rem;
    border-radius: 12px; border: 1px solid var(--card-border); background: var(--bg); cursor: pointer;
}
.acct-opt:hover { border-color: var(--orange); }
.acct-opt:has(input:checked) { border-color: var(--link-on-card); background: var(--orange-light); }
.acct-opt input { width: 22px; height: 22px; flex-shrink: 0; margin: 0; accent-color: var(--orange); cursor: pointer; }
.acct-opt-label { font-size: 1rem; color: var(--text-primary); line-height: 1.4; }

/* ── Avatar editor ──────────────────────────────────────────────────────── */
.acct-avatar-editor { margin-bottom: 1.5rem; }
.acct-avatar-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.acct-avatar-opt {
    width: 44px; height: 44px; border-radius: 50%; padding: 0; overflow: hidden;
    border: 2px solid transparent; cursor: pointer; background: var(--card-bg);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 0.95rem; font-family: inherit;
    transition: transform .12s ease, border-color .12s ease;
}
.acct-avatar-opt img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.acct-avatar-opt:hover { transform: scale(1.1); }
.acct-avatar-opt--selected { border-color: var(--orange); }

/* ── Plain forms (password, theme) ──────────────────────────────────────── */
.acct-form-group { margin-bottom: 1rem; }
.acct-form-group label, .acct-form-label {
    display: block; font-size: 0.9375rem; font-weight: 600;
    margin-bottom: 0.35rem; color: var(--text-primary);
}
.acct-hint { display: block; font-size: 0.9375rem; color: var(--text-secondary); margin-top: 0.4rem; line-height: 1.45; }
.acct-form-error {
    display: none; background: rgba(231, 76, 60, .08); border: 1px solid rgba(231, 76, 60, .3);
    color: var(--red-on-card); border-radius: 10px; padding: 0.6rem 0.85rem;
    font-size: 0.9375rem; line-height: 1.45; margin-bottom: 1rem;
}
.acct-form-error.acct-visible { display: block; }

/* ── Password inputs (show/hide toggle) ─────────────────────────────────── */
.acct-pw-wrap { position: relative; }
.acct-pw-wrap .acct-input { padding-right: 3rem; }
.acct-pw-toggle {
    position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; background: none; border: none; padding: 0; cursor: pointer;
    color: var(--text-secondary); display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
}
.acct-pw-toggle:hover { color: var(--text-primary); }
.acct-pw-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ── Activity card ──────────────────────────────────────────────────────── */
.acct-act-section { padding-top: 1.1rem; margin-top: 1.1rem; border-top: 1px solid var(--card-border); }
.acct-card-head + .acct-act-section { padding-top: 0; margin-top: 0; border-top: none; }
.acct-act-title {
    font-size: 0.8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-secondary); margin-bottom: 0.7rem;
}
.acct-streak {
    display: flex; align-items: center; gap: 0.75rem;
    background: var(--orange-light); border-radius: 12px; padding: 0.85rem 1rem;
}
.acct-streak svg { flex-shrink: 0; color: var(--link-on-card); }
.acct-streak-num { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); }
.acct-streak-label { font-size: 0.9375rem; color: var(--text-secondary); line-height: 1.4; }

.acct-cat-row {
    display: grid; grid-template-columns: auto 1fr auto auto auto; align-items: center;
    gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--card-border);
    font-size: 0.9375rem;
}
.acct-cat-row:last-child { border-bottom: none; }
.acct-cat-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--teal); }
.acct-cat-dot--memory { background: var(--teal); }
.acct-cat-dot--reaction { background: var(--orange); }
.acct-cat-dot--attention { background: var(--gold); }
.acct-cat-name { font-weight: 600; color: var(--text-primary); text-transform: capitalize; }
.acct-cat-stat { color: var(--text-secondary); white-space: nowrap; }
.acct-cat-stat b { color: var(--text-primary); font-weight: 700; }

.acct-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.8rem; }
.acct-chip {
    display: inline-flex; align-items: center;
    font-size: 0.8125rem; font-weight: 600;
    background: var(--teal-light); color: var(--teal-on-tint);
    border-radius: 999px; padding: 0.35rem 0.75rem;
}

.acct-tut-item {
    display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem;
    min-height: 44px; padding: 0.6rem 0.6rem; margin: 0 -0.6rem; border-radius: 10px;
    text-decoration: none; min-width: 0;
}
.acct-tut-item:hover { background: var(--orange-light); }
.acct-tut-prompt {
    font-size: 0.9375rem; color: var(--text-primary); font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.acct-tut-date { font-size: 0.8125rem; color: var(--text-secondary); flex-shrink: 0; }
.acct-empty { font-size: 0.9375rem; color: var(--text-secondary); padding: 0.3rem 0; }

/* ── Loading skeletons (only the three async sections keep one) ─────────── */
.acct-skel {
    border-radius: 8px; background: var(--border-color);
    position: relative; overflow: hidden; height: 0.95rem; margin-bottom: 0.85rem;
}
.acct-skel::after {
    content: ''; position: absolute; inset: 0; transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, var(--card-bg), transparent);
    opacity: 0.6; animation: acctShimmer 1.4s infinite;
}
.acct-skel--input { height: 2.35rem; border-radius: 10px; }
.acct-skel--half { width: 55%; }
@keyframes acctShimmer { to { transform: translateX(100%); } }

/* ── Delete my account (personal accounts only, last in the DOM) ────────── */
.acct-card--danger { border-color: rgba(231, 76, 60, .35); }
.acct-card--danger .acct-card-head h2 { color: var(--red-error); }
.acct-btn-danger { background: none; border: 2px solid var(--red-error); color: var(--red-on-card); border-radius: 12px; font-weight: 700; }
.acct-btn-danger:hover { background: rgba(231, 76, 60, .08); }
/* Literal white on purpose: --brand-on-primary can be flipped near-black by a
   white-label palette (main.css) and would be unreadable on --red-error. */
.acct-btn-danger--solid { background: var(--red-error); color: #fff; }
.acct-btn-danger--solid:hover { background: var(--red-error); opacity: 0.9; }
.acct-btn-danger:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Delete-account modal (two-step confirmation) ───────────────────────── */
.acct-modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0, 0, 0, .55);
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.acct-modal {
    background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: 18px; box-shadow: var(--card-shadow);
    width: 100%; max-width: 460px; padding: 1.75rem;
}
.acct-modal h3 { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.6rem; }
.acct-modal p { font-size: 1rem; color: var(--text-secondary); line-height: 1.55; }
.acct-modal-list { margin: 0.9rem 0 0; padding-left: 1.2rem; font-size: 0.95rem; color: var(--text-secondary); line-height: 1.7; }
.acct-modal-check {
    display: flex; align-items: flex-start; gap: 0.6rem; margin-top: 1.1rem; min-height: 44px;
    font-size: 0.95rem; color: var(--text-primary); font-weight: 600; cursor: pointer;
}
.acct-modal-check input { width: 22px; height: 22px; flex-shrink: 0; accent-color: var(--red-error); cursor: pointer; }
.acct-modal-actions { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1.4rem; }
.acct-modal-actions .acct-btn-primary,
.acct-modal-actions .acct-btn-danger,
.acct-modal-actions .acct-btn-ghost { width: 100%; padding: 0.85rem 1rem; font-size: 1rem; }
.acct-modal-error {
    display: none; background: rgba(231, 76, 60, .08); border: 1px solid rgba(231, 76, 60, .3);
    color: var(--red-on-card); border-radius: 10px; padding: 0.6rem 0.85rem;
    font-size: 0.9375rem; margin-top: 1rem;
}
.acct-modal-error.acct-visible { display: block; }

/* ── Subscription panel ─────────────────────────────────────────────────── */
.acct-sub-card { border-color: var(--card-border); }
/* Deep-link spotlight: the navbar Subscribe button lands on
   /account#subPanel and this pulse is what makes the landing visible. */
.acct-sub-card--spotlight { animation: acctSubSpotlight 2.4s ease; }
@keyframes acctSubSpotlight {
    0%, 60% { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-light); }
    100% { border-color: var(--card-border); box-shadow: none; }
}
.acct-sub-status {
    display: inline-flex; align-items: center; gap: 0.35rem; flex-shrink: 0;
    font-size: 0.8125rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; padding: 0.3rem 0.7rem; border-radius: 999px;
}
.acct-sub-status--active { background: var(--teal-light); color: var(--teal-on-tint); }
.acct-sub-status--trial { background: var(--orange-light); color: var(--link-on-card); }
.acct-sub-status--past_due { background: rgba(231, 76, 60, .12); color: var(--red-on-card); }
.acct-sub-status--inactive { background: var(--progress-bg); color: var(--text-secondary); }
.acct-sub-row { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.75rem 0; border-bottom: 1px solid var(--card-border); }
.acct-sub-row:last-of-type { border-bottom: none; }
.acct-sub-label { color: var(--text-secondary); font-weight: 600; font-size: 0.9375rem; }
.acct-sub-value { color: var(--text-primary); font-weight: 600; font-size: 1.0625rem; }
.acct-sub-value small { display: block; font-weight: 400; font-size: 0.8125rem; color: var(--text-secondary); }
.acct-sub-actions { display: flex; gap: 0.6rem; margin-top: 1rem; flex-wrap: wrap; }
.acct-sub-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    min-height: 44px; padding: 0.5rem 1.25rem; border-radius: 10px; font-weight: 600;
    font-size: 1rem; font-family: inherit; cursor: pointer; border: 1px solid transparent;
}
.acct-sub-btn--primary {
    background: linear-gradient(135deg, var(--orange), var(--orange-hover));
    color: var(--brand-on-primary); border: none;
}
.acct-sub-btn--primary:hover { opacity: 0.9; }
.acct-sub-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Plan picker (monthly / annual) ─────────────────────────────────────── */
.acct-plan-picker { margin-top: 1.1rem; }
.acct-plan-picker-lead { font-size: 0.9375rem; color: var(--text-secondary); margin: 0 0 0.75rem; }
.acct-plan-options { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.acct-plan-card {
    position: relative; display: flex; flex-direction: column; gap: 0.15rem; min-height: 44px;
    padding: 0.85rem; border-radius: 12px; border: 1.5px solid var(--card-border);
    background: var(--card-bg); text-align: left; cursor: pointer; font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.acct-plan-card:hover { border-color: var(--orange); box-shadow: var(--card-shadow-hover); }
.acct-plan-card:active { transform: translateY(1px); }
.acct-plan-card--recommended { border-color: var(--orange); background: linear-gradient(135deg, var(--orange-light), transparent); }
.acct-plan-name { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.acct-plan-price { font-size: 1.25rem; font-weight: 800; color: var(--text-primary); }
.acct-plan-price span { font-size: 0.8125rem; font-weight: 500; color: var(--text-secondary); }
.acct-plan-note { font-size: 0.8125rem; color: var(--text-secondary); }
.acct-plan-badge {
    position: absolute; top: -0.5rem; right: 0.6rem;
    background: var(--orange); color: var(--brand-on-primary);
    font-size: 0.8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
    padding: 0.2rem 0.5rem; border-radius: 999px;
}

/* ── Motion ─────────────────────────────────────────────────────────────── */
/* Reduced motion keeps the spotlight's MEANING (a static outline) rather than
   dropping it — the navbar deep link depends on the panel being findable. */
@media (prefers-reduced-motion: reduce) {
    .acct-meter-fill,
    .acct-avatar-opt,
    .acct-plan-card { transition: none; }
    .acct-skel::after { animation: none; }
    .acct-sub-card--spotlight { animation: none; outline: 3px solid var(--orange); }
}

/* ── Desktop: the two-column enhancement ────────────────────────────────── */
@media (min-width: 961px) {
    .acct-grid {
        display: grid;
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
        gap: 1.5rem; align-items: start;
    }
    /* Profile spans the three right-hand cards. If a FOURTH card is ever added
       to the right column, this span must grow with it. */
    .acct-card--profile  { grid-column: 1; grid-row: 1 / span 3; }
    .acct-card--activity,
    .acct-card--prefs,
    .acct-card--security { grid-column: 2; }
    .acct-card--sub,
    .acct-card--danger   { grid-column: 1 / -1; }
}

/* ── Tablet and phone ───────────────────────────────────────────────────── */
@media (max-width: 960px) {
    .acct-container { padding: 0 1rem; }
}
@media (max-width: 500px) {
    .acct-container { margin: 1.5rem auto 3rem; }
    .acct-card { padding: 1.15rem; }
    .acct-avatar { width: 52px; height: 52px; font-size: 1.3rem; }
    .acct-hero-info h1 { font-size: 1.5rem; }
    .acct-trial-banner { flex-wrap: wrap; }
    .acct-trial-link { margin-left: 0; }
    .acct-row-main { flex-basis: 100%; }
    .acct-row-btn { width: 100%; margin-left: 0; }
    .acct-row-lock { margin-left: 0; }
    .acct-row-actions .acct-btn-primary,
    .acct-row-actions .acct-btn-ghost { flex: 1 1 auto; }
    .acct-seg { display: grid; grid-template-columns: 1fr 1fr; }
    .acct-plan-options { grid-template-columns: 1fr; }
    .acct-cat-row { grid-template-columns: auto 1fr auto; row-gap: 0.15rem; }
    .acct-cat-stat--wide { grid-column: 2 / -1; }
}
