/* A watch-officer's console, not a dashboard product. Ground is cold slate;
   the only warm colour in the build is reserved for "this one wants you". */
:root {
  --ink:#0d1117; --panel:#151b24; --line:#232c38;
  --text:#c9d4e0; --dim:#6b7a8d;
  --signal:#e8a33d;      /* wants you */
  --damp:#3f7a72;        /* suppressor */
  --hot:#2a1d10;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --sans: "Inter Tight", "Helvetica Neue", system-ui, sans-serif;
}
* { box-sizing:border-box; }
body {
  margin:0; background:var(--ink); color:var(--text);
  font-family:var(--sans); font-size:14px; line-height:1.5;
}
.bar {
  display:flex; align-items:center; gap:24px; flex-wrap:wrap;
  padding:12px 20px; border-bottom:1px solid var(--line); background:var(--panel);
  position:sticky; top:0; z-index:5;
}
.mark { font-family:var(--mono); font-size:12px; letter-spacing:.16em; color:var(--signal); }
.bar nav { display:flex; gap:18px; }
.bar a { color:var(--dim); text-decoration:none; font-size:13px; }
.bar a:hover, .bar a:focus-visible { color:var(--text); }
.shadow-tag {
  margin-left:auto; font-family:var(--mono); font-size:11px; color:var(--dim);
  border:1px solid var(--line); padding:3px 8px; border-radius:2px;
}
main { max-width:920px; margin:0 auto; padding:28px 20px 80px; }
h1 { font-size:22px; font-weight:600; letter-spacing:-.01em; margin:0 0 6px; }
h2 { font-size:15px; font-weight:600; margin:32px 0 10px; color:var(--dim); }
.lede { color:var(--dim); max-width:62ch; margin:0 0 24px; }
.muted { color:var(--dim); }

/* --- thread cards ---------------------------------------------------- */
/* Cards are separated by space and a left status rail rather than by borders
   alone — at a glance you should be able to count the threads without reading
   them. Bar segments size their FILL by contribution, not their box, so short
   labels never get clipped. */
.thread {
  border:1px solid var(--line); border-radius:4px;
  background:var(--panel); margin-bottom:18px; overflow:hidden;
  border-left:3px solid var(--line);
}
.thread.hot { border-left-color:var(--signal); background:var(--hot); }

.head {
  display:flex; align-items:center; gap:14px;
  padding:12px 16px 11px; border-bottom:1px solid var(--line);
}
.score {
  font-family:var(--mono); font-size:24px; line-height:1; color:var(--signal);
  min-width:52px; font-variant-numeric:tabular-nums;
}
.thread:not(.hot) .score { color:var(--dim); }
.who-col { display:flex; flex-direction:column; gap:3px; min-width:0; }
.label { font-weight:600; font-size:15px; letter-spacing:-.01em; }
.meta { font-family:var(--mono); font-size:10.5px; color:var(--dim); }

.bars {
  display:flex; align-items:center; flex-wrap:wrap; gap:5px;
  padding:11px 16px; background:rgba(0,0,0,.18);
}
.seg {
  position:relative; display:inline-flex; align-items:center; gap:6px;
  padding:3px 8px; border-radius:3px; overflow:hidden;
  font-family:var(--mono); font-size:10.5px; white-space:nowrap;
}
.seg i {                       /* proportional fill, sits behind the label */
  position:absolute; left:0; top:0; bottom:0; display:block;
}
.seg.pos { box-shadow:inset 0 0 0 1px rgba(232,163,61,.4); }
.seg.pos i { background:rgba(232,163,61,.2); }
.seg.neg { box-shadow:inset 0 0 0 1px rgba(63,122,114,.5); }
.seg.neg i { background:rgba(63,122,114,.24); }
.seg em, .seg b { position:relative; font-style:normal; }
.seg em { color:var(--text); opacity:.9; }
.seg b { font-weight:600; color:var(--dim); font-variant-numeric:tabular-nums; }
.seg.neg b { color:var(--damp); }
.mult { font-family:var(--mono); font-size:10px; color:var(--dim); margin-left:auto; }

