:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-2: #f0f2f5;
  --line: #e2e5ea;
  --text: #171a21;
  --muted: #69707d;
  --accent: #5865f2;
  --accent-text: #ffffff;
  --ok: #1f9d55;
  --warn: #b7791f;
  --bad: #d63d3d;
  --info: #2f6fd6;
  --log-bg: #0f1117;
  --log-text: #d7dbe3;
  --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 4px 16px rgb(0 0 0 / 4%);
  --radius: 12px;
  color-scheme: light;
}
/* Dark mode: follows Windows unless you pick Light or Dark in the sidebar (data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1015;
    --panel: #161920;
    --panel-2: #1d2029;
    --line: #2a2e39;
    --text: #e6e8ee;
    --muted: #8b92a1;
    --accent: #7983ff;
    --ok: #3ccf7a;
    --warn: #e5b04a;
    --bad: #ff6b6b;
    --info: #6aa5ff;
    --log-bg: #0a0c10;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0e1015;
    --panel: #161920;
    --panel-2: #1d2029;
    --line: #2a2e39;
    --text: #e6e8ee;
    --muted: #8b92a1;
    --accent: #7983ff;
    --ok: #3ccf7a;
    --warn: #e5b04a;
    --bad: #ff6b6b;
    --info: #6aa5ff;
    --log-bg: #0a0c10;
    --shadow: none;
    color-scheme: dark;
  }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif; }
code, pre, .mono { font-family: "Cascadia Mono", Consolas, ui-monospace, monospace; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; }
h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.muted { color: var(--muted); }
.tiny { font-size: 11px; }
.small-text { font-size: 12px; }
[hidden] { display: none !important; }

.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { align-self: start; background: var(--panel); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; padding: 0 6px 12px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); position: relative; }
.brand-mark::before { content: ""; position: absolute; inset: 11px 8px 7px; background: #fff; border-radius: 5px; }
.brand-mark::after { content: ""; position: absolute; left: 12px; top: 18px; width: 3px; height: 3px; border-radius: 50%; background: var(--accent); box-shadow: 7px 0 0 var(--accent); }
.brand-name { font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 11px; color: var(--muted); }
.side-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 8px; }
.bot-list { display: flex; flex-direction: column; gap: 4px; }
.bot-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; border: 1px solid transparent; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; width: 100%; }
.bot-item:hover { background: var(--panel-2); }
.bot-item[aria-current="true"] { background: var(--panel-2); border-color: var(--line); }
.bot-item .name { font-weight: 600; }
.bot-item .state { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }

.avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; }
.avatar svg { width: 18px; height: 18px; }
.avatar.big { width: 48px; height: 48px; border-radius: 14px; }
.avatar.big svg { width: 26px; height: 26px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.dot.running { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.dot.waiting, .dot.starting, .dot.stopping { background: var(--warn); }
.dot.crashed, .dot.needs-setup { background: var(--bad); }

.main { padding: 26px 32px 90px; min-width: 0; max-width: 1200px; }
.bot-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.bot-title { display: flex; gap: 14px; align-items: center; }
.bot-meta { display: flex; gap: 10px; align-items: center; margin-top: 4px; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel-2); border: 1px solid var(--line); }
.pill.running { color: var(--ok); }
.pill.crashed, .pill.needs-setup { color: var(--bad); }
.pill.waiting, .pill.stopping { color: var(--warn); }

.btn { font: inherit; font-weight: 600; border-radius: 9px; padding: 8px 14px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover:not(:disabled) { background: var(--panel-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); background: var(--accent); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.danger-text { color: var(--bad); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .tab:focus-visible, .bot-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 22px 0 18px; overflow-x: auto; }
.tab { font: inherit; font-weight: 600; background: none; border: none; color: var(--muted); padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

.grid.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card + .card { margin-top: 16px; }
.grid .card + .card { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 10px; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; cursor: pointer; }
.notice { border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn) 10%, var(--panel)); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; }
.notice.bad { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: color-mix(in srgb, var(--bad) 8%, var(--panel)); }

input[type="checkbox"][role="switch"] { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; flex: none; transition: background .15s; margin: 0; }
input[type="checkbox"][role="switch"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgb(0 0 0 / 25%); }
input[type="checkbox"][role="switch"]:checked { background: var(--accent); }
input[type="checkbox"][role="switch"]:checked::after { transform: translateX(16px); }

input[type="text"], input[type="search"], input[type="password"], input[type="number"], input[type="time"], select, textarea {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; width: 100%; min-width: 0;
}
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input[type="search"] { max-width: 280px; }
.spacer { flex: 1; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }

.log { background: var(--log-bg); color: var(--log-text); border-radius: var(--radius); padding: 14px 16px; margin: 0; height: calc(100vh - 290px); min-height: 320px; overflow: auto; font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.log.mini { height: 200px; min-height: 0; }
.log .ln { display: block; }
.log .t { color: #6b7280; margin-right: 8px; user-select: none; }
.log .err { color: #ff8a8a; }
.log .warn { color: #f3c969; }
.log .sys { color: #8ab4ff; font-weight: 600; }
.log .ok { color: #7ee2a8; }

#settings-form { display: flex; flex-direction: column; gap: 14px; }
details.section { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
details.section > summary { cursor: pointer; padding: 14px 18px; font-weight: 600; list-style: none; display: flex; gap: 12px; align-items: center; }
details.section > summary > span + span { margin-left: auto; font-weight: 400; }
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary::after { content: "▸"; color: var(--muted); transition: transform .15s; }
details.section[open] > summary::after { transform: rotate(90deg); }
.fields { padding: 0 18px 8px; }
.field { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: 6px 20px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.field label.name { font-weight: 600; display: block; }
.field .key { font-size: 11px; color: var(--muted); font-family: "Cascadia Mono", Consolas, monospace; }
.field.compact { grid-template-columns: 150px minmax(0, 1fr); align-items: center; padding: 8px 0; }
.field.compact .inline-form > select, .field.compact .inline-form > input:not([type=checkbox]) { flex: 1; max-width: none; }
.field .help { grid-column: 2; font-size: 12px; color: var(--muted); margin-top: -2px; }
.field.dirty label.name::after { content: " •"; color: var(--accent); }
.secret-row { display: flex; gap: 6px; }
.savebar { position: fixed; bottom: 18px; left: calc(250px + 32px); right: 32px; max-width: 1136px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 30px rgb(0 0 0 / 18%); padding: 10px 14px; display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.savebar #dirty-count { margin-right: auto; font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .v { font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .k { color: var(--muted); font-size: 12px; margin-top: 2px; }
.server-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.chip-btn { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 999px; padding: 5px 12px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
td.num { font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: none; }
.user { display: flex; gap: 10px; align-items: center; min-width: 180px; }
.user img, .user .ph { width: 28px; height: 28px; border-radius: 50%; background: var(--panel-2); flex: none; }
.pips { display: inline-flex; gap: 3px; vertical-align: middle; }
.pips i { width: 10px; height: 10px; border-radius: 3px; background: var(--line); display: inline-block; }
.pips i.on { background: var(--warn); }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); white-space: nowrap; }
.tag.bad { color: var(--bad); }
.tag.warn { color: var(--warn); }
.tag.ok { color: var(--ok); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: nowrap; }
.feed { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow: auto; }
.feed li { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 22px 1fr; gap: 8px; }
.feed li:last-child { border-bottom: none; }
.feed .ic { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; }
.feed .ic.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); }
.feed .ic.mute { background: color-mix(in srgb, var(--bad) 18%, transparent); }
.feed .ic.staff { background: color-mix(in srgb, var(--ok) 18%, transparent); }
.feed .quote { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px 2px 10px; font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; }
.chip.severe { border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); color: var(--bad); }
.chip button { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 2px 6px; border-radius: 999px; }
.chip button:hover { background: var(--line); color: var(--text); }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input[type="text"] { max-width: 240px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.sub { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 2px; }
.empty-state { padding: 26px 10px; text-align: center; color: var(--muted); }
.empty { max-width: 560px; margin: 80px auto; text-align: center; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .2s; max-width: min(90vw, 560px); z-index: 10; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.bad { background: var(--bad); color: #fff; }

@media (max-width: 1000px) {
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .grid.cards { grid-template-columns: minmax(0, 1fr); }
  .bot-item { flex: none; }
  .sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--line); }
  .bot-list { flex-direction: row; overflow-x: auto; }
  .bot-item { width: auto; }
  .side-foot { display: none; }
  .main { padding: 18px 16px 90px; }
  .field { grid-template-columns: 1fr; }
  .field.compact { grid-template-columns: 150px minmax(0, 1fr); align-items: center; padding: 8px 0; }
.field.compact .inline-form > select, .field.compact .inline-form > input:not([type=checkbox]) { flex: 1; max-width: none; }
.field .help { grid-column: 1; }
  .savebar { left: 16px; right: 16px; }
  .log { height: 60vh; }
}

/* link status */
.link-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.link-status .dot { background: var(--ok); }
.link-status.down .dot { background: var(--bad); }

