/* =========================================================
   AVITO RADAR — GOOGLE STITCH SEMANTIC DESIGN SYSTEM
   ========================================================= */

:root {
  /* Canvas & Neutral Bases */
  --bg-space: #080c15;
  --bg-surface: #101726;
  --bg-card: rgba(16, 23, 38, 0.85);
  --bg-card-hover: rgba(23, 32, 51, 0.95);
  --bg-elevated: #172033;
  --bg-input: #0b101c;

  /* Borders & Structural Dividers */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glass: rgba(255, 255, 255, 0.14);
  --border-focus: rgba(6, 182, 212, 0.5);

  /* Calibrated Accents (Saturation < 80%) */
  --accent-emerald: #10b981;
  --accent-crimson: #ef4444;
  --accent-cyan: #06b6d4;
  --accent-indigo: #4f46e5;
  --accent-amber: #f59e0b;
  --accent-purple: #8b5cf6;

  /* Typography Colors */
  --text-head: #f8fafc;
  --text-body: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Geometry Scale */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  /* Elevation Shadows */
  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.45);

  /* Typography Stacks */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace, Consolas;

  --transition-spring: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-space);
  color: var(--text-body);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 10% 0%, rgba(6, 182, 212, 0.08) 0px, transparent 40%),
    radial-gradient(circle at 90% 100%, rgba(79, 70, 229, 0.07) 0px, transparent 45%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* App Container */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: 32px;
}

/* =========================================================
   HEADER
   ========================================================= */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: rgba(8, 12, 21, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo-radar, .logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.18), rgba(79, 70, 229, 0.22));
  border: 1px solid rgba(6, 182, 212, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  font-size: 19px;
}

.logo-radar .radar-sweep {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(from 0deg at 50% 50%, rgba(6, 182, 212, 0.35) 0deg, transparent 60deg);
  animation: radarRotate 3.5s linear infinite;
}

@keyframes radarRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.brand-text h1 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-head);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--accent-emerald);
  font-weight: 600;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-body);
}

/* =========================================================
   NAVIGATION TABS
   ========================================================= */

.tab-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px 14px;
  background: rgba(8, 12, 21, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 69px;
  z-index: 90;
}

.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  padding: 6px 4px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-spring);
  position: relative;
}

.tab-btn .tab-icon {
  font-size: 16px;
}

.tab-btn:hover {
  color: var(--text-body);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan);
  border-color: rgba(6, 182, 212, 0.28);
}

.tab-btn .badge {
  position: absolute;
  top: 3px;
  right: 6px;
  background: var(--accent-cyan);
  color: #080c15;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

/* =========================================================
   CONTENT AREA
   ========================================================= */

.content-area {
  padding: 16px;
  flex: 1;
}

.tab-content {
  display: none;
  animation: tabAppear 0.22s ease-out;
}

.tab-content.active {
  display: block;
}

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

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-head);
  letter-spacing: -0.01em;
}

.btn-refresh {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-spring);
}

.btn-refresh:active {
  transform: rotate(180deg) scale(0.94);
}

/* =========================================================
   CARDS & BASE STYLES
   ========================================================= */

.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  margin-bottom: 12px;
  transition: var(--transition-spring);
}

.card:hover {
  border-color: var(--border-glass);
}

/* =========================================================
   FILTER CARDS & LISTS
   ========================================================= */

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

.filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-card);
  margin-bottom: 10px;
  transition: var(--transition-spring);
  border-left: 3px solid var(--accent-emerald);
}

.filter-card.inactive {
  opacity: 0.65;
  border-left: 3px solid var(--text-dim);
}

.filter-card-top, .filter-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.filter-title, .filter-name {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 800;
  color: var(--text-head);
  line-height: 1.3;
}

.filter-meta, .filter-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 8px;
}

.meta-tag, .badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.meta-tag.interval, .badge-tag.interval {
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent-cyan);
  border-color: rgba(6, 182, 212, 0.25);
}

.meta-tag.price, .badge-tag.price {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.25);
}

.filter-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
  margin-top: 6px;
}

.btn-avito-link, .history-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-cyan);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-spring);
}

.btn-avito-link:hover, .history-link:hover {
  color: var(--text-head);
}

.btn-icon, .btn-icon-action {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-spring);
}

.btn-icon:hover, .btn-icon-action:hover {
  background: rgba(239, 68, 68, 0.18);
  color: var(--accent-crimson);
  border-color: var(--accent-crimson);
}

/* =========================================================
   HISTORY (НАХОДКИ) CARDS
   ========================================================= */

.history-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-cyan);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-card);
  margin-bottom: 10px;
  transition: var(--transition-spring);
}

.history-card:hover {
  border-color: var(--border-glass);
}

.history-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-head);
  line-height: 1.4;
}

.history-price {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 800;
  color: var(--accent-emerald);
  margin-top: 2px;
}

.history-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
  margin-top: 6px;
}

/* =========================================================
   TOGGLE SWITCH (44px TOUCH TARGET)
   ========================================================= */

.toggle-switch, .switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider::before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  border-radius: 50%;
  transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

input:checked + .slider {
  background-color: var(--accent-emerald);
  border-color: var(--accent-emerald);
}

input:checked + .slider::before {
  transform: translateX(20px);
  background-color: #080c15;
}

/* =========================================================
   MODE SWITCHER & FORMS
   ========================================================= */

.mode-switch-container {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
  margin-bottom: 14px;
  gap: 4px;
}

.mode-switch-btn {
  flex: 1;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-spring);
}

.mode-switch-btn.active {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.3);
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-body);
  margin-bottom: 6px;
}

