/* Bloom — кабинет провайдера. Без фреймворков: CSS-переменные, светлая/тёмная тема. */

/* Палитра — токены приложения Bloom (App/UI/Theme.swift): бирюзовый акцент, серо-бирюзовый фон. */
:root {
  --bg: #eaeff1;
  --surface: #ffffff;
  --surface-2: #f3f6f7;
  --surface-3: #e3eaed;
  --border: rgba(18, 26, 28, 0.09);
  --border-strong: rgba(18, 26, 28, 0.17);
  --text: #121a1c;
  --text-2: #4e6167;
  --text-3: #5f7379;
  --brand: #147684;
  --brand-hover: #0e5761;
  --on-brand: #ffffff;
  --brand-soft: rgba(20, 118, 132, 0.1);
  /* Заливка крупных плашек (на ней всегда белый текст) и градиент заголовка. */
  --brand-grad: linear-gradient(135deg, #0a3a41 0%, #0e5761 45%, #147684 100%);
  --brand-grad-text: linear-gradient(120deg, #0e5761 0%, #147684 45%, #2196a7 100%);
  --brand-glow: rgba(33, 150, 167, 0.55);
  --ok: #0c7d48;
  --ok-soft: rgba(12, 125, 72, 0.11);
  --warn: #ae4e1a;
  --warn-soft: rgba(230, 115, 57, 0.14);
  --danger: #ba2b2e;
  --danger-soft: rgba(226, 73, 71, 0.11);
  --info: #1f6fb5;
  --info-soft: rgba(31, 111, 181, 0.1);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(18, 26, 28, 0.06);
  --shadow: 0 1px 2px rgba(18, 26, 28, 0.04), 0 8px 28px -10px rgba(18, 26, 28, 0.13);
  --shadow-lg: 0 30px 80px -24px rgba(10, 58, 65, 0.38);
  --focus: 0 0 0 4px rgba(33, 150, 167, 0.3);
  --focus-ring: #2196a7;
  --topbar: rgba(234, 239, 241, 0.8);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121a1c;
    --surface: #1e282c;
    --surface-2: #26323a;
    --surface-3: #38484d;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #f4f7f9;
    --text-2: #9fb2b8;
    --text-3: #8fa3a9;
    --brand: #6dd6e8;
    --brand-hover: #8fe0ee;
    --on-brand: #121a1c;
    --brand-soft: rgba(109, 214, 232, 0.14);
    --brand-grad-text: linear-gradient(120deg, #6dd6e8 0%, #2db8cc 55%, #b9e8f0 100%);
    --brand-glow: rgba(45, 184, 204, 0.4);
    --ok: #3cc078;
    --ok-soft: rgba(60, 192, 120, 0.14);
    --warn: #fc9b6f;
    --warn-soft: rgba(252, 155, 111, 0.14);
    --danger: #f97770;
    --danger-soft: rgba(249, 119, 112, 0.14);
    --info: #7cb8ee;
    --info-soft: rgba(124, 184, 238, 0.14);
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 30px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
    --focus: 0 0 0 4px rgba(45, 184, 204, 0.35);
    --focus-ring: #2db8cc;
    --topbar: rgba(18, 26, 28, 0.76);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font: 15px/1.55 var(--font);
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 0% -10%, rgba(33, 150, 167, 0.13), transparent 60%),
    radial-gradient(900px 480px at 100% -5%, rgba(109, 214, 232, 0.1), transparent 60%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
/* Видимый фокус с клавиатуры у всего, на что можно попасть Tab-ом. */
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 6px; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; line-height: 1.2; margin: 0; }
h1 { font-size: clamp(26px, 3.2vw, 34px); font-weight: 750; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 0.9em; }
code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.center { text-align: center; }
.only-sheet { display: none !important; }
@media (min-width: 1040px) { .only-narrow { display: none !important; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 15px; height: 15px; }
.link-icon { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; flex: 1; }
@media (min-width: 640px) { .container { padding: 0 24px; } }
main.container { padding-top: 28px; padding-bottom: 56px; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--topbar);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner {
  max-width: 1160px; margin: 0 auto; padding: 0 16px;
  min-height: 62px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
@media (min-width: 640px) { .topbar__inner { padding: 0 24px; } }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 750; font-size: 17px; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand .logo-mark { width: 30px; height: 28px; fill: var(--brand); }
.brand__tag { font-weight: 550; font-size: 13px; color: var(--text-3); letter-spacing: 0; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  color: var(--text-2); font-weight: 550; font-size: 14px;
  padding: 8px 12px; border-radius: 10px; white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a.is-active { color: var(--text); background: var(--surface); box-shadow: var(--shadow-sm); border: 1px solid var(--border); padding: 7px 11px; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar__user { font-size: 13px; color: var(--text-3); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .topbar__user { display: none; }
  .nav { order: 3; width: 100%; margin: 0 -4px 8px; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .brand__tag { display: none; }
}

.footer { border-top: 1px solid var(--border); color: var(--text-3); font-size: 13px; }
.footer__inner { max-width: 1160px; margin: 0 auto; padding: 22px 16px; display: flex; gap: 12px 24px; justify-content: space-between; flex-wrap: wrap; }
.footer__links { display: flex; gap: 8px 20px; flex-wrap: wrap; }
.footer__links a { color: var(--text-2); }
.footer__links a:hover, .footer__links a[aria-current] { color: var(--text); }
@media (min-width: 640px) { .footer__inner { padding: 22px 24px; } }

.page-head { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { margin-top: 6px; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-2); margin-bottom: 8px; }

.grid-2 { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.stack { display: grid; gap: 20px; align-content: start; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px;
  min-width: 0;
}
@media (min-width: 640px) { .card { padding: 26px; } }
.card > h2 + p, .section-head p { margin-top: 6px; }
.card > h2 { margin-bottom: 4px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
section.card + section.card, .card + .card { margin-top: 0; }
.mt { margin-top: 20px; }
.mt-sm { margin-top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px;
  border-radius: 12px; border: 1px solid transparent;
  font: 600 14px/1 var(--font); letter-spacing: -0.005em;
  cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background 0.15s, box-shadow 0.15s, transform 0.05s, color 0.15s, border-color 0.15s;
  color: var(--text); background: var(--surface-2);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn--primary {
  color: var(--on-brand); background: var(--brand);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 6px 18px -8px var(--brand-glow);
}
.btn--primary:hover { background-color: var(--brand-hover); }
.btn--secondary { background: var(--surface); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--surface-2); }
.btn--ghost { background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--danger { background: var(--danger-soft); color: var(--danger); }
.btn--danger:hover { background: var(--danger); color: #fff; }
.btn--ok { background: var(--ok-soft); color: var(--ok); }
.btn--ok:hover { background: var(--ok); color: #fff; }
.btn--sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn--lg { height: 50px; padding: 0 24px; font-size: 15px; border-radius: 14px; }
.btn--icon { width: 38px; height: 38px; padding: 0; border-radius: 10px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
form.inline { display: inline; margin: 0; }

/* ---------- Forms ---------- */
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.field { display: grid; gap: 7px; min-width: 0; }
.field + .field, .field-row + .field, .field + .field-row, .field-row + .field-row { margin-top: 16px; }
.field-row { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
.field-row > .field + .field { margin-top: 0; }
.field label, .label { font-weight: 600; font-size: 13.5px; color: var(--text); }
.field__top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.field__hint { font-size: 12.5px; color: var(--text-3); }
.field__error { font-size: 12.5px; color: var(--danger); font-weight: 550; }
.counter { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.counter.is-over { color: var(--danger); font-weight: 650; }
.input {
  -webkit-appearance: none; appearance: none;
  width: 100%; min-width: 0; height: 44px; padding: 0 14px;
  font: 15px/1.4 var(--font); color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
textarea.input { height: auto; min-height: 96px; padding: 11px 14px; resize: vertical; line-height: 1.5; }
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--border-strong)); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.input:disabled, fieldset[disabled] .input { background: var(--surface-2); color: var(--text-2); cursor: default; }
.has-error .input { border-color: var(--danger); }
.has-error .input:focus { box-shadow: 0 0 0 4px var(--danger-soft); }
select.input { padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
.input-group { position: relative; }
.input-group .input { padding-right: 48px; }
.input-group__btn { position: absolute; right: 4px; top: 4px; height: 36px; width: 40px; border: 0; background: transparent; color: var(--text-3); border-radius: 9px; cursor: pointer; display: grid; place-items: center; }
.input-group__btn:hover { color: var(--text); background: var(--surface-2); }

.color-input { display: flex; gap: 8px; }
.color-input__swatch {
  -webkit-appearance: none; appearance: none; flex: none;
  width: 44px; height: 44px; padding: 3px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface);
}
.color-input__swatch::-webkit-color-swatch-wrapper { padding: 0; }
.color-input__swatch::-webkit-color-swatch { border: 0; border-radius: 8px; }
.color-input__swatch::-moz-color-swatch { border: 0; border-radius: 8px; }
fieldset[disabled] .color-input__swatch { cursor: default; opacity: 0.8; }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ---------- Badges, notes, flash ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 650; white-space: nowrap;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.9; }
.badge--plain::before { display: none; }
.badge--active, .badge--ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge--pending, .badge--warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge--suspended, .badge--danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge--info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge--brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

.flash {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; margin-bottom: 22px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow);
  animation: flash-in 0.35s ease-out;
}
.flash__icon { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.flash__body { flex: 1; min-width: 0; padding-top: 3px; }
.flash__body ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); font-size: 13.5px; }
.flash__body li + li { margin-top: 4px; }
.flash__close { border: 0; background: transparent; color: var(--text-3); cursor: pointer; padding: 4px; border-radius: 8px; }
.flash__close:hover { color: var(--text); background: var(--surface-2); }
.flash--success .flash__icon { background: var(--ok-soft); color: var(--ok); }
.flash--error .flash__icon { background: var(--danger-soft); color: var(--danger); }
.flash--info .flash__icon { background: var(--info-soft); color: var(--info); }
.flash--error { border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); }
@keyframes flash-in { from { transform: translateY(-6px); } to { transform: none; } }

.note { padding: 12px 14px; border-radius: 12px; font-size: 13.5px; background: var(--surface-2); color: var(--text-2); }
.note--info { background: var(--info-soft); color: var(--text); }
.note--warn { background: var(--warn-soft); color: var(--text); }
.note--ok { background: var(--ok-soft); color: var(--text); }
/* Предупреждение администратору о настройке сервера: заметное, на каждой странице. */
.sysnote { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 22px; border-radius: var(--radius); background: var(--warn-soft); border: 1.5px solid var(--warn); }
.sysnote__icon { width: 28px; height: 28px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--warn); color: var(--surface); }
.sysnote strong { display: block; }
.sysnote p { margin-top: 4px; font-size: 13.5px; color: var(--text-2); }

/* ---------- Dashboard ---------- */
.live {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; margin-bottom: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.live__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--warn); flex: none; box-shadow: 0 0 0 5px var(--warn-soft); }
.live.is-live { background: linear-gradient(90deg, var(--ok-soft), transparent 70%), var(--surface); }
.live.is-live .live__dot { background: var(--ok); box-shadow: 0 0 0 5px var(--ok-soft); animation: pulse 2s infinite; }
.live strong { display: block; font-size: 15px; }
.live span { font-size: 13.5px; color: var(--text-2); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 4px var(--ok-soft); } 50% { box-shadow: 0 0 0 9px transparent; } }

.stats { display: grid; gap: 16px; grid-template-columns: 1fr; margin-bottom: 20px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(3, 1fr); } }
.stats--4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .stats--4 { grid-template-columns: repeat(4, 1fr); } }
.stat { display: grid; gap: 8px; align-content: start; padding: 20px 22px; }
.stat__label { font-size: 13px; color: var(--text-3); font-weight: 600; }
.stat__value { font-family: var(--font-display); font-size: 22px; font-weight: 720; letter-spacing: -0.02em; }
.stat__sub { font-size: 13px; color: var(--text-2); }
.stat .badge { justify-self: start; max-width: 100%; }
/* Узкая карточка (две в ряд на телефоне): «Ожидает активации» переносится, а не вылезает за край. */
@media (max-width: 480px) { .stat .badge { white-space: normal; height: auto; min-height: 26px; padding-top: 3px; padding-bottom: 3px; line-height: 1.3; border-radius: 12px; } }

.checklist { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 4px; }
.checklist li { display: flex; gap: 12px; padding: 10px 0; }
.checklist li + li { border-top: 1px dashed var(--border); }
.checklist__icon {
  width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center;
  border: 2px solid var(--border-strong); color: #fff; margin-top: 1px;
}
.checklist li.is-done .checklist__icon { background: var(--ok); border-color: var(--ok); }
.checklist li.is-done strong { color: var(--text-2); font-weight: 600; }
.checklist strong { font-weight: 650; font-size: 14.5px; }
.checklist p { font-size: 13.5px; color: var(--text-2); margin-top: 2px; }

.code {
  margin: 12px 0; padding: 14px 16px; border-radius: 12px; overflow-x: auto;
  font: 13px/1.6 var(--mono); background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  white-space: pre;
}
.code--wrap { white-space: pre-wrap; word-break: break-all; }

.add-host { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.add-host .input { flex: 1 1 240px; }
.empty {
  text-align: center; padding: 34px 16px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
  color: var(--text-2);
}
.empty .empty__icon { width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.empty strong { display: block; color: var(--text); margin-bottom: 4px; }

.hosts { display: grid; gap: 14px; }
.host { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--surface); scroll-margin-top: 90px; }
.host:target { border-color: var(--brand); box-shadow: var(--focus); }
.host.is-verified { background: linear-gradient(180deg, var(--ok-soft), transparent 80px), var(--surface); }
.host__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.host__name { display: flex; align-items: center; gap: 8px; font-size: 15.5px; min-width: 0; margin-right: auto; }
.host__name strong { overflow-wrap: anywhere; }
.host__name .icon { color: var(--text-3); }
.host__meta { margin-top: 8px; font-size: 13.5px; color: var(--text-2); }
.methods { display: grid; gap: 12px; margin-top: 14px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .methods { grid-template-columns: 1fr 1fr; } }
.method { background: var(--surface-2); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.method h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.method > p { font-size: 13.5px; color: var(--text-2); margin-bottom: 10px; }
.method__num { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 750; }
.kv { margin: 0; display: grid; gap: 6px; }
.kv > div { display: grid; grid-template-columns: 74px 1fr; gap: 10px; align-items: center; }
@media (max-width: 480px) { .kv > div { grid-template-columns: 1fr; gap: 4px; } }
.kv dt { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.kv dd { margin: 0; display: flex; align-items: center; gap: 6px; min-width: 0; }
.kv code, .codeline code { background: var(--surface); flex: 1; min-width: 0; padding: 6px 9px; font-size: 12.5px; }
.codeline { display: flex; align-items: center; gap: 6px; }
.copy {
  flex: none; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border); cursor: pointer;
  background: var(--surface); color: var(--text-2); display: grid; place-items: center; transition: 0.15s;
}
.copy:hover { color: var(--brand); border-color: var(--brand); }
.copy.is-copied { color: var(--ok); border-color: var(--ok); }
.verify { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.verify .input { flex: 1 1 260px; }

/* ---------- Tables (admin) ---------- */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.tabs { display: inline-flex; padding: 4px; gap: 2px; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--border); overflow-x: auto; max-width: 100%; }
.tabs a, .tabs button {
  padding: 7px 12px; border-radius: 9px; font: 600 13px/1.2 var(--font); color: var(--text-2);
  white-space: nowrap; border: 0; background: transparent; cursor: pointer;
}
.tabs a:hover, .tabs button:hover { color: var(--text); text-decoration: none; }
.tabs .is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tabs .count { color: var(--text-3); font-weight: 600; margin-left: 4px; }
.search { display: flex; gap: 8px; flex: 1 1 260px; max-width: 420px; }
.search .input { height: 40px; }

.table-wrap { overflow-x: auto; margin: 0 -22px -22px; }
@media (min-width: 640px) { .table-wrap { margin: 0 -26px -26px; } }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
@media (min-width: 640px) { .table th:first-child, .table td:first-child { padding-left: 26px; } .table th:last-child, .table td:last-child { padding-right: 26px; } }
.table tbody tr { transition: background 0.1s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .who { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.table .who a { color: var(--text); font-weight: 650; }
.table .who small { display: block; color: var(--text-3); font-size: 12.5px; }
.table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .nowrap { white-space: nowrap; }
.table .details { color: var(--text-2); max-width: 520px; overflow-wrap: anywhere; }
.avatar {
  width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center;
  background: var(--brand-grad); color: #fff; font-weight: 750; font-size: 15px; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--lg { width: 56px; height: 56px; border-radius: 16px; font-size: 22px; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 12px; }

.dl { display: grid; gap: 10px; margin: 16px 0 0; }
.dl > div { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); font-size: 14px; }
.dl > div:last-child { border-bottom: 0; padding-bottom: 0; }
.dl dt { color: var(--text-2); }
.dl dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.divider { height: 1px; background: var(--border); margin: 20px 0; border: 0; }

.admin-hosts { display: grid; gap: 10px; margin-top: 14px; }
.admin-host { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.admin-host strong { margin-right: auto; overflow-wrap: anywhere; }
.admin-host small { display: block; color: var(--text-3); font-weight: 500; }
.admin-host__url { overflow-wrap: anywhere; }
/* Одноразовая ссылка и опасные действия на странице провайдера. */
.onetime { padding: 14px 16px; border-radius: 14px; background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.onetime p { font-size: 13.5px; color: var(--text-2); margin-top: 4px; }
.onetime .codeline code { user-select: all; }
.danger-zone { margin-top: 22px; padding: 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); background: var(--danger-soft); }
.danger-zone h3 { color: var(--danger); }
.danger-zone p { font-size: 13.5px; color: var(--text-2); margin: 4px 0 12px; }
.danger-zone .input { flex: 1 1 220px; }
.card > h2 .icon, .section-head h2 .icon { vertical-align: -3px; margin-right: 4px; color: var(--brand); display: inline-block; }

/* ---------- Auth ---------- */
.auth { display: grid; gap: 24px; align-items: stretch; max-width: 980px; margin: 12px auto 0; grid-template-columns: 1fr; }
@media (min-width: 900px) { .auth { grid-template-columns: 1.05fr 1fr; margin-top: 32px; } }
.auth--single { max-width: 440px; }
@media (min-width: 900px) { .auth--single { grid-template-columns: 1fr; } }
.auth__card { padding: 30px; }
@media (min-width: 640px) { .auth__card { padding: 38px; } }
.auth__card h1 { font-size: 27px; }
.auth__card > p { margin: 8px 0 24px; color: var(--text-2); }
.auth__card form .btn--block { margin-top: 22px; }
.auth__alt { margin-top: 20px; text-align: center; font-size: 14px; color: var(--text-2); }
.auth__alt--minor { margin-top: 10px; font-size: 13px; color: var(--text-3); }
.auth__aside {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 34px; color: #fff;
  background: var(--brand-grad); box-shadow: var(--shadow-lg); display: none;
}
@media (min-width: 900px) { .auth__aside { display: block; } }
.auth__aside::after { content: ""; position: absolute; width: 420px; height: 420px; right: -160px; bottom: -180px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); }
.auth__aside h2 { font-size: 24px; color: #fff; }
.auth__aside p { margin-top: 10px; opacity: 0.9; }
.auth__aside ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 14px; position: relative; z-index: 1; }
.auth__aside li { display: flex; gap: 12px; align-items: flex-start; }
.auth__aside li .icon { width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: rgba(255, 255, 255, 0.18); }
.form-error { padding: 11px 14px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-size: 14px; font-weight: 550; margin-bottom: 16px; }

/* ---------- Landing ---------- */
.hero { display: grid; gap: 40px; align-items: center; grid-template-columns: 1fr; padding: 8px 0 24px; }
@media (min-width: 960px) { .hero { grid-template-columns: 1.1fr 0.9fr; padding: 28px 0 40px; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 650; }
.hero h1 { font-size: clamp(34px, 5.4vw, 58px); line-height: 1.04; letter-spacing: -0.035em; margin-top: 18px; font-weight: 800; }
.grad { background: var(--brand-grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(16px, 1.6vw, 18.5px); color: var(--text-2); margin-top: 18px; max-width: 560px; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero__points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; color: var(--text-2); font-size: 14.5px; }
.hero__points li { display: flex; gap: 10px; align-items: center; }
.hero__points .icon { color: var(--ok); }
.hero__preview { display: grid; gap: 14px; justify-items: center; position: relative; }
.hero__preview > * { position: relative; }
.hero__preview::before { content: ""; position: absolute; inset: 10% 5%; background: linear-gradient(135deg, #2196a7, #6dd6e8); filter: blur(70px); opacity: 0.26; border-radius: 50%; pointer-events: none; }

.section { margin-top: 64px; }
.section__head { max-width: 640px; margin-bottom: 26px; }
.section__head p { margin-top: 10px; color: var(--text-2); font-size: 16px; }
.section__head h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 760; }
.features { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .features { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .features { grid-template-columns: repeat(4, 1fr); } }
.feature .feature__icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 14px; }
.feature p { color: var(--text-2); font-size: 14px; margin-top: 6px; }
@media (min-width: 1000px) { .features--3 { grid-template-columns: repeat(3, 1fr); } }
.feature p a { text-decoration: underline; text-underline-offset: 3px; }
.free-band { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.free-band > div:nth-child(2) { flex: 1 1 320px; min-width: 0; }
.free-band h2 { font-size: 20px; }
.free-band p { margin-top: 6px; color: var(--text-2); font-size: 14.5px; }
.free-band__icon { width: 46px; height: 46px; border-radius: 14px; flex: none; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.steps { display: grid; gap: 16px; grid-template-columns: 1fr; counter-reset: step; }
@media (min-width: 800px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step { position: relative; }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--brand-grad); color: #fff; font-weight: 800; margin-bottom: 14px; }
.step p { color: var(--text-2); font-size: 14px; margin-top: 6px; }
.cta-band {
  margin-top: 64px; padding: 36px; border-radius: var(--radius-lg); color: #fff; background: var(--brand-grad);
  display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; box-shadow: var(--shadow-lg);
}
.cta-band h2 { color: #fff; font-size: 26px; }
.cta-band p { opacity: 0.9; margin-top: 6px; }
.cta-band .btn { background: #fff; color: #0e5761; box-shadow: none; }

/* ---------- Branding editor ---------- */
.editor { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1040px) { .editor { grid-template-columns: minmax(0, 1fr) 400px; } }
.editor__form { display: grid; gap: 20px; min-width: 0; }
.editor__form > fieldset { display: grid; gap: 20px; }
.editor__preview { display: grid; gap: 14px; justify-items: center; }
@media (min-width: 1040px) { .editor__preview { position: sticky; top: 84px; } }
/* Узкий экран: сначала форма. Предпросмотр редактора открывается кнопкой на весь экран
   (без скриптов он просто стоит после формы). */
@media (max-width: 1039px) {
  .editor__preview--sheet.is-open {
    position: fixed; inset: 0; z-index: 80; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 16px 16px 28px; align-content: start; background: var(--bg);
  }
  .editor__preview--sheet.is-open .only-sheet { display: inline-flex !important; justify-self: start; }
  /* Высота задаётся, а ширина выводится из aspect-ratio: если ограничить только max-height, рамка
     становится ниже экрана телефона, и он вылезает за неё. Не ниже 640px (ширина ~300px): у телефона
     поменьше строка состояния и подписи уже не помещаются — на низком экране лист просто прокручивается. */
  .editor__preview--sheet.is-open .phone { width: auto; height: min(735px, max(640px, calc(100vh - 210px))); height: min(735px, max(640px, calc(100dvh - 210px))); }
  html.has-sheet { overflow: hidden; }
}
@media (min-width: 1040px) { .editor__preview--sheet .phone { width: auto; height: min(735px, max(640px, calc(100vh - 250px))); } }
.form-section h2 { display: flex; align-items: center; gap: 10px; }
.form-section h2 .icon { color: var(--brand); }
.form-section > p.muted { font-size: 13.5px; margin: 6px 0 18px; }
.form-section > h2 + .field, .form-section > h2 + .field-row, .form-section > h2 + .logo-field { margin-top: 18px; }
.logo-field { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.logo-field + .field, .logo-field + .field-row { margin-top: 18px; }
.logo-field .avatar { width: 72px; height: 72px; border-radius: 20px; font-size: 30px; box-shadow: var(--shadow); }
.logo-field__controls { display: grid; gap: 8px; flex: 1; min-width: 200px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn:focus-within { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.file-btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
fieldset[disabled] .file-btn { display: none; }
.savebar {
  position: sticky; bottom: 12px; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 12px 12px 18px; border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.savebar .muted { font-size: 13px; flex: 1 1 220px; }
.savebar__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
@media (max-width: 559px) {
  /* На телефоне панель сохранения не должна закрывать пол-экрана: остаются кнопки и пометка о несохранённом. */
  .savebar { padding: 10px; }
  .savebar .savebar__state { display: none; flex-basis: 100%; }
  .savebar.is-dirty .savebar__state { display: block; font-size: 0; }
  .savebar.is-dirty .savebar__state::before { font-size: 13px; }
  .savebar__actions { width: 100%; }
  .savebar__actions .btn { flex: 1; padding: 0 12px; }
}
.savebar.is-dirty .savebar__state::before { content: "● Есть несохранённые изменения. "; color: var(--warn); font-weight: 650; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; }
.seg button { border: 0; background: transparent; padding: 6px 11px; border-radius: 8px; font: 600 12.5px/1.2 var(--font); color: var(--text-2); cursor: pointer; }
.seg button.is-active, .seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.preview-controls { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ---------- Phone preview: miniature of the Bloom Home screen (App/Screens/HomeView.swift) ----------
   Sizes are the app's points × 0.82 (a 402 pt wide screen drawn 330 px wide).
   Colours are the tokens of App/UI/Theme.swift. preview.js sets, for a provider colour, --acc (fills,
   as is), --acc-on (the label on a fill) and --acc-text (text and icons, adjusted per theme as
   ProviderAccent does); the connect ring keeps the app's own colours in every state. */
.phone {
  --ph-bg: #eaeff1; --ph-text: #121a1c; --ph-text-2: #576a70; --ph-text-3: #798d94;
  --ph-acc-default: #147684; --ph-on-acc: #ffffff; --ph-subtle: rgba(243, 250, 251, 0.82);
  --ph-glass: rgba(255, 255, 255, 0.56); --ph-glass-line: rgba(255, 255, 255, 0.85);
  --ph-bar: rgba(255, 255, 255, 0.93); --ph-sep: rgba(0, 0, 0, 0.08);
  --ph-danger: #ba2b2e; --ph-ping: #2196a7; --ph-logo: #147684;
  --ph-shadow: 0 6px 18px -8px rgba(18, 26, 28, 0.16);
  position: relative; width: 348px; max-width: 100%; aspect-ratio: 348 / 735;
  border-radius: 52px; padding: 9px; background: #0d0e12;
  box-shadow: 0 0 0 1.5px #2a2c33 inset, 0 0 0 1px rgba(255, 255, 255, 0.06), var(--shadow-lg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", var(--font);
  user-select: none; -webkit-user-select: none;
}
.phone[data-theme="dark"] {
  --ph-bg: #121a1c; --ph-text: #f4f7f9; --ph-text-2: #9fb2b8; --ph-text-3: #798d94;
  --ph-acc-default: #6dd6e8; --ph-on-acc: #121a1c; --ph-subtle: rgba(10, 35, 40, 0.9);
  --ph-glass: rgba(255, 255, 255, 0.08); --ph-glass-line: rgba(255, 255, 255, 0.11);
  --ph-bar: rgba(50, 60, 64, 0.95); --ph-sep: rgba(255, 255, 255, 0.12);
  --ph-danger: #f97770; --ph-ping: #2db8cc; --ph-logo: #6dd6e8;
  --ph-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.5);
}
.phone__screen {
  position: relative; height: 100%; border-radius: 43px; overflow: hidden; isolation: isolate;
  background: var(--ph-bg); color: var(--ph-text);
  display: flex; flex-direction: column;
}
.phone__island { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 98px; height: 28px; border-radius: 20px; background: #000; z-index: 6; }
/* AmbientBackground: мягкое бирюзовое свечение за кнопкой. */
.ph-glow { position: absolute; inset: 0 0 auto 0; height: 72%; z-index: 0; pointer-events: none; background: radial-gradient(78% 52% at 50% 40%, rgba(33, 150, 167, 0.36), rgba(33, 150, 167, 0.14) 52%, transparent 80%); }
.phone[data-theme="dark"] .ph-glow { background: radial-gradient(70% 46% at 50% 42%, rgba(45, 184, 204, 0.13), transparent 75%); }
.ph-ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* Статус-бар и шапка лежат поверх прокрутки: содержимое уходит под них, как в приложении. */
.ph-status, .ph-bar { position: absolute; left: 0; right: 0; z-index: 4; transition: background 0.25s; }
.ph-status { top: 0; display: flex; justify-content: space-between; align-items: center; padding: 14px 26px 0 32px; height: 44px; font-size: 14px; font-weight: 650; }
.ph-status__icons { display: flex; gap: 5px; align-items: center; }
.ph-status__icons svg { width: 16px; height: 11px; fill: currentColor; }
.ph-status__icons svg.ph-battery { width: 24px; }
.ph-bar { top: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 13px 6px; }
.ph-bar__btn { width: 46px; height: 36px; border-radius: 99px; display: grid; place-items: center; background: var(--ph-glass); box-shadow: inset 0 0 0 1px var(--ph-glass-line), var(--ph-shadow); }
.ph-bar__title { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; font-weight: 600; }
.ph-bar__title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phone.is-scrolled .ph-status, .phone.is-scrolled .ph-bar { background: var(--ph-bg); }
.phone.is-scrolled .ph-bar { box-shadow: 0 1px 0 var(--ph-sep); }
/* Свёрнутая шапка: появляется, когда большая кнопка ушла за край (collapsedHeader). */
.ph-mini {
  position: absolute; z-index: 3; top: 94px; left: 13px; right: 13px;
  display: flex; align-items: center; gap: 12px; padding: 9px 9px 9px 14px; border-radius: 20px;
  background: var(--ph-bar); box-shadow: inset 0 0 0 1px var(--ph-glass-line), var(--ph-shadow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  opacity: 0; transform: translateY(-10px); pointer-events: none; transition: opacity 0.25s, transform 0.25s;
}
.phone.is-scrolled .ph-mini { opacity: 1; transform: none; }
.ph-mini__text { flex: 1; min-width: 0; }
.ph-mini__title { font-size: 16px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-mini__sub { font-size: 12.5px; color: var(--ph-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-mini__power { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--ph-glass); box-shadow: inset 0 0 0 1px var(--ph-glass-line); }
.phone[data-state="expired"] .ph-mini__power { color: var(--ph-text-3); }
.ph-scroll { position: absolute; inset: 0; z-index: 1; overflow-y: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.ph-scroll::-webkit-scrollbar { display: none; }
.ph-home { padding: 90px 13px 106px; display: flex; flex-direction: column; }
.ph-title { margin-top: 22px; text-align: center; font-size: 23px; font-weight: 600; line-height: 1.22; letter-spacing: 0.01em; color: var(--ph-text-2); }
.ph-loc { margin-top: 6px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ph-text-3); }
/* Флаг примера (Нидерланды) — рисуем сами, чтобы не зависеть от эмодзи в системе. */
.ph-flag { width: 30px; height: 30px; border-radius: 50%; flex: none; background: linear-gradient(#ae1c28 0 33.4%, #fff 33.4% 66.6%, #21468b 66.6%); box-shadow: inset 0 0 0 1px var(--ph-sep); }
.ph-flag--sm { width: 13px; height: 13px; }
/* Кнопка подключения: стеклянный круг и кольцо в цветах макета (ConnectRing, палитра покоя). */
.ph-ring {
  width: 185px; height: 185px; margin: 39px auto 0; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: radial-gradient(circle at 34% 22%, #c7eff5 0%, #dff9fc 46%, #f1fefe 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9), 0 0 0 3px rgba(45, 184, 204, 0.3), 0 0 0 7px rgba(45, 184, 204, 0.1), 0 0 28px 5px rgba(45, 184, 204, 0.22), 0 12px 22px -10px rgba(18, 26, 28, 0.18);
}
.phone[data-theme="dark"] .ph-ring {
  background: radial-gradient(circle at 34% 22%, #3b474a 0%, #303b3e 55%, #293336 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 0 0 3px rgba(109, 214, 232, 0.3), 0 0 0 7px rgba(45, 184, 204, 0.1), 0 0 28px 5px rgba(45, 184, 204, 0.2);
}
.ph-ring__logo { width: 79px; height: 79px; fill: var(--ph-logo); }
.phone[data-state="expired"] .ph-ring { margin-top: 27px; }
.phone[data-state="expired"] .ph-ring__logo { display: none; }
.ph-hint { margin-top: 23px; text-align: center; font-size: 12.5px; line-height: 1.35; color: var(--ph-text-3); white-space: pre-line; overflow-wrap: anywhere; }
.ph-cta { display: flex; justify-content: center; margin-top: 16px; }
.ph-primary { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; height: 44px; padding: 0 20px; border-radius: 99px; font-size: 14px; font-weight: 600; background: var(--acc, var(--ph-acc-default)); color: var(--acc-on, var(--ph-on-acc)); box-shadow: var(--ph-shadow); }
.ph-primary span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-textlink { display: flex; align-items: center; justify-content: center; gap: 4px; height: 30px; margin-top: 8px; font-size: 12.5px; color: var(--acc-text, var(--ph-acc-default)); }
.ph-textlink .ph-ico { width: 13px; height: 13px; }
.ph-short { display: flex; justify-content: center; gap: 7px; margin-top: 20px; }
.ph-round { width: 43px; height: 43px; border-radius: 50%; display: grid; place-items: center; color: var(--acc-text, var(--ph-acc-default)); background: var(--ph-subtle); box-shadow: inset 0 0 0 1px var(--ph-glass-line), var(--ph-shadow); }
.ph-stats { display: flex; align-items: center; margin-top: 20px; }
.ph-stat { flex: 1; min-width: 0; display: grid; gap: 3px; justify-items: center; }
.ph-stat span { font-size: 12.5px; color: var(--ph-text-3); }
.ph-stat strong { font-size: 14px; font-weight: 600; color: var(--acc-text, var(--ph-acc-default)); white-space: nowrap; }
.ph-stats__sep { width: 1px; height: 20px; background: var(--ph-sep); }
.phone[data-state="expired"] .ph-stat strong[data-el="stat-date"] { color: var(--ph-danger); }
/* Карточка провайдера (Provider Info): название, логотип 28 pt справа, объявление, кнопки-капсулы. */
.ph-card { margin-top: 20px; padding: 10px 13px; border-radius: 26px; background: var(--ph-glass); box-shadow: inset 0 0 0 1px var(--ph-glass-line), var(--ph-shadow); display: grid; gap: 10px; }
.ph-card__head { display: flex; align-items: center; gap: 7px; min-height: 23px; }
.ph-card__name { flex: 1; min-width: 0; font-size: 16.5px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-logo { width: 23px; height: 23px; border-radius: 6.5px; flex: none; overflow: hidden; box-shadow: inset 0 0 0 1px var(--ph-sep); }
.ph-logo img { width: 100%; height: 100%; object-fit: cover; }
.ph-card__text { font-size: 12.5px; line-height: 1.36; color: var(--ph-text-2); white-space: pre-line; overflow-wrap: anywhere; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; }
.ph-card__more { font-size: 11px; font-weight: 600; color: var(--acc-text, var(--ph-acc-default)); }
.ph-card__empty { font-size: 12.5px; color: var(--ph-text-3); }
.ph-links { display: flex; flex-wrap: wrap; gap: 3.5px; }
.ph-link { display: inline-flex; align-items: center; gap: 3.5px; max-width: 100%; padding: 6.5px 10px; border-radius: 99px; font-size: 12.5px; color: var(--acc-text, var(--ph-acc-default)); background: var(--ph-subtle); box-shadow: inset 0 0 0 1px var(--ph-glass-line); }
.ph-link .ph-ico { width: 13px; height: 13px; }
.ph-link span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Баннер провайдера: под карточкой, текст и под ним кнопка; на светлом фоне текст и кнопка тёмные.
   --bn-label (preview.js) — подпись кнопки, если цвет баннера сливается с кнопкой. */
.ph-banner { --bn: var(--acc, var(--ph-acc-default)); margin-top: 20px; padding: 13px; border-radius: 26px; display: grid; gap: 10px; justify-items: start; color: #fff; background: var(--bn); background: linear-gradient(135deg, var(--bn), color-mix(in srgb, var(--bn) 78%, transparent)); }
.ph-banner__text { font-size: 12.5px; font-weight: 600; line-height: 1.34; white-space: pre-line; overflow-wrap: anywhere; }
.ph-banner__btn { max-width: 100%; padding: 7px 13px; border-radius: 99px; font-size: 12.5px; font-weight: 700; background: rgba(255, 255, 255, 0.95); color: var(--bn-label, var(--bn)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-banner.is-light { color: #121a1c; }
.ph-banner.is-light .ph-banner__btn { background: rgba(18, 26, 28, 0.92); }
/* Панель текущего сервера внизу (ServerBar). */
.ph-server {
  position: absolute; z-index: 5; left: 13px; right: 13px; bottom: 30px; height: 55px;
  display: flex; align-items: center; gap: 10px; padding: 0 12px 0 10px; border-radius: 28px;
  background: var(--ph-bar); box-shadow: inset 0 0 0 1px var(--ph-glass-line), 0 6px 16px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.ph-server__text { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.ph-server__text strong { font-size: 14px; font-weight: 600; }
.ph-server__text span { font-size: 12.5px; color: var(--ph-text-2); }
.ph-server__ping { font-size: 10.7px; color: var(--ph-text-3); font-variant-numeric: tabular-nums; }
.ph-bars { display: flex; gap: 3px; }
.ph-bars i { width: 5px; height: 15px; border-radius: 3px; background: var(--ph-ping); }
.ph-server__chev { margin-left: 4px; color: var(--ph-text-3); }
@media (max-width: 380px) { .phone { border-radius: 46px; } .phone__screen { border-radius: 38px; } }
.preview-note { max-width: 360px; }
/* Состояние задано в адресе (#pv-…): показываем сразу, без переходов. */
.phone.no-anim, .phone.no-anim * { transition: none !important; }

/* ---------- Public documents (privacy, licences) ---------- */
.doc { max-width: 760px; margin: 0 auto; font-size: 16px; line-height: 1.65; }
.doc__head { margin-bottom: 22px; }
.doc__head h1 { margin-top: 14px; font-size: clamp(30px, 6vw, 42px); letter-spacing: -0.03em; }
.doc__head .lead { margin-top: 12px; max-width: none; }
.doc section { margin-top: 34px; scroll-margin-top: 84px; }
.doc h2 { font-size: 22px; margin-bottom: 10px; }
.doc h3 { font-size: 16.5px; margin: 22px 0 6px; }
.doc p + p, .doc ul + p, .doc table + p, .doc .note + p, .doc pre + p { margin-top: 10px; }
.doc ul { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 8px; }
.doc p, .doc li { color: var(--text-2); overflow-wrap: anywhere; }
.doc strong { color: var(--text); }
.doc a { text-decoration: underline; text-underline-offset: 3px; }
.doc__draft { padding: 14px 16px; border-radius: var(--radius); background: var(--warn-soft); border: 1.5px solid var(--warn); }
.doc__draft strong { display: block; color: var(--warn); }
.doc__draft p { font-size: 14.5px; margin-top: 4px; }
.doc__todo { padding: 16px 18px; border-radius: var(--radius); border: 1.5px dashed var(--border-strong); }
/* Место, которое заполнит владелец сервиса (черновик). */
.doc__fill { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); border: 1.5px dashed var(--warn); color: var(--text-2); font-size: 14.5px; }
.doc__fill strong { display: block; color: var(--warn); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
.doc__note { margin-top: 16px; font-size: 14.5px; }
.lic { display: grid; gap: 12px; margin-top: 14px; }
.lic__item { padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.lic__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.lic__top h3 { margin: 0; }
.lic__item p { font-size: 14.5px; }
.lic__item p + p { margin-top: 6px; }
.lic__item ul { margin-top: 4px; font-size: 14.5px; gap: 4px; }
.lic__top h3 code { font-size: 0.85em; }
.lic__meta { color: var(--text-3) !important; font-size: 13.5px !important; }
.lic-list { margin-top: 12px; }
.lic-list summary { cursor: pointer; font-weight: 600; color: var(--brand); width: fit-content; }
@media (min-width: 641px) { .lic-list .doc-table td:first-child { width: 70%; } }

/* Содержание длинной страницы: ссылки-«таблетки», переносятся на телефоне. */
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.toc a { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 14px; font-weight: 550; text-decoration: none; }
.toc a:hover { color: var(--text); background: var(--brand-soft); text-decoration: none; }
.doc .toc a { text-decoration: none; }

/* ---------- Документация для провайдеров ---------- */
.doc--wide { max-width: 860px; }
.ways { display: grid; gap: 12px; grid-template-columns: 1fr; margin: 12px 0 14px; }
@media (min-width: 720px) { .ways { grid-template-columns: 1fr 1fr; } }
.doc pre.code { font-size: 12.5px; }
.doc .note { font-size: 14.5px; line-height: 1.6; }
.doc .note strong { display: block; margin-bottom: 2px; }
.doc-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14.5px; line-height: 1.55; }
.doc-table th { text-align: left; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--border-strong); }
.doc-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--text-2); overflow-wrap: anywhere; }
.doc-table td:first-child { width: 36%; }
.doc-table td small { display: block; margin-top: 4px; font-size: 12.5px; color: var(--text-3); line-height: 1.7; }
.doc-table td small code { font-size: 11.5px; }
@media (max-width: 640px) {
  .doc-table thead { display: none; }
  .doc-table, .doc-table tbody, .doc-table tr, .doc-table td, .doc-table td:first-child { display: block; width: auto; }
  .doc-table tr { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .doc-table td { border: 0; padding: 0; }
  .doc-table td + td { margin-top: 6px; }
}
.linkgen { margin-top: 18px; padding: 18px; border-radius: var(--radius-lg); }
.linkgen h3 { margin: 0 0 12px; }
.linkgen .kv > div { grid-template-columns: 84px 1fr; }
@media (max-width: 480px) { .linkgen .kv > div { grid-template-columns: 1fr; } }
.linkgen .kv code { overflow-wrap: anywhere; word-break: break-all; }

/* ---------- «Открыть в Bloom» (/add) ---------- */
.addpage { max-width: 560px; margin: 8px auto 0; display: grid; gap: 16px; }
.addpage__main { text-align: center; }
.addpage__mark { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 19px; display: grid; place-items: center; background: var(--brand-grad); box-shadow: 0 10px 30px -12px var(--brand-glow); }
.addpage__mark .logo-mark { width: 40px; height: 38px; fill: #fff; }
.addpage h1 { font-size: clamp(26px, 6vw, 32px); }
.addpage .lead { margin: 8px auto 0; font-size: 16px; }
.addpage__link { margin: 18px 0 16px; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); text-align: left; }
.addpage__what { display: block; font-weight: 650; font-size: 14px; margin: 0 2px 8px; overflow-wrap: anywhere; }
.addpage__link code { background: var(--surface); flex: 1; min-width: 0; padding: 6px 9px; font-size: 12.5px; max-height: 5.2em; overflow: hidden; word-break: break-all; user-select: all; }
.addpage__note { margin-top: 14px; font-size: 14px; color: var(--text-2); }
.addpage__status { margin-top: 10px; color: var(--warn); font-weight: 600; }
.addpage__steps h2 { margin-bottom: 4px; }
.numlist { margin: 12px 0 0; padding-left: 22px; display: grid; gap: 10px; color: var(--text-2); font-size: 14.5px; }
.numlist strong { color: var(--text); }
.addpage__privacy { text-align: center; padding: 0 8px; }

/* ---------- Срок оплаты (баннер провайдеру за 7 дней до конца и после) ---------- */
.paynote { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 22px; border-radius: var(--radius); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); }
.paynote__icon { width: 28px; height: 28px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--warn); color: var(--surface); }
.paynote__body { flex: 1 1 260px; min-width: 0; }
.paynote__body strong { display: block; }
.paynote__body p { margin-top: 4px; font-size: 13.5px; color: var(--text-2); }
.paynote__action { align-self: center; }
.paynote--expired { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.paynote--expired .paynote__icon { background: var(--danger); }

/* ---------- Статистика ---------- */
.chart { position: relative; padding-top: 20px; }
.chart__max { position: absolute; top: 0; left: 0; font-variant-numeric: tabular-nums; }
.chart__svg { display: block; width: 100%; height: 160px; overflow: visible; }
.chart__grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 3 4; }
.chart__bar { fill: color-mix(in srgb, var(--brand) 55%, transparent); transition: fill 0.12s; }
.chart__bar:hover { fill: var(--brand); }
.chart__bar--today { fill: color-mix(in srgb, var(--brand) 28%, transparent); stroke: var(--brand); stroke-width: 1; stroke-dasharray: 3 2; vector-effect: non-scaling-stroke; }
.chart__bar--zero { fill: var(--border-strong); }
.chart__axis { display: flex; justify-content: space-between; margin-top: 8px; }
.chart__days { margin-top: 16px; }
.chart__days summary { cursor: pointer; color: var(--text-2); font-size: 13.5px; font-weight: 600; width: fit-content; }
.chart__days summary:hover { color: var(--text); }
.chart__days .table-wrap { margin: 10px 0 0; max-height: 420px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; }
.table--compact td, .table--compact th { padding: 8px 14px; }
.table--compact th:first-child, .table--compact td:first-child { padding-left: 14px; }
.table--compact th:last-child, .table--compact td:last-child { padding-right: 14px; }
/* Узкий экран: строки таблицы становятся карточками с подписями к числам. */
@media (max-width: 640px) {
  .table--stack thead { display: none; }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; }
  .table--stack tr { padding: 12px 22px; border-bottom: 1px solid var(--border); }
  .table--stack tr:last-child { border-bottom: 0; }
  .table--stack td { padding: 3px 0 !important; border: 0; display: grid; grid-template-columns: minmax(120px, 45%) 1fr; gap: 12px; align-items: center; }
  .table--stack td.num { text-align: right; }
  .table--stack td:first-child { display: block; padding-bottom: 6px !important; }
  .table--stack td[data-label]::before { content: attr(data-label); color: var(--text-3); font-variant-numeric: normal; text-align: left; font-size: 13px; }
  .table--stack .cell { min-width: 0; }
  .table--stack td.nowrap { white-space: normal; overflow-wrap: anywhere; }
  .table--stack td.details { grid-template-columns: 1fr; gap: 2px; max-width: none; }
  .table--stack td code { justify-self: start; }
  .table--stack .badge { white-space: normal; height: auto; min-height: 24px; padding-top: 3px; padding-bottom: 3px; line-height: 1.3; border-radius: 10px; }
}
.how h2 .icon { color: var(--brand); }
.how__list { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 10px; color: var(--text-2); font-size: 14px; }
.how__list strong { color: var(--text); }
.host-cell { overflow-wrap: anywhere; font-weight: 650; }
.block { display: block; }
.tab-note { margin: -4px 0 14px; max-width: 860px; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; }
.table td .block { margin-top: 2px; font-size: 12.5px; }

/* ---------- Повторная проверка доменов ---------- */
.proof-missing strong { display: block; }
.proof-missing p { margin-top: 4px; }
.proof-missing .kv code { background: var(--surface); }
.keep-proof { margin-top: 10px; font-size: 13.5px; color: var(--text-2); }
.keep-proof summary { cursor: pointer; color: var(--text-2); width: fit-content; }
.keep-proof summary:hover { color: var(--text); }
.keep-proof p { margin-top: 6px; }

/* ---------- История брендинга ---------- */
.versions { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.version { padding: 18px 20px; scroll-margin-top: 90px; }
.version:target { border-color: var(--brand); box-shadow: var(--focus); }
.version.is-current { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); }
.version__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.version__logo { width: 40px; height: 40px; border-radius: 12px; font-size: 16px; }
.version__when { flex: 1 1 160px; min-width: 0; }
.version__when strong { display: block; font-variant-numeric: tabular-nums; }
.version__when small { display: block; color: var(--text-3); font-size: 12.5px; overflow-wrap: anywhere; }
.changes { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.changes li { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 4px 14px; font-size: 13.5px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
@media (max-width: 560px) { .changes li { grid-template-columns: 1fr; } }
.changes__label { color: var(--text-3); font-weight: 600; }
.changes__val { min-width: 0; overflow-wrap: anywhere; color: var(--text-2); }
.changes__val del { color: var(--text-3); text-decoration-color: color-mix(in srgb, var(--danger) 60%, transparent); }
.changes__val ins { color: var(--text); text-decoration: none; background: var(--ok-soft); border-radius: 4px; padding: 0 3px; }
.changes__val em { color: var(--text-3); }
.swatch { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 12.5px; vertical-align: -2px; }
.swatch svg { width: 14px; height: 14px; border-radius: 3px; box-shadow: 0 0 0 1px var(--border-strong); }

/* ---------- Вход с кодом ---------- */
.subcard { padding: 18px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.subcard h3 { margin-bottom: 2px; }
.subcard .input { background: var(--surface); }
.step-num { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 6px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); font-size: 14px; vertical-align: 2px; }
.secret { letter-spacing: 0.06em; font-size: 13.5px; }
.code-input { font-size: 20px; letter-spacing: 0.18em; height: 52px; }
.codes { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); counter-reset: code; }
.codes li { counter-increment: code; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 15px; letter-spacing: 0.02em; white-space: nowrap; user-select: all; }
.codes li::before { content: counter(code) "."; color: var(--text-3); margin-right: 8px; font-size: 12px; }
.codes-card { max-width: 760px; }

/* ---------- Админка: приложение ---------- */
@media (min-width: 900px) { .grid-2--wide { grid-template-columns: 1.35fr 1fr; } }
.plain-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.plain-list strong { color: var(--text); }

/* ---------- Error page ---------- */
.error-page { max-width: 520px; margin: 48px auto; text-align: center; }
.error-page__code { font-family: var(--font-display); font-size: 84px; font-weight: 850; letter-spacing: -0.05em; line-height: 1; }
.error-page h1 { margin-top: 14px; font-size: 26px; }
.error-page p { margin-top: 10px; color: var(--text-2); }
.error-page .btn-row { justify-content: center; margin-top: 26px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* Пока страница не загрузилась, переходов нет (app.js ставит .is-ready после load): иначе
   стиль, посчитанный до прихода этого файла (ссылки синие, фон прозрачный), «перетекал» бы
   в настоящий — синие рамки у кнопок на первых кадрах. */
html:not(.is-ready) *, html:not(.is-ready) *::before, html:not(.is-ready) *::after { transition: none !important; }
