/* Reverium account — dark theme matching landing */

:root {
  --bg-0: #0b0d10;
  --bg-1: #13161b;
  --bg-2: #1a1e25;
  --bg-3: #242932;
  --bg-card: #15181d;
  --text-0: #e8e9eb;
  --text-1: #c1c4c9;
  --text-2: #8a8e96;
  --text-3: #5a5e66;
  --border-1: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.14);
  --accent: #b8864a;
  --accent-soft: rgba(184, 134, 74, 0.12);
  --accent-border: rgba(184, 134, 74, 0.4);
  --success: #3ecf71;
  --success-soft: rgba(62, 207, 113, 0.10);
  --warning: #f0a830;
  --danger: #e05252;
  --danger-soft: rgba(224, 82, 82, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text-0);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01";
}

body {
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover { color: var(--text-0); }

button { font-family: inherit; }

/* ─────────────── Splash ─────────────── */

#splash {
  position: fixed;
  inset: 0;
  background: var(--bg-0);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 9999;
  transition: opacity 0.3s, visibility 0.3s;
}
#splash[data-hidden] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splash-mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg-2);
  color: var(--accent);
  font-weight: 700;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.splash-text {
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ─────────────── Login ─────────────── */

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}
.auth-card {
  width: 380px;
  max-width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-1);
  border-radius: 16px;
  padding: 36px 32px;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.auth-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-brand-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-0);
}
.auth-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.01em;
}
.auth-sub {
  margin: 0 0 22px;
  color: var(--text-2);
  font-size: 13px;
}

/* ─────────────── Forms ─────────────── */

.field { margin-bottom: 14px; }
.label {
  display: block;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: 8px;
  color: var(--text-0);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.input:focus {
  border-color: var(--accent-border);
  background: var(--bg-1);
}
.input.mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
  text-align: center;
}

/* OTP — 6 boxes inline */
.otp-row {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}
.otp-cell {
  width: 100%;
  aspect-ratio: 1;
  text-align: center;
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: 8px;
  color: var(--text-0);
  font-family: "JetBrains Mono", monospace;
  font-size: 20px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s;
}
.otp-cell:focus {
  border-color: var(--accent);
  background: var(--bg-1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #1a1a1a;
}
.btn-primary:hover {
  background: #c89556;
}
.btn-primary:disabled {
  background: var(--bg-3);
  color: var(--text-3);
  cursor: not-allowed;
}
.btn-secondary {
  background: transparent;
  color: var(--text-1);
  border-color: var(--border-2);
}
.btn-secondary:hover {
  background: var(--bg-2);
  color: var(--text-0);
}
.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover {
  color: var(--text-0);
  background: var(--bg-2);
}
.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(224, 82, 82, 0.4);
}
.btn-danger:hover {
  background: var(--danger-soft);
}
.btn-block { width: 100%; }
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.error-msg {
  margin-top: 10px;
  padding: 9px 12px;
  background: var(--danger-soft);
  border: 1px solid rgba(224, 82, 82, 0.3);
  border-radius: 6px;
  color: var(--danger);
  font-size: 12px;
}
.success-msg {
  margin-top: 10px;
  padding: 9px 12px;
  background: var(--success-soft);
  border: 1px solid rgba(62, 207, 113, 0.3);
  border-radius: 6px;
  color: var(--success);
  font-size: 12px;
}

/* ─────────────── Shell layout ─────────────── */

