/* Stroomvoorspeller — basis-stijlen
   Mobiel-eerst, sober, hoge leesbaarheid.
*/

:root {
  --c-bg: #f6f8fb;
  --c-surface: #ffffff;
  --c-text: #18222e;
  --c-text-soft: #4a5b6e;
  --c-text-mute: #5d6f80;
  --c-border: #e1e7ee;

  --c-brand: #0f6cbd;
  --c-brand-deep: #0a4f8b;
  --c-accent: #2e75b6;

  --c-free: #7048e8;
  --c-free-bg: #f0ebff;
  --c-cheap: #2f9e44;
  --c-cheap-bg: #e6f4ea;
  --c-normal: #d4a017;
  --c-normal-bg: #fff4d6;
  --c-pricey: #c92a2a;
  --c-pricey-bg: #fde8e8;

  --shadow-sm: 0 1px 2px rgba(20, 30, 50, 0.05);
  --shadow-md: 0 4px 16px rgba(20, 30, 50, 0.08);

  --radius: 14px;
  --radius-sm: 8px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--c-brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(140%) blur(8px);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--c-text);
}
.brand-mark {
  display: block;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.brand-tld { color: var(--c-text-mute); font-weight: 500; }
.primary-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.primary-nav a { color: var(--c-text-soft); font-weight: 500; font-size: 0.95rem; padding: 10px 4px; }
.primary-nav a:hover { color: var(--c-brand); }

/* Settings toggle button in header */
.settings-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--c-brand);
  background: #f0f6fc;
  border-radius: 999px;
  padding: 6px 14px 6px 12px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--c-brand-deep);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 2px rgba(15, 108, 189, 0.08);
  max-width: 100%;
}
.settings-toggle:hover {
  background: #e3eef9;
  border-color: var(--c-brand-deep);
  box-shadow: 0 2px 6px rgba(15, 108, 189, 0.15);
}
.settings-toggle[aria-expanded="true"] {
  background: var(--c-brand);
  color: #fff;
  border-color: var(--c-brand);
}
.settings-toggle[aria-expanded="true"] .settings-toggle-prefix,
.settings-toggle[aria-expanded="true"] .settings-toggle-value { color: #fff; }
.settings-toggle-icon { font-size: 1rem; line-height: 1; flex-shrink: 0; }
.settings-toggle-text {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.settings-toggle-prefix {
  color: var(--c-text-soft);
  font-weight: 500;
  white-space: nowrap;
}
.settings-toggle-value {
  font-weight: 600;
  color: var(--c-brand-deep);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.settings-toggle-caret {
  font-size: 0.85rem;
  margin-left: -2px;
  opacity: 0.7;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.settings-toggle[aria-expanded="true"] .settings-toggle-caret {
  transform: rotate(180deg);
  opacity: 1;
}
@media (max-width: 640px) {
  .settings-toggle-prefix { display: none; }
  .settings-toggle-value { max-width: 130px; }
}

/* Settings panel */
.settings-panel {
  margin: 18px auto 0;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-md);
  animation: panel-in 0.2s ease;
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.settings-block { display: grid; gap: 8px; align-content: start; }
.settings-block strong { color: var(--c-text); font-size: 1rem; }
.settings-help { margin: 0; color: var(--c-text-soft); font-size: 0.88rem; line-height: 1.5; }
.settings-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--c-text);
  background: #fff;
}
.settings-input:focus {
  outline: none;
  border-color: var(--c-brand);
  box-shadow: 0 0 0 3px rgba(15, 108, 189, 0.15);
}
.settings-row { display: grid; gap: 4px; margin-top: 6px; }
.settings-row label { font-size: 0.88rem; color: var(--c-text-soft); }
.settings-current {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--c-text-mute);
}
.settings-meta {
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--c-text-soft);
  font-size: 0.9rem;
  line-height: 1.6;
}
.settings-meta li { margin: 2px 0; }
@media (max-width: 720px) {
  .settings-grid { grid-template-columns: 1fr; gap: 16px; }
  .settings-panel { padding: 16px 18px; }
}

