/* «Зерно» — фирменный стиль, общий для Mini App гостя и экрана бариста.
   Картон стакана, тушь цвета эспрессо и кобальтовая манжета; заказ — бумажный талон.
   Шрифты: Commissioner (Kostas Bartsokas, Греция) и IBM Plex Mono. Без свечений и градиентов. */

:root {
  --bg: #F6F1E7; --surface: #FFFCF6; --surface-2: #EFE8DA; --surface-3: #E4DBCA;
  --ink: #221A14; --muted: #6A5E53; --line: #DED5C6; --line-2: #CBBFAC;
  --accent: #2743C8; --accent-ink: #2743C8; --on-accent: #FFFFFF; --accent-soft: #E2E6F6;
  --ok: #1D7249; --ok-soft: #DCEEE2; --warn: #A33F17; --warn-soft: #F6E1D5;
  --paper: #FFFDF8; --paper-ink: #221A14; --paper-muted: #6A5E53; --paper-line: #D9CFBF;
  --shadow: 0 1px 0 rgba(34, 26, 20, .06), 0 8px 22px -12px rgba(34, 26, 20, .28);
  --f-text: "Commissioner", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --r: 16px; --r-sm: 10px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #15110E; --surface: #1F1915; --surface-2: #2A221C; --surface-3: #372D25;
  --ink: #F1E9DC; --muted: #B3A596; --line: #3A3029; --line-2: #514439;
  --accent: #8FA2FF; --accent-ink: #9FB0FF; --on-accent: #0E1330; --accent-soft: #232B4D;
  --ok: #5CCB8E; --ok-soft: #173526; --warn: #F08A5D; --warn-soft: #3A2016;
  --paper: #EDE5D6; --paper-ink: #221A14; --paper-muted: #5E5248; --paper-line: #CFC3B0;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 26px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.45 var(--f-text); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
svg { display: block; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sprite { display: none; }
.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--f-mono); font-feature-settings: "zero" 0; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* вывеска: у Commissioner расширяющиеся концы штрихов (ось FLAR) — как буквы на вывеске кофейни */
.sign { font-variation-settings: "FLAR" 100, "VOLM" 40; font-weight: 800; letter-spacing: -.01em; }

/* ---------- кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 14px; font-weight: 700; font-size: 16px; line-height: 1.1; transition: background-color .15s, color .15s, transform .12s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:disabled { background: var(--surface-3); color: var(--muted); transform: none; }
.btn-ok { background: var(--ok); color: #fff; }
:root[data-theme="dark"] .btn-ok { color: #0B2317; }
.btn-ghost { background: var(--surface-2); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-line { border: 1.5px solid var(--line-2); color: var(--ink); background: transparent; }
.btn-line:hover { background: var(--surface-2); }
.btn-link { min-height: 44px; padding: 0 4px; color: var(--accent-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.btn .price { font-family: var(--f-mono); font-weight: 600; }

/* ---------- чипы, сегменты, степпер, переключатель ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 15px; transition: border-color .15s, background-color .15s; }
.chip small { font: 500 12.5px/1 var(--f-mono); color: var(--muted); }
.chip[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent); }
.chip[aria-checked="true"] small { color: var(--accent-ink); }
.chip:disabled { opacity: .55; text-decoration: line-through; text-decoration-thickness: 1.5px; }
.chip:disabled small { text-decoration: none; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.seg button { display: grid; gap: 2px; justify-items: center; align-content: center; min-height: 48px; padding: 4px 6px; border-radius: 10px; font-weight: 700; font-size: 15px; line-height: 1.1; transition: background-color .15s, color .15s; }
.seg button small { font: 500 12px/1.1 var(--f-mono); color: var(--muted); }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 0 rgba(0, 0, 0, .06), 0 2px 8px -3px rgba(34, 26, 20, .25); }
.seg button[aria-checked="true"] small { color: var(--accent-ink); }

.stepper { display: inline-flex; align-items: center; border-radius: 12px; background: var(--surface-2); }
.stepper button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; }
.stepper button:disabled { color: var(--line-2); }
.stepper button:not(:disabled):hover { background: var(--surface-3); }
.stepper output { min-width: 28px; text-align: center; font: 600 16px/1 var(--f-mono); }
.stepper .icon { width: 18px; height: 18px; stroke-width: 2.2; }

.switch { position: relative; flex: none; width: 50px; height: 30px; border-radius: 15px; background: var(--surface-3); transition: background-color .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
[aria-checked="true"] > .switch, .switch[aria-checked="true"] { background: var(--ok); }
[aria-checked="true"] > .switch::after, .switch[aria-checked="true"]::after { transform: translateX(20px); }

/* ---------- тост ---------- */
.toast { position: fixed; left: 50%; z-index: 80; display: flex; align-items: center; gap: 14px; max-width: min(440px, calc(100% - 24px)); min-height: 48px; padding: 8px 8px 8px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 15px; line-height: 1.3; translate: -50% 12px; opacity: 0; pointer-events: none; transition: opacity .2s, translate .25s var(--ease); }
.toast.show { opacity: 1; translate: -50% 0; pointer-events: auto; }
.toast button { flex: none; min-height: 36px; padding: 0 12px; border-radius: 10px; background: color-mix(in srgb, var(--bg) 16%, transparent); color: inherit; font-weight: 700; }
.toast:not(:has(button)) { padding-right: 16px; }

/* ---------- талон: термобумага с отрывным краем снизу ---------- */
.paper { position: relative; background: var(--paper); color: var(--paper-ink);
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%; }
.paper-wrap { filter: drop-shadow(0 1px 0 rgba(34, 26, 20, .08)) drop-shadow(0 6px 10px rgba(34, 26, 20, .12)); }
:root[data-theme="dark"] .paper-wrap { filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .45)); }
.paper .rule { height: 0; margin: 10px 0; border-top: 1.5px dashed var(--paper-line); }

