/* Quarvix Cabinet — design system */
:root {
  --bg: #09090f;
  --surface: #12121a;
  --surface-raised: #181824;
  --border: #262636;
  --border-subtle: #1e1e2c;
  --text: #ededf2;
  --text-secondary: #a1a1b5;
  --text-tertiary: #6b6b80;
  --accent: #6366f1;
  --accent-soft: rgba(99, 102, 241, 0.14);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.12);
  --danger: #ef4444;
  --telegram: #2aabee;

  /* Type scale — 1.25 ratio, base 16px */
  --text-xs: 0.75rem;    /* 12 */
  --text-sm: 0.875rem;   /* 14 */
  --text-base: 1rem;     /* 16 */
  --text-lg: 1.125rem;   /* 18 */
  --text-xl: 1.25rem;    /* 20 */
  --text-2xl: 1.5rem;    /* 24 */

  /* Spacing — 4px grid */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body.page-glow {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.22), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(139, 92, 246, 0.12), transparent),
    var(--bg);
}

a { color: var(--accent); text-decoration: none; }

/* ── Layout ── */
.page-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}

.container {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-10);
}

/* ── Typography ── */
.t-page-title {
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.3;
  margin-bottom: var(--space-5);
}

.t-card-title {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.t-body {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.55;
}

.t-caption {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.t-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.3;
}

.t-price {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-top: var(--space-4);
}

.t-price span {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

/* ── Icons ── */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon svg { display: block; }

/* ── Header ── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  min-height: 40px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: inherit;
  text-decoration: none;
}

.header-brand .brand-name {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.user-bar .user-email {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-bar .btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.user-bar .btn-icon:hover {
  background: var(--surface-raised);
  color: var(--text);
}

/* ── Status bar ── */
.status-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-5);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  align-self: start;
  margin-top: 6px;
}
.status-dot.inactive { background: var(--text-tertiary); }

.status-bar .meta { min-width: 0; }

.status-bar .value {
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: var(--space-1);
}

.status-bar .hint {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

.status-bar .status-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Steps ── */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.step {
  padding: var(--space-3) var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: 1.35;
}

.step-num {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 2px;
}

.step.active {
  color: var(--text);
  background: var(--accent-soft);
  border-color: rgba(99, 102, 241, 0.3);
}

.step.done { color: var(--success); }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-3);
}

.card.featured {
  border-color: rgba(99, 102, 241, 0.45);
  background: linear-gradient(165deg, var(--accent-soft) 0%, var(--surface) 50%);
}

.card + .card { margin-top: var(--space-3); }

.card .sub { margin-top: var(--space-1); }

.card .btn { margin-top: var(--space-5); }

.card .btn + .btn { margin-top: var(--space-2); }

/* ── Tariff row ── */
.tariff-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.tariff-head .icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Device hero (connect / download) ── */
.device-hero {
  text-align: center;
  padding: var(--space-2) 0 var(--space-4);
}

