/* ISR Dashboard — Backend (logged-in pages + login)
 * Editorial / Academic — Variant A (calmer)
 * Source Serif 4 headlines + Inter body + JetBrains Mono metadata
 * Off-white #FAFAF7, ink #15161A, single quiet medical-blue accent
 *
 * Class names are kept identical to the previous stylesheet so all PHP
 * pages (admin, isr, ua, kb, publications, …) render without changes.
 */

:root {
  color-scheme: light;

  /* Editorial palette */
  --bg: #FAFAF7;
  --paper: #FFFFFF;
  --paper-2: #F5F4EE;
  --ink: #15161A;
  --ink-2: #3A3B40;
  --muted: #7A7B80;
  --rule: #E4E2DA;
  --rule-2: #D8D5CB;
  --accent: oklch(0.42 0.09 250);
  --accent-soft: oklch(0.94 0.02 250);

  /* Status colors — kept but quieter */
  --ok: #166534;
  --okbg: #DCFCE7;
  --err: #991B1B;
  --errbg: #FEE2E2;
  --inf: #1E3A8A;
  --infbg: #DBEAFE;

  /* Compat aliases (some pages reference these directly) */
  --text: var(--ink);
  --primary: var(--ink);
  --primary-h: #000;
  --card: var(--paper);
  --card-2: var(--paper);
  --line: var(--rule);
  --shadow: none;
  --shadow-soft: none;

  --serif: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --pad-x: clamp(20px, 5vw, 64px);

  font-family: var(--sans);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0 0 .4rem; }
h2 { font-size: clamp(1.08rem, 1.05vw + .72rem, 1.5rem); font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; }
h3 { font-size: 0.94rem; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── Shell ─── */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Masthead ─── */
.masthead {
  padding: 28px var(--pad-x) 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}

.masthead .brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  color: inherit;
  text-decoration: none;
}

.masthead .brand a { color: inherit; text-decoration: none; }

.masthead .brand-mark {
  height: 44px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.masthead .brand-text {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.1;
}

.masthead .brand-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}

/* Compact icon-bar primary navigation — full-width row under the masthead.
   Markup also carries .site-nav and .nav for backward compat with non-ui.php callers. */
.primary-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  padding: 0 var(--pad-x);
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.primary-nav::-webkit-scrollbar { display: none; }

.primary-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  margin: 0;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-2);
  text-decoration: none;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  border-radius: 0;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.primary-nav a:hover {
  color: var(--ink);
  background: rgba(20, 22, 26, 0.025);
}

.primary-nav a.is-active,
.primary-nav a.active {
  color: var(--ink);
  font-weight: 500;
  border-bottom-color: var(--ink);
  padding-bottom: 12px;
}

.primary-nav .nav-icon {
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
}

.primary-nav .nav-label { display: inline; }

/* Legacy fallback — kept for any caller that emits .site-nav/.nav without
   .primary-nav (none today, but defensive). Plain inline text links. */
.site-nav:not(.primary-nav),
.nav:not(.primary-nav) {
  display: flex;
  gap: clamp(14px, 1.6vw, 22px);
  font-size: 14px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--ink-2);
  margin: 0;
}

.site-nav:not(.primary-nav) a,
.nav:not(.primary-nav) a {
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-nav:not(.primary-nav) a:hover,
.nav:not(.primary-nav) a:hover { color: var(--ink); }

.site-nav:not(.primary-nav) a.is-active,
.nav:not(.primary-nav) a.is-active {
  color: var(--ink);
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 2px;
}

.masthead-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.role-chip {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  border: 1px solid var(--rule-2);
  padding: 4px 8px;
  text-transform: uppercase;
}

.nav-login {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink) !important;
  border: 1px solid var(--ink) !important;
  padding: 6px 14px !important;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  border-bottom-width: 1px !important;
}

.nav-login:hover {
  background: var(--ink);
  color: var(--bg) !important;
}

