/* ==========================================================================
   AeroVoice SaaS — Design System
   Glassmorphic dark theme. Inherited from personal app; extended for SaaS.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design Tokens
   -------------------------------------------------------------------------- */
:root {
  --bg-primary:   #0b0f19;
  --bg-secondary: #131a2d;

  /* Indigo accent */
  --accent-color: #4f46e5;
  --accent-light: #818cf8;
  --accent-glow:  rgba(79, 70, 229, 0.25);

  /* Status colors */
  --emerald:      #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.25);
  --rose:         #ef4444;
  --rose-glow:    rgba(239, 68, 68, 0.25);

  /* Glassmorphism */
  --glass-bg:     rgba(30, 41, 59, 0.5);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: rgba(0, 0, 0, 0.4);

  /* Typography */
  --text-primary:   #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;

  --transition-speed: 0.25s;
  --font-sans: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

/* --------------------------------------------------------------------------
   Body — column flex so .top-nav + page content stack vertically
   -------------------------------------------------------------------------- */
body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(at 10% 20%, rgba(79, 70, 229, 0.15) 0px, transparent 50%),
    radial-gradient(at 90% 80%, rgba(16, 185, 129, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ==========================================================================
   TOP NAV — Balance, Account link, Sign Out
   ========================================================================== */
.top-nav {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 24px;
  height: 52px;
  background: rgba(11, 15, 25, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
  z-index: 200;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-light);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.4px;
  text-decoration: none;
}

.nav-brand svg { flex-shrink: 0; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-self: end;
}

.nav-balance-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.nav-balance-label strong {
  font-family: var(--font-sans);
  color: var(--emerald);
}

.nav-link {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

.nav-link:hover { color: var(--text-primary); }

.nav-btn-signout {
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 4px 12px;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.nav-btn-signout:hover {
  color: var(--rose);
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.06);
}

/* ==========================================================================
   Single-Panel Tabbed Dialer Layout (app.html)
   ========================================================================== */
.app-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  max-width: 440px;
  flex: 1;
  padding: 12px 14px 20px;
}

/* Shared Glassmorphic Console Panels */
.console-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 16px 40px var(--glass-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* ==========================================================================
   Dialer Panel (single column)
   ========================================================================== */
.dialer-section {
  padding: 16px 20px 14px;
  width: 100%;
  height: calc(100vh - 52px - 32px); /* viewport - nav - container top+bottom padding */
}

/* status-row removed — pill merged into call-meta-info */

/* Status Pill */
.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all var(--transition-speed) ease;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-simulating  { color: var(--accent-light); border-color: rgba(129, 140, 248, 0.2); }
.status-simulating .status-dot { background: var(--accent-light); box-shadow: 0 0 8px var(--accent-light); }

.status-ready       { color: var(--emerald); border-color: rgba(16, 185, 129, 0.2); }
.status-ready .status-dot { background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }

.status-connecting  { color: var(--text-secondary); }
.status-connecting .status-dot { background: var(--text-muted); animation: blink 1s infinite alternate; }

.status-error       { color: var(--rose); border-color: rgba(239, 68, 68, 0.2); }
.status-error .status-dot { background: var(--rose); box-shadow: 0 0 8px var(--rose); }

/* Digital Display */
.display-container {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 13px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  overflow: hidden;
}

.call-meta-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.call-meta-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.call-timer {
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  color: var(--accent-light);
  background: rgba(79, 70, 229, 0.15);
  padding: 1px 6px;
  border-radius: 4px;
}

.call-status {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.number-display-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Country code picker */
.country-picker {
  position: relative;
  flex-shrink: 0;
}

.country-picker-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
  min-width: 76px;
  text-align: center;
  transition: background var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.country-picker-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
}

.country-picker-btn::after {
  content: ' ▾';
  font-size: 0.65em;
  opacity: 0.5;
}
.country-picker-btn.open::after {
  content: ' ▴';
}

.country-picker-dropdown {
  position: fixed;
  background: #1a1d27;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  overflow: hidden;
}

.country-picker-dropdown.hidden { display: none; }

.country-search {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.04);
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  padding: 10px 12px;
  outline: none;
}

.country-search::placeholder { color: var(--text-muted); }

.country-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 220px;
  overflow-y: auto;
}

.country-list::-webkit-scrollbar { width: 4px; }
.country-list::-webkit-scrollbar-track { background: transparent; }
.country-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 9999px; }

.country-list-divider {
  padding: 6px 12px 3px;
  font-size: 0.63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--text-muted);
  pointer-events: none;
  list-style: none;
}
.country-list-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 4px 0;
  pointer-events: none;
  list-style: none;
}