.device-hero .icon-lg {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.device-hero .icon-lg.icon-success {
  background: var(--success-soft);
  border-color: rgba(34, 197, 94, 0.25);
  color: var(--success);
}

.device-hero .t-card-title { margin-bottom: var(--space-2); }

.device-hero .sub { margin-top: 0; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 48px;
  padding: 0 var(--space-5);
  border-radius: var(--radius-sm);
  border: none;
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  color: #fff;
}
.btn:hover { opacity: 0.92; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--accent); }
.btn-success { background: var(--success); }
.btn-secondary {
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-telegram { background: var(--telegram); }

.btn-sm {
  min-height: 40px;
  padding: 0 var(--space-4);
  font-size: var(--text-sm);
}

.btn-row {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.btn-row .btn { flex: 1; }

/* ── Link box ── */
.link-box {
  margin-top: var(--space-5);
  padding: var(--space-4);
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.link-box .link-url {
  margin-top: var(--space-2);
  padding: var(--space-3);
  background: var(--surface-raised);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.5;
  word-break: break-all;
  max-height: 72px;
  overflow-y: auto;
}

.link-box .link-url-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: none;
  outline: none;
  cursor: text;
  max-height: none;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}

/* ── QR ── */
.qr-section { margin-top: var(--space-5); text-align: center; }
.qr-section .t-body { margin-bottom: var(--space-3); }

.qr-wrap {
  display: inline-block;
  padding: var(--space-3);
  background: #fff;
  border-radius: var(--radius-sm);
}
.qr-wrap img { display: block; width: 176px; height: 176px; }

/* ── Devices list ── */
.devices-list {
  margin-top: var(--space-6);
}

.devices-list .t-label {
  margin-bottom: var(--space-3);
  display: block;
}

.device-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
}

.device-item .name {
  flex: 1;
  font-weight: 500;
  color: var(--text);
}

.device-item .ip {
  font-family: var(--mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* ── Auth pages ── */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: max(var(--space-4), env(safe-area-inset-top)) var(--space-5) max(var(--space-6), env(safe-area-inset-bottom));
}
.auth-page.one-screen {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  justify-content: flex-start;
  padding: max(8px, env(safe-area-inset-top)) var(--space-4) max(12px, env(safe-area-inset-bottom));
  gap: 12px;
}
.auth-header {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  margin-bottom: var(--space-6);
  flex-shrink: 0;
}
.one-screen .auth-header {
  margin-bottom: 0;
}
.auth-back {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1.1rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.auth-back:hover {
  background: var(--surface);
  color: var(--text);
}
.auth-header .auth-logo {
  justify-self: center;
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 6px 18px rgba(99,102,241,0.4));
}
.one-screen .auth-header .auth-logo {
  width: 36px;
  height: 36px;
}
.auth-header-spacer { width: 36px; }
.auth-hero {
  text-align: center;
  margin-bottom: var(--space-6);
  flex-shrink: 0;
}
.one-screen .auth-hero {
  margin-bottom: 0;
}
.auth-hero h1 {
  font-size: clamp(1.5rem, 6vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: linear-gradient(135deg, #fff 0%, #e0e7ff 50%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: var(--space-1);
}
.one-screen .auth-hero h1 {
  font-size: clamp(1.25rem, 5.5vw, 1.5rem);
}
.auth-hero p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.4;
  max-width: 300px;
  margin: 0 auto;
}
.one-screen .auth-hero p {
  font-size: var(--text-xs);
}
.auth-form {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.one-screen .auth-form {
  flex: 0 0 auto;
  gap: 8px;
}
.field {
  margin-bottom: var(--space-4);
}
.field label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-2);
}
.field input[type=email],
.field input[type=password],
.auth-form input[type=email],
.auth-form input[type=password] {
  width: 100%;
  height: 52px;
  padding: 0 var(--space-4);
  margin-bottom: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(18,18,26,0.6);
  color: var(--text);
  font-family: inherit;
  font-size: var(--text-base);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.one-screen .auth-form input[type=email],
.one-screen .auth-form input[type=password] {
  height: 44px;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}
.field input:focus,
.auth-form input:focus {
  outline: none;
  border-color: rgba(99,102,241,0.6);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.auth-actions {
  margin-top: 0;
  padding-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-shrink: 0;
}
.one-screen .auth-actions {
  margin-top: 4px;
  padding-top: 0;
  gap: 0;
}
.auth-actions .btn-hero {
  margin-bottom: var(--space-4);
}
.one-screen .auth-actions .btn-hero {
  margin-bottom: 8px;
  min-height: 44px;
  font-size: var(--text-base);
  box-shadow: 0 6px 20px rgba(99,102,241,0.3);
}
.btn-compact {
  min-height: 42px !important;
  font-size: var(--text-sm) !important;
}
.divider-tight {
  margin: 6px 0 !important;
}
.auth-hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-align: center;
  margin-top: var(--space-3);
}
.auth-link-tight {
  margin-top: 12px !important;
  padding: 10px 12px;
  font-size: var(--text-sm) !important;
  font-weight: 600 !important;
  color: #c4b5fd !important;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 12px;
}
.one-screen .err {
  min-height: 0;
  margin-bottom: var(--space-1);
  font-size: var(--text-xs);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: var(--space-8) var(--space-6);
}

.auth-logo {
  text-align: center;
  margin-bottom: var(--space-8);
}

.auth-logo .icon-lg { margin: 0 auto var(--space-4); }

.auth-logo h1 {
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.auth-logo p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-2);
}

label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

input[type=email],
input[type=password] {
  width: 100%;
  height: 48px;
  padding: 0 var(--space-4);
  margin-bottom: var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: var(--text-base);
}
input:focus {
  outline: none;
  border-color: var(--accent);
}

.err {
  font-size: var(--text-sm);
  color: var(--danger);
  margin-bottom: var(--space-3);
  min-height: 20px;
}

.divider {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin: var(--space-5) 0;
  position: relative;
}
.divider::before,
.divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--border);
}
.divider::before { left: 0; }
.divider::after { right: 0; }

