/* Магазин: главная и страница заказа. Светлая тема по умолчанию, тёмная —
   по настройке системы. */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-soft: #f4f5f7;
  --card: #f4f5f7;
  --card-hover: #eceef1;
  --line: #e4e6ea;
  --text: #111317;
  --muted: #6b7280;
  --accent: #2EE07A;          /* фирменный зелёный, точка в логотипе */
  --accent-ink: #0D0D10;      /* текст и галочки на зелёном */
  --accent-soft: #e3f9ec;
  --accent-text: #0e7a3d;
  --btn: #111317;
  --btn-text: #ffffff;
  --warn-bg: #fff6e0;
  --warn-line: #f3d48a;
  --warn-text: #7a5300;
  --bad-bg: #fdecec;
  --bad-line: #f2b8b8;
  --bad-text: #9b1c1c;
  --shadow: 0 10px 30px rgba(17, 19, 23, 0.10);
  --radius: 20px;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f12;
    --bg-soft: #15181d;
    --card: #171a1f;
    --card-hover: #1e2228;
    --line: #262a31;
    --text: #f2f3f5;
    --muted: #9aa1ac;
    --accent: #2EE07A;
    --accent-soft: rgba(46, 224, 122, 0.13);
    --accent-text: #6ef0a4;
    --btn: #f2f3f5;
    --btn-text: #0d0f12;
    --warn-bg: rgba(245, 158, 11, 0.12);
    --warn-line: rgba(245, 158, 11, 0.35);
    --warn-text: #fcd58a;
    --bad-bg: rgba(248, 113, 113, 0.12);
    --bad-line: rgba(248, 113, 113, 0.35);
    --bad-text: #fecaca;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
a { color: var(--accent-text); }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 620px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