/* Mode toggle (incl./excl. belasting) */
.mode-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.mode-toggle-label {
  font-size: 0.85rem;
  color: var(--c-text-mute);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.mode-toggle-buttons {
  display: inline-flex;
  background: #ecf1f6;
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.mode-btn {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--c-text-soft);
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.mode-btn:hover { color: var(--c-text); }
.mode-btn.is-active {
  background: var(--c-surface);
  color: var(--c-brand-deep);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
@media (max-width: 480px) {
  .mode-toggle { justify-content: space-between; }
  .mode-btn { padding: 6px 10px; font-size: 0.83rem; }
}

/* Resolution toggle (per uur / per kwartier) — zit in chart section-head */
.chart-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.chart-head-text { flex: 1 1 auto; min-width: 0; }
.res-toggle {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding-top: 4px; /* visueel uitlijnen met h2 baseline */
}
.res-toggle[hidden] { display: none; }
.res-toggle-buttons {
  display: inline-flex;
  background: #ecf1f6;
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.res-btn {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--c-text-mute);
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.res-btn:hover { color: var(--c-text); }
.res-btn.is-active {
  background: var(--c-surface);
  color: var(--c-brand-deep);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
@media (max-width: 560px) {
  .chart-section-head { flex-direction: column; gap: 8px; }
  .res-toggle { padding-top: 0; }
  .res-btn { padding: 5px 11px; font-size: 0.82rem; }
}

/* Now-card aanpassing — extra mode-label en EPEX-regel */
.now-price-mode {
  font-size: 0.9rem;
  color: var(--c-text-soft);
  font-weight: 500;
  background: #ecf1f6;
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: 4px;
  align-self: center;
}
.now-meta-soft { color: var(--c-text-mute); font-size: 0.88rem; }

/* Scroll-offset: compenseert de sticky header (~56px) bij ankerlinks */
.hero,
.chart-section,
.forecast-section,
.suppliers-section,
.moments-section,
.explain-section {
  scroll-margin-top: 72px;
}

/* Sectiestructuur (#62): consistente ruimte en visuele scheiding tussen blokken */
.forecast-section,
.suppliers-section,
.moments-section,
.explain-section {
  padding-top: 36px;
  padding-bottom: 48px;   /* was 40vh (360px+ op desktop) — teruggebracht */
  border-top: 1px solid var(--c-border);
}

/* ----- Hero-verdict: morgen/nu-samenvatting bovenaan — vervangt tomorrow-tip (#58) ----- */
/* Structuur zelfde als de voormalige tomorrow-tip banner, maar boven de now-card. */
.hero-verdict {
  width: 100%;
  font-size: 0.92rem;
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
}
.hero-verdict[hidden] { display: none; }
.hero-verdict-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
}
.hero-verdict-icon { flex-shrink: 0; font-size: 1.15rem; }
.hero-verdict-text {
  margin: 0;
  flex: 1;
  line-height: 1.5;
  font-weight: 500;
}
.hero-verdict-text a { font-weight: 600; margin-left: 4px; text-decoration: none; }
.hero-verdict-text a:hover { text-decoration: underline; }

/* Kleurvarianten — identiek aan de voormalige tomorrow-tip */
.hero-verdict--neg  {
  background: #f0ebff;
  border-color: #c4b5fd;
  color: #3b1d8a;
}
.hero-verdict--neg .hero-verdict-text a { color: #5b21b6; }

.hero-verdict--cheap {
  background: #e6f4ea;
  border-color: #86efac;
  color: #14532d;
}
.hero-verdict--cheap .hero-verdict-text a { color: #15803d; }

.hero-verdict--pricey {
  background: #fff8e1;
  border-color: #fde68a;
  color: #78350f;
}
.hero-verdict--pricey .hero-verdict-text a { color: #92400e; }

/* Neutraal (geen bijzonder scenario / no-data) */
.hero-verdict--neutral {
  background: var(--c-surface);
  border-color: var(--c-border);
  color: var(--c-text-soft);
}
.hero-verdict--neutral .hero-verdict-text a { color: var(--c-brand); }

@media (max-width: 640px) {
  .hero-verdict-inner { padding: 10px 12px; }
  .hero-verdict-icon  { font-size: 1rem; }
}

/* Hero / now-card */
.hero { padding: 32px 0 8px; }
.hero-heading {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--c-text-soft);
  margin: 0 0 4px;
  letter-spacing: 0.01em;
}
/* Tagline (#59): "De Buienradar voor stroomprijzen." */
.hero-tagline {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--c-brand-deep);
  margin: 0 0 10px;
  letter-spacing: 0.005em;
}
@media (max-width: 640px) {
  .hero-tagline { font-size: 0.95rem; }
}
.hero-sub {
  font-size: 0.92rem;
  color: var(--c-text-mute);
  margin: 0 0 16px;
}

/* Scroll-nudge (#61): subtiele ↓ richting grafiek, alleen zichtbaar op mobiel */
.scroll-nudge {
  text-align: center;
  padding: 12px 0 4px;
  display: none; /* verborgen op desktop; grafiek is daar al in beeld */
}
.scroll-nudge-arrow {
  display: inline-block;
  font-size: 1.3rem;
  color: var(--c-text-mute);
  text-decoration: none;
  line-height: 1;
  animation: nudge-bounce 2.2s ease-in-out infinite;
}
.scroll-nudge-arrow:hover { color: var(--c-brand); }
@keyframes nudge-bounce {
  0%, 100% { transform: translateY(0);   opacity: 0.5; }
  50%       { transform: translateY(5px); opacity: 1;   }
}
@media (max-width: 640px) {
  .scroll-nudge { display: block; }
}
.now-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 28px 28px 22px;
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 8px;
  position: relative;
  overflow: hidden;
  min-height: 160px;
}
.now-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--c-cheap), var(--c-normal), var(--c-pricey));
  opacity: 0.85;
}
.now-card[data-status="free"]    { background: linear-gradient(180deg, var(--c-free-bg) 0%, var(--c-surface) 65%); }
.now-card[data-status="cheap"]   { background: linear-gradient(180deg, var(--c-cheap-bg) 0%, var(--c-surface) 65%); }
.now-card[data-status="normal"]  { background: linear-gradient(180deg, var(--c-normal-bg) 0%, var(--c-surface) 65%); }
.now-card[data-status="pricey"]  { background: linear-gradient(180deg, var(--c-pricey-bg) 0%, var(--c-surface) 65%); }
.now-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--c-text-soft);
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-text-mute);
  display: inline-block;
}
.now-card[data-status="free"]   .status-dot { background: var(--c-free);   box-shadow: 0 0 0 4px var(--c-free-bg); }
.now-card[data-status="cheap"]  .status-dot { background: var(--c-cheap);  box-shadow: 0 0 0 4px var(--c-cheap-bg); }
.now-card[data-status="normal"] .status-dot { background: var(--c-normal); box-shadow: 0 0 0 4px var(--c-normal-bg); }
.now-card[data-status="pricey"] .status-dot { background: var(--c-pricey); box-shadow: 0 0 0 4px var(--c-pricey-bg); }
.status-value {
  font-weight: 700;
  color: var(--c-text);
  text-transform: lowercase;
}
.now-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
}
.now-price-value {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--c-text);
  line-height: 1;
}
.now-price-unit {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--c-text-soft);
}
.now-meta { color: var(--c-text-soft); font-size: 0.95rem; margin: 4px 0 0; }
.dot-sep { margin: 0 8px; color: var(--c-text-mute); }

