:root {
  --bg: #000000;
  --bg-card: #141414;
  --bg-hover: #1e1e1e;
  --text: #f0ebe3;
  --text-muted: #8a8278;
  --input-bg: var(--bg-card);
  --input-text: var(--text);
  --input-placeholder: var(--text-muted);
  --input-focus-bg: var(--bg-hover);
  --accent: #5a9e6f;
  --accent-light: #1a2e1f;
  --accent-dark: #7ec492;
  --border: #2a2a2a;
  --icon-btn-bg: #0a0a0a;
  --icon-btn-border: var(--border);
  --icon-btn-color: var(--text-muted);
  --icon-btn-hover-border: rgba(255, 255, 255, 0.12);
  --icon-btn-active-bg: rgba(11, 26, 16, 0.45);
  --icon-btn-active-border: rgba(255, 255, 255, 0.28);
  --icon-btn-active-color: #ffffff;
  --tab-bar-bg: #0a0a0a;
  --tab-inactive-color: var(--text-muted);
  --tab-active-bg: var(--accent);
  --tab-active-color: #0b1a10;
  --tab-border: var(--border);
  --favorite-active-bg: #2a1818;
  --favorite-active-border: #7a4040;
  --favorite-active-color: #e8a0a0;
  --favorite-active-hover-color: #f0b0b0;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --radius: 14px;
  --radius-sm: 8px;
  --font-serif: "DM Serif Display", Georgia, serif;
  --font-sans: "Outfit", system-ui, sans-serif;
}

input::placeholder,
textarea::placeholder {
  color: var(--input-placeholder);
  opacity: 1;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

/* Header */
.header {
  margin-bottom: 2rem;
}

.header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.brand h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 300;
  margin-top: 0.15rem;
}

.btn-today {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-dark);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}

.btn-today:hover {
  background: #243528;
}

.btn-today:active {
  transform: scale(0.97);
}

/* Week navigation */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

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

.week-picker {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 140px;
  justify-content: center;
}

.week-label {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-muted);
}

.week-input {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 400;
  width: 72px;
  text-align: center;
  border: none;
  background: transparent;
  color: var(--text);
  -moz-appearance: textfield;
  line-height: 1;
}

.week-input::-webkit-outer-spin-button,
.week-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.week-input:focus {
  outline: none;
}

.year-label {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
}

.week-range {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.65rem;
  font-weight: 300;
}

/* Main layout */
.main {
  max-width: 720px;
  margin: 0 auto;
}

/* Panels */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}

.panel-header h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 400;
}

.panel-badge {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-dark);
  background: var(--accent-light);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.view-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  background: var(--tab-bar-bg);
  border: 1px solid var(--tab-border);
  width: 100%;
}

.view-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--tab-inactive-color);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.7rem 1rem;
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.view-tab svg {
  opacity: 0.65;
}

.view-tab:hover:not(.active) {
  color: var(--text);
  background: var(--bg-hover);
  border-color: var(--tab-border);
}

.view-tab.active {
  background: var(--tab-active-bg);
  color: var(--tab-active-color);
  border-color: #6fbf87;
  box-shadow: 0 2px 10px rgba(90, 158, 111, 0.35);
}

.view-tab.active svg {
  opacity: 1;
}

.view-hidden {
  display: none !important;
}

.shopping-overview {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.day-shopping-link {
  margin: -0.15rem 0 0 6.5rem;
  border: none;
  background: transparent;
  color: var(--accent-dark);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-align: left;
}

.day-shopping-link:hover {
  color: var(--accent);
}

.shopping-overview-empty {
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 1rem 0;
}

.store-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.store-filter {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.store-filter:hover:not(.active) {
  color: var(--text);
  border-color: var(--accent);
}

.store-filter.active {
  background: var(--accent-light);
  color: var(--accent-dark);
  border-color: var(--accent);
}

.shopping-overview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.shopping-category {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  overflow: hidden;
}

.shopping-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border);
}

.shopping-category-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 400;
}

.shopping-category-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.shopping-list-overview {
  padding: 0.35rem 0.5rem 0.5rem;
}

.item-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.item-day-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* Meals grid */
.meals-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.day-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.day-block.today {
  position: relative;
}

.day-block.today::before {
  content: "";
  position: absolute;
  left: -1.25rem;
  top: 0.25rem;
  bottom: 0.25rem;
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.meal-row {
  display: grid;
  grid-template-columns: 90px 1fr 36px 36px 40px;
  gap: 0.75rem;
  align-items: start;
}

.meal-day {
  padding-top: 0.65rem;
}

.day-name {
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
}

.day-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  opacity: 0.92;
}

.day-block.today .day-name {
  color: var(--accent-dark);
}

.meal-input {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.45;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--input-text);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  resize: none;
  min-height: 44px;
  overflow-wrap: break-word;
  word-wrap: break-word;
  white-space: pre-wrap;
  overflow-x: hidden;
  overflow-y: hidden;
}

.meal-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(90, 158, 111, 0.2);
  background: var(--input-focus-bg);
}

.meal-row.followed .meal-input {
  border-color: var(--accent);
  opacity: 0.75;
}

