/* Prozone AI product chrome — the final-report visual language, applied system-wide. */
* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  min-height: 100vh; margin: 0; display: flex;
  background: var(--bg-app); color: var(--text-primary);
  font: var(--font-size-base)/var(--lh-normal) var(--font-family-base);
}
a { color: var(--accent-default); text-decoration: none; }
a:hover { text-decoration: none; }

/* App sidebar — follows the theme (light rail in light, deep-slate rail in dark);
   the colour logo always rides a fixed white --brand-plate. See tokens.css --sidebar-* */
.sidebar {
  position: sticky; top: 0; z-index: var(--z-sidebar); width: var(--sidebar-w); height: 100vh; flex: 0 0 var(--sidebar-w);
  display: flex; flex-direction: column; gap: 2px; padding: var(--space-5) var(--space-4) var(--space-4);
  color: var(--sidebar-text); background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border); box-shadow: 1px 0 0 var(--sidebar-border);
}
.brand { display: flex; align-items: center; margin: 0 0 var(--space-2); }
.sidebar-logo { width: 100%; max-width: 252px; height: auto; }
/* Dark rail: the transparent-PNG logo rides a white plate so the colour mark stays legible. */
[data-theme="dark"] .brand { padding: 10px var(--space-3); border-radius: var(--radius-lg); background: var(--brand-plate); box-shadow: 0 1px 3px rgba(2, 6, 23, .5); }
/* Tagline: an anchored statement, not a stray line — a short accent tick (page-kicker
   DNA) above it, allowed to wrap to two lines so it reads as a deliberate descriptor. */
.brand-tagline { margin: var(--space-2) 0 var(--space-5); color: var(--sidebar-text-strong); font-size: 15px; font-weight: var(--fw-semibold); line-height: 1.3; letter-spacing: -.03em; white-space: nowrap; text-align: center; }
.brand-tagline::before { content: ""; display: block; width: 26px; height: 2px; margin: 0 auto 10px; border-radius: 1px; background: var(--sidebar-accent); }
.demo-badge {
  display: flex; align-items: center; gap: var(--space-3); margin: 0 0 var(--space-4);
  padding: 11px var(--space-3); border: 1px solid var(--sidebar-active-border);
  border-radius: var(--radius-md); background: var(--sidebar-active-bg);
}
.demo-badge-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--text-muted); }
/* state is polled; the dot always pairs with the text beside it, never alone */
#system-state[data-state="ok"] .demo-badge-dot { background: var(--color-success-600); }
#system-state[data-state="busy"] .demo-badge-dot { background: var(--accent-default); }
#system-state[data-state="attention"] .demo-badge-dot { background: var(--color-danger-600); }
.demo-badge div { display: grid; min-width: 0; line-height: 1.3; }
.demo-badge strong { color: var(--sidebar-active-text); font-size: var(--font-size-sm); font-weight: var(--fw-semibold); letter-spacing: -.01em; }
.demo-badge small { margin-top: 2px; color: var(--sidebar-text); font-size: var(--font-size-xs); }
.nav-section-label { margin: var(--space-2) var(--space-3) var(--space-1); color: var(--sidebar-text-muted); font-size: 10px; font-weight: var(--fw-semibold); letter-spacing: .09em; text-transform: uppercase; }
.sidebar > a {
  position: relative; display: flex; align-items: center; gap: var(--space-3); min-height: 42px;
  padding: var(--space-2) var(--space-3); border: 1px solid transparent; border-radius: var(--radius-md);
  color: var(--sidebar-text); font-size: var(--font-size-sm); font-weight: var(--fw-medium);
  transition: color var(--motion-fast), background var(--motion-fast), border-color var(--motion-fast);
}
.sidebar > a:hover { color: var(--sidebar-text-strong); background: var(--sidebar-hover-bg); }
.sidebar > a.active { color: var(--sidebar-active-text); background: var(--sidebar-active-bg); border-color: var(--sidebar-active-border); }
.sidebar > a.active::after { content: ""; position: absolute; left: -17px; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: var(--sidebar-accent); }
.nav-icon { display: grid; place-items: center; width: 18px; height: 18px; flex: none; }
.nav-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.spacer { flex: 1; }
/* Bottom of the rail: a standalone theme toggle, then a compact profile + logout row */
.sidebar-theme {
  display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: 40px;
  margin-bottom: var(--space-2); padding: var(--space-2) var(--space-3); border: 0;
  border-radius: var(--radius-md); background: transparent; color: var(--sidebar-text);
  font: var(--fw-medium) var(--font-size-sm)/1 var(--font-family-base); text-align: left; cursor: pointer;
}
.sidebar-theme:hover { color: var(--sidebar-text-strong); background: var(--sidebar-hover-bg); transform: none; box-shadow: none; }
.account-card { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3); border: 1px solid var(--sidebar-border); border-radius: var(--radius-md); background: var(--sidebar-card-bg); }
.user-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--sidebar-active-bg); color: var(--sidebar-active-text); font-size: 13px; font-weight: var(--fw-semibold); text-transform: uppercase; }
.user-copy { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.user-copy strong { overflow: hidden; color: var(--sidebar-text-strong); font-size: var(--font-size-sm); text-overflow: ellipsis; white-space: nowrap; }
.user-copy small { color: var(--sidebar-text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
/* linklike: borderless text button. Base is theme-aware (inline menus in the
   main canvas); the sidebar logout overrides to the light rail. */
button.linklike {
  min-height: 30px; padding: var(--space-1) var(--space-2); border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-secondary); font-size: var(--font-size-xs); text-align: center;
}
button.linklike:hover { color: var(--text-primary); background: var(--bg-hover); transform: none; box-shadow: none; }
.account-card form { display: flex; flex: none; }
.account-logout { flex: none; color: var(--sidebar-text); font-weight: var(--fw-medium); }
.account-logout:hover { color: var(--sidebar-active-text); background: var(--sidebar-hover-bg); }

/* Main canvas and paper composition */
main { width: calc(100% - var(--sidebar-w)); min-width: 0; flex: 1; padding: 42px clamp(24px, 4vw, 64px) 64px; }
.page-shell { width: min(1180px, 100%); margin: 0 auto; }
.page-shell.narrow { width: min(860px, 100%); }
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-5);
  margin-bottom: var(--space-5);
}
.page-kicker { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--accent-default); font-size: var(--font-size-xs); font-weight: var(--fw-semibold); letter-spacing: .1em; text-transform: uppercase; }
.page-kicker::before { content: ""; width: 22px; height: 2px; background: currentColor; }
.page-header h1, .hero-title { margin: 6px 0 5px; font-size: clamp(26px, 3vw, 36px); line-height: 1.15; letter-spacing: -.035em; }
.page-header p { max-width: 660px; margin: 0; color: var(--text-secondary); font-size: var(--font-size-md); }
.page-actions { display: flex; align-items: center; gap: var(--space-2); flex: none; }
.surface-panel, .card {
  border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface);
  box-shadow: var(--shadow-panel-current);
}
.surface-panel { overflow: hidden; }
.card { padding: var(--space-5); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-default); }
.panel-head h2, .panel-head h3 { margin: 0; font-size: var(--font-size-md); }
.panel-head p { margin: 2px 0 0; color: var(--text-muted); font-size: var(--font-size-xs); }
.panel-body { padding: var(--space-5); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.toolbar h1 { margin: 0; }
.section-eyebrow { display: block; margin-bottom: 3px; color: var(--text-muted); font-size: 10px; font-weight: var(--fw-semibold); letter-spacing: .1em; text-transform: uppercase; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }
h1 { margin: 0 0 var(--space-4); font-size: var(--font-size-xl); line-height: var(--lh-tight); letter-spacing: -.025em; }
h2 { letter-spacing: -.018em; }
h3 { font-size: var(--font-size-md); font-weight: var(--fw-semibold); }
.meta { color: var(--text-muted); font-size: var(--font-size-sm); }

/* Data tables */
.table-wrap { width: 100%; overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); }
table.list th { padding: 11px var(--space-4); border-bottom: 1px solid var(--border-strong); background: var(--bg-subtle); color: var(--text-muted); font-size: 10px; font-weight: var(--fw-semibold); letter-spacing: .085em; text-align: left; text-transform: uppercase; }
table.list td { padding: 14px var(--space-4); border-bottom: 1px solid var(--table-row-border); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr { transition: background var(--motion-fast), transform var(--motion-fast); }
table.list tr.rowlink:hover, table.list tbody tr:hover { background: var(--table-row-hover); }
table.list tr.rowlink { cursor: pointer; }
.meeting-title { display: grid; gap: 2px; }
.meeting-title strong { color: var(--text-primary); font-size: var(--font-size-base); }
.meeting-title small { color: var(--text-muted); font-size: var(--font-size-xs); }
td.num, .tabular { font-variant-numeric: tabular-nums slashed-zero; }
.row-arrow { color: var(--text-muted); font-size: var(--font-size-md); transition: transform var(--motion-fast), color var(--motion-fast); }
tr:hover .row-arrow { color: var(--accent-default); transform: translateX(2px); }

/* Status and notices */
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 9px; border-radius: var(--chip-radius); background: var(--bg-subtle); color: var(--text-secondary); font-size: var(--font-size-xs); font-weight: var(--fw-medium); white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 12%, transparent); }
.chip.processing, .chip.in_review { background: var(--status-info-bg); color: var(--status-info-text); }
.chip.failed { background: var(--status-danger-bg); color: var(--status-danger-text); }
.chip.ready_for_review { background: var(--status-warning-bg); color: var(--status-warning-text); }
.chip.final { background: var(--status-success-bg); color: var(--status-success-text); }
.notice, .error { display: flex; align-items: flex-start; gap: var(--space-2); margin: var(--space-3) 0; padding: var(--space-3) var(--space-4); border: 1px solid transparent; border-radius: var(--radius-md); font-size: var(--font-size-sm); }
.notice { background: var(--status-warning-bg); color: var(--status-warning-text); }
.notice.info { background: var(--status-info-bg); color: var(--status-info-text); }
.error { border-color: color-mix(in srgb, var(--status-danger-text) 25%, transparent); background: var(--status-danger-bg); color: var(--status-danger-text); }
.empty { display: grid; place-items: center; min-height: 220px; padding: var(--space-7); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--bg-surface) 78%, transparent); color: var(--text-muted); text-align: center; }

