/* Keep foreground/background pairs together, including the OS-selected theme. */
:root {
  --action-bg: #285443;
  --action-ink: #ffffff;
  --danger-bg: #9d3030;
  --danger-ink: #ffffff;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111f1a;
  --panel: #192c23;
  --panel-soft: #223b2e;
  --ink: #f1f4ed;
  --muted: #c0cebd;
  --line: #607668;
  --green: #9ed7b1;
  --green-dark: #b2d7a7;
  --action-bg: #9ed7b1;
  --action-ink: #102219;
  --danger-bg: #f69797;
  --danger-ink: #2d0b0b;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
    --bg: #111f1a;
    --panel: #192c23;
    --panel-soft: #223b2e;
    --ink: #f1f4ed;
    --muted: #c0cebd;
    --line: #607668;
    --green: #9ed7b1;
    --green-dark: #b2d7a7;
    --action-bg: #9ed7b1;
    --action-ink: #102219;
    --danger-bg: #f69797;
    --danger-ink: #2d0b0b;
  }
}
button.primary, .button.primary {
  background: var(--action-bg);
  border-color: var(--action-bg);
  color: var(--action-ink);
}
button.danger, .button.danger {
  background: var(--danger-bg);
  border-color: var(--danger-bg);
  color: var(--danger-ink);
}
.flash, .status, .score-pill { color: var(--ink); }
.flash.good, .status.good, .status.goed, .score-pill.goed {
  background: color-mix(in srgb, var(--panel) 88%, var(--green) 12%);
  color: var(--ink);
  border-color: var(--green);
}
.flash.danger, .status.bijsturen, .score-pill.bijsturen {
  background: color-mix(in srgb, var(--panel) 88%, var(--red) 12%);
  color: var(--ink);
  border-color: var(--red);
}
.flash.warning, .status.aandacht, .score-pill.aandacht {
  background: color-mix(in srgb, var(--panel) 88%, var(--amber) 12%);
  color: var(--ink);
  border-color: var(--amber);
}
.flash.info {
  background: color-mix(in srgb, var(--panel) 88%, var(--blue) 12%);
  color: var(--ink);
  border-color: var(--blue);
}
.studio-intro, .pill, .breed-tag, .breed-tag.brown {
  background: var(--panel-soft);
  color: var(--ink);
  border-color: var(--line);
}
.studio-symbol { color: var(--green-dark); }
.mini-bar, .dual-meter { background: var(--panel-soft); }
:root[data-accessible="true"] {
  --bg: #090d0b;
  --panel: #090d0b;
  --panel-soft: #151c16;
  --ink: #ffffff;
  --muted: #ededdf;
  --line: #bfcab9;
  --green: #ffdf68;
  --green-dark: #ffdf68;
  --amber: #ffdf68;
  --action-bg: #ffdf68;
  --action-ink: #101510;
  --danger-bg: #861f2b;
  --danger-ink: #ffffff;
}
:root[data-accessible="true"] :is(.flash,.status,.score-pill,.breed-tag,.pill) {
  background: var(--panel-soft);
  color: var(--ink);
}
:root[data-accessible="true"] :is(.account-grid,.user-cards) {
  grid-template-columns: 1fr;
}
.integration-page pre, .integration-page .mono {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.integration-page table {
  table-layout: fixed;
  overflow-wrap: anywhere;
}
.integration-page .settings-grid > .panel {
  min-width: 0;
}
:root[data-accessible="true"] .integration-page .settings-grid {
  grid-template-columns: 1fr;
}
.scroll-top-slot {
  position: sticky;
  bottom: 12px;
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  min-height: 64px;
  pointer-events: none;
  z-index: 11;
}
.scroll-top-slot button {
  pointer-events: auto;
  min-height: 52px;
  border: 2px solid var(--ink);
  background: var(--panel);
  color: var(--ink);
  font-weight: 700;
}
.scroll-top-slot [hidden] { display: none !important; }
:root[data-accessible="true"] .scroll-top-slot { min-height: 110px; }
@media print { .scroll-top-slot { display: none; } }
.notebooklm-diagnosis { padding: 20px; margin: 20px 0; border: 2px solid var(--ink); border-radius: 8px; background: var(--panel-soft); color: var(--ink); }
.notebooklm-diagnosis h3 { margin-top: 0; }
.notebooklm-diagnosis dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 20px; }
.notebooklm-diagnosis dd { margin: 0; overflow-wrap: anywhere; }
:root[data-accessible="true"] .notebooklm-diagnosis { border-width: 3px; padding: 24px; }
@media(max-width:600px) { .notebooklm-diagnosis dl { grid-template-columns: 1fr; gap: 6px; } .notebooklm-diagnosis dt { margin-top: 12px; font-weight: 700; } }
/* Links use colour, borders and focus outlines; no underlines on portal actions. */
a:hover,a:focus-visible { text-decoration:none; }
.metric-card.metric-mini { color:var(--ink); }
.metric-card.metric-mini:hover { outline:2px solid var(--green-dark); outline-offset:2px; }
.metric-chart-hint { display:block; color:var(--green-dark); margin-top:12px; font-size:.75rem; }

.graph-balloon { position:fixed; z-index:2000; max-width:min(300px,calc(100vw - 16px)); padding:12px 16px; border:2px solid var(--green-dark); border-radius:12px; background:var(--panel); color:var(--ink); box-shadow:0 8px 30px #0005; font-size:16px; font-weight:650; line-height:1.5; white-space:pre-line; pointer-events:none; font-variant-numeric:tabular-nums; }
.graph-balloon[hidden] { display:none; }
.knowledge-health { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(170px,100%),1fr)); gap:12px; margin:20px 0; }
.knowledge-health > div { border:1px solid var(--line); border-radius:12px; padding:18px; background:var(--panel-soft); color:var(--ink); }
.knowledge-health strong { font-size:1.8rem; font-variant-numeric:tabular-nums; }
.podcast-weekdays { border:1px solid var(--line);border-radius:12px;padding:12px;display:flex;flex-wrap:wrap;gap:8px;min-width:0; }
.podcast-weekdays legend { padding:0 6px; }
.podcast-weekdays label.check { min-height:44px;display:flex;align-items:center;gap:8px;margin:0;padding:4px 8px; }
.management-panel .editor-grid.podcast-schedule-grid { grid-template-columns:repeat(auto-fit,minmax(min(100%,350px),1fr)); }
.knowledge-health p { margin:8px 0 0; }
:root[data-accessible="true"] .graph-balloon { font-size:1rem; max-width:min(500px,calc(100vw - 16px)); }
