:root {
  --bg: #eef2f9;
  --bg2: #e7ecf6;
  --card: #ffffff;
  --ink: #0b1220;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e6eaf2;
  --brand: #2563eb;
  --brand-2: #0ea5e9;
  --brand-dark: #1d4ed8;
  --indigo: #4f46e5;
  --good: #16a34a;
  --warn: #d97706;
  --crit: #dc2626;
  --info: #2563eb;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 10px 30px -10px rgba(15, 23, 42, .18);
  --shadow-lg: 0 20px 50px -16px rgba(15, 23, 42, .35);
  --grad-brand: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  --grad-ink: linear-gradient(120deg, #0b1220 0%, #1e293b 60%, #1e3a8a 140%);
  --font: "Plus Jakarta Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(14,165,233,.10), transparent 60%),
    radial-gradient(800px 480px at -5% 0%, rgba(79,70,229,.10), transparent 55%),
    var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Top nav ---------- */
.nav {
  background: var(--grad-ink);
  color: #fff;
  padding: 0 26px;
  display: flex; align-items: center; justify-content: space-between;
  height: 66px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 6px 24px -12px rgba(2, 6, 23, .7);
  border-bottom: 1px solid rgba(148,163,184,.16);
}
.nav .brand { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: .2px; font-size: 16px; }
.nav .brand .logo {
  width: 34px; height: 34px; border-radius: 10px; display: block;
  box-shadow: 0 6px 18px -6px rgba(155, 19, 251, .75);
}
.nav .brand small { display: block; font-weight: 600; font-size: 10px; color: #7dd3fc; letter-spacing: 2.5px; text-transform: uppercase; margin-top: 1px; }
.nav .nav-right { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.nav .nav-right > a { color: #cbd5e1; font-weight: 600; transition: color .15s; }
.nav .nav-right > a:hover { color: #fff; text-decoration: none; }
.nav .who { color: #cbd5e1; font-size: 13px; }
.nav .who b { color: #fff; }
.nav .role-pill { font-size: 9.5px; text-transform: uppercase; letter-spacing: .8px; background: rgba(59,130,246,.25); color: #bfdbfe; padding: 3px 9px; border-radius: 20px; margin-left: 7px; border: 1px solid rgba(59,130,246,.35); font-weight: 700; }
.linkbtn { background: rgba(255,255,255,.06); border: 1px solid #475569; color: #e2e8f0; padding: 7px 14px; border-radius: 9px; cursor: pointer; font-size: 13px; font-family: var(--font); font-weight: 600; transition: all .15s; }
.linkbtn:hover { background: #334155; color: #fff; border-color: #64748b; }

.wrap { max-width: 1060px; margin: 0 auto; padding: 34px 24px 70px; }
.page-title { font-size: 30px; font-weight: 800; letter-spacing: -.5px; margin: 4px 0 6px; }
.page-sub { color: var(--muted); margin: 0 0 26px; font-size: 15.5px; max-width: 70ch; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-bottom: 24px;
}
.card h2 { margin: 0 0 16px; font-size: 19px; font-weight: 700; letter-spacing: -.2px; }

/* ---------- Audit form ---------- */
.url-row { display: flex; gap: 12px; flex-wrap: wrap; }
.url-row input[type=text] {
  flex: 1; min-width: 260px; padding: 16px 18px; font-size: 16px; font-family: var(--font);
  border: 1.5px solid var(--line); border-radius: 12px; outline: none; background: #f7f9fc;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.url-row input[type=text]:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(37,99,235,.14); background: #fff; }

.btn {
  background: var(--grad-brand); color: #fff; border: none; padding: 15px 26px;
  font-size: 15px; font-weight: 700; border-radius: 12px; cursor: pointer; font-family: var(--font);
  box-shadow: 0 10px 22px -10px rgba(37,99,235,.8);
  transition: transform .12s ease, box-shadow .15s ease, filter .15s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.04); box-shadow: 0 16px 30px -12px rgba(37,99,235,.85); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost { background: #fff; color: var(--brand); border: 1.5px solid #c7d6fb; box-shadow: none; }
.btn-ghost:hover { background: #eff5ff; filter: none; box-shadow: 0 6px 16px -10px rgba(37,99,235,.6); }

.modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 20px 0 6px; }
.module {
  position: relative; border: 1.5px solid var(--line); border-radius: 14px; padding: 16px 16px 16px 18px; cursor: pointer;
  display: flex; gap: 13px; align-items: flex-start; background: #fff; overflow: hidden;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .12s;
}
.module::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: transparent; transition: background .15s; }
.module:hover { border-color: #c7d6fb; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.module.on { border-color: var(--brand); background: linear-gradient(180deg, #f5f9ff, #eef5ff); }
.module.on::before { background: var(--grad-brand); }
.module input { margin-top: 2px; width: 19px; height: 19px; accent-color: var(--brand); flex: none; cursor: pointer; }
.module .m-name { font-weight: 700; font-size: 14.5px; }
.module .m-desc { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.45; }

.toggle-all { display: flex; gap: 10px; margin: 4px 0 0; }
.toggle-all .btn { padding: 9px 16px; font-size: 13px; }

.err { background: #fff1f2; border: 1px solid #fecdd3; color: #be123c; padding: 13px 15px; border-radius: 11px; margin-top: 16px; display: none; font-size: 14px; font-weight: 500; }
.err.show { display: block; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 700; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f8fafc; }
td .url-cell { max-width: 440px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; font-weight: 600; color: var(--ink-soft); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 4px 11px; border-radius: 20px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.done { background: #dcfce7; color: #15803d; }
.status.running, .status.queued { background: #dbeafe; color: #1d4ed8; }
.status.error { background: #fee2e2; color: #b91c1c; }
.empty { color: var(--muted); padding: 26px 0; text-align: center; font-size: 14.5px; }
.row-actions { display: flex; gap: 12px; }
.row-actions a { font-weight: 600; }

/* ---------- Progress ---------- */
.progress-wrap { text-align: center; padding: 34px 0 18px; }
.audit-progress .t-url { color: var(--brand); }
.pct { font-size: 78px; font-weight: 800; letter-spacing: -2px; line-height: 1; margin: 14px 0 4px;
  background: linear-gradient(120deg, #2563eb, #0ea5e9, #22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums; }
.pct-sign { font-size: 34px; -webkit-text-fill-color: #94a3b8; color: #94a3b8; margin-left: 4px; }
.bar { position: relative; height: 18px; background: #e6edf6; border-radius: 12px; overflow: hidden; margin: 16px auto 18px; max-width: 560px; box-shadow: inset 0 2px 5px rgba(15,23,42,.14); }
.bar > span { display: block; height: 100%; width: 0%; border-radius: 12px; position: relative;
  background: linear-gradient(90deg, #2563eb, #0ea5e9, #22d3ee, #2563eb); background-size: 300% 100%;
  animation: flow 2.2s linear infinite; transition: width .4s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 16px rgba(34,211,238,.7); }
.bar > span::after { content: ""; position: absolute; inset: 0; border-radius: 12px;
  background-image: linear-gradient(45deg, rgba(255,255,255,.28) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.28) 50%, rgba(255,255,255,.28) 75%, transparent 75%);
  background-size: 26px 26px; animation: stripes .8s linear infinite; }
@keyframes flow { to { background-position: 300% 0; } }
@keyframes stripes { to { background-position: 26px 0; } }
.stage { font-size: 15.5px; color: var(--muted); min-height: 22px; font-weight: 500; display: inline-flex; align-items: center; gap: 9px; }
.stage-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand-2); animation: pulse 1.3s ease-out infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(14,165,233,.55); } 100% { box-shadow: 0 0 0 12px rgba(14,165,233,0); } }
.skip-link { margin-top: 22px; }

/* ---------- Completion FX ---------- */
.fx-overlay { position: fixed; inset: 0; z-index: 9998; pointer-events: none; display: none; }
.fx-overlay.on { display: block; }
/* dim/blur backdrop behind the result card */
.fx-backdrop { position: fixed; inset: 0; z-index: 9997; display: none; opacity: 0; transition: opacity .35s ease;
  background: rgba(8, 12, 24, .62); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.fx-backdrop.on { display: block; opacity: 1; }
.fx-backdrop.bad { background: rgba(28, 6, 8, .66); }

/* centered result card */
.fx-banner { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 20px; pointer-events: none; opacity: 0; }
.fx-banner.on { opacity: 1; }
.fx-card { pointer-events: auto; width: 100%; max-width: 360px; background: #fff; border-radius: 22px; padding: 30px 30px 26px; text-align: center;
  box-shadow: 0 30px 80px -24px rgba(2, 6, 23, .7); border-top: 6px solid var(--g, #64748b);
  animation: cardPop .55s cubic-bezier(.2, 1.35, .4, 1) both; }
.fx-card.bad { animation: cardPop .55s cubic-bezier(.2,1.35,.4,1) both, badShake .4s linear .2s 2; }
.fx-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.fx-ring { width: 132px; height: 132px; border-radius: 50%; border: 8px solid var(--g, #64748b); display: grid; place-items: center; margin: 0 auto;
  box-shadow: 0 0 0 10px rgba(0,0,0,.02), 0 12px 40px -12px var(--g, #64748b); }
.fx-letter { font-size: 74px; font-weight: 800; line-height: 1; color: var(--g, #334155); }
.fx-score { font-size: 30px; font-weight: 800; margin-top: 16px; color: var(--ink); }
.fx-score small { font-size: 15px; color: var(--muted); font-weight: 600; }
.fx-msg { font-size: 19px; font-weight: 700; margin-top: 6px; color: var(--ink); }
.fx-cta { display: inline-block; margin-top: 20px; padding: 13px 24px; border-radius: 12px; font-weight: 800; font-size: 15px; color: #fff; background: var(--grad-brand); box-shadow: 0 12px 24px -10px rgba(37,99,235,.8); }
.fx-cta:hover { text-decoration: none; filter: brightness(1.05); }
@keyframes cardPop { from { opacity: 0; transform: scale(.8) translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes badShake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-10px) rotate(-1deg); } 75% { transform: translateX(10px) rotate(1deg); } }
body.doom::after { content: ""; position: fixed; inset: 0; z-index: 9997; pointer-events: none;
  box-shadow: inset 0 0 200px 46px rgba(220,38,38,.55); animation: doomPulse .9s ease-in-out infinite; }
@keyframes doomPulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.audit-progress.shake { animation: shake .4s cubic-bezier(.36,.07,.19,.97) infinite; }
@keyframes shake { 10%,90% { transform: translateX(-2px); } 20%,80% { transform: translateX(4px); } 30%,50%,70% { transform: translateX(-8px); } 40%,60% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) { .audit-progress.shake, body.doom::after, .bar > span::after { animation: none; } }

/* ---------- Grades ---------- */
.grade-A { --g: #16a34a; } .grade-B { --g: #65a30d; } .grade-C { --g: #d97706; }
.grade-D { --g: #ea580c; } .grade-F { --g: #dc2626; }
.grade-hero { display: flex; align-items: center; gap: 22px; border: 1px solid var(--line); border-left: 7px solid var(--g, #64748b); border-radius: 16px; padding: 20px 26px; margin: 4px 0 18px; background: #fff; box-shadow: var(--shadow); }
.grade-ring { width: 92px; height: 92px; border-radius: 50%; border: 6px solid var(--g, #64748b); display: grid; place-items: center; flex: none; box-shadow: inset 0 0 0 6px rgba(0,0,0,.02); }
.grade-letter { font-size: 50px; font-weight: 800; color: var(--g, #334155); line-height: 1; }
.grade-score { font-size: 36px; font-weight: 800; letter-spacing: -1px; } .grade-score small { font-size: 16px; color: var(--muted); font-weight: 600; }
.grade-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); font-weight: 700; }
.scorecards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 6px 0 24px; }
.scorecard { border: 1px solid var(--line); border-top: 4px solid var(--g, #64748b); border-radius: 14px; padding: 16px 18px; background: #fff; box-shadow: var(--shadow-sm); }
.sc-top { display: flex; justify-content: space-between; align-items: center; }
.sc-label { font-weight: 700; font-size: 15px; }
.sc-grade { font-size: 30px; font-weight: 800; color: var(--g, #334155); line-height: 1; }
.sc-bar { height: 8px; background: #eef2f7; border-radius: 6px; margin: 10px 0 6px; overflow: hidden; }
.sc-bar > span { display: block; height: 100%; background: var(--g, #64748b); border-radius: 6px; }
.sc-score { font-weight: 700; } .sc-score small { color: var(--muted); font-weight: 600; }
.sc-summary { margin: 8px 0 0; color: var(--ink-soft); font-size: 13px; }

/* ---------- Report ---------- */
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.report-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 6px 0 22px; padding: 16px 18px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 14px; }
.report-meta .meta-k { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; margin-bottom: 3px; }
.report-meta a { word-break: break-all; font-weight: 600; }
.report-section { margin: 26px 0; }
.report-section h2 { font-size: 19px; font-weight: 700; letter-spacing: -.2px; border-bottom: 2px solid var(--line); padding-bottom: 9px; position: relative; }
.report-section h2::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 54px; height: 2px; background: var(--grad-brand); }
.section-summary { color: var(--ink-soft); }
.report-section.exec p { font-size: 15.5px; color: var(--ink-soft); }
.finding { border-left: 4px solid #cbd5e1; background: #f8fafc; padding: 13px 15px; margin: 11px 0; border-radius: 0 11px 11px 0; transition: box-shadow .15s; }
.finding:hover { box-shadow: var(--shadow-sm); }
.finding.status-good { border-left-color: var(--good); background: #f3fbf5; }
.finding.status-warning { border-left-color: var(--warn); background: #fffbf2; }
.finding.status-critical { border-left-color: var(--crit); background: #fef5f5; }
.finding.status-info { border-left-color: var(--info); background: #f4f8ff; }
.finding-head { display: flex; align-items: center; gap: 11px; }
.finding-item { font-weight: 700; }
.finding-detail { margin: 8px 0 0; color: var(--ink-soft); }
.finding-rec { margin: 8px 0 0; color: #1e3a8a; }
.badge { font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; padding: 4px 10px; border-radius: 20px; color: #fff; white-space: nowrap; }
.badge-good { background: var(--good); } .badge-warning { background: var(--warn); } .badge-critical { background: var(--crit); } .badge-info { background: var(--info); }
.assess { font-weight: 800; }
.assess-strong, .assess-good { color: var(--good); } .assess-needs_improvement { color: var(--warn); } .assess-poor { color: var(--crit); }
.prio-list { list-style: none; padding: 0; margin: 0; }
.prio { display: flex; gap: 15px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.prio:last-child { border-bottom: none; }
.prio-badge { font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; padding: 4px 10px; border-radius: 20px; color: #fff; height: fit-content; white-space: nowrap; }
.prio-badge-high { background: var(--crit); } .prio-badge-medium { background: var(--warn); } .prio-badge-low { background: var(--info); }
.prio-rec { font-weight: 700; margin: 0; }
.prio-rationale { margin: 5px 0 0; color: var(--ink-soft); }
/* action plan */
.fix { border: 1px solid var(--line); border-left: 5px solid #94a3b8; border-radius: 12px; padding: 16px 18px; margin: 12px 0; background: #fff; box-shadow: var(--shadow-sm); }
.fix.prio-high { border-left-color: var(--crit); } .fix.prio-medium { border-left-color: var(--warn); } .fix.prio-low { border-left-color: var(--info); }
.fix-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fix-num { width: 26px; height: 26px; border-radius: 50%; background: #0f172a; color: #fff; font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.fix-title { font-weight: 700; font-size: 16px; }
.effort { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; padding: 3px 9px; border-radius: 20px; margin-left: auto; }
.effort-quick { background: #dcfce7; color: #15803d; } .effort-moderate { background: #fef9c3; color: #854d0e; } .effort-involved { background: #fee2e2; color: #991b1b; }
.fix-issue { margin: 10px 0 0; color: var(--ink-soft); }
.fix-how { margin: 12px 0 4px; font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.fix-steps { margin: 4px 0 0; padding-left: 22px; }
.fix-steps li { margin: 6px 0; color: var(--ink-soft); }
.disclaimer { margin-top: 28px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 15px; }

/* ---------- Login ---------- */
.login-page { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 24px; overflow: hidden;
  background: radial-gradient(1200px 700px at 50% -20%, #1e3a8a, #0b1220 70%); }
.login-aurora { position: absolute; inset: -30%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(420px 420px at 20% 30%, rgba(37,99,235,.55), transparent 60%),
    radial-gradient(460px 460px at 80% 70%, rgba(14,165,233,.45), transparent 60%),
    radial-gradient(380px 380px at 65% 20%, rgba(79,70,229,.45), transparent 60%);
  filter: blur(30px); animation: drift 16s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate3d(-3%, -2%, 0) scale(1); } to { transform: translate3d(4%, 3%, 0) scale(1.08); } }
.login-card {
  position: relative; z-index: 1;
  background: rgba(255,255,255,.97);
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 22px; box-shadow: var(--shadow-lg);
  padding: 40px 36px 30px; width: 100%; max-width: 410px;
  backdrop-filter: blur(8px);
}
.login-card .logo-big { width: 58px; height: 58px; border-radius: 16px; display: block; margin-bottom: 18px; box-shadow: 0 12px 28px -8px rgba(155, 19, 251, .7); }
.login-card h1 { margin: 0 0 3px; font-size: 24px; font-weight: 800; letter-spacing: -.4px; }
.login-card .sub { color: var(--muted); margin: 0 0 22px; font-size: 14.5px; }
.login-card label { display: block; font-size: 13px; font-weight: 700; margin: 16px 0 7px; color: var(--ink-soft); }
.login-card input { width: 100%; padding: 13px 15px; border: 1.5px solid var(--line); border-radius: 11px; font-size: 15px; font-family: var(--font); transition: border-color .15s, box-shadow .15s; }
.login-card input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(37,99,235,.14); }
.login-card .btn { width: 100%; margin-top: 24px; }
.login-err { background: #fff1f2; border: 1px solid #fecdd3; color: #be123c; padding: 12px 14px; border-radius: 11px; font-size: 14px; margin-bottom: 4px; font-weight: 500; }
.captcha-box { display: inline-block; margin: 2px 0 4px; padding: 4px; background: #eef3fb; border: 1px solid #d6e2fe; border-radius: 14px; line-height: 0; box-shadow: var(--shadow-sm); }
.captcha-box svg { display: block; border-radius: 11px; }
.login-foot { text-align: center; color: #94a3b8; font-size: 12px; margin: 22px 0 0; letter-spacing: .3px; }

/* ---------- Warp-speed transition ---------- */
.warp-overlay { position: fixed; inset: 0; z-index: 9999; background: #020614; display: none; opacity: 0; transition: opacity .2s ease; }
.warp-overlay.on { display: block; opacity: 1; }
#warp-caption { position: fixed; left: 0; right: 0; bottom: 16%; z-index: 10000; text-align: center;
  font-family: var(--font); font-weight: 800; letter-spacing: 4px; text-transform: uppercase; font-size: 15px;
  color: #cfe7ff; text-shadow: 0 0 22px rgba(96,165,250,.9), 0 0 6px rgba(186,230,253,.8);
  opacity: 0; transition: opacity .4s ease .15s; }
#warp-caption.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .warp-overlay, #warp-caption { transition: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .page-title { font-size: 25px; }
  .nav .who { display: none; }
  .url-row .btn { width: 100%; }
}

/* ---------- Use-code / login extras ---------- */
.login-or { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: #94a3b8; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.use-code-btn { display: block; width: 100%; text-align: center; }
.use-code-btn:hover { text-decoration: none; }

/* ---------- Admin: client codes ---------- */
.code-gen { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 4px 0 18px; }
.code-gen input[type=text] { flex: 1; min-width: 220px; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 10px; font-family: var(--font); font-size: 14px; }
.code-gen input[type=text]:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.14); }
.code-max { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.code-max input { width: 64px; padding: 10px; border: 1.5px solid var(--line); border-radius: 10px; font-family: var(--font); }
.code-gen .btn { padding: 11px 18px; }
.code-chip { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 700; letter-spacing: 1px; background: #eef4ff; border: 1px solid #d6e2fe; color: #1d4ed8; padding: 4px 10px; border-radius: 8px; white-space: nowrap; }
.linkbtn.dark { background: #fff; border: 1px solid var(--line); color: var(--ink-soft); }
.linkbtn.dark:hover { background: #f1f5f9; color: var(--ink); border-color: #cbd5e1; }
.linkbtn.dark.danger { color: #b91c1c; border-color: #fecaca; }
.linkbtn.dark.danger:hover { background: #fef2f2; color: #991b1b; }

/* ---------- Guest report CTA ---------- */
.cta { background: var(--grad-ink); color: #fff; border-radius: 16px; padding: 26px 28px; display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: center; box-shadow: var(--shadow); }
.cta-title { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.cta-sub { margin: 6px 0 0; color: #cbd5e1; font-size: 14px; max-width: 56ch; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.cta-btn { display: inline-flex; align-items: center; gap: 6px; padding: 13px 20px; border-radius: 12px; font-weight: 800; font-size: 15px; text-decoration: none; transition: transform .12s ease, filter .15s; }
.cta-btn:hover { transform: translateY(-1px); filter: brightness(1.05); text-decoration: none; }
.cta-call { background: linear-gradient(135deg,#22d3ee,#0ea5e9); color: #04121f; }
.cta-web { background: #fff; color: var(--brand-dark); }

/* ---------- Admin: prompt editor ---------- */
.prompt-label { display: block; font-weight: 700; font-size: 13px; margin: 14px 0 6px; color: var(--ink-soft); }
.prompt-area { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 16px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.5; color: var(--ink); background: #f8fafc; resize: vertical; }
.prompt-area:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.14); background: #fff; }
.prompt-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.prompt-actions .btn { padding: 11px 18px; font-size: 14px; }

/* ---------- Admin tabs + prompt history ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 22px; border-bottom: 2px solid var(--line); }
.tab { padding: 11px 18px; font-weight: 700; font-size: 14px; color: var(--muted); border-radius: 10px 10px 0 0; position: relative; top: 2px; border: 2px solid transparent; border-bottom: none; }
.tab:hover { color: var(--ink); text-decoration: none; background: #f1f5f9; }
.tab.on { color: var(--brand-dark); background: #fff; border-color: var(--line); border-bottom: 2px solid #fff; }
.hist { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.hist-h { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.hist-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid #f1f5f9; }

/* ---------- Live audit console (hacker terminal) ---------- */
.console { max-width: 660px; margin: 20px auto 0; background: #0a0f1a; border: 1px solid #1e293b; border-radius: 12px; overflow: hidden; box-shadow: 0 18px 40px -16px rgba(2,6,23,.7), inset 0 0 60px rgba(34,211,238,.04); text-align: left; }
.console-bar { display: flex; align-items: center; gap: 7px; padding: 9px 13px; background: #0f172a; border-bottom: 1px solid #1e293b; }
.cdot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.cdot.r { background: #ff5f56; } .cdot.y { background: #ffbd2e; } .cdot.g { background: #27c93f; }
.console-title { margin-left: 8px; color: #64748b; font-size: 11px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .5px; }
.console-body { height: 210px; overflow-y: auto; padding: 12px 14px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.65; color: #cbd5e1; scroll-behavior: smooth; }
.console-body::after { content: "▋"; color: #22d3ee; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.cline { white-space: pre-wrap; word-break: break-word; }
.ctime { color: #475569; }
.cok { color: #34d399; font-weight: 700; }
.cerr { color: #f87171; font-weight: 700; }
.cmut { color: #64748b; }
.cboot { color: #93c5fd; }
.cdone { color: #fff; font-weight: 700; }
.console-body::-webkit-scrollbar { width: 8px; }
.console-body::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 8px; }

/* ============================================================
   Colored desktop scrollbar (iOS Safari uses overlay bars, so
   this only affects desktop — exactly as intended)
   ============================================================ */
html { scrollbar-color: #2563eb #e7ecf6; scrollbar-width: thin; }
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: #e7ecf6; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #2563eb, #0ea5e9); border-radius: 10px; border: 3px solid #e7ecf6; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #1d4ed8, #0284c7); }
::-webkit-scrollbar-corner { background: #e7ecf6; }

/* Safari niceties */
.login-card { -webkit-backdrop-filter: blur(8px); }
.login-page { min-height: 100vh; min-height: 100dvh; }

/* ============================================================
   Mobile / iPhone Safari responsiveness
   ============================================================ */
@media (max-width: 720px) {
  .wrap { padding: 22px 15px 60px; }
  .nav { padding: 0 15px; height: 60px; }
  .nav .brand { font-size: 15px; gap: 9px; }
  .nav .brand .logo { width: 30px; height: 30px; }
  .nav .nav-right { gap: 13px; font-size: 13px; }
  .nav .who, .nav .role-pill { display: none; }
  .linkbtn { padding: 6px 11px; }

  .page-title { font-size: 23px; }
  .page-sub { font-size: 14.5px; }
  .card { padding: 18px 16px; border-radius: 14px; }
  .card h2 { font-size: 17px; }

  /* prevent iOS auto-zoom on focus: inputs must be >= 16px */
  .login-card input, .url-row input[type=text], .code-gen input[type=text],
  #captcha, .prompt-area, input[type=email], input[type=password], input[type=number] { font-size: 16px; }

  .url-row { gap: 10px; }
  .url-row input[type=text] { min-width: 0; }
  .url-row .btn { width: 100%; }
  .toggle-all { flex-wrap: wrap; }
  .modules { grid-template-columns: 1fr; gap: 10px; }

  /* horizontally scrollable data tables */
  .card table { display: block; width: 100%; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  td .url-cell { max-width: 190px; }

  /* report */
  .report-head { flex-direction: column; align-items: stretch; }
  .report-head .row-actions { width: 100%; }
  .report-head .row-actions .btn { flex: 1; text-align: center; }
  .report-meta { grid-template-columns: 1fr; }
  .grade-hero { flex-direction: column; text-align: center; align-items: center; gap: 12px; padding: 20px; }
  .grade-ring { width: 80px; height: 80px; border-width: 5px; }
  .grade-letter { font-size: 44px; }
  .scorecards { grid-template-columns: 1fr; }

  /* progress */
  .pct { font-size: 60px; }
  .pct-sign { font-size: 26px; }
  .console { max-width: 100%; }
  .console-body { height: 168px; font-size: 11.5px; }

  /* finale card */
  .fx-card { max-width: 320px; padding: 26px 22px; }
  .fx-ring { width: 108px; height: 108px; border-width: 7px; }
  .fx-letter { font-size: 58px; }
  .fx-score { font-size: 26px; }
  .fx-msg { font-size: 17px; }

  /* admin */
  .tabs { gap: 3px; }
  .tab { padding: 9px 12px; font-size: 13px; }
  .code-gen { gap: 8px; }
  .code-gen input[type=text] { min-width: 0; flex: 1 1 100%; }
  .hist-row { flex-direction: column; align-items: flex-start; gap: 4px; }

  /* guest report CTA */
  .cta { padding: 20px; }
  .cta-actions { width: 100%; }
  .cta-btn { flex: 1; text-align: center; justify-content: center; }
}

@media (max-width: 400px) {
  .nav .brand small { display: none; }
  .page-title { font-size: 21px; }
  .pct { font-size: 52px; }
  .login-card { padding: 28px 20px; }
}

/* prevent long URLs/paths in reports from forcing horizontal scroll */
.report p, .report li, .finding-item, .fix-title, .sc-summary, .section-summary,
.finding-detail, .finding-rec, .fix-issue, .prio-rec, .prio-rationale, .cta-sub, .disclaimer { overflow-wrap: anywhere; }
.report a, .report-meta a { word-break: break-all; }
