/* Same tokens as metrics.thefaithmade.com (bible-app/web/dash.html). */
:root {
  --background: oklch(0.992 0.004 85); --card: oklch(1 0 0);
  --muted: oklch(0.968 0.006 85); --muted-2: oklch(0.945 0.007 85);
  --border: oklch(0.912 0.008 85); --foreground: oklch(0.22 0.015 60);
  --mid: oklch(0.42 0.013 60); --muted-fg: oklch(0.545 0.012 60);
  --primary: oklch(0.52 0.105 62); --primary-fg: oklch(0.99 0.005 85);
  --ring: oklch(0.52 0.105 62 / 0.35);
  --pos: oklch(0.52 0.12 155); --neg: oklch(0.53 0.18 27); --warn: oklch(0.62 0.13 75);
  --pos-bg: oklch(0.52 0.12 155 / 0.11); --neg-bg: oklch(0.53 0.18 27 / 0.10); --warn-bg: oklch(0.62 0.13 75 / 0.13);
  --c1: oklch(0.55 0.19 22); --c2: oklch(0.58 0.145 196); --c4: oklch(0.52 0.16 258);
  --shadow-sm: 0 1px 2px oklch(0.22 0.015 60 / 0.06);
  --shadow: 0 1px 2px oklch(0.22 0.015 60 / 0.05), 0 8px 20px -12px oklch(0.22 0.015 60 / 0.18);
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: oklch(0.165 0.008 60); --card: oklch(0.205 0.010 60);
    --muted: oklch(0.245 0.010 60); --muted-2: oklch(0.275 0.011 60);
    --border: oklch(0.30 0.012 60); --foreground: oklch(0.955 0.008 85);
    --mid: oklch(0.82 0.010 70); --muted-fg: oklch(0.70 0.012 70);
    --primary: oklch(0.74 0.115 68); --primary-fg: oklch(0.18 0.01 60);
    --ring: oklch(0.74 0.115 68 / 0.4);
    --pos: oklch(0.72 0.13 158); --neg: oklch(0.68 0.16 25); --warn: oklch(0.78 0.13 78);
    --pos-bg: oklch(0.72 0.13 158 / 0.15); --neg-bg: oklch(0.68 0.16 25 / 0.15); --warn-bg: oklch(0.78 0.13 78 / 0.15);
    --c1: oklch(0.62 0.16 22); --c2: oklch(0.63 0.13 196); --c4: oklch(0.57 0.145 262);
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.4);
    --shadow: 0 1px 2px oklch(0 0 0 / 0.4), 0 8px 20px -12px oklch(0 0 0 / 0.7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--background); color: var(--foreground); }
body { font: 14px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, sans-serif; -webkit-font-smoothing: antialiased; }
h2 { font-size: 15px; margin: 0 0 10px; font-weight: 650; letter-spacing: -0.01em; }
h3 { font-size: 13px; margin: 18px 0 8px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-fg); }
a { color: var(--primary); }
.muted { color: var(--muted-fg); }
.err { color: var(--neg); min-height: 1.2em; }
[hidden] { display: none !important; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(380px, 100%); display: grid; gap: 12px; padding: 28px; }
.login-card .brand { font-size: 20px; }
label { display: grid; gap: 5px; font-size: 12.5px; font-weight: 550; color: var(--mid); }
input, select, textarea {
  font: inherit; color: var(--foreground); background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; outline: none; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }

