/* Brother Eye — the family's secure system, by Wayne Enterprises Applied Sciences.
   One typeface, hairlines instead of boxes, one accent: the colour of whoever you're playing. */

@font-face { font-family: "JetBrains Mono"; font-weight: 100 800; font-display: swap; src: url(/fonts/jetbrains-mono.woff2) format("woff2"); }

@property --accent { syntax: "<color>"; inherits: true; initial-value: #f4f4f5; }

:root {
  --bg: #09090b;
  --bg-1: #0d0d10;
  --bg-2: #121215;
  --bg-3: #18181c;
  --bg-4: #1f1f24;
  --line: #1b1b20;
  --line-2: #25252b;
  --line-3: #32323a;
  --text: #e8e8eb;
  --text-2: #b6b6be;
  --text-3: #868690;
  --text-4: #7a7a85;        /* the faintest text that's read: 4.7:1 on the background (WCAG AA) */
  --text-5: #4f4f59;        /* only for what isn't read: rules, separators, what's switched off */
  --accent: #f4f4f5;
  --ink: #0a0a0b;
  --a-05: color-mix(in oklab, var(--accent) 5%, transparent);
  --a-10: color-mix(in oklab, var(--accent) 10%, transparent);
  --a-18: color-mix(in oklab, var(--accent) 18%, transparent);
  --a-30: color-mix(in oklab, var(--accent) 30%, transparent);
  --a-50: color-mix(in oklab, var(--accent) 50%, transparent);
  --online: #5ed38f;
  --idle: #e9b44c;
  --dnd: #ef6b65;
  --ooc: #7ea7ef;
  --danger: #ef6b65;
  --sev-1: #8c919b;
  --sev-2: #e3b04b;
  --sev-3: #ef8a4a;
  --sev-4: #f0544b;
  --font: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs: 13px;
  --r: 3px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --t: .16s;
  transition: --accent .45s var(--ease);
  color-scheme: dark;
}
/* Themes (Settings › Theme): the ground under everything. Whoever you're playing stays the accent on any
   of them; the faintest read text keeps 4.5:1 or better on each. */
:root[data-theme="abyss"] { --bg: #000; --bg-1: #050506; --bg-2: #0a0a0c; --bg-3: #111114; --bg-4: #18181c;
  --line: #141418; --line-2: #1f1f25; --line-3: #2c2c34; --text-4: #7c7c87; --text-5: #4a4a53; }
:root[data-theme="graphite"] { --bg: #17181b; --bg-1: #1c1d21; --bg-2: #222328; --bg-3: #292b31; --bg-4: #31333a;
  --line: #26282e; --line-2: #31333a; --line-3: #3e4049; --text: #eeeef1; --text-2: #c6c7ce; --text-3: #a0a1ab; --text-4: #8d8f9a; --text-5: #5b5d67; }
:root[data-theme="steel"] { --bg: #0a0d12; --bg-1: #0e1218; --bg-2: #131820; --bg-3: #19202a; --bg-4: #202834;
  --line: #19202a; --line-2: #232b37; --line-3: #303a48; --text: #e5eaf1; --text-2: #b2bccb; --text-3: #8b97aa; --text-4: #7d899c; --text-5: #4a5464; }
:root[data-theme="contrast"] { --bg: #000; --bg-1: #000; --bg-2: #0b0b0b; --bg-3: #161616; --bg-4: #222;
  --line: #3a3a3a; --line-2: #555; --line-3: #777; --text: #fff; --text-2: #ececec; --text-3: #d2d2d2; --text-4: #bdbdbd; --text-5: #8a8a8a; }
:root[data-theme="daylight"] { --bg: #f3f3f0; --bg-1: #fbfbf9; --bg-2: #ecece8; --bg-3: #e3e3de; --bg-4: #d9d9d3;
  --line: #e1e1dc; --line-2: #d3d3cd; --line-3: #c0c0b9; --text: #141416; --text-2: #35353b; --text-3: #55555d; --text-4: #66666e; --text-5: #a3a3a9;
  --ink: #fbfbf9; color-scheme: light; }
:root[data-theme="daylight"] ::selection { color: var(--text); }
:root[data-size="s"] { --fs: 12px; }
:root[data-size="l"] { --fs: 14px; }
:root[data-size="xl"] { --fs: 15px; }
:root[data-motion="off"] { --t: 0s; }

* { box-sizing: border-box; }
/* the pointer takes the character's colour (drawn in main.js); the system's own is the fallback */
html { cursor: var(--cur, default); }
a, button, [role="button"], [role="tab"], select, summary, label:has(input[type="color"]), .file-row, .chip[onclick] { cursor: var(--cur-pointer, pointer); }
input:not([type="range"]):not([type="color"]), textarea, [contenteditable] { cursor: var(--cur-text, text); }
button:disabled, .btn:disabled { cursor: not-allowed; }
:root.resizing, :root.resizing * { cursor: var(--cur-col, col-resize) !important; }
/* Dragging across the interface selects nothing; only what's worth copying can be: messages, the
   files, notes on places and anything typed. (The desktop app is WebKit, which needs the prefix.) */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, [contenteditable], .row .body, .file-text, .protocol p, .place-more > div:first-child, .map-card p, .selectable { -webkit-user-select: text; user-select: text; }
::selection { background: var(--a-30); color: var(--text); }
* { scrollbar-width: thin; scrollbar-color: var(--line-3) transparent; }
*:hover { scrollbar-color: color-mix(in oklab, var(--accent) 40%, var(--line-3)) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-3); border-radius: 4px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in oklab, var(--accent) 45%, var(--line-3)); }
::-webkit-scrollbar-track { background: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: var(--fs)/1.55 var(--font); font-feature-settings: "calt" 0, "zero" 1;
  -webkit-font-smoothing: antialiased; overflow: hidden; letter-spacing: -.005em;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; letter-spacing: inherit; }
input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--a-30); color: var(--text); }
:focus-visible { outline: 2px solid color-mix(in oklab, var(--accent) 75%, transparent); outline-offset: 2px; border-radius: 2px; }
.row:focus-within .acts { display: flex; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.i { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--line-3); }
::-webkit-scrollbar-track { background: transparent; }

/* --- primitives -------------------------------------------------------------- */

.label { font-size: .77em; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-4); }
.rule { display: flex; align-items: center; gap: 10px; }
.rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.dim { color: var(--text-3); }
.faint { color: var(--text-4); }
.mono-num { font-variant-numeric: tabular-nums; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 28px; padding: 0 11px;
  border: 1px solid var(--line-2); border-radius: var(--r); color: var(--text-2); background: transparent;
  font-size: .92em; white-space: nowrap; transition: background var(--t), color var(--t), border-color var(--t), transform .08s;
}
.btn:hover { background: var(--bg-3); color: var(--text); border-color: var(--line-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; color: var(--text-3); }
.btn.ghost:hover { color: var(--text); background: var(--bg-3); }
.btn.danger:hover { color: var(--danger); border-color: color-mix(in oklab, var(--danger) 50%, transparent); }
.btn.sm { height: 24px; padding: 0 8px; font-size: .85em; }
.btn svg.i { width: 14px; height: 14px; } .btn.sm svg.i { width: 13px; height: 13px; }
/* a row of buttons: one height, one gap, centred, in every view */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.rule.label .btn { font-size: 1.15em; font-weight: 500; letter-spacing: normal; text-transform: none; }
.icon-btn { display: grid; place-items: center; width: 26px; height: 26px; border-radius: var(--r); color: var(--text-3); transition: color var(--t), background var(--t); }
.icon-btn:hover { color: var(--text); background: var(--bg-3); }

.field {
  width: 100%; height: 30px; padding: 0 10px; border-radius: var(--r); border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text); outline: none; transition: border-color var(--t), box-shadow var(--t);
}
.field::placeholder { color: var(--text-4); }
.field:focus { border-color: var(--a-50); box-shadow: 0 0 0 3px var(--a-10); }
textarea.field { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.55; }
select.field { appearance: none; padding-right: 24px; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%; background-size: 4px 4px; background-repeat: no-repeat; }

.tag { display: inline-flex; align-items: center; height: 17px; padding: 0 5px; border-radius: 2px; font-size: .74em; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; border: 1px solid color-mix(in oklab, currentColor 40%, transparent); line-height: 1; }
.tag.online { color: var(--online); } .tag.idle { color: var(--idle); } .tag.dnd { color: var(--dnd); } .tag.offline, .tag.invisible { color: var(--text-4); } .tag.ooc { color: var(--ooc); }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1.5px var(--text-4); }
.dot.online { background: var(--online); box-shadow: 0 0 6px color-mix(in oklab, var(--online) 55%, transparent); }
.dot.idle { background: var(--idle); box-shadow: none; } .dot.dnd { background: var(--dnd); box-shadow: none; }
.dot.invisible { box-shadow: inset 0 0 0 1.5px var(--text-3); }
.count { min-width: 18px; height: 17px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center; font-size: .74em; font-weight: 700; background: var(--accent); color: var(--ink); }
.count.quiet { background: var(--bg-4); color: var(--text-2); }

/* faces: a portrait, or an emblem, or initials — always square */
.face { --size: 32px; position: relative; flex: none; width: var(--size); height: var(--size); border-radius: var(--r);
  background: var(--bg-3) center / cover no-repeat; display: grid; place-items: center; overflow: hidden;
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c) 45%, transparent); color: var(--c);
  font-weight: 700; font-size: calc(var(--size) * .36); letter-spacing: .02em; }
.face svg.em { width: 76%; height: 76%; fill: var(--c); overflow: visible; filter: drop-shadow(0 0 4px color-mix(in oklab, var(--c) 35%, transparent)); }
.face .ini { line-height: 1; letter-spacing: .04em; }
.face.xs { --size: 16px; border-radius: 2px; } .face.sm { --size: 22px; } .face.md { --size: 28px; } .face.lg { --size: 44px; } .face.xl { --size: 96px; }
.face .pres { position: absolute; right: 1px; bottom: 1px; width: 7px; height: 7px; border-radius: 50%; background: var(--bg-1); box-shadow: 0 0 0 2px var(--bg-1), inset 0 0 0 1.5px var(--text-4); }
.face .pres.online { background: var(--online); box-shadow: 0 0 0 2px var(--bg-1); }
.face .pres.idle { background: var(--idle); box-shadow: 0 0 0 2px var(--bg-1); }
.face .pres.dnd { background: var(--dnd); box-shadow: 0 0 0 2px var(--bg-1); }

/* --- boot & sign in ------------------------------------------------------------- */

.boot { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: grid; place-items: center; transition: opacity .5s var(--ease), visibility .5s; animation: fade .35s var(--ease); }
.boot.done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-inner { width: min(560px, calc(100vw - 48px)); }
.boot-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.boot-head .label { color: var(--text-3); }
.boot-lines { min-height: 168px; font-size: .95em; }
.boot-line { display: flex; gap: 10px; color: var(--text-3); white-space: pre; animation: boot-in .22s var(--ease) both; }
.boot-line b { font-weight: 500; color: var(--text); }
.boot-line .ok { color: var(--accent); margin-left: auto; }
.boot-line .err { color: var(--danger); margin-left: auto; }
.boot-bar { height: 1px; background: var(--line); margin: 18px 0 26px; position: relative; overflow: hidden; }
.boot-bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); transition: width .35s var(--ease); box-shadow: 0 0 10px var(--a-50); }
.boot-id { display: flex; align-items: center; gap: 18px; min-height: 86px; opacity: 0; transition: opacity .3s; }
.boot-id.on { opacity: 1; }
.boot-id .mark { width: 108px; height: 108px; flex: none; display: grid; place-items: center; color: var(--accent); }
.boot-id svg.em { width: 100%; height: 100%; fill: var(--accent); stroke: var(--accent); stroke-width: 1.5; overflow: visible; stroke-linejoin: round; filter: drop-shadow(0 0 14px var(--a-30)); }

.boot-id b { display: block; font-size: 1.7em; font-weight: 700; letter-spacing: .16em; color: var(--accent); }
.boot-id span { color: var(--text-3); }
@keyframes boot-in { from { opacity: 0; transform: translateX(-4px); } }

.signin { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; background: var(--bg); }
.signin-card { width: min(460px, calc(100vw - 40px)); }
.signin-card .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.signin-card .brand .logo { width: 40px; height: 40px; flex: none; }
.signin-card h1 { margin: 0; font-size: 1.55em; font-weight: 700; letter-spacing: .02em; }
.cursor { display: inline-block; width: .6em; height: 1.05em; background: var(--accent); vertical-align: -.15em; margin-left: 2px; animation: blink 1.06s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.signin-card p { margin: 0 0 16px; color: var(--text-3); }
.prompt-field { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg-1); transition: border-color var(--t), box-shadow var(--t); }
.prompt-field:focus-within { border-color: var(--a-50); box-shadow: 0 0 0 3px var(--a-10); }
.prompt-field > span { color: var(--accent); font-weight: 700; }
.prompt-field input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; }
.signin-card .btn.primary { width: 100%; height: 36px; margin-top: 12px; }
.signin-card .err { margin-top: 12px; color: var(--danger); font-size: .92em; }
.signin-foot { margin-top: 34px; display: flex; justify-content: space-between; color: var(--text-5); font-size: .8em; }

/* --- the frame ---------------------------------------------------------------------- */

