:root {
  --a-bg: #f2f6f7;
  --a-text: #0d1f24;
  --a-hint: #5f8189;
  --a-hint-soft: #7f9ba1;
  --a-placeholder: #9ab0b5;
  --a-line: #dde8ea;
  --a-line-soft: #eef3f4;
  --a-card: #ffffff;
  --a-card-soft: #eef4f5;
  --a-accent-dk: #0d3f4b;
  --a-accent: #12525f;
  --a-ok: oklch(0.62 0.11 172);
  --a-ok-text: oklch(0.55 0.11 172);
  --a-ok-bg: #e6f5f2;
  --a-ok-line: #b7e2d9;
  --a-bad: #c25353;
  --a-bad-bg: #fdf1f1;
  --a-bad-line: #f0d6d6;
  --a-bad-tint-bg: #ffffff;
  --a-warn-bg: #fff4d9;
  --a-warn-line: #f0d79b;
  --a-warn-text: #9a7215;
  --a-pill-active-bg: #ffffff;
  --a-pill-active-fg: #0d1f24;
  --a-pill-shadow: 0 2px 6px rgba(13,63,75,.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; min-height: 100%; background: var(--a-bg); color: var(--a-text);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--a-ok-text); text-decoration: none; }
a:hover { color: var(--a-accent-dk); }
input { font-family: inherit; }
input::placeholder { color: var(--a-placeholder); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(.85); opacity: 0; } 60% { transform: scale(1.05); } 100% { transform: scale(1); opacity: 1; } }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* --- Auth screen --- */
.auth-page {
  position: relative; min-height: 100vh; overflow: hidden; padding: 36px 24px 60px;
  background: radial-gradient(120% 90% at 18% 0%, rgba(41,150,160,.42) 0%, rgba(12,58,72,0) 58%), linear-gradient(168deg,#0d4653 0%,#0a3242 34%,#08202f 66%,#061724 100%);
  color: #eaf7f8; box-sizing: border-box;
}
.auth-page::before { content: ""; position: absolute; bottom: -220px; right: -180px; width: 680px; height: 680px; border-radius: 50%; background: radial-gradient(closest-side, rgba(72,222,214,.14), rgba(72,222,214,0)); pointer-events: none; }
.auth-header { position: relative; display: flex; align-items: center; max-width: 1100px; margin: 0 auto; }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 20px; border-radius: 15px; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.26); backdrop-filter: blur(14px); box-shadow: inset 0 1px 0 rgba(255,255,255,.22); color: #fff; }
.brand-mark { height: 20px; width: auto; flex: none; display: block; }
.auth-brand .brand-text { font-size: 17px; font-weight: 800; letter-spacing: .6px; }
.auth-brand .brand-text span { font-weight: 500; opacity: .85; }
.auth-back-link { font-size: 14.5px; font-weight: 600; color: rgba(234,247,248,.7); }
.auth-back-link:hover { color: #fff; }

.auth-center { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 60px; text-align: center; }
.auth-center h1 { font-size: 44px; font-weight: 800; letter-spacing: -1.8px; line-height: 1.1; margin: 0; text-wrap: balance; }
.auth-center p { font-size: 16.5px; line-height: 1.6; color: rgba(234,247,248,.68); margin: 16px 0 0; max-width: 520px; }

.auth-perks { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; justify-content: center; }
.auth-perk { display: flex; gap: 9px; align-items: center; height: 38px; padding: 0 16px 0 12px; border-radius: 99px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); font-size: 13.5px; font-weight: 600; color: rgba(234,247,248,.85); }
.auth-perk .tick { width: 20px; height: 20px; flex: none; border-radius: 50%; background: rgba(72,222,214,.16); border: 1px solid rgba(72,222,214,.36); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: oklch(0.86 0.12 188); }

