/* Skrepka VPN — страница подписки. Палитра бренда: крем #F9F2EF, голубой #9BB5F6, графит #2C2C2C */
:root {
  --sk-bg: #F9F2EF;
  --sk-sky: #DCE5FB;
  --sk-blue: #9BB5F6;
  --sk-blue-deep: #7E9BEA;
  --sk-blue2: #C9D7FA;
  --sk-ink: #2C2C2C;
  --sk-ink-soft: rgba(44,44,44,.62);
  --sk-card: rgba(255,255,255,.72);
  --sk-ok: #4CAF7D;
  --sk-warn: #E7A33E;
  --sk-bad: #E26D5C;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* Подложка под всем: сверху крем, снизу голубой. Видна только при «оттягивании»
   страницы пальцем (iOS) — тогда сверху крем, снизу небо, а не белая полоса. */
html {
  min-height: 100%;
  background: linear-gradient(180deg, var(--sk-bg) 0 50%, var(--sk-sky) 50% 100%);
}
body {
  min-height: 100vh;
  background: transparent;
  color: var(--sk-ink);
  font-family: -apple-system, 'SF Pro Text', 'Segoe UI', Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
@font-face {
  font-family: 'Gothic60';
  src: url('/skrepka-assets/fonts/Gothic60-Regular.otf') format('opentype');
  font-display: swap;
}
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--sk-blue-deep); outline-offset: 2px; }

/* ---- небо и облака ---- */
/* Небо = фон страницы. Высота по «большому» экрану (100lvh): когда в iOS Safari
   прячется/выезжает нижняя панель, снизу не остаётся пустой полосы. */
.sk-sky {
  position: fixed; top: 0; left: 0; right: 0;
  height: 100vh; height: 100lvh;
  overflow: hidden; pointer-events: none; z-index: 0;
  background: linear-gradient(170deg, var(--sk-bg) 0%, var(--sk-bg) 46%, var(--sk-sky) 100%);
}
/* ряды облаков строит app.js (buildSky): слой = 2 ширины экрана, вторая половина — копия первой */
.sk-cloud-layer { position: absolute; left: 0; width: 200vw; height: 0; animation: sk-drift 100s linear infinite; will-change: transform; }
.sk-cloud {
  position: absolute; top: 0; width: 92px; height: 30px;
  background: rgba(201,215,250,.55); border-radius: 30px;
}
.sk-cloud::before, .sk-cloud::after { content: ""; position: absolute; background: inherit; border-radius: 50%; }
.sk-cloud::before { width: 44px; height: 44px; left: 16px; top: -22px; }
.sk-cloud::after  { width: 30px; height: 30px; left: 54px; top: -14px; }
.sk-cloud.l2t { background: rgba(155,181,246,.24); }
@keyframes sk-drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---- каркас ---- */
.sk-page { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; padding: 34px 16px 130px; }
.sk-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 2px; }
.sk-brand-logo { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 34px; }
.sk-brand-logo img { width: 32px; height: 32px; object-fit: contain; border-radius: 8px; }
.sk-brand-dot {
  width: 34px; height: 22px; border-radius: 20px; background: var(--sk-blue-deep); position: relative; flex: none;
  filter: drop-shadow(0 3px 6px rgba(94,124,214,.45));
}
.sk-brand-dot::before { content:""; position:absolute; width:14px; height:14px; border-radius:50%; background:inherit; left:-5px; top:3px; }
.sk-brand-dot::after  { content:""; position:absolute; width:10px; height:10px; border-radius:50%; background:inherit; right:-3px; top:1px; }
.sk-h1 { font-family: 'Gothic60', -apple-system, sans-serif; font-size: 30px; letter-spacing: .5px; margin: 0; font-weight: 400; overflow-wrap: anywhere; }
.sk-sub { margin: 0 0 18px; color: var(--sk-ink-soft); font-size: 13px; min-height: 1.2em; }
.sk-h2 { font-size: 15px; font-weight: 600; margin: 22px 2px 10px; display: flex; align-items: center; gap: 8px; }
.sk-count { font-size: 12px; font-weight: 500; background: rgba(155,181,246,.35); border-radius: 999px; padding: 1px 8px; }
.sk-count:empty { display: none; }