.app { position: fixed; inset: 0; display: grid; grid-template-columns: var(--rail-w, 252px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 26px; }
.rail { display: flex; flex-direction: column; min-height: 0; background: var(--bg-1); border-right: 1px solid var(--line); }
.main { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.status { grid-column: 1 / -1; display: flex; align-items: stretch; background: var(--bg-1); border-top: 1px solid var(--line);
  font-size: .8em; color: var(--text-3); overflow: hidden; white-space: nowrap; }
.status > * { display: flex; align-items: center; gap: 7px; padding: 0 12px; border-right: 1px solid var(--line); }
.status > .grow { flex: 1; border-right: 0; }
.status b { font-weight: 600; color: var(--text-2); }
.status .live { color: var(--text-2); }
.status .live i { width: 6px; height: 6px; border-radius: 50%; background: var(--idle); }
.status .live.ok i { background: var(--online); box-shadow: 0 0 6px var(--online); }
.status .live.down i { background: var(--danger); }
.status .alert { color: var(--sev-3); }
.status button:hover { color: var(--text); }

.brand-row { display: flex; align-items: center; gap: 9px; height: 46px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.brand-row .mark { display: grid; flex: none; }
.brand-row .logo { width: 20px; height: 20px; }
.brand-row b { font-weight: 700; letter-spacing: .08em; white-space: nowrap; }
.brand-row .ver { margin-left: auto; color: var(--text-5); font-size: .74em; letter-spacing: .12em; white-space: nowrap; }

/* who you are */
.idcard { padding: 12px 12px 10px; border-bottom: 1px solid var(--line); display: grid; gap: 9px; }
.whoami { display: flex; align-items: center; gap: 10px; padding: 4px; margin: -4px; border-radius: var(--r); text-align: left; transition: background var(--t); }
.whoami:hover { background: var(--bg-3); }
.whoami .names { min-width: 0; flex: 1; }
.whoami b { display: block; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.whoami span { display: block; color: var(--text-3); font-size: .88em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.whoami .chev { color: var(--text-4); }
.presence-btn { display: flex; align-items: center; gap: 8px; height: 26px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r);
  color: var(--text-2); font-size: .86em; transition: background var(--t), border-color var(--t); }
.presence-btn:hover { background: var(--bg-3); border-color: var(--line-3); }
.presence-btn .since { margin-left: auto; color: var(--text-4); font-variant-numeric: tabular-nums; }
.presence-btn svg.i { width: 12px; height: 12px; color: var(--text-4); margin-left: auto; }
.presence-btn .since + svg.i { margin-left: 0; }
.where { display: flex; align-items: center; gap: 6px; }
.where-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; height: 24px; padding: 0 6px; border-radius: var(--r); color: var(--text-3); font-size: .88em; text-align: left; }
.where-btn:hover { background: var(--bg-3); color: var(--text); }
.where-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.where-btn svg.i { color: var(--accent); width: 13px; height: 13px; }

.nav { display: grid; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.nav button { position: relative; display: flex; align-items: center; gap: 10px; height: 28px; padding: 0 10px; border-radius: var(--r);
  color: var(--text-3); font-size: .86em; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; transition: color var(--t), background var(--t); }
.nav button:hover { color: var(--text); background: var(--bg-3); }
.nav button.on { color: var(--text); background: var(--bg-3); }
.nav button.on::before { content: ""; position: absolute; left: -6px; top: 7px; bottom: 7px; width: 2px; background: var(--accent); border-radius: 0 2px 2px 0; box-shadow: 0 0 8px var(--a-50); }
.nav button .count { margin-left: auto; }
.nav kbd { margin-left: auto; font: inherit; font-size: .8em; color: var(--text-5); letter-spacing: 0; }

.channels { flex: 1; overflow-y: auto; padding: 6px 6px 14px; }
.channels .rule { margin: 12px 8px 4px; }
.channels .rule .add { order: 3; color: var(--text-4); }
.channels .rule .add:hover { color: var(--text); }
.chan { position: relative; width: 100%; display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 8px; border-radius: var(--r); color: var(--text-3); text-align: left; transition: background var(--t), color var(--t); }
.chan:hover { background: var(--bg-3); color: var(--text-2); }
.chan.on { background: var(--bg-3); color: var(--text); }
.chan.unread { color: var(--text); font-weight: 600; }
.chan .sig { width: 16px; text-align: center; color: var(--text-4); flex: none; }
.chan.on .sig { color: var(--accent); }
.chan .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan .typing-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* --- views ------------------------------------------------------------------------------ */

.view { flex: 1; display: flex; flex-direction: column; min-height: 0; animation: view-in .18s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(3px); } }
.view-head { flex: none; display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 18px; border-bottom: 1px solid var(--line); container-type: inline-size; }
.view-head h2 { margin: 0; font-size: 1em; font-weight: 700; letter-spacing: .06em; white-space: nowrap; }
.view-head .sub { color: var(--text-3); font-size: .88em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view-head .tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.view-body { flex: 1; min-height: 0; overflow-y: auto; }
.empty { display: grid; place-content: center; text-align: center; gap: 6px; padding: 60px 20px; color: var(--text-4); }
.empty b { color: var(--text-3); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; font-size: .86em; }

/* comms */
.log { padding: 10px 0 8px; }
.view[data-view="comms"] > .view-body { background-image: radial-gradient(rgba(255,255,255,.028) 1px, transparent 1px); background-size: 22px 22px; background-attachment: local; }
.row { position: relative; display: grid; grid-template-columns: 7ch 14ch minmax(0, 1fr); column-gap: 12px; padding: 1px 18px; }
.row:hover { background: var(--bg-1); }
.row.first { margin-top: 7px; }
.row .t { color: var(--text-4); font-size: .86em; padding-top: .14em; font-variant-numeric: tabular-nums; }
.row:hover .t { color: var(--text-4); }
.row .who { color: var(--c); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.row .who.person { cursor: var(--cur-pointer, pointer); outline: none; }
.row .who.person:hover, .row .who.person:focus-visible { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.row .body { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.row.mine .who { color: var(--accent); }
.row .who .who-em { width: 1.15em; height: 1.15em; margin-right: .45em; vertical-align: -.2em; fill: currentColor; opacity: .95; }
.row.pending .body { color: var(--text-3); }
.row.sys .body { color: var(--text-4); font-style: italic; }
.row.sys .who { color: var(--text-5); }
.row.ooc .body { color: var(--text-3); }
.row.ooc .body::before { content: "ooc "; color: var(--ooc); font-size: .78em; font-weight: 700; letter-spacing: .1em; }
.row.action .body { color: var(--text-2); font-style: italic; }
.row.deleted .body { color: var(--text-5); font-style: italic; }
.row .gone { display: inline-flex; align-items: center; gap: 6px; }
.row .gone svg.i { width: 12px; height: 12px; flex: none; opacity: .8; }
.row.hit { background: var(--a-05); }
.row.hit::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent); }
.row.new { animation: row-in .3s var(--ease); }
@keyframes row-in { from { opacity: 0; background: var(--a-10); } }
.row .edited { color: var(--text-5); font-size: .8em; margin-left: 6px; }
.row .quote { display: block; color: var(--text-4); font-size: .88em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 1px; }
.row .quote b { font-weight: 600; color: var(--text-3); }
.mention { color: var(--accent); background: var(--a-10); border-radius: 2px; padding: 0 2px; }
.row .acts { position: absolute; right: 12px; top: -10px; display: none; gap: 2px; padding: 2px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r); }
.row:hover .acts { display: flex; }
.row .seen { display: flex; gap: 3px; justify-content: flex-end; margin-top: 3px; color: var(--text-4); font-size: .78em; align-items: center; }
.sep { display: flex; align-items: center; gap: 12px; padding: 12px 18px 6px; color: var(--text-4); font-size: .78em; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.sep::before, .sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sep.newline { color: var(--accent); }
.sep.newline::before, .sep.newline::after { background: var(--a-30); }
.older { display: block; margin: 4px auto 8px; }

.typing { flex: none; height: 20px; padding: 0 18px; color: var(--text-4); font-size: .86em; display: flex; align-items: center; gap: 6px; }
.typing i { width: 7px; height: 12px; background: var(--accent); opacity: .6; animation: blink 1.06s steps(1) infinite; }
.composer { flex: none; border-top: 1px solid var(--line); padding: 10px 18px 12px; }
.replying { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: var(--text-3); font-size: .88em; }
.replying b { color: var(--text-2); }
.prompt { display: flex; align-items: flex-start; gap: 10px; }
.prompt .ps1 { flex: none; padding-top: 5px; color: var(--accent); font-weight: 600; white-space: nowrap; }
.prompt .ps1 em { font-style: normal; color: var(--text-4); font-weight: 400; }
.prompt .entry { position: relative; flex: 1; min-width: 0; display: flex; }
.prompt textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: none; background: transparent; padding: 5px 0; max-height: 180px; line-height: 1.55; caret-color: var(--accent); }
.prompt textarea::placeholder { color: transparent; }
.prompt .ghost { display: none; position: absolute; left: 1.3ch; right: 0; top: 5px; line-height: 1.55; color: var(--text-5); pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prompt textarea:placeholder-shown + .ghost { display: block; }
.prompt textarea:disabled + .ghost { left: 0; }
.prompt-tools { flex: none; display: flex; gap: 2px; margin-top: 1px; }
.prompt-tools .icon-btn { color: var(--text-4); }
.prompt-tools .icon-btn:hover { color: var(--accent); }
.composer.recording .prompt { display: none; }
.send-btn { display: grid; place-items: center; width: 28px; height: 28px; margin-left: 4px; border-radius: var(--r); background: var(--accent); color: var(--bg);
  transition: opacity var(--t), transform .12s var(--ease), box-shadow var(--t); box-shadow: 0 0 12px color-mix(in oklab, var(--accent) 35%, transparent); }
.send-btn svg.i { width: 15px; height: 15px; stroke-width: 2; }
.send-btn:hover:not(:disabled) { transform: translateX(1px); }
.send-btn:active:not(:disabled) { transform: scale(.92); }
.send-btn:disabled { background: var(--bg-3); color: var(--text-5); box-shadow: none; cursor: default; }
.hints { margin-top: 6px; display: flex; gap: 14px; color: var(--text-5); font-size: .78em; }
.hints b { color: var(--text-4); font-weight: 500; }
.cmd-pop { position: absolute; left: 18px; right: 18px; bottom: calc(100% + 4px); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 4px; box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.cmd-pop button { display: flex; gap: 12px; width: 100%; padding: 5px 8px; border-radius: 2px; text-align: left; }
.cmd-pop button.hl, .cmd-pop button:hover { background: var(--bg-4); }
.cmd-pop button b { color: var(--accent); font-weight: 600; min-width: 13ch; }
.cmd-pop button span { color: var(--text-3); }
.cmd-pop[data-kind="mention"] button { align-items: center; gap: 10px; }
.cmd-pop[data-kind="mention"] button b { min-width: 0; color: var(--c, var(--accent)); }
.cmd-pop[data-kind="mention"] button .sub { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9em; }
.cmd-pop[data-kind="mention"] kbd { margin-left: auto; }
.cmd-pop .face.all { display: inline-grid; place-items: center; color: var(--accent); background: var(--bg-4); font-weight: 700; }

/* codex: the index (left) and the file (right) */
.tabs { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--line); flex: none; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; height: 36px; padding: 0 10px; color: var(--text-4); font-size: .82em; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; border-bottom: 1px solid transparent; margin-bottom: -1px; transition: color var(--t); }
.tabs button:hover { color: var(--text-2); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs button em { font-style: normal; color: var(--text-5); margin-left: 5px; }
.search-box { position: relative; display: flex; align-items: center; }
.search-box > .i { position: absolute; left: 8px; width: 14px; height: 14px; color: var(--text-4); pointer-events: none; }
.search-box .field.search { width: min(240px, 34vw); height: 28px; padding: 0 30px 0 28px; }
.search-box kbd { position: absolute; right: 7px; color: var(--text-5); }
kbd { font: inherit; font-size: .78em; padding: 0 4px; border: 1px solid var(--line-2); border-radius: 2px; color: var(--text-4); line-height: 1.5; }

.split { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: var(--index-w, clamp(270px, 25vw, 400px)) minmax(0, 1fr); }
.file-index { border-right: 1px solid var(--line); padding: 4px 0 18px; }
.file-group { position: sticky; top: 0; z-index: 1; display: flex; align-items: baseline; gap: 8px; padding: 10px 16px 6px; background: var(--bg);
  font-size: .72em; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-4); }
.file-group::after { content: ""; flex: 1; height: 1px; background: var(--line); align-self: center; }
.file-group em { font-style: normal; color: var(--text-5); }
.file-row { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  width: 100%; min-height: 46px; padding: 6px 14px 6px 16px; text-align: left; transition: background var(--t); }
.file-row::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; background: var(--c); opacity: 0; transition: opacity var(--t); }
.file-row:hover { background: var(--bg-1); }
.file-row.on { background: color-mix(in oklab, var(--c) 7%, var(--bg-1)); }
.file-row.on::before { opacity: 1; }
.file-row .face.md { --size: 30px; }
.r-main { min-width: 0; display: grid; }
.r-main b { color: var(--c); font-weight: 700; font-size: .9em; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-main span { color: var(--text-4); font-size: .82em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-side { display: flex; align-items: center; justify-content: flex-end; gap: 7px; min-width: 0; max-width: 120px; color: var(--text-3); font-size: .8em; }
.r-side small { font-size: 1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-side .npc { color: var(--text-5); letter-spacing: .1em; text-transform: uppercase; font-size: .88em; }
.pips { display: inline-flex; gap: 2px; flex: none; }
.pips i { width: 4px; height: 10px; border-radius: 1px; background: var(--line-3); }
.pips.l1 i.on { background: var(--sev-1); } .pips.l2 i.on { background: var(--sev-2); } .pips.l3 i.on { background: var(--sev-3); } .pips.l4 i.on { background: var(--sev-4); }
.cust { letter-spacing: .08em; text-transform: uppercase; font-size: .86em !important; }
.cust.free { color: var(--sev-4); } .cust.held { color: var(--text-3); } .cust.gone { color: var(--text-5); text-decoration: line-through; }

.file-pane { min-height: 0; overflow-y: auto; overflow-x: hidden; }
.file { --c: var(--accent); position: relative; max-width: 940px; padding: 0 28px 28px; container-type: inline-size; }
.file-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 0; height: 40px; margin: 0 -28px 0; padding: 0 28px;
  background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  font-size: .74em; letter-spacing: .14em; text-transform: uppercase; color: var(--text-4); white-space: nowrap; overflow: hidden; }
.file-bar > span + span::before { content: "/"; margin: 0 10px; color: var(--text-5); }
.file-bar b { color: var(--text-2); font-weight: 700; }
.file-bar .cls { color: var(--c); font-weight: 600; }
.file-bar .cls.rogues { color: var(--sev-4); }
.file-bar .cls.edit { color: var(--idle); }
.file-bar .rev { margin-left: auto; letter-spacing: .08em; text-transform: none; }
.file-bar .rev::before { display: none; }
.file-bar .rev.flash { color: var(--c); animation: rev-flash 1.6s var(--ease); }
.file-bar .back { display: none; margin-right: 8px; transform: rotate(90deg); }
@keyframes rev-flash { 0%, 30% { color: var(--c); text-shadow: 0 0 10px var(--c); } 100% { text-shadow: none; } }

.file-id { position: relative; display: grid; grid-template-columns: clamp(132px, 15vw, 184px) minmax(0, 1fr) clamp(84px, 9vw, 112px); gap: 24px; align-items: start; padding: 26px 0 22px; }

.file-photo { position: relative; aspect-ratio: 1; width: 100%; }
.photo-clip { position: absolute; inset: 0; overflow: hidden; border-radius: 2px; box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c) 30%, transparent); }
.photo-clip .face.xl { --size: 100%; width: 100%; height: 100%; border-radius: 0; box-shadow: none; font-size: clamp(30px, 4vw, 46px); filter: saturate(.92) contrast(1.04); }
.photo-clip .face.xl svg.em { width: 70%; height: 70%; }
.photo-clip .scanlines { position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0,0,0,.16) 2px 3px), radial-gradient(120% 95% at 50% 38%, transparent 58%, rgba(0,0,0,.5)); }
.photo-clip .scan-line { position: absolute; left: 0; right: 0; top: 0; height: 9%; opacity: 0; pointer-events: none;
  background: linear-gradient(to bottom, transparent, color-mix(in oklab, var(--c) 28%, transparent) 70%, var(--c) 96%, transparent); mix-blend-mode: screen; }
.photo-cap { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; gap: 6px; padding: 14px 8px 5px;
  font-size: .6em; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-2); pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,.78)); white-space: nowrap; }
