/* ЛК PRO — общий стиль для всех страниц кабинета */

:root {
  --ground: #0A0D12;
  --surface: #121821;
  --surface-2: #18202B;
  --ink: #E8EDF4;
  --ink-2: #B4C0CF;
  --muted: #7A889A;
  --line: #1F2935;
  --line-2: #2A3745;
  --accent: #4C9AFF;
  --accent-deep: #10243D;
  --ok: #46C08B;
  --ok-deep: #0F2C21;
  --warn: #E0A458;
  --warn-deep: #2E2312;
  --crit: #E8705F;
  --crit-deep: #2E1714;

  --display: "Unbounded", ui-sans-serif, system-ui, sans-serif;
  --body: "Onest", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

a { color: inherit; text-decoration: none; }

.shell { max-width: 880px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 28px); }

/* ---------- шапка ---------- */

header.top {
  border-bottom: 1px solid var(--line);
  background: rgba(10, 13, 18, .9);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 20;
}

.top-in { display: flex; align-items: center; gap: 16px; height: 62px; }

.brand { display: flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.brand .sub { font-family: var(--mono); font-size: 10.5px; font-weight: 400; color: var(--muted); letter-spacing: .1em; padding-left: 8px; border-left: 1px solid var(--line-2); }

.top-nav { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--body); font-size: 15px; font-weight: 500;
  padding: 11px 18px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn-solid { background: var(--accent); color: #051020; font-weight: 600; }
.btn-solid:hover:not(:disabled) { background: #6BAEFF; transform: translateY(-1px); }
.btn-ghost { border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-wide { width: 100%; }

/* ---------- карточки ---------- */

main { padding: clamp(24px, 5vw, 44px) 0 72px; }

.stack { display: flex; flex-direction: column; gap: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(18px, 3vw, 26px);
}

.card-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2 { font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: -.02em; margin: 0; }
.card-head .hint { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-left: auto; }

h1 { font-family: var(--display); font-weight: 700; font-size: clamp(24px, 4.4vw, 32px); letter-spacing: -.03em; margin: 0 0 8px; }
.sub { color: var(--ink-2); margin: 0 0 24px; }

/* ---------- статус подписки ---------- */

.status-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.pill {
  font-family: var(--mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 100px;
}
.pill-ok { background: var(--ok-deep); color: var(--ok); }
.pill-warn { background: var(--warn-deep); color: var(--warn); }
.pill-crit { background: var(--crit-deep); color: var(--crit); }
.pill-mute { background: var(--surface-2); color: var(--muted); }

.big-date { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 5vw, 36px); letter-spacing: -.03em; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 20px; }
.fact { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.fact .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.fact .v { font-size: 19px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ---------- ссылка подписки ---------- */

.link-box { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.link-box input {
  flex: 1 1 260px; min-width: 0;
  background: var(--ground); border: 1px solid var(--line-2); border-radius: 10px;
  color: var(--ink-2); font-family: var(--mono); font-size: 12.5px; padding: 11px 13px;
}
.link-box input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- тарифы ---------- */

.period { display: inline-flex; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; }
.period button { font-family: var(--body); font-size: 14px; color: var(--ink-2); background: transparent; border: none; padding: 8px 14px; border-radius: 8px; cursor: pointer; }
.period button[aria-pressed="true"] { background: var(--accent); color: #051020; font-weight: 600; }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }

.plan {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; display: flex; flex-direction: column; gap: 12px; cursor: pointer;
  transition: border-color .15s ease;
}
.plan:hover { border-color: var(--line-2); }
.plan[aria-selected="true"] { border-color: var(--accent); background: linear-gradient(180deg, rgba(76,154,255,.07), var(--surface-2)); }
.plan h3 { font-family: var(--display); font-weight: 600; font-size: 18px; margin: 0; letter-spacing: -.02em; }
.plan .price { display: flex; align-items: baseline; gap: 6px; }
.plan .price .p { font-family: var(--display); font-weight: 700; font-size: 30px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.plan .price .cur { color: var(--muted); font-size: 14px; }
.plan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 14.5px; color: var(--ink-2); }
.plan ul li { display: grid; grid-template-columns: 16px 1fr; gap: 8px; align-items: start; }
.plan ul li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-top: 8px; margin-left: 5px; }

/* ---------- служебное ---------- */

.note { font-size: 14px; color: var(--muted); }
.note-warn { background: var(--warn-deep); border: 1px solid #4A3A1C; color: var(--warn); border-radius: 10px; padding: 12px 15px; font-size: 14.5px; }
.note-crit { background: var(--crit-deep); border: 1px solid #4C231D; color: var(--crit); border-radius: 10px; padding: 12px 15px; font-size: 14.5px; }

.skeleton { background: var(--surface-2); border-radius: 8px; height: 1em; animation: sk 1.4s ease-in-out infinite; }
@keyframes sk { 0%,100% { opacity: .45; } 50% { opacity: .8; } }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field label { font-size: 14px; color: var(--ink-2); }
.field input {
  background: var(--ground); border: 1px solid var(--line-2); border-radius: 10px;
  color: var(--ink); font-family: var(--body); font-size: 15px; padding: 12px 14px;
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

footer.bot { border-top: 1px solid var(--line); padding: 22px 0 40px; color: var(--muted); font-size: 14px; }
.bot-in { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.bot-in a:hover { color: var(--accent); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ok-deep); color: var(--ok); border: 1px solid #1D4F3A;
  padding: 11px 20px; border-radius: 100px; font-size: 14.5px;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.toast.show { opacity: 1; }

/* ==========================================================================
   Кабинет 2.0 — состояние, подключение устройств, скидка всплывающим окном
   ========================================================================== */

body {
  background:
    radial-gradient(900px 520px at 50% -220px, rgba(76,154,255,.10), transparent 70%),
    var(--ground);
  background-attachment: fixed;
}

/* ---------- герой состояния ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(165deg, var(--surface-2), var(--surface) 55%);
}
.hero::after {
  content: ""; position: absolute; inset: -40% -30% auto auto;
  width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(76,154,255,.16), transparent 65%);
  pointer-events: none;
}
.hero.is-warn::after { background: radial-gradient(circle, rgba(224,164,88,.16), transparent 65%); }
.hero.is-crit::after { background: radial-gradient(circle, rgba(232,112,95,.18), transparent 65%); }

.hero-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; position: relative; }
.hero-top .tariff {
  margin-left: auto; font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: 100px; padding: 4px 11px;
}

.clock { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; position: relative; }
.clock .num {
  font-family: var(--display); font-weight: 700; letter-spacing: -.04em;
  font-size: clamp(38px, 9vw, 58px); line-height: .95; font-variant-numeric: tabular-nums;
}
.clock .unit { font-family: var(--display); font-weight: 600; font-size: clamp(15px, 3vw, 19px); color: var(--ink-2); padding-bottom: 6px; }
.clock .num.sm { font-size: clamp(26px, 6vw, 34px); }
.hero.is-warn .clock .num { color: var(--warn); }
.hero.is-crit .clock .num { color: var(--crit); }

.until { color: var(--muted); font-size: 14.5px; margin-top: 8px; font-variant-numeric: tabular-nums; position: relative; }

.bar { height: 7px; border-radius: 100px; background: var(--ground); border: 1px solid var(--line); overflow: hidden; margin-top: 20px; position: relative; }
.bar > i { display: block; height: 100%; border-radius: 100px; background: linear-gradient(90deg, var(--accent), #7FBBFF); transition: width .5s ease; }
.hero.is-warn .bar > i { background: linear-gradient(90deg, var(--warn), #F0C68B); }
.hero.is-crit .bar > i { background: linear-gradient(90deg, var(--crit), #F09A8C); }
.bar-legend { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 8px; position: relative; }

/* ---------- вкладки платформ ---------- */

.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px; margin: 0 0 18px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 0 0 auto; font-family: var(--body); font-size: 14px; color: var(--ink-2);
  background: transparent; border: none; padding: 9px 15px; border-radius: 9px;
  cursor: pointer; white-space: nowrap; transition: background .15s ease, color .15s ease;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--accent); color: #051020; font-weight: 600; }

/* ---------- приложения ---------- */

.apps { display: flex; flex-direction: column; gap: 10px; }

.app {
  display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 14px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px;
  padding: 13px 15px; transition: border-color .15s ease;
}
.app:hover { border-color: var(--line-2); }
.app.best { border-color: rgba(76,154,255,.45); background: linear-gradient(180deg, rgba(76,154,255,.08), var(--surface-2)); }
.app .logo {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  background: var(--ground); border: 1px solid var(--line-2);
  font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--accent);
}
.app .nm { font-weight: 600; font-size: 15.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.app .ds { font-size: 13px; color: var(--muted); margin-top: 2px; }
.app .go { display: flex; gap: 8px; align-items: center; }
.tag {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase;
  background: var(--accent-deep); color: var(--accent); border-radius: 100px; padding: 3px 8px;
}
@media (max-width: 560px) {
  .app { grid-template-columns: 38px 1fr; }
  .app .logo { width: 38px; height: 38px; font-size: 15px; }
  .app .go { grid-column: 1 / -1; }
  .app .go .btn { flex: 1 1 0; }
}

.steps { counter-reset: s; display: flex; flex-direction: column; gap: 9px; margin: 0 0 18px; padding: 0; list-style: none; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 14.5px; color: var(--ink-2); }
.steps li::before {
  content: counter(s); width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--muted);
  font-family: var(--mono); font-size: 11px; display: grid; place-items: center;
}

/* ---------- ссылка и QR ---------- */

.disclose { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
.disclose summary { cursor: pointer; color: var(--ink-2); font-size: 14.5px; list-style: none; display: flex; align-items: center; gap: 8px; }
.disclose summary::-webkit-details-marker { display: none; }
.disclose summary::before { content: "+"; font-family: var(--mono); color: var(--muted); }
.disclose[open] summary::before { content: "\2212"; }
.disclose summary:hover { color: var(--accent); }
.disclose .in { padding-top: 14px; }

.qr-wrap { display: flex; justify-content: center; margin-top: 16px; }
.qr { background: #fff; padding: 12px; border-radius: 12px; line-height: 0; box-shadow: 0 8px 30px rgba(0,0,0,.35); }
.qr canvas { display: block; width: 200px; height: 200px; image-rendering: pixelated; }

/* ---------- устройства ---------- */

.devs { display: flex; flex-direction: column; gap: 9px; }
.dev {
  display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 13px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.dev .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--ground); border: 1px solid var(--line-2); font-size: 17px; }
.dev .nm { font-weight: 500; font-size: 15px; word-break: break-word; }
.dev .ds { font-size: 12.5px; color: var(--muted); margin-top: 1px; font-family: var(--mono); }
.dev .when { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: right; white-space: nowrap; }
@media (max-width: 560px) { .dev { grid-template-columns: 34px 1fr; } .dev .when { grid-column: 2; text-align: left; margin-top: 3px; } }

.empty { text-align: center; color: var(--muted); font-size: 14.5px; padding: 20px 12px; border: 1px dashed var(--line-2); border-radius: 12px; }

.meter { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.meter .bar { flex: 1; margin-top: 0; }
.meter .cnt { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- скидка: баннер и всплывающее окно ---------- */

.promo-strip {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; width: 100%; text-align: left;
  background: linear-gradient(135deg, rgba(70,192,139,.14), rgba(76,154,255,.10));
  border: 1px solid rgba(70,192,139,.35); border-radius: 14px;
  padding: 14px 18px; margin-bottom: 16px; cursor: pointer; font-family: var(--body); color: var(--ink);
}
.promo-strip:hover { border-color: rgba(70,192,139,.6); }
.promo-strip .pc { font-family: var(--display); font-weight: 700; font-size: 24px; color: var(--ok); letter-spacing: -.03em; }
.promo-strip .tx { font-size: 14.5px; }
.promo-strip .tx b { font-variant-numeric: tabular-nums; }
.promo-strip .arrow { margin-left: auto; color: var(--ok); font-size: 19px; }

.overlay {
  position: fixed; inset: 0; z-index: 60; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(5,8,12,.72); backdrop-filter: blur(6px);
}
.overlay.show { display: flex; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.modal {
  width: min(430px, 100%); background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 20px; padding: clamp(22px, 5vw, 30px); position: relative; text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: pop .22s cubic-bezier(.2,.9,.3,1.2);
  max-height: calc(100vh - 40px); overflow-y: auto;
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97) } to { opacity: 1; transform: none } }
.modal .x {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%;
  background: transparent; border: none; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1;
}
.modal .x:hover { color: var(--ink); background: var(--surface-2); }
.modal h2 { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -.03em; margin: 0 0 10px; }
.modal p { color: var(--ink-2); font-size: 15px; margin: 0 0 18px; }
.modal .gift { font-size: 40px; line-height: 1; margin-bottom: 10px; }
.modal .huge {
  font-family: var(--display); font-weight: 700; font-size: clamp(46px, 13vw, 64px);
  letter-spacing: -.05em; line-height: 1; color: var(--ok); margin: 2px 0 12px;
}
.modal .timer {
  font-family: var(--mono); font-size: 12.5px; color: var(--warn);
  background: var(--warn-deep); border-radius: 100px; padding: 6px 13px; display: inline-block; margin-bottom: 18px;
}
.modal .later { display: block; width: 100%; text-align: center; margin-top: 12px; background: none; border: none; color: var(--muted); font-family: var(--body); font-size: 14px; cursor: pointer; padding: 8px; }
.modal .later:hover { color: var(--ink-2); }

/* ссылки установки внутри строки приложения */
.app .ds a { color: var(--ink-2); border-bottom: 1px dashed var(--line-2); }
.app .ds a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.app .ds .dot-sep { color: var(--line-2); margin: 0 6px; }

/* кнопки в строке устройства */
.dev .when { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.dev .when .btn { padding: 6px 11px; font-size: 13px; }
@media (max-width: 560px) { .dev .when { justify-content: flex-start; margin-top: 8px; } }

/* ==========================================================================
   Правки по замечаниям: белые кнопки, сворачиваемые разделы, плотный герой
   ========================================================================== */

/* У <button> фон по умолчанию системный (светлая плашка) — из-за этого
   «призрачные» кнопки выглядели белыми прямоугольниками. */
.btn { background: transparent; }
.btn-solid { background: var(--accent); }

/* На узком экране две плитки влезают в ряд, если порог ниже. */
.facts { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 12px; }

/* Кнопка продления живёт в карточке подписки — сразу под трафиком. */
.hero-cta { margin-top: 18px; position: relative; }

/* Полоса скидки: процент, текст и стрелка в одну сетку. */
.promo-strip { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.promo-strip .tx { line-height: 1.4; }

/* ---------- приложение: крупные кнопки вместо мелких ссылок ---------- */

.app { display: block; padding: 15px 16px; }
.app-top { display: flex; align-items: center; gap: 13px; margin-bottom: 13px; }
.app .go { display: flex; gap: 9px; flex-wrap: wrap; }
.app .go .btn { flex: 1 1 150px; padding: 12px 16px; font-size: 15px; }
@media (max-width: 560px) { .app .go .btn { flex: 1 1 100%; } }

/* ---------- сворачиваемые разделы ---------- */

.fold { padding: 0; }
.fold > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px;
  padding: clamp(16px, 3vw, 22px) clamp(18px, 3vw, 26px);
  border-radius: 16px;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary:hover { background: rgba(255,255,255,.02); }
.fold > summary h2 {
  font-family: var(--display); font-weight: 600; font-size: 19px;
  letter-spacing: -.02em; margin: 0;
}
.fold > summary .hint { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-left: auto; }
.fold > summary .chev {
  color: var(--muted); font-size: 18px; line-height: 1; transition: transform .18s ease;
  width: 22px; height: 22px; display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: 50%;
}
.fold[open] > summary .chev { transform: rotate(90deg); color: var(--accent); }
.fold[open] > summary { border-radius: 16px 16px 0 0; }
.fold-body { padding: 0 clamp(18px, 3vw, 26px) clamp(18px, 3vw, 26px); }

/* ---------- выравнивание по базовой линии ---------- */

/* Цифры и подписи «ч»/«мин» должны стоять на одной линии: при выравнивании
   по низу коробок подписи разъезжались по высоте. */
.clock { align-items: baseline; gap: 8px; }
.clock .unit { padding-bottom: 0; }
.clock .num.sm { margin-left: 4px; }

/* Полоса скидки: заголовок и срок в две строки, процент — якорь слева. */
.promo-strip .tx b { display: block; font-weight: 600; font-size: 15px; }
.promo-strip .tx i { display: block; font-style: normal; font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.promo-strip .pc { font-size: 27px; line-height: 1; }
.promo-strip .arrow { line-height: 1; }

/* Подпись в шапке сворачиваемого раздела не должна налезать на заголовок. */
.fold > summary .hint { white-space: nowrap; }

/* Клик по шапке раздела не должен выделять её текст. */
.fold > summary { -webkit-user-select: none; user-select: none; }

/* Кнопки установки по две в ряд, «Добавить подписку» — во всю ширину. */
.app .go .btn { flex: 1 1 calc(50% - 5px); }
.app .go .add-link { flex: 1 1 100%; }
@media (max-width: 560px) { .app .go .btn { flex: 1 1 calc(50% - 5px); } }

/* Вторая строка описания устройства — компактнее. */
.dev .ds + .ds { margin-top: 1px; }

/* Скрытые до кнопки «ещё» приложения. */
.app.extra { display: none; }

/* ---------- ключи подключения ---------- */

.keys-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 12px; }
.keys-actions .btn { flex: 1 1 160px; }

.keys-search {
  width: 100%; background: var(--ground); border: 1px solid var(--line-2); border-radius: 10px;
  color: var(--ink); font-family: var(--body); font-size: 15px; padding: 11px 14px; margin-bottom: 12px;
}
.keys-search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.keys-list {
  max-height: 380px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
  padding-right: 4px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.keys-list::-webkit-scrollbar { width: 6px; }
.keys-list::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 100px; }

.key {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 12px 11px 15px;
}
.key:hover { border-color: var(--line-2); }
.key .kn {
  font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kbtn {
  width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto;
  background: transparent; border: 1px solid var(--line-2); border-radius: 9px;
  color: var(--ink-2); cursor: pointer; transition: color .15s ease, border-color .15s ease;
}
.kbtn:hover { color: var(--accent); border-color: var(--accent); }

/* Узкий телефон: заголовок раздела должен помещаться в строку. */
@media (max-width: 420px) { .fold > summary h2 { font-size: 17px; } }

/* Длинное название не должно залезать под крестик. */
.modal h2 { padding-right: 30px; }

:root { color-scheme:dark; }
@media(prefers-color-scheme:light) {
 :root { color-scheme:light; --ground:#f5f7fc; --surface:#fff; --surface-2:#eef2f9; --ink:#1a2940; --ink-2:#475b73; --muted:#60728a; --line:#dde5f0; --line-2:#c5d3e5; --accent:#315ed5; --accent-deep:#e8eefc; --ok:#127b52; --ok-deep:#e5f4ed; --warn:#8b5d13; --warn-deep:#fcf2df; --crit:#b63e31; --crit-deep:#fcebe7; }
 header.top { background:rgba(255,255,255,.92); }
 .card { box-shadow:0 8px 32px rgba(27,52,97,.05); }
 .btn-solid { color:#fff; }
 .btn-solid:hover:not(:disabled) { background:#254cba; }
}

@media(prefers-color-scheme:light) { .period button[aria-pressed="true"],.tabs button[aria-selected="true"] { color:#fff; } .note-warn,.note-crit,.status { border-color:var(--line-2); } }
