/* QWERTY Server · console de administração (Blazor). Tokens and pieces from the console mockups
   ("QWERTY Server — console de administração"): dark is the default; [data-theme="light"] swaps surfaces and ink
   for the Serigy light tokens. Keep this file in step with the mockups' admin.css. */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("fonts/IBMPlexSans-Regular.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url("fonts/IBMPlexSans-Medium.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("fonts/IBMPlexSans-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 700; font-display: swap; src: url("fonts/IBMPlexSans-Bold.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("fonts/IBMPlexMono-Regular.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("fonts/IBMPlexMono-Medium.ttf") format("truetype"); }
:root {
  /* Serigy, dark */
  --surface-000: #0e0e0e;
  --surface-100: #161616;
  --surface-200: #212121;
  --surface-300: #434343;
  --hairline: #2e2e2e;
  --ink: #f4f7f5;
  --ink-muted: #aab5b0;
  --ink-subtle: #7d8883;
  --brand-aqua: #30ffeb;
  --brand-mint: #74ffcf;
  --brand-lime: #b8ffb3;
  --green-500: #2db790;
  --green-700: #14765b;
  --green-800: #10604a;
  --green-900: #0c4939;
  --green-950: #0c3127;
  --primary: #74ffcf;
  --on-primary: #0e0e0e;
  --warning: #ffc857;
  --danger: #ff8a80;
  --info: #7fd6ff;

  /* NEW — one more neutral step: the chat canvas sits between page and panels */
  --surface-050: #121212;
  --hairline-strong: #3a3a3a;

  /* NEW — Bot identity hues: marks only (avatar tile, 2px tab rule, typing dots), never large fills or body text */
  --bot-mint: #74ffcf;   --bot-mint-deep: #0c4939;
  --bot-sky: #8ec5ff;    --bot-sky-deep: #14324d;
  --bot-sand: #f2cf96;   --bot-sand-deep: #4a3613;
  --bot-rose: #ffa3b1;   --bot-rose-deep: #4d1f27;
  --bot-lime: #b8ffb3;   --bot-lime-deep: #24401c;

  /* NEW — the machine zone: where a Bot acts (computer, terminal, activity) */
  --machine-000: #08201a;
  --machine-100: #0c3127;
  --machine-200: #10403a;
  --machine-line: #1d5446;
  --machine-ink: #d8f5e9;
  --machine-prompt: #74ffcf;
  --machine-out: #b8ffb3;

  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--surface-000); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- Type: the app ramp (NEW roles marked in Fundamentos) ---------- */
.t-hero { font: 700 48px/1.05 var(--sans); letter-spacing: -0.015em; margin: 0; }
.t-page { font: 600 28px/1.15 var(--sans); letter-spacing: -0.01em; margin: 0; }
.t-title { font: 600 20px/1.3 var(--sans); margin: 0; }
.t-item { font: 600 15px/1.35 var(--sans); margin: 0; }
.t-body { font: 400 16px/1.6 var(--sans); margin: 0; }
.t-ui { font: 400 15px/1.45 var(--sans); margin: 0; }
.t-small { font: 400 13px/1.45 var(--sans); color: var(--ink-muted); margin: 0; }
.t-label { font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-subtle); margin: 0; }
.t-meta { font: 400 12px/1.3 var(--mono); color: var(--ink-subtle); font-variant-numeric: tabular-nums; margin: 0; }
.t-code { font: 400 13px/1.6 var(--mono); margin: 0; }
.muted { color: var(--ink-muted); }
.subtle { color: var(--ink-subtle); }
.mint { color: var(--accent); }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent; font: 600 14px/1 var(--sans); cursor: pointer; white-space: nowrap; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--hairline-strong); }
.btn-ghost { background: transparent; color: var(--ink-muted); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--err-line); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 8px; background: transparent; border: 1px solid transparent; color: var(--ink-muted); display: inline-flex; align-items: center; justify-content: center; }
.btn-icon.on { background: var(--surface-200); color: var(--ink); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font: 500 13px/1 var(--sans); color: var(--ink-muted); }
.input { height: 44px; border-radius: 6px; border: 1px solid var(--hairline-strong); background: var(--surface-100); color: var(--ink); padding: 0 14px; font: 400 15px/1 var(--sans); width: 100%; }
.input.focus { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
textarea.input { height: auto; padding: 12px 14px; line-height: 1.5; resize: none; }
.kbd { font: 500 11px/1 var(--mono); color: var(--ink-subtle); border: 1px solid var(--hairline-strong); border-radius: 4px; padding: 3px 5px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 4px; font: 500 11px/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; }
.pill-ok { background: var(--ok-bg); color: var(--accent); }
.pill-warn { background: var(--warn-bg); color: var(--warning); }
.pill-off { background: var(--surface-200); color: var(--ink-subtle); }
.pill-info { background: var(--info-bg); color: var(--info); }
.dot { width: 6px; height: 6px; border-radius: 3px; display: inline-block; }
.toggle { width: 36px; height: 20px; border-radius: 10px; background: var(--surface-300); position: relative; flex: none; border: 0; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 7px; background: var(--ink-muted); }
.toggle.on { background: var(--primary); }
.toggle.on::after { left: 19px; background: var(--on-primary); }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-100); border: 1px solid var(--hairline); border-radius: 8px; }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-muted); font: 500 13px/1 var(--sans); }
.seg button.on { background: var(--surface-300); color: var(--ink); }

