:root {
  --bg:#0b1020; --card:#151b2e; --ink:#e6e9f2; --muted:#94a0bf; --accent:#5b8cff;
  --good:#1f7a4d; --bad:#a33; --line:#222a44;
}
* { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
body { margin:0; background:var(--bg); color:var(--ink);
  font:16px/1.5 -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;
  padding-bottom:calc(96px + env(safe-area-inset-bottom)); }
a { color:var(--accent); text-decoration:none; }
h1 { margin:0; font-size:19px; } h2 { font-size:15px; margin:18px 0 6px; color:var(--muted); }
.muted { color:var(--muted); } .small { font-size:13px; } .nowrap { white-space:nowrap; }
.mono { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:14px; }
.truncate { max-width:280px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.error { color:#ffb4b4; background:#3a1620; padding:10px 14px; border-radius:10px; margin:12px 16px; }
.bar { display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:calc(12px + env(safe-area-inset-top)) 16px 12px; border-bottom:1px solid var(--line);
  position:sticky; top:0; background:rgba(11,16,32,.92); backdrop-filter:blur(8px); z-index:5; }
.back { font-size:20px; margin-right:6px; }

/* ---------------------------------------------------------------- capture */
.capture-bar { position:fixed; left:0; right:0; bottom:0; z-index:10;
  padding:12px 16px calc(12px + env(safe-area-inset-bottom));
  background:linear-gradient(to top, var(--bg) 60%, rgba(11,16,32,.75));
  border-top:1px solid var(--line); }
.shoot-row { display:flex; gap:10px; }
.shoot { display:block; flex:1; background:var(--accent); color:#06101f; border-radius:14px;
  padding:16px 12px; text-align:center; font-weight:700; font-size:16px; cursor:pointer; }
.shoot.secondary { background:#243056; color:var(--ink); border:1px solid var(--line); }
.shoot span { display:block; }
.shoot input { display:none; }
.shoot-row.dragging .shoot { outline:2px dashed var(--accent); }
#status { margin-top:8px; text-align:center; min-height:18px; }

/* ---------------------------------------------------------------- list */
.search { display:flex; gap:8px; align-items:center; padding:12px 16px; flex-wrap:wrap; }
.search input[type=search] { flex:1; min-width:160px; }
.search .inline { color:var(--muted); font-size:13px; display:flex; align-items:center; gap:6px; }
.list { padding:0 12px; }
table.cards { width:100%; border-collapse:collapse; }
th, td { text-align:left; padding:10px; border-bottom:1px solid var(--line); font-size:14px; }
th { color:var(--muted); font-weight:600; font-size:12px; text-transform:uppercase; letter-spacing:.04em; }
.badge { padding:3px 9px; border-radius:999px; font-size:12px; white-space:nowrap; }
.badge.good { background:var(--good); } .badge.bad { background:var(--bad); }
.empty { padding:24px 10px; }

/* ---------------------------------------------------------------- detail */
.detail { padding:12px 16px 24px; display:grid; gap:16px; }
.photo { width:100%; border-radius:12px; background:#000; }
.grid { display:grid; grid-template-columns:1fr 1fr; gap:10px 12px; }
.grid .wide { grid-column:1 / -1; }
label { display:flex; flex-direction:column; gap:6px; font-size:13px; color:var(--muted); }
input[type=checkbox] { accent-color:var(--accent); width:20px; height:20px; margin:0; }
.search label.inline { flex-direction:row; align-items:center; gap:8px; padding:6px 2px; }
input[type=text], input[type=password], input[type=number], input[type=search], select {
  width:100%; padding:12px; font-size:16px; border-radius:10px;
  border:1px solid #2c3553; background:#0f1428; color:var(--ink); }
.row { display:flex; gap:10px; margin-top:14px; flex-wrap:wrap; }
button { background:var(--accent); border:0; color:#06101f; font-weight:700; font-size:16px;
  padding:14px 18px; border-radius:12px; cursor:pointer; flex:1; min-height:48px; }
button.ghost, .ghost { background:transparent; color:var(--muted); border:1px solid var(--line);
  font-weight:600; padding:10px 14px; border-radius:10px; min-height:0; flex:0 0 auto; font-size:14px; }
button.danger { background:var(--bad); color:#fff; flex:0 0 auto; padding:14px 22px; }
.transcript-box { background:var(--card); border-radius:12px; padding:12px; }
.transcript-box summary { cursor:pointer; font-weight:600; }
.transcript { white-space:pre-wrap; font-size:13px; margin:10px 0 0; }

/* ---------------------------------------------------------------- phones */
@media (max-width:760px) {
  /* table -> cards */
  table.cards thead { display:none; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display:block; width:100%; }
  table.cards tr { background:var(--card); border:1px solid var(--line); border-radius:14px;
    margin-bottom:10px; padding:6px 12px; }
  table.cards td { display:flex; justify-content:space-between; gap:14px; align-items:baseline;
    border-bottom:1px dashed #1d2440; padding:9px 0; font-size:15px; }
  table.cards td:last-child { border-bottom:0; }
  table.cards td::before { content:attr(data-label); color:var(--muted); font-size:12px;
    text-transform:uppercase; letter-spacing:.04em; flex:0 0 auto; }
  table.cards td[data-label="Captured"] { font-weight:600; }
  table.cards td[data-label="Captured"]::before,
  table.cards td[data-label="State"]::before { content:""; }
  table.cards td.empty { display:block; text-align:center; }
  .truncate { max-width:60vw; text-align:right; }
  .grid { grid-template-columns:1fr; }
  .detail { padding:12px; }
  .list { padding:0 12px; }
}

.row-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.row-actions .ghost { font-size:13px; padding:8px 12px; }
button.small-btn { flex:0 0 auto; min-height:36px; padding:8px 14px; font-size:14px; }

/* transcription mode: the label text is the content */
.preview a { color:var(--ink); display:block; line-height:1.4; }
.preview { max-width:60ch; }
textarea { width:100%; padding:12px; font-size:16px; line-height:1.5; border-radius:10px;
  border:1px solid #2c3553; background:#0f1428; color:var(--ink);
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace; resize:vertical; }