/* ---------- Шапка ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.top.scrolled { border-bottom-color: var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 20px; color: var(--text); text-decoration: none; letter-spacing: -0.05em; }
.logo-mark { width: 32px; height: 32px; flex: none; display: block; }
@media (prefers-color-scheme: dark) { .logo-mark, .cloud .center { outline: 1px solid var(--line); outline-offset: -1px; border-radius: 22%; } }
.top-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--btn); color: var(--btn-text);
  font-weight: 650; font-size: 16px; padding: 14px 22px; border-radius: 16px;
  transition: transform .1s, opacity .15s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.big { font-size: 18px; padding: 18px 26px; border-radius: 20px; width: 100%; }
.btn.small { font-size: 14px; padding: 8px 14px; border-radius: 12px; }
.btn.soft { background: var(--card); color: var(--text); }
.btn.soft:hover { background: var(--card-hover); }
.btn.green { background: var(--accent); color: var(--accent-ink); }
.btn svg { flex: none; }

/* ---------- Главная: первый экран ---------- */
.hero { padding-top: 28px; padding-bottom: 8px; text-align: center; }
.cloud { position: relative; height: 230px; max-width: 420px; margin: 0 auto 6px; }
.cloud .center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 112px; height: 112px; display: block; filter: drop-shadow(0 12px 24px rgba(13, 13, 16, 0.22));
}
.cloud .float {
  position: absolute; width: 64px; height: 64px; border-radius: 16px; padding: 6px;
  background: var(--bg); box-shadow: var(--shadow);
  animation: bob 6s ease-in-out infinite;
}
.cloud .float img { width: 100%; height: 100%; border-radius: 12px; display: block; object-fit: cover; }
.cloud svg.links { position: absolute; inset: 0; width: 100%; height: 100%; }
.cloud svg.links line { stroke: var(--line); stroke-width: 1.5; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
@media (prefers-reduced-motion: reduce) { .cloud .float { animation: none; } html { scroll-behavior: auto; } }

.hero h1 { font-size: clamp(30px, 6vw, 52px); line-height: 1.08; font-weight: 800; margin-top: 8px; }
.hero .lead { color: var(--muted); font-size: clamp(16px, 2.2vw, 19px); max-width: 560px; margin: 14px auto 0; }
.hero-cta { max-width: 460px; margin: 26px auto 0; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.hero-cta .note { font-size: 14px; color: var(--muted); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 34px 0 0; }
.step { background: var(--card); border-radius: var(--radius); padding: 18px; display: flex; gap: 14px; align-items: flex-start; text-align: left; }
.num { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-weight: 750; display: grid; place-items: center; }
.step b { display: block; font-size: 17px; }
.step span { color: var(--muted); font-size: 14.5px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Секции ---------- */
.section { padding-top: 56px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.section h2 { font-size: clamp(24px, 4vw, 34px); font-weight: 800; }
.section-head p { color: var(--muted); }

/* ---------- Каталог ---------- */
.search { position: relative; margin-bottom: 12px; }
.search input {
  width: 100%; font: inherit; font-size: 17px; color: var(--text);
  background: var(--card); border: 1px solid transparent; border-radius: 16px; padding: 14px 16px 14px 46px;
}
.search input:focus { outline: none; border-color: var(--accent); background: var(--bg); }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 0; cursor: pointer; background: var(--card); color: var(--text); font-weight: 600; font-size: 15px; padding: 9px 16px; border-radius: 12px; }
.chip.on { background: var(--btn); color: var(--btn-text); }

.list-head { display: flex; justify-content: space-between; font-weight: 700; font-size: 17px; margin: 6px 2px 10px; }
.list-head span { color: var(--muted); font-weight: 500; }
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.app {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center;
  background: var(--card); border: 1.5px solid transparent; border-radius: 18px; padding: 12px 14px;
  cursor: pointer; text-align: left; width: 100%; transition: background .15s, border-color .15s;
}
.app:hover { background: var(--card-hover); }
.app.sel { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.app-icon { width: 56px; height: 56px; border-radius: 13px; object-fit: cover; background: var(--line); display: grid; place-items: center; font-weight: 750; color: var(--muted); font-size: 22px; }
.app-name { font-weight: 650; font-size: 16.5px; display: block; overflow-wrap: anywhere; }
.app-meta { color: var(--muted); font-size: 13.5px; }
.tick { width: 28px; height: 28px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--muted) 55%, transparent); display: grid; place-items: center; color: transparent; transition: background .15s, border-color .15s; }
.app.sel .tick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.empty { color: var(--muted); padding: 24px 4px; text-align: center; grid-column: 1 / -1; }

/* ---------- Нижняя панель выбора ---------- */
.cart {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}
.cart-in {
  pointer-events: auto; max-width: 620px; margin: 0 auto;
  background: #111317; color: #fff; border-radius: 22px; padding: 12px 12px 12px 20px;
  display: flex; align-items: center; gap: 10px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  animation: up .2s ease-out;
}
@media (prefers-color-scheme: dark) { .cart-in { background: #1f242b; border: 1px solid var(--line); } }
@keyframes up { from { transform: translateY(20px); opacity: 0; } }
.cart-sum { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.cart-sum small { color: #a5abb5; font-size: 13px; white-space: nowrap; }
.cart-sum b { font-size: 21px; }
.cart .clear { width: 44px; height: 44px; border-radius: 13px; border: 0; background: rgba(255,255,255,0.1); color: #fff; cursor: pointer; display: grid; place-items: center; flex: none; }
.cart .btn.green { padding: 13px 18px; border-radius: 14px; }

/* ---------- Безопасность и вопросы ---------- */
.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.trust > div { background: var(--card); border-radius: var(--radius); padding: 20px; }
.trust b { display: block; font-size: 17px; margin: 10px 0 4px; }
.trust p { color: var(--muted); font-size: 15px; }
.trust .ico { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; }
@media (max-width: 760px) { .trust { grid-template-columns: 1fr; } }

.faq { display: flex; flex-direction: column; gap: 8px; }
.faq details { background: var(--card); border-radius: 16px; padding: 0 18px; }
.faq summary { cursor: pointer; list-style: none; font-weight: 650; padding: 16px 0; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--muted); font-weight: 400; font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq details p { color: var(--muted); padding: 0 0 16px; font-size: 15px; }

.final { margin: 56px 0 0; background: var(--card); border-radius: 28px; padding: 36px 22px; text-align: center; }
.final h2 { font-size: clamp(24px, 4vw, 32px); font-weight: 800; }
.final p { color: var(--muted); margin: 8px auto 22px; max-width: 460px; }
.final .btn { max-width: 380px; }

footer { padding-top: 40px; padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: 14px; text-align: center; display: flex; flex-direction: column; gap: 6px; }
footer a { color: var(--muted); }

/* ---------- Окно оформления ---------- */
.sheet {
  border: 0; padding: 0; background: var(--bg); color: var(--text);
  width: min(520px, 100vw); max-height: 92vh; border-radius: 26px; box-shadow: var(--shadow);
}
.sheet::backdrop { background: rgba(0, 0, 0, 0.45); }
@media (max-width: 560px) {
  .sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 26px 26px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
}
.sheet-in { padding: 22px 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h3 { font-size: 22px; }
.x { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--card); cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.lines { display: flex; flex-direction: column; gap: 10px; max-height: 40vh; overflow: auto; }
.line { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; }
.line .app-icon { width: 40px; height: 40px; border-radius: 10px; font-size: 16px; }
.total { display: flex; justify-content: space-between; font-weight: 750; font-size: 19px; border-top: 1px solid var(--line); padding-top: 14px; }
.fine { color: var(--muted); font-size: 13.5px; text-align: center; }

/* ---------- Страница заказа ---------- */
.order { padding-top: 22px; padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; }
.order h1 { font-size: 28px; font-weight: 800; }
.card { background: var(--card); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.card h2 { font-size: 19px; display: flex; gap: 12px; align-items: center; }
.card h2 .num { width: 32px; height: 32px; font-size: 15px; }
.card .text { color: var(--muted); font-size: 15px; }
.card ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 15.5px; }
.path { background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 1px 7px; font-weight: 600; font-size: 14px; white-space: nowrap; }

.banner { border-radius: 16px; padding: 14px 16px; font-size: 15px; border: 1px solid; display: flex; flex-direction: column; gap: 6px; }
.banner b { font-weight: 700; }
.banner.ok { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent-text); }
.banner.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-text); }
.banner.bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad-text); }
.banner.plain { background: var(--bg); border-color: var(--line); color: var(--muted); }
.banner .btn { align-self: flex-start; margin-top: 4px; }

.cred { display: flex; flex-direction: column; gap: 6px; }
.cred label { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.cred-row { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 8px 8px 8px 14px; }
.cred-row span { flex: 1; min-width: 0; font-family: var(--mono); font-size: 16px; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.copy { flex: none; border: 0; cursor: pointer; background: var(--card); color: var(--text); font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 10px; }
.copy.done { background: var(--accent-soft); color: var(--accent-text); }

.code-box { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.code-digits { font-family: var(--mono); font-size: 40px; font-weight: 750; letter-spacing: .18em; padding-left: .18em; }
.wait { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 15px; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.install { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.install:first-child { border-top: 0; padding-top: 0; }
.install .app-icon { width: 52px; height: 52px; border-radius: 12px; }
.install .btn { padding: 9px 16px; border-radius: 999px; font-size: 15px; }
.install .btn.busy { background: var(--line); color: var(--muted); }

.timer { font-variant-numeric: tabular-nums; }
.price-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.big-state { text-align: center; padding: 30px 18px; }
.big-state h2 { justify-content: center; }
.card .btn.soft { background: var(--bg); }
