:root {
  --bg: #140c05;
  --bg-2: #1b1108;
  --panel: #22150a;
  --panel-2: #2b1b0e;
  --panel-3: #34230f;
  --line: rgba(var(--fg), 0.1);
  --line-2: rgba(var(--fg), 0.18);
  --text: #f4f1d8;
  --muted: rgba(var(--fg), 0.62);
  --faint: rgba(var(--fg), 0.4);
  --red: #ee2329;
  --red-2: #ff4b50;
  --yellow: #f4c21c;
  --green: #1a572b;
  --green-2: #5fc27e;
  --ink: #241608;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --chat-w: 420px;
  --top-h: 60px;
  /* Theme hooks: rgb triplets for tinted overlays, plus roles the themes remap. */
  --fg: 244, 241, 216;
  --bg-rgb: 20, 12, 5;
  --panel-rgb: 34, 21, 10;
  --hi: var(--yellow);
  --hi-rgb: 244, 194, 28;
  --hi-ink: var(--ink);
  --good: var(--green-2);
  --good-rgb: 95, 194, 126;
  --bad: #ff8a8d;
  --eyebrow: var(--yellow);
  --btn-alt: var(--yellow);
  --btn-alt-ink: var(--ink);
  --font-body: Poppins, system-ui, sans-serif;
  --font-display: "Lilita One", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: 0.5; }
:focus-visible { outline: 2px solid var(--hi); outline-offset: 2px; }
a { color: var(--hi); }
[hidden] { display: none !important; }
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.2px; margin: 0; line-height: 1.08; }
p { margin: 0; }
.muted { color: var(--muted); }
.eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: 2.2px; text-transform: uppercase; color: var(--eyebrow); margin-bottom: 6px; }
kbd { font: 600 10px/1 var(--font-body); padding: 3px 6px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--faint); }

/* ---------- buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px; padding: 10px 16px;
  font-weight: 600; font-size: 13px; background: var(--panel-3); color: var(--text);
  transition: transform 0.12s ease, background 0.15s ease;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
a.btn { text-decoration: none; }
.btn.red { background: var(--red); color: #fff; }
.btn.red:hover:not(:disabled) { background: var(--red-2); }
.btn.yellow { background: var(--btn-alt); color: var(--btn-alt-ink); }
.btn.ghost { background: transparent; border-color: var(--line-2); }
.btn.ghost:hover:not(:disabled) { background: rgba(var(--fg), 0.06); }
.btn.small { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }
.btn.full { width: 100%; }
.btn.danger { background: rgba(238, 35, 41, 0.14); color: var(--bad); }
.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center; align-items: center; justify-content: center;
  border-radius: 9px; border: 1px solid var(--line); background: transparent; font-size: 17px; color: var(--muted);
}
.icon-btn:hover { color: var(--text); background: rgba(var(--fg), 0.06); }
.field { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.field input, .field textarea, .field select {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font-weight: 400; font-size: 14px;
}
.field textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--hi); outline: none; }
.form-error { color: var(--bad); font-size: 12.5px; min-height: 1em; }
.row { display: flex; gap: 12px; align-items: center; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(900px 500px at 50% -10%, rgba(238, 35, 41, 0.25), transparent 70%), var(--bg); overflow: auto; height: 100%; }
.login-card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow); }
.login-logo { width: 120px; height: auto; display: block; margin-bottom: 18px; }
.login-card h1 { font-size: 44px; margin-bottom: 6px; }
.login-card .muted { margin-bottom: 22px; }

/* PIN keypad (when BRAIN_PASSWORD is 6 digits) */
.login-card.pin-mode { text-align: center; }
.login-card.pin-mode .login-logo { margin: 0 auto 18px; }
.login-card.pin-mode #pw-field, .login-card.pin-mode #login-submit { display: none; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 2px 0 24px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); transition: background 0.12s, border-color 0.12s, transform 0.12s; }
.pin-dots i.on { background: var(--red); border-color: var(--red); transform: scale(1.1); }
.pin.bad .pin-dots i { background: var(--bad); border-color: var(--bad); }
.pin.bad { animation: shake 0.4s; }
.pin.ok .pin-dots i { background: var(--good); border-color: var(--good); }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-9px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px 18px; justify-content: center; margin-bottom: 8px; }
.keypad button {
  width: 72px; height: 72px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel-2);
  font: 400 28px/1 var(--font-display); color: var(--text); transition: background 0.1s, transform 0.08s, color 0.1s;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.keypad button:hover { background: var(--panel-3); }
.keypad button:active, .keypad button.press { transform: scale(0.93); background: var(--red); border-color: var(--red); color: #fff; }
.keypad button.del { background: transparent; border-color: transparent; font-size: 22px; color: var(--muted); }
.keypad .gap { visibility: hidden; }
.login-card.pin-mode .form-error { min-height: 1.4em; margin-top: 4px; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-rows: var(--top-h) minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); height: 100%; height: 100dvh; }
.top {
  display: flex; align-items: center; gap: 18px; padding: 0 14px 0 18px;
  border-bottom: 1px solid var(--line); background: rgba(var(--bg-rgb), 0.92); backdrop-filter: blur(10px); z-index: 5;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); flex-shrink: 0; }
.brand img { width: 58px; height: auto; display: block; }
.brand-word { font-family: var(--font-display); font-size: 22px; letter-spacing: 0.3px; }
.views { display: flex; gap: 4px; background: var(--bg-2); padding: 4px; border-radius: 12px; border: 1px solid var(--line); }
.view-tab { display: flex; gap: 7px; align-items: center; border: 0; background: transparent; color: var(--muted); padding: 6px 13px; border-radius: 9px; font-weight: 600; font-size: 13px; }
.view-tab .ico { font-size: 13px; opacity: 0.8; }
.view-tab.active { background: var(--panel-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.view-tab:hover:not(.active) { color: var(--text); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); color: var(--faint); width: 240px; }
.search input { border: 0; background: transparent; outline: none; flex: 1; min-width: 0; color: var(--text); font-size: 13px; }
.search:focus-within { border-color: var(--hi); }
.ai-pill { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: transparent; border-radius: 99px; padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--muted); }
.ai-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.ai-pill.on i { background: var(--green-2); box-shadow: 0 0 10px var(--green-2); }
.ai-pill.on { color: var(--text); }
.ai-pill.off i { background: var(--red); }

.stage { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) var(--chat-w); grid-template-rows: minmax(0, 1fr); min-height: 0; min-width: 0; }
.stage.chat-hidden { grid-template-columns: minmax(0, 1fr) 0; }
.stage.chat-hidden .chat { display: none; }
.view { grid-column: 1; grid-row: 1; min-height: 0; min-width: 0; display: none; position: relative; }
.view.active { display: block; }
.view.scroll { overflow-y: auto; }
.mobile-only { display: none !important; }

