:root {
  color-scheme: dark;

  /* Surfaces (one cool-neutral family) */
  --bg: #0c0d10;
  --surface-1: #121317;
  --surface-2: #17181d;
  --surface-3: #1e2026;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);

  /* Text */
  --text: #ececef;
  --text-2: #b4b6bf;
  --muted: #8b8e99;

  /* Accent: one restrained mint for primary actions */
  --accent: #66d4b8;
  --accent-strong: #7fe0c7;
  --accent-ink: #07130f;
  --accent-soft: rgba(102, 212, 184, 0.12);
  --accent-line: rgba(102, 212, 184, 0.32);

  /* Record red */
  --rec: #e5484d;
  --rec-soft: rgba(229, 72, 77, 0.14);
  --rec-line: rgba(229, 72, 77, 0.4);

  /* Status */
  --ok: #5fcf9a;
  --warn: #e2b54a;
  --danger: #ef6a6e;

  /* Speaker palette */
  --sp-1: #7fb0ff;
  --sp-2: #e29bd0;
  --sp-3: #e8b86a;
  --sp-4: #7fd6c2;
  --sp-5: #b69cf5;
  --sp-6: #f08f78;

  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --t-fast: 150ms;
  --t: 220ms;

  --sidebar-w: 300px;
  --z-toast: 50;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.55 var(--font-ui);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
[hidden] { display: none !important; }

::selection { background: var(--accent-soft); color: var(--text); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: var(--z-toast);
  padding: 8px 12px;
  background: var(--surface-3);
  color: var(--text);
  border-radius: var(--r-sm);
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 12px; }

.eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-lg { width: 22px; height: 22px; }

/* ---------- Shell ---------- */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 14px 14px;
  background: var(--surface-1);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; border-radius: var(--r-sm); }
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-tag { font-size: 11px; color: var(--muted); }
.brand-mark { width: 26px; height: 26px; flex: none; }
.bm-bg { fill: var(--surface-3); stroke: var(--border-strong); }
.bm-wave { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; }

.btn.history-toggle { display: none; }

.btn.new-btn, .btn.nav-btn { justify-content: flex-start; margin: 0 2px; }
.btn.nav-btn[aria-current="page"] { background: var(--surface-3); border-color: var(--accent-line); color: var(--accent-strong); }

.history { display: flex; flex-direction: column; gap: 8px; min-height: 0; flex: 1; }
.history .eyebrow { padding: 4px 8px 0; }

.list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  margin: 0 -6px;
  padding: 0 6px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}

.list button {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 10px 10px;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.list button:hover { background: var(--surface-2); }
.list button:active { background: var(--surface-3); }
.list button[aria-current="true"] { background: var(--surface-3); border-color: var(--border-strong); }

.list .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.list .title {
  font-weight: 500;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.list .meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.side-empty {
  margin: 4px 8px;
  padding: 14px;
  font-size: 12.5px;
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
}

/* ---------- Account ---------- */

.side-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 -6px;
  padding: 10px 6px 0;
  border-top: 1px solid var(--border);
}
.side-user-email {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-user .btn { flex: none; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 14px;
  font: 500 13px/1 var(--font-ui);
  color: var(--text);
  text-decoration: none;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn:hover { background: #262830; border-color: rgba(255, 255, 255, 0.2); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn.small { min-height: 30px; padding: 0 11px; font-size: 12.5px; }

.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.btn.primary:hover { background: var(--accent-strong); }

.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }

.btn.danger { background: transparent; border-color: transparent; color: var(--muted); }
.btn.danger:hover { background: rgba(239, 106, 110, 0.12); color: var(--danger); }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 2px 8px 2px 7px;
  font-size: 11px;
  font-weight: 500;
  text-transform: capitalize;
  color: var(--text-2);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.badge.done { color: var(--ok); }
.badge.done::before { background: var(--ok); }
.badge.error { color: var(--danger); }
.badge.error::before { background: var(--danger); }
.badge.processing { color: var(--warn); }
.badge.processing::before { background: var(--warn); animation: pulse 1.4s ease-in-out infinite; }

/* ---------- Main ---------- */

.main { min-width: 0; outline: none; }

.view {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 44px 40px 96px;
  animation: view-in var(--t) var(--ease);
}

.view-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 28px; }
.view-head h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; }

/* ---------- Recorder ---------- */

.rec-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 40px 24px 32px;
  background:
    radial-gradient(60% 90% at 50% 0%, rgba(255, 255, 255, 0.035), transparent 70%),
    var(--surface-1);
  border-bottom: 1px solid var(--border);
  transition: background var(--t) var(--ease);
}
.rec-card.live .stage {
  background:
    radial-gradient(60% 90% at 50% 0%, var(--rec-soft), transparent 70%),
    var(--surface-1);
}

