/* TCB Marketing AI theme. Colours are tokens only, defined for light and dark mode. */
:root {
  color-scheme: light;
  --nav-bg: #000d44;
  --nav-text: #ffffff;
  --nav-muted: #cbd5e1;
  --nav-accent: #60a5fa;
  --page-bg: #f1f5f9;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-selected: #eff6ff;
  --text: #0f172a;
  --text-muted: #475569;
  --label: #526582;
  --line: #e2e8f0;
  --line-strong: #94a3b8;
  --primary: #0b5ed7;
  --primary-text: #ffffff;
  --primary-hover: #0a4fb5;
  --link: #0b5ed7;
  --link-hover: #000d44;
  --success: #16803c;
  --danger: #b91c1c;
  --focus: #2563eb;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.06);
  --tone-green-bg: #dcfce7;
  --tone-green-text: #166534;
  --tone-amber-bg: #fef3c7;
  --tone-amber-text: #92400e;
  --tone-blue-bg: #dbeafe;
  --tone-blue-text: #1d4ed8;
  --tone-grey-bg: #e2e8f0;
  --tone-grey-text: #334155;
  --tone-red-bg: #fee2e2;
  --tone-red-text: #991b1b;
  --note-warn-bg: #fffbeb;
  --note-warn-line: #fcd34d;
  --note-warn-text: #78350f;
  --meter-good: #16803c;
  --meter-fair: #b45309;
  --meter-poor: #b91c1c;
  --step-active-bg: #000d44;
  --step-active-text: #ffffff;
  --step-active-muted: #cbd5e1;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-heading: "IBM Plex Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Dark tokens: follow the system unless the person chose Light, or always when they chose Dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --nav-bg: #020617;
    --nav-muted: #94a3b8;
    --page-bg: #0b1220;
    --surface: #111a2e;
    --surface-muted: #0f1729;
    --surface-selected: #13264a;
    --text: #e2e8f0;
    --text-muted: #a3b1c6;
    --label: #a3b1c6;
    --line: #24324d;
    --line-strong: #4b5d7e;
    --primary: #3b82f6;
    --primary-text: #ffffff;
    --primary-hover: #2563eb;
    --link: #8ab4ff;
    --link-hover: #c3d7ff;
    --success: #22a052;
    --danger: #f87171;
    --focus: #8ab4ff;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4);
    --tone-green-bg: #12351f;
    --tone-green-text: #86efac;
    --tone-amber-bg: #3a2a0c;
    --tone-amber-text: #fcd34d;
    --tone-blue-bg: #132a52;
    --tone-blue-text: #93c5fd;
    --tone-grey-bg: #24324d;
    --tone-grey-text: #cbd5e1;
    --tone-red-bg: #3b1515;
    --tone-red-text: #fca5a5;
    --note-warn-bg: #2a2110;
    --note-warn-line: #a16207;
    --note-warn-text: #fde68a;
    --meter-good: #22a052;
    --meter-fair: #f59e0b;
    --meter-poor: #f87171;
    --step-active-bg: #3b82f6;
    --step-active-text: #ffffff;
    --step-active-muted: #e0ecff;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --nav-bg: #020617;
  --nav-muted: #94a3b8;
  --page-bg: #0b1220;
  --surface: #111a2e;
  --surface-muted: #0f1729;
  --surface-selected: #13264a;
  --text: #e2e8f0;
  --text-muted: #a3b1c6;
  --label: #a3b1c6;
  --line: #24324d;
  --line-strong: #4b5d7e;
  --primary: #3b82f6;
  --primary-text: #ffffff;
  --primary-hover: #2563eb;
  --link: #8ab4ff;
  --link-hover: #c3d7ff;
  --success: #22a052;
  --danger: #f87171;
  --focus: #8ab4ff;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4);
  --tone-green-bg: #12351f;
  --tone-green-text: #86efac;
  --tone-amber-bg: #3a2a0c;
  --tone-amber-text: #fcd34d;
  --tone-blue-bg: #132a52;
  --tone-blue-text: #93c5fd;
  --tone-grey-bg: #24324d;
  --tone-grey-text: #cbd5e1;
  --tone-red-bg: #3b1515;
  --tone-red-text: #fca5a5;
  --note-warn-bg: #2a2110;
  --note-warn-line: #a16207;
  --note-warn-text: #fde68a;
  --meter-good: #22a052;
  --meter-fair: #f59e0b;
  --meter-poor: #f87171;
  --step-active-bg: #3b82f6;
  --step-active-text: #ffffff;
  --step-active-muted: #e0ecff;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--page-bg); color: var(--text); font: 14px/1.5 var(--font-ui); }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
h1, h2, h3 { font-family: var(--font-heading); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip-link { position: absolute; left: -9999px; }
/* Panels set their own display, which would otherwise show a hidden one. */
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fields > .field.end { justify-content: flex-end; flex: 0 0 auto; }
.skip-link:focus { left: 16px; top: 8px; z-index: 10; padding: 8px 12px; background: var(--surface); color: var(--text); }

/* Top menu */
.topnav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 20px; background: var(--nav-bg); color: var(--nav-text); }
.topnav > a, .topnav-links > a { display: inline-flex; align-items: center; min-height: 44px; color: var(--nav-text); font-weight: 600; text-decoration: none; }
.topnav > a:hover, .topnav-links > a:hover { color: var(--nav-text); text-decoration: underline; }
.topnav .brand { font-family: var(--font-heading); font-size: 18px; font-weight: 700; }
.topnav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; font-size: 13px; }
.topnav-links > a[aria-current] { box-shadow: inset 0 -2px 0 var(--nav-accent); }