/* ---------- разрез стакана (assets/cup.js) ---------- */
.cup { width: 100%; height: auto; color: var(--ink); overflow: visible; }
.cup .cup-line { fill: none; stroke: currentColor; stroke-width: 1.6px; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.cup .cup-lid { fill: var(--surface); stroke: currentColor; stroke-width: 1.6px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.cup .cup-sleeve { fill: var(--accent); }
.cup .cup-straw { stroke: var(--accent); stroke-width: 6; stroke-linecap: butt; }
.cup .cup-straw-edge { stroke: currentColor; stroke-width: 9; stroke-linecap: butt; }
.cup .cup-ice { fill: rgba(225, 238, 246, .38); stroke: rgba(70, 105, 140, .6); stroke-width: 1.3px; vector-effect: non-scaling-stroke; }
.cup .px-seam { fill: none; stroke: #8A5328; stroke-width: 2.5; stroke-linecap: round; opacity: .75; }
.cup--detail .cup-line, .cup--detail .cup-lid { stroke-width: 2px; }
.cup .cup-axis { stroke: var(--line-2); stroke-width: 1px; vector-effect: non-scaling-stroke; stroke-dasharray: 18 4 3 4; }
.cup .cup-lead { fill: none; stroke: var(--ink); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.cup .cup-dot { fill: var(--ink); stroke: var(--surface); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.cup .cup-lab { font: 600 13px var(--f-text); fill: var(--ink); }
.cup .cup-ml { font: 500 11.5px var(--f-mono); fill: var(--muted); }
.cup .cup-dim, .cup .cup-ext { stroke: var(--ink); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.cup .cup-ext { stroke: var(--line-2); stroke-dasharray: 3 3; }
.cup .cup-arrow { fill: var(--ink); }
.cup .cup-dimtext { font: 600 12px var(--f-mono); fill: var(--ink); paint-order: stroke; stroke: var(--bg); stroke-width: 5px; }

/* след от чашки на карте гостя */
.ring path { stroke: #6B4330; opacity: .82; }
:root[data-theme="dark"] .ring path { stroke: #C79A74; }

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