/* Buttons and form controls */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 36px; padding: var(--space-2) var(--space-3); border: 1px solid var(--button-secondary-border); border-radius: var(--radius-md); background: var(--bg-surface); color: var(--button-secondary-text); cursor: pointer; font: var(--fw-medium) var(--font-size-sm)/1 var(--font-family-base); text-decoration: none; transition: background var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast), transform var(--motion-fast), box-shadow var(--motion-fast); }
button:hover, .btn:hover { background: var(--bg-hover); box-shadow: 0 3px 9px rgba(15,23,42,.06); transform: translateY(-1px); }
button:active, .btn:active { transform: none; box-shadow: none; }
button.primary, .btn.primary { border-color: var(--button-primary-bg); background: var(--button-primary-bg); color: var(--button-primary-text); box-shadow: 0 6px 14px color-mix(in srgb, var(--button-primary-bg) 23%, transparent); }
button.primary:hover, .btn.primary:hover { border-color: var(--button-primary-bg-hover); background: var(--button-primary-bg-hover); }
button.danger, .btn.danger { border-color: var(--button-danger-bg); background: var(--button-danger-bg); color: var(--text-on-accent); }
button.danger:hover, .btn.danger:hover { background: var(--button-danger-bg-hover); border-color: var(--button-danger-bg-hover); }
td.user-actions { display: flex; gap: var(--space-1); flex-wrap: wrap; justify-content: flex-end; }
td.user-actions form { display: inline; }
.role-form { display: flex; gap: var(--space-1); align-items: center; }
.role-form select { min-height: 30px; padding: 2px var(--space-2); font-size: var(--font-size-xs); }
.pending-pw { display: block; color: var(--status-warning-text); font-size: var(--font-size-xs); }
.purge-form { padding: var(--space-4); border-top: 1px solid var(--border-default); }
.purge-row { display: flex; gap: var(--space-2); align-items: center; margin: var(--space-2) 0; }
.purge-row input { max-width: 220px; }
button:disabled, .btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.tiny { min-height: 28px; padding: 3px var(--space-2); border-radius: var(--radius-sm); font-size: var(--font-size-xs); }
.btn.large { min-height: 44px; padding: var(--space-3) var(--space-4); }
input, select, textarea { width: 100%; min-height: 40px; padding: 9px var(--space-3); border: 1px solid var(--input-border); border-radius: var(--radius-md); background: var(--bg-surface); color: var(--text-primary); font: var(--font-size-sm)/1.35 var(--font-family-base); transition: border-color var(--motion-fast), box-shadow var(--motion-fast), background var(--motion-fast); }
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--input-border-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus-ring) 15%, transparent); }
input[type="checkbox"], input[type="radio"] { min-height: 0; }
label { display: block; margin: var(--space-3) 0 var(--space-1); color: var(--text-secondary); font-size: var(--font-size-sm); font-weight: var(--fw-medium); }
.field-hint { margin-top: 3px; color: var(--text-muted); font-size: var(--font-size-xs); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-4); }
.form-actions { display: flex; gap: var(--space-2); margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--border-default); }
.upload-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--space-4); align-items: start; }
.upload-card { padding: var(--space-6); }
.assurance-card { padding: var(--space-5); border-color: var(--accent-tint-border); background: var(--accent-tint); }
.assurance-card h3 { margin: 0 0 var(--space-3); }
.assurance-list { display: grid; gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.assurance-list li { display: grid; grid-template-columns: 24px 1fr; gap: var(--space-2); color: var(--text-secondary); font-size: var(--font-size-sm); }
.assurance-list span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--status-success-bg); color: var(--status-success-text); font-size: 11px; font-weight: var(--fw-semibold); }

