/* ═══════════════════════════════════════════════════
   Bifro Connect — Global Styles
   Blue accent · Dark/Light themes · Mobile-first
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Outfit:wght@400;500;600;700;800;900&display=swap');

/* ─── Dark Theme (default) ─────────────────────────── */
:root {
  --bg:             #060A13;
  --bg-card:        rgba(11, 18, 36, 0.7);
  --bg-card-2:      rgba(15, 27, 54, 0.35);
  --bg-elevated:    rgba(15, 27, 54, 0.6);
  --border:         rgba(255, 255, 255, 0.05);
  --border-hover:   rgba(255, 255, 255, 0.1);
  --border-accent:  rgba(31, 95, 245, 0.25);
  --text:           #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted:     #64748B;
  --accent:         #1F5FF5;
  --accent-light:   #4D83FF;
  --accent-glow:    rgba(31, 95, 245, 0.25);
  --accent-grad:    linear-gradient(135deg, #1F5FF5, #8B5CF6);
  --accent-2:       #F59E0B;
  --green:          #10B981;
  --green-glow:     rgba(16, 185, 129, 0.2);
  --red:            #EF4444;
  --yellow:         #F59E0B;
  --radius:         22px;
  --radius-sm:      14px;
  --radius-xs:      10px;
  --radius-lg:      28px;
  --surface-soft:   rgba(255,255,255,0.035);
  --surface-quiet:  rgba(255,255,255,0.02);
  --border-soft:    rgba(255,255,255,0.075);
  --shadow:         0 16px 48px rgba(0,0,0,0.28);
  --shadow-lg:      0 26px 72px rgba(0,0,0,0.42);
  --shadow-soft:    0 18px 54px rgba(0,0,0,0.24);
  --shadow-accent:  0 4px 20px rgba(31, 95, 245, 0.25);
  --transition:     0.2s ease-out;
  --transition-slow: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --nav-height:     76px;
  --nav-height-mob: 64px;
  --card-inset:     inset 0 1px 0 rgba(255,255,255,0.04);
}

/* ─── Light Theme ──────────────────────────────────── */
[data-theme="light"] {
  --bg:             #F1F3F5; /* Warmer, cleaner cool gray background to elevate card surfaces */
  --bg-card:        #FFFFFF; /* Pure white surfaces for high contrast and premium card layouts */
  --bg-card-2:      #F8FAFC; /* Deeper cool gray for secondary panels and nested lists */
  --bg-elevated:    #FFFFFF; /* Elevated components like dropdowns and inputs */
  --border:         #E2E8F0; /* Clean Slate-style border line */
  --border-hover:   #CBD5E1; /* Darker gray for interactive hover states */
  --border-accent:  #1877F2; /* Meta Blue active boundary */
  --text:           #0F172A; /* Slate Obsidian dark text for maximum readability */
  --text-secondary: #334155; /* Slate gray text for legible body descriptions */
  --text-muted:     #64748B; /* Legible Slate helper and subtitle copy */
  --accent:         #1877F2; /* Facebook/Meta Blue */
  --accent-light:   #E7F3FF; /* Meta Light Blue highlight background */
  --accent-glow:    rgba(24, 119, 242, 0.15); /* Soft Meta Blue glow */
  --accent-grad:    linear-gradient(135deg, #1877F2, #0056C6); /* Meta Gradient Blue */
  --shadow:         0 2px 12px rgba(0,0,0,0.05); /* Noticeable but soft shadows for depth */
  --shadow-lg:      0 8px 32px rgba(0,0,0,0.08);
  --shadow-soft:    0 22px 64px rgba(15,23,42,0.08);
  --shadow-accent:  0 4px 16px rgba(24, 119, 242, 0.12);
  --green:          #15803D; /* Highly legible Success Green */
  --green-glow:     rgba(21, 128, 61, 0.15);
  --red:            #B91C1C; /* Premium crimson Red */
  --yellow:         #B45309; /* Warm dark Amber */
  --accent-2:       #B45309;
  --card-inset:     none;
  --surface-soft:   #FFFFFF;
  --surface-quiet:  #F7FAFE;
  --border-soft:    #D9E4F2;
}

/* ─── Theme transition ─────────────────────────────── */
html {
  transition: background var(--transition-slow);
}
body {
  transition: background var(--transition-slow), color var(--transition-slow);
}
.card, .topbar, .stat-card, .toast, .form-select, .form-input, .modal-overlay, .checkout-modal {
  transition: background var(--transition-slow), border-color var(--transition-slow), box-shadow var(--transition-slow);
}

/* ─── Reset ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

h1, h2, h3, h4, h5, h6, .brand-name, .plan-name, .stat-value {
  font-family: 'Outfit', 'Inter', sans-serif;
  letter-spacing: -0.03em;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-light); text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }
.hidden { display: none !important; }

/* ─── Background ──────────────────────────────────── */
.bg-gradient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 85% 65% at 50% -20%, rgba(31, 95, 245, 0.15) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 85% 90%, rgba(139, 92, 246, 0.07) 0%, transparent 50%);
}
[data-theme="light"] .bg-gradient {
  background:
    radial-gradient(ellipse 85% 65% at 50% -20%, rgba(24, 119, 242, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 90%, rgba(24, 119, 242, 0.03) 0%, transparent 50%);
}

/* ─── Card ────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft), var(--card-inset);
  position: relative;
  z-index: 1;
}
.card:hover { border-color: var(--border-hover); }

/* ─── Reveal Animation ────────────────────────────── */
@keyframes reveal {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal { animation: reveal 0.6s var(--transition-slow) both; }

/* ─── Gradient Text ───────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, var(--text) 40%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Theme Toggle ─────────────────────────────────── */
.theme-toggle {
  min-width: 44px; min-height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card-2);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
}
.theme-toggle:hover {
  border-color: var(--border-hover);
  color: var(--accent);
  background: rgba(24,119,242,0.08);
}
.theme-toggle:active { transform: scale(0.92); }

/* ─── Mobile Menu Toggle ──────────────────────────── */
.mobile-menu-btn {
  display: none;
  min-width: 44px; min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  flex-direction: column; align-items: center; justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.mobile-menu-btn:active { background: rgba(255,255,255,0.05); }
.mobile-menu-btn span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all var(--transition);
}



/* ─── AUTH PAGE ───────────────────────────────────── */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.auth-center { display: flex; flex-direction: column; align-items: center; gap: 28px; width: 100%; max-width: 420px; z-index: 1; }

.brand { display: flex; align-items: center; gap: 14px; }
.brand-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-grad);
  box-shadow: 0 4px 20px var(--accent-glow);
  flex-shrink: 0;
}
.brand-name { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; }

.auth-card { padding: 36px 32px; width: 100%; display: flex; flex-direction: column; gap: 24px; }

