/* Chat review console (STR-45). One stylesheet for every page; tokens first, light and dark. */
:root {
  --bg: #f4f5f7; --panel: #ffffff; --ink: #1b1f24; --muted: #5b6470; --line: #dfe3e8;
  --accent: #2a5fc4; --ok: #1e7a3c; --warn: #9a5800; --bad: #b3261e;
  --st: #ffffff; --op: #eaf1fc; --chip: #eef0f3;
  --radius: 12px; --gutter: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121417; --panel: #1b1e23; --ink: #e8eaed; --muted: #9aa3ad; --line: #2e333a;
    --accent: #8ab0ff; --ok: #7bd88f; --warn: #f0b35a; --bad: #ff8a80;
    --st: #22262c; --op: #1d2633; --chip: #262a31;
  }
}
:root[data-theme="dark"] {
  --bg: #121417; --panel: #1b1e23; --ink: #e8eaed; --muted: #9aa3ad; --line: #2e333a;
  --accent: #8ab0ff; --ok: #7bd88f; --warn: #f0b35a; --bad: #ff8a80;
  --st: #22262c; --op: #1d2633; --chip: #262a31;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* header bar: product, tabs, who */
.bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px;
  background: var(--panel); border-bottom: 1px solid var(--line); padding: 10px var(--gutter);
}
.brand { font-weight: 700; color: var(--ink); }
.tabs { display: flex; gap: 16px; font-size: 14px; }
.tabs a { color: var(--muted); padding: 4px 0; border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--ink); font-weight: 650; border-bottom-color: var(--accent); }
.who-am-i { margin-left: auto; font-size: 13px; color: var(--muted); }

main { max-width: 1120px; margin: 0 auto; padding: 18px var(--gutter) 40px; }
main.narrow { max-width: 520px; padding-top: 48px; }

/* answer first */
.verdict { font-size: 22px; font-weight: 650; line-height: 1.25; margin: 0 0 4px; }
.verdict.tone-ok { color: var(--ok); }
.verdict.tone-warn { color: var(--warn); }
.verdict.tone-bad { color: var(--bad); }
.facts { color: var(--muted); margin: 0 0 14px; }

/* segmented switch: GEO filter, English / Original / Both */
.switch { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; font-size: 14px; }
.switch a, .switch span {
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; background: var(--panel);
}
.switch span.on { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 600; }