.btn-find-recipe {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-top: 0.55rem;
  border: 1px solid var(--icon-btn-border);
  border-radius: var(--radius-sm);
  background: var(--icon-btn-bg);
  color: var(--icon-btn-color);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-find-recipe svg {
  opacity: 0.92;
}

.btn-find-recipe:hover {
  background: var(--accent-light);
  color: var(--accent-dark);
  border-color: var(--accent);
}

.btn-find-recipe:disabled {
  opacity: 0.5;
  cursor: wait;
}

.btn-favorite-meal {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-top: 0.55rem;
  border: 1px solid var(--icon-btn-border);
  border-radius: var(--radius-sm);
  background: var(--icon-btn-bg);
  color: var(--icon-btn-color);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-favorite-meal svg {
  opacity: 0.92;
}

.btn-favorite-meal:hover {
  background: var(--accent-light);
  color: var(--accent-dark);
  border-color: var(--accent);
}

.btn-favorite-meal.active svg {
  opacity: 1;
}

.btn-favorite-meal.active {
  color: var(--favorite-active-color);
  border-color: var(--favorite-active-border);
  background: var(--favorite-active-bg);
}

.btn-favorite-meal.active:hover {
  color: var(--favorite-active-hover-color);
  border-color: var(--favorite-active-border);
}

.meal-check {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 0.65rem;
  cursor: pointer;
}

.meal-checkbox {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Per-day shopping dropdown */
.day-shopping {
  margin-left: 90px;
}

.day-shopping-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.day-shopping-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.day-shopping.open .day-shopping-toggle {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
  background: var(--bg-hover);
}

.day-shopping-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.day-shopping-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-right: auto;
}

.day-shopping-count.has-items {
  color: var(--accent-dark);
  background: var(--accent-light);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.day-shopping-chevron {
  display: flex;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.day-shopping.open .day-shopping-chevron {
  transform: rotate(180deg);
  color: var(--accent-dark);
}

.day-shopping-panel {
  padding: 0.65rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: none;
  border-bottom-left-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 560px) {
  .day-shopping {
    margin-left: 0;
  }

  .meal-row {
    grid-template-columns: 72px 1fr 36px 36px;
  }
}

/* Shopping list */
.add-item-form {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.add-item-input {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--input-text);
}

.add-item-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(90, 158, 111, 0.2);
  background: var(--input-focus-bg);
}

.btn-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}

.btn-add:hover {
  background: var(--accent-dark);
}

.btn-add:active {
  transform: scale(0.95);
}

.shopping-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.shopping-list:empty::after {
  content: "Ingen varer";
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 300;
  padding: 0.25rem 0;
  font-style: italic;
}

.shopping-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.25rem;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
}

.shopping-item:hover {
  background: var(--bg-hover);
}

.shopping-item.checked .item-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.item-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.item-text {
  flex: 1;
  font-size: 0.85rem;
  word-break: break-word;
}

.btn-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s, color 0.12s;
  flex-shrink: 0;
}

.shopping-item:hover .btn-remove {
  opacity: 1;
}

.btn-remove:hover {
  background: #3a1f1f;
  color: #e66;
}

.day-shopping-actions {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.btn-find-deals {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent-dark);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-find-deals:hover:not(:disabled) {
  background: #243528;
}

.btn-find-deals:disabled {
  opacity: 0.6;
  cursor: wait;
}

.shopping-item {
  flex-wrap: wrap;
}

.item-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.item-offer {
  width: 100%;
  padding-left: 1.75rem;
  font-size: 0.75rem;
}

.item-offer a {
  color: var(--accent-dark);
  text-decoration: none;
}

.item-offer a:hover {
  text-decoration: underline;
}

.item-offer.loading {
  color: var(--text-muted);
  font-style: italic;
}

.item-offer.none {
  color: var(--text-muted);
  font-style: italic;
}

.btn-search-offer {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s, color 0.12s;
  flex-shrink: 0;
}

.shopping-item:hover .btn-search-offer {
  opacity: 1;
}

@media (hover: none) and (pointer: coarse) {
  .shopping-overview .btn-search-offer {
    opacity: 1;
  }
}

.btn-search-offer:hover {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.settings-dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  background: var(--bg-card);
  color: var(--text);
  max-width: 360px;
  width: calc(100% - 2rem);
}

.recipe-dialog {
  max-width: 640px;
}

.recipe-panel {
  padding: 1.25rem;
  max-height: min(82vh, 760px);
  overflow: auto;
}

.recipe-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.recipe-header h3 {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 400;
  margin: 0;
}

.recipe-eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.recipe-close {
  flex-shrink: 0;
}

.recipe-status {
  min-height: 1.2em;
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.recipe-image {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 0.85rem;
}

.recipe-meta {
  margin-bottom: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.recipe-body h4 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.recipe-ingredients,
.recipe-steps {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  font-size: 0.88rem;
  color: var(--text);
}

.recipe-ingredients li,
.recipe-steps li {
  margin-bottom: 0.35rem;
}

.recipe-actions,
.recipe-fallback-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.recipe-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.settings-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.settings-form {
  padding: 1.25rem;
}

.settings-form h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 0.35rem;
}

.settings-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.settings-field input,
.settings-field select,
.settings-select {
  font-family: var(--font-sans);
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--input-text);
}

.settings-subheading {
  font-size: 0.95rem;
  font-weight: 500;
  margin: 0.5rem 0 0.25rem;
}

.background-color-field {
  border: none;
  margin: 0 0 1rem;
  padding: 0;
}

.background-color-field legend {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.background-preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.background-preset-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 3.5rem;
}

.background-preset-option:hover {
  color: var(--text);
}

.background-preset-swatch {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.background-preset-option.selected .background-preset-swatch {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.background-preset-option.selected {
  color: var(--text);
}

.background-custom-field {
  margin-bottom: 0;
}

.background-custom-field.selected input[type="color"] {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.background-custom-field input[type="color"] {
  width: 100%;
  height: 2.5rem;
  padding: 0.2rem;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.favorite-stores-field {
  border: none;
  margin: 0 0 1rem;
  padding: 0;
}

.favorite-stores-field legend {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.favorite-stores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.45rem;
}

.favorite-store-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
}

.favorite-store-option:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg));
}

.favorite-store-option input {
  accent-color: var(--accent);
}

.settings-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-primary {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: white;
  cursor: pointer;
}

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

.settings-status {
  margin-top: 0.65rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  min-height: 1.2em;
}

.footer a {
  color: var(--accent-dark);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.btn-secondary {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

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

/* Footer */
.footer {
  text-align: center;
  margin-top: 2.5rem;
}

.footer p {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 300;
}

/* Login */
.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1.5rem;
}

.login-panels {
  width: min(100%, 400px);
}

.login-panel[hidden] {
  display: none;
}

.login-card {
  display: grid;
  gap: 1rem;
  width: min(100%, 400px);
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.5rem;
}

.login-brand h1 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 400;
}

.login-field {
  display: grid;
  gap: 0.35rem;
}

.login-field span {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

.login-field-hint {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
  opacity: 0.85;
}

.login-field input {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--input-text);
}

.login-field input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--input-focus-bg);
}