/* ---------- graph ---------- */
#view-graph { background: radial-gradient(1200px 700px at 50% 45%, var(--panel) 0%, var(--bg) 70%); overflow: hidden; }
#graph { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#graph:active { cursor: grabbing; }
.graph-hud { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.stats { display: flex; gap: 8px; flex-wrap: wrap; pointer-events: auto; }
.stat { display: flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 99px; background: rgba(var(--panel-rgb), 0.85); border: 1px solid var(--line); font-size: 12px; color: var(--muted); backdrop-filter: blur(6px); }
.stat b { font-family: var(--font-display); font-weight: 400; font-size: 17px; color: var(--text); }
.stat.hot b { color: var(--hi); }
.stat.warn { color: var(--red); border-color: var(--red); font-weight: 600; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; pointer-events: auto; max-width: 760px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 99px;
  border: 1px solid var(--line); background: rgba(var(--panel-rgb), 0.8); color: var(--text); font-size: 11.5px; font-weight: 500; backdrop-filter: blur(6px);
}
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--faint)); flex-shrink: 0; }
.chip { white-space: nowrap; flex-shrink: 0; }
.chip.off { opacity: 0.38; }
.chip.off i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
.chip:hover { border-color: var(--line-2); }
.chip.tiny { font-size: 11px; padding: 2px 8px 2px 6px; }
.tip {
  position: absolute; pointer-events: none; z-index: 4; max-width: 280px; padding: 10px 12px; border-radius: 12px;
  background: rgba(var(--panel-rgb), 0.96); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 12.5px;
}
.tip b { display: block; font-weight: 600; font-size: 13px; margin: 2px 0 3px; }
.tip .meta { font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; font-weight: 700; }
.tip p { color: var(--muted); font-size: 12px; }
.zoom { position: absolute; right: 14px; bottom: 14px; display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: rgba(var(--panel-rgb), 0.88); }
.zoom button { width: 38px; height: 36px; border: 0; background: transparent; font-size: 17px; color: var(--muted); }
.zoom button + button { border-top: 1px solid var(--line); }
.zoom button:hover { color: var(--text); background: rgba(var(--fg), 0.06); }
.legend { position: absolute; right: 66px; bottom: 14px; display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; max-width: 460px; font-size: 11px; color: var(--muted); padding: 7px 12px; border-radius: 12px; background: rgba(var(--panel-rgb), 0.75); border: 1px solid var(--line); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend svg { width: 12px; height: 12px; }
.activity { position: absolute; left: 14px; bottom: 14px; width: 310px; max-width: calc(100% - 28px); border-radius: 14px; background: rgba(var(--panel-rgb), 0.9); border: 1px solid var(--line); backdrop-filter: blur(8px); overflow: hidden; }
.activity-head { width: 100%; display: flex; align-items: center; gap: 9px; padding: 9px 12px; border: 0; background: transparent; font-weight: 600; font-size: 12.5px; text-align: left; }
.activity-head .caret { margin-left: auto; color: var(--faint); transition: transform 0.2s; }
.activity.closed .caret { transform: rotate(-90deg); }
.activity.closed ol { display: none; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green-2); box-shadow: 0 0 0 0 rgba(95, 194, 126, 0.6); animation: pulse 2.2s infinite; }
.thinking .pulse { background: var(--hi); animation-duration: 0.9s; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(95, 194, 126, 0.55); } 70% { box-shadow: 0 0 0 9px rgba(95, 194, 126, 0); } 100% { box-shadow: 0 0 0 0 rgba(95, 194, 126, 0); } }
.activity ol { list-style: none; margin: 0; padding: 0 6px 8px; max-height: 190px; overflow-y: auto; }
.activity li button { width: 100%; text-align: left; border: 0; background: transparent; padding: 6px 7px; border-radius: 8px; display: grid; grid-template-columns: 18px 1fr; gap: 6px; font-size: 12px; color: var(--muted); }
.activity li button:hover { background: rgba(var(--fg), 0.05); color: var(--text); }
.activity li time { display: block; font-size: 10.5px; color: var(--faint); }

/* node card */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.node-card {
  position: absolute; top: 14px; right: 14px; width: 360px; max-height: calc(100% - 80px); overflow-y: auto;
  padding: 18px 18px 16px; box-shadow: var(--shadow); z-index: 3; border-top: 4px solid var(--c, var(--line));
  animation: rise 0.22s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.node-card .close { position: absolute; top: 10px; right: 10px; }
.kind-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; padding-right: 36px; }
.kind { font-size: 10.5px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; color: var(--c); }
.status { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: rgba(var(--fg), 0.08); color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; }
.status.done { background: rgba(var(--good-rgb), 0.15); color: var(--good); }
.status.doing { background: rgba(var(--hi-rgb), 0.15); color: var(--hi); }
.node-card h3 { font-size: 23px; margin-bottom: 8px; }
.node-card .body { color: rgba(var(--fg), 0.85); font-size: 13.5px; }
.node-card .body p + p { margin-top: 8px; }
.node-card .origin { margin-top: 10px; font-size: 11.5px; color: var(--faint); }
.node-card .origin button { border: 0; background: none; padding: 0; color: var(--hi); text-decoration: underline; font-size: inherit; }
.tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 10px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: rgba(var(--fg), 0.07); color: var(--muted); }
.section-label { font-size: 10.5px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--faint); margin: 16px 0 6px; }
.links-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.links-list button { width: 100%; display: flex; gap: 9px; align-items: center; border: 0; background: transparent; text-align: left; padding: 6px 8px; border-radius: 8px; font-size: 13px; }
.links-list button:hover { background: rgba(var(--fg), 0.05); }
.links-list i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex-shrink: 0; }
.links-list em { font-style: normal; font-size: 11px; color: var(--hi); margin-left: auto; white-space: nowrap; padding-left: 8px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.importance { display: inline-flex; gap: 2px; }
.importance b { width: 6px; height: 6px; border-radius: 50%; background: rgba(var(--fg), 0.15); }
.importance b.on { background: var(--hi); }
.link-search { position: relative; margin-top: 10px; }
.link-search input { width: 100%; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--bg-2); font-size: 13px; }
.suggest { list-style: none; margin: 4px 0 0; padding: 4px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); max-height: 180px; overflow-y: auto; }
.suggest button { width: 100%; text-align: left; border: 0; background: transparent; padding: 6px 8px; border-radius: 7px; font-size: 12.5px; display: flex; gap: 8px; align-items: center; }
.suggest button:hover { background: rgba(var(--fg), 0.06); }
.suggest i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }

