/* SenkaPopka VPN cabinet.
   Same language as the landing: a light sunlit page, crystal photography inside
   rounded panels, ink pill buttons, frosted panels and hand-drawn notes.
   The frosted surfaces are a web approximation of liquid glass (backdrop-filter
   plus layered borders), not an official Apple material.
   Shape rule: interactive elements are pills, containers are 28px / 20px. */

@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(../fonts/onest-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 300 700;
  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: 300 700;
  font-display: swap;
  src: url(../fonts/onest-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 300 700;
  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;
}
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/caveat-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/caveat-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/caveat-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/caveat-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: #f1f1ee;
  --panel: #e6e7e9;
  --ink: #0b0d12;
  --text: #12151b;
  --muted: #5d6573;
  --hair: rgba(11, 13, 18, .1);
  --edge: rgba(11, 13, 18, .07);
  --accent: #3170dd;
  --ok: #1d7a4b;
  --ok-bg: rgba(29, 122, 75, .1);
  --bad: #b3261e;
  --bad-bg: rgba(179, 38, 30, .08);
  --radius: 28px;
  --radius-inner: 20px;
  --w: 640px;
  --nav-h: 56px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --safe-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}
body.wide { --w: 1120px; }
body.narrow { --w: 480px; }

img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
h1, h2, h3, p, figure, fieldset { margin: 0; }
fieldset { padding: 0; border: 0; min-width: 0; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* Headings focused by script (payment outcome) are announced, not outlined */
[tabindex="-1"]:focus { outline: none; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
.ic { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; vertical-align: -.28em; }
.row-ext { width: 20px; height: 20px; color: var(--muted); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .9375rem; }
.center { text-align: center; }
.mt { margin-top: 12px; }
.mt-lg { margin-top: 24px; }
.mt-xl { margin-top: 40px; }

html.tg .hide-in-webapp { display: none !important; }
html:not(.tg) .only-webapp { display: none !important; }

.skip {
  position: absolute;
  left: 16px; top: -64px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  transition: top .2s;
}
.skip:focus { top: 16px; }

/* Glass surface */

.glass {
  background: linear-gradient(135deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .45));
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .85);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .95),
    0 0 0 1px var(--edge),
    0 16px 40px -22px rgba(11, 13, 18, .25);
}
@media (prefers-reduced-transparency: reduce) {
  .glass { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Navigation: one floating pill, like the landing */

.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: calc(12px + var(--safe-top)) 0 12px;
  pointer-events: none;
}
.nav {
  pointer-events: auto;
  width: min(100% - 24px, var(--w));
  margin-inline: auto;
  height: var(--nav-h);
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 10px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 500;
  letter-spacing: -.01em;
  text-decoration: none;
  padding-right: 8px;
}
.brand img { width: 30px; height: 30px; border-radius: 50%; flex: none; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 15px;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s, background-color .2s;
}
.nav-link:hover { color: var(--text); background: rgba(11, 13, 18, .05); }
.nav-link.is-active { color: var(--text); }
.nav-link svg { width: 20px; height: 20px; fill: currentColor; }
@media (max-width: 599px) {
  .brand { font-size: 15px; }
  .nav-link { padding: 0 10px; }
  .nav-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* Page */

.page {
  flex: 1;
  width: min(100% - 24px, var(--w));
  margin-inline: auto;
  padding: 12px 0 40px;
}
@media (min-width: 640px) { .page { padding-top: 24px; } }

.head { display: grid; gap: 10px; margin: 8px 0 24px; }
.head-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.head-row h1 { flex: 1 1 0; min-width: 0; }
h1, .h1 {
  font-size: clamp(2rem, 7vw, 2.75rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.lead { color: var(--muted); font-size: 1.0625rem; max-width: 56ch; text-wrap: pretty; }
h2, .h2 {
  font-size: clamp(1.4rem, 4.5vw, 1.75rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.03em;
}
h3, .h3 { font-size: 1.125rem; font-weight: 500; letter-spacing: -.02em; }
.sec { margin: 40px 0 8px; }
.page > :first-child .sec, .page > :first-child.sec { margin-top: 0; }

/* Entry choreography: top-level blocks rise in sequence, below-fold blocks
   wait for the scroll (script adds .is-in). */
@media (prefers-reduced-motion: no-preference) {
  .page > :not(.reveal):nth-child(-n + 7) {
    animation: fade-up .8s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 80ms);
  }
  .page > :nth-child(2) { --i: 1; }
  .page > :nth-child(3) { --i: 2; }
  .page > :nth-child(4) { --i: 3; }
  .page > :nth-child(5) { --i: 4; }
  .page > :nth-child(6) { --i: 5; }
  .page > :nth-child(7) { --i: 6; }
  .stagger > * {
    animation: rise .9s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 70ms + 120ms);
  }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: none; }
}
.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .8s ease, transform .9s var(--ease);
}
.js .reveal[data-delay="1"] { transition-delay: .12s; }
.js .reveal.is-in { opacity: 1; transform: none; }

/* Cross-document page transitions (Chrome 126+, Safari 18.2+); older engines just navigate. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation-duration: .16s; }
::view-transition-new(root) { animation-duration: .3s; }

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s var(--ease), background-color .2s, box-shadow .2s, color .2s;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.btn-ink {
  background: var(--ink);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 10px 24px -14px rgba(11, 13, 18, .6);
}
.btn-ink:hover { background: #1a1e27; }
.btn-glass {
  background: linear-gradient(135deg, rgba(255, 255, 255, .88), rgba(255, 255, 255, .6));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 0 0 1px var(--edge), 0 10px 24px -18px rgba(11, 13, 18, .35);
}
.btn-glass:hover { background: #fff; }
.btn-line { box-shadow: inset 0 0 0 1px var(--hair); }
.btn-line:hover { background: rgba(11, 13, 18, .05); }
.btn-bad { color: var(--bad); box-shadow: inset 0 0 0 1px rgba(179, 38, 30, .28); }
.btn-bad:hover { background: var(--bad-bg); }
.btn-sm { height: 40px; padding: 0 18px; font-size: 15px; }
.btn-block { display: flex; width: 100%; }
.btn.is-busy, .btn[disabled] { pointer-events: none; opacity: .65; }
.btn-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(11, 13, 18, .05);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .2s, transform .15s var(--ease);
}
.btn-icon:hover { background: rgba(11, 13, 18, .1); }
.btn-icon:active { transform: scale(.94); }
.btn-icon svg { width: 20px; height: 20px; fill: currentColor; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
/* Side by side only while both labels fit: buttons are nowrap and cannot shrink, so a fixed two-column grid pushed
   the second one out of its panel at 380-411px. Basis 0 makes the wrap decision depend on the labels alone */
.actions-2 { display: flex; flex-wrap: wrap; gap: 10px; }
.actions-2 > * { flex: 1 1 0; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  text-underline-offset: 4px;
}
.link-arrow .arrow { color: var(--muted); transition: transform .3s var(--ease); }
.link-arrow:hover { text-decoration: underline; }
.link-arrow:hover .arrow { transform: translateX(4px); }
.arrow {
  width: 22px;
  height: 12px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* Panels */

.panel {
  border-radius: var(--radius);
  padding: clamp(20px, 5vw, 28px);
}
.panel-sm { border-radius: var(--radius-inner); padding: 16px 18px; }
.tile {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--radius);
  padding: clamp(20px, 5vw, 32px);
  background: var(--panel);
  box-shadow: 0 0 0 1px var(--edge), 0 30px 70px -40px rgba(11, 13, 18, .35);
}
.tile-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Tags and chips */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  background: rgba(11, 13, 18, .06);
  color: var(--text);
}
.tag svg { width: 14px; height: 14px; fill: currentColor; }
.tag-ok { background: var(--ok-bg); color: var(--ok); }
.tag-bad { background: var(--bad-bg); color: var(--bad); }
.tag-ink { background: var(--ink); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 20px 0 6px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: transform .3s var(--ease), background-color .2s, color .2s;
}
.chip:hover { transform: translateY(-2px); }
.chip .code {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--panel) url(../img/crystals.webp) no-repeat;
  background-size: 1000% auto;
  background-position: calc(5% + var(--i, 0) * 15%) 62%;
  box-shadow: inset 0 0 0 1px var(--edge);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .7);
}
.chip .code svg { width: 20px; height: 20px; fill: currentColor; }