.msgs { list-style:none; margin:0; padding:4px 16px 10px; }
.msgs li {
  display:grid; grid-template-columns:78px 1fr auto; gap:12px;
  padding:6px 0; font-size:13px; align-items:baseline;
}
.msgs li + li { border-top:1px solid rgba(255,255,255,.045); }
.msgs .who {
  font-family:var(--mono); font-size:11px; color:var(--dim);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.msgs li.mine .who { color:var(--damp); }
.msgs .txt { min-width:0; overflow-wrap:anywhere; }
.msgs li.gist .txt, .msgs li.gone .txt, .msgs li.pending .txt {
  color:var(--dim); font-style:italic;
}
.flag {
  font-family:var(--mono); font-size:9px; letter-spacing:.08em;
  text-transform:uppercase; color:var(--dim); align-self:center;
  border:1px solid var(--line); padding:1px 5px; border-radius:2px;
}

/* Screenshot redaction. Purely visual — the text is still in the DOM, so this
   is for sharing a screenshot, not for hiding data from anyone with access. */
.tools { margin:-12px 0 22px; }
body.redact .msgs .txt { filter:blur(5px); user-select:none; }
body.redact .msgs .who { filter:blur(4px); }
body.redact .label { filter:blur(5px); }

/* --- tables and stats ----------------------------------------------- */
.grid { width:100%; border-collapse:collapse; }
.grid th {
  text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.08em;
  color:var(--dim); font-weight:500; padding:7px 10px; border-bottom:1px solid var(--line);
}
.grid td { padding:7px 10px; border-bottom:1px solid rgba(255,255,255,.04); }
.grid .n { text-align:right; }
.mono { font-family:var(--mono); font-size:12px; }
.inline { display:flex; gap:6px; justify-content:flex-end; }
input[type=number] {
  width:64px; background:var(--ink); border:1px solid var(--line);
  color:var(--text); padding:3px 6px; border-radius:2px; font-family:var(--mono);
}
button {
  background:transparent; border:1px solid var(--line); color:var(--dim);
  padding:3px 10px; border-radius:2px; cursor:pointer; font-size:12px;
}
button:hover { color:var(--signal); border-color:var(--signal); }
.stats { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:8px; }
.stats div {
  border:1px solid var(--line); background:var(--panel); border-radius:3px;
  padding:10px 16px; min-width:96px;
}
.stats b { display:block; font-family:var(--mono); font-size:20px; color:var(--text); }
.stats span { font-size:11px; color:var(--dim); }
.stats .cur b { color:var(--signal); }
.empty { border:1px dashed var(--line); border-radius:3px; padding:28px; text-align:center; }

:focus-visible { outline:2px solid var(--signal); outline-offset:2px; }
@media (prefers-reduced-motion:reduce) { * { transition:none !important; } }
@media (max-width:620px) {
  .age { margin-left:0; }
  .msgs li { flex-wrap:wrap; }
}

/* Gists sit hidden under each message. Auditing them against the real text is
   only possible before the body expires — after that the gist is all there is. */
.gist-txt { display:none; }
body.show-gists .msgs li { grid-template-columns:78px 1fr 1fr auto; }
body.show-gists .gist-txt {
  display:block; font-family:var(--mono); font-size:11px;
  color:var(--damp); min-width:0; overflow-wrap:anywhere;
}
body.show-gists .gist-txt.pend { color:var(--dim); font-style:italic; }
body.redact .gist-txt { filter:blur(5px); }
.tools button + button { margin-left:6px; }
@media (max-width:620px) {
  body.show-gists .msgs li { grid-template-columns:78px 1fr auto; }
}

select {
  background:var(--ink); border:1px solid var(--line); color:var(--text);
  padding:3px 6px; border-radius:2px; font-family:var(--mono); font-size:11px;
}
.mute { font-size:11px; color:var(--dim); display:flex; align-items:center; gap:4px; }

.addrow { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
.addrow input {
  background:var(--ink); border:1px solid var(--line); color:var(--text);
  padding:6px 9px; border-radius:2px; font-size:13px; min-width:170px; flex:1;
}
.stats .bad b { color:#e0685a; }
.alert {
  border:1px solid rgba(224,104,90,.4); background:rgba(224,104,90,.08);
  color:var(--text); padding:9px 12px; border-radius:3px; font-size:13px;
}

.notice {
  border:1px solid rgba(63,122,114,.45); background:rgba(63,122,114,.1);
  padding:9px 12px; border-radius:3px; font-size:13px;
}

.namefield { width:110px; font-family:var(--sans); font-size:12px;
  background:var(--ink); border:1px solid var(--line); color:var(--text);
  padding:3px 6px; border-radius:2px; }
.selftag { font-family:var(--mono); font-size:9px; text-transform:uppercase;
  letter-spacing:.08em; color:var(--damp); border:1px solid var(--line);
  padding:1px 4px; border-radius:2px; }
.inline { flex-wrap:wrap; align-items:center; }

.script {
  border:1px solid var(--line); border-left:3px solid var(--signal);
  background:var(--panel); border-radius:3px; padding:20px 24px;
  font-size:16px; line-height:1.75; margin:16px 0 8px; max-width:64ch;
  white-space:pre-wrap;
}

tr.off td { opacity:.45; }
.grid td form.inline button { padding:2px 8px; font-size:11px; }

.loginpage { display:flex; align-items:center; justify-content:center;
  min-height:100vh; }
.loginbox { text-align:center; padding:36px 40px; border:1px solid var(--line);
  background:var(--panel); border-radius:4px; min-width:300px; }
.loginbox .mark { display:block; margin-bottom:22px; font-size:13px; }
.loginbox form { display:flex; gap:8px; }
.loginbox input { flex:1; background:var(--ink); border:1px solid var(--line);
  color:var(--text); padding:8px 11px; border-radius:2px; font-size:14px; }
.loginbox .alert { margin-bottom:16px; font-size:12px; }

.htmx-indicator { display:none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display:block; }

.askfield { width:100%; background:var(--ink); border:1px solid var(--line);
  color:var(--text); padding:7px 10px; border-radius:2px; font-size:13px; }
.sched-row { display:flex; gap:14px; align-items:center; flex-wrap:wrap;
  margin:0; font-size:12px; color:var(--dim); }
.sched-row label { display:flex; align-items:center; gap:5px; }
.sched-row input[type=number] { width:52px; }
