:root {
  --bg: #f5f5f7;
  --surface: #fff;
  --surface-raised: rgba(255, 255, 255, .88);
  --surface-soft: #f7f7f9;
  --ink: #1d1d1f;
  --ink-2: #424245;
  --muted: #6e6e73;
  --quiet: #86868b;
  --line: rgba(0, 0, 0, .085);
  --line-strong: rgba(0, 0, 0, .14);
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --blue-soft: #eaf3ff;
  --green: #147d3f;
  --green-soft: #eaf8ef;
  --red: #c1272d;
  --red-soft: #fff0f1;
  --amber: #966100;
  --amber-soft: #fff6df;
  --violet: #6e52c7;
  --violet-soft: #f2efff;
  --shadow: 0 22px 70px rgba(0,0,0,.08), 0 2px 10px rgba(0,0,0,.035);
  --sidebar: 242px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body, #app { min-width: 320px; min-height: 100%; margin: 0; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; min-height: 100svh; background: var(--bg); }
button, input, select, textarea { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
svg { display: block; }

.skip-link {
  position: fixed; z-index: 300; top: 8px; left: 8px; padding: 10px 14px;
  color: #fff; background: #111; border-radius: 10px; transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.boot { display: grid; min-height: 100vh; min-height: 100svh; place-items: center; }
.spinner {
  display: inline-block; width: 24px; height: 24px; border: 2px solid rgba(0,113,227,.14);
  border-top-color: var(--blue); border-radius: 50%; animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.brand { display: inline-flex; gap: 10px; align-items: center; color: var(--ink); font-weight: 650; letter-spacing: -.025em; text-decoration: none; }
.brand-mark {
  display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center;
  color: var(--blue); background: #fff; border: 1px solid var(--line); border-radius: 11px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.brand-mark svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.brand em { color: var(--blue); font-style: normal; }

/* Login */
.login-page {
  display: grid; min-height: 100vh; min-height: 100svh; padding: max(22px, var(--safe-top)) 22px max(22px, var(--safe-bottom));
  place-items: center; background:
    radial-gradient(circle at 50% -16%, rgba(0,113,227,.13), transparent 36rem),
    radial-gradient(circle at 8% 92%, rgba(100,116,255,.06), transparent 28rem), var(--bg);
}
.login-wrap { width: min(100%, 440px); }
.login-brand { display: flex; margin: 0 0 26px; justify-content: center; }
.login-card {
  padding: clamp(28px, 6vw, 42px); background: var(--surface-raised); border: 1px solid rgba(255,255,255,.88);
  border-radius: 28px; box-shadow: var(--shadow); backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%); animation: rise .4s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(9px) scale(.99); } to { opacity: 1; transform: none; } }
.login-icon { display: grid; width: 58px; height: 58px; margin-bottom: 24px; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 19px; }
.login-icon svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.login-card h1 { margin: 0 0 10px; font-size: 32px; line-height: 1.1; letter-spacing: -.04em; }
.login-card > p { margin: 0 0 26px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.login-foot { margin: 22px 0 0; color: var(--quiet); font-size: 11px; line-height: 1.5; text-align: center; }

.field { display: grid; gap: 7px; }
.field + .field { margin-top: 14px; }
.field label { color: var(--ink-2); font-size: 12px; font-weight: 600; }
.input-wrap { position: relative; }
.input {
  width: 100%; height: 48px; padding: 0 14px; color: var(--ink); background: rgba(255,255,255,.85);
  border: 1px solid var(--line-strong); border-radius: 13px; outline: 0; transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder { color: #a0a0a5; }
.input:hover { border-color: rgba(0,0,0,.22); }
.input:focus { background: #fff; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,113,227,.12); }
.input.secret { padding-right: 48px; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 13px; }
.reveal {
  position: absolute; top: 50%; right: 7px; display: grid; width: 36px; height: 36px; padding: 0; place-items: center;
  color: var(--muted); background: transparent; border: 0; border-radius: 9px; transform: translateY(-50%);
}
.reveal:hover { color: var(--ink); background: var(--surface-soft); }
.reveal svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }

.button {
  display: inline-flex; min-height: 42px; padding: 0 17px; gap: 8px; align-items: center; justify-content: center;
  color: #fff; background: var(--blue); border: 0; border-radius: 12px; font-size: 13px; font-weight: 650;
  text-decoration: none; transition: transform .14s, background .14s, box-shadow .14s, opacity .14s;
}
.button:hover { background: var(--blue-hover); }
.button:active { transform: scale(.985); }
.button:focus-visible, .icon-button:focus-visible, .nav-link:focus-visible, .tab:focus-visible { outline: 3px solid rgba(0,113,227,.23); outline-offset: 2px; }
.button:disabled { opacity: .48; cursor: default; transform: none; }
.button.full { width: 100%; margin-top: 18px; }
.button.secondary { color: var(--ink); background: #ededf0; }
.button.secondary:hover { background: #e5e5e9; }
.button.ghost { color: var(--blue); background: transparent; }
.button.ghost:hover { background: var(--blue-soft); }
.button.danger { color: var(--red); background: var(--red-soft); }
.button.danger:hover { background: #ffe5e7; }
.button.compact { min-height: 36px; padding: 0 13px; font-size: 12px; border-radius: 10px; }
.button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.form-error { min-height: 0; margin-top: 12px; color: var(--red); font-size: 12px; line-height: 1.45; }
.form-error:not(:empty) { padding: 11px 13px; background: var(--red-soft); border-radius: 11px; }

/* App shell */
.panel-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; min-height: 100svh; }
.sidebar {
  position: fixed; z-index: 40; inset: 0 auto 0 0; display: flex; width: var(--sidebar); padding: max(20px,var(--safe-top)) 14px max(16px,var(--safe-bottom));
  flex-direction: column; background: rgba(248,248,250,.88); border-right: 1px solid var(--line); backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}
.sidebar-head { padding: 0 8px 24px; }
.nav { display: grid; gap: 4px; }
.nav-link {
  display: flex; width: 100%; min-height: 43px; padding: 0 12px; gap: 11px; align-items: center;
  color: var(--muted); background: transparent; border: 0; border-radius: 12px; font-size: 13px; font-weight: 570; text-align: left;
}
.nav-link:hover { color: var(--ink); background: rgba(0,0,0,.035); }
.nav-link.active { color: var(--ink); background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.nav-link svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nav-badge { min-width: 21px; padding: 2px 6px; margin-left: auto; color: var(--muted); background: #ededf0; border-radius: 999px; font-size: 10px; text-align: center; }
.sidebar-bottom { display: grid; gap: 10px; margin-top: auto; }
.account-card { padding: 12px; background: rgba(255,255,255,.68); border: 1px solid var(--line); border-radius: 14px; }
.account-row { display: flex; min-width: 0; gap: 9px; align-items: center; }
.avatar { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 9px; font-size: 11px; font-weight: 700; }
.account-copy { min-width: 0; }
.account-copy strong, .account-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { font-size: 12px; font-weight: 650; }
.account-copy span { margin-top: 2px; color: var(--quiet); font-size: 10px; }
.logout { width: 100%; min-height: 34px; margin-top: 10px; color: var(--muted); background: transparent; border: 0; border-top: 1px solid var(--line); font-size: 11px; text-align: left; }
.logout:hover { color: var(--red); }

.main-column { grid-column: 2; min-width: 0; }
.mobile-header { display: none; }
.content { width: min(100%, 1440px); min-height: 100vh; padding: 42px clamp(28px,4vw,60px) 70px; }
.page-head { display: flex; gap: 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 28px; }
.page-head h1 { margin: 0; font-size: clamp(30px,3.5vw,42px); line-height: 1.06; letter-spacing: -.045em; }
.page-head p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.head-actions { display: flex; gap: 8px; align-items: center; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.metric-card { padding: 17px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 17px; }
.metric-label { display: flex; gap: 7px; align-items: center; color: var(--muted); font-size: 11px; font-weight: 570; }
.metric-dot { width: 7px; height: 7px; background: var(--quiet); border-radius: 50%; }
.metric-dot.success { background: var(--green); }
.metric-dot.danger { background: var(--red); }
.metric-dot.warning { background: var(--amber); }
.metric-value { display: block; margin-top: 10px; font-size: 27px; font-weight: 650; letter-spacing: -.04em; }

.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.search { position: relative; width: min(360px, 100%); }
.search svg { position: absolute; top: 50%; left: 13px; width: 17px; height: 17px; color: var(--quiet); fill: none; stroke: currentColor; stroke-width: 1.7; transform: translateY(-50%); pointer-events: none; }
.search .input { height: 42px; padding-left: 40px; background: #fff; }
.tabs { display: flex; min-width: 0; padding: 3px; gap: 2px; overflow-x: auto; background: #eaeaed; border-radius: 12px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { min-height: 34px; padding: 0 13px; flex: 0 0 auto; color: var(--muted); background: transparent; border: 0; border-radius: 9px; font-size: 11px; font-weight: 600; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.09); }

.table-card { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 19px; box-shadow: 0 1px 2px rgba(0,0,0,.015); }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; min-width: 780px; border-collapse: collapse; table-layout: fixed; }
.data-table th { height: 43px; padding: 0 15px; color: var(--quiet); background: #fafafa; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 650; letter-spacing: .025em; text-align: left; text-transform: uppercase; }
.data-table td { height: 67px; padding: 9px 15px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 12px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { cursor: pointer; transition: background .12s; }
.data-table tbody tr:hover { background: #fafafa; }
.data-table tbody tr:focus-visible { outline: 3px solid rgba(0,113,227,.22); outline-offset: -3px; }
.id-cell strong { display: block; color: var(--ink); font-size: 12px; font-weight: 620; }
.id-cell span { display: block; max-width: 250px; margin-top: 4px; overflow: hidden; color: var(--quiet); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: .93em; }
.subtle { color: var(--quiet); }
.status {
  display: inline-flex; min-height: 25px; padding: 0 9px; gap: 6px; align-items: center; color: var(--muted);
  background: #f0f0f2; border-radius: 999px; font-size: 10px; font-weight: 650; white-space: nowrap;
}
.status::before { width: 6px; height: 6px; content: ""; background: currentColor; border-radius: 50%; }
.status.verified { color: var(--green); background: var(--green-soft); }
.status.rejected, .status.failed, .status.cancelled { color: var(--red); background: var(--red-soft); }
.status.manual_review { color: var(--amber); background: var(--amber-soft); }
.status.processing, .status.in_progress { color: var(--blue); background: var(--blue-soft); }
.status.pending { color: var(--violet); background: var(--violet-soft); }
.table-foot { display: flex; min-height: 58px; padding: 10px 14px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); }
.table-foot p { margin: 0; color: var(--quiet); font-size: 11px; }

.empty-state { display: grid; min-height: 330px; padding: 34px; place-items: center; align-content: center; text-align: center; }
.empty-icon { display: grid; width: 52px; height: 52px; margin-bottom: 17px; place-items: center; color: var(--muted); background: var(--surface-soft); border-radius: 17px; }
.empty-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.55; }
.empty-state h2 { margin: 0 0 7px; font-size: 19px; letter-spacing: -.025em; }
.empty-state p { max-width: 320px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.skeleton { position: relative; overflow: hidden; color: transparent !important; background: #eeeeF1; border-radius: 7px; }
.skeleton::after { position: absolute; inset: 0; content: ""; background: linear-gradient(90deg,transparent,rgba(255,255,255,.68),transparent); transform: translateX(-100%); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* Detail drawer */
.drawer-backdrop { position: fixed; z-index: 90; inset: 0; background: rgba(0,0,0,.23); animation: fade .18s both; }
.drawer {
  position: fixed; z-index: 100; top: 0; right: 0; width: min(670px, 94vw); height: 100vh; height: 100dvh;
  overflow-y: auto; overscroll-behavior: contain; background: var(--bg); border-left: 1px solid rgba(255,255,255,.5); box-shadow: -25px 0 70px rgba(0,0,0,.15);
  animation: slide .28s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(35px); opacity: .5; } }
.drawer-head { position: sticky; z-index: 5; top: 0; display: flex; min-height: 68px; padding: 12px 22px; gap: 12px; align-items: center; justify-content: space-between; background: rgba(245,245,247,.86); border-bottom: 1px solid var(--line); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); }
.drawer-title { min-width: 0; }
.drawer-title strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.drawer-title span { display: block; margin-top: 3px; color: var(--quiet); font-size: 10px; }
.icon-button { display: grid; width: 38px; height: 38px; flex: 0 0 auto; padding: 0; place-items: center; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.icon-button:hover { color: var(--ink); background: #fafafa; }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.drawer-body { display: grid; gap: 14px; padding: 18px 18px max(44px,var(--safe-bottom)); }
.detail-card { padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.detail-card-title { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.detail-card-title h2 { margin: 0; font-size: 14px; letter-spacing: -.015em; }
.detail-card-title span { color: var(--quiet); font-size: 10px; }
.summary-top { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; }
.summary-top h2 { margin: 11px 0 5px; font-size: 25px; letter-spacing: -.04em; }
.summary-top p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.score-ring { --score: 0; position: relative; display: grid; width: 78px; height: 78px; flex: 0 0 auto; place-items: center; background: conic-gradient(var(--green) calc(var(--score)*1%), #ececef 0); border-radius: 50%; }
.score-ring::before { position: absolute; width: 62px; height: 62px; content: ""; background: #fff; border-radius: 50%; }
.score-ring strong, .score-ring span { position: relative; z-index: 1; display: block; text-align: center; }
.score-ring strong { font-size: 17px; letter-spacing: -.03em; }
.score-ring span { margin-top: 1px; color: var(--quiet); font-size: 8px; text-transform: uppercase; }
.key-values { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; margin-top: 17px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 13px; }
.key-value { min-width: 0; padding: 12px; background: #fafafa; }
.key-value span { display: block; margin-bottom: 5px; color: var(--quiet); font-size: 9px; text-transform: uppercase; }
.key-value strong { display: block; overflow: hidden; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }

.photo-pair { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.photo-item { min-width: 0; }
.photo-frame { position: relative; width: 100%; aspect-ratio: 4/3; overflow: hidden; background: #ececef; border-radius: 14px; }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-frame button { position: absolute; inset: 0; width: 100%; padding: 0; background: transparent; border: 0; }
.photo-frame .photo-placeholder { display: grid; width: 100%; height: 100%; place-items: center; color: var(--quiet); }
.photo-placeholder svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.photo-item > span { display: block; margin: 7px 2px 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.evidence-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.evidence-grid .photo-frame { aspect-ratio: 3/4; }

.reason-box { padding: 13px; color: var(--ink-2); background: var(--surface-soft); border-radius: 13px; font-size: 11px; line-height: 1.55; }
.metrics-list { display: grid; gap: 10px; }
.meter-row { display: grid; grid-template-columns: minmax(110px,1fr) 2fr 42px; gap: 10px; align-items: center; font-size: 10px; }
.meter { height: 6px; overflow: hidden; background: #ebebee; border-radius: 999px; }
.meter i { display: block; width: 0; height: 100%; background: var(--blue); border-radius: inherit; }
.meter-row strong { color: var(--muted); font-weight: 600; text-align: right; }

.webhook { padding: 13px; background: var(--surface-soft); border-radius: 13px; }
.webhook + .webhook { margin-top: 9px; }
.webhook-head { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.webhook-head strong { display: block; font-size: 11px; }
.webhook-head span { display: block; margin-top: 3px; color: var(--quiet); font-size: 9px; }
.webhook-code { display: inline-flex !important; padding: 3px 6px; color: var(--green) !important; background: var(--green-soft); border-radius: 6px; font-family: ui-monospace,monospace; }
.webhook-code.error { color: var(--red) !important; background: var(--red-soft); }
.response-block { max-height: 150px; padding: 10px; margin: 10px 0 0; overflow: auto; color: #d7d7dd; background: #1e1e21; border-radius: 9px; font: 9px/1.55 ui-monospace,monospace; white-space: pre-wrap; word-break: break-word; }
.metadata { margin: 0; font: 10px/1.65 ui-monospace,monospace; white-space: pre-wrap; word-break: break-word; }

/* API keys */
.keys-grid { display: grid; gap: 10px; }
.key-card { display: flex; min-height: 72px; padding: 14px 16px; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.key-glyph { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 12px; }
.key-glyph svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.key-info { min-width: 0; flex: 1; }
.key-info strong { display: block; font-size: 12px; }
.key-info span { display: block; margin-top: 5px; overflow: hidden; color: var(--quiet); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.role-pill { padding: 4px 7px; color: var(--muted); background: var(--surface-soft); border-radius: 7px; font-size: 9px; font-weight: 650; text-transform: uppercase; }
.new-key-box { padding: 15px; margin: 16px 0 0; background: var(--amber-soft); border: 1px solid rgba(150,97,0,.15); border-radius: 14px; }
.new-key-box strong { display: block; margin-bottom: 5px; font-size: 12px; }
.new-key-box p { margin: 0 0 11px; color: var(--amber); font-size: 10px; line-height: 1.5; }
.copy-row { display: flex; gap: 7px; }
.copy-value { min-width: 0; padding: 10px 11px; flex: 1; overflow: hidden; background: rgba(255,255,255,.72); border: 1px solid rgba(150,97,0,.18); border-radius: 10px; font: 10px ui-monospace,monospace; text-overflow: ellipsis; white-space: nowrap; }

/* Modals, toasts */
.modal-backdrop { position: fixed; z-index: 180; inset: 0; display: grid; padding: 20px; place-items: center; background: rgba(0,0,0,.28); animation: fade .18s both; }
.modal { width: min(100%, 430px); padding: 24px; background: rgba(255,255,255,.96); border: 1px solid rgba(255,255,255,.9); border-radius: 22px; box-shadow: var(--shadow); animation: rise .22s both; }
.modal h2 { margin: 0 0 8px; font-size: 21px; letter-spacing: -.03em; }
.modal > p { margin: 0 0 20px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.modal-actions { display: flex; margin-top: 20px; gap: 8px; justify-content: flex-end; }
.lightbox { width: min(92vw,1000px); height: min(88vh,800px); padding: 0; overflow: hidden; background: #101012; border-radius: 20px; }
.lightbox img { width: 100%; height: 100%; object-fit: contain; }
.lightbox-close { position: absolute; top: 18px; right: 18px; color: #fff; background: rgba(20,20,22,.65); border-color: rgba(255,255,255,.2); backdrop-filter: blur(12px); }
.toast-region { position: fixed; z-index: 260; right: 20px; bottom: max(20px,var(--safe-bottom)); display: grid; width: min(360px,calc(100vw - 40px)); gap: 8px; pointer-events: none; }
.toast { padding: 12px 14px; color: #fff; background: rgba(29,29,31,.94); border: 1px solid rgba(255,255,255,.12); border-radius: 13px; box-shadow: 0 12px 35px rgba(0,0,0,.18); font-size: 11px; line-height: 1.45; backdrop-filter: blur(15px); animation: toast-in .22s both; }
.toast.error { background: rgba(130,25,30,.96); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.noscript { position: fixed; z-index: 400; inset: auto 16px 16px; padding: 14px; color: #fff; background: #1d1d1f; border-radius: 12px; text-align: center; }

@media (max-width: 980px) {
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search { width: 100%; }
}

@media (max-width: 760px) {
  .panel-shell { display: block; }
  .sidebar { display: none; }
  .main-column { min-height: 100vh; }
  .mobile-header { position: sticky; z-index: 35; top: 0; display: flex; min-height: 60px; padding: max(10px,var(--safe-top)) 14px 10px; align-items: center; justify-content: space-between; background: rgba(248,248,250,.87); border-bottom: 1px solid var(--line); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
  .mobile-header .brand { font-size: 14px; }
  .mobile-header .brand-mark { width: 30px; height: 30px; }
  .mobile-nav { position: fixed; z-index: 50; right: 12px; bottom: max(12px,var(--safe-bottom)); left: 12px; display: grid; grid-template-columns: repeat(3,1fr); padding: 5px; background: rgba(255,255,255,.91); border: 1px solid rgba(0,0,0,.09); border-radius: 17px; box-shadow: 0 12px 42px rgba(0,0,0,.14); backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%); }
  .mobile-nav .nav-link { min-height: 45px; padding: 0 5px; gap: 3px; flex-direction: column; justify-content: center; font-size: 9px; }
  .mobile-nav .nav-link svg { width: 17px; height: 17px; }
  .content { min-height: 0; padding: 27px 14px 100px; }
  .page-head { align-items: flex-start; margin-bottom: 21px; }
  .page-head h1 { font-size: 32px; }
  .head-actions .button span { display: none; }
  .head-actions .button { width: 40px; min-height: 40px; padding: 0; }
  .metric-card { padding: 14px; }
  .metric-value { font-size: 23px; }
  .table-card { border-radius: 16px; }
  .table-wrap { overflow: visible; }
  .data-table, .data-table tbody { display: block; min-width: 0; }
  .data-table thead { display: none; }
  .data-table tr { display: grid; grid-template-columns: 1fr auto; padding: 15px; gap: 10px 14px; border-bottom: 1px solid var(--line); }
  .data-table tbody tr:last-child { border-bottom: 0; }
  .data-table td { display: block; height: auto; padding: 0; border: 0; }
  .data-table td:nth-child(1) { grid-column: 1; }
  .data-table td:nth-child(2) { grid-column: 2; grid-row: 1; }
  .data-table td:nth-child(3) { grid-column: 1; color: var(--quiet); font-size: 10px; }
  .data-table td:nth-child(4) { display: none; }
  .data-table td:nth-child(5) { grid-column: 2; grid-row: 2; color: var(--quiet); font-size: 10px; text-align: right; }
  .drawer { width: 100%; border: 0; }
}

@media (max-width: 520px) {
  .metric-grid { gap: 8px; }
  .metric-card { border-radius: 14px; }
  .metric-label { font-size: 10px; }
  .tabs { margin-right: -14px; border-radius: 11px 0 0 11px; }
  .photo-pair { grid-template-columns: 1fr; }
  .evidence-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .key-values { grid-template-columns: 1fr; }
  .drawer-body { padding-right: 10px; padding-left: 10px; }
  .detail-card { padding: 15px; border-radius: 16px; }
  .meter-row { grid-template-columns: 92px 1fr 36px; }
  .key-card { flex-wrap: wrap; }
}

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

@media (forced-colors: active) {
  .button, .input, .table-card, .detail-card { border: 1px solid ButtonText; }
}
