/* ── Design tokens ─────────────────────────────── */
:root {
  --ink: #1c1c1c;
  --ink-2: #3a3a3a;
  --ink-3: #6a6a6a;
  --ink-4: #9a9a9a;
  --paper: #f4f1ea;
  --paper-2: #ece8df;
  --screen: #ffffff;
  --chip: #eceae4;
  --accent: #5a8a3a;
  --accent-soft: #dce8ce;
  --divider: #f0efea;
  --border: #ddd;
  --error-bg: #ffeaea;
  --error-fg: #d32f2f;
  --ok-bg: #e8f5e9;
  --ok-fg: #2e7d32;
}

[data-theme="dark"] {
  --ink: #e8e4dc;
  --ink-2: #cdc8bc;
  --ink-3: #a09a90;
  --ink-4: #706a60;
  --paper: #1a1917;
  --paper-2: #242220;
  --screen: #2a2826;
  --chip: #333028;
  --accent: #7ab856;
  --accent-soft: #2a3d1e;
  --divider: #3a3830;
  --border: #3a3830;
  --error-bg: #3a1a1a;
  --error-fg: #f08080;
  --ok-bg: #1a3020;
  --ok-fg: #80c880;
}

/* ── Base ───────────────────────────────────────── */
html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1:focus { outline: none; }

/* ── MudBlazor overrides ────────────────────────── */
.mud-typography, .mud-button, .mud-input, .mud-chip { font-family: 'Inter', sans-serif !important; }

/* ── Update banner ──────────────────────────────── */
.update-banner {
  position: fixed;
  bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.22);
  z-index: 2000;
  -webkit-tap-highlight-color: transparent;
  animation: slide-up 0.3s ease;
}
.update-banner .material-symbols-rounded { font-size: 18px; }
@keyframes slide-up {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── App shell ──────────────────────────────────── */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--screen);
}
.app-shell-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── App bar ────────────────────────────────────── */
.din-appbar {
  flex: 0 0 auto;
  padding: 10px 16px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--screen);
}
.din-appbar .appbar-title { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; color: var(--ink); }
.din-appbar .appbar-sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.din-appbar .appbar-actions { display: flex; gap: 10px; color: var(--ink-2); }
.din-appbar .appbar-actions .material-symbols-rounded { font-size: 22px; cursor: pointer; }
.din-appbar .appbar-actions .material-symbols-rounded.disabled { opacity: 0.4; pointer-events: none; }

/* ── Status pill ────────────────────────────────── */
.pill {
  display: inline-block;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--chip);
  color: var(--ink-3);
  margin-left: 8px;
  vertical-align: middle;
}
.pill.confirmed { background: var(--accent-soft); color: var(--accent); }

/* ── Bottom nav ─────────────────────────────────── */
.botnav {
  flex: 0 0 auto;
  border-top: 1px solid var(--divider);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 60px;
  background: var(--screen);
  padding-bottom: env(safe-area-inset-bottom);
}
.botnav .tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--ink-4);
  font-size: 9px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.botnav .tab.active { color: var(--accent); }
.botnav .tab.active .material-symbols-rounded { font-variation-settings: 'FILL' 1; }
.botnav .tab .material-symbols-rounded { font-size: 22px; }

/* ── Install prompt banner ──────────────────────── */
.install-banner {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface, #fff);
  border-top: 1px solid var(--divider);
  box-shadow: 0 -8px 16px -8px rgba(0, 0, 0, 0.08);
}
.install-banner-icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.install-banner-icon .material-symbols-rounded { font-size: 22px; }
.install-banner-text { flex: 1 1 auto; min-width: 0; }
.install-banner-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.install-banner-sub { font-size: 11px; color: var(--ink-3); line-height: 1.3; }
.install-banner .din-btn { padding: 6px 12px; font-size: 12px; }

/* ── Page content ───────────────────────────────── */
.page-body {
  padding: 0 14px 80px;
}

/* ── Inline banner (vervangt toast op Home) ─────── */
.inline-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px; font-weight: 500;
  margin-bottom: 10px;
  animation: banner-in 0.2s ease-out;
}
@keyframes banner-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.inline-banner .material-symbols-rounded { font-size: 18px; flex-shrink: 0; }
.inline-banner.error { background: var(--error-bg); color: var(--error-fg); }
.inline-banner.info  { background: var(--accent-soft); color: var(--accent); }

/* ── Shopping bar ───────────────────────────────── */
.shop-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 10px;
  margin: 8px 0 10px;
}
.shop-bar .material-symbols-rounded { font-size: 14px; }
.shop-bar .shop-day { margin-left: auto; font-weight: 700; }