.sk-card {
  background: var(--sk-card);
  border-radius: 20px;
  padding: 14px 16px;
  margin-bottom: 12px;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.sk-skeleton { height: 76px; }
.sk-skeleton::before { content: ""; display: block; height: 100%; border-radius: 12px; background: linear-gradient(90deg, rgba(201,215,250,.35), rgba(201,215,250,.6), rgba(201,215,250,.35)); background-size: 200% 100%; animation: sk-shimmer 1.4s ease-in-out infinite; }
@keyframes sk-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---- статус ---- */
.sk-status-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; }
.sk-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(76,175,125,.16); color: var(--sk-ink);
  border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 500;
}
.sk-badge .sk-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sk-ok); display: inline-block; }
.sk-badge.is-warn { background: rgba(231,163,62,.2); }
.sk-badge.is-warn .sk-dot { background: var(--sk-warn); }
.sk-badge.is-bad { background: rgba(226,109,92,.18); }
.sk-badge.is-bad .sk-dot { background: var(--sk-bad); }
.sk-days { font-size: 13px; color: var(--sk-ink-soft); }
.sk-days b { color: var(--sk-ink); font-weight: 500; }
.sk-days.is-bad b { color: var(--sk-bad); }
.sk-meter { margin-top: 12px; }
.sk-meter-track { height: 10px; border-radius: 999px; background: rgba(201,215,250,.55); overflow: hidden; }
.sk-meter-fill { height: 100%; width: 0%; border-radius: 999px; background: var(--sk-blue); transition: width .6s ease; }
.sk-meter-labels { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px 12px; margin-top: 8px; font-size: 12px; color: var(--sk-ink-soft); }
.sk-meter-labels > span { white-space: nowrap; }
.sk-meter-labels b { color: var(--sk-ink); font-weight: 500; }
.sk-reset { margin-top: 2px; font-size: 11.5px; color: var(--sk-ink-soft); }

/* ---- кнопки ---- */
.sk-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  width: 100%; text-decoration: none; cursor: pointer;
  background: var(--sk-blue); color: var(--sk-ink);
  font-size: 16px; font-weight: 500; font-family: inherit;
  padding: 15px 18px; border-radius: 18px; border: 0;
  box-shadow: 0 10px 22px rgba(155,181,246,.55);
  margin: 4px 0 16px;
  transition: filter .15s ease, transform .15s ease;
}
.sk-cta:hover { filter: brightness(1.05); }
.sk-cta:active { transform: translateY(1px); }
.sk-cta-app { font-size: 13px; font-weight: 400; color: var(--sk-ink-soft); }
.sk-cta-app::before { content: "· "; }

.sk-copy, .sk-dl, .sk-iconbtn {
  border: 0; cursor: pointer; font-family: inherit;
  background: rgba(155,181,246,.3); color: var(--sk-ink);
  border-radius: 999px; font-weight: 500; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.sk-copy { padding: 8px 14px; font-size: 12.5px; flex: none; }
.sk-copy:hover, .sk-dl:hover, .sk-iconbtn:hover { background: rgba(155,181,246,.55); }
.sk-dl { padding: 9px 14px; font-size: 12.5px; }
.sk-add {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--sk-blue); color: var(--sk-ink); text-decoration: none; border: 0; cursor: pointer; font-family: inherit;
  border-radius: 12px; padding: 10px 16px; font-size: 13px; font-weight: 500;
  box-shadow: 0 6px 14px rgba(155,181,246,.45);
}
.sk-add:hover { filter: brightness(1.05); }
.sk-iconbtn { width: 34px; height: 34px; padding: 0; flex: none; background: transparent; }
.sk-iconbtn svg { width: 18px; height: 18px; }

/* ---- QR ---- */
.sk-qr-row { display: flex; align-items: center; gap: 16px; }
.sk-qr { flex: none; width: 132px; height: 132px; border-radius: 14px; background: #fff; padding: 8px; }
.sk-qr img, .sk-qr canvas { display: block; width: 100% !important; height: 100% !important; image-rendering: pixelated; }
.sk-qr-note { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--sk-ink-soft); min-width: 0; line-height: 1.4; }
.sk-qr-note b { color: var(--sk-ink); font-weight: 500; font-size: 14px; }

/* ---- ссылка ---- */
.sk-card.sk-linkrow { display: flex; align-items: center; gap: 8px; }
.sk-linktext {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; color: var(--sk-ink-soft);
}

/* ---- вкладки платформ ---- */
.sk-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.sk-tab {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; cursor: pointer; font-family: inherit; font-size: 13.5px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,.6); color: var(--sk-ink-soft);
  transition: background .15s ease;
}
.sk-tab .sk-ic, .sk-tab .sk-ic svg { width: 16px; height: 16px; }
.sk-tab:hover { background: rgba(155,181,246,.35); color: var(--sk-ink); }
.sk-tab[aria-selected="true"] { background: var(--sk-blue); color: var(--sk-ink); font-weight: 500; }