/* Quick summary — staat nu na de grafiek (standalone, buiten de hero) (#56) */
.quick-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 12px auto 24px;
}
.summary-item {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 14px 14px;
}
.summary-label {
  display: block;
  font-size: 0.78rem;
  color: var(--c-text-mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.summary-value {
  font-weight: 700;
  color: var(--c-text);
  font-size: 1rem;
  line-height: 1.3;
  display: block;
}

/* Sections */
.section-head { margin: 36px 0 14px; }
.tips-notes-head { margin-top: 40px; }
.section-head h2,
.section-head h3 {
  margin: 0 0 4px;
  font-size: 1.4rem;
  color: var(--c-brand-deep);
  letter-spacing: -0.01em;
}
.section-sub { margin: 0; color: var(--c-text-soft); font-size: 0.97rem; }

/* Chart */
.chart-section { padding-bottom: 8px; }
.chart-wrapper {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 16px 12px 12px;
  box-shadow: var(--shadow-sm);
  height: 360px;
}
.chart-note {
  font-size: 0.83rem;
  color: var(--c-text-mute);
  margin: 10px 4px 0;
  line-height: 1.55;
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  font-size: 0.85rem;
  color: var(--c-text-soft);
  margin: 12px 4px 0;
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-item::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--c-text-mute);
}
.legend-free::before    { background: var(--c-free); }
.legend-cheap::before   { background: var(--c-cheap); }
.legend-normal::before  { background: var(--c-normal); }
.legend-pricey::before  { background: var(--c-pricey); }
.legend-current::before { background: var(--c-brand); border-radius: 50%; }

/* Collapsible details (#60) */
.forecast-details {
  cursor: default;
}
.forecast-details-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--c-brand-deep);
  cursor: pointer;
  user-select: none;
  border-radius: var(--radius);
}
.forecast-details-summary::-webkit-details-marker { display: none; }
.forecast-details-summary::before {
  content: "▶";
  font-size: 0.65rem;
  color: var(--c-text-mute);
  transition: transform 0.18s;
  flex-shrink: 0;
}
.forecast-details[open] > .forecast-details-summary::before {
  transform: rotate(90deg);
}
.forecast-details-summary:hover { color: var(--c-brand); }
.forecast-details > p {
  padding: 0 22px 14px;
  margin: 0;
}

/* Forecast placeholder (legacy class, niet meer gebruikt sinds v1.6) */
.forecast-placeholder {
  background: var(--c-surface);
  border: 1px dashed var(--c-border);
  border-radius: var(--radius);
  padding: 18px 22px;
  color: var(--c-text-soft);
}
.forecast-placeholder strong { color: var(--c-brand-deep); }
.forecast-placeholder p { margin: 6px 0 0; }

/* Subtiele achtergrond voor uitleg-secties (#62) */
.explain-section { background: var(--c-surface); }

/* Forecast explainer (live sinds v1.6 — uitleg onder de grafiek) */
.forecast-explainer {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 18px 22px;
  color: var(--c-text-soft);
  line-height: 1.55;
}
.forecast-explainer strong { color: var(--c-brand-deep); }
.forecast-explainer p { margin: 0 0 10px; }
.forecast-explainer p:last-child { margin-bottom: 0; }
.forecast-explainer a { color: var(--c-brand); text-decoration: none; }
.forecast-explainer a:hover { text-decoration: underline; }