/* ── Day card (Home V1) ─────────────────────────── */

/* Wrapper handles overflow clipping and today highlight */
.day-slide-wrapper {
  position: relative;
  overflow-x: clip;
}
.day-slide-wrapper.today {
  background: var(--accent-soft);
  margin: 0 -14px;
  padding: 0 14px;
  border-left: 3px solid var(--accent);
}
.day-slide-wrapper:last-of-type .day-card { border-bottom: none; }

/* Card row scopes the slide-reveal actions to the card height only,
   so they don't overlap the review/swap panels below. */
.day-card-row { position: relative; }

/* Slide-reveal action buttons (hidden behind card until slid) */
.slide-actions {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  display: flex;
  align-items: stretch;
}
.slide-action-btn {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; width: 72px; border: none;
  font-size: 10px; font-weight: 700; letter-spacing: 0.03em;
  color: #fff; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.slide-action-btn .material-symbols-rounded { font-size: 22px; }
.slide-action-btn.action-detail   { background: #2e7d32; }
.slide-action-btn.action-detail:hover { background: #388e3c; }
.slide-action-btn.action-external { background: #1565c0; }
.slide-action-btn.action-external:hover { background: #1976d2; }

.day-card {
  display: flex;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--divider);
  position: relative;
  background: var(--screen);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}
.day-slide-wrapper.today .day-card { background: var(--accent-soft); }
.day-card.slid-1 { transform: translateX(-72px); }
.day-card.slid-2 { transform: translateX(-144px); }
.day-card.swap-highlight {
  animation: swap-highlight 1.2s ease-out forwards;
}
@keyframes swap-highlight {
  0%   { background-color: var(--accent-soft); }
  60%  { background-color: var(--accent-soft); }
  100% { background-color: var(--surface); }
}
.day-card .card-thumb {
  width: 68px; height: 68px;
  flex: 0 0 auto;
  border-radius: 12px;
  object-fit: cover;
  background: var(--paper-2);
}
.day-card .card-thumb.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-4);
}
.day-card .card-thumb.placeholder .material-symbols-rounded { font-size: 22px; }
.day-card .card-meta { flex: 1 1 auto; min-width: 0; padding-top: 2px; }
.day-card .card-dayline {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--ink-3); text-transform: uppercase;
}
.day-card .card-title {
  font-size: 14px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 3px;
}
.day-card .card-tag { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.day-card .day-action {
  flex: 0 0 auto;
  align-self: center;
  background: transparent;
  border: none;
  padding: 6px;
  border-radius: 8px;
  color: var(--ink-3);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.day-card .day-action:hover { background: var(--paper-2); color: var(--ink); }
.day-card .day-action.active { color: var(--accent); background: var(--accent-soft); }
.day-card .day-action.has-occasion { color: var(--accent); }
.day-card .day-action.cook { color: var(--accent); }
.day-card .day-action:disabled { opacity: 0.4; pointer-events: none; }
.day-card .day-action .material-symbols-rounded { font-size: 20px; }
.day-card .card-dayline .cooked-chip {
  display: inline-flex; align-items: center; gap: 3px;
  margin-left: 6px;
  color: var(--accent);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}
.day-card .card-dayline .cooked-chip .material-symbols-rounded { font-size: 11px; }
.day-card .card-tag .occasion-chip-inline {
  display: inline-flex; align-items: center; gap: 3px;
  margin-left: 6px;
  font-size: 10px; font-weight: 500;
  color: var(--accent);
}


/* ── Recipe swap panel ──────────────────────────── */
.swap-panel {
  padding: 8px 0 12px 80px;
  border-bottom: 1px solid var(--divider);
}
.swap-panel-hd {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-4);
  margin-bottom: 6px;
}
.swap-alt {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; margin: 0 -8px;
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.swap-alt:hover { background: var(--paper-2); }
.swap-alt-thumb {
  width: 36px; height: 36px;
  flex: 0 0 auto;
  border-radius: 8px; object-fit: cover;
  background: var(--paper-2);
}
.swap-alt-thumb.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-4);
}
.swap-alt-thumb.placeholder .material-symbols-rounded { font-size: 18px; }
.swap-alt-meta-col { flex: 1 1 auto; min-width: 0; }
.swap-alt-name {
  font-size: 13px; font-weight: 500; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.swap-alt-tag { font-size: 10px; color: var(--ink-4); margin-top: 1px; }
.swap-empty {
  font-size: 11px; color: var(--ink-4); font-style: italic;
  padding: 4px 0 4px 2px;
}

/* ── Occasion picker ────────────────────────────── */
.occasion-grid {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.occasion-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--screen);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.occasion-chip:hover { background: var(--paper-2); }
.occasion-chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.occasion-chip.clear { color: var(--ink-4); }
.occasion-chip.clear:hover { color: var(--error-fg); }

/* ── Review panel (cook event + emoji) ──────────── */
.review-panel {
  padding: 8px 0 12px 66px;
  border-bottom: 1px solid var(--divider);
}
.review-panel-hd {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-4);
  margin-bottom: 6px;
}
.review-controls {
  display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center;
}
.review-member-select {
  font-size: 11px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--screen);
  color: var(--ink-2);
  max-width: 140px;
  font-family: 'Inter', sans-serif;
}
.emoji-btn {
width: 38px; height: 38px;
border-radius: 50%;
border: 1px solid var(--border);
background: var(--screen);
font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.emoji-btn:hover:not(:disabled) { background: var(--paper-2); }
.emoji-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.emoji-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.review-thanks {
  font-size: 10px; color: var(--ink-4);
  font-style: italic;
  margin-left: 4px;
}

/* ── Day-tag rows (Family page) ─────────────────── */
.daytag-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--divider);
}
.daytag-row:last-of-type { border-bottom: none; }
.daytag-info { flex: 1 1 auto; min-width: 0; }
.daytag-day { font-size: 13px; font-weight: 600; color: var(--ink); }
.daytag-date { font-size: 10px; color: var(--ink-4); margin-top: 1px; }
.daytag-select { max-width: 160px; flex: 0 0 auto; }