/* Operational dashboard */
/* Use the horizontal space on wide monitors instead of a narrow centred column. */
.dashboard-page, .records-page { width: min(1560px, 100%); max-width: none; }
/* On desktop the control tab fills the viewport height so everything is visible
   at once, never scrollable — the priority/workflow row grows to take up slack. */
@media (min-width: 981px) {
  .dashboard-page { display: flex; flex-direction: column; min-height: calc(100vh - 106px); }
  .dashboard-page .dashboard-grid { flex: 1 1 auto; }
}
.dashboard-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-6); margin: var(--space-5) 0 var(--space-4); }
.dashboard-hero h1 { margin: 7px 0 6px; font-size: clamp(26px, 3vw, 36px); letter-spacing: -.035em; }
.dashboard-hero p { max-width: 1000px; margin: 0; color: var(--text-secondary); font-size: var(--font-size-md); }
.hero-action { flex: none; }
.success-banner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); padding: var(--space-3) var(--space-4); border: 1px solid color-mix(in srgb, var(--status-success-text) 24%, transparent); border-radius: var(--radius-lg); background: var(--status-success-bg); color: var(--status-success-text); }
.success-banner .banner-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb, var(--status-success-text) 15%, transparent); font-weight: var(--fw-semibold); }
.success-banner div { display: grid; }
.success-banner span, .success-banner a { font-size: var(--font-size-sm); }
.success-banner a { color: inherit; font-weight: var(--fw-semibold); }
.success-banner.compact { grid-template-columns: auto 1fr; margin-top: var(--space-3); padding-top: var(--space-2); padding-bottom: var(--space-2); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.metric-card { position: relative; overflow: hidden; display: flex; align-items: center; gap: var(--space-3); min-height: 104px; padding: var(--space-4); border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface); transition: border-color var(--motion-fast); }
.metric-card:hover { border-color: var(--border-strong); }
.metric-primary { border-color: var(--accent-tint-border); background: var(--accent-tint); }
.metric-primary:hover { border-color: var(--accent-default); }
.metric-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: var(--radius-md); background: var(--bg-subtle); color: var(--accent-default); font-size: var(--font-size-lg); }
.metric-card > div { display: grid; min-width: 0; }
.metric-label { color: var(--text-secondary); font-size: var(--font-size-xs); font-weight: var(--fw-medium); }
.metric-card strong { margin: 2px 0; font-size: 27px; line-height: 1; font-variant-numeric: tabular-nums; }
.metric-card small { color: var(--text-muted); font-size: 11px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .65fr); gap: var(--space-4); margin-bottom: var(--space-4); align-items: stretch; }
.attention-panel, .process-panel { min-height: 260px; }
.attention-count { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-tint); color: var(--accent-active); font-size: var(--font-size-sm); font-weight: var(--fw-semibold); }
.action-list { display: grid; }
.action-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--border-default); color: inherit; transition: background var(--motion-fast); }
.action-row:last-child { border-bottom: 0; }
.action-row:hover { background: var(--bg-hover); }
.action-status { width: 9px; height: 9px; border-radius: 50%; background: var(--text-muted); box-shadow: 0 0 0 4px var(--bg-subtle); }
.action-status.ready_for_review { background: var(--status-warning-text); box-shadow: 0 0 0 4px var(--status-warning-bg); }
.action-status.in_review, .action-status.processing { background: var(--status-info-text); box-shadow: 0 0 0 4px var(--status-info-bg); }
.action-status.failed { background: var(--status-danger-text); box-shadow: 0 0 0 4px var(--status-danger-bg); }
.action-copy { display: grid; min-width: 0; }
.action-copy strong { overflow: hidden; color: var(--text-primary); font-size: var(--font-size-sm); text-overflow: ellipsis; white-space: nowrap; }
.action-copy small { overflow: hidden; margin-top: 2px; color: var(--text-muted); font-size: var(--font-size-xs); text-overflow: ellipsis; white-space: nowrap; }
.action-arrow { color: var(--text-muted); transition: transform var(--motion-fast); }
.action-row:hover .action-arrow { transform: translateX(3px); color: var(--accent-default); }
.all-clear { display: flex; align-items: center; justify-content: center; gap: var(--space-4); min-height: 220px; padding: var(--space-6); color: var(--text-secondary); }
.all-clear > span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--status-success-bg); color: var(--status-success-text); font-size: var(--font-size-lg); }
.all-clear p { margin: 3px 0 0; color: var(--text-muted); font-size: var(--font-size-sm); }
.process-list { display: grid; gap: 0; margin: 0; padding: var(--space-3) var(--space-5); list-style: none; }
.process-list li { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: var(--space-3); padding: 9px 0; }
.process-list li:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 37px; bottom: -3px; width: 1px; background: var(--border-default); }
.process-list li > span { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--accent-tint-border); border-radius: 50%; background: var(--accent-tint); color: var(--accent-active); font-size: 11px; font-weight: var(--fw-semibold); }
.process-list li div { display: grid; }
.process-list strong { font-size: var(--font-size-xs); }
.process-list small { margin-top: 1px; color: var(--text-muted); font-size: 11px; }
.trust-strip { display: flex; align-items: center; gap: var(--space-3); margin: 0 var(--space-4) var(--space-4); padding: var(--space-3); border-radius: var(--radius-md); background: var(--status-success-bg); }
.trust-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--status-success-text); box-shadow: 0 0 0 4px color-mix(in srgb, var(--status-success-text) 13%, transparent); }
.trust-strip strong { color: var(--status-success-text); font-size: var(--font-size-xs); }
/* attention panel: pin the "view all" link to the bottom as a real footer so it
   doesn't float awkwardly under a short list */