/* home */
.home-avatar { background: var(--accent); position: relative; }
.home-avatar::before, .home-avatar::after { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 2px; background: #fff; }
.home-avatar::before { left: 9px; top: 9px; box-shadow: 9px 0 0 #fff; }
.home-avatar::after { left: 9px; top: 18px; box-shadow: 9px 0 0 #fff; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 22px; }
.bot-card { display: flex; flex-direction: column; gap: 12px; }
.bot-card .top { display: flex; gap: 12px; align-items: center; }
.bot-card .top h2 { font-size: 17px; }
.bot-card .lines { display: flex; flex-direction: column; gap: 4px; min-height: 64px; font-size: 13px; }
.bot-card .lines .big { font-size: 20px; font-weight: 700; }
.bot-card .row-actions { justify-content: flex-start; margin-top: auto; }
.log .who { font-weight: 700; margin-right: 8px; display: inline-block; min-width: 72px; }
.home-grid .card + .card { margin-top: 0; }
.chips.people { margin: 4px 0 0; }
.feed-card { margin-top: 16px; }
.log.mini.tall { height: 320px; }

/* theme picker */
.theme-picker { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.theme-picker button { flex: 1; font: inherit; font-size: 12px; font-weight: 600; border: 0; border-radius: 7px; padding: 5px 6px; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.theme-picker button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / 12%); }
.theme-picker svg { width: 14px; height: 14px; }

.setup-frame { width: 100%; height: calc(100vh - 200px); min-height: 520px; border: 1px solid var(--line); border-radius: var(--radius); background: #0f1115; display: block; }
#log-kind { width: auto; }
a.btn { text-decoration: none; }

/* Dashboard results: verses, hadith, answers */
.result { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.result:empty { margin-top: 0; }
.passage { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.passage .ar { font-size: 20px; line-height: 2; direction: rtl; text-align: right; margin-bottom: 8px; }
.passage a { color: var(--info); }
.bad-text { color: var(--bad); }
.feed.plain li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.feed.plain li:last-child { border-bottom: 0; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }

/* Tick-boxes laid out as pickable pills — Jarvis's language list. */
.choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; }
.choices .choice { display: inline-flex; align-items: center; gap: 7px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 7px 12px; cursor: pointer; font-size: 13px; user-select: none; }
.choices .choice:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.choices .choice:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel-2)); font-weight: 600; }
.choices .choice input { accent-color: var(--accent); margin: 0; }
.choices .choice:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.field.stacked { display: block; }
.field.stacked .help { margin: 2px 0 8px; max-width: 72ch; }

/* Tiny bar chart for a 14-day series. */
.spark { display: flex; align-items: flex-end; gap: 3px; height: 44px; margin: 4px 0 12px; }
.spark-bar { flex: 1; min-width: 4px; background: color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 3px 3px 0 0; }
.spark-bar:hover { background: var(--accent); }

/* Spend card: a service split bar, coloured dots and a taller sparkline. */
.spark.tall { height: 60px; }
.split-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; margin: 2px 0 10px; background: var(--panel-2); }
.split-bar .seg { min-width: 2px; }
.seg-brain, .dot-brain { background: var(--accent); }
.seg-stt, .dot-stt { background: #22a06b; }
.seg-tts, .dot-tts { background: #e2a03f; }
.seg-search, .dot-search { background: #b56ad6; }
.dot-kind { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* The one dialog in the app (price editing). */
.modal { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); padding: 0; width: min(760px, 92vw); max-height: 86vh; }
.modal::backdrop { background: rgb(0 0 0 / 45%); }
.modal .card-head { padding: 14px 18px; border-bottom: 1px solid var(--line); margin: 0; }
.modal-body { padding: 14px 18px; overflow: auto; max-height: 62vh; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }

/* ── expanded spend / swear cards ───────────────────────────────────────────
   A readable trend (labelled days, today and peak marked) and proportion
   meters, so the numbers say something without being hovered. */
.trend-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 2px 0 4px; }
.trend { display: flex; align-items: flex-end; gap: 3px; height: 72px; margin: 0 0 14px; }
.trend-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: stretch; gap: 3px; height: 100%; }
.trend-track { flex: 1; display: flex; align-items: flex-end; background: color-mix(in srgb, var(--panel-2) 70%, transparent); border-radius: 3px; overflow: hidden; }
.trend-fill { width: 100%; border-radius: 3px 3px 0 0; transition: filter .12s; }
.trend-col:hover .trend-fill { filter: brightness(1.35); }
.trend-fill.is-peak { outline: 1px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: -1px; }
.trend-day { font-size: 9px; line-height: 1; text-align: center; color: var(--muted); overflow: hidden; }
.trend-col.is-today .trend-day { color: var(--accent); font-weight: 700; }
.trend-col.is-today .trend-track { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }

.meters { display: grid; gap: 8px; margin: 4px 0 14px; }
.meter-row { display: grid; gap: 3px; }
.meter-label { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.meter { height: 7px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 999px; background: var(--accent); min-width: 2px; }
.meter.slim { height: 5px; width: 64px; display: inline-block; vertical-align: middle; margin-right: 6px; }

th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--text); }
th.sorted { color: var(--accent); }
.sort-caret { font-size: 10px; }
.tag.warn { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); color: var(--warn); }