.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-1);
  border-right: 1px solid var(--border-1);
  padding: 24px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 22px;
}
.sidebar-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--bg-2);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-brand-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-0);
}
.sidebar-section {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 14px 10px 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 7px;
  color: var(--text-1);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.12s;
  text-decoration: none;
  position: relative;
}
.sidebar-link:hover {
  background: var(--bg-2);
  color: var(--text-0);
  transform: translateX(2px);
}
.sidebar-link.active {
  background: var(--accent-soft);
  color: var(--accent);
}
/* Active link gleam — vertical bar слева, как в Linear / Vercel */
.sidebar-link.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.sidebar-link-icon {
  width: 16px;
  text-align: center;
  font-size: 13px;
  opacity: 0.8;
}
.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-1);
  font-size: 11px;
  color: var(--text-3);
}
.sidebar-user {
  padding: 10px;
  border-radius: 8px;
  background: var(--bg-2);
  margin-bottom: 8px;
}
.sidebar-user-email {
  font-size: 12px;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user-plan {
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 4px;
}

.main {
  padding: 36px 48px 60px;
  max-width: 1100px;
  width: 100%;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 28px;
  gap: 24px;
  flex-wrap: wrap;
  position: relative;
}
/* Premium gleam — subtle accent gradient over hero title.
   На больших экранах даёт ощущение «brand splash». */
.page-header::before {
  content: "";
  position: absolute;
  top: -40px;
  left: -40px;
  width: 280px;
  height: 140px;
  background: radial-gradient(
    ellipse at center,
    rgba(184, 134, 74, 0.10) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: -1;
}
.page-title {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-0);
  font-family: "Inter Display", "Inter", sans-serif;
}
.page-sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-2);
}

/* ─────────────── Cards ─────────────── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-1);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 18px;
  transition: border-color 0.15s;
}
.card:hover {
  border-color: var(--border-2);
}
.card-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-0);
}
.card-sub {
  margin: 0 0 18px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}

/* Stats — 4-column responsive grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border-1);
  border-radius: 12px;
  padding: 18px 20px;
  transition: border-color 0.15s, transform 0.12s;
}
.stat:hover {
  border-color: var(--border-2);
  transform: translateY(-1px);
}
.stat-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}
.stat-value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-0);
  font-feature-settings: "tnum";
}
.stat-meta {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 6px;
}

/* Plan badge */
.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  letter-spacing: 0.12em;
  font-weight: 600;
  text-transform: uppercase;
}
.plan-badge.pro {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}
.plan-badge.lite {
  background: var(--bg-3);
  color: var(--text-2);
  border: 1px solid var(--border-2);
}
.plan-badge.trial {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(62, 207, 113, 0.3);
}
.plan-badge.studio {
  background: linear-gradient(90deg, var(--accent-soft), rgba(184, 134, 74, 0.04));
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

/* Progress bar */
.progress {
  height: 6px;
  background: var(--bg-2);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 10px;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
}
.progress-bar.warn { background: var(--warning); }
.progress-bar.danger { background: var(--danger); }
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-2);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

/* ─────────────── Tables ─────────────── */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-1);
}
.table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border-1);
  color: var(--text-1);
  vertical-align: middle;
}
.table tr:last-child td {
  border-bottom: none;
}
.table tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}
.table .mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--text-2);
}
.table .actions {
  text-align: right;
  white-space: nowrap;
}
.table .actions button + button {
  margin-left: 4px;
}

.empty-state {
  padding: 56px 24px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  border: 1px dashed var(--border-2);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.15);
}
.empty-state-title {
  color: var(--text-1);
  font-size: 14px;
  margin-bottom: 4px;
  font-weight: 500;
}

/* ─────────────── Subscription cards ─────────────── */

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border-1);
  border-radius: 14px;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
}
.plan-card.current {
  border-color: var(--accent-border);
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg-card) 80%);
}
.plan-card-name {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 8px;
}
.plan-card-price {
  font-size: 32px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}
.plan-card-period {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 18px;
}
.plan-card-features {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  flex: 1;
}
.plan-card-features li {
  padding: 5px 0;
  font-size: 13px;
  color: var(--text-1);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.plan-card-features li::before {
  content: "✓";
  color: var(--accent);
  font-weight: 600;
  flex-shrink: 0;
}
.plan-card-features li.off {
  color: var(--text-3);
}
.plan-card-features li.off::before {
  content: "—";
  color: var(--text-3);
}

/* ─────────────── Misc ─────────────── */

.row-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.kv-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-1);
  font-size: 13px;
}
.kv-row:last-child { border-bottom: none; }
.kv-key { color: var(--text-2); }
.kv-val { color: var(--text-0); }

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.activity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border-1);
}
.activity-row:last-child { border-bottom: none; }
.activity-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--accent);
  flex-shrink: 0;
}
.activity-text { flex: 1; color: var(--text-1); }
.activity-time {
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.copy-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--text-1);
  cursor: pointer;
  transition: background 0.12s;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copy-pill:hover {
  background: var(--bg-3);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-0);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  animation: toastIn 0.2s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-3);
}