.attention-panel { display: flex; flex-direction: column; }
.attention-panel .all-clear { flex: 1; }
.panel-foot-link { margin-top: auto; display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: var(--space-3) var(--space-5); border-top: 1px solid var(--border-default); color: var(--accent-default); font-weight: var(--fw-medium); font-size: var(--font-size-sm); transition: background var(--motion-fast), color var(--motion-fast); }
.panel-foot-link:hover { background: var(--bg-hover); color: var(--accent-active); }
.governance-strip { display: grid; grid-template-columns: 1.1fr repeat(2, 1fr) auto; align-items: center; gap: var(--space-4); margin-bottom: 0; padding: var(--space-4) var(--space-5); border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface); }
.governance-strip > div { display: grid; }
.governance-strip a { display: grid; padding-left: var(--space-4); border-left: 1px solid var(--border-default); color: inherit; }
.governance-strip a span { font-size: var(--font-size-md); font-weight: var(--fw-semibold); }
.governance-strip a small { color: var(--text-muted); font-size: 10px; }
.governance-strip .governance-link { display: block; color: var(--accent-default); font-size: var(--font-size-xs); font-weight: var(--fw-semibold); }
.meetings-section { margin-top: var(--space-6); }
.section-header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-5); margin-bottom: var(--space-4); }
.section-header h2 { margin: 2px 0; font-size: var(--font-size-lg); }
.section-header p { margin: 0; color: var(--text-muted); font-size: var(--font-size-sm); }
.search-box { position: relative; width: 230px; margin: 0; }
.search-box span { position: absolute; left: 12px; top: 9px; color: var(--text-muted); font-size: var(--font-size-md); }
.search-box input { padding-left: 34px; }
.table-empty { padding: var(--space-6); color: var(--text-muted); text-align: center; }
.discovery-shell.surface-panel { position: relative; z-index: var(--z-sticky-inline); overflow: visible; margin-bottom: var(--space-3); }
.quick-views { display: flex; gap: 3px; padding: 5px; overflow-x: auto; border-bottom: 1px solid var(--border-default); background: var(--bg-subtle); }
.quick-view { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 38px; padding: 7px 11px; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: var(--font-size-xs); font-weight: var(--fw-medium); white-space: nowrap; }
.quick-view:hover { background: var(--bg-hover); color: var(--text-primary); }
.quick-view.active { background: var(--bg-surface); color: var(--accent-active); box-shadow: 0 1px 4px rgba(15,23,42,.08); }
.quick-view strong { display: grid; place-items: center; min-width: 21px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--bg-subtle); color: var(--text-muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.quick-view.active strong { background: var(--accent-tint); color: var(--accent-active); }
.discovery-form { padding: var(--space-4) var(--space-5) var(--space-3); }
.discovery-search-row { display: grid; grid-template-columns: minmax(280px, 1fr) auto auto; gap: var(--space-2); align-items: center; }
.discovery-search { width: 100%; }
.discovery-search input { min-height: 44px; font-size: var(--font-size-base); }
.discovery-search > span { top: 10px; font-size: 20px; }
.discovery-search-row > button, .filter-details > summary { min-height: 44px; }
.filter-details { position: relative; }
.filter-details > summary { list-style: none; }
.filter-details > summary::-webkit-details-marker { display: none; }
.filter-details[open] > summary { border-color: var(--accent-tint-border); background: var(--accent-tint); color: var(--accent-active); }
.filter-count { display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--accent-default); color: var(--text-on-accent); font-size: 10px; }
.filter-popover { position: absolute; top: calc(100% + 8px); right: 0; z-index: var(--z-popover); width: min(760px, calc(100vw - 300px)); padding: var(--space-4); border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface); box-shadow: var(--shadow-float); }
.filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: var(--space-3); }
.filter-grid label { margin-top: 0; }
.filter-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--border-default); }
.discovery-result-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 45px; padding: var(--space-2) var(--space-5) var(--space-3); }
.discovery-result-bar > div:first-child { display: inline-flex; align-items: baseline; gap: 5px; color: var(--text-secondary); font-size: var(--font-size-xs); white-space: nowrap; }
.discovery-result-bar > div:first-child strong { color: var(--text-primary); font-size: var(--font-size-md); font-variant-numeric: tabular-nums; }
.discovery-result-bar > div:first-child small { margin-left: 5px; color: var(--text-muted); }
.active-filters { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.filter-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 260px; padding: 5px 7px 5px 9px; border: 1px solid var(--accent-tint-border); border-radius: 15px; background: var(--accent-tint); color: var(--accent-active); font-size: 10px; }
.filter-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-chip b { font-size: var(--font-size-sm); font-weight: var(--fw-regular); line-height: 1; }
.clear-filters { color: var(--text-muted); font-size: 10px; text-decoration: underline; text-underline-offset: 2px; }
.meeting-results { position: relative; z-index: 1; }
.meeting-row-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.meeting-tag { display: inline-flex; align-items: center; max-width: 150px; padding: 2px 6px; border: 1px solid var(--border-default); border-radius: 9px; background: var(--bg-subtle); color: var(--text-secondary); font-size: 9px; font-weight: var(--fw-medium); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discovery-empty { min-height: 260px; }
.discovery-empty h3, .discovery-empty p { margin: 0; }
.pagination { display: flex; align-items: center; justify-content: center; gap: var(--space-3); margin-top: var(--space-3); }
.pagination > span { color: var(--text-muted); font-size: var(--font-size-xs); }
.pagination .disabled { opacity: .45; pointer-events: none; }
.dashboard-empty { align-content: center; gap: var(--space-2); }
.dashboard-empty h3, .dashboard-empty p { margin: 0; }
.dashboard-empty p { max-width: 560px; }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent-tint); color: var(--accent-active); font-size: var(--font-size-lg); }

