/* ────────────────────────────────────────────────────────────
   TOTALFLOW — Reference design (jbs_rnd_header_1 / footer / h1-1)
   Two-row header, flat design, indigo accents, sans-serif throughout
   ──────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Pacifico&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400&display=swap');

:root {
  /* Palette — neutral, slate, indigo accent (anti-AI-default) */
  --bg:          #ffffff;
  --bg-soft:     #f3f4f6;       /* header top band */
  --bg-indigo:   #eef2ff;       /* info sidebar */
  --bg-emerald:  #ecfdf5;       /* success status */
  --bg-warning:  #fef3c7;       /* research-control notice */
  --ink:         #0f172a;       /* near-black slate-900 */
  --ink-soft:    #475569;       /* slate-600 */
  --ink-mute:    #64748b;       /* slate-500 */
  --ink-faint:   #94a3b8;       /* slate-400 */
  --rule:        #e2e8f0;       /* slate-200 */
  --rule-strong: #cbd5e1;       /* slate-300 */
  --indigo:      #2563eb;       /* primary action */
  --indigo-soft: #eef2ff;       /* hover */
  --indigo-deep: #1d4ed8;       /* active */
  --indigo-text: #1e40af;       /* slate-blue text */
  --emerald:     #059669;       /* success accent */
  --emerald-deep:#047857;
  --amber:       #92400e;       /* warning text on warning bg */
  --amber-bg:    #fef3c7;

  /* Typography */
  --font-brand:  'Pacifico', cursive;
  --font-display:'Inter', system-ui, -apple-system, sans-serif;
  --font-body:   'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:   'JetBrains Mono', 'Courier New', monospace;

  /* Spacing (8pt) */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  20px;
  --s-6:  24px;
  --s-7:  32px;
  --s-8:  40px;
  --s-10: 64px;

  /* Radius — 8px, modern flat */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
}

/* ─── Base ──────────────────────────────────────────────── */
* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html, body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}

body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1 0 auto; }

/* ─── Top header band (gray, brand) ────────────────────── */
.app-header { background: var(--bg); padding: 16px 24px; border-bottom: 1px solid var(--rule); }
.app-header__inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; }
.app-header__logo { width: auto; height: 48px; flex-shrink: 0; }

/* ─── Tab navigation ───────────────────────────────────── */
.app-tabs { background: var(--bg); border-bottom: 1px solid var(--rule); padding: 0 24px; }
.app-tabs__inner { max-width: 1280px; margin: 0 auto; display: flex; gap: 0; align-items: center; overflow-x: auto; }
.tab-btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-mute);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 14px 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 120ms ease, border-color 120ms ease;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--indigo); border-bottom-color: var(--indigo); font-weight: 600; }
.tab-btn .runs { color: var(--ink-faint); font-weight: 400; margin-left: 4px; }
.tab-btn.active .runs { color: var(--indigo); opacity: 0.7; }
.tab-btn--settings { margin-left: auto; }

/* ─── Main tab content ─────────────────────────────────── */
.tab-content { max-width: 1024px; margin: 0 auto; padding: 32px 24px 64px; }

/* Page header (simple title + lede) */
.page-header { margin-bottom: 24px; }
.page-header h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.015em;
}
.page-header p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-mute);
  max-width: 70ch;
}

/* Action button row (Research Design / Practical Example) */
.action-row { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }

/* ─── Buttons ──────────────────────────────────────────── */

/* Outlined "secondary" (Research Design, etc.) */
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--indigo-text);
  background: var(--bg);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.btn-outline:hover { background: var(--indigo-soft); border-color: var(--indigo); }
.btn-outline:active { background: var(--indigo-soft); }
.btn-outline svg { flex-shrink: 0; color: var(--indigo); }

/* Solid "primary" (Run Experiment) */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  background: var(--indigo);
  border: 1px solid var(--indigo);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.btn-primary:hover { background: var(--indigo-deep); border-color: var(--indigo-deep); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* Tertiary / ghost (used in headers, info notes) */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.btn-ghost:hover { color: var(--indigo); border-color: var(--indigo); }

/* Icon button (e.g. settings gear, info) */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  color: var(--ink-mute);
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
}
.btn-icon:hover { color: var(--indigo); border-color: var(--indigo); }

/* ─── Cards ────────────────────────────────────────────── */
.card {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 24px;
}

.card--flat { box-shadow: none; }

/* Two-column main work area */
.work-area {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 768px) { .work-area { grid-template-columns: 1fr; } }

