:root {
  --bg: #18181b;
  --bg-subtle: #1c1c20;
  --surface: #27272a;
  --surface-2: #2e2e33;
  --surface-3: #3a3a40;
  --border: #36363c;
  --border-soft: #2c2c32;
  --border-focus: #d4a544;

  --text: #fafafa;
  --text-soft: #d4d4d8;
  --muted: #a1a1aa;
  --muted-soft: #71717a;

  --accent: #d4a544;
  --accent-hover: #e0b34f;
  --accent-soft: rgba(212, 165, 68, 0.14);
  --accent-glow: rgba(212, 165, 68, 0.35);

  --green: #4ade80;
  --green-bg: rgba(74, 222, 128, 0.12);
  --green-border: rgba(74, 222, 128, 0.3);
  --red: #f87171;
  --red-bg: rgba(248, 113, 113, 0.12);
  --red-border: rgba(248, 113, 113, 0.3);
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.12);

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.5);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

body {
  min-height: 100dvh;
  background: var(--bg);
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(at 20% -10%, rgba(212,165,68,0.05) 0%, transparent 50%),
    radial-gradient(at 80% 100%, rgba(212,165,68,0.04) 0%, transparent 40%);
}

.container {
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  padding: 16px 20px 100px 20px;
  padding-top: max(16px, env(safe-area-inset-top));
  width: 100%;
}

/* === Header / App Bar === */
.brand {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0 24px 0;
  padding: 0 4px;
  gap: 12px;
  flex-wrap: wrap;
}
.brand h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.8px;
  color: var(--text);
}
.brand .sub {
  color: var(--muted);
  margin: 2px 0 0 0;
  font-size: 13px;
  letter-spacing: 0;
}
.brand nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.brand nav a,
.brand nav button,
.brand nav form button {
  background: var(--surface);
  color: var(--text-soft);
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.brand nav a:hover,
.brand nav button:hover,
.brand nav form button:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--accent);
}
.brand nav a.cta {
  background: var(--accent);
  color: #1a1a1a;
  border-color: var(--accent);
}
.brand nav a.cta:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.brand nav form { margin: 0; display: inline; }

/* === Cards === */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.card h2 {
  margin: 0 0 18px 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
}
.card h3 {
  margin: 0 0 14px 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  font-weight: 800;
}

/* === Form === */
label {
  display: block;
  margin-bottom: 16px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="file"],
input:not([type]),
textarea,
select {
  width: 100%;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 16px;
  margin-top: 8px;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
  text-transform: none;
  letter-spacing: 0;
}
textarea { resize: vertical; min-height: 76px; line-height: 1.5; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--muted-soft); font-weight: 400; }
input[type="file"] { padding: 12px 14px; cursor: pointer; font-size: 14px; }
select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M3 4.5l3 3 3-3' stroke='%23a1a1aa' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; gap: 0; } }

