/* ===== VARIABLES ===== */
:root {
  --bg-primary: #0a0c16;
  --bg-secondary: #0f1221;
  --bg-card: #131630;
  --bg-card-hover: #181c3a;
  --bg-sidebar: #0c0e1c;
  --purple: #7c5cfc;
  --purple-light: #a78bfa;
  --purple-glow: rgba(124, 92, 252, 0.3);
  --purple-dim: rgba(124, 92, 252, 0.1);
  --green: #34d399;
  --green-glow: rgba(52, 211, 153, 0.3);
  --cyan: #22d3ee;
  --red: #e53e3e;
  --orange: #f59e0b;
  --yellow: #f0b429;
  --text-primary: #e8eaf0;
  --text-secondary: #8b8fa8;
  --text-dim: #555876;
  --border: rgba(124, 92, 252, 0.12);
  --border-hover: rgba(124, 92, 252, 0.3);
  --sidebar-w: 250px;
  --topbar-h: 64px;
  --bnav-h: 64px;
  --radius: 14px;
  --radius-sm: 10px;
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ===== GRID BACKGROUND ===== */
.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(124, 92, 252, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 92, 252, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* ===== LOADING ===== */
.cab-loading-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--text-dim);
}
.cab-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.cab-page-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  gap: 1rem;
  color: var(--text-dim);
}

/* ===== LOGIN SCREEN ===== */
.cab-login {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
}
.cab-login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3rem 2.5rem;
  max-width: 440px;
  width: 100%;
  position: relative;
  z-index: 1;
}
.cab-login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 2rem;
}
.cab-login-logo svg { width: 32px; height: 32px; }
.cab-login-logo span { font-size: 1.3rem; font-weight: 700; }
.cab-login-logo .accent { color: var(--purple); }

.cab-login-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.2rem;
  background: linear-gradient(135deg, #2AABEE, #229ED9);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cab-login-icon svg { width: 32px; height: 32px; fill: #fff; }
.cab-login-card h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.cab-login-card .desc { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1.5rem; line-height: 1.6; }
.cab-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.9rem 2rem;
  background: linear-gradient(135deg, #2AABEE, #229ED9);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(42, 171, 238, 0.3);
}
.cab-login-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 30px rgba(42, 171, 238, 0.4); }
.cab-login-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.cab-login-btn svg { width: 20px; height: 20px; fill: #fff; }
.cab-login-status { margin-top: 1rem; font-size: 0.85rem; color: var(--text-secondary); min-height: 1.4rem; }
.cab-login-status.polling { color: var(--purple-light); animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.cab-login-note {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.cab-login-note svg { width: 14px; height: 14px; stroke: var(--text-dim); fill: none; }

/* ===== APP LAYOUT ===== */
.cab-app {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ===== SIDEBAR ===== */
.cab-sidebar {
  width: var(--sidebar-w);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow-y: auto;
}
.cab-sidebar-header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
}
.cab-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.cab-sidebar-logo svg { width: 28px; height: 28px; flex-shrink: 0; }
.cab-sidebar-logo span { font-size: 1.15rem; font-weight: 700; }
.cab-sidebar-logo .accent { color: var(--purple); }

.cab-sidebar-nav {
  flex: 1;
  padding: 0.8rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.cab-nav-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.cab-nav-item:hover {
  color: var(--text-primary);
  background: var(--purple-dim);
}
.cab-nav-item.active {
  color: var(--text-primary);
  background: var(--purple-dim);
  border-left-color: var(--purple);
}
.cab-nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }

.cab-sidebar-footer {
  padding: 0.8rem;
  border-top: 1px solid var(--border);
}
.cab-sidebar-support {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 0.85rem;
  transition: all 0.2s;
}
.cab-sidebar-support:hover { color: var(--text-secondary); }
.cab-sidebar-support svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ===== CONTENT WRAPPER ===== */
.cab-content-wrapper {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== TOPBAR ===== */
.cab-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  background: rgba(10, 12, 22, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}
.cab-topbar-left { display: flex; align-items: center; gap: 1rem; }
.cab-topbar-title { font-size: 1.15rem; font-weight: 700; }
.cab-topbar-menu {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 0.4rem;
}
.cab-topbar-menu svg { width: 22px; height: 22px; }

.cab-topbar-right { display: flex; align-items: center; gap: 0.8rem; }

/* User badge */
.cab-user-badge {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.35rem 0.6rem 0.35rem 0.9rem;
  border-radius: 50px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s;
  position: relative;
}
.cab-user-badge:hover { border-color: var(--border-hover); }
.cab-user-badge-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cab-user-badge-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--purple);
  overflow: hidden;
  flex-shrink: 0;
}
.cab-user-badge-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* User dropdown */
.cab-user-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  min-width: 200px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 100;
  display: none;
  animation: dropIn 0.2s ease;
}
.cab-user-dropdown.open { display: block; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-8px); } }
.cab-dropdown-name { font-weight: 600; font-size: 0.95rem; }
.cab-dropdown-username { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 0.8rem; }
.cab-dropdown-sep { border: none; border-top: 1px solid var(--border); margin: 0.6rem 0; }
.cab-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.6rem;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: all 0.2s;
}
.cab-dropdown-btn:hover { background: var(--purple-dim); color: var(--text-primary); }
.cab-dropdown-btn svg { width: 16px; height: 16px; }

