/* cato chrome — the vindra design system on cato's own surfaces (app shell,
   chat rail, auth pages, returns filters). Tokens come from varro's
   dashboard.css, which loads first; this file only consumes them.
   Product-surface rules: stock geometry, mono machine chrome, serif reserved
   for headlines and the wordmark, red only where money leaks (plus the
   error-message precedent). */

/* ---- app shell ---- */
.shell {
  display: flex;
  height: 100vh;
  background: var(--background);
}
.chat-rail {
  width: 380px;
  min-width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface-1);
}
/* drag handle straddling the rail border (ui.py RESIZER_SCRIPT) */
.chat-resize {
  flex-shrink: 0;
  width: 7px;
  margin: 0 -3px;
  z-index: 20;
  cursor: col-resize;
  transition: background 0.12s;
}
.chat-resize:hover { background: var(--border); }
.rail-top {
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}
.rail-wordmark {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--foreground);
}
.rail-toggle {
  margin-left: auto;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.rail-toggle:hover { background: var(--muted-2); color: var(--foreground); }
/* collapsed rail: a slim strip carrying only the expand toggle */
body.rail-collapsed .chat-rail {
  width: 44px !important;
  min-width: 44px;
}
body.rail-collapsed .chat-panel,
body.rail-collapsed .rail-wordmark,
body.rail-collapsed .chat-resize { display: none; }
body.rail-collapsed .rail-top { padding: 0; justify-content: center; }
body.rail-collapsed .rail-toggle { margin-left: 0; }
.content-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.content-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.content-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 36px 56px;
}

/* ---- navbar (content column) ---- */
.navbar {
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
}
.nav-links {
  display: flex;
  gap: 2px;
}
.nav-link {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  color: var(--muted-foreground);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: color 0.12s, background 0.12s;
}
.nav-link:hover {
  color: var(--foreground);
  background: var(--muted-2);
}
/* "you are here" — server-rendered from the request path, NAV_SCRIPT keeps
   it in step with boosted navigation */
.nav-link.active {
  color: var(--foreground);
  background: var(--muted-2);
}
.nav-link:focus:not(:focus-visible) { outline: none; }
.nav-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-name {
  font-size: 13px;
  color: var(--muted-foreground);
  margin-right: 10px;
}

/* ---- buttons (stock shadcn geometry, ink on paper) ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.btn:hover { background: var(--muted-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--background);
}
.btn-primary:hover { background: #17140F; border-color: #17140F; }
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted-foreground);
}
.btn-ghost:hover { background: var(--muted-2); color: var(--foreground); }
.btn-sm { height: 26px; padding: 0 9px; font-size: 12px; }

/* ---- chat rail internals ---- */
.chat-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-header .select {
  flex: 1;
  min-width: 0;
}
.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 14px 8px;
}
.chat-turn { margin-bottom: 4px; }
/* Human input is a paper card handed onto the rail; machine text prints
   directly on the rail. Both voices speak at 14px — the rail is a side
   panel, a step below the content column's 16px prose. */
.chat-user {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin: 14px 0 14px 36px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.chat-text {
  max-width: none;
  margin: 10px 0;
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
/* ---- inline answer segments (<fig>/<df> tags resolved to figures/tables) */
.chat-answer .chat-img { margin: 10px 0; }
.chat-answer .chat-fig { margin: 10px 0; }
.chat-table-wrap { overflow-x: auto; margin: 10px 0; }
.chat-table {
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
}
.chat-table th,
.chat-table td {
  padding: 4px 10px 4px 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.chat-table th {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tracking-label);
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border-strong);
}
.chat-table-note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-foreground);
  margin-top: 4px;
}
/* Markdown headings scaled for the rail (dashboard.css .prose sizes are for
   the 760px content column). Covers final answers and mid-run notes. */
.chat-messages .prose :where(h1) { font-size: 18px; }
.chat-messages .prose :where(h2) { font-size: 16px; }
.chat-messages .prose :where(h3) { font-size: 15px; margin-top: 12px; }
/* ---- reasoning groups (varro-legacy tool UI on vindra tokens) ----
   Status dots keep varro-legacy's traffic-light semantics: green done,
   amber running, red failed — the sanctioned exception to red-only. */
:root {
  --status-success: #4e8a5a;
  --status-running: #c9932b;
}
[x-cloak] { display: none !important; }
.rotate-90 { transform: rotate(90deg); }

