:root {
  --green-950: #06251A;
  --green-900: #0A2E1C;
  --green-800: #0A3D24;
  --green-700: #0B6B35;
  --green-100: #E3EFE6;
  --red: #D4141B;
  --red-700: #B00F15;
  --gold: #E9C46A;
  --cream: #F4EFE4;
  --paper: #FBF9F4;
  --white: #FFFFFF;
  --ink: #14261C;
  --muted: #56665C;
  --line: rgba(20, 38, 28, 0.14);
  --line-strong: rgba(20, 38, 28, 0.28);
  --focus: #1D7BE0;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --shadow-card: 0 1px 0 rgba(20, 38, 28, 0.04), 0 18px 48px -24px rgba(10, 46, 28, 0.35);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- brand: SPAR logo on its white plate ---------- */
.brand { display: inline-flex; align-items: center; gap: 14px; min-width: 0; text-decoration: none; }
.brand-logo {
  display: inline-flex; align-items: center; flex: none;
  padding: 8px 12px; border-radius: 10px; background: #fff;
  box-shadow: 0 0 0 1px rgba(20, 38, 28, 0.08);
}
.brand-logo img { height: 26px; width: auto; }
.on-dark .brand-logo { box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.45); }
.brand-tag {
  padding-left: 14px; border-left: 1px solid currentColor;
  font-weight: 600; font-size: 15px; letter-spacing: 0.01em; white-space: nowrap;
}
.brand-tag { border-left-color: var(--line-strong); }
.on-dark .brand-tag { border-left-color: rgba(255, 255, 255, 0.25); }
@media (max-width: 420px) {
  .brand-logo { padding: 7px 10px; }
  .brand-logo img { height: 22px; }
  .brand-tag { display: none; }
}

/* ---------- language switch ---------- */
.lang {
  display: inline-flex; padding: 3px; gap: 2px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,0.6);
}
.lang button {
  min-width: 44px; min-height: 36px; padding: 0 10px;
  border: 0; border-radius: 999px; background: transparent;
  font-weight: 700; font-size: 13px; letter-spacing: 0.06em; cursor: pointer;
  color: var(--muted);
  transition: background-color .2s var(--ease-out), color .2s var(--ease-out);
}
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.on-dark .lang { border-color: rgba(255,255,255,0.18); background: rgba(255,255,255,0.06); }
.on-dark .lang button { color: rgba(255,255,255,0.7); }
.on-dark .lang button:hover { color: #fff; }
.on-dark .lang button[aria-pressed="true"] { background: #fff; color: var(--green-900); }

/* ---------- buttons ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 28px;
  border: 0; border-radius: var(--r-md);
  font-weight: 700; font-size: 17px; letter-spacing: 0.01em;
  text-decoration: none; cursor: pointer;
  transition: transform .18s var(--ease-out), background-color .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.btn:active { transform: translateY(1px) scale(0.985); }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 10px 24px -12px rgba(212, 20, 27, 0.8); }
.btn-primary:hover { background: var(--red-700); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(1px) scale(0.985); }
.btn-primary[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; border: 1px solid var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: rgba(20,38,28,0.05); }
.btn .arrow { transition: transform .2s var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- dialog ---------- */
dialog.sheet {
  width: min(560px, calc(100% - 32px));
  max-height: min(80vh, 640px);
  padding: 0; border: 0; border-radius: var(--r-lg);
  background: var(--paper); color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(6, 37, 26, 0.5);
}
dialog.sheet::backdrop { background: rgba(6, 37, 26, 0.55); backdrop-filter: blur(3px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 0; }
.sheet-head h2 { margin: 0; font-size: 22px; font-stretch: 90%; }
.sheet-body { padding: 8px 24px 24px; color: var(--ink); }
.sheet-body p { margin: 12px 0; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 999px; background: transparent; cursor: pointer;
}
.icon-btn:hover { background: rgba(20,38,28,0.07); }

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