/* ── Анастасия Булаткина · авторский альманах ─────────────────────────
   Палитра: тёплая слоновая кость, шоколадные чернила, золотая фольга.
   Дисплейная антиква Prata + интерфейсный Golos Text. Без обводок блоков. */

@font-face {
  font-family: 'Prata';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/prata-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Prata';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/prata-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/golos-text-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/golos-text-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --canvas: #faf6ed;
  --paper: #fffdf9;
  --open-surface: #f4eddf;
  --field: #f3ebdb;
  --tint: #f6ecd6;
  --tint-deep: #f0e2c2;
  --gold: #ffeb97;
  --gold-soft: #fff5cb;
  --foil: #d9a648;
  --foil-deep: #a9762b;
  --chocolate: #583714;
  --ink: #2b1d10;
  --muted: #766550;
  --error: #a6402a;
  --hairline: rgb(88 55 20 / 0.16);
  --serif: 'Prata', Georgia, 'Times New Roman', serif;
  --sans: 'Golos Text', system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.22, 0.7, 0.25, 1);
  --shadow-book: 0 24px 48px -20px rgb(88 55 20 / 0.5), 0 6px 16px -8px rgb(88 55 20 / 0.28);
}

* { box-sizing: border-box; }

html {
  scrollbar-width: none;
  scroll-padding-bottom: 96px;
}
html::-webkit-scrollbar { display: none; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }

h1, h2 { font-family: var(--serif); font-weight: 400; color: var(--chocolate); }
h1:focus, h2:focus { outline: none; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; }

.i {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.shell {
  max-width: 468px;
  margin: 0 auto;
  padding: 14px clamp(18px, 5vw, 24px) calc(96px + env(safe-area-inset-bottom, 0px));
}

.view:not([hidden]) { animation: view-in 0.3s var(--ease) both; }
@keyframes view-in {
  from { opacity: 0; transform: translateY(10px); }
}

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── Обложка-объект ─────────────────────────────────────────────── */

.book {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 3px 7px 7px 3px;
  background: url('assets/cover-art.jpg') center / cover;
  box-shadow:
    inset 6px 0 8px -5px rgb(60 35 10 / 0.45),
    inset -1px 0 0 rgb(255 255 255 / 0.35),
    var(--shadow-book);
  display: grid;
  place-content: center;
  gap: 5px;
  padding: 0 8%;
  text-align: center;
  color: var(--chocolate);
  transform: translateY(4%);
}
.book-author,
.book-caption {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 6.5px;
  line-height: 1.3;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.book-middle { display: grid; gap: 5px; justify-items: center; }
.book-year {
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.04em;
}
.hero-book .book-year { font-size: 1.9rem; }
.release-book { width: 76px; box-shadow: inset 4px 0 6px -4px rgb(60 35 10 / 0.4), 0 10px 22px -12px rgb(88 55 20 / 0.5); }
.release-book .book-year { font-size: 1.4rem; }
.release-book .book-author, .release-book .book-caption { font-size: 4.6px; letter-spacing: 0.1em; }
.release-book { gap: 3px; }
.release-book .book-middle { gap: 3px; }

/* ── Кнопки и ссылки ────────────────────────────────────────────── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.button .i { width: 18px; height: 18px; }
.button.primary {
  background: var(--chocolate);
  color: #fff6e3;
  box-shadow: 0 10px 24px -14px rgb(88 55 20 / 0.75);
}
.button.primary:active { transform: scale(0.98); }
.button.quiet {
  min-height: 40px;
  padding: 8px 12px;
  background: transparent;
  color: var(--chocolate);
  font-size: 13px;
}
.button.wide { width: 100%; }
.button:disabled { opacity: 0.6; cursor: progress; transform: none; }
.button:focus-visible,
a:focus-visible,
summary:focus-visible,
select:focus-visible {
  outline: 2px solid var(--chocolate);
  outline-offset: 2px;
}

.inline-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  font-weight: 600;
  font-size: 13px;
  color: var(--chocolate);
}
.inline-link .i { width: 16px; height: 16px; }

/* ── Главная ────────────────────────────────────────────────────── */

.author-heading {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(18px, 5vw, 26px) clamp(14px, 4.5vw, 22px) 10px;
  margin-bottom: 14px;
  border-radius: 17px;
  background: linear-gradient(105deg, #f8edda, #f5f0e9 74%);
}
.author-photo {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 auto;
  width: 46%;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 23%);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 23%);
}
.author-photo::before {
  content: '';
  display: block;
  width: 137%;
  aspect-ratio: 475 / 680;
  margin: -15% 0 0 -18.5%;
  background: url('assets/author-portrait.jpg') center / cover;
}
.author-contacts { width: fit-content; max-width: 100%; }
.byline {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--chocolate);
  font-size: 13px;
  margin-bottom: 10px;
}
.byline::before {
  content: '';
  width: 22px;
  height: 2px;
  background: linear-gradient(90deg, var(--foil-deep), var(--gold));
}
.author-heading h1 {
  margin: 0;
  font-size: clamp(32px, 8.9vw, 43px);
  letter-spacing: -.045em;
  line-height: 1.08;
}
.author-contacts { display: flex; flex-wrap: wrap; column-gap: 15px; margin-top: 9px; }
.author-contacts a, .edition-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  font-size: 14px;
  color: var(--chocolate);
}
.author-contacts a:hover, .edition-feature:hover .edition-link { text-decoration: underline; text-underline-offset: 4px; }
.author-contacts .i, .edition-link .i { width: 16px; height: 16px; }
.author-contacts a { font-size: 13px; font-weight: 500; gap: 5px; }