/* Guided meeting intake */
.create-page { max-width: 1260px; }
.create-header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-6); margin-bottom: var(--space-5); }
.create-header .back-link { margin-bottom: var(--space-4); }
.create-header .page-kicker { display: flex; }
.create-header h1 { margin: 7px 0 5px; font-size: clamp(30px, 3vw, 40px); }
.create-header p { max-width: 760px; margin: 0; color: var(--text-secondary); font-size: var(--font-size-md); }
.create-security { display: flex; align-items: center; gap: var(--space-3); min-width: 270px; padding: var(--space-3) var(--space-4); border: 1px solid color-mix(in srgb, var(--status-success-text) 22%, var(--border-default)); border-radius: var(--radius-lg); background: var(--status-success-bg); }
.create-security div { display: grid; }
.create-security strong { color: var(--status-success-text); font-size: var(--font-size-xs); }
.create-security small { margin-top: 2px; color: var(--text-muted); font-size: 10px; }
.create-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-4); align-items: start; }
.create-form { display: grid; gap: var(--space-4); }
.form-section { overflow: visible; }
.form-section-head { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-default); }
.form-section-head h2 { margin: 0; font-size: var(--font-size-md); }
.form-section-head p { margin: 2px 0 0; color: var(--text-muted); font-size: var(--font-size-xs); }
.step-number { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--accent-tint-border); border-radius: 50%; background: var(--accent-tint); color: var(--accent-active); font-size: var(--font-size-xs); font-weight: var(--fw-semibold); }
.step-state { padding: 4px 7px; border-radius: var(--radius-sm); background: var(--status-info-bg); color: var(--status-info-text); font-size: 10px; font-weight: var(--fw-medium); }
.step-state.optional { background: var(--bg-subtle); color: var(--text-muted); }
.form-section-body { padding: var(--space-4) var(--space-5) var(--space-5); }
.form-grid.three { grid-template-columns: 1.1fr 1fr 1fr; }
.tag-field { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--border-default); }
.optional-label { margin-left: 5px; color: var(--text-muted); font-size: 10px; font-weight: var(--fw-regular); }
.tag-suggestions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: var(--space-2); }
.tag-suggestions > span { color: var(--text-muted); font-size: 10px; }
.tag-suggestion { min-height: 25px; padding: 3px 7px; border-radius: 12px; background: var(--bg-subtle); color: var(--text-secondary); font-size: 10px; }
.meeting-tag-preview { display: flex; gap: 5px; flex-wrap: wrap; min-height: 0; margin-top: var(--space-2); }
.meeting-tag-preview:empty { display: none; }
.upload-dropzone { display: flex; align-items: center; justify-content: center; gap: var(--space-4); min-height: 150px; margin: 0; padding: var(--space-5); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--bg-subtle); cursor: pointer; text-align: left; transition: border-color var(--motion-fast), background var(--motion-fast), transform var(--motion-fast); }
.upload-dropzone:hover, .upload-dropzone.is-dragging { border-color: var(--accent-default); background: var(--accent-tint); }
.upload-dropzone.is-dragging { transform: scale(.995); }
.upload-dropzone.has-file { border-color: color-mix(in srgb, var(--status-success-text) 45%, var(--border-default)); }
.upload-dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-symbol { display: grid; place-items: center; width: 50px; height: 50px; flex: none; border-radius: var(--radius-lg); background: var(--bg-surface); color: var(--accent-default); box-shadow: var(--shadow-panel-current); font-size: 25px; }
.upload-prompt { display: grid; flex: 1; }
.upload-prompt strong { color: var(--text-primary); font-size: var(--font-size-md); }
.upload-prompt small { margin-top: 3px; color: var(--text-muted); font-weight: var(--fw-regular); }
.upload-select { pointer-events: none; }
.file-requirements { display: flex; justify-content: center; gap: var(--space-4); margin-top: var(--space-3); color: var(--text-muted); font-size: 10px; }
.file-requirements span { display: inline-flex; align-items: center; gap: 5px; }
.file-requirements span::before { content: "✓"; color: var(--status-success-text); }
.selected-file { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-3); padding: var(--space-3); border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-surface); }
.selected-file[hidden] { display: none; }
.file-mark { padding: 5px 7px; border-radius: var(--radius-sm); background: var(--accent-tint); color: var(--accent-active); font-size: 9px; font-weight: var(--fw-semibold); }
.selected-file div { display: grid; flex: 1; min-width: 0; }
.selected-file strong { overflow: hidden; font-size: var(--font-size-xs); text-overflow: ellipsis; white-space: nowrap; }
.selected-file small { color: var(--text-muted); font-size: 10px; }
.roster-copy { display: grid; grid-template-columns: 170px 1fr; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); padding: var(--space-3); border-radius: var(--radius-md); background: var(--bg-subtle); }
.roster-copy label { margin: 0; }
.people-search-wrap { position: relative; }
.people-search-wrap > span { position: absolute; left: 13px; top: 9px; z-index: 1; color: var(--text-muted); font-size: var(--font-size-md); }
.people-search-wrap input { padding-left: 36px; }
.people-options { position: relative; z-index: var(--z-raised); }
.people-option-card { position: absolute; top: 4px; left: 0; right: 0; display: grid; padding: 5px; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-surface); box-shadow: var(--shadow-float); }
.people-option-card button.linklike { width: 100%; min-height: 36px; padding: var(--space-2); color: var(--text-primary); text-align: left; }
.people-option-card button.linklike:hover { background: var(--bg-hover); }
.roster-head { display: flex; align-items: center; justify-content: space-between; margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--border-default); }
.roster-head strong { font-size: var(--font-size-xs); }
.roster-head span { color: var(--text-muted); font-size: var(--font-size-xs); }
.rosterchips.roster-empty { min-height: 50px; align-items: center; padding: var(--space-3); border: 1px dashed var(--border-default); border-radius: var(--radius-md); }
.roster-placeholder { color: var(--text-muted); font-size: var(--font-size-xs); }
.rosterchips .pchip small { padding: 1px 4px; border-radius: 3px; background: var(--bg-surface); color: var(--text-muted); font-size: 9px; }
.create-actions { position: sticky; bottom: 0; z-index: 6; display: flex; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) 0; background: linear-gradient(to bottom, transparent, var(--bg-app) 22%); }
.create-aside { position: sticky; top: var(--space-4); display: grid; gap: var(--space-4); }
.create-summary-card, .next-steps-card { padding: var(--space-5); }
.create-summary-card h3, .next-steps-card h3 { margin: 5px 0 var(--space-4); }
.create-summary { display: grid; margin: 0; }
.create-summary div { display: grid; grid-template-columns: 90px minmax(0,1fr); gap: var(--space-2); padding: 9px 0; border-bottom: 1px solid var(--border-default); }
.create-summary div:last-child { border-bottom: 0; }
.create-summary dt { color: var(--text-muted); font-size: var(--font-size-xs); }
.create-summary dd { overflow: hidden; margin: 0; font-size: var(--font-size-xs); font-weight: var(--fw-medium); text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.next-steps-card { border-color: var(--accent-tint-border); background: var(--accent-tint); }
.next-steps-card ol { display: grid; gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.next-steps-card li { display: grid; grid-template-columns: 24px 1fr; gap: var(--space-2); color: var(--text-secondary); font-size: var(--font-size-xs); }
.next-steps-card li > span { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--accent-tint-border); border-radius: 50%; color: var(--accent-active); font-size: 10px; font-weight: var(--fw-semibold); }
.human-control-note { display: grid; margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--accent-tint-border); }
.human-control-note strong { font-size: var(--font-size-xs); }
.human-control-note small { margin-top: 3px; color: var(--text-muted); font-size: 10px; }