.country-list-item {
  padding: 7px 12px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  transition: background var(--transition-speed) ease;
}
.cc-iso  { min-width: 2em;  flex-shrink: 0; }
.cc-dial { min-width: 4em;  flex-shrink: 0; }
.cc-name { flex: 1; }

.country-list-item:hover,
.country-list-item.selected {
  background: rgba(99, 102, 241, 0.15);
  color: var(--text-primary);
}


#phone-number {
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 1.64rem;
  color: var(--text-primary);
  font-weight: 500;
  flex: 1;
  min-width: 0;
  padding: 3px 0;
  caret-color: var(--accent-light);
}

#phone-number::placeholder {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 1.32rem;
  font-weight: 400;
}

.display-actions {
  display: flex;
  align-items: center;
  margin-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 6px;
}

.caller-id-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.caller-id-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--emerald);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.6rem;
  font-weight: 600;
}

.caller-id-badge .badge-dot {
  width: 4px;
  height: 4px;
  background: var(--emerald);
  border-radius: 50%;
  box-shadow: 0 0 4px var(--emerald);
}

.btn-icon-display {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed) ease;
}

.btn-icon-display:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* Waveform Visualizer */
.visualizer-container {
  height: 38px;
  margin: 13px 0;
  background: rgba(15, 23, 42, 0.3);
  border-radius: 10px;
  overflow: hidden;
  border: 1px dashed rgba(255, 255, 255, 0.03);
}

#waveform-canvas { width: 100%; height: 100%; display: block; }

/* Keypad */
.keypad-container {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 64px);
  gap: 13px 19px;
}

.key-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.key-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

.key-btn:active, .key-btn.active-press {
  background: var(--accent-color);
  border-color: var(--accent-light);
  box-shadow: 0 0 13px var(--accent-glow);
  transform: scale(0.92);
}

.key-btn .num    { font-size: 1.4rem; font-weight: 500; line-height: 1.1; }
.key-btn .letters { font-size: 0.5rem; color: var(--text-secondary); font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }
.key-btn:active .letters, .key-btn.active-press .letters { color: rgba(255, 255, 255, 0.7); }

/* Dialer Controls */
.controls-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px 0;
}

.control-btn {
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  outline: none;
  transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.secondary-btn {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.secondary-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.secondary-btn:active:not(:disabled) { transform: scale(0.95); }
.secondary-btn:disabled { opacity: 0.3; cursor: not-allowed; }

#btn-mute .icon-mic-off { display: none; }
#btn-mute.muted-active .icon-mic     { display: none; }
#btn-mute.muted-active .icon-mic-off { display: block; }

#btn-mute.muted-active {
  background: var(--rose-glow);
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--rose);
  box-shadow: 0 0 10px var(--rose-glow);
}

.primary-btn { width: 56px; height: 56px; }

.primary-btn.call-trigger {
  background: var(--emerald);
  color: #fff;
  box-shadow: 0 6px 19px var(--emerald-glow);
}

.primary-btn.call-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.4);
}

.primary-btn.call-trigger:active { transform: scale(0.92); }

.primary-btn.hangup-trigger {
  background: var(--rose);
  color: #fff;
  box-shadow: 0 8px 24px var(--rose-glow);
  transform: rotate(135deg);
}

.primary-btn.hangup-trigger:hover { box-shadow: 0 12px 30px rgba(239, 68, 68, 0.4); }

#btn-speaker.drawer-active {
  background: var(--accent-glow);
  border-color: rgba(79, 70, 229, 0.4);
  color: var(--accent-light);
}