.photo-cap span:last-child { overflow: hidden; text-overflow: ellipsis; }
.photo-cap .online { color: var(--online); } .photo-cap .idle { color: var(--idle); } .photo-cap .dnd { color: var(--dnd); }
.photo-cap .offline, .photo-cap .invisible, .photo-cap .npc { color: var(--text-3); }
.photo-cap .free { color: var(--sev-4); } .photo-cap .held { color: var(--text-2); } .photo-cap .gone { color: var(--text-4); }
.file-photo .brackets { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); fill: none; stroke: var(--c); stroke-width: 1.5; overflow: visible; pointer-events: none; }
.file-photo.can { cursor: pointer; }
.file-photo.can .photo-clip::after { content: "change photo"; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: .7em; letter-spacing: .18em; text-transform: uppercase; color: var(--text); background: rgba(0,0,0,.55); opacity: 0; transition: opacity var(--t); }
.file-photo.can:hover .photo-clip::after, .file-photo.over .photo-clip::after { opacity: 1; }
.file-photo.over .photo-clip { box-shadow: inset 0 0 0 2px var(--c); }

/* the insignia plate: one per file, same size, same place */
.file-plate { position: relative; aspect-ratio: 1; width: 100%; display: grid; place-items: center; margin-top: 2px;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--c) 10%, transparent), transparent 92%); }
.file-plate .brackets { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: color-mix(in oklab, var(--c) 55%, transparent); stroke-width: 1; overflow: visible; pointer-events: none; }
.file-plate svg.em { width: 76%; height: 76%; overflow: visible; fill: var(--c); stroke: var(--c); stroke-width: 1.2; stroke-linejoin: round;
  filter: drop-shadow(0 0 12px color-mix(in oklab, var(--c) 35%, transparent)); }
.file-plate.num { align-content: center; gap: 4px; text-align: center; }
.plate-k { font-size: .6em; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--text-4); }
.plate-n { font-size: clamp(1.35em, 2.1vw, 1.9em); font-weight: 800; letter-spacing: .08em; line-height: 1; color: var(--c);
  text-shadow: 0 0 18px color-mix(in oklab, var(--c) 30%, transparent); font-variant-numeric: tabular-nums; }
@container (max-width: 640px) {
  .file-id { grid-template-columns: 112px minmax(0, 1fr); gap: 16px; }
  .file-plate { position: absolute; top: 18px; right: 0; width: 46px; }
  .file-plate.num { gap: 1px; } .plate-k { font-size: .5em; } .plate-n { font-size: 1.05em; }
  .file-who { padding-right: 56px; }
}

.file-who { min-width: 0; display: grid; gap: 4px; align-content: start; padding-top: 2px; }
.file-who .kicker { font-size: .72em; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--text-4); }
.file-who h3 { margin: 0; font-size: clamp(1.45em, 2.4vw, 2.05em); line-height: 1.12; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--c);
  overflow-wrap: anywhere; text-shadow: 0 0 22px color-mix(in oklab, var(--c) 22%, transparent); }
.file-who .legal { color: var(--text-2); font-size: 1.02em; }
.file-live { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 14px; margin: 12px 0 4px; font-size: .88em; }
.file-live dt { color: var(--text-4); font-size: .84em; letter-spacing: .14em; text-transform: uppercase; padding-top: 1px; }
.file-live dd { margin: 0; display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--text-2); }
.file-live dd small { color: var(--text-4); font-size: 1em; }
.file-live dd .i { width: 13px; height: 13px; color: var(--text-4); flex: none; }
.file-live dd span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-live dd.quote { color: var(--text-3); font-style: italic; display: block; }
.file-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.file-actions .btn .i { width: 13px; height: 13px; }

.file-sec { padding: 18px 0 4px; }
.rule-head { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font-size: .72em; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--text-3); }
.rule-head::before { content: ""; width: 6px; height: 6px; background: var(--c); flex: none; }
.rule-head::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border: 1px solid var(--line); overflow: hidden; }
.facts.wide { grid-template-columns: minmax(0, 1fr); }
.fact { padding: 8px 12px 9px; min-width: 0; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }   /* hairlines that leave an unfilled row blank */
.fact dt { font-size: .7em; letter-spacing: .16em; text-transform: uppercase; color: var(--text-4); }
.fact dd { margin: 2px 0 0; color: var(--text); font-size: .92em; overflow-wrap: anywhere; }
.facts.wide .fact { display: grid; grid-template-columns: 12ch minmax(0, 1fr); gap: 14px; align-items: baseline; }
.facts.wide .fact dd { margin: 0; }
.file-text { max-width: 68ch; color: var(--text-2); line-height: 1.75; font-size: .96em; }
.file-text p { margin: 0 0 1em; }
.file-text p:first-child::first-letter { color: var(--c); font-weight: 700; }
.danger .meter { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.bars { display: inline-flex; gap: 3px; }
.bars i, .bars button { width: 22px; height: 8px; border-radius: 1px; background: var(--line-3); }
.bars.l1 .on { background: var(--sev-1); } .bars.l2 .on { background: var(--sev-2); } .bars.l3 .on { background: var(--sev-3); } .bars.l4 .on { background: var(--sev-4); box-shadow: 0 0 8px color-mix(in oklab, var(--sev-4) 50%, transparent); }
.bars.pick button { cursor: pointer; height: 12px; }
.danger .meter b { font-size: .86em; letter-spacing: .14em; text-transform: uppercase; color: var(--text); }
.danger .meter small { color: var(--text-4); font-size: .8em; }
.protocol { margin-top: 12px; padding: 10px 14px; border-left: 2px solid var(--sev-4); background: color-mix(in oklab, var(--sev-4) 6%, var(--bg)); }
.protocol span { display: block; font-size: .7em; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--sev-4); margin-bottom: 3px; }
.protocol p { margin: 0; color: var(--text); font-size: .92em; line-height: 1.6; }
.file-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: .68em; letter-spacing: .16em; text-transform: uppercase; color: var(--text-5); }
@keyframes fade-in { to { opacity: 1; } }

/* revising a file (the master) */
.file.editing .file-sec { padding-top: 16px; }
.edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.edit-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.edit-field { display: grid; gap: 5px; min-width: 0; }
.edit-field > span { font-size: .7em; letter-spacing: .16em; text-transform: uppercase; color: var(--text-4); }
.edit-field.full { margin-top: 10px; }
.edit-field .field { width: 100%; }
.edit-field .swatch { width: 100%; height: 30px; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg-2); cursor: pointer; }
.file textarea.summary { width: 100%; min-height: 220px; resize: vertical; line-height: 1.7; }
.file .hint { margin: 8px 0 0; font-size: .82em; }
.edit-foot { justify-content: flex-end; gap: 8px; text-transform: none; letter-spacing: normal; font-size: 1em; }

/* the photo desk */
.desk { display: grid; grid-template-columns: min(320px, 70vw) minmax(150px, 1fr); gap: 18px; align-items: start; }
.desk-view { --c: var(--accent); position: relative; aspect-ratio: 1; width: 100%; border-radius: 2px; background: var(--bg-3) no-repeat; cursor: var(--cur-move, grab); touch-action: none; user-select: none; }
.desk-view.grab { cursor: var(--cur-move, grabbing); }
.desk-view .brackets { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); fill: none; stroke: var(--c); stroke-width: 1.5; overflow: visible; pointer-events: none; }
.desk-view .thirds { position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background: linear-gradient(to right, transparent calc(33.33% - .5px), rgba(255,255,255,.5) calc(33.33% - .5px) calc(33.33% + .5px), transparent calc(33.33% + .5px) calc(66.66% - .5px), rgba(255,255,255,.5) calc(66.66% - .5px) calc(66.66% + .5px), transparent calc(66.66% + .5px)),
              linear-gradient(to bottom, transparent calc(33.33% - .5px), rgba(255,255,255,.5) calc(33.33% - .5px) calc(33.33% + .5px), transparent calc(33.33% + .5px) calc(66.66% - .5px), rgba(255,255,255,.5) calc(66.66% - .5px) calc(66.66% + .5px), transparent calc(66.66% + .5px)); }
.desk-side { display: grid; gap: 10px; align-content: start; min-width: 0; }
.desk-minis { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.desk-minis .face.xl { --size: 72px; }
.desk-zoom { display: flex; align-items: center; gap: 10px; }
.desk-zoom input { flex: 1; min-width: 0; accent-color: var(--accent); }
.desk-z { min-width: 5ch; text-align: right; color: var(--text-3); font-size: .86em; }
.desk-side p { margin: 0; font-size: .84em; line-height: 1.6; }
.dialog:has(.desk) { width: min(640px, calc(100vw - 32px)); }

/* sitrep */
.district { padding: 6px 0 4px; }
.district > .rule { padding: 12px 18px 6px; }
.district > .rule small { color: var(--text-5); letter-spacing: .04em; text-transform: none; font-weight: 400; }
.place { display: grid; grid-template-columns: 16px minmax(0, 1.3fr) minmax(0, 1fr) auto 3ch; gap: 12px; align-items: center; width: 100%; padding: 7px 18px; text-align: left;
  border-left: 2px solid transparent; transition: background var(--t), border-color var(--t); }
.place:hover { background: var(--bg-1); }
.place.open { background: var(--bg-1); border-left-color: var(--k); }
.place .k { display: grid; place-items: center; opacity: .7; }
.place .k .glyph-i { width: 13px; height: 13px; }
.place.occupied .k, .place:hover .k, .place.open .k { opacity: 1; }
.place .nm b { font-weight: 600; color: var(--text); }
.place .nm span { display: block; color: var(--text-4); font-size: .82em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place .ppl { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.place .inc { display: flex; gap: 4px; }
.place .pill { padding: 0 6px; height: 18px; line-height: 16px; border: 1px solid color-mix(in oklab, var(--sev) 55%, var(--line-2)); border-radius: 9px; color: var(--sev); font-size: .72em; font-weight: 700; letter-spacing: .06em; }
.place .ref { color: var(--text-4); font-size: .76em; text-align: right; }
.place-more { display: grid; gap: 8px; padding: 4px 18px 14px 46px; color: var(--text-3); background: var(--bg-1); border-left: 2px solid var(--k); }
.place-more > .label { display: inline-flex; align-items: center; gap: 7px; color: var(--k); }
.place-more > div:not(.label):not(.chips):not(.actions):not(.place-call) { color: var(--text-2); }
.place-call { color: var(--sev); font-size: .88em; }
.place-call b { font-weight: 700; }
.district-head small { margin-left: 2px; }
.district-counts { order: 3; display: inline-flex; gap: 10px; color: var(--text-3); letter-spacing: .04em; }
.district-counts span { display: inline-flex; align-items: center; gap: 4px; }
.district-counts svg.i { width: 12px; height: 12px; }
.district-counts .live { color: var(--sev-3); }

/* scanner */
.call { border-bottom: 1px solid var(--line); padding: 12px 18px; display: grid; gap: 7px; animation: view-in .25s var(--ease); }
.call-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.call .code { font-weight: 700; color: var(--sev); min-width: 6ch; }
.call .title { font-weight: 600; color: var(--text); }
.call .when { margin-left: auto; color: var(--text-4); font-size: .84em; font-variant-numeric: tabular-nums; }
.call .state { font-size: .74em; font-weight: 700; letter-spacing: .12em; color: var(--sev); }
.call .details { color: var(--text-2); }
.call .log { padding: 0; display: grid; gap: 2px; font-size: .88em; }
.call .log div { display: grid; grid-template-columns: 7ch 14ch minmax(0, 1fr); gap: 12px; color: var(--text-3); }
.call .log div .w { color: var(--c, var(--text-4)); font-weight: 600; text-transform: uppercase; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call.closed { opacity: .62; }
.call .responders { display: flex; gap: 4px; align-items: center; }
.sev-1 { --sev: var(--sev-1); } .sev-2 { --sev: var(--sev-2); } .sev-3 { --sev: var(--sev-3); } .sev-4 { --sev: var(--sev-4); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sev-4); animation: pulse 1.2s ease-in-out infinite; }

/* control */
.panel { padding: 16px 18px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
/* tables: the rows share one set of columns (subgrid), so every row lines up whatever it holds */
.table { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) auto; column-gap: 16px; }
.table .tr { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; min-height: 42px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.table .tr > .actions { justify-content: flex-end; }
.table .tr:last-child { border-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 7px 0 3px; border-radius: var(--r); background: var(--bg-3); color: var(--c, var(--text-2)); font-size: .82em; font-weight: 600; }
.chip .face { --size: 16px; }
.linkbox { display: flex; gap: 6px; }
.linkbox input { flex: 1; }

/* menus, dialogs, toasts */
.menu { position: fixed; z-index: 120; min-width: 230px; max-width: 340px; max-height: min(480px, calc(100vh - 40px)); overflow-y: auto; padding: 4px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: 0 16px 48px rgba(0,0,0,.55); animation: pop .14s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-3px); } }
.menu .label { padding: 8px 8px 4px; display: block; }
.menu input.field { margin: 4px 0 6px; }
.menu button.item { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 30px; padding: 4px 8px; border-radius: 2px; text-align: left; color: var(--text-2); }
.menu button.item:hover, .menu button.item.hl { background: var(--bg-4); color: var(--text); }
.menu button.item.on { color: var(--accent); }
.menu button.item .grow { flex: 1; min-width: 0; }
.menu button.item small { display: block; color: var(--text-4); font-size: .8em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

.scrim { position: fixed; inset: 0; z-index: 130; background: rgba(0,0,0,.55); display: grid; place-items: center; animation: fade .16s; }
@keyframes fade { from { opacity: 0; } }
.dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 64px); display: flex; flex-direction: column; background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 4px; box-shadow: 0 24px 80px rgba(0,0,0,.6); animation: pop .18s var(--ease); }
.dialog > header { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--line); }
.dialog > header h3 { margin: 0; font-size: .92em; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.dialog > header .icon-btn { margin-left: auto; }
.dialog > .body { overflow-y: auto; padding: 14px 16px; display: grid; gap: 14px; }
.dialog > footer { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); }
.setting { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.setting b { display: block; font-weight: 500; }
.setting small { display: block; color: var(--text-4); font-size: .84em; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.seg button { height: 26px; padding: 0 10px; color: var(--text-3); font-size: .86em; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--bg-4); color: var(--text); }
.switch { width: 32px; height: 18px; border-radius: 9px; background: var(--bg-4); position: relative; transition: background var(--t); border: 1px solid var(--line-2); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--text-3); transition: transform var(--t), background var(--t); }
.switch.on { background: var(--a-30); border-color: var(--a-50); }
.switch.on::after { transform: translateX(14px); background: var(--accent); }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; max-height: 300px; overflow-y: auto; }
.pick button { display: flex; align-items: center; gap: 8px; padding: 5px; border: 1px solid var(--line); border-radius: var(--r); text-align: left; color: var(--text-2); }
.pick button.on { border-color: var(--a-50); background: var(--a-05); color: var(--text); }
.pick button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9em; }

