/* AveryQ family experience — design system for the app shell and the
   task-based screens (Home, Family, Documents, Reminders, Sharing & safety,
   Legacy, Ask, Import). Compact and calm: 14px base type on a token scale,
   12px cards, minimal elevation, 44px touch targets on touch screens.

   Palette = the public website's (index.html): warm ivory page, white cards,
   navy ink, brass-gold accent; Sora headings + Inter body. Dark mode is the
   website's navy with the same gold. Primary buttons are solid gold with navy
   text. Type is Inter throughout (see the tokens below). */

:root, :root[data-theme="light"] {
    --aq-bg: #f4f2ec;            /* site --bg */
    --aq-surface: #ffffff;       /* site --surface */
    --aq-surface-2: #faf8f2;     /* site --panel */
    --aq-line: #e6e1d6;
    --aq-line-strong: #d3ccbd;
    --aq-text: #141d2b;          /* site --ink */
    --aq-text-2: #3f4756;
    --aq-muted: #646b78;         /* site --body/--dim, darkened to pass 4.5:1 */
    --aq-accent: #b28a4c;        /* site --gold */
    --aq-accent-2: #c8a463;      /* site --gold-2 */
    --aq-accent-hover: #a07a3e;
    --aq-accent-soft: rgba(178,138,76,0.13);   /* site --gold-soft */
    --aq-accent-ink: #7d5f2c;    /* site --gold-d, a touch darker for text contrast */
    --aq-on-accent: #141d2b;     /* navy text on gold, as on the site */
    --aq-navy: #16223a;          /* site --navy */
    --aq-ok: #1f6b45;
    --aq-ok-soft: #e8f3ec;
    --aq-warn: #9a5b0e;
    --aq-warn-soft: #fbf0dc;
    --aq-danger: #a3302a;
    --aq-danger-soft: #f9e9e7;
    --aq-shadow: 0 1px 2px rgba(20,29,43,.05), 0 8px 22px rgba(20,29,43,.05);   /* site --sh-sm */
    --aq-shadow-lg: 0 24px 54px rgba(20,29,43,.13);                            /* site --sh */
    --aq-overlay: rgba(20,29,43,.45);
    --aq-font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --aq-font-head: 'Sora', 'Inter', system-ui, sans-serif;
}
:root[data-theme="dark"] {
    --aq-bg: #0e1524;
    --aq-surface: #16223a;       /* site --navy */
    --aq-surface-2: #1f2d49;     /* site --navy-2 */
    --aq-line: #2a3a58;
    --aq-line-strong: #3a4c6e;
    --aq-text: #f4f2ec;
    --aq-text-2: #d4d6dc;
    --aq-muted: #a3a9b5;
    --aq-accent: #c8a463;
    --aq-accent-2: #d6b67a;
    --aq-accent-hover: #d6b67a;
    --aq-accent-soft: rgba(200,164,99,0.16);
    --aq-accent-ink: #dcbf86;
    --aq-on-accent: #141d2b;
    --aq-navy: #0e1524;
    --aq-ok: #6fcf97;
    --aq-ok-soft: rgba(111,207,151,.13);
    --aq-warn: #e9b864;
    --aq-warn-soft: rgba(233,184,100,.14);
    --aq-danger: #f08a80;
    --aq-danger-soft: rgba(240,138,128,.13);
    --aq-shadow: 0 1px 2px rgba(0,0,0,.35);
    --aq-shadow-lg: 0 24px 54px rgba(0,0,0,.5);
    --aq-overlay: rgba(5,9,18,.65);
    --aq-font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --aq-font-head: 'Sora', 'Inter', system-ui, sans-serif;
}
/* ── Design tokens (build 2420) ───────────────────────────────────────────
   One typographic scale, one spacing scale, one radius/elevation set. Every
   component below reads these; screens never set their own sizes. Mobile
   values are redefined at the 768px breakpoint (not scaled proportionally). */
:root {
    /* Type scale */
    --fs-title: 24px;      /* page title */
    --fs-section: 18px;    /* section heading, dialog title */
    --fs-card: 15px;       /* card heading, list item title */
    --fs-body: 14px;       /* body text, inputs on desktop */
    --fs-meta: 12px;       /* secondary text, metadata, timestamps */
    --fs-label: 12px;      /* form labels, eyebrows, badges */
    --fs-button: 13px;
    --fs-nav: 11px;        /* bottom-tab labels */
    --fs-sidenav: 13px;    /* sidebar items (13px stays legible at desktop distance) */
    --fs-kpi: 26px;        /* large numbers */
    --fs-input: 14px;
    --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700;
    --lh-tight: 1.25; --lh-snug: 1.4; --lh-body: 1.5;
    /* Spacing (4px base) */
    --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px;
    /* Shape */
    --aq-radius: 12px; --radius-card: 12px; --radius-ctl: 8px; --radius-sm: 6px;
    /* Controls and icons */
    --ctl-h: 36px; --ctl-h-sm: 32px; --input-h: 38px; --row-h: 52px;
    --icon: 18px; --icon-sm: 16px; --icon-box: 34px;
    --aq-tap: 44px;
}
@media (max-width: 768px) {
    :root { --fs-title: 21px; --fs-section: 17px; --fs-card: 14px; --fs-label: 11px; --fs-nav: 10px; --fs-kpi: 22px; }
}
/* Touch screens: 44px targets, and 16px inputs (smaller makes iOS zoom the page). */
@media (pointer: coarse) {
    :root { --ctl-h: 44px; --ctl-h-sm: 40px; --input-h: 44px; --row-h: 56px; --fs-input: 16px; }
}
:root, :root[data-theme="light"] {
    --aq-shadow: 0 1px 2px rgba(20,29,43,.04);
    --aq-shadow-hover: 0 2px 10px rgba(20,29,43,.07);
    --aq-shadow-lg: 0 16px 40px rgba(20,29,43,.14);
    --aq-font-head: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
:root[data-theme="dark"] { --aq-shadow-hover: 0 2px 10px rgba(0,0,0,.4); --aq-font-head: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; }

.aq-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.aq-noscroll { overflow: hidden; }
.aq-grow { flex: 1; }
.aq-i { width: var(--icon); height: var(--icon); flex: none; display: inline-block; vertical-align: middle; }
.aq-i-sm { width: 14px; height: 14px; margin: -2px 2px 0; }
.aq-i-inline { width: var(--icon-sm); height: var(--icon-sm); margin-top: -3px; }

/* ── App shell: flat page, no decorative watermarks ───────────────────── */
body.aq-app, :root[data-theme] body.aq-app { background: var(--aq-bg) !important; color: var(--aq-text); font-size: var(--fs-body); line-height: var(--lh-body); }
body.aq-app::before, body.aq-app::after,
body.aq-app .container::before, body.aq-app .container::after,
body.aq-app .header::before, body.aq-app .header::after,
body.aq-app .sidebar::before, body.aq-app .sidebar::after,
body.aq-app .content-area::before, body.aq-app .content-area::after { content: none !important; display: none !important; }
body.aq-app .container { max-width: 1240px; padding: var(--sp-6) var(--sp-6) 48px; }
body.aq-app .main-content { grid-template-columns: 216px 1fr; gap: 28px; }

/* Header: a quiet full-width top bar */
body.aq-app .aq-header {
    position: sticky; top: 0; z-index: 50; margin: 0; max-width: none; border-radius: 0; border: none;
    border-bottom: 1px solid var(--aq-line); background: var(--aq-surface); box-shadow: none; min-height: 56px;
    padding: 8px max(24px, calc((100vw - 1240px) / 2 + 24px)); gap: var(--sp-4); overflow: visible; flex-wrap: nowrap;
}
body.aq-app .aq-header .header-logo { width: 30px; height: 30px; border-radius: 8px; }
body.aq-app .aq-header .header-title { font-size: 16px; font-weight: var(--fw-semibold); background: none; -webkit-text-fill-color: currentColor; color: var(--aq-text); letter-spacing: -0.01em; }
body.aq-app .aq-header .header-subtitle { color: var(--aq-muted); font-size: var(--fs-meta); }
.aq-header-search { flex: 1; max-width: 520px; margin: 0 auto; position: relative; display: flex; align-items: center; }
.aq-header-search-icon { position: absolute; left: 12px; color: var(--aq-muted); display: flex; pointer-events: none; }
.aq-header-search-icon .aq-i { width: var(--icon-sm); height: var(--icon-sm); }
.aq-header-search input { width: 100%; min-height: var(--input-h); padding: 8px 12px 8px 36px; border-radius: var(--radius-ctl); border: 1px solid var(--aq-line);
    background: var(--aq-surface-2); color: var(--aq-text); font: inherit; font-size: var(--fs-input); }
.aq-header-search input::placeholder { color: var(--aq-muted); }
.aq-header-search input:focus { background: var(--aq-surface); border-color: var(--aq-accent); outline: none; box-shadow: 0 0 0 3px var(--aq-accent-soft); }
.aq-header-actions { display: flex; gap: var(--sp-2); align-items: center; flex: none; }
body.aq-app .aq-header-actions .sync-status { font-size: var(--fs-meta); color: var(--aq-muted); background: none; border: none; padding: 0 4px; box-shadow: none; }
.aq-account-btn { display: inline-flex; align-items: center; gap: 6px; min-height: var(--ctl-h); padding: 2px 8px 2px 2px; border-radius: 999px; border: 1px solid var(--aq-line);
    background: var(--aq-surface); color: var(--aq-text); font: inherit; font-size: var(--fs-meta); cursor: pointer; }
.aq-account-btn:hover { border-color: var(--aq-line-strong); }
.aq-account-btn .aq-avatar { width: 30px; height: 30px; }
.aq-account-btn .aq-avatar .aq-i { width: var(--icon-sm); height: var(--icon-sm); }
.aq-plan-badge { font-size: 11px; font-weight: var(--fw-semibold); letter-spacing: .02em; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--aq-line-strong) !important; color: var(--aq-text-2) !important; }