/* chrome */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 18px; padding: 10px 22px;
  background: color-mix(in oklch, var(--background) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.brand { font-weight: 700; letter-spacing: -0.015em; font-size: 16px; display: flex; align-items: center; gap: 7px; }
.brand .sub { font-weight: 450; color: var(--muted-fg); font-size: 12px; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.tabs a { text-decoration: none; color: var(--mid); padding: 6px 11px; border-radius: 7px; font-weight: 550; font-size: 13px; }
.tabs a:hover { background: var(--muted); }
.tabs a.on { background: var(--muted-2); color: var(--foreground); }
.top-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
main { max-width: 1280px; margin: 0 auto; padding: 18px 22px 60px; display: grid; gap: 16px; }
main > section { display: grid; gap: 16px; }

.banner { margin: 14px 22px 0; padding: 10px 14px; border-radius: var(--radius); background: var(--warn-bg); color: var(--foreground); border: 1px solid color-mix(in oklch, var(--warn) 35%, transparent); font-size: 13px; }
.banner.neg { background: var(--neg-bg); border-color: color-mix(in oklch, var(--neg) 35%, transparent); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; }
.link { font-size: 12.5px; text-decoration: none; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; }

.btn { font: inherit; font-weight: 600; font-size: 13px; border: 1px solid var(--border); background: var(--card); color: var(--foreground);
  border-radius: 8px; padding: 7px 13px; cursor: pointer; box-shadow: var(--shadow-sm); }
.btn:hover { background: var(--muted); }
.btn.primary { background: var(--primary); color: var(--primary-fg); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--neg); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; padding: 3px 9px; border-radius: 999px; background: var(--muted-2); color: var(--mid); white-space: nowrap; }
.pill.test { background: var(--warn-bg); color: var(--warn); }
.pill.live { background: var(--neg-bg); color: var(--neg); }
.pill.pos { background: var(--pos-bg); color: var(--pos); }
.pill.neg { background: var(--neg-bg); color: var(--neg); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.src { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px; color: white; white-space: nowrap; }
.src.tiktok { background: var(--c1); } .src.meta { background: var(--c4); } .src.shopify { background: var(--c2); }
.score { font-variant-numeric: tabular-nums; font-weight: 700; }
.score.hi { color: var(--neg); } .score.md { color: var(--warn); } .score.lo { color: var(--muted-fg); }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.tile .k { font-size: 12px; color: var(--muted-fg); font-weight: 550; }
.tile .v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile .s { font-size: 11.5px; color: var(--muted-fg); margin-top: 2px; }
.tile.hot .v { color: var(--neg); }

/* queue */
.queue { display: grid; gap: 8px; }
.qitem { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 8px; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; }
.qitem:hover { background: var(--muted); }
.thumb { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; background: var(--muted-2); display: block; }
.qtitle { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.qmeta { font-size: 12px; color: var(--muted-fg); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 3px; }
.empty { color: var(--muted-fg); padding: 18px; text-align: center; font-size: 13px; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11.5px; font-weight: 650; color: var(--muted-fg); text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--muted); white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--muted); }
td.t { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input { flex: 1; min-width: 180px; }

.activity { display: grid; gap: 0; max-height: 360px; overflow-y: auto; }
.act { display: grid; grid-template-columns: 120px 90px 1fr; gap: 10px; font-size: 12.5px; padding: 6px 2px; border-bottom: 1px solid var(--border); }
.act .when { color: var(--muted-fg); font-variant-numeric: tabular-nums; }
.act .kind { font-weight: 600; color: var(--mid); }

/* drawer */
.drawer { position: fixed; inset: 0; z-index: 20; }
.drawer-bg { position: absolute; inset: 0; background: oklch(0 0 0 / 0.35); }
.drawer-panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(860px, 100%); background: var(--background); border-left: 1px solid var(--border);
  overflow-y: auto; padding: 22px 24px 60px; box-shadow: var(--shadow); }
.x { position: sticky; top: 0; float: right; font-size: 26px; line-height: 1; border: 0; background: none; color: var(--mid); cursor: pointer; }
.case-head { display: grid; grid-template-columns: 120px 1fr; gap: 16px; }
.case-head img { width: 120px; height: 120px; object-fit: cover; border-radius: 8px; background: var(--muted-2); }
.case-head h2 { font-size: 17px; margin-bottom: 6px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 4px 12px; font-size: 13px; margin-top: 10px; }
.kv dt { color: var(--muted-fg); }
.kv dd { margin: 0; word-break: break-word; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--muted-2); color: var(--mid); }
.chip.strong { background: var(--neg-bg); color: var(--neg); font-weight: 650; }
.evidence { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.evidence img { max-width: 260px; max-height: 320px; object-fit: cover; object-position: top; border: 1px solid var(--border); border-radius: 8px; }
.notice { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.notice summary { padding: 9px 12px; cursor: pointer; display: flex; gap: 10px; align-items: center; background: var(--muted); font-weight: 600; font-size: 13px; }
.notice pre { margin: 0; padding: 12px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; background: var(--card); max-height: 420px; overflow-y: auto; }
.affirm { border: 1px solid color-mix(in oklch, var(--primary) 40%, var(--border)); border-radius: 10px; padding: 14px; background: color-mix(in oklch, var(--primary) 6%, var(--card)); margin-top: 14px; }
.affirm label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; color: var(--foreground); font-size: 13px; }
.affirm input[type=checkbox] { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--primary); }
.affirm .row { margin-top: 12px; align-items: center; }
.filed { font-size: 12.5px; display: grid; gap: 6px; }
.filed .f { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; display: grid; gap: 3px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
code { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--muted-2); padding: 1px 5px; border-radius: 4px; }