/* ---- приложения ---- */
.sk-apps { display: flex; flex-direction: column; gap: 8px; }
details.sk-app { background: var(--sk-card); border-radius: 16px; overflow: hidden; }
details.sk-app.is-featured { box-shadow: inset 0 0 0 1.5px rgba(155,181,246,.7); }
details.sk-app summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
}
details.sk-app summary::-webkit-details-marker { display: none; }
details.sk-app summary:hover { background: rgba(155,181,246,.14); }
/* иконки приложений в конфиге Remnawave белые (под тёмную тему) — даём им плашку */
.sk-app-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: var(--sk-blue-deep); color: #fff; }
.sk-app-ic svg { width: 22px; height: 22px; }
.sk-app-title { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 500; }
.sk-app-title small { display: block; color: var(--sk-ink-soft); font-size: 12px; font-weight: 400; margin-top: 2px; }
.sk-chev { flex: none; width: 18px; height: 18px; color: var(--sk-ink-soft); transition: transform .2s ease; }
.sk-chev svg { width: 18px; height: 18px; }
details[open] .sk-chev { transform: rotate(90deg); }

.sk-blocks { list-style: none; margin: 0; padding: 2px 14px 14px; display: flex; flex-direction: column; gap: 14px; }
.sk-block { display: flex; gap: 12px; align-items: flex-start; }
.sk-block-ic {
  flex: none; width: 32px; height: 32px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
}
.sk-block-ic svg { width: 18px; height: 18px; }
.sk-block-body { flex: 1; min-width: 0; }
.sk-block-title { display: block; font-size: 13.5px; font-weight: 500; margin-top: 6px; }
.sk-block-desc { margin: 4px 0 0; font-size: 12.5px; color: var(--sk-ink-soft); line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.sk-app-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sk-app-actions .sk-ic, .sk-app-actions .sk-ic svg { width: 16px; height: 16px; }

/* ---- чипы ---- */
/* ровная сетка 2×N: Поддержка / Бот / Новости / Язык — все одной ширины */
.sk-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.sk-chips { display: contents; }
.sk-links .is-wide { grid-column: 1 / -1; }
.sk-links .sk-chip, .sk-links .sk-lang-pill { width: 100%; min-width: 0; }
.sk-chip {
  justify-content: center; min-height: 44px;
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  background: var(--sk-card); color: var(--sk-ink);
  border-radius: 999px; padding: 0 14px; font-size: 13px;
  transition: background .15s ease;
}
.sk-chip:hover { background: rgba(155,181,246,.35); }
.sk-chip-solo { flex: none; min-height: 0; padding: 10px 16px; margin-top: 12px; }

/* ---- язык ---- */
/* родной select прозрачный и растянут на всю «пилюлю» — выглядит как чип, а список открывается системный */
.sk-lang-pill {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; padding: 0 14px; border-radius: 999px;
  background: var(--sk-card); color: var(--sk-ink); font-size: 13px; cursor: pointer;
  transition: background .15s ease;
}
.sk-lang-pill:hover { background: rgba(155,181,246,.35); }
.sk-lang-pill:focus-within { outline: 2px solid var(--sk-blue-deep); outline-offset: 2px; }
.sk-lang-pill .sk-ic, .sk-lang-pill .sk-ic svg { width: 16px; height: 16px; }
.sk-lang-chev { color: var(--sk-ink-soft); }
.sk-lang-select {
  position: absolute; inset: 0; width: 100%; height: 100%;
  -webkit-appearance: none; appearance: none; opacity: 0;
  border: 0; margin: 0; font: inherit; font-size: 16px; cursor: pointer;
}

/* ---- ошибка ---- */
.sk-err { display: flex; flex-direction: column; gap: 6px; text-align: center; align-items: center; }
.sk-err b { font-size: 15px; font-weight: 500; }
.sk-err span { font-size: 13px; color: var(--sk-ink-soft); }

/* ---- тост ---- */
.sk-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 5;
  background: var(--sk-ink); color: #fff; font-size: 13px; padding: 10px 16px; border-radius: 999px;
  box-shadow: 0 8px 20px rgba(44,44,44,.25); max-width: calc(100vw - 32px); text-align: center;
}

/* ---- футер и маскот ---- */
.sk-footer { margin-top: 18px; text-align: center; font-size: 11.5px; color: var(--sk-ink-soft); }
.sk-mascot-wrap { position: fixed; right: 14px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 2; pointer-events: none; animation: sk-float 5.2s ease-in-out infinite; }
.sk-mascot-wrap img { display: block; width: 118px; height: auto; }
@keyframes sk-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

.sk-ic { display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; flex: none; }
.sk-ic svg { width: 18px; height: 18px; }

@media (max-width: 420px) {
  .sk-mascot-wrap img { width: 84px; }
  .sk-h1 { font-size: 26px; }
  .sk-qr { width: 112px; height: 112px; padding: 6px; }
  .sk-qr-row { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .sk-cloud-layer, .sk-mascot-wrap, .sk-skeleton::before { animation: none; }
  .sk-meter-fill { transition: none; }
}