/* Info sidebar (indigo-50 background) */
.info-sidebar {
  background: var(--bg-indigo);
  border: 1px solid #e0e7ff;
  border-radius: var(--r-md);
  padding: 20px;
}
.info-sidebar h3 {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--indigo);
  margin-bottom: 8px;
}
.info-sidebar p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* ─── File input (matches native look) ─────────────────── */
.file-input {
  display: block;
  width: 100%;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-sm);
  padding: 8px;
  cursor: pointer;
}
.file-input::file-selector-button {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  padding: 4px 10px;
  margin-right: 10px;
  cursor: pointer;
}

.field-label {
  display: block;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
.field-select, .field-input-text {
  display: block;
  width: 100%;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-sm);
  padding: 8px 12px;
}
.field-select:focus, .field-input-text:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px var(--indigo-soft);
}

.helper-text {
  font-size: 12px;
  color: var(--ink-mute);
  text-align: center;
  margin-top: 8px;
}

/* ─── Results strip ─────────────────────────────────────── */
.results-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 768px) { .results-strip { grid-template-columns: 1fr; } }

/* Status card (emerald tint) */
.status-card {
  background: var(--bg-emerald);
  border: 1px solid #a7f3d0;
  border-radius: var(--r-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.status-card__icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--emerald);
  color: #ffffff;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.status-card__text { display: flex; flex-direction: column; gap: 2px; }
.status-card__title { font-size: 14px; font-weight: 700; color: var(--emerald-deep); }
.status-card__desc { font-size: 12px; color: var(--ink-mute); }

.status-card--ready { background: var(--bg-soft); border-color: var(--rule); }
.status-card--ready .status-card__icon { background: var(--ink-faint); }
.status-card--ready .status-card__title { color: var(--ink-soft); }

.status-card--running { background: #fff7ed; border-color: #fed7aa; }
.status-card--running .status-card__icon { background: #ea580c; }
.status-card--running .status-card__title { color: #c2410c; }

.status-card--error { background: #fef2f2; border-color: #fecaca; }
.status-card--error .status-card__icon { background: #dc2626; }
.status-card--error .status-card__title { color: #b91c1c; }

/* Actions card */
.actions-card { background: var(--bg); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 20px; }
.actions-card h4 { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.actions-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 600px) { .actions-row { grid-template-columns: repeat(2, 1fr); } }
.actions-row .btn-outline { width: 100%; justify-content: center; }

/* Info note at bottom */
.info-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  font-size: 12px;
  color: var(--ink-mute);
}
.info-note svg { flex-shrink: 0; color: var(--ink-faint); margin-top: 2px; }

/* ─── Modernised Footer ─────────────────────────────────── */
.app-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--rule);
  padding: 32px 24px 24px;
  margin-top: 64px;
  width: 100%;
}
.app-footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.app-footer__top {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
}
@media (max-width: 768px) {
  .app-footer__top {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.footer-logo {
  height: 40px;
  width: auto;
  flex-shrink: 0;
}
.footer-brand .name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-transform: uppercase;
}
.footer-vertical-divider {
  width: 1px;
  height: 52px;
  background-color: var(--rule-strong);
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .footer-vertical-divider {
    display: none;
  }
}
.footer-middle {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-grow: 1;
}
.footer-middle__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.footer-middle__subtitle {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}
.footer-middle__accent {
  font-size: 13px;
  font-weight: 700;
  color: var(--indigo);
}
.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  text-align: right;
}
@media (max-width: 768px) {
  .footer-right {
    align-items: flex-start;
    text-align: left;
  }
}
.footer-right__copy {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.footer-right__rights {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}
.app-footer__bottom {
  border-top: 1px solid var(--rule);
  padding-top: 12px;
  margin-top: 4px;
}
.footer-disclaimer {
  font-size: 11px;
  color: var(--ink-mute);
  line-height: 1.5;
  margin: 0;
}

/* ─── Modal ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(15, 23, 42, 0.4);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn 0.15s ease-out;
}
.modal-content {
  position: relative;
  background: var(--bg);
  border-radius: var(--r-md);
  max-width: 720px;
  width: 100%;
  max-height: 80vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.2);
  animation: slideIn 0.2s ease-out;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--rule);
}
.modal-body {
  padding: 20px 24px 24px;
  overflow-y: auto;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-soft);
}
.modal-body h4 {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--indigo);
  margin-top: 16px;
  margin-bottom: 4px;
}
.modal-body h4:first-child { margin-top: 0; }
.modal-body p { margin-bottom: 8px; }
.modal-body p:last-child { margin-bottom: 0; }
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1;
  color: var(--ink-mute);
  background: transparent; border: none; border-radius: var(--r-sm);
  cursor: pointer;
}
.modal-close:hover { background: var(--bg-soft); color: var(--ink); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
body.modal-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ─── Status indicator dot (used in compact badges) ──── */
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.status-dot.is-ready    { background: var(--ink-faint); }
.status-dot.is-running  { background: #ea580c; }
.status-dot.is-complete { background: var(--emerald); }
.status-dot.is-error    { background: #dc2626; }

/* ─── Research-control notice ─────────────────────────── */
.research-notice {
  background: var(--bg-warning);
  border: 1px solid #fcd34d;
  color: var(--amber);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.research-notice strong { color: var(--amber); }

/* ─── Policy Editor tags + receipt thumb (preserved) ─── */
.pe-tag-container { display: flex; flex-wrap: wrap; gap: 0.375rem; padding: 0.5rem; border: 1px solid var(--rule-strong); border-radius: var(--r-sm); background: var(--bg); min-height: 2rem; }
.pe-tag { display: inline-flex; align-items: center; gap: 0.25rem; background: var(--bg-soft); color: var(--ink-soft); padding: 0.125rem 0.5rem; border-radius: var(--r-sm); font-size: 0.75rem; line-height: 1.4; }
.pe-tag-remove { color: var(--ink-faint); font-weight: 700; line-height: 1; cursor: pointer; background: none; border: none; padding: 0; font-size: 1rem; }
.pe-tag-remove:hover { color: #dc2626; }
.pe-tag-input { flex: 1; min-width: 80px; border: 0; outline: none; font-size: 0.75rem; background: transparent; }

#receipt-bar { background: var(--bg-emerald); border-color: #6ee7b7; }
.config-drift-badge { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.7rem; padding: 0.125rem 0.4rem; border-radius: 9999px; background: var(--bg-warning); color: var(--amber); font-weight: 500; }
.config-drift-badge.ok { background: var(--bg-emerald); color: var(--emerald-deep); }
.cache-badge { display: inline-block; font-size: 0.65rem; padding: 0.0625rem 0.35rem; border-radius: 9999px; background: #e0f2fe; color: #0369a1; font-weight: 500; }
.cache-badge.miss { background: var(--bg-soft); color: var(--ink-mute); }
.meta-text { font-size: 0.7rem; color: var(--ink-faint); line-height: 1.3; }
.meta-text strong { color: var(--ink-soft); }
.shared-receipt-indicator { margin-top: 8px; }
.shared-receipt-thumb { width: 3.5rem; height: 3.5rem; object-fit: cover; border-radius: var(--r-sm); border: 1px solid #bfdbfe; transition: border-color 0.15s, transform 0.15s; }
.shared-receipt-thumb:hover { border-color: var(--indigo); transform: scale(1.08); }

/* Verdict badges */
.verdict-justified { background: #10b981 !important; color: #ffffff !important; border: none !important; border-radius: 4px; padding: 2px 8px; }
.verdict-suspicious { background: #ef4444 !important; color: #ffffff !important; border: none !important; border-radius: 4px; padding: 2px 8px; }
.verdict-unclear    { background: #f59e0b !important; color: #ffffff !important; border: none !important; border-radius: 4px; padding: 2px 8px; }
.verdict-error      { background: #6b7280 !important; color: #ffffff !important; border: none !important; border-radius: 4px; padding: 2px 8px; }

/* ─── KPI strip (5 cells, vertical separators) ────────────────── */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 20px;
}
@media (max-width: 900px) { .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) { .kpi-strip { grid-template-columns: 1fr; } }

.kpi-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px 16px;
  text-align: center;
}
.kpi-cell + .kpi-cell::before {
  content: '';
  position: absolute;
  left: 0; top: 18%; bottom: 18%;
  width: 1px;
  background: var(--rule);
}
@media (max-width: 900px) {
  .kpi-cell + .kpi-cell::before { display: none; }
  .kpi-cell { border-top: 1px solid var(--rule); }
}
.kpi-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-soft);
  color: var(--ink-soft);
  flex-shrink: 0;
}
.kpi-icon--orange { background: #fff7ed; color: #ea580c; }
.kpi-icon--green  { background: var(--bg-emerald); color: var(--emerald); }
.kpi-icon--purple { background: #f5f3ff; color: #7c3aed; }
.kpi-icon--slate  { background: var(--bg-soft); color: var(--ink-soft); }

.kpi-number {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.kpi-number--orange { color: #ea580c; }
.kpi-number--green  { color: var(--emerald); }
.kpi-number--purple { color: #7c3aed; }
.kpi-number--slate  { color: var(--ink); }

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.kpi-sub {
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: -2px;
}
.kpi-time {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* ─── Pill badge (status, populated, etc.) ─────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.pill--green   { background: var(--bg-emerald); color: var(--emerald-deep); border: 1px solid #a7f3d0; }
.pill--blue    { background: var(--bg-indigo);  color: var(--indigo);      border: 1px solid #c7d2fe; }
.pill--amber   { background: var(--bg-warning); color: var(--amber);       border: 1px solid #fcd34d; }
.pill--slate   { background: var(--bg-soft);    color: var(--ink-soft);    border: 1px solid var(--rule); }
.pill--mute    { background: transparent;      color: var(--ink-mute);    border: 1px solid var(--rule); }

/* ─── Summary row (label / value, dense) ───────────────────── */
.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
}
.summary-row:last-child { border-bottom: 0; }
.summary-row__label {
  color: var(--ink-mute);
  font-weight: 500;
  flex-shrink: 0;
}
.summary-row__value {
  color: var(--ink);
  font-weight: 600;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
  word-break: break-word;
}
.summary-row__value--plain { font-family: var(--font-body); }

/* ─── Sidebar accent cards (amber guidance, blue shortcuts) ── */
.accent-card {
  border-radius: var(--r-md);
  padding: 18px 20px;
  border: 1px solid;
}
.accent-card__title {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.accent-card--amber {
  background: var(--bg-warning);
  border-color: #fcd34d;
  color: var(--amber);
}
.accent-card--amber .accent-card__title { color: var(--amber); }
.accent-card--amber ul { color: #78350f; }
.accent-card--blue {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: var(--indigo-text);
}
.accent-card--blue .accent-card__title { color: var(--indigo); }
.accent-card--indigo {
  background: var(--bg-indigo);
  border-color: #e0e7ff;
}
.accent-card--indigo .accent-card__title { color: var(--indigo); }
.accent-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  line-height: 1.55;
}
.accent-card li {
  position: relative;
  padding-left: 14px;
}
.accent-card li::before {
  content: '';
  position: absolute;
  left: 2px; top: 8px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}

/* ─── Keyboard shortcut chip ─────────────────────────────── */
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink-soft);
  background: var(--bg);
  border: 1px solid var(--rule-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
}
.shortcut-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}
.shortcut-grid > div {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-soft);
}

/* ─── Image preview / toolbar ─────────────────────────────── */
.image-frame {
  position: relative;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  max-height: 460px;
}
.image-frame img {
  display: block;
  max-width: 100%;
  max-height: 460px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.image-empty {
  color: var(--ink-faint);
  font-size: 13px;
  text-align: center;
  padding: 32px;
}
.image-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  margin-top: 8px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  width: fit-content;
}
.image-toolbar .btn-icon { width: 30px; height: 30px; }

/* ─── Two-column workspace header (title + side action) ───── */
.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.workspace-header h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.workspace-header .pill { font-size: 11px; }

/* ─── Pagination row (Prev / counter / Next) ──────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.pagination__center {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ─── Inline info callout (light indigo) ──────────────────── */
.info-callout {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--bg-indigo);
  border: 1px solid #e0e7ff;
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--indigo-text);
  line-height: 1.55;
}
.info-callout svg { flex-shrink: 0; color: var(--indigo); margin-top: 1px; }

/* ─── Inline save feedback (green text + check) ──────────── */
.save-feedback {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--emerald-deep);
  font-weight: 500;
}
.save-feedback svg { color: var(--emerald); }

/* ─── Form textarea ─────────────────────────────────────── */
.field-textarea {
  display: block;
  width: 100%;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  resize: vertical;
  min-height: 60px;
}
.field-textarea:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px var(--indigo-soft);
}
.field-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}
.field-checkbox-row input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--indigo);
  cursor: pointer;
  flex-shrink: 0;
}
.field-help {
  display: inline-flex;
  align-items: center;
  color: var(--ink-faint);
  cursor: help;
}

/* ─── Metadata list (label / value) — compact, no border ─── */
.meta-list { display: flex; flex-direction: column; gap: 6px; }
.meta-list__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  line-height: 1.4;
}
.meta-list__label {
  color: var(--ink-mute);
  font-weight: 500;
  flex-shrink: 0;
}
.meta-list__value {
  color: var(--ink);
  font-weight: 600;
  text-align: right;
  font-family: var(--font-mono);
  word-break: break-word;
}
.meta-list__value--plain { font-family: var(--font-body); }

/* ─── PE: Page header (large) ─────────────────────────────── */
.page-header--pe { margin-bottom: 24px; }
.page-header--pe h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.page-header--pe p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-mute);
  max-width: 82ch;
}

/* ─── PE: Info card pair (Research Design / Practical Example) ── */
.info-card-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 768px) { .info-card-pair { grid-template-columns: 1fr; } }

.info-card {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 18px 20px;
}
.info-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 12px;
}
.info-card__title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.info-card__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-body);
  background: var(--bg);
  border: 1px solid;
  cursor: pointer;
  transition: background 120ms ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.info-card__pill--blue {
  color: var(--indigo);
  border-color: #c7d2fe;
}
.info-card__pill--blue:hover { background: var(--bg-indigo); }
.info-card__pill--purple {
  color: #7c3aed;
  border-color: #ddd6fe;
}
.info-card__pill--purple:hover { background: #f5f3ff; }
.info-card__body {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* ─── PE: Status tile grid (7 tiles, single row) ─────────── */
.status-tile-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 14px;
}
@media (max-width: 1100px) { .status-tile-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px)  { .status-tile-grid { grid-template-columns: repeat(2, 1fr); } }

.status-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 10px;
  position: relative;
  min-width: 0;
}
.status-tile + .status-tile::before {
  content: '';
  position: absolute;
  left: 0; top: 16%; bottom: 16%;
  width: 1px;
  background: var(--rule);
}
@media (max-width: 1100px) {
  .status-tile + .status-tile::before { display: none; }
  .status-tile { border-top: 1px solid var(--rule); }
}

.status-tile__icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 1;
}
.status-tile__icon--blue   { background: var(--bg-indigo);  color: var(--indigo); }
.status-tile__icon--purple { background: #f5f3ff;            color: #7c3aed; }
.status-tile__icon--green  { background: var(--bg-emerald); color: var(--emerald); }
.status-tile__icon--slate  { background: var(--bg-soft);    color: var(--ink-soft); }

.status-tile__label {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
  line-height: 1.2;
}
.status-tile__value {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  font-family: var(--font-body);
  word-break: break-word;
  line-height: 1.3;
  max-width: 100%;
}
.status-tile__value--link   { color: var(--indigo); cursor: pointer; }
.status-tile__value--link:hover { text-decoration: underline; }
.status-tile__value--mono   { font-family: var(--font-mono); font-size: 12px; }
.status-tile__value--green  { color: var(--emerald-deep); }
.status-tile__value--small  { font-size: 11px; font-weight: 500; }

/* ─── PE: Inline info callout (blue, research control) ───── */
.info-callout--pe {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg-indigo);
  border: 1px solid #e0e7ff;
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--indigo-text);
}
.info-callout--pe svg { flex-shrink: 0; color: var(--indigo); margin-top: 1px; }

/* ─── PE: Section header (title + small label) ───────────── */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}
.section-header h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.01em;
}
.section-header__label {
  font-size: 12px;
  color: var(--ink-mute);
  font-weight: 400;
  font-family: var(--font-body);
}
.section-subtitle {
  font-size: 12px;
  color: var(--ink-mute);
  margin-bottom: 14px;
  margin-top: -2px;
  line-height: 1.5;
}