.auth-link {
  display: block;
  text-align: center;
  margin-top: var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  color: #c4b5fd;
  text-decoration: none;
  transition: color 0.15s ease;
}
.auth-link:hover {
  color: #e9d5ff;
}

.auth-soon {
  margin: 0;
  padding: 10px 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  user-select: none;
}

/* ── Landing (fastaccess redesign) ── */
.fa-page {
  --fa-bg: #0a0a0f;
  --fa-surface: rgba(255, 255, 255, 0.03);
  --fa-border: rgba(255, 255, 255, 0.08);
  --fa-text-primary: #ffffff;
  --fa-text-secondary: rgba(255, 255, 255, 0.55);
  --fa-accent-purple: #7c3aed;
  --fa-accent-blue: #2563eb;
  --fa-accent-cyan: #06b6d4;
  --fa-glass: rgba(255, 255, 255, 0.06);
  font-family: var(--font);
  background: var(--fa-bg);
  color: var(--fa-text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.fa-page ::-webkit-scrollbar { display: none; }

.fa-bg-blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.fa-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: faBlobFloat 12s ease-in-out infinite;
}
.fa-blob-1 {
  width: 300px;
  height: 300px;
  background: var(--fa-accent-purple);
  top: -80px;
  left: -60px;
}
.fa-blob-2 {
  width: 250px;
  height: 250px;
  background: var(--fa-accent-blue);
  bottom: 10%;
  right: -80px;
  animation-delay: -4s;
}
.fa-blob-3 {
  width: 200px;
  height: 200px;
  background: var(--fa-accent-cyan);
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  animation-delay: -8s;
  opacity: 0.2;
}
@keyframes faBlobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}
.fa-noise {
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: 0.03;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px;
}
.fa-app-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(48px, env(safe-area-inset-top)) 24px max(32px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}
.fa-logo-wrapper {
  position: relative;
  margin-bottom: 8px;
}
.fa-logo-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, rgba(124,58,237,0.35) 0%, transparent 70%);
  border-radius: 50%;
  opacity: 0.8;
}
.fa-logo {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #7c3aed 0%, #3b82f6 50%, #06b6d4 100%);
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}
.fa-logo svg {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}
.fa-hero {
  text-align: center;
  margin-top: 32px;
  margin-bottom: 8px;
}
.fa-hero-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fa-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  background: var(--fa-glass);
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--fa-border);
  backdrop-filter: blur(10px);
}
.fa-hero-label::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 8px #22c55e;
  animation: faStatusBlink 2s ease-in-out infinite;
}
@keyframes faStatusBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.fa-hero-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.fa-gradient-text {
  background: linear-gradient(135deg, #fff 0%, #a78bfa 50%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.fa-hero-subtitle {
  font-size: 15px;
  color: var(--fa-text-secondary);
  line-height: 1.5;
  max-width: 280px;
  margin: 0 auto;
}
.fa-social-showcase {
  display: flex;
  gap: 12px;
  margin: 28px 0;
  padding: 16px 20px;
  background: var(--fa-glass);
  border: 1px solid var(--fa-border);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}
.fa-social-showcase::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}
.fa-social-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.fa-social-icon:active { transform: scale(0.92); }
.fa-social-icon.fa-instagram { background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.fa-social-icon.fa-youtube { background: #ff0000; }
.fa-social-icon.fa-telegram { background: #0088cc; }
.fa-social-icon.fa-whatsapp { background: #25d366; }
.fa-social-icon svg { width: 24px; height: 24px; fill: white; }
.fa-platforms {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  margin-bottom: 32px;
}
.fa-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--fa-surface);
  border: 1px solid var(--fa-border);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fa-text-secondary);
}
.fa-chip.fa-active {
  background: rgba(124, 58, 237, 0.15);
  border-color: rgba(124, 58, 237, 0.3);
  color: #c4b5fd;
}
.fa-chip svg { width: 14px; height: 14px; opacity: 0.7; }
.fa-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
}
.fa-btn {
  width: 100%;
  padding: 16px 24px;
  border-radius: 16px;
  border: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  -webkit-user-select: none;
  text-decoration: none;
}
.fa-btn:active { transform: scale(0.97); }
.fa-btn-primary {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: white;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35), inset 0 1px 0 rgba(255,255,255,0.15);
}
.fa-btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}
.fa-btn-primary:active::after { transform: translateX(100%); }
.fa-btn-secondary {
  background: var(--fa-surface);
  color: var(--fa-text-primary);
  border: 1px solid var(--fa-border);
  backdrop-filter: blur(10px);
}
.fa-btn-telegram {
  background: linear-gradient(135deg, #0088cc 0%, #00a8e8 100%);
  color: white;
  box-shadow: 0 4px 20px rgba(0, 136, 204, 0.3);
}
.fa-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.fa-home-indicator {
  width: 120px;
  height: 5px;
  background: rgba(255,255,255,0.15);
  border-radius: 100px;
  margin: 20px auto 0;
}
.fa-fade-up {
  opacity: 0;
  transform: translateY(20px);
  animation: faFadeUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.fa-delay-1 { animation-delay: 0.1s; }
.fa-delay-2 { animation-delay: 0.2s; }
.fa-delay-3 { animation-delay: 0.3s; }
.fa-delay-4 { animation-delay: 0.4s; }
.fa-delay-5 { animation-delay: 0.5s; }
.fa-delay-6 { animation-delay: 0.6s; }
@keyframes faFadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Landing (legacy) ── */
.landing {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  padding: max(var(--space-6), env(safe-area-inset-top)) var(--space-5) max(var(--space-8), env(safe-area-inset-bottom));
  text-align: center;
  position: relative;
  overflow: hidden;
  max-width: 440px;
  margin: 0 auto;
}
.landing.one-screen {
  height: 100dvh;
  max-height: 100dvh;
  justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) var(--space-4) max(14px, env(safe-area-inset-bottom));
}
.landing::before {
  content: '';
  position: absolute;
  width: 120%;
  height: 55%;
  top: -8%;
  left: 50%;
  transform: translateX(-50%);
  background:
    radial-gradient(ellipse at 30% 20%, rgba(225,48,108,0.14), transparent 55%),
    radial-gradient(ellipse at 70% 15%, rgba(99,102,241,0.2), transparent 50%),
    radial-gradient(ellipse at 50% 40%, rgba(37,211,102,0.08), transparent 60%);
  pointer-events: none;
}
.landing-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-8);
  flex-shrink: 0;
}
.one-screen.landing .landing-top {
  margin-bottom: 0;
}
.landing-logo {
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 8px 24px rgba(99,102,241,0.45));
}
.one-screen .landing-logo {
  width: 48px;
  height: 48px;
}
.landing-hero {
  position: relative;
  margin-bottom: var(--space-8);
  flex-shrink: 0;
}
.one-screen .landing-hero {
  margin-bottom: 0;
}
.hero-eyebrow {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
  margin-bottom: var(--space-2);
}
.one-screen .hero-eyebrow {
  font-size: var(--text-xs);
  margin-bottom: var(--space-1);
}
.hero-title {
  font-size: clamp(1.65rem, 7vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  background: linear-gradient(135deg, #fff 0%, #e0e7ff 45%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: var(--space-3);
}
.one-screen .hero-title {
  font-size: clamp(1.35rem, 6vw, 1.65rem);
  margin-bottom: 0;
  line-height: 1.2;
}
.hero-sub {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 300px;
  margin: 0 auto;
}
.device-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  flex-shrink: 0;
}
.one-screen .device-strip {
  margin-bottom: 0;
  gap: 6px;
}
.device-strip span {
  font-size: 11px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
.one-screen .device-strip span {
  font-size: 10px;
  padding: 4px 10px;
}
.device-strip span.muted {
  opacity: 0.55;
  border-style: dashed;
}
.landing .actions {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex-shrink: 0;
}
.one-screen .actions {
  gap: var(--space-2);
}
.btn-hero {
  min-height: 54px;
  font-size: var(--text-lg);
  font-weight: 600;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 28px rgba(99,102,241,0.35);
}
.one-screen .btn-hero {
  min-height: 46px;
  font-size: var(--text-base);
}
@media (min-width: 480px) {
  .landing:not(.one-screen) {
    justify-content: center;
    padding-top: var(--space-10);
  }
  .landing:not(.one-screen) .landing-top { margin-bottom: var(--space-10); }
}
@media (max-height: 640px) {
  .one-screen .auth-hero h1,
  .one-screen .hero-title { font-size: 1.2rem; }
  .one-screen .auth-form input { height: 40px; }
  .one-screen .btn-hero { min-height: 42px; }
  .one-screen .btn-compact { min-height: 38px !important; }
}

/* ── Site footer (legal + support) ── */
.site-footer {
  flex-shrink: 0;
  width: 100%;
  padding: 12px 16px max(16px, env(safe-area-inset-bottom));
  text-align: center;
}
.one-screen .site-footer {
  margin-top: auto;
  padding-top: 8px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}
.dash-page .site-footer {
  padding-top: 6px;
  padding-bottom: 0;
}
.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 10px;
  font-size: 11px;
  line-height: 1.4;
}
.site-footer-nav a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.15s ease;
}
.site-footer-nav a:hover {
  color: #a78bfa;
  text-decoration: underline;
}
.site-footer-sep {
  color: rgba(255, 255, 255, 0.2);
  user-select: none;
}
.fa-app-container .site-footer {
  padding-left: 0;
  padding-right: 0;
  margin-top: 12px;
}