/* Sidebar */
body.aq-app .aq-sidebar { background: none; border: none; box-shadow: none; padding: 0; position: sticky; top: 76px; border-radius: 0; overflow: visible; }
body.aq-app .aq-sidebar .menu-item { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 7px 10px; margin-bottom: 2px; border: none; border-left: 0 !important; border-radius: var(--radius-ctl);
    color: var(--aq-text-2); font-size: var(--fs-sidenav); font-weight: var(--fw-medium); background: none; }
body.aq-app .aq-sidebar .menu-item:hover { background: var(--aq-surface-2); color: var(--aq-text); border-radius: var(--radius-ctl); }
body.aq-app .aq-sidebar .menu-item.active { background: var(--aq-accent-soft); color: var(--aq-accent-ink); font-weight: var(--fw-semibold); border-radius: var(--radius-ctl); box-shadow: inset 2px 0 0 var(--aq-accent); }
body.aq-app .aq-sidebar .menu-item .aq-i { width: var(--icon-sm); height: var(--icon-sm); }
.aq-nav-ico { display: flex; color: inherit; }
body.aq-app .content-area { min-width: 0; }
body.aq-app .content-area:focus { outline: none; }

/* Menus */
.aq-menu-anchor { position: relative; }
.aq-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 99970; min-width: 240px; padding: var(--sp-1); border-radius: var(--radius-card); background: var(--aq-surface);
    border: 1px solid var(--aq-line); box-shadow: var(--aq-shadow-lg); display: grid; }
.aq-menu[hidden] { display: none; }
.aq-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--ctl-h); padding: 6px 10px; border-radius: var(--radius-sm); border: none; background: none;
    color: var(--aq-text); font: inherit; font-size: var(--fs-body); text-align: left; cursor: pointer; }
.aq-menu button span[data-icon] { color: var(--aq-muted); display: flex; }
.aq-menu button .aq-i { width: var(--icon-sm); height: var(--icon-sm); }
.aq-menu button:hover { background: var(--aq-surface-2); }
.aq-menu hr { border: none; height: 1px; background: var(--aq-line); margin: var(--sp-1); }
.aq-tabbar { display: none; }

/* ── Type ─────────────────────────────────────────────────────────────── */
.aq-h1 { font-size: var(--fs-title); line-height: var(--lh-tight); font-weight: var(--fw-semibold); color: var(--aq-text); margin: 0 0 var(--sp-1); letter-spacing: -0.015em; }
.aq-h2 { font-size: var(--fs-section); line-height: var(--lh-tight); font-weight: var(--fw-semibold); color: var(--aq-text); margin: 0 0 var(--sp-2); letter-spacing: -0.01em; }
.aq-h3 { font-size: var(--fs-card); line-height: var(--lh-snug); font-weight: var(--fw-semibold); color: var(--aq-text); margin: 0; }
.aq-lead { font-size: var(--fs-body); line-height: var(--lh-body); color: var(--aq-muted); margin: 0; max-width: 70ch; }
.aq-body { font-size: var(--fs-body); line-height: var(--lh-body); color: var(--aq-text-2); margin: var(--sp-1) 0; }
.aq-body strong { color: var(--aq-text); font-weight: var(--fw-semibold); }
.aq-muted { color: var(--aq-muted); font-size: var(--fs-body); line-height: var(--lh-body); }
.aq-small { font-size: var(--fs-meta); line-height: var(--lh-snug); }
.aq-ok { color: var(--aq-ok); font-weight: var(--fw-medium); font-size: var(--fs-body); }
.aq-warn { color: var(--aq-warn); }
.aq-err { color: var(--aq-danger); font-size: var(--fs-body); min-height: 18px; margin: var(--sp-1) 0; }
.aq-req { font-size: var(--fs-meta); color: var(--aq-muted); font-weight: var(--fw-regular); margin-left: 4px; }
.aq-opt { font-size: var(--fs-meta); color: var(--aq-muted); font-weight: var(--fw-regular); margin-left: 4px; }

/* ── Layout ───────────────────────────────────────────────────────────── */
.aq-page { max-width: 1000px; display: flex; flex-direction: column; gap: var(--sp-5); }
.aq-page-head, .aq-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--sp-3) var(--sp-4); flex-wrap: wrap; }
.aq-page-head > div > .aq-h1 + .aq-lead, .aq-hero .aq-h1 + .aq-lead { margin-top: 2px; }
.aq-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: var(--sp-4); }
.aq-card { background: var(--aq-surface); border: 1px solid var(--aq-line); border-radius: var(--radius-card); padding: var(--sp-4); box-shadow: var(--aq-shadow); }
.aq-card-head { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); flex-wrap: wrap; }
.aq-divider { height: 1px; background: var(--aq-line); margin: var(--sp-4) 0; }
.aq-callout { background: var(--aq-accent-soft); border: 1px solid transparent; border-radius: var(--radius-ctl); padding: var(--sp-3) var(--sp-4); margin-top: var(--sp-3); }
.aq-empty .aq-h3 { margin-bottom: var(--sp-1); }

/* ── Buttons & links ──────────────────────────────────────────────────── */
.aq-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--ctl-h); padding: 6px 14px; border-radius: var(--radius-ctl);
    border: 1px solid var(--aq-line-strong); background: var(--aq-surface); color: var(--aq-text); font: inherit; font-size: var(--fs-button); font-weight: var(--fw-semibold); line-height: 1.2; cursor: pointer;
    text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.aq-btn .aq-i { width: var(--icon-sm); height: var(--icon-sm); }
.aq-btn:hover { background: var(--aq-surface-2); }
.aq-btn:disabled { opacity: .55; cursor: not-allowed; }
.aq-btn-primary { background: var(--aq-accent); border-color: var(--aq-accent); color: var(--aq-on-accent); box-shadow: none; }
.aq-btn-primary:hover { background: var(--aq-accent-hover); border-color: var(--aq-accent-hover); }
.aq-btn-quiet { background: transparent; border-color: transparent; color: var(--aq-text-2); }
.aq-btn-quiet:hover { background: var(--aq-surface-2); }
.aq-btn-sm { min-height: var(--ctl-h-sm); padding: 4px 12px; font-size: var(--fs-meta); }
.aq-btn-danger-quiet { background: transparent; border-color: transparent; color: var(--aq-danger); }
.aq-btn-danger-quiet:hover { background: var(--aq-danger-soft); }
.aq-link { background: none; border: none; padding: 2px; color: var(--aq-accent-ink); font: inherit; font-size: var(--fs-button); font-weight: var(--fw-semibold); cursor: pointer;
    text-decoration: none; min-height: 28px; }