.tool-call-group {
  border: 1px solid var(--border);
  background: var(--background);
  border-radius: var(--radius);
  padding: 8px 10px;
  margin: 10px 0;
}
.tool-call-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.tool-call-hgroup {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.tool-call-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: var(--tracking-label);
}
.tool-call-meta,
.tool-call-toggle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-foreground);
  white-space: nowrap;
}
.tool-call-chevron,
.tool-step-chevron {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-foreground);
  transition: transform 150ms ease;
  flex-shrink: 0;
}

/* connected timeline: left rule + status dots on each step */
.tool-steps {
  margin-top: 6px;
  margin-left: 5px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}
.tool-step {
  position: relative;
  padding: 3px 0 8px;
}
.tool-step:last-child { padding-bottom: 2px; }
.tool-step::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--border-strong);
  border: 2px solid var(--background);
  box-shadow: 0 0 0 1px var(--border-strong);
}
.tool-step[data-status="success"]::before {
  background: var(--status-success);
  box-shadow: 0 0 0 1px var(--status-success);
}
.tool-step[data-status="running"]::before {
  background: var(--status-running);
  box-shadow: 0 0 0 1px var(--status-running);
  animation: chat-pulse 1.6s ease-in-out infinite;
}
.tool-step[data-status="error"]::before {
  background: var(--red);
  box-shadow: 0 0 0 1px var(--red);
}
.tool-step-note::before {
  background: var(--border);
  box-shadow: 0 0 0 1px var(--border);
}

.tool-step-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  padding: 2px 6px;
  margin-left: -6px;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
}
.tool-step-summary:hover { background: var(--muted-2); }
.tool-step-summary .tool-step-chevron { margin-top: 3px; }
.tool-step-headings {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.tool-step-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  color: var(--foreground);
}
.tool-step-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-foreground);
  overflow-wrap: anywhere;
}
.tool-step-details { margin-top: 6px; }

/* the Input/Output card behind a step's toggle */
.tool-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tool-card-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tool-card-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.tool-code-block,
.tool-output-block {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--muted-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin: 0;
}
.tool-code-meta,
.tool-empty {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-foreground);
}

/* notes in the timeline: thinking, mid-run text, figures, url steers */
.tool-note-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--muted-foreground);
  display: block;
  margin-bottom: 3px;
}
.tool-note-body { font-size: 13px; overflow-wrap: anywhere; }
.tool-note-thinking {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  color: var(--muted-foreground);
  font-style: italic;
}
.tool-step .chat-img { margin: 4px 0; }
.tool-step .chat-url { margin: 2px 0; }
.chat-img {
  display: block;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--background);
  margin: 6px 0;
}
.chat-url {
  font-family: var(--font-mono);
  font-size: 12px;
  margin: 8px 0;
  overflow-wrap: anywhere;
}
.chat-url a {
  color: var(--foreground);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.12s;
}
.chat-url a:hover { text-decoration-color: var(--foreground); }
.chat-error {
  color: var(--red);
  font-size: 14px;
  background: var(--background);
  border: 1px solid var(--border);
  border-left: 2px solid var(--red);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin: 10px 0;
  overflow-wrap: anywhere;
}
/* thinking indicator: the game-of-life colony (chat/game_of_life.py) lives
   at the flow's tail; running it animates, idle it sits as the settled mark */
.chat-progress { padding: 2px 0 10px; }
.gol-canvas { display: block; }
@keyframes chat-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.chat-form {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding: 12px;
}
.chat-form-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-input {
  width: 100%;
  resize: vertical;
  min-height: 64px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--foreground);
}
.chat-input:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(33, 29, 22, 0.1);
}
.chat-input::placeholder { color: var(--muted-foreground); }
.chat-actions { display: flex; justify-content: flex-end; }
.chat-stop { width: 100%; }

/* ---- returns page ---- */
/* titan's returns layout on cato mechanics: filters row (products popover +
   risk select left, years toggle right), chart card with the view toggle in
   its head, tables with rank pills. All form controls stay plain inputs so
   the URL-state sync (change → /returns/_/filters) is untouched. */
.content-page-wide { max-width: 1260px; }

.filters-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.filters-left { display: flex; align-items: center; gap: 8px; }
.filters-right { display: flex; align-items: center; gap: 10px; }
.yrs-label {
  font-size: 13px;
  color: var(--muted-foreground);
  white-space: nowrap;
}
.risk-select { min-width: 150px; }
.filter-summary {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 190px;
  cursor: pointer;
}
.filter-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted-foreground);
}

/* toggle groups — titan's outline ToggleGroup as radio labels */
.toggle-group { display: inline-flex; }
.toggle-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-left-width: 0;
  background: var(--background);
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.toggle-btn:first-child {
  border-left-width: 1px;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.toggle-btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.toggle-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.toggle-btn:hover { background: var(--muted-2); }
.toggle-btn:has(input:checked) { background: var(--muted-2); }
.toggle-btn-primary:has(input:checked) {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--background);
}
.toggle-btn:has(input:focus-visible) {
  outline: 2px solid rgba(33, 29, 22, 0.55);
  outline-offset: 2px;
}

