/* ════════════════════════════════════════════════════════════════════════
   Calculator Data (admin) — same look as Admin Vault (base copied from
   css/admin-vault.css so this page never depends on the APP-only file),
   plus the page's own blocks (ac-*) and the PDF / image pages (rp-*).
   Tokens, appbar, icon-btn, screen-header come from /css/design.css.
   ════════════════════════════════════════════════════════════════════════ */

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
body{
    background:var(--bg);
    color:var(--text);
    min-height:100vh;
    -webkit-font-smoothing:antialiased;
}
button, input{ font-family:inherit; }
::selection{ background:var(--primary-soft); }

/* ── Layout: spreads with the screen, never a centred fixed card ───────── */
.av-wrap{
    width:100%;
    max-width:100%;
    padding:20px clamp(14px, 2.6vw, 30px) calc(56px + env(safe-area-inset-bottom));
    animation:av-fade-up .45s cubic-bezier(.22,.9,.3,1) both;
}
/* never let any inner block widen the page — everything stays relative to
   the screen; wide content scrolls INSIDE its own container instead */

/* ── Locked app frame — identical behaviour to home / exams / mock hub ──
   The BODY never scrolls: it is a fixed flex column (header + scroller),
   and only the inner .screen-scroll moves. A sticky header on a document
   scroller always rubs/jitters on fast mobile flings and overscroll; a
   header outside the scroller cannot move at all. */
html, body{ height:100%; }
body{
    position:fixed; inset:0;
    display:flex; flex-direction:column;
    overflow:hidden;
}
.screen-header{ flex-shrink:0; }
.screen-scroll{ overscroll-behavior:contain; }
.av-wrap, .tab-panel, .panel-card, .table-wrapper{ max-width:100%; }
/* grid/flex children default to min-width:auto, which let a wide table
   stretch its whole column past the viewport (the old mobile glitch) */
.av-2col > *, .av-stats > *, .period-summary > *, .filter-row > *{ min-width:0; }
@media (min-width:760px){ .av-wrap{ padding-top:24px; } }

@keyframes av-fade-up{ from{ opacity:0; transform:translateY(10px); } to{ opacity:1; transform:none; } }
@keyframes av-pop{ from{ opacity:0; transform:translateY(8px) scale(.985); } to{ opacity:1; transform:none; } }
@keyframes av-row-in{ from{ opacity:0; transform:translateY(5px); } to{ opacity:1; transform:none; } }
@keyframes av-spin{ to{ transform:rotate(360deg); } }
@keyframes av-shimmer{ 0%{ background-position:-420px 0; } 100%{ background-position:420px 0; } }
@keyframes av-pulse-ring{ 0%{ box-shadow:0 0 0 0 var(--primary-soft); } 70%{ box-shadow:0 0 0 12px rgba(61,90,254,0); } 100%{ box-shadow:0 0 0 0 rgba(61,90,254,0); } }

/* Full-screen data gate: no empty admin cards or placeholder numbers are
   exposed while the initial Supabase reads are still in flight. */
.av-loading{
    min-height:50vh; display:flex; align-items:center; justify-content:center;
    flex-direction:column; gap:12px; color:var(--text-2); font-size:13px; font-weight:700;
}
.av-loading[hidden]{ display:none !important; }
.av-loading-spinner{
    width:30px; height:30px; border-radius:50%;
    border:3px solid var(--border-strong); border-top-color:var(--primary);
    animation:av-spin .72s linear infinite;
}

/* ── Denied screen ─────────────────────────────────────────────────────── */
.av-denied{
    max-width:460px; margin:9vh auto 0; text-align:center;
    background:var(--surface); border:1px solid var(--border); border-radius:22px;
    padding:40px 28px; box-shadow:0 18px 44px rgba(15,23,42,.10);
    animation:av-pop .4s cubic-bezier(.22,.9,.3,1) both;
}
.av-denied-ico{
    width:64px; height:64px; margin:0 auto 16px; border-radius:20px;
    background:var(--red-soft, rgba(225,29,72,.10)); color:var(--red);
    display:grid; place-items:center; animation:av-pulse-ring 2.2s ease-out infinite;
}
.av-denied-ico svg{ width:28px; height:28px; }
.av-denied h2{ margin:0 0 8px; font-size:20px; font-weight:800; letter-spacing:-.3px; }
.av-denied p{ margin:0; font-size:13px; color:var(--text-2); line-height:1.55; }