/* === Buttons === */
button {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
button:hover { background: var(--surface-3); border-color: var(--border-focus); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
button:disabled:hover { background: var(--surface-2); border-color: var(--border); }

button.primary {
  background: linear-gradient(180deg, var(--accent-hover) 0%, var(--accent) 100%);
  color: #1a1a1a;
  border-color: var(--accent);
  font-weight: 700;
  font-size: 16px;
  padding: 15px 22px;
  width: 100%;
  margin-top: 16px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(212,165,68,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
}
button.primary:hover {
  background: linear-gradient(180deg, #ecbe5f 0%, var(--accent-hover) 100%);
  box-shadow: 0 6px 16px rgba(212,165,68,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
}
button.primary:active { transform: translateY(1px); box-shadow: 0 2px 6px rgba(212,165,68,0.25); }

button.ghost {
  background: transparent;
  color: var(--text-soft);
  border: 1px dashed var(--border);
  width: 100%;
  font-weight: 600;
  padding: 12px 18px;
}
button.ghost:hover { background: var(--surface); border-style: solid; border-color: var(--accent); color: var(--accent); }

button.warn {
  background: var(--warn);
  color: #1a1a1a;
  border-color: var(--warn);
  font-weight: 700;
}
button.warn:hover { background: #fcc54a; border-color: #fcc54a; }

button.danger {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  font-weight: 700;
}

button.small { padding: 9px 14px; font-size: 13px; border-radius: var(--radius-sm); }

button.link {
  background: transparent;
  border: none;
  color: var(--accent);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
button.link:hover { background: var(--accent-soft); }

a { color: var(--accent); }
a:not(.tab):not(.brand nav a):not(.stat-card):not(.history-row) { transition: color 0.15s; }

/* === Photo upload rows === */
.photo-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  align-items: center;
}
.photo-row input, .photo-row select { margin-top: 0; background: var(--bg-subtle); border-color: var(--border-soft); }
.photo-row .remove {
  padding: 9px 14px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  font-weight: 600;
}
.photo-row .remove:hover { color: var(--red); border-color: var(--red); background: var(--red-bg); }

@media (max-width: 520px) {
  .photo-row { grid-template-columns: 1fr; padding: 12px; gap: 8px; }
  .photo-row .remove { justify-self: end; padding: 8px 14px; }
}

.imported-row { background: var(--surface-2); border-color: var(--border-soft); }
.thumb-wrap { position: relative; }
.thumb { width: 100%; height: 96px; object-fit: cover; border-radius: var(--radius-sm); display: block; }

/* === Hints / messages === */
.hint { color: var(--muted); font-size: 13px; margin: 8px 0; line-height: 1.55; }
.hint a { color: var(--accent); text-decoration: none; }
.hint a:hover { text-decoration: underline; }
.err {
  color: var(--red);
  font-size: 14px;
  margin: 14px 0;
  padding: 12px 16px;
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  border-radius: var(--radius-sm);
  font-weight: 500;
}
.ok {
  color: var(--green);
  font-size: 14px;
  margin: 14px 0;
  padding: 12px 16px;
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* === URL paste block === */
.url-block {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 18px;
}
.url-block label { margin-bottom: 10px; }
.url-block .ghost { margin-top: 8px; }

/* === Meta preview === */
.meta-preview {
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--surface) 100%);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
  font-size: 14px;
}
.meta-preview h3 { margin: 0 0 10px 0; color: var(--accent); }
.meta-preview div { padding: 3px 0; color: var(--text-soft); }
.meta-preview strong { color: var(--text); font-weight: 700; }

/* === Verdict colors === */
.verdict-green { border-color: var(--green); background: linear-gradient(180deg, rgba(74,222,128,0.1) 0%, var(--surface) 100%); }
.verdict-green-soft { border-color: rgba(74,222,128,0.4); background: linear-gradient(180deg, rgba(74,222,128,0.05) 0%, var(--surface) 100%); }
.verdict-gray { border-color: var(--border); }
.verdict-red-soft { border-color: rgba(248,113,113,0.4); background: linear-gradient(180deg, rgba(248,113,113,0.05) 0%, var(--surface) 100%); }
.verdict-red { border-color: var(--red); background: linear-gradient(180deg, rgba(248,113,113,0.1) 0%, var(--surface) 100%); }

#verdict-card h2 { font-size: 32px; letter-spacing: -1px; font-weight: 800; }
.confidence { color: var(--muted); margin: 6px 0 18px 0; font-size: 14px; font-weight: 500; }
.confidence strong { color: var(--text); font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }

.loading { color: var(--accent); }
.loading::after { content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 10px; border-radius: 50%; background: var(--accent); animation: pulse 1s infinite; vertical-align: middle; }
@keyframes pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* === Checklist / red flags === */
.checklist, .redflags { list-style: none; padding: 0; margin: 0; }
.checklist li, .redflags li { padding: 14px 0; border-top: 1px solid var(--border-soft); }
.checklist li:first-child, .redflags li:first-child { border-top: none; padding-top: 0; }
.tag {
  font-size: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 800;
  vertical-align: middle;
  display: inline-block;
}
.check-pass .tag { background: var(--green-bg); color: var(--green); }
.check-fail .tag { background: var(--red-bg); color: var(--red); }
.check-inconclusive .tag, .check-not_visible .tag { background: var(--surface-3); color: var(--muted); }
.flag-low .tag { background: var(--warn-bg); color: var(--warn); }
.flag-medium .tag { background: var(--warn-bg); color: var(--warn); }
.flag-high .tag, .flag-fatal .tag { background: var(--red-bg); color: var(--red); }
.evidence { color: var(--muted); font-size: 13px; margin-top: 5px; line-height: 1.55; }

/* === Misc text === */
pre {
  background: var(--bg-subtle);
  padding: 14px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 12px;
  white-space: pre-wrap;
  line-height: 1.55;
  border: 1px solid var(--border-soft);
}
code {
  background: var(--bg-subtle);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  color: var(--accent);
  word-break: break-all;
  border: 1px solid var(--border-soft);
}

.meta { display: grid; grid-template-columns: 110px 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.meta dt { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; }
.meta dd { margin: 0; color: var(--text-soft); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo { margin: 0; }
.photo img { width: 100%; height: 130px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border-soft); }
.photo figcaption { font-size: 11px; color: var(--muted); text-align: center; margin-top: 6px; font-weight: 600; }

/* === History rows === */
.history { display: flex; flex-direction: column; gap: 10px; }
.history-row {
  display: grid;
  grid-template-columns: 56px 1fr 140px 110px;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none !important;
  color: var(--text);
  align-items: center;
  transition: all 0.15s ease;
}
.history-row:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.col-id { color: var(--muted); font-family: ui-monospace, monospace; font-size: 13px; font-weight: 700; }
.col-verdict { font-size: 12px; font-weight: 800; text-align: right; text-transform: uppercase; letter-spacing: 1px; }
.col-date { font-size: 11px; text-align: right; color: var(--muted); }
@media (max-width: 640px) {
  .history-row { grid-template-columns: 44px 1fr 88px; padding: 14px; gap: 10px; }
  .col-date { display: none; }
}

/* === Bottom tab bar === */
body.has-tab-bar { padding-bottom: 0; }
body.has-tab-bar .container { padding-bottom: 110px; }
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  /* Solid opaque background — backdrop-filter + position:fixed drifts during
     momentum scroll on iOS Safari, so we trade the blur for a bulletproof bar. */
  background: #14141a;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: env(safe-area-inset-bottom);
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  will-change: transform;
}
.tab {
  flex: 1;
  text-align: center;
  text-decoration: none !important;
  color: var(--muted);
  padding: 12px 4px 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: color 0.15s;
}
.tab svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}
.tab span { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
.tab:hover { color: var(--text-soft); }
.tab.active { color: var(--accent); }

/* === Admin stat cards === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  text-decoration: none !important;
  color: var(--text);
  display: block;
  transition: all 0.18s ease;
  position: relative;
  overflow: hidden;
}
.stat-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-card.highlight {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--surface) 100%);
}
.stat-card.highlight::after {
  content: '';
  position: absolute;
  top: 14px;
  right: 14px;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: ping 1.6s infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  100% { box-shadow: 0 0 0 14px transparent; }
}
.stat-n { font-size: 44px; font-weight: 800; color: var(--accent); line-height: 1; letter-spacing: -1.5px; }
.stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 10px;
  font-weight: 800;
}

/* === Pending / user rows === */
.pending-row, .user-row { padding: 18px; }
.pending-head, .user-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.pending-head h3, .user-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  text-transform: none;
  letter-spacing: -0.2px;
}
.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.row-actions form { margin: 0; }
.row-actions button { margin: 0; width: auto; }
.badge {
  font-size: 10px;
  padding: 4px 9px;
  background: var(--accent);
  color: #1a1a1a;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 800;
  display: inline-block;
  margin-left: 8px;
}

.user-head .tag { background: var(--surface-3); color: var(--muted); }

/* === Login form polish === */
form.card label { margin-bottom: 16px; }
form.card button.primary { margin-top: 12px; }

form.card label.remember {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-direction: row;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 8px;
}
form.card label.remember input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: var(--surface-2);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
form.card label.remember input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
form.card label.remember input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 11px;
  border: solid #1a1a1a;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Kill default link underlines in main content */
.brand nav a, .tab, .stat-card, .history-row, button.link { text-decoration: none !important; }

/* === Watermark === */
.watermark {
  position: fixed;
  bottom: 12px;
  left: 14px;
  z-index: 90;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.28);
  text-decoration: none !important;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: #14141a;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  will-change: transform;
}
.watermark span { color: var(--accent); }
.watermark:hover {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(28, 28, 32, 0.7);
  border-color: rgba(212, 165, 68, 0.3);
}
body.has-tab-bar .watermark { bottom: calc(72px + env(safe-area-inset-bottom)); }
@media (max-width: 480px) {
  .watermark { font-size: 9px; padding: 5px 9px; left: 10px; bottom: 10px; }
}

/* === Search bar === */
.search-bar {
  display: flex;
  gap: 8px;
  margin: 0 0 16px 0;
  align-items: stretch;
}
.search-bar input {
  flex: 1;
  background: var(--surface-2);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  color: var(--text);
  padding: 10px 16px;
  font-size: 14px;
}
.search-bar input:focus {
  outline: none;
  border-color: var(--accent);
}
.search-bar button { flex-shrink: 0; }

/* === Verdict feedback buttons === */
.feedback-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  background: var(--surface-2);
  color: var(--text-soft);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.pill:hover { background: var(--surface-3); color: var(--text); }
.pill:disabled { opacity: 0.6; cursor: not-allowed; }
.pill.active { background: var(--accent); color: #1a1a1a; border-color: var(--accent); }
.ok-pill.active { background: #4ade80; border-color: #4ade80; color: #0a1f0a; }
.warn-pill.active { background: #f87171; border-color: #f87171; color: #1a0a0a; }

/* === Share link === */
.share-state { display: flex; align-items: center; gap: 10px; }
.share-url-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.share-url-row input {
  flex: 1;
  background: var(--surface-2);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.share-url-row button { flex-shrink: 0; }

/* === Request rows === */
.request-row {
  background: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}
.request-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.request-head strong { font-size: 15px; }
.tag-open { background: rgba(212, 165, 68, 0.18); color: var(--accent); }
.tag-progress { background: rgba(96, 165, 250, 0.18); color: #93c5fd; }
.tag-done { background: rgba(74, 222, 128, 0.18); color: #86efac; }
.tag-declined { background: rgba(248, 113, 113, 0.18); color: #fca5a5; }

/* === Side-by-side comparison === */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 16px 0;
  width: 100%;
}
.compare-grid > * { min-width: 0; width: 100%; margin-bottom: 0; }
@media (max-width: 720px) {
  .compare-grid { grid-template-columns: 1fr; }
}
.compare-side {
  background: var(--surface-2);
  border: 1.5px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 14px;
}
.compare-side h3 {
  margin: 0 0 10px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.compare-side-a h3 { color: #93c5fd; }
.compare-side-b h3 { color: #fcd34d; }
.compare-side-card.side-a { border-left: 3px solid #60a5fa; }
.compare-side-card.side-b { border-left: 3px solid #f59e0b; }

.winner-a {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.18), rgba(96, 165, 250, 0.05));
  border-color: rgba(96, 165, 250, 0.4);
}
.winner-a h2 { color: #93c5fd; }
.winner-b {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(245, 158, 11, 0.05));
  border-color: rgba(245, 158, 11, 0.4);
}
.winner-b h2 { color: #fcd34d; }

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.compare-table th,
.compare-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}
.compare-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-soft);
  font-weight: 600;
}
.compare-table tr.res-a td:nth-child(2) { background: rgba(96, 165, 250, 0.10); }
.compare-table tr.res-b td:nth-child(3) { background: rgba(245, 158, 11, 0.10); }
.compare-table tr.res-both td:nth-child(2),
.compare-table tr.res-both td:nth-child(3) { background: rgba(74, 222, 128, 0.08); }
.compare-table tr.res-neither td:nth-child(2),
.compare-table tr.res-neither td:nth-child(3) { background: rgba(248, 113, 113, 0.08); }
.compare-table .hint { margin-top: 4px; font-size: 11px; }
.tag-hard {
  background: rgba(212, 165, 68, 0.18);
  color: var(--accent);
  font-size: 10px;
  padding: 2px 6px;
}
/* On phones, the 4-column compare-table is unreadable. Restack each row as a card
   with labeled subsections (Item A: …, Item B: …, Result: …). */
@media (max-width: 720px) {
  .compare-table,
  .compare-table tbody,
  .compare-table tr,
  .compare-table td { display: block; width: 100%; }
  .compare-table thead { display: none; }
  .compare-table tr {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: var(--surface-2);
  }
  .compare-table td {
    border-bottom: 0;
    padding: 6px 0;
    background: transparent !important;
  }
  .compare-table td:nth-child(1) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 8px;
    margin-bottom: 4px;
  }
  .compare-table td:nth-child(2)::before { content: 'Item A — '; color: #93c5fd; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; margin-right: 4px; }
  .compare-table td:nth-child(3)::before { content: 'Item B — '; color: #fcd34d; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; margin-right: 4px; }
  .compare-table td:nth-child(4)::before { content: 'Result: '; font-size: 11px; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.5px; margin-right: 4px; }
  /* Color-code the winning side per row by re-applying the bg to the relevant labeled cell */
  .compare-table tr.res-a td:nth-child(2) { background: rgba(96, 165, 250, 0.10) !important; border-radius: 6px; padding: 6px 8px !important; }
  .compare-table tr.res-b td:nth-child(3) { background: rgba(245, 158, 11, 0.10) !important; border-radius: 6px; padding: 6px 8px !important; }
  .compare-table tr.res-both td:nth-child(2),
  .compare-table tr.res-both td:nth-child(3) { background: rgba(74, 222, 128, 0.08) !important; border-radius: 6px; padding: 6px 8px !important; }
  .compare-table tr.res-neither td:nth-child(2),
  .compare-table tr.res-neither td:nth-child(3) { background: rgba(248, 113, 113, 0.08) !important; border-radius: 6px; padding: 6px 8px !important; }
}

/* Long URLs / hashes in notes/meta cells should wrap rather than overflow the card */
dl.meta dd { overflow-wrap: anywhere; word-break: break-word; }

/* === Live camera capture overlay === */
.capture-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}
.capture-overlay[hidden] { display: none; }
.capture-frame {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.capture-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.capture-bar button { color: #fff; font-size: 22px; line-height: 1; }
#capture-video {
  flex: 1;
  width: 100%;
  object-fit: cover;
  background: #111;
  min-height: 0;
}
.capture-prompt {
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  line-height: 1.4;
}
.capture-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: #000;
  gap: 12px;
}
.shutter {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid #d4a544;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.15) inset;
  transition: transform 0.1s;
}
.shutter:active { transform: scale(0.92); }
.capture-review {
  position: absolute;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  z-index: 1;
}
.capture-review[hidden] { display: none; }
.capture-review img {
  flex: 1;
  width: 100%;
  object-fit: contain;
  background: #111;
  min-height: 0;
}

/* === Captured-thumbs strip (under photo list, before submit) === */
.captured-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.captured-strip:empty { display: none; }
.captured-thumb {
  position: relative;
  width: 80px;
}
.captured-thumb img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1.5px solid rgba(212, 165, 68, 0.4);
}
.captured-thumb span {
  display: block;
  font-size: 10px;
  text-align: center;
  margin-top: 2px;
  color: var(--text-soft);
}
.captured-thumb .remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #111;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.2);
  font-size: 12px;
  padding: 0;
  line-height: 1;
}

/* === Result page: compact actions row, background-check sections, debug, compact meta === */
.actions-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px !important;
}
.actions-row .action-sep {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.08);
}
.actions-row .inline-share { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.actions-row .share-url-inline {
  display: flex;
  align-items: stretch;
  gap: 6px;
  flex: 1;
  min-width: 220px;
}
.actions-row .share-url-inline input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text);
  padding: 7px 10px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.actions-row .inline-feedback { display: inline-flex; align-items: center; gap: 4px; }
.actions-row .inline-feedback .pill { padding: 6px 12px; font-size: 13px; }
@media (max-width: 560px) {
  .actions-row { gap: 8px; }
  .actions-row .action-sep { display: none; }
  .actions-row .share-url-inline { width: 100%; min-width: 0; }
}

.verdict-summary {
  font-size: 15px;
  line-height: 1.55;
  margin: 8px 0 0 0;
}

/* Background-checks consolidated card sub-sections */
.bg-section {
  background: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
}
.bg-section:last-child { margin-bottom: 0; }
.bg-section .bg-head {
  margin-bottom: 4px;
  font-size: 14px;
}
.bg-section.bg-alert { border-left: 3px solid #f87171; }
.bg-section.bg-warn { border-left: 3px solid #fcd34d; }
.bg-section ul.redflags { padding-left: 18px; font-size: 13px; }
.bg-section ul.redflags li { margin-bottom: 4px; }

/* Compact submitted-info meta */
.compact-meta dt { font-size: 11px; }
.compact-meta dd { font-size: 13px; }

/* Debug card (admin-only collapsible) */
.debug-card summary {
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
}
.debug-card[open] { padding-bottom: 18px; }
.debug-card pre {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px;
  font-size: 11px;
  line-height: 1.4;
  max-height: 400px;
  overflow: auto;
}
.debug-card h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-soft);
}

/* === Adversarial debate grid (auth result page) === */
.debate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 720px) {
  .debate-grid { grid-template-columns: 1fr; }
}
.debate-side {
  background: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px 14px;
}
.debate-side[open] { padding-bottom: 14px; }
.debate-defense { border-left: 3px solid #4ade80; }
.debate-prosecution { border-left: 3px solid #f87171; }
.debate-side summary { cursor: pointer; padding: 4px 0; user-select: none; }
.debate-side ul { padding-left: 18px; font-size: 13px; line-height: 1.5; }
.debate-side ul li { margin-bottom: 4px; }
.debate-side ul li strong { color: var(--text); }

/* === Hunt agent === */
.badge-trusted {
  background: rgba(96, 165, 250, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.3);
}
.hunt-card .hunt-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hunt-card .hunt-head h3 { margin: 0; }
.hunt-match-grid {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 14px;
  align-items: start;
}
.hunt-match-thumb img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 10px;
}
.hunt-match-thumb .thumb-placeholder {
  width: 100px;
  height: 100px;
  border-radius: 10px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-soft);
}
.hunt-match-body h4 { margin: 0; font-size: 15px; line-height: 1.4; }
.hunt-match-body a { color: var(--text); text-decoration: none; }
.hunt-match-body a:hover { color: var(--accent); }
.hunt-match-new { border-left: 3px solid var(--accent); }
@media (max-width: 480px) {
  .hunt-match-grid { grid-template-columns: 80px 1fr; gap: 10px; }
  .hunt-match-thumb img, .hunt-match-thumb .thumb-placeholder { width: 80px; height: 80px; }
}

/* === Accuracy dashboard === */
.acc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 8px;
}
.acc-table th,
.acc-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}
.acc-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-soft);
  font-weight: 600;
}
.acc-bar {
  display: inline-block;
  width: 80px;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 6px;
}
.acc-fill {
  height: 100%;
  border-radius: 4px;
}

/* === Reference photo grid (admin) === */
.ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.ref-card {
  background: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 8px;
  margin: 0;
}
.ref-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.ref-card figcaption {
  padding: 8px 4px 4px 4px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-soft);
}
.ref-card figcaption strong { color: var(--text); }
