/* Genesis store mini app. Palette: celadon porcelain + steeped-tea green ink + brass for prices; dark variant follows Telegram's dark theme. */
:root {
  --paper: #e7ede3; --porcelain: #f7f9f4; --ink: #17322e; --ink-2: #3d5752; --smoke: #76857f; --brass: #9b7432; --line: rgba(23, 50, 46, .14);
  --danger: #a23b2c; --ok: #2f6b4f; --shadow: 0 1px 0 rgba(23, 50, 46, .06), 0 10px 24px -18px rgba(23, 50, 46, .45);
  --display: 'Unbounded', 'Golos Text', system-ui, sans-serif; --body: 'Golos Text', system-ui, sans-serif;
}
:root[data-scheme="dark"] {
  --paper: #121b19; --porcelain: #1a2623; --ink: #e4ebe2; --ink-2: #b9c6c0; --smoke: #8a9892; --brass: #d0a75f; --line: rgba(228, 235, 226, .12);
  --danger: #e07a68; --ok: #7cc39f; --shadow: 0 10px 24px -18px rgba(0, 0, 0, .8);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
main { max-width: 640px; margin: 0 auto; padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
img { display: block; max-width: 100%; }

/* ---------- header: the shop name is the hero, a brass steam line rises once ---------- */
.head { position: relative; padding: 10px 0 18px; }
.head h1 { font: 700 34px/1.04 var(--display); letter-spacing: -.01em; margin: 0; max-width: 11ch; }
.head p { margin: 10px 0 0; color: var(--ink-2); max-width: 34ch; }
.steam { position: absolute; right: 4px; top: -6px; width: 74px; height: 110px; color: var(--brass); }
.steam path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 160; stroke-dashoffset: 160; animation: rise 2.4s .3s ease-out forwards; }
.steam path + path { animation-delay: .7s; opacity: .6; }
@keyframes rise { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .steam path { animation: none; stroke-dashoffset: 0; } }
.admin-link { margin-top: 14px; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; color: var(--ink-2); }

/* ---------- categories ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 4px -16px 18px; padding: 0 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 8px 16px; font-weight: 500; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- product grid ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
.card { display: flex; flex-direction: column; background: none; border: 0; padding: 0; text-align: left; }
.card .ph { position: relative; aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; background: var(--porcelain); box-shadow: var(--shadow); }
.card .ph img { width: 100%; height: 100%; object-fit: cover; }
.mono { position: absolute; inset: 0; display: grid; place-items: center; font: 700 44px var(--display); color: var(--brass); opacity: .55; }
.card .out { position: absolute; left: 8px; bottom: 8px; background: var(--porcelain); color: var(--ink-2); font-size: 12px; padding: 2px 8px; border-radius: 6px; }
.card h3 { font: 500 15px/1.3 var(--body); margin: 10px 0 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .unit { color: var(--smoke); font-size: 13px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.price { font: 700 15px var(--display); color: var(--brass); letter-spacing: -.01em; }
.add { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--ink); background: transparent; font-size: 22px; line-height: 1; display: grid; place-items: center; }
.add:disabled { opacity: .3; }
.step { display: inline-flex; align-items: center; border: 1px solid var(--ink); border-radius: 999px; height: 36px; }
.step button { width: 34px; height: 34px; border: 0; background: none; font-size: 20px; line-height: 1; }
.step span { min-width: 20px; text-align: center; font-weight: 600; }
.empty { padding: 40px 0; color: var(--ink-2); }
.hidden-tag { color: var(--danger); font-size: 12px; }

/* ---------- product sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(10, 20, 18, .45); display: flex; align-items: flex-end; }
.sheet[hidden] { display: none; }
.sheet .panel { width: 100%; max-width: 640px; margin: 0 auto; max-height: 92vh; overflow: auto; background: var(--paper); border-radius: 22px 22px 0 0; padding: 0 0 calc(100px + env(safe-area-inset-bottom)); animation: up .28s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet .panel { animation: none; } }
.sheet .big { aspect-ratio: 1 / 1; background: var(--porcelain); position: relative; }
.sheet .big img { width: 100%; height: 100%; object-fit: cover; }
.sheet .body { padding: 18px 16px 0; }
.sheet h2 { font: 700 22px/1.2 var(--display); margin: 0 0 6px; }
.sheet .desc { white-space: pre-line; color: var(--ink-2); margin: 14px 0 0; }
.close { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--porcelain); font-size: 20px; box-shadow: var(--shadow); }

/* ---------- cart & checkout ---------- */
h2.title { font: 700 24px/1.2 var(--display); margin: 6px 0 16px; }
.line { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line .thumb { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--porcelain); position: relative; }
.line .thumb img { width: 100%; height: 100%; object-fit: cover; }
.line .thumb .mono { font-size: 22px; }
.line .nm { font-weight: 500; line-height: 1.3; }
.line .sub { color: var(--smoke); font-size: 13px; }
.total { display: flex; justify-content: space-between; align-items: baseline; margin: 16px 0 26px; }
.total b { font: 700 22px var(--display); color: var(--brass); }
form.fields { display: grid; gap: 14px; }
label.f { display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
label.f input, label.f textarea, label.f select { width: 100%; border: 1px solid var(--line); background: var(--porcelain); border-radius: 12px; padding: 12px 14px; font-size: 16px; color: var(--ink); }
label.f textarea { min-height: 84px; resize: vertical; }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { border: 0; background: var(--porcelain); padding: 11px; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.hint { font-size: 13px; color: var(--smoke); margin: -6px 0 0; }
.err { color: var(--danger); font-size: 14px; }
.done { padding: 40px 0; }
.done h2 { font: 700 26px/1.15 var(--display); margin: 0 0 10px; }
.btn { border: 0; border-radius: 12px; padding: 13px 18px; background: var(--ink); color: var(--paper); font-weight: 600; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; z-index: 40; font-size: 14px; max-width: 90vw; }

/* ---------- admin ---------- */
.tabs { display: flex; gap: 6px; margin: 0 0 18px; overflow-x: auto; }
.tabs button { flex: none; border: 0; background: none; padding: 8px 10px; border-radius: 10px; color: var(--ink-2); font-weight: 500; }
.tabs button[aria-current="page"] { background: var(--porcelain); color: var(--ink); box-shadow: var(--shadow); }
.list { display: grid; gap: 0; }
.item { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; width: 100%; }
.item .thumb { width: 48px; height: 48px; border-radius: 10px; overflow: hidden; background: var(--porcelain); position: relative; }
.item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.item .thumb .mono { font-size: 20px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.photo-pick { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; }
.photo-pick .thumb { width: 96px; height: 120px; border-radius: 12px; overflow: hidden; background: var(--porcelain); position: relative; }
.photo-pick .thumb img { width: 100%; height: 100%; object-fit: cover; }
.check { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }
.order { padding: 14px 0; border-bottom: 1px solid var(--line); }
.order .top { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.order .st { font-size: 13px; padding: 2px 8px; border-radius: 6px; background: var(--porcelain); }
.order ul { margin: 6px 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; }
.order select { border: 1px solid var(--line); background: var(--porcelain); border-radius: 10px; padding: 8px 10px; }
.cat-row { display: grid; grid-template-columns: 1fr 70px auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cat-row input { border: 1px solid var(--line); background: var(--porcelain); border-radius: 10px; padding: 9px 10px; width: 100%; }
.outside { padding: 30px 0; color: var(--ink-2); }