.login-password-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.15rem;
  padding: 0;
  border: none;
  background: none;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: color 0.15s ease;
}

.login-password-toggle:hover {
  color: var(--accent-dark);
}

.login-password-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.login-password-toggle[aria-pressed="true"] {
  color: var(--accent-dark);
}

.login-password-toggle-icon {
  flex-shrink: 0;
  opacity: 0.85;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
}

.login-remember input {
  accent-color: var(--accent);
}

.login-error {
  margin: 0;
  font-size: 0.82rem;
  color: #e07070;
}

.btn-login {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-login:hover {
  background: var(--accent-dark);
}

.login-alt-action {
  margin: 0;
  text-align: center;
}

.login-alt-link {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.login-alt-link:hover {
  color: var(--accent-dark);
}

.user-badge {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}

.logout-form {
  margin: 0;
}

.btn-logout {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-logout:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.sync-status {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  min-height: 1.1em;
}

.sync-status[data-state="ok"] {
  color: var(--accent-dark);
}

.sync-status[data-state="saving"] {
  color: var(--text-muted);
}

.sync-status[data-state="warning"] {
  color: #d4a24a;
}

.admin-dialog .settings-form {
  max-width: 420px;
}

.user-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.user-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.user-email {
  color: var(--text-muted, #8a8a8a);
  font-size: 0.78rem;
}

.admin-tag {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--accent-light);
  color: var(--accent-dark);
}

.admin-form {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.admin-form h4 {
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0;
}

.login-field-narrow input {
  max-width: 6.5rem;
}

.admin-code-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.admin-code-row input {
  flex: 1;
  min-width: 0;
}

.admin-code-row .btn-small {
  white-space: nowrap;
  align-self: stretch;
}

.admin-ok {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--accent-dark);
}

.meals-toolbar,
.shopping-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.85rem;
}

.btn-danger {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border: 1px solid #7a2e2e;
  border-radius: var(--radius-sm);
  background: #3a1515;
  color: #f5b4b4;
  cursor: pointer;
}

.btn-danger:hover:not(:disabled) {
  background: #4d1a1a;
  border-color: #9a3a3a;
}

.btn-danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-small {
  font-size: 0.78rem;
  padding: 0.38rem 0.7rem;
}

/* Favoritretter */
.favorites-bar {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.favorites-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.favorites-bar-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.favorites-bar-manage {
  border: none;
  background: transparent;
  color: var(--accent-dark);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
}

.favorites-bar-manage:hover {
  color: var(--accent);
}

.favorites-bar-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.favorites-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.favorite-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.favorite-chip:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent-dark);
}

.favorites-dialog {
  max-width: 420px;
}

.favorites-form {
  padding: 1.25rem;
}

.add-favorite-form {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.add-favorite-input {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--input-text);
}

.add-favorite-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(90, 158, 111, 0.2);
  background: var(--input-focus-bg);
}

.favorites-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 280px;
  overflow: auto;
}

.favorites-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.favorites-list-name {
  font-size: 0.9rem;
  flex: 1;
  min-width: 0;
}

.favorites-list-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.btn-small {
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
}

.btn-remove-favorite {
  width: 32px;
  height: 32px;
}