/* ── Stat cards ────────────────────────────────────────────────────────── */
.av-stats{
    display:grid; gap:14px;
    grid-template-columns:repeat(auto-fit, minmax(215px, 1fr));
    margin-bottom:20px;
}
.av-stat{
    position:relative; overflow:hidden;
    background:var(--surface); border:1px solid var(--border); border-radius:18px;
    padding:16px 18px 15px;
    display:flex; align-items:center; gap:14px;
    box-shadow:0 6px 18px rgba(15,23,42,.05);
    transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    animation:av-pop .5s cubic-bezier(.22,.9,.3,1) both;
}
.av-stat:nth-child(2){ animation-delay:.06s; }
.av-stat:nth-child(3){ animation-delay:.12s; }
.av-stat:nth-child(4){ animation-delay:.18s; }
.av-stat:hover{ transform:translateY(-3px); box-shadow:0 14px 30px rgba(15,23,42,.10); border-color:var(--border-strong); }
.av-stat::after{
    content:''; position:absolute; inset:0 0 auto 0; height:3px;
    background:var(--accent, var(--grad-primary)); opacity:.9;
}
.av-stat-ico{
    width:44px; height:44px; flex-shrink:0; border-radius:14px;
    display:grid; place-items:center;
    background:var(--accent-soft, var(--primary-soft)); color:var(--accent-solid, var(--primary));
}
.av-stat-ico svg{ width:21px; height:21px; }
.av-stat-body{ min-width:0; }
.av-stat p{
    margin:0 0 3px; font-size:10.5px; font-weight:800; letter-spacing:.9px;
    text-transform:uppercase; color:var(--text-3); white-space:nowrap;
}
.av-stat h3{
    margin:0; font-size:clamp(20px, 2vw, 25px); font-weight:800; letter-spacing:-.5px;
    font-variant-numeric:tabular-nums; line-height:1.1;
}
.av-stat .stat-sub{ display:block; margin-top:3px; font-size:10.5px; font-weight:600; color:var(--text-3); }
.av-stat.gold{ --accent:linear-gradient(90deg,#f59e0b,#fbbf24); --accent-soft:var(--amber-soft); --accent-solid:var(--amber-strong, #d97706); }
.av-stat.navy{ --accent:linear-gradient(90deg,#10b981,#34d399); --accent-soft:var(--emerald-soft); --accent-solid:var(--emerald-strong, #059669); }
.av-stat.seal{ --accent:linear-gradient(90deg,#e11d48,#fb7185); --accent-soft:rgba(225,29,72,.10); --accent-solid:var(--red); }

/* ── Tab bar ───────────────────────────────────────────────────────────── */
.av-tabs{
    display:flex; gap:7px; overflow-x:auto; padding:5px;
    background:var(--surface); border:1px solid var(--border); border-radius:16px;
    margin-bottom:18px; scrollbar-width:thin;
    position:sticky; top:0; z-index:60;   /* scroller starts under the header */
    backdrop-filter:blur(8px);
}
.av-tabs::-webkit-scrollbar{ height:0; }
.tab-btn{
    flex:0 0 auto; border:none; cursor:pointer;
    padding:9px 15px; border-radius:11px;
    background:transparent; color:var(--text-2);
    font-size:12.5px; font-weight:700; letter-spacing:.1px;
    transition:background .18s ease, color .18s ease, transform .12s ease;
    white-space:nowrap;
}
.tab-btn:hover{ background:var(--surface-2); color:var(--text); }
.tab-btn:active{ transform:scale(.95); }
.tab-btn.active{ background:var(--grad-primary); color:#fff; box-shadow:0 6px 16px rgba(61,90,254,.30); }
.tab-btn.owner-only{ display:none; }
body.role-owner .tab-btn.owner-only{ display:inline-block; }
.owner-only{ display:none; }
body.role-owner .owner-only{ display:block; }
body.role-owner .tab-btn.owner-only{ display:inline-block; }

/* ── Panels + cards ────────────────────────────────────────────────────── */
.tab-panel{ display:none; }
.tab-panel.active{ display:block; animation:av-fade-up .35s cubic-bezier(.22,.9,.3,1) both; }

.av-2col{ display:grid; gap:16px; }
@media (min-width:1100px){
    .av-2col{ grid-template-columns:1fr 1fr; align-items:start; }
}

.panel-card{
    background:var(--surface); border:1px solid var(--border); border-radius:18px;
    padding:18px clamp(14px, 1.8vw, 22px) 20px;
    margin-bottom:16px;
    box-shadow:0 6px 18px rgba(15,23,42,.05);
    animation:av-pop .4s cubic-bezier(.22,.9,.3,1) both;
}
.panel-card > h3, .panel-card .av-card-title{
    display:flex; align-items:center; gap:9px;
    margin:0 0 4px; font-size:15px; font-weight:800; letter-spacing:-.2px;
}
.panel-card > h3 svg, .panel-card .av-card-title svg{
    width:17px; height:17px; color:var(--primary); flex-shrink:0;
}
.panel-card .hint{ margin:6px 0 14px; font-size:12px; color:var(--text-2); line-height:1.55; }
.section-header{ display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.section-header h3{ margin:0; }
.section-header h3{ display:flex; align-items:center; gap:9px; font-size:16px; font-weight:700; color:var(--text-1); }
.section-header h3 svg{ width:19px; height:19px; flex-shrink:0; color:var(--primary,#3d5afe); }
.ac-h3 svg, .panel-card h3 svg{ width:19px; height:19px; flex-shrink:0; }

/* ── Filters / period summary ──────────────────────────────────────────── */
.filter-row{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:16px; }
.filter-btn{
    border:1px solid var(--border); background:var(--surface-2); color:var(--text-2);
    padding:8px 14px; border-radius:10px; cursor:pointer;
    font-size:12px; font-weight:700;
    transition:background .16s ease, color .16s ease, border-color .16s ease, transform .12s ease;
}
.filter-btn:hover{ color:var(--text); border-color:var(--border-strong); }
.filter-btn:active{ transform:scale(.94); }
.filter-btn.active{ background:var(--grad-primary); border-color:transparent; color:#fff; box-shadow:0 5px 14px rgba(61,90,254,.28); }
.filter-row input[type=date], .av-input, .inline-input, .pay-input{
    border:1px solid var(--border); background:var(--surface-2); color:var(--text);
    border-radius:10px; padding:8px 11px; font-size:12.5px; font-weight:600;
    outline:none; transition:border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.filter-row input[type=date]:focus, .av-input:focus, .inline-input:focus, .pay-input:focus{
    border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); background:var(--surface);
}
.inline-input{ width:86px; }
.pay-input{ width:88px; }
.filter-row .av-to{ font-size:11.5px; font-weight:700; color:var(--text-3); }

.period-summary{
    display:grid; grid-template-columns:repeat(auto-fit, minmax(160px, 1fr)); gap:12px;
    margin-bottom:16px;
}
.period-summary > div{
    background:var(--surface-2); border:1px solid var(--border); border-radius:14px;
    padding:13px 16px; animation:av-pop .35s ease both;
}
.period-summary p{ margin:0 0 4px; font-size:10.5px; font-weight:800; letter-spacing:.8px; text-transform:uppercase; color:var(--text-3); }
.period-summary h2{ margin:0; font-size:22px; font-weight:800; letter-spacing:-.5px; font-variant-numeric:tabular-nums; }

/* ── Tables ────────────────────────────────────────────────────────────── */
.table-wrapper{
    overflow-x:auto; border:1px solid var(--border); border-radius:14px;
    background:var(--surface);
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-x:contain;
    scrollbar-width:thin;
}
.table-wrapper::-webkit-scrollbar{ height:8px; }
.table-wrapper::-webkit-scrollbar-thumb{ background:var(--border-strong); border-radius:8px; }
/* Tables size to their CONTENT (no crushed columns, no vertical button
   text) and scroll horizontally inside the wrapper on tight screens;
   min-width:100% keeps them filling the card on roomy ones. */
table{ width:max-content; min-width:100%; border-collapse:collapse; font-size:12.5px; }
.table-wrapper td, .table-wrapper th{ max-width:340px; overflow-wrap:anywhere; }
thead th{
    position:sticky; top:0; z-index:2;
    background:var(--surface-2); color:var(--text-3);
    font-size:10.5px; font-weight:800; letter-spacing:.8px; text-transform:uppercase;
    text-align:left; padding:10px 12px; border-bottom:1px solid var(--border);
    white-space:nowrap;
}
tbody td{ padding:10px 12px; border-bottom:1px solid var(--border); color:var(--text-2); vertical-align:middle; }
tbody tr:last-child td{ border-bottom:none; }
tbody tr{ animation:av-row-in .3s ease both; }
tbody tr:nth-child(2){ animation-delay:.03s; }
tbody tr:nth-child(3){ animation-delay:.06s; }
tbody tr:nth-child(4){ animation-delay:.09s; }
tbody tr:nth-child(5){ animation-delay:.12s; }
tbody tr:nth-child(6){ animation-delay:.15s; }
tbody tr:hover td{ background:var(--surface-2); }
tbody td b{ color:var(--text); font-weight:700; }
tbody td small{ color:var(--text-3); font-size:11px; }
tr.date-divider td{
    background:var(--primary-soft); color:var(--primary);
    font-size:11px; font-weight:800; letter-spacing:.6px; text-transform:uppercase;
    padding:7px 12px;
}
.av-mono{ font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:11px; letter-spacing:-.2px; }
.history-label{
    display:block; margin:18px 0 8px; font-size:11px; font-weight:800;
    letter-spacing:.9px; text-transform:uppercase; color:var(--text-3);
}

/* ── Badges + small buttons ────────────────────────────────────────────── */
.badge{
    display:inline-flex; align-items:center; gap:5px;
    padding:4px 10px; border-radius:999px;
    font-size:10.5px; font-weight:800; letter-spacing:.5px; text-transform:uppercase;
}
.badge::before{ content:''; width:6px; height:6px; border-radius:50%; background:currentColor; }
.badge.on{ background:var(--emerald-soft); color:var(--emerald-strong, #059669); }
.badge.off{ background:rgba(225,29,72,.10); color:var(--red); }
body.dark-mode .badge.on{ color:#34d399; }
body.dark-mode .badge.off{ color:#fb7185; }

.btn-sm{
    border:none; cursor:pointer; border-radius:9px; padding:7px 12px;
    font-size:11.5px; font-weight:800; letter-spacing:.2px;
    white-space:nowrap;               /* never stack letters vertically */
    transition:transform .12s ease, filter .15s ease, box-shadow .15s ease;
    margin:2px 4px 2px 0;
}
.btn-sm:active{ transform:scale(.93); }
.btn-sm.approve{ background:var(--emerald-soft); color:var(--emerald-strong, #059669); }
.btn-sm.approve:hover{ box-shadow:0 4px 12px rgba(16,185,129,.25); }
.btn-sm.reject{ background:rgba(225,29,72,.10); color:var(--red); }
.btn-sm.reject:hover{ box-shadow:0 4px 12px rgba(225,29,72,.22); }
.btn-sm.edit, .btn-sm.toggle{ background:var(--primary-soft); color:var(--primary); }
.btn-sm.edit:hover, .btn-sm.toggle:hover{ box-shadow:0 4px 12px rgba(61,90,254,.22); }
body.dark-mode .btn-sm.approve{ color:#34d399; }
body.dark-mode .btn-sm.reject{ color:#fb7185; }
body.dark-mode .btn-sm.edit, body.dark-mode .btn-sm.toggle{ color:#818cf8; }
a.btn-sm{ text-decoration:none; display:inline-block; }

/* ── Primary buttons + forms ───────────────────────────────────────────── */
.btn-primary{
    border:none; cursor:pointer; border-radius:12px;
    background:var(--grad-primary); color:#fff;
    padding:11px 18px; font-size:13px; font-weight:800; letter-spacing:.1px;
    box-shadow:0 8px 20px rgba(61,90,254,.30);
    transition:transform .12s ease, box-shadow .18s ease, filter .18s ease;
}
.btn-primary:hover{ box-shadow:0 12px 26px rgba(61,90,254,.38); filter:brightness(1.05); }
.btn-primary:active{ transform:scale(.96); }
.btn-primary:disabled{ opacity:.55; cursor:default; box-shadow:none; }
.btn-ghost{
    border:1px solid var(--border); background:var(--surface); color:var(--text-2);
    border-radius:12px; padding:10px 16px; font-size:13px; font-weight:700; cursor:pointer;
    transition:color .15s ease, border-color .15s ease, transform .12s ease;
}
.btn-ghost:hover{ color:var(--text); border-color:var(--border-strong); }
.btn-ghost:active{ transform:scale(.96); }

.form-grid{ display:grid; gap:10px; grid-template-columns:repeat(auto-fit, minmax(170px, 1fr)); margin-bottom:14px; }
.form-grid .av-input, .form-grid input{ width:100%; }
.form-grid input[readonly]{ opacity:.75; cursor:default; }
.av-field-col{ display:flex; flex-direction:column; gap:10px; margin-bottom:14px; }
.av-inline-msg{ margin:10px 0 0; font-size:12.5px; font-weight:700; min-height:16px; }
.av-inline-msg.ok{ color:var(--emerald-strong, #059669); }
.av-inline-msg.err{ color:var(--red); }
body.dark-mode .av-inline-msg.ok{ color:#34d399; }
body.dark-mode .av-inline-msg.err{ color:#fb7185; }

.bulk-bar{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:14px; }

/* ── Split editor ──────────────────────────────────────────────────────── */
.split-row{
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    background:var(--surface-2); border:1px solid var(--border); border-radius:12px;
    padding:9px 14px; margin-bottom:8px; animation:av-row-in .3s ease both;
}
.split-row span{ font-size:13px; font-weight:700; }
.split-input{ width:100px; }

/* ── Clearance preview + history ───────────────────────────────────────── */
.clearance-preview{
    margin-top:14px; padding:14px 16px;
    background:var(--emerald-soft); border:1px dashed var(--emerald-strong, #059669);
    border-radius:14px; animation:av-pop .3s ease both;
}
.clearance-preview p{ margin:0 0 10px; font-size:13px; color:var(--text); font-weight:600; }
.clearance-preview b{ font-size:16px; font-weight:800; }

.clearance-batch{
    border:1px solid var(--border); border-radius:14px; overflow:hidden;
    margin-bottom:12px; background:var(--surface); animation:av-pop .35s ease both;
}
.clearance-batch-head{
    display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap;
    padding:11px 14px; background:var(--surface-2); border-bottom:1px solid var(--border);
    font-size:12.5px;
}
.clearance-batch-head b{ color:var(--text); font-weight:800; }
.clearance-batch-head span{ color:var(--primary); font-weight:800; }
.clearance-batch .hint{ padding:8px 14px 0; margin:0; }
.share-row{
    display:flex; align-items:center; gap:10px; flex-wrap:wrap;
    padding:10px 14px; border-bottom:1px solid var(--border);
    animation:av-row-in .3s ease both;
}
.share-row:last-child{ border-bottom:none; }
.share-name{ font-size:13px; font-weight:800; color:var(--text); min-width:110px; }
.share-amounts{ font-size:12px; color:var(--text-2); font-weight:600; flex:1; min-width:200px; display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.share-actions{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; }

/* ── Modals (clearance confirm + generic dialog) ───────────────────────── */
.modal-overlay, .av-dialog-overlay{
    position:fixed; inset:0; z-index:1200;
    background:rgba(10,15,30,.52); backdrop-filter:blur(4px);
    display:none; align-items:center; justify-content:center; padding:18px;
}
.modal-overlay.active, .av-dialog-overlay.active{ display:flex; animation:av-fade-up .18s ease both; }
.modal-box, .av-dialog-box{
    width:min(560px, 100%); max-height:84vh; overflow-y:auto;
    background:var(--surface); border:1px solid var(--border); border-radius:20px;
    padding:22px; box-shadow:0 26px 60px rgba(10,15,30,.35);
    animation:av-pop .26s cubic-bezier(.22,.9,.3,1) both;
}
.modal-box h3, .av-dialog-box h3{ margin:0 0 6px; font-size:16px; font-weight:800; letter-spacing:-.2px; }
.modal-box .hint{ margin:0 0 14px; }
.modal-actions{ display:flex; justify-content:flex-end; gap:10px; margin-top:18px; }
.modal-share-row{
    background:var(--surface-2); border:1px solid var(--border); border-radius:14px;
    padding:12px 14px; margin-bottom:10px; animation:av-row-in .3s ease both;
}
.msr-name{ font-size:13.5px; font-weight:800; margin-bottom:3px; }
.msr-due{ font-size:12.5px; color:var(--text-2); font-weight:600; margin-bottom:8px; }
.modal-share-row label{ display:flex; align-items:center; gap:7px; font-size:12px; font-weight:700; color:var(--text-2); margin-bottom:8px; cursor:pointer; }
.msr-paid-input{ width:120px; }
input[type=checkbox]{ width:16px; height:16px; accent-color:var(--primary); cursor:pointer; }

.av-dialog-msg{ margin:4px 0 14px; font-size:13px; color:var(--text-2); line-height:1.6; white-space:pre-wrap; }
.av-dialog-input{ width:100%; margin-bottom:4px; }

/* ── Toasts ────────────────────────────────────────────────────────────── */
.av-toast-root{
    position:fixed; left:50%; transform:translateX(-50%);
    bottom:calc(18px + env(safe-area-inset-bottom)); z-index:1400;
    display:flex; flex-direction:column; align-items:center; gap:8px;
    pointer-events:none; width:min(420px, calc(100vw - 32px));
}
.av-toast{
    display:flex; align-items:center; gap:9px;
    background:var(--surface); color:var(--text);
    border:1px solid var(--border); border-left:4px solid var(--primary);
    border-radius:13px; padding:11px 15px;
    font-size:12.5px; font-weight:700; line-height:1.45;
    box-shadow:0 14px 34px rgba(15,23,42,.18);
    animation:av-pop .25s cubic-bezier(.22,.9,.3,1) both;
    max-width:100%;
}
.av-toast.out{ opacity:0; transform:translateY(8px); transition:opacity .25s ease, transform .25s ease; }
.av-toast.ok{ border-left-color:var(--emerald); }
.av-toast.err{ border-left-color:var(--red); }
.av-toast.warn{ border-left-color:var(--amber); }
.av-toast svg{ width:16px; height:16px; flex-shrink:0; }
.av-toast.ok svg{ color:var(--emerald); }
.av-toast.err svg{ color:var(--red); }
.av-toast.warn svg{ color:var(--amber); }

/* ── Sync spin ─────────────────────────────────────────────────────────── */
#syncBtn.spinning svg{ animation:av-spin .8s linear infinite; }

/* ── Reduced motion ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion:reduce){
    *, *::before, *::after{ animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
}

/* ── Header extras — verbatim parity with home.css ─────────────────────── */
.brand-logo-img{
    width:100%; height:100%;
    object-fit:cover;
    border-radius:11px;
    display:block;
    background:var(--surface-2);
}

/* ═══════════════════════════════════════════════════════════════════════
   CALCULATOR DATA — page blocks (ac-*)
   ═══════════════════════════════════════════════════════════════════════ */
.screen-scroll{ flex:1 1 auto; overflow-y:auto; -webkit-overflow-scrolling:touch; }
[hidden]{ display:none !important; }

/* password gate (same idea as Check Reports) */
.ac-gate{ min-height:70vh; display:flex; align-items:center; justify-content:center; padding:24px 16px; }
body:not(.ac-locked) .ac-gate{ display:none; }
.ac-gate-card{
    width:min(420px, 100%); text-align:center;
    background:var(--surface); border:1px solid var(--border); border-radius:22px;
    padding:30px 24px 22px; box-shadow:0 18px 44px rgba(15,23,42,.10);
    animation:av-pop .4s cubic-bezier(.22,.9,.3,1) both;
}
.ac-gate-ico{ width:58px; height:58px; margin:0 auto 14px; border-radius:18px; display:grid; place-items:center;
    background:var(--primary-soft); color:var(--primary); }
.ac-gate-ico svg{ width:27px; height:27px; }
.ac-gate-card h2{ margin:0 0 6px; font-size:19px; font-weight:800; letter-spacing:-.3px; }
.ac-gate-card p{ margin:0 0 16px; font-size:13px; color:var(--text-2); }
.ac-gate-field{ position:relative; }
.ac-gate-field input{
    width:100%; padding:12px 44px 12px 14px; border-radius:12px; font-size:14px; font-weight:600;
    border:1px solid var(--border-strong); background:var(--surface-2); color:var(--text); outline:none;
}
.ac-gate-field input:focus{ border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); background:var(--surface); }
.ac-gate-eye{ position:absolute; right:6px; top:50%; transform:translateY(-50%); width:34px; height:34px; border:0; background:transparent; color:var(--text-3); cursor:pointer; border-radius:9px; display:grid; place-items:center; }
.ac-gate-eye svg{ width:18px; height:18px; }
.ac-gate-eye.on{ color:var(--primary); }
.ac-gate-err{ margin-top:10px; font-size:12.5px; font-weight:700; color:var(--red); }
.ac-gate-btn{ width:100%; margin-top:14px; }
.ac-gate-note{ display:block; margin-top:12px; font-size:11px; color:var(--text-3); line-height:1.5; }

/* exam bar */
.ac-exambar{ padding-top:14px; padding-bottom:14px; }
.ac-exambar-row{ display:flex; gap:14px; align-items:flex-end; flex-wrap:wrap; }
.ac-exambar-row > *{ min-width:0; }
.ac-field{ display:flex; flex-direction:column; gap:5px; min-width:0; }
.ac-field > span{ font-size:10.5px; font-weight:800; letter-spacing:.8px; text-transform:uppercase; color:var(--text-3); }
.ac-field .av-input, .ac-field select, .ac-field input{ width:100%; }
.ac-field-grow{ flex:1 1 320px; }
.ac-field-wide{ grid-column:span 2; }
@media (max-width:520px){ .ac-field-wide{ grid-column:auto; } }
.ac-exam-meta{ flex:2 1 300px; font-size:12.5px; color:var(--text-2); font-weight:600; line-height:1.5; padding-bottom:6px; }
.ac-exam-meta b{ color:var(--text); }
.ac-exambar-actions{ display:flex; gap:8px; flex-wrap:wrap; }
.ac-checklink{ text-decoration:none; display:inline-flex; align-items:center; }
select.av-input{ cursor:pointer; padding-right:28px; }

.ac-tools{ display:flex; gap:7px; align-items:center; flex-wrap:wrap; }
.ac-tools .av-input{ min-width:150px; }
.ac-inline{ display:inline-flex; align-items:center; gap:7px; font-size:12px; font-weight:700; color:var(--text-2); }
.ac-num{ width:84px !important; min-width:0 !important; }
.ac-check{ display:inline-flex; align-items:center; gap:8px; font-size:12.5px; font-weight:700; color:var(--text-2); cursor:pointer; }
.ac-check .ac-num{ width:70px !important; padding:5px 8px; }
.ac-sep{ flex:1 1 auto; }
.ac-muted{ color:var(--text-3); font-size:12px; font-weight:600; }
.ac-pad{ padding:18px; }
.ac-h3{ margin:0 0 8px; font-size:13.5px; font-weight:800; }
.ac-h3-gap{ margin-top:18px !important; }
.ac-gap-top{ margin-top:16px; }
.ac-form{ margin-bottom:10px; }
.ac-need-exam{ padding:40px 16px; text-align:center; color:var(--text-3); font-weight:700; font-size:13px;
    background:var(--surface); border:1px dashed var(--border-strong); border-radius:18px; }
.ac-summary{ margin:6px 0 10px; font-size:12.5px; color:var(--text-2); font-weight:600; }
.ac-summary b{ color:var(--text); }

/* KPI tiles inside a card */
.ac-kpis{ display:grid; gap:10px; grid-template-columns:repeat(auto-fit, minmax(140px, 1fr)); margin:6px 0 12px; }
.ac-kpi{ background:var(--surface-2); border:1px solid var(--border); border-radius:14px; padding:11px 13px; min-width:0; }
.ac-kpi p{ margin:0 0 3px; font-size:10px; font-weight:800; letter-spacing:.8px; text-transform:uppercase; color:var(--text-3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ac-kpi h4{ margin:0; font-size:19px; font-weight:800; letter-spacing:-.4px; font-variant-numeric:tabular-nums; color:var(--text); }
.ac-kpi small{ display:block; margin-top:2px; font-size:10.5px; color:var(--text-3); font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* table extras */
.table-wrapper td.num, .table-wrapper th.num{ text-align:right; font-variant-numeric:tabular-nums; }
.table-wrapper tr.ac-click{ cursor:pointer; }
.table-wrapper tr.ac-group td{ background:var(--primary-soft); color:var(--primary); font-size:11.5px; font-weight:800; letter-spacing:.3px; padding:8px 12px; }
.table-wrapper tr.ac-group td small{ color:var(--text-2); font-weight:700; margin-left:6px; }
.table-wrapper .ac-empty{ padding:22px; text-align:center; color:var(--text-3); font-weight:700; }
.ac-url{ font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:11px; color:var(--text-2); word-break:break-all; display:inline-block; max-width:420px; }
.ac-pos{ display:inline-grid; place-items:center; min-width:26px; height:26px; padding:0 6px; border-radius:8px; background:var(--surface-2); font-weight:800; color:var(--text); font-size:12px; }
.ac-pos.g1{ background:linear-gradient(135deg,#fbbf24,#f59e0b); color:#3b2400; }
.ac-pos.g2{ background:linear-gradient(135deg,#e5e7eb,#cbd5e1); color:#1f2937; }
.ac-pos.g3{ background:linear-gradient(135deg,#fdba74,#f97316); color:#3b1600; }
.ac-sec-cell{ font-size:11px; line-height:1.35; white-space:nowrap; }
.ac-sec-cell b{ font-size:12px; }

/* difficulty badges */
.lvl{ display:inline-flex; align-items:center; gap:5px; padding:4px 9px; border-radius:999px; font-size:10.5px; font-weight:800; letter-spacing:.4px; text-transform:uppercase; white-space:nowrap; }
.lvl::before{ content:''; width:6px; height:6px; border-radius:50%; background:currentColor; }
.lvl-ve{ background:rgba(16,185,129,.16); color:#047857; }
.lvl-e{ background:rgba(132,204,22,.18); color:#4d7c0f; }
.lvl-m{ background:rgba(245,158,11,.16); color:#b45309; }
.lvl-h{ background:rgba(249,115,22,.16); color:#c2410c; }
.lvl-vh{ background:rgba(225,29,72,.14); color:#be123c; }
.lvl-ld{ background:var(--surface-2); color:var(--text-3); }
body.dark-mode .lvl-ve{ color:#34d399; } body.dark-mode .lvl-e{ color:#a3e635; } body.dark-mode .lvl-m{ color:#fbbf24; }
body.dark-mode .lvl-h{ color:#fb923c; } body.dark-mode .lvl-vh{ color:#fb7185; }
.qual{ display:inline-block; margin-left:6px; padding:2px 7px; border-radius:6px; background:var(--amber-soft); color:var(--amber-strong,#b45309); font-size:10px; font-weight:800; letter-spacing:.3px; }
.pos{ color:var(--emerald-strong,#059669); font-weight:800; } .neg{ color:var(--red); font-weight:800; }
body.dark-mode .pos{ color:#34d399; } body.dark-mode .neg{ color:#fb7185; }

/* charts (plain divs — print / html2canvas safe) */
.ac-chart{ min-height:180px; }
.ac-vbars{ display:flex; align-items:flex-end; gap:4px; height:200px; padding:8px 4px 0; border-bottom:1px solid var(--border-strong); }
.ac-vbar{ flex:1 1 0; min-width:0; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; height:100%; position:relative; }
.ac-vbar i{ display:block; width:100%; border-radius:6px 6px 0 0; background:var(--grad-primary); min-height:2px; }
.ac-vbar em{ font-style:normal; font-size:10px; font-weight:800; color:var(--text-2); margin-bottom:3px; white-space:nowrap; }
.ac-vlabels{ display:flex; gap:4px; padding:5px 4px 0; }
.ac-vlabels span{ flex:1 1 0; min-width:0; text-align:center; font-size:9.5px; color:var(--text-3); font-weight:700; overflow:hidden; white-space:nowrap; text-overflow:clip; }
.ac-hbars{ display:flex; flex-direction:column; gap:7px; }
.ac-hbar{ display:grid; grid-template-columns:minmax(140px, 330px) 1fr 64px; gap:10px; align-items:center; font-size:12px; }
.ac-hbar > span{ font-weight:700; color:var(--text-2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ac-hbar > div{ height:16px; background:var(--surface-2); border-radius:8px; overflow:hidden; }
.ac-hbar > div > i{ display:block; height:100%; border-radius:8px; }
.ac-hbar > b{ text-align:right; font-variant-numeric:tabular-nums; }
@media (max-width:560px){ .ac-hbar{ grid-template-columns:110px 1fr 52px; font-size:11px; } }

/* candidates pager */
.ac-pager{ display:flex; gap:8px; align-items:center; justify-content:flex-end; flex-wrap:wrap; margin-top:12px; font-size:12px; font-weight:700; color:var(--text-2); }

/* lookup cards */
.ac-lk-card{ border:1px solid var(--border); border-radius:16px; padding:14px 16px; margin-top:12px; background:var(--surface-2); }
.ac-lk-head{ display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; align-items:baseline; }
.ac-lk-head h4{ margin:0; font-size:16px; font-weight:800; }
.ac-lk-head .ac-lk-score{ font-size:22px; font-weight:800; color:var(--primary); font-variant-numeric:tabular-nums; }
.ac-lk-meta{ font-size:12px; color:var(--text-2); font-weight:600; margin:4px 0 10px; line-height:1.6; }

/* report builder */
.ac-report-grid{ display:grid; gap:16px; }
@media (min-width:1100px){ .ac-report-grid{ grid-template-columns:minmax(360px, 440px) 1fr; align-items:start; } }
.ac-report-opts .ac-field{ margin-bottom:10px; }
.ac-optlist{ display:flex; flex-direction:column; gap:9px; margin:12px 0; padding:12px; border:1px solid var(--border); border-radius:14px; background:var(--surface-2); }
.ac-optlist-2{ flex-direction:row; flex-wrap:wrap; gap:10px 16px; }
.ac-report-actions{ display:flex; gap:8px; flex-wrap:wrap; margin:6px 0 10px; }
.ac-preview-box{ background:#e9edf5; border-radius:14px; padding:14px; max-height:78vh; overflow:auto; display:flex; flex-direction:column; align-items:center; gap:14px; }
body.dark-mode .ac-preview-box{ background:#0b1022; }
.ac-preview-page{ flex:0 0 auto; box-shadow:0 8px 26px rgba(15,23,42,.18); background:#fff; overflow:hidden; position:relative; }
.ac-preview-page > .rp-page{ transform-origin:0 0; position:absolute; left:0; top:0; }

.ac-dialog-box{ width:min(760px, 100%); }
.ac-dialog-box .table-wrapper{ margin-top:8px; }
.ac-kv{ display:grid; grid-template-columns:repeat(auto-fit, minmax(170px, 1fr)); gap:6px 14px; font-size:12.5px; color:var(--text-2); }
.ac-kv b{ color:var(--text); }

/* ═══════════════════════════════════════════════════════════════════════
   REPORT PAGES (rp-*) — always light, A4 794 × 1123 px (96 dpi)
   Used for preview, PDF download, image download and print.
   ═══════════════════════════════════════════════════════════════════════ */
.rp-root{ position:fixed; left:-12000px; top:0; width:794px; pointer-events:none; z-index:-1; }
.rp-page{
    width:794px; height:1123px; box-sizing:border-box; position:relative; overflow:hidden;
    background:#ffffff; color:#0f172a;
    font-family:"Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    display:flex; flex-direction:column;
}
.rp-page *{ box-sizing:border-box; }
.rp-head{ flex:0 0 auto; height:74px; padding:14px 34px 0; display:flex; align-items:center; gap:12px; position:relative; }
.rp-head::after{ content:''; position:absolute; left:34px; right:34px; bottom:0; height:3px; border-radius:3px; background:linear-gradient(90deg,#3d5afe,#7c4dff 55%,#10b981); }
.rp-logo{ width:40px; height:40px; border-radius:11px; object-fit:cover; flex:0 0 auto; background:#eef2ff; }
.rp-brand{ flex:1 1 auto; min-width:0; }
.rp-brand b{ display:block; font-size:16px; font-weight:700; letter-spacing:-.2px; color:#0f172a; }
.rp-brand span{ display:block; font-size:9.5px; font-weight:500; letter-spacing:1px; text-transform:uppercase; color:#334155; margin-top:1px; }
.rp-head-right{ text-align:right; font-size:10px; color:#334155; font-weight:400; line-height:1.45; }
.rp-head-right b{ color:#0f172a; font-size:11px; font-weight:600; }
.rp-body{ flex:1 1 auto; padding:16px 34px 8px; overflow:hidden; }
.rp-foot{ flex:0 0 auto; height:46px; padding:0 34px; display:flex; align-items:center; justify-content:space-between; gap:12px;
    font-size:9.5px; color:#334155; font-weight:400; border-top:1px solid #cbd5e1; margin:0 34px; padding-left:0; padding-right:0; }
.rp-foot .rp-link{ color:#2743e0; text-decoration:none; font-weight:600; }
.rp-title{ margin:4px 0 2px; font-size:24px; font-weight:700; letter-spacing:-.4px; color:#0f172a; line-height:1.2; }
.rp-subtitle{ margin:0 0 14px; font-size:12px; color:#334155; font-weight:400; }
.rp-h2{ margin:16px 0 8px; font-size:14px; font-weight:600; color:#0f172a; display:flex; align-items:center; letter-spacing:normal; line-height:1.3; }
.rp-h2 i{ flex:0 0 4px; width:4px; height:16px; border-radius:3px; background:#3d5afe; margin-right:8px; }
.rp-h2 span{ flex:1 1 auto; white-space:nowrap; letter-spacing:normal; }
.rp-h2 small{ flex:0 0 auto; font-size:10.5px; color:#334155; font-weight:400; margin-left:10px; letter-spacing:normal; }
.rp-note{ margin:2px 0 8px; font-size:9.5px; color:#334155; font-weight:400; line-height:1.5; }
.rp-kpis{ display:grid; grid-template-columns:repeat(4, 1fr); gap:8px; margin:6px 0 10px; }
.rp-kpi{ border:1px solid #cbd5e1; border-radius:10px; padding:9px 11px; background:#f8fafc; }
.rp-kpi p{ margin:0 0 2px; font-size:9.5px; font-weight:500; color:#334155; }
.rp-kpi h4{ margin:0; font-size:17px; font-weight:600; color:#0f172a; letter-spacing:-.2px; font-variant-numeric:tabular-nums; }
.rp-kpi small{ display:block; font-size:9px; color:#475569; font-weight:400; margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rp-kpi.hl{ background:linear-gradient(135deg,#eef2ff,#f5f3ff); border-color:#c7d2fe; }
/* tables: proper grid — every cell has its own border, header row tinted,
   text solid #0f172a at normal weight (bold only for the key number).
   border-collapse:SEPARATE on purpose — html2canvas draws collapsed borders
   out of place; here each cell draws only its right + bottom line and the
   table draws top + left, so the grid is exact in PDF / image / print. */
.rp-table{ width:100%; border-collapse:separate; border-spacing:0; font-size:10px; line-height:1.35; margin:0 0 6px; table-layout:auto;
    border-top:1px solid #cbd5e1; border-left:1px solid #cbd5e1; }
.rp-table th{ background:#eef2f7; color:#0f172a; font-size:9.5px; font-weight:600; letter-spacing:0; text-transform:none; text-align:left; padding:6px 6px;
    border:0; border-right:1px solid #cbd5e1; border-bottom:1px solid #cbd5e1; white-space:nowrap; vertical-align:bottom; }
.rp-table td{ padding:5px 6px; border:0; border-right:1px solid #cbd5e1; border-bottom:1px solid #cbd5e1; color:#0f172a; font-weight:400; vertical-align:middle; white-space:nowrap; }
.rp-table td b{ font-weight:600; color:#0f172a; }
.rp-page .av-mono{ font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:.95em; letter-spacing:0; }
.rp-table.rp-tight{ font-size:9px; }
.rp-table.rp-tight th{ font-size:8.5px; padding:5px 4px; }
.rp-table.rp-tight td{ padding:4px 4px; }
.rp-table.rp-tighter{ font-size:8.5px; }
.rp-table.rp-tighter th{ font-size:8px; padding:4px 3px; }
.rp-table.rp-tighter td{ padding:3.5px 3px; }
.rp-table td.num, .rp-table th.num{ text-align:right; font-variant-numeric:tabular-nums; }
.rp-table tr:nth-child(even) td{ background:#f8fafc; }
.rp-table tr.rp-group td{ white-space:normal; background:#e8edff !important; color:#1e2a78; font-weight:600; font-size:10px; padding:6px 7px; }
.rp-table tr.rp-group td small{ color:#334155; font-size:9.5px; font-weight:400; margin-left:6px; }
.rp-table .rp-cont td{ color:#475569; font-size:8.5px; font-style:italic; background:#fff !important; padding:3px 7px; }
.rp-pos{ display:inline-block; min-width:20px; padding:1px 5px; border-radius:5px; background:#eef2f7; text-align:center; font-weight:600; color:#0f172a; }
.rp-pos.g1{ background:#fde68a; color:#78350f; } .rp-pos.g2{ background:#e2e8f0; } .rp-pos.g3{ background:#fed7aa; color:#7c2d12; }
.rp-sec{ font-size:9px; color:#0f172a; line-height:1.35; white-space:nowrap; }
.rp-sec b{ font-weight:600; }
.rp-lvl{ display:inline-block; padding:2px 7px; border-radius:999px; font-size:8.5px; font-weight:600; letter-spacing:.2px; text-transform:uppercase; white-space:nowrap; }
.rp-lvl.lvl-ve{ background:#d1fae5; color:#047857; } .rp-lvl.lvl-e{ background:#ecfccb; color:#4d7c0f; }
.rp-lvl.lvl-m{ background:#fef3c7; color:#b45309; } .rp-lvl.lvl-h{ background:#ffedd5; color:#c2410c; }
.rp-lvl.lvl-vh{ background:#ffe4e6; color:#be123c; } .rp-lvl.lvl-ld{ background:#f1f5f9; color:#64748b; }
.rp-qual{ display:inline-block; margin-left:4px; padding:1px 5px; border-radius:4px; background:#fef3c7; color:#92400e; font-size:7.5px; font-weight:600; }
.rp-pos-d{ color:#047857; font-weight:600; } .rp-neg-d{ color:#be123c; font-weight:600; }
.rp-bars{ display:flex; align-items:flex-end; gap:3px; height:150px; padding:6px 2px 0; border-bottom:1px solid #cbd5e1; margin-top:4px; }
.rp-bar{ flex:1 1 0; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; height:100%; }
.rp-bar i{ display:block; width:100%; border-radius:4px 4px 0 0; background:linear-gradient(180deg,#5c7cfa,#3d5afe); min-height:2px; }
.rp-bar em{ font-style:normal; font-size:7.5px; font-weight:600; color:#1e293b; margin-bottom:2px; }
.rp-blabels{ display:flex; gap:3px; padding:3px 2px 0; margin-bottom:8px; }
.rp-blabels span{ flex:1 1 0; text-align:center; font-size:7px; color:#334155; font-weight:500; overflow:hidden; white-space:nowrap; }
.rp-hbars{ display:flex; flex-direction:column; gap:5px; margin:4px 0 8px; }
.rp-hbar{ display:grid; grid-template-columns:210px 1fr 56px; gap:8px; align-items:center; font-size:9.5px; }
.rp-hbar span{ font-weight:400; color:#0f172a; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rp-hbar div{ height:12px; background:#f1f5f9; border-radius:6px; overflow:hidden; }
.rp-hbar div i{ display:block; height:100%; border-radius:6px; }
.rp-hbar b{ text-align:right; font-weight:600; font-variant-numeric:tabular-nums; }
.rp-cta{ margin:14px 0 6px; padding:12px 16px; border-radius:14px; background:linear-gradient(135deg,#3d5afe,#7c4dff); color:#fff; display:flex; align-items:center; justify-content:space-between; gap:12px; }
.rp-cta b{ display:block; font-size:13.5px; font-weight:600; }
.rp-cta span{ display:block; font-size:10px; font-weight:400; margin-top:2px; }
.rp-cta .rp-link{ background:#fff; color:#2743e0; padding:7px 12px; border-radius:10px; font-size:10px; font-weight:600; text-decoration:none; white-space:nowrap; }
.rp-2col{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.rp-mask-note{ font-size:8.5px; color:#94a3b8; font-weight:600; margin:2px 0 8px; }

/* ═══════════════════════════════════════════════════════════════════════
   v2 (t49) — SOLID + THIN text. Pehle grey (#5c6580 / #8a93ab) + 800 weight
   + UPPERCASE = halka aur bhaari dono dikhta tha. Ab: text ka rang gehra,
   weight 400 (normal) / 500 (labels) / 600 (headings + main number).
   Sirf is page pe (body.ac-page) — baaki site ke tokens same.
   ═══════════════════════════════════════════════════════════════════════ */
body.ac-page{ --text-2:#2b3350; --text-3:#4a5370; font-weight:400; }
body.ac-page.dark-mode{ --text-2:#c9d1ea; --text-3:#a9b3d1; }

/* stats */
.ac-page .av-stat p{ font-size:12px; font-weight:500; letter-spacing:0; text-transform:none; color:var(--text-2); }
.ac-page .av-stat h3{ font-weight:600; letter-spacing:-.3px; color:var(--text); }
.ac-page .av-stat .stat-sub{ font-size:11.5px; font-weight:400; color:var(--text-2); }

/* tabs (locked until an exam is picked) */
.ac-page .tab-btn{ font-size:13px; font-weight:500; color:var(--text-2); letter-spacing:0; }
.ac-page .tab-btn.active{ font-weight:600; color:#fff; }
.ac-page .tab-btn:disabled{ opacity:.42; cursor:not-allowed; }
.ac-page .tab-btn:disabled:hover{ background:transparent; color:var(--text-2); }
.ac-page .tab-btn:disabled:active{ transform:none; }

/* cards + headings */
.ac-page .panel-card{ animation:none; }
.ac-page .panel-card > h3, .ac-page .section-header h3{ font-size:15px; font-weight:600; letter-spacing:-.1px; color:var(--text); }
.ac-page .panel-card .hint{ font-size:12.5px; color:var(--text-2); }
.ac-page .ac-h3{ font-size:14px; font-weight:600; color:var(--text); }

/* tables — solid text, normal weight, sentence-case header
   (:where(#acApp…) = sirf screen tables; PDF pages (rp-*) apne rules rakhte hain) */
:where(#acApp, #acDialog) table{ font-size:13px; }
:where(#acApp, #acDialog) thead th{ color:var(--text); font-size:12px; font-weight:600; letter-spacing:0; text-transform:none; padding:9px 12px; border-bottom:1px solid var(--border-strong); }
:where(#acApp, #acDialog) tbody td{ color:var(--text); font-weight:400; padding:9px 12px; }
:where(#acApp, #acDialog) tbody td b{ font-weight:600; }
:where(#acApp, #acDialog) tbody td small{ color:var(--text-2); font-size:11.5px; }
:where(#acApp, #acDialog) tbody tr{ animation:none; }
.ac-page .table-wrapper tr.ac-group td{ font-size:12px; font-weight:600; letter-spacing:0; }
.ac-page .table-wrapper tr.ac-group td small{ font-weight:400; color:var(--text-2); }
.ac-page .table-wrapper .ac-empty{ font-weight:400; color:var(--text-2); }
:where(#acApp, #acDialog) .av-mono{ font-size:11.5px; letter-spacing:0; }
.ac-page .ac-url{ color:var(--text); font-size:11.5px; }

/* KPI tiles */
.ac-page .ac-kpi p{ font-size:12px; font-weight:500; letter-spacing:0; text-transform:none; color:var(--text-2); }
.ac-page .ac-kpi h4{ font-weight:600; letter-spacing:-.2px; }
.ac-page .ac-kpi small{ font-size:11.5px; font-weight:400; color:var(--text-2); }

/* forms + buttons */
.ac-page .ac-field > span{ font-size:12px; font-weight:500; letter-spacing:0; text-transform:none; color:var(--text-2); }
.ac-page .av-input{ font-size:13px; font-weight:400; color:var(--text); }
.ac-page .filter-btn{ font-weight:500; color:var(--text); }
.ac-page .filter-btn:disabled{ opacity:.45; cursor:default; }
.ac-page .btn-primary{ font-weight:600; }
.ac-page .btn-ghost{ font-weight:500; color:var(--text); }
.ac-page .btn-sm{ font-weight:600; letter-spacing:0; }
.ac-page .ac-inline, .ac-page .ac-check{ font-weight:400; color:var(--text); }
.ac-page .ac-muted{ font-weight:400; color:var(--text-2); }
.ac-page .ac-summary{ font-weight:400; color:var(--text); }
.ac-page .ac-summary b, .ac-page .ac-exam-meta b, .ac-page .ac-kv b{ font-weight:600; }
.ac-page .ac-exam-meta{ font-weight:400; color:var(--text-2); }
.ac-page .ac-need-exam{ font-weight:500; color:var(--text-2); }
.ac-page .ac-pager{ font-weight:500; color:var(--text); }
.ac-page .ac-kv{ color:var(--text-2); }

/* small things */
.ac-page .ac-pos{ font-weight:600; }
.ac-page .lvl{ font-weight:600; letter-spacing:.2px; }
.ac-page .qual{ font-weight:600; }
.ac-page .pos, .ac-page .neg{ font-weight:600; }
.ac-page .ac-vbar em{ font-weight:500; color:var(--text); }
.ac-page .ac-vlabels span{ font-weight:400; color:var(--text-2); }
.ac-page .ac-hbar > span{ font-weight:400; color:var(--text); }
.ac-page .ac-hbar > b{ font-weight:600; }
.ac-page .ac-lk-head h4{ font-weight:600; }
.ac-page .ac-lk-head .ac-lk-score{ font-weight:600; }
.ac-page .ac-lk-meta{ font-weight:400; color:var(--text-2); }
.ac-page .av-toast{ font-weight:500; }
.ac-page .ac-gate-card h2, .ac-page .av-dialog-box h3{ font-weight:600; }
.ac-page .ac-gate-card p{ color:var(--text-2); }
.ac-page .ac-gate-err{ font-weight:500; }
.ac-page .ac-gate-field input{ font-weight:400; }
.ac-page .ac-gate-note{ color:var(--text-2); }

/* first open: only the exam picker */
.ac-start{ display:flex; gap:16px; align-items:flex-start; padding:22px clamp(16px, 2vw, 26px); }
.ac-start-ico{ width:46px; height:46px; flex:0 0 46px; border-radius:14px; display:grid; place-items:center; background:var(--primary-soft); color:var(--primary); }
.ac-start-ico svg{ width:22px; height:22px; }
.ac-start-body{ min-width:0; }
.ac-start h3{ margin:0 0 4px; font-size:16px; font-weight:600; color:var(--text); }
.ac-start p{ margin:0; font-size:13px; line-height:1.6; color:var(--text-2); max-width:720px; }
.ac-start p b{ color:var(--text); font-weight:600; }
.ac-start-tabs{ display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
body.ac-noexam .ac-exambar{ border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); }

/* tab loading (only shows if the network takes > 120 ms) */
.tab-panel.is-loading .ac-tab-body{ opacity:.45; pointer-events:none; transition:opacity .15s ease; }
.tab-panel.is-loading::before{
    content:"Loading…"; position:sticky; top:62px; z-index:6; display:block; width:max-content;
    margin:0 auto 12px; padding:7px 16px 7px 34px; border-radius:999px;
    background:var(--surface); border:1px solid var(--border-strong); color:var(--text);
    font-size:12.5px; font-weight:500; box-shadow:0 8px 22px rgba(15,23,42,.12);
    background-image:radial-gradient(circle at 17px 50%, var(--primary) 0 4px, transparent 5px);
    animation:ac-blink 1s ease-in-out infinite;
}
@keyframes ac-blink{ 50%{ background-image:radial-gradient(circle at 17px 50%, var(--primary-soft) 0 4px, transparent 5px); } }

/* phone: compact 2×2 stats, bar labels above the bar */
@media (max-width:560px){
  .av-stats{ grid-template-columns:1fr 1fr !important; gap:10px !important; }
  .av-stat{ padding:12px 12px 12px 14px !important; gap:0 !important; }
  .av-stat .av-stat-ico{ display:none !important; }
  .av-stat h3, .av-stat .stat-num, .av-stat-body h2{ font-size:20px !important; }
  .ac-hbar{ grid-template-columns:1fr 52px; row-gap:3px; }
  .ac-hbar > span{ grid-column:1 / -1; white-space:normal; }
}

/* report pages: never animate (html2canvas would capture mid-animation) */
.rp-root *, .rp-page, .rp-page *{ animation:none !important; transition:none !important; }
.rp-page{ text-rendering:auto; }
.rp-table td.num, .rp-table th.num{ white-space:nowrap; }
.rp-table td b{ white-space:nowrap; }

/* ── t50 · Compare URLs tab ─────────────────────────────────────────── */
.ac-cmp{ margin:2px 0 6px; }
.ac-cmp-track{ display:flex; height:14px; border-radius:999px; overflow:hidden; background:var(--surface-2); border:1px solid var(--border); }
.ac-cmp-track span{ display:block; height:100%; min-width:0; }
.ac-cmp-track .ok, .ac-cmp-legend i.ok{ background:var(--emerald-strong, #059669); }
.ac-cmp-track .no, .ac-cmp-legend i.no{ background:var(--red, #e11d48); }
.ac-cmp-legend{ display:flex; flex-wrap:wrap; gap:6px 18px; margin-top:8px; font-size:12.5px; color:var(--text); font-variant-numeric:tabular-nums; }
.ac-cmp-legend span{ display:inline-flex; align-items:center; gap:6px; }
.ac-cmp-legend i{ width:10px; height:10px; border-radius:3px; display:inline-block; }
.ac-pctbar{ display:inline-block; vertical-align:middle; width:54px; height:6px; margin-right:7px; border-radius:99px; background:var(--surface-2); border:1px solid var(--border); overflow:hidden; }
.ac-pctbar i{ display:block; height:100%; background:var(--emerald-strong, #059669); }
.ac-sub{ font-size:11px; color:var(--text-2); }
.table-wrapper tr.ac-total td{ background:var(--surface-2); font-weight:600; }
#cmpNote:empty{ display:none; }
.ac-page #cmpKpis .ac-kpi p, .ac-page #cmpKpis .ac-kpi small{ white-space:normal; }
