@font-face { font-family: "Inter"; src: url("fonts/inter-cyrillic-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

/* Те же настройки, что у панели: раздел админки «Оформление». Светлая или тёмная — как в Telegram. */
:root {
  --glass-alpha: 0.38;
  --glass-blur: 28px;
  --radius: 12px;
  --radius-sm: calc(var(--radius) * 0.72);
  --tabs-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  --tint: 255 255 255;
  --wall-base: #dfe1e6;
  --wall-1: #aeb3c0; --wall-2: #eceae4; --wall-3: #9aa1b1;
  --line: rgb(0 0 0 / 0.09);
  --line-strong: rgb(0 0 0 / 0.16);
  --spec: rgb(255 255 255 / 0.85);
  --sheen: rgb(255 255 255 / 0.42);
  --shade: 0 1px 2px rgb(0 0 0 / 0.05), 0 12px 30px -14px rgb(0 0 0 / 0.2);
  --well: rgb(0 0 0 / 0.045);
  --well-strong: rgb(0 0 0 / 0.08);
  --text: #1c1c1e;
  --muted: #4e4e52;
  --ok: #1f7a37;
  --wait: #8f5a00;
  --bad: #c4221b;
  --notice-bg: rgb(255 159 10 / 0.15);
  --notice-line: rgb(255 159 10 / 0.34);
  --notice-text: #8f5a00;
  --accent: var(--text);
  --on-accent: var(--wall-base);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --tint: 26 27 32;
  --wall-base: #101114;
  --wall-1: #565a67; --wall-2: #2e3038; --wall-3: #62666f;
  --line: rgb(255 255 255 / 0.13);
  --line-strong: rgb(255 255 255 / 0.18);
  --spec: rgb(255 255 255 / 0.24);
  --sheen: rgb(255 255 255 / 0.11);
  --shade: 0 1px 2px rgb(0 0 0 / 0.3), 0 14px 34px -16px rgb(0 0 0 / 0.65);
  --well: rgb(255 255 255 / 0.06);
  --well-strong: rgb(255 255 255 / 0.1);
  --text: #f5f5f7;
  --muted: #c2c2c9;
  --ok: #5fdc85;
  --wait: #ffcf5c;
  --bad: #ff8078;
  --notice-bg: rgb(255 214 10 / 0.12);
  --notice-line: rgb(255 214 10 / 0.28);
  --notice-text: #ffcf5c;
  color-scheme: dark;
}
:root[data-accent="custom"] { --accent: var(--accent-custom); --on-accent: var(--on-accent-custom); }

:root[data-wall="ocean"] { --wall-base: #dfe9ee; --wall-1: #7fbacd; --wall-2: #c7dfe6; --wall-3: #69a8bd; }
:root[data-wall="ocean"][data-theme="dark"] { --wall-base: #081318; --wall-1: #1c6f88; --wall-2: #0f3a4a; --wall-3: #25808f; }
:root[data-wall="dune"] { --wall-base: #eee8df; --wall-1: #d4b68c; --wall-2: #ece0cd; --wall-3: #c5a274; }
:root[data-wall="dune"][data-theme="dark"] { --wall-base: #14100b; --wall-1: #7a5a33; --wall-2: #3f2f1c; --wall-3: #8c6a3f; }
:root[data-wall="forest"] { --wall-base: #e3ebe2; --wall-1: #8fb98d; --wall-2: #cfdecd; --wall-3: #7aa878; }
:root[data-wall="forest"][data-theme="dark"] { --wall-base: #0a120c; --wall-1: #2f6b3e; --wall-2: #1b3a24; --wall-3: #3a7d4b; }
:root[data-wall="slate"] { --wall-base: #e2e6ee; --wall-1: #93a5c6; --wall-2: #ccd4e2; --wall-3: #7f93b8; }
:root[data-wall="slate"][data-theme="dark"] { --wall-base: #0b0e14; --wall-1: #3b4a6b; --wall-2: #232c40; --wall-3: #4a5a80; }
:root[data-wall="plain"] { --wall-1: transparent; --wall-2: transparent; --wall-3: transparent; }
:root[data-wall="custom"] { --wall-1: color-mix(in srgb, var(--wall-color) 70%, var(--wall-base)); --wall-2: color-mix(in srgb, var(--wall-color) 38%, var(--wall-base)); --wall-3: color-mix(in srgb, var(--wall-color) 90%, var(--wall-base)); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; color: var(--text); }
/* Цвет только у html: фон body лёг бы поверх обоев и стеклу нечего было бы размывать */
html { background-color: var(--wall-base); }
body { background: transparent; }
body { font: 500 15px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: -0.008em; overscroll-behavior-y: none; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(90vw 46vh at 4% 0%, var(--wall-1), transparent 72%),
    radial-gradient(80vw 50vh at 100% 34%, var(--wall-2), transparent 72%),
    radial-gradient(110vw 50vh at 50% 104%, var(--wall-3), transparent 72%);
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.view { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px calc(var(--tabs-h) + var(--safe-b) + 24px); max-width: 560px; margin: 0 auto; outline: none; }
.view p { margin: 0; }

.h1 { font-size: 24px; font-weight: 650; letter-spacing: -0.028em; line-height: 1.2; margin: 0; }
.h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; margin: 4px 0 0; }
.muted { color: var(--muted); }
.legal-note { margin: 10px 2px 0; }
.doc-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.small { font-size: 13px; }
.pre { white-space: pre-line; }

.art { width: 100%; height: auto; aspect-ratio: 2 / 1; border-radius: var(--radius); object-fit: cover; border: 1px solid var(--line); }

.card, .fold, .plan, .tile, .tabs, .toast {
  background: radial-gradient(120% 90% at 14% -10%, var(--sheen), transparent 58%), rgb(var(--tint) / var(--glass-alpha));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(190%);
  backdrop-filter: blur(var(--glass-blur)) saturate(190%);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--spec), inset 0 -1px 0 rgb(0 0 0 / 0.12), var(--shade);
}
.card { border-radius: var(--radius); padding: 16px; }
.card > * + * { margin-top: 10px; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); font-weight: 600; background: var(--well); color: var(--text); text-align: center; box-shadow: inset 0 1px 0 var(--spec); transition: transform 0.08s ease, opacity 0.15s ease; }
.btn:active { transform: scale(0.985); }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.22), 0 1px 2px rgb(0 0 0 / 0.2); }
.btn.ghost { background: transparent; border-color: var(--line); box-shadow: none; }
.btn.danger { background: transparent; border-color: var(--line-strong); color: var(--bad); box-shadow: none; }
.btn.small { min-height: 38px; width: auto; padding: 8px 14px; font-size: 13px; }
.stack > * + * { margin-top: 8px; }

.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.active { background: var(--ok); }
.dot.limited, .dot.disabled { background: var(--wait); }
.dot.expired { background: var(--bad); }

.hero { display: flex; align-items: center; gap: 16px; }
.ring { --p: 0; position: relative; flex: none; width: 88px; height: 88px; display: grid; place-items: center; }
.ring::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--well-strong) 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px)); mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px)); }
.ring-in { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
.ring-num { font-size: 24px; font-weight: 650; letter-spacing: -0.03em; }
.ring-label { font-size: 10px; color: var(--muted); margin-top: 2px; }
.hero-text { min-width: 0; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bar { height: 6px; border-radius: 6px; background: var(--well-strong); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--accent); }

.plan { display: block; width: 100%; text-align: left; border-radius: var(--radius); padding: 14px 16px; }
.plan.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), var(--shade); }
.plan-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.plan-name { font-weight: 600; font-size: 16px; letter-spacing: -0.015em; }
.plan-price { font-weight: 650; font-size: 17px; letter-spacing: -0.02em; white-space: nowrap; }
.plan-specs { color: var(--muted); font-size: 13px; margin-top: 4px; }
.tag { display: inline-block; margin-top: 8px; padding: 2px 8px; border-radius: calc(var(--radius-sm) * 0.8); background: var(--well-strong); font-size: 12px; font-weight: 600; }