/* ── Legal document pages ── */
.legal-page {
  min-height: 100dvh;
}
.legal-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
.legal-top {
  margin-bottom: 20px;
  flex-shrink: 0;
}
.legal-back {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
}
.legal-back:hover {
  color: #a78bfa;
}
.legal-doc {
  flex: 1;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px 20px;
  margin-bottom: 16px;
}
.legal-doc h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.legal-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 0 0 20px;
}
.legal-prose h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 20px 0 8px;
  color: #e2e8f0;
}
.legal-prose p,
.legal-prose li {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 10px;
}
.legal-prose ul {
  margin: 0 0 12px;
  padding-left: 20px;
}
.legal-prose a {
  color: #a78bfa;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Utilities ── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }

#toast {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: var(--text-sm);
  z-index: 10000;
  max-width: calc(100vw - 32px);
}

#loader {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 15, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
#loader.on { display: flex; }

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Auth split layout ── */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .auth-shell { grid-template-columns: 1fr 1fr; }
}
.auth-side {
  display: none;
  padding: var(--space-10);
  background: linear-gradient(145deg, rgba(99,102,241,0.18) 0%, rgba(139,92,246,0.08) 50%, transparent 100%);
  border-right: 1px solid var(--border-subtle);
  flex-direction: column;
  justify-content: center;
}
@media (min-width: 900px) {
  .auth-side { display: flex; }
}
.auth-side h2 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  max-width: 360px;
}
.auth-side p {
  margin-top: var(--space-4);
  color: var(--text-secondary);
  max-width: 340px;
  font-size: var(--text-base);
}
.auth-side .features {
  margin-top: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.auth-side .feat {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.auth-side .feat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}
.auth-card.glass {
  background: rgba(18, 18, 26, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px rgba(0,0,0,0.35);
}

/* ── Device picker ── */
.device-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.device-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  text-align: center;
  font-family: inherit;
  color: var(--text);
}
.device-tile:hover:not(:disabled) {
  border-color: rgba(99,102,241,0.5);
  background: var(--surface-raised);
  transform: translateY(-1px);
}
.device-tile.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(99,102,241,0.25);
}
.device-tile:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.device-tile .tile-name {
  font-size: var(--text-sm);
  font-weight: 600;
}
.device-tile .tile-badge {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(255,255,255,0.08);
  color: var(--text-tertiary);
}
.device-tile .icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

