/* ============================================================
   VERITAS - forensic light-table. Calm, archival, evidentiary.
   Display: Zodiak · UI: Space Grotesk · Data: Space Mono. No Inter.
   ============================================================ */
:root {
  --bg: #0a0c0f;
  --bg-2: #0e1116;
  --panel: #12151b;
  --panel-2: #161a21;
  --line: #20262f;
  --line-2: #2b333d;
  --ink: #e9edf2;
  --ink-dim: #9099a4;
  --ink-faint: #5b646e;
  --real: #4ade80;
  --real-dim: #0e3322;
  --fake: #f26d6d;
  --fake-dim: #3a1518;
  --amber: #f4c152;
  --accent: #6ec3d6;     /* cool examiner cyan */
  --shadow: 0 24px 60px -28px rgba(0,0,0,.85);
  --r: 16px;
  --r-sm: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1100px 520px at 88% -8%, #10222a 0%, transparent 60%),
    radial-gradient(820px 460px at -5% 4%, #161520 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  min-height: 100vh;
}
a { text-decoration: none; }
a:hover { text-decoration: none; }
.mono { font-family: 'Space Mono', monospace; }
.hidden { display: none !important; }
.real { color: var(--real); }
.fake { color: var(--fake); }

/* overlays - a single restrained grain. No double scanline clutter. */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: .025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.scan { display: none; }

/* ---------------- top bar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 30px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 13px; }
.seal {
  width: 42px; height: 42px; display: grid; place-items: center; font-size: 26px;
  color: var(--accent); border: 1px solid var(--line-2); border-radius: 12px;
  background: radial-gradient(circle at 50% 30%, #11313a, var(--panel));
  box-shadow: inset 0 0 18px -6px var(--accent);
}
.brand-text h1 { font-family: 'Space Grotesk'; font-size: 21px; letter-spacing: .34em; margin: 0; font-weight: 700; }
.brand-text p { margin: 1px 0 0; font-size: 11.5px; color: var(--ink-dim); letter-spacing: .03em; }

.conn { display: flex; align-items: center; gap: 12px; }
.badge {
  font-size: 11px; padding: 5px 11px; border-radius: 999px; letter-spacing: .08em;
  font-family: 'Space Mono', monospace; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 6px;
}
.badge-net { background: var(--panel-2); color: var(--accent); border: 1px solid var(--line-2); }
.acct-pill {
  display: inline-flex; align-items: center; gap: 8px; font-family: 'Space Mono', monospace;
  font-size: 12.5px; background: var(--panel); border: 1px solid var(--line-2);
  padding: 6px 12px; border-radius: 999px;
}
.acct-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--real); box-shadow: 0 0 10px var(--real); }

/* ---------------- buttons ---------------- */
.btn {
  font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 13.5px;
  border-radius: var(--r-sm); padding: 9px 16px; cursor: pointer;
  border: 1px solid transparent; transition: .16s ease; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
}
.btn i { font-size: 16px; }
.btn.lg { padding: 13px 22px; font-size: 14.5px; }
.btn.sm { padding: 6px 12px; font-size: 12.5px; }
.btn.block { width: 100%; justify-content: center; }
.btn-primary { background: linear-gradient(180deg, #7ad0e2, #4fb3c8); color: #042127; border-color: #7ad0e2; }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { background: var(--panel); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--panel-2); border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: none; }
.btn-real { background: var(--real-dim); color: var(--real); border-color: #1c5a3e; }
.btn-real:hover { background: #134a32; }
.btn-fake { background: var(--fake-dim); color: var(--fake); border-color: #6e2a2a; }
.btn-fake:hover { background: #501e1e; }
.btn-amber { background: #3a2f0c; color: var(--amber); border-color: #6b561a; }
.btn-amber:hover { background: #4a3c10; }

/* ---------------- light-table layout ---------------- */
.lighttable {
  max-width: 1240px; margin: 0 auto; padding: 56px 28px 14px;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 34px; position: relative; z-index: 2;
}
.panel {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.panel-tab {
  font-family: 'Space Mono', monospace; font-size: 10.5px; letter-spacing: .2em;
  color: var(--ink-faint); padding: 14px 18px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 9px; background: rgba(255,255,255,.012);
}
.panel-tab i { color: var(--accent); font-size: 14px; }

/* evidence viewer */
.viewer {
  position: relative; aspect-ratio: 4/3; background:
    repeating-linear-gradient(45deg, #0a0d11 0 12px, #0d1116 12px 24px);
  overflow: hidden; cursor: crosshair;
}
.viewer-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: .25;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 36px 36px;
}
#viewer-img { width: 100%; height: 100%; object-fit: contain; display: block; filter: contrast(1.04) saturate(.96); }
.viewer-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px;
  align-items: center; justify-content: center; text-align: center; padding: 40px;
  color: var(--ink-faint); font-size: 13.5px; max-width: 340px; margin: 0 auto;
}
.viewer-empty i { font-size: 40px; color: var(--line-2); }
.loupe {
  position: absolute; width: 150px; height: 150px; border-radius: 50%;
  border: 1px solid var(--accent); box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 10px 30px rgba(0,0,0,.6);
  pointer-events: none; display: none; background-repeat: no-repeat; z-index: 4;
}

/* web-page exhibit (when the URL is a page, not a direct image) */
.viewer-page { position: absolute; inset: 0; display: flex; flex-direction: column; }
.vp-shot { flex: 1; position: relative; overflow: hidden; background:
  radial-gradient(420px 240px at 50% 36%, #11242c 0%, transparent 70%),
  repeating-linear-gradient(45deg, #0a0d11 0 12px, #0d1116 12px 24px); }
.vp-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; opacity: .94; }
.vp-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; color: var(--line-2); }
.vp-fallback i { font-size: 62px; color: #2c4d57; }
.vp-fallback::after { content: "WEB EXHIBIT"; font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: .22em; color: var(--ink-faint); }
.vp-fallback.hidden { display: none; }
.vp-meta { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-top: 1px solid var(--line); background: rgba(255,255,255,.012); }
.vp-favicon { width: 22px; height: 22px; border-radius: 5px; }
.vp-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.vp-domain { font-size: 13px; color: var(--ink); }
.vp-note { font-size: 10.5px; color: var(--ink-faint); }

.exhibit-meta { padding: 18px 18px; display: flex; flex-direction: column; gap: 13px; }
.em-row { display: grid; grid-template-columns: 130px 1fr; gap: 14px; align-items: start; font-size: 13px; }
.em-row .k { font-family: 'Space Mono', monospace; font-size: 10px; letter-spacing: .14em; color: var(--ink-faint); padding-top: 3px; }
.em-row .v { color: var(--ink); word-break: break-word; line-height: 1.5; }
.em-row .v.mono { font-size: 12px; color: var(--ink-dim); }

/* bench (right column) */
.bench { display: flex; flex-direction: column; gap: 32px; }
.hero-mini h2 {
  font-family: 'Zodiak', Georgia, serif; font-weight: 600;
  font-size: clamp(32px, 3.8vw, 46px); line-height: 1.05; margin: 0 0 18px; letter-spacing: -.015em;
}
.hero-mini p { color: var(--ink-dim); font-size: 14.5px; line-height: 1.6; max-width: 44ch; margin: 0 0 22px; }

/* verdict card */
.verdict-card { display: flex; flex-direction: column; }
.vc-empty {
  display: flex; flex-direction: column; gap: 13px; align-items: center; justify-content: center;
  text-align: center; padding: 40px 30px; color: var(--ink-faint); font-size: 13px; min-height: 220px;
}
.vc-empty i { font-size: 38px; color: var(--line-2); }
.vc-body { padding: 24px; display: flex; flex-direction: column; gap: 20px; }

.gauge-wrap { position: relative; display: flex; justify-content: center; padding-top: 6px; }
.gauge { width: 240px; max-width: 100%; height: auto; overflow: visible; }
.gauge-track { fill: none; stroke: var(--line); stroke-width: 12; stroke-linecap: round; }
.gauge-fill {
  fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round;
  stroke-dasharray: 251.3; stroke-dashoffset: 251.3; transition: stroke-dashoffset 1.1s cubic-bezier(.2,.7,.2,1), stroke .6s;
}
.gauge-read { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; }
.gauge-num { font-size: 38px; font-weight: 700; display: block; line-height: 1; }
.gauge-lbl { font-family: 'Space Mono', monospace; font-size: 10px; letter-spacing: .1em; color: var(--ink-faint); text-transform: uppercase; }

.vc-verdict { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--bg-2); }
.vc-side { font-family: 'Space Grotesk'; font-weight: 700; letter-spacing: .1em; font-size: 17px; display: inline-flex; align-items: center; gap: 8px; }
.vc-conf { font-size: 12px; color: var(--ink-faint); }
.vc-rationale { font-family: 'Zodiak', serif; font-size: 15px; line-height: 1.5; color: var(--ink-dim); margin: 0; padding-left: 13px; border-left: 2px solid var(--line-2); }

.vc-pool { display: flex; flex-direction: column; gap: 7px; }
.vc-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.vc-actions .btn { flex: 1; justify-content: center; min-width: 90px; }

/* pool bar (shared) */
.pool-bar { height: 9px; border-radius: 999px; overflow: hidden; display: flex; background: var(--fake-dim); }
.pool-bar .real-fill { background: linear-gradient(90deg, #34d399, var(--real)); }
.pool-bar .fake-fill { background: linear-gradient(90deg, var(--fake), #f43f5e); }
.pool-legend { display: flex; justify-content: space-between; font-family: 'Space Mono', monospace; font-size: 11px; }

/* ---------------- stats strip ---------------- */
.stripwrap { max-width: 1240px; margin: 40px auto 0; padding: 0 28px; position: relative; z-index: 2; }
.strip {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
}
.sx { background: var(--panel); padding: 20px 18px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.sx i { font-size: 17px; color: var(--accent); margin-bottom: 6px; opacity: .85; }
.sx-num { font-family: 'Space Mono', monospace; font-size: 25px; font-weight: 700; line-height: 1; }
.sx-lbl { font-size: 10px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .1em; margin-top: 2px; }

/* ---------------- docket ---------------- */
.docket { max-width: 1240px; margin: 56px auto 0; padding: 0 28px; position: relative; z-index: 2; }
.docket-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 26px; flex-wrap: wrap; }
.docket-head h3 { font-family: 'Space Grotesk'; font-size: 14px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-dim); margin: 0; display: flex; align-items: center; gap: 9px; }
.docket-head h3 i { color: var(--accent); }
.docket-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.filters { display: flex; gap: 6px; }
.chip {
  background: var(--panel); border: 1px solid var(--line-2); color: var(--ink-dim);
  font-family: 'Space Grotesk'; font-size: 12.5px; padding: 6px 14px; border-radius: 999px; cursor: pointer; transition: .15s;
}
.chip:hover { color: var(--ink); border-color: var(--accent); }
.chip.active { background: var(--accent); color: #042127; border-color: var(--accent); font-weight: 600; }

.cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.loading, .empty { text-align: center; color: var(--ink-faint); padding: 48px 0; font-size: 14px; }

/* docket row card (compact, evidentiary) */
.card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  display: flex; flex-direction: column; transition: .18s; cursor: pointer;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card-thumb { position: relative; aspect-ratio: 16/9; background: #06080b; overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .9; }
.card-thumb .noimg {
  width: 100%; height: 100%; display: grid; place-items: center; color: var(--ink-faint);
  font-family: 'Space Mono', monospace; font-size: 11px;
  background: repeating-linear-gradient(45deg, #0a0d11 0 10px, #0d1116 10px 20px);
}
.card-id {
  position: absolute; top: 9px; left: 9px; font-family: 'Space Mono', monospace;
  font-size: 10.5px; background: rgba(0,0,0,.62); padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line-2);
}
.status-badge {
  position: absolute; top: 9px; right: 9px; font-family: 'Space Mono', monospace;
  font-size: 10px; letter-spacing: .07em; padding: 4px 9px; border-radius: 6px; text-transform: uppercase; font-weight: 700;
}
.s-open { background: #0a2c37; color: var(--accent); border: 1px solid #1d5266; }
.s-judged { background: #3a2f0c; color: var(--amber); border: 1px solid #6b561a; }
.s-settled { background: #1a1f26; color: var(--ink-dim); border: 1px solid var(--line-2); }
.s-voided { background: var(--fake-dim); color: var(--fake); border: 1px solid #6e2a2a; }

.card-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.caption { font-family: 'Zodiak', serif; font-size: 15px; line-height: 1.34; margin: 0; }
.claimant { font-family: 'Space Mono', monospace; font-size: 10.5px; color: var(--ink-faint); }
.claimant b { color: var(--ink-dim); font-weight: 400; }

/* ---------------- modal ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: rgba(3,5,8,.74); backdrop-filter: blur(5px); padding: 20px;
  opacity: 0; visibility: hidden; transition: opacity .18s ease, visibility .18s ease;
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal {
  width: 100%; max-width: 540px; background: var(--panel); border: 1px solid var(--line-2);
  border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden;
  transform: scale(.97) translateY(8px); transition: transform .18s ease;
}
.modal-backdrop.open .modal { transform: none; }
.modal.sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; letter-spacing: .02em; display: flex; align-items: center; gap: 9px; }
.modal-head h3 i { color: var(--accent); }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { padding: 16px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.icon-btn { background: none; border: none; color: var(--ink-dim); font-size: 18px; cursor: pointer; padding: 4px; display: grid; place-items: center; }
.icon-btn:hover { color: var(--ink); }

.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 12.5px; color: var(--ink-dim); font-weight: 500; display: flex; justify-content: space-between; }
.field > span small { color: var(--ink-faint); font-weight: 400; }
.field input, .field textarea {
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  color: var(--ink); padding: 11px 13px; font-size: 14px; font-family: 'Space Grotesk', sans-serif; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.hint { font-size: 11px; color: var(--ink-faint); display: flex; align-items: center; gap: 6px; }
.hint i { color: var(--accent); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.side-toggle { display: flex; gap: 8px; }
.side-opt {
  flex: 1; padding: 10px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--ink-dim); font-family: 'Space Grotesk'; font-weight: 700; letter-spacing: .06em;
  cursor: pointer; transition: .15s; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.side-opt.real.active { background: var(--real-dim); color: var(--real); border-color: #1c5a3e; }
.side-opt.fake.active { background: var(--fake-dim); color: var(--fake); border-color: #6e2a2a; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-faint); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------------- toasts ---------------- */
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 80; display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.toast {
  background: var(--panel-2); border: 1px solid var(--line-2); border-left-width: 3px;
  border-radius: var(--r-sm); padding: 13px 15px; font-size: 13px; box-shadow: var(--shadow);
  animation: slidein .2s ease; display: flex; gap: 10px; align-items: flex-start;
}
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.info { border-left-color: var(--accent); }
.toast.success { border-left-color: var(--real); }
.toast.error { border-left-color: var(--fake); }
.toast.pending { border-left-color: var(--amber); }
.toast .t-title { font-weight: 600; margin-bottom: 2px; }
.toast .t-msg { color: var(--ink-dim); font-size: 12px; word-break: break-word; }
.spinner {
  width: 14px; height: 14px; border: 2px solid var(--line-2); border-top-color: var(--amber);
  border-radius: 50%; animation: spin .7s linear infinite; flex-shrink: 0; margin-top: 1px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.foot { max-width: 1240px; margin: 48px auto 30px; padding: 20px 24px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--ink-faint); font-size: 12px; flex-wrap: wrap; gap: 8px; position: relative; z-index: 2; }
.foot i { color: var(--accent); }
.foot a { color: var(--ink-faint); text-decoration: none; }
.foot a:hover { color: var(--accent); }

/* ---------------- responsive ---------------- */
@media (max-width: 940px) {
  .lighttable { grid-template-columns: 1fr; }
  .strip { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) { .topbar { padding: 13px 16px; } .brand-text p { display: none; } }
@media (max-width: 560px) {
  .row { grid-template-columns: 1fr; }
  .cases { grid-template-columns: 1fr; }
  .strip { grid-template-columns: repeat(2, 1fr); }
  .em-row { grid-template-columns: 1fr; gap: 2px; }
}