/* Audio Device Drawer */
.audio-settings-drawer {
  position: absolute;
  bottom: 85px;
  left: 24px;
  right: 24px;
  background: rgba(19, 26, 45, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  z-index: 100;
}

.audio-settings-drawer:not(.hidden) {
  animation: slideUpFade 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpFade {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 6px;
}

.drawer-header h3 {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.btn-close-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
  transition: all var(--transition-speed) ease;
}

.btn-close-icon:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }

.setting-row { display: flex; flex-direction: column; gap: 4px; }
.setting-row label { font-size: 0.75rem; color: var(--text-muted); }

.setting-row select {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.setting-row.inline-row { flex-direction: row; justify-content: space-between; align-items: center; }
.setting-row input[type="range"] { accent-color: var(--accent-light); width: 140px; cursor: pointer; }

/* ==========================================================================
   Main Tab Bar
   ========================================================================== */
.main-tab-bar {
  display: flex;
  align-items: flex-end;
  gap: 0;
  margin-top: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.main-tab {
  flex: 1;
  padding: 9px 2px 8px;
  font-size: 0.73rem;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}

.main-tab:hover { color: var(--text-secondary); }

.main-tab.active {
  color: var(--accent-light);
  border-bottom-color: var(--accent-light);
}

.settings-cog-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s;
  margin-bottom: -1px;
}

.settings-cog-btn:hover { color: var(--text-secondary); }
.settings-cog-btn.active { color: var(--accent-light); border-bottom-color: var(--accent-light); }

/* ==========================================================================
   Switchable Panel Area
   ========================================================================== */
.main-panel-area {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.main-panel {
  display: none;
  flex-direction: column;
  height: 100%;
  padding: 12px 0 0;
}

.main-panel.active { display: flex; }

#panel-dial { justify-content: center; padding-top: 0; }

/* ==========================================================================
   Settings Drawer
   ========================================================================== */
.settings-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  z-index: 400;
  transition: opacity 0.2s ease;
}

.settings-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.settings-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(300px, 82vw);
  background: rgba(13, 18, 32, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid var(--glass-border);
  box-shadow: -8px 0 32px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 401;
}

.settings-drawer.open { transform: translateX(0); }

.settings-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.settings-drawer-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.settings-drawer-body {
  padding: 16px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  user-select: none;
}

.settings-toggle-info { flex: 1; }

.settings-toggle-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
}

.settings-toggle-desc {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Toggle switch */
.toggle-track {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-thumb {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-thumb::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: rgba(255,255,255,0.6);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}

.toggle-input:checked + .toggle-thumb { background: var(--accent-color); }
.toggle-input:checked + .toggle-thumb::before { transform: translateX(18px); background: #fff; }

/* ==========================================================================
   Shared list content (used in panel-contacts, panel-history)
   ========================================================================== */
.pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 11px;
}

.pane-header h2 { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }

.text-action-btn {
  background: transparent;
  border: none;
  color: var(--accent-light);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
}

.text-action-btn:hover { text-decoration: underline; }

/* Search + sort toolbar */
.list-toolbar {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.list-search {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  padding: 5px 9px;
  outline: none;
  transition: border-color var(--transition-speed) ease;
}

.list-search::placeholder { color: var(--text-muted); }
.list-search:focus { border-color: rgba(99, 102, 241, 0.4); }

.list-sort {
  width: 7rem;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  padding: 5px 6px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-speed) ease;
}

.list-sort:focus { border-color: rgba(99, 102, 241, 0.4); }

/* Scrollable list */
.scroll-list {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 6px;
  padding-bottom: 10px;
}

.scroll-list::-webkit-scrollbar { width: 5px; }
.scroll-list::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); border-radius: 9999px; }
.scroll-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 9999px; }
.scroll-list::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.30); }

/* List Item Cards */
.list-item-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 10px 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition-speed) ease;
  cursor: pointer;
}

.list-item-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.list-item-card.selected {
  background: rgba(79, 70, 229, 0.1);
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateX(2px);
}

.item-left-info { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-glow);
  border: 1px solid rgba(79, 70, 229, 0.2);
  color: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
  flex-shrink: 0;
  position: relative;
}

.avatar.is-pinned::after {
  content: '';
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 13px;
  height: 13px;
  background-color: var(--rose);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V17z'/%3E%3Cline x1='12' y1='17' x2='12' y2='22' stroke='white' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: 9px 9px;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 50%;
  border: 1.5px solid var(--bg-primary);
}

/* "Save as contact" shortcut — unsaved history entries only */
button.btn-item-add-contact.avatar {
  background: transparent;
  border: 1px dashed rgba(79, 70, 229, 0.5);
  color: rgba(139, 92, 246, 0.8);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  transition: background var(--transition-speed) ease,
              border-color var(--transition-speed) ease,
              color var(--transition-speed) ease;
}

button.btn-item-add-contact.avatar:hover {
  background: rgba(79, 70, 229, 0.15);
  border-color: rgba(139, 92, 246, 0.9);
  color: var(--accent-light);
}