.aq-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.aq-icon-btn { width: var(--ctl-h); height: var(--ctl-h); border-radius: var(--radius-ctl); border: none; background: transparent; color: var(--aq-muted); cursor: pointer; flex: none;
    display: inline-flex; align-items: center; justify-content: center; }
.aq-icon-btn .aq-i { width: var(--icon); height: var(--icon); }
.aq-icon-btn:hover { background: var(--aq-surface-2); color: var(--aq-text); }
.aq-actions { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-5); flex-wrap: wrap; }
.aq-btn:focus-visible, .aq-link:focus-visible, .aq-chip:focus-visible, .aq-row:focus-visible, .aq-tile:focus-visible,
.aq-quick-btn:focus-visible, .aq-tab:focus-visible, .menu-item:focus-visible, .aq-icon-btn:focus-visible, .aq-person:focus-visible,
.aq-menu button:focus-visible, .aq-account-btn:focus-visible, .aq-big-option:focus-within {
    outline: 2px solid var(--aq-accent); outline-offset: 2px; }

.aq-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--sp-2) 0; }
.aq-chip { display: inline-flex; align-items: center; gap: 6px; min-height: var(--ctl-h-sm); padding: 4px 12px; border-radius: 999px; border: 1px solid var(--aq-line-strong);
    background: var(--aq-surface); color: var(--aq-text); font: inherit; font-size: var(--fs-button); font-weight: var(--fw-medium); cursor: pointer; }
.aq-chip .aq-i { width: var(--icon-sm); height: var(--icon-sm); color: var(--aq-muted); }
.aq-chip:hover { background: var(--aq-surface-2); }
.aq-chip.on, .aq-chip[aria-checked="true"] { background: var(--aq-accent-soft); border-color: var(--aq-accent); color: var(--aq-accent-ink); }
.aq-chip-strong { background: var(--aq-accent-soft); border-color: transparent; color: var(--aq-accent-ink); }
.aq-chip-strong:hover { background: var(--aq-accent-soft); border-color: var(--aq-accent); }
.aq-pill { display: inline-block; font-size: var(--fs-label); font-weight: var(--fw-medium); line-height: 1.5; padding: 0 8px; border-radius: 999px; background: var(--aq-accent-soft); color: var(--aq-accent-ink); vertical-align: middle; margin-left: 6px; }

/* ── Forms ────────────────────────────────────────────────────────────── */
.aq-label { display: block; font-size: var(--fs-label); font-weight: var(--fw-medium); color: var(--aq-text-2); margin: var(--sp-4) 0 6px; }
.aq-input { width: 100%; box-sizing: border-box; min-height: var(--input-h); padding: 7px 10px; border-radius: var(--radius-ctl); border: 1px solid var(--aq-line-strong);
    background: var(--aq-surface); color: var(--aq-text); font: inherit; font-size: var(--fs-input); }
.aq-input::placeholder { color: var(--aq-muted); }
.aq-input:focus { border-color: var(--aq-accent); outline: none; box-shadow: 0 0 0 3px var(--aq-accent-soft); }
select.aq-input option { background: var(--aq-surface); color: var(--aq-text); }
textarea.aq-input { min-height: 80px; resize: vertical; line-height: var(--lh-body); }
.aq-input-inline { width: auto; display: inline-block; min-height: var(--ctl-h); }
.aq-fieldset { border: none; padding: 0; margin: 0; }
.aq-check { display: flex; gap: var(--sp-2); align-items: flex-start; font-size: var(--fs-body); color: var(--aq-text-2); margin-top: var(--sp-3); line-height: var(--lh-snug); }
.aq-check[hidden] { display: none; }
.aq-check input { width: 16px; height: 16px; margin-top: 1px; flex: none; accent-color: var(--aq-accent); }
.aq-inline-setting { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; padding: var(--sp-3) var(--sp-4); }
.aq-inline-setting .aq-body { margin: 0; }

.aq-search { display: flex; gap: var(--sp-2); }
.aq-search input { flex: 1; min-width: 0; min-height: var(--input-h); padding: 7px 12px; border-radius: var(--radius-ctl); border: 1px solid var(--aq-line-strong);
    background: var(--aq-surface); color: var(--aq-text); font: inherit; font-size: var(--fs-input); }
.aq-search input:focus { border-color: var(--aq-accent); outline: none; box-shadow: 0 0 0 3px var(--aq-accent-soft); }
.aq-search-lg input { min-height: 44px; }
.aq-search .aq-btn { min-height: var(--input-h); }

/* ── Lists & rows ─────────────────────────────────────────────────────── */
.aq-list { list-style: none; margin: 0 calc(-1 * var(--sp-2)); padding: 0; }
.aq-list > li + li { border-top: 1px solid var(--aq-line); }
.aq-row { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: var(--row-h); padding: var(--sp-2); background: none; border: none;
    color: var(--aq-text); font: inherit; text-align: left; cursor: pointer; border-radius: var(--radius-ctl); }
.aq-row:hover { background: var(--aq-surface-2); }
.aq-row > span:last-child:not(.aq-badge) { color: var(--aq-muted); font-size: 16px; }
.aq-row-static { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 44px; padding: 6px var(--sp-2); font-size: var(--fs-body); color: var(--aq-text); }
.aq-row-icon { width: var(--icon-box); height: var(--icon-box); display: grid; place-items: center; flex: none; border-radius: var(--radius-ctl); background: var(--aq-accent-soft); color: var(--aq-accent-ink); }
.aq-row-icon .aq-i { width: var(--icon); height: var(--icon); }
.aq-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.aq-row-title { font-size: var(--fs-body); font-weight: var(--fw-medium); color: var(--aq-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aq-row-sub { font-size: var(--fs-meta); color: var(--aq-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aq-badge { flex: none; font-size: var(--fs-label); font-weight: var(--fw-medium); line-height: 1.5; padding: 1px 8px; border-radius: 999px; background: var(--aq-surface-2); color: var(--aq-text-2); white-space: nowrap; }
.aq-badge.soon { background: var(--aq-warn-soft); color: var(--aq-warn); }
.aq-badge.urgent, .aq-badge.overdue { background: var(--aq-danger-soft); color: var(--aq-danger); }
.aq-list > li:has(.aq-done-btn) { display: flex; align-items: center; gap: var(--sp-2); }
.aq-list > li:has(.aq-done-btn) > .aq-row { flex: 1; min-width: 0; width: auto; }
.aq-done-btn { flex: none; }
.aq-checks { list-style: none; padding: 0; margin: var(--sp-1) 0 var(--sp-2); display: grid; gap: var(--sp-2); font-size: var(--fs-body); line-height: var(--lh-body); color: var(--aq-text-2); }
.aq-checks li { display: flex; gap: 10px; align-items: flex-start; }
.aq-checks li > .aq-i { width: var(--icon-sm); height: var(--icon-sm); color: var(--aq-accent-ink); margin-top: 2px; }

.aq-meter { height: 6px; border-radius: 999px; background: var(--aq-surface-2); overflow: hidden; margin: var(--sp-2) 0; }
.aq-meter > span { display: block; height: 100%; border-radius: 999px; background: var(--aq-accent); transition: width .4s ease; }
.aq-score { font-size: var(--fs-kpi); font-weight: var(--fw-semibold); color: var(--aq-text); letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.aq-score small { font-size: var(--fs-meta); color: var(--aq-muted); font-weight: var(--fw-regular); }

.aq-details { margin-top: var(--sp-2); }
.aq-details > summary { cursor: pointer; color: var(--aq-accent-ink); font-weight: var(--fw-semibold); font-size: var(--fs-button); min-height: 32px; display: flex; align-items: center; list-style: none; }
.aq-details > summary::-webkit-details-marker { display: none; }
.aq-details > summary::after { content: '›'; margin-left: 6px; transition: transform .15s; display: inline-block; }
.aq-details[open] > summary::after { transform: rotate(90deg); }
.aq-details[open] > summary { margin-bottom: 6px; }
.aq-rules { list-style: none; padding: 0; margin: 6px 0 10px; display: grid; gap: 6px; }
.aq-rules li { display: grid; grid-template-columns: 18px 1fr auto; gap: var(--sp-2); font-size: var(--fs-body); color: var(--aq-text-2); align-items: start; }
.aq-rules li.ok > span:first-child { color: var(--aq-ok); font-weight: var(--fw-bold); }

.aq-steps { list-style: none; padding: 0; margin: var(--sp-2) 0; display: grid; gap: 2px; }
.aq-steps li { display: grid; grid-template-columns: 26px 1fr auto auto; align-items: center; gap: 10px; min-height: 44px; font-size: var(--fs-body); color: var(--aq-text); }
.aq-steps-plain li { align-items: start; padding: var(--sp-2) 0; }
.aq-steps li.done > span:nth-child(2), .aq-steps li.done .aq-step-link { color: var(--aq-muted); }
.aq-steps li.current .aq-step-link { color: var(--aq-text); font-weight: var(--fw-semibold); }
.aq-tick { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--aq-line-strong); font-size: 11px; font-weight: var(--fw-semibold); color: var(--aq-muted); background: var(--aq-surface); }
.aq-steps li.done .aq-tick { background: var(--aq-ok); border-color: var(--aq-ok); color: var(--aq-surface); }
.aq-step-link { text-align: left; color: var(--aq-text-2); font-weight: var(--fw-medium); }

/* ── Home ─────────────────────────────────────────────────────────────── */
.aq-hero { align-items: center; }
.aq-attention { border-left: 3px solid var(--aq-warn); }
.aq-attention .aq-row-icon { background: var(--aq-warn-soft); color: var(--aq-warn); }
.aq-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(172px, 100%), 1fr)); gap: var(--sp-3); }
/* Compact action cards: icon beside text, consistent height */
.aq-quick-btn { display: grid; grid-template-columns: var(--icon-box) 1fr; grid-template-rows: auto auto; column-gap: var(--sp-3); align-items: center; padding: var(--sp-3) 14px; min-height: 64px;
    border-radius: var(--radius-card); border: 1px solid var(--aq-line); background: var(--aq-surface); color: var(--aq-text); font: inherit; text-align: left; cursor: pointer; box-shadow: var(--aq-shadow);
    transition: border-color .15s, box-shadow .15s; }
/* Five across on wide screens: icon above, title, description clamped to two lines */
.aq-quick-btn { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; align-items: start; align-content: start; row-gap: 2px; padding: 14px; }
.aq-quick-btn > .aq-quick-icon { margin: 0 0 var(--sp-2); width: 32px; height: 32px; }
.aq-quick-btn > .aq-quick-sub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.aq-big-option { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-1); padding: 14px; min-height: 96px; border-radius: var(--radius-card);
    border: 1px solid var(--aq-line); background: var(--aq-surface); color: var(--aq-text); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s; }
