/* SBM phone app. The control room's ledger, cut down to one hand: a sentence says where things stand, rules and
   space do the rest. No cards, icons, badges or shadows. Navy and Aegean on Porcelain; red only for a problem. */

@font-face { font-family: "Instrument Serif"; src: url("/fonts/instrument-serif.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/fonts/instrument-sans.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --navy: #071c3f; --aegean: #0b3d91; --gold-ink: #87661f; --sky: #dcebff; --porcelain: #f4f7fb;
  --ink: #0e1a2b; --ink-soft: #2a3446; --muted: #5b6577; --faint: #8d95a3; --rule: #cfd7e3; --rule-soft: #e2e8f0;
  --alarm: #a3271f; --ok: #1d5a3a;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Instrument Sans", var(--sans);
  --pad: 22px;
  --tabs: calc(58px + env(safe-area-inset-bottom));
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--porcelain); color: var(--ink); }
body { font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3 { margin: 0; font-weight: inherit; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

main { max-width: 640px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) var(--pad) calc(var(--tabs) + 32px); }

/* ---------- top line ---------- */
.top { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 12px; border-bottom: 1px solid var(--ink); }
.wordmark { font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: -0.02em; }
.wordmark i { font-family: var(--serif); font-weight: 400; font-size: 20px; color: var(--aegean); margin-left: 3px; }
.top .meta { font-size: 12.5px; color: var(--muted); }

.statement { font-family: var(--serif); color: var(--navy); font-size: 34px; line-height: 1.06; letter-spacing: -0.01em; margin-top: 26px;
  text-wrap: balance; }
.statement .alarm { color: var(--alarm); }
.standfirst { margin-top: 14px; font-size: 15.5px; color: var(--ink-soft); line-height: 1.55; }
.standfirst b { font-weight: 600; color: var(--ink); }

/* ---------- sections ---------- */
.section { margin-top: 40px; }
.sh { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 9px; border-bottom: 1px solid var(--ink); }
.sh h2 { font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: -0.015em; }
.sh h2 .n { font-weight: 400; color: var(--muted); margin-left: 8px; }
.sh .aside { font-size: 12.5px; color: var(--muted); }
.empty { padding: 20px 0; color: var(--muted); font-size: 15px; border-bottom: 1px solid var(--rule-soft); }

/* rows: a label column and the words */
.row { display: grid; grid-template-columns: 74px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--rule-soft); }
.row .lead { font-size: 12.5px; color: var(--muted); padding-top: 2px; }
.row .lead.alarm { color: var(--alarm); }
.name { font-family: var(--display); font-weight: 500; font-size: 16.5px; letter-spacing: -0.01em; color: var(--ink); }
.sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.alarm { color: var(--alarm); }
.muted { color: var(--muted); }

/* figures in a line, each under its label */
.figs { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 8px; }
.figs div { font-variant-numeric: tabular-nums; }
.figs span { display: block; font-size: 11.5px; color: var(--muted); }
.faint { color: var(--faint); }