.timer {
  font: 400 64px/1 var(--font-mono);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  transition: color var(--t) var(--ease);
}
.rec-card.live .timer { color: var(--text); }

.viz {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  max-width: 460px;
  height: 56px;
}
.viz i {
  flex: 1 1 0;
  max-width: 6px;
  height: 100%;
  border-radius: 3px;
  background: var(--surface-3);
  transform: scaleY(0.06);
  transition: transform 90ms linear, background var(--t) var(--ease);
}
.rec-card.live .viz i { background: var(--rec); }

.rec-control { display: flex; flex-direction: column; align-items: center; gap: 12px; }

.rec-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  padding: 0;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease), border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.rec-btn:hover { border-color: var(--rec-line); background: var(--surface-3); }
.rec-btn:active { transform: scale(0.96); }
.rec-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.rec-btn:focus-visible { outline-offset: 5px; border-radius: 50%; }

.rec-core {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--rec);
  box-shadow: 0 0 24px var(--rec-line);
  transition: width var(--t) var(--ease), height var(--t) var(--ease), border-radius var(--t) var(--ease);
}
.rec-ring {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid var(--rec);
  opacity: 0;
  pointer-events: none;
}
.rec-btn.recording { border-color: var(--rec-line); }
.rec-btn.recording .rec-core { width: 26px; height: 26px; border-radius: 7px; }
.rec-btn.recording .rec-ring { animation: ring 1.8s var(--ease) infinite; }

.rec-label { font-size: 13px; color: var(--muted); }
.rec-card.live .rec-label { color: var(--text-2); }

.status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 0 24px;
  font-size: 13px;
  color: var(--text-2);
}
.status:not(:empty) { padding-top: 16px; }
.status.error { color: var(--danger); }
.status:empty { display: none; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#upload-recovery {
  margin: 12px 24px 0;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-left: 2px solid var(--danger);
  border-radius: var(--r-md);
}

.rec-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 20px 24px 22px;
}

