/* Ключ — общий стиль витрины и админки. Сетка 4/8 px, светлая и тёмная тема. */
@font-face { font-family: Onest; src: url(/fonts/onest-cyr.woff2) format('woff2'); font-weight: 400 600; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Onest; src: url(/fonts/onest-lat.woff2) format('woff2'); font-weight: 400 600; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  color-scheme: light dark;
  --bg: #F5F3EF; --card: #FFFFFF; --ink: #1C1D22; --soft: #686A72; --line: #E7E3DC; --chip: #EEEBE5;
  --acc: #4B3FD8; --acc-ink: #FFFFFF; --acc-soft: #E9E7FB; --acc-text: #3A2FC0;
  --ok: #E2F1E5; --ok-ink: #24653A; --wait: #F7EDD2; --wait-ink: #7A5A0E; --bad: #F8E0E0; --bad-ink: #9A2F36;
  --shadow: 0 1px 2px rgba(20, 20, 30, .05), 0 4px 16px rgba(20, 20, 30, .05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131418; --card: #1D1E24; --ink: #ECECEF; --soft: #9A9BA4; --line: #2C2D35; --chip: #26272E;
    --acc: #7D73F0; --acc-ink: #0E0E14; --acc-soft: #272548; --acc-text: #ABA4FF;
    --ok: #1C3324; --ok-ink: #8ED6A3; --wait: #3A3018; --wait-ink: #EBCB7A; --bad: #3D1E21; --bad-ink: #F2A3A9;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 Onest, system-ui, sans-serif; padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
a { color: var(--acc-text); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
main { max-width: 720px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.2; }
.muted { color: var(--soft); }
.small { font-size: 14px; }
.pre { white-space: pre-wrap; }

/* Шапка */
.top { display: flex; align-items: center; gap: 12px; padding: 16px 0; padding-top: calc(16px + env(safe-area-inset-top)); }
.top .grow { flex: 1; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 600; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.logo i { width: 32px; height: 32px; border-radius: 10px; background: var(--acc); display: inline-flex; align-items: center; justify-content: center; }
.logo i svg { width: 20px; height: 20px; stroke: var(--acc-ink); }
.hero { padding: 8px 0 24px; }
.hero h1 { font-size: 32px; letter-spacing: -.02em; max-width: 560px; }
.hero p { margin: 12px 0 0; color: var(--soft); font-size: 17px; max-width: 560px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 20px; }
.steps div { background: var(--card); border-radius: 16px; padding: 12px; font-size: 14px; line-height: 1.35; box-shadow: var(--shadow); }
.steps b { display: block; width: 24px; height: 24px; border-radius: 12px; background: var(--acc-soft); color: var(--acc-text); font-size: 13px; text-align: center; line-height: 24px; margin-bottom: 8px; }
.sec { margin: 24px 0 12px; font-size: 20px; }

/* Каталог */
.grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 600px) { .grid { grid-template-columns: 1fr 1fr; } }
.prod { background: var(--card); border: 0; border-radius: 20px; padding: 16px; text-align: left; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); min-height: 176px; }
.prod:active { transform: scale(.99); }
.prod .hd { display: flex; align-items: center; gap: 12px; }
.badge { width: 44px; height: 44px; border-radius: 14px; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 20px; flex: 0 0 auto; }
.prod .nm { font-size: 18px; font-weight: 600; line-height: 1.2; }
.prod .pl { font-size: 14px; color: var(--soft); }
.prod .ab { font-size: 15px; color: var(--soft); flex: 1; }
.prod .ft { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { font-size: 18px; font-weight: 600; }
.go { height: 36px; padding: 0 14px; border-radius: 18px; background: var(--acc-soft); color: var(--acc-text); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; }

/* Кнопки и поля */
.btn { min-height: 48px; padding: 0 20px; border-radius: 14px; border: 0; background: var(--chip); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: var(--ink); }
.btn.main { background: var(--acc); color: var(--acc-ink); }
.btn.wide { width: 100%; }
.btn.sm { min-height: 40px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.btn.bad { color: var(--bad-ink); }
.btn:disabled { opacity: .55; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
label.f { display: block; margin-top: 16px; }
label.f > span { display: block; font-size: 14px; color: var(--soft); margin-bottom: 4px; }
input.in, textarea.in, select.in { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 12px 14px; font-size: 16px; }
textarea.in { min-height: 96px; resize: vertical; }
input.in:focus, textarea.in:focus, select.in:focus { outline: 2px solid var(--acc); outline-offset: -1px; border-color: transparent; }
.in.err { border-color: var(--bad-ink); }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { flex: 1 1 140px; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 12px 14px; text-align: left; }
.opt b { display: block; font-size: 17px; }
.opt span { font-size: 14px; color: var(--soft); }
.opt.on { border-color: var(--acc); outline: 1px solid var(--acc); background: var(--acc-soft); }
.box { background: var(--card); border-radius: 20px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.box h2 { font-size: 18px; margin-bottom: 8px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.row:first-of-type { border-top: 0; }
.row .k { color: var(--soft); font-size: 14px; }
.row .v { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.copy { border: 0; background: var(--chip); border-radius: 10px; padding: 6px 10px; font-size: 13px; font-weight: 600; margin-left: 8px; }
.note { border-radius: 14px; padding: 12px 14px; font-size: 15px; background: var(--acc-soft); }
.note.ok { background: var(--ok); color: var(--ok-ink); }
.note.wait { background: var(--wait); color: var(--wait-ink); }
.note.bad { background: var(--bad); color: var(--bad-ink); }
.err-t { color: var(--bad-ink); font-size: 14px; margin-top: 8px; }
.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq details:first-child { border-top: 0; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { margin: 8px 0 0; color: var(--soft); }
.foot { margin-top: 32px; font-size: 14px; color: var(--soft); text-align: center; }

/* Шаги заказа */
.track { display: flex; flex-direction: column; gap: 0; margin: 4px 0 8px; }
.track div { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; color: var(--soft); }
.track i { width: 24px; height: 24px; border-radius: 12px; border: 2px solid var(--line); flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 13px; }
.track .on { color: var(--ink); font-weight: 600; }
.track .on i { border-color: var(--acc); background: var(--acc); color: var(--acc-ink); }
.track .past i { border-color: var(--acc); color: var(--acc-text); }

/* Лист снизу */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(10, 10, 16, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet .pan { background: var(--bg); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 24px 24px 0 0; padding: 20px 16px; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
@media (min-width: 600px) { .sheet { align-items: center; } .sheet .pan { border-radius: 24px; } }
.pan .hd { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.pan .hd .grow { flex: 1; min-width: 0; }
.x { width: 40px; height: 40px; border-radius: 20px; border: 0; background: var(--chip); font-size: 20px; line-height: 1; flex: 0 0 auto; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 14px; font-size: 15px; z-index: 30; max-width: calc(100% - 32px); }

/* Админка */
.tabs { display: flex; gap: 4px; background: var(--chip); border-radius: 14px; padding: 4px; margin-bottom: 16px; }
.tabs a { flex: 1; text-align: center; padding: 10px 4px; border-radius: 10px; text-decoration: none; color: var(--soft); font-weight: 600; font-size: 15px; }
.tabs a.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.stats div { background: var(--card); border-radius: 16px; padding: 12px; font-size: 13px; color: var(--soft); box-shadow: var(--shadow); line-height: 1.3; }
.stats b { display: block; font-size: 22px; color: var(--ink); line-height: 1.3; }
.stats .hot b { color: var(--acc-text); }
.chips { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 4px; }
.chips button { border: 0; background: var(--chip); border-radius: 18px; padding: 8px 14px; font-size: 14px; font-weight: 600; white-space: nowrap; color: var(--soft); }
.chips button.on { background: var(--ink); color: var(--bg); }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { background: var(--card); border: 0; border-radius: 16px; padding: 12px 14px; text-align: left; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); width: 100%; }
.item .grow { flex: 1; min-width: 0; }
.item b { display: block; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item span { font-size: 14px; color: var(--soft); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st { font-size: 12px; font-weight: 600; border-radius: 10px; padding: 4px 8px; white-space: nowrap; background: var(--chip); color: var(--soft); }
.st.new { background: var(--wait); color: var(--wait-ink); }
.st.paid, .st.confirmed { background: var(--acc-soft); color: var(--acc-text); }
.st.done { background: var(--ok); color: var(--ok-ink); }
.st.cancel { background: var(--bad); color: var(--bad-ink); }
.empty { text-align: center; color: var(--soft); padding: 32px 16px; }
.optrow { display: grid; grid-template-columns: 1fr 1fr 40px; gap: 8px; margin-top: 8px; align-items: center; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.switch input { width: 24px; height: 24px; accent-color: var(--acc); }