/* Best moments */
.moments-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
  min-height: 220px;
}
.moment {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.moment-rank {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--c-cheap-bg);
  color: var(--c-cheap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}
.moment-when { font-weight: 600; }
.moment-when small { color: var(--c-text-mute); font-weight: 500; margin-left: 6px; }
.moment-price {
  font-weight: 700;
  color: #1e7b34;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 6px;
}
.moment.is-negative .moment-price { color: var(--c-free); }
.moment-badge-free {
  display: inline-block;
  background: var(--c-free-bg);
  color: var(--c-free);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.moment-loading { color: var(--c-text-mute); padding: 8px; }

/* Explain */
.explain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.explain-grid article {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.explain-grid h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: var(--c-brand-deep);
}
.explain-grid p {
  margin: 0;
  color: var(--c-text-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* Legal pages (privacy, cookies, disclaimer) */
.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 24px;
}
.legal-page h1 {
  margin: 8px 0 6px;
  color: var(--c-brand-deep);
  letter-spacing: -0.01em;
  font-size: 2rem;
}
.legal-page h2 {
  margin: 36px 0 8px;
  color: var(--c-brand-deep);
  font-size: 1.2rem;
}
.legal-page p, .legal-page li {
  color: var(--c-text);
  line-height: 1.7;
  font-size: 1rem;
}
.legal-page p { margin: 10px 0; }
.legal-page ul { padding-left: 22px; margin: 10px 0; }
.legal-page li { margin: 6px 0; }
.legal-page code {
  background: #ecf1f6;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.legal-meta {
  color: var(--c-text-mute);
  font-size: 0.9rem;
  margin: 0 0 16px;
}
.legal-breadcrumb {
  margin: 0 0 12px;
  font-size: 0.9rem;
}
.legal-breadcrumb a { color: var(--c-text-soft); }
.legal-breadcrumb a:hover { color: var(--c-brand); }
.legal-summary {
  background: #f3f7fb;
  border-left: 4px solid var(--c-brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 18px !important;
}
.legal-related {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--c-border);
  color: var(--c-text-soft);
  font-size: 0.95rem;
}

/* Footer */
.site-footer {
  margin-top: 60px;
  padding: 28px 0 36px;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  color: var(--c-text-soft);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.footer-brand { margin: 0 0 4px; color: var(--c-text); }
.footer-tag, .footer-meta, .footer-meta-small { margin: 4px 0; font-size: 0.9rem; }
.footer-meta-small { color: var(--c-text-mute); font-size: 0.85rem; }

@media (max-width: 640px) {
  /* #48 quick-summary: 2+1 grid (goedkoopst + duurste naast elkaar, gemiddelde vol-breed) */
  .quick-summary { grid-template-columns: 1fr 1fr; }
  .quick-summary .summary-item:last-child { grid-column: 1 / -1; }
  .footer-grid { grid-template-columns: 1fr; }
  .chart-wrapper { height: 300px; }
  .now-card { padding: 22px 20px 18px; }

  /* #45 section-padding reduceren op mobiel */
  .forecast-section,
  .suppliers-section,
  .moments-section,
  .explain-section { padding-top: 28px; padding-bottom: 64px; }

  /* #46 primaire nav: horizontaal scrollbaar op smal scherm */
  .primary-nav {
    order: 3;         /* eigen rij onder brand + settings-toggle */
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    gap: 0;
  }
  .primary-nav::-webkit-scrollbar { display: none; }
  .primary-nav a { white-space: nowrap; padding: 10px 10px; }
}

/* ----- Morgen-tip banner (proactief, verschijnt na ~13:00 als EPEX morgen-data beschikbaar) ----- */
.tomorrow-tip {
  width: 100%;
  font-size: 0.92rem;
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
}
.tomorrow-tip-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
}
.tomorrow-tip-icon { flex-shrink: 0; font-size: 1.15rem; }
.tomorrow-tip-text { margin: 0; flex: 1; line-height: 1.5; }
.tomorrow-tip-text a { font-weight: 600; margin-left: 4px; }

.tomorrow-tip--neg  {
  background: #f0ebff;
  border-color: #c4b5fd;
  color: #3b1d8a;
}
.tomorrow-tip--neg .tomorrow-tip-text a { color: #5b21b6; }

.tomorrow-tip--cheap {
  background: #e6f4ea;
  border-color: #86efac;
  color: #14532d;
}
.tomorrow-tip--cheap .tomorrow-tip-text a { color: #15803d; }

.tomorrow-tip--pricey {
  background: #fff8e1;
  border-color: #fde68a;
  color: #78350f;
}
.tomorrow-tip--pricey .tomorrow-tip-text a { color: #92400e; }

@media (max-width: 640px) {
  .tomorrow-tip-inner { padding: 10px 12px; }
  .tomorrow-tip-icon { font-size: 1rem; }
}

/* ----- Morgen-knop bij de grafiekkop ----- */
.morgen-link-btn {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-brand);
  border: 1.5px solid var(--c-brand);
  border-radius: 999px;
  padding: 5px 13px;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}
.morgen-link-btn:hover {
  background: var(--c-brand);
  color: #fff;
  text-decoration: none;
}
@media (max-width: 560px) {
  .morgen-link-btn { font-size: 0.8rem; padding: 4px 11px; }
}

/* ----- Stale-data banner (subtiele waarschuwing als prices.json ouder is dan 6 uur) ----- */
.stale-alert {
  width: 100%;
  background: #fff8e1;
  border-bottom: 1px solid #ffe082;
  color: #5a4100;
  font-size: 0.88rem;
}
.stale-alert-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
}
.stale-alert-icon { flex-shrink: 0; font-size: 1rem; }
.stale-alert-text { margin: 0; }
@media (max-width: 640px) {
  .stale-alert-inner { padding: 8px 12px; }
}

/* ----- Source-fout banner (rood, als ENTSO-E onbereikbaar en sample-data wordt getoond) ----- */
.source-alert {
  width: 100%;
  background: #fff0f0;
  border-bottom: 1px solid #ffb3b3;
  color: #7f1d1d;
  font-size: 0.88rem;
}
.source-alert-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
}
.source-alert-icon { flex-shrink: 0; font-size: 1rem; }
.source-alert-text { margin: 0; }
@media (max-width: 640px) {
  .source-alert-inner { padding: 8px 12px; }
}

/* ----- Negatieve-prijs banner (sticky bovenaan, alleen zichtbaar bij negatieve uren) ----- */
.neg-alert {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: linear-gradient(90deg, #1a7a31 0%, #2f9e44 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  font-size: 0.95rem;
  line-height: 1.45;
  min-height: 56px;
}
/* Header schuift onder de banner zodat ze niet overlappen.
   JS zet body.has-neg-alert wanneer de banner zichtbaar is. */
body.has-neg-alert .site-header { top: 56px; }
@media (max-width: 640px) {
  .neg-alert { min-height: 84px; }
  body.has-neg-alert .site-header { top: 84px; }
}
.neg-alert-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  min-height: inherit;
  box-sizing: border-box;
}
.neg-alert-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}
.neg-alert-text {
  margin: 0;
  flex: 1;
  font-weight: 500;
}
.neg-alert-close {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, border-color 0.12s;
}
.neg-alert-close:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.7);
}
.neg-alert-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
@media (max-width: 640px) {
  .neg-alert { font-size: 0.9rem; }
  .neg-alert-inner { padding: 10px 12px; gap: 10px; }
  .neg-alert-icon { font-size: 1.2rem; }
}