/* ── Home dashboard ── */
.home-hero {
  text-align: center;
  padding: var(--space-2) 0 var(--space-6);
}
.conn-ring {
  width: 88px;
  height: 88px;
  margin: 0 auto var(--space-5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--success-soft);
  border: 2px solid rgba(34,197,94,0.35);
  color: var(--success);
  position: relative;
}
.conn-ring::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(34,197,94,0.15);
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.15); opacity: 0; }
}
.conn-status {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--success);
  margin-bottom: var(--space-2);
}
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin: var(--space-5) 0;
}
.stat-card {
  padding: var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  text-align: left;
}
.stat-card.full { grid-column: 1 / -1; }
.stat-card .stat-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat-card .stat-value {
  margin-top: var(--space-1);
  font-size: var(--text-base);
  font-weight: 600;
  font-family: var(--mono);
  color: var(--text);
}
.stat-card .stat-value.accent { color: var(--accent); font-family: var(--font); }
.speed-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-2);
}
.speed-item {
  flex: 1;
  text-align: center;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
}
.speed-item .dir {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}
.speed-item .val {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-top: 2px;
  font-family: var(--mono);
}
.btn-connect {
  min-height: 56px;
  font-size: var(--text-lg);
  font-weight: 600;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(34,197,94,0.25);
}
.connect-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: var(--space-4);
}
.btn-copy-link {
  min-height: 48px;
  font-size: var(--text-base);
  font-weight: 600;
  border-radius: var(--radius-md);
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: var(--text-primary);
}
.btn-copy-link:hover {
  border-color: rgba(96, 165, 250, 0.45);
  color: #fff;
}
.download-hint {
  margin-top: var(--space-4);
  text-align: center;
}
.download-hint a {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.download-hint a:hover { color: var(--accent); }

.container.wide { max-width: 480px; }

/* ── Dashboard one-screen ── */
.dash-page.one-screen {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: max(12px, env(safe-area-inset-top)) var(--space-4) max(14px, env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse 90% 55% at 50% 0%, rgba(124, 58, 237, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse 70% 40% at 50% 100%, rgba(34, 197, 94, 0.06) 0%, transparent 50%);
}
.dash-header {
  margin-bottom: var(--space-3) !important;
  min-height: 48px !important;
  padding: 4px 0 8px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.dash-header .header-brand {
  gap: 10px;
}
.dash-brand-name {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #e9d5ff 0%, #a78bfa 50%, #818cf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.dash-header .user-email {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  max-width: 160px;
}
.dash-header .btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.dash-steps {
  margin-bottom: var(--space-3) !important;
  flex-shrink: 0;
  gap: 8px;
  position: relative;
  z-index: 2;
}
.dash-steps .step {
  padding: 12px 8px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.25;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}
.dash-steps .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 0;
  margin-right: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  vertical-align: middle;
}
.dash-steps .step.active {
  color: #fff;
  font-weight: 700;
  background: linear-gradient(145deg, rgba(124, 58, 237, 0.28) 0%, rgba(99, 102, 241, 0.14) 100%);
  border-color: rgba(167, 139, 250, 0.45);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.2);
}
.dash-steps .step.active .step-num {
  background: rgba(167, 139, 250, 0.35);
  color: #fff;
}
.dash-steps .step.done {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.2);
}
.dash-steps .step.done .step-num {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}
.dash-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  padding: 0 0 8px;
}
.dash-body.dash-body-scroll {
  overflow-y: auto;
  scrollbar-width: none;
}
.dash-body.dash-body-scroll::-webkit-scrollbar {
  display: none;
}
.dash-body.dash-body-center {
  justify-content: center;
}
.dash-body.dash-body-home {
  justify-content: flex-start;
  padding-top: 4px;
}
.dash-screen-tariff .dash-title {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.2rem;
}
.tariffs-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.tariff-card-item {
  border: 1px solid rgba(167, 139, 250, 0.22);
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
}
.tariff-card-item.featured {
  border-color: rgba(167, 139, 250, 0.45);
  background: linear-gradient(145deg, rgba(124, 58, 237, 0.18) 0%, rgba(99, 102, 241, 0.08) 100%);
}
.tariff-card-item .tariff-price {
  font-size: 1.35rem;
  font-weight: 800;
  color: #e9d5ff;
  margin: 8px 0 10px;
}
.tariff-card-item .tariff-meta {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 10px;
}
.tariff-empty {
  padding: 16px;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
}
#userStatus .progress-bar {
  height: 6px;
  background: #1e293b;
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}
#userStatus #trafficProgress {
  height: 100%;
  width: 0;
  background: #22c55e;
  border-radius: 3px;
  transition: width 0.3s ease;
}
.dash-screen {
  flex: 0 0 auto;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.dash-screen-home {
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
}
.dash-screen-home .dash-card {
  flex: 0 0 auto;
}
.dash-screen-home #userStatus {
  margin-top: 0 !important;
}
.dash-screen.hidden { display: none !important; }
.dash-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fafafa;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.device-grid-compact {
  flex: 0 0 auto;
  margin-bottom: 12px;
  gap: 10px;
  align-content: start;
  grid-auto-rows: auto;
}
.device-grid-compact .device-tile {
  padding: 14px 10px;
  gap: 10px;
  min-height: 0;
  height: auto;
  align-self: start;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}