/* ---------- Avatars: Bot tiles (identity hue on its deep pair) and the person ---------- */
.bot { width: 28px; height: 28px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font: 600 13px/1 var(--sans); flex: none; }
.bot-lg { width: 40px; height: 40px; border-radius: 8px; font-size: 16px; }
.bot-sm { width: 20px; height: 20px; border-radius: 4px; font-size: 10px; }
.b-mint { background: var(--bot-mint-deep); color: var(--bot-mint); }
.b-sky { background: var(--bot-sky-deep); color: var(--bot-sky); }
.b-sand { background: var(--bot-sand-deep); color: var(--bot-sand); }
.b-rose { background: var(--bot-rose-deep); color: var(--bot-rose); }
.b-lime { background: var(--bot-lime-deep); color: var(--bot-lime); }
.me { width: 32px; height: 32px; border-radius: 8px; background: var(--green-700); color: #f4f7f5; display: inline-flex; align-items: center; justify-content: center; font: 600 13px/1 var(--sans); flex: none; }

/* ---------- Shell ---------- */
.app { display: flex; height: 100%; width: 100%; overflow: hidden; background: var(--surface-000); }
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; flex: none; display: flex; align-items: center; gap: 16px; padding: 0 32px; border-bottom: 1px solid var(--hairline); }
.topbar .grow { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.page { flex: 1 1 auto; overflow: hidden; padding: 24px 32px; }
.card { background: var(--surface-100); border: 1px solid var(--hairline); border-radius: 8px; }
.row { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; }
.hr { height: 1px; background: var(--hairline); flex: none; }

/* ---------- Sidebar ---------- */
.side { width: 264px; height: 100%; flex: none; background: var(--surface-100); border-right: 1px solid var(--hairline); display: flex; flex-direction: column; }
.side-bot { height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: 6px; color: var(--ink); }
.side-bot.on { background: var(--surface-200); }
.side-bot .name { font: 600 14px/1 var(--sans); flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-row { height: 36px; display: flex; align-items: center; gap: 12px; padding: 0 10px; border-radius: 6px; color: var(--ink-muted); font: 500 14px/1 var(--sans); }
.nav-row svg { flex: none; }
.nav-row.on { background: var(--surface-200); color: var(--ink); }
.nav-row .count { margin-left: auto; }
.search { height: 36px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--hairline); color: var(--ink-subtle); font: 400 13px/1 var(--sans); background: var(--surface-000); }
.working { display: inline-flex; gap: 3px; align-items: center; }
.working i { width: 4px; height: 4px; border-radius: 2px; background: currentColor; display: block; }
.working i:nth-child(1) { opacity: 1; } .working i:nth-child(2) { opacity: .6; } .working i:nth-child(3) { opacity: .3; }

/* ================= ADMIN: peças do console ================= */
.tnum { font-variant-numeric: tabular-nums; }
.pill-err { background: var(--err-bg); color: var(--danger); }
.dot-ok { background: var(--accent); } .dot-warn { background: var(--warning); } .dot-err { background: var(--danger); } .dot-off { background: var(--ink-subtle); }

/* KPI: o número é o conteúdo; rótulo em mono, variação em meta. Sem card quando o título resolve. */
.kpi { display: flex; flex-direction: column; gap: 8px; padding: 16px 20px; border-radius: 8px; background: var(--surface-100); border: 1px solid var(--hairline); min-width: 0; }
.kpi .v { font: 600 28px/1.1 var(--sans); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; margin: 0; }
.kpi .v small { font: 400 15px/1 var(--sans); color: var(--ink-muted); margin-left: 4px; letter-spacing: 0; }
.up { color: var(--accent); } .down { color: var(--danger); }

/* Tabelas: linha inteira clicável, hover surface-100 (linha selecionada surface-200), divisor hairline */
.th { font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-subtle); }
.tr { display: grid; align-items: center; gap: 16px; min-height: 52px; padding: 0 12px; border-bottom: 1px solid var(--hairline); color: inherit; }
.tr.head { min-height: 36px; }
.tr.hover { background: var(--surface-100); }
.tr.sel { background: var(--surface-200); }
.chev { color: var(--ink-subtle); flex: none; }

