:root {
  --ground: #0E0C17;
  --panel: #17142A;
  --seam: #2A2640;
  --ink: #EDEBF5;
  --muted: #A39CBD;
  --free: #B9A3F5;
  --free-deep: #8F76E6;
  --mine: #FFFFFF;
  --sold: #3A3552;
  --held: #6E6690;
  --error: #FF9C9C;
  --on-free: #0E0C17;
  --free-hover: #CBBAF8;
  --free-wash: rgba(185, 163, 245, .14);
  --free-edge: rgba(185, 163, 245, .38);
  --bar: rgba(14, 12, 23, .96);
  --placeholder: #8780A3;
  --shadow: rgba(0, 0, 0, .55);
  --display: 'Geologica', 'Golos Text', sans-serif;
  --text: 'Golos Text', -apple-system, sans-serif;
  --pad: 20px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}
/* Светлая тема того же мира: бледно-лиловая бумага, чернильный текст. Включается по теме Telegram. */
:root[data-theme="light"] {
  --ground: #F3F0FA;
  --panel: #FFFFFF;
  --seam: #DCD5EE;
  --ink: #17132A;
  --muted: #5C5576;
  --free: #6A4FD0;
  --free-deep: #5139B0;
  --mine: #17132A;
  --sold: #CFC8E2;
  --held: #8A82A6;
  --error: #B3261E;
  --on-free: #FFFFFF;
  --free-hover: #5B41C2;
  --free-wash: rgba(106, 79, 208, .10);
  --free-edge: rgba(106, 79, 208, .45);
  --bar: rgba(243, 240, 250, .96);
  --placeholder: #7A7394;
  --shadow: rgba(42, 35, 71, .22);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--ground); -webkit-text-size-adjust: 100%; }
body {
  background: var(--ground);
  color: var(--ink);
  font: 400 16px/1.5 var(--text);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  min-height: 100dvh;
}
::selection { background: var(--free); color: var(--ground); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--seam); }
* { scrollbar-color: var(--seam) transparent; scrollbar-width: thin; }
input, textarea { caret-color: var(--free); }
:focus-visible { outline: 2px solid var(--free); outline-offset: 2px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
svg { display: block; }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0 var(--pad) calc(48px + env(safe-area-inset-bottom));
}
.app.has-bar {
  padding-bottom: calc(120px + env(safe-area-inset-bottom));
  position: relative;
}

/* ---------- top bar ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad);
  position: sticky; top: 0; z-index: 5; background: var(--ground);
  border-bottom: 1px solid transparent;
}
.top.scrolled { border-bottom-color: var(--seam); }
.top .who { font: 500 14px/1 var(--text); color: var(--muted); }
.back { text-decoration: none; display: inline-flex; align-items: center; gap: 10px; font: 500 15px/1 var(--text); color: var(--ink); padding: 10px 0; }
.back svg { transform: scaleX(-1); }
.cart-link {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 0 8px 12px;
  font: 500 15px/1 var(--text); text-decoration: none;
}
.cart-link .count {
  min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center;
  background: var(--free); color: var(--on-free); font: 600 13px/1 var(--text); border-radius: 2px;
}

/* ---------- type ---------- */
.title {
  font: 300 38px/1.04 var(--display); letter-spacing: -0.02em;
  text-wrap: balance; margin-top: 20px;
}
.lede { color: var(--muted); margin-top: 12px; max-width: 34ch; }
h2 {
  font: 400 24px/1.15 var(--display); letter-spacing: -0.01em;
  margin: 48px 0 8px; text-wrap: balance;
}
h3 { font: 600 16px/1.3 var(--text); }
.note { font-size: 14px; line-height: 1.45; color: var(--muted); }
.price { font: 400 28px/1 var(--display); letter-spacing: -0.01em; }

/* ---------- arrows & buttons ---------- */
.arrow { width: 22px; height: 12px; flex: none; transition: transform .35s var(--ease); }
.btn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 14px;
  min-height: 52px; padding: 0 18px; border-radius: 2px;
  font: 600 16px/1.2 var(--text); text-decoration: none; text-align: left;
  transition: background-color .2s, color .2s, opacity .2s;
}
.btn:hover .arrow, .link:hover .arrow { transform: translateX(4px); }
.btn-primary { background: var(--free); color: var(--on-free); }
.btn-primary:hover { background: var(--free-hover); }
.btn-primary:active { background: var(--free-deep); }
.btn-primary[disabled] { background: var(--sold); color: var(--muted); cursor: not-allowed; }
.btn-primary[disabled] .arrow { opacity: .4; }
.btn-line { border: 1px solid var(--seam); color: var(--ink); }
.btn-line:hover { border-color: var(--held); }
.btn-wide { width: 100%; }
.link {
  display: inline-flex; align-items: center; gap: 10px; color: var(--free);
  font: 500 15px/1.3 var(--text); text-decoration: none; padding: 8px 0;
}