/* ─── Page header band ─── */
.topbar {
  padding: clamp(28px, 4vw, 44px) var(--pad-x) clamp(16px, 2vw, 24px);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--rule);
  margin: 0;
}

.page-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.page-title h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.05;
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-title .muted { margin: 0; color: var(--muted); }

.icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--paper);
  border: 1px solid var(--rule-2);
  color: var(--ink-2);
  font-size: 16px;
  flex-shrink: 0;
}

/* ─── Main content area ─── */
.main {
  padding: clamp(20px, 3vw, 32px) var(--pad-x) clamp(48px, 6vw, 80px);
  max-width: 1720px;
  width: 100%;
  margin: 0 auto;
}

/* ─── Card ─── */
.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: none;
}

.card h3 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.005em;
  display: block;
  margin: 0 0 14px 0;
}

.card h3::before {
  content: none;
}

/* ─── KPI ─── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  margin-bottom: 24px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}

.kpi-card {
  background: transparent;
  border: none;
  border-right: 1px solid var(--rule);
  border-radius: 0;
  padding: 24px 24px 24px 0;
}

.kpi-card:not(:first-child) { padding-left: 24px; }
.kpi-card:last-child { border-right: none; padding-right: 0; }

.kpi-label {
  font-size: 13px;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  margin-bottom: 12px;
}

.kpi-value {
  font-family: var(--serif);
  font-size: clamp(36px, 4vw, 48px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-top: 0;
  color: var(--ink);
}

.kpi-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

/* ─── Progress bar ─── */
.progress {
  height: 4px;
  background: var(--rule);
  border-radius: 0;
  overflow: hidden;
  margin-top: 10px;
}

.progress > span {
  display: block;
  height: 100%;
  background: var(--ink);
}

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 0;
  padding: 3px 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--rule-2);
  background: var(--paper);
  color: var(--ink-2);
}

.badge-open {
  background: var(--paper);
  color: var(--muted);
  border-color: var(--rule-2);
}