.favorites-empty {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.day-picker-dialog {
  max-width: 380px;
}

.day-picker-form {
  padding: 1.25rem;
}

.day-picker-week-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.day-picker-week-nav .week-picker {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.day-picker-week-range {
  margin: 0 0 0.85rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.day-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.day-picker-btn {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.day-picker-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent-dark);
}

/* Inspiration */
.inspiration-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.view-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

.view-tab.active .view-tab-badge {
  background: #0b1a10;
  color: #fff;
}

.inspiration-mode-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.inspiration-mode-legend {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.inspiration-mode-bar {
  display: flex;
  gap: 0.35rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}

.inspiration-mode {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.inspiration-mode-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: calc(var(--radius-sm) - 2px);
  background: var(--icon-btn-bg);
  border: 1px solid var(--icon-btn-border);
  color: var(--icon-btn-color);
}

.inspiration-mode-icon svg {
  opacity: 0.9;
}

.inspiration-mode:hover .inspiration-mode-icon {
  color: var(--text);
  border-color: var(--icon-btn-hover-border);
}

.inspiration-mode.active .inspiration-mode-icon {
  background: var(--icon-btn-active-bg);
  border-color: var(--icon-btn-active-border);
  color: var(--icon-btn-active-color);
}

.inspiration-mode.active .inspiration-mode-icon svg {
  opacity: 1;
}

.inspiration-mode-label {
  font-size: 0.9rem;
  font-weight: 600;
}

.inspiration-mode-hint {
  font-size: 0.68rem;
  font-weight: 400;
  opacity: 0.85;
  text-align: center;
  line-height: 1.2;
}

.inspiration-community-hint {
  margin: -0.35rem 0 0;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  border: 1px solid rgba(90, 158, 111, 0.35);
  font-size: 0.85rem;
  color: var(--text);
}

.inspiration-community-link {
  border: none;
  background: transparent;
  color: var(--accent-dark);
  font-family: var(--font-sans);
  font-size: inherit;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inspiration-community-link:hover {
  color: var(--accent);
}

.inspiration-mode:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.inspiration-mode.active {
  background: var(--accent);
  color: #fff;
}

.community-inspiration {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.community-loading,
.community-empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.community-privacy-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px dashed var(--border);
}

.community-card .community-meta {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.community-count {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent-dark);
}

.community-users {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.community-user-badge {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.community-user-badge.is-self {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent-dark);
}

.settings-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.settings-checkbox input {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.inspiration-intro {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.inspiration-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.inspiration-random {
  flex-shrink: 0;
}

.inspiration-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.inspiration-filter {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.inspiration-filter:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.inspiration-filter.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent-dark);
}

.inspiration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

.inspiration-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.inspiration-card.highlight {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(90, 158, 111, 0.2);
}

.inspiration-card-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 400;
  margin: 0;
  line-height: 1.25;
}

.inspiration-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.inspiration-tag {
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.inspiration-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.25rem;
}

.inspiration-empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

@media (max-width: 860px) {
  .brand h1 {
    font-size: 1.65rem;
  }

  .week-input {
    font-size: 2rem;
    width: 60px;
  }

  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .view-tabs {
    grid-template-columns: 1fr;
  }

  .meal-row {
    grid-template-columns: 72px 1fr 36px 36px 36px;
    gap: 0.5rem;
  }

  .inspiration-grid {
    grid-template-columns: 1fr;
  }
}

.intro-dialog {
  max-width: 440px;
  overflow: hidden;
}

.intro-panel {
  --intro-panel-height: clamp(31rem, 88vh, 34rem);
  position: relative;
  display: flex;
  flex-direction: column;
  height: var(--intro-panel-height);
  min-height: var(--intro-panel-height);
  max-height: min(var(--intro-panel-height), calc(100vh - 2rem));
  padding: 1.75rem 1.5rem 1.25rem;
  text-align: center;
  box-sizing: border-box;
}

.intro-panel.is-hero {
  padding-top: 2rem;
}

.intro-panel.is-video .intro-desc {
  max-width: 38ch;
}

.intro-hero-glow {
  position: absolute;
  top: -45%;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(90, 158, 111, 0.2) 0%, transparent 68%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.intro-panel.is-hero .intro-hero-glow {
  opacity: 1;
}

.intro-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.intro-eyebrow {
  flex-shrink: 0;
  margin: 0 0 0.75rem;
  min-height: 1.05rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.intro-visual-stage {
  position: relative;
  flex-shrink: 0;
  height: 11.75rem;
  margin: 0 0 0.85rem;
}

.intro-video-stage,
.intro-icon-wrap {
  position: absolute;
  left: 0;
  right: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.32s ease, visibility 0.32s ease;
}

.intro-video-stage {
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.intro-icon-wrap {
  top: 50%;
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-light);
  border: 1px solid rgba(90, 158, 111, 0.35);
  animation: none;
}

.intro-panel.is-hero .intro-icon-wrap {
  width: 5.25rem;
  height: 5.25rem;
}

.intro-video-stage.is-active,
.intro-icon-wrap.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.intro-icon-wrap.is-active {
  animation: introIconPop 0.45s ease-out;
}

@keyframes introIconPop {
  from {
    transform: translateY(-50%) scale(0.82);
    opacity: 0.4;
  }

  to {
    transform: translateY(-50%) scale(1);
    opacity: 1;
  }
}

.intro-icon {
  font-size: 2.25rem;
  line-height: 1;
}

.intro-panel.is-hero .intro-icon {
  font-size: 2.65rem;
}

.intro-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: opacity 0.28s ease;
}

.intro-text.is-changing {
  opacity: 0;
}

.intro-text h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  margin: 0 0 0.35rem;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.intro-panel.is-hero .intro-text h3 {
  font-size: 1.85rem;
}

.intro-tagline {
  margin: 0 0 0.85rem;
  min-height: 1.35rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--accent-dark);
}

.intro-tagline:empty {
  visibility: hidden;
}

.intro-desc {
  margin: 0 auto 0;
  min-height: 4.65rem;
  max-width: 34ch;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.intro-footer {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 0.35rem;
}

.intro-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.1rem;
}

.intro-step-num {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.intro-dots {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
}

.intro-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.25s ease, transform 0.25s ease, width 0.25s ease;
}

.intro-dot.active {
  background: var(--accent);
  transform: scale(1.05);
  width: 1.15rem;
  border-radius: 999px;
}

.intro-dismiss-opt {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--text-muted);
  cursor: pointer;
}

.intro-dismiss-opt input {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.intro-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.intro-nav {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
}

.intro-nav .btn-primary {
  flex: 1;
  min-width: 5.5rem;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
}

/* Intro video scene */

.intro-video {
  position: relative;
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(90, 158, 111, 0.3);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(126, 196, 146, 0.08);
  background: #0a0a0a;
}

.intro-video-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 9.5rem;
  object-fit: contain;
  vertical-align: middle;
}

.intro-video-sub {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--accent-dark);
  min-height: 1.2em;
  transition: opacity 0.35s ease;
}

.intro-video.is-playing .intro-video-sub {
  animation: ivCaptionFade 6s ease-in-out infinite;
}

@keyframes ivCaptionFade {
  0%, 8% { opacity: 1; }
  45%, 55% { opacity: 0.55; }
  92%, 100% { opacity: 1; }
}

/* Scene cycling */
.intro-video.is-playing .iv-scene-1 {
  animation: ivScene1 18s ease-in-out infinite;
}

.intro-video.is-playing .iv-scene-2 {
  animation: ivScene2 18s ease-in-out infinite;
}

.intro-video.is-playing .iv-scene-3 {
  animation: ivScene3 18s ease-in-out infinite;
}

@keyframes ivScene1 {
  0%, 28% { opacity: 1; }
  33%, 100% { opacity: 0; }
}

@keyframes ivScene2 {
  0%, 28% { opacity: 0; }
  33%, 61% { opacity: 1; }
  66%, 100% { opacity: 0; }
}

@keyframes ivScene3 {
  0%, 61% { opacity: 0; }
  66%, 94% { opacity: 1; }
  100% { opacity: 0; }
}

/* Progress dots in SVG */
.intro-video.is-playing .iv-dot-1 {
  animation: ivDot1 18s ease-in-out infinite;
}

.intro-video.is-playing .iv-dot-2 {
  animation: ivDot2 18s ease-in-out infinite;
}

.intro-video.is-playing .iv-dot-3 {
  animation: ivDot3 18s ease-in-out infinite;
}

@keyframes ivDot1 {
  0%, 28% { fill: #5a9e6f; }
  33%, 100% { fill: #2a2a2a; }
}

@keyframes ivDot2 {
  0%, 28% { fill: #2a2a2a; }
  33%, 61% { fill: #5a9e6f; }
  66%, 100% { fill: #2a2a2a; }
}

@keyframes ivDot3 {
  0%, 61% { fill: #2a2a2a; }
  66%, 94% { fill: #5a9e6f; }
  100% { fill: #2a2a2a; }
}

/* Character motion */
.intro-video.is-playing .iv-mom {
  animation: ivBob 3.2s ease-in-out infinite;
  transform-origin: 108px 130px;
}

.intro-video.is-playing .iv-dad {
  animation: ivBob 3.6s ease-in-out infinite 0.4s;
  transform-origin: 268px 130px;
}

.intro-video.is-playing .iv-child {
  animation: ivBob 2.8s ease-in-out infinite 0.8s;
  transform-origin: 188px 140px;
}

.intro-video.is-playing .iv-child-arm {
  animation: ivWave 2.4s ease-in-out infinite;
  transform-origin: 176px 112px;
}

.intro-video.is-playing .iv-phone {
  animation: ivPhoneGlow 2s ease-in-out infinite;
}

.intro-video.is-playing .iv-tablet {
  animation: ivPhoneGlow 2.4s ease-in-out infinite 0.6s;
}

.intro-video.is-playing .iv-check-mark {
  animation: ivCheckPop 3s ease-in-out infinite 1s;
  transform-origin: 238px 116px;
}

.intro-video.is-playing .iv-sparkle {
  animation: ivSparkle 2.5s ease-in-out infinite;
}

.intro-video.is-playing .iv-sparkle-2 {
  animation-delay: 0.8s;
}

.intro-video.is-playing .iv-sparkle-3 {
  animation-delay: 1.6s;
}

.intro-video.is-playing .iv-glow-pulse {
  animation: ivGlowPulse 4s ease-in-out infinite;
}

.intro-video.is-playing .iv-plant-sway {
  animation: ivPlantSway 5s ease-in-out infinite;
  transform-origin: 310px 118px;
}

.intro-video.is-playing .iv-caption-text {
  animation: ivCaptionPop 18s ease-in-out infinite;
}

.intro-video.is-playing .iv-peek-mom {
  animation: ivPeek 18s ease-in-out infinite;
}

.intro-video.is-playing .iv-peek-dad {
  animation: ivPeek 18s ease-in-out infinite 0.3s;
}

.intro-video.is-playing .iv-peek-child {
  animation: ivPeek 18s ease-in-out infinite 0.6s;
}

.intro-video.is-playing .iv-smile {
  animation: ivSmileWiden 4s ease-in-out infinite;
}

@keyframes ivBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes ivWave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-12deg); }
  75% { transform: rotate(6deg); }
}

@keyframes ivPhoneGlow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(90, 158, 111, 0.3)); }
  50% { filter: drop-shadow(0 0 8px rgba(126, 196, 146, 0.55)); }
}

@keyframes ivCheckPop {
  0%, 70%, 100% { opacity: 0; transform: scale(0.6); }
  80% { opacity: 1; transform: scale(1); }
}

@keyframes ivSparkle {
  0%, 100% { opacity: 0.3; transform: scale(0.85) translateY(0); }
  50% { opacity: 1; transform: scale(1.1) translateY(-4px); }
}

@keyframes ivGlowPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes ivPlantSway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(4deg); }
}

@keyframes ivCaptionPop {
  0%, 28% { opacity: 0; }
  33%, 61% { opacity: 1; }
  66%, 100% { opacity: 0; }
}

@keyframes ivPeek {
  0%, 66% { transform: translateY(6px); opacity: 0.5; }
  72%, 94% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(6px); opacity: 0.5; }
}

@keyframes ivSmileWiden {
  0%, 100% { transform: scaleX(1); }
  50% { transform: scaleX(1.08); }
}

/* Reduced motion: static first scene */
@media (prefers-reduced-motion: reduce) {
  .intro-video.is-playing .iv-scene-1,
  .intro-video.is-playing .iv-scene-2,
  .intro-video.is-playing .iv-scene-3,
  .intro-video.is-playing .iv-mom,
  .intro-video.is-playing .iv-dad,
  .intro-video.is-playing .iv-child,
  .intro-video.is-playing .iv-child-arm,
  .intro-video.is-playing .iv-phone,
  .intro-video.is-playing .iv-tablet,
  .intro-video.is-playing .iv-check-mark,
  .intro-video.is-playing .iv-sparkle,
  .intro-video.is-playing .iv-glow-pulse,
  .intro-video.is-playing .iv-plant-sway,
  .intro-video.is-playing .iv-caption-text,
  .intro-video.is-playing .iv-peek-mom,
  .intro-video.is-playing .iv-peek-dad,
  .intro-video.is-playing .iv-peek-child,
  .intro-video.is-playing .iv-smile,
  .intro-video.is-playing .iv-dot-1,
  .intro-video.is-playing .iv-dot-2,
  .intro-video.is-playing .iv-dot-3,
  .intro-video.is-playing .intro-video-sub {
    animation: none !important;
  }

  .iv-scene-2,
  .iv-scene-3 {
    opacity: 0 !important;
  }

  .iv-scene-1 {
    opacity: 1 !important;
  }

  .iv-dot-1 { fill: #5a9e6f !important; }
  .iv-dot-2,
  .iv-dot-3 { fill: #2a2a2a !important; }
}

@media (max-width: 480px) {
  .intro-panel {
    --intro-panel-height: clamp(29rem, 92vh, 34rem);
    padding: 1.35rem 1.15rem 1.1rem;
  }

  .intro-panel.is-hero {
    padding-top: 1.5rem;
  }

  .intro-visual-stage {
    height: 10.5rem;
  }

  .intro-video-svg {
    max-height: 8.25rem;
  }

  .intro-panel.is-hero .intro-text h3 {
    font-size: 1.65rem;
  }

  .intro-text h3 {
    font-size: 1.45rem;
  }

  .intro-desc {
    min-height: 4.2rem;
    font-size: 0.88rem;
  }

  .intro-video-sub {
    font-size: 0.72rem;
  }
}

/* Guided tour — Madplan-assistenten virtual guide */
body.tour-active {
  overflow: hidden;
}

@media (max-width: 520px) {
  body.tour-active {
    overflow: hidden;
  }
}

.guided-tour {
  position: fixed;
  inset: 0;
  z-index: 12000;
  pointer-events: auto;
}

.tour-spotlight {
  position: fixed;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.84);
  border: 2px solid var(--accent-dark);
  pointer-events: none;
  z-index: 12001;
  transition: top 0.22s ease, left 0.22s ease, width 0.22s ease, height 0.22s ease;
}

.tour-spotlight-mirror {
  position: fixed;
  z-index: 12003;
  pointer-events: none;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-sizing: border-box;
}

.tour-spotlight-mirror .is-tour-mirror-clone {
  margin: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.tour-spotlight-mirror .is-tour-mirror-clone .item-main {
  height: 100%;
}

.tour-inline-demo {
  margin-bottom: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
}

.tour-inline-demo-hint {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.tour-inline-demo-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.tour-inline-demo-check {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--bg-card);
}

.tour-inline-demo-text {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
}

.tour-inline-demo-search {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-light);
  color: var(--accent-dark);
  border: 2px solid var(--accent);
  animation: tour-search-pulse 1.4s ease-in-out infinite;
}

.tour-popover.has-inline-demo .tour-speech-bubble {
  margin-bottom: 0.55rem;
}

.tour-popover.is-compact .tour-inline-demo {
  margin-bottom: 0.5rem;
  padding: 0.55rem 0.65rem;
}

.tour-popover.is-compact .tour-inline-demo-hint {
  font-size: 0.68rem;
  margin-bottom: 0.35rem;
}

body.tour-active .is-tour-target.btn-search-offer {
  opacity: 1;
  background: var(--accent-light);
  color: var(--accent-dark);
}

body.tour-active.tour-search-offer-step .shopping-overview .btn-search-offer {
  opacity: 1;
}

body.tour-active .is-tour-search-btn {
  opacity: 1 !important;
  width: 32px;
  height: 32px;
  background: var(--accent-light);
  color: var(--accent-dark);
  border: 2px solid var(--accent);
  border-radius: 8px;
  position: relative;
  z-index: 1;
  animation: tour-search-pulse 1.4s ease-in-out infinite;
}

body.tour-active .is-tour-search-btn svg {
  width: 16px;
  height: 16px;
}

@keyframes tour-search-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(90, 158, 111, 0.45);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(90, 158, 111, 0);
    transform: scale(1.06);
  }
}

body.tour-active .shopping-category {
  overflow: visible;
}

.tour-popover {
  position: fixed;
  z-index: 12004;
  width: min(24rem, calc(100vw - 1.5rem));
  padding: 1rem 1.1rem 0.95rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
}

.tour-popover.is-centered {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(26rem, calc(100vw - 2rem));
}

.tour-popover.is-bottom-sheet {
  left: 0.75rem;
  right: 0.75rem;
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  width: auto;
  transform: none;
  display: flex;
  flex-direction: column;
  max-height: var(--tour-sheet-max-height, min(48dvh, 20rem));
  overflow: hidden;
  padding: 0;
}

.tour-popover-body {
  min-width: 0;
}

.tour-popover-footer {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.tour-popover.is-bottom-sheet .tour-popover-footer {
  flex-shrink: 0;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem max(0.65rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

.tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.tour-popover.is-bottom-sheet .tour-popover-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.65rem 0.85rem 0.45rem;
}

.tour-popover.has-inline-demo.is-bottom-sheet .tour-popover-body {
  min-height: 9.5rem;
}

.tour-popover.has-speech-only .tour-title,
.tour-popover.has-speech-only .tour-desc {
  display: none;
}

.tour-popover.is-compact {
  padding: 0.65rem 0.85rem 0.7rem;
  border-radius: var(--radius-sm) var(--radius-sm) var(--radius) var(--radius);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.45);
}

.tour-popover.is-compact.is-bottom-sheet {
  padding: 0;
}

.tour-popover.is-compact .tour-guide-header {
  margin-bottom: 0.45rem;
  gap: 0.55rem;
}

.tour-popover.is-compact .tour-eyebrow {
  display: none;
}

.tour-popover.is-compact .tour-speech-bubble {
  margin-bottom: 0.5rem;
  padding: 0.55rem 0.7rem;
}

.tour-popover.is-compact .tour-progress {
  margin-bottom: 0;
}

.tour-popover.is-compact .tour-actions {
  gap: 0.5rem;
}

.tour-guide-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.tour-guide-avatar {
  flex-shrink: 0;
  width: 3.6rem;
  height: 3.95rem;
  border-radius: 50% 50% 42% 42%;
  background: linear-gradient(145deg, var(--accent-light) 0%, var(--bg-hover) 100%);
  border: 2px solid var(--accent);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.tour-guide-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tour-guide-avatar.is-speaking {
  transform: scale(1.04);
  box-shadow: 0 0 0 3px rgba(126, 196, 146, 0.25);
}

.tour-guide-avatar.is-speaking .tour-guide-hand {
  animation: tour-guide-wave 1.2s ease-in-out infinite;
  transform-origin: 62px 54px;
}

.tour-guide-meta {
  flex: 1;
  min-width: 0;
}

.tour-eyebrow {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 0.15rem;
}

.tour-guide-name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  line-height: 1.1;
  color: var(--text);
}

.tour-speech-bubble {
  position: relative;
  margin-bottom: 0.7rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  border: 1px solid rgba(126, 196, 146, 0.35);
  overflow: visible;
}

.tour-speech-bubble::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 1.35rem;
  width: 14px;
  height: 14px;
  background: var(--accent-light);
  border-left: 1px solid rgba(126, 196, 146, 0.35);
  border-top: 1px solid rgba(126, 196, 146, 0.35);
  transform: rotate(45deg);
}

.tour-speech-bubble.is-speaking {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 1px rgba(126, 196, 146, 0.15);
}

.tour-speech-text {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text);
  margin: 0;
  overflow: visible;
  overflow-wrap: break-word;
  word-wrap: break-word;
  white-space: normal;
}

