/* ReplyDue: phone-first, one column, then two on wide screens. No framework, no build step. */
:root {
  --bg: #f6f7f5; --card: #fff; --ink: #18211f; --muted: #5d6b67; --line: #e2e6e3;
  --brand: #0f766e; --brand-ink: #fff; --accent: #f59e0b;
  --red: #b42318; --red-bg: #fdecea; --amber: #a15c07; --amber-bg: #fff4e0; --green: #1a7f4b; --green-bg: #e6f4ec; --blue: #1f5fa8; --blue-bg: #e8f0fb; --grey-bg: #eef0ef;
  --radius: 14px; --gap: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1514; --card: #172120; --ink: #e8efed; --muted: #9db0ab; --line: #263533; --brand: #2bb3a4; --brand-ink: #062521;
    --red: #ff8a80; --red-bg: #3a1714; --amber: #ffc46b; --amber-bg: #33240b; --green: #7ed9a6; --green-bg: #12301f; --blue: #8fbdf5; --blue-bg: #13243a; --grey-bg: #1f2b29; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
main { padding: 12px 16px 40px; max-width: 1180px; margin: 0 auto; }
body.narrow main { max-width: 460px; }
h1 { font-size: 1.35rem; margin: 6px 0 10px; } h2 { font-size: 1.02rem; margin: 0 0 8px; display: flex; gap: 8px; align-items: center; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; color: var(--ink); display: flex; gap: 8px; align-items: center; font-size: 1.05rem; }
.who { color: var(--muted); font-size: .85rem; text-align: right; }
.tabs { display: flex; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 49px; z-index: 4; overflow-x: auto; }
.tabs a { flex: 1; text-align: center; padding: 11px 8px; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); text-decoration: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0 0 var(--gap); }
.card.auth { margin-top: 24px; }
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: var(--gap); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; color: var(--ink); display: flex; flex-direction: column; }
.stat .n { font-size: 1.9rem; font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span:last-child { color: var(--muted); font-size: .9rem; }
.stat.big { grid-column: 1 / -1; } .stat.alert { border-color: var(--red); } .stat.alert .n { color: var(--red); }
a.stat:hover { text-decoration: none; border-color: var(--brand); }
.count { background: var(--grey-bg); color: var(--muted); border-radius: 999px; padding: 0 9px; font-size: .82rem; font-weight: 600; }
.hint, .muted { color: var(--muted); font-size: .88rem; } .hint { margin: 0 0 8px; }
.empty { color: var(--muted); font-style: italic; margin: 6px 0; }
.caveat { color: var(--muted); font-size: .82rem; border-left: 3px solid var(--line); padding-left: 10px; }
.convs { list-style: none; margin: 0; padding: 0; }
.conv a { display: block; padding: 10px 2px; border-top: 1px solid var(--line); color: var(--ink); }
.conv:first-child a { border-top: 0; } .conv a:hover { text-decoration: none; background: var(--grey-bg); }
.row1 { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.reason { margin: 2px 0; } .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); font-size: .82rem; }
.tag { background: var(--grey-bg); border-radius: 6px; padding: 0 6px; color: var(--ink); }
.pill { display: inline-block; font-size: .74rem; font-weight: 650; border-radius: 999px; padding: 1px 8px; background: var(--grey-bg); color: var(--muted); white-space: nowrap; }
.s-waiting_on_us { background: var(--red-bg); color: var(--red); } .s-pending { background: var(--amber-bg); color: var(--amber); }
.s-waiting_on_them { background: var(--blue-bg); color: var(--blue); } .s-quiet, .s-closed { background: var(--grey-bg); color: var(--muted); }
.s-cold { background: var(--amber-bg); color: var(--amber); } .s-warn, .warn { background: var(--amber-bg); color: var(--amber); }
.banner { padding: 10px 16px; font-size: .92rem; border-bottom: 1px solid var(--line); }
.banner.bad { background: var(--red-bg); color: var(--red); } .banner.warn { background: var(--amber-bg); color: var(--amber); } .banner.info { background: var(--blue-bg); color: var(--blue); }
.bars { list-style: none; padding: 0; margin: 0; } .bars li { display: flex; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--line); } .bars li:first-child { border: 0; }
form { margin: 0; } label { display: block; margin: 8px 0; font-size: .92rem; }
input, select, textarea, button, .btn { font: inherit; font-size: 16px; }
input:not([type=checkbox]), select, textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); margin-top: 3px; }
button, .btn { padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; display: inline-block; }
button.primary, .btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 650; }
button:disabled { opacity: .55; cursor: not-allowed; } button.link { border: 0; background: none; color: var(--brand); padding: 0; font-size: .85rem; }
form.inline { display: inline; } label.inline { display: inline-flex; gap: 6px; align-items: center; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; align-items: end; }
.filters input[type=search] { grid-column: 1 / -1; } .filters label.d { margin: 0; font-size: .8rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.msgs { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 88%; } .msg.in { align-self: flex-start; } .msg.out { align-self: flex-end; text-align: right; }
.bubble { display: inline-block; text-align: left; padding: 8px 11px; border-radius: 14px; background: var(--grey-bg); white-space: pre-wrap; word-break: break-word; }
.msg.out .bubble { background: var(--green-bg); } .msg.ev .bubble { outline: 2px solid var(--accent); }
.mmeta { font-size: .74rem; color: var(--muted); margin-top: 2px; } .media { font-size: .85rem; color: var(--muted); }
.ai { background: var(--accent); color: #2b1a00; border-radius: 5px; font-size: .68rem; font-weight: 800; padding: 1px 5px; letter-spacing: .03em; }
.summary { font-size: 1.02rem; margin: 4px 0 8px; }
.fields { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; font-size: .9rem; } .fields dt { color: var(--muted); } .fields dd { margin: 0; }
.ov label { margin: 6px 0; } .notes, .hist, .chans { list-style: none; padding: 0; margin: 0 0 8px; } .notes li, .hist li, .chans li { border-top: 1px solid var(--line); padding: 6px 0; font-size: .9rem; } .notes p { margin: 0; white-space: pre-wrap; }
.hist code { font-size: .78rem; word-break: break-all; }
.board { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x mandatory; }
.col { flex: 0 0 82%; max-width: 320px; background: var(--grey-bg); border-radius: var(--radius); padding: 10px; scroll-snap-align: start; }
.bcard { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px; margin-top: 8px; font-size: .9rem; }
.bcard a { color: var(--ink); } .bcard p { margin: 4px 0 6px; color: var(--muted); }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; display: block; overflow-x: auto; } .tbl th, .tbl td { text-align: left; padding: 6px; border-top: 1px solid var(--line); vertical-align: middle; }
.inline-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; } .inline-form input, .inline-form select { width: auto; flex: 1 1 120px; margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 10px 0; } .day { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }
.day > span { width: 92px; } .day input[type=time] { width: auto; margin: 0; }
.toast { position: fixed; left: 16px; right: 16px; bottom: 16px; margin: 0 auto; max-width: 460px; padding: 12px 14px; border-radius: 12px; background: var(--ink); color: var(--bg); z-index: 50; }
.toast.err { background: var(--red); color: #fff; } .ok { color: var(--green); } .lead { font-size: 1.1rem; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 20px; }
@media (min-width: 760px) {
  .hero { grid-template-columns: repeat(4, 1fr); } .stat.big { grid-column: auto; }
  .filters { grid-template-columns: 2fr repeat(4, 1fr); } .filters input[type=search] { grid-column: auto; }
  .split { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--gap); align-items: start; }
  .col { flex-basis: 260px; } .tabs { justify-content: center; } .tabs a { flex: 0 0 140px; }
  .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; } .grid fieldset, .grid button, .grid label:last-of-type { grid-column: 1 / -1; }
}