:root { --seg-brain: var(--accent); --seg-stt: #22a06b; --seg-tts: #e2a03f; --seg-search: #b56ad6; }

/* ── memory vault editor ────────────────────────────────────────────────────
   A list of notes beside the one you're reading, so editing a person's note
   feels like opening it in Obsidian rather than filling in a form. */
.vault-wrap { display: grid; grid-template-columns: minmax(180px, 250px) 1fr; gap: 14px; align-items: start; }
.vault-list { max-height: 460px; overflow-y: auto; display: grid; gap: 10px; align-content: start; }
.vault-group-head { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 0 4px 4px; }
.vault-item { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; width: 100%; text-align: left;
  font: inherit; color: inherit; background: none; border: 1px solid transparent; border-radius: 8px; padding: 6px 9px; cursor: pointer; }
.vault-item:hover { background: var(--panel-2); }
.vault-item.is-open { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.vault-item-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vault-pane { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-height: 240px; display: grid; gap: 10px; align-content: start; }
.vault-pane.empty { display: grid; place-items: center; text-align: center; padding: 28px 18px; }
.vault-pane-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.vault-editor { width: 100%; min-height: 340px; resize: vertical; font-family: "Cascadia Mono", Consolas, monospace; font-size: 12.5px; line-height: 1.55;
  background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; }
.vault-editor:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: -1px; }
.ok-text { color: #22a06b; }
@media (max-width: 760px) { .vault-wrap { grid-template-columns: 1fr; } .vault-list { max-height: 220px; } }