/* ===== MOBILE BOTTOM NAV ===== */
.cab-mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--bnav-h);
  background: rgba(10, 12, 22, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  align-items: center;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.cab-bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem 0.8rem;
  color: var(--text-dim);
  font-size: 0.65rem;
  font-weight: 500;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.cab-bnav-item svg { width: 22px; height: 22px; }
.cab-bnav-item.active { color: var(--purple-light); }
.cab-bnav-item:active { color: var(--purple); }

/* ===== PAGE CONTENT ===== */
.cab-page-content {
  flex: 1;
  padding: 2rem;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  animation: pageIn 0.25s ease;
}
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } }

/* ===== COMMON: Cards ===== */
.cab-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s;
}
.cab-card:hover { border-color: var(--border-hover); }
.cab-card-title {
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

/* ===== COMMON: Section ===== */
.cab-section {
  margin-bottom: 1.5rem;
}
.cab-section-header {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* ===== COMMON: Buttons ===== */
.cab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.cab-btn svg { width: 16px; height: 16px; }
.cab-btn-primary {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 2px 12px var(--purple-glow);
}
.cab-btn-primary:hover { background: #6a4ce8; transform: translateY(-1px); }
.cab-btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-hover);
}
.cab-btn-secondary:hover { border-color: var(--purple); color: var(--text-primary); }
.cab-btn-sm { padding: 0.5rem 1rem; font-size: 0.8rem; }
.cab-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.cab-btn-copy {
  padding: 0.6rem 1rem;
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.cab-btn-copy:hover { background: #6a4ce8; }
.cab-btn-copy.copied { background: var(--green); }

/* ===== COMMON: Inputs ===== */
.cab-input {
  padding: 0.7rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.cab-input:focus { border-color: var(--purple); }
.cab-input::placeholder { color: var(--text-dim); }
.cab-input-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== COMMON: Badge ===== */
.cab-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}
.cab-badge-green { background: rgba(52, 211, 153, 0.15); color: var(--green); }
.cab-badge-red { background: rgba(229, 62, 62, 0.15); color: var(--red); }
.cab-badge-orange { background: rgba(245, 158, 11, 0.15); color: var(--orange); }
.cab-badge-purple { background: var(--purple-dim); color: var(--purple-light); }
.cab-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ========================================================
   DASHBOARD PAGE
   ======================================================== */

/* Welcome */
.dash-welcome {
  margin-bottom: 1.5rem;
}
.dash-welcome h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.dash-welcome p {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Stats grid */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.dash-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.2s;
}
.dash-stat-card:hover { border-color: var(--border-hover); }
.dash-stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dash-stat-icon svg { width: 20px; height: 20px; }
.dash-stat-icon.purple { background: var(--purple-dim); color: var(--purple-light); }
.dash-stat-icon.green { background: rgba(52, 211, 153, 0.12); color: var(--green); }
.dash-stat-icon.cyan { background: rgba(34, 211, 238, 0.12); color: var(--cyan); }
.dash-stat-icon.orange { background: rgba(245, 158, 11, 0.12); color: var(--orange); }
.dash-stat-icon.red { background: rgba(229, 62, 62, 0.12); color: var(--red); }
.dash-stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
}
.dash-stat-label {
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

/* Sub summary card on dashboard */
.dash-sub-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.dash-sub-card.active { border-color: rgba(52, 211, 153, 0.3); }
.dash-sub-info { display: flex; align-items: center; gap: 0.8rem; }
.dash-sub-info h4 { font-size: 0.95rem; font-weight: 600; }
.dash-sub-info p { font-size: 0.8rem; color: var(--text-secondary); }
.dash-sub-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* Quick actions */
.dash-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.dash-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  transition: all 0.2s;
}
.dash-action-card:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: translateY(-2px);
}
.dash-action-card .icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--purple-dim);
  color: var(--purple-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dash-action-card .icon svg { width: 22px; height: 22px; }
.dash-action-card.accent .icon { background: var(--purple); color: #fff; }

/* ========================================================
   SUBSCRIPTION PAGE
   ======================================================== */

/* Status banner */
.sub-status-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}
.sub-status-banner.active {
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.2);
}
.sub-status-banner.expired {
  background: rgba(229, 62, 62, 0.08);
  border: 1px solid rgba(229, 62, 62, 0.2);
}
.sub-status-banner .icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sub-status-banner.active .icon { background: rgba(52, 211, 153, 0.15); color: var(--green); }
.sub-status-banner.expired .icon { background: rgba(229, 62, 62, 0.15); color: var(--red); }
.sub-status-banner .icon svg { width: 22px; height: 22px; }
.sub-status-text h3 { font-size: 1rem; font-weight: 600; }
.sub-status-text p { font-size: 0.8rem; color: var(--text-secondary); }