/* Login */
main:not(.with-nav) { width: 100%; padding: 0; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 43%) 1fr; background: var(--bg-surface); }
.login-story { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(38px, 6vw, 82px); background: var(--color-slate-900); color: var(--color-slate-100); }
.login-story::after { content: ""; position: absolute; right: -110px; bottom: -140px; width: 380px; height: 380px; border: 1px solid rgba(139,176,209,.2); border-radius: 50%; box-shadow: 0 0 0 52px rgba(111,156,196,.045), 0 0 0 104px rgba(111,156,196,.025); }
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; justify-content: flex-start; }
.login-logo-plate { display: inline-flex; align-items: center; padding: 26px 40px; border-radius: 22px; background: var(--brand-plate); box-shadow: 0 22px 55px rgba(2,6,23,.45); }
.login-logo-plate img { display: block; width: auto; height: 72px; }
.login-statement { position: relative; z-index: 1; max-width: 500px; }
.login-statement .page-kicker { color: var(--color-accent-d-hover); }
.login-statement h1 { margin: var(--space-3) 0; color: var(--color-slate-50); font-size: clamp(32px, 4vw, 50px); line-height: 1.08; }
.login-statement p { color: var(--color-slate-300); font-size: var(--font-size-md); }
.login-appliance { position: relative; z-index: 1; display: flex; align-items: center; gap: var(--space-2); color: var(--color-slate-300); font-size: var(--font-size-xs); }
.login-appliance::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--color-success-600); box-shadow: 0 0 0 4px rgba(47,125,82,.18); }
.login-panel { display: grid; place-items: center; padding: var(--space-6); background: var(--bg-app); }
.login-card { width: min(420px, 100%); padding: var(--space-7); box-shadow: var(--shadow-panel-current); }
.login-card h2 { margin: 5px 0 var(--space-2); font-size: 28px; letter-spacing: -.03em; }
.login-card > p { margin: 0 0 var(--space-5); color: var(--text-muted); }
.login-submit { width: 100%; min-height: 44px; margin-top: var(--space-5); }

/* People, corrections and utility views */
.privacy-note { margin-bottom: var(--space-4); }
.split-panel { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-4); align-items: start; }
.sticky-card { position: sticky; top: var(--space-5); }
.corr-intro { max-width: 720px; margin: 0; }
.corr-counts { display: flex; gap: var(--space-2); margin: var(--space-4) 0; }
.corr-list { display: grid; gap: var(--space-3); }
.corr-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); padding: var(--space-4) var(--space-5); border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface); transition: transform var(--motion-fast), box-shadow var(--motion-fast), border-color var(--motion-fast); }
.corr-row:hover { border-color: var(--accent-tint-border); box-shadow: var(--shadow-elevated); transform: translateY(-1px); }
.corr-row.corr-accepted { border-color: color-mix(in srgb, var(--status-success-text) 45%, var(--border-default)); background: var(--status-success-bg); }
.corr-row.corr-rejected { opacity: .58; }
.corr-head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); font-size: var(--font-size-xs); }
.corr-kind { color: var(--text-muted); letter-spacing: .07em; text-transform: uppercase; }
.corr-reason { font-style: italic; }
.corr-diff { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-size: var(--font-size-base); }
.corr-from { color: var(--text-secondary); text-decoration: line-through; text-decoration-color: var(--status-danger-text); }
.corr-arrow { color: var(--text-muted); }
.corr-to { color: var(--status-success-text); font-weight: var(--fw-semibold); }
.corr-del { color: var(--status-danger-text); font-style: italic; }
.corr-actions { display: flex; align-items: center; gap: var(--space-2); flex: none; }
.corr-status { font-size: var(--font-size-sm); font-weight: var(--fw-medium); }
.corr-status-accepted { color: var(--status-success-text); }
.corr-status-rejected { color: var(--text-muted); }
.rosterchips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-3) 0; }
.rosterchips .pchip { display: inline-flex; align-items: center; gap: var(--space-1); padding: 5px 8px; border: 1px solid var(--accent-tint-border); border-radius: var(--radius-sm); background: var(--accent-tint); color: var(--accent-active); font-size: var(--font-size-sm); }
.pchip button { min-height: 0; padding: 0 2px; border: 0; background: none; color: inherit; box-shadow: none; }

/* Admin */
.admin-page { width: min(1180px, 100%); margin: 0 auto; }
.admin-header { margin-bottom: var(--space-4); }
.admin-header h1 { margin: 6px 0 4px; font-size: clamp(26px, 3vw, 36px); letter-spacing: -.035em; }
.admin-tabs { display: flex; gap: var(--space-1); margin-bottom: var(--space-4); padding: 5px; overflow-x: auto; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-surface); }
.admin-tabs a { position: relative; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text-muted); font-size: var(--font-size-sm); font-weight: var(--fw-medium); white-space: nowrap; }
.admin-tabs a:hover { color: var(--text-primary); background: var(--bg-hover); }
.admin-tabs a.active { color: var(--accent-active); background: var(--accent-tint); }
.admin-section { margin-top: var(--space-4); }
.admin-metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); margin-bottom: var(--space-4); }
.admin-metric-grid article { display: grid; padding: var(--space-4); border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface); }
.admin-metric-grid article.needs-attention { border-color: var(--accent-tint-border); background: var(--accent-tint); }
.admin-metric-grid span { color: var(--text-secondary); font-size: var(--font-size-xs); font-weight: var(--fw-medium); }
.admin-metric-grid strong { margin: 3px 0; font-size: 25px; line-height: 1; font-variant-numeric: tabular-nums; }
.admin-metric-grid small { color: var(--text-muted); font-size: 10px; }
.admin-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .7fr); gap: var(--space-4); align-items: stretch; }
.admin-dashboard-grid > .surface-panel { display: flex; flex-direction: column; }
.control-card-grid { flex: 1; display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 1fr; gap: var(--space-3); padding: var(--space-4); }
.admin-dashboard-grid .audit-preview { flex: 1; align-content: start; }
.control-card-grid a { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: var(--space-3); min-height: 84px; padding: var(--space-3); border: 1px solid var(--border-default); border-radius: var(--radius-md); color: inherit; transition: border-color var(--motion-fast), transform var(--motion-fast), box-shadow var(--motion-fast); }
.control-card-grid a:hover { border-color: var(--accent-tint-border); box-shadow: var(--shadow-elevated); transform: translateY(-1px); }
.control-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-md); background: var(--accent-tint); color: var(--accent-active); font-size: var(--font-size-xs); font-weight: var(--fw-semibold); }
.control-card-grid a div { display: grid; }
.control-card-grid strong { font-size: var(--font-size-xs); }
.control-card-grid small { margin-top: 2px; color: var(--text-muted); font-size: 10px; }
.control-card-grid b { color: var(--text-muted); font-size: var(--font-size-sm); font-variant-numeric: tabular-nums; }
.audit-preview { display: grid; }
.audit-preview > div { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2); padding: 11px var(--space-4); border-bottom: 1px solid var(--border-default); }
.audit-preview > div:last-child { border-bottom: 0; }
.audit-dot { width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--accent-default); box-shadow: 0 0 0 4px var(--accent-tint); }
.audit-preview p { display: grid; margin: 0; font-size: var(--font-size-xs); }
.audit-preview p strong { font-weight: var(--fw-semibold); }
.audit-preview p small { margin-top: 2px; color: var(--text-muted); font-size: 10px; }
.admin-assurance { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); margin-top: var(--space-3); padding: var(--space-4); border: 1px solid color-mix(in srgb, var(--status-success-text) 20%, var(--border-default)); border-radius: var(--radius-lg); background: var(--status-success-bg); }
.admin-assurance > div { display: flex; align-items: flex-start; gap: var(--space-3); }
.admin-assurance p { display: grid; margin: 0; }
.admin-assurance strong { color: var(--status-success-text); font-size: var(--font-size-xs); }
.admin-assurance small { margin-top: 2px; color: var(--text-muted); font-size: 10px; }