.edition-feature {
  display: grid;
  grid-template-columns: minmax(0, .84fr) minmax(0, 1fr);
  gap: clamp(16px, 5vw, 27px);
  align-items: center;
  min-height: 195px;
  padding: clamp(18px, 5vw, 28px);
  margin-bottom: 12px;
  border-radius: 17px;
  background: radial-gradient(ellipse at 18% 44%, var(--gold) 0%, var(--gold-soft) 31%, var(--paper) 78%);
}
.hero-book {
  width: min(100%, 128px);
  justify-self: center;
  padding: 0 9px;
  transform: rotate(-4deg);
  box-shadow:
    inset 3px 0 3px rgb(75 41 9 / .16),
    inset -1px 0 0 var(--foil),
    6px 9px 14px -6px rgb(67 43 12 / .38);
}
.edition-copy h2 { margin: 0; font-size: clamp(22px, 6.1vw, 30px); line-height: 1.22; letter-spacing: -.035em; }
.edition-copy p { margin: 9px 0 3px; font-size: 13px; line-height: 1.5; color: #664c31; }
.edition-link { font-weight: 600; }
.next-step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 20px;
  gap: 12px;
  align-items: center;
  padding: 14px 2px;
  transition: transform 0.15s var(--ease);
}
.next-step:active { transform: scale(0.99); }
.home-directory { background: var(--paper); border-radius: 17px; padding: 3px 16px; }
.next-step-copy strong { display: block; font-size: 14.5px; font-weight: 600; }
.next-step-copy small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.go { color: var(--muted); }

.row-icon { display: grid; place-items: center; width: 24px; color: var(--chocolate); }
.row-icon.small { width: 20px; }
.row-icon.small .i { width: 17px; height: 17px; }

