:root {
  --primary: #1a5276;
  --primary-light: #2980b9;
  --primary-bg: #eaf2f8;
  --accent: #e67e22;
  --accent-light: #f39c12;
  --success: #27ae60;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --text: #2c3e50;
  --text-light: #7f8c8d;
  --border: #dce1e6;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
}

[data-theme="dark"] {
  --primary: #5dade2;
  --primary-light: #85c1e9;
  --primary-bg: #1a2a3a;
  --accent: #e67e22;
  --accent-light: #f39c12;
  --success: #2ecc71;
  --bg: #12151a;
  --surface: #1e2228;
  --text: #dce6f0;
  --text-light: #7f8c9a;
  --border: #2e3440;
  --shadow: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.5);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 28px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 4px;
}

header h1 {
  font-size: 2rem;
  color: var(--primary);
  margin: 0;
}

.dark-mode-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.dark-mode-btn:hover {
  background: var(--primary-bg);
  border-color: var(--primary-light);
}

.subtitle {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* Full-width form card */
.form-card-full {
  grid-column: 1 / -1;
}

/* Accordion panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.panel-header:hover {
  background: var(--primary-bg);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.panel-title h2 {
  font-size: 1.3rem;
  color: var(--primary);
  margin: 0;
}

.panel-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.panel.collapsed .panel-number {
  background: var(--success);
}

.panel-summary {
  flex: 1;
  text-align: right;
  font-size: 0.85rem;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.panel-chevron {
  font-size: 1.2rem;
  color: var(--text-light);
  transition: transform 0.3s;
  flex-shrink: 0;
}

.panel.collapsed .panel-chevron {
  transform: rotate(-90deg);
}

.panel-body {
  padding: 0 20px 20px;
  transition: all 0.3s ease;
}

.panel-body > p {
  color: var(--text-light);
  margin-bottom: 20px;
}

.panel.collapsed .panel-body {
  display: none;
}

.start-btn-wrap {
  text-align: center;
  padding: 24px 0;
}

.start-btn-wrap .hidden {
  display: none;
}

/* Form grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.form-card label {
  display: block;
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

/* Stepper */
.stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.stepper-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: var(--surface);
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s;
}

.stepper-btn:hover {
  background: var(--primary-bg);
}

.stepper input {
  width: 56px;
  height: 44px;
  border: none;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  background: transparent;
  -moz-appearance: textfield;
}

.stepper input::-webkit-inner-spin-button,
.stepper input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

/* Toggle */
.toggle-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toggle-btn {
  flex: 1;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s;
  min-width: 0;
}

.toggle-btn:hover {
  border-color: var(--primary-light);
}

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

.toggle-btn small {
  display: block;
  font-weight: 400;
  font-size: 0.75rem;
  margin-top: 2px;
}

/* Mode hint */
.mode-hint {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.4;
}

/* Custom days */
.custom-days {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.custom-days.hidden {
  display: none;
}

.custom-days .stepper {
  flex: 0 0 auto;
}

.custom-days-label {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 600;
}

/* Scenario grid */
.scenario-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.scenario-card {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.scenario-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-lg);
}

.scenario-card.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.scenario-card .icon {
  font-size: 2rem;
  margin-bottom: 8px;
  display: block;
}

.scenario-card .name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.scenario-card .desc {
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.4;
}

.scenario-card .sc-detail {
  font-size: 0.78rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  opacity: 0.85;
}

/* Scenario tooltip balloon — fixed div appended to body so overflow:hidden panels can't clip it */
.sc-tooltip {
  position: fixed;
  width: 240px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.78rem;
  line-height: 1.5;
  font-weight: 400;
  padding: 10px 13px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 9000;
  white-space: normal;
}
.sc-tooltip.visible {
  opacity: 1;
  visibility: visible;
}
/* Arrow pointing down (tooltip is above card) */
.sc-tooltip[data-dir="above"]::after {
  content: "";
  position: absolute;
  top: 100%;
  left: var(--arrow-left, 50%);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--text);
}
/* Arrow pointing up (tooltip is below card) */
.sc-tooltip[data-dir="below"]::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: var(--arrow-left, 50%);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: var(--text);
}

/* Buttons */
.btn {
  padding: 12px 28px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn.primary {
  background: var(--primary);
  color: white;
}

.btn.primary:hover {
  background: var(--primary-light);
}

.btn.danger {
  background: var(--surface);
  color: #c0392b;
  border: 1px solid #e6b0aa;
}

.btn.danger:hover {
  background: #fdedec;
  border-color: #c0392b;
}

/* Panel actions */
.panel-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

/* Preparedness overview */
.preparedness-overview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 28px;
  margin-bottom: 24px;
}

.prep-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  transition: border-color 0.3s;
}

