/* Fixer tablet: phosphor green on black, monospace, scanlines. One screen.
   Tuned for a projector: 14px base, secondary green kept above ~6:1 contrast on the panel. */

:root {
  --bg: #030603;
  --panel: #050b06;
  --panel-2: #081409;
  --fg: #39ff6a;
  --fg-bright: #c9ffd8;
  --dim: #35b65c;      /* secondary text */
  --dimmer: #1a7334;   /* tertiary text, placeholders */
  --line: #134f24;
  --red: #ff5a5a;
  --amber: #ffb84d;
  --cyan: #5ad1ff;
  --glow: 0 0 6px rgba(57, 255, 106, 0.45);
  --font: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --top: 64px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  overflow: hidden;
}

/* scanlines + vignette, kept light so text stays readable on a projector */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.11) 0px, rgba(0, 0, 0, 0.11) 1px, transparent 1px, transparent 3px),
    radial-gradient(ellipse at center, transparent 65%, rgba(0, 0, 0, 0.45) 100%);
}
body::after {
  content: "";
  position: fixed; left: 0; right: 0; height: 60px; z-index: 51; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(57, 255, 106, 0.035), transparent);
  animation: sweep 9s linear infinite;
}
@keyframes sweep { from { top: -80px; } to { top: 100%; } }