/* Subscription device toggle */
.sub-device-toggle {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 0.3rem;
  border: 1px solid var(--border);
  width: fit-content;
  margin-bottom: 1.2rem;
}
.sub-device-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.2rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}
.sub-device-btn svg { width: 16px; height: 16px; }
.sub-device-btn:hover { color: var(--text-primary); }
.sub-device-btn.active { background: var(--purple); color: #fff; }

/* Subscription details grid */
.sub-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}
.sub-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.sub-detail-label {
  font-size: 0.65rem;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}
.sub-detail-value {
  font-size: 0.95rem;
  font-weight: 500;
}

/* Progress bar */
.sub-progress {
  margin: 1.2rem 0;
}
.sub-progress-bar {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.sub-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.sub-progress-fill.green { background: var(--green); }
.sub-progress-fill.orange { background: var(--orange); }
.sub-progress-fill.red { background: var(--red); }
.sub-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Config URL row */
.sub-config {
  margin-top: 1.2rem;
}
.sub-config-label {
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}
.sub-config-row {
  display: flex;
  gap: 0.5rem;
}
.sub-config-note {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.sub-config-note svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Sub actions */
.sub-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.2rem;
  flex-wrap: wrap;
}

/* Connection guide */
.connect-guide {
  margin-top: 1.5rem;
}
.connect-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.connect-tab {
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.connect-tab:hover { border-color: var(--border-hover); }
.connect-tab.active {
  background: var(--purple-dim);
  border-color: var(--purple);
  color: var(--text-primary);
}
.connect-steps {
  counter-reset: step;
}
.connect-step {
  display: flex;
  gap: 0.8rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
}
.connect-step:last-child { border-bottom: none; }
.connect-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--purple-dim);
  color: var(--purple-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.connect-step-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.connect-step-text strong { color: var(--text-primary); }
.connect-step-text a {
  color: var(--purple-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* App download links */
.connect-apps {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.connect-apps-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.7rem;
}
.connect-apps-list {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.connect-app-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  position: relative;
}
.connect-app-link:hover {
  border-color: var(--purple);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}
.connect-app-link svg { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.5; }
.connect-app-link:hover svg { opacity: 1; }
.connect-app-link.recommended {
  border-color: var(--purple);
  background: var(--purple-dim);
  color: var(--text-primary);
}
.connect-app-badge {
  position: absolute;
  top: -8px;
  left: 0.6rem;
  padding: 0.1rem 0.5rem;
  background: var(--purple);
  color: #fff;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.connect-app-name { white-space: nowrap; }

/* Sub history */
.sub-history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}
.sub-history-row:last-child { border-bottom: none; }
.sub-history-name { font-size: 0.9rem; font-weight: 500; }
.sub-history-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.sub-history-date { font-size: 0.8rem; color: var(--text-dim); }
.sub-history-price { font-size: 0.8rem; color: var(--text-secondary); }

/* No sub */
.sub-no-active {
  text-align: center;
  padding: 3rem 1rem;
}
.sub-no-active .icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--purple-dim);
  color: var(--purple-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}
.sub-no-active .icon svg { width: 28px; height: 28px; }
.sub-no-active h3 { margin-bottom: 0.5rem; font-size: 1.1rem; }
.sub-no-active p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1.5rem; }

/* Trial card */
.trial-card {
  background: linear-gradient(135deg, rgba(124, 92, 252, 0.1), rgba(52, 211, 153, 0.08));
  border: 1px solid rgba(124, 92, 252, 0.25);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}
.trial-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--purple-dim);
  color: var(--purple-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.trial-card-icon svg { width: 24px; height: 24px; }
.trial-card-body h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.4rem; }
.trial-card-body p { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 1rem; line-height: 1.5; }

/* ========================================================
   SHOP PAGE
   ======================================================== */

.shop-balance-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.shop-balance-info svg { width: 20px; height: 20px; flex-shrink: 0; }
.shop-balance-info strong { color: var(--purple-light); font-size: 1rem; }

/* Device toggle */
.shop-device-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 0.3rem;
  border: 1px solid var(--border);
  width: fit-content;
}
.shop-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.2rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}
.shop-toggle-btn svg { width: 16px; height: 16px; }
.shop-toggle-btn:hover { color: var(--text-primary); }
.shop-toggle-btn.active {
  background: var(--purple);
  color: #fff;
}