/* ─── PE: Identity form grids ────────────────────────────── */
.identity-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}
.identity-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.identity-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) {
  .identity-grid--3 { grid-template-columns: 1fr; }
  .identity-grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .identity-grid--4 { grid-template-columns: 1fr; }
}

/* ─── PE: Phase accordion (replaces JS-rendered <details>) ─── */
.phase-block {
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--bg);
}
.phase-block--expanded { background: #f8fafc; border-color: #c7d2fe; }
.phase-block--collapsed { background: var(--bg); }

.phase-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  gap: 12px;
  transition: background 120ms ease;
}
.phase-block__header:hover { background: rgba(0,0,0,0.02); }

.phase-block__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.phase-block__total {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--ink-mute);
  font-weight: 500;
  flex-shrink: 0;
}
.phase-block__chevron {
  width: 16px; height: 16px;
  transition: transform 200ms ease;
  color: var(--ink-mute);
  flex-shrink: 0;
}
.phase-block--expanded .phase-block__chevron { transform: rotate(180deg); }

.phase-block__body {
  padding: 4px 18px 18px;
  display: none;
}
.phase-block--expanded .phase-block__body { display: block; }

/* ─── PE: Policy rules grid (3 columns per phase) ────────── */
.policy-rules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 900px) { .policy-rules-grid { grid-template-columns: 1fr; } }

