/* MealieShopper huisstijl: basilicumgroen op rustige neutrale vlakken.
   Manrope voor koppen en het woordmerk, Inter voor de interface; beide lokaal. */

@font-face {
  font-family: "Manrope";
  src: url("fonts/Manrope-Variable.woff2") format("woff2"),
    url("fonts/Manrope-Variable.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;

  /* Merk en actie */
  --primary: #176b45;
  --primary-strong: #105235;
  --selection: #eaf5ee;
  --lemon: #f2cf45; /* decoratief: niet als tekst op wit */

  /* Vlakken, tekst en rand */
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-muted: #eef3f0;
  --text: #18251e;
  --muted: #59665e;
  --border: #d6dfd9;

  /* Meldingen: fouten blijven rood en krijgen altijd een tekstuele uitleg */
  --success-text: #105235;
  --success-bg: #eaf5ee;
  --success-border: #b8d8c6;
  --danger: #b42318;
  --danger-bg: #fff0ee;
  --danger-border: #f3b5af;
  --warning-text: #7a4f00;
  --warning-bg: #fff8e6;
  --warning-border: #e0a100;

  /* Menubalk onderaan op een telefoon: dichter glas en donkerdere inkt, zodat labels leesbaar blijven boven donkere foto's */
  --tabbar-glass: rgba(255, 255, 255, 0.8);
  --tabbar-tint: rgba(23, 107, 69, 0.14);
  --tabbar-ink: #3f4c45;
  --tabbar-ink-active: #105235;
  --tabbar-solid: rgba(255, 255, 255, 0.97);
  --tabbar-border: rgba(255, 255, 255, 0.7);

  /* Tekst op een primair vlak, balk bovenaan, scherm achter de inlogkaart en kleine details */
  --on-primary: #fff;
  --topbar-bg: rgba(255, 255, 255, 0.96);
  --gate-bg: rgba(245, 247, 246, 0.96);
  --code-on-message: rgba(255, 255, 255, 0.7);
  --flag-ring: rgba(24, 37, 30, 0.25);
  --shadow-ink: 24, 37, 30; /* rgb-waarden voor schaduwen */

  /* Diepte en verfijning: drie schaduwniveaus, een focushalo, een rand voor het hoverniveau en het glas van de balk bovenaan */
  --shadow-xs: 0 1px 2px rgba(var(--shadow-ink), 0.06);
  --shadow-sm: 0 1px 2px rgba(var(--shadow-ink), 0.05), 0 2px 8px rgba(var(--shadow-ink), 0.04);
  --shadow-md: 0 2px 4px rgba(var(--shadow-ink), 0.04), 0 10px 28px rgba(var(--shadow-ink), 0.09);
  --shadow-lg: 0 4px 8px rgba(var(--shadow-ink), 0.05), 0 28px 64px rgba(var(--shadow-ink), 0.16);
  --btn-shadow: 0 1px 2px rgba(16, 82, 53, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  --btn-shadow-hover: 0 2px 8px rgba(16, 82, 53, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  --ring: rgba(23, 107, 69, 0.2);
  --border-strong: #c0ccc5;
  --placeholder: #66756c; /* 4,8 : 1 op wit */
  --topbar-glass: rgba(255, 255, 255, 0.9);
  --page-glow: rgba(23, 107, 69, 0.07);
  --ease: cubic-bezier(0.2, 0, 0, 1);

  --radius-card: 12px;
  --radius-control: 8px;
  --control-height: 44px;

  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-heading: "Manrope", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Donker thema: wordt gezet met data-theme="dark" op <html> (zie static/theme.js en de kop van de pagina). */
:root[data-theme="dark"] {
  color-scheme: dark;

  --primary: #4cc38a;
  --primary-strong: #7bd9ab;
  --selection: #1d3a2c;

  --bg: #0f1613;
  --surface: #17211c;
  --surface-muted: #1e2b24;
  --text: #e6eee9;
  --muted: #9fb0a6;
  --border: #2d3d34;

  --success-text: #8fe0b4;
  --success-bg: #163326;
  --success-border: #2a5c43;
  --danger: #ff8a80;
  --danger-bg: #3a1b18;
  --danger-border: #7a2f29;
  --warning-text: #f2c35a;
  --warning-bg: #33280d;
  --warning-border: #a67c00;

  --tabbar-glass: rgba(23, 33, 28, 0.8);
  --tabbar-tint: rgba(76, 195, 138, 0.18);
  --tabbar-ink: #b4c4ba;
  --tabbar-ink-active: #7bd9ab;
  --tabbar-solid: rgba(23, 33, 28, 0.97);
  --tabbar-border: rgba(255, 255, 255, 0.12);

  --on-primary: #0b1f15;
  --topbar-bg: rgba(15, 22, 19, 0.96);
  --gate-bg: rgba(15, 22, 19, 0.96);
  --code-on-message: rgba(0, 0, 0, 0.3);
  --flag-ring: rgba(255, 255, 255, 0.35);
  --shadow-ink: 0, 0, 0;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 10px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.35), 0 32px 72px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --btn-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  --btn-shadow-hover: 0 2px 10px rgba(76, 195, 138, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  --ring: rgba(76, 195, 138, 0.28);
  --border-strong: #3d5247;
  --placeholder: #8a9c91;
  --topbar-glass: rgba(15, 22, 19, 0.9);
  --page-glow: rgba(76, 195, 138, 0.08);
}

/* De ruimte voor de scrollbalk blijft altijd gereserveerd: de pagina verspringt niet als een scherm hoger wordt dan het venster. */
html {
  scrollbar-gutter: stable;
}

@supports not (scrollbar-gutter: stable) {
  html {
    overflow-y: scroll;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg) radial-gradient(1100px 380px at 50% -140px, var(--page-glow), transparent 72%) no-repeat;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--selection);
  color: var(--primary-strong);
}

a {
  color: var(--primary);
}

/* Zichtbare groene focusring voor toetsenbord en schermlezers */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.input:focus-visible,
.textarea:focus-visible,
select:focus-visible {
  border-color: var(--primary);
  outline-offset: 0;
  box-shadow: 0 0 0 5px var(--ring);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: var(--topbar-bg);
  box-shadow: 0 1px 0 rgba(var(--shadow-ink), 0.02), 0 6px 20px rgba(var(--shadow-ink), 0.04);
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .topbar {
    background: var(--topbar-glass);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    backdrop-filter: saturate(180%) blur(18px);
  }
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
}

.brand-link:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1120px;
  min-height: 64px;
  margin: 0 auto;
  padding: 8px 16px;
}

.topbar .brand-mark {
  width: 40px;
  height: 40px;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(900px 520px at 50% -10%, var(--page-glow), transparent 70%), var(--gate-bg);
  overflow-y: auto;
}

.auth-card {
  width: min(440px, 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  animation: rise-in 0.4s var(--ease) both;
}

.auth-card h2 {
  font-size: 26px;
  letter-spacing: -0.02em;
}

.auth-card .brand-mark {
  margin: 0 auto 14px;
}

.auth-card > h2,
.auth-card > p {
  text-align: center;
}

.auth-card > p {
  margin-top: 6px;
}

.box > h2 + .profile-avatar {
  margin-top: 14px;
}

.auth-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.brand-mark {
  display: block;
  flex: none;
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 2px 4px rgba(var(--shadow-ink), 0.14));
}

.brand-mark--large {
  width: 64px;
  height: 64px;
}

/* Lijnicoon: ronde uiteinden, kleur volgt de tekst */
.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h2 {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.wordmark {
  font-size: 21px;
  letter-spacing: -0.025em;
  font-weight: 800;
  line-height: 1.1;
}

.wordmark span {
  color: var(--primary);
}

.wordmark-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.beta-badge {
  padding: 1px 8px;
  border: 1px solid var(--warning-border);
  border-radius: 999px;
  background: var(--warning-bg);
  color: var(--warning-text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.5;
  text-transform: uppercase;
}

.topbar p {
  margin-top: 1px;
  color: var(--muted);
  font-size: 13px;
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 16px 48px;
}

.tabs,
.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: fit-content;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

/* Tweede niveau als segmentbediening: een ingedeukt spoor met een oplichtend actief segment. */
.subtabs {
  background: var(--surface-muted);
  box-shadow: inset 0 1px 2px rgba(var(--shadow-ink), 0.05);
}

.tabs {
  margin-bottom: 24px;
}

.subtabs {
  margin-bottom: 20px;
}

.tab,
.subtab,
.button,
.icon-button {
  border: 0;
  border-radius: var(--radius-control);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease),
    box-shadow 0.2s var(--ease), transform 0.12s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.tab,
.subtab {
  position: relative;
  min-height: var(--control-height);
  padding: 0 16px;
  background: transparent;
  color: var(--muted);
}

.tab:hover:not(.is-active),
.subtab:hover:not(.is-active) {
  background: var(--selection);
  color: var(--primary-strong);
}

.tab.is-active {
  background: var(--selection);
  color: var(--primary-strong);
  box-shadow: inset 0 0 0 1px var(--success-border);
}

.subtab.is-active {
  background: var(--surface);
  color: var(--primary-strong);
  box-shadow: 0 1px 2px rgba(var(--shadow-ink), 0.12), 0 0 0 1px var(--border);
}

.tab.is-active > svg {
  color: var(--primary);
}

/* Uitklapmenu in een subtabbalk (Instellingen > Koppelen): de knop opent een lijst met de winkels eronder. */
.subtab-menu {
  position: relative;
}

.subtab-menu__toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* De winkelkeuze in Winkels kiest iets in plaats van een pagina te openen: lichte vulling in plaats van de actieve kleur. */
.subtab-menu__toggle--select,
.subtab-menu__toggle--select:hover {
  background: var(--selection);
  color: var(--primary-strong);
}

.subtab-menu__chevron {
  flex: none;
  width: 20px;
  height: 20px;
  fill: currentColor;
  transition: transform 0.15s ease;
}

.subtab-menu__toggle[aria-expanded="true"] .subtab-menu__chevron {
  transform: rotate(180deg);
}

.subtab-menu__list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 100%;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: pop-in 0.16s var(--ease) both;
  transform-origin: top left;
}

.subtab-menu__list[hidden] {
  display: none;
}

.subtab-menu__item {
  min-height: var(--control-height);
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.subtab-menu__item:hover,
.subtab-menu__item.is-active {
  background: var(--selection);
  color: var(--primary-strong);
}

/* Iconen: Material Design Icons (Pictogrammers, licentie in static/icons/). In de bovenste tabs staan
   ze links van de tekst; in de onderste menubalk (PWA op een klein scherm) boven een kort label. */
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.subtab--icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tab-icon {
  flex: none;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.subtab-icon {
  flex: none;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.tab-short {
  display: none;
}

.panel,
.subpanel {
  display: none;
}

.panel.is-active,
.subpanel.is-active {
  display: block;
  animation: rise-in 0.28s var(--ease) both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel.is-active,
  .subpanel.is-active,
  .auth-card {
    animation: none;
  }
}

.toolbar,
.form-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-row .button {
  flex: none;
  white-space: nowrap;
}

.week-label {
  min-width: 180px;
  text-align: center;
}

.week-label strong,
.week-label span {
  display: block;
}

.week-label span,
.muted {
  color: var(--muted);
  font-size: 14px;
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--control-height);
  background: var(--primary);
  color: var(--on-primary);
  padding: 0 18px;
  box-shadow: var(--btn-shadow);
}

.button:hover,
.icon-button:hover {
  background: var(--primary-strong);
  box-shadow: var(--btn-shadow-hover);
}

.button:active:not(:disabled),
.icon-button:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: none;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.button--secondary,
.icon-button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

.button--secondary:hover,
.icon-button:hover {
  border-color: var(--border-strong);
  background: var(--selection);
  color: var(--primary-strong);
  box-shadow: var(--shadow-sm);
}

.icon-button {
  width: var(--control-height);
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.inline-button {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 14px;
  text-decoration: none;
}

/* 16 px voorkomt dat iOS bij het focussen van een veld inzoomt */
.field {
  display: grid;
  gap: 6px;
}

.field > span {
  font-size: 14px;
  font-weight: 600;
}

.input,
.textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  box-shadow: inset 0 1px 2px rgba(var(--shadow-ink), 0.04);
  transition: border-color 0.15s var(--ease), box-shadow 0.2s var(--ease);
}

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

.input:hover:not(:focus-visible),
.textarea:hover:not(:focus-visible),
.store-select:hover:not(:focus-visible) {
  border-color: var(--border-strong);
}

.input {
  min-height: var(--control-height);
  padding: 0 12px;
}

.textarea {
  margin: 12px 0;
  padding: 10px 12px;
  resize: vertical;
}

.box,
.message,
.day-card,
.recipe-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.box,
.day-card,
.recipe-card {
  box-shadow: var(--shadow-sm);
}

.box {
  max-width: 680px;
  margin-bottom: 16px;
  padding: 24px;
}

.narrow {
  max-width: 620px;
}

/* Verticaal ritme in een blok: kop, uitleg, invoer en knop krijgen vaste, rustige afstanden. */
.box > h2 + .muted,
.box > .toolbar + .muted,
.box > .list-header + .muted {
  margin-top: 6px;
}

.box > .muted + .form-row,
.box > .muted + form {
  margin-top: 16px;
}

.box .muted + .button,
.box .muted + .inline-button {
  margin-top: 14px;
}

.box .button + .muted {
  margin-top: 10px;
}

/* Overzichten met kaarten gebruiken de volle breedte, zodat er meer naast elkaar passen */
.box--wide {
  max-width: none;
}

.message {
  margin: 16px 0;
  padding: 12px 16px 12px 18px;
  font-size: 15px;
}

/* Een gekleurde balk links maakt het soort melding in één oogopslag duidelijk; de tekst legt het altijd uit. */
.message.success {
  border-color: var(--success-border);
  background: var(--success-bg);
  color: var(--success-text);
  box-shadow: inset 4px 0 0 var(--primary);
}

.message.error {
  border-color: var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger);
  box-shadow: inset 4px 0 0 var(--danger);
}

.message.warning {
  border-color: var(--warning-border);
  background: var(--warning-bg);
  color: var(--warning-text);
  box-shadow: inset 4px 0 0 var(--warning-border);
}

.message.warning code {
  background: var(--code-on-message);
}

/* Melding met een knop ernaast */
.message--action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.message--action .inline-button {
  margin-top: 0;
}

.day-grid,
.recipe-grid {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.day-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.recipe-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.day-card,
.recipe-card {
  overflow: hidden;
  padding: 16px;
}

.day-card h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Vandaag valt op: een groene rand en een kleine chip, zonder de andere dagen te dempen. */
.day-card--today {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-md);
}

.day-card--today h3 {
  color: var(--primary-strong);
}

.day-card__today {
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  padding: 1px 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.meal {
  margin-bottom: 12px;
}

.meal span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.meal strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  overflow-wrap: break-word;
  hyphens: auto;
}

.meal small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.ingredients {
  margin-top: 18px;
  padding: 18px;
}

.ingredients ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 6px 16px;
  margin: 14px 0 0;
  padding-left: 18px;
}

.recipe-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}

.recipe-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

/* Het oplichten van kaarten alleen met een muis: op een scherm blijft het na een tik anders hangen. */
@media (hover: hover) {
  .recipe-card:hover {
    transform: translateY(-2px);
  }

  .list-card:hover {
    transform: translateY(-1px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .recipe-card,
  .list-card,
  .button,
  .icon-button,
  .tab,
  .subtab,
  .input,
  .offer-chip,
  .product-card {
    transition: none;
  }

  .recipe-card:hover,
  .list-card:hover,
  .button:active:not(:disabled),
  .icon-button:active:not(:disabled) {
    transform: none;
  }
}

.recipe-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-control);
  object-fit: cover;
  background: var(--surface-muted);
  outline: 1px solid rgba(var(--shadow-ink), 0.08);
  outline-offset: -1px;
}

.recipe-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

.recipe-card .recipe-card__headline {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  border-radius: 999px;
  background: var(--selection);
  box-shadow: inset 0 0 0 1px var(--success-border);
  color: var(--primary-strong);
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
}

.card-actions a {
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
}

.pager {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.credential-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.credential-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 12px;
}

.credential-row strong,
.credential-row small {
  display: block;
}

.credential-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.credential-row .list-link {
  flex: 1;
  color: inherit;
  text-decoration: none;
}

.credential-row .list-link strong {
  color: var(--primary);
}

.security-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.steps {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

code {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.product-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  padding: 10px;
  color: inherit;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease), box-shadow 0.2s var(--ease);
}

a.product-card:hover {
  border-color: var(--primary);
  background: var(--selection);
  box-shadow: var(--shadow-sm);
}

.product-card img {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: var(--radius-control);
  object-fit: contain;
  background: #fff;
  outline: 1px solid rgba(var(--shadow-ink), 0.08);
  outline-offset: -1px;
}

a.product-card strong {
  color: var(--primary);
}

.product-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.product-card .bonus {
  width: fit-content;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--danger-bg);
  box-shadow: inset 0 0 0 1px var(--danger-border);
  color: var(--danger);
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 700;
}

/* De prijs is het eerste wat je zoekt: groter en vet, met de oude prijs er klein en doorgestreept naast. */
.product-card .product-card__price {
  margin-top: 4px;
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.product-card .product-card__price s {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
}

.product-card s {
  margin-left: 4px;
  color: var(--muted);
}

/* Een gekoppeld product onder een receptvoorstel: een knop die op een link lijkt en het productvenster opent. */
.offer-match {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--primary);
  text-align: left;
  cursor: pointer;
}

.offer-match:hover {
  text-decoration: underline;
}

/* De kleine vlag naast een gekoppeld product: meld dat de koppeling niet klopt. */
.offer-flag {
  appearance: none;
  border: 0;
  background: none;
  padding: 2px;
  margin-left: 4px;
  color: var(--muted);
  cursor: pointer;
  vertical-align: middle;
  line-height: 0;
  border-radius: 4px;
}

.offer-flag:hover {
  color: var(--danger);
}

.offer-flag:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.offer-flag svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.offer-match:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.product-dialog {
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(var(--shadow-ink), 0.3);
}

.product-dialog::backdrop {
  background: rgba(var(--shadow-ink), 0.5);
}

.product-dialog [hidden] {
  display: none;
}

.product-dialog__inner {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.product-dialog__body {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.product-dialog__image {
  width: 112px;
  height: 112px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  object-fit: contain;
  background: var(--surface);
}

.product-dialog h3 {
  margin: 0 0 4px;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.product-dialog p {
  margin: 4px 0;
}

.product-dialog .bonus {
  color: var(--danger);
  font-weight: 600;
}

.product-dialog s {
  margin-left: 6px;
  color: var(--muted);
}

.product-dialog__match {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.product-dialog__actions .button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.product-dialog__actions .mdi {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.product-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 480px) {
  .product-dialog__body {
    flex-direction: column;
  }
}

/* AI-beoordeling (optioneel): de balk boven de receptvoorstellen, het vinkje bij een goedgekeurde koppeling en het blok bij Instellingen. */
.offers-ai {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 8px 0;
}

.offers-ai[hidden] {
  display: none;
}

.offers-ai p {
  margin: 0;
}

#offers-ai-run .ai-run__icon {
  width: 18px;
  height: 18px;
  margin-right: 6px;
  vertical-align: middle;
  fill: currentColor;
  animation: spin 1s linear infinite;
}

.offer-ai {
  display: inline-flex;
  margin-left: 4px;
  vertical-align: middle;
  color: var(--success-text);
}

.offer-ai svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.ai-provider {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.ai-provider h3 {
  margin: 0 0 4px;
}

.offer-matches {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
}

.recipe-card .bonus {
  margin: 0;
  color: var(--danger);
  font-weight: 600;
  font-size: 14px;
}

.product-card--list {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.product-card__main {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

a.product-card__main:hover strong {
  text-decoration: underline;
}

.product-card--list.is-edited {
  border-color: var(--primary);
}

.qty {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.qty__note {
  flex: 1;
  color: var(--muted);
  font-size: 13px;
}

.qty__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.qty__step:hover {
  background: var(--selection);
  color: var(--primary-strong);
}

.qty__step svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.qty__input {
  width: 52px;
  height: 36px;
  padding: 0 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}

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

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.cart-lines {
  margin: 10px 0 0;
  padding-left: 20px;
  columns: 2 260px;
}

.picnic-recipe__image {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin-bottom: 12px;
  border-radius: var(--radius-control);
}

.picnic-recipe__list {
  margin: 8px 0 16px;
  padding-left: 22px;
  display: grid;
  gap: 6px;
}

.picnic-slots {
  margin-top: 14px;
}

.picnic-basket {
  margin-top: 14px;
}

.basket-lines {
  list-style: none;
  margin: 10px 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.basket-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
}

.basket-qty {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.basket-qty .review-qty {
  width: 64px;
  min-height: var(--control-height);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: center;
}

.basket-line.is-unavailable .basket-title {
  opacity: 0.7;
}

.basket-unavailable {
  color: var(--danger, #b3261e);
  font-weight: 600;
}

.basket-price {
  min-width: 64px;
  text-align: right;
}

@media (max-width: 560px) {
  .basket-line {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .basket-title {
    grid-column: 1 / -1;
  }
}

.review-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.review-row {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) minmax(180px, 2fr) auto 72px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 10px 12px;
}

.review-row.is-doubt {
  border-color: var(--warning-border);
  background: var(--warning-bg);
}

.review-row.is-missing {
  grid-template-columns: auto minmax(120px, 1fr) 2fr;
  border-style: dashed;
}

.review-row.is-missing .review-note {
  color: var(--muted);
}

.review-search {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.review-search[hidden] {
  display: none;
}

.review-search--extra {
  grid-column: 1 / -1;
}

.review-search-status {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 13px;
}

.review-search-status:empty {
  display: none;
}

.review-search-toggle {
  display: block;
  min-height: 0;
  margin-top: 4px;
  padding: 0;
  font-size: 13px;
  text-align: left;
}

.review-search-input {
  flex: 1;
  min-width: 0;
  min-height: var(--control-height);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  padding: 0 8px;
}

.review-note {
  display: block;
  margin-top: 3px;
  color: var(--warning-text);
  font-size: 13px;
}

.review-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.review-row .review-product,
.review-row .review-qty {
  min-height: var(--control-height);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  padding: 0 8px;
}

.review-row .review-product {
  width: 100%;
}

.store-select {
  min-height: var(--control-height);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  padding: 0 8px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s var(--ease), box-shadow 0.2s var(--ease);
}

/* Keuzelijsten: één eigen pijltje van twee kleurvlakken in plaats van het pijltje van de browser; het volgt --muted, dus ook in het donkere thema. */
select.input,
.store-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) calc(50% + 1px), calc(100% - 15px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

select.input {
  padding-left: 12px;
}

.review-link {
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}

.review-link:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .review-row {
    grid-template-columns: auto 1fr auto;
  }

  .review-row .review-ingredient,
  .review-row .review-product {
    grid-column: 2 / 4;
  }

  .review-row .review-link {
    grid-column: 2;
  }

  .review-row .review-qty {
    grid-column: 3;
    width: 72px;
  }

  .review-row.is-missing {
    grid-template-columns: auto 1fr;
  }

  .review-row.is-missing .review-search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .topbar__inner {
    flex-wrap: wrap;
    min-height: 56px;
    padding: 6px 12px 6px 16px;
  }

  .topbar p {
    display: none;
  }

  .topbar .brand-mark {
    width: 34px;
    height: 34px;
  }

  .wordmark {
    font-size: 20px;
  }

  .toolbar,
  .form-row,
  .security-actions,
  .credential-row {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .week-label {
    flex: 1 1 140px;
  }

  .form-row .button,
  .form-row .input,
  .security-actions .button,
  .security-actions .input,
  .credential-row .button {
    width: 100%;
  }
}

/* Zoekbalk bovenaan een overzicht (recepten, lijstjes) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.searchbar {
  position: relative;
  display: block;
  margin: 14px 0;
}

.searchbar__icon {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  fill: var(--muted);
  pointer-events: none;
}

.searchbar .input {
  padding-left: 42px;
}

/* Weekmenu: het plaatje uit Mealie links van de maaltijd */
.meal--with-image {
  display: flex;
  align-items: center;
  gap: 12px;
}

.meal__image {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-control);
  object-fit: cover;
  background: var(--surface-muted);
}

.meal__text {
  min-width: 0;
}

/* Receptkaarten: op een telefoon minstens twee naast elkaar, op een groter scherm zoveel als er passen */
.recipe-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.recipe-grid--compact .recipe-card {
  padding: 12px;
  gap: 10px;
}

.recipe-grid--compact .recipe-card h3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Importeren en "Open bij AH" onder elkaar, zodat de knop ook in een smalle kaart past */
.recipe-grid--compact .card-actions {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.recipe-grid--compact .card-actions .button {
  width: 100%;
  padding: 0 12px;
}

.card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  border-radius: var(--radius-control);
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.card-link:hover {
  background: var(--selection);
  color: var(--primary-strong);
}

.card-link svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: currentColor;
}

.recipe-import-result .message {
  margin: 0;
  padding: 8px 10px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

/* AH lijstjes als kaarten naast elkaar */
.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.list-card {
  position: relative;
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.list-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.list-card__open {
  display: block;
  flex: 1;
  min-width: 0;
  min-height: 88px;
  padding: 14px 52px 14px 14px;
  border: 0;
  border-radius: var(--radius-card);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.list-card__open:hover {
  background: var(--selection);
}

.list-card__open strong {
  display: block;
  color: var(--primary);
  font-size: 16px;
  line-height: 1.3;
  overflow-wrap: break-word;
  hyphens: auto;
}

.list-card__open small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.list-card .list-card__hit {
  color: var(--primary-strong);
  font-weight: 600;
}

.list-card__sync {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  min-height: 40px;
  height: 40px;
}

.icon-button svg,
.list-card__sync svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.icon-button.is-busy svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Zolang de aanbiedingen van een winkel laden: een draaiend icoon met tekst, op de plek van het raster. */
.offers-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 160px;
  color: var(--muted);
}

.offers-loading[hidden] {
  display: none;
}

.offers-loading__icon {
  width: 28px;
  height: 28px;
  flex: none;
  fill: currentColor;
  animation: spin 1s linear infinite;
}

.list-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.list-header h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.list-header .icon-button,
.list-header .button {
  flex: none;
}

.list-header__actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

.list-cart {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.list-cart svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

@media (max-width: 640px) {
  .recipe-grid--compact,
  .list-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .recipe-grid--compact .recipe-card h3 {
    font-size: 14px;
  }

  .list-header {
    flex-wrap: wrap;
  }

  .list-header h2 {
    flex: 1 1 0;
  }

  .list-header__actions {
    flex: 1 1 100%;
  }

  .list-header__actions .list-cart {
    flex: 1;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .icon-button.is-busy svg {
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .offers-loading__icon {
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  #offers-ai-run .ai-run__icon {
    animation: none;
  }
}

/* Inloggen: het wachtwoord- en MFA-formulier op de inlogpagina */
.auth-card .auth-form > .button,
.auth-card .auth-form > .link-button {
  width: 100%;
}

.auth-or {
  margin: 14px 0 0;
  text-align: center;
}

a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.link-button {
  min-height: var(--control-height);
  border: 0;
  background: none;
  color: var(--primary);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-button:hover {
  color: var(--primary-strong);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 28px;
  font-size: 15px;
  line-height: 1.4;
}

.check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--primary);
}

/* Installatiehulp (eerste start) */
body.has-onboarding {
  overflow: hidden;
}

.onboarding {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: radial-gradient(900px 420px at 50% -80px, var(--page-glow), transparent 72%), var(--bg);
}

.onboarding[hidden] {
  display: none;
}

.onboarding__card {
  width: min(680px, 100%);
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  padding: 28px;
  animation: rise-in 0.4s var(--ease) both;
}

@media (prefers-reduced-motion: reduce) {
  .onboarding__card {
    animation: none;
  }
}

.onboarding__head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.onboarding__head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.onboarding__head h2:focus {
  outline: none;
}

.onboarding__eyebrow {
  margin: 0 0 2px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.ob-progress {
  display: flex;
  gap: 6px;
  margin: 20px 0 8px;
  padding: 0;
  list-style: none;
}

.ob-progress li {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.ob-progress__dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  font-size: 13px;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}

/* Een lijn tussen de stappen: grijs voor wat nog komt, groen voor wat klaar is. */
.ob-progress li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 13px;
  left: calc(50% + 18px);
  right: calc(-50% + 12px);
  height: 2px;
  border-radius: 2px;
  background: var(--border);
}

.ob-progress li.is-done:not(:last-child)::after {
  background: var(--primary);
}

.ob-progress li.is-current {
  color: var(--primary-strong);
}

.ob-progress li.is-current .ob-progress__dot {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
  color: var(--on-primary);
}

.ob-progress li.is-done .ob-progress__dot {
  border-color: var(--primary);
  background: var(--selection);
  color: var(--primary-strong);
}

.ob-progress__label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#ob-body {
  margin-top: 12px;
  line-height: 1.55;
}

#ob-body p {
  margin: 12px 0;
}

.ob-env {
  padding: 10px 12px;
  border-radius: var(--radius-control);
  background: var(--surface-muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.ob-note {
  margin: 14px 0;
}

.ob-options {
  display: grid;
  gap: 12px;
  margin: 14px 0;
}

.ob-option {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
}

.ob-option--recommended {
  border-color: var(--primary);
  background: var(--selection);
}

.ob-option h3,
.ob-subtitle {
  margin: 0 0 6px;
  font-size: 17px;
}

.ob-subtitle {
  margin-top: 20px;
}

.ob-option p {
  margin: 0 0 12px;
  font-size: 15px;
}

.ob-badge {
  display: inline-block;
  margin-bottom: 8px;
  border-radius: 999px;
  background: var(--primary);
  padding: 2px 10px;
  color: var(--on-primary);
  font-size: 12px;
  font-weight: 700;
}

.ob-skip {
  text-align: center;
}

.ob-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
}

.ob-actions--wrap {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.ob-checklist {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.ob-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 10px 12px;
  overflow-wrap: anywhere;
}

.ob-checklist .is-ok {
  background: var(--selection);
  border-color: var(--primary);
}

.ob-check {
  flex: none;
  width: 20px;
  color: var(--primary-strong);
  font-weight: 700;
  text-align: center;
}

.qr-box {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 18px;
  align-items: start;
  margin: 16px 0;
}

.qr {
  width: 200px;
  height: 200px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  /* Een QR-code scant het best zwart op wit, ook in een donker thema */
  background: #fff;
  padding: 4px;
}

.qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.qr-help p {
  margin: 8px 0;
}

.qr-secret {
  display: inline-block;
  letter-spacing: 0.08em;
  user-select: all;
}

.recovery-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
  padding: 0;
  list-style: none;
}

.recovery-codes li {
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-muted);
  padding: 8px 10px;
  text-align: center;
}

.recovery-codes code {
  border: 0;
  background: none;
  font-size: 15px;
  letter-spacing: 0.04em;
  user-select: all;
}

@media (max-width: 640px) {
  .onboarding__card {
    padding: 18px 16px;
  }

  .onboarding__head h2 {
    font-size: 21px;
  }

  .ob-progress li:not(.is-current) .ob-progress__label {
    display: none;
  }

  .qr-box {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .qr-help {
    width: 100%;
  }

  .ob-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .ob-actions--wrap {
    flex-direction: column;
  }

  .ob-actions > span {
    display: none;
  }

  .recovery-codes {
    grid-template-columns: 1fr 1fr;
  }
}

/* Inklapbare blokken (Profiel > Beveiliging) */
.fold__title {
  margin: 0;
}

.fold__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: var(--control-height);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.fold__toggle:disabled {
  cursor: default;
}

.fold__toggle .fold__chevron {
  flex: none;
  width: 24px;
  height: 24px;
  margin-left: auto;
  fill: var(--muted);
  transition: transform 0.15s ease;
}

.fold__toggle[aria-expanded="true"] .fold__chevron {
  transform: rotate(180deg);
}

.fold__toggle.is-static .fold__chevron {
  display: none;
}

.fold__badge {
  border-radius: 999px;
  background: var(--selection);
  padding: 2px 10px;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 700;
}

.fold__body[hidden] {
  display: none;
}

.link-statuses {
  max-width: 680px; /* even breed als de blokken eronder */
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}

.link-statuses .message {
  margin: 8px 0;
}

.link-statuses {
  margin-bottom: 8px;
}

.link-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.link-status__icon {
  display: none;
  flex: none;
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.link-status--working {
  border-color: var(--success-text);
  font-weight: 600;
}

/* Op een klein scherm staan twee meldingen naast elkaar: alleen het pictogram en de naam; de tekst blijft voor schermlezers. */
@media (max-width: 640px) {
  .link-status__icon {
    display: block;
  }

  .link-status__text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .link-status__name {
    font-weight: 600;
  }
}

.fold__section {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.fold__section h3 {
  margin: 0 0 8px;
}

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

/* Over */
.about-version {
  margin: 4px 0 12px;
  font-size: 15px;
}

.about-version strong {
  margin-left: 6px;
  font-family: var(--font-heading, inherit);
  font-size: 24px;
  overflow-wrap: anywhere;
}

.about-group {
  margin: 22px 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.about-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.about-list li {
  display: grid;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 10px 12px;
}

.about-list__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.about-list__head a {
  color: var(--primary);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.about-list__version {
  border-radius: 999px;
  background: var(--surface-muted);
  padding: 1px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.about-list small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.about-list .about-list__license {
  font-size: 12px;
}

.about-coffee p {
  margin: 8px 0 14px;
}

.coffee-button svg {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  fill: currentColor;
}

/* Taalkiezer met vlaggen (nl en en) */
.flag-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.switches {
  display: flex;
  flex: none;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.lang-switch {
  display: flex;
  flex: none;
  gap: 2px;
}

/* Knop voor donker en licht, naast de vlaggen: de maan in het lichte thema, de zon in het donkere */
.theme-toggle {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--primary);
}

.theme-toggle__icon {
  grid-area: 1 / 1;
  width: 24px;
  height: 24px;
}

.theme-toggle__icon--sun,
:root[data-theme="dark"] .theme-toggle__icon--moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle__icon--sun {
  display: block;
}

.lang-switch__button {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  background: none;
  cursor: pointer;
}

.lang-switch__button .flag {
  display: block;
  width: 30px;
  height: 21px;
  border-radius: 4px;
  box-shadow: 0 0 0 1px var(--flag-ring);
  opacity: 0.55;
  transition: opacity 0.15s ease, box-shadow 0.15s ease;
}

.lang-switch__button:hover .flag {
  opacity: 0.9;
}

.lang-switch__button.is-active .flag {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary);
}

.auth-card .switches {
  margin: -8px -8px 4px 0;
  justify-content: flex-end;
}

.topbar__inner .switches + .user-menu {
  margin-left: 8px;
}

.onboarding__head .switches {
  align-self: flex-start;
  margin-right: -8px;
  margin-top: -6px;
}

@media (prefers-reduced-motion: reduce) {
  .lang-switch__button .flag {
    transition: none;
  }
}

/* Onderste menubalk: een zwevende glazen balk zoals een native tabbalk op iOS.
   Alleen in de geinstalleerde app (html.has-tabbar, zie de kop van de pagina) op een klein scherm. */
@media (max-width: 640px) {
  html.has-tabbar .shell {
    padding-bottom: calc(112px + env(safe-area-inset-bottom));
  }

  html.has-tabbar .tabs {
    position: fixed;
    z-index: 20;
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
    width: auto;
    margin: 0;
    padding: 6px;
    border: 1px solid var(--tabbar-border);
    border-radius: 32px;
    background: var(--tabbar-solid);
    box-shadow:
      0 10px 32px rgba(var(--shadow-ink), 0.16),
      0 0 0 0.5px rgba(var(--shadow-ink), 0.1),
      inset 0 1px 0 var(--tabbar-border);
  }

  @supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
    html.has-tabbar .tabs {
      background: var(--tabbar-glass);
      -webkit-backdrop-filter: saturate(180%) blur(24px);
      backdrop-filter: saturate(180%) blur(24px);
    }
  }

  html.has-tabbar .tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    min-height: 56px;
    padding: 6px 1px;
    border-radius: 26px;
    color: var(--tabbar-ink);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.1;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  html.has-tabbar .tab-icon {
    width: 24px;
    height: 24px;
  }

  html.has-tabbar .tab-text {
    display: none;
  }

  html.has-tabbar .tab-short {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html.has-tabbar .tab:hover:not(.is-active) {
    background: transparent;
    color: var(--tabbar-ink);
  }

  html.has-tabbar .tab:active {
    transform: scale(0.95);
  }

  html.has-tabbar .tab.is-active {
    background: var(--tabbar-tint);
    color: var(--tabbar-ink-active);
    box-shadow: none;
  }

  html.has-tabbar .tab.is-active > svg {
    color: inherit;
  }

  html.has-tabbar .tab:focus-visible {
    outline-offset: -3px;
  }
}

@media (max-width: 640px) and (prefers-reduced-motion: reduce) {
  html.has-tabbar .tab {
    transition: none;
  }

  html.has-tabbar .tab:active {
    transform: none;
  }
}

/* Gebruikers (Instellingen > Gebruikers) en regels die alleen de beheerder aangaan */
.user-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--selection);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 600;
}

#invite-result .form-row {
  margin: 8px 0;
}

#invite-result .input {
  flex: 1;
  min-width: 0;
}

/* Toestemmingsscherm voor AI-apps (templates/oauth.html) */
.oauth-page {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.oauth-card {
  width: 100%;
  max-width: 480px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.oauth-card h1 {
  margin: 16px 0 8px;
  font-size: 24px;
}

.oauth-card h2 {
  margin: 20px 0 6px;
  font-size: 16px;
}

.oauth-list {
  margin: 0 0 12px;
  padding-left: 20px;
}

.oauth-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* AI-apps (Profiel > AI-apps) */
.ai-guide {
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
}

.ai-guide summary {
  cursor: pointer;
  font-weight: 600;
}

.ai-code {
  margin: 8px 0 0;
  padding: 10px 12px;
  overflow-x: auto;
  border-radius: var(--radius-control);
  background: var(--surface-muted);
  font-size: 13px;
}

.ai-tools {
  margin: 0;
  padding-left: 20px;
}

.ai-tool-off {
  opacity: 0.6;
}

#profile-ai .form-row {
  flex-wrap: wrap;
  width: 100%;
}

#profile-ai .form-row .input {
  flex: 1 1 220px;
  min-width: 0;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
  font-weight: 600;
}

.switch-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

/* Kassabon: een strook papier zoals uit de kassa, ook in de donkere modus licht */
.receipt {
  --paper: #f7f4ea;
  --ink: #202020;
  position: relative;
  box-sizing: border-box;
  width: min(100%, 400px);
  margin: 12px auto 28px;
  padding: 22px 18px 20px;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.45;
  filter: drop-shadow(0 2px 5px rgb(0 0 0 / 0.22));
}

.receipt::before,
.receipt::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 9px;
  background: linear-gradient(135deg, var(--paper) 50%, transparent 50%) 0 0 / 12px 12px repeat-x,
    linear-gradient(225deg, var(--paper) 50%, transparent 50%) 0 0 / 12px 12px repeat-x;
}

.receipt::before {
  top: -9px;
  transform: scaleY(-1);
}

.receipt::after {
  bottom: -9px;
}

.receipt__head {
  display: grid;
  gap: 2px;
  margin-bottom: 14px;
  text-align: center;
}

.receipt__store {
  font-size: 18px;
  letter-spacing: 0.18em;
}

.receipt__row {
  display: grid;
  grid-template-columns: 5.5ch minmax(0, 1fr) 6ch 7ch;
  gap: 0 8px;
}

.receipt__row > span {
  overflow-wrap: anywhere;
}

.receipt__row > span:nth-child(3),
.receipt__row > span:nth-child(4) {
  text-align: right;
}

.receipt__cols {
  padding-bottom: 4px;
  margin-bottom: 4px;
  border-bottom: 1px dashed var(--ink);
  font-size: 11px;
}

.receipt__line .receipt__c1 {
  text-transform: uppercase;
}

.receipt__bonus {
  font-style: italic;
}

.receipt__section {
  margin-top: 6px;
  font-weight: 700;
}

.receipt__rule {
  margin: 8px 0;
  border-top: 1px dashed var(--ink);
}

.receipt__total,
.receipt__pay {
  grid-template-columns: minmax(0, 1fr) auto;
}

.receipt__total {
  font-size: 15px;
  font-weight: 700;
}

.receipt__total > span:nth-child(2),
.receipt__pay > span:nth-child(2) {
  text-align: right;
}

.receipt__total > span:first-child,
.receipt__pay > span:first-child {
  text-align: left;
}

.receipt-hits {
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 14px;
}

.receipt__hit {
  margin: 0 -4px;
  padding: 0 4px;
  background: #ffe97a;
  border-radius: 2px;
}

/* Updatecheck (Instellingen > Updates): een bolletje bij de tab en een melding als er een nieuwe versie is */
.update-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 2px var(--surface);
}

.message__actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.message__actions .inline-button {
  margin-top: 0;
}

/* Fabrieksinstellingen (Instellingen > Systeem > Opschonen) */
.button--danger {
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger);
}

.button--danger:hover {
  border-color: var(--danger);
}

.reset-form {
  margin-top: 16px;
}

.reset-warning ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.reset-warning li + li {
  margin-top: 4px;
}

.update-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  margin: 16px 0;
}

.update-facts dt {
  color: var(--muted);
}

.update-facts dd {
  margin: 0;
  font-weight: 600;
}

#ah-orders-main h3 {
  margin: 24px 0 10px;
}

/* Auditlog (Instellingen > Auditlog) */
.audit-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.audit-chip {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-muted);
  font-size: 13px;
}

.audit-failed {
  color: var(--danger);
  font-weight: 600;
}

.audit-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.audit-toolbar .input {
  flex: 1 1 220px;
  min-width: 0;
}

.audit-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.audit-entry {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.audit-entry.is-error {
  border-color: var(--danger-border);
}

.audit-entry summary {
  display: grid;
  grid-template-columns: max-content max-content minmax(0, 1fr) max-content max-content;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
}

.audit-action strong,
.audit-action small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-action small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.audit-time,
.audit-duration {
  font-size: 13px;
  white-space: nowrap;
}

.audit-service {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--selection);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.audit-status {
  min-width: 36px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.audit-status.is-ok {
  background: var(--success-bg);
  color: var(--success-text);
}

.audit-status.is-error {
  background: var(--danger-bg);
  color: var(--danger);
}

.audit-detail {
  padding: 0 12px 12px;
}

.audit-detail h4 {
  margin: 14px 0 6px;
  font-size: 14px;
}

.audit-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 16px;
  margin: 0;
}

.audit-facts dt {
  color: var(--muted);
}

.audit-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.audit-body {
  max-height: 320px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-muted);
  font-size: 12.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.audit-body--error {
  border-color: var(--danger-border);
  background: var(--danger-bg);
}

.audit-related {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

@media (max-width: 640px) {
  .audit-entry summary {
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    gap: 6px 10px;
  }

  .audit-time {
    grid-column: 1 / -1;
  }

  .audit-action strong,
  .audit-action small {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .audit-duration {
    display: none;
  }
}

/* Avatar en avatar-menu: op een groot scherm in de kop, op een klein scherm in de tabbalk (op de plek van Beheer). */
.avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar--lg {
  width: 44px;
  height: 44px;
  font-size: 16px;
}

.avatar--xl {
  width: 96px;
  height: 96px;
  font-size: 32px;
}

.user-menu {
  display: flex;
  margin-left: auto;
}

.user-menu__button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--control-height);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  padding: 3px 8px 3px 4px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}

.user-menu__button {
  box-shadow: var(--shadow-xs);
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.2s var(--ease);
}

.user-menu__button:hover {
  border-color: var(--border-strong);
  background: var(--selection);
  box-shadow: var(--shadow-sm);
}

.user-menu__name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu__chevron {
  width: 20px;
  height: 20px;
  fill: var(--muted);
}

.user-menu__button[aria-expanded="true"] .user-menu__chevron {
  transform: rotate(180deg);
}

.user-menu__list {
  position: fixed;
  z-index: 50;
  min-width: 220px;
  max-width: calc(100vw - 16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  animation: pop-in 0.16s var(--ease) both;
  transform-origin: top right;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-4px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .user-menu__list,
  .subtab-menu__list {
    animation: none;
  }
}

.user-menu__list[hidden] {
  display: none;
}

.user-menu__who {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
  padding: 4px 8px 12px;
}

.user-menu__who small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.user-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: var(--radius-control);
  background: none;
  padding: 0 12px;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-align: left;
}

.user-menu__item:hover,
.user-menu__item:focus-visible {
  background: var(--selection);
}

.user-menu__item[hidden] {
  display: none;
}

.tab--avatar {
  display: none;
}

.tab--avatar .avatar {
  width: 22px;
  height: 22px;
  font-size: 10px;
}

.tab[hidden] {
  display: none !important;
}

.profile-avatar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.profile-avatar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (max-width: 640px) {
  .tab--avatar:not([hidden]) {
    display: inline-flex;
  }

  .user-menu {
    display: none;
  }
}

/* Supermarktkeuze en knop onder de boodschappenlijst in het weekmenu. */
.ingredients__actions {
  margin-top: 16px;
  flex-wrap: wrap;
}

/* Navigatiemenu links op een groot scherm. Het blijft een nav met dezelfde knoppen: onder 1024px staat het zoals altijd
   boven de pagina (of als onderste menubalk in de app), en de knop om in te klappen is er dan niet. */
.tabs__toggle {
  display: none;
}

@media (min-width: 1024px) {
  .topbar__inner,
  .shell {
    max-width: 1360px;
  }

  .shell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 24px;
    align-items: start;
  }

  .shell > * {
    grid-column: 2;
    min-width: 0;
  }

  .shell > .tabs {
    grid-column: 1;
    grid-row: 1 / span 12;
    position: sticky;
    top: 88px;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 2px;
    width: 232px;
    margin-bottom: 0;
    padding: 8px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: width 0.2s ease;
  }

  .tabs .tab {
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    text-align: left;
  }

  /* Het actieve onderdeel krijgt links een groene streep, zoals in een professioneel beheerscherm. */
  .shell > .tabs .tab.is-active::before {
    content: "";
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: -7px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--primary);
  }

  .tabs__toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: var(--control-height);
    margin-top: 4px;
    padding: 0 16px;
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius-control) var(--radius-control);
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
  }

  .tabs__toggle:hover {
    background: var(--selection);
    color: var(--primary-strong);
  }

  .tabs__toggle-icon {
    flex: none;
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: transform 0.2s ease;
  }

  html.nav-collapsed .shell > .tabs {
    width: 62px;
  }

  html.nav-collapsed .tabs .tab,
  html.nav-collapsed .tabs__toggle {
    justify-content: center;
    padding: 0;
  }

  html.nav-collapsed .tabs .tab-text,
  html.nav-collapsed .tabs__toggle-text {
    display: none;
  }

  html.nav-collapsed .tabs__toggle-icon {
    transform: rotate(180deg);
  }

  html.nav-collapsed .tabs .update-dot {
    top: 6px;
    right: 6px;
  }
}

@media (min-width: 1024px) and (prefers-reduced-motion: reduce) {
  .shell > .tabs,
  .tabs__toggle-icon {
    transition: none;
  }
}

/* Instellingen > Koppelen: de aanbiedingen per winkel. */
.offers-sync-list {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  padding-left: 18px;
  font-size: 14px;
}

.offers-sync-list__failed {
  color: var(--danger);
}

#offers-sync-box .toolbar {
  margin-top: 12px;
}

/* Aanbiedingen > Prijsgeschiedenis: de zoeklijst links en het product met de grafiek rechts (op een smal scherm onder elkaar). */
.ohc-layout {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 900px) {
  .ohc-layout {
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    align-items: start;
  }
}

.ohc-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  max-height: 420px;
  overflow-y: auto;
  list-style: none;
}

.ohc-item {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ohc-item small {
  color: var(--muted);
}

.ohc-item:hover:not(.is-active) {
  background: var(--selection);
}

.ohc-item.is-active {
  border-color: var(--primary);
  background: var(--selection);
}

.ohc-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ohc-head img {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-control);
  object-fit: contain;
  background: var(--surface-muted);
}

.ohc-head h3,
.ohc-head p {
  margin: 0;
}

.ohc-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.ohc-stat {
  min-width: 120px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-muted);
}

.ohc-stat dt {
  color: var(--muted);
  font-size: 13px;
}

.ohc-stat dd {
  margin: 0;
  font-weight: 600;
}

.ohc-chart {
  overflow-x: hidden;
}

.ohc {
  display: block;
  max-width: 100%;
  font-size: 12px;
}

.ohc-grid {
  stroke: var(--border);
  stroke-width: 1;
}

.ohc-grid--x {
  stroke-dasharray: 2 4;
}

.ohc-axis,
.ohc-regular-label {
  fill: var(--muted);
  font-size: 12px;
}

.ohc-price {
  fill: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.ohc-regular {
  stroke: var(--muted);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
}

.ohc-today {
  stroke: var(--primary-strong);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

.ohc-axis--today {
  fill: var(--primary-strong);
}

.ohc-bar rect,
.ohc-bar path {
  fill: var(--primary);
}

.ohc-bar:hover rect,
.ohc-bar:hover path,
.ohc-bar:focus rect,
.ohc-bar:focus path {
  fill: var(--primary-strong);
}

.ohc-bar:focus {
  outline: none;
}

.ohc-bar:focus-visible rect {
  stroke: var(--text);
  stroke-width: 2;
}

.ohc-table {
  width: 100%;
  margin-top: 14px;
  border-collapse: collapse;
  font-size: 14px;
}

.ohc-table th,
.ohc-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.ohc-table th {
  color: var(--muted);
  font-weight: 600;
}

/* Aanbiedingen: de looptijd van de bonus, vet boven het aantal aanbiedingen. */
.offers-period {
  margin: 4px 0 0;
  font-weight: 600;
}

/* Aanbiedingen: categorieën als knoppen met het aantal ("5x Groente & Fruit"). */
.offer-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.offer-cats[hidden] {
  display: none;
}

.offer-chip {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.offer-chip:hover:not(.is-active) {
  border-color: var(--border-strong);
  background: var(--selection);
  color: var(--primary-strong);
}

.offer-chip.is-active {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: var(--btn-shadow);
  color: var(--on-primary);
}

#offers-more {
  margin-top: 14px;
}

/* Back-up en terugzetten (Instellingen > Systeem) */
#backup-box .field,
#backup-box .check {
  margin-top: 12px;
}

.backup-confirm {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.backup-confirm h4 {
  margin: 0 0 6px;
}

.backup-confirm ul {
  margin: 8px 0;
  padding-left: 20px;
}

.backup-progress {
  margin-top: 16px;
}

.backup-progress p {
  margin: 0 0 6px;
}

.backup-progress progress {
  display: block;
  width: 100%;
  height: 10px;
  accent-color: var(--primary);
}

#backup-box h3 {
  margin-top: 24px;
}