.prep-card.complete {
  border-color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, var(--bg));
}

.prep-card .prep-icon {
  font-size: 1rem;
  margin-bottom: 2px;
}

.prep-card .prep-label {
  font-size: 0.68rem;
  color: var(--text-light);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.prep-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.prep-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
  background: var(--primary-light);
}

.prep-bar-fill.high { background: var(--success); }
.prep-bar-fill.mid { background: var(--accent); }
.prep-bar-fill.low { background: #e74c3c; }

.prep-pct {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
}

/* Shopping list */
.category-group {
  margin-bottom: 24px;
}

.shopping-list-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

.shopping-list-columns[data-cols="2"] {
  grid-template-columns: 1fr 1fr;
}

.shopping-list-columns[data-cols="3"] {
  grid-template-columns: 1fr 1fr 1fr;
}

.shopping-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--primary-bg);
}

.category-pct {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 10px;
  background: var(--primary-bg);
  color: var(--primary);
}

.category-pct.complete {
  background: color-mix(in srgb, var(--success) 12%, var(--bg));
  color: var(--success);
}

.list-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-bg);
  border-top: 3px solid var(--primary);
  border-radius: 6px;
  padding: 10px 14px;
  margin: 20px 0 12px;
}

.section-counter {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.list-section-header:first-child {
  margin-top: 0;
}

.list-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  transition: background 0.15s;
}

.list-item.checked {
  background: var(--border);
}

.list-item.checked .item-name {
  text-decoration: line-through;
  color: var(--text-light);
}

.list-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--success);
  cursor: pointer;
  flex-shrink: 0;
}

.list-item .item-name {
  flex: 1;
  font-size: 0.95rem;
}

.list-item .item-name-clickable {
  cursor: pointer;
}

.list-item .item-name a {
  color: var(--primary-light);
  text-decoration: none;
  border-bottom: 1px dotted var(--primary-light);
  transition: color 0.15s;
}

.list-item .item-name a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.list-item .item-qty {
  font-weight: 600;
  color: var(--primary);
  font-size: 0.9rem;
  white-space: nowrap;
}

/* Info button */
.item-info-btn {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: var(--text-light);
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  line-height: 24px;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
}

.item-info-btn:hover,
.item-info-btn.active {
  color: var(--primary);
  background: var(--primary-bg);
}

/* Shop button */
.item-shop-btn {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  line-height: 24px;
  border-radius: 50%;
  transition: background 0.15s;
}

.item-shop-btn:hover,
.item-shop-btn.active {
  background: var(--primary-bg);
}

/* Info box (help text + links) */
.item-info-box {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 6px;
  order: 99;
}

.item-info-help {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-light);
  margin: 0;
}

.item-info-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.item-info-help + .item-info-links {
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.item-info-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--primary-light);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  transition: border-color 0.15s, color 0.15s;
}

.item-info-link:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.item-info-link::before {
  content: "\1F6D2";
  font-size: 0.75rem;
}

.list-item .item-scenario {
  font-size: 0.7rem;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  order: 98;
  width: 100%;
}

/* List actions */
.list-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.copy-feedback {
  color: var(--success);
  font-weight: 600;
  font-size: 0.9rem;
  transition: opacity 0.3s;
}

.copy-feedback.hidden {
  opacity: 0;
}

/* Footer */
.site-footer {
  max-width: 720px;
  margin: 48px auto 0;
  padding: 0 16px 48px;
  border-top: 1px solid var(--border);
}

.footer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  cursor: pointer;
  user-select: none;
}

.footer-header:hover h2 {
  color: var(--primary-light);
}

.footer-chevron {
  font-size: 1rem;
  color: var(--text-light);
  transition: transform 0.25s;
  flex-shrink: 0;
}

.site-footer.collapsed .footer-chevron {
  transform: rotate(-90deg);
}

.site-footer.collapsed .footer-body {
  display: none;
}

.site-footer h2 {
  font-size: 1.1rem;
  color: var(--primary);
  margin: 0;
  transition: color 0.15s;
}

.site-footer p {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-light);
  margin-bottom: 10px;
}

.site-footer p:last-child {
  margin-bottom: 0;
}

.footer-privacy {
  font-size: 0.82rem !important;
  opacity: 0.75;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 16px;
}

.footer-disclaimer {
  font-size: 0.82rem !important;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 16px;
  color: var(--text-light);
  opacity: 0.85;
}

/* Wide screens */
@media (min-width: 900px) {
  .app {
    max-width: 1280px;
  }

  .scenario-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1400px) {
  .app {
    max-width: 1400px;
  }
}

