@layer legacy {

/* ══════════════════════════════════════════════════════════════════════════
   FIX_STORE_S5A_2026_07_06 — IN-APP AUDIT SURFACE (Store P1-S5a).
   The website audit PORTED out of the standalone Archive/audit-tool.html iframe
   into the authenticated app context (account-aware; bridges to aiv_audit_data).
   HARD GUARDRAIL (mission §3.2): the archived tool's generic tokens (:root design
   vars, .btn/.view/.card/.panel) WOULD collide with app chrome, so EVERY rule below
   is descendant-scoped under `#page-audit ` and the design tokens are converted to
   `--aud-*` scoped ON #page-audit (NO bare :root leak) — EXACTLY as #page-storefront
   did for S1. Full-bleed (DELIBERATELY ABSENT from the sidebarPages array → no left
   rail, like #page-pos / #page-storefront).
   ══════════════════════════════════════════════════════════════════════════ */
#page-audit{
  --aud-dark:#2B2B2B; --aud-gold:#C9A84C; --aud-gold-dk:#a8862f; --aud-white:#ffffff;
  --aud-offwh:#F8F8F8; --aud-text:#333333; --aud-gray:#6B7280; --aud-line:#e6e2d8;
  --aud-bg:#f4f2ec; --aud-ink:#2B2B2B;
  /* FIX_DISABLED_LEGIBILITY_LIGHTSCOPE_2026_07_26 (F-1) — light-surface override. Same
     rule as #page-storefront: flattened fill = this scope's line neutral, label = its body
     ink. --aud-gray was rejected: it lands at 3.74:1 on --aud-line and 4.55:1 on
     --aud-offwh, which clears by 0.05 and would break on any palette nudge. */
  --disabled-ink:var(--aud-text); --disabled-surface:var(--aud-line);
  --aud-sh-bg:rgba(220,38,38,.14); --aud-sh-t:#991B1B;
  --aud-sm-bg:rgba(245,158,11,.16); --aud-sm-t:#92400E;
  --aud-sl-bg:rgba(16,185,129,.16); --aud-sl-t:#065F46;
  --aud-radius:14px; --aud-radius-sm:10px;
  --aud-shadow:0 4px 18px rgba(43,43,43,.08),0 2px 6px rgba(43,43,43,.05);
  font-family:'Open Sans',system-ui,-apple-system,sans-serif;
  color:var(--aud-text); background:var(--aud-bg); line-height:1.55;
  -webkit-font-smoothing:antialiased; overflow-x:hidden; min-height:100vh;
  /* FIX_MENUS_READABLE_EVERY_SURFACE_2026_09_20 -- a THIRD registered light-theme surface
     (tools/disabled_contrast_scan.js SCOPES array; #page-storefront and #sf-utility-terminal
     are the other two, both fixed by this build). Zero native <select>/<input> exist on this
     page today (latent, not live) -- same defensive-hardening rationale as
     .plan-viewer-export-host: the app-wide color-scheme: dark added at :root would otherwise
     silently inherit here the moment a native form control is ever added. */
  color-scheme: light;
}
#page-audit h1,#page-audit h2,#page-audit h3,#page-audit h4{font-family:'Montserrat','Open Sans',sans-serif;letter-spacing:-.01em;line-height:1.2;margin:0;color:var(--aud-ink)}
#page-audit a{color:inherit;text-decoration:none}
#page-audit button{font-family:inherit;cursor:pointer;border:none;background:none}
#page-audit img{max-width:100%}
#page-audit *{box-sizing:border-box}
#page-audit .aud-wrap{width:100%;max-width:1120px;margin:0 auto;padding:0 28px}
#page-audit .aud-hidden{display:none!important}