.input { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--well); border: 1px solid var(--line); outline: none; box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.08); }
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--muted); }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; min-width: 0; text-transform: uppercase; }
.input-row .btn { width: auto; flex: none; min-height: 48px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 14px; border-radius: var(--radius-sm); background: var(--well); border: 1px solid var(--line); font-weight: 550; font-size: 14px; }
.chip.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.chip:disabled { opacity: 0.4; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper .chip { width: 48px; padding: 9px 0; text-align: center; font-size: 18px; line-height: 1.1; }
.stepper b { flex: 1; text-align: center; font-size: 17px; font-weight: 620; }

.total { display: flex; align-items: baseline; justify-content: space-between; }
.total b { font-size: 22px; font-weight: 650; letter-spacing: -0.025em; }
.total s { color: var(--muted); font-weight: 500; margin-right: 8px; }

.device { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.device + .device { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.device-name { font-weight: 600; overflow-wrap: anywhere; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { border-radius: var(--radius-sm); padding: 12px 8px; text-align: center; }
.tile b { display: block; font-size: 22px; font-weight: 650; letter-spacing: -0.025em; }
.tile span { color: var(--muted); font-size: 12px; }

.link-box { display: block; width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--well); border: 1px dashed var(--line-strong); font-size: 13px; text-align: left; overflow-wrap: anywhere; color: var(--muted); }

.fold { border-radius: var(--radius-sm); overflow: hidden; }
.fold + .fold { margin-top: 8px; }
.fold-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 14px 16px; font-weight: 600; text-align: left; }
.fold-head::after { content: ""; flex: none; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 0.15s ease; margin-right: 3px; }
.fold.open .fold-head::after { transform: rotate(-135deg); }
.fold-body { padding: 0 16px 16px; }
.fold-body > * + * { margin-top: 10px; }

.notice { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--notice-bg); border: 1px solid var(--notice-line); color: var(--notice-text); font-size: 14px; }

.center { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 0 12px; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--well-strong); border-top-color: var(--text); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: center; height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b); border-width: 1px 0 0; box-shadow: inset 0 1px 0 var(--spec); }
.tab { flex: 1; max-width: 112px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 500; min-width: 0; }
.tab svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.active { color: var(--text); font-weight: 650; }
.tab.active svg { stroke-width: 2.2; }

.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabs-h) + var(--safe-b) + 12px); z-index: 20; max-width: 528px; margin: 0 auto; padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 550; text-align: center; background: rgb(var(--tint) / max(var(--glass-alpha), 0.85)); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .card, .fold, .plan, .tile, .tabs, .toast { background: rgb(var(--tint)); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