.upcoming h2 {
  margin: 0 0 10px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.icon-symbols { position: absolute; pointer-events: none; }
.upcoming { margin-top: 28px; }
.waiting-list { display: grid; list-style: none; padding: 0; margin: 0; }
.waiting-list li { display: flex; align-items: baseline; gap: 12px; padding: 8px 0; color: var(--chocolate); font-size: 14px; }
.waiting-list .i { width: 15px; height: 15px; flex: none; align-self: flex-start; margin-top: 3px; color: var(--muted); }
.waiting-list small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.readings-header, .profile-header {
  padding: 21px 19px;
  border-radius: 17px;
  margin-bottom: 14px;
  background-color: #f7eedc;
}
.readings-header {
  background-image: linear-gradient(90deg, #f8eedc 16%, rgb(248 238 220 / .88) 54%, transparent 84%), url('assets/armillary.jpg');
  background-size: cover;
  background-position: right 47%;
}
.readings-header .section-heading { margin: 0 0 8px; }
.readings-note { color: #705739; font-size: 13px; max-width: 68%; }
.waiting-group { border-radius: 17px; padding: 0 16px; background: var(--paper); margin: 10px 0; }
.waiting-group[open] { background: var(--open-surface); }
.waiting-group summary, .future-summary summary {
  display: flex; align-items: center; gap: 12px;
  min-height: 55px; cursor: pointer; list-style: none;
}
.waiting-group summary::-webkit-details-marker, .future-summary summary::-webkit-details-marker { display: none; }
.waiting-group summary { font: 400 clamp(18px, 5vw, 22px)/1.3 var(--serif); color: var(--chocolate); }
.waiting-group summary .i:first-child { color: #916b31; }
.waiting-group summary .i:last-child, .future-summary summary .i { width: 16px; height: 16px; margin-left: auto; }
.waiting-group[open] summary .i:last-child, .future-summary[open] summary .i { transform: rotate(180deg); }
.waiting-group .waiting-list { padding: 0 0 14px 32px; }
.waiting-group .waiting-list li { padding: 6px 0; color: var(--muted); }
.future-summary { margin-top: 12px; }
.future-summary summary { font-size: 14px; font-weight: 600; }
.future-summary summary span { color: var(--muted); font-size: 12px; font-weight: 400; }
.future-summary summary .i { margin-left: 0; }
.home-faq { margin-top: 18px; padding: 16px 16px 2px; background: var(--paper); border-radius: 17px; }
.home-faq h2 { margin: 0 0 5px; font: 400 21px/1.35 var(--serif); color: var(--chocolate); }
.delivery-help + .delivery-help { border-top: 1px solid var(--hairline); }
.delivery-help summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; color: var(--chocolate); font-size: 14px; font-weight: 600; list-style: none; cursor: pointer; }
.delivery-help summary::-webkit-details-marker { display: none; }
.delivery-help .i { width: 16px; height: 16px; }
.delivery-help[open] .i { transform: rotate(180deg); }
.delivery-help p { margin-bottom: 12px; color: var(--muted); font-size: 13px; }

/* ── Маркет ─────────────────────────────────────────────────────── */

.section-heading {
  margin: 4px 0 16px;
  font-size: clamp(2.15rem, 9.5vw, 2.8rem);
  line-height: 1.1;
}
.market-edition {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  padding: 12% 9% 8%;
  border-radius: 16px;
  background: #eaca84 url('assets/cover-art.jpg') center / 100% 100% no-repeat;
  box-shadow: inset 0 0 0 1px rgb(104 69 21 / .12), 0 12px 26px -22px #664213;
  text-align: center;
  color: #442c12;
}
.market-cover-title {
  font: 400 clamp(29px, 8.7vw, 43px)/1.08 var(--serif);
  letter-spacing: -.046em;
}
.market-cover-lead {
  max-width: 25ch;
  margin: clamp(8px, 3vw, 14px) 0;
  font-size: clamp(12px, 3.4vw, 15px);
  line-height: 1.42;
  text-wrap: balance;
}
.market-cover-link, .market-back, .service-availability {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
}
.market-cover-link { padding-bottom: 2px; border-bottom: 1px solid currentColor; }
.market-cover-link .i, .market-back .i, .service-availability .i { width: 15px; height: 15px; }
.market-edition:hover .market-cover-link { color: #281803; }
.market-back { min-height: 44px; margin-bottom: 8px; color: var(--muted); }
.market-back:hover { text-decoration: underline; }
#market-product .description { max-width: 45ch; }
.market-order-note { margin: 16px 0; padding: 15px; background: var(--paper); border-radius: 12px; font-size: 14px; }
.market-order-note a { margin-top: 6px; }
.market-services { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--hairline); }
.market-services h2 { margin: 0; font-size: clamp(25px, 6.7vw, 31px); line-height: 1.22; letter-spacing: -.035em; }
.market-services-note { margin: 7px 0 22px; color: var(--muted); max-width: 33ch; font-size: 13px; }
.service-group + .service-group { margin-top: 24px; }
.service-group h3 { margin: 0 0 10px; font: 500 15px/1.35 var(--sans); color: var(--chocolate); }
.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.service-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
  min-width: 0;
  min-height: 99px;
  padding: 14px clamp(10px, 3vw, 16px);
  border: 0;
  border-radius: 13px;
  background: var(--paper);
  text-align: left;
  color: var(--chocolate);
  font: 400 clamp(13px, 3.8vw, 17px)/1.34 var(--serif);
  overflow-wrap: anywhere;
  cursor: pointer;
}
.service-tile .i { width: 23px; height: 23px; color: #8c693c; stroke-width: 1.3; }
.service-tile .service-lock { position: absolute; top: 14px; right: 12px; width: 14px; height: 14px; color: #7c6c56; stroke-width: 1.6; }
.service-tile:hover { background: var(--open-surface); }
.service-tile:focus-visible { outline: 2px solid var(--chocolate); outline-offset: 2px; }
.service-availability { margin-top: 16px; color: var(--chocolate); }
.description { margin: 0 0 14px; max-width: 34ch; font-size: 14px; color: var(--muted); }
.purchase-title { margin: 0; font: 400 20px/1.3 var(--serif); color: var(--chocolate); }

.facts { display: grid; gap: 8px; margin: 0 0 18px; font-size: 13.5px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }

.book-actions { display: grid; gap: 6px; justify-items: stretch; }
.book-actions .quiet { justify-self: center; }

.state-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  margin-top: 4px;
  padding: 14px;
  border-radius: 16px;
  background: var(--paper);
}
.state-icon { color: var(--chocolate); display: grid; place-items: start center; padding-top: 2px; }
.state-icon .i { width: 18px; height: 18px; }
.state-card strong { font-size: 14.5px; font-weight: 600; }
.state-card p { margin: 4px 0 8px; font-size: 13px; color: var(--muted); }
.state-card .button { min-height: 42px; padding: 10px 16px; font-size: 13px; }

.note { margin: 10px 2px 0; min-height: 0; font-size: 12.5px; color: var(--muted); }
.note:empty { display: none; }
.note.error { color: var(--error); }

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--chocolate);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--foil); }