/* ── FAB ────────────────────────────────────────── */
.din-fab {
  position: fixed;
  right: calc(50% - 240px + 14px);
  bottom: 74px;
  width: 44px; height: 44px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px -4px rgba(0,0,0,0.3);
  cursor: pointer;
  border: none;
}
.din-fab .material-symbols-rounded { font-size: 22px; }
@media (max-width: 480px) {
  .din-fab { right: 14px; }
}

/* ── Empty state ────────────────────────────────── */
.empty-state {
  text-align: center; padding: 40px 20px; color: var(--ink-3);
}
.empty-state .empty-icon {
  width: 56px; height: 56px; border-radius: 16px;
  border: 1.5px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px; color: var(--ink-4);
}
.empty-state .empty-icon .material-symbols-rounded { font-size: 26px; }
.empty-state .empty-title { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.empty-state .empty-sub { font-size: 11px; line-height: 1.5; }
.empty-state .empty-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; align-items: center; }
.empty-btn {
  display: flex; align-items: center; gap: 6px; justify-content: center;
  min-width: 190px; padding: 10px 18px; border-radius: 10px; border: none; cursor: pointer;
  font-size: 13px; font-weight: 500; background: var(--paper-2); color: var(--ink);
  transition: background 0.15s;
}
.empty-btn.primary { background: var(--accent); color: #fff; }
.empty-btn:hover:not(:disabled) { filter: brightness(1.08); }
.empty-btn:disabled { opacity: 0.45; pointer-events: none; }
.empty-btn .material-symbols-rounded { font-size: 18px; }

/* ── Library ────────────────────────────────────── */
.lib-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lib-card { border-radius: 10px; background: var(--screen); border: 1px solid var(--border); overflow: hidden; text-decoration: none; color: inherit; display: block; }
.lib-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--paper-2); display: block; }
.lib-card .lib-card-img-ph { width: 100%; aspect-ratio: 4/3; background: var(--paper-2); display: flex; align-items: center; justify-content: center; color: var(--ink-4); }
.lib-card .lib-card-img-ph .material-symbols-rounded { font-size: 28px; }
.lib-card .lib-card-body { padding: 6px 8px 8px; }
.lib-card .tit { font-size: 11px; font-weight: 600; color: var(--ink); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lib-card .meta { font-size: 9px; color: var(--ink-4); margin-top: 3px; }

/* ── Shopping list ──────────────────────────────── */
.shop-group-hd { display: flex; align-items: baseline; gap: 8px; padding: 12px 0 4px; }
.shop-group-hd span:first-child { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.shop-group-hd .fresh { font-size: 10px; color: var(--accent); font-weight: 500; }
.shop-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--divider); font-size: 13px; color: var(--ink); cursor: pointer; user-select: none; }
.shop-item:last-child { border-bottom: none; }
.shop-item.checked { color: var(--ink-4); text-decoration: line-through; opacity: 0.6; }
.shop-check { width: 18px; height: 18px; flex-shrink: 0; border: 1.5px solid var(--border); border-radius: 5px; display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.shop-check.on { border-color: var(--accent); background: var(--accent); }
.shop-check.on::after { content: ''; width: 10px; height: 6px; border-left: 2px solid white; border-bottom: 2px solid white; transform: rotate(-45deg) translateY(-1px); display: block; }
.export-bar { display: flex; gap: 8px; padding: 16px 0 6px; }
.export-bar button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; background: var(--paper-2); border: none; border-radius: 10px; font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; font-family: 'Inter', sans-serif; }
.export-bar button .material-symbols-rounded { font-size: 16px; }

