/* Layout: an observatory console. Star chart (knowledge graph) dominates; a right rail holds what needs you
   (approvals) above the live log. On phones the panels become tabs with a bottom bar. */
:root {
  color-scheme: dark;
  --ink: #070a17;          /* night sky */
  --ink-2: #0d1226;        /* raised panel */
  --ink-3: #151b36;        /* inputs, hover */
  --line: #222a4d;         /* hairlines, chart grid */
  --star: #eef0ff;         /* primary text */
  --dim: #8d94c2;          /* secondary text */
  --faint: #59608c;        /* tertiary text */
  --amber: #ffc56b;        /* accent: starlight */
  --amber-ink: #2a1a00;
  --ok: #2fd8a4;
  --warn: #ffd23f;
  --bad: #ff5c7a;
  --f-display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --f-rune: "Noto Sans Runic", "Segoe UI Historic", "Segoe UI Symbol", sans-serif;
  --r: 10px;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --ink: #f3f1ea; --ink-2: #fbfaf6; --ink-3: #e9e6dc; --line: #d6d2c4;
    --star: #161a33; --dim: #4c5277; --faint: #7d829f;
    --amber: #b86a00; --amber-ink: #fff6e6;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --ink: #f3f1ea; --ink-2: #fbfaf6; --ink-3: #e9e6dc; --line: #d6d2c4;
  --star: #161a33; --dim: #4c5277; --faint: #7d829f;
  --amber: #b86a00; --amber-ink: #fff6e6;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--star);
  font: 14px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.app {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  padding-inline: 16px;
  padding-block: 0 12px;
}

/* ---------- Top bar ---------- */
.top {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding-block: 12px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand svg { width: 44px; height: 44px; flex: none; }
.wordmark {
  font: 600 20px/1 var(--f-display);
  letter-spacing: 0.22em; text-transform: uppercase;
}
.wordmark small {
  display: block; margin-top: 4px;
  font: 500 10px/1 var(--f-mono); letter-spacing: 0.14em; color: var(--dim);
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px;
  font: 500 11px/1.4 var(--f-mono); letter-spacing: 0.04em; color: var(--dim);
  background: var(--ink-2); white-space: nowrap;
}
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.chip.on i { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.chip.warn i { background: var(--warn); }
.chip.off i { background: var(--bad); }
.gauge { width: 70px; height: 4px; border-radius: 2px; background: var(--ink-3); overflow: hidden; }
.gauge b { display: block; height: 100%; background: var(--amber); width: 0; transition: width .6s; }
.iconbtn {
  border: 1px solid var(--line); background: var(--ink-2); border-radius: 8px;
  width: 32px; height: 32px; display: grid; place-items: center; color: var(--dim);
}
.iconbtn:hover { color: var(--star); border-color: var(--faint); }

/* ---------- Main grid ---------- */
.main {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "sky rail" "tasks rail";
  gap: 12px;
  padding-top: 12px;
}
.panel {
  background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r);
  min-width: 0; min-height: 0;
}
.panel-h {
  display: flex; align-items: baseline; gap: 8px;
  padding: 12px 14px 8px;
  font: 600 11px/1 var(--f-display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim);
}
.panel-h .count { font-family: var(--f-mono); color: var(--faint); letter-spacing: 0; }
.panel-h .spacer { flex: 1; }

/* Sky / graph */
.sky { grid-area: sky; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.sky canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.sky .overlay-top {
  position: relative; z-index: 2; display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap;
  padding: 12px 14px; pointer-events: none;
}
.sky .overlay-top > * { pointer-events: auto; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font: 11px var(--f-mono); color: var(--faint); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; }
.legend .sq { border-radius: 2px; }
.coords { margin-left: auto; font: 11px var(--f-mono); color: var(--faint); text-align: right; }
.command {
  position: relative; z-index: 2; margin-top: auto;
  display: flex; gap: 8px; padding: 12px;
}
.command input {
  flex: 1; min-width: 0;
  background: color-mix(in srgb, var(--ink) 80%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 999px; padding: 11px 18px;
}
.command input::placeholder { color: var(--faint); }
.btn {
  border: 1px solid var(--line); background: var(--ink-3); border-radius: 999px;
  padding: 8px 16px; font-weight: 600; white-space: nowrap;
}
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); }
.btn.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.btn.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn.small { padding: 5px 12px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }

/* Rail */
.rail { grid-area: rail; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 12px; min-height: 0; }
.rail > .panel { display: flex; flex-direction: column; }
.scroll { overflow-y: auto; min-height: 0; overscroll-behavior: contain; }

.agents { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 4px 10px 12px; }
.agent {
  display: grid; justify-items: center; gap: 2px; padding: 8px 4px;
  border: 1px solid transparent; border-radius: 8px; background: none; text-align: center;
}
.agent:hover { background: var(--ink-3); }
.agent .g { font-family: var(--f-rune); font-size: 20px; line-height: 1; color: var(--c); position: relative; }
.agent .n { font: 600 12px var(--f-display); letter-spacing: .04em; }
.agent .s { font: 10px var(--f-mono); color: var(--faint); }
.agent.working .s { color: var(--ok); }
.agent.paused .s { color: var(--warn); }
.agent.working .g::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 1.5px solid var(--c); border-right-color: transparent; animation: spin 1.2s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.approvals { max-height: 42vh; }
.approval {
  margin: 0 10px 10px; padding: 12px; border-radius: 8px;
  background: var(--ink); border: 1px solid var(--line); border-left: 3px solid var(--bad);
  display: grid; gap: 8px;
}
.approval h4 { margin: 0; font: 600 14px/1.3 var(--f-body); text-wrap: balance; }
.approval .meta { font: 11px var(--f-mono); color: var(--faint); }
.approval .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.approval details summary { cursor: pointer; color: var(--dim); font-size: 12px; }
.empty { padding: 4px 14px 14px; color: var(--faint); font-size: 13px; }

.feed { list-style: none; margin: 0; padding: 0 6px 8px; }
.feed li {
  display: grid; grid-template-columns: 52px 1fr; gap: 8px; padding: 6px 8px; border-radius: 6px;
  animation: drop .5s ease-out;
}
.feed li:hover { background: var(--ink-3); }
.feed time { font: 11px/1.7 var(--f-mono); color: var(--faint); font-variant-numeric: tabular-nums; }
.feed .who { font-weight: 600; }
.feed .kind { font: 10px var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-left: 4px; }
.feed .what { color: var(--dim); overflow-wrap: anywhere; }
@keyframes drop { from { opacity: .3; transform: translateY(-4px); } }

/* Task board */
.tasks { grid-area: tasks; display: flex; flex-direction: column; max-height: 34vh; }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 0 10px 10px; min-height: 0; overflow: hidden; flex: 1; }
.col { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.col-h { font: 600 10px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 0 4px 6px; display: flex; justify-content: space-between; }
.col .scroll { display: grid; gap: 6px; align-content: start; }
.task {
  padding: 8px 10px; border-radius: 6px; background: var(--ink); border: 1px solid var(--line);
  display: grid; gap: 4px; text-align: left; width: 100%;
}
.task:hover { border-color: var(--faint); }
.task .t { font-size: 12.5px; line-height: 1.35; overflow-wrap: anywhere; }
.task .m { display: flex; gap: 6px; align-items: center; font: 10.5px var(--f-mono); color: var(--faint); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--faint)); flex: none; }
.risk { padding: 0 5px; border-radius: 3px; font: 600 9.5px/1.6 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; }
.risk.low { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.risk.medium { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.risk.high { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }

/* Drawer */
.drawer {
  position: fixed; z-index: 20; top: 0; right: 0; bottom: 0; width: min(440px, 100%);
  background: var(--ink-2); border-left: 1px solid var(--line);
  padding: calc(16px + env(safe-area-inset-top, 0px)) 18px calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 14px; overflow-y: auto;
  transform: translateX(105%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  box-shadow: -20px 0 60px rgba(0,0,0,.35);
}
.drawer.open { transform: none; }
.drawer header { display: flex; gap: 12px; align-items: center; }
.drawer .big { font-family: var(--f-rune); font-size: 30px; color: var(--c); line-height: 1; }
.drawer h2 { margin: 0; font: 600 20px/1.2 var(--f-display); letter-spacing: .04em; }
.drawer .sub { color: var(--dim); font-size: 13px; }
.drawer header .iconbtn { margin-left: auto; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.stat b { display: block; font: 600 18px var(--f-mono); font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; color: var(--faint); }
.drawer h3 { margin: 6px 0 0; font: 600 11px var(--f-display); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.output {
  background: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 12px;
  font-size: 13px; overflow-wrap: anywhere;
}
.output p { margin: 0 0 8px; }
.output ul { margin: 0 0 8px; padding-left: 18px; }
.output code { font: 12px var(--f-mono); background: var(--ink-3); padding: 1px 4px; border-radius: 3px; }
.output pre { overflow-x: auto; background: var(--ink-3); padding: 8px; border-radius: 6px; }
.output pre code { background: none; padding: 0; }
.output h4 { margin: 8px 0 4px; font-size: 13px; }
.drawer textarea { width: 100%; min-height: 70px; background: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; resize: vertical; }
.scrim { position: fixed; inset: 0; z-index: 19; background: rgba(3,5,12,.45); opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.open { opacity: 1; pointer-events: auto; }

/* Login */
/* ---------- The gate (sign-in): always a night sky, whatever the theme ---------- */
.gate {
  position: fixed; inset: 0; z-index: 30; overflow: hidden auto;
  background: #05070f; color: #eef0ff; color-scheme: dark;
  --g-ink: rgba(9, 12, 30, .72); --g-line: rgba(139, 124, 255, .35); --g-dim: #a3a9d6;
}
.gate.leaving { opacity: 0; transition: opacity .35s ease; }
#gate-sky { position: fixed; inset: 0; display: block; cursor: crosshair; touch-action: manipulation; }
.gate-inner {
  position: relative; min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: calc(24px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
  pointer-events: none; text-align: center;
}
.gate-inner > * { pointer-events: auto; }
.gate-hero { display: grid; justify-items: center; gap: 4px; pointer-events: none; }
.gate-logo { width: 104px; height: 104px; filter: drop-shadow(0 0 18px rgba(255, 197, 107, .45)); animation: gate-float 6s ease-in-out infinite; }
.gate-kicker { font: 600 11px/1.4 var(--f-display); letter-spacing: .32em; text-transform: uppercase; color: #ffc56b; }
.gate-kicker .runic { font-family: var(--f-rune); letter-spacing: .2em; margin-right: .6em; opacity: .85; }
.gate-title {
  margin: 0; font: 600 clamp(40px, 9vw, 76px)/1 var(--f-display); letter-spacing: .04em;
  background: linear-gradient(100deg, #fff8e6 0%, #ffc56b 25%, #c9d1ff 50%, #8b7cff 75%, #fff8e6 100%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gate-shimmer 9s linear infinite; text-shadow: 0 0 40px rgba(139, 124, 255, .25);
}
.gate-tag { margin: 2px 0 0; color: var(--g-dim); font-size: 15px; }
.gate-card {
  width: min(440px, 100%); display: grid; gap: 10px; padding: 18px;
  background: var(--g-ink); border: 1px solid var(--g-line); border-radius: 14px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .03) inset, 0 20px 60px rgba(0, 0, 0, .5), 0 0 50px rgba(139, 124, 255, .12);
}
.gate-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 10px; background: rgba(5, 7, 15, .6); border: 1px solid rgba(255, 255, 255, .06); }
.gate-tabs button { border: 0; background: none; color: var(--g-dim); padding: 8px; border-radius: 7px; font: 600 13px var(--f-display); letter-spacing: .05em; transition: background .2s, color .2s; }
.gate-tabs button[aria-selected="true"] { background: rgba(139, 124, 255, .22); color: #fff; box-shadow: 0 0 0 1px rgba(139, 124, 255, .45) inset; }
.gate-card[data-mode="forgot"] .gate-tabs, .gate-card[data-mode="reset"] .gate-tabs, .gate-card[data-mode="token"] .gate-tabs { display: none; }
.gate-title-sm { margin: 2px 0 0; font: 500 13px/1.4 var(--f-display); letter-spacing: .06em; color: #c9d1ff; text-align: left; }
.gate-card .f { display: none; gap: 5px; font: 500 12px var(--f-display); letter-spacing: .05em; color: var(--g-dim); text-align: left; }
.gate-card[data-mode="signin"] :is(.f-login, .f-password),
.gate-card[data-mode="signup"] :is(.f-username, .f-email, .f-password),
.gate-card[data-mode="forgot"] .f-login,
.gate-card[data-mode="reset"] .f-password,
.gate-card[data-mode="token"] .f-token { display: grid; }
.gate-card .f input {
  width: 100%; background: rgba(5, 7, 15, .7); border: 1px solid var(--g-line); border-radius: 9px;
  padding: 11px 12px; color: #eef0ff; font: 15px var(--f-body); letter-spacing: 0; transition: border-color .2s, box-shadow .2s;
}
.gate-card .f input:focus { outline: none; border-color: #ffc56b; box-shadow: 0 0 0 3px rgba(255, 197, 107, .2); }
.gate-msg { padding: 10px 12px; border-radius: 9px; background: rgba(47, 216, 164, .12); border: 1px solid rgba(47, 216, 164, .45); color: #c8f7e8; font-size: 13px; text-align: left; }
.gate-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; }
.gate-links button { background: none; border: 0; padding: 2px 0; color: #8d94c2; font: 12px var(--f-body); text-decoration: underline; text-underline-offset: 3px; }
.gate-links button:hover { color: #ffc56b; }
.gate-card .l-back { display: none; }
.gate-card:is([data-mode="forgot"], [data-mode="reset"], [data-mode="token"]) .l-back { display: inline; }
.gate-card:is([data-mode="forgot"], [data-mode="reset"], [data-mode="token"]) :is(.l-forgot, .l-token) { display: none; }
.gate-card[data-mode="signup"] .l-forgot { visibility: hidden; }
.gate-card.no-signup #tab-signup { display: none; }
.gate-card.no-signup .gate-tabs { grid-template-columns: 1fr; }
.gate-go[disabled] { opacity: .6; cursor: progress; }
.gate-go { position: relative; overflow: hidden; white-space: nowrap; }
.gate-go span { font-family: var(--f-rune); margin-right: 4px; }
.gate-go::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  transform: translateX(-100%); animation: gate-sweep 4s ease-in-out infinite;
}
.gate .err { color: #ff8da2; min-height: 1.2em; font-size: 13px; text-align: left; }
.gate .err:empty { display: none; }
.gate-watch { display: flex; align-items: center; gap: 8px; font: 12px var(--f-mono); color: var(--g-dim); text-align: left; }
.gate-watch i { width: 8px; height: 8px; border-radius: 50%; background: #2fd8a4; box-shadow: 0 0 0 0 rgba(47, 216, 164, .6); animation: gate-ping 2s infinite; flex: none; }
.gate-gods { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 560px; }
.gate-gods button {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; border-radius: 999px;
  background: rgba(9, 12, 30, .6); border: 1px solid rgba(255, 255, 255, .08); color: #c9d1ff;
  font: 500 12px var(--f-display); letter-spacing: .05em; transition: transform .2s, border-color .2s, box-shadow .2s;
}
.gate-gods button span {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  font: 14px var(--f-rune); color: #fff8e6; background: color-mix(in srgb, var(--god) 35%, transparent);
  border: 1px solid var(--god);
}
.gate-gods button:hover, .gate-gods button[aria-current] {
  transform: translateY(-2px); border-color: var(--god); box-shadow: 0 0 18px color-mix(in srgb, var(--god) 45%, transparent); color: #fff;
}
.gate-god {
  width: min(440px, 100%); display: flex; gap: 12px; align-items: center; text-align: left;
  padding: 12px 14px; border-radius: 12px; background: var(--g-ink); border: 1px solid var(--god);
  box-shadow: 0 0 30px color-mix(in srgb, var(--god) 30%, transparent); animation: gate-rise .3s ease;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.gate-god.empty { --god: rgba(139, 124, 255, .35); box-shadow: none; animation: none; }
.gate-god.empty .gate-god-rune { color: #8b7cff; }
.gate-god-rune { font: 30px var(--f-rune); color: var(--god); text-shadow: 0 0 14px var(--god); width: 40px; text-align: center; flex: none; }
.gate-god b { font: 600 15px var(--f-display); letter-spacing: .04em; }
.gate-god small { display: block; color: var(--god); font: 11px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; }
.gate-god p { margin: 4px 0 0; color: var(--g-dim); font-size: 13px; }
.gate-hint { margin: 0; color: #59608c; font: 11px var(--f-mono); letter-spacing: .04em; pointer-events: none; }
@keyframes gate-float { 50% { transform: translateY(-8px); } }
@keyframes gate-shimmer { to { background-position: -250% 0; } }
@keyframes gate-sweep { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes gate-ping { 0% { box-shadow: 0 0 0 0 rgba(47, 216, 164, .6); } 80%, 100% { box-shadow: 0 0 0 8px rgba(47, 216, 164, 0); } }
@keyframes gate-rise { from { opacity: 0; transform: translateY(6px); } }
@media (max-width: 520px) {
  .gate-logo { width: 80px; height: 80px; }
  .gate-tag { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .gate-logo, .gate-title, .gate-go::after, .gate-watch i, .gate-god { animation: none; }
}

.toast {
  position: fixed; z-index: 40; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 20px); opacity: 0; transition: .25s;
  background: var(--star); color: var(--ink); padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 13px;
  max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Mobile tab bar */
.tabbar { display: none; }

@media (max-width: 1100px) {
  .main { grid-template-columns: minmax(0, 1fr) 320px; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .app { padding-block: 0 calc(64px + env(safe-area-inset-bottom, 0px)); }
  .top { gap: 10px; padding-block: 10px; }
  .brand svg { width: 36px; height: 36px; }
  .wordmark { font-size: 16px; }
  .chips .chip.hide-sm { display: none; }
  .main { display: block; position: relative; padding-top: 10px; }
  .main > [data-tab] { display: none; height: 100%; }
  .main > [data-tab].active { display: flex; }
  .rail { gap: 10px; }
  .rail.active { display: grid !important; grid-template-rows: auto auto minmax(0, 1fr); }
  .approvals { max-height: none; }
  .tasks { max-height: none; }
  .board { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .board .col .scroll { overflow: visible; }
  .coords { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(3, 1fr);
    position: fixed; z-index: 10; left: 0; right: 0; bottom: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--ink-2) 92%, transparent); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
  }
  .tabbar button {
    background: none; border: 0; padding: 6px; display: grid; justify-items: center; gap: 2px;
    color: var(--faint); font: 600 10px var(--f-display); letter-spacing: .1em; text-transform: uppercase; position: relative;
  }
  .tabbar button svg { width: 22px; height: 22px; }
  .tabbar button[aria-selected="true"] { color: var(--amber); }
  .tabbar .badge {
    position: absolute; top: 2px; left: calc(50% + 6px); min-width: 16px; height: 16px; border-radius: 8px;
    background: var(--bad); color: #fff; font: 600 10px/16px var(--f-mono); padding: 0 4px; letter-spacing: 0;
  }
  .tabbar .badge:empty { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}

/* ---------- Accounts (drawer) ---------- */
.acct-list { display: grid; gap: 8px; }
.acct { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--ink-2); }
.acct b { font: 600 14px var(--f-display); letter-spacing: .03em; }
.acct .sub { grid-column: 1; }
.acct .acts { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font: 600 10px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; border: 1px solid currentColor; margin-left: 6px; vertical-align: 1px; }
.pill.ok { color: var(--ok); } .pill.warn { color: var(--warn); } .pill.dim { color: var(--faint); }