.form-hint {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 14px;
  font-size: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-with-icon input {
  padding-left: 40px !important;
}

input[type="text"],
input[type="url"],
input[type="number"] {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-head);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: var(--transition-spring);
}

input:focus {
  border-color: var(--accent-cyan);
  background: #0f1626;
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* City Chips */
.city-chips-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.city-chips-scroll::-webkit-scrollbar {
  display: none;
}

.city-chip {
  flex-shrink: 0;
  min-height: 38px;
  padding: 7px 13px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-spring);
  white-space: nowrap;
}

.city-chip.active {
  background: rgba(6, 182, 212, 0.16);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

/* Interval Pills */
.interval-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.interval-pill input {
  display: none;
}

.interval-pill span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-spring);
}

.interval-pill input:checked + span {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border-color: var(--accent-emerald);
}

/* =========================================================
   LIVE PREVIEW
   ========================================================= */

.preview-section {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 16px;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.preview-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-head);
}

.preview-status {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
}

.preview-status.searching {
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
}

.preview-cards-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: var(--transition-spring);
}

.preview-thumb {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  flex-shrink: 0;
}

.preview-thumb-fallback {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.preview-info {
  flex: 1;
  min-width: 0;
}

.preview-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-head);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.preview-item-price {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 800;
  color: var(--accent-emerald);
  margin-bottom: 2px;
}

.preview-item-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
}

/* Primary Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: none;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-spring);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.25);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-block {
  width: 100%;
}

/* =========================================================
   100 PORTS POOL & TELEMETRY
   ========================================================= */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
}

.green-card::before { background: var(--accent-emerald); }
.red-card::before { background: var(--accent-crimson); }
.unk-card::before { background: var(--accent-cyan); }
.rate-card::before { background: var(--accent-purple); }

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-head);
  font-variant-numeric: tabular-nums;
}

.green-card .stat-value { color: var(--accent-emerald); }
.red-card .stat-value { color: var(--accent-crimson); }
.rate-card .stat-value { color: var(--accent-cyan); }

/* Matrix Card */
.matrix-card {
  padding: 14px;
}

.matrix-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.matrix-header h3 {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-head);
}

.legend {
  display: flex;
  gap: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
}

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

.dot-green { background: var(--accent-emerald); }
.dot-red { background: var(--accent-crimson); }
.dot-unk { background: #475569; }

.ports-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
}

.port-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: transform 0.15s ease;
  user-select: none;
}

.port-cell:active {
  transform: scale(0.92);
}

.port-cell.green {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.6);
}

.port-cell.red {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-crimson);
  border: 1px solid rgba(239, 68, 68, 0.6);
}

.port-cell.unknown {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  border: 1px solid var(--border-subtle);
}

/* =========================================================
   SKELETONS & EMPTY STATES
   ========================================================= */

.skeleton-card {
  height: 72px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.02) 25%, rgba(255, 255, 255, 0.06) 50%, rgba(255, 255, 255, 0.02) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border: 1px solid var(--border-subtle);
  margin-bottom: 8px;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.empty-state {
  padding: 36px 16px;
  text-align: center;
  color: var(--text-dim);
}

.empty-icon {
  font-size: 36px;
  display: block;
  margin-bottom: 8px;
}

.empty-state h3 {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-head);
  margin-bottom: 4px;
}

.empty-state p {
  font-size: 12px;
  margin-bottom: 14px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #172033;
  border: 1px solid rgba(6, 182, 212, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  z-index: 1000;
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  max-width: 90%;
  text-align: center;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Modal Bottom Sheet */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-backdrop.show {
  display: block;
  opacity: 1;
}

.modal-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 480px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-glass);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 18px 18px 30px 18px;
  z-index: 210;
  transition: transform 0.25s cubic-bezier(0.32, 1, 0.23, 1);
}

.modal-sheet.show {
  transform: translateX(-50%) translateY(0);
}

.modal-handle {
  width: 32px;
  height: 4px;
  background: var(--text-dim);
  border-radius: 2px;
  margin: 0 auto 14px auto;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 800;
  color: var(--text-head);
  margin-bottom: 10px;
}

/* =========================================================
   LEGAL FOOTER
   ========================================================= */

.app-footer {
  margin-top: 32px;
  padding: 16px 12px 24px;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--accent-blue-hi);
  text-decoration: underline;
}

.footer-sep {
  color: var(--text-dim);
  font-size: 10px;
}

.footer-copy {
  color: var(--text-dim);
  font-size: 10px;
}

/* =========================================================
   FORM SELECT & CHECKOUT MODAL
   ========================================================= */

.form-select {
  width: 100%;
  min-height: 46px;
  padding: 11px 36px 11px 14px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-head);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2306b6d4' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  transition: var(--transition-spring);
}

.form-select:focus {
  border-color: var(--accent-cyan);
  background-color: #0f1626;
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.25);
}

.form-select option {
  background-color: #101726;
  color: #f8fafc;
  padding: 8px 10px;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 999999;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  display: flex !important;
  opacity: 1;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.75);
  animation: modalPop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.checkout-summary-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin: 12px 0 16px;
  font-size: 13px;
}

.checkout-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.checkout-price-highlight {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent-cyan);
}

.pay-methods-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.pay-method-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-head);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-spring);
  text-align: left;
}

.pay-method-btn:hover, .pay-method-btn:active {
  background: rgba(6, 182, 212, 0.12);
  border-color: var(--accent-cyan);
}

.compliance-box {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin: 12px 0;
  font-size: 12px;
  line-height: 1.45;
}