/* ----- Aanbieders-prijsvergelijking (sectie #aanbieders) ----- */
/* .suppliers-section padding wordt afgehandeld door het gezamenlijke sectie-blok hierboven (#62) */
.suppliers-table-wrap {
  overflow-x: auto;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-height: 380px;
}
.suppliers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.suppliers-table thead th {
  text-align: left;
  font-weight: 600;
  color: var(--c-text-soft);
  background: #f7fafc;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  font-size: 0.85rem;
  vertical-align: bottom;
}
.suppliers-table thead th small {
  display: block;
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--c-text-mute);
  margin-top: 2px;
}
.suppliers-table .th-price,
.suppliers-table .th-markup,
.suppliers-table .th-fixed { text-align: right; }
.suppliers-table tbody tr {
  border-bottom: 1px solid var(--c-border);
  transition: background 0.1s;
}
.suppliers-table tbody tr:last-child { border-bottom: none; }
.suppliers-table tbody tr:hover { background: #fafcfe; }
.suppliers-table tbody tr.is-mine {
  background: #f0f6fc;
  font-weight: 500;
}
.suppliers-table tbody tr.is-mine:hover { background: #e3eef9; }
.suppliers-table td {
  padding: 12px 16px;
  vertical-align: middle;
}
.suppliers-table .td-supplier { color: var(--c-text); }
.suppliers-table .td-supplier a {
  color: var(--c-brand);
  text-decoration: none;
  font-weight: 500;
}
.suppliers-table .td-supplier a:hover { text-decoration: underline; }
.suppliers-table .td-price {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--c-text);
}
.suppliers-table .td-markup,
.suppliers-table .td-fixed {
  text-align: right;
  color: var(--c-text-soft);
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}
.suppliers-table .th-action,
.suppliers-table .td-action {
  text-align: right;
  width: 1%;
  white-space: nowrap;
}
.supplier-pick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 14px;
  border: 1px solid var(--c-brand);
  background: #fff;
  color: var(--c-brand);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.supplier-pick-btn:hover {
  background: var(--c-brand);
  color: #fff;
}
.supplier-pick-btn:focus-visible {
  outline: 2px solid var(--c-brand);
  outline-offset: 2px;
}
.supplier-pick-btn[disabled] {
  border-color: var(--c-border);
  background: transparent;
  color: var(--c-text-mute);
  cursor: default;
  font-weight: 400;
}
.supplier-pick-btn[disabled]:hover {
  background: transparent;
  color: var(--c-text-mute);
}
.suppliers-table .suppliers-loading {
  text-align: center;
  color: var(--c-text-mute);
  padding: 24px;
}
.supplier-mine-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--c-brand);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.suppliers-note {
  margin: 12px 4px 0;
  font-size: 0.85rem;
  color: var(--c-text-mute);
  line-height: 1.5;
}

/* Mobile: tabel klapt om naar kaarten per aanbieder */
@media (max-width: 640px) {
  .suppliers-table { font-size: 0.9rem; }
  .suppliers-table thead { display: none; }
  .suppliers-table, .suppliers-table tbody, .suppliers-table tr, .suppliers-table td { display: block; width: 100%; }
  .suppliers-table tbody tr {
    padding: 12px 16px;
    border-bottom: 1px solid var(--c-border);
  }
  .suppliers-table td { padding: 4px 0; text-align: left; }
  .suppliers-table .td-supplier { font-weight: 600; font-size: 1rem; padding-bottom: 6px; }
  .suppliers-table .td-price::before { content: "Prijs nu: "; color: var(--c-text-mute); font-weight: 400; }
  .suppliers-table .td-price { text-align: left; font-size: 1rem; }
  .suppliers-table .td-markup::before { content: "Opslag: "; color: var(--c-text-mute); font-weight: 400; }
  .suppliers-table .td-markup { text-align: left; }
  .suppliers-table .td-fixed::before { content: "Vast/maand: "; color: var(--c-text-mute); font-weight: 400; }
  .suppliers-table .td-fixed { text-align: left; }
  /* Kies-knop in de mobile-card-fallback: vol-breed onderaan de kaart, grotere tap-zone */
  .suppliers-table .td-action { padding-top: 10px; width: 100%; text-align: left; }
  .supplier-pick-btn { width: 100%; padding: 10px 14px; font-size: 0.95rem; }
}


/* ═══════════════════════════════════════════════════════════
   KENNISBANK — overzichtspagina & artikel-footers
   Alle klassen zijn .kb-* om conflicten te vermijden.
   ═══════════════════════════════════════════════════════════ */

/* Brede lay-out voor de overzichtspagina (ruimer dan .legal-page) */
.kb-page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