.toasts { position: fixed; z-index: 160; right: 14px; bottom: 40px; display: grid; gap: 8px; width: min(360px, calc(100vw - 28px)); }
.toast { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 22px; gap: 10px; align-items: start; padding: 10px 8px 12px 14px; overflow: hidden;
  background: color-mix(in oklab, var(--bg-2) 94%, var(--tc, var(--accent))); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: 0 14px 40px rgba(0,0,0,.5);
  animation: toast-in .24s var(--ease); cursor: var(--cur-pointer, pointer); }
.toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--tc, var(--accent)); box-shadow: 0 0 10px var(--tc, var(--accent)); }
.toast::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; transform-origin: left; background: color-mix(in oklab, var(--tc, var(--accent)) 55%, transparent);
  animation: toast-time var(--ttl, 6s) linear forwards; }
.toast > .icon-btn { width: 22px; height: 22px; margin-top: -2px; justify-self: end; color: var(--text-4); }
.toast > .icon-btn:hover { color: var(--text); background: var(--bg-4); }
.toast > .icon-btn svg.i { width: 13px; height: 13px; }
.toast.out { animation: toast-out .2s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(14px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(14px); } }
@keyframes toast-time { to { transform: scaleX(0); } }
.toast b { display: block; font-weight: 600; font-size: .8em; color: var(--tc, var(--text)); text-transform: uppercase; letter-spacing: .14em; }
.toast .t-text { display: -webkit-box; margin-top: 2px; color: var(--text-2); font-size: .92em; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.update-bar { position: fixed; z-index: 170; left: 50%; top: 10px; transform: translateX(-50%); padding: 6px 12px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r); font-size: .86em; color: var(--text-2); display: flex; gap: 10px; align-items: center; animation: pop .2s var(--ease); }

/* --- overlay (HUD) mode: a compact, translucent panel over the game ----------------------------- */

:root[data-mode="overlay"] body { background: transparent; }
:root[data-mode="overlay"] .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); background: color-mix(in srgb, var(--bg) calc(var(--hud, .86) * 100%), transparent);
  border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; inset: 0; }
:root[data-mode="overlay"] .rail, :root[data-mode="overlay"] .status { display: none; }
:root[data-mode="overlay"] .hud-head { display: flex; }
:root[data-mode="overlay"] .main { display: flex; flex-direction: column; }
:root[data-mode="overlay"] .view-head { display: none; }
:root[data-mode="overlay"] .row { grid-template-columns: 8ch 10ch minmax(0, 1fr); column-gap: 8px; padding: 1px 10px; }
.row .t { white-space: nowrap; }
:root[data-mode="overlay"] .row .acts { display: none !important; }
:root[data-mode="overlay"] .row .who .who-em { display: none; }           /* the HUD is narrow: names first */
:root[data-mode="overlay"] .composer { padding: 8px 10px 9px; }
:root[data-mode="overlay"] .hints { display: none; }
:root[data-mode="overlay"] .toasts { right: 8px; left: 8px; width: auto; bottom: 64px; }
:root[data-mode="overlay"] .typing { padding: 0 10px; }
.hud-head { display: none; flex: none; flex-direction: column; border-bottom: 1px solid var(--line-2); user-select: none; -webkit-user-select: none; cursor: grab; }
.hud-row { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 6px 0 4px; }
.hud-grip { flex: none; display: grid; grid-template-columns: repeat(2, 3px); gap: 3px; padding: 6px 5px; border-radius: var(--r); cursor: var(--cur-move, grab); }
.hud-grip i { width: 3px; height: 3px; border-radius: 50%; background: var(--text-4); }
.hud-grip:hover { background: var(--bg-3); }
.hud-grip:hover i { background: var(--accent); }
.hud-row .grow { min-width: 12px; cursor: var(--cur-move, grab); }
.hud-tabs button { height: 22px; padding: 0 7px; font-size: .64em; letter-spacing: .12em; text-transform: uppercase; }
.hud-strip { display: flex; gap: 4px; padding: 0 8px 7px; overflow-x: auto; scrollbar-width: none; cursor: default; }
.hud-strip::-webkit-scrollbar { display: none; }
.hud-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 24px; max-width: 150px; padding: 0 8px 0 6px; border: 1px solid var(--line-2); border-radius: 12px;
  color: var(--text-3); font-size: .78em; transition: border-color var(--t), color var(--t), background var(--t); }