.meta-details  { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.meta-name     { font-size: 0.75rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta-company  { font-size: 0.65rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.3em; line-height: 1.3; }
.meta-phone    { font-family: var(--font-sans); font-size: 0.65rem; color: var(--text-secondary); min-width: 6.5rem; }

.meta-phone-row { display: flex; align-items: center; }
.meta-type      { padding-left: 8px; font-size: 0.6rem; color: var(--text-muted); white-space: nowrap; }

.meta-sub-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  line-height: 1.2;
  color: var(--text-muted);
  margin-top: 0;
}

.call-log-icon { display: inline-flex; align-items: center; }
.icon-outgoing { color: var(--emerald); }
.icon-incoming { color: var(--accent-light); }
.icon-missed   { color: var(--rose); }

.item-right-actions { display: flex; align-items: center; gap: 4px; }

/* Call button */
.btn-item-call {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.15);
  color: var(--emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.btn-item-call:hover {
  background: var(--emerald);
  color: #fff;
  box-shadow: 0 0 8px var(--emerald-glow);
}

.call-active .btn-item-call {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}

/* Details button */
.btn-item-details {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.btn-item-details:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

/* Delete button (SaaS contacts only) */
.btn-item-delete {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.btn-item-delete:hover {
  background: var(--rose-glow);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--rose);
}

.btn-item-edit {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.btn-item-edit:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: #818cf8;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 40px 20px;
}

/* ==========================================================================
   Modal / Dialog
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 19, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity var(--transition-speed) ease;
}

.modal-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  transition: transform var(--transition-speed) cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 18px;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; }
.form-group-header { display: flex; justify-content: flex-start; align-items: center; gap: 6px; }

.btn-pin-contact {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color var(--transition-speed) ease, transform var(--transition-speed) ease;
}
.btn-pin-contact:hover { color: var(--text-secondary); }
.btn-pin-contact:disabled { opacity: 0.3; cursor: default; }
.btn-pin-contact.is-pinned { color: var(--rose); transform: rotate(20deg); }
.btn-pin-contact.is-pinned svg { fill: var(--rose); }

.form-group input {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
}

.form-group input:focus { border-color: var(--accent-light); box-shadow: 0 0 8px var(--accent-glow); }

.form-group textarea {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 10px 14px;
  outline: none;
  resize: vertical;
  overflow: hidden;
  min-height: 56px;
  width: 100%;
  box-sizing: border-box;
}
.form-group textarea:focus { border-color: var(--accent-light); box-shadow: 0 0 8px var(--accent-glow); }
.form-group textarea::placeholder { color: var(--text-muted); }

.label-optional { font-size: 0.72rem; color: var(--text-muted); font-weight: 400; margin-left: 4px; }

.contact-phone-row { display: flex; align-items: center; gap: 8px; }
.contact-phone-row #contact-phone { flex: 1; min-width: 0; }

.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }

.modal-btn {
  border: none;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.modal-btn.cancel { background: transparent; color: var(--text-secondary); }
.modal-btn.cancel:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }

.modal-btn.submit { background: var(--accent-color); color: #fff; box-shadow: 0 4px 14px var(--accent-glow); }
.modal-btn.submit:hover { background: var(--accent-light); box-shadow: 0 6px 18px rgba(129,140,248,0.4); }

/* Contact list / detail sub-views inside #panel-contacts */
#contact-list-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

#contact-detail-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.contact-detail-scroll { padding: 0 8px 16px 0; scrollbar-gutter: stable; }
.contact-detail-scroll::-webkit-scrollbar { width: 6px; }
.contact-detail-scroll::-webkit-scrollbar-track { background: transparent; }
.contact-detail-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.contact-detail-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* Detail sections (numbers / emails / websites) */
.detail-section { margin-bottom: 20px; }
.detail-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.detail-section-label  { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; }

.add-row-btn {
  background: none;
  border: 1px solid var(--glass-border);
  color: var(--accent-color);
  border-radius: 50%;
  width: 22px; height: 22px;
  font-size: 1.1rem; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition-speed);
  flex-shrink: 0;
}
.add-row-btn:hover { background: rgba(129,140,248,0.12); }

.detail-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }

/* Primary indicator dot */
.primary-dot {
  flex-shrink: 0;
  background: none; border: none;
  width: 22px; height: 22px; padding: 0;
  cursor: pointer; color: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: color var(--transition-speed);
}
.primary-dot:hover   { color: rgba(129,140,248,0.5); }
.primary-dot.is-primary { color: var(--accent-color); }

/* Type dropdown */
.row-type {
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-sans); font-size: 0.78rem;
  padding: 7px 6px;
  width: auto; flex-shrink: 0;
  outline: none; cursor: pointer;
  -webkit-appearance: none;
}
.row-type:focus { border-color: var(--accent-light); }