/* ── Hero ──────────────────────────────────────────────── */
.kb-hero {
  background: var(--c-brand-deep);
  color: #fff;
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 20px;
}
.kb-hero h1 {
  font-size: 1.85rem;
  font-weight: 800;
  margin: 0 0 5px;
  letter-spacing: -0.02em;
}
.kb-hero-sub {
  color: #a8c4dc;
  font-size: 0.97rem;
  margin: 0 0 16px;
  line-height: 1.5;
}
.kb-hero-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.kb-hero-chip {
  background: rgba(255,255,255,0.12);
  color: #d0e6f5;
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
}

/* ── Leerpad-stepper ────────────────────────────────────── */
.kb-leerpad {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 14px 18px 16px;
  margin-bottom: 28px;
}
.kb-leerpad-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--c-brand);
  margin-bottom: 10px;
}
.kb-leerpad-steps {
  display: flex;
  align-items: stretch;
  gap: 6px;
  flex-wrap: wrap;
}
.kb-leerpad-step {
  flex: 1;
  min-width: 140px;
  background: #f3f7fb;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-decoration: none;
  color: var(--c-text);
  border: 1px solid var(--c-border);
  transition: border-color 0.15s, background 0.15s;
}
.kb-leerpad-step:hover {
  border-color: var(--c-brand);
  background: #eaf2fa;
  text-decoration: none;
}
.kb-leerpad-step-n {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--c-brand);
  display: block;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.kb-leerpad-step-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--c-text);
}
.kb-leerpad-arrow {
  color: var(--c-text-mute);
  font-size: 1rem;
  flex-shrink: 0;
  align-self: center;
  padding: 0 2px;
}

/* ── Featured card ──────────────────────────────────────── */
.kb-featured {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-brand);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 36px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, border-left-color 0.15s;
}
.kb-featured:hover {
  box-shadow: var(--shadow-md);
  border-left-color: var(--c-brand-deep);
  text-decoration: none;
}
.kb-featured-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}
.kb-featured-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-brand);
  margin-bottom: 4px;
}
.kb-featured-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 5px;
  line-height: 1.35;
}
.kb-featured-desc {
  font-size: 0.88rem;
  color: var(--c-text-soft);
  line-height: 1.55;
  margin-bottom: 10px;
}
.kb-featured-meta {
  font-size: 0.78rem;
  color: var(--c-text-mute);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Categorie-sectie ────────────────────────────────────── */
.kb-cat {
  margin-bottom: 32px;
}
.kb-cat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--c-brand-deep);
  color: #fff;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.kb-cat-icon { font-size: 1.1rem; line-height: 1; }
.kb-cat-title {
  font-size: 0.9rem;
  font-weight: 700;
  flex: 1;
}
.kb-cat-count {
  font-size: 0.72rem;
  background: rgba(255,255,255,0.15);
  padding: 2px 8px;
  border-radius: 12px;
  color: rgba(255,255,255,0.8);
}

/* Kaartgrid binnen categorie — deelt één border via 1px gap op gekleurde achtergrond */
.kb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--c-border);
  border: 1px solid var(--c-border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  overflow: hidden;
}

/* ── Artikel-kaart ──────────────────────────────────────── */
.kb-card {
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.kb-card:hover {
  background: #f3f8fd;
  text-decoration: none;
}
.kb-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.kb-card-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--c-brand);
  line-height: 1.4;
}
/* Niveaubadges */
.kb-level {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.kb-level-begin { background: #d3f9d8; color: #1a6629; }
.kb-level-mid   { background: #fff3bf; color: #7d5a00; }
.kb-level-adv   { background: #ffe3e3; color: #9b2020; }

.kb-card-icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 7px;
}
.kb-card-title {
  font-size: 0.97rem;
  font-weight: 700;
  line-height: 1.38;
  margin-bottom: 6px;
  color: var(--c-text);
}
.kb-card-desc {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--c-text-soft);
  flex-grow: 1;
  /* Tekstafkapping na 3 regels */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kb-card-foot {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--c-border);
  padding-top: 9px;
}
.kb-card-time {
  font-size: 0.75rem;
  color: var(--c-text-mute);
}
.kb-card-cta {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-brand);
}
/* "Nieuw" badge — toon alleen bij artikelen < 30 dagen oud */
.kb-new-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--c-brand);
  color: #fff;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 5px;
  vertical-align: middle;
}

/* ── "Lees ook"-blok op artikelpagina's ─────────────────── */
.kb-lees-ook {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--c-border);
}
.kb-lees-ook-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--c-text-mute);
  margin-bottom: 12px;
}
.kb-lees-ook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.kb-lees-ook-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 13px;
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-brand);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  background: var(--c-surface);
  transition: border-left-color 0.15s, background 0.15s;
}
.kb-lees-ook-card:hover {
  border-left-color: var(--c-brand-deep);
  background: #f3f8fd;
  text-decoration: none;
}
.kb-lees-ook-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-brand);
}
.kb-lees-ook-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--c-text);
}
.kb-lees-ook-meta {
  font-size: 0.72rem;
  color: var(--c-text-mute);
  margin-top: 3px;
}

