:root {
  --paper: oklch(95.8% 0.014 88);
  --paper-2: oklch(92.4% 0.02 88);
  --card: oklch(98.4% 0.008 88);
  --ink: oklch(24% 0.025 160);
  --ink-2: oklch(38% 0.025 160);
  --muted: oklch(51% 0.02 150);
  --line: oklch(84.5% 0.02 100);
  --accent: oklch(39% 0.075 162);
  --accent-2: oklch(33% 0.07 162);
  --accent-ink: oklch(97% 0.01 90);
  --sale: oklch(52% 0.15 31);
  --serif: "Alegreya", Georgia, "Times New Roman", serif;
  --sans: "Alegreya Sans", -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --step--1: clamp(.84rem, .82rem + .1vw, .9rem);
  --step-0: clamp(1rem, .97rem + .15vw, 1.08rem);
  --step-1: clamp(1.14rem, 1.08rem + .3vw, 1.32rem);
  --step-2: clamp(1.36rem, 1.22rem + .65vw, 1.78rem);
  --step-3: clamp(1.7rem, 1.42rem + 1.3vw, 2.6rem);
  --step-4: clamp(2.1rem, 1.62rem + 2.4vw, 3.7rem);
  --gut: clamp(16px, 3.2vw, 42px);
  --maxw: 1260px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: oklch(19.5% 0.014 160); --paper-2: oklch(23.5% 0.016 160); --card: oklch(22% 0.015 160);
    --ink: oklch(92% 0.014 90); --ink-2: oklch(80% 0.014 90); --muted: oklch(67% 0.015 100);
    --line: oklch(34% 0.016 160); --accent: oklch(72% 0.09 160); --accent-2: oklch(78% 0.09 160); --accent-ink: oklch(18% 0.02 160);
    --sale: oklch(68% 0.14 33);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: oklch(19.5% 0.014 160); --paper-2: oklch(23.5% 0.016 160); --card: oklch(22% 0.015 160);
  --ink: oklch(92% 0.014 90); --ink-2: oklch(80% 0.014 90); --muted: oklch(67% 0.015 100);
  --line: oklch(34% 0.016 160); --accent: oklch(72% 0.09 160); --accent-2: oklch(78% 0.09 160); --accent-ink: oklch(18% 0.02 160);
  --sale: oklch(68% 0.14 33);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--step-0)/1.5 var(--sans); }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.12; margin: 0 0 .4em; text-wrap: balance; }
h1 { font-size: var(--step-4); letter-spacing: -.01em; }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-0); }
p { margin: 0 0 .8em; }
a { color: inherit; text-decoration-color: color-mix(in oklch, currentColor 40%, transparent); text-underline-offset: .18em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
table { border-collapse: collapse; }

.demo-bar { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; justify-content: space-between; padding: 7px var(--gut); background: var(--ink); color: var(--paper); font-size: var(--step--1); }
.demo-bar p { margin: 0; }
.demo-bar nav { display: flex; gap: 16px; }
.demo-bar a { color: inherit; }
.demo-bar a[aria-current] { text-decoration: none; opacity: .65; }

.top { position: sticky; top: 0; z-index: 40; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px 30px; align-items: center; padding: 12px var(--gut); background: var(--paper); border-bottom: 1px solid var(--line); }
.logo { font: 800 var(--step-2)/1 var(--serif); text-decoration: none; color: var(--accent); display: flex; align-items: baseline; gap: 9px; }
.logo small { font: italic 400 var(--step--1) var(--serif); color: var(--muted); }
.search { position: relative; display: flex; max-width: 620px; }
.search input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--ink-2); border-right: 0; background: var(--card); border-radius: 2px 0 0 2px; }
.search button { padding: 0 16px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; border-radius: 0 2px 2px 0; }
.sugg { position: absolute; top: 100%; left: 0; right: 0; z-index: 50; background: var(--card); border: 1px solid var(--ink); border-top: 0; }
.sugg a { display: flex; gap: 12px; align-items: center; padding: 8px 12px; text-decoration: none; }
.sugg a:hover, .sugg a:focus { background: var(--paper-2); color: inherit; }
.sugg a span { display: grid; }
.sugg small { color: var(--muted); }
.sugg .all { justify-content: flex-end; color: var(--accent); border-top: 1px solid var(--line); }
.sugg .none { padding: 10px 12px; margin: 0; color: var(--muted); }
.main-nav { display: flex; gap: 22px; }
.main-nav a { text-decoration: none; }
.main-nav a[aria-current] { color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 8px; }
.cart-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; margin-left: 2px; background: var(--sale); color: #fff; font-size: 12px; font-weight: 700; border-radius: 10px; vertical-align: 1px; }
[hidden] { display: none !important; }

main { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut) 64px; outline: none; }
.boot { padding: 80px 0; color: var(--muted); font-family: var(--serif); font-style: italic; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); text-decoration: none; cursor: pointer; border-radius: 2px; font-weight: 700; line-height: 1.2; text-align: center; }
.btn:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--accent-ink); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: color-mix(in oklch, var(--accent) 9%, transparent); }
.btn.wide { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; }
.buy { display: flex; flex-wrap: wrap; gap: 10px; }

/* обложки */
.cover { --w: 120px; position: relative; display: flex; flex-direction: column; justify-content: space-between; width: var(--w); aspect-ratio: 2 / 3; padding: 10% 9%; overflow: hidden; flex: none;
  background: var(--c); color: oklch(97% 0.01 85); font-family: var(--serif); border-radius: 1px 3px 3px 1px;
  box-shadow: inset 4px 0 0 oklch(0% 0 0 / .18), inset 5px 0 0 oklch(100% 0 0 / .08); }
.cover .c-title { font-size: calc(var(--w) * .12); font-weight: 700; line-height: 1.1; hyphens: auto; overflow-wrap: anywhere; }
.cover .c-author { font: 400 calc(var(--w) * .078)/1.2 var(--sans); opacity: .85; }
.cover.s { --w: 34px; padding: 0; }
.cover.s span { display: none; }
.cover.m { --w: 100%; container-type: inline-size; }
.cover.m .c-title { font-size: 12cqi; }
.cover.m .c-author { font-size: 7.6cqi; }
.cover.l { --w: 240px; }
.cover.v0 { justify-content: flex-end; gap: 8%; }
.cover.v0::before { content: ""; position: absolute; left: 9%; right: 9%; top: 12%; height: 1px; background: currentColor; opacity: .5; }
.cover.v1 { background: linear-gradient(180deg, var(--c) 62%, color-mix(in oklch, var(--c) 70%, black) 62%); }
.cover.v1 .c-author { order: -1; }
.cover.v2 { text-align: center; align-items: center; justify-content: center; gap: 10%; }
.cover.v2::after { content: ""; position: absolute; inset: 6%; border: 1px solid currentColor; opacity: .45; }
.cover.v3 { background: radial-gradient(circle at calc(30% + var(--k) * 40%) 72%, color-mix(in oklch, var(--c) 55%, white) 0 18%, transparent 18.5%), var(--c); }
.cover.v4 { background: repeating-linear-gradient(135deg, transparent 0 9px, oklch(100% 0 0 / .06) 9px 10px), var(--c); }
.cover.v4 .c-title { font-style: italic; font-weight: 500; }
.cover.v5 { background: linear-gradient(90deg, color-mix(in oklch, var(--c) 75%, black) 0 18%, var(--c) 18%); padding-left: 24%; }
.cover.v6 { justify-content: center; }
.cover.v6 .c-title { font-size: calc(var(--w) * .135); }
.cover.m.v6 .c-title { font-size: 13.5cqi; }
.cover.v6 .c-author { position: absolute; bottom: 8%; left: 9%; }