/* products popover */
.filter-details { position: relative; }
/* The summary borrows .select's field look; kill the disclosure marker. */
.filter-details > summary {
  display: inline-flex;
  align-items: center;
  list-style: none;
}
.filter-details > summary::-webkit-details-marker { display: none; }
.filter-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  min-width: 460px;
  max-width: 640px;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(33, 29, 22, 0.08);
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.filter-group { min-width: 150px; }
.filter-group-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  color: var(--muted-foreground);
  margin-bottom: 6px;
}
.filter-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 3px 0;
  cursor: pointer;
}
.content-slot { margin-bottom: 24px; transition: opacity 0.12s ease; }
/* in-flight feedback: htmx puts .htmx-request on the slot while it refetches;
   the delay keeps sub-200ms responses from flickering */
.content-slot.htmx-request { opacity: 0.55; transition-delay: 0.2s; }

/* chart card */
.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px 0;
}
.chart-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  margin: 0;
}
.chart-subtitle {
  font-size: 13px;
  color: var(--muted-foreground);
  margin: 2px 0 0;
}
.chart-body { padding: 16px 12px 12px; }
.chart-mount { position: relative; height: 384px; }

/* external chart tooltip — titan's layout: swatch / muted name / dark
   left-aligned tabular value */
.chart-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  column-gap: 8px;
  row-gap: 5px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(33, 29, 22, 0.12);
  padding: 8px 10px;
  font-size: 12px;
  white-space: nowrap;
}
.ct-swatch { width: 10px; height: 10px; border-radius: 2px; }
.ct-name { color: var(--muted-foreground); }
.ct-value {
  justify-self: start;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 600;
  color: var(--foreground);
}

/* table tabs (titan's Afkast/Aktiver switch) — pure CSS visibility */
.table-tabs { margin: 4px 0 14px; }
.table-tabs .tab {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.table-tabs .tab input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.table-tabs .tab:has(input:checked) {
  background: var(--background);
  color: var(--foreground);
  box-shadow: 0 1px 2px rgba(33, 29, 22, 0.06), 0 0 0 1px rgba(33, 29, 22, 0.06);
}
.table-tabs .tab:has(input:focus-visible) {
  outline: 2px solid rgba(33, 29, 22, 0.55);
  outline-offset: 2px;
}
.table-tabs:has(input[value="assets"]:checked) ~ #returns-returns-table { display: none; }
.table-tabs:has(input[value="returns"]:checked) ~ #returns-allocation-table { display: none; }

/* returns tables — titan's table look on the vindra mono table base.
   The wrap is the scroll container on both axes (a horizontal-overflow box
   can't defer vertical scrolling to #content-panel), sized to the viewport so
   sticky headers actually engage: dashboard.css pins thead th to top 0. */
.content-page-wide .table-wrap { max-height: calc(100vh - 110px); }

/* the product column rides along under horizontal scroll */
.returns-table .cell-product,
.returns-table thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--card);
}
.returns-table thead th { z-index: 3; }
.returns-table thead th:first-child { z-index: 4; }
.returns-table tbody tr:hover .cell-product { background: var(--muted-2); }
.group-label { display: inline-block; position: sticky; left: 14px; }