.aq-quick-btn:hover, .aq-big-option:hover { border-color: var(--aq-line-strong); box-shadow: var(--aq-shadow-hover); }
.aq-quick-icon { width: var(--icon-box); height: var(--icon-box); border-radius: var(--radius-ctl); display: grid; place-items: center; background: var(--aq-accent-soft); color: var(--aq-accent-ink); margin-bottom: var(--sp-1); }
.aq-quick-icon .aq-i { width: var(--icon); height: var(--icon); }
.aq-quick-title { font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--aq-text); line-height: var(--lh-snug); }
.aq-quick-sub { font-size: var(--fs-meta); color: var(--aq-muted); line-height: var(--lh-snug); }
.aq-setup { border-left: 3px solid var(--aq-accent); }
.aq-next { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap; padding: var(--sp-1) 0 2px; }
.aq-next-label { font-size: 11px; font-weight: var(--fw-semibold); color: var(--aq-accent-ink); text-transform: uppercase; letter-spacing: .08em; }
.aq-next-title { font-size: var(--fs-card); font-weight: var(--fw-semibold); color: var(--aq-text); margin: 2px 0; }
.aq-people { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.aq-person { display: flex; flex-direction: column; align-items: center; gap: var(--sp-1); min-width: 68px; padding: var(--sp-2) var(--sp-1); border-radius: var(--radius-ctl); border: none;
    background: none; color: var(--aq-text); font: inherit; font-size: var(--fs-meta); font-weight: var(--fw-medium); cursor: pointer; }
.aq-person:hover { background: var(--aq-surface-2); }
.aq-person-add .aq-avatar { background: transparent; border: 1.5px dashed var(--aq-line-strong); color: var(--aq-muted); }
.aq-avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: var(--aq-accent-soft);
    color: var(--aq-accent-ink); font-weight: var(--fw-semibold); font-size: 13px; }
.aq-avatar-lg { width: 48px; height: 48px; font-size: 16px; }

/* ── Documents hub ────────────────────────────────────────────────────── */
.aq-areas { display: grid; gap: var(--sp-5); }
.aq-area .aq-h3 { margin-bottom: 2px; font-size: var(--fs-card); }
.aq-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--sp-3); margin-top: var(--sp-2); }
.aq-tile { display: grid; grid-template-columns: var(--icon-box) 1fr; column-gap: var(--sp-3); align-items: center; padding: var(--sp-3); min-height: 60px; border-radius: var(--radius-card);
    border: 1px solid var(--aq-line); background: var(--aq-surface); color: var(--aq-text); font: inherit; text-align: left; cursor: pointer; box-shadow: var(--aq-shadow); transition: border-color .15s, box-shadow .15s; }
.aq-tile:hover { border-color: var(--aq-line-strong); box-shadow: var(--aq-shadow-hover); }
.aq-tile-icon { grid-row: 1 / span 2; width: var(--icon-box); height: var(--icon-box); border-radius: var(--radius-ctl); display: grid; place-items: center; background: var(--aq-accent-soft); color: var(--aq-accent-ink); }
.aq-tile-icon .aq-i { width: var(--icon); height: var(--icon); }
.aq-tile.locked .aq-tile-icon { background: var(--aq-surface-2); color: var(--aq-muted); }
.aq-tile-label { grid-column: 2; font-size: var(--fs-body); font-weight: var(--fw-medium); color: var(--aq-text); line-height: var(--lh-snug); }
.aq-tile-count { grid-column: 2; font-size: var(--fs-meta); color: var(--aq-muted); }

/* ── Family ───────────────────────────────────────────────────────────── */
.aq-members { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: var(--sp-3); }
.aq-member { display: flex; flex-direction: column; gap: var(--sp-3); }
.aq-member-top { display: flex; gap: var(--sp-3); align-items: center; }
.aq-member-id { min-width: 0; }
.aq-facts { margin: 0; display: grid; gap: 6px; }
.aq-facts > div { display: grid; grid-template-columns: 96px 1fr; gap: var(--sp-2); font-size: var(--fs-body); }
.aq-facts dt { color: var(--aq-muted); font-size: var(--fs-meta); padding-top: 1px; }
.aq-facts dd { margin: 0; color: var(--aq-text-2); word-break: break-word; }
.aq-member-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }

/* ── Sharing ──────────────────────────────────────────────────────────── */
.aq-shares { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-2); }
.aq-share { padding: var(--sp-3) 14px; border-radius: var(--radius-ctl); border: 1px solid var(--aq-line); background: var(--aq-surface-2); }
.aq-share.ended { opacity: .65; }
.aq-share-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: var(--sp-2); }
.aq-stepper { display: flex; gap: 6px; margin-bottom: var(--sp-4); flex-wrap: wrap; }
.aq-stepper span { font-size: var(--fs-label); font-weight: var(--fw-medium); padding: 3px 10px; border-radius: 999px; background: var(--aq-surface-2); color: var(--aq-muted); }
.aq-stepper span.on { background: var(--aq-accent-soft); color: var(--aq-accent-ink); }
.aq-stepper span.done { color: var(--aq-ok); }
.aq-pick { list-style: none; padding: 0; margin: var(--sp-3) 0; display: grid; gap: var(--sp-2); }
.aq-pick > li { display: flex; align-items: center; gap: var(--sp-2); }
.aq-pick-row { flex: 1; display: flex; align-items: center; gap: var(--sp-3); min-height: 48px; padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-ctl); border: 1px solid var(--aq-line-strong); cursor: pointer; }
.aq-pick-row:hover { border-color: var(--aq-accent); }
.aq-pick-row input { width: 18px; height: 18px; flex: none; accent-color: var(--aq-accent); }
.aq-pick-row.disabled { opacity: .6; cursor: default; }
.aq-pick-row:has(input:checked) { border-color: var(--aq-accent); background: var(--aq-accent-soft); }
.aq-review { margin-top: var(--sp-4); }