.shop-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.shop-plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
  position: relative;
}
.shop-plan-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.shop-plan-card.popular { border-color: var(--purple); }
.shop-plan-badge {
  position: absolute;
  top: -10px;
  right: 1rem;
  padding: 0.2rem 0.7rem;
  background: var(--purple);
  color: #fff;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.shop-plan-name {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.shop-plan-price {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}
.shop-plan-price .currency {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.shop-plan-monthly {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}
.shop-plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  flex: 1;
}
.shop-plan-features li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.shop-plan-features li svg {
  width: 16px;
  height: 16px;
  color: var(--green);
  flex-shrink: 0;
}
.shop-plan-btn {
  width: 100%;
  padding: 0.7rem;
  background: var(--purple-dim);
  border: 1px solid var(--purple);
  border-radius: var(--radius-sm);
  color: var(--purple-light);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
}
.shop-plan-btn:hover { background: var(--purple); color: #fff; }
.shop-plan-card.popular .shop-plan-btn { background: var(--purple); color: #fff; }
.shop-plan-card.popular .shop-plan-btn:hover { background: #6a4ce8; }

/* Promo section in shop */
.shop-promo {
  margin-bottom: 1.5rem;
}
.shop-promo-row {
  display: flex;
  gap: 0.5rem;
}
.shop-promo-msg {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  min-height: 1.2rem;
}
.shop-promo-msg.success { color: var(--green); }
.shop-promo-msg.error { color: var(--red); }

/* Active promo display on shop page */
.shop-promo-active {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.7rem 1rem;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: var(--radius-sm);
}
.shop-promo-active-info { display: flex; align-items: center; gap: 0.8rem; }
.shop-promo-active-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green);
}
.shop-promo-active-desc { font-size: 0.8rem; color: var(--text-secondary); }

/* Discounted plan card */
.shop-plan-card.discounted { border-color: rgba(52, 211, 153, 0.3); }
.shop-plan-badge.promo { background: var(--green); }
.shop-plan-price-old {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-decoration: line-through;
  margin-bottom: -0.2rem;
}

/* Modal promo section */
.cab-modal-promo-section { margin-bottom: 0.5rem; }
.modal-promo-applied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: 8px;
}
.modal-promo-applied-info { display: flex; align-items: center; gap: 0.6rem; }
.modal-promo-applied-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green);
}
.modal-promo-applied-desc { font-size: 0.75rem; color: var(--text-secondary); }
.modal-promo-clear {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: all 0.2s;
}
.modal-promo-clear:hover { color: var(--red); background: rgba(229, 62, 62, 0.1); }

.modal-promo-msg { font-size: 0.75rem; margin-top: 0.4rem; }
.modal-promo-msg.success { color: var(--green); }
.modal-promo-msg.error { color: var(--red); }

/* Modal price summary */
.modal-price-summary {
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.8rem;
}
.modal-price-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.2rem 0;
}
.modal-price-row.discount { color: var(--green); }
.modal-price-row.total {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  border-top: 1px solid var(--border);
  margin-top: 0.3rem;
  padding-top: 0.5rem;
}

