:root {
  color-scheme: dark;
  --bg: #121e20;
  --ink: #e5edeb;
  --muted: #a4b7b2;
  --muted-on-accent: #a4b7b2;
  --accent: #b9ed76;
  --line: #364b4a;
  --surface: #1b2b2c;
  --control-bg: #162426;
  --accent-surface: #283c32;
  --heading-accent: #b1d491;
  --icon: #b9ed76;
  --button-bg: #b9ed76;
  --button-ink: #172c2b;
  --secondary-hover: #293e3e;
  --focus: #b9ed76;
  --success-bg: #30472d;
  --success-ink: #d0ecb7;
  --warning-bg: #3a3020;
  --warning-ink: #eed6a0;
  --warning-line: #75613c;
  --checkout-message-ink: #eed6a0;
  --inactive-bg: #303b3d;
  --inactive-ink: #bac5c5;
  --danger: #f3aaa2;
  --danger-line: #94615b;
  --danger-hover: #432e2d;
  --notice-bg: #2b4141;
  --notice-ink: #e5edeb;
  --overlay: #061010b3;
  --shadow: 0 8px 28px #00000014;
  --notice-shadow: 0 5px 30px #0005;
  --brand-ink: #172c2b;
  --art-bg: #183b36;
  --orbit: #81b875;
  --radius: 22px;
  --page-width: 1116px;
  --page-gutter: clamp(20px, 3vw, 40px);
  --section-space: clamp(48px, 5vw, 72px);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f0;
  --ink: #172c2b;
  --muted: #617370;
  --muted-on-accent: #617370;
  --line: #dbe2da;
  --surface: #fff;
  --control-bg: #fff;
  --accent-surface: #e6efdf;
  --heading-accent: #638c54;
  --icon: #659548;
  --button-bg: #172c2b;
  --button-ink: #fff;
  --secondary-hover: #e6efdf;
  --focus: #638c54;
  --success-bg: #e8f4de;
  --success-ink: #294928;
  --warning-bg: #f8eedb;
  --warning-ink: #76551b;
  --warning-line: #e8d5b3;
  --checkout-message-ink: #172c2b;
  --inactive-bg: #efeeeb;
  --inactive-ink: #655e5b;
  --danger: #923c36;
  --danger-line: #d7b6b1;
  --danger-hover: #fcf0ee;
  --notice-bg: #172c2b;
  --notice-ink: #fff;
  --overlay: #172c2b66;
  --shadow: none;
  --notice-shadow: 0 5px 30px #0002;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 system-ui, -apple-system, sans-serif; }
header, main, footer { max-width: calc(var(--page-width) + 2 * var(--page-gutter)); margin-inline: auto; padding: 24px var(--page-gutter); }
header { display: flex; justify-content: space-between; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); }
header nav { margin-left: auto; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 10px; }
.theme-toggle svg { width: 22px; height: 22px; }
.theme-moon, :root[data-theme="light"] .theme-sun { display: none; }
:root[data-theme="light"] .theme-moon { display: block; }
.brand { font-size: 24px; font-weight: 800; letter-spacing: -1px; text-decoration: none; white-space: nowrap; }
.mark { display: inline-block; background: var(--accent); color: var(--brand-ink); border-radius: 12px; padding: 0 9px; transform: rotate(-8deg); margin-right: 5px; }
nav { display: flex; flex-wrap: wrap; gap: 24px; font-size: 14px; }
a { color: inherit; text-underline-offset: 4px; }
nav a { text-decoration: none; }
nav a:hover { text-decoration: underline; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(40px, 4.4vw, 62px); line-height: 1.12; letter-spacing: -2.5px; font-weight: 650; }
h2 { font-size: 30px; line-height: 1.25; letter-spacing: -1px; margin-bottom: 20px; }
h3 { font-size: 21px; line-height: 1.35; margin-bottom: 12px; }
h1 span { color: var(--heading-accent); }
p:last-child { margin-bottom: 0; }
section { margin-bottom: 40px; scroll-margin-top: 24px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(32px, 4vw, 56px); align-items: center; padding: 40px 0 64px; margin-bottom: 0; }
.hero h1 { font-size: clamp(44px, 4.2vw, 60px); line-height: 1.08; letter-spacing: -.045em; margin-bottom: 24px; text-wrap: balance; }
.hero .lead { max-width: 48ch; line-height: 1.65; margin-bottom: 28px; }
.hero .actions { gap: 12px; margin: 0 0 16px; }
.hero .button { padding: 14px 22px; min-height: 50px; }
.hero .trial-note { font-size: 14px; line-height: 1.5; margin: 0; }
.hero ~ section { margin-bottom: var(--section-space); }
.hero ~ section h2, main > .legal h2 { font-size: clamp(26px, 2.5vw, 34px); line-height: 1.2; letter-spacing: -.035em; margin-bottom: 24px; }
.hero ~ section > .eyebrow { margin-bottom: 12px; }
.eyebrow { font-size: 11px; font-weight: 750; letter-spacing: 1.8px; margin-bottom: 16px; }
.lead { font-size: 18px; max-width: 520px; color: var(--muted); }
.muted { color: var(--muted); font-size: 13px; margin-top: 12px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0; }
button, .button { background: var(--button-bg); color: var(--button-ink); border: 1px solid var(--button-bg); font: inherit; font-weight: 650; font-size: 14px; padding: 12px 18px; min-height: 44px; border-radius: 12px; cursor: pointer; text-decoration: none; display: inline-block; text-align: center; }
.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
button:disabled { opacity: .55; cursor: not-allowed; }
.button:hover, button:enabled:hover { filter: brightness(1.15); }
.button.secondary:hover, button.secondary:enabled:hover { background: var(--secondary-hover); filter: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
button[aria-busy="true"] { cursor: progress; }
button[aria-busy="true"]::after { content: " …"; }
.flow-art { height: 400px; border-radius: 120px 22px 120px 22px; background: var(--art-bg); position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--accent); }
.flow-art > span { font-size: 130px; letter-spacing: -15px; font-weight: 600; z-index: 1; }
.flow-dot { font-size: 50px; vertical-align: top; letter-spacing: 0; }
.flow-art small { position: absolute; bottom: 40px; letter-spacing: 3px; font-size: 9px; }
.orbit { position: absolute; border: 1px solid var(--orbit); border-radius: 50%; width: 540px; height: 210px; transform: rotate(-40deg); opacity: .3; }
.orbit-two { height: 300px; transform: rotate(40deg); }
.orbit-three { height: 500px; width: 250px; transform: rotate(55deg); }
.grid { display: grid; gap: 20px; }
.grid > *, .hero > *, .pricing > * { min-width: 0; }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.feature-grid .card { padding: clamp(24px, 2.5vw, 32px); }
.feature-grid h3 { font-size: 21px; letter-spacing: -.025em; margin-bottom: 10px; }
.feature-grid p { max-width: 44ch; line-height: 1.6; margin-bottom: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.card p { color: var(--muted); }
.icon { display: block; color: var(--icon); font-weight: 700; font-size: 22px; margin-bottom: 24px; }
.location-grid { margin-top: 20px; }
.pricing { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; padding: 48px 0; align-items: center; }
.hero ~ .pricing { gap: clamp(32px, 6vw, 80px); padding: 0; }
.hero ~ .pricing > div > p:not(.eyebrow) { max-width: 46ch; color: var(--muted); }
.hero ~ .card { padding: clamp(24px, 3vw, 40px); }
.hero ~ .card > p { max-width: 80ch; }
.price, .accent { background: var(--accent-surface); }
.price p, .accent p { color: var(--muted-on-accent); }
.price h3 { font-size: 64px; margin: 24px 0 8px; line-height: 1; letter-spacing: -2px; }
.price h3 small { font-size: 30px; }
.price ul { padding: 16px 0 16px 20px; line-height: 2; font-size: 14px; }
.price .button { width: 100%; }
.pill { display: inline-block; background: var(--success-bg); color: var(--success-ink); border-radius: 50px; font-size: 12px; padding: 5px 12px; }
.pill[data-state="expired"] { color: var(--warning-ink); background: var(--warning-bg); }
.pill[data-state="inactive"] { color: var(--inactive-ink); background: var(--inactive-bg); }
.auth { max-width: 470px; margin: 60px auto 100px; background: var(--surface); padding: 35px; border-radius: var(--radius); border: 1px solid var(--line); }
.auth h1 { font-size: 40px; letter-spacing: -1px; }
label { display: block; font-size: 13px; font-weight: 600; margin: 16px 0; }
input, select { display: block; width: 100%; min-width: 0; margin-top: 7px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); font: inherit; font-size: 16px; background: var(--control-bg); color: var(--ink); }
input::placeholder { color: var(--muted); opacity: 1; }
input:autofill { background: var(--control-bg); color: var(--ink); }
input:-webkit-autofill { -webkit-text-fill-color: var(--ink); caret-color: var(--ink); box-shadow: 0 0 0 1000px var(--control-bg) inset; }
input[readonly] { font-size: 13px; background: var(--bg); }
form button { width: 100%; margin-top: 8px; }
.dashboard-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px 0 8px; }
.dashboard-head h1 { font-size: 44px; letter-spacing: -2px; margin-bottom: 8px; }
.dashboard { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.dashboard .card { margin-bottom: 20px; }
.dashboard h2 { font-size: 23px; }
.section-title { display: flex; justify-content: space-between; align-items: start; gap: 12px; flex-wrap: wrap; }
.section-title h2 { margin-bottom: 4px; overflow-wrap: anywhere; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 24px 0 12px; padding: 20px 0; border-block: 1px solid var(--line); }
.metrics small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.metrics strong { font-size: 24px; line-height: 1.3; font-weight: 650; }
.device { padding: 20px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.device > div:first-child { flex: 1 1 180px; min-width: 0; }
.device strong, #account-email { overflow-wrap: anywhere; }
.device .actions { margin: 0; gap: 8px; }
.device button { font-size: 12px; padding: 8px 12px; }
.device small { display: block; color: var(--muted); font-size: 12px; }
.device .device-status { margin-top: 4px; }
.inline-form { display: flex; gap: 12px; align-items: end; }
.inline-form label { flex: 1; min-width: 0; margin-bottom: 0; }
.inline-form button { width: auto; margin-bottom: 0; }
.accent small { font-size: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
td, th { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); }
td button { font-size: 12px; padding: 6px 10px; }
td small { display: block; color: var(--muted); }
.orders { font-size: 13px; }
.orders td { vertical-align: top; overflow-wrap: anywhere; }
.orders .order-identity strong { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.orders .order-amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.orders .order-state small { margin-top: 6px; max-width: 34ch; line-height: 1.45; }
.orders .order-actions { display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 0; }
.orders tr.order { border-bottom: 1px solid var(--line); }
.orders tr.order > td { border-bottom: 0; }
.orders .order-actions button { font-size: 13px; padding: 8px 14px; min-height: 40px; white-space: nowrap; }
.orders .order-message td { padding: 20px 8px; border-bottom: 0; }
.orders .order-message button { margin-left: 8px; }
.pill[data-state="pending"] { color: var(--warning-ink); background: var(--warning-bg); }
.pill[data-state="paid"] { color: var(--success-ink); background: var(--success-bg); }
#billing .section-title .muted { margin-top: 0; }
#notice { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 4; background: var(--notice-bg); color: var(--notice-ink); padding: 16px 24px; border-radius: 12px; width: max-content; max-width: calc(100vw - 32px); box-shadow: var(--notice-shadow); overflow-wrap: anywhere; }
footer { border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1.35fr 1fr; align-items: start; gap: 28px 40px; font-size: 13px; color: var(--muted); padding-block: 32px; }
footer .brand { font-size: 24px; color: var(--ink); }
footer p { margin: 0; }
.footer-brand p { max-width: 26ch; margin-top: 8px; }
footer nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); font-size: inherit; gap: 4px 24px; }
footer nav a, .footer-contacts a { padding-block: 5px; }
footer > * { min-width: 0; }
footer a, .review-code { overflow-wrap: anywhere; }
.footer-contacts { display: flex; flex-direction: column; align-items: start; gap: 4px; }
footer .review-code { grid-column: 1 / -1; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12px; }
.danger { color: var(--danger); border-color: var(--danger-line); }
button.danger:enabled:hover { background: var(--danger-hover); }
.legal { margin: 56px auto 32px; }
main > .legal { max-width: none; margin: 32px 0 24px; }
.hero ~ .legal { margin-top: 0; margin-bottom: 24px; }
main > .legal > p { max-width: 68ch; color: var(--muted); margin-bottom: 24px; }
#faq details, main > .legal details { border-radius: 16px; margin: 0 0 12px; }
#faq details:last-child, main > .legal details:last-child { margin-bottom: 0; }
#faq summary, main > .legal summary { padding: 22px 24px; font-size: 16px; border-radius: 15px; }
#faq summary:hover, main > .legal summary:hover { background: var(--bg); }
#faq details[open] > summary, main > .legal details[open] > summary { background: var(--accent-surface); border-radius: 15px 15px 0 0; }
#faq details > p, main > .legal .legal-body { max-width: calc(76ch + 48px); padding: 24px; font-size: 16px; line-height: 1.75; }
.legal h1 { font-size: 40px; letter-spacing: -1px; }
details { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); margin: 12px 0; scroll-margin-top: 24px; }
summary { cursor: pointer; font-weight: 650; padding: 20px 24px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; line-height: 1.4; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 22px; font-weight: 400; color: var(--muted); flex: 0 0 auto; transition: transform .18s ease; }
details[open] > summary::after { transform: rotate(45deg); }
details[open] > summary { border-bottom: 1px solid var(--line); }
details > p, .legal-body { padding: 20px 24px; margin: 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.legal-body p + p { margin-top: 16px; }
.legal-body h3 { font-size: 18px; margin-top: 28px; }
details[open] > .legal-body { animation: reveal .18s ease; }
@keyframes reveal { from { opacity: .3; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
#support a { overflow-wrap: anywhere; }
#support .actions { margin-bottom: 0; }
#merge-preview { margin-top: 20px; overflow-wrap: anywhere; }
#merge-preview h3 { font-size: 16px; margin-top: 24px; }
#merge-preview .device { align-items: start; flex-direction: column; }
#telegram-replace-dialog { width: min(520px, calc(100vw - 32px)); color: var(--ink); }
#telegram-replace-dialog::backdrop { background: var(--overlay); }
#telegram-replace-dialog h2 { font-size: 24px; }
#telegram-replace-dialog .actions { margin-bottom: 0; }
#telegram-replace-dialog button { width: auto; flex: 1; }
#checkout-dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; color: var(--ink); padding: clamp(20px, 4vw, 32px); }
#checkout-dialog::backdrop { background: var(--overlay); }
#checkout-dialog h2 { font-size: clamp(24px, 6vw, 30px); margin-bottom: 12px; }
#checkout-dialog .eyebrow { margin-bottom: 12px; }
#checkout-dialog .pill { margin-bottom: 20px; }
.checkout-plan { background: var(--bg); border-radius: 14px; padding: 16px 20px; margin-bottom: 20px; }
.checkout-plan strong { color: var(--ink); font-size: 24px; }
#checkout-dialog .checkout-plan p { margin-bottom: 4px; }
.checkout-identity { overflow-wrap: anywhere; font-size: 14px; }
.checkout-identity p { margin-bottom: 8px; }
#checkout-description { font-size: 14px; margin-top: 16px; }
.checkout-total { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.checkout-total strong { font-size: 28px; white-space: nowrap; }
#checkout-message { color: var(--checkout-message-ink); background: var(--warning-bg); border: 1px solid var(--warning-line); padding: 14px; border-radius: 12px; font-size: 14px; margin-top: 16px; overflow-wrap: anywhere; }
#checkout-dialog .actions { margin: 20px 0 0; gap: 10px; }
#checkout-dialog button { width: auto; flex: 1 1 100px; margin-top: 0; }
#auth-extra a { display: inline-block; margin: 5px; }
[hidden] { display: none !important; }
@media (max-width: 1000px) {
  .dashboard { grid-template-columns: 1fr; }
  .hero { gap: 28px; }
  .pricing { gap: 32px; }
  footer { grid-template-columns: 1fr 1.4fr; gap: 24px 32px; }
  .footer-contacts { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 8px 24px; }
}
@media (max-width: 800px) {
  header, main { padding-block: 20px; }
  header { flex-wrap: wrap; gap: 16px; }
  header .brand { order: 0; }
  header .theme-toggle { order: 1; margin-left: auto; }
  header nav { order: 2; flex-basis: 100%; margin-left: 0; }
  nav { gap: 16px; font-size: 13px; }
  .hero { grid-template-columns: 1fr; gap: 32px; padding: 24px 0 var(--section-space); }
  .hero h1 { max-width: 620px; font-size: clamp(44px, 6.5vw, 52px); }
  .flow-art { height: 270px; }
  .pricing { grid-template-columns: 1fr; gap: 24px; padding: 24px 0; }
  .card { padding: 24px; }
  .auth { padding: 24px; margin: 32px auto; }
  header nav a { display: inline-flex; align-items: center; min-height: 44px; }
  .hero ~ .pricing { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 680px) {
  .three { grid-template-columns: 1fr; }
  .card { padding: 22px; }
  .hero h1 { font-size: clamp(40px, 10.7vw, 52px); }
  .hero .lead { font-size: 17px; }
  .hero .actions { flex-direction: column; gap: 10px; }
  .hero .actions > a { width: 100%; }
  .feature-grid { grid-template-columns: 1fr; gap: 12px; }
  .feature-grid .card { padding: 24px; }
  #faq summary, main > .legal summary { padding: 20px; }
  #faq details > p, main > .legal .legal-body { padding: 20px; }
  main > .legal { margin-top: 24px; }
  .hero ~ .legal { margin-top: 0; }
  footer { grid-template-columns: 1fr; gap: 24px; }
  footer nav { gap: 0 20px; }
  footer nav a, .footer-contacts a { display: inline-flex; align-items: center; min-height: 44px; }
  .footer-contacts { grid-column: auto; flex-direction: column; gap: 0; }
  .dashboard-head h1 { font-size: 36px; }
  .metrics strong { font-size: 21px; }
  .inline-form { flex-wrap: wrap; }
  .inline-form label { flex-basis: 100%; }
  .inline-form button { width: 100%; }
  .device { align-items: start; }
  .device .actions { width: 100%; }
  /* Payment history: one card per order instead of table columns. */
  .table-wrap { overflow-x: visible; }
  .orders, .orders tbody, .orders tr, .orders td { display: block; width: 100%; }
  .orders thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .orders tr.order { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; background: var(--control-bg); }
  .orders tr.order > td { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 4px 12px; align-items: start; padding: 7px 0; border-bottom: 0; }
  .orders tr.order > td::before { content: attr(data-label); color: var(--muted); font-size: 12px; padding-top: 2px; }
  .orders tr.order > td > * { grid-column: 2; min-width: 0; }
  .orders .order-state small { max-width: none; }
  .orders .order-state .pill { justify-self: start; }
  .orders tr.order > td.order-actions { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; }
  .orders tr.order > td.order-actions::before { display: none; }
  .orders .order-actions button { width: 100%; min-height: 44px; font-size: 14px; white-space: normal; }
  .orders .order-no-actions { display: none !important; }
  .orders .order-message td { padding: 16px 0; }
  .orders .order-message button { display: block; width: 100%; margin: 12px 0 0; min-height: 44px; }
  .legal { margin-top: 40px; }
  summary { padding: 18px; }
  details > p, .legal-body { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