/* ---------- edition map ---------- */
.edition { margin-top: 28px; }
.map {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px 10px;
}
.block { display: grid; gap: 6px; text-align: left; padding: 0; }
.block .dots {
  display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px;
  aspect-ratio: 1; width: 100%;
}
.block .dots i { border-radius: 50%; background: var(--sold); }
.block .dots i.f { background: var(--free); }
.block .dots i.h { background: none; box-shadow: inset 0 0 0 1px var(--held); }
.block .dots i.m { background: var(--mine); }
.block .range { font: 500 11px/1 var(--text); color: var(--muted); letter-spacing: .01em; }
.block:hover .dots i.f { background: var(--free-hover); }
.block.all-held .range { color: var(--muted); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 18px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--sold); display: inline-block; }
.legend i.f { background: var(--free); }
.legend i.h { background: none; box-shadow: inset 0 0 0 1px var(--held); }
.legend i.m { background: var(--mine); }

.buy-row {
  display: grid; gap: 16px;
  margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--seam);
}
.buy-row .pr { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.btn { white-space: nowrap; }

/* ---------- other items ---------- */
.item { display: grid; grid-template-columns: 64px 1fr; gap: 18px; padding: 22px 0; border-top: 1px solid var(--seam); }
.item:last-of-type { border-bottom: 1px solid var(--seam); }
.item .state { font: 500 13px/1 var(--text); color: var(--free); margin-top: 12px; display: inline-block; }
.soon { display: flex; gap: 10px; align-items: baseline; color: var(--muted); font-size: 15px; margin-top: 4px; }

.foot { margin-top: 56px; display: grid; gap: 4px; }
.proto { margin-top: 32px; font-size: 12px; color: var(--muted); }

/* ---------- cover object ---------- */
.cover { width: 100%; height: auto; }
.cover-wrap {
  margin: 8px auto 0; width: 62%; max-width: 230px;
  filter: drop-shadow(0 18px 28px var(--shadow));
}
.cover-cap { text-align: center; font-size: 12px; color: var(--muted); margin-top: 14px; }

/* ---------- copy screen ---------- */
.desc { margin-top: 16px; max-width: 36ch; }
.desc p + p { margin-top: 10px; }

.numberline {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin-top: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--seam);
}
.bignum {
  font: 300 84px/.9 var(--display); letter-spacing: -0.03em; display: flex; align-items: baseline;
  min-height: 76px;
}
.bignum .no { font-size: 32px; letter-spacing: 0; margin-right: 10px; color: var(--muted); }
.bignum .ph { color: var(--sold); }
.digit { display: inline-block; overflow: hidden; height: .92em; }
.digit span { display: inline-block; }
.settle .digit span { animation: settle .7s var(--ease) both; }
@keyframes settle {
  from { transform: translateY(100%); filter: blur(4px); opacity: 0; }
  to { transform: none; filter: none; opacity: 1; }
}
.numberline .side { display: grid; gap: 6px; justify-items: end; text-align: right; padding-bottom: 6px; max-width: 46%; }
.numberline .side.err { color: var(--error); }

.tabs {
  display: flex; gap: 6px; overflow-x: auto; margin: 18px calc(var(--pad) * -1) 0; padding: 0 var(--pad) 4px;
  scroll-snap-type: x proximity; scroll-padding-inline: var(--pad); scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; scroll-snap-align: start; display: grid; gap: 3px; text-align: left;
  padding: 9px 12px; border: 1px solid var(--seam); border-radius: 2px; min-width: 86px;
}
.tab b { font: 500 14px/1 var(--text); }
.tab small { font: 400 12px/1 var(--text); color: var(--muted); }
.tab[aria-selected="true"] { border-color: var(--free); background: var(--panel); }
.tab.none small { color: var(--muted); }

.grid100 {
  display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; margin-top: 14px;
}
.cell {
  aspect-ratio: 1; display: grid; place-items: center; border-radius: 2px;
  font: 500 11px/1 var(--text); letter-spacing: -0.02em; position: relative;
  transition: background-color .15s, color .15s;
}
.cell.f { color: var(--free); box-shadow: inset 0 0 0 1px var(--free-edge); }
.cell.f:hover { background: var(--free-wash); }
.cell.s { color: var(--sold); cursor: not-allowed; }
.cell.s::after { content: ""; position: absolute; left: 22%; right: 22%; top: 50%; height: 1px; background: var(--sold); }
.cell.h { color: var(--held); cursor: not-allowed; box-shadow: inset 0 0 0 1px var(--seam); }
.cell.r { color: var(--sold); cursor: not-allowed; }
.cell.m { background: var(--mine); color: var(--ground); font-weight: 600; }