/* Responsive */
@media (max-width: 600px) {
  .app {
    padding: 16px 12px 32px;
  }

  header h1 {
    font-size: 1.4rem;
  }

  .dark-mode-btn {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .panel-header {
    padding: 14px 16px;
  }

  .panel-body {
    padding: 0 16px 16px;
  }

  .panel-title h2 {
    font-size: 1.1rem;
  }

  .panel-summary {
    font-size: 0.78rem;
  }

  .form-grid,
  .scenario-grid {
    grid-template-columns: 1fr;
  }

  .preparedness-overview {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .form-card-full .toggle-group {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    text-align: center;
  }
}

/* Intro banner (dismissible) */
.intro-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 18px 44px 18px 20px;
  margin-bottom: 20px;
  position: relative;
  box-shadow: var(--shadow);
}

.intro-banner.hidden {
  display: none;
}

.intro-banner-title {
  font-size: 1.05rem;
  color: var(--primary);
  margin-bottom: 10px;
}

.intro-banner p {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.65;
  margin-bottom: 8px;
}

.intro-banner p:last-child {
  margin-bottom: 0;
}

.intro-banner p strong {
  color: var(--text);
}

.intro-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 0.95rem;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
  padding: 0;
}

.intro-close-btn:hover {
  background: var(--primary-bg);
  color: var(--text);
}

/* Panel intro blocks */
.panel-intro {
  margin-bottom: 20px;
}

.panel-intro > p {
  color: var(--text-light);
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 10px;
}

.panel-intro-list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.panel-intro-list li {
  font-size: 0.85rem;
  color: var(--text-light);
  padding: 7px 10px;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
  line-height: 1.4;
}

.panel-intro-list li strong {
  color: var(--text);
}

.panel-intro-note {
  font-size: 0.8rem !important;
  color: var(--text-light) !important;
  font-style: italic;
  margin-bottom: 0 !important;
  opacity: 0.85;
}

/* List type info: kopen vs regelen (dismissible) */
.list-type-info {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 40px 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
}

.list-type-info.hidden {
  display: none;
}

.list-type-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  flex: 1;
}

.list-type-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  line-height: 1.3;
}

.list-type-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 2px;
}

.list-type-desc {
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.45;
  display: block;
}

.list-type-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 0.9rem;
  cursor: pointer;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
  padding: 0;
}

.list-type-close:hover {
  background: var(--primary-bg);
  color: var(--text);
}

@media (max-width: 600px) {
  .list-type-info {
    flex-direction: column;
    gap: 10px;
  }
}

.print-scenarios {
  display: none;
}

/* Print */
@media print {
  body {
    background: white;
  }

  .app {
    max-width: none;
    padding: 0;
  }

  /* Hide everything except the shopping list panel */
  #panel-1,
  #panel-2,
  .intro-banner,
  .list-type-info,
  .list-actions,
  .preparedness-overview,
  .item-info-btn,
  .item-shop-btn,
  .item-info-box,
  .site-footer,
  .changelog-wrapper {
    display: none !important;
  }

  #panel-3 {
    border: none;
    box-shadow: none;
  }

  #panel-3 .panel-header {
    padding: 0 0 8px;
  }

  #panel-3 .panel-number,
  #panel-3 .panel-chevron {
    display: none;
  }

  .print-scenarios {
    display: block;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 8px;
  }

  /* Always show the body even if collapsed */
  #panel-3.collapsed .panel-body {
    display: block !important;
  }

  #panel-3 .panel-body {
    padding: 0;
  }

  .shopping-list-columns {
    grid-template-columns: 1fr 1fr !important;
    gap: 16px;
  }

  .category-group {
    break-inside: avoid;
    margin-bottom: 16px;
  }

  .list-item {
    padding: 4px 8px;
    margin-bottom: 3px;
    border: 1px solid #ccc;
    font-size: 0.85rem;
  }

  .list-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
  }

  .list-item.checked .item-name {
    text-decoration: line-through;
    color: #999;
  }

  .list-item .item-name a {
    color: inherit;
    text-decoration: none;
    border: none;
  }
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 300px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--success);
  border-radius: 10px;
  padding: 14px 16px 12px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
}

.toast.hidden {
  display: none;
}

.toast.toast-action {
  border-left-color: var(--accent);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(32px); }
}

.toast.toast-entering {
  animation: toast-in 0.25s ease-out forwards;
}

.toast.toast-leaving {
  animation: toast-out 0.3s ease-in forwards;
}

.toast-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.toast-message {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  margin: 0;
  white-space: pre-line;
}

.toast-close-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  margin-top: 1px;
  transition: color 0.15s;
}

.toast-close-btn:hover {
  color: var(--text);
}

.toast-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.toast-footer.hidden {
  display: none;
}

.btn.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.toast-mute-btn {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 0.8rem;
  padding: 4px 0;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s;
}

.toast-mute-btn:hover {
  color: var(--text);
}