/* ── Mobiele aanpassingen ────────────────────────────────── */
@media (max-width: 640px) {
  .kb-hero { padding: 18px 16px; }
  .kb-hero h1 { font-size: 1.45rem; }
  .kb-leerpad-steps { flex-direction: column; gap: 8px; }
  .kb-leerpad-arrow { transform: rotate(90deg); align-self: center; }
  .kb-leerpad-step { min-width: 0; }
  .kb-featured { flex-direction: column; gap: 10px; padding: 14px 16px; }
  .kb-featured-icon { font-size: 1.8rem; }
  .kb-grid { grid-template-columns: 1fr; }
  .kb-lees-ook-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════
   Morgen-pagina (/morgen)
   ══════════════════════════════════════════════════════════ */

/* Hero */
.morgen-hero {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding: 32px 0 28px;
}
.morgen-breadcrumb {
  font-size: 0.85rem;
  color: var(--c-text-mute);
  margin: 0 0 16px;
}
.morgen-breadcrumb a { color: var(--c-text-mute); }
.morgen-breadcrumb a:hover { color: var(--c-brand); }

#morgen-h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.2;
}
.morgen-subtitle {
  font-size: 0.9rem;
  color: var(--c-text-soft);
  margin: 0 0 20px;
}
.morgen-compare {
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--c-text-soft);
  min-height: 1.4em;
}
.morgen-compare.is-cheaper { color: var(--c-cheap); }
.morgen-compare.is-pricier { color: var(--c-pricey); }

/* Highlight cards */
.morgen-highlights {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 20px;
}
.morgen-highlight {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: center;
}
.morgen-highlight.is-free {
  background: var(--c-free-bg);
  border-color: var(--c-free);
}
.morgen-highlight-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-mute);
  margin: 0 0 6px;
}
.morgen-highlight-value {
  display: block;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1.1;
}
.morgen-hl-pricey { color: var(--c-pricey); }
.morgen-highlight.is-free .morgen-highlight-value { color: var(--c-free); }
.morgen-highlight-sub {
  font-size: 0.78rem;
  color: var(--c-text-soft);
  margin: 5px 0 0;
}

/* Secties */
.morgen-section {
  padding: 40px 0;
  border-bottom: 1px solid var(--c-border);
}
.morgen-section:last-child { border-bottom: none; }

/* Chart */
.morgen-chart-wrap {
  position: relative;
  height: 280px;
  margin-top: 20px;
}

/* Legenda */
.morgen-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--c-text-soft);
}
.morgen-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.morgen-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Tip-box */
.morgen-tip-box {
  background: var(--c-cheap-bg);
  border: 1px solid var(--c-cheap);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 16px;
  font-size: 0.95rem;
  color: var(--c-text);
  line-height: 1.5;
}

/* Apparaten-tips grid */
.morgen-apparaten-tips { margin-top: 32px; }
.morgen-apparaten-tips h3 { margin: 0 0 14px; font-size: 1rem; }
.morgen-tips-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.morgen-tip-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 0.9rem;
}
.morgen-tip-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.95rem;
}
.morgen-tip-card p {
  margin: 0;
  color: var(--c-text-soft);
  line-height: 1.55;
  font-size: 0.875rem;
}
.morgen-tip-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 8px;
  line-height: 1;
}

/* Aanbieder-tabel (morgen-variant: geen actie-kolom) */
.morgen-suppliers-wrap { min-height: auto; }
.morgen-td-avg { text-align: right; font-weight: 600; }