.rule-column {
  display: flex;
  flex-direction: column;
  padding: 14px;
  border-radius: var(--r-sm);
  border: 1px solid;
  min-width: 0;
}
.rule-column--allowed    { background: #f0fdf4; border-color: #bbf7d0; }
.rule-column--restricted { background: #fffbeb; border-color: #fde68a; }
.rule-column--forbidden  { background: #fef2f2; border-color: #fecaca; }

.rule-column__header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}
.rule-column--allowed    .rule-column__header { color: var(--emerald-deep); }
.rule-column--restricted .rule-column__header { color: #c2410c; }
.rule-column--forbidden  .rule-column__header { color: #b91c1c; }

.rule-column__icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  font-weight: 700;
}
.rule-column--allowed    .rule-column__icon { background: var(--bg-emerald); color: var(--emerald); }
.rule-column--restricted .rule-column__icon { background: #fff7ed;           color: #ea580c; }
.rule-column--forbidden  .rule-column__icon { background: #fef2f2;           color: #dc2626; }

.rule-column__count {
  font-weight: 500;
  color: var(--ink-mute);
  font-size: 12px;
  margin-left: 2px;
}

.rule-column__list {
  list-style: disc;
  padding-left: 18px;
  margin: 0 0 12px 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-soft);
  flex: 1 1 auto;
}
.rule-column__list li { margin-bottom: 4px; }
.rule-column__list li:last-child { margin-bottom: 0; }

.rule-column__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px dashed;
  font-size: 12px;
}
.rule-column--allowed    .rule-column__footer { border-color: #bbf7d0; }
.rule-column--restricted .rule-column__footer { border-color: #fde68a; }
.rule-column--forbidden  .rule-column__footer { border-color: #fecaca; }

.rule-column__link {
  color: var(--indigo);
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 12px;
  text-decoration: none;
  font-family: var(--font-body);
}
.rule-column__link:hover { text-decoration: underline; }

/* ─── PE: Action bar (3 buttons + helper text) ───────────── */
.action-bar-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: stretch;
}
@media (max-width: 768px) { .action-bar-3col { grid-template-columns: 1fr; } }

.action-bar-item {
  display: flex;
  flex-direction: column;
}
.action-bar-item > .btn-save-primary,
.action-bar-item > .btn-reset-outline,
.action-bar-item > .btn-discard-outline {
  width: 100%;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.btn-save-primary {
  background: var(--indigo);
  color: #ffffff;
  border: 1px solid var(--indigo);
}
.btn-save-primary:hover { background: var(--indigo-deep); border-color: var(--indigo-deep); }
.btn-save-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-reset-outline {
  background: var(--bg);
  color: var(--ink-soft);
  border: 1px solid var(--rule-strong);
}
.btn-reset-outline:hover { background: var(--bg-soft); border-color: var(--ink-mute); color: var(--ink); }

.btn-discard-outline {
  background: var(--bg);
  color: #b91c1c;
  border: 1px solid #fca5a5;
}
.btn-discard-outline:hover { background: #fef2f2; border-color: #dc2626; }

.helper-text {
  font-size: 12px;
  text-align: center;
  margin-top: 8px;
  line-height: 1.5;
  color: var(--ink-mute);
  max-width: 28ch;
  margin-left: auto;
  margin-right: auto;
}
.helper-text--muted   { color: var(--ink-mute); }
.helper-text--success { color: var(--emerald-deep); }
.helper-text--danger  { color: #b91c1c; }

/* ─── PE: Warning banner (amber) ─────────────────────────── */
.amber-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-warning);
  border: 1px solid #fcd34d;
  border-radius: var(--r-sm);
  padding: 14px 16px;
  color: var(--amber);
  font-size: 13px;
  line-height: 1.55;
}
.amber-warning__icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--amber);
  color: #ffffff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.amber-warning__body strong { color: var(--amber); display: block; margin-bottom: 2px; font-weight: 700; }

/* ─── PE: Immutable policy footer note ───────────────────── */
.immutable-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 12px;
  color: var(--ink-mute);
  text-align: center;
}
.immutable-note svg { color: var(--ink-faint); flex-shrink: 0; }

/* ─── PE: E6 warning banner (preserved for app.js compat) ── */
#pe-e6-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--r-sm);
  padding: 12px 14px;
  color: #c2410c;
  font-size: 12px;
  line-height: 1.55;
  margin-bottom: 16px;
}
#pe-e6-warning strong { color: #c2410c; }

/* ─── ST: 2-column main layout (left content + right sticky sidebar) ─── */
.layout-2col-with-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 980px) {
  .layout-2col-with-sidebar { grid-template-columns: 1fr; }
}

/* ─── ST: Sidebar wrapper (right column) ─────────────────────────────── */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.sidebar--sticky {
  position: sticky;
  top: 80px;
  align-self: start;
}
@media (max-width: 980px) {
  .sidebar--sticky { position: static; }
}

/* ─── ST: Page header row (title + side action buttons) ─────────────── */
.page-header--st {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title top"
    "title sub";
  align-items: start;
  column-gap: 24px;
  row-gap: 14px;
  margin-bottom: 24px;
}
@media (max-width: 720px) {
  .page-header--st {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "top"
      "sub";
  }
}
.page-header--st__title { grid-area: title; min-width: 0; }
.page-header--st__top-actions {
  grid-area: top;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  justify-self: end;
}
.page-header--st__sub-actions {
  grid-area: sub;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-self: end;
}
.page-header--st h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.page-header--st p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-mute);
  max-width: 70ch;
}