.hud-chip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-chip .sig { color: var(--text-4); }
.hud-chip:hover { color: var(--text); border-color: var(--line-3); }
.hud-chip.on { color: var(--text); border-color: color-mix(in oklab, var(--accent) 55%, var(--line-2)); background: var(--a-10); }
.hud-chip.unread { color: var(--text); }
.hud-chip .count { min-width: 16px; height: 16px; line-height: 16px; font-size: .78em; }
.hud-chip.more { padding: 0 9px; color: var(--text-4); letter-spacing: .1em; }
.main.hud-city-on > .view { display: none !important; }
.hud-city { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 6px; padding: 10px 12px 14px; }
.hud-city > .rule { margin-top: 6px; }
.hud-city > .btn { justify-self: start; margin-top: 8px; }
.hud-person { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: .84em; }
.hud-person b { color: var(--c); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: .9em; }
.hud-person span { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-person time { color: var(--text-5); font-size: .82em; }
.hud-call { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; padding: 6px 8px; border-left: 2px solid var(--sev); background: var(--bg-1); font-size: .84em; }
.hud-call b { color: var(--sev); }
.hud-call small { grid-column: 2; color: var(--text-4); }
.hud-call .chips { grid-row: 1 / span 2; grid-column: 3; }
/* the HUD at any size: narrow windows shed what they can do without */
@media (max-width: 380px) {
  :root[data-mode="overlay"] .row { grid-template-columns: 0 9ch minmax(0, 1fr); column-gap: 8px; }
  :root[data-mode="overlay"] .row .t { visibility: hidden; }
  :root[data-mode="overlay"] .prompt-tools .seal-btn, :root[data-mode="overlay"] .prompt-tools .emo-open { display: none; }
  :root[data-mode="overlay"] .prompt .ps1 { display: none; }
  :root[data-mode="overlay"] .hud-who b { display: none; }
}
@media (max-width: 300px) {
  :root[data-mode="overlay"] .row { grid-template-columns: minmax(0, 1fr); }
  :root[data-mode="overlay"] .row .who { text-align: left; }
  :root[data-mode="overlay"] .hud-tabs { display: none; }
}
.hud-head .hud-who, .hud-head .hud-chan { display: flex; align-items: center; gap: 6px; height: 24px; padding: 0 6px; border-radius: var(--r); min-width: 0; cursor: pointer; }
.hud-head .hud-who:hover, .hud-head .hud-chan:hover { background: var(--bg-3); }
.hud-head .hud-who b { color: var(--accent); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .88em; }
.hud-head .hud-chan { color: var(--text-2); font-size: .88em; overflow: hidden; }
.hud-head .hud-chan span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-head .grow { flex: 1; height: 100%; }
.hud-head .tag { cursor: pointer; }

.tag.admin { color: var(--accent); border-color: var(--a-30); }
/* touch screens have no keyboard shortcuts to hint at */
@media (hover: none) and (pointer: coarse) { .hints, .nav kbd, .search-box kbd, .file-bar kbd { display: none !important; } }

.menu-btn { display: none !important; }      /* shown again on narrow windows, below (so this must come first) */

/* --- narrow windows ------------------------------------------------------------------------------------- */

@media (max-width: 760px) {
  :root:not([data-mode="overlay"]) .app { grid-template-columns: minmax(0, 1fr); }
  :root:not([data-mode="overlay"]) .rail { position: fixed; inset: 0 auto 26px 0; width: 252px; z-index: 50; transform: translateX(-100%); transition: transform .2s var(--ease); }
  :root:not([data-mode="overlay"]) .app.rail-open .rail { transform: none; box-shadow: 24px 0 60px rgba(0,0,0,.6); }
  .menu-btn { display: grid !important; }
  .status .st-clock, .status .st-on { display: none; }
  .status { overflow-x: auto; scrollbar-width: none; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split > .file-pane { display: none; }
  .split.detail > .view-body { display: none; }
  .split.detail > .file-pane { display: block; }
  .file { padding: 0 16px 24px; }
  .file-bar { margin: 0 -16px; padding: 0 12px 0 6px; }
  .file-bar .back { display: grid; }
  .file-bar > span:nth-of-type(2) { display: none; }
  .file-id { grid-template-columns: 112px minmax(0, 1fr); gap: 16px; padding-top: 18px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts.wide .fact { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .edit-grid, .edit-grid.three { grid-template-columns: minmax(0, 1fr); }
  .desk { grid-template-columns: minmax(0, 1fr); }
  .search-box .field.search { width: 38vw; }
  .search-box kbd { display: none; }
  .row { grid-template-columns: 5ch 10ch minmax(0, 1fr); column-gap: 8px; padding: 1px 12px; }
  .place { grid-template-columns: 16px minmax(0, 1fr) auto; }
  .place .inc { display: none; }
}

@media (prefers-reduced-motion: reduce) { :root { --t: 0s; } * { animation-duration: .01ms !important; } }
:root[data-motion="off"] * { animation-duration: .01ms !important; }

/* resizable panels: a hairline that lights up in the accent when you take it */
.resizer { position: absolute; z-index: 20; top: 0; bottom: 0; width: 7px; margin-left: -3px; cursor: var(--cur-col, col-resize); touch-action: none; }
.resizer::after { content: ""; position: absolute; left: 3px; top: 0; bottom: 0; width: 1px; background: transparent; transition: background var(--t), box-shadow var(--t); }
.resizer:hover::after, .resizer.on::after { background: var(--a-50); box-shadow: 0 0 8px var(--a-30); }
.app > .resizer { left: var(--rail-w, 252px); bottom: 26px; }
.split > .resizer { left: var(--index-w, clamp(270px, 25vw, 400px)); }
@media (max-width: 760px) { .resizer { display: none; } }
:root[data-mode="overlay"] .resizer { display: none; }

/* the lock: a satellite lock to get back in */
.lock { --c: var(--accent); position: fixed; inset: 0; z-index: 190; display: grid; grid-template-rows: auto 1fr auto; padding: 18px 22px;
  background: radial-gradient(ellipse at 50% 45%, color-mix(in oklab, var(--c) 6%, var(--bg)) 0%, var(--bg) 62%); animation: fade .25s var(--ease); }
.lock.verified .lock-note { color: var(--c); text-shadow: 0 0 12px color-mix(in oklab, var(--c) 60%, transparent); }
.lock.verified .lock-scope { filter: drop-shadow(0 0 18px color-mix(in oklab, var(--c) 45%, transparent)); transition: filter .4s; }
.lock.miss .lock-scope { animation: lock-miss .32s; }
.lock-head, .lock-foot { display: flex; align-items: center; justify-content: space-between; }
.lock-head .label { color: var(--text-4); }
.lock-foot { justify-content: center; }
.lock-body { display: grid; justify-items: center; align-content: center; gap: 14px; min-height: 0; }
.lock-id { display: flex; align-items: center; gap: 14px; }
.lock-id svg.em { width: 56px; height: 56px; fill: var(--c); filter: drop-shadow(0 0 10px color-mix(in oklab, var(--c) 40%, transparent)); }
.lock-id .lock-ini { display: grid; place-items: center; width: 56px; height: 56px; border: 1px solid color-mix(in oklab, var(--c) 50%, transparent); color: var(--c); font-size: 1.3em; letter-spacing: .06em; }
.lock-id b { display: block; font-size: 1.3em; font-weight: 800; letter-spacing: .16em; color: var(--c); }
.lock-id span { color: var(--text-4); font-size: .82em; letter-spacing: .14em; text-transform: uppercase; }
.lock-scope { width: min(300px, 70vw, 42vh); aspect-ratio: 1; cursor: var(--cur-pointer, pointer); touch-action: manipulation; border-radius: 50%; }
.lock-pips { display: flex; gap: 6px; }
.lock-pips i { width: 26px; height: 4px; border-radius: 1px; background: var(--line-3); transition: background var(--t), box-shadow var(--t); }
.lock-pips i.on { background: var(--c); box-shadow: 0 0 8px color-mix(in oklab, var(--c) 60%, transparent); }
.lock-note { min-height: 1.4em; color: var(--text-3); font-size: .84em; letter-spacing: .12em; text-transform: uppercase; }
.lock-hold { position: relative; overflow: hidden; }
.lock-hold::before { content: ""; position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: color-mix(in oklab, var(--c) 30%, transparent); }
.lock-hold.holding::before { transform: scaleX(1); transition: transform 2s linear; }
@keyframes lock-miss { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
:root[data-mode="overlay"] .lock { padding: 10px; } :root[data-mode="overlay"] .lock-scope { width: min(220px, 60vw); }

/* an emblem's dim layer (Robin's badge): a faint fill and a crisp ring, so the mark itself reads first */
svg.em path.dim { fill-opacity: .2; stroke: var(--c, var(--accent)); stroke-width: 1.2; }
.boot-id svg.em path.dim { stroke: var(--accent); }

/* emoji, monochrome by default so they sit with the terminal (Settings › Emoji) */
:root:not([data-emoji="colour"]) .emo { filter: grayscale(1) contrast(1.15) brightness(1.05); opacity: .9; }
.emo { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: 1.05em; line-height: 1; vertical-align: -0.08em; }

/* the system you're on shows in its mark: Brother Eye's bat, a phone's plain badge, a burner's nothing */
:root[data-tier="civilian"] .brand-row img, :root[data-tier="underworld"] .brand-row img { display: none; }
:root[data-tier="civilian"] .brand-row::before { content: "W"; display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--line-3); border-radius: 4px; font-size: .72em; font-weight: 800; color: var(--accent); }
:root[data-tier="underworld"] .brand-row::before { content: "//"; color: var(--accent); font-weight: 800; letter-spacing: -.05em; }
:root[data-tier="underworld"] { --bg: #070607; --bg-1: #0b0a0b; --bg-2: #100e0f; }
.boot-id .mark.civilian .face { --size: 72px; border-radius: 50%; }

/* --- calls: one panel, three sizes, dragged by its header ---------------------------------------- */
.call-dock { --c: var(--accent); position: fixed; z-index: 150; right: 14px; bottom: 40px; width: min(360px, calc(100vw - 28px));
  background: color-mix(in oklab, var(--bg-1) 95%, var(--c)); border: 1px solid var(--line-2); border-radius: var(--r);
  box-shadow: 0 18px 50px rgba(0,0,0,.55); animation: toast-in .24s var(--ease); overflow: hidden; }
.call-dock::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--c); box-shadow: 0 0 10px var(--c); }
.call-dock[hidden] { display: none; }
.call-dock.pill { width: auto; min-width: 250px; }
.call-dock.dragging { opacity: .92; box-shadow: 0 24px 70px rgba(0,0,0,.65); }
.call-panel { display: grid; gap: 10px; padding: 10px 10px 10px 14px; }
.call-head { display: flex; align-items: center; gap: 8px; min-width: 0; cursor: var(--cur-move, grab); user-select: none; }
.call-dock.dragging .call-head { cursor: var(--cur-move, grabbing); }
.call-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .9em; }
.call-head .icon-btn { width: 22px; height: 22px; margin: -2px -2px -2px 0; }
.call-head .icon-btn svg.i { width: 13px; height: 13px; }
.call-label { font-size: .68em; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--c); white-space: nowrap; }
.call-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--idle); }
.call-dot.live { background: var(--online); box-shadow: 0 0 8px var(--online); animation: blink 1.8s steps(1) infinite; }
.call-dot.wait { animation: blink .8s steps(1) infinite; }
.call-time { color: var(--text-3); font-size: .82em; font-variant-numeric: tabular-nums; letter-spacing: .04em; white-space: nowrap; }
.call-time.dots::after { content: ""; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.call-rows { display: grid; gap: 2px; }
.call-member { display: grid; grid-template-columns: 28px minmax(0, 1fr) 88px; align-items: center; gap: 10px; padding: 5px 4px; border-radius: 2px; animation: rise .3s var(--ease) both; }
.call-member .face.md { --size: 28px; border-radius: 50%; }
.call-id { display: grid; min-width: 0; line-height: 1.25; }
.call-id b { font-size: .8em; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--c); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-id small { font-size: .66em; letter-spacing: .14em; text-transform: uppercase; color: var(--text-4); }
.call-member.live .call-id small, .call-member.you .call-id small { color: var(--online); }
.call-member.reconnecting .call-id small, .call-member.retrying .call-id small, .call-member.listening .call-id small { color: var(--idle); }
.call-member.muted .call-id small { color: var(--dnd); }
.call-member { --level: 0; }
.call-member .face.md { box-shadow: 0 0 0 1px color-mix(in oklab, var(--c) 55%, transparent), 0 0 calc(var(--level) * 16px) color-mix(in oklab, var(--c) 65%, transparent); transition: box-shadow .08s linear; }
.call-member .viz.bars { width: 88px; height: 12px; }
.call-btns { display: flex; align-items: center; gap: 6px; }
.call-btns .grow { flex: 1; }
.call-key { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 30px; min-width: 30px; padding: 0 8px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text-2); font-size: .82em; letter-spacing: .06em; transition: background var(--t), color var(--t), border-color var(--t); }
.call-key:hover { background: var(--bg-4); color: var(--text); border-color: var(--line-3); }
.call-key svg.i { width: 15px; height: 15px; }
.call-key.on { background: color-mix(in oklab, var(--dnd) 16%, var(--bg-2)); color: var(--dnd); border-color: color-mix(in oklab, var(--dnd) 40%, transparent); }
.call-key.leave { color: var(--danger); border-color: color-mix(in oklab, var(--danger) 40%, transparent); background: color-mix(in oklab, var(--danger) 10%, var(--bg-2)); }
.call-key.leave:hover { background: var(--danger); color: var(--ink); }
.call-key.answer { color: var(--online); border-color: color-mix(in oklab, var(--online) 45%, transparent); background: color-mix(in oklab, var(--online) 12%, var(--bg-2)); animation: call-nudge 1.4s ease-in-out infinite; }
.call-key.answer:hover { background: var(--online); color: var(--ink); }
.call-key.wide { padding: 0 12px; text-transform: uppercase; font-weight: 600; letter-spacing: .12em; font-size: .74em; }
.call-dock.pill .call-panel { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 8px 7px 12px; }
.call-dock.pill .call-head .call-label { display: none; }
.call-ringing { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; }
.call-who { position: relative; width: 50px; height: 50px; display: grid; place-items: center; }
.call-who .face.lg { --size: 44px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--c); }
.call-pulse { position: absolute; inset: 3px; border-radius: 50%; border: 1.5px solid var(--c); animation: call-pulse 1.6s ease-out infinite; pointer-events: none; }
.call-pulse.two { animation-delay: .8s; }
.call-text { min-width: 0; display: grid; gap: 1px; }
.call-text b { font-size: 1.12em; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--c); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-join { color: var(--online); border-color: color-mix(in oklab, var(--online) 45%, transparent); animation: call-nudge 1.6s ease-in-out infinite; }
@keyframes call-pulse { from { transform: scale(1); opacity: .9; } to { transform: scale(1.7); opacity: 0; } }
@keyframes call-nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.5px); } }
:root[data-mode="overlay"] .call-dock { left: 8px !important; right: 8px !important; top: auto !important; bottom: 8px; width: auto; }

/* call lines in the chat: what happened, at a glance */
.row.sys.call-ended .who, .row.sys.call-ended .body { color: var(--text-3); }
.row.sys.call-missed .who, .row.sys.call-missed .body { color: var(--danger); font-style: normal; }
.row.sys.call-declined .who, .row.sys.call-declined .body { color: var(--idle); font-style: normal; }
.row.sys .who svg.i { width: 13px; height: 13px; vertical-align: -2px; }

/* chats: pinned and muted flags, the ⋯ that appears on hover */
.chan .flag { display: inline-grid; color: var(--text-4); flex: none; }
.chan .flag svg.i { width: 11px; height: 11px; }
.chan.muted .nm { color: var(--text-4); }
.chan .more { display: none; margin-left: 2px; padding: 0 4px; border-radius: 2px; color: var(--text-4); font-weight: 700; letter-spacing: .05em; flex: none; }
.chan:hover .more, .chan:focus-visible .more { display: inline-block; }
.chan:hover .count { display: none; }
.chan .more:hover { color: var(--text); background: var(--bg-4); }
.more-glyph { font-weight: 800; letter-spacing: .06em; line-height: 1; }

/* the full-screen call: over the main view (the rail stays), a ring per person with room to breathe */
.call-dock.stage { left: var(--rail-w, 252px); top: 0; right: 0; bottom: 26px; width: auto; border: 0; border-left: 1px solid var(--line); border-radius: 0;
  box-shadow: none; animation: fade .25s var(--ease);
  background: radial-gradient(ellipse at 50% 42%, color-mix(in oklab, var(--c) 9%, var(--bg)) 0%, var(--bg) 70%),
              var(--bg); }