/* Lists: hairline rows, no card soup */

.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 12px 0;
  color: inherit;
  text-decoration: none;
}
.rows > * + * { border-top: 1px solid var(--hair); }
.row-ic {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(11, 13, 18, .05);
  box-shadow: inset 0 0 0 1px var(--edge);
  flex: none;
  color: var(--text);
}
.row-ic svg { width: 22px; height: 22px; fill: currentColor; }
.row-body { flex: 1; min-width: 0; }
.row-t { display: block; font-weight: 500; letter-spacing: -.01em; overflow-wrap: anywhere; }
.row-s { display: block; color: var(--muted); font-size: .9375rem; margin-top: 2px; overflow-wrap: anywhere; }
.row-end { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.row .arrow { color: var(--muted); }
a.row:hover .row-t { text-decoration: underline; text-underline-offset: 4px; }
a.row:hover .arrow { transform: translateX(4px); }
a.row .arrow { transition: transform .3s var(--ease); }

/* Subscription cards: a crystal arch per card, offset through one photo.
   Phones stack status under the text; from 480px the status gets its own column. */

.subs { display: grid; gap: 12px; list-style: none; margin: 0; padding: 0; }
.sub {
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px 16px;
  align-items: center;
  padding: 12px 18px 12px 12px;
  border-radius: var(--radius-inner);
  transition: transform .3s var(--ease), box-shadow .3s;
}
.sub:hover { transform: translateY(-2px); }
.sub .arch { grid-row: 1 / span 2; height: 84px; }
.sub-t { font-size: 1.125rem; font-weight: 500; letter-spacing: -.02em; line-height: 1.25; }
.sub-t a { text-decoration: none; }
.sub-t a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.sub-s { color: var(--muted); font-size: .9375rem; margin-top: 2px; }
.sub-end { position: relative; z-index: 1; grid-column: 2; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sub-end .arrow { margin-left: auto; color: var(--muted); }
@media (min-width: 480px) {
  .sub { grid-template-columns: 64px 1fr auto; }
  .sub .arch { grid-row: auto; }
  .sub-end { grid-column: auto; flex-direction: column; align-items: flex-end; }
  .sub-end .arrow { margin-left: 0; }
}

.arch {
  position: relative;
  overflow: hidden;
  border-radius: 999px 999px 0 0;
  background: var(--panel) url(../img/crystals.webp) no-repeat;
  background-size: 700% auto;
  background-position: calc(var(--i, 0) * 16%) 70%;
  isolation: isolate;
}
.arch::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--edge), inset 0 1px 0 rgba(255, 255, 255, .6);
  pointer-events: none;
}