/* overview v2: today strip, outcome tiles, pipeline, feeds */
.small { font-size: 12px; }
.card-h.wrap { flex-wrap: wrap; gap: 8px; }
.btnrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.today { display: grid; grid-template-columns: auto repeat(4, 1fr); gap: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.today .lbl { padding: 10px 16px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary); display: flex; align-items: center; background: var(--muted); }
.today .t { padding: 10px 16px; border-left: 1px solid var(--border); display: flex; align-items: baseline; gap: 8px; }
.today .t b { font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.today .t span { font-size: 12px; color: var(--muted-fg); }
.tile.pos .v { color: var(--pos); } .tile.neg .v { color: var(--neg); } .tile.warn .v { color: var(--warn); }
.tile .bar { height: 4px; border-radius: 99px; background: var(--muted-2); margin-top: 8px; overflow: hidden; }
.tile .bar i { display: block; height: 100%; background: var(--pos); }
a.tile { color: inherit; text-decoration: none; } a.tile:hover { border-color: var(--primary); }

.pipeline { display: grid; grid-template-columns: repeat(5, 1fr) 1.2fr; gap: 6px; margin-top: 4px; }
.stage { position: relative; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; cursor: pointer; background: var(--muted); text-decoration: none; color: inherit; display: block; }
.stage:hover { border-color: var(--primary); background: var(--muted-2); }
.stage .n { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stage .l { font-size: 11.5px; color: var(--muted-fg); font-weight: 600; }
.stage .fill { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--primary); border-radius: 0 0 0 8px; }
.stage.hot .n { color: var(--warn); }
.stage.split { display: grid; grid-template-columns: 1fr 1fr; padding: 0; overflow: hidden; cursor: default; }
.stage.split a { padding: 10px 12px; color: inherit; text-decoration: none; }
.stage.split a:hover { background: var(--muted-2); }
.stage.split a + a { border-left: 1px solid var(--border); }
.stage.split .pos .n { color: var(--pos); } .stage.split .neg .n { color: var(--neg); }

.feed { display: grid; }
.feed .r { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; padding: 8px 2px; border-bottom: 1px solid var(--border); font-size: 12.5px; align-items: start; }
.feed .r:last-child { border-bottom: 0; }
.feed .r .snip { grid-column: 2 / -1; color: var(--muted-fg); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.feed .r .when { color: var(--muted-fg); white-space: nowrap; font-variant-numeric: tabular-nums; }
.feed .r .ttl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hash { font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted-fg); word-break: break-all; }
.strike { display: inline-block; min-width: 22px; text-align: center; font-weight: 700; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted-fg); margin-right: 6px; vertical-align: middle; }
.dot.on { background: var(--neg); } .dot.off { background: var(--pos); }

/* case timeline */
.tl { list-style: none; margin: 0; padding: 0 0 0 4px; }
.tl li { position: relative; padding: 0 0 12px 22px; border-left: 2px solid var(--border); font-size: 13px; }
.tl li:last-child { border-left-color: transparent; }
.tl li::before { content: ""; position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2px solid var(--muted-fg); }
.tl li.removed::before { background: var(--pos); border-color: var(--pos); }
.tl li.rejected::before, .tl li.reappeared::before, .tl li.failed::before { background: var(--neg); border-color: var(--neg); }
.tl li.filed::before, .tl li.approved::before { background: var(--primary); border-color: var(--primary); }
.tl li.response::before { border-color: var(--warn); background: var(--warn-bg); }
.tl .lab { font-weight: 650; }
.tl .at { color: var(--muted-fg); font-size: 12px; margin-left: 6px; font-variant-numeric: tabular-nums; }
.tl .det { color: var(--muted-fg); font-size: 12px; word-break: break-word; }

@media (max-width: 900px) {
  .pipeline { grid-template-columns: repeat(3, 1fr); }
  .pipeline .stage.split { grid-column: span 3; }
}
@media (max-width: 700px) {
  .today { grid-template-columns: 1fr 1fr; }
  .today .lbl { grid-column: 1 / -1; padding: 6px 12px; }
  .today .t { border-left: 0; border-top: 1px solid var(--border); padding: 8px 12px; }
  .today .t:nth-child(odd) { border-left: 1px solid var(--border); }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .tile { padding: 10px 12px; } .tile .v { font-size: 22px; }
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .pipeline .stage.split { grid-column: span 2; }
  .grid2 { grid-template-columns: 1fr; }
  .top .brand .sub { display: none; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; width: 100%; }
}
@media (max-width: 700px) {
  .top { padding: 10px 14px; gap: 10px; }
  main { padding: 14px; }
  .grid2 { grid-template-columns: 1fr; }
  .case-head { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .act { grid-template-columns: 1fr; }
}
