:root {
  /* Светлая тема: свежая трава */
  --bg: #D9EFBA;
  --card: #F5FBEC;
  --ink: #1D2A12;
  --muted: #4B5C3C;
  --line: #BFDD9C;
  --green: #3D8618;     /* трава */
  --green-ink: #FFFFFF;
  --honey: #7E530A;     /* мёд */
  --pistachio: #C5E59E;
  --pistachio-ink: #2D5414;
  --warn-bg: #F4DDA6;
  --warn-ink: #653F05;
  --danger: #A63A24;
  --shadow: none;
  --radius: 10px;
}
:root.dark {
  /* Тёмная тема: олива ночью */
  --bg: #1C1B10;
  --card: #272618;
  --ink: #F1E6D3;
  --muted: #BDB096;
  --line: #3E3B27;
  --green: #D2A64F;
  --green-ink: #1C1B10;
  --honey: #E0B862;
  --pistachio: #37391F;
  --pistachio-ink: #DCD6A8;
  --warn-bg: #403117;
  --warn-ink: #F2CF85;
  --danger: #EE8B73;
  --shadow: none;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 500 15px/1.45 'Golos Text', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }

.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px 120px; }

/* Header */
.hero { padding: 20px 0 8px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.brand { font-weight: 900; font-size: 30px; letter-spacing: -.5px; color: var(--green); line-height: 1; }
.brand span { color: var(--ink); }
.tagline { color: var(--muted); font-size: 14px; margin-top: 6px; }
.lang { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px; flex: none; }
.lang button { padding: 5px 11px; border-radius: 999px; font-weight: 800; font-size: 13px; color: var(--muted); }
.lang button.on { background: var(--green); color: var(--green-ink); }

.delivery { margin: 12px 0 4px; padding: 10px 14px; border-radius: 8px; background: var(--pistachio); color: var(--pistachio-ink); font-weight: 700; font-size: 14px; }

/* Category chips */
.chips { position: sticky; top: 0; z-index: 5; background: var(--bg); margin: 0 -16px; padding: 12px 16px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 700; font-size: 14px; white-space: nowrap; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Sections & grid */
.section { scroll-margin-top: 64px; padding-top: 8px; }
.section h2 { font-size: 20px; font-weight: 900; margin: 10px 0 4px; }
.note { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line); }
.thumb { aspect-ratio: 1 / 1; background: var(--pistachio); display: grid; place-items: center; font-size: 52px; position: relative; overflow: hidden; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-name { font-weight: 800; font-size: 15px; line-height: 1.25; }
.card-price { font-weight: 900; font-size: 15px; color: var(--green); }
.card-price small { color: var(--muted); font-weight: 600; font-size: 12px; }
.card-foot { margin-top: auto; }

.add { width: 100%; height: 38px; border-radius: 8px; background: var(--green); color: var(--green-ink); font-weight: 800; }
.add:active { transform: scale(.98); }
.stepper { display: flex; align-items: center; justify-content: space-between; height: 38px; border-radius: 8px; background: var(--pistachio); color: var(--pistachio-ink); }
.stepper button { width: 40px; height: 38px; font-size: 20px; font-weight: 900; color: inherit; }
.stepper b { font-weight: 900; font-size: 16px; }

/* Bottom bar */
.bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent); z-index: 10; }
.bar-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 528px; margin: 0 auto; height: 54px; padding: 0 18px; border-radius: 8px; background: var(--green); color: var(--green-ink); font-weight: 900; font-size: 16px; box-shadow: 0 6px 20px rgba(61, 134, 24, .3); }
.bar-btn:disabled { opacity: .5; }
.bar-btn.center { justify-content: center; }
.badge { background: rgba(255,255,255,.22); border-radius: 999px; padding: 2px 9px; font-size: 13px; margin-right: 8px; }
:root.dark .badge { background: rgba(0,0,0,.18); }

/* Page header (cart/checkout) */
.top { display: flex; align-items: center; gap: 10px; padding: 18px 0 10px; }
.back { width: 38px; height: 38px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); font-size: 18px; font-weight: 900; }
.top h1 { margin: 0; font-size: 24px; font-weight: 900; }