.tour-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 0.3rem;
  color: var(--text-muted);
}

.tour-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.55rem;
  opacity: 0.85;
}

.tour-progress {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.tour-skip {
  border: none;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0.25rem 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  flex-shrink: 0;
  white-space: nowrap;
}

.tour-skip:hover {
  color: var(--text);
}

.tour-nav {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
  align-items: center;
  flex-shrink: 0;
}

.tour-nav .btn-primary {
  box-sizing: border-box;
  min-width: 5.5rem;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  border: 2px solid transparent;
}

.tour-nav .btn-primary.is-reserved {
  visibility: hidden;
  pointer-events: none;
}

body.tour-active .is-tour-target {
  position: relative;
  /* Stay below tour popover — spotlight cutout reveals without elevating */
}

body.tour-active .shopping-category:has(.is-tour-target) {
  overflow: visible;
}

body.tour-active .is-tour-target.shopping-item {
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
}

@keyframes tour-guide-wave {
  0%,
  100% {
    transform: rotate(0deg);
  }
  35% {
    transform: rotate(-8deg);
  }
  65% {
    transform: rotate(6deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tour-spotlight {
    transition: none;
  }

  body.tour-active .is-tour-search-btn,
  .tour-inline-demo-search {
    animation: none;
  }

  .tour-guide-avatar.is-speaking .tour-guide-hand {
    animation: none;
    opacity: 0.75;
  }

  .tour-guide-avatar.is-speaking {
    transform: none;
  }
}

@media (max-width: 520px) {
  .tour-popover:not(.is-centered) {
    left: 0.75rem !important;
    right: 0.75rem !important;
    width: auto !important;
    bottom: max(0.75rem, env(safe-area-inset-bottom)) !important;
    top: auto !important;
    transform: none !important;
  }

  .tour-popover.is-centered {
    width: min(22rem, calc(100vw - 1.5rem));
    max-height: min(70dvh, 28rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
  }

  .tour-popover.is-centered .tour-popover-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0.65rem 0.85rem 0.45rem;
  }

  .tour-popover.is-centered .tour-popover-footer {
    flex-shrink: 0;
    padding: 0.45rem 0.85rem max(0.65rem, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
  }

  .tour-popover.has-inline-demo.is-bottom-sheet .tour-guide-header {
    margin-bottom: 0.35rem;
  }

  .tour-popover.has-inline-demo.is-bottom-sheet .tour-speech-bubble {
    margin-bottom: 0.4rem;
    padding: 0.45rem 0.6rem;
  }

  .tour-popover.has-inline-demo.is-bottom-sheet .tour-speech-text {
    font-size: 0.84rem;
    line-height: 1.45;
    overflow: visible;
    white-space: normal;
  }

  .tour-popover.has-inline-demo .tour-inline-demo {
    display: block !important;
    margin-bottom: 0.35rem;
    padding: 0.4rem 0.55rem;
  }

  .tour-popover.has-inline-demo .tour-inline-demo-row {
    padding: 0.35rem 0.45rem;
    gap: 0.4rem;
  }

  .tour-popover.has-inline-demo .tour-inline-demo-text {
    font-size: 0.88rem;
  }

  .tour-popover.has-inline-demo .tour-inline-demo-search {
    width: 28px;
    height: 28px;
  }

  .tour-popover.has-inline-demo .tour-inline-demo-search svg {
    width: 14px;
    height: 14px;
  }

  .tour-spotlight {
    border-width: 2px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.78);
  }

  .tour-guide-avatar {
    width: 2.35rem;
    height: 2.55rem;
  }

  .tour-guide-name {
    font-size: 1rem;
  }

  .tour-speech-text {
    font-size: 0.88rem;
    line-height: 1.45;
  }

  .tour-title {
    font-size: 0.98rem;
  }

  .tour-speech-bubble::before {
    left: 1rem;
  }

  .tour-popover.is-compact .tour-speech-bubble::before {
    display: none;
  }

  .tour-nav .btn-primary {
    min-width: 4.75rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 360px) {
  .tour-inline-demo-hint {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

/* Analytics admin */
a.btn-icon {
  text-decoration: none;
}

.analytics-page {
  min-height: 100vh;
}

.analytics-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.analytics-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.analytics-eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.analytics-header h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 0.35rem;
}

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

.btn-analytics-back,
.analytics-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-analytics-back:hover,
.analytics-detail-back:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--accent-dark);
}

.analytics-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: auto;
  box-shadow: var(--shadow);
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.analytics-table th,
.analytics-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.analytics-table th {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.analytics-table tbody tr:last-child td {
  border-bottom: none;
}

.analytics-table-clickable tbody tr[data-href] {
  cursor: pointer;
  transition: background 0.15s;
}

.analytics-table-clickable tbody tr[data-href]:hover {
  background: var(--bg-hover);
}

.analytics-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem 1rem !important;
}

.analytics-detail-head {
  margin-bottom: 1.25rem;
}

.analytics-detail-head h2 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 400;
  margin-top: 0.75rem;
}

.analytics-detail-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.analytics-stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  padding: 1rem;
}

.analytics-stat-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.analytics-stat-value {
  font-size: 1.2rem;
  font-weight: 500;
}

@media (max-width: 720px) {
  .analytics-header {
    flex-direction: column;
  }

  .analytics-detail-stats {
    grid-template-columns: 1fr;
  }
}

/* Chat assistant — Madplan-assistenten */
.chat-assistant {
  position: fixed;
  inset: 0;
  z-index: 11000;
  pointer-events: none;
  font-family: var(--font-sans);
}

.chat-fab {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent-light) 0%, var(--bg-card) 100%);
  color: var(--accent-dark);
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.chat-fab:hover {
  transform: scale(1.04);
  border-color: var(--accent-dark);
}

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

