/* ===========================================================================
   Sentinel — dashboard UI
   Visual design adapted from "Crypto Dashboard Wallet WhiteLabel" by CaIN
   (https://codepen.io/realCaiN/pen/PordyGX) — MIT License, Copyright (c) 2026 CaIN.
   Fonts: Inter and Space Grotesk, SIL Open Font License 1.1 (see fonts/OFL-*.txt).
   =========================================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('fonts/space-grotesk-latin.woff2') format('woff2');
}

:root {
  --bg: #08090d;
  --panel: #101219;
  --panel-2: #151824;
  --panel-hover: #1a1e2b;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);
  --text: #e9ebf2;
  --muted: #8a90a4;
  --faint: #636a7d;

  --accent: #7c6cff;
  --accent-2: #5a48e8;
  --accent-deep: #4a3dd6;
  --accent-soft: rgba(124, 108, 255, 0.16);
  --accent-ring: rgba(124, 108, 255, 0.3);
  --up: #23d29a;
  --down: #ff5b6e;

  --critical: #ff5d6c;
  --high: #ff9d42;
  --medium: #f5c542;
  --low: #5aa2ff;
  --info: #43d6a0;

  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 9px;
  --shadow: 0 20px 50px -24px rgba(0, 0, 0, 0.75);

  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', 'Cascadia Code', Menlo, Consolas, monospace;

  --safe-b: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 66px;
}

/* ---------------- base ---------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-color: rgba(255, 255, 255, 0.14) transparent; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(124, 108, 255, 0.12), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(35, 210, 154, 0.07), transparent 55%),
    var(--bg);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: #9d91ff; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: rgba(124, 108, 255, 0.35); }
[hidden] { display: none !important; }

/* numbers tabular where they matter */
.mono, .mono-sm, .score-num b, .sev-count b, .cov-stat b, .q-cat .top b, .stat-value { font-variant-numeric: tabular-nums; }

/* ---------------- brand ---------------- */
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.logo {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--accent), var(--accent-deep));
  box-shadow: 0 6px 18px -6px var(--accent);
}
.logo.sm { width: 36px; height: 36px; border-radius: 11px; }
.wordmark { font-family: var(--display); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.01em; color: var(--text); }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 18px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font-family: var(--sans); font-weight: 600; font-size: 14.5px; color: var(--text);
  white-space: nowrap; text-decoration: none;
  transition: transform 0.18s ease, background 0.2s ease, border-color 0.2s ease, filter 0.2s ease, color 0.2s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 24px -12px var(--accent); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-ghost { background: var(--panel-2); border-color: var(--border); color: var(--muted); font-weight: 500; }
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--border-strong); background: var(--panel-hover); }
.btn-danger { background: rgba(255, 91, 110, 0.08); border-color: rgba(255, 91, 110, 0.3); color: var(--down); font-weight: 500; }
.btn-danger:hover:not(:disabled) { background: rgba(255, 91, 110, 0.15); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 13px; border-radius: var(--radius-xs); }
.btn-block { width: 100%; }
/* icon-only compact button (e.g. row delete) */
.btn-icon { padding: 6px; width: 34px; }
.btn-icon svg { width: 16px; height: 16px; }
.btn-ghost.danger:hover:not(:disabled) { color: var(--down); border-color: rgba(255, 91, 110, 0.4); background: rgba(255, 91, 110, 0.1); }

.icon-btn {
  position: relative; display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; padding: 0;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--panel); color: var(--muted);
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.icon-btn:hover { color: var(--text); background: var(--panel-hover); border-color: var(--border-strong); }

/* ---------------- forms ---------------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.field-hint { font-size: 12px; color: var(--faint); }
.field input, .field select, .modal input:not([type='checkbox']), .modal select {
  width: 100%; min-height: 46px; padding: 11px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field select, .modal select {
  appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a90a4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.field select option, .modal select option { background: var(--panel-2); color: var(--text); }
.field input:focus, .field select:focus, .modal input:not([type='checkbox']):focus, .modal select:focus {
  outline: none; border-color: rgba(124, 108, 255, 0.6); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input:disabled { opacity: 0.6; }
.field input::placeholder, .modal input::placeholder { color: var(--faint); }
.form-msg { font-size: 13px; min-height: 18px; margin-top: 8px; }
.form-msg.err { color: var(--down); }
.form-msg.ok { color: var(--up); }

/* ===========================================================================
   AUTH
   =========================================================================== */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; }