/* ── Family page ────────────────────────────────── */
.section-hd { font-size: 15px; font-weight: 700; color: var(--ink); margin: 20px 0 4px; }
.pref-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.pref-icon { font-size: 20px; color: var(--ink-3); }
.pref-label { flex: 1; font-size: 14px; color: var(--ink); }
.nav-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; text-decoration: none; -webkit-tap-highlight-color: transparent; cursor: pointer; }
.nav-row .pref-label { font-weight: 500; }
.section-sub { font-size: 11px; color: var(--ink-3); margin-bottom: 12px; line-height: 1.4; }
.fam-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--divider); }
.fam-row:last-child { border-bottom: none; }
.fam-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fam-avatar.parent { background: var(--accent); color: #fff; }
.fam-info { flex: 1 1 auto; min-width: 0; }
.fam-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.fam-role { font-size: 10px; color: var(--ink-4); margin-top: 1px; }
.vote-pill { font-size: 9px; font-weight: 600; background: var(--chip); color: var(--ink-3); padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
.vote-pill.heavy { background: var(--accent-soft); color: var(--accent); }
.guardrail-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--paper-2); border-radius: 8px; margin-bottom: 6px; font-size: 12px; color: var(--ink-2); }
.guardrail-row .material-symbols-rounded { font-size: 16px; color: var(--accent); }
.guardrail-row .guardrail-del { margin-left: auto; background: none; border: none; color: #d32f2f; cursor: pointer; padding: 2px; display: flex; }
.guardrail-row .guardrail-del .material-symbols-rounded { font-size: 16px; color: inherit; }
.fam-detail { padding: 8px 0 10px 46px; }
.vw-label { font-size: 11px; color: var(--ink-3); margin-bottom: 3px; }
.vote-range { width: 100%; accent-color: var(--accent); cursor: pointer; }
.din-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; margin-top: 8px; }
.din-toggle input[type="checkbox"] { width: 36px; height: 20px; appearance: none; -webkit-appearance: none; background: var(--chip); border-radius: 10px; position: relative; cursor: pointer; transition: background 0.2s; flex-shrink: 0; }
.din-toggle input[type="checkbox"]:checked { background: var(--accent); }
.din-toggle input[type="checkbox"]::before { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: white; border-radius: 50%; transition: left 0.2s; }
.din-toggle input[type="checkbox"]:checked::before { left: 18px; }
.din-toggle .toggle-lbl { font-size: 12px; color: var(--ink-2); }
.pin-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; }
.din-input { width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font-family: 'Inter', sans-serif; font-size: 13px; background: var(--screen); color: var(--ink); box-sizing: border-box; }
.din-input:focus { outline: none; border-color: var(--accent); }
select.din-input { appearance: none; -webkit-appearance: none; }
.din-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; background: var(--accent); color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: 'Inter', sans-serif; }
.din-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.din-btn.outline { background: transparent; border: 1.5px solid var(--accent); color: var(--accent); }
.din-error { font-size: 11px; color: var(--error-fg); padding: 6px 10px; background: var(--error-bg); border-radius: 6px; margin-top: 4px; }
.din-ok { font-size: 11px; color: var(--ok-fg); padding: 6px 10px; background: var(--ok-bg); border-radius: 6px; margin-top: 4px; }
.add-form { display: flex; flex-direction: column; gap: 10px; padding: 12px 0 4px; }
.form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }

/* ── Blazor boilerplate ─────────────────────────── */
.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid red; }
.validation-message { color: red; }

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}
.blazor-error-boundary::after { content: "An error has occurred."; }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem; height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}
.loading-progress circle {
    fill: none;
    stroke: var(--border);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}
.loading-progress circle:last-child {
    stroke: var(--accent);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}
.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}
.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Loading"); }
