@font-face {
  font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/onest-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/onest-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 {
  --bg: #f3f3ee;
  --card: #ffffff;
  --ink: #1b1c1a;
  --muted: #6e7068;
  --line: #e4e4dc;
  --lime: #dff46a;
  --lime-ink: #1b1c1a;
  --lime-soft: #f1f9c4;
  --danger: #d4473a;
  --radius: 28px;
  --font: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --safe-top: var(--tg-content-safe-area-inset-top, 0px);
  --safe-bottom: var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --motion-out: cubic-bezier(.2, .75, .25, 1);
  --motion-slide: cubic-bezier(.35, 0, .2, 1);
}
:root[data-theme="dark"] {
  --bg: #121311;
  --card: #1c1d1a;
  --ink: #f1f2ea;
  --muted: #92948b;
  --line: #2b2c28;
  --lime-soft: #2a3016;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
html { overflow-x: clip; }
body {
  font: 400 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; }
a { color: inherit; }

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(12px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
}
body.has-fallback-cta #app { padding-bottom: 150px; }

.boot { display: grid; place-items: center; min-height: 70vh; }

.view[data-enter] { animation: screen-in 170ms var(--motion-out); }
.view[data-enter="forward"] { --enter-x: 12px; }
.view[data-enter="back"] { --enter-x: -12px; }
@keyframes screen-in { from { transform: translateX(var(--enter-x)); } }

/* ---------- шапка ---------- */
.top { display: flex; align-items: center; gap: 10px; margin: 2px 2px 16px; }
.top .logo { width: 32px; height: 32px; border-radius: 50%; }
.top .brand { font-weight: 700; font-size: 17px; letter-spacing: -.015em; }
.top .pill { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
             padding: 6px 11px 6px 9px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); }
.top .pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.top .pill.on i { background: #7bc043; box-shadow: 0 0 0 3px rgba(123,192,67,.2); }

h1 { font-size: 32px; line-height: 1.08; letter-spacing: -.035em; margin: 8px 2px 10px; font-weight: 800; }
h2 { font-size: 19px; letter-spacing: -.02em; font-weight: 700; margin: 28px 4px 10px; }
.lead { color: var(--muted); margin: 0 2px 20px; font-size: 16px; max-width: 34em; }

/* ---------- статус ---------- */
.status {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: 34px; padding: 24px 24px 24px;
  background: var(--lime); color: var(--lime-ink);
  min-height: 212px;
}
.status.off { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.status .cat {
  position: absolute; right: -26px; bottom: -34px; width: 168px; z-index: -1;
  transform: rotate(-9deg); pointer-events: none;
}
.status.off .cat { opacity: .07; filter: grayscale(1); }
:root[data-theme="dark"] .status.off .cat { filter: invert(1); opacity: .05; }
.status .label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.on .dot { background: #1b1c1a; box-shadow: 0 0 0 4px rgba(27,28,26,.12); }
.status .big { font-size: 68px; font-weight: 800; letter-spacing: -.055em; line-height: .9; margin: 22px 0 8px;
               font-variant-numeric: tabular-nums; }
.status .big small { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin-left: 6px; }
.status .big.text { font-size: 34px; letter-spacing: -.035em; line-height: 1.02; }
.status .sub { font-size: 15px; opacity: .72; max-width: 62%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; max-width: 64%; }
.chip { font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 99px; background: rgba(27,28,26,.09); }
.status.off .chip { background: var(--bg); }

/* ---------- плитки быстрых действий ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: 22px; text-align: left;
  min-height: 118px; padding: 18px; border-radius: 30px; border: 1px solid var(--line);
  background: var(--card); cursor: pointer;
}
.tile .ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); }
.tile .ic svg { width: 20px; height: 20px; }
.tile b { display: block; font-size: 16px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.tile span.s { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.tile.ink { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tile.ink .ic { background: var(--lime); color: var(--lime-ink); }
.tile.ink span.s { color: color-mix(in srgb, var(--bg) 62%, transparent); }

/* ---------- преимущества ---------- */
.perks { display: grid; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 30px; padding: 6px; }
.perk { display: flex; gap: 14px; align-items: center; padding: 12px; }
.perk .ic { width: 40px; height: 40px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; flex: none; }
.perk .ic svg { width: 20px; height: 20px; }
.perk b { display: block; font-weight: 650; font-size: 15px; }
.perk span { color: var(--muted); font-size: 13px; }

/* ---------- список ---------- */
.list { background: var(--card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.row {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 14px 16px; border: 0; background: none; text-align: left; cursor: pointer;
  text-decoration: none; position: relative;
}
.row + .row::before { content: ""; position: absolute; top: 0; left: 62px; right: 0; height: 1px; background: var(--line); }
.row:active { background: var(--bg); }
.row .ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); flex: none; }
.row .ic svg { width: 18px; height: 18px; }
.row .ic.lime { background: var(--lime); color: var(--lime-ink); }
.row .t { flex: 1; min-width: 0; }
.row .t b { display: block; font-weight: 600; font-size: 16px; }
.row .t span { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .v { color: var(--muted); font-size: 15px; }
.row .chev { width: 16px; height: 16px; color: var(--muted); flex: none; }
.row.danger .t b { color: var(--danger); }

/* ---------- кнопки ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 16px 22px; border-radius: 999px; border: 0; cursor: pointer;
  font-weight: 600; font-size: 16px; text-decoration: none;
}
.btn svg { width: 18px; height: 18px; }
.btn-main { background: var(--ink); color: var(--bg); }
.btn-lime { background: var(--lime); color: var(--lime-ink); }
.btn-ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: transparent; color: var(--danger); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-row { display: grid; gap: 8px; margin-top: 12px; }
.btn-row.two { grid-template-columns: 1fr 1fr; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px;
            cursor: pointer; padding: 10px 0; font-size: 14px; width: 100%; }

.cta-fallback {
  position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + var(--safe-bottom));
  background: linear-gradient(transparent, var(--bg) 30%); display: grid; gap: 8px; max-width: 560px; margin: 0 auto;
}

/* ---------- платформы ---------- */
.seg { position: relative; display: flex; gap: 4px; padding: 4px; background: var(--card); border: 1px solid var(--line);
       border-radius: 999px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1 1 auto; min-width: 0; border: 0; background: none; padding: 9px 4px; border-radius: 999px; font-weight: 600;
              font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button { position: relative; z-index: 1; transition: color 150ms var(--motion-slide); }
.seg button.on { color: var(--bg); }
.seg-ind { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 999px; background: var(--ink);
           pointer-events: none; }
.seg-ind.sliding { transition: transform 170ms var(--motion-slide), width 170ms var(--motion-slide); }

.steps { margin-top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 30px; padding: 6px 20px; }
.step { position: relative; padding: 18px 0 18px 46px; }
.step + .step { border-top: 1px solid var(--line); }
.step::before { /* линия таймлайна */
  content: ""; position: absolute; left: 15px; top: 52px; bottom: -18px; width: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.num { position: absolute; left: 0; top: 16px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
       font-weight: 700; font-size: 14px; background: var(--lime); color: var(--lime-ink); }
.step-h b { font-size: 18px; letter-spacing: -.02em; font-weight: 700; display: block; padding-top: 4px; }
.step p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.step .btn-row { margin-top: 14px; }
.alt { margin-top: 10px; text-align: center; }

/* ---------- тарифы ---------- */
.plans { display: grid; gap: 8px; }
.plan {
  display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: center;
  background: var(--card); color: var(--ink); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 16px; cursor: pointer; text-align: left; width: 100%;
}
.plan .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); }
.plan.on { border-color: var(--ink); }
.plan.on .radio { border-color: var(--ink); box-shadow: inset 0 0 0 5px var(--ink); }
.plan b { font-size: 17px; font-weight: 700; display: block; }
.plan > span { font-size: 13px; }
.plan > span > span { color: var(--muted); }
.plan .price { text-align: right; }
.plan .price b { font-size: 18px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
         background: var(--lime); color: var(--lime-ink); border-radius: 999px; padding: 2px 8px; margin-left: 6px; vertical-align: 2px; }
.note { color: var(--muted); font-size: 13px; margin: 12px 4px 0; }
.incl { display: grid; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 10px; }
.incl div { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.incl svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }

/* ---------- прогресс ---------- */
.meter { height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; margin: 12px 0 6px; }
.meter i { display: block; height: 100%; background: var(--lime); border-radius: 99px; }
.meter-legend { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel .big { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }

/* ---------- устройства ---------- */
.dev .ic { background: var(--bg); }
.dev .del { display: none; }
.dev .del svg { width: 18px; height: 18px; }
.empty { text-align: center; padding: 26px 16px; color: var(--muted); }
.empty img { width: 64px; opacity: .9; margin-bottom: 8px; }

/* ---------- ссылка ---------- */
.qr { display: grid; place-items: center; background: #fff; border-radius: var(--radius); padding: 22px; margin-bottom: 10px; }
.qr svg, .qr img { width: 220px; height: 220px; }
.mono { font: 500 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; color: var(--muted);
        background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 12px 18px; text-align: center; }

/* ---------- FAQ ---------- */
details { background: var(--card); border: 1px solid var(--line); border-radius: 24px; margin-bottom: 8px; }
summary { list-style: none; cursor: pointer; padding: 16px 20px; font-weight: 600; display: flex; justify-content: space-between; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary svg { width: 16px; height: 16px; color: var(--muted); transition: transform 180ms var(--motion-out); flex: none; margin-top: 3px; }
details[open] summary svg { transform: rotate(90deg); }
details.closing summary svg { transform: none; }
details p { margin: 0; padding: 0 20px 18px; color: var(--muted); font-size: 15px; }

/* ---------- результат ---------- */
.result { text-align: center; padding: 40px 8px 10px; }
.result .mark { width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 18px; background: var(--lime); color: var(--lime-ink); }
.result .mark svg { width: 38px; height: 38px; }
.result .confirm-mark path { stroke-dasharray: 16; animation: confirm-stroke 190ms var(--motion-out); }
@keyframes confirm-stroke { from { stroke-dashoffset: 16; } }
.result h1 { margin-bottom: 8px; }
.result p { color: var(--muted); margin: 0 0 22px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); transform: translate(-50%, 6px);
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 500;
  clip-path: inset(100% 0 0 round 999px); pointer-events: none; max-width: calc(100% - 32px); z-index: 10;
  transition: clip-path 140ms var(--motion-out), transform 140ms var(--motion-out);
}
.toast.on { clip-path: inset(0 round 999px); transform: translate(-50%, 0); }
body.has-fallback-cta .toast { bottom: 150px; }

/* ---------- тестовый режим и шаги на главной ---------- */
.testbar { margin: 0 0 12px; padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
           background: var(--lime-soft); color: var(--ink); text-align: center; }
.perk .num-ic { font-weight: 800; font-size: 16px; }

/* максимальные скругления */
.row:first-child { border-top-left-radius: inherit; border-top-right-radius: inherit; }
.row:last-child { border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; }
.row + .row::before { left: 66px; }
.plan { border-radius: 26px; }
.panel { border-radius: 30px; }
.meter { height: 12px; }
.qr { border-radius: 34px; }

/* ---------- отклик на нажатие ---------- */
.tile, .btn, .plan { transition: transform 140ms var(--motion-out); }
.tile:active, .btn:active, .plan:active { transform: scale(.985); transition-duration: 80ms; }
.status .big small { display: inline-block; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .tile:active, .btn:active, .plan:active { transform: none; }
}

/* ---------- глубина ---------- */
:root {
  --sh-1: 0 1px 2px rgba(27,28,26,.04), 0 4px 10px -4px rgba(27,28,26,.09);
  --sh-2: 0 2px 4px rgba(27,28,26,.05), 0 9px 18px -7px rgba(27,28,26,.15);
  --rim: inset 0 1px 0 rgba(255,255,255,.45);
  --light: rgba(255,255,255,.45);
}
:root[data-theme="dark"] {
  --sh-1: 0 1px 2px rgba(0,0,0,.25), 0 4px 10px -4px rgba(0,0,0,.35);
  --sh-2: 0 2px 4px rgba(0,0,0,.3), 0 9px 18px -7px rgba(0,0,0,.45);
  --rim: inset 0 1px 0 rgba(255,255,255,.04);
  --light: rgba(255,255,255,.025);
}
body { background: radial-gradient(900px 520px at -10% -10%, var(--light), transparent 65%) var(--bg) no-repeat; }

.list, .perks, .steps, .panel, details, .seg, .incl, .plan, .top .pill, .mono, .tile, .btn-ghost {
  box-shadow: var(--sh-1), var(--rim);
}
.plan.on { box-shadow: var(--sh-2), var(--rim); }
.tile.ink, .qr, .toast { box-shadow: var(--sh-2); }
.top .logo, .btn-main, .btn-lime, .seg-ind, .result .mark { box-shadow: var(--sh-1); }
.tile:active, .plan:active, .btn:active { box-shadow: 0 1px 2px rgba(0,0,0,.12); }

.status { box-shadow: var(--sh-2), inset 0 1px 0 rgba(255,255,255,.25);
          background: radial-gradient(520px 320px at 12% 0%, rgba(255,255,255,.22), transparent 70%), var(--lime); }
.status::before, .status::after { content: ""; position: absolute; border-radius: 50%; z-index: -2; pointer-events: none; }
.status::before { width: 300px; height: 300px; right: -90px; bottom: -120px; background: rgba(27,28,26,.06); }
.status::after { width: 210px; height: 210px; right: -45px; bottom: -80px; background: rgba(27,28,26,.05); }
.status .cat { filter: drop-shadow(4px 7px 8px rgba(27,28,26,.16)); }
.status.off { background: radial-gradient(520px 320px at 12% 0%, var(--light), transparent 70%), var(--card);
              box-shadow: var(--sh-2), var(--rim); }
.status.off::before, .status.off::after { background: rgba(127,127,120,.07); }