/* Account dropdown in the top bar */
.user-menu { position: relative; }
.user-menu summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; border: 1px solid transparent; border-radius: 6px; color: var(--nav-text); cursor: pointer; list-style: none; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover, .user-menu[open] summary { border-color: var(--nav-muted); }
.user-menu-name { font-weight: 600; }
.user-menu-role { color: var(--nav-muted); }
.user-menu-chevron { flex: 0 0 auto; transition: transform 0.15s ease; }
.user-menu[open] .user-menu-chevron { transform: rotate(180deg); }
.user-menu-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 240px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 10px 30px rgb(15 23 42 / 0.18); display: flex; flex-direction: column; }
.user-menu-panel a, .user-menu-panel button { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; font-weight: 600; text-align: left; text-decoration: none; cursor: pointer; }
.user-menu-panel a:hover, .user-menu-panel button:hover { background: var(--surface-selected); color: var(--text); }
.user-menu-panel a[aria-current] { color: var(--link); }
.user-menu-panel form { margin: 0; padding-top: 6px; margin-top: 6px; border-top: 1px solid var(--line); }
.user-menu-panel form.theme-switch { padding: 6px 6px 10px; margin: 0 0 6px; border-top: 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.theme-switch-label { padding: 0 6px; color: var(--label); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.theme-switch-options { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted); }
.user-menu-panel .theme-switch-options button { flex: 1 1 0; justify-content: center; min-height: 44px; padding: 0 8px; color: var(--text-muted); }
.user-menu-panel .theme-switch-options button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
@media (prefers-reduced-motion: reduce) { .user-menu-chevron { transition: none; } }

/* Page structure */
.wrap { max-width: 1360px; margin: 0 auto; padding: 24px 20px 40px; display: flex; flex-direction: column; gap: 20px; }
.wrap.narrow { max-width: 760px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; }
.page-head h1 { margin: 0 0 6px; font-size: 28px; }
.page-head p { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.row > * { flex: 1 1 min(360px, 100%); }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel h2 { margin: 0; font-size: 16px; }
.panel h3 { margin: 0; font-size: 14px; }
.panel > p, .panel-head p, .card-body p { margin: 0; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.panel-head p { margin: 2px 0 0; }
.empty-state { padding: 28px 16px; text-align: center; color: var(--text-muted); }
.empty-state strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 16px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--primary); border-radius: 6px; background: var(--surface); color: var(--primary); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { color: var(--primary-hover); border-color: var(--primary-hover); }
.btn.primary { background: var(--primary); color: var(--primary-text); }
.btn.primary:hover { background: var(--primary-hover); color: var(--primary-text); }
.btn.ghost { border-color: var(--line-strong); color: var(--text); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.block { width: 100%; }
/* A small drawn mark inside a button or beside text, in the colour of the words. */
.icon { width: 16px; height: 16px; flex: 0 0 auto; }
.btn .icon { margin-right: 8px; }
.linkbtn { min-height: 44px; padding: 0 8px; border: 0; background: none; color: var(--link); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }

/* Status pills */
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; white-space: nowrap; }
.pill.green { background: var(--tone-green-bg); color: var(--tone-green-text); }
.pill.amber { background: var(--tone-amber-bg); color: var(--tone-amber-text); }
.pill.blue { background: var(--tone-blue-bg); color: var(--tone-blue-text); }
.pill.grey { background: var(--tone-grey-bg); color: var(--tone-grey-text); }
.pill.red { background: var(--tone-red-bg); color: var(--tone-red-text); }

/* Tables */
.table-box { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
.table-wide { min-width: 720px; }
th { padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--label); font-size: 12px; font-weight: 700; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
.row-inactive td { color: var(--text-muted); }

/* Key and value lists */
.kv-list { margin: 0; display: flex; flex-direction: column; }
.kv { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; text-align: right; }

/* Forms */
.fields { display: flex; flex-wrap: wrap; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
/* Inside a .fields row, fields share the width; elsewhere they stack at their natural height. */
.fields > .field { flex: 1 1 min(240px, 100%); }
.fields > .field.full { flex-basis: 100%; }
.field label, .field .label { font-size: 13px; font-weight: 600; }
.field .hint { color: var(--text-muted); font-size: 12px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=url], input[type=number], select, textarea {
  width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit;
}
textarea { padding: 10px 12px; resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-weight: 600; }
.check input { width: 18px; height: 18px; flex: 0 0 auto; }
fieldset.plain { margin: 0; padding: 0; border: 0; }

/* Messages */
.note { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted); color: var(--text-muted); font-size: 13px; }
.note.warn { border-color: var(--note-warn-line); background: var(--note-warn-bg); color: var(--note-warn-text); }
.flash-stack { display: flex; flex-direction: column; gap: 8px; }
.flash { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-weight: 600; }
.flash.success { border-color: var(--success); background: var(--tone-green-bg); color: var(--tone-green-text); }
.flash.info { border-color: var(--primary); background: var(--tone-blue-bg); color: var(--tone-blue-text); }
.flash.warning { border-color: var(--note-warn-line); background: var(--note-warn-bg); color: var(--note-warn-text); }
.flash.error { border-color: var(--danger); background: var(--tone-red-bg); color: var(--tone-red-text); }
.form-error { margin: 0; padding: 12px 14px; border: 1px solid var(--danger); border-radius: 8px; background: var(--tone-red-bg); color: var(--tone-red-text); font-weight: 600; }

/* Setup status list */
.status-list { display: flex; flex-direction: column; }
.status-item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.status-item:last-child { border-bottom: 0; }

/* Pagination */
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; color: var(--text-muted); font-size: 13px; }

/* Sign-in page */
.login-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 32px 16px; }
.login-card { width: min(100%, 30rem); overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 20px 50px rgb(15 23 42 / 0.12); }
.login-card header { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 6.5rem; padding: 1.5rem 2rem; background: var(--nav-bg); color: var(--nav-text); }
.login-card header strong { font-family: var(--font-heading); font-size: 19px; }
.login-card header span { color: var(--nav-muted); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.login-body { padding: 2.25rem; display: flex; flex-direction: column; gap: 16px; }
.login-body h1 { margin: 0; font-size: 26px; }
.login-body p { margin: 0; }
.eyebrow { color: var(--link); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

/* Buttons: extra variants */
.btn.success { background: var(--success); border-color: var(--success); color: var(--primary-text); }
.btn.success:hover { color: var(--primary-text); filter: brightness(0.95); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
/* A part of the page that can't be used for the moment, such as the editor while the AI revises.
   The veil shows it and catches the mouse; the inert attribute in the markup stops the keyboard. */
.paused { position: relative; }
.paused::after { content: ""; position: absolute; inset: -4px; z-index: 2; border-radius: 10px; background: var(--page-bg); opacity: 0.65; cursor: not-allowed; }

/* Small uppercase labels */
.label-caps { color: var(--label); font-size: 12px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }

/* Stat tiles */
.stats { display: flex; flex-wrap: wrap; gap: 16px; }
.stat { flex: 1 1 min(200px, 100%); padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.stat strong { font-family: var(--font-heading); font-size: 28px; line-height: 1; }

/* Workflow step bar */
.steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.steps li { flex: 1 1 min(140px, 100%); display: flex; }
.steps a, .steps .step { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 56px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font-weight: 600; text-decoration: none; }
.steps a:hover { border-color: var(--primary); color: var(--text); }
.step-number { color: var(--label); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.steps .done a { border-color: var(--success); }
.steps .done .step-number { color: var(--tone-green-text); }
.steps .current a { border-color: var(--primary); }
.steps a[aria-current] { background: var(--step-active-bg); border-color: var(--step-active-bg); color: var(--step-active-text); }
.steps a[aria-current] .step-number { color: var(--step-active-muted); }

/* Selectable option cards. The checked state comes from the input itself. */
.option { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.option input { width: 18px; height: 18px; margin: 2px 0 0; flex: 0 0 auto; }
.option:has(input:checked) { border-color: var(--primary); background: var(--surface-selected); }
.option-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.option.compact { align-items: center; padding: 0 12px; }
.option.static { cursor: default; border-style: dashed; background: var(--surface-muted); color: var(--text-muted); }
.option-list { display: flex; flex-direction: column; gap: 8px; }

/* Scores */
.score { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
meter { flex: 1 1 auto; width: 100%; height: 8px; border: 0; border-radius: 999px; background: var(--line); }
meter::-webkit-meter-bar { height: 8px; border: 0; border-radius: 999px; background: var(--line); }
meter::-webkit-meter-optimum-value { border-radius: 999px; background: var(--meter-good); }
meter::-webkit-meter-suboptimum-value { border-radius: 999px; background: var(--meter-fair); }
meter::-webkit-meter-even-less-good-value { border-radius: 999px; background: var(--meter-poor); }
meter::-moz-meter-bar { border-radius: 999px; background: var(--meter-good); }
meter:-moz-meter-sub-optimum::-moz-meter-bar { background: var(--meter-fair); }
meter:-moz-meter-sub-sub-optimum::-moz-meter-bar { background: var(--meter-poor); }
meter.neutral::-webkit-meter-optimum-value { background: var(--primary); }
meter.neutral::-moz-meter-bar { background: var(--primary); }

/* Cards with header, body and footer */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; align-items: stretch; }
.card { display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.card > header, .card-body, .card > footer { padding: 16px 20px; }
.card > header { display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line); }
.card > header h2 { margin: 0; font-size: 18px; }
.card-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 14px; }
.card > footer { border-top: 1px solid var(--line); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.quote-box { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-muted); color: var(--text); }

/* Approval checks */
.check-list { padding: 0; gap: 0; overflow: hidden; }
.check-row { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: 0; }
.check-row.attention { background: var(--note-warn-bg); }
.check-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.check-head .grow { flex: 1 1 min(320px, 100%); min-width: 0; }
.check-row table { background: var(--surface); border: 1px solid var(--line); }
.summary-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.summary-bar meter { flex: 1 1 200px; }
/* Progress of long work inside a panel: a meter with its numbers, then what is happening. */
.progress-block { display: flex; flex-direction: column; gap: 10px; }
.progress-block > p { margin: 0; }
.progress-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.progress-row meter { flex: 1 1 240px; }
/* Numbers that change in place keep their width, so the text beside them does not jump. */
.count { font-variant-numeric: tabular-nums; }

/* Email preview */
.preview-stage { padding: 20px; background: var(--page-bg); border-radius: 8px; }
.email-frame { display: block; width: 100%; max-width: 640px; height: 720px; margin: 0 auto; border: 1px solid var(--line); border-radius: 4px; background: #ffffff; }
.plain-text { margin: 0; padding: 16px; overflow-x: auto; white-space: pre-wrap; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted); font: 13px/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace; }
details.disclosure > summary { padding: 12px 0; font-weight: 700; cursor: pointer; }

/* Model comparison */
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.draft-out { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted); white-space: pre-line; }
.rating { display: flex; flex-wrap: wrap; gap: 4px 14px; }

/* Tabs: links to the sections of one area, the current one marked with aria-current */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-bottom: 2px solid transparent; color: var(--label); font-weight: 700; text-decoration: none; }
.tabs a:hover { border-bottom-color: var(--primary); color: var(--text); }
.tabs a[aria-current] { border-bottom-color: var(--primary); color: var(--text); }

/* Settings forms */
.settings-form { display: flex; flex-direction: column; gap: 16px; }
.settings-form .check { min-height: 36px; }

/* Grouped tables */
.group-row td { background: var(--surface-muted); color: var(--label); font-size: 12px; font-weight: 700; text-transform: uppercase; }

/* A form that wraps a whole page keeps the page's spacing between its sections. */
.stack { display: flex; flex-direction: column; gap: 20px; }
/* Reader: a list of articles beside the chosen article, one to two. */
.reader { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.reader-side, .reader-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.reader-filter { display: flex; flex-direction: column; gap: 12px; }
/* A plain block, not a flex column: inside a fixed height, flex would squeeze the rows into each other. */
.reader-list { max-height: 70vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.reader-list a { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 44px; padding: 12px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.reader-list a:last-child { border-bottom: 0; }
.reader-list a:hover { background: var(--surface-muted); }
.reader-list a[aria-current] { background: var(--surface-selected); box-shadow: inset 3px 0 0 var(--primary); }
@media (max-width: 900px) {
  .reader { grid-template-columns: minmax(0, 1fr); }
  .reader-list { max-height: 50vh; }
}
@media (max-width: 600px) {
  .user-menu-panel { right: auto; left: 0; }
  .wrap { padding: 16px; }
  .login-body { padding: 1.5rem; }
  .kv dd { text-align: left; }
}