/* ---------- chat ---------- */
.chat { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; border-left: 1px solid var(--line); background: var(--bg-2); position: relative; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); position: relative; }
.chat-picker { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 6px 8px; border-radius: 9px; font-weight: 600; text-align: left; }
.chat-picker span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-picker:hover { background: rgba(var(--fg), 0.05); }
.caret { color: var(--faint); font-size: 11px; }
.chat-menu { position: absolute; top: 52px; left: 10px; right: 10px; z-index: 6; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); max-height: 360px; overflow-y: auto; padding: 6px; }
.chat-menu .item { display: flex; align-items: center; gap: 6px; border-radius: 8px; }
.chat-menu .item:hover { background: rgba(var(--fg), 0.05); }
.chat-menu .item.active { background: rgba(var(--hi-rgb), 0.1); }
.chat-menu .open { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 8px 10px; font-size: 13px; }
.chat-menu .open small { display: block; color: var(--faint); font-size: 11px; }
.chat-menu .del { border: 0; background: none; color: var(--faint); padding: 8px 10px; }
.chat-menu .del:hover { color: var(--bad); }
.chat-menu .empty { padding: 14px; color: var(--faint); font-size: 12.5px; }
.messages { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; }
.msg { max-width: 100%; animation: rise 0.2s ease; }
.msg.user { align-self: flex-end; max-width: 88%; background: var(--panel-3); border: 1px solid var(--line); padding: 10px 14px; border-radius: 16px 16px 4px 16px; white-space: pre-wrap; word-wrap: break-word; }
.msg.assistant { align-self: stretch; font-size: 14px; }
.msg.assistant .who { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--red-2); margin-bottom: 4px; }
.msg.assistant .who img { width: 22px; height: 22px; border-radius: 6px; }
.md p + p, .md p + ul, .md ul + p, .md p + ol, .md ol + p { margin-top: 8px; }
.md ul, .md ol { margin: 6px 0; padding-left: 20px; }
.md li + li { margin-top: 3px; }
.md h3, .md h4 { font-family: var(--font-body); font-weight: 700; font-size: 14px; margin: 12px 0 4px; }
.md code { background: rgba(var(--fg), 0.08); border-radius: 5px; padding: 1px 5px; font-size: 12.5px; }
.md pre { background: var(--bg); padding: 10px; border-radius: 9px; overflow-x: auto; }
.md em { color: var(--muted); }
.cite {
  display: inline-flex; align-items: center; gap: 5px; vertical-align: baseline; max-width: 220px;
  border: 1px solid color-mix(in srgb, var(--c, #f4c21c) 45%, transparent); background: color-mix(in srgb, var(--c, #f4c21c) 12%, transparent);
  color: var(--text); border-radius: 99px; padding: 0 8px 0 6px; font-size: 11.5px; line-height: 19px; margin: 0 1px;
}
.cite i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--hi)); flex-shrink: 0; }
.cite span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cite:hover { background: color-mix(in srgb, var(--c, #f4c21c) 24%, transparent); }
.recall, .learned { margin-top: 10px; display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--muted); padding: 8px 10px; border-radius: 10px; background: rgba(var(--fg), 0.035); border: 1px dashed var(--line-2); }
.learned { border-style: solid; border-color: rgba(var(--good-rgb), 0.3); background: rgba(var(--good-rgb), 0.06); }
.learned.fail { border-color: rgba(238, 35, 41, 0.35); background: rgba(238, 35, 41, 0.06); }
.recall .ico, .learned .ico { font-size: 14px; line-height: 19px; }
.learned .chips, .recall .chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.learned b { color: var(--good); font-weight: 600; }
.learning { display: inline-flex; align-items: center; gap: 8px; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--hi); animation: blink 1s infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.typing-cursor::after { content: "▍"; color: var(--hi); animation: blink 0.9s infinite; margin-left: 1px; }
.welcome { margin: auto 0; padding: 10px 4px 20px; }
.welcome h2 { font-size: 34px; margin: 4px 0 8px; }
.welcome p { color: var(--muted); margin-bottom: 18px; }
.starters { display: grid; gap: 8px; }
.starter { text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 11px 13px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.starter:hover { border-color: var(--hi); }
.starter span { font-size: 16px; line-height: 1.2; }
.composer { padding: 10px 12px 12px; border-top: 1px solid var(--line); background: var(--bg-2); }
.mode { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); margin-bottom: 8px; }
.mode button { border: 0; background: transparent; padding: 4px 10px; border-radius: 7px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.mode button.on { background: var(--panel-3); color: var(--text); }
.compose-box { display: flex; align-items: flex-end; gap: 8px; border: 1px solid var(--line-2); background: var(--panel); border-radius: 14px; padding: 6px 6px 6px 12px; }
.compose-box:focus-within { border-color: var(--hi); }
.compose-box textarea { flex: 1; border: 0; outline: none; background: transparent; resize: none; max-height: 180px; padding: 7px 0; line-height: 1.45; font-size: 14px; }
.send { width: 36px; height: 36px; border-radius: 11px; border: 0; background: var(--red); color: #fff; font-size: 17px; font-weight: 700; flex-shrink: 0; }
.send:disabled { background: var(--panel-3); }
.chat-reopen { position: absolute; right: 14px; top: 14px; z-index: 4; border: 0; background: var(--red); color: #fff; font-weight: 600; padding: 9px 14px; border-radius: 99px; box-shadow: var(--shadow); }

/* ---------- pages: notebook & sources ---------- */
.page { max-width: 1060px; margin: 0 auto; padding: 30px 28px 80px; }
.page-head { display: flex; gap: 20px; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h2 { font-size: 40px; margin-bottom: 6px; }
.page-head .muted { max-width: 600px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.nb-hero { padding: 26px 26px 24px; border-radius: 20px; background:
  radial-gradient(500px 220px at 100% 0%, rgba(238, 35, 41, 0.22), transparent 70%),
  radial-gradient(400px 200px at 0% 100%, rgba(var(--hi-rgb), 0.12), transparent 70%), var(--panel);
  border: 1px solid var(--line); margin-bottom: 18px; }
.nb-hero h1 { font-size: clamp(28px, 3.4vw, 42px); margin: 2px 0 12px; }
.nb-hero p { color: rgba(var(--fg), 0.85); font-size: 15px; max-width: 760px; }
.nb-meta { margin-top: 14px; font-size: 11.5px; color: var(--faint); display: flex; gap: 14px; flex-wrap: wrap; }
.nb-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.nb-card { padding: 18px 18px 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.nb-card.wide { grid-column: 1 / -1; }
.nb-card h3 { font-size: 21px; display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.nb-card h3 i { width: 11px; height: 11px; border-radius: 50%; background: var(--c); box-shadow: 0 0 12px var(--c); }
.nb-card > p { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.points { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.points li { font-size: 13.5px; line-height: 1.5; padding-left: 14px; position: relative; }
.points li::before { content: ""; position: absolute; left: 0; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--c, var(--faint)); }
.points .refs { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-left: 4px; vertical-align: middle; }
.ref { border: 0; background: rgba(var(--fg), 0.08); border-radius: 6px; padding: 0 6px; font-size: 10.5px; font-weight: 600; color: var(--muted); line-height: 18px; }
.ref:hover { background: var(--hi); color: var(--hi-ink); }
.when { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 2px 7px; border-radius: 99px; margin-right: 6px; vertical-align: 1px; }
.when.now { background: var(--red); color: #fff; }
.when.soon { background: rgba(var(--hi-rgb), 0.18); color: var(--hi); }
.when.later { background: rgba(var(--fg), 0.08); color: var(--muted); }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.theme { padding: 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.theme b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 17px; margin-bottom: 4px; color: var(--hi); }
.theme p { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.nb-section-title { font-family: var(--font-display); font-size: 24px; margin: 26px 0 12px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state h3 { font-size: 26px; color: var(--text); margin-bottom: 6px; }

.add-source { padding: 18px; margin-bottom: 22px; }
.drop { position: relative; border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 16px; text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 12px; transition: border-color 0.15s, background 0.15s; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop.over { border-color: var(--hi); background: rgba(var(--hi-rgb), 0.06); }
.drop small { display: block; color: var(--faint); font-size: 11.5px; margin-top: 2px; }
.drop strong { display: block; color: var(--hi); margin-top: 6px; font-weight: 600; }
.source-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.source { display: grid; grid-template-columns: 42px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.source .sico { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--panel-3); font-size: 18px; }
.source h4 { margin: 0 0 2px; font-size: 14.5px; font-weight: 600; }
.source p { font-size: 12.5px; color: var(--muted); }
.source .acts { display: flex; gap: 6px; }
.source.processing .sico { animation: blink 1.2s infinite; }
.source.error p { color: var(--bad); }

/* ---------- dialogs, menus, toast ---------- */
dialog { border: 1px solid var(--line-2); border-radius: 18px; background: var(--panel); color: var(--text); padding: 22px; width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(10, 6, 2, 0.7); backdrop-filter: blur(3px); }
dialog h2 { font-size: 28px; margin-bottom: 6px; }
dialog .lead { color: var(--muted); margin-bottom: 16px; font-size: 13.5px; }
dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
dialog pre.source-text { white-space: pre-wrap; background: var(--bg-2); border-radius: 12px; padding: 14px; max-height: 55vh; overflow: auto; font: 12.5px/1.55 var(--font-body); color: rgba(var(--fg), 0.85); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 13px; margin-bottom: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.ok { color: var(--good); }
.bad { color: var(--bad); }
.menu-pop { position: fixed; top: 54px; right: 12px; z-index: 30; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: grid; min-width: 200px; }
.menu-pop button { border: 0; background: transparent; text-align: left; padding: 9px 12px; border-radius: 8px; font-size: 13px; }
.menu-pop button:hover { background: rgba(var(--fg), 0.06); }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 50; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 13px; box-shadow: var(--shadow); transition: all 0.25s ease; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--red); color: #fff; }
.spinner { width: 14px; height: 14px; border: 2px solid rgba(var(--fg), 0.25); border-top-color: var(--hi); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- today, tasks, plan ---------- */
.page.wide { max-width: 1240px; }
.view-tab { position: relative; }
.tab-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; margin-left: 2px; }
.linkish { border: 0; background: none; padding: 0; color: var(--hi); font-weight: 600; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
:is(#today, #tasks, #plan) .card > h3 { font-size: 20px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.today-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.today-grid .card, .brief { padding: 18px; }
.today-grid .card .linkish { margin-top: 10px; display: inline-block; }
.brief { margin-bottom: 14px; border-top: 4px solid var(--red); background:
  radial-gradient(420px 180px at 100% 0%, rgba(var(--hi-rgb), 0.12), transparent 70%), var(--panel); }
.brief h3 { font-size: clamp(24px, 3vw, 32px); margin: 2px 0 10px; }
.brief.empty h3 { font-size: 24px; }
.brief .btn { margin-top: 12px; }
.top3 { margin: 0; padding-left: 22px; display: grid; gap: 8px; font-size: 15px; }
.top3 .refs { display: inline-flex; gap: 4px; flex-wrap: wrap; vertical-align: middle; }
.brief .note { margin-top: 12px; color: var(--muted); font-size: 13.5px; }
.qcard { border-left: 4px solid var(--c, var(--hi)); }
.qcard h3 { font-size: 21px; margin: 2px 0 12px; line-height: 1.2; }
.qcard .field { margin-bottom: 10px; }
.qcard-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.qcard-acts .muted { font-size: 12px; margin-left: auto; }
.moments { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.moments b { display: inline-block; min-width: 72px; color: var(--hi); font-weight: 700; }

.quick-add { display: flex; gap: 8px; margin-bottom: 18px; }
.quick-add input { flex: 1; min-width: 0; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font-size: 15px; }
.quick-add input:focus { outline: none; border-color: var(--hi); }
.task-group { margin-bottom: 18px; }
.task-group h3 { font-family: var(--font-body); font-size: 12px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.task-group.overdue h3 { color: var(--red); }
.task-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.task { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.task-list.compact .task { grid-template-columns: 26px minmax(0, 1fr); padding: 7px 8px; background: transparent; border-color: transparent; }
.task.done .task-title { text-decoration: line-through; color: var(--faint); }
.check { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--c, var(--line-2)); background: transparent; color: var(--bg); font-size: 14px; font-weight: 800; display: grid; place-items: center; padding: 0; }
.task.done .check { background: var(--good); border-color: var(--good); color: #fff; }
.check:hover { background: rgba(var(--good-rgb), 0.15); }
.task-main { min-width: 0; }
.task-title { border: 0; background: none; padding: 0; text-align: left; font-size: 14.5px; font-weight: 500; color: var(--text); width: 100%; overflow-wrap: anywhere; }
.task-title:hover { color: var(--hi); }
.task-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 3px; }
.task-meta i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--faint)); }
.due, .waiting { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: rgba(var(--fg), 0.08); color: var(--muted); }
.due.late { background: var(--red); color: #fff; }
.due.today { background: rgba(var(--hi-rgb), 0.2); color: var(--hi); }
.due.soon { background: rgba(var(--hi-rgb), 0.1); color: var(--text); }
.waiting { background: rgba(var(--fg), 0.06); font-weight: 600; }
.task-acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.task-acts .btn.small { padding: 5px 9px; font-size: 11.5px; }
.date-pick { position: relative; overflow: hidden; cursor: pointer; }
.date-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.stage-sum { display: flex; gap: 6px; flex-wrap: wrap; }
.stage-chip { display: inline-flex; align-items: center; border: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; padding: 3px 10px; border-radius: 99px; background: rgba(var(--fg), 0.08); color: var(--muted); }
.stage-chip.now { background: var(--red); color: #fff; }
.stage-chip.next { background: rgba(var(--hi-rgb), 0.2); color: var(--hi); }
.stage-chip.new { background: rgba(var(--good-rgb), 0.18); color: var(--good); }
.stage-chip.parked { background: rgba(var(--fg), 0.06); color: var(--faint); }
button.stage-chip:hover { filter: brightness(1.1); }
.waiting-strip { padding: 14px 16px; margin-bottom: 16px; }
.waiting-strip h3 { font-size: 16px; margin-bottom: 8px; }
.waiting-strip .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.wait-chip { display: inline-block; text-align: left; border: 1px solid rgba(238, 35, 41, 0.35); background: rgba(238, 35, 41, 0.08); color: var(--text); font-size: 12px; padding: 4px 10px; border-radius: 99px; margin-top: 6px; }
.wait-chip:hover { border-color: var(--red); }
.plan-group { margin-bottom: 22px; }
.plan-group > h3 { font-size: 22px; display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.gkey { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--text); color: var(--bg); font-size: 16px; }
.ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.ws { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--c, var(--line)); }
.ws.done { opacity: 0.55; }
.ws-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ws-num { font-family: var(--font-display); font-size: 22px; color: var(--c, var(--text)); line-height: 1; }
.ws-title { border: 0; background: none; padding: 0; text-align: left; font-family: var(--font-display); font-size: 18px; line-height: 1.15; color: var(--text); }
.ws-title:hover { color: var(--hi); }
.ws-lead { align-self: flex-start; border: 1px solid var(--line-2); background: transparent; border-radius: 99px; padding: 3px 10px; font-size: 12px; font-weight: 600; color: var(--text); }
.ws-lead.empty { border-style: dashed; color: var(--faint); }
.ws-lead:hover { border-color: var(--hi); color: var(--hi); }
.ws-foot { margin-top: auto; padding-top: 4px; font-size: 11.5px; color: var(--faint); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- themes ---------- */
/* Kopitiam day: the shop in daylight — cream paper, ink type, like 555 Queue. */
:root[data-theme="kopitiam"] {
  --bg: #f4f1d8;
  --bg-2: #efebcf;
  --panel: #fffef7;
  --panel-2: #faf7e6;
  --panel-3: #ebe5c9;
  --line: rgba(36, 22, 8, 0.12);
  --line-2: rgba(36, 22, 8, 0.22);
  --text: #241608;
  --muted: rgba(36, 22, 8, 0.68);
  --faint: rgba(36, 22, 8, 0.48);
  --fg: 36, 22, 8;
  --bg-rgb: 244, 241, 216;
  --panel-rgb: 255, 254, 247;
  --hi: #1a572b;
  --hi-rgb: 26, 87, 43;
  --hi-ink: #fffef7;
  --good: #1a572b;
  --good-rgb: 26, 87, 43;
  --bad: #b31018;
  --eyebrow: #ee2329;
  --shadow: 0 14px 36px rgba(36, 22, 8, 0.14);
  color-scheme: light;
}
:root[data-theme="kopitiam"] .msg.user { background: #241608; color: #f4f1d8; border-color: #241608; }
:root[data-theme="kopitiam"] .view-tab.active { background: #241608; color: #f4f1d8; }
:root[data-theme="kopitiam"] .nb-card, :root[data-theme="kopitiam"] .source { box-shadow: 0 6px 0 #e7e1c8; }

/* Order chit: a kitchen order ticket — thermal paper, black print, red stamp, mono type. */
:root[data-theme="chit"] {
  --bg: #fbfaf5;
  --bg-2: #f4f2ea;
  --panel: #ffffff;
  --panel-2: #f7f6f0;
  --panel-3: #ecebe3;
  --line: rgba(26, 26, 26, 0.2);
  --line-2: rgba(26, 26, 26, 0.38);
  --text: #1a1a1a;
  --muted: rgba(26, 26, 26, 0.68);
  --faint: rgba(26, 26, 26, 0.48);
  --red: #d8262c;
  --red-2: #b81e23;
  --fg: 26, 26, 26;
  --bg-rgb: 251, 250, 245;
  --panel-rgb: 255, 255, 255;
  --hi: #d8262c;
  --hi-rgb: 216, 38, 44;
  --hi-ink: #ffffff;
  --good: #2f5d3a;
  --good-rgb: 47, 93, 58;
  --bad: #d8262c;
  --eyebrow: #d8262c;
  --btn-alt: #1a1a1a;
  --btn-alt-ink: #ffffff;
  --radius: 4px;
  --shadow: 0 2px 0 rgba(26, 26, 26, 0.08);
  --font-body: "DM Mono", ui-monospace, Menlo, monospace;
  --font-display: "Space Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
:root[data-theme="chit"] h1, :root[data-theme="chit"] h2, :root[data-theme="chit"] h3, :root[data-theme="chit"] .display,
:root[data-theme="chit"] .brand-word, :root[data-theme="chit"] .nb-section-title, :root[data-theme="chit"] .theme b { font-weight: 700; text-transform: uppercase; letter-spacing: -0.5px; }
:root[data-theme="chit"] :is(.card, .nb-card, .nb-hero, .source, .stat, .chip, .activity, .zoom, .legend, .compose-box, .starter, .login-card, dialog, .msg.user, .theme, .views, .search, .ai-pill, .mode, .recall, .learned, .menu-pop, .chat-menu, .tip, .drop, .ws, .task, .quick-add input, .wait-chip, .ws-lead) { border-style: dashed; border-radius: 4px; }
:root[data-theme="chit"] :is(.btn, .icon-btn, .send, .view-tab, .cite, .status, .tag, .ref, .when, .field input, .field textarea, .field select, .chat-reopen) { border-radius: 3px; }
:root[data-theme="chit"] .nb-hero { background: var(--panel); border-top: 6px solid var(--red); }
:root[data-theme="chit"] #view-graph { background: var(--bg); }
:root[data-theme="chit"] .login { background: var(--bg); }
:root[data-theme="chit"] .msg.user { background: var(--panel-2); }
:root[data-theme="chit"] .btn.red, :root[data-theme="chit"] .send { text-transform: uppercase; letter-spacing: 0.6px; }
:root[data-theme="chit"] .node-card { border-top-style: solid; }
:root[data-theme="chit"] .keypad button { border-radius: 6px; border-style: dashed; }
:root[data-theme="chit"] .pin-dots i { border-radius: 2px; }

/* theme picker (⋯ menu) */
.menu-pop .menu-label { font-size: 10.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--faint); padding: 8px 12px 4px; }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }
#theme-opts { display: grid; }
.menu-pop .theme-opt { display: flex; align-items: center; gap: 10px; }
.sheet-handle { display: none; }
.menu-pop .theme-opt .sw { display: inline-flex; border-radius: 5px; overflow: hidden; border: 1px solid var(--line-2); flex-shrink: 0; }
.menu-pop .theme-opt .sw i { width: 9px; height: 16px; }
.menu-pop .theme-opt .tick { margin-left: auto; color: var(--hi); visibility: hidden; }
.menu-pop .theme-opt.on .tick { visibility: visible; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  :root { --chat-w: 370px; }
  .search { width: 180px; }
  .legend { display: none; }
}
/* ---------- Mission control: a black ops screen — mono type, hairlines, one orange ---------- */
:root[data-theme="control"] {
  --bg: #050505;
  --bg-2: #0a0a0a;
  --panel: #0c0c0c;
  --panel-2: #131313;
  --panel-3: #1b1b1b;
  --line: rgba(236, 236, 236, 0.12);
  --line-2: rgba(236, 236, 236, 0.24);
  --text: #ececec;
  --muted: rgba(236, 236, 236, 0.62);
  --faint: rgba(236, 236, 236, 0.4);
  --red: #ff6a1f;
  --red-2: #ff874a;
  --fg: 236, 236, 236;
  --bg-rgb: 5, 5, 5;
  --panel-rgb: 12, 12, 12;
  --hi: #ff6a1f;
  --hi-rgb: 255, 106, 31;
  --hi-ink: #050505;
  --good: #7ddc9a;
  --good-rgb: 125, 220, 154;
  --bad: #ff6a1f;
  --eyebrow: #ff6a1f;
  --btn-alt: #ececec;
  --btn-alt-ink: #050505;
  --radius: 2px;
  --shadow: none;
  --font-body: "DM Mono", ui-monospace, Menlo, monospace;
  --font-display: "Space Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}

/* Mission control light: the same ops screen on paper. Same pillar colours (validated on both). */
:root[data-theme="controllight"] {
  --bg: #f6f5f1;
  --bg-2: #efeee9;
  --panel: #ffffff;
  --panel-2: #f9f8f5;
  --panel-3: #ecebe6;
  --line: rgba(24, 24, 24, 0.13);
  --line-2: rgba(24, 24, 24, 0.26);
  --text: #181818;
  --muted: rgba(24, 24, 24, 0.66);
  --faint: rgba(24, 24, 24, 0.46);
  --red: #c2410c;
  --red-2: #9a3412;
  --fg: 24, 24, 24;
  --bg-rgb: 246, 245, 241;
  --panel-rgb: 255, 255, 255;
  --hi: #c2410c;
  --hi-rgb: 194, 65, 12;
  --hi-ink: #ffffff;
  --good: #15803d;
  --good-rgb: 21, 128, 61;
  --bad: #c2410c;
  --eyebrow: #c2410c;
  --btn-alt: #181818;
  --btn-alt-ink: #ffffff;
  --radius: 2px;
  --shadow: none;
  --font-body: "DM Mono", ui-monospace, Menlo, monospace;
  --font-display: "Space Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
:root:is([data-theme="control"], [data-theme="controllight"]) :is(h1, h2, h3, .display, .brand-word, .nb-section-title, .theme b) { font-weight: 700; text-transform: uppercase; letter-spacing: 0.2px; }
:root:is([data-theme="control"], [data-theme="controllight"]) .eyebrow::before { content: "// "; }
:root:is([data-theme="control"], [data-theme="controllight"]) :is(.card, .nb-card, .nb-hero, .source, .stat, .chip, .activity, .zoom, .legend, .compose-box, .starter, .login-card, dialog, .msg.user, .theme, .views, .search, .ai-pill, .mode, .recall, .learned, .menu-pop, .chat-menu, .tip, .drop, .ws, .task, .quick-add input, .wait-chip, .ws-lead) { border-radius: 2px; box-shadow: none; }
:root:is([data-theme="control"], [data-theme="controllight"]) :is(.btn, .icon-btn, .send, .view-tab, .cite, .status, .tag, .ref, .when, .field input, .field textarea, .field select, .chat-reopen, .keypad button, .pin-dots i) { border-radius: 2px; }
:root:is([data-theme="control"], [data-theme="controllight"]) :is(.btn.red, .send, .tag, .stat) { text-transform: uppercase; letter-spacing: 0.6px; }
/* White on this orange is too faint to read: dark ink instead. */
:root[data-theme="control"] :is(.btn.red, .send, .chat-reopen, .tab-count, .due.late, .when.now, .stage-chip.now, #toast.err) { color: #050505; }
:root:is([data-theme="control"], [data-theme="controllight"]) :is(#view-graph, .login) { background: var(--bg); }
:root:is([data-theme="control"], [data-theme="controllight"]) .brief { background: var(--panel); border-top-color: var(--hi); }
:root:is([data-theme="control"], [data-theme="controllight"]) .msg.user { background: var(--panel-2); }

/* The ring screen's colours: dark by default, paper in Mission control light. */
.mc, .mc-to-ring { --mc-bg: #050505; --mc-bg-rgb: 5, 5, 5; --mc-fg: 236, 236, 236; --mc-ink: #ececec; --mc-hot: #ff6a1f; --mc-live: #ff3b30; }
:root[data-theme="controllight"] :is(.mc, .mc-to-ring) { --mc-bg: #f6f5f1; --mc-bg-rgb: 246, 245, 241; --mc-fg: 24, 24, 24; --mc-ink: #181818; --mc-hot: #c2410c; --mc-live: #d92d20; }
.mc, .mc-to-ring { display: none; }
:root:is([data-theme="control"], [data-theme="controllight"]) #view-graph:not(.ring-mode) .mc-to-ring { display: block; position: absolute; top: 14px; right: 14px; z-index: 3; }
#view-graph.ring-mode > :is(#graph, .graph-hud, .zoom, .legend, .activity, .tip) { display: none; }
/* Laid out by the Graph pane's own width (it shrinks when the chat is open), not the window's. */
#view-graph.ring-mode { container: mc / inline-size; }
#view-graph.ring-mode .mc { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; background: var(--mc-bg); color: var(--mc-ink); font: 11px/1.5 "DM Mono", ui-monospace, Menlo, monospace; }
.stage.chat-hidden #view-graph .mc-top { padding-right: 170px; }
:root:is([data-theme="control"], [data-theme="controllight"]) .stage.chat-hidden #view-graph:not(.ring-mode) .mc-to-ring { top: 64px; }
.mc.stale .mc-live { color: rgba(var(--mc-fg), 0.45); }
.mc.stale .mc-live i { background: rgba(var(--mc-fg), 0.45); animation: none; }
.mc-live .off, .mc.stale .mc-live .on { display: none; }
.mc.stale .mc-live .off { display: inline; }
.mc .hot { color: var(--mc-hot); }
.mc .dim { color: rgba(var(--mc-fg), 0.4); }
.mc-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 26px; padding: 9px 16px; border-bottom: 1px solid rgba(var(--mc-fg), 0.13); text-transform: uppercase; letter-spacing: 0.6px; }
.mc-title b { display: block; font: 700 12.5px/1.25 "Space Mono", ui-monospace, monospace; letter-spacing: 0.3px; }
.mc-title span { display: block; color: rgba(var(--mc-fg), 0.42); font-size: 9.5px; }
.mc-cells { display: flex; gap: 26px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.mc-cells::-webkit-scrollbar { display: none; }
.mc-cell { white-space: nowrap; }
.mc-cell > span { display: block; color: rgba(var(--mc-fg), 0.42); font-size: 9px; }
.mc-cell b { font-weight: 500; font-size: 13px; }
.mc-cell small { margin-left: 5px; font-size: 10px; color: rgba(var(--mc-fg), 0.5); }
.mc-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.mc-switch { border: 1px solid rgba(var(--mc-fg), 0.28); background: rgba(var(--mc-bg-rgb), 0.85); color: var(--mc-ink); font: 500 10.5px/1 "DM Mono", ui-monospace, monospace; text-transform: uppercase; letter-spacing: 0.6px; padding: 7px 10px; border-radius: 2px; }
.mc-switch:hover { border-color: var(--mc-hot); color: var(--mc-hot); }
.mc-live { display: flex; align-items: center; gap: 6px; color: var(--mc-live); font-weight: 700; }
.mc-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--mc-live); animation: blink 1.4s ease-in-out infinite; }
.mc-stage { position: relative; min-height: 0; }
.mc-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.mc-stage canvas:focus-visible { outline: 1px solid rgba(var(--mc-fg), 0.5); outline-offset: -4px; }
.mc-hint { position: absolute; left: 16px; bottom: 10px; margin: 0; color: rgba(var(--mc-fg), 0.38); font-size: 10px; letter-spacing: 0.4px; text-transform: uppercase; pointer-events: none; }
.mc-zoom { position: absolute; right: 12px; bottom: 10px; display: flex; flex-direction: column; border: 1px solid rgba(var(--mc-fg), 0.22); background: rgba(var(--mc-bg-rgb), 0.85); }
.mc-zoom button { width: 32px; height: 30px; border: 0; background: none; color: var(--mc-ink); font: 500 15px/1 "DM Mono", ui-monospace, monospace; }
.mc-zoom button + button { border-top: 1px solid rgba(var(--mc-fg), 0.14); }
.mc-zoom button:hover { color: var(--mc-hot); }
.mc .mc-dot { display: inline-block; width: 6px; height: 6px; margin-right: 7px; vertical-align: 1px; background: rgba(var(--mc-fg), 0.18); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Full screen: the Graph pane takes the screen; the ring gets the room, the panels stay underneath, shorter. */
#view-graph:is(.is-full, .mc-full) { position: fixed; inset: 0; z-index: 60; background: var(--mc-bg); }
#view-graph.mc-full { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#view-graph:is(.is-full, .mc-full) .mc { display: grid !important; grid-template-rows: minmax(0, 1fr); overflow: hidden !important; }
#view-graph:is(.is-full, .mc-full) :is(.mc-top, .mc-panels) { display: none; }
#view-graph:is(.is-full, .mc-full) .mc-stage { height: auto; min-height: 0; }
#view-graph:is(.is-full, .mc-full) .mc-stage canvas { touch-action: none; }
#view-graph:is(.is-full, .mc-full) .node-card { z-index: 5; }
/* The full-screen switch lives on the ring, top right. */
.mc-fs { position: absolute; top: 10px; right: 12px; z-index: 2; display: flex; align-items: center; gap: 6px; }
.mc-fs .ico { font-size: 13px; line-height: 1; }
/* Hairlines between panels come from the 1px gaps, so any column count works. */
.mc-panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: rgba(var(--mc-fg), 0.13); border-top: 1px solid rgba(var(--mc-fg), 0.13); }
.mc-panel { height: 152px; overflow: hidden; padding: 9px 14px 10px; background: var(--mc-bg); }
.mc-panel > header { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; text-transform: uppercase; letter-spacing: 0.6px; font-size: 9.5px; color: rgba(var(--mc-fg), 0.45); }
.mc-panel > header b { color: var(--mc-ink); font-weight: 700; }
.mc-log { list-style: none; margin: 0; padding: 0; }
.mc-log li > * { display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 0; border: 0; background: none; font: inherit; line-height: 1.62; text-align: left; color: rgba(var(--mc-fg), 0.7); }
.mc-log li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-log li em { font-style: normal; flex: none; color: rgba(var(--mc-fg), 0.45); }
.mc-log button:hover, .mc-log button:focus-visible { color: var(--mc-ink); }
.mc-bars { list-style: none; margin: 0; padding: 0; }
.mc-bars li { display: grid; grid-template-columns: 78px minmax(0, 1fr) 34px; align-items: center; gap: 10px; line-height: 1.62; color: rgba(var(--mc-fg), 0.75); }
.mc-bars li > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-bars li > b { font-weight: 500; text-align: right; }
.mc-bars i { display: block; height: 5px; background: rgba(var(--mc-fg), 0.09); }
.mc-bars s { display: block; height: 100%; background: var(--mc-hot); }
.mc-jobs li { grid-template-columns: 106px minmax(0, 1fr) 84px; }
.mc-jobs s { background: rgba(var(--mc-fg), 0.7); }
.mc-jobs s.hot { background: var(--mc-hot); }
.mc-jobs em { font-style: normal; text-align: right; color: rgba(var(--mc-fg), 0.55); white-space: nowrap; }
.mc-budget { display: flex; align-items: center; gap: 16px; }
.mc-gauge { position: relative; width: 92px; height: 92px; flex: none; }
.mc-gauge svg { width: 100%; height: 100%; }
.mc-gauge circle { fill: none; stroke-width: 2.5; }
.mc-gauge .track { stroke: rgba(var(--mc-fg), 0.16); }
.mc-gauge .fill { stroke: var(--mc-hot); }
.mc-gauge b { position: absolute; inset: 0; display: grid; place-items: center; font: 700 20px/1 "Space Mono", ui-monospace, monospace; }
.mc-gauge-text p { margin: 0 0 3px; color: rgba(var(--mc-fg), 0.7); }
.mc-heat { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); grid-auto-rows: 6px; gap: 2px; }
.mc-heat i { background: rgba(var(--mc-fg), calc(0.05 + var(--v) * 0.8)); }
.mc-heat i.hot { background: var(--mc-hot); }
.mc-flow { display: flex; align-items: flex-end; gap: 4px; height: 104px; }
.mc-flow i { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.mc-flow s { display: block; background: rgba(var(--mc-fg), 0.2); }
.mc-flow s.on { background: rgba(var(--mc-fg), 0.78); }
.mc-flow s.hot { background: var(--mc-hot); }
@container mc (max-width: 1080px) {
  .mc-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mc-cells { order: 3; width: 100%; }
}
/* A narrow pane (phone, or a small window with the chat open): one scrolling column. */
@container mc (max-width: 720px) {
  .mc { display: block !important; overflow-y: auto; overscroll-behavior: contain; }
  .mc-top { gap: 8px 12px; padding: 10px 12px; }
  .mc-cells { gap: 18px; }
  .mc-stage { height: 56vh; min-height: 300px; }
  .mc-stage canvas { touch-action: pan-y; } /* one finger still scrolls the column; pinch and sideways drags go to the ring */
  .mc-hint { display: none; }
  .mc-fs .lbl { display: none; }
  .mc-panels { grid-template-columns: minmax(0, 1fr); }
  .mc-panel { height: auto; min-height: 118px; }
  .mc-heat { grid-auto-rows: 7px; }
}
@media (max-width: 900px) {
  :root:is([data-theme="control"], [data-theme="controllight"]) #view-graph:not(.ring-mode) .mc-to-ring { top: auto; bottom: 64px; right: 10px; }
  .stage.chat-hidden #view-graph .mc-top { padding-right: 12px; }
}

@media (max-width: 900px) {
  :root { --top-h: 56px; --safe-top: env(safe-area-inset-top); --nav-h: calc(62px + env(safe-area-inset-bottom)); }
  body { font-size: 14px; }
  .app { grid-template-rows: calc(var(--top-h) + var(--safe-top)) minmax(0, 1fr); }
  /* backdrop-filter would trap the fixed bottom tab bar inside the header */
  .top {
    position: relative; gap: 8px; backdrop-filter: none; background: var(--bg);
    padding: var(--safe-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  }
  .brand img { width: 50px; }
  .brand-word { font-size: 19px; }
  .desktop-only { display: none !important; }
  .mobile-only { display: flex !important; }
  .top-right { gap: 8px; min-width: 0; }
  .icon-btn { width: 40px; height: 40px; font-size: 18px; border-radius: 11px; }
  .ai-pill span { display: none; }
  .ai-pill { padding: 0; width: 40px; height: 40px; justify-content: center; }
  /* "+ Thought" becomes a round + */
  #thought-btn { width: 40px; height: 40px; padding: 0; border-radius: 50%; font-size: 22px; line-height: 1; }
  #thought-btn .label { display: none; }
  /* search: an icon that opens a bar over the header */
  .search { display: none; }
  .top.searching .search {
    display: flex; position: absolute; z-index: 3; left: 10px; right: 10px; top: calc(var(--safe-top) + 8px);
    width: auto; height: 40px; background: var(--bg-2); border-color: var(--hi);
  }
  .top.searching .search kbd { display: none; }

  /* Every typed field at 16px, or iOS zooms the page on focus. */
  .field input, .field textarea, .field select, .compose-box textarea, .search input, .link-search input, .log-filters input { font-size: 16px; }

  .stage, .stage.chat-hidden { grid-template-columns: minmax(0, 1fr); }
  .stage { padding-bottom: var(--nav-h); }
  .stage.chat-hidden .chat { display: none; }
  .chat { grid-column: 1; border-left: 0; display: none; }
  .chat.active { display: flex; }
  .messages, .view.scroll, .node-card, .chat-menu { overscroll-behavior: contain; }
  .messages { padding: 14px 14px 8px; }
  .msg.user { max-width: 92%; }
  .composer { padding: 8px 10px 10px; }
  .send { width: 40px; height: 40px; }

  .views {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; border-radius: 0; border: 0; border-top: 1px solid var(--line);
    padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    justify-content: space-around; background: rgba(var(--bg-rgb), 0.97);
  }
  .view-tab { flex-direction: column; gap: 1px; font-size: 11px; padding: 6px 10px; flex: 1; min-height: 50px; justify-content: center; position: relative; }
  .view-tab .ico { font-size: 18px; }
  .view-tab.unread::after { content: ""; position: absolute; top: 6px; left: calc(50% + 10px); width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--bg); }
  /* With the keyboard up, give the screen to the text box. */
  body.kb-open .views { display: none; }
  body.kb-open .stage { padding-bottom: 0; }

  /* graph HUD: one swipeable row each */
  .graph-hud { top: 10px; left: 10px; right: 10px; gap: 8px; }
  .stats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px; }
  .stats::-webkit-scrollbar { display: none; }
  .stat { flex-shrink: 0; padding: 5px 10px; font-size: 11.5px; }
  .stat b { font-size: 15px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; max-width: none; padding-bottom: 2px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .chip { min-height: 32px; padding: 4px 12px 4px 10px; }
  .zoom { right: 10px; bottom: 10px; }
  .zoom [data-zoom="in"], .zoom [data-zoom="out"] { display: none; }
  .zoom button { width: 44px; height: 44px; }
  .activity { width: auto; left: 10px; right: 64px; bottom: 10px; }
  .activity-head { min-height: 44px; }
  .activity:not(.closed) ol { max-height: 140px; }

  /* memory card = bottom sheet */
  .node-card {
    left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 64%;
    border-radius: 18px 18px 0 0; padding: 22px 16px 18px; border-left: 0; border-right: 0; border-bottom: 0;
    animation: sheet-up 0.24s ease; touch-action: pan-y;
  }
  .node-card .close { top: 14px; right: 12px; }
  .node-card .card-actions .btn { flex: 1; min-height: 42px; }
  .links-list button { min-height: 40px; }
  .sheet-handle { display: block; position: absolute; top: 7px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 99px; background: var(--line-2); }
  @keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }

  /* dialogs = bottom sheets */
  dialog {
    width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 20px 20px 0 0; border-bottom: 0;
    padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 88dvh; animation: sheet-up 0.24s ease;
  }
  dialog .actions .btn { flex: 1; min-height: 46px; }
  .menu-pop { top: calc(var(--safe-top) + 52px); right: 10px; min-width: 230px; }
  .menu-pop button { padding: 12px 14px; font-size: 14px; }
  .chat-menu .open { padding: 11px 12px; }

  .page { padding: 20px 16px 40px; }
  .page-head h2 { font-size: 32px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; min-height: 42px; }
  .nb-grid { grid-template-columns: 1fr; }
  .nb-hero { padding: 20px; }
  .source { grid-template-columns: 36px 1fr; }
  .source .sico { width: 36px; height: 36px; }
  .source .acts { grid-column: 1 / -1; }
  .source .acts .btn { flex: 1; min-height: 40px; }
  .add-source .row.end { flex-direction: column-reverse; align-items: stretch; }
  .add-source .row.end .btn { min-height: 46px; }
  .today-grid { grid-template-columns: minmax(0, 1fr); }
  .task { grid-template-columns: 28px minmax(0, 1fr); }
  .task-acts { grid-column: 2; justify-content: flex-start; }
  .check { width: 28px; height: 28px; }
  .ws-grid { grid-template-columns: minmax(0, 1fr); }
  .view-tab { padding: 6px 4px; }
  .tab-count { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; }
  .qcard-acts .btn { flex: 1; min-height: 40px; }
  .quick-add input { font-size: 16px; }
}
@media (max-width: 900px) and (max-height: 720px) {
  .keypad { grid-template-columns: repeat(3, 62px); gap: 10px 16px; }
  .keypad button { width: 62px; height: 62px; font-size: 24px; }
  .login-card { padding: 22px 20px; }
  .login-logo { width: 90px; margin-bottom: 10px; }
  .login-card h1 { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- learning log ---------- */
.log-filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 18px; }
.log-filters .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.log-filters .chip { border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); border-radius: 99px; padding: 5px 11px; font-size: 12.5px; }
.log-filters .chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.log-filters input[type="search"] { flex: 1 1 200px; min-width: 0; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); border-radius: var(--radius); padding: 8px 12px; }
.log-batch { padding: 16px 18px; margin-bottom: 12px; }
.log-batch.undone { opacity: 0.6; }
.log-head { display: flex; gap: 14px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 8px; }
.log-head h3 { font-size: 17px; margin: 2px 0 4px; overflow-wrap: anywhere; }
.log-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.log-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.log-row { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.log-row:last-child { border-bottom: 0; }
.log-row.undone .log-what { text-decoration: line-through; color: var(--faint); }
.log-what { flex: 1 1 320px; min-width: 0; font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; }
.log-what > b { font-weight: 600; margin-right: 4px; }
.log-node { font-size: inherit; text-decoration-color: var(--c, currentColor); }
.log-gone { color: var(--faint); font-style: italic; }
.log-label { font-style: normal; font-size: 12px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 99px; padding: 0 7px; margin: 0 4px; }
.log-body { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.log-field { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.log-f { display: inline-block; min-width: 76px; color: var(--faint); text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.6px; }
.log-field del { color: var(--bad); text-decoration-thickness: 1px; }
.log-field ins { color: var(--text); text-decoration: none; background: rgba(var(--good-rgb), 0.12); padding: 0 3px; }
.log-field details del, .log-field details ins { display: block; margin-top: 4px; white-space: pre-wrap; }
.log-badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted); }
.log-badge.warn { color: var(--hi); border-color: rgba(var(--hi-rgb), 0.5); }
.log-edit { flex: 1 1 100%; display: grid; gap: 8px; padding: 10px 0 2px; }
.log-edit .row { display: flex; gap: 8px; flex-wrap: wrap; }
.log-conflict { border: 1px solid rgba(var(--hi-rgb), 0.5); background: rgba(var(--hi-rgb), 0.08); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; font-size: 13.5px; }
.log-conflict ul { margin: 6px 0 10px; padding-left: 18px; }
.log-conflict .row { display: flex; gap: 8px; }
.log-more { display: block; margin: 8px auto 0; }
.log-note { font-size: 12px; margin-top: 18px; text-align: center; }
.log-nudge { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 16px 18px; margin-bottom: 14px; border-left: 4px solid var(--hi); border-radius: 0 var(--radius) var(--radius) 0; }
.log-nudge h3 { font-size: 18px; margin: 2px 0 4px; }
.log-doc { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; }

/* ---------- bin ---------- */
.log-head-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bin-row { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; padding: 14px 16px; }
.bin-main { min-width: 0; flex: 1; }
.bin-main h3 { font-size: 16px; margin: 0 0 6px; overflow-wrap: anywhere; }
.bin-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12.5px; }
.bin-meta .log-body { flex-basis: 100%; }
.bin-type { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--faint); }
.bin-pillar { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.bin-pillar i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.bin-when { font-size: 12px; margin: 8px 0 0; }