/* ── surface header ── */
#page-audit .aud-top{background:var(--aud-dark);color:#EDE8DF;padding:20px 0}
#page-audit .aud-top .aud-wrap{display:flex;align-items:center;justify-content:space-between;gap:16px}
#page-audit .aud-brandline{display:flex;align-items:center;gap:12px}
#page-audit .aud-brandmark{width:38px;height:38px;border-radius:9px;background:linear-gradient(135deg,var(--aud-gold),var(--aud-gold-dk));display:flex;align-items:center;justify-content:center}
#page-audit .aud-brandmark svg{width:20px;height:20px}
#page-audit .aud-brand-t1{font-family:'Montserrat',sans-serif;font-weight:700;font-size:16px;color:#fff;line-height:1.1}
#page-audit .aud-brand-t2{font-size:11.5px;letter-spacing:2px;text-transform:uppercase;color:var(--aud-gold)}
#page-audit .aud-back{display:flex;align-items:center;gap:7px;font-size:13px;color:#cfc9bd;padding:8px 14px;border-radius:8px;cursor:pointer;border:1px solid rgba(255,255,255,.14)}
#page-audit .aud-back:hover{background:rgba(255,255,255,.06)}
#page-audit .aud-back svg{width:15px;height:15px}

/* ── panels ── */
#page-audit .aud-body{padding:36px 0 64px}
#page-audit .aud-panel{background:var(--aud-white);border:1px solid var(--aud-line);border-radius:var(--aud-radius);box-shadow:var(--aud-shadow);padding:32px;margin-bottom:22px;display:none}
#page-audit .aud-panel.active{display:block;animation:audFade .3s ease}
#page-audit .aud-panel-title{font-size:21px;font-weight:700;margin-bottom:6px}
#page-audit .aud-panel-sub{font-size:14px;color:var(--aud-gray);margin-bottom:22px}

/* ── account-aware intro card ── */
#page-audit .aud-acct{display:flex;align-items:center;gap:14px;background:var(--aud-offwh);border:1px solid var(--aud-line);border-radius:var(--aud-radius-sm);padding:16px 18px;margin-bottom:24px}
#page-audit .aud-acct-av{width:44px;height:44px;border-radius:11px;background:var(--aud-dark);color:var(--aud-gold);display:flex;align-items:center;justify-content:center;font-family:'Montserrat',sans-serif;font-weight:700;font-size:16px;flex-shrink:0}
#page-audit .aud-acct-meta .am-1{font-family:'Montserrat',sans-serif;font-weight:600;font-size:15px;color:var(--aud-ink)}
#page-audit .aud-acct-meta .am-2{font-size:12.5px;color:var(--aud-gray);margin-top:2px}
#page-audit .aud-acct-badge{margin-left:auto;font-size:11px;letter-spacing:.5px;text-transform:uppercase;font-weight:600;color:var(--aud-sl-t);background:var(--aud-sl-bg);padding:5px 12px;border-radius:20px}

/* ── run button ── */
#page-audit .aud-btn{display:inline-flex;align-items:center;gap:9px;background:var(--aud-dark);color:#fff;font-family:'Montserrat',sans-serif;font-weight:600;font-size:14.5px;padding:14px 30px;border-radius:10px;transition:transform .15s,box-shadow .2s}
#page-audit .aud-btn:hover{transform:translateY(-2px);box-shadow:0 8px 22px rgba(43,43,43,.22)}
#page-audit .aud-btn:disabled{background:var(--disabled-surface);color:var(--disabled-ink);border:1px solid var(--border,rgba(255,255,255,0.12));box-shadow:none;filter:none;opacity:1;cursor:not-allowed;transform:none}
#page-audit .aud-btn.gold{background:linear-gradient(135deg,var(--aud-gold),var(--aud-gold-dk))}
#page-audit .aud-btn svg{width:17px;height:17px}
/* brand stack member B (section 3.6 item 6): a hidden directions button or run note really hides (1,2,0 beats the 1,1,0 .aud-btn rule) */
#page-audit .aud-btn[hidden], #page-audit .aud-run-note[hidden]{display:none}
/* brand stack member B (section 3.6 item 1): the score panel's Run again / directions row */
#page-audit .aud-score-actions{margin-top:22px}

/* ── progress + log ── */
#page-audit .aud-prog-bg{height:8px;border-radius:99px;background:var(--aud-line);overflow:hidden;margin:8px 0 18px}
#page-audit .aud-prog{height:100%;width:0;background:linear-gradient(90deg,var(--aud-gold),var(--aud-gold-dk));transition:width .5s ease;border-radius:99px}
#page-audit .aud-log{max-height:240px;overflow-y:auto;font-size:13px}
#page-audit .aud-log-line{display:flex;align-items:flex-start;gap:9px;padding:5px 0;color:var(--aud-text)}
#page-audit .aud-log-dot{width:7px;height:7px;border-radius:99px;background:var(--aud-gray);margin-top:6px;flex-shrink:0}
#page-audit .aud-log-line.lg-good .aud-log-dot{background:#16a34a}
#page-audit .aud-log-line.lg-warn .aud-log-dot{background:#d97706}
#page-audit .aud-log-line.lg-active .aud-log-dot{background:var(--aud-gold);animation:audPulse 1.1s infinite}