/* ========================================================
   REFERRALS PAGE
   ======================================================== */

.ref-banner {
  background: linear-gradient(135deg, rgba(124, 92, 252, 0.12), rgba(167, 139, 250, 0.06));
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
}
.ref-banner h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.4rem; }
.ref-banner p { color: var(--text-secondary); font-size: 0.9rem; }

.ref-link-card {
  margin-bottom: 1.5rem;
}
.ref-link-row {
  display: flex;
  gap: 0.5rem;
}

.ref-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.ref-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  text-align: center;
}
.ref-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
}
.ref-stat-label {
  font-size: 0.65rem;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

/* How it works */
.ref-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}
.ref-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.2rem;
  text-align: center;
}
.ref-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--purple-dim);
  color: var(--purple-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 auto 0.8rem;
}
.ref-step h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.3rem; }
.ref-step p { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }

.ref-note {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 1rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.ref-note svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--purple-light); margin-top: 0.1rem; }

/* Referral transfer */
.ref-transfer-section {
  margin-bottom: 1.5rem;
  text-align: center;
}
.ref-transfer-btn {
  width: 100%;
  max-width: 400px;
  padding: 0.9rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
}

/* ========================================================
   TRANSACTIONS
   ======================================================== */
.txn-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
}
.txn-row:last-child { border-bottom: none; }
.txn-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--bg-secondary);
  color: var(--text-dim);
}
.txn-icon.txn-deposit { background: rgba(52,211,153,0.12); color: var(--green); }
.txn-icon.txn-payment { background: rgba(251,146,60,0.12); color: #fb923c; }
.txn-icon.txn-refund { background: rgba(96,165,250,0.12); color: #60a5fa; }
.txn-icon.txn-referral { background: rgba(124,92,252,0.12); color: var(--purple-light); }
.txn-icon.txn-bonus { background: rgba(251,191,36,0.12); color: #fbbf24; }
.txn-info { flex: 1; min-width: 0; }
.txn-desc {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.txn-date { font-size: 0.7rem; color: var(--text-dim); margin-top: 0.15rem; }
.txn-right { text-align: right; flex-shrink: 0; }
.txn-amount { font-size: 0.9rem; font-weight: 700; }
.txn-amount-plus { color: var(--green); }
.txn-amount-minus { color: #fb923c; }
.txn-balance { font-size: 0.65rem; color: var(--text-dim); margin-top: 0.1rem; }

/* ========================================================
   MODAL
   ======================================================== */

.cab-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s;
  padding: 1rem;
}
@keyframes fadeIn { from { opacity: 0; } }
.cab-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  max-width: 440px;
  width: 100%;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.cab-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.3rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
}
.cab-modal-close:hover { color: var(--text-primary); background: var(--purple-dim); }
.cab-modal h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.8rem; }
.cab-modal-purchase { max-width: 520px; }

/* Device toggle in modal */
.modal-device-toggle {
  display: flex;
  gap: 0.4rem;
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 0.25rem;
  margin-bottom: 1rem;
}
.modal-device-btn {
  flex: 1;
  padding: 0.5rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}
.modal-device-btn:hover { color: var(--text-primary); }
.modal-device-btn.active { background: var(--purple); color: #fff; }

/* Plan cards row in modal */
.modal-plans-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.modal-plan-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.8rem 0.5rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.modal-plan-card:hover { border-color: var(--purple-light); }
.modal-plan-card.selected { border-color: var(--purple); background: var(--purple-dim); }
.modal-plan-save {
  position: absolute;
  top: -8px;
  right: -4px;
  padding: 0.1rem 0.4rem;
  background: var(--green);
  color: #000;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 700;
}
.modal-plan-duration { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.modal-plan-price { font-size: 1.1rem; font-weight: 800; color: var(--purple-light); }
.modal-plan-monthly { font-size: 0.65rem; color: var(--text-dim); }
.modal-plan-card.discounted { border-color: var(--green); background: rgba(52,211,153,0.05); }
.modal-plan-card.discounted.selected { border-color: var(--green); background: rgba(52,211,153,0.12); }
.modal-plan-save.promo { background: var(--purple); color: #fff; }
.modal-plan-price-old { color: var(--text-dim); font-weight: 500; font-size: 0.85rem; text-decoration: line-through; margin-right: 0.3rem; }

/* Promo in modal */
.cab-modal-promo {
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}
.cab-modal-promo summary {
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.cab-modal-promo-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

/* Payment methods */
.cab-payment-methods {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.2rem;
}
.cab-payment-label {
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
}
.cab-payment-btn {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1.2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  text-align: left;
}
.cab-payment-btn:hover { border-color: var(--purple); background: var(--bg-card-hover); }
.cab-payment-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.cab-payment-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.cab-payment-info { flex: 1; }
.cab-payment-info .name { font-weight: 600; }
.cab-payment-info .desc { font-size: 0.75rem; color: var(--text-dim); }

.cab-modal-status {
  margin-top: 0.8rem;
  font-size: 0.85rem;
  min-height: 1.2rem;
  text-align: center;
}

/* ========================================================
   TOAST
   ======================================================== */

.cab-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.8rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.85rem;
  z-index: 2000;
  animation: toastIn 0.3s, toastOut 0.3s 2.7s forwards;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(-50%) translateY(20px); } }

/* ========================================================
   RESPONSIVE
   ======================================================== */

@media (max-width: 1024px) {
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .ref-steps { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .cab-sidebar { display: none; }
  .cab-content-wrapper { margin-left: 0; overflow-x: hidden; }
  .cab-mobile-nav { display: flex; }
  .cab-topbar-menu { display: flex; }

  .cab-topbar { padding: 0 1rem; }
  .cab-page-content {
    padding: 1.5rem 0.8rem;
    padding-bottom: calc(var(--bnav-h) + 1.5rem);
    overflow-x: hidden;
  }
  .cab-user-badge-name { display: none; }
  .cab-user-badge { padding: 0.2rem; background: transparent; border-color: transparent; }

  .cab-card { padding: 1.2rem; }

  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .dash-actions { grid-template-columns: 1fr; }
  .dash-sub-card { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
  .dash-sub-actions { width: 100%; }
  .dash-sub-actions .cab-btn { flex: 1; justify-content: center; }

  .sub-status-banner { padding: 1rem; gap: 0.8rem; }
  .sub-details-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .sub-config-row { flex-direction: column; }
  .sub-config-row .cab-input { min-width: 0; }
  .sub-config-row .cab-btn-copy { width: 100%; text-align: center; }
  .sub-actions { flex-direction: column; }
  .sub-actions .cab-btn { width: 100%; justify-content: center; }

  .shop-balance-info { flex-wrap: wrap; }
  .shop-plans-grid { grid-template-columns: 1fr 1fr; gap: 0.8rem; }
  .shop-plan-card { padding: 1.2rem; }
  .shop-promo-row { flex-direction: column; }

  .shop-device-toggle,
  .sub-device-toggle { flex-wrap: wrap; }

  .ref-link-row { flex-direction: column; }
  .ref-stats { grid-template-columns: repeat(2, 1fr); }
  .ref-steps { grid-template-columns: 1fr; }

  .sub-history-row { flex-direction: column; gap: 0.3rem; align-items: flex-start; }
  .sub-history-meta { gap: 0.6rem; }

  .cab-toast { bottom: calc(var(--bnav-h) + 1rem); }
  .cab-login-card { padding: 2rem 1.5rem; }

  .connect-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .connect-apps-list { flex-direction: column; }
  .connect-app-link { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .cab-page-content { padding: 1rem 0.6rem; padding-bottom: calc(var(--bnav-h) + 1.5rem); }
  .cab-card { padding: 1rem; }
  .shop-plans-grid { grid-template-columns: 1fr; }
  .shop-plan-card { padding: 1rem; }
  .sub-details-grid { grid-template-columns: 1fr; }
  .sub-status-banner { flex-direction: column; text-align: center; padding: 1rem; }
  .sub-status-banner .icon { margin: 0 auto; }
  .dash-stats { grid-template-columns: 1fr; }
  .modal-plans-row { grid-template-columns: 1fr 1fr; }
  .cab-modal { padding: 1.2rem; margin: 0.5rem; border-radius: 16px; }
  .cab-modal h3 { font-size: 1.05rem; }
  .cab-payment-methods { flex-direction: column; }
  .cab-modal-promo-row { flex-direction: column; }
  .trial-card { flex-direction: column; align-items: center; text-align: center; padding: 1.2rem; }
  .ref-stats { grid-template-columns: repeat(2, 1fr); }
  .txn-desc { white-space: normal; }
}
