/* ==========================================================================
   Wine Cellar: design system
   All colours live as CSS variables on :root. Mobile first.
   ========================================================================== */

/* ---------- Fonts (self hosted, work offline) ---------- */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  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: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Design tokens ---------- */
:root {
  color-scheme: light;

  --bg: #eef0f2;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --border: #e3e6ea;
  --border-input: #8a9099; /* form fields need 3:1 against their surroundings */

  --text: #1b1d21;
  --text-muted: #5b6068;

  --wine: #7a2437;
  --wine-light: #8f2c42;
  --on-wine: #ffffff;

  --gold: #7a2437; /* accent: labels, focus ring, links */
  --gold-dim: #c9a3ac;

  --ok: #4f7d5b;
  --warn: #b7791f;
  --urgent: #b03a3a;

  --type-red: #8e2a3b;
  --type-white: #cdb86a;
  --type-rose: #e0a3a1;
  --type-sparkling: #d9c58a;
  --type-red-edge: #6e1f2d; /* outline of the glass icons, so light colours show on white */
  --type-white-edge: #a48d3c;
  --type-rose-edge: #bf7c7a;
  --type-sparkling-edge: #ab9550;

  --header-top: #f7f8fa;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  --dark: #1b1d21;

  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  --font-title: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ui: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gutter: 16px;
  --max-width: 640px;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* No browser pull-to-refresh or bounce at the top: the app and the admin have their own (.pull, js/app.js and js/admin.js) */
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

/* Visible focus for keyboard users, everywhere */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

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

.app {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter) calc(6rem + env(safe-area-inset-bottom));
}

/* Small uppercase label used for eyebrows and metadata */
.label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ---------- Search ---------- */
.search {
  position: relative;
  margin-top: 1.25rem;
}

.search__icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.input {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  color: var(--text);
}

.input::placeholder {
  color: var(--text-muted);
}

.input:focus-visible {
  outline: none;
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(122, 36, 55, 0.25);
}

.search .input {
  padding-left: 2.6rem;
}

/* ---------- Filter chips + sort ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.chips {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1 1 100%;
  margin: 0 calc(var(--gutter) * -1);
  padding: 0.125rem var(--gutter);
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 36px;
  padding: 0.35rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  white-space: nowrap;
}

@media (hover: hover) {
  .chip:hover {
    border-color: var(--gold-dim);
  }
}

.chip__count {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.chip[aria-pressed="true"] {
  background: var(--wine);
  border-color: var(--wine-light);
  color: var(--on-wine);
}

.chip[aria-pressed="true"] .chip__count {
  color: var(--on-wine);
  opacity: 0.8;
}

.sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.select {
  min-height: 36px;
  padding: 0.3rem 2rem 0.3rem 0.75rem;
  background: var(--surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238d968f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 0.7rem center;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  appearance: none;
}

/* ---------- Wine card ---------- */