.auth-brand {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  padding: 44px 52px;
  border-right: 1px solid var(--border);
  background:
    radial-gradient(700px 440px at 0% 0%, rgba(124, 108, 255, 0.26), transparent 60%),
    radial-gradient(600px 420px at 100% 100%, rgba(35, 210, 154, 0.1), transparent 60%),
    rgba(12, 14, 20, 0.6);
}
.auth-brand::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.35;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 30%, #000 20%, transparent 70%);
  mask-image: radial-gradient(ellipse at 30% 30%, #000 20%, transparent 70%);
}
.auth-brand-top, .auth-brand-mid, .auth-brand-foot { position: relative; z-index: 1; }
.auth-brand-mid { max-width: 480px; }
.auth-brand-mid h1 { font-size: clamp(30px, 3.2vw, 42px); line-height: 1.08; margin: 0 0 16px; }
.auth-brand-mid p { color: var(--muted); font-size: 15.5px; margin: 0 0 26px; }
.auth-feats { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.auth-feats li { display: flex; align-items: center; gap: 12px; color: #cfd3de; font-size: 14.5px; }
.auth-feats li svg { flex: none; width: 26px; height: 26px; padding: 5px; border-radius: 8px; color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-ring); }
.auth-brand-foot { color: var(--faint); font-size: 12.5px; display: flex; align-items: center; gap: 8px; }

.auth-panel { display: grid; place-items: center; padding: 40px 24px; }
.auth-card {
  width: 100%; max-width: 410px; padding: 30px 28px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.auth-card h2 { font-size: 1.55rem; margin: 0 0 6px; }
.auth-sub { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.auth-form { margin-top: 4px; }
.auth-form .btn { margin-top: 6px; min-height: 46px; }
.auth-toggle { margin-top: 18px; color: var(--muted); font-size: 14px; text-align: center; }

/* ===========================================================================
   APP SHELL
   =========================================================================== */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; gap: 28px;
  padding: 24px 16px;
  border-right: 1px solid var(--border);
  background: rgba(12, 14, 20, 0.6);
}
.side-brand { padding: 2px 8px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 12px; border: none; border-radius: var(--radius-sm);
  background: none; color: var(--muted); font-weight: 500; font-size: 14.5px; text-align: left;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.nav-item svg { flex: none; }
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.nav-item.active { color: var(--text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-ring); }
.nav-item.active svg { color: var(--accent); }
.side-foot { margin-top: auto; display: grid; gap: 10px; }

.net-pill {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  font-size: 12.5px; color: var(--muted); line-height: 1.35;
}
.net-pill .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--up); box-shadow: 0 0 0 3px rgba(35, 210, 154, 0.18); }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  min-height: 66px; padding: 12px clamp(16px, 3vw, 32px);
  border-bottom: 1px solid var(--border);
  background: rgba(8, 9, 13, 0.8);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.topbar .brand { display: none; }
.crumb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); min-width: 0; }
.crumb b { color: var(--text); font-weight: 600; font-family: var(--display); font-size: 15px; }
.crumb .sep { opacity: 0.5; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-btn {
  display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--panel); color: var(--text);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.user-btn:hover { border-color: var(--border-strong); background: var(--panel-hover); }
.user-btn.active { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.who { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; text-align: left; }
.who b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.who span { font-size: 11px; color: var(--muted); }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 600; letter-spacing: 0.3px; color: #fff;
  background: linear-gradient(140deg, var(--accent), var(--up));
}
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.lg { width: 76px; height: 76px; border-radius: 22px; font-family: var(--display); font-size: 26px; font-weight: 700; border: 4px solid var(--panel); }

.content { width: 100%; max-width: 1180px; margin: 0 auto; padding: clamp(20px, 3vw, 32px) clamp(16px, 3vw, 32px) 80px; animation: fade 0.35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.6rem; margin: 0; line-height: 1.2; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 0.92rem; }

/* bottom tab bar — phones only */
.tabbar { display: none; }

/* ---------------- panels ---------------- */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.panel.pad { padding: 22px; }
.panel-title { font-family: var(--display); font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 14px; }

/* ---------------- stat tiles ---------------- */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-tile { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.stat-label { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat-value { display: block; margin-top: 4px; font-family: var(--display); font-size: 1.7rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value.sm { font-size: 1.05rem; padding-top: 0.45rem; }
.stat-foot { display: block; margin-top: 4px; font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- notices ---------------- */
.notice { padding: 14px 16px; border-radius: var(--radius-sm); font-size: 14px; }
.notice.warn { border: 1px solid rgba(245, 197, 66, 0.32); background: rgba(245, 197, 66, 0.08); color: #efe0b4; }
.notice.err { border: 1px solid rgba(255, 91, 110, 0.32); background: rgba(255, 91, 110, 0.1); color: #ffd0d5; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty svg { color: var(--accent); margin: 0 auto 10px; display: block; }

/* ---------------- scan card ---------------- */
.scan-card { padding: 22px; }
.scan-row { display: flex; gap: 12px; flex-wrap: wrap; }
.url-field {
  flex: 1; min-width: 240px; display: flex; align-items: center; gap: 10px;
  padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg); color: var(--muted);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.url-field:focus-within { border-color: rgba(124, 108, 255, 0.6); box-shadow: 0 0 0 3px var(--accent-soft); }
.url-field svg { flex: none; }
.url-input { flex: 1; min-width: 0; padding: 13px 0; border: none; outline: none; background: transparent; color: var(--text); font-family: var(--mono); font-size: 15px; }
.url-input::placeholder { color: var(--faint); font-family: var(--sans); }
.scan-row .btn, .bulk-foot .btn { min-height: 48px; padding: 10px 22px; }
.scan-opts { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }

/* bulk list input */
.bulk-input {
  display: block; width: 100%; min-height: 132px; resize: vertical;
  padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font-family: var(--mono); font-size: 14px; line-height: 1.6;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.bulk-input:focus { outline: none; border-color: rgba(124, 108, 255, 0.6); box-shadow: 0 0 0 3px var(--accent-soft); }
.bulk-input::placeholder { color: var(--faint); }
.bulk-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.bulk-count { color: var(--muted); font-size: 13px; }
.bulk-count b { color: var(--text); font-weight: 600; }
.bulk-count .warn { color: var(--medium); }
.muted-inline { color: var(--faint); font-size: 13px; }

/* toggle switch */
.toggle { position: relative; display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; cursor: pointer; user-select: none; font-size: 14px; }
.toggle.disabled { opacity: 0.55; cursor: not-allowed; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.toggle .track { position: relative; width: 42px; height: 24px; flex: none; border-radius: 999px; background: rgba(255, 255, 255, 0.14); transition: background 0.2s ease; }
.toggle .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s ease; }
.toggle input:checked + .track { background: var(--accent); }
.toggle input:checked + .track::after { transform: translateX(18px); }
.toggle input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

.auth-box {
  margin-top: 18px; padding: 13px 15px; border-radius: var(--radius-sm);
  display: flex; gap: 11px; align-items: flex-start; cursor: pointer;
  border: 1px solid rgba(245, 197, 66, 0.26); background: rgba(245, 197, 66, 0.06);
  font-size: 13.5px; color: #e7dfc4;
}
.auth-box input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }

/* ---------------- progress ---------------- */
.progress-card { margin-top: 18px; padding: 22px; }
.progress-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.progress-head > div:nth-child(2) { min-width: 0; }
.progress-head h3 { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.progress-head .sub { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.progress-head .btn { margin-left: auto; }
.spinner { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.12); border-top-color: var(--accent); animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.45; } }
.steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.step { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: var(--radius-xs); background: var(--panel-2); border: 1px solid var(--border); font-size: 13px; color: var(--muted); min-width: 0; }
.step .lab { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.step.running .dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); animation: pulse 1s infinite; }
.step.done { color: var(--text); }
.step.done .dot { background: var(--up); }
.step.error .dot { background: var(--down); }
.step .count { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--faint); flex: none; }

/* progress bar */
.progress-bar { position: relative; height: 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); overflow: hidden; margin-bottom: 16px; }
.progress-bar > i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #43d6a0); transition: width 0.35s ease; }
.progress-bar.full > i { background: var(--up); }
.progress-bar .bar-pct { position: absolute; right: 8px; top: -20px; font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* live attack console */
.console-wrap { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius-xs); background: #0a0d14; overflow: hidden; }
.console-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--border); background: var(--panel-2); }
.console-head .btn { padding: 2px 6px; }
.console-head .console-count { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--faint); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--down); box-shadow: 0 0 0 3px rgba(255,93,108,0.18); animation: pulse 1s infinite; flex: none; }
.attack-console { max-height: 260px; overflow: auto; padding: 8px 10px; font-family: var(--mono); font-size: 12px; line-height: 1.5; }
.attack-console .cline { display: flex; gap: 8px; white-space: nowrap; }
.attack-console .cline .m { flex: none; width: 46px; color: #7c6cff; font-weight: 600; }
.attack-console .cline .m.POST { color: #f5c542; }
.attack-console .cline .m.PUT, .attack-console .cline .m.DELETE { color: #ff5d6c; }
.attack-console .cline .u { color: #9aa4b2; overflow: hidden; text-overflow: ellipsis; }

/* bulk queue */
.bq-panel { margin-top: 18px; }
.bq-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 8px; flex-wrap: wrap; }
.bq-head h3 { margin: 0; font-size: 1.05rem; }
.bq-head .sub { font-size: 13px; }
.bq-scroll { max-height: 560px; overflow: auto; }
.bq-scroll thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.data-table tr.selected td { background: var(--panel-hover); border-color: var(--accent-ring); }
.bq-err { font-size: 12px; color: var(--down); margin-top: 3px; max-width: 420px; }
.bq-status { font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.bq-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.bq-queued, .bq-skipped { color: var(--faint); }
.bq-running { color: var(--accent); }
.bq-running::before { animation: pulse 1s infinite; }
.bq-done { color: var(--up); }
.bq-failed { color: var(--down); }
.bq-stopped { color: var(--medium); }
.bq-issues { display: flex; gap: 10px; flex-wrap: wrap; }
.bq-issue { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 12.5px; }
.bq-issue i { width: 8px; height: 8px; border-radius: 50%; }

/* ---------------- results: hero ---------------- */
.results-mount { margin-top: 22px; scroll-margin-top: 80px; }
.hero { padding: 26px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: center; position: relative; }
.hero::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-deep) 55%, var(--up)); opacity: 0.85; }
.ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ring { position: relative; width: 160px; height: 160px; }
.ring svg { transform: rotate(-90deg); width: 100%; height: 100%; display: block; }
.ring .score-num { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; }
.ring .score-num b { font-family: var(--display); font-size: 44px; font-weight: 700; letter-spacing: -1px; line-height: 1; text-align: center; }
.ring .score-num span { font-size: 10.5px; color: var(--muted); letter-spacing: 0.6px; margin-top: 6px; display: block; text-align: center; }
.grade-badge { font-size: 13px; font-weight: 700; padding: 4px 14px; border-radius: 999px; }
.hero-main { min-width: 0; }
.hero-main h2 { margin: 0 0 4px; font-family: var(--sans); font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; }
.hero-main .target { font-family: var(--mono); font-size: 17px; overflow-wrap: anywhere; }
.threat-banner { margin: 15px 0; padding: 13px 15px; border-radius: var(--radius-sm); border: 1px solid; font-size: 13.5px; }
.threat-banner b { font-size: 14.5px; }
.sev-counts { display: flex; gap: 8px; flex-wrap: wrap; }
.sev-count { display: flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: var(--radius-xs); background: var(--panel-2); border: 1px solid var(--border); font-size: 13px; }
.sev-count b { font-family: var(--display); font-size: 16px; }
.sev-count .d { width: 9px; height: 9px; border-radius: 50%; }
.hero-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.meta-line { margin-top: 14px; color: var(--faint); font-size: 12.5px; }

/* ---------------- tabs (pill selector) ---------------- */
.tabs {
  display: flex; gap: 4px; margin: 22px 0 16px; padding: 4px;
  width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none;
  border-radius: 999px; border: 1px solid var(--border); background: var(--panel);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; padding: 8px 16px; border: none; border-radius: 999px; background: none;
  color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}
.tab:hover { color: var(--text); }
.tab.active { color: #fff; background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-ring); }
.tab .n { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-left: 6px; }

/* ---------------- findings ---------------- */
.filters { display: flex; gap: 7px; margin-bottom: 14px; flex-wrap: wrap; }
.filter {
  display: inline-flex; align-items: center; padding: 7px 13px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--panel-2);
  color: var(--muted); font-size: 12.5px; font-weight: 500; white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.filter:hover { color: var(--text); }
.filter.active { color: #fff; background: var(--accent-soft); border-color: rgba(124, 108, 255, 0.4); }
.fdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; }
.finding { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden; background: var(--panel); transition: border-color 0.2s ease; }
.finding:hover, .finding.open { border-color: var(--border-strong); }
.finding-head { display: flex; align-items: center; gap: 13px; padding: 15px 16px; cursor: pointer; }
.finding-head > div { min-width: 0; }
.finding-head:hover { background: var(--panel-2); }
.sev-pill { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; padding: 4px 9px; border-radius: 7px; text-transform: uppercase; flex: none; min-width: 66px; text-align: center; }
.finding-title { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.finding-cat { font-size: 12px; color: var(--muted); font-family: var(--mono); margin-top: 2px; overflow-wrap: anywhere; }
.caret { color: var(--muted); transition: transform 0.2s ease; flex: none; }
.finding.open .caret { transform: rotate(90deg); }
.finding-body { display: none; padding: 4px 16px 18px; border-top: 1px solid var(--border); }
.finding.open .finding-body { display: block; }
.fb-section { margin-top: 15px; }
.fb-section h4 { margin: 0 0 7px; font-size: 11px; letter-spacing: 0.7px; text-transform: uppercase; color: var(--muted); }
.fb-section p { margin: 0; color: #d4d7e0; font-size: 13.5px; line-height: 1.6; }
.evidence { margin: 0; padding: 12px 14px; max-height: 320px; overflow: auto; border-radius: var(--radius-xs); border: 1px solid var(--border); background: #06070b; color: #b9c0d2; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-word; }
.remediation { margin: 0; padding: 12px 14px; border-radius: var(--radius-xs); border: 1px solid rgba(35, 210, 154, 0.25); background: rgba(35, 210, 154, 0.06); color: #c3f0da; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-word; }
/* ---------------- proof of concept ---------------- */
.poc h4 { color: #ff9d6a; }
.poc-intro { color: var(--muted); font-size: 12px; margin: 0 0 10px; line-height: 1.5; }
.poc-entry { border: 1px solid var(--border-strong); border-radius: var(--radius-xs); padding: 11px 13px; margin: 10px 0; background: rgba(255, 157, 66, 0.045); }
.poc-step { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.poc-num { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; flex: none; }
.poc-step b { font-size: 13px; color: var(--text); }
.poc-proves { margin: 0 0 8px; font-size: 12.5px; color: #d4d7e0; line-height: 1.55; }
.poc-proves b { color: #ffb27a; }
.poc-lbl { font-size: 10px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--faint); margin: 9px 0 4px; font-weight: 700; }
.poc-lbl.curl-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.poc-pre { margin: 0; padding: 10px 12px; border-radius: var(--radius-xs); border: 1px solid var(--border); background: #06070b; color: #b9c0d2; font-family: var(--mono); font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 280px; overflow: auto; }
.poc-pre.curl { background: #06120c; color: #bdeccd; border-color: rgba(35, 210, 154, 0.22); }
.copy-btn { cursor: pointer; border: 1px solid var(--border-strong); background: var(--panel-2); color: var(--muted); font-size: 11px; padding: 3px 11px; border-radius: 7px; font-family: var(--sans); transition: color 0.15s, border-color 0.15s; }
.copy-btn:hover { color: var(--text); border-color: var(--accent-ring); }
.copy-btn.ok { color: var(--info); border-color: var(--info); }
.refs { display: flex; flex-wrap: wrap; gap: 8px; }
.refs a { font-size: 12px; border: 1px solid var(--border); border-radius: 7px; padding: 4px 9px; color: #a99fff; background: var(--panel-2); }
.refs a:hover { border-color: var(--border-strong); }
.conf-tag { font-size: 11px; color: var(--medium); border: 1px solid rgba(245, 197, 66, 0.3); padding: 2px 7px; border-radius: 6px; flex: none; }

/* ---------------- coverage ---------------- */
.cov-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 18px; }
.cov-stat { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--border); }
.cov-stat b { display: block; font-family: var(--display); font-size: 22px; }
.cov-stat span { font-size: 12px; color: var(--muted); }
.cov-group { margin-bottom: 20px; }
.cov-group h3 { font-family: var(--sans); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; margin: 0 0 10px; }
.cov-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-xs); margin-bottom: 6px; background: var(--panel); }
.cov-row > div { min-width: 0; }
.cov-row .num { font-family: var(--mono); font-size: 12px; color: var(--faint); width: 30px; flex: none; }
.cov-row .name { font-size: 13.5px; }
.cov-row .note { color: var(--faint); font-size: 12px; margin-top: 2px; }
.status-pill { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 7px; flex: none; }

/* ---------------- quality ---------------- */
.q-hero { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-bottom: 20px; }
.q-hero > div { min-width: 0; flex: 1 1 260px; }
.q-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.q-cat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; }
.q-cat .top { display: flex; justify-content: space-between; align-items: baseline; }
.q-cat .top b { font-family: var(--display); font-size: 24px; }
.q-cat .top span { font-size: 13px; color: var(--muted); font-weight: 600; }
.q-bar { height: 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); margin: 10px 0 14px; overflow: hidden; }
.q-bar > i { display: block; height: 100%; border-radius: 999px; }
.q-items { list-style: none; margin: 0; padding: 0; }
.q-item { display: flex; align-items: flex-start; gap: 9px; padding: 7px 0; font-size: 13px; border-top: 1px solid var(--border); }
.q-item:first-child { border-top: none; }
.q-item .qd { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.q-item .ql { min-width: 0; }
.q-item .ql .lab { color: var(--text); }
.q-item .ql .det { color: var(--faint); font-size: 12px; overflow-wrap: anywhere; }
.q-note { margin-top: 18px; font-size: 12.5px; color: var(--faint); background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 12px 14px; }

/* ---------------- pages ---------------- */
.page-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-xs); margin-bottom: 6px; background: var(--panel); font-size: 13px; }
.page-row .st { font-family: var(--mono); font-size: 12px; padding: 2px 8px; border-radius: 6px; flex: none; }
.page-row .u { flex: 1; min-width: 0; font-family: var(--mono); color: #c3c9d8; overflow-wrap: anywhere; }
.page-row .fm { font-size: 12px; color: var(--faint); flex: none; }

/* ---------------- data tables (separated rows) ---------------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; padding: 2px 14px 8px; }
.data-table th { text-align: left; padding: 10px 14px 0; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.data-table td {
  padding: 12px 14px; background: var(--panel-2); font-size: 13.5px; vertical-align: middle;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}
.data-table td:first-child { border-left: 1px solid var(--border); border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.data-table td:last-child { border-right: 1px solid var(--border); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.data-table tbody tr:hover td { background: var(--panel-hover); }
.mono { font-family: var(--mono); font-size: 13px; color: #c7cddb; overflow-wrap: anywhere; }
.mono-sm { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border-strong); color: var(--muted); white-space: nowrap; }
.tag-admin { color: #c9c2ff; border-color: rgba(124, 108, 255, 0.45); background: var(--accent-soft); }
.status-dot { font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.status-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; }
.status-dot.on { color: var(--up); }
.status-dot.on::before { background: var(--up); box-shadow: 0 0 0 3px rgba(35, 210, 154, 0.18); }
.status-dot.off { color: var(--medium); }
.status-dot.off::before { background: var(--medium); }
.score-chip { font-weight: 700; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.user-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.user-cell > div:last-child { min-width: 0; }
.user-cell b { font-size: 13.5px; display: block; }
.user-cell .sub { font-size: 12px; color: var(--faint); overflow-wrap: anywhere; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

.segmented { display: inline-flex; padding: 4px; gap: 3px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--panel); }
.seg { border: none; background: none; color: var(--muted); padding: 8px 14px; border-radius: 9px; font-size: 13px; font-weight: 500; white-space: nowrap; transition: color 0.2s ease, background 0.2s ease; }
.seg:hover { color: var(--text); }
.seg.active { color: #fff; background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-ring); }
.settings-row { display: flex; align-items: center; margin-bottom: 18px; }
.settings-row .toggle { flex-wrap: nowrap; }
.settings-row .toggle > span:last-child { min-width: 0; }

/* ---------------- audit ---------------- */
.audit-list { display: grid; gap: 0; }
.audit-row { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 13px; align-items: center; }
.audit-row:first-child { border-top: none; }
.audit-action { font-family: var(--mono); font-size: 12px; color: #a99fff; }
.audit-detail { color: var(--muted); overflow-wrap: anywhere; }
.audit-time { color: var(--faint); font-size: 12px; white-space: nowrap; }

/* ---------------- account / profile ---------------- */
.profile-card { position: relative; padding: 0; }
.profile-cover { height: 96px; background: linear-gradient(120deg, var(--accent), var(--accent-deep) 55%, var(--up)); }
.profile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 0 22px 22px; margin-top: -38px; }
.profile > div { min-width: 0; max-width: 100%; }
.profile h2 { margin: 0; font-size: 1.3rem; overflow-wrap: anywhere; }
.profile-tags { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.sub { color: var(--muted); font-size: 13.5px; }

/* ---------------- modal ---------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; padding: 20px;
  display: grid; place-items: center;
  background: rgba(4, 5, 8, 0.7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.modal {
  width: 100%; max-width: 480px; max-height: calc(100dvh - 40px); overflow: auto;
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow);
  animation: pop 0.25s ease;
}
@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(10px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 1.1rem; }
.modal-x { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--panel-2); color: var(--muted); font-size: 22px; line-height: 1; }
.modal-x:hover { color: var(--text); border-color: var(--border-strong); }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border); }
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--panel-2); font-size: 13.5px; cursor: pointer; transition: border-color 0.2s ease; }
.check-row:hover { border-color: var(--border-strong); }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }

/* ===========================================================================
   RESPONSIVE
   =========================================================================== */
@media (max-width: 1040px) {
  .hero { grid-template-columns: 1fr; justify-items: stretch; }
  .ring-wrap { justify-self: center; }
}

/* tablets & phones: sidebar → bottom tab bar, tables → cards */
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar { min-height: 60px; padding: 10px 16px; }
  .topbar .brand { display: flex; }
  .crumb { display: none; }
  .user-btn { padding: 3px; }
  .user-btn .who { display: none; }

  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 6px 8px calc(6px + var(--safe-b));
    border-top: 1px solid var(--border);
    background: rgba(10, 11, 16, 0.92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  }
  .tab-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 54px; padding: 4px 2px; border: none; border-radius: var(--radius-sm); background: none;
    color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.2px;
  }
  .tab-item .ico { display: grid; place-items: center; width: 44px; height: 28px; border-radius: 999px; transition: background 0.2s ease; }
  .tab-item.active { color: var(--text); }
  .tab-item.active .ico { color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-ring); }

  .content { padding: 20px 16px calc(var(--tabbar-h) + 28px + var(--safe-b)); }
  .results-mount { scroll-margin-top: 70px; }

  /* tables become cards with labelled rows */
  .table-wrap { overflow: visible; }
  .bq-scroll { max-height: none; overflow: visible; }
  .data-table, .data-table tbody { display: block; width: 100%; }
  .data-table { padding: 10px; border-spacing: 0; }
  .data-table thead { display: none; }
  .data-table tr {
    display: flex; flex-direction: column;
    margin-bottom: 10px; padding: 4px 14px;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2);
  }
  .data-table tr:last-child { margin-bottom: 0; }
  .data-table tr.selected { border-color: var(--accent-ring); }
  .data-table td, .data-table td:first-child, .data-table td:last-child {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 10px 0; text-align: right;
    background: none; border: none; border-bottom: 1px solid var(--border); border-radius: 0;
  }
  .data-table tbody tr:hover td, .data-table tr.selected td { background: none; }
  .data-table td:last-child { border-bottom: none; }
  .data-table td::before { content: attr(data-label); flex: none; color: var(--muted); font-size: 12px; font-weight: 500; text-align: left; }
  .data-table td[data-label='']::before { content: none; }
  .data-table td[data-label=''] { justify-content: flex-end; }
  .data-table td.cell-primary { order: -1; display: block; text-align: left; padding: 12px 0 10px; font-size: 14px; }
  .data-table td.cell-primary::before { content: none; }
  .data-table td.cell-primary .mono { font-size: 13.5px; color: var(--text); }
  .data-table td > * { min-width: 0; }
  .row-actions .btn { min-height: 38px; }

  .audit-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .audit-detail { grid-column: 1 / -1; grid-row: 2; }

  .modal-overlay { place-items: end center; padding: 0; }
  .modal { max-width: none; max-height: 92dvh; border-radius: var(--radius) var(--radius) 0 0; border-bottom: none; padding-bottom: var(--safe-b); animation: sheet 0.28s ease; }
  @keyframes sheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
}

@media (max-width: 880px) {
  .auth-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-brand { padding: 22px 20px 24px; gap: 18px; border-right: none; border-bottom: 1px solid var(--border); }
  .auth-brand-mid h1 { font-size: 25px; margin-bottom: 8px; }
  .auth-brand-mid p { font-size: 14px; margin: 0; }
  .auth-feats, .auth-brand-foot { display: none; }
  .auth-panel { place-items: start center; padding: 22px 16px 40px; }
}

/* phones */
@media (max-width: 560px) {
  body { font-size: 14.5px; }
  .page-head { align-items: stretch; margin-bottom: 18px; }
  .page-head h1 { font-size: 1.4rem; }
  .page-head > div:first-child { flex: 1 1 100%; }
  .page-head .segmented { width: 100%; }
  .page-head .segmented .seg { flex: 1; }
  .page-head > .btn { width: 100%; }

  /* 16px inputs stop iOS from zooming on focus */
  .field input, .field select, .modal input:not([type='checkbox']), .modal select, .url-input, .bulk-input { font-size: 16px; }

  .panel.pad, .scan-card, .progress-card { padding: 16px; }
  .auth-card { padding: 22px 18px; }
  .scan-row { flex-direction: column; }
  .url-field { min-width: 0; }
  .scan-row .btn, .bulk-foot .btn { width: 100%; }
  .toggle .muted-inline { flex-basis: 100%; padding-left: 54px; margin-top: -4px; }

  .progress-head { flex-wrap: wrap; }
  .progress-head > div:nth-child(2) { flex: 1; }
  .steps { grid-template-columns: 1fr; }

  .hero { padding: 22px 16px 18px; gap: 18px; }
  .ring { width: 144px; height: 144px; }
  .ring .score-num b { font-size: 38px; }
  .ring .score-num span { font-size: 9px; letter-spacing: 0.4px; margin-top: 5px; }
  .hero-main .target { font-size: 15px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .sev-count { padding: 7px 10px; }

  .tabs { margin: 18px 0 14px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin-right: -16px; padding-right: 16px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }

  .finding-head { padding: 13px 12px; gap: 10px; }
  .sev-pill { min-width: 0; padding: 4px 7px; font-size: 10px; }
  .finding-body { padding: 2px 12px 16px; }

  .cov-row { flex-wrap: wrap; padding: 10px 12px; }
  .cov-row > div { flex: 1 1 0; }
  .cov-row .status-pill { margin-left: 42px; }
  .page-row { flex-wrap: wrap; }
  .page-row .u { flex-basis: calc(100% - 60px); }
  .page-row .fm { margin-left: auto; }

  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-tile { padding: 13px 14px; }
  .stat-value { font-size: 1.4rem; }

  .profile { padding: 0 16px 18px; }
  .perm-grid { grid-template-columns: 1fr; }
  .modal-foot .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ============================ language switcher ============================ */
.lang-switch { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.lang-switch > svg { width: 16px; height: 16px; flex: none; }
.lang-select {
  appearance: none; -webkit-appearance: none;
  background-color: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-xs);
  padding: 7px 30px 7px 11px; font-family: var(--sans); font-size: 13px; font-weight: 500; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a90a4' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 11px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.lang-select:hover { border-color: var(--border-strong); background-color: var(--panel-hover); }
.lang-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lang-select option { background: var(--panel); color: var(--text); }

/* auth screen: language switcher sits above the card, aligned to the end */
.auth-topbar { display: flex; justify-content: flex-end; width: 100%; max-width: 420px; margin: 0 auto 16px; }

/* account → display preferences */
.toggle-text { display: inline-flex; flex-direction: column; gap: 2px; }
.toggle-hint { color: var(--muted); font-size: 12px; line-height: 1.5; font-weight: 400; max-width: 340px; }
.pref-lang { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.pref-lang-label { font-size: 14px; color: var(--text); font-weight: 500; }

/* ============================ brand footer (© Muhammad Kanhan) ============== */
.app-footer {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 18px;
  margin-top: 30px; padding: 18px 2px 6px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--muted);
}
.app-footer .copyr { font-weight: 500; letter-spacing: 0.1px; }
.app-footer .gh-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; transition: color 0.2s ease; }
.app-footer .gh-link:hover { color: var(--accent); }
.app-footer .gh-link svg { width: 15px; height: 15px; flex: none; }
.auth-panel .app-footer { width: 100%; max-width: 420px; margin: 22px auto 0; justify-content: center; gap: 6px 16px; }

/* ============================ RTL (Arabic / Kurdish, or forced) ============= */
/* Arabic & Kurdish Sorani script fonts (Inter/Space Grotesk are Latin-only) */
:lang(ar), :lang(ckb) { font-family: 'Segoe UI', Tahoma, 'Noto Naskh Arabic', 'Noto Sans Arabic', 'Geeza Pro', sans-serif; }
:lang(ar) .wordmark, :lang(ckb) .wordmark { font-family: inherit; }
/* layout mirroring for right-to-left */
html[dir="rtl"] .progress-head .btn { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .lang-select { padding: 7px 11px 7px 30px; background-position: left 10px center; }
html[dir="rtl"] .toggle .track::after { left: auto; right: 3px; }
html[dir="rtl"] .toggle input:checked + .track::after { transform: translateX(-18px); }
html[dir="rtl"] .data-table td::before { text-align: right; }
html[dir="rtl"] .data-table td.cell-primary { text-align: right; }
html[dir="rtl"] .crumb .sep { transform: scaleX(-1); }
html[dir="rtl"] .evidence, html[dir="rtl"] .remediation, html[dir="rtl"] .mono, html[dir="rtl"] .mono-sm, html[dir="rtl"] .poc-pre { direction: ltr; text-align: left; }

/* ---- AI analysis panel ---- */
.ai-panel{border:1px solid rgba(124,108,255,0.35);background:linear-gradient(180deg,rgba(124,108,255,0.08),rgba(124,108,255,0.02));margin-top:16px}
.ai-head{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.ai-badge{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:#cfc6ff;background:rgba(124,108,255,0.18);border:1px solid rgba(124,108,255,0.45);border-radius:999px;padding:3px 10px}
.ai-model{font-size:12px;color:var(--muted)}
.ai-risk{font-weight:700;margin:4px 0 8px;color:#e9e6ff}
.ai-summary{margin:0 0 10px;color:#d8dbe4;line-height:1.55;max-width:760px}
.ai-sub{margin:12px 0 6px;font-size:13px;color:#cfc6ff}
.ai-pri{margin:0;padding-inline-start:20px;color:#d8dbe4}
.ai-pri li{margin:4px 0;line-height:1.5}
.ai-disc{margin-top:12px;font-size:11px;color:var(--muted);font-style:italic}
.ai-err{color:#ffb4bc;margin:4px 0}
.ai-insight{border-inline-start:3px solid rgba(124,108,255,0.6);padding-inline-start:12px;background:rgba(124,108,255,0.05);border-radius:6px}
.ai-insight h4{color:#cfc6ff}
.ai-insight p{margin:6px 0;line-height:1.5;color:#d4d8e0}
.ai-insight b{color:#efeaff}