/* Row text input */
.row-input {
  flex: 1; min-width: 0;
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-sans); font-size: 0.88rem;
  padding: 8px 12px; outline: none;
}
.row-input:focus { border-color: var(--accent-light); box-shadow: 0 0 8px var(--accent-glow); }
.row-input::placeholder { color: var(--text-muted); }

/* Row action buttons (dial, open-tab, delete) */
.row-action-btn {
  flex-shrink: 0; background: none; border: none;
  color: var(--text-muted); padding: 0; margin: 0; cursor: pointer;
  display: flex; align-items: center; border-radius: 6px;
  transition: color var(--transition-speed), background var(--transition-speed);
}
.row-action-btn:hover  { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.row-delete-btn:hover  { color: #f87171; background: rgba(248,113,113,0.08); }

/* Country picker button inside a number row — compact size */
.contact-row-country-btn { font-size: 0.78rem; padding: 7px 8px; flex-shrink: 0; white-space: nowrap; }

/* Pane header multi-button group */
.pane-header-actions { display: flex; align-items: center; gap: 8px; }

/* ==========================================================================
   Logs Panel
   ========================================================================== */
.log-panel-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.terminal-console {
  background: rgba(7, 10, 19, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 10px;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  line-height: 1.4;
  overflow-y: auto;
  flex-grow: 1;
}

.log-entry { margin-bottom: 6px; word-break: break-all; }
.log-time  { color: var(--text-muted); margin-right: 4px; }
.log-info    { color: var(--text-secondary); }
.log-success { color: var(--emerald); }
.log-warning { color: #f59e0b; }
.log-error   { color: var(--rose); }

/* ==========================================================================
   Shared Page Layout (account, rates, index — non-dialer pages)
   ========================================================================== */

/* Standard page body below the nav */
.page-main {
  width: 100%;
  max-width: 900px;
  padding: 32px 24px 64px;
  flex: 1;
}

/* Page section card */
.page-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 28px 32px;
  margin-bottom: 24px;
  backdrop-filter: blur(16px);
}

.page-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.page-card p, .page-card li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Standard page heading */
.page-heading {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.page-subheading {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* Form elements on non-dialer pages */
.field-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }

.field-group label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.field-input {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  width: 100%;
}

.field-input:focus { border-color: var(--accent-light); box-shadow: 0 0 8px var(--accent-glow); }

/* Primary CTA button */
.btn-primary {
  background: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 22px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover { background: var(--accent-light); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(129,140,248,0.4); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Secondary outlined button */
.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.btn-secondary:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }

/* Feedback / alert messages */
.alert {
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.alert-success { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); color: var(--emerald); }
.alert-error   { background: rgba(239, 68, 68, 0.1);  border: 1px solid rgba(239, 68, 68, 0.2);  color: var(--rose); }
.alert-info    { background: rgba(79, 70, 229, 0.1);  border: 1px solid rgba(79, 70, 229, 0.2);  color: var(--accent-light); }

/* Balance display card */
.balance-display {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 20px;
}

.balance-amount {
  font-family: var(--font-sans);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--emerald);
}

.balance-currency {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* Toggle / switch */
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.toggle-row:last-child { border-bottom: none; }

.toggle-label {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.toggle-description {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 22px;
  cursor: pointer;
  transition: background var(--transition-speed) ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition-speed) ease;
}

.toggle-switch input:checked + .toggle-slider { background: var(--accent-color); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* Rates table */
.rates-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.rates-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rates-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.rates-table tr:last-child td { border-bottom: none; }
.rates-table tr:hover td { background: rgba(255,255,255,0.02); }

.rates-table .rate-estimate { color: var(--text-muted); font-size: 0.75rem; }
.rates-table .rate-verified  { color: var(--emerald); }

/* Stripe Elements container */
#stripe-elements-container {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
}

/* ==========================================================================
   Skeleton loading — list cards and Contact Details sections
   ========================================================================== */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.35; }
  50%       { opacity: 0.8;  }
}

.skeleton-card {
  --sk-delay: 0s;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 10px 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.skeleton-left  { display: flex; align-items: center; gap: 12px; flex: 1; }
.skeleton-right { display: flex; gap: 4px; }
.skeleton-lines { display: flex; flex-direction: column; gap: 5px; flex: 1; }

.skeleton-block {
  background: rgba(255,255,255,0.07);
  border-radius: 4px;
  animation: skeleton-pulse 1.6s ease-in-out infinite;
  animation-delay: var(--sk-delay);
}
.skeleton-avatar { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; }
.skeleton-line-a { height: 10px; width: 52%; }
.skeleton-line-b { height: 9px;  width: 32%; }
.skeleton-btn    { width: 26px;  height: 26px; border-radius: 50%; }

.section-loading-row {
  height: 34px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  animation: skeleton-pulse 1.6s ease-in-out infinite;
  margin-bottom: 6px;
}

/* ==========================================================================
   Utilities & Animations
   ========================================================================== */
.hidden { display: none !important; }

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
}

@keyframes blink {
  0%   { opacity: 0.3; }
  100% { opacity: 1; }
}

.icon-pulse { animation: float 3s ease-in-out infinite; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-3px); }
}

.country-picker-btn.ringing { animation: jitter 0.2s infinite; }

@keyframes jitter {
  0%   { transform: rotate(0)    scale(1); }
  25%  { transform: rotate(-5deg) scale(1.05); }
  75%  { transform: rotate(5deg)  scale(1.05); }
  100% { transform: rotate(0)    scale(1); }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Tablet / small desktop — narrow the panel */
@media (max-width: 480px) {
  .app-container { padding: 8px 10px 16px; }
  .dialer-section { padding: 14px 16px 12px; }
}

/* Mobile — compact nav */
@media (max-width: 600px) {
  .top-nav { padding: 0 16px; }
  .nav-balance-label { display: none; }
  .page-main { padding: 20px 16px 48px; }
  .page-card  { padding: 20px; }
}

/* ==========================================================================
   Account Page
   ========================================================================== */

.account-section { padding: 20px 0; }
.account-section:first-child { padding-top: 4px; }

hr.section-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin: 0;
}

.section-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.section-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

/* Add Funds row: amount input + button side by side */
.topup-amount-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.topup-amount-row .field-group { flex: 1; margin-bottom: 0; }

.amount-input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
}

