/* «Две секунды. Калькулятор возможностей».
   Основа — «графит» EKAi_lab (решение Галины по калькулятору внимания 25.11): графит, бронзовая кромка,
   салатовые кнопки действий. Под обложку книги (чёрный + золото) суммы и акценты — золотом;
   месячная сумма золотая, годовая белая (ТЗ 9.7), зелёного в суммах нет.
   Открытая страница книги — светлая кремовая, как страница атласа (ТЗ 14.1). */
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(fonts/manrope-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(fonts/manrope-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 {
  --text: #f5f1ea; --text2: #ddd3c7; --mute: #b3a79a;
  --gold: #e3b96f; --gold-l: #f1d398; --gold-line: rgba(213, 168, 98, .30);
  --edge: linear-gradient(138deg, rgba(240, 214, 180, .80) 0%, rgba(197, 150, 103, .50) 16%, rgba(105, 94, 84, .30) 42%,
    rgba(84, 78, 73, .26) 62%, rgba(181, 138, 98, .50) 86%, rgba(226, 194, 152, .70) 100%) border-box;
  --glass: radial-gradient(ellipse 70% 55% at 0% 0%, rgba(213, 176, 138, .10) 0%, transparent 72%) padding-box,
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(166, 108, 62, .11) 0%, transparent 75%) padding-box,
    linear-gradient(135deg, #2a2a2d 0%, #202124 42%, #1b1c1f 70%, #24221f 100%) padding-box, var(--edge);
  --deep: radial-gradient(ellipse 80% 70% at 85% 0%, rgba(240, 170, 70, .20) 0%, rgba(240, 170, 70, .05) 38%, transparent 64%) padding-box,
    linear-gradient(160deg, #0c0c0e 0%, #121214 55%, #17130e 100%) padding-box, var(--edge);
  --shadow: inset 0 1px 0 rgba(255, 255, 255, .045), inset 0 -10px 20px rgba(0, 0, 0, .20), 0 10px 26px rgba(0, 0, 0, .38);
  --btn: linear-gradient(180deg, #ddf58a 0%, #cdee67 32%, #b7e43a 100%);
  --btn-sh: inset 0 0 0 1px rgba(233, 255, 171, .45), inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -2px 4px rgba(63, 95, 7, .14),
    0 10px 24px rgba(154, 201, 44, .16), 0 2px 6px rgba(0, 0, 0, .3);
  --on-lime: #1e250c; --lime: #cdee67;
  --cream: #fbf7ef; --beige: #efe5d2; --ink: #1d1a16; --ink2: #4a4238; --dgold: #9a7534;
  --err: #f2a7a0;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --safe-top: max(env(safe-area-inset-top, 0px), calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), calc(var(--tg-safe-area-inset-bottom, 0px) + var(--tg-content-safe-area-inset-bottom, 0px)));
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: #101114; }
body {
  margin: 0; min-height: 100vh; color: var(--text); font-family: var(--sans); line-height: 1.5; overflow-x: hidden;
  background:
    radial-gradient(120% 45% at 88% 0%, rgba(176, 116, 52, .20) 0%, rgba(176, 116, 52, .06) 30%, transparent 56%),
    radial-gradient(90% 35% at 10% 85%, rgba(120, 72, 36, .08) 0%, transparent 52%),
    linear-gradient(180deg, #131417 0%, #0f1012 100%);
  background-color: #101114; background-attachment: fixed;
}
.wrap { max-width: 600px; margin: 0 auto; padding: calc(16px + var(--safe-top)) 16px calc(40px + var(--safe-bottom)); }
h1, h2, h3, h4, p { margin: 0; }
h2 { font-size: clamp(20px, 5.8vw, 23px); font-weight: 750; line-height: 1.22; letter-spacing: -.3px; color: #f7f3ec; }
button { font-family: inherit; }
a { color: var(--gold-l); }

.card, .dark { border: 1px solid transparent; box-shadow: var(--shadow); }
.card { background: var(--glass); margin-top: 16px; padding: 24px 18px; border-radius: 22px; }
.dark { background: var(--deep); border-radius: 22px; }
.card > h2 { margin-bottom: 14px; }
.text { color: var(--text2); font-size: 16px; margin-bottom: 4px; }

/* Приветствие */
.hero { padding: 26px 20px 26px; }
.eyebrow { color: #d6b98c; font-size: 12px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; }
h1 { font-size: clamp(28px, 8.4vw, 36px); font-weight: 800; line-height: 1.13; letter-spacing: -.8px; color: #fbf7f0; margin: 14px 0 14px; }
.lead { color: #e9e1d6; font-size: 17px; }
.accent { color: var(--gold-l); font-size: 17px; font-weight: 650; margin-top: 12px; }
.accent.strong { font-size: 19px; font-weight: 750; margin-top: 8px; margin-bottom: 12px; }
.white { color: #fff; }

/* Поля */
.field { padding: 14px 0 16px; }
.field + .field { border-top: 1px solid rgba(197, 150, 103, .12); }
.field label { display: block; font-size: 16px; font-weight: 650; color: #f1ebe2; margin-bottom: 10px; line-height: 1.35; }
.field input[type=text], .field textarea, .dream-own {
  width: 100%; background: rgba(12, 13, 15, .72); color: var(--text);
  border: 1px solid rgba(197, 150, 103, .24); border-radius: 14px; padding: 13px 14px; min-height: 52px;
  font: 650 18px/1.3 var(--sans); outline: none; -webkit-appearance: none; appearance: none;
}
.field textarea { font-weight: 500; font-size: 16px; resize: vertical; min-height: 96px; }
.field input::placeholder, .field textarea::placeholder, .dream-own::placeholder { color: #857a6f; font-weight: 500; font-size: 16px; }
.field input:focus, .field textarea:focus, .dream-own:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(227, 185, 111, .16); }
.field.bad input { border-color: var(--err); }
.money { position: relative; }
.money input[type=text] { padding-right: 64px; font-variant-numeric: tabular-nums; }
.unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--gold); font-weight: 700; font-size: 16px; pointer-events: none; }
.help { color: var(--mute); font-size: 14px; margin-top: 8px; }
.help.center { text-align: center; }
.err { color: var(--err); font-size: 14px; font-weight: 600; }
.err:not(:empty) { margin-top: 8px; }
.chip { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 12px 14px; border-radius: 14px;
  background: rgba(227, 185, 111, .08); border: 1px solid rgba(227, 185, 111, .22); }
.chip b { color: var(--gold-l); font-size: 22px; font-weight: 800; }
.chip span { color: var(--text2); font-size: 14px; }
.calm { margin-top: 10px; padding: 14px 16px; border-radius: 14px; background: rgba(245, 241, 234, .06); color: #e9e1d6; font-size: 16px; line-height: 1.45; }

/* Валюта */
.cur-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 2px; }
.cur-label { color: var(--text2); font-size: 15px; font-weight: 600; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(12, 13, 15, .72); border: 1px solid rgba(197, 150, 103, .22); }
.seg button { min-width: 48px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text2);
  font-size: 16px; font-weight: 700; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.seg button.on { background: linear-gradient(180deg, #f1d398, #d9a95a); color: #241a0b; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.rates { color: var(--mute); font-size: 13px; margin-top: 10px; line-height: 1.45; }
.rates.warn { color: #e8c58f; }

/* Карточки результата */
.result { margin-top: 10px; padding: 20px 18px; text-align: left; }
.r-title { color: var(--gold-l); font-size: 15px; font-weight: 650; }
.r-big { color: var(--gold-l); font-size: clamp(36px, 11vw, 44px); font-weight: 800; letter-spacing: -1px; line-height: 1.1; margin: 8px 0 6px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.r-big.long { font-size: clamp(28px, 8.6vw, 38px); }
.r-big.xlong { font-size: clamp(22px, 6.8vw, 30px); }
.r-sub { color: #fff; font-size: 14px; }
.r-mid { color: #fff; font-size: clamp(26px, 8vw, 32px); font-weight: 800; letter-spacing: -.6px; line-height: 1.15; margin-top: 16px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.r-mid.long { font-size: clamp(22px, 7vw, 28px); }
.r-mid.xlong { font-size: clamp(19px, 5.8vw, 24px); }
.r-cap { font-size: 14px; font-weight: 600; }
.gold { color: var(--gold-l); }
.r-cap.white { color: #fff; }
.revenue .r-big { margin-bottom: 2px; }
.fine { color: var(--mute); font-size: 13px; margin-top: 10px; line-height: 1.45; }

/* Клиенты */
.clients label { text-align: left; }
.counter { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 6px; }
.step-btn { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--gold-line); background: rgba(12, 13, 15, .6); color: var(--gold-l);
  font-size: 24px; font-weight: 600; line-height: 1; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.step-btn:disabled { opacity: .35; cursor: default; }
.count { display: flex; align-items: baseline; justify-content: center; color: #fff; }
.count .plus { font-size: 44px; font-weight: 800; color: #fff; }
.field .count input[type=text] { width: 2.6ch; min-height: 0; padding: 0 2px; border: 0; border-bottom: 2px dashed rgba(227, 185, 111, .35); border-radius: 0;
  background: transparent; color: #fff; font: 800 48px/1.1 var(--sans); text-align: center; font-variant-numeric: tabular-nums; box-shadow: none; }
.field .count input[type=text]:focus { border-bottom-color: var(--gold); box-shadow: none; }
.count-cap { text-align: center; color: var(--text2); font-size: 14px; margin-top: 2px; }
input[type=range] { width: 100%; margin: 18px 0 0; height: 32px; accent-color: var(--gold); cursor: pointer; touch-action: pan-y; background: transparent; }
.ticks { position: relative; height: 20px; margin: 2px 10px 0; color: var(--mute); font-size: 12px; }
.ticks span { position: absolute; transform: translateX(-50%); }

.bridge { margin-top: 18px; padding: 18px 16px; border-radius: 16px; border: 1px solid rgba(227, 185, 111, .22); background: rgba(227, 185, 111, .06); }
.bridge h3 { font-size: 18px; font-weight: 750; color: #fbf7f0; line-height: 1.3; }
.bridge p { color: var(--text2); font-size: 16px; margin-top: 8px; }

/* Желания */
.dreams { margin-top: 12px; }
.dream { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 4px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  border-bottom: 1px solid rgba(197, 150, 103, .10); font-size: 16px; color: #efe8de; }
.dream input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dream .box { flex: 0 0 24px; height: 24px; border-radius: 7px; border: 1.5px solid rgba(227, 185, 111, .5); background: rgba(12, 13, 15, .6); position: relative; }
.dream input:checked + .box { background: linear-gradient(180deg, #f1d398, #d9a95a); border-color: transparent; }
.dream input:checked + .box::after { content: ""; position: absolute; left: 8px; top: 4px; width: 6px; height: 11px; border: solid #241a0b; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.dream input:focus-visible + .box { box-shadow: 0 0 0 3px rgba(227, 185, 111, .35); }
.dream-own { margin-top: 14px; font-weight: 500; font-size: 16px; }

/* Переход к книге */
.intro { margin-top: 16px; padding: 24px 20px; }

/* Сетка четырёх страниц */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.tcard { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-height: 168px; padding: 14px 12px 14px 16px;
  border-radius: 6px 16px 16px 6px; border: 1px solid rgba(227, 185, 111, .38); text-align: left; cursor: pointer; color: var(--gold-l);
  background: radial-gradient(ellipse 90% 60% at 100% 0%, rgba(240, 170, 70, .16), transparent 70%), linear-gradient(160deg, #0d0d0f 0%, #17140f 100%);
  box-shadow: inset 4px 0 0 rgba(227, 185, 111, .28), 0 8px 20px rgba(0, 0, 0, .35); -webkit-tap-highlight-color: transparent; }
.tcard:active { transform: scale(.985); }
.tc-top { display: flex; width: 100%; justify-content: space-between; align-items: baseline; gap: 6px; }
.tc-brand { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #d6b98c; }
.tc-num { font-size: 26px; font-weight: 800; color: var(--gold-l); line-height: 1; }
.tc-ico { color: var(--gold); opacity: .85; margin-top: auto; }
.tc-title { font-size: 14px; font-weight: 700; color: #fbf7f0; line-height: 1.3; }
.tc-title:empty { display: none; }
.tc-act { font-size: 14px; font-weight: 700; color: var(--gold-l); }
.tcard.opened { border-color: rgba(227, 185, 111, .6); background: linear-gradient(160deg, #1d1912 0%, #2a2216 100%); }
.tcard.opened .tc-ico { display: none; }
.tcard.active { box-shadow: inset 4px 0 0 var(--gold), 0 0 0 2px rgba(227, 185, 111, .55), 0 8px 20px rgba(0, 0, 0, .35); }
.progress { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; color: var(--text2); font-size: 15px; font-weight: 600; }
.dots { display: flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(245, 241, 234, .16); }
.dots i.on { background: var(--gold); box-shadow: 0 0 8px rgba(227, 185, 111, .6); }

/* Открытая страница: светлая, как страница книги */
.page { margin-top: 16px; padding: 20px 18px 22px; border-radius: 18px; background: var(--cream); color: var(--ink); scroll-margin-top: calc(12px + var(--safe-top));
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45); outline: none; }
.pg-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pg-num { color: var(--dgold); font-size: 14px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.pg-close { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(154, 117, 52, .35); background: transparent; color: var(--ink2);
  font-size: 26px; line-height: 1; cursor: pointer; }
.pg-title { font-size: clamp(24px, 7vw, 28px); font-weight: 800; letter-spacing: -.5px; line-height: 1.2; color: var(--ink); margin: 6px 0 14px; }
.page h4 { font-size: 16px; font-weight: 800; color: var(--ink); margin-top: 16px; }
.page p { font-size: 17px; color: var(--ink2); margin-top: 6px; line-height: 1.5; }
.pg-ex { margin-top: 10px; padding-left: 12px; border-left: 3px solid rgba(154, 117, 52, .45); }
.pg-ex span { display: block; font-size: 13px; font-weight: 800; color: var(--dgold); text-transform: uppercase; letter-spacing: .5px; }
.pg-ex p { margin-top: 2px; color: var(--ink); }
.pg-do { margin-top: 18px; padding: 16px; border-radius: 14px; background: var(--beige); }
.pg-do h4 { margin-top: 0; }
.pg-phrase { font-weight: 700; color: var(--ink) !important; user-select: text; -webkit-user-select: text; }
.pg-demo { font-size: 13px !important; color: #8a7d6b !important; margin-top: 14px !important; }
.page .btn { margin-top: 20px; }
.page .btn.small { margin-top: 12px; min-height: 48px; font-size: 15px; }

/* Предложение книги */
.offer { margin-top: 16px; padding: 24px 20px 22px; }
.book { display: flex; gap: 16px; align-items: center; margin: 18px 0 14px; }
.book img { width: 42%; max-width: 170px; height: auto; border-radius: 6px; box-shadow: 0 14px 30px rgba(0, 0, 0, .6), 0 0 0 1px rgba(227, 185, 111, .25); }
.b-title { font-size: 24px; font-weight: 800; color: #fbf7f0; line-height: 1.15; }
.b-sub { color: var(--text2); font-size: 15px; margin-top: 4px; }
.b-author { color: var(--gold-l); font-size: 15px; font-weight: 700; margin-top: 10px; }
.big365 { color: var(--gold-l); font-size: clamp(32px, 10vw, 40px); font-weight: 800; letter-spacing: -.8px; margin-top: 6px; }
.offer .lead { margin-top: 4px; color: #fff; }
.desc { color: var(--text2); font-size: 16px; margin-top: 12px; }
.offer .btn { margin-top: 20px; }

/* Кнопки */
.btn { display: block; width: 100%; min-height: 54px; border: 0; border-radius: 16px; background: var(--btn); box-shadow: var(--btn-sh); color: var(--on-lime);
  font: 800 16px/1.2 var(--sans); cursor: pointer; -webkit-tap-highlight-color: transparent; padding: 0 16px; }
.btn:active { transform: scale(.99); filter: brightness(1.04); }
.toast { min-height: 20px; margin-top: 10px; text-align: center; color: var(--lime); font-size: 14px; font-weight: 600; }
.toast.dark-t { color: #4b6b0a; }
.toast.err { color: var(--err); }
.toast.dark-t.err { color: #a3392d; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (max-width: 360px) {
  .wrap { padding-left: 12px; padding-right: 12px; }
  .card { padding: 20px 14px; }
  .hero, .intro, .offer { padding-left: 16px; padding-right: 16px; }
  .tcard { min-height: 150px; padding: 12px 10px 12px 14px; }
  .tc-num { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