@media (max-width: 600px) {
  .toast {
    bottom: 16px;
    right: 16px;
    left: 16px;
    width: auto;
  }
}

/* === Subtle animations === */

/* Row bounce when checking a checkbox */
@keyframes item-check-pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.025); }
  100% { transform: scale(1); }
}
.list-item.just-checked {
  animation: item-check-pop 0.22s ease-out;
}

/* Scenario card micro-bounce on select/deselect */
@keyframes scenario-toggle-bounce {
  0%   { transform: scale(1); }
  35%  { transform: scale(0.94); }
  70%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}
.scenario-card.just-toggled {
  animation: scenario-toggle-bounce 0.22s ease-out;
}

/* Panel body fade + slide when opening */
@keyframes panel-body-open {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.panel-body.panel-opening {
  animation: panel-body-open 0.35s ease-out;
}

/* Panel body closing animation */
@keyframes panel-body-close {
  from { opacity: 1; max-height: 2000px; }
  to   { opacity: 0; max-height: 0; }
}
.panel-body.panel-closing {
  animation: panel-body-close 0.4s ease-in forwards;
  overflow: hidden;
}

/* Prep card glow + scale pulse when reaching 100% */
@keyframes prep-complete-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.6); transform: scale(1); }
  45%  { box-shadow: 0 0 0 10px rgba(39, 174, 96, 0); transform: scale(1.1); }
  100% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0); transform: scale(1); }
}
.prep-card.just-complete {
  animation: prep-complete-pulse 0.55s ease-out;
}

/* Category % badge flash when first hitting 100% */
@keyframes cat-pct-complete {
  0%   { background: var(--success); color: white; transform: scale(1.2); }
  100% { background: color-mix(in srgb, var(--success) 12%, var(--bg)); color: var(--success); transform: scale(1); }
}
.category-pct.flash-complete {
  animation: cat-pct-complete 0.5s ease-out;
}

/* Stepper value bump */
@keyframes stepper-val-bump {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}
.stepper input.just-bumped {
  animation: stepper-val-bump 0.18s ease-out;
}

/* Reset button confirming state */
@keyframes reset-btn-shake {
  0%, 100% { transform: translateX(0); }
  18%       { transform: translateX(-5px); }
  36%       { transform: translateX(5px); }
  54%       { transform: translateX(-4px); }
  72%       { transform: translateX(4px); }
  88%       { transform: translateX(-2px); }
}
#reset-btn.confirming {
  background: #c0392b;
  color: white;
  border-color: #c0392b;
  animation: reset-btn-shake 0.35s ease-out;
}
#reset-btn.confirming:hover {
  background: #a93226;
  border-color: #a93226;
}

/* Changelog */
.changelog-wrapper {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 32px;
}

.changelog {
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.changelog-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
  user-select: none;
  list-style: none;
  transition: color 0.15s;
}

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

.changelog-summary::after {
  content: "▾";
  margin-left: auto;
  font-size: 1rem;
  color: var(--text-light);
  transition: transform 0.25s;
}

.changelog[open] .changelog-summary::after {
  transform: rotate(180deg);
}

.changelog-summary:hover {
  color: var(--primary);
}

.changelog-body {
  padding: 0 0 8px;
  border-top: 1px solid var(--border);
}

.changelog-list {
  margin: 0;
  padding: 0;
}

.changelog-list dt {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 10px;
  margin-bottom: 2px;
}

.changelog-list dt:first-child {
  margin-top: 8px;
}

.changelog-list dd {
  font-size: 0.75rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-left: 0;
  padding-left: 12px;
  border-left: 2px solid var(--border);
  margin-bottom: 2px;
}

.changelog-list dd em {
  color: var(--text);
  font-style: normal;
  font-weight: 600;
}


/* Voorbereidingsscore */
.score-section {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 28px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.score-ring-wrap {
  position: relative;
  flex-shrink: 0;
  width: 80px;
  height: 80px;
}

.score-ring {
  width: 80px;
  height: 80px;
  transform: rotate(-90deg);
}

.score-ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.score-ring-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
}
.score-ring-fill.high { stroke: var(--success); }
.score-ring-fill.mid  { stroke: var(--accent); }
.score-ring-fill.low  { stroke: #e74c3c; }

.score-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.score-text {
  flex: 1;
  min-width: 0;
}

.score-heading {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.score-sub {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 12px;
}

.score-share-btn {
  font-size: 13px;
  padding: 6px 14px;
}

@media print { .score-section { display: none; } }

/* Item uncheck cascade (animated reset) */
@keyframes item-uncheck-cascade {
  from { opacity: 1; }
  to   { opacity: 0.3; }
}
.list-item.unchecking {
  animation: item-uncheck-cascade 0.15s ease-out forwards;
}