/* Skeleton loaders — структурные placeholders вместо одного spinner'а.
   Даёт ощущение что страница уже частично загружена. Shimmer-anim
   подсказывает что идёт работа. */
@keyframes skeletonShimmer {
  0% { background-position: -800px 0; }
  100% { background-position: 800px 0; }
}
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-2) 0%,
    var(--bg-3) 50%,
    var(--bg-2) 100%
  );
  background-size: 800px 100%;
  animation: skeletonShimmer 1.4s infinite linear;
  border-radius: 4px;
  display: inline-block;
}
.skel-stat { height: 84px; border-radius: 12px; width: 100%; }
.skel-row { height: 48px; border-radius: 6px; width: 100%; margin-bottom: 6px; }
.skel-title { height: 22px; width: 160px; margin-bottom: 12px; }
.skel-text { height: 12px; width: 100%; margin-bottom: 6px; }
.skel-text.short { width: 60%; }

/* Modal — для copy-id reveal и других overlay */
.modal-backdrop-acc {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 800;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box-acc {
  background: var(--bg-card);
  border: 1px solid var(--border-1);
  border-radius: 14px;
  padding: 24px;
  max-width: 420px;
  width: 90%;
}

/* ─────────────── Onboarding wizard ─────────────── */

.onb-overlay {
  position: fixed;
  inset: 0;
  z-index: 9800;
  background: rgba(11, 13, 16, 0.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  animation: onb-fade-in 280ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.onb-overlay.closing { animation: onb-fade-out 200ms ease forwards; }
@keyframes onb-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes onb-fade-out {
  to { opacity: 0; }
}
.onb-card {
  background: var(--bg-1, #13161b);
  border: 1px solid var(--border-2, rgba(255,255,255,0.16));
  border-radius: 18px;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 0;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(184, 134, 74, 0.08);
  animation: onb-slide-up 380ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes onb-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.onb-progress {
  padding: 22px 28px 0;
}
.onb-progress-bar {
  height: 2px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}
.onb-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #a8743b, #d4884e);
  transition: width 420ms cubic-bezier(0.16, 1, 0.3, 1);
}
.onb-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3, #5a5e66);
}
.onb-skip {
  background: transparent;
  border: 0;
  color: var(--text-3, #5a5e66);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.15s;
}
.onb-skip:hover { color: var(--text-1, #c1c4c9); }
.onb-content {
  padding: 28px 36px 20px;
}
.onb-hero-mark {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  background: var(--bg-2, #1a1e25);
  color: var(--accent, #b8864a);
  font-weight: 700;
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.onb-title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-0, #e8e9eb);
  line-height: 1.2;
}
.onb-sub {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2, #8a8e96);
}
.onb-sub code {
  font-family: "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  background: rgba(184, 134, 74, 0.08);
  color: var(--accent, #b8864a);
  padding: 2px 6px;
  border-radius: 4px;
}
.onb-fineprint {
  margin: 20px 0 0;
  font-size: 12px;
  color: var(--text-3, #5a5e66);
  line-height: 1.6;
}
.onb-fineprint code {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  background: rgba(255,255,255,0.04);
  padding: 1px 5px;
  border-radius: 3px;
}
.onb-checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
}
.onb-checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-1, #c1c4c9);
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.onb-checklist li:last-child { border-bottom: 0; }
.onb-checklist strong {
  color: var(--text-0, #e8e9eb);
  font-weight: 500;
}
.onb-check {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #6fb38a;
  background: rgba(111, 179, 138, 0.12);
  border-radius: 50%;
  flex-shrink: 0;
}
.onb-field {
  display: block;
  margin-bottom: 16px;
}
.onb-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-2, #8a8e96);
  margin-bottom: 6px;
  font-weight: 500;
}
.onb-optional {
  color: var(--text-3, #5a5e66);
  font-weight: 400;
}
.onb-hint {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-3, #5a5e66);
}
.onb-username-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--bg-0, #0b0d10);
  border: 1px solid var(--border-1, rgba(255,255,255,0.08));
  border-radius: 9px;
  transition: border-color 0.15s;
}
.onb-username-row:focus-within {
  border-color: var(--accent, #b8864a);
  box-shadow: 0 0 0 3px rgba(184, 134, 74, 0.10);
}
.onb-username-at {
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--accent, #b8864a);
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
}
.onb-username {
  background: transparent !important;
  border: 0 !important;
  flex: 1;
  font-family: "JetBrains Mono", monospace;
  padding: 12px 4px;
}
.onb-username-status {
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.onb-username-status.available { color: #6fb38a; }
.onb-username-status.taken     { color: #e07a52; }
.onb-username-status.invalid   { color: #e07a52; }
.onb-username-status.checking::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--border-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: onb-spin 0.7s linear infinite;
}
@keyframes onb-spin { to { transform: rotate(360deg); } }
.onb-textarea {
  min-height: 64px;
  resize: vertical;
  font-family: inherit;
}
.onb-toggle {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-0, #0b0d10);
  border: 1px solid var(--border-1, rgba(255,255,255,0.08));
  border-radius: 11px;
  cursor: pointer;
  margin-bottom: 12px;
  transition: border-color 0.15s, background 0.15s;
}
.onb-toggle:hover {
  border-color: var(--border-2, rgba(255,255,255,0.16));
}
.onb-toggle input { display: none; }
.onb-toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
  background: rgba(255,255,255,0.10);
  border-radius: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  transition: background 0.15s;
}
.onb-toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--text-0, #e8e9eb);
  border-radius: 50%;
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
.onb-toggle input:checked ~ .onb-toggle-switch {
  background: var(--accent, #b8864a);
}
.onb-toggle input:checked ~ .onb-toggle-switch::after {
  transform: translateX(16px);
}
.onb-toggle-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 14px;
  color: var(--text-0, #e8e9eb);
  line-height: 1.4;
}
.onb-toggle-label strong { font-weight: 500; }
.onb-toggle-label small {
  font-size: 12px;
  color: var(--text-2, #8a8e96);
  font-weight: 400;
}
.onb-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 4px 0 8px;
}
.onb-plan {
  position: relative;
  background: var(--bg-0, #0b0d10);
  border: 1px solid var(--border-1, rgba(255,255,255,0.08));
  border-radius: 12px;
  padding: 16px 16px 14px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
  color: var(--text-0, #e8e9eb);
  font-family: inherit;
}
.onb-plan:hover {
  border-color: var(--border-2, rgba(255,255,255,0.16));
  transform: translateY(-1px);
}
.onb-plan.selected {
  border-color: var(--accent, #b8864a);
  background: rgba(184, 134, 74, 0.06);
  box-shadow: 0 0 0 3px rgba(184, 134, 74, 0.10);
}
.onb-plan-badge {
  position: absolute;
  top: -8px;
  right: 12px;
  background: var(--accent, #b8864a);
  color: var(--bg-0, #0b0d10);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}
.onb-plan-name {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-1, #c1c4c9);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.onb-plan-price {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-0, #e8e9eb);
  margin-bottom: 12px;
}
.onb-plan-price span {
  font-size: 12px;
  color: var(--text-2, #8a8e96);
  font-weight: 400;
  letter-spacing: 0;
}
.onb-plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
}
.onb-plan-features li {
  font-size: 12px;
  color: var(--text-2, #8a8e96);
  padding: 3px 0;
  position: relative;
  padding-left: 14px;
  line-height: 1.5;
}
.onb-plan-features li::before {
  content: '·';
  position: absolute;
  left: 4px;
  color: var(--accent, #b8864a);
  font-weight: 700;
}
.onb-actions {
  padding: 16px 28px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-1, rgba(255,255,255,0.08));
}
.onb-actions .btn-primary { min-width: 140px; }

/* ─────────────── Mobile ─────────────── */

@media (max-width: 760px) {
  .shell {
    grid-template-columns: 1fr;
    padding-bottom: 72px;
    /* Safe-area для iPhone notch + home indicator */
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
  /* Sidebar → fixed bottom-tabbar (native iOS / Android pattern) */
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    z-index: 100;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 6px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    gap: 4px;
    border-right: none;
    border-top: 1px solid var(--border-1);
    border-bottom: none;
    background: rgba(19, 22, 27, 0.92);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    /* hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar-brand,
  .sidebar-section,
  .sidebar-footer,
  .sidebar-user { display: none; }
  .sidebar-link {
    flex-shrink: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    min-width: 64px;
    gap: 2px;
    font-size: 10px;
    border-radius: 8px;
    text-align: center;
  }
  .sidebar-link-icon {
    font-size: 16px;
    width: auto;
  }
  .sidebar-link:hover {
    transform: none;
  }
  /* Active indicator → bronze dot сверху (вместо vertical bar) */
  .sidebar-link.active::before {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: -2px;
    width: 16px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    bottom: auto;
  }

  .main {
    padding: 20px 16px 36px;
    max-width: 100%;
  }

  /* Plans → 1 column */
  .plan-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .plan-card {
    padding: 20px 18px;
  }

  /* Stats → 1 column */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Typography compact */
  .page-title {
    font-size: 22px;
  }
  .page-header {
    margin-bottom: 22px;
  }
  .page-header::before {
    width: 200px;
    height: 100px;
    top: -30px;
    left: -20px;
  }

  /* Cards tighter padding */
  .card {
    padding: 18px 16px;
    border-radius: 12px;
  }
  .card-title {
    font-size: 14px;
  }

  /* Tables → horizontal scroll wrapper.
     Сами tr остаются — нативный scroll работает корректно. */
  .card .table,
  .main .table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .table th, .table td {
    padding: 10px 8px;
    font-size: 12px;
  }

  /* Action buttons row-actions → стек на узких */
  .row-actions {
    flex-wrap: wrap;
  }
  .row-actions .btn,
  .row-actions a {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
  }

  /* Modal — full-width на mobile */
  .modal-box-acc {
    max-width: 92%;
    padding: 20px;
  }

  /* Auth card — comfy padding */
  .auth-card {
    width: 100%;
    max-width: 380px;
    padding: 28px 22px;
    margin: 0 12px;
  }
  .otp-cell {
    font-size: 18px;
  }

  /* KV rows stack vertically — справа значения часто длинные */
  .kv-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 0;
  }
  .kv-val {
    font-size: 12px;
    word-break: break-word;
  }

  /* Touch-target sizing — minimum 44×44 для iOS HIG */
  .btn-sm {
    padding: 8px 14px;
    min-height: 36px;
  }
  .btn {
    min-height: 44px;
  }

  /* Input full width by default */
  .input,
  textarea.input {
    font-size: 16px; /* iOS Safari не zoomит при focus если ≥16px */
  }

  /* Toast — выше bottom-tabbar */
  .toast {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    left: 16px;
    right: 16px;
    transform: none;
    text-align: center;
  }
  /* Onboarding wizard на мобиле */
  .onb-overlay { padding: 16px 14px; }
  .onb-card {
    max-height: calc(100vh - 32px);
    border-radius: 14px;
  }
  .onb-progress { padding: 18px 22px 0; }
  .onb-content { padding: 22px 22px 16px; }
  .onb-actions { padding: 14px 22px 20px; }
  .onb-title { font-size: 21px; }
  .onb-sub { font-size: 14px; }
  .onb-plans { grid-template-columns: 1fr; }
}

/* Очень узкие phones (< 380px) — ещё более compact */
@media (max-width: 380px) {
  .sidebar-link {
    min-width: 56px;
    padding: 5px 6px;
  }
  .sidebar-link-icon { font-size: 14px; }
  .page-title { font-size: 20px; }
  .stat-value { font-size: 22px; }
}
