/* The modal, branding, motion, role-based visibility, the responsive sidebar, legal pages, footer. Loaded in the order web/index.html lists them; the order is the cascade. */
/* modal dialog */
.modal-ov { display:none; position:fixed; inset:0; background:rgba(15,17,30,.5); z-index:70; align-items:center; justify-content:center; padding:20px; }
.modal-ov.show { display:flex; }
.modal { background:#fff; border-radius:14px; max-width:520px; width:100%; max-height:80vh; overflow:auto; box-shadow:0 24px 60px -12px rgba(20,20,40,.5); }
.modal-hd { display:flex; align-items:center; gap:10px; padding:18px 20px 8px; font-weight:700; font-size:15px; }
.modal-bd { padding:4px 20px 8px; font-size:13.5px; color:var(--ink); }
.modal-ft { padding:14px 20px 20px; display:flex; justify-content:flex-end; gap:10px; }
.dup-list { list-style:none; margin:12px 0 0; padding:0; display:flex; flex-direction:column; gap:8px; }
.dup-list li { display:flex; align-items:center; gap:10px; padding:8px 12px; border:1px solid var(--line); border-radius:9px; }
.dup-list .mono { font-weight:600; }

/* ---------- Cardium branding + premium type ---------- */
h1, h2, .page-head h1, .brand-word, .login-word { font-family:'Sora','Inter',system-ui,sans-serif; letter-spacing:-.025em; }
.page-head h1 { font-weight:700; }
.mark svg { width:18px; height:18px; }
.brand-text { display:flex; flex-direction:column; line-height:1.05; }
.brand-word { color:#fff; font-size:16px; font-weight:700; }
.brand-by { font-size:9px; font-weight:600; letter-spacing:.16em; text-transform:uppercase; color:#6f8ef2; margin-top:3px; }  /* 5.13:1 on navy; --accent2 itself is 4.48:1 */
.mobile-bar .mark svg { width:16px; height:16px; }
.mobile-bar .brand-word { font-size:15px; }
/* login */
.login-logo { display:flex; align-items:center; gap:12px; margin-bottom:8px; }
.login-logo .mark { width:44px; height:44px; border-radius:13px; background:var(--grad); display:grid; place-items:center; box-shadow:0 8px 22px -6px rgba(59,91,219,.6); }
.login-logo .mark svg { width:24px; height:24px; }
.login-word { font-family:'Sora',sans-serif; font-size:23px; font-weight:700; letter-spacing:-.03em; color:var(--ink); line-height:1; }
.login-by { font-size:9px; font-weight:600; letter-spacing:.16em; text-transform:uppercase; color:var(--accent); margin-top:4px; }
.login-tag { color:var(--muted); font-size:13px; margin:2px 0 20px; line-height:1.5; }
.login-tag b { color:var(--ink); font-weight:600; }

/* ---------- motion + premium polish ---------- */
body { -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility; }
@keyframes pageIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
@keyframes riseIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }
@keyframes spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: no-preference) {
  .page.active { animation: pageIn .34s cubic-bezier(.22,.61,.36,1) both; }
  .page.active .panel { animation: riseIn .44s cubic-bezier(.22,.61,.36,1) both; }
  .page.active .panel:nth-of-type(2) { animation-delay:.06s; }
  .page.active .panel:nth-of-type(3) { animation-delay:.12s; }
  .page.active .panel:nth-of-type(4) { animation-delay:.18s; }
  .stat { animation: riseIn .5s cubic-bezier(.22,.61,.36,1) both; }
  .stat:nth-child(2){animation-delay:.05s} .stat:nth-child(3){animation-delay:.1s} .stat:nth-child(4){animation-delay:.15s} .stat:nth-child(5){animation-delay:.2s}
}
.panel { transition: box-shadow .22s ease; }
.panel:hover { box-shadow:0 16px 44px -20px rgba(26,35,50,.30); }
.stat { transition: transform .16s ease, box-shadow .16s ease; }
.stat:hover { transform:translateY(-3px); box-shadow:0 12px 26px -14px rgba(59,91,219,.35); }
.btn:active:not(:disabled){ transform:translateY(0) scale(.97); }
nav.tabs a { transition: background .18s ease, color .18s ease, padding-left .18s ease; }
nav.tabs a:hover { padding-left:15px; }
:focus-visible { outline:2px solid var(--accent); outline-offset:2px; border-radius:6px; }
/* --accent-soft as the focus ring measured 1.13:1 against a white panel, i.e. no visible focus across an
   82-field form. --e-focus is the token that was always meant for this. */
/* Was outline:none. The border-colour flip is a good cue but it vanishes in forced-colors like every
   other painted cue, so the outline has to stay. :focus-visible above supplies it; this keeps the
   border tint for mouse focus on text fields. */
input:focus, select:focus, textarea:focus { border-color:var(--accent); box-shadow:var(--e-focus); }
.spinner { display:inline-block; width:14px; height:14px; border:2px solid var(--accent-soft-2); border-top-color:var(--accent); border-radius:50%; animation:spin .7s linear infinite; vertical-align:-2px; margin-right:6px; }
nav.tabs a.admin-only { display:none; }  /* hide admin nav items by default (needs to out-specify `nav.tabs a{display:flex}`) */
body.is-admin nav.tabs a.admin-only { display:flex; }  /* admin-only nav item keeps flex layout when shown */
.genrepo-card.grc-comp { border-color:#f1b5b5; background:#fff8f8; }
.grc-compchip { background:#fde8e8; color:#b42318; border-radius:4px; padding:1px 6px; font-size:10px; font-weight:700; letter-spacing:.03em; }
.grc-compline { font-size:11px; color:#b42318; font-weight:600; margin-top:2px; overflow-wrap:anywhere; }
.is-admin-only { display:none !important; }  /* inline admin-only controls (buttons etc) */
body.is-admin .is-admin-only { display:inline-flex !important; }
.compromise-only { display:none !important; }  /* Mark compromised: admin, manager, card tester (COMPROMISE_ROLES in shared/roles.js) */
body.can-compromise .compromise-only { display:inline-flex !important; }
/* The URL under test, pinned above every step of a case. Locked grey: it is the URL the start gate checked. */
.trk-urlbar { display:flex; gap:8px; align-items:baseline; flex-wrap:wrap; margin:6px 0 12px; padding:9px 13px;
  border:1px solid var(--line); border-radius:10px; background:var(--panel2, #f1f3f8); color:var(--muted); font-size:13px; }
.trk-urlbar b { color:var(--ink); font-weight:600; word-break:break-all; }
.trk-urlbar .trk-urlbar-k { font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; }
/* Auditor = read-only. Hides every write control on its two pages; the server refuses the writes regardless. */
body.is-auditor [data-gtab="gen"], body.is-auditor #gtab-gen, body.is-auditor #genSubmitSel, body.is-auditor #genCompSel,
body.is-auditor .grc-check, body.is-auditor .genrepo-card .grc-foot .btn,
body.is-auditor [data-trksub="new"] { display:none !important; }
.ai-data { margin-top:10px; border:1px solid var(--line); border-radius:12px; overflow:hidden; background:var(--panel); }
.ai-data-h { font-size:11.5px; font-weight:600; letter-spacing:.02em; color:var(--muted); background:var(--line-soft); padding:7px 12px; }
.ai-row { display:flex; align-items:center; gap:10px; padding:8px 12px; border-top:1px solid var(--line-soft); font-size:13px; }
.ai-row:first-of-type { border-top:none; }
.ai-row.ai-nav { cursor:pointer; transition:background var(--t-fast); }
.ai-row.ai-nav:hover { background:var(--accent-soft); }
.ai-row.ai-nav:focus-visible { background:var(--accent-soft); }  /* keep the global outline; these rows are role=button */
.ai-nav-go { margin-left:8px; color:var(--accent); font-weight:700; opacity:0; transition:opacity var(--t-fast); }
.ai-row.ai-nav:hover .ai-nav-go, .ai-row.ai-nav:focus-visible .ai-nav-go { opacity:1; }
/* Keep BIN result rows on one straight line: pin fixed bits, let only the issuer shrink+ellipsis. */
.ai-row > .mono, .ai-row .ai-meta, .ai-row .badge, .ai-row .ai-nav-go { flex:0 0 auto; white-space:nowrap; }
.ai-row .ai-issuer { flex:1 1 auto; min-width:0; margin-left:auto; text-align:right; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tool-strip { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; }
.tool-chip { display:inline-flex; align-items:center; gap:6px; font-size:11.5px; font-weight:600; padding:4px 10px; border-radius:999px;
  background:var(--accent-soft); color:var(--accent); border:1px solid var(--accent-soft-2); }
.tool-chip svg { width:13px; height:13px; }
.tool-chip.run { background:var(--accent); color:#fff; border-color:var(--accent); }
.tool-chip.done { opacity:.85; }
.tool-chip .spin { width:11px; height:11px; border:2px solid rgba(255,255,255,.45); border-top-color:#fff; border-radius:50%; animation:spin .7s linear infinite; }
.result-banner { padding:9px 13px; border-radius:9px; font-weight:600; font-size:13px; margin-bottom:10px; }
.result-banner.ok { background:var(--ok-soft); color:var(--ok); }
.result-banner.warn { background:var(--warn-soft); color:var(--warn); }
.result-banner.bad { background:var(--bad-soft); color:var(--bad); }
@keyframes flashRow { from { background:var(--accent-soft); } to { background:transparent; } }
.exprow.flash > td { animation:flashRow 1.4s ease; }

/* ---------- responsive: collapsible sidebar ---------- */
@media (max-width:900px) {
  .sidebar { transform:translateX(-100%); box-shadow:20px 0 40px rgba(0,0,0,.25); }
  .sidebar.open { transform:translateX(0); }
  .sidebar.open ~ .sidebar-overlay { display:block; }
  .mobile-bar { display:flex; }
  main { margin-left:0; max-width:100%; padding:22px 16px 60px; }
}
/* legal pages (Privacy / Terms / Legal) — full-screen overlay, works pre- and post-login */
.legal-page { display:none; }
.legal-page.active { display:block; position:fixed; inset:0; z-index:200; overflow:auto; background:var(--bg); padding:32px 20px 64px; }
.legal-wrap { max-width:760px; margin:0 auto; }
.legal-wrap h1 { font-family:var(--font-display,inherit); font-size:26px; margin:14px 0 4px; color:var(--ink); }
.legal-wrap h2 { font-size:15px; margin:22px 0 6px; color:var(--ink); }
.legal-wrap p, .legal-wrap li { color:var(--muted); line-height:1.65; font-size:14px; }
.legal-wrap ul { padding-left:20px; }
.legal-meta { font-size:12px; color:var(--faint); margin:0 0 18px; }
.legal-back { margin-bottom:6px; }
/* app footer */
.app-footer { display:flex; flex-wrap:wrap; gap:10px 18px; align-items:center; justify-content:space-between;
  max-width:1100px; margin:40px auto 0; padding:18px 20px; border-top:1px solid var(--line); color:var(--faint); font-size:12px; }
.app-footer .foot-links { display:flex; gap:16px; flex-wrap:wrap; }
.app-footer a, .login-legal a { color:var(--muted); text-decoration:none; }
.app-footer a:hover, .login-legal a:hover { color:var(--accent); text-decoration:underline; }
.login-legal { margin-top:18px; padding-top:14px; border-top:1px solid var(--line); text-align:center; font-size:11px; color:var(--faint); line-height:1.7; }
.login-legal .foot-links { display:flex; gap:14px; justify-content:center; flex-wrap:wrap; margin-top:4px; }