/* Cart */
.list { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.row { display: flex; gap: 12px; align-items: center; padding: 12px; }
.row + .row { border-top: 1px solid var(--line); }
.row .mini { width: 56px; height: 56px; border-radius: 8px; flex: none; font-size: 28px; aspect-ratio: auto; }
.row-info { flex: 1; min-width: 0; }
.row-name { font-weight: 800; }
.row-sum { color: var(--muted); font-size: 13px; font-weight: 700; }
.row .stepper { width: 112px; flex: none; }

.warn { margin: 12px 0; padding: 12px 14px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); font-weight: 700; font-size: 14px; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 4px 4px; font-weight: 800; }
.total b { font-size: 22px; font-weight: 900; }
.clear { margin-top: 6px; color: var(--danger); font-weight: 700; font-size: 14px; padding: 6px 4px; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .big { font-size: 64px; }
.empty p { font-weight: 700; }

/* Form */
.form { display: flex; flex-direction: column; gap: 14px; }
.field label { display: block; font-weight: 800; font-size: 14px; margin: 0 0 6px 2px; }
.field input, .field textarea { width: 100%; padding: 13px 14px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--card); outline: none; font-weight: 600; font-size: 16px; }
.field textarea { resize: none; min-height: 84px; }
.field input:focus, .field textarea:focus { border-color: var(--green); }
.field.err input, .field.err textarea { border-color: var(--danger); }
.field .hint { font-size: 12px; color: var(--danger); margin: 4px 0 0 2px; font-weight: 700; display: none; }
.field.err .hint { display: block; }

.summary { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; }
.summary div { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 2px 0; }
.summary .sum-total { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 8px; font-weight: 900; font-size: 16px; }

/* Done */
.done { text-align: center; padding: 70px 24px; }
.done .big { font-size: 72px; }
.done h1 { font-size: 24px; font-weight: 900; margin: 12px 0 8px; }
.done p { color: var(--muted); font-weight: 600; }

/* Toast */
.toast { position: fixed; left: 16px; right: 16px; bottom: 90px; max-width: 528px; margin: 0 auto; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 8px; font-weight: 700; z-index: 20; text-align: center; }

