:root {
  --ground: #F6F7F2; --card: #FFFFFF; --ink: #1C2A1F; --muted: #4F5D52; --green: #24613B;
  --on-green: #FFFFFF; --line: #8A978B; --tint: #E3E9DF; --danger: #9B2C1F; --banner: #FCEFC7;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #121814; --card: #1C241F; --ink: #EEF2EC; --muted: #B7C2B9; --green: #7CC597;
    --on-green: #0E1A12; --line: #6F7C72; --tint: #263229; --danger: #FF9D8F; --banner: #4A3D0E;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #121814; --card: #1C241F; --ink: #EEF2EC; --muted: #B7C2B9; --green: #7CC597;
  --on-green: #0E1A12; --line: #6F7C72; --tint: #263229; --danger: #FF9D8F; --banner: #4A3D0E;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 16px/1.5 Inter, system-ui, sans-serif; }
main { max-width: 480px; margin: 0 auto; padding: 20px 16px calc(32px + env(safe-area-inset-bottom)); }
main > * { margin: 0 0 12px; }
h1, h2 { font-family: 'Space Grotesk', Inter, system-ui, sans-serif; line-height: 1.2; }
h1 { font-size: 28px; } h1:focus { outline: none; }
h2 { font-size: 19px; margin-top: 20px; }
a { color: var(--green); }
.eyebrow, .hint { color: var(--muted); font-size: 14px; }
.eyebrow { margin-bottom: 2px; }
.practice { background: var(--banner); padding: calc(8px + env(safe-area-inset-top)) 16px 8px; text-align: center; font-size: 14px; font-weight: 600; }
.card { display: block; background: var(--card); border: 0; border-radius: 14px; padding: 14px; margin: 0 0 12px; overflow-wrap: anywhere; }
.tint { background: var(--tint); }
.card > :first-child { margin-top: 0; } .card > :last-child { margin-bottom: 0; }
form > * { margin: 0 0 12px; }
.field label, legend { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
fieldset.card legend { float: left; width: 100%; }
fieldset.card legend + * { clear: both; }
input:not([type=checkbox]), select { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font: inherit; background: var(--card); color: var(--ink); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--green); flex: none; }
button { font: 600 15px Inter, system-ui, sans-serif; cursor: pointer; border-radius: 12px; min-height: 48px; padding: 10px 14px; width: 100%; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.primary { background: var(--green); color: var(--on-green); border: 2px solid var(--green); }
.secondary { background: var(--card); color: var(--green); border: 2px solid var(--green); }
.plain { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.danger { background: var(--card); color: var(--danger); border: 1px solid var(--danger); }
.link { background: none; border: 0; color: var(--green); text-decoration: underline; }
.card.tint button { margin-top: 10px; }
.row { display: flex; gap: 8px; margin-top: 10px; }
.between { display: flex; justify-content: space-between; gap: 12px; }
.between > b:last-child { flex: none; max-width: 60%; }
.product { display: flex; gap: 12px; align-items: center; }
.product img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; flex: none; }
.grow { flex: 1; min-width: 0; }
.preview { display: block; width: 100%; max-height: 220px; object-fit: contain; border-radius: 12px; background: var(--card); }
nav { display: flex; gap: 6px; }
.tab { background: var(--card); color: var(--ink); border: 1px solid var(--line); min-height: 44px; padding: 6px; font-size: 14px; }
.tab[aria-current=page] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.contacts a { display: flex; align-items: center; min-height: 44px; }
.error { color: var(--danger); font-weight: 600; } .error:empty, .success:empty { display: none; }
.success { color: var(--green); font-weight: 600; }
summary { cursor: pointer; font-weight: 600; min-height: 32px; }

/* Shopper page */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .tab { width: auto; padding: 6px 14px; }
.tab[aria-pressed=true] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.add { width: auto; min-width: 76px; flex: none; }
.stepper { display: flex; align-items: center; gap: 8px; flex: none; }
.stepper button { width: 44px; min-height: 44px; padding: 0; font-size: 20px; }
.stepper button:disabled { cursor: default; }
.stepper b { min-width: 2ch; text-align: center; }
.line { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.tight { margin-top: 0; }
fieldset { border: 0; padding: 0; margin: 12px 0 0; min-width: 0; }
.check input[type=radio] { width: 22px; height: 22px; }
.total { padding: 0 2px; font-size: 18px; }
.cart-bar { position: sticky; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
.cart-bar button { box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.card ul { padding-left: 20px; margin: 8px 0; }
.card > button, .card > .pay { margin-top: 10px; }
.card.product > button { margin-top: 0; }
.pay { display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 12px; background: var(--green); color: var(--on-green); font-weight: 600; text-decoration: none; }
.pay:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.note { background: var(--tint); border-radius: 10px; padding: 10px 12px; user-select: all; overflow-wrap: anywhere; }
.order-link { display: flex; align-items: center; min-height: 44px; font-weight: 600; }

/* Order screens */
textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; background: var(--card); color: var(--ink); resize: vertical; }
textarea:focus-visible, .action:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.urgent { border: 2px solid var(--danger); }
.banners:empty { display: none; }
.lines { white-space: pre-line; }
.big { font-size: 22px; }
.order > button, .order > .hint { margin-top: 10px; }
.order p, .urgent p, .bag p { margin: 8px 0; }
.order summary { min-height: 44px; display: list-item; padding-top: 10px; }
.canceled { border: 1px dashed var(--line); }
.bag { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.bag > button { margin-top: 4px; }
.contact .note { margin: 8px 0 0; }
.contact .row > * { flex: 1; min-width: 0; }
.contact .row button { width: auto; }
.action { display: flex; align-items: center; justify-content: center; min-height: 48px; border: 2px solid var(--green); border-radius: 12px; font-weight: 600; text-decoration: none; }
details > form { margin-top: 10px; }