.device-grid-compact .device-tile .tile-name {
  font-size: 15px;
  font-weight: 700;
  color: #fafafa;
}
.device-grid-compact .device-tile.selected {
  border-color: #a78bfa;
  background: rgba(124, 58, 237, 0.22);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.35);
}
.device-grid-compact .device-tile.selected .tile-name {
  color: #fff;
}
.device-grid-compact .icon-wrap {
  width: 44px;
  height: 44px;
  color: #c4b5fd;
}
.device-grid-compact .device-tile .tile-badge {
  font-size: 9px;
  padding: 3px 7px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
}
#deviceScreen .btn-hero {
  flex-shrink: 0;
  margin-top: 4px;
  min-height: 50px;
  font-size: 16px;
  font-weight: 600;
}
#deviceScreen .btn-hero:disabled {
  opacity: 0.45;
}
.card-compact {
  padding: var(--space-4) !important;
  margin-bottom: var(--space-2) !important;
}
.card-compact .btn { margin-top: var(--space-3) !important; }
.tariff-head-compact .icon-wrap {
  width: 36px !important;
  height: 36px !important;
}
.tariff-head-compact .t-card-title {
  font-size: var(--text-sm) !important;
}
.tariff-head-compact .sub {
  font-size: 11px !important;
  margin-top: 0 !important;
}
.t-price-compact {
  font-size: var(--text-xl) !important;
  margin-top: var(--space-2) !important;
}