.spinner { width: 20px; height: 20px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Описание товара в карточке */
.card-desc { font-size: 12.5px; color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ───────── Админка ───────── */
.muted { color: var(--muted); }
.btn { height: 42px; padding: 0 16px; border-radius: 8px; font-weight: 800; font-size: 14px; }
.btn:disabled { opacity: .5; }
.btn.primary { background: var(--green); color: var(--green-ink); }
.btn.ghost { background: var(--card); border: 1px solid var(--line); }
.btn.ghost-danger { background: transparent; color: var(--danger); border: 1.5px solid currentColor; }
.btn.wide { width: 100%; margin-top: 12px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 12px; }
.stats div { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.stats b { display: block; font-size: 18px; font-weight: 900; }
.stats span { font-size: 12px; color: var(--muted); font-weight: 700; }

.seg { display: flex; gap: 6px; margin-bottom: 12px; }
.seg button { flex: 1; height: 36px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); font-weight: 800; font-size: 13px; }
.seg button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg button:last-child { flex: 0 0 44px; font-size: 18px; }

.order { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.order-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.order-top b { font-size: 17px; font-weight: 900; }
.order-top .pill { margin-left: auto; }
.order-who { margin: 10px 0; display: grid; gap: 3px; font-size: 14px; font-weight: 600; word-break: break-word; }
.order-who a { color: var(--green); font-weight: 800; text-decoration: none; }
.order-items { border-top: 1px dashed var(--line); padding-top: 8px; font-size: 14px; }
.order-items div { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.order-items .sum-total { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 6px; font-weight: 900; }
.order-actions { display: flex; gap: 8px; margin-top: 12px; }
.order-actions .btn { flex: 1; }

.pill { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--pistachio); color: var(--pistachio-ink); white-space: nowrap; }
.pill.st-new { background: var(--warn-bg); color: var(--warn-ink); }
.pill.st-cancelled { background: transparent; color: var(--danger); border: 1px solid currentColor; }
.pill.st-done { background: var(--line); color: var(--muted); }

.row-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-align: left; padding: 0; }
.row-main .row-info { display: flex; flex-direction: column; }
.row-name, .row-sum { display: block; }
.row.off .row-main { opacity: .5; }
.arrows { display: flex; flex-direction: column; flex: none; }
.arrows button { width: 32px; height: 22px; font-size: 11px; color: var(--muted); }

.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(18px); }

.photo { display: flex; gap: 14px; align-items: center; }
.big-thumb { width: 112px; height: 112px; border-radius: 8px; font-size: 48px; flex: none; }
.photo-btns { display: flex; flex-direction: column; gap: 8px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field select { width: 100%; padding: 13px 14px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--card); font: inherit; font-weight: 600; font-size: 16px; color: inherit; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.check input { width: 20px; height: 20px; accent-color: var(--green); }

/* ───────── Фирменный стиль TaBee ───────── */
.section h2, .top h1, .done h1, .card-name, .row-name, .total b, .brand, .order-top b {
  font-family: 'PT Serif', Georgia, serif; font-weight: 700; letter-spacing: 0;
}
.section h2 { font-size: 22px; }
.card-name { font-size: 16px; }
.brand { color: var(--green); }
.brand span { color: var(--honey); }
.card-price, .stats b { color: var(--honey); }
.thumb { background: var(--pistachio); }

.hero.shop { position: relative; display: block; text-align: center; padding: 8px 0 4px; }
.hero.shop .lang { position: absolute; top: 12px; right: 0; }
.logo { display: block; width: 188px; height: auto; margin: 0 auto; }
:root.dark .logo { border-radius: 10px; }
.hero.shop .tagline { font-family: 'PT Serif', Georgia, serif; font-size: 16px; color: var(--ink); margin-top: 4px; }
.delivery { margin: 10px 0 0; padding: 8px 0; border-radius: 0; background: none; color: var(--muted); text-align: center; font-weight: 500; border-block: 1px solid var(--line); }
.chips { padding-block: 10px; }
.chip.on { background: var(--green); color: var(--green-ink); border-color: var(--green); }
.summary .sum-note { color: var(--muted); padding-top: 4px; }

:focus-visible { outline: 2px solid var(--honey); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .spinner { animation-duration: 2s; }
}
.add, .chip, .bar-btn, .btn, .card-price, .seg button { font-weight: 600; }
.card-price { font-size: 15px; }

/* Переключатель темы */
.tools { display: flex; align-items: center; gap: 8px; flex: none; }
.theme-btn { width: 38px; height: 38px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink); }
.hero.shop .lang { position: static; }
.hero.shop .tools { position: absolute; top: 12px; right: 0; flex-direction: column; align-items: flex-end; }

/* Иконки категорий */
.ico { width: 1.25em; height: 1.25em; flex: none; }
.ico .ac { stroke: var(--honey); }
.chip { display: inline-flex; align-items: center; gap: 7px; }
.chip .ico { width: 20px; height: 20px; }
.chip.on .ico .ac { stroke: currentColor; opacity: .75; }
.section h2 { display: flex; align-items: center; gap: 10px; }
.section h2 .ico { width: 30px; height: 30px; color: var(--green); stroke-width: 1.3; }
.thumb { color: var(--pistachio-ink); }
.thumb .ico { width: 46%; height: 46%; stroke-width: 1.1; }
.thumb.mini .ico { width: 64%; height: 64%; stroke-width: 1.3; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-pick button { width: 52px; height: 52px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--card); display: grid; place-items: center; color: var(--green); }
.icon-pick button.on { border-color: var(--green); background: var(--pistachio); }
.icon-pick .ico { width: 30px; height: 30px; }

/* Цена и итог тем же шрифтом, что и логотип */
.card-price, .summary .sum-total, .row-sum { font-family: 'PT Serif', Georgia, serif; font-weight: 700; }
.hero.shop .tools { position: static; flex-direction: row; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.hero.shop { display: flex; flex-direction: column; align-items: center; }
.hero.shop .tools { order: -1; align-self: stretch; }

/* Карточка товара открывается нажатием */
.card[data-act="open"] { cursor: pointer; }
.card-media { position: relative; }
.hit-tag { position: absolute; top: 8px; left: 8px; z-index: 1; padding: 2px 9px; border-radius: 999px; background: var(--honey); color: var(--card); font-size: 12px; font-weight: 700; }
.hit-tag.static { position: static; display: inline-block; margin-bottom: 6px; }

/* Хиты: горизонтальная лента */
.hits { display: flex; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hits::-webkit-scrollbar { display: none; }
.hits .card { flex: 0 0 46%; scroll-snap-align: start; }

/* Нижняя панель товара */
body.locked { overflow: hidden; }
.sheet-wrap { position: fixed; inset: 0; z-index: 30; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(12, 18, 6, .5); }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: 90vh; overflow-y: auto; background: var(--card); border-radius: 18px 18px 0 0; animation: sheet-up .22s ease-out; }
@keyframes sheet-up { from { transform: translateY(100%); } }
.sheet-x { position: absolute; top: 10px; right: 10px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); font-size: 22px; line-height: 1; }
.thumb.sheet-img { aspect-ratio: 4 / 3; border-radius: 18px 18px 0 0; }
.thumb.sheet-img .ico { width: 34%; height: 34%; }
.sheet-body { padding: 16px 16px 8px; }
.sheet-name { font-family: 'PT Serif', Georgia, serif; font-weight: 700; font-size: 24px; line-height: 1.2; margin: 0 0 6px; }
.sheet-meta { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sheet-meta .card-price { font-size: 19px; }
.sheet-weight { color: var(--muted); font-size: 14px; }
.sheet-desc { margin: 12px 0 0; line-height: 1.55; }
.sheet-body h3 { font-size: 14px; font-weight: 700; color: var(--muted); margin: 16px 0 4px; }
.sheet-body h3 + p { margin: 0; line-height: 1.5; }
.sheet-body .note { margin-top: 14px; }
.sheet-foot { position: sticky; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
.sheet-foot .add, .sheet-foot .stepper { height: 50px; font-size: 16px; }

/* Заглушки при загрузке */
.sk { border-radius: 8px; background: linear-gradient(90deg, var(--pistachio) 25%, var(--card) 50%, var(--pistachio) 75%); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.sk-line { height: 14px; margin: 10px 0; }
.sk-line.short { width: 55%; }
.sk-chip { width: 96px; height: 36px; border-radius: 999px; flex: none; }
.sk-img { aspect-ratio: 1 / 1; border-radius: 0; }
@media (prefers-reduced-motion: reduce) { .sheet, .sk { animation: none; } }

/* Фото категорий вместо иконок */
.cat-img { width: 1.25em; height: 1.25em; border-radius: 50%; object-fit: cover; flex: none; }
.chip .cat-img { width: 26px; height: 26px; margin-left: -6px; }
.section h2 .cat-img { width: 36px; height: 36px; }

/* Доставка и часы работы */
.delivery { display: grid; gap: 6px; }
.hours { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.pill.is-open { background: var(--green); color: var(--green-ink); }
.pill.is-closed { background: transparent; color: var(--danger); border: 1px solid currentColor; }

/* Способ оплаты */
.pay { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-opt { height: 48px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--card); font-weight: 600; font-size: 15px; }
.pay-opt.on { border-color: var(--green); background: var(--pistachio); color: var(--pistachio-ink); }
.field.err .pay-opt { border-color: var(--danger); }
.pay-note { margin: 8px 2px 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.card-box { margin: 20px auto 0; max-width: 320px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); display: grid; gap: 6px; color: var(--ink); }
.card-num { font-family: 'PT Serif', Georgia, serif; font-weight: 700; font-size: 22px; letter-spacing: .04em; }
.card-box .btn { margin-top: 6px; }
#settings h2 { font-family: 'PT Serif', Georgia, serif; font-size: 20px; margin: 18px 0 0; }

/* Выбор оплаты: крупные заметные кнопки */
.pay-opt { position: relative; height: auto; min-height: 76px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 2px solid var(--line); border-radius: 10px; font-size: 16px; font-weight: 700; color: var(--ink); transition: background .15s, border-color .15s; }
.pay-opt .pay-ico { width: 28px; height: 28px; color: var(--green); }
.pay-opt.on { background: var(--green); border-color: var(--green); color: var(--green-ink); box-shadow: 0 6px 16px rgba(61, 134, 24, .28); }
.pay-opt.on .pay-ico { color: var(--green-ink); }
.pay-opt .tick { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; display: none; place-items: center; background: var(--green-ink); color: var(--green); }
.pay-opt.on .tick { display: grid; }
.pay-warn { margin: 10px 0 0; font-weight: 600; }

/* Чек об оплате */
.receipt { margin: 18px auto 0; max-width: 320px; display: grid; gap: 4px; }
.receipt .btn { height: 48px; }
.receipt-ok { color: var(--green); font-weight: 700; }

/* Админы в настройках */
.btn.sm { height: 34px; padding: 0 10px; font-size: 13px; }
.acc-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.acc-row .row-name small { font-weight: 600; color: var(--muted); }
.acc-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.acc-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--green); color: var(--green-ink); font-size: 11px; font-weight: 800; }
.acc-add { display: flex; gap: 8px; margin: 10px 0 4px; }
.acc-add input { flex: 1; min-width: 0; height: 42px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; }