/* карточка: цена и скидка висят на ляссе */
.card { position: relative; display: flex; flex-direction: column; min-width: 0; }
.card-cover { position: relative; display: block; margin-bottom: 10px; padding-top: 10px; }
.card-cover .cover { transition: transform .18s; }
.card-cover:hover .cover { transform: translateY(-3px); }
.tab { position: absolute; top: 0; right: 12%; z-index: 2; padding: 6px 5px 14px; min-width: 34px; text-align: center; background: var(--sale); color: #fff; font: 700 13px/1 var(--sans); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); }
.tab.new { background: var(--accent); writing-mode: vertical-rl; padding: 8px 6px 16px; font-weight: 400; font-style: italic; font-family: var(--serif); font-size: 14px; }
.card h3 { margin: 2px 0 1px; font-size: var(--step-0); font-weight: 600; line-height: 1.2; }
.card h3 a { text-decoration: none; }
.card .by { margin: 0 0 4px; color: var(--muted); font-size: var(--step--1); }
.price { margin: 0; display: flex; align-items: baseline; gap: 8px; }
.price b { font: 700 var(--step-1)/1.1 var(--serif); }
.price s, .fmt s { color: var(--muted); font-size: var(--step--1); }
.row { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin: 0 0 10px; color: var(--muted); font-size: var(--step--1); }
.stars b { color: var(--ink); font-weight: 700; }
.stars::before { content: "★ "; color: oklch(70% 0.14 75); }
.card .btn { margin-top: auto; padding: 8px 10px; font-size: var(--step--1); }
.card.out .card-cover { opacity: .62; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 30px 22px; }
.row-s { margin-top: 44px; }
.row-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--ink); margin-bottom: 14px; }
.row-h h2 { margin: 0 0 6px; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px; scrollbar-width: thin; }
.strip > * { scroll-snap-align: start; }
@media (min-width: 1100px) { .strip { grid-auto-columns: calc((100% - 5 * 22px) / 6); } }

/* витрина недели */
.window { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 28px 60px; align-items: center; padding: 40px 0 34px; border-bottom: 1px solid var(--line); }
.kicker { margin: 0 0 6px; font: italic 400 var(--step-1) var(--serif); color: var(--accent); }
.window h1 { max-width: 14ch; margin-bottom: .2em; }
.window .by { color: var(--muted); margin-bottom: 18px; }
.lead { font-size: var(--step-1); max-width: 56ch; color: var(--ink-2); }
.window-cover { justify-self: center; transform: rotate(-2.5deg); }
.window-cover .cover { box-shadow: inset 4px 0 0 oklch(0% 0 0 / .18), 14px 18px 0 -6px var(--paper-2); }

.cats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.cats a { display: inline-flex; gap: 7px; align-items: baseline; padding: 6px 12px 6px 10px; border-left: 4px solid var(--c); background: var(--card); text-decoration: none; font-size: var(--step--1); }
.cats small { color: var(--muted); }
.promo { margin-top: 44px; padding: 18px 22px; background: var(--accent); color: var(--accent-ink); }
.promo p { margin: 0; max-width: 80ch; }

/* каталог */
.cat-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 20px; padding: 30px 0 14px; }
.cat-head h1 { font-size: var(--step-3); margin: 0; }
.found { color: var(--muted); margin: 0; }
.cat-wrap { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 36px; }
.side h3 { margin: 0 0 6px; font-size: var(--step-0); }
.side ul { list-style: none; margin: 0 0 22px; padding: 0; }
.side li a { display: block; padding: 3px 0; text-decoration: none; }
.side a[aria-current] { color: var(--accent); font-weight: 700; }
.side .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.side .chips a { padding: 3px 9px; border: 1px solid var(--line); }
.side .chips a[aria-current] { border-color: var(--accent); }
.check { display: flex; gap: 8px; align-items: center; font-size: var(--step--1); }
.check input { accent-color: var(--accent); width: 18px; height: 18px; }
.sort { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 18px; font-size: var(--step--1); }
.sort a { text-decoration: none; color: var(--muted); }
.sort a[aria-current] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; }
.empty { color: var(--muted); font-style: italic; font-family: var(--serif); }
.pager { display: flex; gap: 20px; justify-content: center; align-items: baseline; margin-top: 36px; }

