/* KidHome — воздушный кабинет в фиолетовой гамме приложения
   (iOS CoreShared/Colors: accent #7B5CDA, header #8F70F3 → #6B4BD8). */
:root {
  color-scheme: light dark;
  --accent: #7b5cda;
  --accent-strong: #6b4bd8;
  --accent-soft: #ede8fb;
  --grad: linear-gradient(135deg, #8f70f3 0%, #6b4bd8 100%);
  --grad-soft: linear-gradient(135deg, rgba(143,112,243,.14), rgba(243,220,207,.18));
  --bg: #f6f4fc;
  --card: rgba(255,255,255,.82);
  --card-border: rgba(123,92,218,.12);
  --title: #2f2f57;
  --text: #4a4a6a;
  --muted: #7d7c99;
  --line: rgba(123,92,218,.12);
  --ok: #2fa86a;
  --ok-soft: #e3f6ec;
  --off-soft: #f1eff7;
  --danger: #e5484d;
  --shadow: 0 1px 2px rgba(47,47,87,.04), 0 12px 32px -12px rgba(91,64,190,.18);
  --radius: 22px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  color: var(--text);
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent-soft: #2d2942;
    --bg: #111016;
    --card: rgba(30,28,40,.78);
    --card-border: rgba(160,140,255,.14);
    --title: #f2f1fa;
    --text: #cfcde3;
    --muted: #9a98b5;
    --line: rgba(160,140,255,.14);
    --ok-soft: rgba(47,168,106,.16);
    --off-soft: rgba(255,255,255,.06);
    --grad-soft: linear-gradient(135deg, rgba(143,112,243,.18), rgba(102,81,166,.1));
    --shadow: 0 12px 32px -12px rgba(0,0,0,.6);
  }
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; line-height: 1.5;
  background:
    radial-gradient(60rem 40rem at 110% -10%, rgba(143,112,243,.22), transparent 60%),
    radial-gradient(50rem 36rem at -15% 10%, rgba(243,220,207,.35), transparent 60%),
    radial-gradient(40rem 30rem at 50% 120%, rgba(170,182,231,.25), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
@media (prefers-color-scheme: dark) {
  body { background:
    radial-gradient(60rem 40rem at 110% -10%, rgba(143,112,243,.25), transparent 60%),
    radial-gradient(50rem 36rem at -15% 10%, rgba(102,81,166,.22), transparent 60%),
    var(--bg); background-attachment: fixed; }
}

/* Шапка */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .75rem max(1rem, calc((100% - 64rem) / 2));
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--title); font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; }
.brand img { border-radius: 11px; box-shadow: 0 6px 16px -6px rgba(91,64,190,.5); }

/* Раскладка */
main { margin: clamp(1.5rem, 6vw, 4rem) auto 4rem; }
main.narrow { width: min(100% - 2rem, 28rem); }
main.wide { width: min(100% - 2rem, 64rem); }
.dashboard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 21rem); gap: 1.5rem; align-items: start; }
.main-col { display: grid; gap: 1.25rem; }
.main-col > h1, .main-col > .eyebrow { margin-bottom: -1rem; }
.main-col > .email { margin-bottom: .25rem; }
.side-col { position: sticky; top: 5.5rem; }
@media (max-width: 800px) { .dashboard { grid-template-columns: 1fr; } .side-col { position: static; } }