/* Filtros: chips quadrados (sem pills), estado ativo = surface-300 + ink, nunca muda de peso */
.chip { height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--hairline-strong); background: transparent; color: var(--ink-muted); font: 500 13px/1 var(--sans); cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--surface-300); border-color: var(--surface-300); color: var(--ink); }
.chip .x { color: var(--ink-subtle); }

/* Gráficos: grade hairline sólida, eixos em meta, marcas finas, ponta 4px arredondada, base reta, 2px de folga */
.grid-line { height: 1px; background: var(--hairline); }
.axis { font: 400 11px/1 var(--mono); color: var(--ink-subtle); font-variant-numeric: tabular-nums; }
.col { display: flex; flex-direction: column; }
.stack { display: flex; flex-direction: column-reverse; gap: 2px; width: 100%; max-width: 18px; }
.seg-a { background: var(--chart-a); }
.seg-b { background: var(--chart-b); }
.stack > :last-child { border-radius: 4px 4px 0 0; }
.hbar { height: 12px; border-radius: 0 4px 4px 0; background: var(--chart-a); }
.hbar-track { height: 12px; background: transparent; flex: 1; display: flex; gap: 2px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; display: inline-block; }
.tip { background: var(--surface-200); border: 1px solid var(--hairline-strong); border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 180px; }

/* Medidores: trilho surface-200, preenchimento green-500; acima do limite vira warning, com palavra */
.meter { height: 6px; border-radius: 3px; background: var(--surface-200); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 3px; background: var(--chart-a); }
.meter.warn > i { background: var(--warning); }
.meter.err > i { background: var(--danger); }
.meter.m > i { background: var(--accent); }

/* Painel de detalhe: entra pela direita, distance-md, duration-enter, ease-out */
.panel { position: absolute; top: 0; right: 0; bottom: 0; background: var(--surface-100); border-left: 1px solid var(--hairline-strong); display: flex; flex-direction: column; }
.panel-h { height: 64px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 24px; border-bottom: 1px solid var(--hairline); }