.amount-input-wrapper:focus-within {
  border-color: var(--accent-light);
  box-shadow: 0 0 8px var(--accent-glow);
}

.amount-prefix {
  padding: 10px 10px 10px 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
  user-select: none;
}

.amount-input {
  background: transparent;
  border: none;
  outline: none;
  padding: 10px 14px 10px 0;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  width: 100%;
}

/* Remove number input spinners */
.amount-input::-webkit-inner-spin-button,
.amount-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.amount-input[type=number] { -moz-appearance: textfield; }

/* Stripe section action buttons */
.topup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

/* Payment method status */
.pm-status {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.pm-status.pm-saved { color: var(--emerald); }

.pm-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Auto top-up fields */
.autotopup-fields { padding-top: 14px; }

.autotopup-fields.fields-disabled {
  opacity: 0.38;
  pointer-events: none;
}

/* ==========================================================================
   Rates Page
   ========================================================================== */

.billing-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 14px;
  line-height: 1.5;
}

.rate-estimate-badge {
  font-size: 0.72rem;
  background: rgba(100, 116, 139, 0.15);
  border: 1px solid rgba(100, 116, 139, 0.2);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: middle;
  margin-left: 4px;
}

.rate-verified-badge {
  font-size: 0.72rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--emerald);
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: middle;
  margin-left: 4px;
}

/* ==========================================================================
   Landing Page
   ========================================================================== */

.hero {
  text-align: center;
  padding: 72px 24px 48px;
  max-width: 700px;
  margin: 0 auto;
  width: 100%;
}

.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent-light);
  margin-bottom: 20px;
  display: block;
}

.hero-headline {
  font-size: 2.9rem;
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text-primary) 60%, var(--accent-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Feature grid */
.features-section {
  width: 100%;
  max-width: 900px;
  padding: 0 24px 48px;
  margin: 0 auto;
}

.features-heading {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 24px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(12px);
}

.feature-icon {
  font-size: 1.4rem;
  margin-bottom: 12px;
  display: block;
}

.feature-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.feature-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Pricing teaser card */
.pricing-teaser {
  width: 100%;
  max-width: 900px;
  padding: 0 24px 56px;
  margin: 0 auto;
}

/* Site footer */
.site-footer {
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 22px 24px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: auto;
}

.site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

.site-footer a:hover { color: var(--text-primary); }

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

/* Landing-page responsive */
@media (max-width: 700px) {
  .hero-headline { font-size: 2rem; letter-spacing: -0.8px; }
  .feature-grid  { grid-template-columns: 1fr; }
}