.call-dock.stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.035) 1px, transparent 1px); background-size: 22px 22px; }
.call-dock.stage .call-panel { position: relative; z-index: 1; height: 100%; grid-template-rows: auto minmax(0, 1fr) auto; padding: 14px 22px 22px 26px; gap: 0; }
.call-dock.stage .call-head { cursor: default; height: 32px; }
.call-dock.stage .call-head b { font-size: 1em; }
.call-stage { display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 28px 44px; overflow-y: auto; padding: 12px 0; }
.call-stage .call-member { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 8px; padding: 0; animation: rise .4s var(--ease) both; }
.call-stage .call-id { justify-items: center; }
.call-stage .call-id b { font-size: 1.05em; letter-spacing: .14em; }
.call-stage .call-id small { font-size: .72em; }
.call-face { --level: 0; position: relative; width: clamp(150px, 16vw, 210px); aspect-ratio: 1; display: grid; place-items: center; }
.call-face .viz.ring { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.call-face .face.lg { --size: 55%; width: 55%; height: 55%; border-radius: 50%; font-size: 2em;
  box-shadow: 0 0 0 2px var(--c), 0 0 calc(var(--level) * 34px) color-mix(in oklab, var(--c) 70%, transparent); transition: box-shadow .08s linear; }
.call-dock.stage .call-btns { justify-content: center; gap: 10px; }
.call-dock.stage .call-key { height: 38px; min-width: 38px; }
.call-dock.stage .call-key.wide { padding: 0 18px; }
@media (max-width: 760px) { .call-dock.stage { left: 0; } .call-face { width: 128px; } }
:root[data-mode="overlay"] .call-dock.stage { inset: 0 !important; width: auto; }

/* --- the map: a tactical display in the colour of whoever you're playing ------------------------------ */
.view-body.map-mode { overflow: hidden; display: flex; }
.map { position: relative; flex: 1; min-height: 0; overflow: hidden;
  background: radial-gradient(ellipse at 50% 45%, color-mix(in oklab, var(--accent) 5%, transparent), transparent 75%), var(--bg); }
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; cursor: var(--cur-move, grab); touch-action: none; }
.map-svg.panning { cursor: var(--cur-move, grabbing); }
.map-svg.dropping { cursor: crosshair; }
/* the grid: 100-unit squares, lettered across and numbered down */
.map-grid line { stroke: color-mix(in oklab, var(--accent) 5%, transparent); stroke-width: .5; vector-effect: non-scaling-stroke; }
.map-grid line.major { stroke: color-mix(in oklab, var(--accent) 10%, transparent); }
.map-grid .frame { fill: none; stroke: color-mix(in oklab, var(--accent) 24%, transparent); stroke-width: .75; vector-effect: non-scaling-stroke; }
.map-grid .corner { fill: none; stroke: color-mix(in oklab, var(--accent) 80%, transparent); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.map-grid .ref { font: 600 9px var(--font); letter-spacing: .14em; fill: color-mix(in oklab, var(--accent) 45%, var(--text-4)); text-anchor: middle; }
.map-grid .ref.row { text-anchor: end; }
.map-places.intro > g, .map-edge.intro > g { animation: mark-in .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 16ms); }
@keyframes mark-in { from { opacity: 0; } }
/* the city */
.map-base .block { fill: color-mix(in oklab, var(--accent) 6%, var(--bg)); stroke: color-mix(in oklab, var(--accent) 52%, transparent); stroke-width: .8; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.map-base .inner { fill: none; stroke: color-mix(in oklab, var(--accent) 17%, transparent); stroke-width: .6; vector-effect: non-scaling-stroke; }
.map-base .park { fill: url(#map-hatch); stroke: color-mix(in oklab, var(--accent) 26%, transparent); stroke-width: .6; vector-effect: non-scaling-stroke; }
.map-base .plaza { fill: url(#map-dots); fill-rule: evenodd; }
.map-base .rail { fill: none; stroke: color-mix(in oklab, var(--accent) 42%, transparent); stroke-width: .7; vector-effect: non-scaling-stroke; }
.map-base .rail-ties { fill: none; stroke: color-mix(in oklab, var(--accent) 34%, transparent); stroke-width: 4.5; stroke-dasharray: .9 3.6; vector-effect: non-scaling-stroke; }
#map-hatch .hatch { stroke: color-mix(in oklab, var(--accent) 17%, transparent); stroke-width: .7; }
#map-dots .dot { fill: color-mix(in oklab, var(--accent) 24%, transparent); }
.map-base, .map-grid { animation: map-in .9s var(--ease) both; }
@keyframes map-in { from { opacity: 0; } }
/* places */
.map-mark, .map-pin, .map-off { cursor: var(--cur-pointer, pointer); outline: none; }
.map-mark .disc { fill: var(--bg); stroke: var(--k); stroke-width: 1.2; }
.map-mark.occupied .disc { stroke-width: 1.9; }
.map-mark .glyph { fill: var(--k); transform: scale(.74); }
.map-mark.sel .disc { fill: var(--k); } .map-mark.sel .glyph { fill: var(--bg); }
.map-mark .brackets, .map-pin .brackets { fill: none; stroke: var(--k); stroke-width: 1.2; opacity: 0; transform: scale(1.4); transition: opacity var(--t), transform var(--t); }
.map-mark:hover .brackets, .map-mark:focus-visible .brackets, .map-mark.sel .brackets,
.map-pin:hover .brackets, .map-pin:focus-visible .brackets, .map-pin.sel .brackets { opacity: 1; transform: none; }
.map-label { font: 600 9px var(--font); letter-spacing: .1em; text-transform: uppercase; fill: var(--text-2); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; opacity: 0; transition: opacity var(--t); pointer-events: none; }
.map-svg[data-zoom="mid"] .map-mark.occupied .map-label, .map-svg[data-zoom="near"] .map-label,
.map-mark:hover .map-label, .map-mark:focus-visible .map-label, .map-mark.sel .map-label { opacity: 1; }
.map-mark .map-label.hidden { opacity: 0; }
.map-mark:hover .map-label.hidden, .map-mark.sel .map-label.hidden { opacity: 1; }
.map-mark.sel .map-label { fill: var(--text); }
.map-mark .locate { fill: none; stroke: var(--k); stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: center; animation: map-ping 1.1s .65s ease-out 3; }
/* calls */
.map-call { pointer-events: none; }
.map-call .pulse { fill: none; stroke: var(--sev); stroke-width: 1.4; transform-box: fill-box; transform-origin: center; animation: map-ping 1.8s ease-out infinite; }
.map-call .pulse.two { animation-delay: .9s; }
.map-call .edge { fill: color-mix(in oklab, var(--sev) 10%, transparent); stroke: var(--sev); stroke-width: 1.1; stroke-dasharray: 3 2.2; transform-box: fill-box; transform-origin: center; animation: map-spin 14s linear infinite; }
.map-call .map-code { font: 700 8.5px var(--font); letter-spacing: .12em; fill: var(--sev); text-anchor: middle; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; }
@keyframes map-ping { from { transform: scale(.8); opacity: .9; } to { transform: scale(2.1); opacity: 0; } }
@keyframes map-spin { to { transform: rotate(360deg); } }
/* markers people drop */
.map-pin .pole { stroke: var(--k); stroke-width: 1.2; }
.map-pin .flag { fill: var(--k); }
.map-pin .foot { fill: var(--bg); stroke: var(--k); stroke-width: 1.2; }
.pin-label { font: 600 8.5px var(--font); letter-spacing: .1em; text-transform: uppercase; fill: var(--k); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
/* people */
.map-person-at { pointer-events: none; }
.map-person-at .face-bg { fill-opacity: .22; }
.map-person-at .face-ring { fill: none; stroke-width: 1.5; pointer-events: auto; }
.map-person-at .tether { fill: none; stroke-width: 1; stroke-dasharray: 1.5 1.5; opacity: .7; }
.map-person-at .you-ring { fill: none; stroke-width: 1.3; transform-box: fill-box; transform-origin: center; animation: map-ping 2.2s ease-out infinite; }
.person-tag { font: 700 8px var(--font); letter-spacing: .12em; text-transform: uppercase; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; }
.map-more { font: 700 8.5px var(--font); fill: var(--text-2); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.map-trails .trail { fill: none; stroke-width: 1.2; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; animation: map-trail 6s ease-out forwards; }
@keyframes map-trail { from { opacity: .9; stroke-dashoffset: 0; } to { opacity: 0; stroke-dashoffset: -80; } }
/* off the map, at its edges */
.off-label { font: 600 8.5px var(--font); letter-spacing: .14em; text-transform: uppercase; text-anchor: middle; fill: color-mix(in oklab, var(--k) 55%, var(--text-4)); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; transition: fill var(--t); }
.map-off:hover .off-label, .map-off:focus-visible .off-label, .map-off.sel .off-label { fill: var(--k); }
.map-off.crowded { opacity: 0; pointer-events: none; }
/* the controls over it */
.map-tools { position: absolute; left: 12px; right: 12px; top: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; pointer-events: none; }
.map-tabs, .map-zoom { display: flex; gap: 4px; pointer-events: auto; }
.map-tab { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 8px 0 10px; border: 1px solid var(--line-2); border-radius: 2px; background: color-mix(in oklab, var(--bg-1) 90%, transparent); backdrop-filter: blur(6px);
  color: var(--text-3); font-size: .7em; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; transition: color var(--t), border-color var(--t); }
.map-tab:hover { color: var(--text-2); }
.map-tab b { color: var(--accent); font-weight: 700; letter-spacing: .04em; }
.map-tab { white-space: nowrap; }
.map-tab svg.i { width: 12px; height: 12px; color: var(--text-4); transition: transform var(--t); }
.map-tab.on { color: var(--text); border-color: color-mix(in oklab, var(--accent) 45%, var(--line-2)); }
.map-tab.on svg.i { transform: rotate(180deg); }
.map-zoom .icon-btn { width: 28px; height: 28px; border: 1px solid var(--line-2); border-radius: 2px; background: color-mix(in oklab, var(--bg-1) 90%, transparent); backdrop-filter: blur(6px); }
.map-zoom .icon-btn svg.i { width: 14px; height: 14px; }
.map-zoom .icon-btn.on { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.map-panel, .map-card { position: absolute; top: 48px; display: grid; border: 1px solid var(--line-2); border-radius: 2px; background: color-mix(in oklab, var(--bg-1) 94%, transparent);
  backdrop-filter: blur(8px); box-shadow: 0 16px 40px rgba(0,0,0,.5); animation: toast-in .18s var(--ease); }
.map-panel { left: 12px; width: 252px; max-height: calc(100% - 96px); overflow: auto; gap: 1px; padding: 10px 8px; }
.map-panel[hidden], .map-card[hidden] { display: none; }
.map-panel > .label { margin: 8px 6px 4px; }
.map-panel > .label:first-child { margin-top: 0; }
.map-layer { display: grid; grid-template-columns: 14px 1fr auto 10px; align-items: center; gap: 10px; height: 27px; padding: 0 6px; border-radius: 2px; color: var(--text-4); font-size: .8em; text-align: left; }
.map-layer:hover { background: var(--bg-3); color: var(--text-2); }
.map-layer.on { color: var(--text-2); }
.map-layer small { color: var(--text-4); font-size: .9em; }
.map-layer .box { width: 10px; height: 10px; border: 1px solid var(--line-3); border-radius: 1px; transition: background var(--t), border-color var(--t); }
.map-layer.on .box { background: var(--k); border-color: var(--k); box-shadow: 0 0 6px color-mix(in oklab, var(--k) 60%, transparent); }
.map-layer .glyph-i { opacity: .4; } .map-layer.on .glyph-i { opacity: 1; }
.glyph-i { width: 12px; height: 12px; flex: none; overflow: visible; }
.glyph-i path { fill: var(--k, currentColor); }
.map-person { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px; border-radius: 2px; text-align: left; }
.map-person:hover:not(:disabled), .map-person.on { background: var(--bg-3); }
.map-person:disabled { opacity: .55; cursor: default; }
.map-person .nm { display: grid; min-width: 0; }
.map-person .nm b { color: var(--c); font-size: .84em; font-weight: 600; letter-spacing: .04em; }
.map-person .nm small { color: var(--text-3); font-size: .76em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-person time { color: var(--text-4); font-size: .7em; white-space: nowrap; }
.map-note { margin: 8px 6px 2px; color: var(--text-4); font-size: .74em; line-height: 1.5; }
.map-note b { color: var(--text-3); font-weight: 600; }
.map-card { right: 12px; width: min(300px, calc(100% - 24px)); gap: 8px; padding: 12px 12px 12px 14px; }
.map-card::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 2px; background: var(--k, var(--accent)); box-shadow: 0 0 10px var(--k, var(--accent)); }
.map-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.map-card-head .label { display: inline-flex; align-items: center; gap: 7px; color: var(--k); }
.map-card-name { font-size: 1.05em; letter-spacing: .04em; }
.map-card-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; color: var(--text-4); font-size: .78em; }
.map-card p { margin: 0; color: var(--text-2); font-size: .88em; line-height: 1.55; }
.map-card-call { font-size: .84em; color: var(--sev-4); }
.map-readout { position: absolute; left: 14px; bottom: 10px; color: var(--text-4); font-size: .68em; letter-spacing: .12em; white-space: pre; pointer-events: none; }
.map-hint { position: absolute; left: 50%; top: 48px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 8px 0 10px; white-space: nowrap;
  border: 1px solid color-mix(in oklab, var(--accent) 45%, var(--line-2)); border-radius: 2px; background: color-mix(in oklab, var(--bg-1) 94%, transparent); color: var(--text-2); font-size: .76em; pointer-events: none; }
.map-hint[hidden] { display: none; }
.map-hint svg.i { width: 13px; height: 13px; color: var(--accent); }
.map-pop { position: absolute; z-index: 3; width: 260px; display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line-2); border-radius: 2px; background: var(--bg-1); box-shadow: 0 16px 40px rgba(0,0,0,.55); animation: toast-in .16s var(--ease); }
.map-pop[hidden] { display: none; }
.map-pop .label { display: inline-flex; align-items: center; gap: 7px; }
.map-pop input { width: 100%; height: 30px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 2px; background: var(--bg); color: var(--text); font: inherit; font-size: .86em; }
.map-pop input:focus { outline: none; border-color: color-mix(in oklab, var(--accent) 60%, var(--line-2)); }
@media (max-width: 760px) {
  .map-tab { padding: 0 6px 0 8px; letter-spacing: .08em; }
  .map-tab .long { display: none; }
  .map-card { top: auto; bottom: 34px; left: 8px; right: 8px; width: auto; }
  .map-panel { width: calc(100% - 24px); }
}

/* --- a person's card, and the tips that name things on hover ------------------------------------------- */
.tip { position: fixed; z-index: 400; max-width: 260px; padding: 4px 8px; border: 1px solid var(--line-2); border-radius: 2px; background: var(--bg-1); color: var(--text-2);
  font-size: .74em; letter-spacing: .04em; pointer-events: none; box-shadow: 0 8px 24px rgba(0,0,0,.45); animation: tip-in .12s var(--ease); }
@keyframes tip-in { from { opacity: 0; transform: translateY(-2px); } }
.face-btn { display: inline-grid; border-radius: 50%; transition: transform var(--t); }
.face-btn:hover { transform: translateY(-1px); }
.face-btn:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.title-btn { color: inherit; font: inherit; letter-spacing: inherit; }
.title-btn:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.menu .pcard { position: relative; display: grid; gap: 10px; width: 260px; padding: 10px 10px 8px 12px; }
.menu .pcard::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px; background: var(--c); box-shadow: 0 0 10px var(--c); }
.pcard-head { display: flex; align-items: center; gap: 12px; }
.pcard-id { display: grid; gap: 1px; min-width: 0; }
.pcard-id b { color: var(--c); font-size: 1.02em; letter-spacing: .06em; text-transform: uppercase; }
.pcard-id > span { color: var(--text-3); font-size: .84em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-id .pcard-mode { display: inline-flex; align-items: center; gap: 6px; color: var(--text-4); font-size: .76em; }
.pcard-mode i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-5); }
.pcard-mode.online i { background: var(--online); box-shadow: 0 0 6px var(--online); } .pcard-mode.idle i { background: var(--idle); } .pcard-mode.dnd i { background: var(--dnd); }
.pcard-lines { display: grid; gap: 4px; }
.pcard-line { display: grid; grid-template-columns: 11ch 1fr; gap: 8px; font-size: .82em; color: var(--text-2); }
.pcard-line .label { padding-top: 2px; white-space: nowrap; }

/* --- the system's mark (logo.js) --------------------------------------------------------------------------- */
.logo { overflow: visible; color: var(--text); }
.logo .ln { fill: none; stroke: currentColor; stroke-linecap: round; }
.logo .core { fill: var(--accent); transform-box: fill-box; transform-origin: center; }
.logo.network .core { filter: drop-shadow(0 0 5px color-mix(in oklab, var(--accent) 70%, transparent)); animation: lens-breathe 6s ease-in-out infinite; }
.signin .logo .core, .boot .logo .core { fill: #ff3b30; }         /* nobody's signed in yet: Brother Eye's own red */
@keyframes lens-breathe { 0%, 100% { opacity: 1; transform: none; } 50% { opacity: .8; transform: scale(.88); } }
:root[data-motion="off"] .logo .core { animation: none; }

/* --- emoji: reactions on messages, the quick row and the picker --------------------------------------------- */
.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; white-space: normal; }
.react { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 7px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--bg-1);
  font-size: .82em; color: var(--text-3); transition: border-color var(--t), background var(--t), transform .12s var(--ease); }
.react:hover { border-color: var(--line-3); color: var(--text); }
.react:active { transform: scale(.94); }
.react b { font-weight: 600; font-variant-numeric: tabular-nums; }
.react.on { border-color: color-mix(in oklab, var(--accent) 55%, var(--line-2)); background: var(--a-10); color: var(--text); }
.react.on b { color: var(--accent); }
.react.add { padding: 0 6px; color: var(--text-5); opacity: 0; }
.row:hover .react.add, .react.add:focus-visible { opacity: 1; }
.react.add svg.i { width: 13px; height: 13px; }
.emo-quick, .emo-picker { position: fixed; z-index: 300; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg-1); box-shadow: 0 16px 40px rgba(0,0,0,.55); animation: tip-in .14s var(--ease); }
.emo-quick { display: flex; gap: 2px; padding: 4px; }
.emo-btn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r); font-size: 1.15em; transition: background var(--t), transform .12s var(--ease); }
.emo-btn:hover, .emo-btn:focus-visible { background: var(--bg-4); transform: scale(1.12); outline: none; }
.emo-btn.more { color: var(--text-4); font-size: 1em; }
.emo-btn .emo { font-size: 1.3em; }
.emo-picker { width: 332px; height: 380px; display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
.emo-top { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--text-4); }
.emo-top .field { flex: 1; height: 28px; border: 0; background: transparent; padding: 0; }
.emo-top .field:focus { box-shadow: none; }
.emo-tabs { display: flex; gap: 2px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.emo-tab { display: grid; place-items: center; flex: 1; height: 28px; border-radius: var(--r); opacity: .55; transition: opacity var(--t), background var(--t); }
.emo-tab:hover { opacity: 1; background: var(--bg-3); }
.emo-tab .mark { color: var(--text-3); font-size: 1.1em; }
.emo-grid { overflow-y: auto; padding: 4px 6px 8px; overscroll-behavior: contain; }
.emo-grid section > .label { position: sticky; top: -4px; z-index: 1; padding: 8px 4px 4px; background: var(--bg-1); }
.emo-set { display: grid; grid-template-columns: repeat(9, 1fr); }
.emo-none { padding: 24px 8px; color: var(--text-4); text-align: center; font-size: .86em; }
@media (max-width: 760px) { .emo-picker { width: calc(100vw - 16px); height: 50vh; } .emo-set { grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); } }