/* Arched windows onto one photo (login hero) */
.arches {
  --n: 4;
  --gap: 8px;
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  gap: var(--gap);
  height: clamp(150px, 38vw, 240px);
}
.arches .arch { background: var(--panel); }
.arches .arch img {
  position: absolute;
  top: 50%;
  left: calc(-1 * var(--i) * (100% + var(--gap)));
  width: calc(var(--n) * 100% + (var(--n) - 1) * var(--gap));
  max-width: none;
  height: auto;
  transform: translateY(-56%);
}
@media (min-width: 640px) {
  .arches { --n: 5; --gap: 12px; }
  .arches .arch:nth-child(n + 6) { display: none; }
}
@media (max-width: 639px) {
  .arches .arch:nth-child(n + 5) { display: none; }
}

/* Forms */

.field { display: grid; gap: 8px; margin-bottom: 16px; }
.field > label { font-size: .9375rem; font-weight: 500; }
.input {
  width: 100%;
  height: 52px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: rgba(255, 255, 255, .75);
  color: var(--text);
  font-size: 16px; /* 16px: iOS does not zoom the page on focus */
  appearance: none;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.input:hover { border-color: rgba(11, 13, 18, .2); }
.input:focus { outline: none; border-color: var(--ink); background: #fff; box-shadow: 0 0 0 4px rgba(11, 13, 18, .08); }
.input::placeholder { color: var(--muted); }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 56px; }
.input-wrap .btn-icon { position: absolute; right: 6px; top: 6px; background: transparent; }
.hint { font-size: .9375rem; color: var(--muted); }
.err { font-size: .9375rem; color: var(--bad); }
.form-grid { display: grid; gap: 0 16px; }
@media (min-width: 560px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .span-2 { grid-column: 1 / -1; }
}

/* Segmented control with a sliding ink thumb */

.seg {
  --n: 3;
  --sel: 0;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(11, 13, 18, .06);
  box-shadow: inset 0 0 0 1px rgba(11, 13, 18, .05);
}
.seg::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px - (var(--n) - 1) * 4px) / var(--n));
  border-radius: 999px;
  background: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
  transform: translateX(calc(var(--sel) * (100% + 4px)));
  transition: transform .45s var(--ease);
}
.seg input {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  opacity: 0;
}
.seg label {
  display: grid;
  place-items: center;
  height: 44px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: color .25s;
}
.seg label:hover { color: var(--text); }
.seg input:checked + label { color: #fff; }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg:has(input:nth-of-type(1):checked) { --sel: 0; }
.seg:has(input:nth-of-type(2):checked) { --sel: 1; }
.seg:has(input:nth-of-type(3):checked) { --sel: 2; }
.seg:has(input:nth-of-type(4):checked) { --sel: 3; }
.seg:has(input:nth-of-type(5):checked) { --sel: 4; }

.price-main {
  font-size: clamp(2.75rem, 11vw, 3.75rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}
.price-sub { font-size: 1.0625rem; margin-top: 8px; }
.price-note { font-size: .9375rem; color: var(--muted); margin-top: 2px; }
.price-set[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .price-set { animation: price-in .4s var(--ease) both; }
}
@keyframes price-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* Option pills (payment method) */

.opts { display: grid; gap: 10px; }
.opt { position: relative; display: block; cursor: pointer; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.opt-box {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 10px 18px 10px 10px;
  border-radius: 999px;
  transition: transform .3s var(--ease), background-color .2s, box-shadow .2s;
}
.opt-box .code { flex: none; }
.opt-main { flex: 1; min-width: 0; }
.opt-t { display: block; font-weight: 500; letter-spacing: -.01em; }
.opt-s { display: block; color: var(--muted); font-size: .9375rem; }
.opt-check { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(11, 13, 18, .2); display: grid; place-items: center; flex: none; transition: background-color .2s, box-shadow .2s; }
.opt-check svg { width: 14px; height: 14px; fill: #fff; opacity: 0; transform: scale(.6); transition: opacity .2s, transform .3s var(--ease); }
.opt:hover .opt-box { transform: translateY(-2px); }
.opt input:checked + .opt-box { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 0 0 1.5px var(--ink), 0 16px 40px -22px rgba(11, 13, 18, .25); }
.opt input:checked + .opt-box .opt-check { background: var(--ink); box-shadow: none; }
.opt input:checked + .opt-box .opt-check svg { opacity: 1; transform: none; }
.opt input:focus-visible + .opt-box { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Sticky total bar */

.buy-bar {
  position: sticky;
  bottom: calc(12px + var(--safe-bottom));
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding: 6px 6px 6px 22px;
  border-radius: 999px;
}
.buy-total { flex: 1; min-width: 0; line-height: 1.15; }
.buy-total small { display: block; font-size: .8125rem; color: var(--muted); }
.buy-total b { font-size: 1.25rem; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.buy-bar .btn { height: 48px; padding: 0 20px; }

/* Notices */

.flashes { display: grid; gap: 10px; margin-bottom: 20px; }
.flash {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-inner);
  font-size: .9375rem;
  line-height: 1.45;
}
.flash svg { width: 20px; height: 20px; fill: currentColor; flex: none; margin-top: 1px; }
.flash-error { background: var(--bad-bg); color: var(--bad); }
.flash-success { background: var(--ok-bg); color: var(--ok); }
.flash-info { background: rgba(11, 13, 18, .06); color: var(--text); }

/* Waiting */

.wait { display: inline-flex; align-items: center; gap: 12px; color: var(--muted); }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .3; }
@media (prefers-reduced-motion: no-preference) {
  .dots i { animation: blink 1.2s ease-in-out infinite; }
  .dots i:nth-child(2) { animation-delay: .2s; }
  .dots i:nth-child(3) { animation-delay: .4s; }
}
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.shimmer {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(11, 13, 18, .06) 0 35%, rgba(11, 13, 18, .2) 50%, rgba(11, 13, 18, .06) 65% 100%);
  background-size: 250% 100%;
}
@media (prefers-reduced-motion: no-preference) {
  .shimmer { animation: shimmer 1.8s linear infinite; }
}
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -130% 0; } }

/* Mascot and empty states */

/* minmax(0, 1fr): a long nowrap link inside (the new-subscription copy box) must not widen the track past the panel */
.empty { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 10px; padding: 24px 0 8px; text-align: center; }
.empty .lead { max-width: 34ch; }
.empty .btn, .empty .actions { margin-top: 10px; }
/* Paired buttons take their spacing from the pair (a .mt on it), not from each button: stacked, the margin doubled the gap */
.empty .actions-2 .btn { margin-top: 0; }
.mascot-wrap { position: relative; display: inline-block; }
.mascot {
  width: clamp(120px, 34vw, 160px);
  transform: rotate(-6deg);
  filter: drop-shadow(0 16px 24px rgba(11, 13, 18, .16));
}
@media (prefers-reduced-motion: no-preference) {
  .mascot { animation: pop .9s var(--ease) both; animation-delay: .15s; }
}
@keyframes pop {
  from { opacity: 0; transform: rotate(-14deg) scale(.7) translateY(12px); }
  to { opacity: 1; transform: rotate(-6deg); }
}

/* Copy box and QR */

.copybox {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 52px;
  padding: 0 6px 0 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .75);
  box-shadow: inset 0 0 0 1px var(--hair);
}
.copybox code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  color: var(--text);
}
.copybox .btn-icon { background: transparent; }
.qr {
  display: inline-block;
  padding: 12px;
  background: #fff;
  border-radius: var(--radius-inner);
  box-shadow: 0 0 0 1px var(--edge);
}
.qr img { border-radius: 8px; }
details.more > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  font-weight: 500;
  text-underline-offset: 4px;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary:hover { text-decoration: underline; }