.badge-booked {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.badge-neutral {
  background: var(--paper);
  color: var(--muted);
  border-color: var(--rule-2);
}

.badge-warn {
  background: var(--paper);
  color: var(--accent);
  border-color: var(--accent);
}

/* ─── Status row buttons / icon links ─── */
.status-actions {
  display: inline-flex;
  gap: 6px;
  vertical-align: middle;
  margin-left: 6px;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 0;
  border: 1px solid var(--rule-2);
  background: var(--paper);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 13px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.icon-link:hover {
  background: var(--bg);
  border-color: var(--ink);
  color: var(--ink);
}

/* ─── Attendees ─── */
.attendee-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.attendee-chip {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  padding: 3px 8px;
  background: var(--paper);
  border: 1px solid var(--rule-2);
  color: var(--ink-2);
}

.remove-x {
  border: none;
  background: transparent;
  color: var(--err);
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
  padding: 0 0 0 6px;
}

.remove-x:hover { color: #7f1d1d; }

/* ─── Slots / cards (used on dashboards & workspace tiles) ─── */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.slot-card {
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--paper);
  padding: 20px;
  box-shadow: none;
  transition: border-color 0.15s ease;
}

.slot-card:hover { border-color: var(--ink); }

.slot-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.slot-time {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.slot-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.35;
  margin: 4px 0 12px;
  letter-spacing: -0.005em;
}

.slot-meta {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.slot-meta .muted { margin: 0; }

/* ─── KB chips & pills ─── */
.method-chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 6px 0;
}

.method-chip {
  border: 1px solid var(--rule-2);
  border-radius: 0;
  padding: 2px 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  background: var(--paper);
}

.score-pill-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.score-pill {
  border-radius: 0;
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  background: var(--paper);
  color: var(--ink-2);
  border: 1px solid var(--rule-2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.score-pill-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.score-pill-ghost {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.confidence-tag {
  border-radius: 0;
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 11px;
  background: var(--paper);
  color: var(--ink-2);
  border: 1px solid var(--rule-2);
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.confidence-tag.confidence-high {
  background: var(--okbg);
  color: var(--ok);
  border-color: transparent;
}

.confidence-tag.confidence-low {
  background: var(--errbg);
  color: var(--err);
  border-color: transparent;
}

.detail-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.kb-score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.kb-score-grid .progress { margin-top: 4px; }

.kb-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

/* ─── Feedback chips ─── */
.feedback-reasons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.feedback-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--rule-2);
  border-radius: 0;
  padding: 8px 10px;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.feedback-chip:hover {
  background: var(--bg);
  border-color: var(--ink);
}

.feedback-chip input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--ink);
  flex: 0 0 auto;
}

.feedback-chip:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── Layout helpers ─── */
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stack.compact { max-width: 290px; }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--ink-2);
  font-weight: 500;
  font-size: 14px;
}

/* ─── Forms ─── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px 16px;
  align-items: start;
}

.form-grid .form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-start;
  margin-top: 8px;
}

#publication-form {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#publication-form.form-grid { grid-template-columns: 1fr; }

#publication-form label,
#minute-form label {
  width: 100%;
  max-width: none;
}

#publication-form .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

#publication-form .row .btn {
  min-height: 44px;
  white-space: nowrap;
}

#publication-form textarea,
#minute-form textarea { min-height: 120px; }

#minute-form.form-grid { grid-template-columns: 1fr; }

input, select, textarea {
  width: 100%;
  max-width: 420px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--rule-2);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-family: var(--sans);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  min-height: 88px;
  resize: vertical;
  font-family: var(--sans);
}

#publication-form input,
#publication-form select,
#publication-form textarea,
#minute-form input,
#minute-form select,
#minute-form textarea {
  width: 100%;
  max-width: none;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input:invalid { border-color: #fca5a5; }
input:invalid:focus { box-shadow: 0 0 0 3px var(--errbg); }

/* ─── Buttons ─── */
.btn {
  border: 1px solid var(--ink);
  border-radius: 0;
  min-height: 44px;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.btn:active { transform: translateY(1px); }

.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--rule-2);
  box-shadow: none;
}

.btn-secondary:hover {
  background: var(--bg);
  border-color: var(--ink);
  color: var(--ink);
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.btn-sm {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

/* ─── Tables ─── */
.table-wrap,
.table-wrapper {
  overflow: auto;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--paper);
}

.responsive-table { width: 100%; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

th {
  white-space: nowrap;
  background: var(--paper-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--ink);
}

tr:hover td { background: var(--bg); }

details summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 500;
  font-family: var(--serif);
}

/* ─── Alerts ─── */
.alert {
  border-radius: 0;
  padding: 12px 14px;
  margin: 0 0 16px;
  border: 1px solid var(--rule-2);
  font-weight: 400;
  background: var(--paper);
}

.alert.success { color: var(--ok); background: var(--okbg); border-color: transparent; }
.alert.error   { color: var(--err); background: var(--errbg); border-color: transparent; }
.alert.info    { color: var(--accent); background: var(--accent-soft); border-color: transparent; }

/* ─── Empty state ─── */
.empty {
  padding: 28px;
  border: 1px dashed var(--rule-2);
  border-radius: 0;
  color: var(--muted);
  text-align: center;
  background: transparent;
}

.empty .btn { margin-top: 12px; }

.muted { color: var(--muted); }
.small { font-size: 0.86rem; }

/* ─── Auth (login screen) ─── */
.auth-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: var(--bg);
  padding: 24px;
}

.auth-card {
  width: min(94vw, 440px);
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 40px 36px;
  border-radius: 0;
  box-shadow: none;
}

.auth-card .brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}

.auth-card .brand-mark {
  height: 48px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.auth-card .brand-text {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.15;
}

.auth-card h1 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0;
}

.auth-card .muted { margin-top: 2px; font-size: 12px; }

.auth-card .stack { gap: 16px; }

.auth-card label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}