/* карточка книги */
.crumbs { display: flex; gap: 8px; padding: 18px 0 8px; font-size: var(--step--1); color: var(--muted); }
.crumbs a + a::before { content: "/"; margin-right: 8px; color: var(--line); }
.prod { display: grid; grid-template-columns: auto minmax(0, 1fr) 300px; gap: 28px 44px; align-items: start; padding-bottom: 20px; }
.prod-cover { display: grid; gap: 12px; }
.prod h1 { font-size: var(--step-3); margin-bottom: .15em; }
.prod .by { font-size: var(--step-1); color: var(--ink-2); margin-bottom: 8px; }
.about { max-width: 62ch; }
.spec { margin-top: 14px; font-size: var(--step--1); }
.spec th { text-align: left; font-weight: 400; color: var(--muted); padding: 4px 22px 4px 0; vertical-align: top; }
.spec td { padding: 4px 0; }
.offer { position: sticky; top: 90px; display: grid; gap: 10px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--accent); }
.fmt { display: grid; grid-template-columns: auto 1fr auto; gap: 0 10px; align-items: baseline; padding: 10px 12px; border: 1px solid var(--line); cursor: pointer; }
.fmt:has(input:checked) { border-color: var(--accent); background: color-mix(in oklch, var(--accent) 6%, transparent); }
.fmt input { accent-color: var(--accent); margin: 0; align-self: center; }
.fmt b { font: 700 var(--step-1) var(--serif); }
.fmt s { grid-column: 3; justify-self: end; }
.fmt small { grid-column: 2 / -1; color: var(--muted); font-size: var(--step--1); }
.note { color: var(--muted); font-size: var(--step--1); margin: 0; }