/* Zona da máquina: o que um Bot executa. Igual nos dois temas. */
.machine { background: var(--machine-000); border: 1px solid var(--machine-line); border-radius: 8px; color: var(--machine-ink); }
.term { font: 400 12.5px/1.65 var(--mono); color: var(--machine-ink); margin: 0; white-space: pre; }
.term .p { color: var(--machine-prompt); } .term .o { color: var(--machine-out); } .term .d { color: #7fa89a; }
.machine .t-meta { color: #8fb8a8; }

/* Alertas: estado no ícone e na borda, nunca só cor */
.alert { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 14px; border-radius: 8px; background: var(--surface-100); border: 1px solid var(--hairline); }
.alert.warn { border-color: var(--warn-line); } .alert.err { border-color: var(--err-line); }
.kbd-mask { font: 400 13px/1 var(--mono); color: var(--ink-muted); letter-spacing: 0.02em; }

/* ================= TEMAS ================= */
/* Papéis usados no console, escuro (padrão) */
:root, [data-theme="dark"] {
  --accent: #74ffcf; --focus: #74ffcf; --success: #74ffcf;
  --ok-bg: #123a2e; --warn-bg: #3d3112; --info-bg: #13303d; --err-bg: #3d1a17;
  --warn-line: #5a4a1f; --err-line: #5a2f2c;
  --chart-a: #2db790; --chart-b: #c5c5c5; --gray-400: #c5c5c5;
  --heat-0: #0c3127; --heat-1: #10604a; --heat-2: #14765b; --heat-3: #2db790; --heat-4: #74ffcf;
  --heat-ink-lo: #d8f5e9; --heat-ink-hi: #0e0e0e;
  --veil: rgba(14,14,14,0.45);
}
/* Claro: tokens light da Serigy (os mesmos do tema claro do app). Mint vira green-700. */
[data-theme="light"] {
  --surface-000: #f6f8f7; --surface-050: #f1f4f2; --surface-100: #ffffff; --surface-200: #eef2f0; --surface-300: #dfe5e2;
  --hairline: #d0d8d4; --hairline-strong: #b9c4bf;
  --ink: #0e0e0e; --ink-muted: #4c5a54; --ink-subtle: #66736d;
  --primary: #14765b; --on-primary: #ffffff;
  --accent: #14765b; --focus: #14765b; --success: #14765b;
  --warning: #8a5a00; --danger: #b3261e; --info: #0b5e8a;
  --ok-bg: #dcf1e8; --warn-bg: #fbefd6; --info-bg: #dcedf7; --err-bg: #fbe3e1;
  --warn-line: #e2c27a; --err-line: #e6a59f;
  --chart-a: #269b7a; --chart-b: #10604a;
  --heat-0: #e3f3ec; --heat-1: #a9dcc8; --heat-2: #2db790; --heat-3: #14765b; --heat-4: #0c3127;
  --heat-ink-lo: #0e0e0e; --heat-ink-hi: #ffffff;
  --veil: rgba(14,14,14,0.28);
  color-scheme: light;
}
[data-theme="light"] .toggle.on::after { background: #ffffff; }
[data-theme="light"] .toggle::after { background: #ffffff; }
[data-theme="light"] .toggle { background: #b9c4bf; }
[data-theme="light"] .toggle.on { background: var(--primary); }
[data-theme="light"] .side, [data-theme="light"] .panel { background: #ffffff; }

/* ================= LIVE: what the mockups drew as states ================= */
html, body { height: 100%; }
body { background: var(--surface-000); }
.app { height: 100vh; }
.page { overflow-y: auto; }
.side .nav-row:hover, .side-bot:hover { background: var(--surface-200); color: var(--ink); }
a.tr:hover { background: var(--surface-100); }
.btn-ghost:hover { color: var(--ink); }
.btn-secondary:hover { background: var(--surface-200); }
.seg button { cursor: pointer; }
.seg button:hover:not(.on) { color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Chart: each column shows its tooltip in place on hover (no motion) */
.chart-col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; border-radius: 4px 4px 0 0; }
.chart-col:hover { background: var(--surface-200); }
.chart-col .tip { position: absolute; top: 8px; left: calc(100% + 6px); z-index: 2; pointer-events: none; }
.chart-col.last .tip { left: auto; right: calc(100% + 6px); }
.stack > i { display: block; }
/* Bots: the whole row is a button that opens the Bot's instructions beneath it */
button.tr { width: 100%; border: 0; border-bottom: 1px solid var(--hairline); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
button.tr:hover { background: var(--surface-100); }
button.tr.sel { background: var(--surface-200); }
.bot-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 24px; padding: 16px 12px 20px 52px; border-bottom: 1px solid var(--hairline); background: var(--surface-050); }
.instructions { margin: 0; max-height: 240px; overflow: auto; padding: 12px 14px; border-radius: 6px; border: 1px solid var(--hairline); background: var(--surface-100); color: var(--ink-muted); font: 400 12.5px/1.6 var(--mono); white-space: pre-wrap; }
.warn-ink { color: var(--warning); }
.toggle { cursor: pointer; }
.toggle:disabled { opacity: 0.6; cursor: progress; }
.app-tile { width: 28px; height: 28px; border-radius: 6px; background: var(--surface-200); display: inline-flex; align-items: center; justify-content: center; font: 600 12px/1 var(--sans); color: var(--ink-muted); flex: none; }
.empty { padding: 28px 0; text-align: center; color: var(--ink-subtle); font: 400 13px/1.45 var(--sans); }

/* Narrower windows: the grids stack (tablet and phone layouts come later) */
@media (max-width: 1279px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .split { grid-template-columns: minmax(0, 1fr) !important; }
}
@media (max-width: 767px) {
  .side { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .topbar { padding: 0 16px; }
  .page { padding: 16px; }
}

/* ================= MOVIMENTO ================= */
/* Serigy Movimento.md + the mockups' "Interações do console": the motion explains where things came from.
   Entrances decelerate (ease-out), exits accelerate (ease-in) and are shorter; distances 8 / 16 / 24 px; nothing
   bounces or blinks; color, weight and text size change at once (never animated). */
:root {
  --duration-instant: 80ms; --duration-exit: 120ms; --duration-enter: 200ms; --duration-loop: 1000ms; --stagger: 24ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1); --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-travel: cubic-bezier(0.25, 0.8, 0.25, 1); --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --distance-sm: 8px; --distance-md: 16px; --distance-lg: 24px;
}

/* I4 · Hover: instant fills. Table rows surface-100, sidebar rows surface-200, segments surface-200 (the active one
   keeps its own). Icons, chips and segments never scale. */
.seg button:hover:not(.on) { background: var(--surface-200); }
.btn-icon:hover { background: var(--surface-200); color: var(--ink); }
.chip:hover:not(.on) { background: var(--surface-200); color: var(--ink); }

/* I5 · Press: only buttons with text shrink to 0.97 (instant in, exit back). Rows and icons answer with their fill. */
.btn { transition: transform var(--duration-exit) var(--ease-in); }
.btn:active { transform: scale(0.97); transition: transform var(--duration-instant) var(--ease-out); }

/* Switch: the thumb travels in place; the track's color changes at once. */
.toggle::after { transition: left var(--duration-enter) var(--ease-in-out); }

/* I1 · The active sidebar row's fill slides to the new row (console.js moves it after each navigation). */
.side { position: relative; }
.nav-indicator { position: absolute; left: 0; top: 0; width: 0; height: 0; border-radius: 6px; background: var(--surface-200); pointer-events: none; opacity: 0; }
.nav-indicator.ready { opacity: 1; }
.nav-indicator.moving { transition: transform var(--duration-enter) var(--ease-out), height var(--duration-enter) var(--ease-out); }
.side.has-indicator .nav-row.on { background: transparent; }
.side .nav-row { position: relative; z-index: 1; }

/* I3 · A detail opens inside its row: it comes down 8 px and appears; the chevron turns. */
.chev { transition: transform var(--duration-enter) var(--ease-out); }
.bot-detail { animation: descend var(--duration-enter) var(--ease-out) both; }
@keyframes descend { from { opacity: 0; transform: translateY(calc(-1 * var(--distance-sm))); } }

/* I6 · Chart tooltip: appears in place with no motion, leaves in 120 ms. */
.chart-col .tip { display: flex; opacity: 0; visibility: hidden; transition: opacity var(--duration-exit) linear, visibility 0s linear var(--duration-exit); }
.chart-col:hover .tip, .chart-col:focus-visible .tip { opacity: 1; visibility: visible; transition: none; }

/* I9 · A new alert comes down 8 px at the top of the list. Never shakes, never blinks. */
.alert.arrive { animation: descend var(--duration-enter) var(--ease-out) both; }

/* The one loop: a Bot working breathes its three dots in turn (opacity and 2 px), like the app's indicator. */
.working i { animation: breathe var(--duration-loop) var(--ease-in-out) infinite; }
.working i:nth-child(2) { animation-delay: 160ms; }
.working i:nth-child(3) { animation-delay: 320ms; }
@keyframes breathe { 0%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

/* Changing period: the chart is rebuilt, its bars grow from the axis in a left-to-right sweep (enter 200 ms, the
   sweep spreads over 120 ms, six staggers' worth, however many columns) and the axis labels fade in. A refresh of the
   same period doesn't move anything (numbers change in place). */
.chart-grow .stack { transform-origin: 50% 100%; animation: grow var(--duration-enter) var(--ease-out) both; animation-delay: calc(var(--sweep, 0) * 120ms); }
@keyframes grow { from { transform: scaleY(0); } }
.chart-fade { animation: fade var(--duration-enter) var(--ease-out) both; }

/* The period selection's fill slides to the button picked (console.js measures it); the text color changes at once. */
.seg { position: relative; }
.seg button { position: relative; z-index: 1; }
.seg-indicator { position: absolute; left: 0; top: 3px; height: 30px; width: 0; border-radius: 6px; background: var(--surface-300); pointer-events: none; opacity: 0; }
.seg-indicator.ready { opacity: 1; }
.seg-indicator.moving { transition: transform var(--duration-enter) var(--ease-out), width var(--duration-enter) var(--ease-out); }
.seg.has-indicator button.on { background: transparent; }

/* I11 · Reduced motion: no travel and no cascade; what stays is a 120 ms fade. The loop stops on a readable frame. */
@media (prefers-reduced-motion: reduce) {
  .btn, .btn:active { transform: none; transition: none; }
  .toggle::after, .chev, .nav-indicator.moving, .seg-indicator.moving { transition: none; }
  .chart-grow .stack { animation: fade var(--duration-exit) linear both; }
  .bot-detail, .alert.arrive { animation: fade var(--duration-exit) linear both; }
  .working i { animation: none; }
  .working i:nth-child(1) { opacity: 1; } .working i:nth-child(2) { opacity: .6; } .working i:nth-child(3) { opacity: .3; }
}
@keyframes fade { from { opacity: 0; } }

/* ---- Signing in (Pages/Account): one task in one column ---- */
.account { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.account-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 16px; }
.account-card > img { margin-bottom: 8px; }
.account-form { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.account-form .btn { width: 100%; height: 44px; }
.account-alert { margin: 0; padding: 10px 12px; border-radius: 6px; border: 1px solid var(--err-line); color: var(--danger); font: 400 13px/1.45 var(--sans); }
.account-key { font: 500 15px/1.4 var(--mono); letter-spacing: 0.04em; padding: 10px 12px; border-radius: 6px; background: var(--surface-100); border: 1px solid var(--hairline); user-select: all; word-break: break-all; }
.account-codes { margin: 0; }
.input.mono { font-family: var(--mono); letter-spacing: 0.12em; }
.input:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