/* ─── ST: Research Control info callout (very pale blue) ───────────── */
.info-callout--st {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-indigo);
  border: 1px solid #e0e7ff;
  border-radius: var(--r-md);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.info-callout--st__icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--indigo);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.info-callout--st__body strong {
  display: block;
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 2px;
  font-size: 14px;
}

/* ─── ST: Section sub-heading (inside a card) ─────────────────────── */
.card-section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.card-section-subtitle {
  font-size: 12px;
  color: var(--ink-mute);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ─── ST: API key input wrapper (password + eye toggle) ────────────── */
.apikey-field {
  position: relative;
  display: block;
}
.apikey-field .field-input-text {
  padding-right: 44px;
}
.apikey-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--ink-mute);
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease;
}
.apikey-toggle:hover {
  color: var(--indigo);
  background: var(--bg-soft);
}

/* ─── ST: 2-button action row (Save + Test) ────────────────────────── */
.action-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}
@media (max-width: 540px) { .action-row-2col { grid-template-columns: 1fr; } }

.action-row-2col .action-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.action-row-2col .action-item > .btn-save-primary,
.action-row-2col .action-item > .btn-test-outline {
  width: 100%;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.btn-save-primary {
  background: var(--indigo);
  color: #ffffff;
  border: 1px solid var(--indigo);
}
.btn-save-primary:hover { background: var(--indigo-deep); border-color: var(--indigo-deep); }
.btn-save-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-test-outline {
  background: var(--bg);
  color: var(--ink-soft);
  border: 1px solid var(--rule-strong);
}
.btn-test-outline:hover {
  background: var(--bg-soft);
  border-color: var(--ink-mute);
  color: var(--ink);
}

.action-row-2col .action-item > .helper-text {
  margin-top: 8px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── ST: Helper text colour variants ──────────────────────────────── */
.helper-text {
  font-size: 12px;
  text-align: center;
  margin-top: 8px;
  line-height: 1.5;
  color: var(--ink-mute);
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
}
.helper-text--muted   { color: var(--ink-mute); }
.helper-text--success { color: var(--emerald-deep); }
.helper-text--danger  { color: #b91c1c; }

/* ─── ST: Sub-card (Export / Delete) within parent card ────────────── */
.sub-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 760px) { .sub-card-grid { grid-template-columns: 1fr; } }

.sub-card {
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sub-card__body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
}
.sub-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 4px;
}
.sub-card__header--blue {
  border-bottom-color: #c7d2fe;
}
.sub-card__header--red {
  border-bottom-color: #fecaca;
}
.sub-card-header--blue {
  border-bottom-color: #c7d2fe;
}
.sub-card-header--red {
  border-bottom-color: #fecaca;
}
.sub-card__title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.sub-card__icon {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sub-card__icon--blue { background: var(--bg-indigo); color: var(--indigo); }
.sub-card__icon--red  { background: #fef2f2; color: #dc2626; }

.sub-card__desc {
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
}

/* Include list (green checks) — used in Export sub-card */
.include-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.include-list__item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.include-list__check,
.include-list__cross {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}
.include-list__check {
  background: var(--bg-emerald);
  color: var(--emerald);
  border: 1px solid #a7f3d0;
}
.include-list__cross {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.include-list__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
  margin-bottom: 6px;
}

/* Lists inside coloured tinted boxes (delete will / will not) */
.delete-box {
  border-radius: var(--r-sm);
  padding: 10px 12px;
  margin: 0;
  border: 1px solid;
}
.delete-box--red {
  background: #fef2f2;
  border-color: #fecaca;
}
.delete-box--green {
  background: var(--bg-emerald);
  border-color: #a7f3d0;
}
.delete-box__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.delete-box--red .delete-box__label { color: #b91c1c; }
.delete-box--green .delete-box__label { color: var(--emerald-deep); }

/* Sub-card footer button row */
.sub-card__footer {
  padding: 12px 18px 16px;
  border-top: 1px solid var(--rule);
  background: var(--bg);
}
.sub-card__footer .btn-export-outline,
.sub-card__footer .btn-delete-outline {
  width: 100%;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.btn-export-outline {
  background: var(--bg);
  color: var(--indigo);
  border: 1px solid #c7d2fe;
}
.btn-export-outline:hover { background: var(--bg-indigo); border-color: var(--indigo); }
.btn-delete-outline {
  background: var(--bg);
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.btn-delete-outline:hover { background: #fef2f2; border-color: #dc2626; }

/* ─── ST: Warning banner (red) ─────────────────────────────────────── */
.warning-banner--red {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--r-sm);
  padding: 12px 14px;
  margin-top: 16px;
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.55;
}
.warning-banner--red__icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #dc2626;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.warning-banner--red strong { color: #b91c1c; display: block; margin-bottom: 2px; font-weight: 700; }

/* ─── ST: Note callout (light blue) ────────────────────────────────── */
.info-callout--st-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg-indigo);
  border: 1px solid #e0e7ff;
  border-radius: var(--r-sm);
  padding: 12px 16px;
  font-size: 12px;
  color: var(--indigo-text);
  line-height: 1.6;
}
.info-callout--st-note__icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--indigo);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.info-callout--st-note strong {
  color: var(--ink);
  font-weight: 700;
  margin-right: 4px;
}

/* ─── ST: Settings result feedback row ─────────────────────────────── */
.settings-result-row {
  text-align: center;
  margin-top: 10px;
  min-height: 18px;
  font-size: 12px;
}

/* ─── ST: Page Guide sidebar card ──────────────────────────────────── */
.page-guide-card {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.page-guide-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.page-guide-card__title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.page-guide-card__close {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--ink-mute);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}
.page-guide-card__close:hover {
  color: var(--ink);
  background: var(--bg-soft);
  border-color: var(--rule);
}
.page-guide-card__intro {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-mute);
  margin: 0;
}

/* ─── ST: Page Guide glossary items ────────────────────────────────── */
.guide-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.guide-item:last-child { border-bottom: 0; }
.guide-item__icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  background: var(--bg-soft);
  color: var(--ink-soft);
  line-height: 1;
}
.guide-item__icon--blue   { background: var(--bg-indigo);  color: var(--indigo); }
.guide-item__icon--purple { background: #f5f3ff;            color: #7c3aed; }
.guide-item__icon--green  { background: var(--bg-emerald); color: var(--emerald); }
.guide-item__icon--red    { background: #fef2f2;           color: #dc2626; }
.guide-item__icon--slate  { background: var(--bg-soft);    color: var(--ink-soft); }
.guide-item__icon--amber  { background: var(--bg-warning); color: var(--amber); }

.guide-item__body {
  flex: 1 1 auto;
  min-width: 0;
}
.guide-item__name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
  line-height: 1.3;
}
.guide-item__desc {
  font-size: 12px;
  color: var(--ink-mute);
  line-height: 1.5;
  margin: 0;
}

/* ─── ST: Page Guide footer callout (Configuration Versioning) ────── */
.guide-callout {
  background: var(--bg-indigo);
  border: 1px solid #e0e7ff;
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--indigo-text);
}
.guide-callout strong { color: var(--ink); display: block; margin-bottom: 4px; font-weight: 700; }

/* ─── ST: Sidebar hide/show helpers ───────────────────────────────── */
.sidebar.is-hidden { display: none; }