.wine-name {
  font-family: var(--font-title);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

/* Glass per wine type (typeGlass in js/render/icons.js): shape and colour together */
.type-glass {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  --glass-fill: var(--type-red);
  --glass-edge: var(--type-red-edge);
}

.type-glass--white { --glass-fill: var(--type-white); --glass-edge: var(--type-white-edge); }
.type-glass--rose { --glass-fill: var(--type-rose); --glass-edge: var(--type-rose-edge); }
.type-glass--sparkling { --glass-fill: var(--type-sparkling); --glass-edge: var(--type-sparkling-edge); }

.type-glass__bowl {
  fill: var(--glass-fill);
  stroke: var(--glass-edge);
  stroke-width: 1;
  stroke-linejoin: round;
}

.type-glass__stem {
  fill: none;
  stroke: var(--glass-edge);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.type-glass__bubble { fill: #ffffff; }

.badge {
  max-width: 100%;
  padding: 0.15rem 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.badge--sample {
  border-color: var(--gold-dim);
  color: var(--gold);
}

/* Status pill: solid colour, text colour chosen for contrast */
.pill {
  flex-shrink: 0;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill--ok { background: var(--ok); color: var(--bg); }
.pill--warn { background: var(--warn); color: var(--bg); }
.pill--urgent { background: var(--urgent); color: var(--text); }

/* Ripeness bar: fill width comes from --progress (0% to 100%) */
.ripeness {
  margin-top: 0.875rem;
}

.ripeness__bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.ripeness__fill {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--ok);
}

.ripeness--warn .ripeness__fill { background: var(--warn); }
.ripeness--urgent .ripeness__fill { background: var(--urgent); }

/* Quantity stepper */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none; /* also for links that look like a button */
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

@media (hover: hover) {
  .btn:hover {
    border-color: var(--gold-dim);
  }
}

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

.btn--primary {
  background: var(--wine);
  border-color: var(--wine-light);
  color: var(--on-wine);
}

@media (hover: hover) {
  .btn--primary:hover {
    background: var(--wine-light);
    border-color: var(--wine-light);
    color: var(--on-wine);
  }
}

.btn--ghost {
  background: none;
  border-color: transparent;
  color: var(--text-muted);
}

@media (hover: hover) {
  .btn--ghost:hover {
    color: var(--text);
    border-color: var(--border);
  }
}

@media (hover: hover) {
  .btn--danger:hover {
    color: var(--text);
    background: var(--urgent);
    border-color: var(--urgent);
  }
}

.btn--icon {
  width: 44px;
  padding: 0;
  border-radius: 50%;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Floating add button */
/* Floating buttons: Scan + Add wine */

/* ---------- Empty state ---------- */
.empty {
  margin-top: 2rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
}

.empty__title {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.empty .btn {
  margin-top: 1rem;
}

/* ---------- Out of stock, flat lists, history ---------- */
.pill--none {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Header actions ---------- */

.btn--small {
  min-height: 40px;
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
}

.btn--small svg {
  width: 16px;
  height: 16px;
}

/* ---------- Clickable cards ---------- */

.wine-name__btn {
  min-height: 24px; /* minimum tap target size */
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  text-align: left;
  color: inherit;
  overflow-wrap: anywhere;
}

.muted {
  color: var(--text-muted);
}

/* ---------- Modal (bottom sheet on phones, centred card on larger screens) ---------- */
body:has(.modal[open]) {
  overflow: hidden;
}

.modal {
  width: 100%;
  max-width: var(--max-width);
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.modal[open] {
  display: flex;
  flex-direction: column;
  animation: sheet-in 0.25s ease-out;
}

.modal::backdrop {
  background: rgba(8, 10, 10, 0.7);
  backdrop-filter: blur(3px);
}

@keyframes sheet-in {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (min-width: 680px) {
  .modal {
    margin: auto;
    max-height: 88vh;
    border-bottom: 1px solid var(--border);
    border-radius: 18px;
  }
}

.sheet {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: inherit;
  margin: 0;
}

.sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem var(--gutter) 1rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--header-top) 0%, var(--surface) 100%);
}

.sheet__title {
  margin-top: 0.2rem;
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.sheet__head .meta {
  margin-top: 0.25rem;
}

/* Small "Vivino ↗" pill after the wine's details (only when the page was found) */
.vivino-link {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  min-height: 24px;
  padding: 0 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--wine);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: 1px;
}

.vivino-link svg {
  width: 12px;
  height: 12px;
}

@media (hover: hover) {
  .vivino-link:hover { border-color: var(--gold-dim); }
}

.sheet__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem var(--gutter) 1.25rem;
}

.sheet__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.875rem var(--gutter) calc(0.875rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.sheet__body > p + .field {
  margin-top: 1rem;
}

.btn--danger-solid {
  background: var(--urgent);
  border-color: var(--urgent);
  color: var(--text);
}

/* ---------- Form ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem 0.75rem;
}

.field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field--wide {
  grid-column: 1 / -1;
}

.field__label {
  display: block;
  margin-bottom: 0.35rem;
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}

.field__hint {
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.field__error {
  margin-top: 0.3rem;
  font-size: 0.8125rem;
  color: #e38d8d;
}

.input[aria-invalid="true"] {
  border-color: var(--urgent);
}

.textarea {
  min-height: 5.5rem;
  resize: vertical;
  line-height: 1.45;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.375rem;
}

.segmented__option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented__option > span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  cursor: pointer;
}

.segmented__option .type-glass {
  margin: -2px 0;
}

.segmented__option input:checked + span {
  background: var(--wine);
  border-color: var(--wine-light);
  color: var(--on-wine);
}

.segmented__option input:checked + span .type-glass {
  --glass-edge: #ffffff; /* keeps the red glass visible on the burgundy button */
}

.segmented__option input:focus-visible + span {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Bottle size in the wine form (owner's choice F2): one line, "Ander formaat" shows the choice */
.bottle-size__line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: -0.25rem 0 0;
  font-size: 0.8125rem;
}

.bottle-size__line[hidden] {
  display: none;
}

.bottle-size__more {
  min-height: 44px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--wine);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.bottle-size__choice {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.segmented__option > .bottle-size__option {
  flex-direction: column;
  gap: 0;
  min-height: 52px;
  line-height: 1.2;
}

.bottle-size__option small {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Topfles switch in the wine form (owner's choice Vinkje 1) */
.top-bottle {
  background: #f8f1f3;
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem 0.65rem;
}

.top-bottle__label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
}

.top-bottle__label svg {
  width: 16px;
  height: 16px;
  color: var(--wine);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch__track {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 26px;
  background: var(--surface-2);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-pill);
  transition: background-color 0.15s ease;
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.switch input:checked + .switch__track {
  background: var(--wine);
  border-color: var(--wine-light);
}

.switch input:checked + .switch__track::after {
  transform: translateX(18px);
  background: var(--on-wine);
}

.switch input:focus-visible + .switch__track {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.more summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  color: var(--gold);
  cursor: pointer;
}

.more .form-grid {
  margin-top: 0.75rem;
}

/* ---------- Detail screen ---------- */
.detail__sample {
  display: inline-block;
  margin-bottom: 0.75rem;
}

.detail-block {
  padding-bottom: 1.1rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
}

.detail-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.detail-block .ripeness {
  margin-top: 0.75rem;
}

.detail__window {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Serving temperature under the ripeness (owner's choice T1) */
.detail__serve {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.detail__serve svg {
  width: 18px;
  height: 18px;
  color: var(--wine);
  flex: none;
}

.detail__serve-tip {
  margin-top: 0.2rem;
}

.detail__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.detail__sources {
  margin-top: 0.9rem;
  overflow-wrap: anywhere;
}

.detail__sources a {
  color: var(--gold);
}

.spinner.spinner--small {
  width: 14px;
  height: 14px;
  margin: 0;
  border-width: 2px;
}

.detail__text {
  margin-top: 0.4rem;
}

.detail__subhead {
  margin-top: 1rem;
}

.flavours {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.flavour {
  padding: 0.25rem 0.7rem;
  background: rgba(122, 36, 55, 0.1);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  color: var(--text);
  overflow-wrap: anywhere;
}

.detail__notes {
  margin: 0.5rem 0 0;
  padding-left: 0.9rem;
  border-left: 2px solid var(--wine-light);
  font-family: var(--font-title);
  font-style: italic;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem 1rem;
  margin: 0;
}

.fact dt {
  font-size: 0.625rem;
  color: var(--text-muted);
}

.fact dd {
  margin: 0.15rem 0 0;
  overflow-wrap: anywhere;
}

/* Small grey line under a fact, e.g. the adviesprijs under your own price */
.fact__sub {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ---------- Empty state art ---------- */
.empty__art {
  display: block;
  width: 44px;
  height: 66px;
  margin: 0 auto 1rem;
  color: var(--gold-dim);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(5.5rem + env(safe-area-inset-bottom));
  z-index: 10;
  width: min(calc(100% - 2 * var(--gutter)), 480px);
  transform: translate(-50%, 1rem);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

.toast__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.9rem 0.75rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-size: 0.9rem;
}

.toast__action {
  min-height: 36px;
  padding: 0.3rem 0.6rem;
  background: none;
  border: 0;
  font-weight: 600;
  color: var(--gold);
}

/* ---------- Sync status ---------- */
.sync {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 28px;
  margin-top: 0.3rem;
  padding: 0;
  background: none;
  border: 0;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.sync__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}

.sync--synced .sync__dot { background: var(--ok); }
.sync--syncing .sync__dot,
.sync--connecting .sync__dot { background: var(--gold); animation: pulse 1.2s ease-in-out infinite; }
.sync--offline .sync__dot,
.sync--no-storage .sync__dot,
.sync--error .sync__dot { background: var(--warn); }

@keyframes pulse {
  50% { opacity: 0.3; }
}

/* ---------- PIN lock screen ---------- */
.lock {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  /* The content stays in the part above the on-screen keyboard (js/app.js sets these from visualViewport) */
  padding:
    calc(1.5rem + env(safe-area-inset-top) + var(--keyboard-top, 0px)) var(--gutter)
    calc(1.5rem + env(safe-area-inset-bottom) + var(--keyboard-bottom, 0px));
  scroll-padding: var(--keyboard-top, 0px) 0 var(--keyboard-bottom, 0px);
  overflow-y: auto;
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(111, 31, 44, 0.35), transparent 70%),
    linear-gradient(180deg, var(--header-top) 0%, var(--bg) 100%);
}

.lock[hidden] {
  display: none;
}

body.is-locked {
  overflow: hidden;
}

.lock__card {
  width: 100%;
  max-width: 360px;
  /* Centred, but starts at the top when it does not fit (then you can scroll) */
  margin: auto;
  text-align: center;
  animation: card-in 0.5s ease-out both;
}

/* Loading card: appears only when the server takes a moment, otherwise the PIN card comes first */
.lock__card--loading {
  animation-delay: 0.6s;
}

.lock__logo {
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  border-radius: 14px;
}

.lock__title {
  margin-top: 0.4rem;
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 500;
}

.lock__tagline {
  margin-top: 0.25rem;
  font-family: var(--font-title);
  font-style: italic;
  color: var(--gold);
}

.lock__text {
  margin-top: 0.5rem;
  color: var(--text-muted);
}

.lock__text em {
  font-family: var(--font-title);
  color: var(--gold);
}

.lock__form {
  margin-top: 1.5rem;
}

.lock__input {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  letter-spacing: 0.4em;
  text-align: center;
}

.lock__error {
  min-height: 1.3rem;
}

.lock__button {
  width: 100%;
  margin-top: 0.75rem;
}

.lock__hint {
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* "App installeren" at the top of the login screen (Android) */
.lock__install {
  margin-bottom: 1.5rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.lock__install[hidden] {
  display: none;
}

.lock__install-button {
  width: 100%;
  background: var(--surface-2);
  font-weight: 700;
}

.lock__install-text {
  margin-top: 0.4rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Keyboard open (or a small screen): only what you need, so the button stays above the keyboard */
.lock--compact {
  padding-top: calc(0.75rem + env(safe-area-inset-top) + var(--keyboard-top, 0px));
  padding-bottom: calc(0.75rem + var(--keyboard-bottom, 0px));
}

.lock--compact .lock__logo,
.lock--compact .lock__tagline,
.lock--compact .lock__install-text {
  display: none;
}

.lock--compact .lock__install {
  margin-bottom: 0.75rem;
  padding: 0.5rem;
}

.lock--compact .lock__title {
  margin-top: 0.2rem;
  font-size: 1.5rem;
}

.lock--compact .lock__form {
  margin-top: 0.75rem;
}

.lock--compact .lock__hint {
  margin-top: 0.75rem;
}

/* ---------- Welcome tour ---------- */
.welcome__body {
  padding-top: 2rem;
  text-align: center;
}

.welcome__art {
  display: grid;
  place-items: center;
  height: 88px;
  margin-bottom: 1rem;
  color: var(--gold);
}

.welcome__art .empty__art {
  margin: 0;
  color: var(--gold);
}

/* "Zo lees je een wijn": an example wine card instead of an icon */
.welcome__art--card {
  height: auto;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
}

.welcome__card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 250px;
  padding: 0.7rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.08);
  text-align: left;
}

.welcome__card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.welcome__card-title {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.welcome__card-name {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.3;
}

.welcome__card-meta {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.welcome__card-bar {
  display: block;
  height: 5px;
  border-radius: 3px;
  background: var(--bg);
  overflow: hidden;
}

.welcome__card-bar span {
  display: block;
  width: 78%;
  height: 100%;
  background: #d59a3a;
}

.welcome__legend {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 250px;
  padding: 0 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--gold);
}

.welcome__icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 1px solid var(--gold-dim);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, rgba(162, 58, 74, 0.35), transparent 70%);
}

.welcome__icon svg {
  width: 34px;
  height: 34px;
}

.welcome__title {
  margin-top: 0.4rem;
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.welcome__text {
  max-width: 34ch;
  margin: 0.75rem auto 0;
  color: var(--text-muted);
}

.welcome__dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1.5rem;
}

.welcome__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border-input);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.welcome__dot.is-active {
  background: var(--gold);
  transform: scale(1.3);
}

.welcome .sheet__body {
  animation: card-in 0.35s ease-out both;
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 3rem;
  padding: 1.25rem 0 0.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer__name {
  color: var(--gold);
}

.footer__tagline {
  margin-top: 0.2rem;
  font-family: var(--font-title);
  font-style: italic;
  color: var(--text-muted);
}

.footer .meta {
  margin-top: 0.2rem;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
}

.footer__storage {
  overflow-wrap: anywhere;
}

.env-banner {
  margin-bottom: 1rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--warn);
  border-radius: var(--radius-sm);
  background: rgba(183, 121, 31, 0.12);
  color: var(--text);
  font-size: 0.875rem;
}

.backup-group {
  margin-top: 1.25rem;
}

.backup-group .label {
  margin-bottom: 0.5rem;
}

.backup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.backup__main {
  flex: 1;
  min-width: 10rem;
}

.backup__title {
  font-weight: 500;
}

.backup__confirm {
  flex: 1 1 100%;
  padding: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-sm);
}

.backup__confirm .sheet__actions {
  margin-top: 0.6rem;
  justify-content: flex-end;
}

.footer__tour {
  margin-top: 0.5rem;
  color: var(--text-muted);
}

/* ---------- Photo recognition ---------- */
.ai-model {
  margin-top: 0.35rem;
  color: var(--gold);
}

.scan-status {
  padding: 2rem 0;
  text-align: center;
}

.scan-status p + p {
  margin-top: 0.4rem;
}

.spinner {
  display: inline-block;
  width: 36px;
  height: 36px;
  margin-bottom: 1rem;
  border: 3px solid var(--surface-2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  /* Keep a slow, visible hint that work is happening */
  .spinner { animation: pulse 1.6s ease-in-out infinite !important; animation-duration: 1.6s !important; }
}

.proposal {
  margin-bottom: 0.875rem;
  padding: 0.875rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: opacity 0.15s ease;
}

.proposal--skipped {
  opacity: 0.5;
}

.proposal__head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.proposal__title {
  flex: 1;
  min-width: 0;
}

.proposal__title .wine-name {
  font-size: 1.05rem;
}

.proposal__note,
.proposal__match {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.proposal__match {
  color: var(--gold);
}

.proposal__quick {
  margin-top: 0.75rem;
}

.proposal .more {
  margin-top: 0.25rem;
}

.badge--high { border-color: var(--ok); color: var(--text); }
.badge--medium { border-color: var(--warn); color: var(--warn); }
.badge--low { border-color: var(--urgent); color: #e38d8d; }

.input--compact {
  min-height: 44px;
  padding: 0.5rem 0.75rem;
}

.select--full {
  width: 100%;
  min-height: 44px;
  font-size: 1rem;
}

.switch--small {
  min-height: 32px;
  margin-top: 0.1rem;
}

/* Scan review: look up this new wine after adding? (2.8.0) */
.proposal__enrich {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.proposal__enrich-label {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 600;
}

.proposal__enrich .switch--small {
  margin-top: 0;
}

.enrich-tag {
  padding: 0.1rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.enrich-tag--free { background: #e3efe6; color: #2f5a3b; }
.enrich-tag--paid { background: #f3e3e7; color: var(--wine); }
.enrich-tag--off { background: var(--surface-2); color: var(--text-muted); }

.scan-enrich-all {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.scan-enrich-all__label {
  font-size: 0.875rem;
  font-weight: 700;
}

.scan-enrich {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  flex-basis: 100%;
  margin: 0;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.scan-enrich svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 0.1rem;
  color: var(--wine);
}

.scan-enrich--free {
  background: #e3efe6;
  color: #23452d;
}

.scan-enrich--free svg {
  color: #2f5a3b;
}

.sheet__foot--spread {
  align-items: center;
  justify-content: space-between;
}

.sheet__actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

/* ---------- Friendly motion ---------- */
@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes glow {
  0% { box-shadow: 0 0 0 0 rgba(122, 36, 55, 0.45), var(--shadow); }
  100% { box-shadow: 0 0 0 14px rgba(122, 36, 55, 0), var(--shadow); }
}

.wine-card--new {
  animation: card-in 0.45s ease-out both, glow 1.2s ease-out 0.3s;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Larger screens ---------- */
@media (min-width: 560px) {
  

  .chips {
    flex: 1 1 auto;
    margin: 0;
    padding: 0.125rem 0;
  }
}

/* ==========================================================================
   Pages: overview, cellar and history with the bottom menu
   ========================================================================== */


/* Shared parts that need a small tweak on light backgrounds */
.label { letter-spacing: 0.06em; font-weight: 700; }
.pill { letter-spacing: 0; text-transform: none; font-weight: 700; font-size: 0.6875rem; }
.pill--ok,
.pill--urgent,
.btn--danger-solid { color: #ffffff; }
.pill--warn { color: var(--text); }
.badge--low { color: var(--urgent); }
.sheet__title,
.wine-name,
.empty__title { font-weight: 700; font-style: normal; }
.footer__tagline { font-style: normal; }
.modal::backdrop { background: rgba(27, 29, 33, 0.45); }
.modal { box-shadow: 0 -10px 40px rgba(27, 29, 33, 0.2); }
.toast__inner { box-shadow: 0 10px 30px rgba(27, 29, 33, 0.2); }

.empty { background: var(--surface); border-style: solid; }

.app {
  padding-bottom: calc(7rem + env(safe-area-inset-bottom));
}

.toast {
  bottom: calc(6.5rem + env(safe-area-inset-bottom));
}

.dash {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.dash-card {
  background: var(--surface);
  border-radius: var(--radius);
}

.dash-muted {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Page title */
.dash-head {
  padding-top: calc(1.75rem + env(safe-area-inset-top));
}

.dash-head__eyebrow,
.dash-head__sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.dash-head__title {
  margin-top: 0.25rem;
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.dash-head__sub {
  margin-top: 0.1rem;
}

.dash-head .sync {
  margin-top: 0.15rem;
  font-size: 0.75rem;
}

/* Three small numbers */
.dash-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.625rem;
}

.dash-tile {
  padding: 0.75rem 0.875rem;
  border-radius: 16px;
  min-width: 0;
}

.dash-tile__label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dash-tile__value {
  margin-top: 0.1rem;
  font-size: 1.25rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-tile__value--word {
  font-size: 0.9375rem;
  line-height: 1.9rem;
}

/* Card with a title */
.dash-section {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 1rem 1.125rem;
}

.dash-section__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.dash-section__title {
  font-size: 0.9375rem;
  font-weight: 700;
}

.dash-section__count {
  font-weight: 500;
  color: var(--text-muted);
}

.dash-link {
  min-height: 44px;
  margin: -0.75rem -0.5rem;
  padding: 0 0.5rem;
  background: none;
  border: 0;
  color: var(--wine);
  font-size: 0.8125rem;
  font-weight: 700;
}

/* "Alle 6 wijnen" under the list on the Overzicht (3.1.0) */
.dash-link--below {
  display: block;
  margin: 0.25rem 0 -0.5rem auto;
}

/* Ripeness: one bar in three parts */
.dash-ripeness {
  display: flex;
  gap: 2px;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
}

.dash-ripeness__part { width: var(--size); }
.dash-ripeness__part--now { background: var(--urgent); }
.dash-ripeness__part--soon { background: #d59a3a; }
.dash-ripeness__part--wait { background: #5e8c69; }

.dash-ripeness__legend {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #3f434a;
}

/* Bottles per country */
.dash-bars {
  display: grid;
  grid-template-columns: minmax(0, 6rem) minmax(0, 1fr) 1.75rem;
  gap: 0.5rem 0.625rem;
  align-items: center;
  font-size: 0.8125rem;
}

.dash-bars__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-bars__track { display: block; }

.dash-bars__fill {
  display: block;
  width: var(--size);
  min-width: 10px;
  height: 10px;
  border-radius: 5px;
  background: var(--wine);
}

.dash-bars__fill--rest { background: #9aa0a8; }
.dash-bars__count { text-align: right; }

/* Jouw smaak on Historie (W068, 3.2.0): label, favourite, average score */
.taste {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.875rem;
}

.taste__row {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) auto;
  gap: 0.625rem;
  align-items: center;
}

.taste__label { color: var(--text-muted); font-size: 0.8125rem; }

.taste__value {
  margin: 0;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.taste__score {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.taste__star { display: flex; color: var(--warn); }
.taste__star svg { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.taste__count { font-weight: 500; color: var(--text-muted); }
.taste__foot { font-size: 0.75rem; color: var(--text-muted); }

/* Rows inside a card (ready to drink, history) */
.dash-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dash-list li + li .dash-row {
  border-top: 1px solid var(--border);
}

/* History row: the row itself plus a small bin button on the right */
.dash-hist {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.dash-hist + .dash-hist { border-top: 1px solid var(--border); }
.dash-list .dash-hist + .dash-hist .dash-row { border-top: 0; }
.dash-hist .dash-row { flex: 1; min-width: 0; }

.dash-hist__remove {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-right: -0.5rem;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 50%;
  color: #8a9099;
}

.dash-hist__remove svg { width: 18px; height: 18px; }

@media (hover: hover) {
  .dash-hist__remove:hover { background: #f4e6e9; color: var(--urgent); }
}

.remove-history__hint { margin-top: 0.6rem; font-size: 0.875rem; }
.remove-history__hint strong { color: var(--text); }

.dash-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 56px;
  padding: 0.5rem 0;
  background: none;
  border: 0;
  color: var(--text);
  text-align: left;
}

.dash-row__main { min-width: 0; }

.dash-row__title,
.dash-row__meta {
  display: block;
  overflow-wrap: anywhere;
}

.dash-row__title {
  font-size: 0.9375rem;
  font-weight: 700;
}

.dash-row__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dash-row__date {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--wine);
}

@media (hover: hover) {
  button.dash-row:hover .dash-row__title { color: var(--wine); }
}

/* Cellar: segmented control, chips and wine cards */
.dash .search { margin-top: 0; }
.dash .search .input { border-radius: 14px; }

.dash-seg {
  display: grid;
  /* Each tab as wide as its name, so "Laatst toegevoegd" stays on one line on a 360 px phone */
  grid-template-columns: repeat(3, auto);
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border-radius: 14px;
}

.dash-seg__item {
  min-height: 40px;
  padding-inline: 0.5rem;
  white-space: nowrap;
  background: none;
  border: 0;
  border-radius: 10px;
  color: #3f434a;
  font-size: 0.8125rem;
  font-weight: 500;
}

.dash-seg__item[aria-selected="true"] {
  background: var(--dark);
  color: #ffffff;
  font-weight: 700;
}

.dash .toolbar { margin-top: 0; }

.chip {
  background: var(--surface);
  border-color: #d5d9de;
  color: var(--text);
  font-weight: 600;
}

.chip[aria-pressed="true"] {
  background: var(--wine);
  border-color: var(--wine);
  color: #ffffff;
}

.chip[aria-pressed="true"] .chip__count { color: #ffffff; opacity: 0.8; }

.dash-group {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.dash-group + .dash-group { margin-top: 1rem; }

.dash-group__title {
  margin-bottom: -0.125rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-muted);
}

.dash-wine {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0.875rem 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  cursor: pointer;
}

.dash-wine--empty { opacity: 0.6; }

.dash-wine__top {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
}

.dash-wine__top .type-glass {
  margin-top: 0;
}

.dash-wine__title {
  flex: 1;
  min-width: 0;
}

.dash-wine__name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.dash-wine__meta {
  margin-top: 0.1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.dash-size {
  color: var(--wine);
  font-weight: 700;
}

.dash-sample {
  color: var(--wine);
  font-weight: 600;
}

.dash-wine__bar {
  height: 6px;
  border-radius: 3px;
  background: var(--bg);
  overflow: hidden;
}

.dash-wine__bar.ripeness--ok .ripeness__fill { background: #5e8c69; }
.dash-wine__bar.ripeness--warn .ripeness__fill { background: #d59a3a; }
.dash-wine__bar.ripeness--urgent .ripeness__fill { background: var(--urgent); }

.dash-wine__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.dash-qty {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 2px;
  background: var(--bg);
  border-radius: 999px;
}

.dash-qty__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--surface);
  border: 0;
  border-radius: 50%;
  color: var(--text);
}

.dash-qty__btn svg { width: 16px; height: 16px; }
.dash-qty__btn:disabled { opacity: 0.35; cursor: not-allowed; }

.dash-qty__value {
  min-width: 1.5rem;
  text-align: center;
  font-weight: 700;
}

.dash-wine__price {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Buttons of the dashboard pages */
.dash-btn {
  min-height: 44px;
  padding: 0 0.875rem;
  border: 0;
  border-radius: 12px;
  font-size: 0.8125rem;
  font-weight: 700;
}

.dash-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.dash-btn--dark { background: var(--dark); color: #ffffff; }
.dash-btn--wine { background: var(--wine); color: #ffffff; }
.dash-btn--light { background: var(--surface); color: var(--text); border: 1px solid #d5d9de; }

.dash-btn--block {
  width: 100%;
  min-height: 52px;
  border-radius: 14px;
  font-size: 1rem;
}

/* History page: one card per month */
.dash-month {
  padding: 0.5rem 1.125rem 0.25rem;
}

.dash-month + .dash-month { margin-top: 0.875rem; }

.dash-month__title {
  margin: 0.5rem 0 0.125rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Bottom navigation + round add button */
.dash-nav {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)); /* Overzicht, Kelder, plus, Eten, Historie */
  align-items: center;
  width: min(calc(100% - 2 * var(--gutter)), calc(var(--max-width) - 2 * var(--gutter)));
  height: 64px;
  padding: 0 10px;
  box-sizing: border-box;
  transform: translateX(-50%);
  background: var(--dark);
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(27, 29, 33, 0.25);
}

.dash-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 52px;
  padding: 0;
  background: none;
  border: 0;
  color: #b6bbc3;
  font-size: 0.6875rem;
  font-weight: 500;
}

.dash-nav__item svg { width: 20px; height: 20px; flex-shrink: 0; }

.dash-nav__item[aria-current="page"] {
  color: #ffffff;
  font-weight: 700;
}

.dash-nav__item:focus-visible { outline-color: #ffffff; outline-offset: -4px; }

/* The raised plus in the middle of the menu */
.dash-nav__plus-slot {
  display: flex;
  justify-content: center;
}

.dash-nav__plus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  margin-top: -30px;
  padding: 0;
  background: var(--wine);
  border: 4px solid var(--bg);
  border-radius: 50%;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(27, 29, 33, 0.25);
}

.dash-nav__plus svg { width: 26px; height: 26px; }
.dash-nav__plus:focus-visible { outline-color: var(--wine); outline-offset: 2px; }

/* "Wijn toevoegen" choice sheet */
.modal--add-choice { background: var(--bg); }

.add-choice__head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem var(--gutter) 0.25rem;
}

.add-choice__grip {
  position: absolute;
  top: 0.625rem;
  left: 50%;
  width: 40px;
  height: 4px;
  margin-left: -20px;
  border-radius: 2px;
  background: #c4c9cf;
}

.add-choice__title {
  font-size: 1.25rem;
  font-weight: 800;
}

.add-choice__list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0.5rem var(--gutter) calc(1.25rem + env(safe-area-inset-bottom));
}

.add-choice__item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-height: 72px;
  padding: 0.75rem 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text);
  text-align: left;
}

@media (hover: hover) {
  .add-choice__item:hover { border-color: var(--gold-dim); }
}

.add-choice__icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #f4e6e9;
  color: var(--wine);
}

.add-choice__icon--primary {
  background: var(--wine);
  color: #ffffff;
}

.add-choice__icon svg { width: 22px; height: 22px; }

.add-choice__name,
.add-choice__text { display: block; }
.add-choice__name { font-size: 1rem; font-weight: 700; }
.add-choice__text { font-size: 0.8125rem; color: var(--text-muted); }

/* "Alleen opzoeken, niet toevoegen": a small grey link, not one of the big choices (3.5.0) */
.add-choice__lookup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 44px;
  margin-top: 0.125rem;
  padding: 0.5rem;
  background: none;
  border: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.add-choice__lookup svg { width: 16px; height: 16px; flex-shrink: 0; }
.add-choice__lookup:disabled { opacity: 0.5; }

.lookup__note { margin-top: 0.5rem; }
.lookup__form { align-items: start; }
.lookup__form > p + .field { margin-top: 0; }
.lookup__choices { padding: 1rem 0 0; }
.lookup__match,
.lookup__notice {
  margin-bottom: 1rem;
  padding: 0.75rem 0.875rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.875rem;
}
.lookup__match { border-color: var(--gold-dim); }

/* ---------- Accounts: login screen, AI actions, footer ---------- */
.lock__field {
  margin-top: 0.75rem;
  text-align: left;
}

.lock__field:first-child {
  margin-top: 0;
}

.lock__form .input {
  width: 100%;
}

.lock__text em {
  font-style: normal;
  font-weight: 700;
}

.add-choice__ai {
  margin: 0.25rem var(--gutter) 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.add-choice__ai--blocked {
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  background: #f8ecd9;
  color: var(--text);
}

.add-choice__plus {
  margin-left: 0.4rem;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--wine);
  color: var(--on-wine);
  font-size: 0.6875rem;
  font-weight: 700;
  vertical-align: 0.15em;
}

.add-choice__item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.detail__ai {
  margin-top: 0.25rem;
}

.footer__account {
  margin: 1rem 0 0.5rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ---------- Drawers: where a wine lies (form, card, detail) ---------- */
.field__optional {
  font-weight: 400;
}

.drawers__add {
  display: flex;
  gap: 0.5rem;
}

.drawers__input {
  width: 7.5rem;
}

.drawers__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
}

.drawers__list:empty {
  display: none;
}

.drawer-chip {
  display: inline-flex;
  align-items: center;
  padding-left: 0.85rem;
  border-radius: var(--radius-pill);
  background: var(--wine);
  color: var(--on-wine);
  font-size: 0.9375rem;
  font-weight: 700;
}

.drawer-chip__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 40px;
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
}

.drawer-chip__remove svg {
  width: 16px;
  height: 16px;
}

/* ---------- Tasting: score (stars) and note of an opened bottle ---------- */
.tasting {
  margin: 1rem 0 0;
  padding: 0;
  border: 0;
}

.tasting__score {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  margin-bottom: 0.75rem;
}

.star-input {
  display: flex;
}

.star-input__star {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  cursor: pointer;
  color: var(--border-input);
}

.star-input__star svg,
.stars svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.star-input__star svg {
  width: 30px;
  height: 30px;
}

/* data-rating is set by js/app.js as soon as a star is tapped */
.star-input[data-rating="1"] .star-input__star:nth-of-type(-n+1),
.star-input[data-rating="2"] .star-input__star:nth-of-type(-n+2),
.star-input[data-rating="3"] .star-input__star:nth-of-type(-n+3),
.star-input[data-rating="4"] .star-input__star:nth-of-type(-n+4),
.star-input[data-rating="5"] .star-input__star:nth-of-type(-n+5),
.star--on {
  color: var(--warn);
}

.star-input[data-rating="1"] .star-input__star:nth-of-type(-n+1) svg,
.star-input[data-rating="2"] .star-input__star:nth-of-type(-n+2) svg,
.star-input[data-rating="3"] .star-input__star:nth-of-type(-n+3) svg,
.star-input[data-rating="4"] .star-input__star:nth-of-type(-n+4) svg,
.star-input[data-rating="5"] .star-input__star:nth-of-type(-n+5) svg,
.star--on svg {
  fill: currentColor;
}

.star-input__radio:focus-visible + .star-input__star {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}

.tasting__label {
  font-size: 0.875rem;
  font-weight: 700;
}

.stars {
  display: inline-flex;
  gap: 1px;
  color: var(--border-input);
}

.stars svg {
  width: 15px;
  height: 15px;
}

/* History: stars and note under a bottle, or the button to add them */
.dash-hist {
  flex-wrap: wrap;
}

.dash-hist__tasting,
.dash-hist__rate {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 36px;
  margin: -0.35rem 0 0.5rem;
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
}

.dash-hist__note {
  min-width: 0;
  overflow: hidden;
  font-size: 0.8125rem;
  font-style: italic;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-hist__rate {
  align-self: flex-start;
  flex-basis: auto;
  gap: 0.3rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--wine);
}

.dash-hist__rate svg {
  width: 14px;
  height: 14px;
}

/* Detail screen: earlier bottles with a score or note */
.tasting-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

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

.tasting-list__note {
  margin-top: 0.2rem;
  font-size: 0.9375rem;
  font-style: italic;
}

/* ---------- Import a list (Excel or CSV) ---------- */
.import-steps {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
}

.import-steps__download {
  display: inline-flex;
  margin-top: 0.5rem;
  color: var(--text);
  text-decoration: none;
}

.import-summary {
  margin-bottom: 0.35rem;
}

.import-note {
  margin-top: 0.35rem;
}

.import-list {
  display: flex;
  flex-direction: column;
  margin: 0.9rem 0 0.5rem;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.import-list__item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.import-list__item .type-glass {
  margin-top: 0.1rem;
}

.import-list__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.import-list__title {
  font-weight: 700;
}

/* ---------- Admin dashboard (admin.html) ---------- */
.admin {
  padding-bottom: calc(3rem + env(safe-area-inset-bottom));
}

.admin .toast {
  bottom: calc(1.5rem + env(safe-area-inset-bottom));
}

.admin-head {
  position: relative;
  padding-right: 6.5rem; /* room for Menu */
}

/* Menu: top right, next to the title; on a computer the menu stays on the left instead */
.admin-head__menu {
  position: absolute;
  top: calc(1.75rem + env(safe-area-inset-top) - 0.5rem);
  right: 0;
  gap: 0.4rem;
  border-radius: var(--radius-pill);
}

.admin-head__menu svg {
  width: 18px;
  height: 18px;
}

/* Something waits on Overzicht (a delete request or an account long not used) */
.admin-head__dot {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #b3261e;
  border: 2px solid var(--surface);
}

.admin-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 1rem;
}

.admin-totals__tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-totals__value {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.admin-totals__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.admin-card,
.admin-user {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
}

.admin-card__title,
.admin-user[hidden],
.admin-user__body[hidden] {
  display: none;
}

/* Admin: each account folded to one line until you tap it (2.7.0) */
.admin-user__title {
  font-size: inherit;
}

.admin-user__toggle {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  width: 100%;
  min-height: 44px;
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  text-align: left;
}

/* Name, plan and status on one line (2.8.2) */
.admin-user__row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

/* A long name wraps; the labels stay level with its first line */
.admin-user__row .admin-user__tags,
.admin-user__row .admin-user__chevron {
  margin-top: 0.15rem;
}

.admin-user__row .admin-user__name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-user__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.admin-user__sub {
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.admin-user__chevron {
  display: inline-flex;
  color: var(--text-muted);
}

.admin-user__chevron svg {
  width: 18px;
  height: 18px;
  transform: rotate(90deg);
  transition: transform 0.15s ease;
}

/* Folded: AI actions as a small bar with "4/15" (owner's choice, Balk 2) */
.admin-user__meter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.3rem;
}

.admin-user__meter .admin-bar {
  flex: 1;
  height: 6px;
}

.admin-user__count {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

/* Open: the badges and the bar stand in the card itself */
.admin-user.is-open .admin-user__tags,
.admin-user.is-open .admin-user__meter {
  display: none;
}

.admin-user.is-open .admin-user__chevron svg {
  transform: rotate(-90deg);
}

.admin-user__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-user__name {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.125rem;
  font-weight: 800;
}

/* Admin: search and filters above the accounts */
.admin-accounts__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.admin-accounts__head .admin-section {
  margin-top: 0;
}

.admin-accounts__all {
  min-height: 44px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--wine);
  font-size: 0.8125rem;
  font-weight: 700;
}

.admin-accounts__search {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-accounts__chips {
  flex-wrap: wrap;
  overflow: visible;
  margin: 0;
  padding: 0;
}

.admin-accounts__results:empty {
  display: none;
}

.admin-user__signup {
  display: inline-flex;
  color: var(--text-muted);
}

.admin-user__signup svg {
  width: 18px;
  height: 18px;
}

.admin-section {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.admin-form {
  display: grid;
  /* Phones: one field per row; wider screens: side by side (see the media query below) */
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.admin-form .input {
  width: 100%;
}

.admin-form__submit {
  grid-column: 1 / -1;
}

.admin-form--row {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
}

.admin-form--single {
  grid-template-columns: minmax(0, 1fr);
}

.admin-form__save {
  min-height: 44px;
}

.admin-user--blocked {
  opacity: 0.7;
}

.admin-user__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-user__badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.admin-status {
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--text-muted);
}

.admin-status--active { background: #e3efe6; color: #2f5a3b; }
.admin-status--invited { background: #f8ecd9; color: #7a4f0f; }
.admin-status--blocked { background: #f6e0e0; color: #8a2a2a; }
/* Login screen: "Gratis account maken", and the box to agree on the sign up screen */
.lock__signup {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.lock__signup-title {
  margin-bottom: 0.5rem;
  font-weight: 700;
}

/* Word lid page (/aanmelden): back link, what you get, and the button or "not possible now" */
.lock__back {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  margin: -0.5rem auto 1rem 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--wine);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.lock__back svg,
.lock__join svg,
.lock__join-full svg {
  flex: none;
  width: 20px;
  height: 20px;
}

.lock__join {
  margin: 1.5rem 0 0;
  padding: 0.25rem 1rem;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
}

.lock__join li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.lock__join li + li { border-top: 1px solid var(--border); }

.lock__join li svg {
  margin-top: 0.1rem;
  color: var(--wine);
}

.lock__join-wait {
  margin-top: 1.25rem;
  color: var(--text-muted);
}

.lock__join-full {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: #f6eef0;
  color: var(--text);
  font-weight: 600;
  text-align: left;
}

.lock__join-full svg { color: var(--wine); }

.lock__check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 0.9rem;
  text-align: left;
  font-size: 0.875rem;
}

.lock__check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0.1rem 0 0;
  accent-color: var(--wine);
}

/* ---------- Account sheet (footer "Account") ---------- */
.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-height: 56px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.account-rows > :last-child { border-bottom: 0; }

/* "Je kelder": import, CSV, backups and the tour (in the footer until 3.1.0) */
.account-sheet__group {
  margin-top: 1.5rem;
}

/* Afmelden on its own, under a line */
.account-rows--last {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
}

/* A row with a second line under its name (E-mailadres) */
.account-row__text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
  padding-block: 0.625rem;
}

.account-row__sub {
  overflow-wrap: anywhere;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.account-sheet__verify {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 1rem;
}

.account-row svg {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.account-sheet__end {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.75rem;
  text-align: center;
}

/* Deleting is possible, but not a button that catches the eye */
.account-sheet__remove {
  min-height: 44px;
  padding: 0.75rem 0.5rem;
  border: 0;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.75rem;
  text-decoration: underline;
  cursor: pointer;
}

.admin-status--plus { background: var(--wine); color: var(--on-wine); }
.admin-status--royaal { background: var(--dark); color: #ffffff; }
.admin-status--gratis { background: var(--surface-2); color: var(--text-muted); }

.admin-usage {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-usage__top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.admin-bar {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  overflow: hidden;
}

.admin-bar__fill {
  display: block;
  width: var(--progress);
  height: 100%;
  border-radius: inherit;
  background: var(--ok);
}

.admin-bar--full .admin-bar__fill {
  background: var(--urgent);
}

.admin-actions {
  /* Equal buttons in two columns, so they line up on every screen */
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.admin-actions .btn {
  width: 100%;
  white-space: normal;
  text-align: center;
  line-height: 1.25;
}

.admin-actions__danger {
  color: var(--urgent);
}

.admin-link,
.admin-confirm {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.admin-link__text {
  font-size: 0.875rem;
}

.admin-link__url {
  width: 100%;
  font-size: 0.8125rem;
}

.admin-confirm {
  background: #f6e0e0;
}

/* Admin menu (owner's choice A, 2.19.0): a sheet from the bottom on a phone, always on the left on a computer */
.admin-menu,
.admin-menu__backdrop {
  display: none;
}

.is-menu-open .admin-menu__backdrop {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 40;
  border: 0;
  background: rgba(27, 29, 33, 0.35);
}

.is-menu-open .admin-menu {
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  max-height: 85vh;
  overflow-y: auto;
  padding: 0.75rem var(--gutter) calc(1.25rem + env(safe-area-inset-bottom));
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 30px rgba(27, 29, 33, 0.2);
}

.admin-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-menu__title {
  font-size: 1.125rem;
  font-weight: 800;
}

.admin-menu__brand {
  display: none;
  margin: 0 0.75rem 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.admin-menu__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-menu__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 50px;
  padding: 0 0.75rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.admin-menu__item svg {
  width: 20px;
  height: 20px;
  flex: none;
}

.admin-menu__item[aria-current="page"] {
  background: #f8f1f3;
  color: var(--wine);
  font-weight: 700;
}

.admin-menu__label {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-menu__count {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.admin-menu__badge {
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.admin-menu__badge--urgent {
  background: #b3261e;
  color: #ffffff;
}

.admin-menu__logout {
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
  border-radius: 0;
  color: var(--text-muted);
}

@media (hover: hover) {
  .admin-menu__item:hover {
    background: var(--surface-2);
  }
}

/* Overzicht and the new account card: titles that stay visible (the other card titles are hidden) */
.admin-overview__title {
  font-size: 0.9375rem;
  font-weight: 800;
}

.admin-plans-count {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  text-align: center;
}

.admin-plans-count__tile {
  display: flex;
  flex-direction: column;
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.admin-plans-count__tile--plus {
  background: #f8f1f3;
  color: var(--wine);
}

.admin-create__open {
  gap: 0.5rem;
  min-height: 48px;
}

.admin-create__open svg {
  width: 18px;
  height: 18px;
}

.admin-create__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Instellingen: AI actions per plan as a small table */
.admin-plans {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-plans__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.5rem;
  align-items: center;
}

.admin-plans__head {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.admin-plans__name {
  font-weight: 700;
}

.admin-plans__none {
  padding-left: 0.75rem;
  color: var(--text-muted);
}

.admin-accounts__list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.admin-panel {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.admin-filters {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Advice badges: Doen, Later, Niet, Klaar and Hebben we */
.admin-advice {
  flex: none;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.6875rem;
  font-weight: 700;
  white-space: nowrap;
}

.admin-advice--doen,
.admin-advice--have { background: #e3efe6; color: #2f5a3b; }
.admin-advice--later { background: #f8ecd9; color: #7a4f0f; }
.admin-advice--niet { background: var(--surface-2); color: var(--text-muted); }
.admin-advice--klaar { background: #e6eef7; color: #24496e; }

/* Werklijst: each item folded to one line until you tap it */
.admin-roadmap__group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-roadmap__group .admin-section {
  margin-top: 0.25rem;
}

.admin-roadmap__list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-roadmap__item {
  background: var(--surface);
  border-radius: 14px;
}

.admin-roadmap__item[hidden],
.admin-roadmap__group[hidden],
.admin-roadmap__body[hidden],
.admin-compare__more[hidden] {
  display: none;
}

.admin-roadmap__toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 52px;
  padding: 0.7rem 0.875rem;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.admin-roadmap__head {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.admin-roadmap__title {
  font-size: 0.9375rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* Fixed code of a werklijst item, such as W012 (owner's wish, 20 okt 2026) */
.admin-roadmap__code {
  display: inline-block;
  margin-right: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.admin-roadmap__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.admin-roadmap__item.is-open .admin-user__chevron svg {
  transform: rotate(-90deg);
}

.admin-roadmap__body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0 0.875rem 0.875rem;
}

.admin-roadmap__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.admin-roadmap__status--ontwerp { background: #f3e3e7; color: var(--wine); }
.admin-roadmap__status--bezig { background: #f8ecd9; color: #7a4f0f; }

.admin-roadmap__when {
  font-size: 0.8125rem;
  font-weight: 600;
}

.admin-roadmap__reason {
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.admin-roadmap__reason strong {
  color: var(--text);
}

.admin-roadmap__link {
  align-self: flex-start;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--wine);
}

/* Concurrenten: prices, then the table */
.admin-prices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0.875rem;
}

.admin-prices__app {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  font-size: 0.75rem;
}

.admin-prices__name {
  font-size: 0.9375rem;
  font-weight: 800;
}

.admin-prices__name a {
  color: inherit;
}

.admin-prices__price {
  font-weight: 600;
}

.admin-prices__note {
  color: var(--text-muted);
}

.admin-compare {
  overflow: hidden;
}

.admin-compare__table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.admin-compare__col { width: 3.5rem; }
.admin-compare__col-advice { width: 0; }

.admin-compare__table thead th {
  padding: 0.65rem 0.25rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  text-align: center;
}

.admin-compare__table thead th:first-child {
  padding-left: 0.875rem;
  text-align: left;
}

.admin-compare__group th {
  padding: 0.9rem 0.875rem 0.35rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

.admin-compare__row > * {
  border-top: 1px solid var(--border);
  vertical-align: middle;
}

.admin-compare__feature {
  padding: 0;
  font-weight: inherit;
  text-align: left;
}

.admin-compare__toggle {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  min-height: 48px;
  padding: 0.55rem 0.25rem 0.55rem 0.875rem;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.admin-compare__name {
  font-size: 0.875rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.admin-compare__row.is-open .admin-compare__name {
  color: var(--wine);
}

/* Phone: advice under the name, no notes and no advice column */
.admin-compare__note,
.admin-compare__advice {
  display: none;
}

.admin-compare__cell {
  padding: 0 0.15rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.admin-compare__cell--free { color: #2f5a3b; }
.admin-compare__cell--paid { color: var(--wine); }
.admin-compare__cell--yes { color: var(--text); }
.admin-compare__cell--none,
.admin-compare__cell--unknown { color: #8a9099; }

.admin-compare__more td {
  padding: 0 0.875rem 0.875rem;
}

.admin-compare__why {
  margin-bottom: 0.45rem;
  font-size: 0.875rem;
}

.admin-compare__go {
  min-height: 44px;
  margin-top: 0.25rem;
  padding: 0;
  background: none;
  border: 0;
  color: var(--wine);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}

.admin-compare__legend {
  font-size: 0.8125rem;
}

/* Computer: wider, accounts next to the settings, werklijst in two columns, a full table */
@media (min-width: 900px) {
  .app.admin {
    max-width: 1240px;
  }

  /* The menu stays on the left; no Menu button */
  .admin-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
  }

  .admin-menu,
  .is-menu-open .admin-menu {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    inset: auto;
    z-index: auto;
    max-height: none;
    padding: calc(1.75rem + env(safe-area-inset-top)) 0 1.5rem;
    background: none;
    border-radius: 0;
    box-shadow: none;
  }

  .admin-menu__head,
  .admin-menu__backdrop,
  .is-menu-open .admin-menu__backdrop,
  .admin-head__menu {
    display: none;
  }

  .admin-menu__brand {
    display: block;
  }

  .admin-head {
    padding-right: 0;
  }

  .admin-menu__item[aria-current="page"] {
    background: var(--surface);
  }

  /* Overzicht and Instellingen: cards side by side */
  .admin-panel--overzicht,
  .admin-panel--instellingen {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .admin-panel--overzicht .admin-totals {
    grid-column: 1 / -1;
  }

  .admin-panel--accounts .admin-create__open {
    align-self: flex-start;
    padding: 0 1.25rem;
  }

  /* Accounts: one column, not wider than reads well */
  .admin-panel--accounts {
    max-width: 52rem;
  }

  .admin-filters {
    flex-direction: row;
    align-items: flex-end;
    gap: 1rem;
  }

  .admin-filters .admin-accounts__search {
    flex: 0 0 22rem;
  }

  .admin-roadmap__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .admin-prices {
    padding: 1.1rem 1.25rem;
    gap: 1rem;
    font-size: 0.875rem;
  }

  .admin-prices__app {
    font-size: 0.875rem;
  }

  .admin-prices__name {
    font-size: 1.125rem;
  }

  .admin-compare__col { width: 6.5rem; }
  .admin-compare__col-advice { width: 7.5rem; }

  .admin-compare__table thead th {
    font-size: 0.75rem;
  }

  .admin-compare__table thead th:first-child,
  .admin-compare__group th,
  .admin-compare__more td {
    padding-left: 1.25rem;
  }

  .admin-compare__toggle {
    padding-left: 1.25rem;
  }

  .admin-compare__advice-inline {
    display: none;
  }

  .admin-compare__note {
    display: block;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 400;
  }

  .admin-compare__advice {
    display: table-cell;
    padding-right: 1.25rem;
    text-align: left;
  }

  .admin-compare__cell {
    font-size: 0.8125rem;
  }

  /* The note already shows in the row */
  .admin-compare__why {
    display: none;
  }

  .admin-compare__more .admin-roadmap__reason {
    max-width: 52rem;
  }
}

@media (min-width: 600px) {
  .admin-form:not(.admin-form--row):not(.admin-form--single) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .admin-form--row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .admin-form__save {
    grid-column: 1 / -1;
  }
}

/* "Inloggen met je wachtwoord" on the PIN screen */
.lock__link {
  padding: 0;
  background: none;
  border: 0;
  color: var(--wine);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

/* "Trek omlaag om te vernieuwen": follows the finger down from the top (js/app.js sets --pull) */
.pull {
  position: fixed;
  top: env(safe-area-inset-top);
  left: 50%;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: 0 4px 16px -6px rgba(16, 24, 40, 0.25);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  transform: translate(-50%, calc(var(--pull, 0px) - 100%));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.pull.is-visible {
  opacity: 1;
}

.pull .spinner {
  display: none;
}

.pull.is-busy .spinner {
  display: inline-block;
}

/* Admin: the AI is off for every account (2.12.0) */
.admin-alert {
  border: 1px solid var(--urgent);
  border-left-width: 5px;
}

/* Card titles are hidden in the dashboard; this one is the point of the card */
.admin-alert .admin-card__title {
  display: block;
  margin: 0;
  font-size: 1.05rem;
  color: var(--urgent);
}

.admin-alert p {
  margin: 0;
}

/* Admin: households that asked to delete their account */
.admin-requests__list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.25rem;
}

.admin-requests__list a {
  color: var(--wine);
  font-weight: 700;
}

/* ---------- Wijn bij je eten (js/render/pairing.js, 2.11.0) ---------- */
.pairing-form,
.pairing-plus,
.pairing-none {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
}

.pairing-occasions {
  margin: 0;
  padding: 0;
  border: 0;
}

.pairing-occasions__row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.pairing-occasion {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-width: 0;
  min-height: 56px;
  padding: 0.4rem 0.1rem;
  background: var(--surface);
  border: 1px solid #d5d9de;
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  text-align: center;
  cursor: pointer;
}

/* "Doordeweeks" is the longest: the size follows the screen so it stays on one line (360px phones too) */
.pairing-occasion__label {
  max-width: 100%;
  font-size: clamp(0.6875rem, 3.4vw, 0.875rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.pairing-occasion__sub {
  font-size: 0.6875rem;
  line-height: 1.25;
  color: var(--text-muted);
}

.pairing-occasion[aria-pressed="true"] {
  background: var(--wine);
  border-color: var(--wine);
  color: #ffffff;
}

.pairing-occasion[aria-pressed="true"] .pairing-occasion__sub {
  color: #ffffff;
  opacity: 0.85;
}

.pairing-form__submit {
  width: 100%;
}

.pairing-form__cost {
  font-size: 0.8125rem;
}

.pairing-result,
.pairing-example {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.pairing-pick {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.875rem 1rem;
}

.pairing-pick__top {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.pairing-pick__name {
  flex: 1;
  min-width: 0;
  font-size: 1rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.pairing-match {
  flex: none;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.6875rem;
  font-weight: 700;
  white-space: nowrap;
}

.pairing-match--top { background: #e3efe6; color: #2f5a3b; }
.pairing-match--good { background: var(--surface-2); color: var(--text-muted); }

.pairing-pick__meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.pairing-pick__reason {
  font-size: 0.875rem;
  line-height: 1.45;
}

.pairing-pick__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.pairing-none__title {
  font-weight: 700;
}

.pairing-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--wine);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
}

.pairing-plus a {
  color: var(--wine);
  font-weight: 700;
}

.pairing-example .pairing-pick {
  opacity: 0.9;
}

.pairing-example__note {
  font-size: 0.8125rem;
}

/* Wijn bij je eten: "Niet deze" and wines without a price (2.13.0) */
.pairing-skip {
  min-height: 36px;
  margin-left: auto;
  padding: 0 0.25rem;
  background: none;
  border: 0;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.pairing-prices {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: #f8ecd9;
  color: #5c3b0b;
  font-size: 0.8125rem;
}

.pairing-prices .btn {
  background: #ffffff;
  border-color: #c58a2b;
  color: #5c3b0b;
}

.pairing-prices__list {
  display: flex;
  flex-direction: column;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.pairing-price {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--border);
}

.pairing-price__wine {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.pairing-price__name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.pairing-price__meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.pairing-price__field {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 7.5rem;
}

.pairing-price__field .input {
  min-width: 0;
}

.pairing-price .field__error {
  flex-basis: 100%;
  margin: 0;
}

/* "Nieuw" pop up: Wijn bij je eten, once per device (2.14.0) */
.news__body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.news__label {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: #f3e3e7;
  color: var(--wine);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.news__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.news__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #f3e3e7;
  color: var(--wine);
}

.news__icon svg {
  width: 26px;
  height: 26px;
}

.news__title {
  flex: 1;
  font-size: 1.375rem;
  font-weight: 800;
}

.news__text {
  line-height: 1.5;
}

.news__example {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.75rem;
  border-radius: 14px;
  background: var(--surface-2);
}

.news__example-label,
.news__note {
  font-size: 0.8125rem;
}

.news__example-label {
  color: var(--text-muted);
}

.news__example-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.news__example-name {
  flex: 1;
  font-weight: 700;
}

.news__example-reason {
  font-size: 0.875rem;
}

.news__note a {
  color: var(--wine);
  font-weight: 700;
}

.news__foot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ---------- Paying for Plus and Royaal (3.0.0-beta, js/render/billing.js) ---------- */
.plan-cards,
.subscription,
.checkout {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.plan-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.plan-card.is-current { border: 2px solid var(--wine); padding: calc(0.9rem - 1px) calc(1rem - 1px); }

.plan-card__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  width: 100%;
}

.plan-card__price { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.plan-card__now { margin: 0; color: var(--wine); font-size: 0.8125rem; font-weight: 700; }

.link-button {
  align-self: center;
  min-height: 44px;
  padding: 0 0.5rem;
  border: 0;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.875rem;
  text-decoration: underline;
  cursor: pointer;
}

.checkout .lock__check { margin-top: 0; }
.checkout__test { margin: 0; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); background: var(--bg); font-size: 0.8125rem; font-weight: 700; }
.checkout__methods { margin: 0; }
.checkout__required { margin: 0 0 -0.25rem; }

/* Automatisch verlengen or Eenmalig (3.0.0-beta.9): the texts follow the chosen way without a script */
.checkout__ways { display: flex; flex-direction: column; gap: 0.5rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.checkout__ways .field__label { margin-bottom: 0.25rem; padding: 0; }
.checkout__way {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.checkout__way:has(input:checked) { border: 2px solid var(--wine); padding: calc(0.75rem - 1px) calc(0.9rem - 1px); }
.checkout__way input { margin-top: 0.2rem; accent-color: var(--wine); flex: none; }
.checkout__way > span { display: flex; flex-direction: column; gap: 0.1rem; }
.checkout--choice:has(#checkout-way-prepaid:checked) .checkout__only-auto,
.checkout--choice:not(:has(#checkout-way-prepaid:checked)) .checkout__only-prepaid { display: none; }

.notice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.notice--warn { border: 1px solid var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
.notice__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.25rem; }
.billing-notice { margin-bottom: 0.75rem; }

.pill-status { padding: 0.15rem 0.6rem; border-radius: var(--radius-pill); font-size: 0.75rem; font-weight: 700; }
.pill-status--ok { background: color-mix(in srgb, var(--ok) 15%, var(--surface)); color: var(--ok); }

.subscription__actions { display: flex; flex-direction: column; gap: 0.5rem; }
.subscription__title { margin: 0.75rem 0 0; font-size: 0.95rem; }
.subscription__cancel { margin-top: 0.5rem; }

.invoice-list { display: flex; flex-direction: column; }

.invoice-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
}

.invoice-list > :last-child { border-bottom: 0; }
.invoice-row__amount { display: inline-flex; align-items: center; gap: 0.4rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.invoice-row svg { width: 16px; height: 16px; color: var(--text-muted); }

/* Paying per account in the dashboard (3.0.0-beta) */
.admin-billing {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
}

.admin-billing p { margin: 0; }
/* Wie kan betalen? (3.0.1): the ways to pay only when someone can pay */
.admin-who { display: flex; flex-direction: column; gap: 0.5rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.admin-who .field__label { padding: 0; margin-bottom: 0.15rem; }
.admin-who__option {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.admin-who__option:has(input:checked) { border: 2px solid var(--wine); padding: calc(0.7rem - 1px) calc(0.85rem - 1px); }
.admin-who__option input { margin-top: 0.2rem; accent-color: var(--wine); flex: none; }
.admin-who__option > span { display: flex; flex-direction: column; gap: 0.1rem; }
.admin-who__option .dash-muted { font-size: 0.8125rem; }
.admin-pay-form:has(#pay-who-none:checked) .admin-ways { display: none; }
.admin-ways { display: flex; flex-direction: column; gap: 0.6rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.admin-ways .field__label { padding: 0; margin-bottom: 0.15rem; }
.admin-link code { overflow-wrap: anywhere; }

/* Cijfers and Betalingen in the dashboard (3.0.0-beta, js/render/adminPay.js) */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.admin-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.admin-stat__value { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.admin-stat__label { color: var(--text-muted); font-size: 0.8125rem; }
.admin-stat__note { font-size: 0.75rem; color: var(--text-muted); }
.admin-stat--warn .admin-stat__value { color: var(--warn); }
.admin-stat--urgent .admin-stat__value { color: var(--urgent); }
.admin-stat-mode { align-self: center; color: var(--warn); font-size: 0.8125rem; font-weight: 700; }

.admin-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.admin-chart { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.admin-chart__svg { display: block; width: 100%; height: auto; }
.admin-chart__grid { stroke: var(--border); stroke-width: 1; }
.admin-chart__axis { fill: var(--text-muted); font-size: 16px; font-family: var(--font-ui); }
.admin-chart__bar,
.admin-chart__bar--plus { fill: var(--wine); }
.admin-chart__bar--royaal { fill: var(--dark); }
.admin-chart__bar--gratis { fill: var(--border); }
.admin-chart__legend { display: flex; flex-wrap: wrap; gap: 1rem; color: var(--text-muted); font-size: 0.8125rem; }
.admin-chart__key { display: inline-block; width: 10px; height: 10px; margin-right: 0.35rem; border-radius: 3px; background: var(--border); }
.admin-chart__key--plus { background: var(--wine); }
.admin-chart__key--royaal { background: var(--dark); }

/* Verkoop and Gebruikers on Cijfers (3.0.0-beta.7) */
.admin-section-title { margin: 0.5rem 0 0; font-size: 1.125rem; font-weight: 800; }
.admin-chart__bar--scan { fill: var(--wine); }
.admin-chart__bar--enrich { fill: var(--dark); }
.admin-chart__bar--pair { fill: var(--gold-dim); }
.admin-chart__key--scan { background: var(--wine); }
.admin-chart__key--enrich { background: var(--dark); }
.admin-chart__key--pair { background: var(--gold-dim); }

.admin-hbars { display: flex; flex-direction: column; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.admin-hbars__row {
  display: grid;
  grid-template-columns: minmax(7rem, 40%) 1fr auto;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
}
.admin-hbars__label { min-width: 0; overflow-wrap: anywhere; }
.admin-hbars__track { height: 10px; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; }
.admin-hbars__fill { display: block; height: 100%; min-width: 2px; border-radius: var(--radius-pill); background: var(--wine); }
.admin-hbars__value { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.admin-hbars__value small { color: var(--text-muted); font-weight: 500; }

.admin-loss { display: flex; flex-direction: column; gap: 0.5rem; margin: 0; padding: 0; list-style: none; font-size: 0.875rem; }
.admin-loss li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; }
.admin-loss small { color: var(--text-muted); }

.admin-pay-tools { display: flex; flex-direction: column; gap: 0.75rem; }

/* Terug te betalen (3.0.0-beta.10): the owner pays every refund back himself */
.admin-due__list { display: flex; flex-direction: column; margin: 0.25rem 0 0; padding: 0; list-style: none; }
.admin-due__item { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.75rem 0; border-top: 1px solid var(--border); }
.admin-due__item:first-child { border-top: 0; }
.admin-due__item p { margin: 0; overflow-wrap: anywhere; }
.admin-due__row { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; }
.admin-due__who { min-width: 0; overflow-wrap: anywhere; }
.admin-due__amount { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Status page (3.0.0-beta.7, js/render/adminHealth.js) */
.admin-health__head { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.admin-health__head p { margin: 0; }
.admin-health__summary { font-size: 1.125rem; font-weight: 800; }
.admin-health__summary--ok { color: var(--ok); }
.admin-health__summary--warn { color: var(--warn); }
.admin-health__summary--error { color: var(--urgent); }
.admin-health { display: flex; flex-direction: column; margin: 0.25rem 0 0; padding: 0; list-style: none; }
.admin-health__item { padding: 0.75rem 0; border-top: 1px solid var(--border); }
.admin-health__item:first-child { border-top: 0; }
.admin-health__row { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.admin-health__label { font-weight: 700; min-width: 0; }
.admin-health__row .admin-status { flex: none; }
.admin-health__detail { margin: 0.25rem 0 0; color: var(--text-muted); font-size: 0.875rem; overflow-wrap: anywhere; }
.admin-pay-list { display: flex; flex-direction: column; gap: 0.5rem; }

.admin-pay {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.admin-pay__row {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) auto auto 5.5rem;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 48px;
  padding: 0.5rem 0.9rem;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
}

.admin-pay__who { min-width: 0; overflow-wrap: anywhere; }
.admin-pay__amount { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; white-space: nowrap; }
.admin-pay__invoice { font-variant-numeric: tabular-nums; text-align: right; }
.admin-pay__body { display: flex; flex-direction: column; gap: 0.5rem; padding: 0 0.9rem 0.9rem; }
.admin-pay__body p { margin: 0; overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .admin-pay__row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "who amount" "date status" "invoice invoice";
    row-gap: 0.25rem;
  }
  .admin-pay__who { grid-area: who; }
  .admin-pay__amount { grid-area: amount; }
  .admin-pay__date { grid-area: date; font-size: 0.75rem; color: var(--text-muted); }
  .admin-pay__row .admin-status { grid-area: status; justify-self: end; }
  .admin-pay__invoice { grid-area: invoice; font-size: 0.75rem; text-align: left; }
}

/* ---------- Cadeaucodes (3.6.0) ---------- */
.admin-gift-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.admin-gifts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.admin-gift { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.75rem 0; border-top: 1px solid var(--border); }
.admin-gift:first-child { border-top: 0; padding-top: 0; }
.admin-gift__top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.admin-gift__code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 700; letter-spacing: 0.04em; overflow-wrap: anywhere; }
.admin-gift__code--big { font-size: 1.25rem; margin: 0.25rem 0 0.5rem; }
.admin-gift-made { margin-top: 1rem; padding: 0.875rem; border: 1px solid var(--gold-dim); border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 0.375rem; }
.admin-gift-made .input { width: 100%; }

.lock__gift { margin-top: 1rem; padding: 0.875rem 1rem; border: 1px solid var(--gold-dim); border-radius: 14px; background: var(--surface); text-align: left; display: flex; flex-direction: column; gap: 0.375rem; }
.lock__gift-title { font-weight: 800; font-size: 1.0625rem; }
.lock__gift-code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 700; letter-spacing: 0.04em; color: var(--text-muted); }
.gift-code__input { width: 100%; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.04em; text-transform: uppercase; }