.chat-fab-icon-close {
  display: none;
}

.chat-assistant.is-open .chat-fab-icon-open {
  display: none;
}

.chat-assistant.is-open .chat-fab-icon-close {
  display: block;
}

.chat-panel[hidden] {
  display: none !important;
}

.chat-panel {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 3.5rem + 0.75rem);
  pointer-events: auto;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(22rem, calc(100vw - 2rem));
  max-height: min(32rem, calc(100vh - 6rem - env(safe-area-inset-bottom) - env(safe-area-inset-top)));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.85rem 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-card));
}

.chat-header-identity {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.chat-avatar {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--accent);
  background: var(--accent-light);
}

.chat-avatar-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chat-eyebrow {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  line-height: 1.2;
}

.chat-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
}

.chat-close {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 12rem;
  -webkit-overflow-scrolling: touch;
}

.chat-message {
  max-width: 92%;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-word;
}

.chat-message-assistant {
  align-self: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
}

.chat-message-user {
  align-self: flex-end;
  background: var(--accent-light);
  border: 1px solid var(--accent);
  color: var(--accent-dark);
}

.chat-message-typing {
  align-self: flex-start;
  color: var(--text-muted);
  font-style: italic;
  background: transparent;
  border: none;
  padding-left: 0.2rem;
}