/* ── Add flow & assistant ─────────────────────────────────────────────── */
.aq-add-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-2); margin: var(--sp-3) 0 var(--sp-1); }
.aq-big-option { box-shadow: none; }
.aq-add-results { margin-top: var(--sp-2); max-height: 360px; overflow-y: auto; padding: 0 var(--sp-2); }
.aq-suggest { margin: var(--sp-3) 0; background: var(--aq-accent-soft); border-color: transparent; box-shadow: none; }
.aq-answer { border-left: 3px solid var(--aq-accent); }
.aq-answer.suggest { border-left-color: var(--aq-warn); }
.aq-answer-kind { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: var(--fw-semibold); letter-spacing: .08em; text-transform: uppercase; color: var(--aq-muted); margin-bottom: var(--sp-1); }
.aq-legacy-step { border-left: 3px solid var(--aq-accent); padding: var(--sp-5); }

/* ── Modal & nudge ────────────────────────────────────────────────────── */
.aq-modal-wrap { position: fixed; inset: 0; z-index: 99990; background: var(--aq-overlay); display: flex; align-items: flex-start; justify-content: center;
    padding: 8vh 16px 24px; overflow-y: auto; }
.aq-modal { width: 100%; max-width: 540px; background: var(--aq-surface); color: var(--aq-text); border: 1px solid var(--aq-line); border-radius: var(--radius-card); box-shadow: var(--aq-shadow-lg); }
.aq-modal-head { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); padding: 14px 12px 0 var(--sp-5); }
.aq-modal-head .aq-h2 { margin: 0; font-size: var(--fs-section); }
.aq-modal-body { padding: var(--sp-1) var(--sp-5) var(--sp-5); }
.aq-nudge { position: fixed; right: 24px; bottom: 88px; z-index: 99980; width: min(380px, calc(100vw - 32px)); background: var(--aq-surface); color: var(--aq-text);
    border: 1px solid var(--aq-line); border-radius: var(--radius-card); padding: 14px var(--sp-4); box-shadow: var(--aq-shadow-lg); animation: aqUp .25s ease; }
.aq-nudge-x { position: absolute; top: 6px; right: 6px; }
.aq-nudge .aq-h3 { padding-right: 36px; color: var(--aq-ok); }
.aq-nudge-foot { margin-top: var(--sp-2); }
@keyframes aqUp { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .aq-nudge { animation: none; } .aq-meter > span { transition: none; } }

