:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #f0f0ed;
  --border: #e3e3df;
  --text: #1d1d1b;
  --muted: #6b6b66;
  --faint: #9a9a94;
  --accent: #3b5bdb;
  --accent-soft: #e7ecfd;
  --rec: #e01b24;
  --rec-soft: #fde8e8;
  --ok: #2b8a3e;
  --warn: #b7791f;
  --warn-soft: #fdf3e1;
  --shadow: 0 1px 2px rgb(0 0 0 / 5%), 0 2px 8px rgb(0 0 0 / 4%);
  --radius: 10px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Ubuntu, Cantarell, sans-serif;
  --mono: ui-monospace, "SF Mono", "Ubuntu Mono", Menlo, monospace;
  color-scheme: light;
  /* Charts: validated categorical slots (fixed order), blue sequential scale, 4-step ordinal ramp, chart chrome. */
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6; --series-8: #e34948;
  --seq-1: #cde2fb; --seq-2: #9ec5f4; --seq-3: #6da7ec; --seq-4: #3987e5; --seq-5: #256abf; --seq-6: #184f95; --seq-7: #0d366b;
  --ord-1: #86b6ef; --ord-2: #5598e7; --ord-3: #2a78d6; --ord-4: #1c5cab;
  --meter-fill: #2a78d6;
  --viz-grid: #e1e0d9; --viz-axis: #c3c2b7; --viz-label: #898781;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615;
    --surface: #1f1f1e;
    --surface-2: #272725;
    --border: #333331;
    --text: #ececea;
    --muted: #a3a39d;
    --faint: #75756f;
    --accent: #7c95f5;
    --accent-soft: #252c47;
    --rec: #ff5c5c;
    --rec-soft: #3a1f1f;
    --ok: #69c27b;
    --warn: #e0b250;
    --warn-soft: #3a3020;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%);
    color-scheme: dark;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
    /* In dark mode "little" recedes into the dark surface, so the sequential scale runs the other way. */
    --seq-1: #0d366b; --seq-2: #104281; --seq-3: #1c5cab; --seq-4: #2a78d6; --seq-5: #5598e7; --seq-6: #86b6ef; --seq-7: #b7d3f6;
    --ord-1: #184f95; --ord-2: #256abf; --ord-3: #3987e5; --ord-4: #6da7ec;
    --meter-fill: #5598e7;
    --viz-grid: #2c2c2a; --viz-axis: #383835; --viz-label: #898781;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }

.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

/* Sidebar */
.sidebar { position: sticky; top: 0; height: 100vh; padding: 20px 14px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 18px; background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; font-weight: 650; font-size: 15px; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); }
.brand-dot.listening { background: var(--ok); }
.brand-dot.recording { background: var(--rec); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav a.open { color: var(--text); }
.unsaved { color: var(--warn); font-size: 13px; }
.subnav { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 4px 12px; padding-left: 8px; border-left: 1px solid var(--border); }
.nav .subnav a { padding: 5px 10px; font-size: 13px; font-weight: 450; }
.page-head .crumb { color: var(--faint); font-weight: 500; }
.count { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--faint); }
.nav a.active .count { color: var(--accent); }
.sidebar-foot { margin-top: auto; padding: 0 6px; font-size: 12px; color: var(--faint); }