/* ── Morgen samengevat (prose summary-box in hero) ── */
.morgen-summary-box {
  margin: 20px 0 4px;
  padding: 14px 18px;
  border-radius: var(--radius);
  border-left: 4px solid var(--c-brand);
  background: color-mix(in srgb, var(--c-brand) 6%, var(--c-bg));
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--c-text);
}
.morgen-summary-box strong { font-weight: 600; }
/* Kleurvarianten per classificatie */
.morgen-summary-negative  { border-left-color: #7048e8; background: color-mix(in srgb, #7048e8 7%, var(--c-bg)); }
.morgen-summary-very_cheap { border-left-color: #1a7a31; background: color-mix(in srgb, #1a7a31 7%, var(--c-bg)); }
.morgen-summary-cheap      { border-left-color: #2f9e44; background: color-mix(in srgb, #2f9e44 6%, var(--c-bg)); }
.morgen-summary-normal     { border-left-color: var(--c-brand); background: color-mix(in srgb, var(--c-brand) 6%, var(--c-bg)); }
.morgen-summary-pricey     { border-left-color: #c92a2a; background: color-mix(in srgb, #c92a2a 6%, var(--c-bg)); }
.morgen-summary-very_pricey { border-left-color: #9c1a1a; background: color-mix(in srgb, #9c1a1a 7%, var(--c-bg)); }

/* ── Vandaag vs. Morgen vergelijkingstabel ── */
.morgen-cmp-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.morgen-cmp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.morgen-cmp-table thead th {
  text-align: left;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-text-mute);
  border-bottom: 2px solid var(--c-border);
}
.morgen-cmp-table thead .cmp-th-today,
.morgen-cmp-table thead .cmp-th-tomorrow { text-align: right; }
.morgen-cmp-table thead .cmp-th-diff { text-align: center; }

.morgen-cmp-table tbody tr { border-bottom: 1px solid var(--c-border); }
.morgen-cmp-table tbody tr:last-child { border-bottom: none; }
.morgen-cmp-table tbody tr:hover { background: var(--c-surface); }

.cmp-row-label {
  padding: 11px 12px;
  font-weight: 500;
  color: var(--c-text);
  text-align: left;
  white-space: nowrap;
}
.cmp-today, .cmp-tomorrow {
  padding: 11px 12px;
  text-align: right;
  color: var(--c-text);
  white-space: nowrap;
}
.cmp-diff {
  padding: 11px 12px;
  text-align: center;
  font-size: 0.85rem;
  white-space: nowrap;
}
.cmp-arrow { font-size: 0.9rem; margin-left: 4px; font-weight: 700; }
.cmp-better { color: #1e7b34; }
.cmp-worse  { color: #c92a2a; }
.cmp-neutral { color: var(--c-text-mute); }
.cmp-diff-better { color: #1e7b34; font-weight: 600; }
.cmp-diff-worse  { color: #c92a2a; font-weight: 600; }

/* ── Prijsanalyse als nieuwsbericht ── */
.morgen-news-article {
  max-width: 72ch;
}
.morgen-news-lead {
  font-size: 1.05rem;
  line-height: 1.7;
  margin-top: 0;
  margin-bottom: 16px;
  color: var(--c-text);
}
.morgen-news-article p {
  font-size: 0.97rem;
  line-height: 1.75;
  margin-bottom: 14px;
  color: var(--c-text);
}
.morgen-news-article strong { font-weight: 600; }
.morgen-news-model {
  font-size: 0.86rem !important;
  color: var(--c-text-mute) !important;
  border-top: 1px solid var(--c-border);
  padding-top: 12px;
  margin-top: 6px;
}
.morgen-news-model a { color: var(--c-brand); }

/* Oude waarom-stijlen (backward compat, niet meer actief gebruikt) */
.morgen-why-note {
  font-size: 0.82rem;
  color: var(--c-text-mute);
  margin-top: 10px;
}

/* FAQ */
.morgen-faq-item {
  border-bottom: 1px solid var(--c-border);
  padding: 20px 0;
}
.morgen-faq-item:first-child { padding-top: 0; }
.morgen-faq-item:last-child { border-bottom: none; }
.morgen-faq-item h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--c-text);
  font-weight: 600;
}
.morgen-faq-item p {
  margin: 0;
  color: var(--c-text-soft);
  font-size: 0.92rem;
  line-height: 1.65;
}

/* Lees-ook / gerelateerd */
.morgen-related { background: var(--c-bg); }
.morgen-related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.morgen-related-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: block;
  text-decoration: none;
  color: var(--c-text);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.morgen-related-card:hover {
  border-color: var(--c-brand);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.morgen-related-icon {
  font-size: 1.4rem;
  display: block;
  margin-bottom: 8px;
  line-height: 1;
}
.morgen-related-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 0.95rem;
}
.morgen-related-card p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--c-text-soft);
  line-height: 1.5;
}

/* No-data state */
.morgen-no-data {
  text-align: center;
  padding: 80px 20px;
}
.morgen-no-data-icon {
  font-size: 3rem;
  margin: 0 0 16px;
}
.morgen-no-data h2 { margin: 0 0 12px; }
.morgen-no-data p { color: var(--c-text-soft); max-width: 480px; margin: 0 auto 12px; }

/* Controls: leverancier-select + mode-toggle naast elkaar */
.morgen-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.morgen-control-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.morgen-control-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-text-soft);
  white-space: nowrap;
}
.morgen-supplier-select {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--c-text);
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 7px 32px 7px 12px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235d6f80' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  max-width: 320px;
}
.morgen-supplier-select:focus {
  outline: 2px solid var(--c-brand);
  outline-offset: 1px;
  border-color: var(--c-brand);
}

/* Grafiek-header: heading links, kwartier-toggle rechts */
.morgen-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* Kwartier-toggle (checkbox met toggle-track look) */
.morgen-quarter-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding-top: 4px;
}
.morgen-quarter-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-text-soft);
  cursor: pointer;
  user-select: none;
}
.morgen-quarter-label:hover { color: var(--c-text); }
.morgen-quarter-cb {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.morgen-quarter-track {
  display: inline-flex;
  width: 40px;
  height: 22px;
  background: var(--c-border);
  border-radius: 999px;
  flex-shrink: 0;
  position: relative;
  transition: background 0.2s;
}
.morgen-quarter-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}
.morgen-quarter-cb:checked + .morgen-quarter-track {
  background: var(--c-brand);
}
.morgen-quarter-cb:checked + .morgen-quarter-track::after {
  transform: translateX(18px);
}
.morgen-quarter-cb:focus-visible + .morgen-quarter-track {
  outline: 2px solid var(--c-brand);
  outline-offset: 2px;
}

/* ── Morgen mobiel ──── */
@media (max-width: 880px) {
  .morgen-tips-grid { grid-template-columns: 1fr 1fr; }
  .morgen-related-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  #morgen-h1 { font-size: 1.35rem; }
  .morgen-highlights { grid-template-columns: 1fr 1fr; }
  .morgen-highlight-value { font-size: 1.3rem; }
  .morgen-chart-wrap { height: 200px; }
  .morgen-tips-grid { grid-template-columns: 1fr; }
  .morgen-related-grid { grid-template-columns: 1fr; }
  .morgen-section { padding: 28px 0; }
  .morgen-controls { flex-direction: column; align-items: flex-start; gap: 12px; }
  .morgen-supplier-select { max-width: 100%; width: 100%; }
  .morgen-chart-head { flex-direction: column; gap: 12px; }

  /* Summary-box op mobiel */
  .morgen-summary-box { font-size: 0.9rem; padding: 12px 14px; margin: 16px 0 4px; }

  /* Vergelijkingstabel op mobiel: label smaller, kolommen compacter */
  .cmp-row-label { font-size: 0.82rem; padding: 9px 8px; white-space: normal; }
  .cmp-today, .cmp-tomorrow, .cmp-diff { font-size: 0.82rem; padding: 9px 6px; }

  /* Nieuwsartikel op mobiel */
  .morgen-news-lead { font-size: 0.97rem; }
  .morgen-news-article { max-width: 100%; }
}