.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field-label { display: block; line-height: 16px; padding: 0; font-size: 12px; font-weight: 500; color: var(--text-2); }
.field-label em { margin-left: 6px; font-style: normal; color: var(--muted); font-weight: 400; }

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder { color: var(--muted); opacity: 0.7; }
input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover { border-color: rgba(255, 255, 255, 0.2); }
input[type="text"]:focus-visible,
input[type="email"]:focus-visible,
input[type="password"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--r-md); height: 38px; }
.seg-opt { position: relative; display: flex; }
.seg-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg-opt span {
  display: grid;
  place-items: center;
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 7px;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.seg-opt:hover span { color: var(--text); }
.seg-opt input:checked + span { background: var(--surface-3); color: var(--text); box-shadow: 0 0 0 1px var(--border-strong); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
#modes:disabled { opacity: 0.5; }
#modes:disabled .seg-opt input { cursor: not-allowed; }

.hint { font-size: 12.5px; color: var(--muted); }
.rec-card > .hint { padding: 0 24px 20px; margin-top: -6px; }

.dropzone {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  padding: 18px 20px;
  color: var(--text-2);
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.dropzone:hover, .dropzone.drag { background: var(--surface-1); border-color: var(--accent-line); }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone .icon-lg { color: var(--muted); }
.dz-text { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--muted); }
.dz-text strong { font-size: 13.5px; font-weight: 500; color: var(--text); }

/* ---------- Detail ---------- */

.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.detail-head h2 { font-size: 26px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; overflow-wrap: anywhere; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.detail-meta .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.detail-head .actions { flex: none; padding-top: 2px; }
.btn .icon { width: 14px; height: 14px; }

.player {
  margin: 0 0 24px;
  padding: 10px 12px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.player audio { display: block; width: 100%; height: 38px; color-scheme: dark; }

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--text-2);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.banner.error { color: var(--text); border-color: rgba(239, 106, 110, 0.35); background: rgba(239, 106, 110, 0.07); }
.banner .banner-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.banner .banner-text strong { font-weight: 600; }
.banner.error .banner-text span { color: var(--text-2); }

.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tab {
  position: relative;
  padding: 10px 12px;
  font: 500 13px/1 var(--font-ui);
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease);
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.card { padding: 18px 20px; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-lg); min-width: 0; }
.card.wide { grid-column: 1 / -1; }
.card h3 { margin-bottom: 12px; font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.card.summary { padding: 22px 24px; background: linear-gradient(180deg, var(--surface-2), var(--surface-1)); border-color: var(--border-strong); }
.card.summary p { font-size: 16px; line-height: 1.65; color: var(--text); max-width: 68ch; }

.card ul { display: flex; flex-direction: column; gap: 10px; }
.card li { position: relative; padding-left: 16px; color: var(--text-2); overflow-wrap: anywhere; }
.card li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 5px; height: 5px; border-radius: 50%; background: var(--border-strong); }
.card.decisions li::before { background: var(--accent); }
.none { font-size: 13px; color: var(--muted); }

.tasks { display: flex; flex-direction: column; }
.task { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.task:first-child { border-top: 0; padding-top: 0; }
.task:last-child { padding-bottom: 0; }
.check { width: 16px; height: 16px; margin-top: 2px; border: 1.5px solid var(--border-strong); border-radius: 5px; }
.task-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.task-title { color: var(--text); overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  font-size: 12px;
  color: var(--text-2);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.chip .icon { width: 12px; height: 12px; color: var(--muted); }
.chip.empty { color: var(--muted); background: transparent; border-style: dashed; }

/* ---------- Transcript ---------- */

.transcript { max-width: 720px; display: flex; flex-direction: column; }
.seg { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; padding: 12px 8px; margin: 0 -8px; border-radius: var(--r-md); transition: background var(--t-fast) var(--ease); }
.seg:hover { background: var(--surface-1); }
.seg .ts {
  align-self: start;
  justify-content: flex-start;
  min-height: 24px;
  padding: 0 6px;
  font: 400 12px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.seg .ts:hover { color: var(--accent); background: var(--accent-soft); }
.seg .who { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 600; color: var(--spk, var(--text-2)); }
.seg .line { color: var(--text); line-height: 1.7; overflow-wrap: anywhere; }

/* ---------- Skeleton ---------- */

.skeleton { display: grid; gap: 12px; }
.sk {
  display: block;
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}
.sk.w60 { width: 60%; } .sk.w80 { width: 80%; } .sk.w40 { width: 40%; }
.sk-card { padding: 20px; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-lg); display: grid; gap: 12px; }

/* ---------- Toasts ---------- */

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto;
  padding: 11px 14px;
  font-size: 13px;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-left: 2px solid var(--accent);
  border-radius: var(--r-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  animation: toast-in var(--t) var(--ease);
}
.toast.error { border-left-color: var(--danger); }

/* ---------- Motion ---------- */

/* ---------- Usage ("Consumo") ---------- */

.view.usage { max-width: 1040px; }
.usage-section { margin-top: 24px; }
.usage-section > h2 { margin-bottom: 12px; font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-lg); min-width: 0; }
.kpi.hero { grid-column: 1 / -1; padding: 20px 22px; background: linear-gradient(180deg, var(--surface-2), var(--surface-1)); border-color: var(--border-strong); }
.kpi-label { font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.kpi-value { font: 500 24px/1.15 var(--font-mono); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--text); overflow-wrap: anywhere; }
.kpi.hero .kpi-value { font-size: 34px; }
.kpi-sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kpi-sub.warn { color: var(--warn); }
.kpi-sub.over { color: var(--danger); }

.meter { height: 6px; margin-top: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.meter-fill { width: var(--w, 0%); height: 100%; background: var(--accent); border-radius: 999px; }
.meter-fill.warn { background: var(--warn); }
.meter-fill.over { background: var(--danger); }

.chart-card { padding: 18px 20px 12px; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-lg); }
.chart-host { width: 100%; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-base { stroke: var(--border-strong); stroke-width: 1; }
.chart-tick { fill: var(--muted); font: 400 11px var(--font-mono); font-variant-numeric: tabular-nums; }
.chart-label { fill: var(--text-2); font: 500 11px var(--font-mono); font-variant-numeric: tabular-nums; }
.chart-bar { fill: var(--accent); }
.chart-col:hover .chart-bar { fill: var(--accent-strong); }
.chart-hit { fill: transparent; }
.chart-col:hover .chart-hit { fill: var(--accent-soft); }

.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.panel { padding: 16px 18px; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-lg); min-width: 0; }
.panel h3 { margin-bottom: 12px; font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; gap: 6px; }
.bar-row .top { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.bar-row .name { min-width: 0; overflow-wrap: anywhere; }
.bar-row .val { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-row .sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-lg); scrollbar-width: thin; }
.usage-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.usage-table th { padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; border-bottom: 1px solid var(--border-strong); }
.usage-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: top; }
.usage-table tr:last-child td { border-bottom: 0; }
.usage-table .num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.usage-table td.title-cell { color: var(--text); min-width: 160px; overflow-wrap: anywhere; }
.usage-table tr.go { cursor: pointer; }
.usage-table tr.go:hover td { background: var(--surface-2); }
.usage-table tr.go:focus-visible { outline-offset: -2px; }
.usage-table .models span { display: block; white-space: nowrap; }
.usage-table .gone { color: var(--muted); font-style: italic; }

.err-list { display: flex; flex-direction: column; gap: 10px; }
.err-item { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--text-2); }
.err-item strong { color: var(--text); font-weight: 500; }
.err-item .code { font-family: var(--font-mono); color: var(--danger); }
.usage-empty { padding: 28px 20px; text-align: center; color: var(--muted); background: var(--surface-1); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); }
.disclaimer { margin-top: 28px; padding: 14px 16px; font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--warn); border-radius: var(--r-md); }
.disclaimer .note { display: block; margin-top: 6px; color: var(--muted); }
.tag-partial { display: inline-block; padding: 0 6px; font: 500 10px/1.6 var(--font-ui); letter-spacing: 0.04em; text-transform: uppercase; color: var(--warn); border: 1px solid rgba(226, 181, 74, 0.4); border-radius: 999px; vertical-align: middle; }
.cost-chip { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-2); }