/* --- attachments: the tray, voice notes being recorded, what messages carry, the viewer --------------------- */
.tray { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding: 2px 0 10px; }
.tray-item { position: relative; display: grid; place-items: center; width: 64px; height: 64px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg-2); overflow: hidden; }
.tray-item img, .tray-item video { width: 100%; height: 100%; object-fit: cover; }
.tray-item.going img, .tray-item.going video { opacity: .55; }
.tray-item.error { border-color: var(--sev-4); }
.tray-voice { display: grid; justify-items: center; gap: 2px; color: var(--accent); } .tray-voice b { color: var(--text-2); font-size: .74em; }
.tray-file { display: grid; justify-items: center; gap: 2px; padding: 0 4px; text-align: center; }
.tray-file b { color: var(--accent); font-size: .72em; letter-spacing: .1em; }
.tray-file small { max-width: 56px; color: var(--text-4); font-size: .62em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tray-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: calc(var(--p, 0) * 100%); background: var(--accent); box-shadow: 0 0 6px var(--accent); transition: width .2s linear, opacity .4s; }
.tray-item.up .tray-bar { opacity: 0; }
.tray-err { position: absolute; inset: auto auto 4px 4px; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--sev-4); color: #fff; font-size: .7em; font-weight: 700; }
.tray-x { position: absolute; top: 3px; right: 3px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,.72); color: #fff; opacity: 0; transition: opacity var(--t); }
.tray-x svg.i { width: 11px; height: 11px; }
.tray-item:hover .tray-x, .tray-x:focus-visible { opacity: 1; }
.tray-note { align-self: center; color: var(--text-4); font-size: .76em; }
.rec { display: flex; align-items: center; gap: 10px; height: 36px; }
.rec[hidden] { display: none; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sev-4); box-shadow: 0 0 10px var(--sev-4); animation: rec-blink 1.1s steps(1) infinite; }
@keyframes rec-blink { 50% { opacity: .25; } }
.rec-label { color: var(--sev-4); font-size: .72em; font-weight: 700; letter-spacing: .2em; }
.rec-time { min-width: 4ch; color: var(--text); }
.rec-level { flex: 1; display: flex; align-items: center; gap: 2px; height: 26px; overflow: hidden; }
.rec-level i { flex: 1; height: calc(var(--v, .08) * 100%); min-height: 4px; background: repeating-linear-gradient(to top, var(--accent) 0 2px, transparent 2px 4px); transition: height .08s; }
.view[data-view="comms"].dropping::after { content: "Drop to attach"; position: absolute; inset: 8px; z-index: 20; display: grid; place-items: center;
  border: 1px dashed color-mix(in oklab, var(--accent) 70%, transparent); border-radius: var(--r); background: color-mix(in oklab, var(--bg) 82%, transparent);
  color: var(--accent); font-size: .9em; letter-spacing: .2em; text-transform: uppercase; pointer-events: none; }
.view[data-view="comms"] { position: relative; }
/* in a message */
.atts { display: grid; gap: 6px; margin: 4px 0 4px; max-width: 400px; white-space: normal; }
.media-grid { display: grid; gap: 3px; border-radius: var(--r); overflow: hidden; }
.media-grid.n1 { max-width: 380px; }
.media-grid:not(.n1) { max-width: 360px; }
.media-grid.n1 .tile { aspect-ratio: var(--ratio); max-height: 380px; }
.media-grid.n2, .media-grid.n4 { grid-template-columns: 1fr 1fr; } .media-grid.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.media-grid.n3 .tile:first-child { grid-row: span 2; }
.media-grid:not(.n1) .tile { aspect-ratio: 1; }
.media-grid.n3 .tile:first-child { aspect-ratio: auto; }
.tile { position: relative; display: block; width: 100%; overflow: hidden; background: var(--bg-2); border-radius: 2px; }
.tile img, .tile video { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease), filter .3s; }
.tile:hover img, .tile:hover video { transform: scale(1.03); filter: brightness(1.08); }
.tile-play { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 6px; background: linear-gradient(transparent 50%, rgba(0,0,0,.5)); color: #fff; }
.tile-play svg.i { width: 34px; height: 34px; padding: 9px; border-radius: 50%; background: rgba(0,0,0,.55); fill: #fff; stroke: none; box-sizing: content-box; backdrop-filter: blur(4px); }
.tile-play b { position: absolute; right: 8px; bottom: 6px; font-size: .74em; font-weight: 600; }
.tile-more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.6); color: #fff; font-size: 1.3em; font-weight: 700; }
.att-wrap { position: relative; width: 100%; max-width: 360px; }
.att-wrap > .vn, .att-wrap > .file-card { width: 100%; }
.att-x { position: absolute; top: 6px; right: 6px; z-index: 2; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.72); color: #fff; opacity: 0; transition: opacity var(--t), background var(--t); cursor: var(--cur-pointer, pointer); }
.att-x svg.i { width: 12px; height: 12px; }
.att-x:hover { background: var(--sev-4); }
.att-wrap > .att-x { top: 50%; right: -30px; transform: translateY(-50%); background: var(--bg-3); color: var(--text-3); }
.att-wrap > .att-x:hover { background: var(--sev-4); color: #fff; }
.tile:hover .att-x, .att-wrap:hover > .att-x, .att-x:focus-visible { opacity: 1; }
.vn { display: flex; align-items: center; gap: 10px; width: min(340px, 100%); padding: 6px 10px 6px 6px; border: 1px solid var(--line-2); border-radius: 18px; background: var(--bg-1); }
.vn { --c: var(--accent); }
.vn-play { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--c); color: var(--bg); transition: transform .12s var(--ease); box-shadow: 0 0 10px color-mix(in oklab, var(--c) 35%, transparent); }
.vn-play:active { transform: scale(.92); }
.vn-play svg.i { width: 14px; height: 14px; fill: currentColor; stroke: currentColor; }
.vn-wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 28px; cursor: var(--cur-pointer, pointer); outline: none; }
/* the call meter's own segments, in the speaker's colour: faint until played, lit as it plays */
.vn-wave i { flex: 1; min-width: 2px; height: calc(var(--v) * 100%); min-height: 4px; background: repeating-linear-gradient(to top, var(--c) 0 2px, transparent 2px 4px); opacity: .28; transition: opacity .15s; }
.vn-wave i.on { opacity: 1; }
.vn-wave:hover i:not(.on) { opacity: .45; }
.vn-time { flex: none; min-width: 4ch; color: var(--text-3); font-size: .78em; }
.vn-speed { flex: none; min-width: 3ch; color: var(--text-4); font-size: .74em; }
.vn-speed:hover { color: var(--accent); }
.vn.big { width: min(520px, 90vw); padding: 10px 16px 10px 10px; border-radius: 26px; } .vn.big .vn-play { width: 44px; height: 44px; } .vn.big .vn-wave { height: 48px; }
.file-card { display: flex; align-items: center; gap: 10px; width: min(360px, 100%); padding: 8px 6px 8px 8px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg-1); }
.file-ext { display: grid; place-items: center; flex: none; width: 38px; height: 44px; border: 1px solid color-mix(in oklab, var(--accent) 40%, var(--line-2)); border-radius: 2px 8px 2px 2px;
  color: var(--accent); font-size: .66em; font-weight: 700; letter-spacing: .08em; }
.file-ext.big { width: 72px; height: 88px; font-size: .9em; }
.file-meta { display: grid; flex: 1; min-width: 0; }
.file-meta b { font-weight: 600; font-size: .9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta small { color: var(--text-4); font-size: .76em; }
a.icon-btn { color: var(--text-3); }
/* the viewer */
.viewer { position: fixed; inset: 0; z-index: 500; display: grid; grid-template-rows: auto minmax(0, 1fr); background: rgba(5,5,6,.94); backdrop-filter: blur(10px); animation: tip-in .16s var(--ease); }
.viewer header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.viewer-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.viewer-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-title small { color: var(--text-4); font-size: .8em; white-space: nowrap; }
.viewer .tools { display: flex; gap: 4px; }
.viewer-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 18px 64px; overflow: hidden; }
.viewer-pan { display: grid; place-items: center; width: 100%; height: 100%; min-height: 0; }
.viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: var(--cur-zoom-in, zoom-in); border-radius: 2px; box-shadow: 0 20px 60px rgba(0,0,0,.6); transform-origin: center; transition: transform .12s var(--ease); user-select: none; -webkit-user-select: none; }
.viewer-stage img.zoomed { cursor: var(--cur-move, grab); }
.viewer-zoom { display: inline-flex; gap: 2px; margin-right: 6px; padding-right: 8px; border-right: 1px solid var(--line-2); }
.viewer-zoom[hidden] { display: none; }
.viewer-stage video { max-width: 100%; max-height: 100%; border-radius: 2px; background: #000; }
.viewer-stage iframe { width: min(1000px, 100%); height: 100%; border: 1px solid var(--line-2); border-radius: 2px; background: #fff; }
.viewer-text { width: min(1000px, 100%); height: 100%; margin: 0; overflow: auto; padding: 16px 18px; border: 1px solid var(--line-2); border-radius: 2px; background: var(--bg-1);
  color: var(--text-2); font-size: .86em; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.viewer-file { display: grid; justify-items: center; gap: 14px; }
.viewer-nav { position: absolute; top: 50%; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line-2); border-radius: 50%; background: rgba(10,10,12,.7); color: var(--text-2); }
.viewer-nav:hover { color: var(--text); border-color: var(--line-3); }
.viewer-nav.prev { left: 14px; } .viewer-nav.prev svg.i { transform: rotate(90deg); }
.viewer-nav.next { right: 14px; } .viewer-nav.next svg.i { transform: rotate(-90deg); }
.viewer-nav[hidden] { display: none; }
/* a chat's files and media */
.sheet-scrim { align-items: stretch; justify-content: flex-end; }
.sheet { display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(460px, 100vw); height: 100%; border-left: 1px solid var(--line-2); background: var(--bg-1); box-shadow: -20px 0 60px rgba(0,0,0,.5); animation: sheet-in .22s var(--ease); }
@keyframes sheet-in { from { transform: translateX(24px); opacity: 0; } }
.sheet header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.sheet header h3 { margin: 0; font-size: .9em; letter-spacing: .14em; text-transform: uppercase; }
.sheet header .sub { flex: 1; color: var(--text-4); font-size: .8em; }
.sheet-body { overflow: auto; padding: 12px 14px 20px; display: grid; align-content: start; gap: 18px; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.sheet-list { display: grid; gap: 10px; }
.sheet-row { display: grid; gap: 4px; }
.sheet-row > small { color: var(--text-4); font-size: .74em; }

/* --- ordering chats by dragging ---------------------------------------------------------------------------- */
.chan.dragging { opacity: .4; }
.chan.drop-above { box-shadow: inset 0 1px 0 var(--accent); }
.chan.drop-below { box-shadow: inset 0 -1px 0 var(--accent); }

/* --- search ---------------------------------------------------------------------------------------------------- */
.search-scrim { align-items: start; padding-top: 12vh; background: rgba(0,0,0,.45); }
.search-panel { width: min(680px, calc(100vw - 24px)); max-height: 72vh; display: grid; grid-template-rows: auto minmax(0, 1fr); border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--bg-1); box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden; animation: tip-in .16s var(--ease); }
.search-top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--text-4); }
.search-top svg.i { color: var(--accent); }
.search-q { flex: 1; min-width: 0; height: 30px; border: 0; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 1em; }
.search-scope { flex: none; }
.search-scope button { max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-list { overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.search-list.busy { opacity: .6; }
.search-hint { padding: 22px 12px; color: var(--text-4); font-size: .86em; text-align: center; }
.search-count { padding: 6px 8px 4px; }
.search-row { display: grid; gap: 3px; width: 100%; padding: 8px 10px; border-radius: var(--r); text-align: left; }
.search-row:hover, .search-row.hl { background: var(--bg-3); }
.search-meta { display: flex; align-items: baseline; gap: 10px; font-size: .8em; }
.search-meta b { font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.search-meta time { margin-left: auto; color: var(--text-5); white-space: nowrap; }
.search-chat { color: var(--text-4); }
.search-text { color: var(--text-2); font-size: .9em; line-height: 1.5; overflow-wrap: anywhere; }
.search-files { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--text-3); font-size: .82em; }
.search-files span { display: inline-flex; align-items: center; gap: 5px; }
.search-files svg.i { width: 12px; height: 12px; }
mark { background: color-mix(in oklab, var(--accent) 30%, transparent); color: var(--text); border-radius: 2px; padding: 0 1px; }
.row.found { animation: found 2.4s var(--ease); }
@keyframes found { 0%, 30% { background: color-mix(in oklab, var(--accent) 16%, transparent); box-shadow: inset 2px 0 0 var(--accent); } }

/* --- pinned messages, and the chat header's order ------------------------------------------------------------- */
.row.pinned::after { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 2px; background: color-mix(in oklab, var(--accent) 55%, transparent); }
.row .t .pin-mark { display: inline-grid; margin-left: 4px; color: var(--accent); vertical-align: -2px; }
.row .t .pin-mark svg.i { width: 11px; height: 11px; }
.see-pin { color: var(--accent); font-style: normal; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.row .quote { cursor: var(--cur-pointer, pointer); border-radius: 2px; }
.row .quote:hover, .row .quote:focus-visible { color: var(--text-2); background: var(--bg-2); outline: none; }
.row .acts .icon-btn.on { color: var(--accent); }
.head-people { display: flex; align-items: center; gap: 6px; }
.head-people .chips { flex-wrap: nowrap; }
.face-more { min-width: 22px; height: 22px; padding: 0 5px; border: 1px solid var(--line-2); border-radius: var(--r); font-size: .72em; font-weight: 600; color: var(--text-3); }
.face-more:hover { color: var(--text); border-color: var(--text-4); }
@container (max-width: 680px) { .head-people .chips { display: none; } }      /* narrow: the members button alone */
.head-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--line-2); }
.head-pins { position: relative; }
.head-pins.has { color: var(--accent); }
.head-pins b { position: absolute; top: -2px; right: -3px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px; background: var(--accent); color: var(--bg);
  font-size: .62em; font-weight: 700; line-height: 14px; text-align: center; }
.pins { display: grid; gap: 8px; }
.pin-card { position: relative; display: grid; gap: 5px; padding: 10px 12px 10px 14px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg-2);
  cursor: var(--cur-pointer, pointer); transition: border-color var(--t), background var(--t); }