/* edge affordances: TABLE_EDGE_SCRIPT (ui.py) sets .can-left/.can-right */
.table-card { position: relative; }
.table-card::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 22px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  background: linear-gradient(270deg, rgba(33, 29, 22, 0.1), rgba(33, 29, 22, 0));
  z-index: 5;
}
.table-card.can-right::after { opacity: 1; }
.table-card.can-left .cell-product,
.table-card.can-left thead th:first-child {
  clip-path: inset(0 -14px 0 0);
  box-shadow: 10px 0 12px -10px rgba(33, 29, 22, 0.28);
}
.returns-table thead th {
  text-transform: uppercase;
  color: var(--muted-foreground);
  font-size: 10.5px;
}
.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
}
.num .th-sort { width: 100%; justify-content: flex-end; }
.sort-arrows {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}
.sort-arrow { font-size: 7px; color: var(--border-strong); }
th.sorted-asc .sort-asc,
th.sorted-desc .sort-desc { color: var(--foreground); }
.group-row td {
  padding: 6px 14px;
  background: var(--surface-1);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  color: var(--muted-foreground);
}
.group-row:hover { background: var(--surface-1); }
.cell-product { font-weight: 500; }
.cell-val.neg { color: var(--red); }
.cell-missing { color: var(--border-strong); }
.cell-descriptive { font-style: italic; color: var(--muted-foreground); }
.rank-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}
.rank-top { background: #DCFCE7; color: #15803D; }
.rank-good { background: #DBEAFE; color: #1D4ED8; }
.rank-rest { background: var(--muted-2); color: var(--muted-foreground); }

/* allocation heatmap — server-rendered ink ramp */
.heatmap-body { padding: 12px 20px 20px; }
.heatmap-table {
  border-collapse: separate;
  border-spacing: 2px;
}
.heatmap-table thead th {
  background: transparent;
  border-bottom: 0;
}
.heatmap-table thead th.hm-col {
  height: 116px;
  min-width: 62px;
  position: relative;
  vertical-align: bottom;
}
.hm-col span {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: rotate(-45deg);
  transform-origin: 0 100%;
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: normal;
  text-transform: none;
  color: var(--foreground);
}
.hm-product {
  text-align: right;
  padding: 0 10px;
  border-bottom: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}
.hm-cell {
  text-align: center;
  padding: 8px 6px;
  border-bottom: 0;
  font-size: 11px;
}
.hm-cell.hm-dark { color: var(--background); }
.heatmap-table tbody tr:hover { background: transparent; }
/* dashboard.css only styles .page-header .prose p; cato emits plain <p> */
.page-header > p {
  color: var(--foreground);
  font-size: 16px;
  line-height: 1.6;
  max-width: 760px;
  margin: 0;
}
.section-title {
  font-family: var(--font-display);
  font-size: 17.5px;
  font-weight: 500;
  margin: 4px 0 10px;
}
.empty-note { color: var(--muted-foreground); font-size: 14px; }
.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.notfound-actions { display: flex; gap: 8px; margin-top: 18px; }

/* ---- chats page ---- */
/* the list is short and the page below it empty — no reason to cage it */
.chats-card .table-wrap { max-height: none; overflow: visible; }
.chat-title-cell a {
  display: block;
  max-width: 560px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chats-card tr.row-active td { background: var(--muted-2); }
.chats-card tr.row-active td:first-child {
  box-shadow: inset 2px 0 0 var(--foreground);
}

/* ---- account page ---- */
.account-meta { font-size: 15px; margin: 0 0 20px; }
.account-card {
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 20px;
}
.account-card h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 12px;
}
.account-card form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.account-card .input {
  width: 100%;
  height: 36px;
  font-size: 14px;
  cursor: text;
}
.account-card .btn { align-self: flex-start; }
.account-links { margin-top: 20px; }

/* ---- auth pages (login, invite) ---- */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--background);
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 28px 28px 24px;
}
.auth-wordmark {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.1;
  margin: 0;
}
.auth-sub {
  font-size: 14px;
  color: var(--muted-foreground);
  margin: 6px 0 0;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}
.auth-form .input {
  width: 100%;
  height: 38px;
  font-size: 14px;
  cursor: text;
  min-width: 0;
}
.auth-form .btn {
  width: 100%;
  height: 36px;
  margin-top: 4px;
}
.form-error { color: var(--red); font-size: 13px; margin: 10px 0 0; }
.form-ok { font-size: 13px; margin: 10px 0 0; }

@media (max-width: 1200px) {
  .chat-rail { width: 320px; }
}
@media (max-width: 900px) {
  .chat-rail { display: none; }
  .chat-resize { display: none; }
  .content-page { padding: 20px; }
}

/* ---------- data page (routes/download.py) ---------- */
.dataset-tabs { margin-bottom: 16px; }
/* fra/til only mean anything for the monthly series; pure CSS visibility,
   same trick as the table tabs */
.year-range { display: none; align-items: center; gap: 6px; }
.year-range .select { min-width: 88px; }
.download-form:has(input[name="dataset"][value="afkast"]:checked) .year-range {
  display: flex;
}
.download-actions { display: flex; align-items: center; gap: 10px; margin: 0 0 20px; }
.preview-note {
  font-size: 12px;
  color: var(--muted-foreground);
  margin: 8px 2px 20px;
}
.prompt-card { margin-top: 4px; }
.prompt-summary {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.prompt-summary::-webkit-details-marker { display: none; }
.prompt-summary::before { content: "▸ "; color: var(--muted-foreground); }
.prompt-card[open] .prompt-summary::before { content: "▾ "; }
.prompt-body { position: relative; padding: 0 16px 14px; }
.prompt-body pre {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.55;
  overflow-x: auto;
}
.prompt-copy { position: absolute; top: 10px; right: 28px; }