.auth-card { width: 452px; max-width: 100%; box-sizing: border-box; margin-top: 40px; padding: 32px; border-radius: 28px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(16px); box-shadow: 0 30px 70px rgba(0,0,0,.38); text-align: left; }
.seg { display: flex; padding: 4px; border-radius: 14px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.1); gap: 3px; }
.seg-btn { flex: 1; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; cursor: pointer; transition: .15s; color: rgba(234,247,248,.55); background: transparent; border: 1px solid transparent; font-family: inherit; }
.seg-btn.active { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.28); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.24); }
.auth-title { font-size: 26px; font-weight: 800; letter-spacing: -.9px; margin-top: 26px; color: #eaf7f8; }
.auth-subtitle { font-size: 14.5px; color: rgba(234,247,248,.62); margin-top: 8px; line-height: 1.55; }
.auth-field-label { font-size: 12px; font-weight: 700; color: rgba(234,247,248,.55); letter-spacing: .5px; text-transform: uppercase; }
.auth-field { width: 100%; box-sizing: border-box; height: 50px; margin-top: 7px; padding: 0 15px; border-radius: 14px; font-size: 15px; color: var(--a-text); background: #fff; outline: none; border: 1px solid var(--a-line); font-family: inherit; }
.auth-field.err { border-color: #e8a3a3; }
.auth-field:focus { border-color: var(--a-accent); }
.auth-page .auth-field { height: 52px; margin-top: 8px; padding: 0 16px; border-radius: 15px; color: #eaf7f8; background: rgba(0,0,0,.26); border-color: rgba(255,255,255,.16); }
.auth-page .auth-field::placeholder { color: rgba(234,247,248,.35); }
.auth-page .auth-field.err { border-color: rgba(255,143,143,.6); }
.auth-page .auth-field:focus { border-color: oklch(0.7 0.1 188); }
.auth-form-group { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.pw-strength { margin-top: 9px; }
.pw-strength-track { height: 4px; border-radius: 99px; background: rgba(255,255,255,.14); overflow: hidden; }
.pw-strength-fill { height: 100%; width: 0%; border-radius: 99px; background: #c25353; transition: width .2s, background .2s; }
.pw-strength-fill.mid { background: #f5c451; }
.pw-strength-fill.strong { background: oklch(0.72 0.13 172); }
.pw-strength-hint { font-size: 11.5px; color: rgba(234,247,248,.45); margin-top: 6px; line-height: 1.4; }
.auth-err { font-size: 13.5px; font-weight: 600; color: #ff8f8f; display: none; }
.auth-err.show { display: block; }
.btn-primary { height: 52px; border-radius: 15px; background: linear-gradient(var(--a-accent), var(--a-accent-dk)); display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; color: #fff; cursor: pointer; border: none; width: 100%; font-family: inherit; box-shadow: 0 10px 22px rgba(13,63,75,.26); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.auth-page .btn-primary { height: 54px; border-radius: 16px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.32); box-shadow: inset 0 1px 0 rgba(255,255,255,.26), 0 12px 28px rgba(0,0,0,.28); }
.auth-page .btn-primary:hover { background: rgba(255,255,255,.26); filter: none; }
.auth-legal { font-size: 12px; color: rgba(234,247,248,.42); line-height: 1.5; text-align: center; margin-top: 4px; }
.auth-sending { margin-top: 28px; display: flex; align-items: center; gap: 14px; height: 56px; padding: 0 22px; border-radius: 16px; background: rgba(0,0,0,.2); border: 1px solid rgba(255,255,255,.1); }
.spinner-sm { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.16); border-top-color: oklch(0.82 0.13 188); display: inline-block; animation: spin .8s linear infinite; }
.auth-sending span:last-child { font-size: 15px; font-weight: 600; color: #eaf7f8; }
.auth-sent { margin-top: 26px; animation: fade .3s; }
.auth-sent-box { padding: 22px; border-radius: 20px; background: rgba(72,222,214,.1); border: 1px solid rgba(72,222,214,.32); display: flex; gap: 14px; align-items: flex-start; }
.auth-sent-tick { width: 32px; height: 32px; flex: none; border-radius: 50%; background: oklch(0.8 0.12 172); color: #062229; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; animation: pop .4s; }
.auth-sent-title { font-size: 16px; font-weight: 700; color: #eaf7f8; }
.auth-sent-note { font-size: 14px; color: rgba(234,247,248,.66); margin-top: 6px; line-height: 1.5; }
.auth-foot-link { text-align: center; margin-top: 16px; font-size: 13px; color: rgba(234,247,248,.6); }
.auth-foot-link a { color: #eaf7f8; font-weight: 700; }
a.disabled { opacity: .5; pointer-events: none; }
@media (max-width: 560px) { .auth-header { padding: 0 8px; } .auth-center h1 { font-size: 34px; } .auth-card { padding: 24px; } }

/* --- Dashboard shell --- */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
@media (max-width: 860px) { .app-shell { grid-template-columns: 1fr; } }
/* embed-admin — просьба пользователя 2026-09-04 "мне нужна просто
   админка а не сайт в приложении": десктоп-клиент открывает эту же
   страницу в iframe (?embed=admin, см. app.js load()) внутри своей
   собственной вкладки "Админка" — свой сайдбар/шапка сайта там лишние,
   получалась вложенная вторая навигация внутри уже открытой вкладки. */
body.embed-admin .app-side,
body.embed-admin .app-header-row,
body.embed-admin .app-mobile-brand,
body.embed-admin .app-bottom-nav { display: none !important; }
body.embed-admin .app-shell { grid-template-columns: 1fr; }
body.embed-admin .app-main { padding: 18px 22px 40px; }
.app-side { padding: 26px 18px; background: linear-gradient(168deg,#0d4653,#0a3242 55%,#071c29); display: flex; flex-direction: column; gap: 24px; }
.app-side-brand { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 0 8px; color: #fff; }
.app-side-brand a { color: inherit; }
.app-side-brand .brand-text { font-size: 16px; font-weight: 800; letter-spacing: .5px; }
.ann-bell { position: relative; flex: none; width: 36px; height: 36px; border-radius: 12px; border: none; background: transparent; color: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: .15s; padding: 0; }
.ann-bell:hover { background: rgba(72,222,214,.14); color: #eafcff; }
.ann-dot { position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: oklch(0.84 0.13 188); border: 2px solid var(--a-accent-dk); }
.app-mobile-brand .ann-dot { border-color: var(--a-bg, #0a2530); }
.app-nav { display: flex; flex-direction: column; gap: 4px; }
.app-nav-item { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-radius: 13px; font-size: 14.5px; font-weight: 600; cursor: pointer; transition: .15s; color: rgba(234,247,248,.62); background: transparent; border: 1px solid transparent; }
.app-nav-item.active { color: #eafcff; background: rgba(72,222,214,.18); border-color: rgba(72,222,214,.42); box-shadow: inset 0 1px 0 rgba(255,255,255,.14); }
.app-nav-item:hover:not(.active) { color: #fff; background: rgba(72,222,214,.12); }
.app-status-box { margin-top: auto; padding: 18px; border-radius: 18px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); }
.app-status-title { font-size: 12.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: oklch(0.86 0.12 188); }
.app-status-note { font-size: 13.5px; color: rgba(234,247,248,.72); margin-top: 8px; line-height: 1.45; }
.app-status-btn { margin-top: 13px; height: 36px; border-radius: 12px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.24); display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; color: #fff; cursor: pointer; }
.app-status-btn:hover { background: rgba(255,255,255,.22); }
.app-logout { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 600; color: rgba(234,247,248,.6); cursor: pointer; }
.app-logout:hover { color: #fff; }
.app-logout-card { justify-content: center; padding: 14px; border-radius: 16px; background: var(--a-card); border: 1px solid var(--a-line); color: var(--a-bad); }
.app-logout-card:hover { color: var(--a-bad); opacity: .8; }
@media (max-width: 860px) { .app-side { display: none; } }

.app-main { padding: 30px 36px 60px; min-width: 0; }
.app-mobile-brand { display: none; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 18px; color: var(--a-text); }
.app-mobile-brand .brand-text { font-size: 15px; font-weight: 800; letter-spacing: .4px; }
.app-header-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.app-page-title { font-size: 24px; font-weight: 800; letter-spacing: -.8px; }
.app-page-sub { font-size: 13.5px; color: var(--a-hint); margin-top: 4px; }
.app-user-chip { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 8px 0 15px; border-radius: 14px; background: var(--a-card-soft); border: 1px solid var(--a-line); margin-left: auto; }
.app-user-email { font-size: 13px; font-weight: 600; color: var(--a-text); }
.app-user-av { width: 28px; height: 28px; border-radius: 9px; background: linear-gradient(var(--a-accent), var(--a-accent-dk)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 800; }

.app-tab { display: none; animation: fade .25s; margin-top: 24px; }
.app-tab.active { display: block; }

.verify-banner { padding: 16px 20px; border-radius: 18px; background: var(--a-warn-bg); border: 1px solid var(--a-warn-line); color: var(--a-warn-text); font-size: 13.5px; margin-bottom: 18px; }

.ov-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 700px) { .ov-grid { grid-template-columns: minmax(0, 1fr); } }
.sub-hero { padding: 26px; border-radius: 22px; background: var(--a-hero-bg); border: 1px solid var(--a-hero-line); color: var(--a-hero-text); position: relative; overflow: hidden; }
.sub-hero::before { content: ""; position: absolute; top: -70px; right: -50px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(closest-side, rgba(72,222,214,.22), rgba(72,222,214,0)); }
.sub-state { position: relative; display: flex; align-items: center; gap: 9px; font-size: 11.5px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--a-ok-text); }
.sub-state .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sub-until { position: relative; font-size: 30px; font-weight: 800; letter-spacing: -1.2px; margin-top: 12px; }
.sub-left { position: relative; font-size: 13.5px; color: var(--a-hero-text2); margin-top: 5px; }
.sub-bar-track { position: relative; height: 6px; border-radius: 99px; background: var(--a-hero-track); margin-top: 18px; overflow: hidden; }
.sub-bar-fill { height: 100%; border-radius: 99px; transition: width .5s; }
.sub-actions { position: relative; display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.sub-act-btn { height: 44px; padding: 0 20px; border-radius: 14px; background: var(--a-hero-btn); border: 1px solid var(--a-hero-btn-line); display: flex; align-items: center; font-size: 14px; font-weight: 700; color: var(--a-hero-btn-fg); cursor: pointer; }
.sub-act-btn:hover { background: var(--a-hero-btn-hover); }
.sub-act-btn.outline { background: transparent; border-color: var(--a-hero-line2); font-weight: 600; color: var(--a-hero-text2); }
.sub-act-btn.outline:hover { border-color: var(--a-hero-line-strong); }

.link-card { padding: 24px; border-radius: 22px; background: var(--a-hero-bg); border: 1px solid var(--a-hero-line); color: var(--a-hero-text); }
.link-card-label { font-size: 12px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--a-ok-text); }
.link-card-note { font-size: 13px; color: var(--a-hero-text2); margin-top: 9px; line-height: 1.5; }
.link-box { display: flex; align-items: center; gap: 10px; margin-top: 15px; padding: 12px 13px; border-radius: 13px; background: var(--a-hero-inset); border: 1px solid var(--a-hero-line); }
.link-box span { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--a-hero-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: filter .15s ease; }
.link-box span.link-hidden { filter: blur(6px); user-select: none; }
.link-eye-btn { -webkit-appearance: none; appearance: none; flex: none; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--a-hero-line2); background: transparent; display: flex; align-items: center; justify-content: center; color: var(--a-hero-text2); cursor: pointer; padding: 0; }
.link-eye-btn:hover { border-color: var(--a-hero-line-strong); color: var(--a-hero-text); }
.link-actions { display: flex; gap: 10px; margin-top: 13px; }
.link-copy-btn { flex: 1; height: 42px; border-radius: 13px; background: linear-gradient(var(--a-accent), var(--a-accent-dk)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13.5px; font-weight: 700; cursor: pointer; border: none; font-family: inherit; }
.link-copy-btn:hover { filter: brightness(1.1); }
.link-card .link-copy-btn { background: var(--a-hero-btn); border: 1px solid var(--a-hero-btn-line); color: var(--a-hero-btn-fg); }
.link-card .link-copy-btn:hover { background: var(--a-hero-btn-hover); filter: none; }
.link-rotate-btn { flex: none; height: 42px; padding: 0 18px; border-radius: 13px; border: 1px solid var(--a-hero-line2); background: transparent; display: flex; align-items: center; font-size: 13.5px; font-weight: 600; color: var(--a-hero-text2); cursor: pointer; font-family: inherit; }
.link-rotate-btn:hover { border-color: var(--a-hero-line-strong); }

.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
@media (max-width: 700px) { .stat-grid { grid-template-columns: minmax(0, 1fr); } }
.stat-grid.admin-overview-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 700px) { .stat-grid.admin-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat-card { padding: 22px; border-radius: 20px; background: var(--a-hero-bg); border: 1px solid var(--a-hero-line); color: var(--a-hero-text); }
.stat-label { font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--a-ok-text); }
.stat-value { font-size: 24px; font-weight: 800; letter-spacing: -.8px; margin-top: 11px; color: var(--a-hero-text); }
.stat-note { font-size: 12.5px; color: var(--a-hero-text2); margin-top: 5px; }

.loc-panel { margin-top: 16px; padding: 24px; border-radius: 22px; background: var(--a-hero-bg); border: 1px solid var(--a-hero-line); color: var(--a-hero-text); }
.loc-panel-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.loc-panel-title { font-size: 16px; font-weight: 700; letter-spacing: -.3px; color: var(--a-hero-text); }
.loc-panel-hint { font-size: 12.5px; color: var(--a-hero-text2); }
.loc-pick-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 11px; margin-top: 16px; }
@media (max-width: 700px) { .loc-pick-grid { grid-template-columns: repeat(2, 1fr); } }
.loc-pick-card { padding: 16px; border-radius: 16px; cursor: pointer; transition: .15s; background: var(--a-hero-overlay); border: 1px solid var(--a-hero-line); }
.loc-pick-card:hover:not(.selected) { border-color: var(--a-hero-line-strong); }
.loc-pick-card.selected { background: rgba(72,222,214,.16); border-color: rgba(72,222,214,.44); }
.loc-pick-flag { font-size: 24px; }
.loc-pick-name { font-size: 13.5px; font-weight: 700; margin-top: 10px; color: var(--a-hero-text); }
.loc-pick-meta { font-size: 11.5px; color: var(--a-hero-text3); margin-top: 2px; }
.loc-pick-badge { margin-top: 10px; font-size: 11.5px; font-weight: 700; color: var(--a-hero-text3); }
.loc-pick-card.selected .loc-pick-badge { color: var(--a-ok-text); }

/* --- Devices tab --- */
.dev-list { display: flex; flex-direction: column; gap: 11px; }
.dev-row { padding: 20px 24px; border-radius: 20px; background: var(--a-card); border: 1px solid var(--a-line); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.dev-icon { width: 44px; height: 44px; flex: none; border-radius: 13px; background: var(--a-card-soft); display: flex; align-items: center; justify-content: center; font-size: 19px; color: var(--a-ok-text); }
.dev-name { font-size: 15px; font-weight: 700; }
.dev-meta { font-size: 12.5px; color: var(--a-hint-soft); margin-top: 3px; }
.dev-state { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; }
.dev-state.on { color: var(--a-ok-text); }
.dev-state.off { color: var(--a-placeholder); }
.dev-state .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.dev-remove-btn { height: 38px; padding: 0 17px; border-radius: 12px; border: 1px solid var(--a-bad-line); color: var(--a-bad); display: flex; align-items: center; font-size: 13px; font-weight: 700; cursor: pointer; background: var(--a-bad-tint-bg); font-family: inherit; }
.dev-remove-btn:hover { background: var(--a-bad-bg); }
.dev-add-slot { padding: 24px; border-radius: 20px; border: 1.5px dashed #cfdee1; display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 14px; font-weight: 700; color: var(--a-hint); cursor: pointer; }
.dev-add-slot:hover { border-color: var(--a-accent); color: var(--a-ok-text); }
.dev-more-card { margin-top: 16px; padding: 22px 24px; border-radius: 20px; background: var(--a-card); border: 1px solid var(--a-line); display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.dev-more-title { font-size: 15px; font-weight: 700; }
.dev-more-note { font-size: 13px; color: var(--a-hint-soft); margin-top: 4px; }
.dev-more-btn { height: 42px; padding: 0 20px; border-radius: 13px; background: var(--a-card-soft); border: 1px solid var(--a-line); display: flex; align-items: center; font-size: 13.5px; font-weight: 700; color: var(--a-ok-text); cursor: pointer; margin-left: auto; }

/* --- Billing tab --- */
.bill-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
@media (max-width: 900px) { .bill-plans { grid-template-columns: 1fr; } }
.bill-plans.bill-plans-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .bill-plans.bill-plans-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .bill-plans.bill-plans-4 { grid-template-columns: 1fr; } }
.bill-card { position: relative; display: flex; flex-direction: column; padding: 28px; border-radius: 22px; background: var(--a-card); border: 1px solid var(--a-line); }
.bill-badge { position: absolute; top: 20px; right: 20px; height: 24px; padding: 0 11px; border-radius: 99px; background: var(--a-warn-bg); border: 1px solid var(--a-warn-line); display: flex; align-items: center; font-size: 10.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: var(--a-warn-text); }
.bill-badge.stars { background: var(--a-ok-bg); border-color: var(--a-ok-line); color: var(--a-ok-text); }
.bill-name { font-size: 17px; font-weight: 700; }
.bill-desc { font-size: 13px; color: var(--a-hint); margin-top: 6px; line-height: 1.5; min-height: 38px; }
.bill-price-row { display: flex; align-items: baseline; gap: 6px; margin-top: 16px; }
.bill-price { font-size: 34px; font-weight: 800; letter-spacing: -1.3px; color: var(--a-placeholder); }
.bill-unit { font-size: 13px; color: var(--a-hint); }
.bill-items { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--a-line-soft); }
.bill-items div { display: flex; gap: 8px; font-size: 13px; line-height: 1.4; color: var(--a-hint); }
.bill-cta { margin-top: auto; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; background: var(--a-card-soft); color: var(--a-hint); cursor: default; border: none; width: 100%; font-family: inherit; }
.bill-cta.active { background: linear-gradient(var(--a-accent), var(--a-accent-dk)); color: #fff; cursor: pointer; }
.bill-cta.active:hover { filter: brightness(1.1); }
.bill-cta.active:disabled { opacity: .6; cursor: default; }
.bill-history { margin-top: 20px; padding: 24px; border-radius: 22px; background: var(--a-card); border: 1px solid var(--a-line); }
.bill-history-title { font-size: 16px; font-weight: 700; letter-spacing: -.3px; }
.bill-history-empty { font-size: 13.5px; color: var(--a-hint-soft); margin-top: 10px; }

/* --- Settings tab --- */
.settings-wrap { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.settings-card { padding: 24px; border-radius: 22px; background: var(--a-card); border: 1px solid var(--a-line); }
.settings-title { font-size: 16px; font-weight: 700; }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 15px 0; border-bottom: 1px solid var(--a-line-soft); gap: 12px; }
.settings-row:last-child { border-bottom: none; }
.settings-label { font-size: 13.5px; color: var(--a-hint); }
.settings-value { font-size: 13.5px; font-weight: 700; }
.settings-desc { font-size: 13px; color: var(--a-hint-soft); margin-top: 8px; line-height: 1.55; }
.settings-links { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; justify-content: center; }
.settings-link-btn { height: 42px; padding: 0 18px; border-radius: 13px; background: var(--a-card-soft); border: 1px solid var(--a-line); display: flex; align-items: center; font-size: 13.5px; font-weight: 700; color: var(--a-ok-text); }
.settings-link-btn.outline { background: transparent; color: var(--a-text); font-weight: 600; }

.lang-switch { display: flex; gap: 3px; padding: 3px; border-radius: 10px; background: var(--a-card-soft); border: 1px solid var(--a-line); }
.lang-switch-btn { padding: 6px 15px; border-radius: 8px; font-size: 12.5px; font-weight: 700; cursor: pointer; color: var(--a-hint); background: transparent; border: none; font-family: inherit; }
.lang-switch-btn.active { background: var(--a-pill-active-bg); color: var(--a-pill-active-fg); box-shadow: var(--a-pill-shadow); }

/* auth всегда тёмная (в отличие от dashboard, у которого есть отдельная
   светлая тема) — --a-card-soft/--a-line/--a-pill-active-bg по умолчанию
   светлые (для dashboard[data-theme=light]), поэтому здесь переключатель
   RU/EN выглядел белым "островком" на тёмном фоне. Те же значения, что и у
   .seg-btn (Регистрация/Вход на той же странице). Landing.html эту кнопку
   не показывает и этот файл не подключает (свой style.css) — не трогаем. */
body[data-page="auth"] .lang-switch {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.14);
}
body[data-page="auth"] .lang-switch-btn {
  color: rgba(234,247,248,.6);
}
body[data-page="auth"] .lang-switch-btn.active {
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.28);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.24);
}

.settings-subtitle { font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--a-hint); margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--a-line-soft); }
.login-history-list { display: flex; flex-direction: column; margin-top: 6px; }
.login-history-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--a-line-soft); font-size: 12.5px; }
.login-history-row:last-child { border-bottom: none; }
.login-history-device { flex: 1; min-width: 0; font-weight: 700; color: var(--a-text); }
.login-history-ip { color: var(--a-hint-soft); font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
.login-history-time { color: var(--a-hint-soft); white-space: nowrap; }
.login-history-action { flex: none; white-space: nowrap; }
.login-history-current { font-size: 11.5px; font-weight: 700; color: var(--a-ok-text); }
.login-history-revoked { font-size: 11.5px; color: var(--a-hint-soft); }
.login-history-revoke-btn { height: 30px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--a-bad-line); background: var(--a-bad-tint-bg); color: var(--a-bad); font-size: 11.5px; font-weight: 700; cursor: pointer; font-family: inherit; }
.login-history-revoke-btn:hover { background: var(--a-bad-bg); }
.login-history-revoke-btn:disabled { opacity: .6; cursor: default; }
.login-history-empty { font-size: 12.5px; color: var(--a-hint-soft); margin-top: 6px; }
@media (max-width: 640px) {
  .login-history-row { flex-wrap: wrap; row-gap: 6px; }
  .login-history-device { flex: 1 1 100%; order: 1; }
  .login-history-action { order: 2; margin-left: auto; }
  .login-history-ip { order: 3; }
  .login-history-time { order: 4; margin-left: auto; }
}

.bill-split { display: flex; gap: 8px; margin-top: auto; padding-top: 22px; }
.bill-split-btn { flex: 1; min-height: 52px; height: auto; padding: 8px 6px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: default; border: none; font-family: inherit; background: var(--a-card-soft); color: var(--a-hint); }
.bill-split-price { font-size: 14px; font-weight: 800; white-space: nowrap; }
.bill-split-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; text-align: center; }
.bill-split-btn.stars:not(.locked) { background: var(--a-accent); color: #eafcff; cursor: pointer; }
.bill-split-btn.stars:not(.locked):hover { filter: brightness(1.15); }
.bill-split-btn.rub { background: var(--a-accent); border: none; color: #eafcff; cursor: pointer; }
.bill-split-btn.rub:hover { filter: brightness(1.15); }
.bill-split-btn.locked { background: transparent; border: 1.5px solid var(--a-ok-line); color: var(--a-ok-text); cursor: pointer; }
.bill-split-btn.locked:hover { background: var(--a-ok-bg); }
.bill-split-btn.locked .bill-split-price { color: var(--a-ok-text); }
.bill-split-btn.sbp { background: var(--a-accent); border: none; color: #eafcff; cursor: pointer; }
.bill-split-btn.sbp:hover { filter: brightness(1.15); }

.faq-card-list { display: flex; flex-direction: column; margin-top: 4px; }
.faq-card-row { border-bottom: 1px solid var(--a-line-soft); }
.faq-card-row:last-child { border-bottom: none; }
.faq-card-q { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 0; cursor: pointer; font-size: 14px; font-weight: 700; }
.faq-card-chev { font-size: 10px; color: var(--a-hint-soft); transition: transform .2s; flex: none; }
.faq-card-row.open .faq-card-chev { transform: rotate(180deg); }
.faq-card-a { max-height: 0; overflow: hidden; transition: max-height .25s ease; font-size: 13.5px; color: var(--a-hint); line-height: 1.55; }
.faq-card-row.open .faq-card-a { max-height: 300px; padding-bottom: 15px; }

/* --- Toast --- */
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px); padding: 12px 22px; border-radius: 14px; background: var(--a-accent-dk); color: #fff; font-size: 13.5px; font-weight: 600; box-shadow: 0 12px 30px rgba(7,28,41,.3); z-index: 40; opacity: 0; pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- Поддержка: чат/тикеты --- */
.chat-box { display: flex; flex-direction: column; gap: 12px; }
.chat-messages { display: flex; flex-direction: column; gap: 10px; max-height: 480px; overflow-y: auto; padding: 20px; border-radius: 22px; background: var(--a-card); border: 1px solid var(--a-line); }
.chat-bubble { max-width: 70%; padding: 12px 15px; border-radius: 16px; font-size: 13.5px; line-height: 1.5; word-break: break-word; }
.chat-bubble.mine { align-self: flex-end; background: linear-gradient(var(--a-accent), var(--a-accent-dk)); color: #fff; border-bottom-right-radius: 4px; }
.chat-bubble.theirs { align-self: flex-start; background: var(--a-card-soft); color: var(--a-text); border-bottom-left-radius: 4px; }
.chat-bubble-time { font-size: 10.5px; opacity: .65; margin-top: 4px; }
.chat-empty { text-align: center; color: var(--a-hint-soft); font-size: 13px; padding: 30px 0; }
.chat-input-row { display: flex; gap: 10px; }

.ticket-row { padding: 18px 22px; border-radius: 18px; background: var(--a-card); border: 1px solid var(--a-line); display: flex; align-items: center; gap: 14px; cursor: pointer; }
.ticket-row:hover { border-color: var(--a-accent); }
.ticket-row-id { font-weight: 800; }
.ticket-row-meta { font-size: 12.5px; color: var(--a-hint-soft); flex: 1; }
.ticket-row-badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--a-warn-bg); color: var(--a-warn-text); }

/* --- Payment modal --- */
.pay-modal { position: fixed; inset: 0; background: rgba(7,28,41,.55); display: flex; align-items: center; justify-content: center; z-index: 50; animation: fade .2s; }
.pay-modal-box { position: relative; width: 380px; max-width: calc(100vw - 40px); background: var(--a-hero-bg, #fff); border-radius: 24px; padding: 40px 28px 28px; text-align: center; box-sizing: border-box; animation: up .3s cubic-bezier(.2,.9,.2,1); }
.pay-modal-close { position: absolute; top: 14px; left: 14px; width: 30px; height: 30px; border-radius: 10px; background: var(--a-card-soft); border: 1px solid var(--a-line); display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--a-hint); cursor: pointer; }
.pay-modal-close:hover { background: var(--a-line); }
.pay-modal-spinner { width: 42px; height: 42px; margin: 0 auto; border-radius: 50%; border: 3px solid var(--a-line); border-top-color: var(--a-accent); animation: spin .8s linear infinite; }
.pay-modal-check { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; background: var(--a-ok); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; animation: pop .4s; }
.pay-modal-title { font-size: 18px; font-weight: 800; margin-top: 18px; }
.pay-modal-text { font-size: 13.5px; color: var(--a-hint); line-height: 1.55; margin-top: 8px; }
.pay-modal-box .btn-primary { margin-top: 22px; }
.method-list { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; max-height: 340px; overflow-y: auto; }
.method-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 14px 16px; border-radius: 14px; border: none; cursor: pointer;
  background: var(--a-card-soft); color: var(--a-text); font-family: inherit; font-size: 14.5px; font-weight: 700;
  text-align: left;
}
.method-row:hover { background: var(--a-accent); color: #eafcff; }
.method-row-arrow { opacity: .5; font-weight: 400; }
.method-row:hover .method-row-arrow { opacity: 1; }
.method-row-icon { width: 20px; height: 20px; flex: none; border-radius: 50%; background: var(--a-line); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; }
.crypto-onramp-links { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.crypto-onramp-link { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--a-card-soft); border: 1px solid var(--a-line); font-size: 13.5px; font-weight: 700; color: var(--a-text); text-align: left; }
.crypto-onramp-link:hover { border-color: var(--a-ok-line); }
.crypto-onramp-icon { flex: none; color: var(--a-ok-text); }
.crypto-onramp-disclaimer { font-size: 11.5px; color: var(--a-hint-soft); line-height: 1.5; margin-top: 10px; }
.crypto-price-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; padding: 12px 14px; border-radius: 14px; background: var(--a-card-soft); font-size: 13px; color: var(--a-hint); }
.crypto-price-value { font-size: 16px; font-weight: 800; color: var(--a-text); }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* --- How-to-connect modal (device picker / steps / support) --- */
.howto-icon-badge { width: 56px; height: 56px; margin: 0 auto; border-radius: 18px; background: var(--a-card-soft); border: 1px solid var(--a-line); display: flex; align-items: center; justify-content: center; color: var(--a-accent); }
.howto-device-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 26px; }
.howto-device-card { padding: 22px 12px; border-radius: 20px; background: var(--a-card-soft); border: 1.5px solid transparent; display: flex; flex-direction: column; align-items: center; gap: 12px; cursor: pointer; transition: .15s; text-align: center; }
.howto-device-card:hover { border-color: var(--a-line-soft); }
.howto-device-card.selected { background: rgba(72,222,214,.14); border-color: rgba(72,222,214,.4); }
.howto-device-icon { display: flex; align-items: center; justify-content: center; color: var(--a-hint); transition: .15s; }
.howto-device-card.selected .howto-device-icon { color: var(--a-ok-text); }
.howto-device-name { font-size: 14px; font-weight: 700; color: var(--a-text); }
.howto-steps { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.howto-step { display: flex; gap: 12px; align-items: flex-start; }
.howto-step-num { flex: none; width: 24px; height: 24px; border-radius: 50%; background: rgba(72,222,214,.18); color: var(--a-ok-text); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; }
.howto-step-text { font-size: 13.5px; color: var(--a-text); line-height: 1.5; padding-top: 2px; }

/* --- Mobile bottom nav (dashboard) --- */
.app-bottom-nav { display: none; }
.app-bottom-nav .app-nav-item svg { flex: none; }

/* --- Dashboard: dark theme (default) --- */
body[data-page="dashboard"] {
  --a-bg: #0a2530;
  --a-text: #eaf7f8;
  --a-hint: rgba(234,247,248,.6);
  --a-hint-soft: rgba(234,247,248,.48);
  --a-placeholder: rgba(234,247,248,.38);
  --a-line: rgba(255,255,255,.14);
  --a-line-soft: rgba(255,255,255,.09);
  --a-card: #123f4a;
  --a-card-soft: rgba(255,255,255,.06);
  --a-warn-bg: rgba(245,196,81,.14);
  --a-warn-line: rgba(245,196,81,.36);
  --a-warn-text: #f5c451;
  --a-bad-bg: rgba(255,120,120,.14);
  --a-bad-line: rgba(255,150,150,.35);
  --a-bad: #ff9b9b;
  --a-bad-tint-bg: rgba(255,120,120,.08);
  --a-ok-text: oklch(0.8 0.12 172);
  --a-ok-bg: rgba(72,222,214,.14);
  --a-ok-line: rgba(72,222,214,.36);
  --a-pill-active-bg: rgba(72,222,214,.18);
  --a-pill-active-fg: #eafcff;
  --a-pill-shadow: none;
  --a-hero-bg: linear-gradient(150deg,#0f4a58,#0b3341);
  --a-hero-line: rgba(255,255,255,.1);
  --a-hero-line2: rgba(255,255,255,.24);
  --a-hero-line-strong: rgba(255,255,255,.4);
  --a-hero-text: #eaf7f8;
  --a-hero-text2: rgba(234,247,248,.66);
  --a-hero-text3: rgba(234,247,248,.55);
  --a-hero-inset: rgba(0,0,0,.26);
  --a-hero-track: rgba(255,255,255,.14);
  --a-hero-overlay: rgba(255,255,255,.05);
  --a-hero-btn: rgba(255,255,255,.16);
  --a-hero-btn-hover: rgba(255,255,255,.26);
  --a-hero-btn-line: rgba(255,255,255,.3);
  --a-hero-btn-fg: #fff;
}
body[data-page="dashboard"] .auth-field { background: var(--a-hero-inset); color: var(--a-text); border-color: var(--a-line); }
body[data-page="dashboard"] .auth-field::placeholder { color: var(--a-placeholder); }
body[data-page="dashboard"] .pay-modal-close { background: var(--a-card-soft); border-color: var(--a-line); color: var(--a-hint); }

/* --- Dashboard: light theme --- */
body[data-page="dashboard"][data-theme="light"] {
  --a-bg: #f2f6f7;
  --a-text: #0d1f24;
  --a-hint: #5f8189;
  --a-hint-soft: #7f9ba1;
  --a-placeholder: #9ab0b5;
  --a-line: #dde8ea;
  --a-line-soft: #eef3f4;
  --a-card: #ffffff;
  --a-card-soft: #eef4f5;
  --a-warn-bg: #fff4d9;
  --a-warn-line: #f0d79b;
  --a-warn-text: #9a7215;
  --a-bad-bg: #fdf1f1;
  --a-bad-line: #f0d6d6;
  --a-bad: #c25353;
  --a-bad-tint-bg: #ffffff;
  --a-ok-text: oklch(0.5 0.1 192);
  --a-ok-bg: #e6f5f2;
  --a-ok-line: #b7e2d9;
  --a-pill-active-bg: #ffffff;
  --a-pill-active-fg: #0d1f24;
  --a-pill-shadow: 0 2px 6px rgba(13,63,75,.12);
  --a-hero-bg: #ffffff;
  --a-hero-line: #dde8ea;
  --a-hero-line2: #cfdee1;
  --a-hero-line-strong: #b7cdd1;
  --a-hero-text: #0d1f24;
  --a-hero-text2: #5f8189;
  --a-hero-text3: #7f9ba1;
  --a-hero-inset: #eef4f5;
  --a-hero-track: #e4edef;
  --a-hero-overlay: #f5f9fa;
  --a-hero-btn: linear-gradient(var(--a-accent), var(--a-accent-dk));
  --a-hero-btn-hover: var(--a-accent-dk);
  --a-hero-btn-line: transparent;
  --a-hero-btn-fg: #fff;
}
body[data-page="dashboard"][data-theme="light"] .auth-field { background: #fff; }

/* --- Mobile dashboard: bottom nav layout --- */
@media (max-width: 860px) {
  .app-mobile-brand { display: flex; }
  .app-main { padding-bottom: 106px; }

  .app-bottom-nav {
    display: flex; gap: 4px; position: fixed; left: 8px; right: 8px; bottom: 10px; z-index: 20;
    padding: 6px; border-radius: 20px; background: rgba(6,26,36,.9); backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.12); box-shadow: 0 14px 34px rgba(0,0,0,.35);
  }
  .app-bottom-nav .app-nav-item {
    flex: 1; min-width: 0; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 8px 2px; border-radius: 14px; font-size: 9.5px; text-align: center;
  }
  .app-bottom-nav .app-nav-item svg { width: 19px; height: 19px; }
}

/* --- Shared bits --- */
.msg { font-size: 13px; padding: 11px 14px; border-radius: 12px; margin-top: 12px; display: none; }
.msg.show { display: block; }
.msg.err { background: var(--a-bad-bg); color: var(--a-bad); }
.msg.ok { background: var(--a-ok-bg); color: var(--a-ok-text); }
.skeleton { text-align: center; padding: 60px 0; color: var(--a-hint); }