.auth-card input {
  max-width: none;
}

.auth-card .btn { width: 100%; }
.auth-card .btn-secondary { width: 100%; }

.auth-card .auth-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

.auth-card .auth-footer .muted {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ─── Workspace tiles (admin_home / isr / ua) ─── */
.workspace-card {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.workspace-grid {
  margin-top: 16px;
  gap: 18px;
}

.workspace-split {
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: stretch;
}

.workspace-left,
.workspace-right { width: 100%; min-width: 0; margin: 0; }

.workspace-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.workspace-tile {
  position: relative;
  border-radius: 0;
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 16px;
  box-shadow: none;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.workspace-tile:hover {
  transform: translateY(-2px);
  border-color: var(--ink);
}

.workspace-tile .slot-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.workspace-tile .slot-title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.005em;
  margin: 6px 0 8px;
}

.workspace-tile .slot-meta .muted {
  font-size: 12px;
  line-height: 1.5;
}

.workspace-cta {
  margin-top: 10px;
  min-height: 32px;
  border-radius: 0;
  padding: 6px 12px;
  font-size: 12px;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  box-shadow: none;
}

.workspace-cta:hover {
  background: var(--accent);
  border-color: var(--accent);
  filter: none;
}

.workspace-subhead {
  margin: 14px 0 4px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.quick-overview {
  position: relative;
  border: 1px solid var(--rule);
  background: var(--paper);
  box-shadow: none;
  padding: 32px 32px 28px;
}

.quick-overview > h3,
.quick-overview > p {
  padding-right: 120px;   /* keep clear of the QUICK SCAN badge */
}

/* Quick Overview is now full-width: responsibilities table left, stack right */
.qo-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 24px;
  margin-top: 14px;
  align-items: start;
}

.qo-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

@media (max-width: 980px) {
  .qo-grid { grid-template-columns: 1fr; }
}

/* Settings page — notification toggle cards. */
.notify-card {
  display: flex;
  flex-direction: column;
  margin-top: 18px;
  border: 1px solid var(--rule);
  background: var(--paper);
}

.notify-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 14px;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease;
}

.notify-row:last-child { border-bottom: none; }
.notify-row:hover { background: rgba(20, 22, 26, 0.025); }
.notify-row:has(input:checked) { background: rgba(20, 22, 26, 0.012); }

.notify-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  font-size: 22px;
  background: var(--bg);
  border: 1px solid var(--rule);
  flex-shrink: 0;
}

.notify-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.notify-text strong {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink);
  line-height: 1.25;
}

.notify-text .muted {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.notify-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
}

@media (max-width: 700px) {
  .notify-row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 14px 16px;
  }
  .notify-icon { width: 36px; height: 36px; font-size: 18px; }
}

.qo-block .workspace-subhead { margin-top: 0; }

/* Quick-overview typography aligned with the tiles */
.quick-overview .workspace-subhead {
  font-family: var(--serif);
  font-size: 16px;       /* same as .workspace-tile .slot-title */
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.3;
  color: var(--ink);
}

.quick-overview p,
.quick-overview .muted,
.quick-overview .empty,
.quick-overview .slot-card p {
  font-size: 12px;       /* same as .workspace-tile .slot-meta .muted */
  line-height: 1.5;
}

.quick-overview table { font-size: 12px; }
.quick-overview th { font-size: 10px; padding: 9px 10px; }
.quick-overview td { padding: 8px 10px; }

.quick-overview .slot-card { padding: 14px; }

.quick-overview::before {
  content: 'QUICK SCAN';
  position: absolute;
  top: 24px;
  right: 28px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--rule-2);
  border-radius: 0;
  padding: 3px 8px;
}