.pickers { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.jump { display: flex; gap: 8px; flex: 1 1 200px; }
.jump .field { flex: 1; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; margin-top: 16px; }
.field > span { font: 500 14px/1.2 var(--text); color: var(--muted); }
.input {
  width: 100%; min-height: 50px; padding: 0 14px; border-radius: 2px;
  background: var(--panel); border: 1px solid var(--seam); color: var(--ink);
  font: 400 16px/1.2 var(--text);
}
.input::placeholder { color: var(--placeholder); }
.input:hover { border-color: var(--held); }
.input:focus { outline: none; border-color: var(--free); }
.input.bad { border-color: var(--error); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: right 20px center, right 15px center; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.field .err { font-size: 13px; color: var(--error); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  min-height: 40px; padding: 0 14px; border: 1px solid var(--seam); border-radius: 2px;
  font: 500 14px/1 var(--text); color: var(--ink);
}
.chip:hover { border-color: var(--held); }
.chip[aria-pressed="true"] { border-color: var(--free); background: var(--panel); color: var(--free); }

.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--seam); border-radius: 2px; margin-top: 16px; }
.seg button { min-height: 48px; font: 500 15px/1.2 var(--text); color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: inset 0 0 0 1px var(--free); }

.check { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; margin-top: 22px; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { appearance: none; width: 22px; height: 22px; border: 1px solid var(--held); border-radius: 2px; margin-top: 1px; display: grid; place-items: center; cursor: pointer; }
.check input:checked { background: var(--free); border-color: var(--free); }
.check input:checked::after { content: ""; width: 10px; height: 5px; border: solid var(--on-free); border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.check a { color: var(--free); text-underline-offset: 3px; }

/* ---------- reviews ---------- */
.review { padding: 20px 0; border-top: 1px solid var(--seam); }
.review .who { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.review .who b { color: var(--ink); font-weight: 600; }
.review .text { margin-top: 10px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.review.open .text { display: block; }
.review .media { display: flex; gap: 8px; margin-top: 12px; }
.review .media span { width: 72px; height: 72px; border: 1px dashed var(--held); border-radius: 2px; display: grid; place-items: center; font-size: 11px; color: var(--held); text-align: center; line-height: 1.2; }
.sample { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--muted); border: 1px solid var(--seam); padding: 3px 6px; border-radius: 2px; }

.specs { margin-top: 8px; }
.specs div { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-top: 1px solid var(--seam); font-size: 15px; }
.specs dt { color: var(--muted); }
.specs dd { text-align: right; }

/* ---------- cart ---------- */
.line { padding: 22px 0; border-top: 1px solid var(--seam); display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; }
.line .n { font: 300 44px/1 var(--display); letter-spacing: -0.02em; grid-row: span 3; min-width: 112px; }
.line .n small { font-size: 18px; color: var(--muted); margin-right: 4px; }
.line .for { font-size: 14px; color: var(--muted); }
.line .acts { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; grid-column: 2; }
.remove { font: 500 14px/1 var(--text); color: var(--muted); padding: 12px 0 12px 24px; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--seam); }
.remove:hover { color: var(--error); text-decoration-color: currentColor; }
.sum { margin-top: 8px; border-top: 1px solid var(--seam); }
.sum div { display: flex; justify-content: space-between; padding: 12px 0; font-size: 15px; color: var(--muted); }
.sum div.total { color: var(--ink); font: 400 22px/1.2 var(--display); border-top: 1px solid var(--seam); padding-top: 16px; }
.empty { margin-top: 64px; text-align: left; }
.empty p { color: var(--muted); margin: 10px 0 20px; }

.pvz { margin-top: 14px; padding: 16px; border: 1px solid var(--seam); border-radius: 2px; display: grid; gap: 6px; }
.pvz .row { display: flex; justify-content: space-between; gap: 12px; }
.hold { margin-top: 24px; padding: 14px 16px; background: var(--panel); border-radius: 2px; font-size: 14px; color: var(--muted); }
.hold b { color: var(--ink); font-weight: 500; }

/* ---------- bottom bar ---------- */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--bar); border-top: 1px solid var(--seam);
  padding: 12px var(--pad) calc(12px + env(safe-area-inset-bottom));
}
.bar .in { max-width: 440px; margin: 0 auto; display: flex; align-items: center; gap: 16px; }
.bar .meta { flex: none; display: grid; gap: 2px; }
.bar .meta b { font: 400 22px/1 var(--display); }
.bar .meta small { font-size: 13px; color: var(--muted); }
.bar .btn { flex: 1; }
.bar .pay-note { text-align: center; font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ---------- done ---------- */
.done { padding-top: 64px; }
.done .bignum { font-size: 120px; min-height: 110px; }
.done p { margin-top: 18px; max-width: 34ch; }
.done h1 { font: 400 28px/1.15 var(--display); letter-spacing: -0.01em; margin-top: 20px; }

.view { animation: enter .45s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 360px) {
  :root { --pad: 16px; }
  .title { font-size: 32px; }
  .bignum { font-size: 68px; }
  .cell { font-size: 10px; }
}

/* предзаказ */
.kicker { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--free); margin: 0 0 12px; }
.pre-how { margin-top: 40px; padding: 20px; background: var(--panel); border: 1px solid var(--seam); }
.pre-how ol { margin: 12px 0 14px; padding-left: 20px; display: grid; gap: 10px; font-size: 15px; line-height: 1.5; }
/* документы в подвале */
.legal { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 20px; font-size: 13px; }
.legal a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