/* ── Чат ────────────────────────────────────────────────────────── */

.chat-screen {
  padding: clamp(60px, 14vh, 120px) 10px 40px;
  text-align: center;
}
.chat-emblem { display: inline-flex; margin-bottom: 16px; color: var(--chocolate); }
.chat-emblem .i { width: 26px; height: 26px; }
.chat-screen h1 { margin: 0; font-size: clamp(1.8rem, 8vw, 2.3rem); }
.chat-screen p { margin: 10px auto 0; max-width: 26ch; font-size: 13.5px; color: var(--muted); }

/* ── Профиль ────────────────────────────────────────────────────── */

.profile-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-direction: row-reverse;
  justify-content: space-between;
  background: linear-gradient(110deg, #f7eedc, #f4e3bf);
}
.profile-avatar { color: var(--chocolate); display: flex; }
.profile-avatar .i { width: 32px; height: 32px; stroke-width: 1.2; }
.profile-header h1 { margin: 0 0 6px; font-size: clamp(2.15rem, 9.5vw, 2.8rem); line-height: 1.1; }
.profile-header small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.profile-header #telegram-identity { font-variant-numeric: tabular-nums; }
.profile-header #connect-account { padding-inline: 0; min-height: 44px; }

.profile-item {
  margin-bottom: 10px;
  border-radius: 16px;
  background: var(--paper);
}
.profile-item[open] { background: var(--open-surface); }
.profile-item[open]:not(.profile-later) { padding-block-end: 10px; }
.profile-item summary > .row-icon, .edition-link .i, .author-contacts .i { color: #966921; }
.waiting-group[open] summary .i:first-child, .tabs a[aria-current='page'] .i { color: #94641e; }
#profile-invite { background: linear-gradient(140deg, #fff5d8, #fffdf8 74%); }
#profile-invite form .button { margin-top: 2px; }
#profile-error:empty { display: none; }
.profile-item summary:focus-visible, .waiting-group summary:focus-visible { outline-offset: -3px; border-radius: 14px; }
.profile-item summary .row-label strong { font: 400 18px/1.3 var(--serif); }
.profile-later .waiting-list { padding: 0 16px 14px 50px; }
.profile-later .waiting-list .i { display: none; }
.profile-later .waiting-list li { padding: 5px 0; color: var(--muted); }
.profile-item summary {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 18px;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}
.profile-item summary::-webkit-details-marker { display: none; }
.row-label strong { display: block; font-size: 14.5px; font-weight: 600; }
.row-label small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.chevron { width: 18px; height: 18px; color: var(--muted); transition: transform 0.25s var(--ease); }
.profile-item[open] .chevron { transform: rotate(180deg); }

.profile-body {
  display: grid;
  gap: 12px;
  margin: 0 10px;
  padding: 16px;
  border-radius: 12px;
  background: var(--paper);
}
.profile-item[open] .profile-body { animation: view-in 0.26s var(--ease) both; }
.profile-body .facts { margin: 0; }

#email-summary { overflow-wrap: anywhere; }
.profile-email {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  container-type: inline-size;
}
.profile-email-hint { margin: 6px 0 10px; }
.profile-email .choice {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  align-content: center;
  min-height: 44px;
  margin: 0;
  padding-block: 8px;
}
.profile-email .choice input { margin-top: 1px; }
.profile-email-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}
.profile-email-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.profile-email-actions .button { min-height: 44px; }
.profile-email [role="status"]:not(:empty) { margin-top: 10px; }
@container (max-width: 17rem) {
  .profile-email-actions { flex-direction: column; align-items: stretch; gap: 4px; }
}

.release-cover {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  animation: view-in 0.35s var(--ease) both;
}
.release-copy h2 { margin: 0 0 4px; font-size: 1.15rem; line-height: 1.25; }
.release-copy p { font-size: 12.5px; color: var(--muted); }

.subrow {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: var(--tint);
}
.subrow .row-label strong { font-size: 13.5px; }
.subrow .row-label small { font-size: 11.5px; }
.subrow .inline-link { min-height: 32px; font-size: 12.5px; }

/* ── Анкета ─────────────────────────────────────────────────────── */

#birth { display: grid; gap: 12px; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--chocolate);
}
.field label .small { font-weight: 400; }
.field input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
  font: 400 16px/1.3 var(--sans);
  scroll-margin-bottom: 120px;
  transition: box-shadow 0.2s;
}
.field input::placeholder { color: var(--muted); opacity: 1; }
.field input:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--chocolate); }
.field input[aria-invalid='true'] { box-shadow: inset 0 0 0 1.5px var(--error); }
.field-error { margin: 6px 2px 0; font-size: 12px; color: var(--error); }
.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
  font-weight: 500;
  font-size: 13.5px;
}
.choice input[type="checkbox"] {
  appearance: none; flex: 0 0 22px; width: 22px; height: 22px; padding: 0; margin: 0;
  display: inline-grid; place-content: center; border: 1.5px solid #987b56;
  border-radius: 6px; background: #fffdf8; cursor: pointer;
}
.choice input[type="checkbox"]:checked { background: #60401e; border-color: #60401e; }
.choice input[type="checkbox"]:checked::after {
  content: ""; width: 10px; height: 6px; border-left: 2px solid #fff4cd;
  border-bottom: 2px solid #fff4cd; transform: translateY(-1px) rotate(-45deg);
}
.choice input:focus-visible, .legal-choice a:focus-visible { outline: 2px solid #76501d; outline-offset: 3px; }
@media (forced-colors: active) {
  .choice input[type="checkbox"] { appearance: auto; }
  .choice input[type="checkbox"]:checked::after { content: none; }
}
#birth .button { justify-self: stretch; }

/* ── Таббар: стекло ─────────────────────────────────────────────── */

.tabs {
  position: fixed;
  z-index: 30;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(10px, env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  width: min(100% - 24px, 440px);
  padding: 6px;
  border-radius: 20px;
  background: rgb(255 253 249 / 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  box-shadow: 0 8px 28px rgb(72 46 20 / 0.16), inset 0 1px 0 rgb(255 255 255 / 0.8);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tabs { background: rgb(255 253 249 / 0.95); }
}
.tabs a {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  min-height: 50px;
  position: relative;
  min-width: 0;
  font-weight: 400;
  font-size: 11px;
  color: var(--muted);
  transition: color 0.2s, background-color 0.2s;
}
.tabs a .i { width: 21px; height: 21px; }
.tabs a[aria-current='page'] {
  background: var(--gold-soft);
  border-radius: 14px;
  font-weight: 600;
  color: var(--chocolate);
}

.tabs a[aria-current='page']::after {
  content: '';
  position: absolute;
  bottom: 1px;
  width: 12px;
  height: 2px;
  background: var(--foil-deep);
  border-radius: 2px;
}

/* ── Служебное прототипа ────────────────────────────────────────── */

.preview-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 2px 0;
  font-size: 12px;
  color: var(--muted);
}
.preview-controls select {
  border: 0;
  background: transparent;
  padding: 6px 0;
  font: 600 12px var(--sans);
  color: var(--chocolate);
}

dialog {
  width: min(100% - 40px, 360px);
  padding: 22px;
  border: 0;
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 80px -30px rgb(43 29 16 / 0.5);
}
dialog::backdrop { background: rgb(43 29 16 / 0.35); }
dialog h2 { margin: 0 0 8px; font-size: 1.35rem; }
dialog p { font-size: 13.5px; color: var(--muted); }
dialog .facts { margin: 14px 0 0; }
dialog .button { width: 100%; margin-top: 16px; }

/* ── Заставка ───────────────────────────────────────────────────── */

.splash {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-content: center;
  justify-items: center;
  background: radial-gradient(80% 60% at 50% 42%, var(--gold-soft) 0%, var(--canvas) 72%);
  transition: opacity 0.24s ease;
}
.splash.leave { opacity: 0; pointer-events: none; }
.splash-seal {
  position: relative;
  width: 92px;
  height: 92px;
  border: 1px solid rgb(88 55 20 / 0.35);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--paper);
  animation: seal-in 0.5s var(--ease) both;
}
.splash-seal::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--foil);
}
.splash-seal span {
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: -0.02em;
  color: var(--chocolate);
}
.splash-name {
  margin: 16px 0 14px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--chocolate);
}
.splash-progress {
  width: 56px;
  height: 2px;
  border-radius: 2px;
  background: var(--chocolate);
  transform-origin: left;
  animation: load 0.5s var(--ease) both;
}
@keyframes seal-in {
  from { opacity: 0; transform: scale(0.92); }
}
@keyframes load {
  from { transform: scaleX(0); }
}