.error-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-sm);
  color: #FCA5A5;
  font-size: 0.85rem;
}
[data-theme="light"] .error-banner { color: #B91C1C; background: #FEE2E2; border-color: #FCA5A5; }
.error-banner.hidden { display: none; }

.auth-hero { text-align: center; }
.auth-title { font-size: 2rem; font-weight: 800; letter-spacing: -0.04em; margin-bottom: 10px; }
.auth-subtitle { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.6; }

.feature-list { display: flex; flex-direction: column; gap: 12px; }
.feature-item { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; color: var(--text-secondary); }
.feature-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-accent   { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.dot-green  { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot-amber  { background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 24px;
  background: var(--accent-grad);
  color: white; font-size: 0.95rem; font-weight: 600;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer; text-decoration: none;
  transition: all var(--transition);
  position: relative; overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn-primary::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s;
}
.btn-primary:hover::before { transform: translateX(100%); }
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(24,119,242,0.35);
  text-decoration: none;
}
.btn-primary:active { transform: translateY(0) scale(0.97); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ─── Ghost Button ────────────────────────────────────── */
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card-2);
  color: var(--text-secondary);
  font-size: 0.9rem; font-weight: 500;
  cursor: pointer; text-decoration: none;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.btn-ghost:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: rgba(255,255,255,0.03);
}
.btn-ghost:active { transform: scale(0.97); }
[data-theme="light"] .btn-ghost { background: rgba(255,255,255,0.6); }

.auth-note { font-size: 0.8rem; color: var(--text-muted); text-align: center; line-height: 1.5; }
.auth-footer { font-size: 0.8rem; color: var(--text-muted); }

/* ─── SIDEBAR ─────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 99;
  width: 260px;
  background: rgba(10,14,26,0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 20px 0;
  overflow-y: auto;
}
[data-theme="light"] .sidebar { background: #FFFFFF; }

.sidebar-header {
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.sidebar-header svg { flex-shrink: 0; }
.sidebar-brand { font-weight: 800; font-size: 1.1rem; letter-spacing: -0.03em; }

.sidebar-agency-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  margin: 0 12px 16px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.sidebar-agency-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent-grad);
  color: white; font-weight: 700; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-agency-info { min-width: 0; }
.sidebar-agency-name { font-weight: 600; font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-agency-plan { font-size: 0.65rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

.sidebar-nav { padding: 0 12px; margin-bottom: 16px; }
.sidebar-nav-label {
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); padding: 8px 8px 4px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin: 2px 0;
  border-radius: 8px;
  font-size: 0.85rem; font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
}
.sidebar-link:hover { color: var(--text); background: rgba(59,130,246,0.06); text-decoration: none; }
.sidebar-link.active { color: #3B82F6; background: rgba(59,130,246,0.1); font-weight: 600; }
.sidebar-link svg { opacity: 0.6; flex-shrink: 0; }
.sidebar-link.active svg { opacity: 1; }

.sidebar-footer {
  padding: 12px 16px 0;
  border-top: 1px solid var(--border);
  margin: 0 12px;
}
.sidebar-footer-top { margin-bottom: 8px; }
.sidebar-theme-btn {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 0.82rem; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: all var(--transition);
}
.sidebar-theme-btn:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.sidebar-logout-btn {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 0.82rem; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: all var(--transition);
  margin: 4px 0;
}
.sidebar-logout-btn:hover { border-color: rgba(239,68,68,0.4); color: var(--red); background: rgba(239,68,68,0.06); }

/* ─── MAIN AREA ──────────────────────────────────── */
.main-area {
  margin-left: 260px;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ─── DASHBOARD LAYOUT ────────────────────────────── */
.dashboard-layout { min-height: 100vh; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: var(--nav-height);
  background: transparent;
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .topbar { background: rgba(255, 255, 255, 0.9); }

.topbar-left { display: flex; align-items: center; gap: 24px; flex: 1; min-width: 0; }
.topbar-title-group { display: flex; flex-direction: column; gap: 1px; }
.topbar-title { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em; font-family: 'Outfit','Inter',sans-serif; }
.topbar-subtitle { font-size: 0.75rem; color: var(--text-muted); font-weight: 400; }
@media (max-width: 900px) {
  .topbar-subtitle { display: none; }
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.agency-badge {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px;
  background: var(--bg-card-2); border: 1px solid var(--border);
  border-radius: 100px; font-size: 0.82rem;
  white-space: nowrap;
}
.agency-badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green-glow); flex-shrink: 0; }
.mobile-drawer-agency {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0;
  font-size: 0.88rem; font-weight: 600;
}
.btn-logout {
  padding: 6px 14px; border-radius: 8px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 0.82rem; font-weight: 500;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  min-height: 38px;
  display: inline-flex; align-items: center;
  text-decoration: none; cursor: pointer;
}
.btn-logout:hover { border-color: rgba(239,68,68,0.4); color: var(--red); background: rgba(239,68,68,0.06); }
.btn-logout:active { background: rgba(239,68,68,0.1); transform: scale(0.97); }

.dashboard-body {
  --radius: 28px;
  --radius-sm: 18px;
  --radius-xs: 12px;
  --shadow: 0 18px 54px rgba(0,0,0,0.22);
  --shadow-lg: 0 26px 76px rgba(0,0,0,0.34);
  flex: 1;
  padding: 56px 42px 76px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 42px;
}

[data-theme="light"] .dashboard-body {
  --shadow: 0 18px 48px rgba(15,23,42,0.08);
  --shadow-lg: 0 28px 70px rgba(15,23,42,0.14);
}

.dashboard-command {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: start;
  padding: 36px 38px;
  border: 1px solid var(--border-soft);
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(24,119,242,0.06), transparent 50%),
    var(--bg-card);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  z-index: 1;
}

[data-theme="light"] .dashboard-command {
  background:
    linear-gradient(135deg, rgba(24,119,242,0.08), transparent 46%),
    #FFFFFF;
}

.dashboard-command-main {
  max-width: 680px;
}

.dashboard-kicker,
.create-summary-kicker {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.dashboard-command h1 {
  margin-top: 10px;
  font-size: clamp(1.8rem, 2.8vw, 2.45rem);
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.dashboard-command p {
  max-width: 62ch;
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
}

.dashboard-command-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-command-primary,
.dashboard-command-refresh {
  min-height: 46px;
  border-radius: 999px;
}

.dashboard-command-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 2px;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

.dashboard-command-strip > div {
  min-height: 72px;
  padding: 16px 18px;
  background: var(--surface-quiet);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
}

[data-theme="light"] .dashboard-command-strip > div {
  background: #F8FAFC;
  border-color: #DCE6F3;
}

.command-strip-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dashboard-command-strip strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 1.55rem;
  line-height: 1;
}

.section-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 26px; gap: 18px; flex-wrap: wrap; }
.section-header-actions { display: flex; align-items: center; gap: 14px; }
.section-timestamp { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.section-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.section-subtitle { font-size: 0.88rem; color: var(--text-secondary); margin-top: 4px; }

/* Stats */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; }
.stat-card {
  display: flex; align-items: flex-start; gap: 12px;
  min-height: 104px;
  padding: 22px 20px; border-radius: 24px;
  background: var(--surface-quiet);
  border: 1px solid var(--border-soft);
  box-shadow: none;
  transition: all var(--transition);
}
.stat-card:hover { border-color: var(--border-hover); transform: translateY(-1px); box-shadow: 0 18px 40px rgba(0,0,0,0.12), var(--card-inset); }
.stat-icon {
  width: 40px; height: 40px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.stat-icon-default { background: rgba(59,130,246,0.1); color: #3B82F6; }
.stat-icon-green   { background: rgba(16,185,129,0.1); color: #10B981; }
.stat-icon-amber   { background: rgba(245,158,11,0.1); color: #F59E0B; }
.stat-icon-red     { background: rgba(239,68,68,0.1); color: #F87171; }
.stat-icon-accent  { background: rgba(139,92,246,0.1); color: #8B5CF6; }
[data-theme="light"] .stat-icon-default { background: #EFF6FF; color: #1877F2; border: 1px solid #BFDBFE; }
[data-theme="light"] .stat-icon-green   { background: #DCFCE7; color: #15803D; border: 1px solid #BBF7D0; }
[data-theme="light"] .stat-icon-amber   { background: #FEF3C7; color: #B45309; border: 1px solid #FDE68A; }
[data-theme="light"] .stat-icon-red     { background: #FEE2E2; color: #B91C1C; border: 1px solid #FCA5A5; }
[data-theme="light"] .stat-icon-accent  { background: #F5F3FF; color: #6D28D9; border: 1px solid #DDD6FE; }
.stat-info { min-width: 0; flex: 1; }
.stat-label { font-size: 0.66rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 7px; }
.stat-value { font-size: 1.62rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.stat-accent   { color: #3B82F6; }
.stat-green  { color: var(--green); }
.stat-amber { color: var(--accent-2); }
.stat-red    { color: #F87171; }
[data-theme="light"] .stat-red { color: #B91C1C; }
[data-theme="light"] .stat-amber { color: #B45309; }
[data-theme="light"] .stat-green { color: #15803D; }
[data-theme="light"] .stat-accent { color: #1877F2; }

/* Shared pricing disclosures and large-agency path */
.active-client-term {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.active-client-info {
  position: relative;
  display: inline-flex;
  z-index: 5;
}

.active-client-info > button {
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-hover);
  border-radius: 50%;
  background: var(--surface-quiet);
  color: var(--text-secondary);
  font: 700 11px/1 inherit;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.active-client-info > [role="tooltip"] {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  width: min(280px, calc(100vw - 40px));
  transform: translate(-50%, 5px);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  box-shadow: var(--shadow-lg);
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

.active-client-info:hover > [role="tooltip"],
.active-client-info:focus-within > [role="tooltip"] {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.founding-progress {
  margin-top: 16px;
  max-width: 420px;
}

.founding-progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  margin-bottom: 7px;
}

.founding-progress-track {
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-quiet);
  border: 1px solid var(--border-soft);
}

.founding-progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent-grad);
  transition: width 300ms ease;
}

.bespoke-band {
  width: min(1160px, calc(100% - 48px));
  margin: -30px auto 72px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.bespoke-band-copy {
  max-width: 720px;
}

.bespoke-band-label {
  color: var(--accent-light);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.bespoke-band h3 {
  margin: 5px 0 4px;
  font-size: 1.08rem;
}

.bespoke-band p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.55;
}

.bespoke-band a {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid var(--border-hover);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bespoke-band a:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: rgba(31, 95, 245, 0.06);
}

@media (max-width: 640px) {
  .bespoke-band {
    width: min(100% - 32px, 1160px);
    align-items: stretch;
    flex-direction: column;
    margin-bottom: 56px;
  }

  .bespoke-band a {
    width: 100%;
  }

  .active-client-info > [role="tooltip"] {
    left: auto;
    right: -12px;
    width: min(160px, calc(100vw - 32px));
    transform: translateY(5px);
  }

  .active-client-info:hover > [role="tooltip"],
  .active-client-info:focus-within > [role="tooltip"] {
    transform: translateY(0);
  }
}

#usage-card { display: flex; }

/* Create Link */
.create-panel { padding: 38px; }
.create-panel-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 28px; }
.create-panel-header svg { margin-top: 2px; flex-shrink: 0; color: #3B82F6; }
.create-panel-header h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 5px; }
.create-panel-header p  { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.65; margin: 0; }

.create-panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.75fr);
  gap: 38px;
  align-items: start;
}

.create-summary {
  min-height: 100%;
  padding-left: 36px;
  border-left: 1px solid var(--border);
}

.create-summary .access-preview {
  margin-top: 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.create-summary-note {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.6;
}

.create-summary-note strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}

.create-action-row {
  margin-top: 26px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.create-action-row #create-btn {
  min-height: 48px;
  padding: 13px 24px;
  border-radius: 999px;
}

#form-error {
  color: #F87171;
  font-size: 0.82rem;
  font-weight: 600;
}

/* Client Table Cell */
.client-cell { display: flex; align-items: center; gap: 10px; }
.client-avatar {
  width: 38px; height: 38px; border-radius: 14px;
  background: rgba(59,130,246,0.1); color: #3B82F6;
  font-weight: 700; font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Asset Chips */
.asset-chips-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
}
.asset-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: 999px;
  font-size: 0.68rem; font-weight: 700;
  line-height: 1.4;
}
.asset-chip-success { background: rgba(16,185,129,0.08); color: #10B981; border: 1px solid rgba(16,185,129,0.15); }
.asset-chip-failed  { background: rgba(239,68,68,0.06); color: #f87171; border: 1px solid rgba(239,68,68,0.15); }
.asset-chip-neutral { background: rgba(59,130,246,0.08); color: #60A5FA; border: 1px solid rgba(59,130,246,0.18); }
.asset-chip-warning { background: rgba(245,158,11,0.08); color: #F59E0B; border: 1px solid rgba(245,158,11,0.18); }

.client-cell-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.client-cell-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-weight: 700;
}

.connection-note {
  margin-top: 8px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.025);
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.5;
}

.connection-note strong { color: var(--text); }
.connection-note-warning { border-color: rgba(245,158,11,0.2); background: rgba(245,158,11,0.06); }
.connection-note-danger { border-color: rgba(239,68,68,0.2); background: rgba(239,68,68,0.05); }
.connection-note-success { border-color: rgba(16,185,129,0.2); background: rgba(16,185,129,0.05); }

.failed-assets-panel {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.failed-asset-row {
  display: grid;
  grid-template-columns: minmax(110px, 150px) minmax(140px, 1fr) minmax(160px, 1.4fr);
  gap: 8px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid rgba(239,68,68,0.12);
  border-radius: var(--radius-sm);
  background: rgba(239,68,68,0.04);
}

.failed-asset-label { color: var(--text); font-weight: 600; }
.failed-asset-name { color: var(--text-secondary); }
.failed-asset-reason { color: var(--text-muted); }

/* Details dropdown animation */
.assets-dropdown[open] .details-arrow {
  transform: rotate(180deg);
}

/* Card Section Header */
.link-card-section-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px 4px;
  margin: 8px 0 4px;
  font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
}

.form-row { display: flex; gap: 18px; flex-wrap: wrap; }
.form-group { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 220px; }
.form-label { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); letter-spacing: 0.03em; text-transform: uppercase; }
.form-select, .form-input {
  min-height: 48px;
  padding: 13px 16px;
  background: rgba(8,12,24,0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}
[data-theme="light"] .form-select, [data-theme="light"] .form-input { background: rgba(255,255,255,0.6); }
.form-select:focus, .form-input:focus {
  border-color: rgba(24,119,242,0.4);
  box-shadow: 0 0 0 3px rgba(24,119,242,0.08);
}
.form-select option { background: #0F172A; }
[data-theme="light"] .form-select option { background: #FFFFFF; color: #0F172A; }

.access-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.access-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: 118px;
  padding: 19px;
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  background: var(--surface-quiet);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.access-option:hover {
  transform: translateY(-1px);
  border-color: rgba(59,130,246,0.32);
  background: rgba(59,130,246,0.045);
}

.access-option.selected {
  border-color: rgba(16,185,129,0.5);
  background: rgba(16,185,129,0.065);
  box-shadow: inset 0 0 0 1px rgba(16,185,129,0.08), 0 10px 28px rgba(0,0,0,0.08);
}

.access-option input {
  margin-top: 3px;
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1px solid var(--border-hover);
  background: rgba(255,255,255,0.04);
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  transition: all var(--transition);
}

.access-option input::before {
  content: "✓";
  color: transparent;
  font-size: 0.78rem;
  line-height: 1;
  font-weight: 900;
}

.access-option input:checked {
  border-color: var(--green);
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(16,185,129,0.1);
}

.access-option input:checked::before {
  color: #fff;
}

.access-option-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.access-option-badge {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 0.64rem;
  line-height: 1.2;
  color: #2563EB;
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.22);
}

[data-theme="light"] .access-option {
  background: #fff;
}

[data-theme="light"] .access-option.selected {
  background: rgba(16,185,129,0.06);
}

.access-option-desc {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.access-preview {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  background: var(--surface-quiet);
}

.access-preview-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.access-preview-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.access-preview-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.5;
}

.access-preview-item svg { flex-shrink: 0; color: var(--green); margin-top: 2px; }

.link-result {
  margin-top: 22px; padding: 18px;
  background: rgba(24,119,242,0.05);
  border: 1px solid rgba(24,119,242,0.2);
  border-radius: 20px;
  display: none;
}
.link-result.visible { display: block; }
.link-result-label {
  font-size: 0.75rem; color: var(--accent); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px;
}
.link-copy-row { display: flex; gap: 8px; }
.link-url-input {
  flex: 1; padding: 10px 14px; min-width: 0;
  background: rgba(8,12,24,0.5); border: 1px solid var(--border);
  border-radius: var(--radius-xs); color: var(--text-secondary);
  font-family: 'Inter', monospace; font-size: 0.8rem; outline: none;
}
[data-theme="light"] .link-url-input { background: rgba(244,246,249,0.8); }
.btn-copy {
  padding: 10px 18px;
  background: var(--accent-grad); border: none; border-radius: var(--radius-xs);
  color: white; font-size: 0.8rem; font-weight: 600; white-space: nowrap;
  transition: all var(--transition);
}
.btn-copy:hover { box-shadow: 0 4px 16px rgba(24,119,242,0.3); }
.btn-copy.copied { background: var(--green); }

/* Table */
.links-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px;
}
.links-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px;
  font-size: 0.86rem;
}
.links-table th {
  text-align: left; padding: 10px 18px;
  color: var(--text-muted); font-weight: 600;
  border-bottom: none;
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em;
}
.links-table td {
  padding: 18px 18px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  background: rgba(255,255,255,0.018);
}
.links-table .connection-row td:first-child {
  border-left: 1px solid var(--border);
  border-radius: 22px 0 0 22px;
}
.links-table .connection-row td:last-child {
  border-right: 1px solid var(--border);
  border-radius: 0 22px 22px 0;
}
.links-table .connection-row:hover td {
  border-color: rgba(24,119,242,0.18);
  background: rgba(24,119,242,0.035);
}
[data-theme="light"] .links-table td { background: #FFFFFF; }
[data-theme="light"] .links-table .connection-row:hover td { background: #F8FBFF; }

.links-table .connection-row.status-row-connected td {
  border-color: rgba(16,185,129,0.18);
}

.links-table .connection-row.status-row-pending td,
.links-table .connection-row.status-row-pending_confirmation td,
.links-table .connection-row.status-row-pending_meta_approval td {
  border-color: rgba(245,158,11,0.18);
}

.links-table .connection-row.status-row-revoked td {
  background: rgba(148,163,184,0.045);
}

[data-theme="light"] .links-table .connection-row.status-row-revoked td {
  background: #FBFCFE;
}

.connection-row.status-row-revoked .client-cell-name,
.connection-row.status-row-revoked td:nth-child(3),
.connection-row.status-row-revoked td:nth-child(4),
.connection-row.status-row-revoked td:nth-child(6) {
  color: var(--text-secondary) !important;
}

.connection-row.status-row-revoked .client-avatar,
.connection-row.status-row-revoked .asset-chip {
  opacity: 0.72;
}

.connection-details-row td {
  padding: 0 22px 18px 78px !important;
  border: none !important;
  background: transparent !important;
}

.connection-actions-cell {
  min-width: 174px;
  white-space: nowrap;
}

.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 100px;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.02em;
}
.status-pending      { background: rgba(245,158,11,0.1); color: var(--yellow); }
.status-connected    { background: rgba(16,185,129,0.1); color: var(--green); }
.status-revoked      { background: rgba(239,68,68,0.08); color: #F87171; }
.status-no_business  { background: rgba(24,119,242,0.1); color: var(--accent); }
.status-pending_confirmation  { background: rgba(24,119,242,0.08); color: var(--accent); }
.status-pending_meta_approval { background: rgba(245,158,11,0.08); color: #FCD34D; border: 1px solid rgba(245,158,11,0.2); }
[data-theme="light"] .status-pending      { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
[data-theme="light"] .status-connected    { background: #DCFCE7; color: #15803D; border: 1px solid #BBF7D0; }
[data-theme="light"] .status-revoked      { background: #FEE2E2; color: #B91C1C; border: 1px solid #FCA5A5; }
[data-theme="light"] .status-no_business  { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
[data-theme="light"] .status-pending_confirmation  { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
[data-theme="light"] .status-pending_meta_approval { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }

.btn-revoke {
  padding: 8px 13px;
  background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2);
  color: #F87171; font-size: 0.72rem; font-weight: 600;
  border-radius: 999px; transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.btn-revoke:hover { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.4); }
.btn-revoke:active { transform: scale(0.95); }
.btn-revoke:disabled { opacity: 0.4; cursor: not-allowed; }
[data-theme="light"] .btn-revoke { color: #B91C1C; background: #FEE2E2; border-color: #FCA5A5; }
[data-theme="light"] .btn-revoke:hover { background: #B91C1C; color: #FFFFFF; border-color: #B91C1C; box-shadow: 0 2px 8px rgba(185, 28, 28, 0.15); }

.btn-delete {
  padding: 8px 13px;
  background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2);
  color: #F87171; font-size: 0.72rem; font-weight: 600;
  border-radius: 999px; transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-delete:hover { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.4); }
.btn-delete:active { transform: scale(0.95); }
.btn-delete:disabled { opacity: 0.4; cursor: not-allowed; }
[data-theme="light"] .btn-delete { color: #B91C1C; background: #FEE2E2; border-color: #FCA5A5; }
[data-theme="light"] .btn-delete:hover { background: #B91C1C; color: #FFFFFF; border-color: #B91C1C; box-shadow: 0 2px 8px rgba(185, 28, 28, 0.15); }

.btn-copy-link {
  padding: 8px 13px;
  background: rgba(24,119,242,0.08); border: 1px solid rgba(24,119,242,0.2);
  color: var(--accent); font-size: 0.72rem; font-weight: 700;
  border-radius: 999px; transition: all var(--transition);
  margin-right: 6px;
  -webkit-tap-highlight-color: transparent;
}
.btn-copy-link:hover { background: rgba(24,119,242,0.15); }
.btn-copy-link:active { transform: scale(0.95); }

.btn-reconnect {
  padding: 8px 13px;
  background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.25);
  color: #F59E0B; font-size: 0.72rem; font-weight: 600;
  border-radius: 999px; transition: all var(--transition);
  margin-right: 6px;
  -webkit-tap-highlight-color: transparent;
}
.btn-reconnect:hover { background: rgba(245,158,11,0.15); }
.btn-reconnect:active { transform: scale(0.95); }
.btn-reconnect:disabled { opacity: 0.5; cursor: not-allowed; }
[data-theme="light"] .btn-reconnect { background: #FEF3C7; border-color: #FDE68A; color: #92400E; }
[data-theme="light"] .btn-reconnect:hover { background: #B45309; color: #FFFFFF; border-color: #B45309; box-shadow: 0 2px 8px rgba(180, 83, 9, 0.15); }

/* ─── Section Divider (table) ──────────────────────── */
.section-divider td {
  padding: 26px 18px 4px !important;
  border-bottom: none !important;
  border-top: none !important;
  background: transparent !important;
}
.section-divider:hover td { background: transparent !important; }
.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 100px;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(148,163,184,0.12);
  color: var(--text-muted);
}
.link-card-section-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 16px 16px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-retry-asset {
  padding: 2px 8px;
  font-size: 0.65rem;
  border-radius: 4px;
  border: 1px solid rgba(248,113,113,0.3);
  background: rgba(248,113,113,0.1);
  color: #f87171;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-retry-asset:hover { background: rgba(248,113,113,0.2); border-color: rgba(248,113,113,0.5); }
.btn-retry-asset:disabled { opacity: 0.5; cursor: not-allowed; }
[data-theme="light"] .btn-retry-asset { border-color: #FCA5A5; background: #FEE2E2; color: #B91C1C; }
[data-theme="light"] .btn-retry-asset:hover { background: #B91C1C; color: #FFFFFF; border-color: #B91C1C; }

.empty-state {
  text-align: center; padding: 48px 20px;
  color: var(--text-secondary); font-size: 0.88rem;
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 14px; }

/* ─── CLIENT PAGES ────────────────────────────────── */
.client-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: clamp(20px, 4vw, 52px); }
.client-card { width: 100%; max-width: 540px; padding: 42px 38px; display: flex; flex-direction: column; gap: 20px; text-align: center; z-index: 1; border-radius: 34px; }
.client-logo-ring {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, #1877F2, #8B5CF6);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  box-shadow: 0 0 0 8px rgba(24,119,242,0.08), 0 4px 20px rgba(24,119,242,0.2);
}
.client-agency-name { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; font-weight: 700; }
.client-title { font-size: clamp(1.55rem, 4vw, 2rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.04em; }
.client-desc { font-size: 0.92rem; color: var(--text-secondary); line-height: 1.58; max-width: 42ch; margin: 10px auto 0; }

.client-permissions-panel {
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  background: var(--surface-quiet);
  overflow: hidden;
  text-align: left;
}

[data-theme="light"] .client-permissions-panel {
  background: #FFFFFF;
  border-color: #D8E2EF;
}

.client-permissions-panel summary {
  min-height: 64px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  list-style: none;
}

.client-permissions-panel summary::-webkit-details-marker { display: none; }

.client-permissions-panel summary strong {
  display: block;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.25;
}

.client-permissions-panel summary small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.client-permissions-chevron {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  transition: transform var(--transition), color var(--transition), background var(--transition);
  flex-shrink: 0;
}

.client-permissions-panel[open] .client-permissions-chevron {
  transform: rotate(180deg);
  color: var(--accent);
  background: rgba(24,119,242,0.08);
}

.permissions-list { text-align: left; display: flex; flex-direction: column; gap: 8px; }
.client-permissions-panel .permissions-list {
  padding: 0 14px 14px;
}
.perm-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px;
  background: rgba(8,12,24,0.24);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  transition: border-color var(--transition);
}
[data-theme="light"] .perm-item { background: rgba(244,246,249,0.5); }
.perm-item:hover { border-color: var(--border-hover); }
.perm-icon { font-size: 1.1rem; width: 24px; text-align: center; flex-shrink: 0; }
.perm-name { font-size: 0.8rem; font-weight: 600; }
.perm-desc { font-size: 0.7rem; color: var(--text-muted); }

.client-trust-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  text-align: left;
}

.client-trust-grid.is-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  text-align: center;
}

.client-trust-box {
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: var(--surface-quiet);
}

.client-trust-grid.is-compact .client-trust-box {
  padding: 11px 8px;
  border-radius: 16px;
}

.client-trust-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.client-trust-box p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.68rem;
  line-height: 1.35;
}

.client-trust-box li {
  list-style: disc;
  margin-left: 16px;
  color: var(--text-secondary);
  font-size: 0.7rem;
  line-height: 1.55;
}

.client-security-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.client-access-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.client-access-summary:empty { display: none; }

.biz-option {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: rgba(8,12,24,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}
[data-theme="light"] .biz-option { background: rgba(244,246,249,0.5); }
.biz-option:hover { border-color: rgba(24,119,242,0.35); background: rgba(24,119,242,0.04); }
.biz-option.selected { border-color: var(--accent); background: rgba(24,119,242,0.08); }
.biz-option-radio {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border); flex-shrink: 0;
  transition: all var(--transition);
}
.biz-option.selected .biz-option-radio { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.biz-name  { font-size: 0.88rem; font-weight: 600; }
.biz-id    { font-size: 0.7rem; color: var(--text-muted); }

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

/* Toast */
.toast {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom, 24px));
  left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--bg-elevated); border: 1px solid var(--border);
  padding: 12px 24px; border-radius: 100px;
  font-size: 0.85rem; color: var(--text);
  box-shadow: var(--shadow-lg);
  transition: transform 0.35s var(--transition-slow);
  z-index: 9999;
  white-space: nowrap;
  max-width: 90vw;
}
.toast.show { transform: translateX(-50%) translateY(0); }

.upgrade-banner {
  display: none; border-radius: var(--radius-sm); padding: 16px 20px; margin-bottom: 4px;
  align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

.usage-bar-track {
  height: 4px; background: rgba(24,119,242,0.08); border-radius: 4px; overflow: hidden;
}
.usage-bar-fill {
  height: 100%; width: 0%; border-radius: 4px;
  background: var(--accent-grad); transition: width 0.5s, background 0.3s;
}

/* ─── Link Card (mobile card replacing table rows) ─── */
.link-card {
  display: none;
}

.dashboard-body > .card,
.dashboard-body section > .card {
  border-radius: 24px;
  overflow: clip;
}

.dashboard-body > .card:hover,
.dashboard-body section > .card:hover {
  transform: none;
}

.assets-dropdown {
  margin-top: 10px !important;
}

.assets-dropdown summary {
  min-height: 30px;
  padding: 5px 0;
}

/* ─── MOBILE (max 768px) ──────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-area { margin-left: 0; }

  .topbar { padding: 0 12px; height: var(--nav-height-mob); }
  .topbar-left { gap: 12px; }
  .topbar-title { font-size: 0.95rem; }
  .mobile-menu-btn { display: flex; }
  .btn-logout { padding: 10px 14px; font-size: 0.82rem; }

  .dashboard-body { padding: 24px 16px 42px; gap: 28px; }

  .dashboard-command {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 28px 20px;
    border-radius: 28px;
  }
  .dashboard-command h1 { font-size: 1.85rem; }
  .dashboard-command p { font-size: 0.9rem; }
  .dashboard-command-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .dashboard-command-actions .btn-primary,
  .dashboard-command-actions .btn-ghost {
    flex: 1 1 150px;
    width: auto;
  }
  .dashboard-command-strip {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .dashboard-command-strip > div {
    min-height: 64px;
    padding: 12px;
  }
  .command-strip-label {
    font-size: 0.62rem;
  }
  .dashboard-command-strip strong {
    font-size: 1.45rem;
  }

  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .stat-card { min-height: 102px; padding: 18px 15px; border-radius: 22px; }
  .stat-icon { width: 34px; height: 34px; border-radius: 12px; }
  .stat-icon svg { width: 14px; height: 14px; }
  .stat-value { font-size: 1.3rem !important; }
  .stat-label { font-size: 0.62rem; }
  #usage-card { grid-column: 1 / -1; }

  .create-panel { padding: 26px 20px; }
  .create-panel-header svg { display: none; }
  .create-panel-grid { grid-template-columns: 1fr; gap: 22px; }
  .create-summary {
    padding-left: 0;
    padding-top: 20px;
    border-left: 0;
    border-top: 1px solid var(--border);
  }
  .form-row { flex-direction: column; gap: 10px; }
  .access-options { grid-template-columns: 1fr; }
  .access-preview-list { grid-template-columns: 1fr; }
  .access-option { min-height: auto; }
  .form-group { min-width: 100%; }
  .btn-primary { padding: 14px 20px; font-size: 0.9rem; width: 100%; justify-content: center; }
  .create-action-row #create-btn { width: 100%; }

  .auth-card { padding: 28px 20px; }
  .client-card { padding: 28px 20px; gap: 16px; border-radius: 28px; }
  .client-logo-ring { width: 56px; height: 56px; }
  .client-desc { font-size: 0.86rem; line-height: 1.48; }
  .client-trust-grid { grid-template-columns: 1fr; }
  .client-trust-grid.is-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .client-trust-grid.is-compact .client-trust-box { padding: 9px 6px; }
  .client-trust-title { font-size: 0.68rem; margin-bottom: 4px; }
  .client-trust-box p { font-size: 0.64rem; }
  .auth-title { font-size: 1.6rem; }

  /* Hide table on mobile, show card list */
  .links-table-wrap { display: none; }
  .link-card { display: block; }
  .link-card-list { display: flex; flex-direction: column; gap: 14px; padding: 4px; }
  .link-card-item {
    padding: 20px;
    border-radius: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow);
  }
  .failed-asset-row { grid-template-columns: 1fr; }
  .link-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0; }
  .link-card-name { font-weight: 600; font-size: 0.95rem; }
  .link-card-portfolio { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }
  .link-card-status { margin-bottom: 0; }
  .link-card-meta {
    font-size: 0.73rem; color: var(--text-muted); margin-bottom: 0;
    display: flex; align-items: center; gap: 6px;
  }
  .link-card-meta svg { flex-shrink: 0; }
  .link-card-actions { display: flex; gap: 8px; }
  .link-card-actions .btn-copy-link,
  .link-card-actions .btn-revoke,
  .link-card-actions .btn-delete {
    flex: 1; text-align: center; padding: 12px 8px; min-height: 44px;
    display: flex; align-items: center; justify-content: center;
    gap: 6px;
    font-size: 0.82rem; margin-right: 0;
  }
  .btn-revoke, .btn-delete, .btn-copy-link { min-height: 44px; padding: 10px 14px; font-size: 0.82rem; }

  .section-header { flex-direction: column; align-items: flex-start; }
  .section-header .btn-primary { width: 100%; }
  .section-header-actions { width: 100%; justify-content: space-between; }
  .section-timestamp { font-size: 0.65rem; }

  .toast { font-size: 0.8rem; padding: 10px 18px; white-space: normal; }
}

/* ─── SMALL PHONES (max 480px) ────────────────────── */
@media (max-width: 480px) {
  .dashboard-body { padding: 18px 12px 34px; gap: 22px; }
  .dashboard-command { padding: 24px 16px; }
  .stats-row { gap: 10px; }
  .stat-card { padding: 15px 12px; min-height: 92px; }
  .stat-value { font-size: 1.1rem !important; }
  .create-panel { padding: 22px 16px; }
  .link-card-item { padding: 18px; }
  .client-page { align-items: flex-start; padding: 18px 12px; }
  .client-card { padding: 22px 16px; gap: 14px; }
  .client-title { font-size: 1.34rem; }
  .client-permissions-panel summary { min-height: 56px; padding: 11px 12px; }
  .perm-item { padding: 9px 10px; }
  .auth-card { padding: 24px 16px; }
  .auth-title { font-size: 1.35rem; }
  .brand-name { font-size: 1.25rem; }
  .error-card { padding: 32px 24px !important; }
  .pricing-hero { padding: 80px 12px 32px !important; }
}

/* ─── VERY SMALL PHONES (max 360px) ───────────────── */
@media (max-width: 360px) {
  .stat-card { min-height: auto; padding: 10px 8px; }
  .stat-value { font-size: 1rem !important; }
  .stat-label { font-size: 0.55rem; }
  .btn-primary { font-size: 0.85rem; padding: 12px 16px; }
  .client-card { padding: 18px 14px; }
  .client-trust-grid.is-compact { grid-template-columns: 1fr; }
  .topbar { padding: 0 8px; }
  .topbar-actions { gap: 6px; }
}

/* ─── MID-SIZE (769-1024px) ───────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar { width: 220px; }
  .main-area { margin-left: 220px; }
  .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  #usage-card { grid-column: 1 / -1; }
  .topbar { padding: 0 16px; }
  .dashboard-body { padding: 30px 22px 46px; max-width: 960px; }
  .dashboard-command { grid-template-columns: 1fr; }
  .dashboard-command-actions { justify-content: flex-start; }
  .create-panel-grid { grid-template-columns: 1fr; }
  .create-summary {
    padding-left: 0;
    padding-top: 24px;
    border-left: 0;
    border-top: 1px solid var(--border);
  }
  .create-summary .access-preview-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .links-table th,
  .links-table td { padding-left: 14px; padding-right: 14px; }
  .connection-details-row td { padding-left: 58px !important; }
}

/* ─── DESKTOP (>768px) ────────────────────────────── */
@media (min-width: 769px) {
  .mobile-menu-btn, .mobile-drawer, .mobile-drawer-overlay { display: none !important; }
}

/* ─── SMALL PHONES (max 400px) ────────────────────── */
@media (max-width: 400px) {
  .stats-row { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 12px 10px; }
  .stat-value { font-size: 1.1rem !important; }
  .stat-label { font-size: 0.58rem; }
  .brand-name { font-size: 1.2rem; }
  .auth-card { padding: 24px 16px; }
  .auth-title { font-size: 1.3rem; }
}

/* ─── UX & DESIGN REFINEMENTS ────────────────────── */

/* Refined card lift */
.card {
  transition: background var(--transition-slow), border-color var(--transition-slow), box-shadow var(--transition-slow), transform var(--transition-slow);
}
.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg), var(--card-inset);
  transform: translateY(-1px);
}

/* Skeleton Loading Shimmer */
@keyframes skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-row td .skeleton-line,
.skeleton-row td .skeleton-circle,
.skeleton-card .skeleton-line,
.skeleton-card .skeleton-circle,
.skeleton-circle,
.skeleton-line {
  background: linear-gradient(90deg, 
    rgba(255, 255, 255, 0.03) 25%, 
    rgba(255, 255, 255, 0.08) 50%, 
    rgba(255, 255, 255, 0.03) 75%
  ) !important;
  background-size: 200% 100% !important;
  animation: skeleton-shimmer 1.5s infinite linear !important;
}

[data-theme="light"] .skeleton-row td .skeleton-line,
[data-theme="light"] .skeleton-row td .skeleton-circle,
[data-theme="light"] .skeleton-card .skeleton-line,
[data-theme="light"] .skeleton-card .skeleton-circle,
[data-theme="light"] .skeleton-circle,
[data-theme="light"] .skeleton-line {
  background: linear-gradient(90deg, 
    rgba(0, 0, 0, 0.03) 25%, 
    rgba(0, 0, 0, 0.08) 50%, 
    rgba(0, 0, 0, 0.03) 75%
  ) !important;
  background-size: 200% 100% !important;
  animation: skeleton-shimmer 1.5s infinite linear !important;
}

/* Responsive/Theme-Aware Logos */
.logo-image {
  height: 60px;
  width: auto;
  object-fit: contain;
  vertical-align: middle;
}
@media (max-width: 768px) {
  .logo-image {
    height: 44px;
  }
}
.logo-image.logo-square {
  height: 32px;
  width: 32px;
}
.logo-dark { display: none; }
.logo-light { display: none; }

[data-theme="dark"] .logo-dark { display: inline-block; }
[data-theme="light"] .logo-light { display: inline-block; }
html:not([data-theme]) .logo-dark { display: inline-block; }

/* ─── SHARED NAV ─────────────────────────────────── */
.site-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; height: var(--nav-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 990;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.site-nav .nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.site-nav .nav-links { display: flex; align-items: center; gap: 6px; }
.site-nav .nav-links a {
  padding: 8px 14px; border-radius: 8px;
  color: var(--text-secondary); font-size: 0.82rem; font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
}
.site-nav .nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.site-nav .nav-links a.active { color: var(--accent); background: rgba(59,130,246,0.1); font-weight: 600; }
.site-nav .nav-actions { display: flex; align-items: center; gap: 8px; }

/* Responsive Visibility Helpers */
.mobile-only {
  display: none !important;
}

@media (max-width: 768px) {
  .site-nav {
    padding: 10px 16px;
    height: var(--nav-height-mob);
  }
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: flex !important;
  }
  .site-nav .nav-actions {
    gap: 12px;
  }
  .site-nav #plan-pill,
  .site-nav #topbar-upgrade-btn {
    display: none !important;
  }
}

/* Mobile Hamburger Menu Button */
.mobile-menu-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  transition: all var(--transition);
  min-width: 40px;
}
.mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
}
.hamburger-bar {
  display: block;
  width: 18px;
  height: 2px;
  background-color: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

@media (max-width: 768px) {
  /* Mobile Drawer Overlay */
  .mobile-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    opacity: 0;
    pointer-events: none;
    z-index: 998;
    display: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), backdrop-filter 0.3s cubic-bezier(0.16, 1, 0.3, 1), -webkit-backdrop-filter 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .mobile-drawer-overlay.open {
    display: block;
    opacity: 1;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: auto;
  }

  /* Mobile Navigation Drawer */
  .mobile-drawer {
    position: fixed;
    top: 0;
    left: auto !important;
    right: 0;
    bottom: 0;
    width: 85%;
    max-width: 300px;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    border-right: none !important;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 999;
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }
  .mobile-drawer.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  /* Body state for open drawer */
  body.drawer-open {
    overflow: hidden !important;
  }

  /* Mobile Drawer Elements */
  .mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
  }
  .mobile-drawer-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    transition: all var(--transition);
  }
  .mobile-drawer-close:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
  }

  .mobile-drawer-body {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .mobile-drawer-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .mobile-drawer-links a {
    display: block;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all var(--transition);
  }
  .mobile-drawer-links a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
  }
  .mobile-drawer-links a.active {
    color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
    font-weight: 600;
  }

  .mobile-drawer-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
  }

  .mobile-drawer-plan-info {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
  }
  .plan-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
  }
  .plan-info-header .plan-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
  }
  .plan-info-header .plan-value {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .mobile-drawer-upgrade-btn {
    display: block;
    text-align: center;
    padding: 8px;
    border-radius: 6px;
    background: var(--accent-grad);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity var(--transition);
  }
  .mobile-drawer-upgrade-btn:hover {
    opacity: 0.9;
  }

  .mobile-drawer-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
  }
  .mobile-drawer-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.06);
    color: #EF4444;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(239, 68, 68, 0.15);
    transition: all var(--transition);
  }
  .mobile-drawer-logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #EF4444;
  }
}

/* ─── SHARED FOOTER ──────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 40px 24px 0;
  margin-top: auto;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; justify-content: space-between; gap: 40px;
  flex-wrap: wrap;
}
.footer-brand { max-width: 260px; }
.footer-logo-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }

.footer-tagline { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.6; }
.footer-company {
  max-width: 250px;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.6;
}
.footer-links { display: flex; gap: 40px; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 6px; min-width: 120px; }
.footer-col-title {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 4px;
}
.footer-col a {
  font-size: 0.82rem; color: var(--text-secondary); text-decoration: none;
  transition: color var(--transition);
}
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  margin-top: 32px; padding: 16px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-bottom p { font-size: 0.75rem; color: var(--text-muted); }
.footer-bottom .footer-disclosure {
  max-width: 920px;
  margin: 6px auto 0;
  line-height: 1.6;
}
.footer-bottom a { color: var(--text-secondary); }
.footer-bottom a:hover { color: var(--text); }
@media (max-width: 640px) {
  .site-footer { padding: 32px 16px 0; }
  .footer-inner { flex-direction: column; gap: 24px; }
  .footer-links { gap: 24px; }
}

/* ─── LEGAL AND TRUST PAGES ───────────────────────── */
.legal-main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}
.legal-hero {
  max-width: 850px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border-soft);
}
.legal-eyebrow {
  margin-bottom: 10px;
  color: var(--accent-light);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
[data-theme="light"] .legal-eyebrow { color: var(--accent); }
.legal-title {
  max-width: 760px;
  font-size: clamp(2rem, 5vw, 3.65rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0;
}
.legal-lead {
  max-width: 760px;
  margin-top: 18px;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
}
.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 22px;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.legal-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.legal-meta span::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  content: "";
}
.legal-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 760px);
  gap: 56px;
  align-items: start;
  margin-top: 40px;
}
.legal-toc {
  position: sticky;
  top: 24px;
  padding-left: 16px;
  border-left: 1px solid var(--border-soft);
}
.legal-toc-title {
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
.legal-toc a {
  display: block;
  padding: 6px 0;
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.4;
}
.legal-toc a:hover { color: var(--text); }
.legal-content { min-width: 0; }
.legal-section {
  padding: 0 0 34px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 24px;
}
.legal-section:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}
.legal-section h2 {
  margin-bottom: 14px;
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: 0;
}
.legal-section h3 {
  margin: 24px 0 8px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
}
.legal-section p,
.legal-section li {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.78;
}
.legal-section p + p { margin-top: 12px; }
.legal-section ul,
.legal-section ol {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 20px;
}
.legal-section ul { list-style: disc; }
.legal-section ol { list-style: decimal; }
.legal-section strong { color: var(--text); font-weight: 700; }
.legal-section a { text-decoration: underline; text-underline-offset: 3px; }
.legal-note {
  margin: 18px 0;
  padding: 16px 18px;
  border-left: 3px solid var(--accent);
  background: var(--surface-quiet);
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.7;
}
.legal-note strong { color: var(--text); }
.legal-definition-list {
  margin-top: 14px;
  border-top: 1px solid var(--border);
}
.legal-definition-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.38fr) minmax(0, 1fr);
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.legal-definition-row dt {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
}
.legal-definition-row dd {
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.65;
}
.legal-status-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.public-deletion-status {
  display: grid;
  gap: 16px;
  max-width: 760px;
  margin: 28px 0 0;
  padding: 20px;
  border: 1px solid rgba(37, 99, 235, 0.34);
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.08);
}
.public-deletion-status.is-error {
  border-color: rgba(239, 68, 68, 0.36);
  background: rgba(239, 68, 68, 0.07);
}
.public-deletion-status[hidden] { display: none; }
.public-deletion-status > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.public-deletion-label {
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}
.public-deletion-status strong { font-size: 1.05rem; }
.public-deletion-status dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}
.public-deletion-status dl div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: var(--surface-quiet);
}
.public-deletion-status dt {
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.public-deletion-status dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
}
.public-deletion-status p {
  margin: 0;
  color: var(--text-secondary);
}
.legal-status {
  display: grid;
  grid-template-columns: minmax(112px, 0.25fr) minmax(0, 1fr);
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.legal-status code {
  align-self: start;
  color: var(--accent-light);
  font-size: 0.78rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}
[data-theme="light"] .legal-status code { color: var(--accent); }
.legal-status span {
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.6;
}
.legal-contact-block {
  padding: 20px 0 0;
  color: var(--text-secondary);
}
.legal-contact-block address {
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-style: normal;
  line-height: 1.75;
}
.legal-contact-block a { font-weight: 700; }
.deletion-tool {
  max-width: 760px;
  margin-top: 38px;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  box-shadow: var(--shadow-soft), var(--card-inset);
}
.deletion-tool[aria-busy="true"] { opacity: 0.72; }
.deletion-tool-header {
  padding-bottom: 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.deletion-tool-header h2 {
  margin-bottom: 7px;
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: 0;
}
.deletion-tool-header p,
.deletion-state p,
.deletion-help {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}
.deletion-state[hidden] { display: none; }
.deletion-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.deletion-status-label {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}
.deletion-status-badge {
  padding: 4px 9px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.08);
  color: var(--yellow);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}
.deletion-deadline {
  margin: 14px 0 18px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.deletion-deadline span {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.deletion-deadline strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 1rem;
}
.deletion-form { margin-top: 22px; }
.legal-label {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
}
.legal-input {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  outline: none;
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
}
.legal-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.deletion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.deletion-button {
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 0.86rem;
  font-weight: 750;
  transition: background var(--transition), border-color var(--transition), opacity var(--transition);
}
.deletion-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.deletion-button-danger {
  background: var(--red);
  color: #fff;
}
.deletion-button-danger:hover:not(:disabled) { background: #dc2626; }
.deletion-button-recover {
  background: var(--accent);
  color: #fff;
}
.deletion-button-recover:hover:not(:disabled) { background: #174fcf; }
.deletion-message {
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.6;
}
.deletion-message.is-error { color: var(--red); }
.deletion-message.is-success { color: var(--green); }
.deletion-help {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.btn-logout:disabled,
.mobile-drawer-logout-btn:disabled {
  cursor: wait;
  opacity: 0.62;
}
.mobile-drawer-logout-btn {
  font-family: inherit;
  cursor: pointer;
}

@media (max-width: 840px) {
  .legal-main { padding-top: 40px; }
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .legal-toc {
    position: static;
    display: flex;
    gap: 8px 18px;
    padding: 0 0 18px;
    overflow-x: auto;
    border-left: 0;
    border-bottom: 1px solid var(--border);
    scrollbar-width: thin;
  }
  .legal-toc-title { display: none; }
  .legal-toc a {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

@media (max-width: 520px) {
  .legal-main { padding: 34px 16px 58px; }
  .legal-hero { padding-bottom: 28px; }
  .legal-title { font-size: 2rem; }
  .legal-lead { font-size: 0.92rem; line-height: 1.7; }
  .legal-meta { display: grid; gap: 7px; }
  .legal-layout { margin-top: 28px; }
  .legal-section { padding-bottom: 28px; margin-bottom: 28px; }
  .legal-section h2 { font-size: 1.2rem; }
  .legal-definition-row,
  .legal-status {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .deletion-tool { padding: 20px 16px; }
  .deletion-status-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .deletion-actions,
  .deletion-button { width: 100%; }
  .public-deletion-status > div:first-child {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
  .public-deletion-status dl { grid-template-columns: 1fr; }
}

/* ─── Interactive Highlight Badges ───────────────────────── */
.interactive-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 100px;
  font-size: 0.65rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; position: absolute; z-index: 2;
  animation: badge-pulse 2s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.05); opacity: 1; }
}


/* Calculator badge - next to calculator title */
.calc-badge {
  margin-left: 8px;
  background: linear-gradient(135deg, var(--green), var(--accent-light));
  color: white; box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
[data-theme="light"] .calc-badge {
  background: linear-gradient(135deg, var(--green), #059669);
  box-shadow: 0 2px 8px rgba(21, 128, 61, 0.2);
}

/* Billing toggle badge */
.billing-badge {
  margin-left: 8px;
  background: linear-gradient(135deg, var(--accent-2), var(--yellow));
  color: #0B1121; box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}
[data-theme="light"] .billing-badge {
  color: white;
  background: linear-gradient(135deg, var(--accent-2), #D97706);
  box-shadow: 0 2px 8px rgba(180, 83, 9, 0.25);
}

/* Tooltip on hover */
[data-tooltip] {
  position: relative; cursor: pointer;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(-4px);
  padding: 6px 10px; border-radius: 6px;
  background: var(--bg-elevated); color: var(--text);
  font-size: 0.7rem; font-weight: 500; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: all 0.2s;
  border: 1px solid var(--border); box-shadow: var(--shadow);
  z-index: 100;
}
[data-tooltip]::before {
  content: ""; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  border: 4px solid transparent; border-top-color: var(--bg-elevated);
  opacity: 0; transition: opacity 0.2s;
}
[data-tooltip]:hover::after,
[data-tooltip]:focus::after {
  opacity: 1; transform: translateX(-50%) translateY(-8px);
}
[data-tooltip]:hover::before { opacity: 1; }

@media (max-width: 768px) {
  .interactive-badge { display: none; }
  [data-tooltip]::after { display: none; }
}

/* ─── PAGE WRAPPER (flex column full-height) ─────── */
.page-wrap {
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ─── Yearly Pricing Toggle Details & Mobile Premium Free Forever Card ─── */
.pricing-plan-price-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 16px;
}

.original-price-strike {
  text-decoration: line-through;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.8;
}

.savings-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(16, 185, 129, 0.12);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
  margin-top: 4px;
}

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--green);
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot-anim 2s infinite ease-in-out;
  vertical-align: middle;
  flex-shrink: 0;
}

@keyframes pulse-dot-anim {
  0%, 100% {
    transform: scale(0.9);
    opacity: 0.6;
    box-shadow: 0 0 4px rgba(16, 185, 129, 0.4);
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.8);
  }
}

/* Premium Glassmorphic style for Free Forever plan */
.pricing-card-saas.free-highlight,
.plan-card.free-highlight {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), rgba(6, 10, 19, 0.8)) !important;
  border: 1.5px solid rgba(16, 185, 129, 0.35) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(16, 185, 129, 0.12), inset 0 0 15px rgba(16, 185, 129, 0.05) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
}
[data-theme="light"] .pricing-card-saas.free-highlight,
[data-theme="light"] .plan-card.free-highlight {
  background: linear-gradient(135deg, rgba(21, 128, 61, 0.04), #FFFFFF) !important;
  border: 1.5px solid var(--green) !important;
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.08), 0 0 20px rgba(16, 185, 129, 0.05) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.pricing-card-saas.free-highlight:hover,
.plan-card.free-highlight:hover {
  border-color: rgba(16, 185, 129, 0.65) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 25px rgba(16, 185, 129, 0.2), inset 0 0 20px rgba(16, 185, 129, 0.08) !important;
}
[data-theme="light"] .pricing-card-saas.free-highlight:hover,
[data-theme="light"] .plan-card.free-highlight:hover {
  border-color: var(--green) !important;
  box-shadow: 0 12px 40px rgba(16, 185, 129, 0.15), 0 0 25px rgba(16, 185, 129, 0.08) !important;
}

/* Make Free Forever badge look glowing and premium */
.pricing-card-saas.free-highlight::after,
.plan-card.free-highlight .popular-badge {
  background: linear-gradient(135deg, var(--green), #059669) !important;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em !important;
}

/* Phone/Mobile view overrides for Free Forever */
@media (max-width: 768px) {
  .pricing-card-saas.free-highlight,
  .plan-card.free-highlight {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.09), rgba(6, 10, 19, 0.85)) !important;
    border: 2px solid rgba(16, 185, 129, 0.5) !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 30px rgba(16, 185, 129, 0.25), inset 0 0 20px rgba(16, 185, 129, 0.08) !important;
  }
}