.quick-overview table { table-layout: fixed; width: 100%; }
.quick-overview th, .quick-overview td { white-space: normal; word-break: break-word; }
.quick-overview th:nth-child(1), .quick-overview td:nth-child(1) { width: 18%; }
.quick-overview th:nth-child(2), .quick-overview td:nth-child(2) { width: 34%; }
.quick-overview th:nth-child(3), .quick-overview td:nth-child(3) { width: 12%; }
.quick-overview th:nth-child(4), .quick-overview td:nth-child(4) { width: 36%; }

/* ─── Misc bits used by isr.php / kb pages ─── */
.section { margin: 24px 0; }
.subtitle { color: var(--muted); font-size: 14px; }
.note { font-size: 13px; color: var(--muted); }
.req { color: var(--err); font-weight: 500; }
.inline-form { display: inline; }

.status-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--rule-2);
  background: var(--paper);
  color: var(--ink-2);
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .masthead {
    padding: 20px var(--pad-x) 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .site-nav, .nav { font-size: 13px; gap: 14px; }
  .masthead-actions { width: 100%; justify-content: space-between; }

  .primary-nav a { padding: 10px 12px; font-size: 12px; gap: 6px; }
  .primary-nav .nav-icon { font-size: 14px; }
  .primary-nav a.is-active { padding-bottom: 10px; }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .page-title h2 { font-size: 28px; }

  .main { padding-top: 20px; padding-bottom: 48px; }
  .card { padding: 18px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-card {
    padding: 18px 0;
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }
  .kpi-card:not(:first-child) { padding-left: 0; }
  .kpi-card:last-child { border-bottom: none; }

  th, td { padding: 9px 10px; font-size: 14px; }
  input, select { max-width: 100%; }
  .row .btn { width: 100%; }

  .responsive-table thead { display: none; }
  .responsive-table,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td { display: block; width: 100%; }
  .responsive-table tr {
    border-bottom: 1px solid var(--rule);
    padding: 12px 10px;
    background: var(--paper);
  }
  .responsive-table td {
    border-bottom: none;
    padding: 4px 0;
  }
  .responsive-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
    font-weight: 400;
  }

  .quick-overview::before {
    position: static;
    display: inline-block;
    margin-bottom: 8px;
  }
  .workspace-tile .slot-title { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Team meetings 2-col: data wide left, sticky forms right ─── */
.tm-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 28px;
  align-items: start;
}

.tm-left {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.tm-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.tm-form-block {
  background: var(--paper);
  border: 1px solid var(--rule);
}

.tm-form-block > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  user-select: none;
}

.tm-form-block > summary::-webkit-details-marker { display: none; }

.tm-form-block > summary::after {
  content: '+';
  font-family: var(--mono);
  font-size: 18px;
  color: var(--muted);
  line-height: 1;
}

.tm-form-block[open] > summary::after { content: '−'; }

.tm-form-block[open] > summary {
  border-bottom: 1px solid var(--rule);
}

.tm-form-block .tm-form-body {
  padding: 16px 18px 18px;
}

.tm-form-block .form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tm-form-block label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tm-form-block input,
.tm-form-block textarea {
  max-width: 100%;
  font-family: var(--sans);
  font-size: 14px;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
}

.tm-form-block .form-actions {
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--rule);
  margin-top: 4px;
}

@media (max-width: 1100px) {
  .tm-grid { grid-template-columns: 1fr; }
}

/* Year-grouped accordion inside the team meetings minutes archive. The same
   class names are used on the public landing publications list (root-styles)
   but each surface needs its own theming. */
.pub-groups { margin: 0; padding: 0; }
.pub-year-group { margin: 0; padding: 0; }
.pub-year-group + .pub-year-group { margin-top: clamp(14px, 2vw, 22px); }

.pub-year-summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
  padding: 12px 0 10px 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: baseline;
  gap: 10px;
  user-select: none;
}

.pub-year-summary::-webkit-details-marker { display: none; }

.pub-year-summary::before {
  content: '▸';
  display: inline-block;
  font-size: 13px;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.pub-year-group[open] > .pub-year-summary::before {
  transform: rotate(90deg);
}

.pub-year-title { color: var(--ink); }