details.more > summary svg { width: 18px; height: 18px; fill: currentColor; transition: transform .3s var(--ease); }
details.more[open] > summary svg { transform: rotate(90deg); }

/* Facts */

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px 24px; }
.fact-l { display: block; font-size: .9375rem; color: var(--muted); }
.fact-v { display: block; font-size: 1.5rem; font-weight: 500; letter-spacing: -.03em; line-height: 1.1; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* Steps (instructions) */

.steps { list-style: none; margin: 0; padding: 0; }
.steps li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 16px;
  padding: 20px 0;
}
.steps li + li { border-top: 1px solid var(--hair); }
.step-n { padding-top: 3px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.steps h3 { margin-bottom: 4px; }
.steps p { color: var(--muted); }

/* Stats (admin) */

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stats .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 600px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stats .stat:last-child:nth-child(odd) { grid-column: auto; }
}
.stat { padding: 20px 22px; border-radius: var(--radius-inner); }
.stat-v { font-size: clamp(2rem, 7vw, 2.75rem); font-weight: 500; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-l { display: block; margin-top: 8px; font-size: .9375rem; color: var(--muted); }

/* Records: key/value on phones, columns on wide screens (admin) */

.recs { display: grid; gap: 10px; }
.rec { display: grid; gap: 6px 16px; padding: 16px 18px; border-radius: var(--radius-inner); }
.rec > div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; min-width: 0; }
.rec-k { font-size: .875rem; color: var(--muted); flex: none; }
.rec-v { text-align: right; min-width: 0; overflow-wrap: anywhere; }
.rec-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding-top: 6px; }
.rec-actions:empty { display: none; }
.rec-head { display: none; }
@media (min-width: 900px) {
  .recs { gap: 0; }
  .rec, .rec-head { display: grid; grid-template-columns: var(--rec-cols); gap: 16px; align-items: center; }
  .rec { border-radius: 0; padding: 14px 18px; background: transparent !important; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .rec + .rec { border-top: 1px solid var(--hair); }
  .rec-head { padding: 0 18px 10px; font-size: .875rem; color: var(--muted); border-bottom: 1px solid var(--hair); }
  .rec > div { display: block; }
  .rec-k { display: none; }
  .rec-v { text-align: left; }
  .rec-actions { display: grid; grid-template-columns: auto auto; justify-content: start; padding: 0; }
}

/* Bottom sheet dialog */

.sheet {
  width: 100%;
  max-width: none;
  max-height: calc(100dvh - 40px);
  margin: auto 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.sheet-in {
  background: linear-gradient(135deg, #fff, #f7f7f5);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 0 0 1px var(--edge), 0 -20px 60px -30px rgba(11, 13, 18, .4);
  padding: 10px 20px calc(24px + var(--safe-bottom));
  max-height: calc(100dvh - 40px);
  overflow: auto;
}
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: rgba(11, 13, 18, .15); margin: 0 auto 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.sheet::backdrop { background: rgba(11, 13, 18, .35); }
@media (min-width: 640px) {
  .sheet { width: min(100% - 32px, 440px); margin: auto; }
  .sheet-in { border-radius: var(--radius); padding: 14px 24px 24px; }
  .sheet-grip { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .sheet[open] { animation: sheet-in .55s var(--ease) both; }
  .sheet[open]::backdrop { animation: fade .3s ease both; }
}
@keyframes sheet-in {
  from { opacity: 0; transform: translateY(48px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Footer */

.foot {
  width: min(100% - 24px, var(--w));
  margin: auto auto 0;
  padding: 24px 0 calc(24px + var(--safe-bottom));
  border-top: 1px solid var(--hair);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 14px;
  color: var(--muted);
}
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 16px; }
.foot a { text-decoration: none; text-underline-offset: 4px; }
.foot a:hover { color: var(--text); text-decoration: underline; }

/* Hand-drawn doodles: pen strokes that draw themselves. pathLength="1" on every
   path lets one dash value stand for the whole stroke regardless of length. */

.doodle {
  display: block;
  overflow: visible;
  color: var(--text);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.doodle path { stroke-dasharray: 1 1.1; stroke-dashoffset: 0; }
.note {
  font-family: 'Caveat', cursive;
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1;
  color: var(--text);
  white-space: nowrap;
  pointer-events: none;
}

.mark { position: relative; display: inline-block; }
.doodle-loop {
  position: absolute;
  left: -8%;
  top: -18%;
  width: 116%;
  height: 136%;
  stroke-width: 2;
}
.price-main .mark { margin-left: .12em; }
.price-main .doodle-loop { left: -10%; width: 120%; top: -14%; height: 128%; }
.doodle-underline {
  position: absolute;
  left: -2%;
  bottom: -8px;
  width: 104%;
  height: 14px;
}
.doodle-sparkles { position: absolute; width: 70px; height: 70px; }
.mascot-wrap .doodle-sparkles { top: -10px; left: -40px; }
.aside-note { position: absolute; display: flex; align-items: flex-end; gap: 4px; }
.aside-note .doodle { width: 44px; height: 40px; }
.aside-note .note { transform: rotate(-6deg); }
/* The note hangs off the right side of a centered button: below 340px it would cross the screen edge */
@media (max-width: 339px) { .empty .aside-note { display: none; } }
.note-best {
  position: absolute;
  right: 28px;
  bottom: calc(100% - 4px);
  display: flex;
  align-items: flex-start;
  gap: 4px;
}
.note-best .doodle { width: 30px; height: 38px; }
.note-best .note { font-size: 1.35rem; margin-top: -4px; transform: rotate(-4deg); }

/* Doodles inside .draw-in (above the fold) draw on load, after the copy fades in */
@media (prefers-reduced-motion: no-preference) {
  .draw-in .doodle path {
    stroke-dashoffset: 1;
    animation: draw .9s cubic-bezier(.4, 0, .2, 1) calc(.8s + var(--d, 0s)) both;
  }
  .draw-in .doodle path:nth-child(2) { animation-delay: calc(1.1s + var(--d, 0s)); }
  .draw-in .doodle path:nth-child(3) { animation-delay: calc(1.35s + var(--d, 0s)); }
  .draw-in .doodle path.head { animation-duration: .3s; animation-delay: calc(1.6s + var(--d, 0s)); }
  .draw-in .note { animation: fade-up .6s var(--ease) calc(1.2s + var(--d, 0s)) both; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Doodles inside .reveal draw when the block scrolls in */
.js .reveal .doodle path {
  stroke-dashoffset: 1;
  transition: stroke-dashoffset .8s cubic-bezier(.4, 0, .2, 1) .55s;
}
.js .reveal .doodle path:nth-child(2) { transition-delay: .85s; }
.js .reveal .doodle path:nth-child(3) { transition-delay: 1.1s; }
.js .reveal .doodle path.head { transition-duration: .3s; transition-delay: 1.3s; }
.js .reveal .note { opacity: 0; transition: opacity .5s ease .9s; }
.js .reveal.is-in .doodle path { stroke-dashoffset: 0; }
.js .reveal.is-in .note { opacity: 1; }

/* Layout helpers for wide pages */

.grid-2 { display: grid; gap: 16px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .doodle path { stroke-dashoffset: 0 !important; transition: none !important; animation: none !important; }
  .note { opacity: 1 !important; animation: none !important; }
  .seg::before, .btn, .chip, .sub, .opt-box, .link-arrow .arrow, .row .arrow { transition: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