.pin-card::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; background: var(--accent); }
.pin-card:hover, .pin-card:focus-visible { border-color: var(--line-3); background: var(--bg-3); outline: none; }
.pin-head { display: flex; align-items: center; gap: 10px; font-size: .8em; }
.pin-head b { letter-spacing: .06em; text-transform: uppercase; }
.pin-head time { color: var(--text-5); }
.pin-head .icon-btn { margin-left: auto; width: 22px; height: 22px; }
.pin-text { color: var(--text); font-size: .92em; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.pin-files { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--text-3); font-size: .8em; }
.pin-files span { display: inline-flex; align-items: center; gap: 5px; } .pin-files svg.i { width: 12px; height: 12px; }
.pin-by { display: inline-flex; align-items: center; gap: 6px; color: var(--text-5); font-size: .72em; }
.pin-by svg.i { width: 11px; height: 11px; color: var(--accent); }

/* --- sealed messages: each system seals its own way ------------------------------------------------------------- */
.sealed { position: relative; display: inline-grid; grid-template-columns: auto 1fr; align-items: center; gap: 5px 14px; width: min(460px, 100%); padding: 9px 12px 10px; margin: 2px 0;
  border: 1px solid color-mix(in oklab, var(--accent) 42%, var(--line-2)); border-radius: var(--r); background: color-mix(in oklab, var(--accent) 6%, var(--bg-1));
  text-align: left; overflow: hidden; transition: border-color var(--t), background var(--t); }
.sealed:hover, .sealed:focus-visible { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 10%, var(--bg-1)); outline: none; }
.sealed .seal-tag { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: .68em; font-weight: 700; letter-spacing: .2em; white-space: nowrap; font-style: normal; }
.sealed .seal-tag svg.i { width: 12px; height: 12px; }
.sealed .seal-hint { justify-self: end; color: var(--text-4); font-size: .7em; letter-spacing: .12em; font-style: normal; }
.sealed .cipher { grid-column: 1 / -1; color: color-mix(in oklab, var(--accent) 50%, var(--text-4)); font-size: .88em; line-height: 1.55; letter-spacing: .14em; overflow-wrap: anywhere; font-style: normal; }
.sealed.network::after { content: ""; position: absolute; left: 0; right: 0; top: -40%; height: 40%; pointer-events: none;
  background: linear-gradient(transparent, color-mix(in oklab, var(--accent) 16%, transparent), transparent); animation: seal-scan 2.8s linear infinite; }
@keyframes seal-scan { to { top: 110%; } }
.sealed.civilian { border-color: var(--line-3); border-radius: 14px; background: color-mix(in oklab, var(--bg-4) 55%, transparent); backdrop-filter: blur(10px); }
.sealed.civilian .seal-tag { color: var(--text); font-size: .78em; font-weight: 600; letter-spacing: .03em; }
.sealed.civilian .cipher { color: var(--text-4); letter-spacing: .32em; filter: blur(1.2px); }
.sealed.underworld { border-color: color-mix(in oklab, var(--sev-4) 55%, var(--line-2)); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='60' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E"), color-mix(in oklab, var(--sev-4) 6%, var(--bg-1)); }
.sealed.underworld .seal-tag { color: var(--sev-4); }
.sealed.underworld .cipher { color: var(--text-4); animation: seal-jitter .18s steps(2) infinite; }
@keyframes seal-jitter { 50% { transform: translateX(1px); opacity: .85; } }
.sealed-file { grid-template-columns: auto auto 1fr; width: min(360px, 100%); }
.sealed-file .seal-what { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: .8em; font-style: normal; }
.sealed-file .seal-what svg.i { width: 13px; height: 13px; }
.media-grid.under-seal .tile img, .media-grid.under-seal .tile video { filter: blur(24px) brightness(.45) saturate(.5); transform: scale(1.25); }
.media-grid.under-seal .tile:hover img, .media-grid.under-seal .tile:hover video { filter: blur(20px) brightness(.55) saturate(.6); transform: scale(1.25); }
.seal-over { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 8px; padding: 8px; color: var(--accent); font-size: .66em; font-weight: 700; letter-spacing: .2em; text-align: center; }
.seal-over svg.i { width: 22px; height: 22px; filter: drop-shadow(0 0 8px currentColor); }
.seal-over.civilian { color: #fff; font-size: .78em; font-weight: 600; letter-spacing: .03em; }
.seal-over.underworld { color: var(--sev-4); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='60' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E"); }
.seal-btn.on { color: var(--accent); background: var(--a-10); }
.seal-chip { display: inline-flex; align-items: center; gap: 5px; margin-left: 10px; padding: 0 7px; height: 18px; border: 1px solid color-mix(in oklab, var(--accent) 50%, var(--line-2)); border-radius: 2px;
  color: var(--accent); font-size: .72em; font-weight: 600; letter-spacing: .1em; vertical-align: 1px; }
.seal-chip svg.i { width: 11px; height: 11px; }
.composer.sealing .prompt textarea { caret-color: var(--accent); }
.composer.sealing { box-shadow: inset 0 1px 0 color-mix(in oklab, var(--accent) 45%, transparent); }
.plain.unsealed { animation: unseal .45s var(--ease); }
@keyframes unseal { from { filter: blur(5px); opacity: .2; } }
.sealed-note { color: var(--text-4); font-style: italic; }
:root[data-motion="off"] .sealed::after, :root[data-motion="off"] .sealed .cipher { animation: none; }
.hud-opacity { display: grid; gap: 8px; width: 200px; padding: 8px 10px 10px; }
.hud-opacity .label { display: flex; justify-content: space-between; }
.hud-opacity .label b { color: var(--text-2); letter-spacing: .04em; }
.hud-opacity input { width: 100%; accent-color: var(--accent); }

/* --- the theme picker (Settings) ------------------------------------------------------------------------------- */
.themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; width: min(330px, 100%); }
.theme-card { display: grid; gap: 5px; padding: 6px; border: 1px solid var(--line-2); border-radius: var(--r); text-align: left; transition: border-color var(--t); }
.theme-card:hover { border-color: var(--line-3); }
.theme-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme-card .swatch { position: relative; display: grid; gap: 3px; height: 34px; padding: 6px; border-radius: 2px; background: var(--sw-bg); overflow: hidden; }
.theme-card .swatch i { display: block; height: 3px; border-radius: 1px; background: var(--sw-text); }
.theme-card .swatch i:nth-child(2) { width: 70%; opacity: .6; }
.theme-card .swatch i:nth-child(3) { position: absolute; right: 6px; bottom: 6px; width: 14px; height: 6px; background: var(--accent); }
.theme-card b { font-size: .74em; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }

/* --- a sealed picture opening in the viewer: decrypted the way its system seals ---------------------------------- */
.viewer-stage .decrypting { animation: decrypt-img 1.15s var(--ease) both; }
.viewer-stage .decrypting.civilian { animation: decrypt-frost .7s var(--ease) both; }
.viewer-stage .decrypting.underworld { animation: decrypt-static 1s steps(10) both; }
@keyframes decrypt-img { 0% { filter: blur(26px) saturate(0) brightness(.5) contrast(1.6); } 55% { filter: blur(6px) saturate(.4) brightness(.9) contrast(1.3); } 100% { filter: none; } }
@keyframes decrypt-frost { from { filter: blur(18px) brightness(1.2); opacity: .6; } }
@keyframes decrypt-static { 0% { filter: blur(14px) contrast(3) grayscale(1); opacity: .5; } 40% { filter: blur(6px) contrast(2) grayscale(.6); } 100% { filter: none; opacity: 1; } }
.decrypt-scan { position: absolute; left: 0; right: 0; top: 0; height: 30%; pointer-events: none; opacity: 0;
  background: linear-gradient(transparent, color-mix(in oklab, var(--accent) 22%, transparent) 85%, var(--accent) 99%, transparent); animation: decrypt-scan 1.15s var(--ease) forwards; }
.decrypt-scan.civilian { display: none; }
.decrypt-scan.underworld { background: linear-gradient(transparent, color-mix(in oklab, var(--sev-4) 25%, transparent) 85%, var(--sev-4) 99%, transparent); }
@keyframes decrypt-scan { 0% { top: -30%; opacity: 1; } 90% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
:root[data-motion="off"] .viewer-stage .decrypting, :root[data-motion="off"] .decrypt-scan { animation: none; }

/* --- Control: the master's console ------------------------------------------------------------------------------- */
.ccards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.ccard { position: relative; display: grid; align-content: start; gap: 5px; padding: 12px 12px 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg-1); min-width: 0; }
.ccard::before { content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 2px; background: var(--line-3); }
.ccard.warn::before { background: var(--idle); box-shadow: 0 0 8px var(--idle); }
.ccard b { font-weight: 600; font-size: .95em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard small { color: var(--text-3); font-size: .78em; line-height: 1.45; }
.ccard .icon-btn { position: absolute; top: 8px; right: 8px; }
.ccard .btn { justify-self: start; margin-top: 4px; }
.prows { display: grid; gap: 4px; }
.prow { display: grid; grid-template-columns: auto minmax(160px, 220px) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-1); }
.prow:hover { border-color: var(--line-2); }
.prow-id { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.prow-id b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow-id small { color: var(--text-4); font-size: .8em; white-space: nowrap; }
.tag.master { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 45%, var(--line-2)); }
.prow-act { display: flex; align-items: center; gap: 4px; }
.ctl-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; }
.ctl-bar .seg small { color: var(--text-4); }
.ctl-search { width: min(240px, 100%); height: 28px; }
.crow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.crow-id { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.crow-id b { color: var(--c); font-weight: 600; letter-spacing: .03em; white-space: nowrap; }
.crow-id span { color: var(--text-3); font-size: .9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctl-scan { display: flex; align-items: center; gap: 12px; }
@media (max-width: 760px) { .prow { grid-template-columns: auto minmax(0, 1fr) auto; } .prow .chips { grid-column: 2 / -1; grid-row: 2; } }
.call-id b .call-em { width: 1.1em; height: 1.1em; margin-right: .4em; vertical-align: -.18em; fill: var(--c); }
.changes { display: grid; gap: 2px; }
.change { border-bottom: 1px solid var(--line); }
.change summary { display: flex; align-items: baseline; gap: 12px; padding: 7px 4px; list-style: none; cursor: var(--cur-pointer, pointer); }
.change summary::-webkit-details-marker { display: none; }
.change summary b { color: var(--accent); font-size: .82em; min-width: 6ch; }
.change summary span { color: var(--text-2); font-size: .9em; }
.change[open] summary span { color: var(--text); }
.change p { margin: 0 4px 10px calc(6ch + 16px); color: var(--text-3); font-size: .84em; line-height: 1.6; }
.ccard .btn.primary { margin-top: 6px; }

/* --- call waiting and hold ---------------------------------------------------------------------------------- */
.call-waiting { display: grid; gap: 8px; margin: 0 0 8px; padding: 10px; border: 1px solid color-mix(in oklab, var(--w) 50%, var(--line-2)); border-radius: var(--r);
  background: color-mix(in oklab, var(--w) 8%, var(--bg-2)); animation: tip-in .2s var(--ease); }
.call-waiting-who { display: flex; align-items: center; gap: 10px; }
.call-waiting-who span { display: grid; }
.call-waiting-who b { color: var(--w); letter-spacing: .06em; text-transform: uppercase; font-size: .9em; }
.call-waiting-who small { color: var(--text-3); font-size: .78em; }
.call-waiting-btns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.call-held { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; padding: 7px 8px 7px 10px; border: 1px dashed var(--line-3); border-radius: var(--r); color: var(--text-3); }
.call-held > svg.i { width: 14px; height: 14px; color: var(--idle); }
.call-held > span:first-of-type { display: grid; flex: 1; min-width: 0; }
.call-held small { font-size: .68em; letter-spacing: .14em; text-transform: uppercase; color: var(--idle); }
.call-held b { color: var(--text); font-size: .9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-held .call-time { color: var(--text-4); font-size: .8em; }
.call-held-row { display: flex; align-items: center; gap: 8px; }
.call-held-row .call-held { flex: 1; margin: 0; }
.call-member.on.hold, .call-member[class*="on hold"] { opacity: .55; }