/* ── Узкие экраны ───────────────────────────────────────────────── */

@media (max-width: 354px) {
  .author-contacts { flex-direction: column; align-items: flex-start; margin-top: 6px; }
  .edition-feature { gap: 14px; padding: 16px; min-height: 170px; }
  .edition-copy p { font-size: 12px; }
  .shell { padding-inline: 16px; }
}

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

/* ── Обёртка предпросмотра (экспорт ПРЕДПРОСМОТР.html) ──────────── */

body.phone-preview {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 14px;
  background: #e7decd;
}
.phone {
  position: relative;
  width: min(100%, 404px);
  height: min(850px, calc(100svh - 28px));
  border: 7px solid #352b24;
  border-radius: 35px;
  background: var(--canvas);
  overflow: hidden;
  box-shadow: 0 30px 70px -30px rgb(43 29 16 / 0.55);
}
.phone-bar {
  position: absolute;
  z-index: 25;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 10px;
  background: rgb(250 244 231 / 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 13px;
  color: var(--chocolate);
}
.phone-bar strong { font-weight: 600; font-size: 13px; }
.phone-bar span { color: var(--muted); font-size: 15px; }
.phone-scroll {
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  padding-top: 34px;
}
.phone-scroll::-webkit-scrollbar { display: none; }
.phone-preview .shell { padding-top: 10px; padding-bottom: 108px; }
.phone-preview .tabs {
  position: absolute;
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  width: calc(100% - 24px);
}
.phone-preview .splash { position: absolute; }
.phone-home {
  position: absolute;
  z-index: 26;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 4px;
  border-radius: 4px;
  background: rgb(43 29 16 / 0.35);
}
@media (max-width: 450px) {
  body.phone-preview { padding: 0; }
  .phone {
    width: 100%;
    height: 100svh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

.city-results button { display:block; width:100%; min-height:44px; padding:8px 0; border:0; background:transparent; color:var(--chocolate); text-align:left; font:inherit; }

.profile-docs { margin: 20px 10px 12px; }
.profile-docs h2 { font: 400 18px/1.35 var(--serif); margin: 0 0 6px; }
.profile-docs a, .legal-inline, .legal-text-button { color: #70502d; font: inherit; font-size: 13px; }
.profile-docs a { display: flex; align-items: center; justify-content: space-between; min-height: 44px; text-decoration: none; }
.profile-docs a::after { content: ''; width: 6px; height: 6px; margin-right: 9px; border: solid currentColor; border-width: 1px 1px 0 0; transform: rotate(45deg); }
.account-removal { margin: 0 10px; padding-top: 6px; border-top: 1px solid var(--hairline); }
.account-action { min-height: 44px; padding: 6px 0; border: 0; background: transparent; color: var(--error); font-size: 14px; cursor: pointer; }
.account-action:disabled { opacity: .6; cursor: default; }
.account-result { padding: clamp(32px, 12vh, 96px) 6px 16px; }
.account-result p { color: var(--muted); }
.account-result .account-action { margin-top: 12px; }
#closure-dialog p + p { margin-top: 10px; }
#closure-dialog .field-error:empty { display: none; }
#closure-dialog .delete-button { margin-top: 8px; background: var(--error); color: white; }
.legal-choice {
  margin-block: 8px; padding: 3px 12px 8px; border-radius: 14px;
  background: #f6f0e5; color: #443422; text-align: left;
}
.legal-choice .choice, .profile-email .legal-choice .choice {
  display: grid; grid-template-columns: 22px minmax(0,1fr); align-items: center;
  gap: 10px; margin: 0; padding-block: 8px; line-height: 1.4;
}
.legal-choice a {
  display: inline-block; margin-left: 32px; padding-block: 3px;
  font-size: 13px; line-height: 1.45; color: #6a4828;
  text-decoration: underline; text-decoration-color: #aa9072; text-underline-offset: 3px;
}
.legal-text-button { justify-self: start; border: 0; background: transparent; padding: 6px 0; }
#doc-reader { width: min(94vw, 36rem); max-height: 85dvh; overflow: auto; }
.legal-reading h3, .legal-page h2 { font: 600 16px/1.4 var(--sans); margin: 20px 0 6px; }
.legal-reading p, .legal-page p { margin: 0 0 12px; line-height: 1.55; }
.legal-reading .legal-version, .legal-page .legal-version { color: #765d43; font-size: 13px; }
.legal-page { max-width: 40rem; margin: auto; padding: 22px 18px 48px; }
.legal-page h1 { font: 400 clamp(25px,6vw,36px)/1.18 var(--serif); margin: 22px 0 12px; }


/* The native Telegram controls sit inside the device's safe area. */
html.telegram-mobile {
  --mobile-top: calc(max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px)) + var(--tg-content-safe-area-inset-top, 0px));
  --mobile-bottom: calc(max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px)) + var(--tg-content-safe-area-inset-bottom, 0px));
  --mobile-left: calc(max(env(safe-area-inset-left, 0px), var(--tg-safe-area-inset-left, 0px)) + var(--tg-content-safe-area-inset-left, 0px));
  --mobile-right: calc(max(env(safe-area-inset-right, 0px), var(--tg-safe-area-inset-right, 0px)) + var(--tg-content-safe-area-inset-right, 0px));
  overscroll-behavior-x: none;
  overscroll-behavior-y: contain;
  scroll-padding-top: calc(12px + var(--mobile-top));
  scroll-padding-bottom: calc(96px + var(--mobile-bottom));
}
.telegram-mobile body { padding-inline: var(--mobile-left) var(--mobile-right); }
.telegram-mobile .shell {
  padding-top: calc(14px + var(--mobile-top));
  padding-bottom: calc(96px + var(--mobile-bottom));
}
.telegram-mobile .tabs {
  bottom: calc(8px + var(--mobile-bottom));
  left: calc((100% + var(--mobile-left) - var(--mobile-right)) / 2);
  width: min(440px, calc(100% - 24px - var(--mobile-left) - var(--mobile-right)));
}
.telegram-mobile dialog {
  inset: var(--mobile-top) var(--mobile-right) var(--mobile-bottom) var(--mobile-left);
  max-height: calc(100dvh - var(--mobile-top) - var(--mobile-bottom) - 24px);
  max-width: calc(100% - var(--mobile-left) - var(--mobile-right) - 24px);
  overflow-y: auto;
}