/* ── scorecard ── */
#page-audit .aud-score-hero{display:flex;align-items:center;gap:26px;flex-wrap:wrap;margin-bottom:26px}
#page-audit .aud-score-circle{width:118px;height:118px;border-radius:99px;border:7px solid var(--aud-gold);display:flex;flex-direction:column;align-items:center;justify-content:center;flex-shrink:0}
#page-audit .aud-score-num{font-family:'Montserrat',sans-serif;font-weight:700;font-size:38px;color:var(--aud-gold);line-height:1}
#page-audit .aud-score-den{font-size:12px;color:var(--aud-gray);margin-top:2px}
#page-audit .aud-score-verdict{font-family:'Montserrat',sans-serif;font-weight:600;font-size:19px;color:var(--aud-ink)}
#page-audit .aud-score-status{font-size:13.5px;color:var(--aud-gray);margin-top:4px}
#page-audit .aud-sc-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px;margin-top:8px}
/* FIX_FALSESUCCESS_S1_2026_08_04 — honest-empty card. Shares the shipped dashed-outline idiom
   (the opc-empty / scv-wd-empty treatment) re-tokenised onto this LIGHT surface's own palette.
   grid-column spans the full track because both hosts that use it are CSS grids, so a default
   auto-placed card would sit in one narrow column. Body ink is --aud-text, NOT --aud-gray: the
   FIX_DISABLED_LEGIBILITY_LIGHTSCOPE_2026_07_26 note on this same scope already records that
   --aud-gray lands 4.55:1 on --aud-offwh and clears AA by only 0.05, which is too thin a margin
   for body copy an operator has to read. Symbol anchor: emptyCard. */
#page-audit .aud-empty{grid-column:1/-1;border:1px dashed var(--aud-line);border-radius:var(--aud-radius-sm);padding:20px 18px;background:var(--aud-offwh);color:var(--aud-text);font-size:12.5px;line-height:1.55}
#page-audit .aud-empty b{display:block;font-family:'Montserrat',sans-serif;font-weight:700;font-size:13.5px;color:var(--aud-ink);margin-bottom:6px}
#page-audit .aud-sc-cat{border:1px solid var(--aud-line);border-radius:var(--aud-radius-sm);padding:13px 15px;background:var(--aud-offwh)}
#page-audit .aud-sc-cat.fail{border-color:rgba(220,38,38,.3)}
#page-audit .aud-sc-cat.warn{border-color:rgba(245,158,11,.35)}
#page-audit .aud-sc-cat.pass{border-color:rgba(16,185,129,.35)}
#page-audit .aud-sc-name{font-size:12px;color:var(--aud-gray);font-weight:600;text-transform:uppercase;letter-spacing:.4px}
#page-audit .aud-sc-score{font-family:'Montserrat',sans-serif;font-weight:700;font-size:22px;margin:5px 0}
#page-audit .aud-sc-bar-bg{height:5px;border-radius:99px;background:var(--aud-line);overflow:hidden}
#page-audit .aud-sc-bar{height:100%;border-radius:99px}
/* FIX_AUDIT_COMPETITIVE_UNSCORED_2026_08_25 - the NOT-SCORED category tile. Deliberately the
   same box as a scored tile (so the category is plainly still one of the ten) with a dashed
   neutral border and no bar, so it cannot be misread as a low score. Never a colour from
   scoreCol: green/amber/red all assert a judgement, and the whole point is that no judgement
   was made. No mechanical gate covers new CSS - this was render-verified over loopback. */
#page-audit .aud-sc-cat.unscored{border-style:dashed;border-color:var(--aud-line);background:transparent}
#page-audit .aud-sc-unscored{font-family:'Montserrat',sans-serif;font-weight:700;font-size:13px;margin:5px 0 4px;color:var(--aud-gray)}
#page-audit .aud-sc-why{font-size:10.5px;line-height:1.45;color:var(--aud-gray)}