/* читалка отрывка */
body.reading .top, body.reading .foot, body.reading .tabbar { display: none; }
.reader { --rs: 1; margin: 0 calc(var(--gut) * -1); }
.r-bar { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 10px var(--gut); background: var(--paper); border-bottom: 1px solid var(--line); font-size: var(--step--1); }
.r-name { font-family: var(--serif); font-style: italic; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-tools { display: flex; gap: 4px; }
.r-tools button { padding: 4px 9px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.r-progress { position: sticky; top: 45px; z-index: 30; height: 2px; background: var(--line); }
.r-progress i { display: block; height: 100%; width: 0; background: var(--accent); }
.r-text { max-width: 66ch; margin: 0 auto; padding: 34px var(--gut) 40px; font: 400 calc(var(--step-1) * var(--rs))/1.65 var(--serif); hyphens: auto; }
.r-text h2 { margin: 1.6em 0 .7em; font-size: 1.3em; }
.r-text p { margin: 0; text-indent: 1.5em; }
.r-text h2 + p { text-indent: 0; }
.r-free { font: italic var(--step--1) var(--serif); color: var(--muted); text-indent: 0 !important; }
.r-end { margin-top: 48px; padding: 24px; border: 1px solid var(--accent); font-family: var(--sans); font-size: var(--step-0); }
.r-end p { text-indent: 0; margin-bottom: 14px; font-family: var(--serif); font-size: var(--step-1); }

/* корзина и оформление */
.narrow { max-width: 640px; padding: 50px 0; }
.page-h { font-size: var(--step-3); padding: 30px 0 10px; margin: 0; }
.cart, .co { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px 44px; align-items: start; }
.lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.lines li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: 8px 18px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.lines li > div { display: grid; }
.lines li > div a { text-decoration: none; }
.lines span, .lines small { color: var(--muted); font-size: var(--step--1); }
.qty { display: inline-flex; align-items: center; gap: 2px; }
.qty button { width: 30px; height: 30px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.qty output { min-width: 26px; text-align: center; color: var(--ink); }
.lines .sum { font-family: var(--serif); font-size: var(--step-1); white-space: nowrap; }
.del { border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: var(--step--1); }
.total { position: sticky; top: 90px; padding: 18px; background: var(--card); border: 1px solid var(--line); }
.total p { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.total .li span { color: var(--ink-2); font-size: var(--step--1); }
.total .minus b { color: var(--sale); }
.total .grand { margin: 14px 0; padding-top: 12px; border-top: 1px solid var(--ink); font-family: var(--serif); font-size: var(--step-2); }
.hint { color: var(--muted); font-size: var(--step--1); display: block !important; }
.co fieldset { border: 0; border-top: 1px solid var(--ink); margin: 0 0 26px; padding: 12px 0 0; display: grid; gap: 12px; }
.co legend { float: left; width: 100%; margin-bottom: 4px; font: 700 var(--step-1) var(--serif); }
.co label { display: grid; gap: 4px; font-size: var(--step--1); color: var(--ink-2); }
.co input:not([type=radio]) { padding: 10px 12px; border: 1px solid var(--ink-2); background: var(--card); border-radius: 2px; font-size: 16px; color: var(--ink); }
.co small { color: var(--muted); }
.co .opt { grid-template-columns: auto 1fr auto; align-items: baseline; gap: 0 10px; padding: 10px 12px; border: 1px solid var(--line); cursor: pointer; color: var(--ink); font-size: var(--step-0); }
.co .opt:has(input:checked) { border-color: var(--accent); }
.co .opt input { accent-color: var(--accent); margin: 0; }
.co .opt small { grid-column: 2; }
.co .opt b { grid-column: 3; grid-row: 1; }
.err { color: var(--sale); font-size: var(--step--1); }

/* оплата */
.pay { max-width: 460px; margin: 30px auto; }
.pay-note { padding: 10px 14px; border-left: 3px solid var(--sale); background: var(--card); font-size: var(--step--1); }
.pay-box { display: grid; justify-items: center; gap: 6px; padding: 30px 24px; border: 1px solid var(--ink); background: var(--card); text-align: center; }
.pay-sum { font: 700 var(--step-4)/1 var(--serif); margin: 0 0 4px; }
.qr { margin: 14px 0 6px; padding: 8px; background: #fff; border: 1px solid var(--line); }
.pay-box .buy { justify-content: center; margin-top: 12px; }

/* готово и чек */
.done { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 30px 50px; align-items: start; padding-top: 34px; }
.done h1 { font-size: var(--step-3); }
.files { list-style: none; padding: 0; margin: 0 0 8px; }
.files li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.files span { color: var(--muted); font-size: var(--step--1); margin-left: 8px; }
.receipt { padding: 22px 20px 26px; background: #fffdf7; color: #222; font: 12.5px/1.45 var(--mono); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), 95% 100%, 90% calc(100% - 8px), 85% 100%, 80% calc(100% - 8px), 75% 100%, 70% calc(100% - 8px), 65% 100%, 60% calc(100% - 8px), 55% 100%, 50% calc(100% - 8px), 45% 100%, 40% calc(100% - 8px), 35% 100%, 30% calc(100% - 8px), 25% 100%, 20% calc(100% - 8px), 15% 100%, 10% calc(100% - 8px), 5% 100%, 0 calc(100% - 8px)); border-top: 1px dashed #bbb; }
.receipt p { margin: 0 0 4px; }
.ch-c { text-align: center; margin-bottom: 12px !important; }
.receipt ol { list-style: none; margin: 12px 0; padding: 10px 0; border-block: 1px dashed #999; }
.receipt li { display: grid; grid-template-columns: 1fr; margin-bottom: 8px; }
.ch-r { text-align: right; }
.receipt small { color: #555; font-size: 11px; }
.ch-t { display: flex; justify-content: space-between; font-size: 15px; font-weight: 700; margin: 6px 0 10px !important; }
.ch-k { display: flex; justify-content: space-between; gap: 10px; }
.ch-k span:last-child { text-align: right; }

/* кабинет */
.adm { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 30px 50px; align-items: start; }
.adm h2 { border-bottom: 1px solid var(--ink); padding-bottom: 6px; }
.drop { display: block; margin: 14px 0 8px; padding: 28px 18px; border: 1px dashed var(--ink-2); text-align: center; cursor: pointer; background: var(--card); }
.drop span { color: var(--accent); text-decoration: underline; }
.drop.over { border-color: var(--accent); background: color-mix(in oklch, var(--accent) 8%, var(--card)); }
.up-form { display: grid; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.up-form label { display: grid; gap: 4px; font-size: var(--step--1); color: var(--ink-2); }
.up-form input:not([type=range]), .up-form select, .up-form textarea { padding: 9px 11px; border: 1px solid var(--ink-2); background: var(--card); border-radius: 2px; font-size: 16px; color: var(--ink); }
.up-form input[type=range] { accent-color: var(--accent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.up-msg { padding: 8px 12px; background: color-mix(in oklch, var(--accent) 10%, transparent); font-size: var(--step--1); margin: 0; }
.up-pre { color: var(--muted); font-size: var(--step--1); font-style: italic; margin: 0; }
.orders { width: 100%; font-size: var(--step--1); margin-bottom: 26px; }
.orders th, .orders td { text-align: left; padding: 7px 10px 7px 0; border-bottom: 1px solid var(--line); }
.orders th { font-weight: 400; color: var(--muted); }

/* подвал */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 40px; padding: 26px var(--gut) 90px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--step--1); }
.foot p { margin: 0 0 4px; }

/* панель Метрики */
.ym { position: fixed; left: 14px; bottom: 14px; z-index: 60; max-width: min(380px, calc(100vw - 28px)); font-size: 13px; }
.ym-t { padding: 7px 12px; border: 1px solid var(--ink); background: var(--card); cursor: pointer; font-weight: 700; }
.ym-n { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px; background: var(--ink); color: var(--paper); border-radius: 9px; text-align: center; font-weight: 400; }
.ym-panel { margin-bottom: 6px; max-height: 50vh; overflow: auto; padding: 12px; background: var(--card); border: 1px solid var(--ink); order: -1; }
.ym:has(.ym-panel:not([hidden])) { display: flex; flex-direction: column-reverse; }
.ym-panel > p { color: var(--muted); }
.ym-log { list-style: none; margin: 0; padding: 0; }
.ym-log li { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.ym-log time { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.ym-log i { grid-column: 2; color: var(--accent); font-style: normal; font-family: var(--mono); font-size: 11px; }
.ym-log code { grid-column: 2; font-size: 11px; color: var(--ink-2); overflow-wrap: anywhere; }
.ym-empty { display: block !important; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 90; max-width: min(92vw, 520px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 11px 16px; background: var(--ink); color: var(--paper); transition: .2s; font-size: var(--step--1); }
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { color: inherit; font-weight: 700; margin-left: 8px; }

.tabbar { display: none; }

@media (max-width: 980px) {
  .prod { grid-template-columns: auto minmax(0, 1fr); }
  .offer { grid-column: 1 / -1; position: static; }
  .cart, .co, .done, .adm { grid-template-columns: minmax(0, 1fr); }
  .total { position: static; }
}
@media (max-width: 760px) {
  .top { grid-template-columns: 1fr; gap: 10px; padding-block: 10px; }
  .main-nav { display: none; }
  .window { grid-template-columns: minmax(0, 1fr); padding-top: 22px; }
  .window-cover { grid-row: 1; justify-self: start; transform: rotate(-2deg); }
  .window-cover .cover.l { --w: 150px; }
  .cat-wrap { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .side { display: grid; gap: 4px; }
  .side ul:first-of-type { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 8px; padding-bottom: 4px; }
  .side ul:first-of-type li a { white-space: nowrap; padding: 4px 10px; border: 1px solid var(--line); }
  .side h3 { display: none; }
  .side .chips { margin-bottom: 8px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 16px; }
  .strip { grid-auto-columns: 42%; gap: 16px; }
  .prod { grid-template-columns: minmax(0, 1fr); }
  .prod-cover { grid-template-columns: auto 1fr; align-items: end; }
  .prod-cover .cover.l { --w: 140px; }
  .lines li { grid-template-columns: auto minmax(0, 1fr) auto; }
  .lines .qty { grid-column: 2; }
  .lines .sum { grid-column: 3; grid-row: 1; }
  .lines .del { grid-column: 3; justify-self: end; }
  .two { grid-template-columns: 1fr; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--paper); border-top: 1px solid var(--ink); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { padding: 11px 4px 12px; text-align: center; text-decoration: none; font-size: 14px; }
  .tabbar a[aria-current] { color: var(--accent); font-weight: 700; box-shadow: inset 0 2px 0 var(--accent); }
  .ym { bottom: calc(60px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(110px + env(safe-area-inset-bottom)); }
  main { padding-bottom: 120px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
@media print { .demo-bar, .top, .foot, .ym, .tabbar, .toast { display: none; } .receipt { clip-path: none; } }

/* страница «Как я это сделаю» */
.how { max-width: 1000px; margin: 0 auto; padding: clamp(32px, 6vw, 72px) var(--gut) 80px; }
.how section { margin-bottom: clamp(48px, 7vw, 84px); }
.how h1 { max-width: 18ch; }
.how h2 { margin-bottom: 16px; }
.how .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px 32px; }
.box { border-top: 2px solid var(--ink); padding: 14px 0 4px; }
.box.alt { border-top-color: var(--accent); background: var(--paper-2); padding: 14px 18px 16px; }
.box h3 { margin-bottom: 8px; }
.box p, .box li { color: var(--ink-2); }
.box ul { margin: 8px 0 0; padding-left: 18px; }
.box li + li { margin-top: 6px; }
.scheme { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--ink); margin-top: 12px; }
.node { text-align: left; padding: 14px 14px 16px; background: var(--paper); border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; }
.node:nth-child(4n) { border-right: 0; }
.node:nth-child(n+5) { border-bottom: 0; }
.node b { display: block; font: 700 var(--step-0)/1.2 var(--serif); margin-bottom: 4px; }
.node small { color: var(--muted); font-size: 14px; }
.node:hover { background: var(--paper-2); }
.node[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.node[aria-pressed="true"] small { color: inherit; opacity: .8; }
.node-info { margin-top: 14px; padding: 14px 18px; background: var(--paper-2); border-left: 3px solid var(--accent); min-height: 96px; max-width: 70ch; }
.flow { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.flow li { position: relative; padding: 0 0 20px 24px; }
.flow li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 11px; height: 15px; background: var(--accent); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%); }
.flow time { display: block; font: italic 400 var(--step-0)/1.3 var(--serif); color: var(--accent); }
.flow p { max-width: 64ch; margin: 2px 0 0; }
.pages { columns: 2 280px; column-gap: 40px; padding: 0; margin: 0; list-style: none; }
.pages li { break-inside: avoid; padding: 9px 0; border-bottom: 1px solid var(--line); font-weight: 700; }
.pages small { display: block; color: var(--muted); font-weight: 400; }
.table-wrap { overflow-x: auto; }
.stages { width: 100%; min-width: 620px; }
.stages th, .stages td { text-align: left; padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.stages th { font-weight: 400; font-size: var(--step--1); color: var(--muted); border-bottom: 2px solid var(--ink); }
.stages td:first-child { font-weight: 700; min-width: 150px; }
.stages td:nth-child(n+3) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.stages tfoot td { font-weight: 700; border-bottom: 0; font-family: var(--serif); font-size: var(--step-1); }
.note-how { margin-top: 16px; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--card); max-width: 70ch; }
.pay-plan { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--ink); margin: 16px 0; }
.pay-plan > div { padding: 14px; border-right: 1px solid var(--line); }
.pay-plan > div:last-child { border-right: 0; }
.pay-plan b { display: block; font: 700 var(--step-1)/1.15 var(--serif); font-variant-numeric: tabular-nums; }
.pay-plan small { color: var(--muted); font-size: 14px; }
.need { columns: 2 260px; column-gap: 40px; padding-left: 18px; margin: 0; }
.need li { margin-bottom: 6px; }
@media (max-width: 760px) {
  .scheme, .pay-plan { grid-template-columns: 1fr 1fr; }
  .node:nth-child(4n) { border-right: 1px solid var(--line); }
  .node:nth-child(2n) { border-right: 0; }
  .node:nth-child(n+5) { border-bottom: 1px solid var(--line); }
  .node:nth-child(n+7) { border-bottom: 0; }
  .pay-plan > div:nth-child(2n) { border-right: 0; }
  .pay-plan > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