/* Main */
.main { min-width: 0; padding: 28px 36px 60px; max-width: 1280px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h1 { font-size: 22px; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-weight: 500; font-size: 13px; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--rec); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn:disabled { opacity: 0.5; cursor: default; }

.search { width: 100%; max-width: 420px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.search:focus, .edit-input:focus, .field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.empty-state { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty-state h3 { color: var(--text); margin-bottom: 6px; }

/* Session list */
.day { margin: 22px 0 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.sessions { display: flex; flex-direction: column; }
.session-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: start; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.session-row:last-child { border-bottom: none; }
.session-row:hover { background: var(--surface-2); }
.session-time { font-variant-numeric: tabular-nums; color: var(--muted); padding-top: 1px; }
.session-title { font-weight: 600; }
.session-title.untitled { color: var(--muted); font-weight: 500; }
.session-summary { color: var(--muted); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.snippet { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.snippet mark { background: var(--warn-soft); color: inherit; border-radius: 3px; padding: 0 2px; }
.session-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--muted); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--app, var(--faint)); }
.app-discord { --app: #5865f2; }
.app-slack { --app: #e01e5a; }
.app-teams { --app: #6264a7; }
.app-zoom { --app: #0b5cff; }
.app-google-meet { --app: #00897b; }
.app-in-person { --app: #b7791f; }
.chip { padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 500; }
.chip.recording { background: var(--rec-soft); color: var(--rec); }
.chip.queued, .chip.transcribing, .chip.summarizing { background: var(--warn-soft); color: var(--warn); }
.chip.failed { background: var(--rec-soft); color: var(--rec); }
.todo-count { font-variant-numeric: tabular-nums; }
.todo-count.has-open { color: var(--accent); font-weight: 500; }

/* Session detail */
.back { color: var(--muted); font-size: 13px; display: inline-flex; gap: 4px; margin-bottom: 12px; }
.back:hover { color: var(--text); }
.detail-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 6px; }
.detail-title { font-size: 24px; font-weight: 650; letter-spacing: -0.015em; flex: 1; }
.meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--muted); margin-bottom: 18px; }
.speakers { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-bottom: 18px; font-size: 13px; color: var(--muted); }
.speakers label { display: inline-flex; align-items: center; gap: 6px; }
.speakers input { width: 150px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.error-box { background: var(--rec-soft); color: var(--rec); padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.progress-box { background: var(--warn-soft); color: var(--warn); padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }

.player { position: sticky; top: 0; z-index: 2; padding: 10px 0; background: var(--bg); margin-bottom: 8px; }
.player { display: flex; gap: 10px; align-items: center; }
.player audio { flex: 1; min-width: 0; height: 40px; }
.player .btn { white-space: nowrap; }

.columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.panel { padding: 18px 20px; }
.panel + .panel { margin-top: 16px; }
.panel h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.panel ul { margin: 0; padding-left: 18px; }
.panel li { margin: 3px 0; }

.editable { border-radius: 6px; padding: 2px 6px; margin: -2px -6px; cursor: text; white-space: pre-wrap; }
.editable:hover { background: var(--surface-2); }
.editable.empty { color: var(--faint); }
.edit-input { width: 100%; padding: 4px 6px; margin: -4px -6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); resize: vertical; line-height: 1.5; }
.detail-title .edit-input { font-size: 24px; font-weight: 650; }

/* To-dos */
.todos { display: flex; flex-direction: column; }
.todo { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); align-items: start; }
.todo:last-child { border-bottom: none; }
.todo input[type=checkbox] { width: 16px; height: 16px; margin-top: 3px; accent-color: var(--accent); cursor: pointer; }
.todo.done .todo-task { color: var(--faint); text-decoration: line-through; }
.todo-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.todo-meta .editable { display: inline-block; margin: 0; padding: 0 4px; }
.todo-meta span.k { color: var(--faint); margin-right: 4px; }
.todo-meta .edit-input { margin: 0; padding: 1px 4px; width: 180px; }
.todo-note { margin-top: 4px; font-size: 13px; color: var(--muted); border-left: 2px solid var(--accent-soft); padding-left: 8px; }
.todo-actions { opacity: 0; transition: opacity 0.1s; }
.todo:hover .todo-actions { opacity: 1; }
.add-todo { display: flex; gap: 8px; margin-top: 10px; }
.add-todo input { flex: 1; padding: 6px 10px; border: 1px dashed var(--border); border-radius: 8px; background: transparent; }
.todo-group { margin-bottom: 18px; padding: 6px 20px 8px; }
.todo-group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0 4px; }
.todo-group-head a { font-weight: 600; }
.todo-group-head a:hover { color: var(--accent); }
.todo-group-head span { color: var(--faint); font-size: 12.5px; white-space: nowrap; }

.tabs { display: inline-flex; background: var(--surface-2); border-radius: 8px; padding: 3px; gap: 2px; }
.tabs button { border: none; background: transparent; padding: 4px 12px; border-radius: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Transcript */
.transcript { max-height: calc(100vh - 140px); overflow-y: auto; position: sticky; top: 64px; }
.transcript-head { position: sticky; top: 0; background: var(--surface); padding: 14px 20px 8px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; z-index: 1; }
.transcript-head h2 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.follow { font-size: 12.5px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.lines { padding: 8px 12px 16px; }
.line { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 5px 8px; border-radius: 6px; cursor: pointer; }
.line:hover { background: var(--surface-2); }
.line.active { background: var(--accent-soft); }
.line-time { font: 12px/1.9 var(--mono); color: var(--faint); }
.line-name { font-weight: 600; margin-right: 6px; }
.line-name.me { color: var(--accent); }
.line.marker { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.line.paused-note { cursor: default; color: var(--faint); font-style: italic; }
.line.paused-note:hover { background: none; }
.line.draft { color: var(--faint); }

.lead { color: var(--muted); max-width: 680px; margin: -8px 0 20px; }
.btn.icon { padding: 2px 7px; font-size: 13px; line-height: 1.3; }
.popover input:not([type=checkbox]):focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.voice-name { font-weight: 600; }

/* Fix-spelling popover */
.hint { font-size: 12px; color: var(--faint); margin-left: auto; margin-right: 14px; }
.lines { user-select: text; }
.popover { position: fixed; z-index: 10; width: 320px; padding: 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 8px 30px rgb(0 0 0 / 18%); }
.popover-title { font-weight: 600; }
.popover input:not([type=checkbox]) { padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.popover label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.popover input[type=checkbox] { accent-color: var(--accent); }
.popover-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* Menus, email, dialogs */
.row-actions { display: flex; gap: 8px; align-items: center; }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; width: 300px; padding: 6px; display: flex; flex-direction: column; box-shadow: 0 8px 30px rgb(0 0 0 / 15%); }
.menu-list button { text-align: left; border: none; background: none; padding: 8px 10px; border-radius: 6px; font-weight: 500; }
.menu-list button:hover:not(:disabled) { background: var(--surface-2); }
.menu-list button:disabled { opacity: 0.45; cursor: default; }
.menu-list button span { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.menu-list .menu-item { display: block; padding: 8px 10px; border-radius: 6px; font-weight: 500; color: var(--text); text-decoration: none; }
.menu-list .menu-item:hover { background: var(--surface-2); }
.menu-list .menu-item span { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.live-badge { display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; padding: 1px 8px; border-radius: 99px; background: var(--rec-soft); color: var(--rec); font-size: 11px; letter-spacing: 0.04em; }
.live-badge.paused::before { animation: none; opacity: 0.5; }
.live-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--rec); animation: pulse 1.4s ease-in-out infinite; }
.email-subject, .email-body, .email-generate input { width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); line-height: 1.5; }
.email-subject { font-weight: 600; margin-bottom: 8px; }
.email-body { resize: vertical; margin-bottom: 8px; }
.email-generate { display: flex; gap: 8px; margin-top: 10px; }
.email-generate input { flex: 1; border-style: dashed; }
.email input:focus, .email textarea:focus, .modal input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.modal-backdrop { position: fixed; inset: 0; z-index: 20; background: rgb(0 0 0 / 35%); display: grid; place-items: center; padding: 16px; }
.modal { width: min(520px, 100%); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.modal h3 { font-size: 16px; }
.modal-quote { padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 6px 6px 0; }
.modal input { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-family: var(--mono); font-size: 13px; }
.todo-actions { display: flex; gap: 2px; }

/* Settings */
.settings { max-width: 720px; }
.settings-group { padding: 6px 20px; margin-bottom: 16px; }
.settings-group h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); padding: 12px 0 4px; }
.settings-group h2 .group-note { text-transform: none; letter-spacing: 0; font-weight: 400; }
.settings-advanced summary { cursor: pointer; padding: 12px 0; font-size: 14px; color: var(--muted); }
.settings-advanced[open] summary { padding-bottom: 4px; }
.field { display: grid; grid-template-columns: 1fr 260px; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.field:last-child { border-bottom: none; }
.field-label { font-weight: 500; }
.field-desc { color: var(--muted); font-size: 12.5px; }
.field input:not([type=checkbox]), .field select { width: 100%; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.field input[type=checkbox] { width: 18px; height: 18px; justify-self: end; accent-color: var(--accent); }
.field-input { display: flex; flex-direction: column; justify-content: center; }
.field-input input[type=checkbox] { align-self: flex-end; }
.engine-test { display: flex; align-items: center; gap: 12px; padding: 12px 0 14px; border-top: 1px solid var(--border); }
.test-ok { color: var(--ok); font-size: 13px; }
.test-fail { color: var(--rec); font-size: 13px; }
.save-bar { display: flex; gap: 12px; align-items: center; }
.saved { color: var(--ok); font-size: 13px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 8px 16px; border-radius: 8px; font-size: 13px; box-shadow: var(--shadow); }

@media (max-width: 980px) {
  .columns { grid-template-columns: 1fr; }
  .transcript { position: static; max-height: none; }
}
@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .main { padding: 20px 16px 40px; }
  .field { grid-template-columns: 1fr; }
  .session-row { grid-template-columns: 1fr; gap: 6px; }
  .session-side { flex-direction: row; align-items: center; }
}

.recognized { margin-left: 6px; font-size: 11px; color: var(--ok); }
.voices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.voice { display: inline-flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface-2); }

.ask-form { display: flex; flex-direction: column; gap: 10px; padding: 14px; margin-bottom: 18px; }
.ask-form textarea { width: 100%; resize: vertical; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.ask-form .row-actions { justify-content: flex-end; }
.ask-answer { padding: 16px; margin-bottom: 14px; }
.ask-question { font-weight: 600; margin-bottom: 8px; }
.ask-question .hint { font-weight: 400; margin-left: 6px; }
.ask-text { white-space: pre-wrap; line-height: 1.55; }
.ask-sources { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ask-sources a { font-size: 12px; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); color: var(--text); text-decoration: none; }
.ask-sources a span { color: var(--faint); margin-left: 4px; }
.digest-weeks { margin-bottom: 14px; flex-wrap: wrap; }
.digest-weeks a { padding: 4px 10px; border-radius: 6px; text-decoration: none; color: var(--muted); }
.digest-weeks a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.digest-title { margin: 0; font-size: 18px; }
.source { margin-left: 6px; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); text-decoration: none; }
.hint-inline { color: var(--faint); font-size: 12.5px; }

/* Overview */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-tile { padding: 14px 16px; }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font-size: 28px; font-weight: 600; margin: 4px 0 2px; }
.stat-delta { font-size: 12.5px; color: var(--muted); }
.overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin-bottom: 18px; }

.upcoming-item { display: grid; grid-template-columns: 78px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.upcoming-item:first-of-type { border-top: none; }
.upcoming-time { font: 13px/1.6 var(--mono); color: var(--muted); white-space: nowrap; }
.upcoming-title { font-weight: 600; }
.upcoming-last { font-size: 13px; color: var(--muted); }
.upcoming-last ul, .missed, .oldest { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; line-height: 1.6; }
.meter-label { font-size: 13.5px; margin-bottom: 8px; color: var(--muted); }
.meter-label b { color: var(--text); font-size: 15px; }
.meter { height: 10px; border-radius: 99px; background: color-mix(in srgb, var(--meter-fill) 18%, var(--surface)); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 99px; background: var(--meter-fill); }
.filter-row { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.filter-row label { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.overview-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 12px; transition: opacity 0.2s; }
.overview-charts.refreshing { opacity: 0.5; }
.overview-charts .wide { grid-column: 1 / -1; }
.chart-card { margin: 0; padding: 16px; min-width: 0; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.chart-head h2 { margin: 0; font-size: 15px; }
.chart-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.chart-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 2px; }
.chart-legend.scale { gap: 3px; align-items: center; }
.scale-step { width: 16px; height: 10px; border-radius: 2px; }
.chart-legend.scale > span:first-child { margin-right: 4px; }
.chart-legend.scale > span:last-child { margin-left: 4px; }
.chart-box { width: 100%; min-width: 0; }
.chart-box svg { display: block; overflow: visible; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; shape-rendering: crispEdges; }
.viz-axis { stroke: var(--viz-axis); stroke-width: 1; shape-rendering: crispEdges; }
.viz-tick { fill: var(--viz-label); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-label { fill: var(--text); font-size: 12.5px; }
.viz-value { fill: var(--muted); font-size: 12px; }
.hit { fill: transparent; outline: none; }
.chart-box rect[tabindex]:focus-visible, .chart-box g[tabindex]:focus-visible { outline: 2px solid var(--accent); }
.chart-box g[tabindex], .chart-box rect[tabindex] { cursor: default; }
.chart-box g:hover > path, .chart-box rect[tabindex]:hover { filter: brightness(1.08); }
.chart-table { overflow-x: auto; }
.chart-table table { border-collapse: collapse; font-size: 12.5px; width: 100%; font-variant-numeric: tabular-nums; }
.chart-table th, .chart-table td { padding: 4px 8px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
.chart-table th:first-child, .chart-table td:first-child { text-align: left; }
.chart-tip { position: fixed; z-index: 50; pointer-events: none; min-width: 140px; max-width: 240px; padding: 8px 10px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 8px 24px rgb(0 0 0 / 14%); font-size: 12.5px; }
.chart-tip-title { color: var(--muted); margin-bottom: 4px; }
.chart-tip-row { display: flex; align-items: center; gap: 6px; line-height: 1.6; }
.chart-tip-row b { color: var(--text); }
.chart-tip-row span:last-child { color: var(--muted); }
.tip-key { width: 10px; height: 2px; border-radius: 1px; flex: none; }
.keys { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; }
.keys th, .keys td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.keys th { color: var(--muted); font-weight: 500; }
.key-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.key-form input:not([type]) { flex: 1; min-width: 180px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.key-form label { font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.key-created { margin-top: 14px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.agent-setup { display: flex; gap: 8px; align-items: flex-start; }
.agent-setup pre { flex: 1; min-width: 0; overflow-x: auto; }
.key-created pre { margin: 0; padding: 10px; border-radius: 6px; background: var(--surface); white-space: pre-wrap; word-break: break-all; font: 12px/1.5 var(--mono); }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 380px; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.auth-card h1 { font-size: 22px; }
.auth-lead { color: var(--muted); margin: -6px 0 4px; }
.auth-form { display: flex; flex-direction: column; gap: 8px; }
.auth-form input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.auth-form .btn { margin-top: 8px; }
.account { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.account > div { min-width: 0; }
.account .btn { white-space: nowrap; flex-shrink: 0; }
.account-name, .account-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-name { font-weight: 600; font-size: 14px; }
.account-email { color: var(--muted); font-size: 12px; }
.keys tr.disabled td { color: var(--faint); }
.person-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.settings-group > .row-actions { margin-top: 12px; }
.readonly-text { white-space: pre-wrap; }
.shared-by { color: var(--muted); font-size: 12px; margin-top: 2px; }
.shared-with { color: var(--muted); font-size: 13px; margin: -4px 0 12px; }
.share-people { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.share-people label { display: flex; gap: 8px; align-items: center; font-size: 14px; }