/* Retention policy editor */
.retention-form { padding: var(--space-3) var(--space-5) var(--space-4); }
.retention-row { display: grid; grid-template-columns: 1fr 240px; align-items: center; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--border-default); }
.retention-row:last-of-type { border-bottom: 0; }
.retention-meta { display: grid; min-width: 0; }
.retention-meta small { margin-top: 2px; color: var(--text-muted); font-size: var(--font-size-xs); }
.retention-pick { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--space-2); margin: 0; }
.retention-pick > span { color: var(--text-muted); font-size: var(--font-size-xs); font-weight: var(--fw-medium); }
.retention-pick select { margin: 0; }
.retention-actions { display: flex; justify-content: flex-end; margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border-default); }
@media (max-width: 620px) { .retention-row { grid-template-columns: 1fr; gap: var(--space-2); } }

/* Minute templates — list actions + editor */
.template-field { margin-top: var(--space-2); }
.template-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: var(--space-2); }
.template-actions form { display: inline; margin: 0; }
.template-editor { display: grid; gap: var(--space-4); }
.template-editor .form-grid.two { grid-template-columns: 1fr 1fr; gap: 0 var(--space-4); }
.checkbox-row { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-4) 0 0; color: var(--text-secondary); font-weight: var(--fw-medium); }
.checkbox-row input { width: auto; }
.field-hint code { padding: 1px 5px; border-radius: var(--radius-sm); background: var(--bg-subtle); font-size: .92em; }
.template-sections { border: 1px solid var(--border-default); border-radius: var(--radius-md); overflow: hidden; }
.template-section-head, .template-section-row { display: grid; grid-template-columns: 56px 68px minmax(120px, 1.1fr) 2fr; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); }
.template-section-head { background: var(--bg-subtle); }
.template-section-head span { color: var(--text-muted); font-size: var(--font-size-xs); font-weight: var(--fw-semibold); letter-spacing: .05em; text-transform: uppercase; }
.template-section-row { border-top: 1px solid var(--border-default); }
.template-section-row .sec-order { text-align: center; padding: 6px; }
.template-section-row .sec-enabled { display: flex; justify-content: center; margin: 0; }
.template-section-row .sec-source { font-size: var(--font-size-sm); font-weight: var(--fw-medium); }
.template-section-row .sec-heading { margin: 0; }
.template-editor-actions { display: flex; justify-content: flex-end; gap: var(--space-3); }
@media (max-width: 620px) {
  .template-section-head { display: none; }
  .template-section-row { grid-template-columns: 56px 60px 1fr; gap: var(--space-2) var(--space-3); }
  .template-section-row .sec-heading { grid-column: 1 / -1; }
}

/* Shared speaker identity */
.spk-c1{--speaker-color:var(--color-cat-1)} .spk-c2{--speaker-color:var(--color-cat-2)}
.spk-c3{--speaker-color:var(--color-cat-3)} .spk-c4{--speaker-color:var(--color-cat-4)}
.spk-c5{--speaker-color:var(--color-cat-5)} .spk-c6{--speaker-color:var(--color-cat-6)}
.spk-c7{--speaker-color:var(--color-cat-7)} .spk-c8{--speaker-color:var(--color-cat-8)}
.spk-c9{--speaker-color:var(--color-cat-9)} .spk-c10{--speaker-color:var(--color-cat-10)}
.spk-c11{--speaker-color:var(--color-cat-11)} .spk-c12{--speaker-color:var(--color-cat-12)}
.speaker-identity { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; color: var(--text-primary); font-size: var(--font-size-sm); }
button.speaker-identity { min-height: 0; margin: -2px; padding: 2px; border: 0; background: transparent; color: inherit; box-shadow: none; font: inherit; text-align: left; }
button.speaker-identity:hover { transform: none; }
button.speaker-identity:hover .speaker-name { color: var(--speaker-color); }
.speaker-code { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 24px; flex: none; padding: 0 7px; border-radius: var(--radius-sm); background: var(--speaker-color); color: var(--text-on-accent); font-size: var(--font-size-xs); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.speaker-name { min-width: 0; overflow: hidden; font-weight: var(--fw-medium); text-overflow: ellipsis; white-space: nowrap; }
.speaker-identity.compact { gap: var(--space-1); font-size: var(--font-size-xs); }
.speaker-identity.compact .speaker-code { min-width: 28px; height: 20px; padding: 0 6px; }

/* Processing and error states */
.processing-page > .back-link { margin-bottom: var(--space-4); }
.processing-card { display: grid; place-items: center; min-height: 520px; padding: var(--space-7); text-align: center; }
.processing-orbit { position: relative; display: grid; place-items: center; width: 76px; height: 76px; margin-bottom: var(--space-5); border: 1px solid var(--accent-tint-border); border-radius: 50%; background: var(--accent-tint); color: var(--accent-active); }
.processing-orbit::after { content: ""; position: absolute; inset: -8px; border: 2px solid transparent; border-top-color: var(--accent-default); border-radius: 50%; animation: orbit 1.5s linear infinite; }
.processing-orbit.failed { border-color: color-mix(in srgb, var(--status-danger-text) 30%, transparent); background: var(--status-danger-bg); color: var(--status-danger-text); }
.processing-orbit.failed::after { display: none; }
.processing-card h2 { margin: 0 0 var(--space-2); }
.processing-card p { max-width: 440px; margin: 0; color: var(--text-muted); }
.processing-progress { display: grid; width: min(520px, 100%); margin-top: var(--space-6); text-align: left; }
.processing-progress > div { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: var(--space-3); padding: 10px 0; }
.processing-progress > div:not(:last-child)::after { content: ""; position: absolute; left: 16px; top: 44px; bottom: -4px; width: 1px; background: var(--border-default); }
.processing-progress > div > span { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--border-strong); border-radius: 50%; color: var(--text-muted); font-size: var(--font-size-xs); }
.processing-progress .done > span { border-color: color-mix(in srgb, var(--status-success-text) 35%, transparent); background: var(--status-success-bg); color: var(--status-success-text); }
.processing-progress .active > span { border-color: var(--accent-tint-border); background: var(--accent-tint); }
.processing-progress .active > span::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-default); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent-default) 12%, transparent); animation: pulse 1.5s ease-in-out infinite; }
.processing-progress > div div { display: grid; }
.processing-progress strong { font-size: var(--font-size-sm); }
.processing-progress small { margin-top: 2px; color: var(--text-muted); font-size: var(--font-size-xs); }
.processing-actions { display: flex; gap: var(--space-2); margin-top: var(--space-6); }
.errpage { max-width: 520px; margin: 10vh auto; padding: var(--space-7); border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface); box-shadow: var(--shadow-panel-current); text-align: center; }
.errpage-code { color: var(--border-strong); font-size: 64px; font-weight: var(--fw-semibold); line-height: 1; letter-spacing: -.05em; }
.errpage h1 { margin: var(--space-3) 0 var(--space-2); }
.errpage p { margin-bottom: var(--space-5); }