/* the research quota: one rule per line, filled to today's count */
.meter { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--rule-soft); font-size: 14.5px; }
.meter .val { font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.meter .bar { grid-column: 1 / -1; height: 2px; background: var(--rule); position: relative; }
.meter .bar i { position: absolute; inset: 0 auto 0 0; background: var(--navy); }

/* ---------- the send list ---------- */
.filters { display: flex; gap: 18px; overflow-x: auto; margin: 18px calc(-1 * var(--pad)) 0; padding: 0 var(--pad); scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters a { white-space: nowrap; font-size: 14.5px; color: var(--muted); padding: 6px 0 8px; border-bottom: 1px solid transparent; }
.filters a.on { color: var(--ink); border-bottom-color: var(--ink); }
.filters sup { font-size: 10.5px; color: var(--aegean); font-weight: 600; margin-left: 2px; }

.item { padding: 20px 0 22px; border-bottom: 1px solid var(--rule); }
.item .kind { font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; }
.item .name { margin-top: 4px; }
.item .part { margin-top: 14px; }
.item .part h4 { margin: 0 0 4px; font-size: 11.5px; font-weight: 500; color: var(--muted); letter-spacing: 0.01em; }
.item .text { white-space: pre-wrap; font-size: 15.5px; line-height: 1.55; color: var(--ink); }
.item .text.subject { font-weight: 600; }
.item .count { font-size: 12px; color: var(--faint); margin-top: 4px; }
.item .count.over { color: var(--alarm); }
.item .blockers { margin-top: 12px; font-size: 13.5px; color: var(--alarm); }
.item .blockers li { margin: 2px 0; }
.item .blockers ul { margin: 0; padding-left: 18px; }
.item textarea { width: 100%; min-height: 160px; border: 0; border-bottom: 1px solid var(--rule); background: transparent; padding: 6px 0;
  font-size: 15.5px; line-height: 1.55; resize: vertical; border-radius: 0; }
.item input.subject { width: 100%; border: 0; border-bottom: 1px solid var(--rule); background: transparent; padding: 6px 0; font-weight: 600; border-radius: 0; }
.item textarea:focus, .item input:focus { outline: none; border-bottom-color: var(--navy); }

.acts { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-top: 16px; }
.btn { display: inline-block; background: var(--navy); color: #fff; border: 0; border-radius: 0; padding: 12px 18px; font-size: 15px;
  font-weight: 500; cursor: pointer; }
.btn.line { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.btn:disabled { opacity: 0.4; }
.link { background: none; border: 0; padding: 8px 0; color: var(--aegean); font-size: 15px; text-decoration: underline;
  text-underline-offset: 3px; text-decoration-color: rgba(11, 61, 145, 0.3); cursor: pointer; }
.link.quiet { color: var(--muted); text-decoration-color: rgba(91, 101, 119, 0.3); }
.link.alarm { color: var(--alarm); }
.done-note { margin-top: 14px; font-size: 14px; color: var(--ok); }

.reply .text { margin-top: 8px; font-size: 15px; }
.reply .summary { margin-top: 6px; font-size: 14px; color: var(--ink-soft); }
details { margin-top: 10px; }
details summary { color: var(--aegean); font-size: 14.5px; cursor: pointer; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details .text { margin-top: 8px; font-size: 14.5px; }

/* ---------- bottom tabs ---------- */
#tabs { position: fixed; left: 0; right: 0; bottom: 0; height: var(--tabs); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(3, 1fr); background: var(--porcelain); border-top: 1px solid var(--ink); z-index: 10; }
#tabs a { display: flex; align-items: center; justify-content: center; font-size: 15px; color: var(--muted); }
#tabs a.on { color: var(--ink); font-weight: 600; }
#tabs sup { font-size: 10.5px; color: var(--aegean); font-weight: 600; margin-left: 3px; }

#toast { position: fixed; left: var(--pad); right: var(--pad); bottom: calc(var(--tabs) + 14px); background: var(--navy); color: #fff;
  padding: 12px 16px; font-size: 14.5px; z-index: 20; max-width: 600px; margin: 0 auto; }
#toast.alarm { background: var(--alarm); }

/* ---------- sign in ---------- */
.signin { min-height: calc(100vh - 80px); display: flex; flex-direction: column; justify-content: center; }
.signin form { margin-top: 30px; display: grid; gap: 16px; }
.signin label { font-size: 12.5px; color: var(--muted); }
.signin input { width: 100%; border: 0; border-bottom: 1px solid var(--rule); background: transparent; padding: 8px 0; font-size: 18px; border-radius: 0; }
.signin input:focus { outline: none; border-bottom-color: var(--navy); }
.signin input.code { letter-spacing: 0.3em; font-variant-numeric: tabular-nums; }
.signin .note { font-size: 13.5px; color: var(--muted); }
.foot { margin-top: 48px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; }