h2 {
  margin: 0; padding: 9px 12px;
  font-size: 13px; letter-spacing: 0.18em; font-weight: 600;
  color: var(--fg); text-shadow: var(--glow);
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
h3 {
  margin: 16px 0 6px; font-size: 11px; letter-spacing: 0.18em; font-weight: 600;
  color: var(--dim);
}
h3:first-child { margin-top: 2px; }

.label { font-size: 11px; letter-spacing: 0.16em; color: var(--dim); }
.count { color: var(--dim); font-weight: normal; }
.dim { color: var(--dim); }
.dimmer { color: var(--dimmer); }
.bright { color: var(--fg-bright); }
.red { color: var(--red); }
.amber { color: var(--amber); }
.cyan { color: var(--cyan); }
.empty { padding: 28px 18px; color: var(--dim); text-align: center; line-height: 1.6; }
.empty b { display: block; color: var(--fg); letter-spacing: 0.14em; font-size: 12px; margin-bottom: 4px; }
.small { font-size: 12px; }

a { color: var(--fg); }

button {
  background: transparent; color: var(--fg);
  border: 1px solid var(--dim);
  padding: 6px 11px;
  font: inherit; font-size: 12px; letter-spacing: 0.1em;
  cursor: pointer;
}
button:hover:not(:disabled) { background: var(--dimmer); border-color: var(--fg); text-shadow: var(--glow); }
button:disabled { opacity: 0.4; cursor: default; }
button.primary { border-color: var(--fg); color: var(--fg-bright); background: rgba(57, 255, 106, 0.08); }
button.danger { border-color: #8a2e2e; color: var(--red); }
button.danger:hover:not(:disabled) { background: rgba(255, 77, 77, 0.12); border-color: var(--red); }
button.link { border: none; padding: 0; text-decoration: underline; letter-spacing: 0; font-size: 12px; }

input, select, textarea {
  background: var(--panel-2); color: var(--fg-bright);
  border: 1px solid var(--line);
  padding: 6px 9px;
  font: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--fg); box-shadow: var(--glow); }
input[type=number] { width: 120px; }
input::placeholder { color: var(--dimmer); }
select {
  cursor: pointer; appearance: none; -webkit-appearance: none; padding-right: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2335b65c'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
select option { background: var(--panel-2); color: var(--fg); }

/* keyboard focus: visible, green, never the browser's blue ring */
:focus-visible { outline: 1px solid var(--fg-bright); outline-offset: 2px; box-shadow: var(--glow); }

.scroll { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--dimmer) transparent; }
.scroll::-webkit-scrollbar { width: 6px; }
.scroll::-webkit-scrollbar-thumb { background: var(--dimmer); }

.bar { height: 7px; background: var(--panel-2); border: 1px solid var(--line); margin-top: 4px; position: relative; }
.bar .fill { height: 100%; background: var(--fg); box-shadow: var(--glow); transition: width 0.4s; min-width: 2px; }

.badge {
  display: inline-block; padding: 0 5px; font-size: 11px; letter-spacing: 0.12em;
  border: 1px solid var(--dim); color: var(--dim); vertical-align: 1px; white-space: nowrap;
}
.badge.ok { border-color: var(--fg); color: var(--fg); }
.badge.bad { border-color: var(--red); color: var(--red); }
.badge.warn { border-color: var(--amber); color: var(--amber); }
.badge.cyan { border-color: var(--cyan); color: var(--cyan); }
.badge.fill { background: var(--fg); color: var(--bg); border-color: var(--fg); font-weight: 700; }
.badge.fill.warn { background: var(--amber); border-color: var(--amber); }

/* provenance glyph: a small cyan diamond, meaningless in-fiction */
.prov { color: var(--cyan); font-size: 9px; vertical-align: 2px; margin-left: 3px; cursor: help; opacity: 0.85; }

details { margin-top: 4px; }
summary { cursor: pointer; color: var(--dim); font-size: 12px; letter-spacing: 0.08em; }
summary:hover { color: var(--fg); }
details[open] > summary { color: var(--fg); }

/* ---------- top bar ---------- */

#topbar {
  height: var(--top);
  display: grid;
  grid-template-columns: 150px minmax(260px, 400px) minmax(150px, 200px) 1fr 28px;
  gap: 16px; align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.tb-block { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tb-block .big { font-size: 16px; color: var(--fg-bright); text-shadow: var(--glow); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-clinic .big { display: flex; align-items: baseline; gap: 8px; }
.tb-clinic .hours { font-size: 22px; font-weight: 700; letter-spacing: 0.02em; }
.tb-clinic .status { font-size: 12px; letter-spacing: 0.16em; color: var(--fg); }
.tb-clinic.worse .hours, .tb-clinic.worse .status { color: var(--amber); text-shadow: 0 0 6px rgba(255, 184, 77, 0.5); }
.tb-clinic.critical .hours, .tb-clinic.critical .status { color: var(--red); text-shadow: 0 0 6px rgba(255, 90, 90, 0.5); animation: blink 1.2s steps(2) infinite; }
.track { display: flex; gap: 2px; margin-top: 3px; height: 7px; }
.track i { flex: 1; background: var(--panel-2); border: 1px solid var(--line); }
.track i.on { background: var(--fg); border-color: var(--fg); box-shadow: var(--glow); }
.tb-clinic.worse .track i.on { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 5px rgba(255, 184, 77, 0.5); }
.tb-clinic.critical .track i.on { background: var(--red); border-color: var(--red); box-shadow: 0 0 5px rgba(255, 90, 90, 0.5); }
.tb-cash .big .of { font-size: 12px; color: var(--dim); text-shadow: none; margin-left: 6px; }
.tb-director .big.live { color: var(--fg-bright); }
.tb-director .big.stub { color: var(--amber); }
.tb-director .big small { font-size: 11px; letter-spacing: .12em; margin-left: 8px; opacity: .8; vertical-align: middle; }
.tb-buttons { flex-direction: row; align-items: center; gap: 10px; justify-content: flex-end; white-space: nowrap; justify-self: end; }
.tb-buttons button { white-space: nowrap; line-height: 1; }
#btn-new { border-color: var(--line); color: var(--dim); padding: 9px 12px; font-size: 11px; }
#btn-new:hover:not(:disabled) { color: var(--fg); border-color: var(--dim); }
#btn-end { border-color: var(--fg); color: var(--fg-bright); background: rgba(57, 255, 106, 0.08); padding: 11px 20px; font-size: 13px; letter-spacing: 0.16em; box-shadow: inset 0 0 0 1px rgba(57, 255, 106, 0.15); }
#btn-end:hover:not(:disabled) { background: rgba(57, 255, 106, 0.16); }
#btn-end.busy { animation: blink 1s steps(2) infinite; }
#btn-end.ready { animation: end-ready 1.4s ease-in-out infinite; }
@keyframes end-ready {
  0%, 100% { background: rgba(57, 255, 106, 0.08); box-shadow: inset 0 0 0 1px rgba(57, 255, 106, 0.15); }
  50% { background: rgba(57, 255, 106, 0.28); box-shadow: 0 0 16px rgba(57, 255, 106, 0.55), inset 0 0 0 1px rgba(57, 255, 106, 0.6); color: #fff; }
}
#btn-presenter { border: 1px solid transparent; color: var(--dimmer); padding: 4px 6px; font-size: 13px; line-height: 1; justify-self: end; }
#btn-presenter:hover { color: var(--cyan); border-color: var(--cyan); background: none; }

@keyframes blink { 50% { opacity: 0.35; } }

/* ---------- layout ---------- */

body { display: flex; flex-direction: column; }
#topbar, #note { flex: none; }
#tablet {
  flex: 1; min-height: 0;          /* takes whatever the top bar and the note bar leave */
  display: grid;
  grid-template-columns: 320px 1fr 400px;
}
.col { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--panel); }
.col:last-child { border-right: none; }
.col > .scroll { flex: 1; min-height: 0; }

body.busy #tablet { opacity: 0.55; pointer-events: none; }

/* waiting on the street: shown while a slow Director call is out */
#waiting {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 66;
  min-width: 380px; padding: 20px 30px; text-align: center;
  border: 1px solid var(--fg); background: var(--panel);
  box-shadow: 0 0 40px rgba(57, 255, 106, 0.22), inset 0 0 30px rgba(57, 255, 106, 0.04);
}
#waiting[hidden] { display: none; }
#waiting .t { font-size: 16px; letter-spacing: 0.22em; color: var(--fg-bright); text-shadow: var(--glow); }
#waiting .sub { margin-top: 6px; color: var(--dim); font-size: 12px; letter-spacing: 0.08em; }
#waiting .sub b { color: var(--fg); font-weight: 600; }
#waiting .scan { height: 3px; margin-top: 14px; background: linear-gradient(90deg, transparent 0%, var(--fg) 50%, transparent 100%); background-size: 45% 100%; background-repeat: no-repeat; animation: scan 1.1s ease-in-out infinite alternate; }
@keyframes scan { from { background-position: -20% 0; } to { background-position: 120% 0; } }

/* ---------- inbox ---------- */

.msg {
  padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer;
  border-left: 3px solid transparent;
}
.msg:hover { background: var(--panel-2); }
.msg:focus-visible { outline: none; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--fg); }
.msg.sel { background: var(--panel-2); border-left-color: var(--fg); }
.msg.unread.text { border-left-color: var(--dim); }
.msg.unread.meeting { border-left-color: var(--amber); }
.msg.unread .from { color: var(--fg-bright); text-shadow: var(--glow); }
.msg .top { display: flex; gap: 8px; align-items: baseline; }
.msg .from { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg .when { color: var(--dim); font-size: 11px; }
.msg .preview {
  color: var(--dim); margin-top: 3px; font-size: 13px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.msg.unread .preview { color: var(--fg); }
.msg .flags { margin-top: 5px; display: flex; gap: 4px; flex-wrap: wrap; }
.msg .chan { width: 42px; text-align: center; }
.msg .chan.call { border-color: var(--fg); color: var(--fg); }
.msg .chan.meeting { border-color: var(--amber); color: var(--amber); }
.msg.unread .chan.meeting { background: var(--amber); color: var(--bg); font-weight: 700; }
.msg.ringing { border-left-color: var(--fg); animation: ring-pulse 1s ease-in-out infinite; }
.msg.ringing .chan.call { background: var(--fg); color: var(--bg); font-weight: 700; animation: blink 0.5s steps(2) infinite; }
@keyframes ring-pulse {
  0%, 100% { background: var(--panel); }
  50% { background: rgba(57, 255, 106, 0.1); box-shadow: inset 0 0 18px rgba(57, 255, 106, 0.18); }
}
.msg .call-actions { margin-top: 7px; display: flex; gap: 6px; }
.unread-dot { display: inline-block; width: 7px; height: 7px; background: var(--fg); box-shadow: var(--glow); margin-right: 5px; vertical-align: 1px; }

/* ---------- conversation ---------- */

#conv-head h2 { display: flex; gap: 10px; align-items: baseline; white-space: nowrap; overflow: hidden; }
#conv-head .sub { font-weight: normal; letter-spacing: 0.06em; color: var(--dim); overflow: hidden; text-overflow: ellipsis; }
#conv-thread { padding: 12px 16px; }
.line { margin: 0 0 12px; max-width: 80%; }
.line .who { font-size: 11px; letter-spacing: 0.16em; color: var(--dim); margin-bottom: 3px; }
.line .text { padding: 9px 11px; border: 1px solid var(--line); background: var(--panel-2); white-space: pre-wrap; }
.line.fixer { margin-left: auto; }
.line.fixer .who { text-align: right; }
.line.fixer .text { border-color: var(--dim); color: var(--fg-bright); }
.line.system { max-width: 100%; text-align: center; color: var(--dim); font-size: 12px; letter-spacing: 0.1em; margin: 10px 0 16px; }
.line.system .text { border: none; background: none; padding: 0; display: inline; }
.line.system .who { display: none; }
.line.dice { max-width: 100%; margin: 4px 0 14px; }
.line.dice .who { letter-spacing: 0.16em; }

#conv-composer { border-top: 1px solid var(--line); padding: 10px 16px 12px; background: var(--panel-2); flex: none; max-height: 60%; overflow: auto; }
#conv-composer:empty { display: none; }
.deal { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; color: var(--dim); align-items: baseline; }
.deal b { color: var(--fg-bright); font-weight: 600; }
.deal .stance.counter b, .deal .stance.stall b { color: var(--amber); }
.deal .stance.accept b { color: var(--fg); }
.deal .stance.walk b { color: var(--red); }
.hints { margin: 0 0 10px; padding: 6px 10px; border-left: 2px solid var(--dim); }
.hints ul { margin: 2px 0 0; padding-left: 16px; }
.row { display: flex; gap: 8px; align-items: center; margin: 6px 0; flex-wrap: wrap; }
.row .label { width: 56px; }
.row.free input { flex: 1; min-width: 180px; }
.row .gap { flex: 1; }
.assign { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 6px; margin: 6px 0 8px; }
.chip {
  display: flex; gap: 8px; align-items: center; cursor: pointer;
  border: 1px solid var(--line); padding: 5px 9px; font-size: 12px;
}
.chip:hover { border-color: var(--dim); }
.chip input { margin: 0; accent-color: var(--fg); flex: none; }
.chip b { color: var(--fg-bright); }
.chip .arch { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.on { border-color: var(--fg); background: rgba(57, 255, 106, 0.08); }
.closed-note { color: var(--dim); font-size: 12px; letter-spacing: 0.1em; text-align: center; padding: 4px; }

/* dice, shown wherever a report is: big die, modifier, target, pass/fail */
.dice-strip { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.die { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); padding: 3px 9px 3px 4px; font-size: 12px; background: var(--panel); }
.die .d { font-size: 18px; font-weight: 700; min-width: 30px; text-align: center; padding: 0 4px; color: var(--fg-bright); border: 1px solid var(--dim); text-shadow: var(--glow); }
.die.fail .d { color: var(--red); border-color: var(--red); text-shadow: 0 0 6px rgba(255, 90, 90, 0.5); }
.die .k { color: var(--dim); }
.die .m { color: var(--fg); }
.die .r { font-weight: 700; letter-spacing: 0.1em; }
.die.pass .r { color: var(--fg); }
.die.fail .r { color: var(--red); }

/* ---------- right column ---------- */

#tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--panel-2); }
#tabs button { flex: 1; border: none; border-bottom: 2px solid transparent; padding: 10px 4px; letter-spacing: 0.16em; color: var(--dim); }
#tabs button.active { color: var(--fg); border-bottom-color: var(--fg); text-shadow: var(--glow); }
#tabs button .count { font-size: 11px; margin-left: 3px; }
#tab-body { padding: 10px 12px; }

.card { border: 1px solid var(--line); padding: 9px 11px; margin-bottom: 8px; background: var(--panel); }
.card .head { display: flex; gap: 8px; align-items: baseline; }
.card .name { flex: 1; font-weight: 600; color: var(--fg-bright); }
.card .meta { color: var(--dim); font-size: 12px; margin-top: 3px; }
.card .meta b { color: var(--fg); font-weight: 600; }
.card.dead { opacity: 0.45; }
.card.dark { border-color: var(--dim); }
.card .brief { margin: 6px 0 2px; color: var(--fg); font-size: 13px; }
.card .report { margin: 6px 0; padding: 7px 9px; border-left: 2px solid var(--fg); background: var(--panel-2); white-space: pre-wrap; }
.skills { display: flex; flex-wrap: wrap; gap: 3px 10px; margin-top: 5px; font-size: 12px; }
.skills .k { color: var(--dim); }
.skills .r { color: var(--fg); letter-spacing: -1px; font-size: 13px; }
.skills .r .dimmer { color: #10391b; }
.rels { font-size: 12px; color: var(--dim); margin-top: 3px; }
.rels .pos { color: var(--fg); }
.rels .neg { color: var(--red); }
.history { margin: 4px 0 0; padding-left: 16px; font-size: 12px; color: var(--dim); }

table.dice { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 4px; }
table.dice th { text-align: left; color: var(--dim); font-weight: normal; letter-spacing: 0.08em; border-bottom: 1px solid var(--line); padding: 2px 4px; }
table.dice td { padding: 2px 4px; border-bottom: 1px solid var(--dimmer); vertical-align: top; }
table.dice .d20 { color: var(--fg-bright); font-weight: 600; }

.searchrow { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.searchrow select { flex: 1; }

table.ledger { width: 100%; border-collapse: collapse; font-size: 12px; }
table.ledger td { padding: 3px 4px; border-bottom: 1px solid var(--dimmer); vertical-align: top; }
table.ledger td.amt { text-align: right; white-space: nowrap; }
table.ledger .in { color: var(--fg-bright); }
table.ledger .out { color: var(--amber); }
.stat { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--dimmer); }
.stat b { color: var(--fg-bright); font-weight: 600; }
.meter { display: inline-block; letter-spacing: 1px; color: var(--dimmer); }
.meter .on { color: var(--fg); }
.meter .onneg { color: var(--red); }

.news { padding: 7px 0; border-bottom: 1px solid var(--dimmer); font-size: 13px; }
.news .meta { color: var(--dim); font-size: 11px; letter-spacing: 0.1em; margin-bottom: 2px; }

/* ---------- presenter drawer ---------- */

#presenter {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(1100px, 92vw); z-index: 60;
  background: #020805; border-left: 1px solid var(--cyan);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.8);
  display: flex; flex-direction: column;
}
#presenter[hidden] { display: none; }
#presenter-head { display: flex; align-items: center; border-bottom: 1px solid var(--cyan); background: #04120c; }
#presenter-head h2 { flex: 1; border: none; background: none; color: var(--cyan); text-shadow: 0 0 6px rgba(90, 209, 255, 0.5); }
#presenter-head button { margin-right: 12px; border-color: var(--cyan); color: var(--cyan); }
#presenter-body { padding: 12px 16px; flex: 1; }
#presenter h3 { color: var(--cyan); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0; }
.two > div { border: 1px solid var(--line); padding: 9px 11px; white-space: pre-wrap; font-size: 13px; }
.two .truth { border-color: var(--cyan); }
.two .heard { border-color: var(--dim); }
.two .t { font-size: 11px; letter-spacing: 0.16em; color: var(--dim); margin-bottom: 5px; }
.two .truth .t { color: var(--cyan); }
.rat { font-size: 12px; color: var(--dim); margin: 2px 0; }
.rat b { color: var(--cyan); font-weight: 600; }
.logentry { border: 1px solid var(--line); padding: 6px 10px; margin-bottom: 6px; font-size: 12px; }
.logentry summary { color: var(--fg); }
.logentry .kv { color: var(--dim); margin: 2px 0; }
.logentry .kv b { color: var(--fg); font-weight: 600; }
.logentry .ask { color: var(--fg-bright); margin: 4px 0; }
table.prov { width: 100%; border-collapse: collapse; font-size: 12px; }
table.prov td { padding: 2px 4px; border-bottom: 1px solid var(--dimmer); }
table.prov tr.director td { color: var(--cyan); }

/* ---------- overlays ---------- */

#overlay {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(3, 6, 3, 0.88);
  display: flex; align-items: center; justify-content: center;
}
#overlay[hidden] { display: none; }
.callcard {
  width: 560px; max-width: 92vw; padding: 30px 34px;
  border: 1px solid var(--fg); background: var(--panel);
  box-shadow: 0 0 40px rgba(57, 255, 106, 0.25), inset 0 0 40px rgba(57, 255, 106, 0.04);
  text-align: center;
}
.callcard.ringing { animation: ring-card 1.1s ease-in-out infinite; }
@keyframes ring-card { 50% { box-shadow: 0 0 70px rgba(57, 255, 106, 0.45), inset 0 0 40px rgba(57, 255, 106, 0.08); } }
.callcard .label { display: block; margin-bottom: 10px; }
.callcard .who { font-size: 24px; color: var(--fg-bright); text-shadow: var(--glow); letter-spacing: 0.08em; }
.callcard .from { color: var(--dim); margin-bottom: 18px; }
.callcard .body { text-align: left; white-space: pre-wrap; margin: 16px 0; padding: 12px; border: 1px solid var(--line); background: var(--panel-2); }
.callcard .actions { display: flex; gap: 12px; justify-content: center; margin-top: 14px; }
.callcard .actions button { padding: 10px 24px; font-size: 13px; }
.callcard.lost { border-color: var(--red); box-shadow: 0 0 40px rgba(255, 77, 77, 0.25); }
.callcard.lost .who { color: var(--red); text-shadow: 0 0 6px rgba(255, 77, 77, 0.5); }
.callcard .stats { display: flex; justify-content: space-around; margin: 10px 0 0; font-size: 12px; color: var(--dim); }
.callcard .stats b { display: block; color: var(--fg-bright); font-size: 16px; }

/* toast sits bottom-left over the oldest inbox rows, never over the thread or composer */
#toast {
  position: fixed; left: 12px; bottom: 16px; z-index: 80;
  padding: 9px 14px; border: 1px solid var(--fg); background: var(--panel); color: var(--fg-bright);
  box-shadow: var(--glow); font-size: 13px; max-width: 296px;
}
#toast[hidden] { display: none; }
#toast.err { border-color: var(--red); color: var(--red); }

@media (max-width: 1100px) {
  body { overflow: auto; }
  #topbar { height: auto; grid-template-columns: 1fr 1fr auto; padding: 8px 12px; }
  .tb-buttons { grid-column: 1 / -1; justify-content: flex-start; }
  #tablet { flex: none; height: auto; grid-template-columns: 1fr; }
  .col { border-right: none; border-bottom: 1px solid var(--line); max-height: 70vh; }
  .chips { grid-template-columns: 1fr; }
}

/* inbox tabs, filing, and the tab pulse that teaches the UI */
#inbox-tabs { display: flex; border-bottom: 1px solid var(--line); }
#inbox-tabs button { flex: 1; border: none; border-bottom: 2px solid transparent; padding: 10px 4px; letter-spacing: 0.16em; color: var(--dim); }
#inbox-tabs .count { margin-left: 6px; }
#inbox-tabs button.active { color: var(--fg); border-bottom-color: var(--fg); text-shadow: var(--glow); }
.count.hot { color: var(--fg-bright); text-shadow: var(--glow); }
#tabs button.pulse, #inbox-tabs button.pulse { animation: tab-pulse 1.1s ease-in-out infinite; }
@keyframes tab-pulse { 0%, 100% { color: var(--dim); } 50% { color: var(--fg-bright); text-shadow: var(--glow); } }
.msg .file { margin-left: 6px; font-size: 9px; letter-spacing: 0.1em; color: var(--dim); background: none; border: 1px solid transparent; padding: 1px 4px; opacity: 0; }
.msg:hover .file, .msg:focus-within .file { opacity: 1; }
.msg .file:hover { color: var(--fg); border-color: var(--line); }

/* note to self: the lead's in-fiction tutorial */
#note { display: flex; align-items: center; gap: 12px; padding: 7px 16px; border-bottom: 1px solid var(--line); background: rgba(57, 255, 106, 0.05); font-size: 12px; }
#note .label { color: var(--cyan); letter-spacing: 0.16em; font-size: 10px; white-space: nowrap; }
#note .text { flex: 1; color: var(--fg-bright); }
#note button { background: none; border: 1px solid transparent; color: var(--dim); font-size: 14px; padding: 0 6px; }
#note button:hover { color: var(--fg); border-color: var(--line); }
.hint { animation: hint-pulse 1.2s ease-in-out infinite; }
@keyframes hint-pulse { 0%, 100% { box-shadow: none; } 50% { box-shadow: 0 0 0 2px var(--cyan), 0 0 14px rgba(80, 220, 255, 0.5); } }

/* feature tips */
#tip { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.55); }
#tip[hidden] { display: none; }
#tip .box { width: min(520px, 92vw); border: 1px solid var(--cyan); background: var(--bg); box-shadow: 0 0 28px rgba(80, 220, 255, 0.25); padding: 18px 22px; }
#tip .kicker { color: var(--cyan); font-size: 10px; letter-spacing: 0.2em; margin-bottom: 8px; }
#tip .title { margin: 0 0 10px; color: var(--fg-bright); text-shadow: var(--glow); font-size: 16px; letter-spacing: 0.08em; }
#tip .body { color: var(--fg); line-height: 1.55; font-size: 13px; }
#tip .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; gap: 12px; }
#tip .foot label { color: var(--dim); font-size: 11px; display: flex; align-items: center; gap: 6px; cursor: pointer; }
#tip .foot label:hover { color: var(--fg); }
#tip input[type=checkbox] { accent-color: var(--fg); }

/* the offer: price, terms and a line, sent together */
.offer { margin: 8px 0 10px; padding: 8px 10px 10px; border: 1px solid var(--line); background: rgba(57, 255, 106, 0.03); }
.offer > .label { display: block; margin-bottom: 6px; }
.offer .fields { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.offer .fields label { display: flex; flex-direction: column; gap: 3px; }
.offer .fields label span { font-size: 9px; letter-spacing: 0.16em; color: var(--dim); }
.offer .fields label.line { flex: 1; min-width: 200px; }
.offer .fields input, .offer .fields select { height: 32px; }
.offer .fields #quote-price { width: 120px; }
.offer .fields button { height: 32px; white-space: nowrap; }

/* named entities in text */
.ent { color: var(--fg-bright); text-decoration: none; border-bottom: 1px dotted var(--dim); cursor: pointer; }
.ent:hover { border-bottom-color: var(--fg); text-shadow: var(--glow); }
.ent.client { color: var(--fg-bright); }
.ent.npc { color: var(--cyan); }
.card.flash { animation: card-flash 1.6s ease-out; }
@keyframes card-flash { 0% { box-shadow: 0 0 0 2px var(--cyan), 0 0 18px rgba(80, 220, 255, 0.6); } 100% { box-shadow: none; } }

/* portraits */
.card.with-portrait { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: start; }
.card.with-portrait .body { min-width: 0; }
.portrait { display: block; border: 1px solid var(--line); background: #050a06; flex: none; }
.card.dead .portrait, .card.injured .portrait { opacity: 0.6; }
#conv-head { display: flex; align-items: center; gap: 10px; }
#conv-head .portrait { width: 30px; height: 35px; }
#conv-head .headshot { flex: none; }

/* photo headshots from the sprite sheet */
.headshot { background-repeat: no-repeat; border: 1px solid var(--line); image-rendering: auto; position: relative; flex: none; }
.headshot.made { outline: 1px dashed var(--cyan); outline-offset: -2px; }
.headshot.dead::after { content: ''; position: absolute; inset: 0; background: linear-gradient(45deg, transparent 47%, #ff5a5a 47%, #ff5a5a 53%, transparent 53%), linear-gradient(-45deg, transparent 47%, #ff5a5a 47%, #ff5a5a 53%, transparent 53%); }
.card.dead .headshot, .card.injured .headshot { filter: brightness(0.6); }