/* Типографика */
h1 { margin: 0 0 .25rem; font-size: clamp(2rem, 5vw, 2.75rem); line-height: 1.08; letter-spacing: -.03em; font-weight: 700; color: var(--title); }
h2 { margin: 0 0 .25rem; font-size: 1.2rem; letter-spacing: -.015em; color: var(--title); }
h3 { margin: 0 0 .35rem; font-size: 1rem; color: var(--title); }
p, dt, small { color: var(--text); }
small { color: var(--muted); }
.eyebrow { margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.email { margin: .25rem 0 0; color: var(--muted); overflow-wrap: anywhere; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* Карточки */
.card {
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
  padding: clamp(1.1rem, 4vw, 1.75rem); box-shadow: var(--shadow);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.pro-card { padding: 0; overflow: hidden; }
.pro-card > :not(.pro-band) { margin-left: clamp(1.1rem, 4vw, 1.75rem); margin-right: clamp(1.1rem, 4vw, 1.75rem); }
.pro-card > :last-child { margin-bottom: clamp(1.1rem, 4vw, 1.75rem); }
.pro-band { background: var(--grad); padding: 1.25rem clamp(1.1rem, 4vw, 1.75rem); position: relative; overflow: hidden; }
.pro-band::after { content: ""; position: absolute; right: -3rem; top: -4rem; width: 12rem; height: 12rem; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.28), transparent 70%); }
.pro-band h2, .pro-band p { color: #fff; margin: 0; position: relative; }
.pro-band p { opacity: .85; font-size: .92rem; }
dl { display: grid; grid-template-columns: auto 1fr; gap: .6rem 1rem; align-items: center; margin-top: 1.25rem; }
dt { color: var(--muted); font-size: .92rem; }
dd { margin: 0; font-weight: 650; color: var(--title); }
.pill { display: inline-block; padding: .25rem .7rem; border-radius: 999px; font-size: .85rem; font-weight: 650; }
.pill-on { background: var(--ok-soft); color: var(--ok); }
.pill-off { background: var(--off-soft); color: var(--muted); }

/* Кнопки */
input, button { font: inherit; }
button, a.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .7rem 1.25rem; border-radius: 999px; border: 0; cursor: pointer;
  font-weight: 650; letter-spacing: -.005em; text-decoration: none;
  color: #fff; background: var(--grad); box-shadow: 0 8px 20px -10px rgba(107,75,216,.7);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
button:hover, a.button:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -10px rgba(107,75,216,.75); }
button:active { transform: translateY(0); }
button.secondary { background: var(--accent-soft); color: var(--accent-strong); box-shadow: none; }
button.ghost { background: transparent; color: var(--accent-strong); border: 1px solid var(--line); box-shadow: none; padding: .55rem 1rem; }
button.danger { background: rgba(229,72,77,.1); color: var(--danger); box-shadow: none; }
button.wide-button { width: 100%; }
button:disabled { opacity: .38; cursor: not-allowed; transform: none; box-shadow: none; filter: grayscale(.3); }
:focus-visible { outline: 3px solid rgba(123,92,218,.45); outline-offset: 3px; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.actions form { margin: 0; }

/* Формы входа */
.hero { display: grid; justify-items: center; gap: .75rem; margin-bottom: 1.25rem; }
.hero img { border-radius: 22px; box-shadow: 0 18px 40px -16px rgba(91,64,190,.6); }
main.narrow h1 { text-align: center; }
.credentials { display: grid; gap: 1rem; margin-top: 1.25rem; }
label { display: grid; gap: .4rem; font-weight: 600; font-size: .92rem; color: var(--title); }
input { min-width: 0; padding: .8rem 1rem; border-radius: 14px; border: 1px solid var(--line); background: color-mix(in srgb, var(--card) 60%, transparent); color: var(--title); transition: border-color .15s, box-shadow .15s; }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(123,92,218,.15); }
.credentials button { width: 100%; padding: .85rem; }
.signin-methods, .authenticator-form, .authenticator-key { display: grid; gap: 1rem; }
.signin-methods { margin-top: 1rem; }
.authenticator-key button[hidden] { display: none; }
.authenticator-key input { font-family: ui-monospace, monospace; cursor: pointer; }
.authenticator-key [role="status"] { margin: 0; }
.authenticator-key [role="status"]:empty { display: none; }
.qr-login { margin-top: .75rem; }
main.narrow > p { text-align: center; }
[role="alert"] { color: var(--danger); }
[role="status"] { color: var(--accent-strong); }

/* Тестовая оплата */
.billing-test { margin-top: 1.25rem; padding: 1rem 1.1rem; border: 1.5px dashed rgba(123,92,218,.35); border-radius: 16px; background: var(--grad-soft); }
.billing-test h3 { color: var(--accent-strong); }

/* Списки */
.device-list, .child-list { list-style: none; padding: 0; margin: 1rem 0 .5rem; display: grid; gap: .6rem; }
.device-list li, .child-list li { padding: .9rem 1rem; border-radius: 16px; background: var(--grad-soft); border: 1px solid var(--line); }
.device-list li { display: grid; gap: .6rem; }
.device-list strong, .child-list strong { color: var(--title); }
.device-list small, .child-list small { display: block; margin-top: .15rem; }
.child-list .platform { display: inline-block; margin-left: .35rem; padding: .1rem .55rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: .8rem; font-weight: 650; }
.child-list .warn { color: var(--danger); }

/* QR */
.qr { display: block; width: min(100%, 300px); height: auto; margin: 1.25rem auto; padding: 12px; background: #fff; border-radius: 20px; box-shadow: var(--shadow); }
.qr[hidden] { display: none; }

/* 2026: боковое меню, плитки (bento), стеклянные карточки */
.app { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 2rem; align-items: start; }
.sidebar { position: sticky; top: 5.5rem; display: grid; gap: .25rem; padding: .5rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--shadow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.nav-item { display: flex; align-items: center; gap: .7rem; padding: .65rem .8rem; border-radius: 14px; color: var(--title); text-decoration: none; font-weight: 600; font-size: .95rem; transition: background .15s; }
.nav-item:hover { background: var(--accent-soft); }
.nav-item svg, .stat-icon svg { width: 20px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.content { display: grid; gap: 1.25rem; min-width: 0; }
.welcome .eyebrow { font-size: .85rem; }
.login { margin: .2rem 0 0; font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; letter-spacing: -.03em; color: var(--title); overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.stat { display: grid; gap: .35rem; padding: 1.1rem 1.2rem; }
.stat-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); margin-bottom: .35rem; }
.stat-label { font-size: .82rem; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 1.35rem; letter-spacing: -.02em; color: var(--title); }
.bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
.tile-wide { grid-column: span 2; }
.tile-side { grid-column: 3; grid-row: span 2; position: sticky; top: 5.5rem; }
.bento .devices { margin-top: 0; }
.bento .device-list li { display: grid; }
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; gap: 1rem; }
  .sidebar { position: static; display: flex; overflow-x: auto; }
  .nav-item span { white-space: nowrap; }
  .bento { grid-template-columns: 1fr; }
  .tile-wide, .tile-side { grid-column: auto; grid-row: auto; position: static; }
}
main.wide { width: min(100% - 2rem, 76rem); }

.welcome-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.gear { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--shadow); transition: transform .2s ease, background .15s; }
.gear:hover { transform: rotate(30deg); background: var(--accent-soft); }
.gear.back:hover { transform: translateX(-2px); }
.gear svg { width: 24px; height: 24px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.content > .pro-card { max-width: 44rem; }

/* Сворачиваемое меню */
.app.nav-animate { transition: grid-template-columns .25s ease; }
.nav-links { display: grid; gap: .25rem; }
.nav-toggle { display: flex; align-items: center; gap: .7rem; width: 100%; justify-content: flex-start; padding: .55rem .8rem; margin-bottom: .25rem; border-radius: 14px; background: transparent; color: var(--muted); box-shadow: none; font-size: .85rem; font-weight: 600; border-bottom: 1px solid var(--line); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.nav-toggle:hover { transform: none; box-shadow: none; background: var(--accent-soft); }
.nav-toggle svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s ease; }
.app.nav-collapsed { grid-template-columns: 4.25rem minmax(0, 1fr); }
.app.nav-collapsed .sidebar span { display: none; }
.app.nav-collapsed .nav-item, .app.nav-collapsed .nav-toggle { justify-content: center; padding-left: 0; padding-right: 0; }
.app.nav-collapsed .nav-toggle svg { transform: rotate(180deg); }
@media (max-width: 860px) { .nav-toggle { display: none; } .app.nav-collapsed { grid-template-columns: 1fr; } .app.nav-collapsed .sidebar span { display: inline; } }

.nav-item.active { background: var(--grad); color: #fff; box-shadow: 0 8px 18px -10px rgba(107,75,216,.8); }
.nav-item.active svg { stroke: #fff; }
.content > .children, .content > .devices { max-width: 44rem; }

.password-card { max-width: 44rem; }
.password-form { display: grid; gap: .9rem; margin-top: .75rem; }

/* Меню — вкладки сверху (решение владельца 2026-11-21): сворачивание не нужно */
.app, .app.nav-collapsed { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
.tabs { position: sticky; top: 4.6rem; z-index: 5; justify-self: start; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs .nav-links { display: flex; gap: .25rem; padding: .35rem; border-radius: 999px; background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.tabs .nav-item { padding: .55rem 1rem; border-radius: 999px; white-space: nowrap; }
.tabs .nav-item svg { width: 18px; height: 18px; }
.tabs .nav-item.active svg { stroke: #fff; }

/* Тонкая полоса вкладок вплотную под шапкой */
.tabbar { position: sticky; top: 65px; z-index: 9; justify-self: stretch; display: block; max-width: none; padding: 0 max(1rem, calc((100% - 76rem) / 2)); background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabbar .nav-links { display: flex; gap: 1.5rem; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.tabbar .nav-item { position: relative; padding: .6rem 0; border-radius: 0; font-size: .9rem; font-weight: 600; color: var(--muted); background: none; box-shadow: none; gap: .45rem; }
.tabbar .nav-item svg { width: 16px; height: 16px; stroke: currentColor; }
.tabbar .nav-item:hover { background: none; color: var(--title); }
.tabbar .nav-item.active { background: none; color: var(--accent); box-shadow: none; }
.tabbar .nav-item.active svg { stroke: var(--accent); }
.tabbar .nav-item.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--grad); }
main.wide { margin-top: 1.75rem; }

.topbar-user { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .5rem 1rem; min-width: 0; }
.user-contacts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .25rem .75rem; min-width: 0; }
.user-contacts strong { font-size: .95rem; color: var(--title); overflow-wrap: anywhere; }
@media (max-width: 600px) { .topbar { flex-wrap: wrap; } .topbar-user { margin-inline-start: auto; } }

/* Карточки детей */
.child-list { gap: .75rem; }
.child-list li.child-card { display: flex; gap: 1rem; align-items: center; padding: 1rem 1.1rem; }
.device-badge { flex: none; width: 56px; height: 72px; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(160deg, #efeaff, #ffffff); box-shadow: inset 0 0 0 1px var(--line); }
.device-art { width: 30px; height: 50px; }
.device-art rect:first-child { fill: #2f2f57; }
.device-art .screen { fill: url(#none); fill: #8f70f3; }
.device-badge .device-art .screen { fill: #8f70f3; }
.device-badge.android .device-art rect:first-child { fill: #3a4a3f; }
.device-badge.android .device-art .screen { fill: #34c27a; }
.device-art .island { fill: #1b1b33; }
@media (prefers-color-scheme: dark) { .device-badge { background: linear-gradient(160deg, #2d2942, #1e1c28); } .device-art rect:first-child { fill: #0b0b14; } }
.child-info { display: grid; gap: .35rem; min-width: 0; }
.child-head { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.child-head strong { font-size: 1.05rem; }
.child-list .child-head .platform { margin: 0; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px rgba(0,0,0,.04); }
.status-ok .status-dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(47,168,106,.18); }
.status-warn .status-dot { background: #f0ae1e; box-shadow: 0 0 0 4px rgba(240,174,30,.18); }
.status-stale .status-dot { background: #c9c7d8; }
.status-text { font-size: .8rem; color: var(--muted); font-weight: 600; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .78rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--off-soft); color: var(--text); }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: rgba(240,174,30,.15); color: #b07a06; }
.chip-bad { background: rgba(229,72,77,.12); color: var(--danger); }

.rename { margin-top: .2rem; }
.rename summary { cursor: pointer; width: fit-content; font-size: .82rem; font-weight: 650; color: var(--accent); list-style: none; }
.rename summary::-webkit-details-marker { display: none; }
.rename summary::before { content: "✎ "; }
.rename form { display: flex; gap: .5rem; margin: .5rem 0 .3rem; flex-wrap: wrap; }
.rename input { flex: 1 1 12rem; padding: .55rem .8rem; }
.rename button { padding: .55rem 1rem; }

/* Шапка и вкладки по одним краям с содержимым (76rem) */
.topbar { padding-left: max(1rem, calc((100% - 76rem) / 2)); padding-right: max(1rem, calc((100% - 76rem) / 2)); }

/* Компактная карточка «Вход с iPhone» */
.devices.compact { padding: 1.1rem 1.15rem; }
.card-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.card-head h2 { margin: 0; font-size: 1.05rem; }
.head-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: var(--grad); box-shadow: 0 6px 14px -8px rgba(107,75,216,.8); }
.head-icon svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.devices.compact .device-list { margin: 0 0 .5rem; }
.devices.compact .device-list li.device-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .3rem .8rem; align-items: center; padding: .75rem .8rem; }
.device-badge.mini { width: 40px; height: 52px; border-radius: 13px; grid-row: span 2; }
.device-badge.mini .device-art { width: 22px; height: 36px; }
.device-info { display: grid; gap: .1rem; min-width: 0; }
.device-info strong { font-size: .92rem; overflow-wrap: anywhere; }
.device-info small { margin: 0; font-size: .76rem; }
.device-card form { grid-column: 2; }
button.small { padding: .35rem .85rem; font-size: .82rem; }
.devices.compact .hint { margin: .25rem 0 .75rem; line-height: 1.35; }

/* Компактная полоса сводки */
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.stat.card { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .7rem; row-gap: 0; align-items: center; padding: .7rem .9rem; border-radius: 16px; }
.stat-icon { grid-row: span 2; width: 34px; height: 34px; margin: 0; border-radius: 11px; }
.stat-icon svg { width: 18px; height: 18px; }
.stat-label { font-size: .74rem; line-height: 1.2; }
.stat-value { font-size: 1rem; line-height: 1.25; }
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Подписка: компактная карточка */
.content > .pro-card { max-width: 40rem; }
.pro-card .pro-band { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; }
.pro-title { display: flex; align-items: center; gap: .75rem; position: relative; }
.pro-crown { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.18); }
.pro-crown svg { width: 22px; height: 22px; fill: #fff; }
.pro-band h2 { font-size: 1.1rem; }
.pro-status { position: relative; padding: .3rem .75rem; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.pro-status.on { background: #fff; color: var(--ok); }
.pro-status.off { background: rgba(255,255,255,.2); color: #fff; }
.pro-card > .pro-body { margin: 0 !important; padding: 1rem 1.25rem 1.15rem; display: grid; gap: .8rem; }
.pro-until { margin: 0; font-size: .9rem; color: var(--muted); }
.pro-until strong { color: var(--title); }
.pro-features { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.pro-features li { display: flex; align-items: center; gap: .55rem; font-size: .9rem; color: var(--text); }
.pro-features svg { flex: none; width: 18px; height: 18px; padding: 2px; border-radius: 50%; background: var(--accent-soft); fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.muted-note { margin: 0; font-size: .82rem; color: var(--muted); }
.pro-body .billing-test { margin: 0; padding: .8rem .9rem; }
.billing-test-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
.billing-test-head h3 { margin: 0; font-size: .9rem; }
.segmented { display: flex; flex-wrap: wrap; gap: .4rem; }
.segmented form { margin: 0; }
.segmented button { padding: .45rem .9rem; font-size: .82rem; }

/* Состояние подписки справа в полосе вкладок */
.tabbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.plan-chip { flex: none; display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 700; text-decoration: none; }
.plan-chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.plan-chip.off { background: var(--off-soft); color: var(--muted); }
.plan-chip.on { background: var(--grad); color: #fff; box-shadow: 0 6px 14px -8px rgba(107,75,216,.8); }
.plan-chip.on svg { fill: #fff; }

/* Настройки: компактные карточки */
.settings-grid { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: 1.25rem; align-items: start; max-width: 60rem; }
.settings-grid-single { grid-template-columns: minmax(0, 1fr); max-width: 36rem; }
.settings-card { padding: 1.1rem 1.2rem; }
.settings-card .card-head { margin-bottom: .6rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .45rem .9rem; margin: 0; }
.kv dt { font-size: .82rem; }
.kv dd { font-size: .9rem; font-weight: 600; overflow-wrap: anywhere; }
.kv a { text-decoration: none; }
.password-card { max-width: none; }
.password-form { gap: .7rem; margin-top: .25rem; }
.password-form label { font-size: .82rem; gap: .3rem; }
.password-form input { padding: .6rem .85rem; border-radius: 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.form-foot small { margin: 0; }
.flash { margin: 0 0 .5rem; padding: .5rem .75rem; border-radius: 12px; font-size: .85rem; font-weight: 600; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.bad { background: rgba(229,72,77,.12); color: var(--danger); }
@media (max-width: 760px) { .settings-grid, .two { grid-template-columns: 1fr; } }

/* Подписка: тарифы, карта, история оплат. Касса: виртуальная платёжная система. */
.sub-grid, .cashier-grid { display: grid; gap: 1rem; align-items: start; }
@media (min-width: 960px) {
  .sub-grid { grid-template-columns: minmax(0, 40rem) minmax(0, 1fr); }
  .cashier-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}
.sub-grid > .pro-card, .cashier-grid > .card { max-width: none; margin: 0; }
.plan-form { display: grid; gap: .7rem; }
.plans { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .5rem; }
.plans legend { padding: 0; margin-bottom: .45rem; font-size: .82rem; font-weight: 650; color: var(--muted); }
.plan { position: relative; display: grid; gap: .1rem; padding: .7rem .85rem; border-radius: 14px; border: 1.5px solid var(--line); background: color-mix(in srgb, var(--card) 70%, transparent); cursor: pointer; font-weight: 500; transition: border-color .15s, box-shadow .15s; }
.plan input { position: absolute; opacity: 0; pointer-events: none; }
.plan:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(123,92,218,.14); background: var(--grad-soft); }
.plan:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.plan-title { font-size: .85rem; color: var(--muted); font-weight: 650; }
.plan-price { font-size: 1.15rem; font-weight: 750; color: var(--title); }
.plan small { font-size: .76rem; color: var(--muted); }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; font-size: .88rem; color: var(--text); cursor: pointer; }
.check input { width: 1.05rem; height: 1.05rem; padding: 0; accent-color: var(--accent); }
.plan-form > button { justify-self: start; }
.method-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .7rem .8rem; border-radius: 14px; background: var(--off-soft); }
.method-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); }
.method-icon svg, .cashier-card .head-icon svg { fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.method-icon svg { width: 18px; height: 18px; stroke: var(--accent-strong); }
.method-info { flex: 1; min-width: 10rem; display: grid; }
.method-info strong { color: var(--title); font-size: .9rem; }
.method-info small { font-size: .78rem; color: var(--muted); }
.method-actions, .cashier-tools, .mode, .pay-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.method-actions form, .cashier-tools form, .mode form { margin: 0; }
.muted { color: var(--muted); font-weight: 500; }
.order-list, .pay-list, .event-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.order { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .65rem .8rem; border-radius: 14px; background: var(--off-soft); }
.order strong, .pay strong { color: var(--title); font-size: .9rem; }
.order small, .pay small { display: block; font-size: .76rem; color: var(--muted); margin-top: .1rem; overflow-wrap: anywhere; }
.order-side { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.order-price { font-weight: 700; color: var(--title); font-size: .9rem; white-space: nowrap; }
.pay-link { font-size: .82rem; font-weight: 650; }
.pill { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; background: var(--off-soft); color: var(--muted); }
.pill-paid, .pill-succeeded { background: var(--ok-soft); color: var(--ok); }
.pill-pending { background: rgba(240,174,30,.15); color: #b07a06; }
.pill-failed, .pill-canceled, .pill-chargeback, .pill-review { background: rgba(229,72,77,.12); color: var(--danger); }
.pill-refunded { background: var(--accent-soft); color: var(--accent-strong); }
.order .pill { background: color-mix(in srgb, var(--card) 80%, transparent); }
.order .pill-paid { background: var(--ok-soft); }
.order .pill-pending { background: rgba(240,174,30,.15); }
.order .pill-failed, .order .pill-review { background: rgba(229,72,77,.12); }
.order .pill-refunded { background: var(--accent-soft); }
.cashier-card .card-head .chip { margin-left: auto; }
.hint-text { margin: 0 0 .8rem; font-size: .86rem; color: var(--muted); }
.cashier-tools { margin-bottom: .9rem; }
.mode { margin-left: auto; }
.mode > span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.pay { display: grid; gap: .3rem; padding: .75rem .85rem; border-radius: 16px; background: var(--grad-soft); border: 1px solid var(--line); scroll-margin-top: 6rem; }
.pay.highlight { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(123,92,218,.16); }
.pay-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.pay-head .pill { margin-left: auto; }
.pay-actions { margin-top: .25rem; }
.small-check { font-size: .78rem; color: var(--muted); margin-left: auto; }
.event-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .1rem .6rem; padding: .5rem .2rem; border-bottom: 1px solid var(--line); font-size: .84rem; }
.event-list li:last-child { border-bottom: 0; }
.event-list strong { color: var(--title); }
.event-list small { grid-column: 2; color: var(--muted); }
.events-card .billing-test { margin-top: 1rem; }
@media (max-width: 600px) {
  .order { flex-direction: column; align-items: stretch; }
  .order-side { justify-content: flex-start; }
  .mode { margin-left: 0; }
}

/* Админка */
.admin-session { display: flex; align-items: center; gap: .6rem; }
.admin-session small { color: var(--muted); }
.admin-gate { max-width: 34rem; }
.admin-gate p { font-size: .9rem; }
.steps { margin: 0 0 1rem; padding-left: 1.2rem; display: grid; gap: .5rem; font-size: .9rem; }
.secret { display: inline-block; margin-top: .3rem; padding: .3rem .55rem; border-radius: 8px; background: var(--off-soft); color: var(--title); letter-spacing: .06em; overflow-wrap: anywhere; }
.totp-qr { display: block; width: 220px; height: 220px; margin: 0 0 1rem; border-radius: 14px; background: #fff; padding: 8px; }
.code-form { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
.code-form input { width: 9rem; font-size: 1.2rem; letter-spacing: .15em; text-align: center; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.stat-tile { padding: .9rem 1rem; border-radius: 18px; background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--shadow); display: grid; gap: .2rem; }
.stat-tile small { color: var(--muted); font-size: .8rem; font-weight: 600; }
.stat-tile strong { color: var(--title); font-size: 1.35rem; }
.admin-card { margin-bottom: 1rem; }
.admin-family-head { margin-top: .8rem; overflow-wrap: anywhere; }
#server-status { scroll-margin-top: 6rem; }
#server-status [data-admin-live][hidden] { display: none; }
#server-status .card-head { justify-content: space-between; flex-wrap: wrap; }
.server-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: .75rem; }
.server-metric { display: grid; align-content: start; gap: .35rem; padding: .85rem; background: var(--off-soft); border-radius: 14px; }
.server-timestamp, .server-uptime, .server-metric h3, .server-metric strong, .server-metric b {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
}
.server-timestamp, .server-uptime { color: var(--muted); font-size: .82rem; }
.server-metric h3 { margin: 0; font-size: .78rem; letter-spacing: .05em; color: var(--muted); }
.server-status-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: .75rem; margin-top: .75rem; }
.server-poll-form { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; }
.server-poll-form select { font: inherit; color: var(--title); background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: .35rem .6rem; }
.server-metric strong { color: var(--title); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.server-metric small { color: var(--muted); }
.server-metric meter { width: 100%; height: .8rem; }
.server-level { font-size: .8rem; font-weight: 650; }
.server-level.critical { color: var(--danger); }
.server-uptime { margin: .75rem 0 0; }
.admin-grid { display: grid; gap: 1rem; align-items: start; }
@media (min-width: 960px) { .admin-grid { grid-template-columns: 1fr 1fr; } }
.admin-grid .admin-card { margin: 0; }
.plan-edit-list { display: grid; gap: .7rem; }
.plan-edit { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .55rem .7rem; padding: .85rem .9rem; border-radius: 16px; background: var(--grad-soft); border: 1px solid var(--line); }
.plan-edit.hidden-plan { opacity: .65; }
.plan-edit label { font-size: .78rem; gap: .25rem; color: var(--muted); }
.plan-edit input, .plan-edit select { padding: .5rem .65rem; border-radius: 10px; font-size: .88rem; }
.plan-edit select { min-width: 0; border: 1px solid var(--line); background: color-mix(in srgb, var(--card) 60%, transparent); color: var(--title); font: inherit; font-size: .85rem; }
.plan-edit .period { grid-column: span 2; }
.period-row { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: .4rem; }
.plan-edit-head, .plan-edit-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.plan-edit-head strong { color: var(--title); }
.plan-edit-head .muted { font-size: .8rem; }
.plan-edit-foot .check { font-size: .84rem; color: var(--text); }
.plan-edit-foot button { margin-left: auto; }
.plan-new summary { cursor: pointer; font-weight: 650; color: var(--accent-strong); padding: .3rem 0 .6rem; }
.admin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.admin-list li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .6rem .8rem; border-radius: 14px; background: var(--off-soft); flex-wrap: wrap; }
.admin-list strong { color: var(--title); font-size: .88rem; overflow-wrap: anywhere; }
.admin-list small { display: block; font-size: .76rem; color: var(--muted); }
@media (max-width: 600px) { .plan-edit .period { grid-column: 1 / -1; } }
@media (min-width: 900px) {
  .plan-edit { grid-template-columns: minmax(8rem, 1.3fr) minmax(5rem, .7fr) minmax(12rem, 1.9fr) minmax(8rem, 1.4fr) minmax(4.5rem, .5fr); }
  .plan-edit .period { grid-column: auto; }
}
.user-search { display: flex; gap: .5rem; align-items: center; margin-bottom: .8rem; flex-wrap: wrap; }
.user-search input { flex: 1; min-width: 12rem; max-width: 24rem; padding: .5rem .8rem; border-radius: 12px; font-size: .88rem; }
.reset-link { font-size: .84rem; font-weight: 600; }
.user-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.user-list li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .7rem .85rem; border-radius: 14px; background: var(--off-soft); flex-wrap: wrap; }
.user-main { display: grid; gap: .12rem; min-width: 0; }
.user-head { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.user-head strong { color: var(--title); font-size: .9rem; overflow-wrap: anywhere; }
.user-main small { font-size: .76rem; color: var(--muted); }
.order-side .src { font-size: .76rem; }
.admin-card .card-head .muted { margin-left: auto; font-weight: 650; }
.grant { margin-top: .3rem; }
.grant summary { cursor: pointer; font-size: .8rem; font-weight: 650; color: var(--accent-strong); }
.grant[open] { padding: .6rem .7rem; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.grant-form { display: grid; grid-template-columns: minmax(12rem, 1fr) minmax(10rem, 1.2fr) auto; gap: .5rem; align-items: end; margin: .5rem 0 .3rem; }
.grant-form label { font-size: .76rem; gap: .25rem; color: var(--muted); }
.grant-form input, .grant-form select { padding: .45rem .6rem; border-radius: 10px; font-size: .85rem; }
.grant-form select { min-width: 0; border: 1px solid var(--line); background: color-mix(in srgb, var(--card) 60%, transparent); color: var(--title); font: inherit; font-size: .82rem; }
.grant .muted-note { margin: .2rem 0 .4rem; font-size: .76rem; }
@media (max-width: 700px) { .grant-form { grid-template-columns: 1fr; } }

.ad-preview{margin:0 0 .5rem;max-width:22rem;border-radius:14px;overflow:hidden;border:1px solid var(--line, #e3e3ea)}
.ad-preview img{display:block;width:100%;height:auto;max-height:16rem;object-fit:contain;background:#f4f4f7}
.ad-preview figcaption{padding:.55rem .75rem;font-size:.92rem}
.ad-form{display:grid;gap:.65rem;max-width:32rem;margin-bottom:.75rem}
.ad-form label{display:grid;gap:.3rem}

#reset-form[hidden] { display: none; }

#push-code-form[aria-busy="true"] button::before {
    content: "";
    display: inline-block;
    width: 0.9em;
    height: 0.9em;
    margin-inline-end: 0.5em;
    border: 2px solid currentColor;
    border-inline-end-color: transparent;
    border-radius: 50%;
    vertical-align: -0.12em;
    animation: push-code-spin 700ms linear infinite;
}

@keyframes push-code-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    #push-code-form[aria-busy="true"] button::before { animation: none; }
}


.ad-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .65rem; }
.ad-editor[open] { flex-basis: 100%; }
.ad-editor summary {
  cursor: pointer;
  width: fit-content;
  list-style: none;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: .48rem .9rem;
  font-size: .875rem;
  font-weight: 650;
}
.ad-editor summary::-webkit-details-marker { display: none; }
.ad-editor .ad-form { margin-top: .85rem; }