.chat-message p {
  margin: 0 0 0.45rem;
}

.chat-message p:last-child {
  margin-bottom: 0;
}

.chat-message ul {
  margin: 0.35rem 0 0.45rem;
  padding-left: 1.15rem;
}

.chat-message li {
  margin-bottom: 0.2rem;
}

.chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.chat-quick-reply {
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.chat-quick-reply:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent-dark);
}

.chat-action-link {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  border: 1px solid var(--accent);
  color: var(--accent-dark);
  font-size: 0.82rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.chat-action-link:hover {
  background: color-mix(in srgb, var(--accent) 18%, var(--bg));
}

.chat-action-link + .chat-action-link {
  margin-left: 0.35rem;
}

.chat-recipe-card {
  margin-top: 0.45rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.chat-recipe-card strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--accent-dark);
}

.chat-recipe-card small {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.chat-form {
  display: flex;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem 0.75rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.chat-input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--input-text);
  font: inherit;
  font-size: 0.9rem;
}

.chat-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.chat-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--tab-active-color);
  cursor: pointer;
  transition: background 0.15s;
}

.chat-send:hover {
  background: var(--accent-dark);
}

.chat-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

body.tour-active .chat-assistant {
  z-index: 11900;
}

@media (max-width: 480px) {
  .chat-fab {
    right: max(0.75rem, env(safe-area-inset-right));
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    width: 3.25rem;
    height: 3.25rem;
  }

  .chat-panel {
    right: max(0.75rem, env(safe-area-inset-right));
    bottom: calc(max(0.75rem, env(safe-area-inset-bottom)) + 3.25rem + 0.75rem);
    width: calc(100vw - 1.5rem);
    max-height: min(70vh, calc(100vh - 5.5rem));
  }
}