/* Home dashboard compact */
.dash-card {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  padding: 20px 18px;
  background: linear-gradient(165deg, rgba(28, 25, 42, 0.96) 0%, rgba(15, 15, 20, 0.98) 100%);
  border: 1px solid rgba(167, 139, 250, 0.22);
  border-radius: 18px;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.dash-status {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: 16px;
  flex-shrink: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.status-pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(34,197,94,0.5);
  animation: statusPulse 2s ease-out infinite;
  flex-shrink: 0;
}
@keyframes statusPulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.45); }
  70% { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.dash-status-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--success);
  line-height: 1.2;
}
.dash-status-sub {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 4px;
  line-height: 1.35;
}
.dash-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
  flex-shrink: 0;
}
.metric {
  padding: 14px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.metric-node {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12) 0%, rgba(255, 255, 255, 0.03) 100%);
  border-color: rgba(167, 139, 250, 0.2);
}
.metric-wide { grid-column: 1 / -1; }
.metric-speed {
  display: flex;
  gap: 6px;
  padding: 0;
  background: transparent;
  border: none;
}
.speed-pill {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.m-label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.48);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 6px;
}
.metric-speed .m-label {
  display: block;
  margin-bottom: 4px;
}
.m-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fafafa;
  line-height: 1.3;
  word-break: break-word;
}
.m-val.mono { font-family: var(--mono); font-size: 1rem; }
.metric-wide .m-val {
  font-size: 1.1rem;
  color: #d8b4fe;
  font-weight: 800;
}
.metric-speed .m-val {
  font-size: 1.05rem;
}
.btn-connect {
  min-height: 54px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(34, 197, 94, 0.28);
  margin-top: 4px;
  flex-shrink: 0;
}
.dash-card .download-hint {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.dash-card .download-hint a {
  font-size: 13px;
  font-weight: 600;
  color: #a78bfa;
}
.dash-hint-text {
  margin: 8px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
  line-height: 1.4;
}
@media (max-height: 680px) {
  .dash-status-title { font-size: var(--text-base); }
  .dash-metrics { gap: 4px; margin-bottom: var(--space-2); }
  .metric { padding: 6px 8px; }
  .btn-connect { min-height: 44px; font-size: var(--text-sm); }
  .dash-card { padding: var(--space-3); }
}
@media (max-width: 480px) {
  .dash-page.one-screen {
    padding-left: 12px;
    padding-right: 12px;
  }
  .dash-steps .step {
    padding: 10px 4px;
    font-size: 11px;
  }
  .dash-steps .step-num {
    width: 18px;
    height: 18px;
    font-size: 10px;
    margin-right: 4px;
  }
  .dash-body.dash-body-home {
    padding-top: 2px;
  }
  .dash-status {
    margin-bottom: 12px;
    padding-bottom: 10px;
  }
  .dash-status-title {
    font-size: 1.05rem;
  }
  .dash-status-sub {
    font-size: 12px;
  }
  .dash-card {
    padding: 14px 12px;
  }
  .dash-metrics {
    gap: 8px;
    margin-bottom: 12px;
  }
  .metric {
    padding: 10px;
  }
  .btn-connect {
    min-height: 48px;
    font-size: 0.95rem;
  }
  .dash-header .user-email {
    max-width: 120px;
    font-size: 12px;
  }
}