/* ── store-variant sample grid ── */
#page-audit .aud-samples-head{font-family:'Montserrat',sans-serif;font-weight:700;font-size:20px;margin:8px 0 4px}
#page-audit .aud-samples-sub{font-size:13.5px;color:var(--aud-gray);margin-bottom:20px}
#page-audit .aud-samples-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:20px}
#page-audit .aud-sample-card{border:1px solid var(--aud-line);border-radius:var(--aud-radius);overflow:hidden;background:var(--aud-white);box-shadow:var(--aud-shadow);transition:transform .18s,box-shadow .2s;cursor:pointer}
#page-audit .aud-sample-card:hover{transform:translateY(-4px);box-shadow:0 14px 34px rgba(43,43,43,.16)}
#page-audit .aud-sample-thumb{height:150px;display:flex;align-items:center;justify-content:center;position:relative}
#page-audit .aud-sample-thumb .sw{display:flex;gap:8px}
#page-audit .aud-sample-thumb .sw i{width:26px;height:26px;border-radius:7px;display:block;box-shadow:0 2px 6px rgba(0,0,0,.18)}
#page-audit .aud-sample-tag{position:absolute;top:12px;left:12px;font-size:10.5px;letter-spacing:.6px;text-transform:uppercase;font-weight:700;padding:4px 10px;border-radius:20px;background:rgba(255,255,255,.9);color:var(--aud-dark)}
#page-audit .aud-sample-body{padding:16px 18px}
#page-audit .aud-sample-name{font-family:'Montserrat',sans-serif;font-weight:700;font-size:16px;color:var(--aud-ink)}
#page-audit .aud-sample-desc{font-size:12.5px;color:var(--aud-gray);margin-top:5px;line-height:1.5}
#page-audit .aud-sample-cta{display:inline-flex;align-items:center;gap:6px;margin-top:12px;font-size:12.5px;font-weight:600;color:var(--aud-gold-dk)}
#page-audit .aud-sample-cta svg{width:14px;height:14px}
#page-audit .aud-sample-src{display:inline-block;margin-top:10px;font-size:11px;color:var(--aud-gray)}
/* FIX_STORE_S5B_2026_07_06 — the SELECTION (commit) CTA on each store-direction card. */
#page-audit .aud-sample-select{display:block;width:100%;margin-top:12px;padding:10px 14px;border:0;border-radius:9px;background:var(--aud-ink);color:#fff;font-family:'Montserrat',sans-serif;font-weight:700;font-size:13px;cursor:pointer;transition:background .18s,transform .12s}
#page-audit .aud-sample-select:hover{background:var(--aud-gold-dk);transform:translateY(-1px)}
#page-audit .aud-sample-select:active{transform:translateY(0)}

/* ── reveal modal (read-only preview) ── */
#page-audit .aud-modal{position:fixed;inset:0;background:rgba(43,43,43,.72);z-index:9200;display:none;align-items:center;justify-content:center;padding:32px}
#page-audit .aud-modal.open{display:flex}
#page-audit .aud-modal-box{background:var(--aud-white);border-radius:var(--aud-radius);width:100%;max-width:920px;max-height:86vh;overflow:hidden;display:flex;flex-direction:column;box-shadow:0 30px 80px rgba(0,0,0,.4)}
#page-audit .aud-modal-head{display:flex;align-items:center;justify-content:space-between;padding:18px 24px;border-bottom:1px solid var(--aud-line)}
#page-audit .aud-modal-title{font-family:'Montserrat',sans-serif;font-weight:700;font-size:17px}
#page-audit .aud-modal-x{width:34px;height:34px;border-radius:9px;cursor:pointer;background:var(--aud-offwh);display:flex;align-items:center;justify-content:center;font-size:18px;color:var(--aud-gray)}
#page-audit .aud-modal-body{padding:26px 28px;overflow-y:auto}
#page-audit .aud-modal-note{font-size:12.5px;color:var(--aud-gray);background:var(--aud-offwh);border-radius:var(--aud-radius-sm);padding:12px 16px;margin-bottom:18px}}