/* Shared (impersonation) view: only Home is meaningful in the tab bar. */
body.aq-guest .aq-tabbar .aq-tab:not([data-section="dashboard"]), body.aq-guest .aq-tabbar .aq-tab-more { display: none; }
body.aq-guest .aq-header-search { display: none; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    body.aq-app .aq-header { flex-wrap: wrap; }
    .aq-header-search { order: 3; flex-basis: 100%; max-width: none; }
    body.aq-app .aq-header-actions .sync-status { display: none; }
    body.aq-app .aq-sidebar { top: 116px; }
}
@media (max-width: 768px) {
    body.aq-app .aq-header { padding: 8px var(--sp-4); gap: var(--sp-2); }
    body.aq-app .aq-header .header-subtitle { display: none; }
    .aq-hide-sm { display: none !important; }
    body.aq-app .aq-header .aq-add-btn { display: none; }
    body.aq-app .aq-sidebar { display: none !important; }
    body.aq-app .main-content { display: block !important; }
    body.aq-app .container { padding: var(--sp-4) var(--sp-4) calc(96px + env(safe-area-inset-bottom)) !important; }
    .aq-tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 9990; background: var(--aq-surface);
        border-top: 1px solid var(--aq-line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
    .aq-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; min-height: 52px; border: none; background: none;
        color: var(--aq-muted); font: inherit; font-size: var(--fs-nav); font-weight: var(--fw-medium); letter-spacing: .01em; cursor: pointer; border-radius: var(--radius-ctl); }
    .aq-tab > span { display: flex; }
    .aq-tab .aq-i { width: 20px; height: 20px; }
    .aq-tab.active { color: var(--aq-accent-ink); font-weight: var(--fw-semibold); }
    .aq-tab-add > span { width: 40px; height: 40px; border-radius: 50%; display: grid !important; place-items: center; background: var(--aq-accent); color: var(--aq-on-accent); }
    .aq-tab-more { display: flex; }
    .aq-menu-up { top: auto; bottom: calc(100% + 8px); right: 4px; }
    .aq-card { padding: 14px; }
    .aq-page { gap: var(--sp-4); }
    .aq-page-head > .aq-btn { width: 100%; }
    .aq-big-option { min-height: 0; padding: var(--sp-3); }
    .aq-big-option .aq-quick-sub { display: none; }
    .aq-modal-wrap { padding: 0; align-items: flex-end; }
    .aq-modal { border-radius: 14px 14px 0 0; max-height: 94vh; overflow-y: auto; }
    .aq-modal-body { padding: var(--sp-1) var(--sp-4) var(--sp-5); }
    .aq-modal-head { padding: var(--sp-3) var(--sp-2) 0 var(--sp-4); }
    .aq-nudge { right: 12px; left: 12px; width: auto; bottom: calc(76px + env(safe-area-inset-bottom)); }
    .aq-members { grid-template-columns: 1fr; }
    .aq-steps li { grid-template-columns: 26px 1fr auto; }
    .aq-steps li > .aq-btn { grid-column: 2 / -1; justify-self: start; }
    .aq-row-main, .aq-page, .aq-card { min-width: 0; }
    .aq-quick { grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
    .aq-quick-btn { grid-template-columns: 1fr; padding: var(--sp-3); min-height: 0; align-content: start; }
    .aq-quick-btn > .aq-quick-icon { grid-row: auto; margin-bottom: 6px; width: 30px; height: 30px; }
    .aq-quick-btn > .aq-quick-sub { display: none; }
    .aq-quick-btn:last-child:nth-child(odd) { grid-column: 1 / -1; grid-template-columns: 30px 1fr; align-items: center; }
    .aq-quick-btn:last-child:nth-child(odd) > .aq-quick-icon { margin: 0 var(--sp-3) 0 0; }
    .aq-tiles { grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
    .aq-tile { grid-template-columns: 1fr; padding: var(--sp-3); }
    .aq-tile-icon { grid-row: auto; margin-bottom: 6px; width: 30px; height: 30px; }
    .aq-tile-label, .aq-tile-count { grid-column: 1; }
}

/* ── Older inner pages (category lists, profile, upgrade panel) ──────────
   They render with inline styles from app.js; align their headings, inputs
   and panels with this design system so the whole app reads as one. */
body.aq-app #contentArea .section-title { background: none; -webkit-text-fill-color: currentColor; color: var(--aq-text); font-size: var(--fs-title) !important; font-weight: var(--fw-semibold) !important; letter-spacing: -0.015em; }
body.aq-app #contentArea select, body.aq-app #contentArea input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]), body.aq-app #contentArea textarea {
    background: var(--aq-surface) !important; color: var(--aq-text) !important; border: 1px solid var(--aq-line-strong) !important; border-radius: var(--radius-ctl) !important; font-size: var(--fs-input) !important; }
body.aq-app #contentArea select option { background: var(--aq-surface); color: var(--aq-text); }
body.aq-app #contentArea select:focus, body.aq-app #contentArea input:focus, body.aq-app #contentArea textarea:focus { border-color: var(--aq-accent) !important; box-shadow: 0 0 0 3px var(--aq-accent-soft) !important; outline: none; }
body.aq-app #contentArea .dashboard-card { background: var(--aq-surface); border: 1px solid var(--aq-line); box-shadow: var(--aq-shadow); border-radius: var(--radius-card) !important; }
body.aq-app #contentArea .dashboard-card-value { font-size: var(--fs-kpi); font-weight: var(--fw-semibold); letter-spacing: -0.02em; }
body.aq-app .login-title { font-size: var(--fs-title); font-weight: var(--fw-semibold); letter-spacing: -0.015em; }
body.aq-app .sv-logo { font-size: var(--fs-section); font-weight: var(--fw-semibold); }
body.aq-app .sv-label { font-size: var(--fs-card); font-weight: var(--fw-medium); }
body.aq-app .sv-section-title { font-size: var(--fs-card); font-weight: var(--fw-semibold); }

/* ── Typography: Inter throughout ─────────────────────────────────────── */
:root { --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; --font-heading: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; }
body.aq-app { font-family: var(--aq-font-body); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body.aq-app button, body.aq-app input, body.aq-app select, body.aq-app textarea { font-family: inherit; }
.aq-h1, .aq-h2, .aq-hero .aq-h1, .aq-next-title, .aq-score, body.aq-app .header-title, body.aq-app #contentArea .section-title { font-family: var(--aq-font-head); }

/* ── Website palette for the older screens ──────────────────────────────
   Sign-in, category lists, profile, share dialogs and the shared view are
   drawn by app.js with inline styles. They read the theme tokens below, so
   remapping those tokens re-colours them; the remaining hard-coded blues are
   caught by attribute selectors so the whole app speaks the site's palette. */
:root, :root[data-theme="light"], :root[data-theme="dark"] {
    --color-primary: #b28a4c;
    --color-primary-light: #c8a463;
    --color-secondary: #8a6a34;
    --color-success: #1f6b45;
    --gradient-primary: linear-gradient(135deg, #c8a463 0%, #b28a4c 100%);
}
:root[data-theme="light"] {
    --color-bg-primary: #f4f2ec; --color-bg-secondary: #ffffff; --color-surface: #ffffff; --color-surface-hover: #faf8f2; --color-bg-elevated: #faf8f2;
    --color-text-primary: #141d2b; --color-text-secondary: #3f4756; --color-text-muted: #646b78;
    --c-0f172a: #f4f2ec; --c-1e293b: #ffffff; --c-334155: #e6e1d6; --c-475569: #646b78; --c-64748b: #646b78;
    --c-94a3b8: #646b78; --c-cbd5e1: #3f4756; --c-e2e8f0: #141d2b; --c-f1f5f9: #141d2b; --c-f8fafc: #141d2b; --c-white: #141d2b;
    --c-93c5fd: #7d5f2c; --c-a78bfa: #7d5f2c;
}
:root[data-theme="dark"] {
    --color-bg-primary: #0e1524; --color-bg-secondary: #16223a; --color-surface: #16223a; --color-surface-hover: #1f2d49; --color-bg-elevated: #1f2d49;
    --color-text-primary: #f4f2ec; --color-text-secondary: #d4d6dc; --color-text-muted: #a3a9b5;
    --c-0f172a: #0e1524; --c-1e293b: #16223a; --c-334155: #2a3a58; --c-475569: #8a92a2; --c-64748b: #9aa1ae;
    --c-94a3b8: #a3a9b5; --c-cbd5e1: #d4d6dc; --c-e2e8f0: #f4f2ec; --c-93c5fd: #dcbf86; --c-a78bfa: #dcbf86;
    --gradient-surface: linear-gradient(135deg, #16223a 0%, #1f2d49 100%);
}

/* Sign-in screen */
body.aq-app .login-screen { background: var(--aq-bg); }
body.aq-app .login-card { background: var(--aq-surface); border: 1px solid var(--aq-line); box-shadow: var(--aq-shadow-lg); }
body.aq-app .login-card::before, body.aq-app .login-card::after { content: none; }
body.aq-app .login-card .security-info { background: var(--aq-accent-soft); border-color: transparent; }
body.aq-app .login-card .security-info strong { color: var(--aq-accent-ink); }
body.aq-app .theme-fab { background: var(--aq-surface); color: var(--aq-text); border-color: var(--aq-line); }

/* Hard-coded blues → gold. Buttons with a blue fill become the site's gold
   button (navy text); blue-tinted panels become gold-tinted; blue text becomes
   the deep gold used for links on the site. */
body.aq-app [style*="rgba(59,130,246" i], body.aq-app [style*="rgba(59, 130, 246" i],
body.aq-app [style*="rgba(99,102,241" i], body.aq-app [style*="rgba(139,92,246" i] {
    background-color: var(--aq-accent-soft) !important; border-color: rgba(178,138,76,.35) !important; }
body.aq-app [style*="color:#3b82f6" i], body.aq-app [style*="color: #3b82f6" i],
body.aq-app [style*="color:#60a5fa" i], body.aq-app [style*="color: #60a5fa" i],
body.aq-app [style*="color:#2563eb" i], body.aq-app [style*="color:#818cf8" i], body.aq-app [style*="color:#a78bfa" i],
body.aq-app [style*="color: #175DDC" i] { color: var(--aq-accent-ink) !important; }
body.aq-app [style*="#3b82f6, #2563eb" i], body.aq-app [style*="#3b82f6,#2563eb" i], body.aq-app [style*="#3b82f6 0%" i],
body.aq-app [style*="#1e40af,#1d4ed8" i], body.aq-app [style*="background: #175DDC" i], body.aq-app [style*="background:#3b82f6" i],
body.aq-app [style*="var(--gradient-primary)" i], body.aq-app .google-signin-btn, body.aq-app .logout-btn, body.aq-app .share-copy-btn {
    background: linear-gradient(135deg, #c8a463, #b28a4c) !important; color: #141d2b !important; border-color: transparent !important; }
body.aq-app [style*="accent-color:#3b82f6" i], body.aq-app input[type="checkbox"], body.aq-app input[type="radio"] { accent-color: #b28a4c !important; }
/* Other off-brand button fills (amber, indigo, violet, deep blue, green) → the
   one brand accent. Destructive red keeps its colour. */
body.aq-app [style*="#f59e0b,#d97706" i], body.aq-app [style*="#6366f1,#4f46e5" i], body.aq-app [style*="#4f46e5,#7c3aed" i],
body.aq-app [style*="#1e3a8a,#1e40af" i], body.aq-app [style*="#22c55e,#16a34a" i] {
    background: var(--aq-accent) !important; color: var(--aq-on-accent) !important; border-color: transparent !important; box-shadow: none !important; }
/* Legacy panels and buttons drawn with inline styles → card and button tokens. */
body.aq-app #contentArea div[style*="border-radius:16px"][style*="padding:28px"] {
    background: var(--aq-surface) !important; border: 1px solid var(--aq-line) !important; border-radius: var(--radius-card) !important;
    padding: var(--sp-5) !important; box-shadow: var(--aq-shadow); margin-bottom: var(--sp-4) !important; }
body.aq-app #contentArea button[style*="linear-gradient"], body.aq-app #contentArea button[style*="padding:12px"], body.aq-app #contentArea button[style*="padding: 12px"] {
    font-size: var(--fs-button) !important; font-weight: var(--fw-semibold) !important; min-height: var(--ctl-h); padding: 6px 16px !important; border-radius: var(--radius-ctl) !important; box-shadow: none !important; }
body.aq-app #contentArea label[style*="text-transform:uppercase"] { font-size: 11px !important; letter-spacing: .06em !important; color: var(--aq-muted) !important; }
body.aq-app #contentArea div[style*="border-radius:16px"][style*="padding:28px"] input:not([type="checkbox"]):not([type="radio"]) { min-height: var(--input-h); padding: 7px 10px !important; }
.aq-label-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 20px; }
.aq-label-row .aq-conf, .aq-label-row .aq-small { margin: 0; }
body.aq-app .menu-item.active { border-left-color: var(--aq-accent); }
body.aq-app .share-tag { background: var(--aq-accent-soft); color: var(--aq-accent-ink); }


/* ═══════════ Renewals, navigation, mobile & PWA (build 2418) ═══════════ */
:root { --aq-u-red: #b3261e; --aq-u-red-soft: #fbe9e7; --aq-u-orange: #b54708; --aq-u-orange-soft: #fdeee2;
        --aq-u-amber: #8a6100; --aq-u-amber-soft: #fbf3d9; --aq-u-green: #1f6b45; --aq-u-green-soft: #e6f3ec;
        --aq-tabbar-h: 62px; }
:root[data-theme="dark"] { --aq-u-red: #f2a39c; --aq-u-red-soft: rgba(179,38,30,.22); --aq-u-orange: #f6b27c; --aq-u-orange-soft: rgba(181,71,8,.22);
        --aq-u-amber: #f0cf74; --aq-u-amber-soft: rgba(138,97,0,.25); --aq-u-green: #8fd3ad; --aq-u-green-soft: rgba(31,107,69,.25); }

/* Layout column: page bar above the content */
body.aq-app .aq-main-col { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.aq-pagebar { display: flex; align-items: center; gap: var(--sp-2); min-height: 44px; }
.aq-pagebar[hidden] { display: none; }
.aq-pagebar-title { flex: 1; min-width: 0; margin: 0; font: var(--fw-semibold) var(--fs-card)/1.3 var(--aq-font-head); color: var(--aq-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aq-pagebar .aq-icon-btn { min-width: var(--ctl-h); min-height: var(--ctl-h); border-radius: var(--radius-ctl); }
.aq-pagebar .aq-icon-btn .aq-i { width: var(--icon); height: var(--icon); }
.aq-pagebar-back .aq-i { transform: rotate(180deg); }
.aq-pagebar-actions { display: flex; gap: 6px; }
/* Desktop: the page's own H1 is the title; the bar only carries Back and Home */
@media (min-width: 769px) { .aq-pagebar-title { visibility: hidden; } .aq-pagebar { min-height: 32px; margin: -8px 0 -10px; } .aq-pagebar .aq-icon-btn { width: 32px; height: 32px; min-width: 32px; min-height: 32px; } }

/* Nav badges */
.aq-navbadge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--aq-u-red); color: #fff;
    font-size: 10.5px; font-weight: var(--fw-semibold); display: inline-grid; place-items: center; line-height: 1; }
.aq-tab { position: relative; }
.aq-tab .aq-navbadge { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; }

/* Urgency colours (green > 90 days, amber 30-90, orange 7-30, red < 7 or overdue) */
.aq-u-red { --u: var(--aq-u-red); --u-soft: var(--aq-u-red-soft); }
.aq-u-orange { --u: var(--aq-u-orange); --u-soft: var(--aq-u-orange-soft); }
.aq-u-amber { --u: var(--aq-u-amber); --u-soft: var(--aq-u-amber-soft); }
.aq-u-green { --u: var(--aq-u-green); --u-soft: var(--aq-u-green-soft); }
.aq-u-grey { --u: var(--aq-muted); --u-soft: var(--aq-surface-2); }
.aq-pill.aq-u-red, .aq-pill.aq-u-orange, .aq-pill.aq-u-amber, .aq-pill.aq-u-green, .aq-pill.aq-u-grey { background: var(--u-soft); color: var(--u); margin-left: 0; }

/* Renewals dashboard */
.aq-head-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.aq-ren-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
.aq-ren-stat { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-1); padding: var(--sp-3) 14px; min-height: 0; border-radius: var(--radius-card); cursor: pointer;
    border: 1px solid var(--aq-line); background: var(--aq-surface); color: var(--aq-muted); font: inherit; font-size: var(--fs-meta); font-weight: var(--fw-medium); text-align: left; box-shadow: var(--aq-shadow); }
.aq-ren-stat-n { font: var(--fw-semibold) var(--fs-kpi)/1 var(--aq-font-head); color: var(--u); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.aq-ren-stat:hover { border-color: var(--u); }
.aq-ren-tools { display: flex; flex-direction: column; gap: var(--sp-3); }
.aq-seg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.aq-seg::-webkit-scrollbar { display: none; }
.aq-seg-b { flex: none; min-height: var(--ctl-h-sm); padding: 0 12px; border-radius: 999px; border: 1px solid var(--aq-line); background: var(--aq-surface); color: var(--aq-text-2);
    font: inherit; font-size: var(--fs-button); font-weight: var(--fw-medium); cursor: pointer; white-space: nowrap; }
.aq-seg-b.on { background: var(--aq-navy); color: #fff; border-color: var(--aq-navy); }
:root[data-theme="dark"] .aq-seg-b.on { background: var(--aq-accent); color: var(--aq-on-accent); border-color: var(--aq-accent); }
.aq-seg-n { opacity: .7; font-weight: var(--fw-regular); margin-left: 2px; font-variant-numeric: tabular-nums; }
.aq-err-inline { color: var(--aq-danger); }
.aq-ren-card { padding: var(--sp-1); }
.aq-ren-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.aq-ren-list > li + li { border-top: 1px solid var(--aq-line); }
.aq-ren { width: 100%; display: grid; grid-template-columns: 8px 1fr auto; gap: var(--sp-3); align-items: center; padding: 10px var(--sp-3); min-height: var(--row-h);
    border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: var(--radius-ctl); }
.aq-ren:hover, .aq-ren:focus-visible { background: var(--aq-surface-2); }
.aq-ren-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--u); box-shadow: 0 0 0 3px var(--u-soft); }
.aq-ren-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.aq-ren-title { font-size: var(--fs-body); font-weight: var(--fw-medium); color: var(--aq-text); overflow-wrap: anywhere; }
.aq-ren-meta { font-size: var(--fs-meta); color: var(--aq-muted); }
.aq-ren-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.aq-ren-days { font-size: var(--fs-meta); color: var(--aq-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.aq-ren-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.aq-ren-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--sp-2); margin-top: var(--sp-4); }
.aq-ren-actions .aq-btn { justify-content: center; }
.aq-dl { display: grid; grid-template-columns: minmax(110px, 36%) 1fr; gap: 6px var(--sp-3); margin: var(--sp-3) 0; font-size: var(--fs-body); }
.aq-dl dt { color: var(--aq-muted); font-size: var(--fs-meta); padding-top: 1px; }
.aq-dl dd { margin: 0; color: var(--aq-text); overflow-wrap: anywhere; }
.aq-masked { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.aq-grid2 > div > .aq-input { width: 100%; }
.aq-center { text-align: center; }
.aq-empty-ill { width: 44px; height: 44px; border-radius: var(--radius-card); display: grid; place-items: center; background: var(--aq-accent-soft); color: var(--aq-accent-ink); margin-bottom: 8px; }
.aq-empty-ill .aq-i { width: 22px; height: 22px; }

/* Skeletons and progress */
.aq-skel { border-radius: var(--radius-ctl); background: linear-gradient(90deg, var(--aq-surface-2) 25%, var(--aq-line) 50%, var(--aq-surface-2) 75%); background-size: 200% 100%; animation: aq-shimmer 1.3s infinite linear; }
.aq-skel-row { height: 44px; margin: var(--sp-2) 0; }
.aq-skel-title { height: 24px; width: 45%; margin-bottom: var(--sp-3); }
@keyframes aq-shimmer { to { background-position: -200% 0; } }
.aq-progress { height: 6px; border-radius: 999px; background: var(--aq-surface-2); overflow: hidden; }
.aq-progress > span { display: block; height: 100%; width: 40%; border-radius: inherit; background: var(--aq-accent); animation: aq-indet 1.1s infinite ease-in-out; }
@keyframes aq-indet { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* Documents: all-documents grid */
.aq-chips-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; margin: 6px 0 10px; }
.aq-chips-scroll::-webkit-scrollbar { display: none; }
.aq-chips-scroll .aq-chip { flex: none; }
.aq-doc-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: var(--sp-2); }
.aq-doc-card { width: 100%; height: 100%; display: flex; align-items: center; gap: var(--sp-3); padding: 10px var(--sp-3); min-height: 56px; border: 1px solid var(--aq-line); border-radius: var(--radius-ctl);
    background: var(--aq-surface); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.aq-doc-card:hover, .aq-doc-card:focus-visible { border-color: var(--aq-line-strong); box-shadow: var(--aq-shadow-hover); }
.aq-doc-card .aq-row-main { flex: 1; }
.aq-doc-grid > li, .aq-ren-list > li { min-width: 0; }
.aq-doc-card .aq-row-main { min-width: 0; }
.aq-doc-card .aq-row-title, .aq-doc-card .aq-row-sub { overflow-wrap: anywhere; }
#aqAllDocs, .aq-ren-tools { min-width: 0; max-width: 100%; }
.aq-chips-scroll, .aq-seg { max-width: 100%; }

/* Upload previews */
.aq-previews { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.aq-preview { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-meta); color: var(--aq-muted); min-width: 0; }
.aq-preview img, .aq-preview-doc { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius-ctl); border: 1px solid var(--aq-line); background: var(--aq-surface-2); }
.aq-preview-doc { display: grid; place-items: center; color: var(--aq-accent-ink); }
.aq-preview-doc .aq-i { width: 24px; height: 24px; }
.aq-preview-name { color: var(--aq-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aq-only-touch { display: none; }
@media (pointer: coarse) { .aq-only-touch { display: flex; } }

/* Profile hub */
.aq-me-head { display: flex; align-items: center; gap: var(--sp-4); }
.aq-avatar-lg { flex: none; }

/* Floating Add (mobile) and network bar */
.aq-fab { display: none; }
.aq-netbar { position: fixed; left: 50%; transform: translateX(-50%); top: calc(10px + env(safe-area-inset-top)); z-index: 99990; max-width: calc(100% - 32px);
    padding: var(--sp-2) var(--sp-4); border-radius: 999px; background: var(--aq-navy); color: #fff; font-size: var(--fs-meta); font-weight: var(--fw-medium); box-shadow: var(--aq-shadow-lg); }
.aq-netbar[data-state="on"] { background: var(--aq-ok); }
.aq-netbar[hidden] { display: none; }

/* Touch targets and gentle page transitions */
/* Touch sizes come from the tokens (--ctl-h, --input-h, --row-h under pointer: coarse). */
body.aq-app #contentArea > .aq-page { animation: aq-page-in .22s ease-out; }
@keyframes aq-page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.aq-sheet .aq-modal { animation: aq-sheet-in .24s cubic-bezier(.2,.8,.2,1); }
@keyframes aq-sheet-in { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    body.aq-app #contentArea > .aq-page, .aq-sheet .aq-modal, .aq-skel, .aq-progress > span { animation: none !important; }
}

@media (max-width: 768px) {
    .aq-pagebar { position: sticky; top: 0; z-index: 50; margin: calc(-1 * var(--sp-4)) calc(-1 * var(--sp-4)) 0; padding: 4px var(--sp-2); background: var(--aq-bg); border-bottom: 1px solid var(--aq-line); }
    .aq-tabbar { grid-template-columns: repeat(5, 1fr); }
    .aq-fab { display: grid; place-items: center; position: fixed; right: 16px; bottom: calc(var(--aq-tabbar-h) + 14px + env(safe-area-inset-bottom)); z-index: 9991;
        width: 52px; height: 52px; border-radius: 16px; border: 0; cursor: pointer; color: var(--aq-on-accent);
        background: var(--aq-accent); box-shadow: 0 6px 16px rgba(20,29,43,.22); }
    .aq-fab .aq-i { width: 22px; height: 22px; }
    body.aq-guest .aq-fab, body.aq-noscroll .aq-fab { display: none; }
    body.aq-app .container { padding-bottom: calc(var(--aq-tabbar-h) + 90px + env(safe-area-inset-bottom)) !important; }
    .aq-ren-summary { gap: var(--sp-2); }
    .aq-ren-stat { padding: 10px var(--sp-3); }
    .aq-ren { grid-template-columns: 8px 1fr; padding: 10px var(--sp-2); }
    .aq-ren-side { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; gap: var(--sp-2); }
    .aq-ren-actions { grid-template-columns: 1fr; }
    .aq-head-actions { width: 100%; }
    .aq-head-actions .aq-btn { flex: 1; justify-content: center; }
    .aq-doc-grid { grid-template-columns: 1fr; }
    .aq-dl { grid-template-columns: 1fr; gap: 2px; }
    .aq-dl dd { margin-bottom: 8px; }
    .aq-sheet .aq-modal { max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
}
@media (max-width: 360px) {
    .aq-ren-stat span:last-child { font-size: 11px; }
    .aq-tab { letter-spacing: 0; padding: 0 1px; }
}
/* Phones: the page bar carries the title, so the in-page H1 is kept for screen readers only. */
@media (max-width: 768px) {
    body.aq-has-pagebar #contentArea .aq-page-head .aq-h1, body.aq-has-pagebar #contentArea .aq-page > .aq-h1:first-child {
        position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}


/* ═══════════ Smart Import (build 2419) ═══════════ */
.aq-src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: var(--sp-3); margin-top: var(--sp-3); }
.aq-src { display: flex; flex-direction: column; border: 1px solid var(--aq-line); border-radius: var(--radius-card); background: var(--aq-surface); box-shadow: var(--aq-shadow); min-width: 0; }
.aq-src.off { opacity: .72; }
.aq-src-main { display: flex; align-items: center; gap: var(--sp-3); padding: 14px; min-height: 64px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: var(--radius-card) var(--radius-card) 0 0; }
.aq-src-main .aq-quick-icon { margin: 0; }
.aq-src-main:hover, .aq-src-main:focus-visible { background: var(--aq-surface-2); }
.aq-src-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.aq-src-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--sp-3); padding: 0 14px var(--sp-3); min-height: 4px; }
.aq-src-foot:empty { padding: 0; }
.aq-badge-ok { background: var(--aq-ok-soft); color: var(--aq-ok); }
.aq-imp-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.aq-imp-stats .aq-ren-stat { cursor: default; box-shadow: none; }
.aq-imp-bar { position: sticky; bottom: var(--sp-3); z-index: 20; display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); padding: 10px 14px;
    background: var(--aq-surface); border: 1px solid var(--aq-line); border-radius: var(--radius-card); box-shadow: var(--aq-shadow-lg); }
.aq-imp-failed { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* Browse */
.aq-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: var(--sp-2); color: var(--aq-muted); font-size: var(--fs-meta); }
.aq-browse-tools { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.aq-files { list-style: none; margin: 0; padding: 0; }
.aq-file { display: flex; align-items: center; gap: 10px; padding: 4px 0; border-top: 1px solid var(--aq-line); min-width: 0; }
.aq-file:first-child { border-top: 0; }
.aq-file.excluded { opacity: .5; }
.aq-file-chk { width: 16px; height: 16px; flex: none; margin: 0 6px; accent-color: var(--aq-accent); }
.aq-file-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) 6px; min-height: var(--row-h); border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 10px; }
.aq-file-main:hover { background: var(--aq-surface-2); }
.aq-file-main .aq-row-main { min-width: 0; }
.aq-file-main .aq-row-title { overflow-wrap: anywhere; }

/* Review */
.aq-rv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.aq-rv { background: var(--aq-surface); border: 1px solid var(--aq-line); border-radius: var(--radius-card); padding: var(--sp-4); box-shadow: var(--aq-shadow); min-width: 0; }
.aq-rv-head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); min-width: 0; }
.aq-rv-head .aq-row-main { flex: 1; min-width: 0; }
.aq-rv-head .aq-row-title { overflow-wrap: anywhere; }
.aq-rv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-2); }
.aq-rv-grid .aq-label { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.aq-rv-grid .aq-label .aq-conf, .aq-rv-grid .aq-label .aq-small { align-self: flex-start; }
.aq-rv-grid .aq-input { width: 100%; }
.aq-rv-dupe { border: 1px solid var(--aq-warn); background: var(--aq-warn-soft); border-radius: var(--radius-ctl); padding: var(--sp-2) var(--sp-3); margin: var(--sp-3) 0; }
.aq-rv-dupe legend { padding: 0 4px; }
.aq-rv-why { margin: var(--sp-2) 0 0; padding-left: 18px; color: var(--aq-warn); font-size: var(--fs-meta); font-weight: var(--fw-medium); }
.aq-rv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); margin-top: var(--sp-3); }
.aq-rv-actions .aq-i { width: 14px; height: 14px; vertical-align: -2px; }
.aq-conf { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: var(--fw-medium); line-height: 1.5; padding: 0 7px; border-radius: 999px; }
.aq-conf-high { background: var(--aq-u-green-soft); color: var(--aq-u-green); }
.aq-conf-medium { background: var(--aq-u-amber-soft); color: var(--aq-u-amber); }
.aq-conf-low { background: var(--aq-u-red-soft); color: var(--aq-u-red); }

@media (max-width: 768px) {
    .aq-imp-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .aq-imp-bar { bottom: calc(var(--aq-tabbar-h) + 8px + env(safe-area-inset-bottom)); }
    .aq-imp-bar .aq-btn { flex: 1; justify-content: center; }
    body:has(.aq-imp-bar) .aq-fab { display: none; }
    .aq-rv { padding: 14px; }
    .aq-rv-grid { grid-template-columns: 1fr 1fr; }
    .aq-rv-grid > .aq-label:first-child, .aq-rv-grid > .aq-label:nth-child(2) { grid-column: 1 / -1; }
}