@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes ring { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes pulse { 50% { opacity: 0.35; } }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; padding: 12px 16px; gap: 10px; border-right: 0; border-bottom: 1px solid var(--border); overflow: visible; }
  .side-top { padding: 0; }
  .btn.history-toggle { display: inline-flex; }
  .btn.new-btn { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .kpi.hero .kpi-value { font-size: 28px; }
  .history { display: none; max-height: 50dvh; }
  .history.open { display: flex; }
  .side-user { margin: 0; padding-top: 8px; }
  .view { padding: 24px 16px 72px; }
  .view-head h1, .detail-head h2 { font-size: 22px; }
  .timer { font-size: 52px; }
  .stage { padding: 28px 16px 24px; }
  .rec-fields { grid-template-columns: minmax(0, 1fr); padding: 18px 16px; }
  .status, .rec-card > .hint { padding-left: 16px; padding-right: 16px; }
  #upload-recovery { margin-left: 16px; margin-right: 16px; }
  .segmented { display: flex; }
  .seg-opt { flex: 1; }
  .seg-opt span { flex: 1; padding: 0 8px; }
  .detail-head { flex-direction: column; gap: 14px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .banner { flex-direction: column; align-items: flex-start; }
  .seg { grid-template-columns: 52px minmax(0, 1fr); gap: 8px; }
}

fieldset.segmented-field { display: block; }
fieldset.segmented-field .field-label { margin-bottom: 8px; }