@keyframes page-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .42; transform: scale(.82); } }

@media (max-width: 980px) {
  :root { --sidebar-w: 232px; }
  .brand-tagline { white-space: normal; }  /* narrower rail: let it wrap instead of overflowing */
  main { padding: 32px 24px 56px; }
  .upload-layout, .split-panel { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .create-layout { grid-template-columns: 1fr; }
  .process-panel { min-height: auto; }
  .create-aside { position: static; grid-template-columns: 1fr 1fr; }
  .create-summary-card, .next-steps-card { min-height: 100%; }
  .governance-strip { grid-template-columns: 1fr repeat(2, 1fr); }
  .governance-strip .governance-link { grid-column: 1 / -1; padding: var(--space-3) 0 0; border-top: 1px solid var(--border-default); border-left: 0; }
  .admin-dashboard-grid { grid-template-columns: 1fr; }
  .sticky-card { position: static; }
}
@media (max-width: 760px) {
  body { display: block; }
  .sidebar { position: sticky; width: 100%; height: 60px; padding: 10px var(--space-3); flex-direction: row; align-items: center; gap: var(--space-1); overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--sidebar-border); }
  .brand { margin: 0 var(--space-2) 0 0; }
  .sidebar-logo { width: auto; max-width: none; height: 26px; }
  .brand-tagline, .demo-badge, .sidebar-theme, .account-card, .sidebar .spacer, .nav-section-label { display: none; }
  .sidebar > a { min-height: 40px; padding: var(--space-2); white-space: nowrap; }
  .sidebar > a.active::after { left: 9px; right: 9px; top: auto; bottom: -10px; width: auto; height: 2px; }
  main { width: 100%; padding: 26px var(--space-4) 48px; }
  .page-header { align-items: stretch; flex-direction: column; }
  .page-actions, .page-actions .btn { width: 100%; }
  .dashboard-hero, .create-header, .section-header { align-items: stretch; flex-direction: column; }
  .dashboard-hero .hero-action { width: 100%; }
  .success-banner { grid-template-columns: auto 1fr; }
  .success-banner a { grid-column: 2; }
  .metric-card { min-height: 102px; padding: var(--space-3); }
  .dashboard-grid { gap: var(--space-3); }
  .action-row { grid-template-columns: auto minmax(0,1fr) auto; padding: var(--space-3); }
  .action-row .chip { grid-column: 2; justify-self: start; }
  .action-arrow { grid-column: 3; grid-row: 1 / 3; }
  .governance-strip { grid-template-columns: 1fr 1fr; }
  .governance-strip > div { grid-column: 1 / -1; }
  .governance-strip a { padding: var(--space-2) 0; border-left: 0; }
  .discovery-form { padding: var(--space-3); }
  .discovery-search-row { grid-template-columns: minmax(0,1fr) auto; }
  .discovery-search-row > button.primary { grid-column: 2; grid-row: 1; }
  .filter-details { grid-column: 1 / -1; }
  .filter-details > summary { width: 100%; }
  .filter-popover { position: static; width: 100%; margin-top: var(--space-2); box-shadow: none; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .discovery-result-bar { align-items: flex-start; flex-direction: column; padding: var(--space-2) var(--space-3) var(--space-3); }
  .active-filters { justify-content: flex-start; }
  .create-security { min-width: 0; }
  .form-section-head { grid-template-columns: auto 1fr; padding: var(--space-3); }
  .form-section-head .step-state { grid-column: 2; justify-self: start; }
  .form-section-body { padding: var(--space-3); }
  .form-grid.three { grid-template-columns: 1fr; }
  .upload-dropzone { align-items: center; flex-direction: column; min-height: 210px; text-align: center; }
  .upload-select { width: 100%; }
  .file-requirements { align-items: center; flex-direction: column; gap: 4px; }
  .roster-copy { grid-template-columns: 1fr; }
  .create-aside { grid-template-columns: 1fr; }
  .create-actions { display: grid; grid-template-columns: 1fr 1.4fr; }
  .admin-metric-grid { grid-template-columns: 1fr 1fr; }
  .admin-assurance { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; }
  .login-story { min-height: 280px; padding: 34px var(--space-5); }
  .login-statement { margin-top: var(--space-7); }
  .login-statement h1 { font-size: 34px; }
  .login-appliance { display: none; }
  .login-panel { padding: var(--space-4); }
  .login-card { padding: var(--space-5); }
  .meetings-table th:nth-child(3), .meetings-table td:nth-child(3),
  .meetings-table th:nth-child(5), .meetings-table td:nth-child(5),
  .meetings-table th:nth-child(6), .meetings-table td:nth-child(6) { display: none; }
  .meetings-table th, .meetings-table td { padding-left: var(--space-3); padding-right: var(--space-3); }
  .meetings-table th:nth-child(2), .meetings-table td:nth-child(2) { width: 108px; }
  .meetings-table th:nth-child(4), .meetings-table td:nth-child(4) { width: 96px; }
  .corr-row { align-items: flex-start; flex-direction: column; }
  .corr-actions { width: 100%; }
}
@media (max-width: 480px) {
  .metric-grid { grid-template-columns: 1fr 1fr; gap: var(--space-2); }
  .metric-card { align-items: flex-start; flex-direction: column; gap: var(--space-2); }
  .metric-icon { width: 32px; height: 32px; }
  .metric-card strong { font-size: 23px; }
  .panel-head { padding: var(--space-3); }
  .process-list { padding: var(--space-3); }
  .control-card-grid { grid-template-columns: 1fr; padding: var(--space-3); }
  .governance-strip { padding: var(--space-3); }
  .discovery-search-row { grid-template-columns: 1fr; }
  .discovery-search-row > button.primary { grid-column: 1; grid-row: auto; width: 100%; }
  .filter-grid { grid-template-columns: 1fr; }
  .filter-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .meetings-table th:nth-child(2), .meetings-table td:nth-child(2) { display: none; }
  .meetings-table th:nth-child(4), .meetings-table td:nth-child(4) { width: 104px; }
}