/* rows: a table when wide */
table.rows { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; font-size: 14px; }
table.rows th, table.rows td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); }
table.rows th { color: var(--muted); font-weight: 600; font-size: 13px; }
table.rows tr:last-child td { border-bottom: 0; }
table.rows .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.tone-warn { color: var(--warn); font-weight: 600; }
td.tone-bad { color: var(--bad); font-weight: 600; }
a.aside { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 6px; }
a.aside:hover { color: var(--accent); }
.totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
.totals div {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px;
}
.totals span { display: block; font-size: 12px; color: var(--muted); }
.totals b { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.more { color: var(--muted); margin: 8px 0 0; }
.card-only { display: none; }

/* rows: cards when narrow (same markup) */
@media (max-width: 767px) {
  table.rows, table.rows tbody { display: block; background: none; border: 0; }
  table.rows thead { display: none; }
  table.rows tr {
    display: flex; flex-wrap: wrap; align-items: baseline; background: var(--panel);
    border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 0 0 8px;
  }
  table.rows td { padding: 0; border: 0; }
  table.rows tr::before { content: ""; order: 1; flex-basis: 100%; height: 2px; } /* line break: top / meta */
  table.rows td.c-title { order: 0; flex: 1 1 auto; font-weight: 650; }
  table.rows td.c-badge { order: 0; flex: 0 0 auto; font-weight: 650; }
  table.rows td.c-meta { order: 2; color: var(--muted); font-size: 13px; }
  /* a dot only between two filled meta cells: an empty last cell never leaves a trailing dot (screen O8) */
  table.rows td.c-meta:not(.empty) ~ td.c-meta:not(.empty)::before { content: "\00a0·\00a0"; }
  .card-only { display: inline; }
  .totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .verdict { font-size: 19px; }
}

/* states in words */
.state { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.state b { display: block; font-size: 17px; margin: 0 0 4px; }
.state-detail { color: var(--muted); }
.state-data-delayed b { color: var(--warn); }

/* chat reader */
.chat { display: flex; flex-direction: column; gap: 8px; max-width: 720px; }
.msg { border-radius: var(--radius); padding: 8px 12px; border: 1px solid var(--line); max-width: 85%; }
.msg-st { background: var(--st); align-self: flex-start; }
.msg-op { background: var(--op); align-self: flex-end; }
.msg .who { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.msg .orig { font-size: 13px; color: var(--muted); border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 4px; }
.msg .gone, .msg .media { color: var(--muted); font-style: italic; }
.fold { align-self: stretch; font-size: 13px; color: var(--muted); background: var(--chip); border-radius: 8px;
  padding: 6px 10px; }
.fold summary { cursor: pointer; }
.fold ol { margin: 6px 0 2px; padding-left: 20px; }
.tap { align-self: flex-start; font-size: 13px; color: var(--muted); background: var(--chip); border-radius: 999px;
  padding: 2px 10px; }
.stage-div { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 600;
  letter-spacing: .02em; margin: 6px 0; }
.stage-div::before, .stage-div::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.wait-mark { align-self: flex-start; color: var(--bad); font-weight: 650; font-size: 14px; }

/* technical details: collapsed, last */
details.tech { margin-top: 28px; font-size: 13px; color: var(--muted); }
details.tech summary { cursor: pointer; }
details.tech dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 14px; margin: 8px 0 0; }
details.tech dt { font-weight: 600; }
details.tech dd { margin: 0; font-family: ui-monospace, Menlo, monospace; overflow-wrap: anywhere; }

/* sign-in */
.signin { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.btn { display: inline-block; background: var(--accent); color: #fff; border-radius: 8px; padding: 8px 16px;
  font-weight: 600; }
:root[data-theme="dark"] .btn { color: #0d1117; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn { color: #0d1117; } }
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.open-ext { margin: -6px 0 14px; font-size: 14px; }
.signout { display: inline; margin: 0 0 0 6px; }
.signout button { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
.signout button:hover { text-decoration: underline; }
.totals-line { font-weight: 600; margin: 0 0 14px; font-variant-numeric: tabular-nums; }
.state + .state { margin-top: 8px; }

/* STR-45 track C fix round (review + screen check of PR #214) */
.button, .review button { display: inline-block; font: inherit; font-size: 14px; font-weight: 600; padding: 8px 14px;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); color: inherit;
  text-decoration: none; cursor: pointer; }
.button:hover, .review button:hover { border-color: var(--accent); color: var(--accent); }
.review button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
p.reply { margin: -4px 0 14px; }
p.reply .button { background: var(--accent); border-color: var(--accent); color: #fff; }
.quiet { color: var(--muted); font-size: 14px; margin: 6px 0 10px; }
.compare { font-weight: 600; margin: 4px 0 12px; }
.filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; }
.filter-label { color: var(--muted); font-size: 13px; min-width: 84px; }
.filter .switch { margin: 0; }
.tag { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 6px; }
ul.plain { list-style: none; padding: 0; margin: 0 0 12px; }
ul.plain li { padding: 2px 0; }
section.geo { margin: 18px 0 26px; }
.review { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  margin: 18px 0; }
.review h2 { font-size: 16px; margin: 0 0 10px; }
.review .field { display: block; margin: 0 0 10px; }
.review .field span { display: block; font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.review textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--bg, #fff); color: inherit; }
.review-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.review .saved { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.wait-mark.tone-warn { color: var(--warn); }
.wait-mark.tone-bad { color: var(--bad); }
@media (max-width: 767px) { td.empty { display: none; } .filter-label { min-width: 0; width: 100%; } }
