/* Default theme = dark. Applied when [data-theme] is "dark" or absent. */
:root {
  color-scheme: dark;
  --bg-color: #050816;
  --section-bg: #0B1020;
  --card-bg: rgba(15, 23, 42, 0.82);
  --card-border: rgba(139, 92, 246, 0.25);
  --text-color: #F8FAFC;
  --muted-color: #94A3B8;
  --accent: #8B5CF6;
  --accent-strong: #6C63FF;
  --accent-secondary: #6C63FF;
  --pill-active-bg: rgba(124, 58, 237, 0.22);
  --pill-active-fg: #F8FAFC;
  --danger: #ff5f8f;
  --success: #2ad28f;
  --shadow: 0 22px 60px rgba(2, 4, 12, 0.65);
  --bg-layer: radial-gradient(circle at 80% 0%, rgba(108, 99, 255, 0.16), transparent 55%),
    var(--bg-color);
}

/* Light theme override. Same variable names, different values. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg-color: #F8FAFC;
  --section-bg: #F1F5F9;
  --card-bg: #FFFFFF;
  --card-border: #E2E8F0;
  --text-color: #0F172A;
  --muted-color: #64748B;
  --accent: #7C3AED;
  --accent-strong: #7C3AED;
  --accent-secondary: #7C3AED;
  --pill-active-bg: #EDE9FE;
  --pill-active-fg: #4C1D95;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  --bg-layer: var(--bg-color);
}

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

body {
  background: var(--bg-layer);
  color: var(--text-color);
  font-family: "Inter", "Segoe UI", sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  padding: 0;
  margin: 0;
  width: 100%;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

.app-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.background-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.5;
}

.glow {
  position: absolute;
  width: 420px;
  height: 420px;
  filter: blur(60px);
  opacity: 0.6;
}

.glow-one {
  top: -120px;
  left: -80px;
  background: #5d7cff;
}

.glow-two {
  bottom: -160px;
  right: -100px;
  background: #00d4ff;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 16px 120px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.glass-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 24px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}

.hero-brand {
  display: flex;
  gap: 16px;
  align-items: center;
  flex: 1 1 360px;
}

.logo-chip {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-eyebrow {
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--muted-color);
  margin-bottom: 6px;
}

.hero-panel h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin-bottom: 6px;
}

.hero-subtitle {
  color: var(--muted-color);
  font-size: 0.95rem;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.metric-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 18px;
  min-width: 140px;
}

.metric-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-color);
}

.metric-value {
  font-weight: 600;
  font-size: 1rem;
}

.menu-wrapper {
  position: relative;
}

.dropdown-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  width: auto;
  box-shadow: none;
}

.dropdown-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.4);
}

.menu-bars {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}

.menu-bars span {
  width: 18px;
  height: 2px;
  background: var(--text-color);
  display: block;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 220px;
  border-radius: 16px;
  padding: 0;
  z-index: 40;
}

.dropdown-content.show {
  display: block;
}

.dropdown-content a,
.menu-footer a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  color: var(--text-color);
  text-decoration: none;
  transition: background 0.2s ease;
}

.dropdown-content a:hover,
.menu-footer a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dropdown-content a.active {
  color: var(--accent-strong);
}

.user-info {
  padding: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.user-info .balance {
  color: var(--success);
  margin-top: 4px;
}

.menu-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 18px 16px;
}

.menu-footer .link-button {
  color: var(--text-color);
  background: none;
  border: none;
  padding: 0;
  width: auto;
  cursor: pointer;
  font: inherit;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.menu-footer .link-button:hover {
  opacity: 1;
  text-decoration: underline;
}

.header {
  display: flex;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 0;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.header .dropdown-content {
  left: 0;
  right: auto;
}

.tabs-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tab-button {
  border-radius: 999px;
  padding: 10px 20px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  width: auto;
}

.tab-button.active {
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  border-color: transparent;
}

.tab-button:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.tabs-hint {
  font-size: 0.85rem;
  color: var(--muted-color);
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

fieldset {
  border: none;
  padding: 0;
}

.control-card .panel-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--muted-color);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

button,
select,
input {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 1rem;
  font-family: inherit;
  width: 100%;
  color: var(--text-color);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

select,
input {
  border: 1px solid rgba(255, 255, 255, 0.15);
}

select:focus,
input:focus {
  outline: none;
  border-color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.06);
}

.bank-search-container,
.provider-dropdown,
.age-fieldset {
  position: relative;
}

.bank-search-container::after,
.provider-dropdown::after,
.age-fieldset::after {
  content: attr(data-label);
  position: absolute;
  top: -10px;
  left: 18px;
  font-size: 0.7rem;
  padding: 0 10px;
  background: rgba(5, 6, 12, 0.85);
  border-radius: 999px;
  color: var(--muted-color);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bank-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: rgba(8, 9, 18, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  max-height: 240px;
  overflow-y: auto;
  display: none;
  z-index: 20;
  box-shadow: var(--shadow);
}

.bank-dropdown::-webkit-scrollbar {
  width: 6px;
}

.bank-dropdown::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.bank-option {
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.bank-option:hover,
.bank-option.active {
  background: rgba(255, 255, 255, 0.08);
}

.bank-option .highlight {
  color: var(--accent-strong);
  font-weight: 600;
}

.info-panel {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--muted-color);
  margin-bottom: 4px;
}

.primary-action,
#showOrderBtn {
  width: auto;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  border: none;
  color: #05060c;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 999px;
  cursor: pointer;
}

.primary-action:hover,
#showOrderBtn:hover {
  transform: translateY(-1px);
}

#info {
  color: var(--muted-color);
  font-size: 0.95rem;
}

.states-panel {
  padding: 0;
}

#content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  padding: 24px;
}

.state-container {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
}

.state-container h2 {
  font-size: 1.1rem;
}

.state-flag img {
  width: 100px;
  height: 60px;
  border-radius: 12px;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: white;
}

.state-info p {
  color: var(--muted-color);
}

.lead-input-container {
  display: flex;
  gap: 10px;
  align-items: center;
}

#lead-input {
  flex: 1;
  border-radius: 12px;
}

.add-button {
  flex-shrink: 0;
  width: auto;
  background: var(--success);
  color: #041017;
  font-weight: 600;
  border-radius: 12px;
  padding: 10px 18px;
  box-shadow: none;
}

.add-button:hover {
  transform: translateY(-1px);
  background: #39e09d;
}

#showerror {
  display: none;
  margin-top: 16px;
  padding: 16px 20px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 66, 101, 0.08);
  color: #ffc0cb;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

#showerror .error-message {
  flex: 1;
}

.close-error {
  width: auto;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
}

#orderSummary {
  position: fixed;
  inset: 0;
  top: 100%;
  background: rgba(5, 6, 12, 0.92);
  color: var(--text-color);
  padding: 32px 20px 120px;
  overflow-y: auto;
  z-index: 200;
  transition: top 0.3s ease-in-out;
}

#orderSummary h2 {
  text-align: center;
  margin-bottom: 20px;
}

#orderSummary .state-container {
  flex-direction: row;
  align-items: center;
  gap: 14px;
}

.order-details h3 {
  margin-bottom: 4px;
}

.order-totals {
  margin-top: 20px;
  line-height: 1.6;
}

.order-totals .discount {
  color: var(--accent-strong);
}

.order-totals .final-total {
  font-size: 1.2rem;
  font-weight: 600;
}

.insufficient-funds {
  color: var(--danger);
}

#orderSummary .delete-order {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  width: auto;
  padding: 0;
  font-size: 1.4rem;
  box-shadow: none;
}

#orderSummary .confirm-order {
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #05060c;
  font-weight: 600;
  margin-top: 20px;
}

#orderSummary .confirm-order:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#orderSummary .go-back {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--text-color);
  margin-top: 12px;
}

#processing-dialog {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 12, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

#processing-dialog .content {
  text-align: center;
}

#processing-dialog h3 {
  margin-top: 12px;
}

#loader {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: rgba(5, 6, 12, 0.8);
  z-index: 400;
  gap: 12px;
}

.lds-roller {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
}

.lds-roller div {
  animation: lds-roller 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  transform-origin: 40px 40px;
}

.lds-roller div:after {
  content: " ";
  display: block;
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  margin: -4px 0 0 -4px;
}

@keyframes lds-roller {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  .app-shell {
    padding: 24px 16px 100px;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  #content {
    grid-template-columns: 1fr;
  }

  .info-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .primary-action,
  #showOrderBtn {
    width: 100%;
    text-align: center;
  }

  #orderSummary {
    padding-bottom: 160px;
  }
}

/* --- Premium refresh additions (do not remove; design pass 2026-05-24) --- */

body {
  font-weight: 450;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

.glass-panel {
  backdrop-filter: blur(18px) saturate(110%);
  -webkit-backdrop-filter: blur(18px) saturate(110%);
  border: 1px solid var(--card-border);
  border-radius: 18px;
}

.tab-button {
  background: transparent;
  color: var(--muted-color);
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: all 0.2s ease;
}
.tab-button:hover {
  color: var(--text-color);
  border-color: var(--card-border);
}
.tab-button.active {
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #F8FAFC;
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 6px 18px rgba(108, 99, 255, 0.25);
}

input[type="text"],
input[type="search"],
input[type="number"],
input[type="email"],
select,
textarea {
  background: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 10px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.35);
}

.info-sub {
  color: var(--muted-color);
  font-size: 0.9rem;
  margin-top: 4px;
  letter-spacing: 0.01em;
}

.cta-premium {
  display: block;
  width: 100%;
  margin: 18px 0 4px;
  padding: 14px 18px;
  border: 1px solid rgba(139, 92, 246, 0.45);
  border-radius: 14px;
  background: linear-gradient(120deg, #6C63FF 0%, #8B5CF6 100%);
  color: #F8FAFC;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(108, 99, 255, 0.35),
              0 0 0 1px rgba(108, 99, 255, 0.15) inset;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.cta-premium:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 36px rgba(108, 99, 255, 0.45);
}
.cta-premium:active { transform: translateY(0); }

/* Tone down decorative background glows (was cyan + blue, now single purple) */
.glow-one {
  background: #6C63FF;
  opacity: 0.25;
}
.glow-two {
  background: transparent;
  opacity: 0;
}
.background-grid { opacity: 0.25; }

/* ============================================================
   Apple-style search redesign (added 2026-05-24)
   ============================================================ */

/* Top bar: menu | title | theme toggle */
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px 4px;
}
.app-topbar h1 {
  flex: 1;
  text-align: center;
  font-size: clamp(1.05rem, 4vw, 1.35rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text-color);
}
.app-topbar .menu-wrapper {
  flex: 0 0 auto;
}

/* Theme toggle button — 38px round */
.theme-toggle {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-color);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}
.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

/* Search hero — Apple-like big headline area */
.search-hero {
  text-align: center;
  padding: 28px 12px 8px;
  margin: 0;
}
.search-hero .info-static {
  font-size: clamp(1.15rem, 4.5vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.25;
  color: var(--text-color);
  margin: 0 0 6px;
}
.search-hero .info-static-sub {
  font-size: 0.92rem;
  color: var(--muted-color);
  line-height: 1.45;
  margin: 0 auto;
  max-width: 520px;
}

/* Mode selector pills */
.mode-pills {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: var(--section-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  margin: 0 auto;
  max-width: 480px;
}
.mode-pill {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted-color);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.mode-pill:hover { color: var(--text-color); }
.mode-pill.active {
  background: var(--pill-active-bg);
  color: var(--pill-active-fg);
  border-color: var(--accent);
  font-weight: 600;
}

/* Filter stack wrapping the control-grid */
.filter-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.filter-stack .control-grid {
  gap: 12px;
}

/* Light-mode adjustments to decorative dark-only elements */
:root[data-theme="light"] .app-background { opacity: 0.4; }
:root[data-theme="light"] .background-grid {
  background-image: linear-gradient(rgba(15, 23, 42, 0.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(15, 23, 42, 0.05) 1px, transparent 1px);
  opacity: 0.6;
}
:root[data-theme="light"] .glow-one { background: #7C3AED; opacity: 0.10; }
:root[data-theme="light"] .glow-two { display: none; }

/* Light-mode glass cards: solid background + soft shadow instead of blur */
:root[data-theme="light"] .glass-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: var(--shadow);
}

/* Light-mode menu dropdown — solid white card */
:root[data-theme="light"] .dropdown-content { background: var(--card-bg); }
:root[data-theme="light"] .dropdown-content a:hover,
:root[data-theme="light"] .menu-footer a:hover {
  background: var(--section-bg);
}

/* Light-mode menu button — visible borders */
:root[data-theme="light"] .dropdown-btn {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-color);
}
:root[data-theme="light"] .menu-bars span { background: var(--text-color); }

/* Light-mode metric pills */
:root[data-theme="light"] .metric-pill {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
}

/* Light-mode form controls: white surface, slate borders, slate text */
:root[data-theme="light"] button,
:root[data-theme="light"] select,
:root[data-theme="light"] input {
  color: var(--text-color);
  background: var(--card-bg);
}
:root[data-theme="light"] select,
:root[data-theme="light"] input {
  border: 1px solid var(--card-border);
}
:root[data-theme="light"] select:focus,
:root[data-theme="light"] input:focus {
  border-color: var(--accent);
  background: var(--card-bg);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

/* Make sure body in light mode uses solid bg (not a gradient) */
:root[data-theme="light"] body { background: var(--bg-color); }

/* In light mode, tab-button.active should also use the purple accent on light surface */
:root[data-theme="light"] .tab-button.active {
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #FFFFFF;
}

/* Empty #info shouldn't reserve vertical space when there's nothing in it */
#info:empty { display: none; }

/* Bank dropdown layering fix — the Bank card's stacking context must
   win over the sibling Age card so the absolute-positioned suggestion
   list floats over it rather than being painted behind. No layout change. */
.control-card:has(.bank-dropdown) {
  position: relative;
  z-index: 60;
}
.bank-dropdown { z-index: 100; }

/* Defensive: ensure no ancestor of the dropdown clips it. */
.filter-stack,
.filter-stack .control-grid {
  overflow: visible;
}

/* === Bank-dropdown theme fix ===
   The original .bank-dropdown / .bank-option rules use hardcoded dark
   colours, so in light mode the popup stays dark and its items become
   unreadable. Make both theme-aware using existing tokens. */

/* Dark mode (default) — re-state using tokens, no visual change */
.bank-dropdown {
  background: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
}
.bank-option {
  color: var(--text-color);
}
.bank-option:hover,
.bank-option.active {
  background: rgba(124, 58, 237, 0.18);
}

/* Light mode — solid white surface, slate text, soft hover */
:root[data-theme="light"] .bank-dropdown {
  background: #FFFFFF;
  color: #0F172A;
  border: 1px solid #E2E8F0;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.10);
}
:root[data-theme="light"] .bank-option { color: #0F172A; }
:root[data-theme="light"] .bank-option:hover,
:root[data-theme="light"] .bank-option.active {
  background: #EDE9FE;
}
:root[data-theme="light"] .bank-dropdown::-webkit-scrollbar-thumb {
  background: #CBD5E1;
}

/* ===========================================================
   Selection feedback + order summary fixes
   =========================================================== */

/* Bug 1 — Selected state for state cards & Add button */
.state-container.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 10px 24px rgba(108, 99, 255, 0.18);
  position: relative;
}
.state-container.selected::before {
  content: "Selected";
  position: absolute;
  top: 10px;
  right: 12px;
  background: var(--pill-active-bg);
  color: var(--pill-active-fg);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent);
}
.add-button.added {
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #FFFFFF;
}
.add-button.added:hover { background: linear-gradient(120deg, var(--accent-strong), var(--accent)); }

/* Per-card running subtotal injected by enhance.js */
.state-subtotal {
  margin-top: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}

/* Bug 2 — Constrain order-summary thumbnails (the css class .state-img
   is only used inside #orderSummary) */
#orderSummary .state-img,
.state-img {
  width: 64px;
  height: 64px;
  max-width: 64px;
  max-height: 64px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: #FFFFFF;
  padding: 4px;
  /* Style alt text / broken-image fallback so it stays inside the box */
  font-size: 10px;
  color: #64748B;
  text-align: center;
  overflow: hidden;
}

/* Order summary list rows — keep tidy row layout */
#orderSummary .state-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  min-height: 0;
}
#orderSummary .order-details { flex: 1; min-width: 0; }
#orderSummary .order-details h3 { font-size: 1rem; }
#orderSummary .order-details p  { font-size: 0.9rem; color: var(--muted-color); }
#orderSummary .delete-order { font-size: 1.2rem; }

/* Light-mode overrides for the order summary overlay & cards */
:root[data-theme="light"] #orderSummary {
  background: rgba(248, 250, 252, 0.96);
  color: #0F172A;
}
:root[data-theme="light"] #orderSummary h2,
:root[data-theme="light"] #orderSummary h3 { color: #0F172A; }
:root[data-theme="light"] #orderSummary .state-container {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
:root[data-theme="light"] #orderSummary .order-details p { color: #64748B; }
:root[data-theme="light"] #orderSummary .go-back {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  color: #0F172A;
}
:root[data-theme="light"] #orderSummary .confirm-order { color: #FFFFFF; }
:root[data-theme="light"] .state-container {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
}

/* ===========================================================
   My Orders redesign — clean Apple-style cards, theme-aware
   =========================================================== */

.orders-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.order-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 18px 20px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 4px 14px rgba(2, 4, 12, 0.18);
  position: relative;
}
.order-card:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 10px 28px rgba(108, 99, 255, 0.18);
}
.order-card:active { transform: translateY(0); }

.order-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.order-card-head .order-id {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-color);
}
.order-card-head .order-date {
  font-size: 0.82rem;
  color: var(--muted-color);
  white-space: nowrap;
}

.order-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.order-card-body .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 0.95rem;
}
.order-card-body .row .label {
  color: var(--muted-color);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.order-card-body .row .value {
  color: var(--text-color);
  font-weight: 500;
  text-align: right;
  word-break: break-word;
  flex: 1;
}

.order-card-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--card-border);
}
.order-card-foot .view-link {
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.005em;
}
.order-card-foot .view-link::after {
  content: "›";
  margin-left: 6px;
  font-weight: 700;
}

/* Light-mode tweaks */
:root[data-theme="light"] .order-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
:root[data-theme="light"] .order-card:hover {
  box-shadow: 0 10px 28px rgba(124, 58, 237, 0.12);
}
:root[data-theme="light"] .order-card-foot { border-top-color: #E2E8F0; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  background: var(--card-bg);
  border: 1px dashed var(--card-border);
  border-radius: 18px;
}
.empty-state h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-color);
}
.empty-state p {
  color: var(--muted-color);
  margin-bottom: 20px;
}
.empty-state .cta-premium {
  display: inline-block;
  width: auto;
  padding: 12px 28px;
}
:root[data-theme="light"] .empty-state {
  background: #FFFFFF;
  border-color: #E2E8F0;
}

/* "Click an order" hint text */
.orders-hint {
  color: var(--muted-color);
  font-size: 0.9rem;
  text-align: center;
  margin: 4px 0 18px;
}

/* ===========================================================
   Order details (#leadsContainer) — Apple-style cards
   =========================================================== */

/* Sticky header inside the slide-up panel */
#leadsContainer .order-detail-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-color);
  border-bottom: 1px solid var(--card-border);
}
#leadsContainer .order-detail-topbar h2 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-color);
  margin: 0;
}
#leadsContainer .icon-button {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-color);
  cursor: pointer;
  box-shadow: none;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
#leadsContainer .icon-button:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
#leadsContainer .icon-button .material-icons {
  font-size: 20px;
  color: var(--text-color);
  vertical-align: middle;
}
#leadsContainer .topbar-actions {
  display: inline-flex;
  gap: 8px;
}

/* Inner padding wrapper for the content scroll area */
#leadsContainer .order-detail-body {
  padding: 16px 18px 80px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* "Unlock all" hero CTA */
.unlock-all-card {
  background: linear-gradient(120deg, #6C63FF 0%, #8B5CF6 100%);
  border-radius: 18px;
  padding: 18px 20px;
  color: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  border: 1px solid rgba(139, 92, 246, 0.45);
  box-shadow: 0 12px 32px rgba(108, 99, 255, 0.30);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.unlock-all-card:hover { transform: translateY(-1px); box-shadow: 0 16px 38px rgba(108, 99, 255, 0.40); }
.unlock-all-card .copy { flex: 1; min-width: 0; }
.unlock-all-card .title { font-weight: 600; font-size: 1.02rem; margin-bottom: 2px; letter-spacing: -0.005em; }
.unlock-all-card .sub { font-size: 0.85rem; opacity: 0.88; }
.unlock-all-card .price {
  font-weight: 700;
  font-size: 1.05rem;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 8px 14px;
  white-space: nowrap;
}

/* Per-person lead card */
.lead-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
:root[data-theme="light"] .lead-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.lead-card .lead-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lead-card .lead-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--pill-active-bg);
  color: var(--pill-active-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--card-border);
}
.lead-card .lead-name-block { flex: 1; min-width: 0; }
.lead-card .lead-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-color);
  word-break: break-word;
  line-height: 1.3;
}
.lead-card .lead-record-id {
  font-size: 0.78rem;
  color: var(--muted-color);
  letter-spacing: 0.02em;
}

.lead-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.92rem;
}
.lead-rows .row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  align-items: baseline;
}
.lead-rows .row .label {
  color: var(--muted-color);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.lead-rows .row .value {
  color: var(--text-color);
  word-break: break-word;
  line-height: 1.4;
}

/* Per-person CTAs */
.cta-outline {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--accent);
  border-radius: 14px;
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.96rem;
  letter-spacing: 0.005em;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease;
}
.cta-outline:hover {
  background: var(--pill-active-bg);
}
:root[data-theme="light"] .cta-outline {
  background: #FFFFFF;
}
:root[data-theme="light"] .cta-outline:hover {
  background: #EDE9FE;
}

.unlock-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  background: var(--pill-active-bg);
  color: var(--pill-active-fg);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.unlock-pill::before { content: "✓"; font-weight: 700; }

/* Tame the inline contact-details rendered inside lead cards
   (extractResult emits <b>name</b>, <p>email/phone/address>) */
.lead-card details {
  border-top: 1px dashed var(--card-border);
  padding-top: 10px;
  margin-top: 4px;
  font-size: 0.9rem;
}
.lead-card details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}
.lead-card details p,
.lead-card details b { color: var(--text-color); }
.lead-card details pre {
  font-size: 0.78rem;
  background: var(--section-bg);
  border-radius: 10px;
  padding: 10px;
  overflow-x: auto;
  color: var(--muted-color);
  white-space: pre-wrap;
}

/* ===========================================================
   Topbar nav menu fix
   The original .dropdown-content rule anchors `right: 0` against
   the menu-wrapper. In the new Apple topbar the menu button is
   the LEFT-most item, so the dropdown opened off-screen to the
   left. Override to anchor on the left and bump z-index above
   sticky topbars / glass panels.
   =========================================================== */
.app-topbar .menu-wrapper .dropdown-content {
  left: 0;
  right: auto;
  top: calc(100% + 10px);
  min-width: 240px;
  max-width: calc(100vw - 24px);
  z-index: 1000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(2, 4, 12, 0.35);
}

/* Make sure no stacking-context ancestor traps the menu */
.app-topbar { z-index: 50; position: relative; }
.menu-wrapper { z-index: 60; }

/* Light-mode tweaks to the menu surface */
:root[data-theme="light"] .app-topbar .menu-wrapper .dropdown-content {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.10);
}
:root[data-theme="light"] .dropdown-content a {
  color: #0F172A;
}
:root[data-theme="light"] .dropdown-content a:hover,
:root[data-theme="light"] .menu-footer a:hover {
  background: #F1F5F9;
}
:root[data-theme="light"] .dropdown-content a.active {
  color: #7C3AED;
  background: #EDE9FE;
}
:root[data-theme="light"] .user-info {
  background: #F1F5F9;
  border-bottom: 1px solid #E2E8F0;
  color: #0F172A;
}
:root[data-theme="light"] .user-info .balance { color: #16A34A; }
:root[data-theme="light"] .menu-footer .link-button { color: #0F172A; }

/* Hide the legacy floating BANK / AGE / PROVIDER decorator pills
   (they predate the redesign; .panel-title labels replaced them) */
.bank-search-container::after,
.provider-dropdown::after,
.age-fieldset::after {
  content: none !important;
  display: none !important;
}

/* ===========================================================
   Topbar menu — convert dropdown into a left-side drawer
   with backdrop. Scoped to .app-topbar .menu-wrapper so other
   .dropdown-content uses on the page are unaffected.
   =========================================================== */

/* Slide animation: start off-screen, slide in when .show is added */
.app-topbar .menu-wrapper .dropdown-content {
  position: fixed;
  top: 0;
  left: 0;
  right: auto;
  min-width: 0;
  width: min(82vw, 340px);
  height: 100vh;
  max-height: 100vh;
  padding-top: max(env(safe-area-inset-top, 0px), 16px);
  border-radius: 0 18px 18px 0;
  border: 1px solid var(--card-border);
  border-left: none;
  background: var(--card-bg);
  box-shadow: 18px 0 44px rgba(2, 4, 12, 0.45);
  overflow-y: auto;
  z-index: 1050;
  transform: translateX(-110%);
  transition: transform 0.25s ease-out;
  display: block;       /* always laid out; visibility controlled by transform */
  visibility: hidden;
  pointer-events: none;
}
.app-topbar .menu-wrapper .dropdown-content.show {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

/* Drawer item rows — slightly bigger tap targets */
.app-topbar .menu-wrapper .dropdown-content a,
.app-topbar .menu-wrapper .dropdown-content .menu-footer a,
.app-topbar .menu-wrapper .dropdown-content .menu-footer .link-button {
  padding: 14px 20px;
  font-size: 1rem;
}
.app-topbar .menu-wrapper .dropdown-content .user-info {
  padding: 18px 20px;
}

/* Backdrop element injected by enhance.js */
.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: pointer;
}
.menu-backdrop.visible { opacity: 1; }

:root[data-theme="light"] .menu-backdrop {
  background: rgba(15, 23, 42, 0.18);
}

/* Lock background scroll while drawer is open */
body.menu-open {
  overflow: hidden;
  touch-action: none;
}

/* ===========================================================
   Hamburger / topbar regressions
   - Make the persisting backdrop ignore pointer events when not
     visible (THIS was the bug: hamburger stopped working after the
     menu had been opened once because the still-mounted invisible
     overlay was eating clicks)
   - Tighten the top-of-page spacing and make the topbar sticky so
     it stays in reach when the user scrolls
   =========================================================== */

/* 1) Critical: don't intercept clicks when backdrop is invisible */
.menu-backdrop { pointer-events: none; }
.menu-backdrop.visible { pointer-events: auto; }

/* 2) Sticky topbar + tighter top padding */
.app-shell {
  padding-top: 8px;
}
.app-topbar {
  position: sticky;
  top: 0;
  padding: 10px 4px;
  margin-bottom: 4px;
  background: var(--bg-color);
  /* Soft bottom edge so content scrolling under it looks clean */
  border-bottom: 1px solid transparent;
  z-index: 50;
}
.app-topbar::after {
  /* subtle separator only when content has scrolled under the topbar */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--card-border);
  opacity: 0.6;
  pointer-events: none;
}

/* Reduce hero top padding now that the topbar sits flush */
.search-hero { padding-top: 18px; }

/* ===========================================================
   Backdrop hardening (Safari/iOS fix)
   - On iOS WebKit, backdrop-filter can keep rendering even when
     opacity is 0. Two safety layers:
     1. Default state hides the element entirely (display:none).
        It only shows when .visible is added.
     2. backdrop-filter is only declared on .visible.
   The JS also removes the element from the DOM after closing
   so nothing can possibly persist between menu opens.
   =========================================================== */
.menu-backdrop {
  display: none;
  pointer-events: none;
  background: transparent;
  /* deliberately no backdrop-filter here */
}
.menu-backdrop.visible {
  display: block;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 1;
}
:root[data-theme="light"] .menu-backdrop.visible {
  background: rgba(15, 23, 42, 0.18);
}

/* =========================================================
   FINAL OVERRIDE: menu backdrop must never have blur.
   This block is intentionally last so it wins the cascade.
   ========================================================= */
.menu-backdrop {
  display: none;
  pointer-events: none;
  background: transparent;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  filter: none !important;
}
.menu-backdrop.visible {
  display: block;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  filter: none !important;
  opacity: 1;
}
:root[data-theme="light"] .menu-backdrop.visible {
  background: rgba(15, 23, 42, 0.20);
}

/* Narrower drawer (fintech feel) + slightly larger border-radius */
.app-topbar .menu-wrapper .dropdown-content {
  width: min(78vw, 320px);
  border-radius: 0 24px 24px 0;
}

/* Subtler active state to feel less "gaming" */
.app-topbar .menu-wrapper .dropdown-content a.active {
  color: var(--accent);
  background: var(--pill-active-bg);
  border-left: 3px solid var(--accent);
  padding-left: 17px; /* 20 - 3 to keep text aligned */
}
:root[data-theme="light"] .app-topbar .menu-wrapper .dropdown-content a.active {
  color: #7C3AED;
  background: #EDE9FE;
}

/* Make the hamburger button itself stack above EVERYTHING including the
   backdrop (1040) and drawer (1050). This way no overlay can ever
   intercept its click, regardless of menu state. */
.app-topbar .menu-wrapper > .dropdown-btn {
  position: relative;
  z-index: 1100;
}

/* ============================================================
   DRAWER REBUILD — single authoritative block.
   Placed last in main.css so it wins the cascade over all the
   earlier patch rounds. Uses !important sparingly only where the
   inherited .glass-panel / earlier appended rules would override.
   ============================================================ */

/* Hamburger goes back to normal stacking inside the topbar so the
   drawer (z-index 50) covers it cleanly when open. */
.app-topbar .menu-wrapper > .dropdown-btn {
  position: relative !important;
  z-index: auto !important;
}

/* The drawer container — Apple/Stripe-style side drawer */
.app-topbar .menu-wrapper .dropdown-content {
  /* Take it OUT of flow and out of the topbar's stacking context */
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: auto !important;
  bottom: auto !important;
  width: min(80vw, 320px) !important;
  max-width: none !important;
  min-width: 0 !important;
  height: 100dvh !important;
  max-height: 100dvh !important;

  /* SOLID surface — no glass, no blur */
  background: var(--card-bg) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  border-right: 1px solid var(--card-border) !important;
  border-radius: 0 !important;
  box-shadow: 6px 0 28px rgba(2, 4, 12, 0.35) !important;

  /* Internal layout: header / nav / footer */
  display: flex !important;
  flex-direction: column !important;
  padding: max(env(safe-area-inset-top, 0px), 18px) 0 max(env(safe-area-inset-bottom, 0px), 18px) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;

  /* Z-index above everything */
  z-index: 50 !important;

  /* Default state: off-screen, no transition flash */
  transform: translateX(-105%) !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: transform 0.22s ease-out, visibility 0s linear 0.22s !important;
}

/* Open state */
.app-topbar .menu-wrapper .dropdown-content.show {
  transform: translateX(0) !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transition: transform 0.22s ease-out, visibility 0s linear 0s !important;
}

/* Light-mode surface */
:root[data-theme="light"] .app-topbar .menu-wrapper .dropdown-content {
  background: #FFFFFF !important;
  border-right: 1px solid #E2E8F0 !important;
  box-shadow: 6px 0 28px rgba(15, 23, 42, 0.10) !important;
}

/* HEADER (user info) */
.app-topbar .menu-wrapper .dropdown-content .user-info {
  padding: 4px 22px 18px !important;
  background: transparent !important;
  border-bottom: 1px solid var(--card-border) !important;
  margin-bottom: 8px !important;
}
.app-topbar .menu-wrapper .dropdown-content .user-info .name {
  font-size: 0.95rem;
  color: var(--text-color);
  margin-bottom: 2px;
}
.app-topbar .menu-wrapper .dropdown-content .user-info .balance {
  font-size: 0.85rem;
  color: var(--success);
}
:root[data-theme="light"] .app-topbar .menu-wrapper .dropdown-content .user-info {
  border-bottom-color: #E2E8F0 !important;
}
:root[data-theme="light"] .app-topbar .menu-wrapper .dropdown-content .user-info .balance { color: #16A34A; }

/* NAV section items */
.app-topbar .menu-wrapper .dropdown-content a,
.app-topbar .menu-wrapper .dropdown-content .menu-footer a,
.app-topbar .menu-wrapper .dropdown-content .menu-footer .link-button {
  display: flex !important;
  align-items: center;
  padding: 13px 22px !important;
  font-size: 0.98rem !important;
  font-weight: 500;
  color: var(--text-color) !important;
  background: transparent !important;
  text-decoration: none;
  border-left: 3px solid transparent !important;
  border-radius: 0 !important;
  transition: background 0.15s ease, color 0.15s ease;
}
.app-topbar .menu-wrapper .dropdown-content a:hover {
  background: var(--pill-active-bg) !important;
}
.app-topbar .menu-wrapper .dropdown-content a.active {
  background: var(--pill-active-bg) !important;
  color: var(--accent) !important;
  border-left-color: var(--accent) !important;
  font-weight: 600;
}
:root[data-theme="light"] .app-topbar .menu-wrapper .dropdown-content a {
  color: #0F172A !important;
}
:root[data-theme="light"] .app-topbar .menu-wrapper .dropdown-content a:hover {
  background: #F1F5F9 !important;
}
:root[data-theme="light"] .app-topbar .menu-wrapper .dropdown-content a.active {
  background: #EDE9FE !important;
  color: #7C3AED !important;
  border-left-color: #7C3AED !important;
}

/* Separator — make it a real divider, push footer to the bottom */
.app-topbar .menu-wrapper .dropdown-content .separator {
  margin: auto 0 12px !important;        /* margin-top:auto pushes footer down */
  border-top: 1px solid var(--card-border);
  height: 0;
  background: transparent !important;
}
:root[data-theme="light"] .app-topbar .menu-wrapper .dropdown-content .separator {
  border-top-color: #E2E8F0;
}

/* FOOTER section */
.app-topbar .menu-wrapper .dropdown-content .menu-footer {
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  gap: 0 !important;
}
.app-topbar .menu-wrapper .dropdown-content .menu-footer a,
.app-topbar .menu-wrapper .dropdown-content .menu-footer .link-button {
  color: var(--muted-color) !important;
  font-weight: 500 !important;
  font-size: 0.92rem !important;
  width: 100% !important;
  text-align: left !important;
  background: transparent !important;
  border: none !important;
}
.app-topbar .menu-wrapper .dropdown-content .menu-footer .link-button:hover,
.app-topbar .menu-wrapper .dropdown-content .menu-footer a:hover {
  background: var(--pill-active-bg) !important;
  color: var(--text-color) !important;
  text-decoration: none !important;
  opacity: 1 !important;
}
:root[data-theme="light"] .app-topbar .menu-wrapper .dropdown-content .menu-footer a,
:root[data-theme="light"] .app-topbar .menu-wrapper .dropdown-content .menu-footer .link-button {
  color: #64748B !important;
}
:root[data-theme="light"] .app-topbar .menu-wrapper .dropdown-content .menu-footer a:hover,
:root[data-theme="light"] .app-topbar .menu-wrapper .dropdown-content .menu-footer .link-button:hover {
  background: #F1F5F9 !important;
  color: #0F172A !important;
}

/* ============================================================
   DRAWER PORTAL — once enhance.js moves #menuDropdown to <body>,
   the previous selector `.app-topbar .menu-wrapper .dropdown-content`
   no longer matches. Re-apply everything via the #menuDropdown id
   so the drawer keeps its styling regardless of parent.
   ============================================================ */

/* The drawer container (now a child of <body>) */
body > #menuDropdown {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: auto !important;
  bottom: auto !important;
  width: min(80vw, 320px) !important;
  max-width: none !important;
  min-width: 0 !important;
  height: 100dvh !important;
  max-height: 100dvh !important;

  background: var(--card-bg) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  border-right: 1px solid var(--card-border) !important;
  border-radius: 0 !important;
  box-shadow: 6px 0 28px rgba(2, 4, 12, 0.35) !important;

  display: flex !important;
  flex-direction: column !important;
  padding: max(env(safe-area-inset-top, 0px), 18px) 0 max(env(safe-area-inset-bottom, 0px), 18px) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;

  z-index: 1050 !important;
  transform: translateX(-105%) !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: transform 0.22s ease-out, visibility 0s linear 0.22s !important;
}
body > #menuDropdown.show {
  transform: translateX(0) !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transition: transform 0.22s ease-out, visibility 0s linear 0s !important;
}
:root[data-theme="light"] body > #menuDropdown {
  background: #FFFFFF !important;
  border-right: 1px solid #E2E8F0 !important;
  box-shadow: 6px 0 28px rgba(15, 23, 42, 0.10) !important;
}

/* Internal sections — re-anchor on the id */
body > #menuDropdown .user-info {
  padding: 4px 22px 18px !important;
  background: transparent !important;
  border-bottom: 1px solid var(--card-border) !important;
  margin-bottom: 8px !important;
}
:root[data-theme="light"] body > #menuDropdown .user-info {
  border-bottom-color: #E2E8F0 !important;
}
body > #menuDropdown .user-info .balance { color: var(--success) !important; }
:root[data-theme="light"] body > #menuDropdown .user-info .balance { color: #16A34A !important; }

body > #menuDropdown a,
body > #menuDropdown .menu-footer a,
body > #menuDropdown .menu-footer .link-button {
  display: flex !important;
  align-items: center;
  padding: 13px 22px !important;
  font-size: 0.98rem !important;
  font-weight: 500;
  color: var(--text-color) !important;
  background: transparent !important;
  text-decoration: none;
  border-left: 3px solid transparent !important;
  border-radius: 0 !important;
  width: 100% !important;
  text-align: left !important;
  border-right: none !important;
  border-top: none !important;
  border-bottom: none !important;
  transition: background 0.15s ease, color 0.15s ease;
}
body > #menuDropdown a:hover { background: var(--pill-active-bg) !important; }
body > #menuDropdown a.active {
  background: var(--pill-active-bg) !important;
  color: var(--accent) !important;
  border-left-color: var(--accent) !important;
  font-weight: 600;
}
:root[data-theme="light"] body > #menuDropdown a { color: #0F172A !important; }
:root[data-theme="light"] body > #menuDropdown a:hover { background: #F1F5F9 !important; }
:root[data-theme="light"] body > #menuDropdown a.active {
  background: #EDE9FE !important;
  color: #7C3AED !important;
  border-left-color: #7C3AED !important;
}

body > #menuDropdown .separator {
  margin: auto 0 12px !important;
  border-top: 1px solid var(--card-border);
  height: 0 !important;
  background: transparent !important;
}
:root[data-theme="light"] body > #menuDropdown .separator { border-top-color: #E2E8F0; }

body > #menuDropdown .menu-footer {
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  gap: 0 !important;
}
body > #menuDropdown .menu-footer a,
body > #menuDropdown .menu-footer .link-button {
  color: var(--muted-color) !important;
  font-weight: 500 !important;
  font-size: 0.92rem !important;
}
body > #menuDropdown .menu-footer a:hover,
body > #menuDropdown .menu-footer .link-button:hover {
  background: var(--pill-active-bg) !important;
  color: var(--text-color) !important;
  opacity: 1 !important;
  text-decoration: none !important;
}
:root[data-theme="light"] body > #menuDropdown .menu-footer a,
:root[data-theme="light"] body > #menuDropdown .menu-footer .link-button {
  color: #64748B !important;
}
:root[data-theme="light"] body > #menuDropdown .menu-footer a:hover,
:root[data-theme="light"] body > #menuDropdown .menu-footer .link-button:hover {
  background: #F1F5F9 !important;
  color: #0F172A !important;
}

/* ============================================================
   Wallet page (/wallet.html) — clean fintech card list
   ============================================================ */

.wallet-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 22px;
}
.wallet-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.wallet-label {
  color: var(--muted-color);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.wallet-value {
  color: var(--text-color);
  font-weight: 600;
  font-size: 1rem;
}
.wallet-balance {
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  color: var(--success);
}
:root[data-theme="light"] .wallet-balance { color: #16A34A; }

.wallet-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}
.wallet-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 20px;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: var(--card-bg);
  color: var(--text-color);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.15s ease;
  box-shadow: 0 4px 14px rgba(2, 4, 12, 0.18);
}
.wallet-action:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}
.wallet-action-chev {
  color: var(--muted-color);
  font-size: 1.2rem;
  font-weight: 700;
}
.wallet-action-back {
  background: transparent;
  color: var(--muted-color);
  box-shadow: none;
  justify-content: center;
  border-style: dashed;
}
.wallet-action-back:hover {
  color: var(--text-color);
  border-color: var(--card-border);
  background: var(--card-bg);
}
:root[data-theme="light"] .wallet-action {
  background: #FFFFFF;
  border-color: #E2E8F0;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
:root[data-theme="light"] .wallet-action-back {
  background: transparent;
}

/* ============================================================
   People Search page
   ============================================================ */

.people-search-form {
  display: flex !important;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
}

.people-search-form .form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.people-search-form .form-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-color);
}
.people-search-form .form-label .req {
  color: var(--accent);
  margin-left: 2px;
}
.people-search-form input[type="text"],
.people-search-form select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--card-bg);
  color: var(--text-color);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.people-search-form input[type="text"]:focus,
.people-search-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.25);
}
:root[data-theme="light"] .people-search-form input[type="text"],
:root[data-theme="light"] .people-search-form select {
  background: #FFFFFF;
  border-color: #E2E8F0;
  color: #0F172A;
}
:root[data-theme="light"] .people-search-form input[type="text"]:focus,
:root[data-theme="light"] .people-search-form select:focus {
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
  border-color: #7C3AED;
}
.people-search-form #submit.cta-premium { margin-top: 6px; }

/* Results section */
.search-results-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-color);
  margin: 4px 0 0;
}
.results-helper {
  color: var(--muted-color);
  font-size: 0.92rem;
  text-align: center;
  padding: 12px 0 4px;
}
.results-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* Tame the existing #results > div inline-style shadow rules */
.results-list > div {
  background: var(--card-bg) !important;
  border: 1px solid var(--card-border) !important;
  border-radius: 14px !important;
  padding: 14px 18px !important;
  box-shadow: 0 4px 14px rgba(2, 4, 12, 0.18) !important;
  font-size: 0.94rem !important;
  color: var(--text-color);
  line-height: 1.5;
}
:root[data-theme="light"] .results-list > div {
  background: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06) !important;
  color: #0F172A;
}
.results-list > div b { color: var(--text-color); }
:root[data-theme="light"] .results-list > div b { color: #0F172A; }
.results-list > div p { margin: 4px 0; color: var(--muted-color); }
:root[data-theme="light"] .results-list > div p { color: #64748B; }

/* Hide the helper text once a result has rendered */
.search-results-section:has(.results-list > div) .results-helper { display: none; }

/* ============================================================
   Blackbird-inspired typography & spacing pass
   - Larger bold headings, tighter letter-spacing
   - More room to breathe between sections
   - Bigger card radii (24px), solid surfaces
   - Bigger tap targets (56px+ buttons / inputs)
   - Apple SF / Inter system stack
   - No backend / no HTML changes; pure visual pass
   ============================================================ */

:root {
  --font-app: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", system-ui, "Segoe UI", sans-serif;
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 12px;
  --gap-section: 28px;
  --pad-page: 22px;
  --pad-card: 24px;
  --h-tap: 58px;
}

/* Apply the system stack everywhere; allow body fluid weight */
html, body, input, select, textarea, button {
  font-family: var(--font-app) !important;
}
body {
  font-weight: 450 !important;
  letter-spacing: 0.005em !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* App shell: roomier page padding, larger gaps between sections */
.app-shell {
  padding: 14px var(--pad-page) 120px !important;
  gap: var(--gap-section) !important;
}

/* Topbar: keep airy, prevent accidental selection */
.app-topbar {
  padding: 14px 0 10px !important;
  user-select: none;
  -webkit-user-select: none;
}
.app-topbar h1 {
  font-weight: 700 !important;
  font-size: clamp(1.05rem, 4.2vw, 1.25rem) !important;
  letter-spacing: -0.012em !important;
}

/* Hero block — bigger, breathes more, immune to selection-flash */
.search-hero {
  padding: 26px 4px 6px !important;
  margin: 0 !important;
}
.search-hero .info-static {
  font-size: clamp(1.6rem, 6.5vw, 2rem) !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
  line-height: 1.12 !important;
  margin: 0 0 10px !important;
  color: var(--text-color) !important;
}
.search-hero .info-static-sub {
  font-size: 1.02rem !important;
  font-weight: 500 !important;
  color: var(--muted-color) !important;
  line-height: 1.4 !important;
}
.search-hero,
.app-topbar,
.mode-pills,
.panel-title,
.form-label,
.wallet-label,
.order-card-head .order-id,
.order-card-head .order-date,
.lead-card .lead-record-id,
.section-title {
  user-select: none;
  -webkit-user-select: none;
}

/* Custom selection color so accidental drag doesn't look broken */
::selection {
  background: rgba(124, 58, 237, 0.22);
  color: inherit;
}

/* Cards: bigger radius, more padding, solid surfaces (no glass blur) */
.glass-panel {
  border-radius: var(--r-lg) !important;
  padding: var(--pad-card) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
:root[data-theme="light"] .glass-panel {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.06) !important;
}

/* Mode pills container — larger radius to match cards */
.mode-pills {
  border-radius: 18px !important;
  padding: 6px !important;
}
.mode-pill {
  padding: 12px 16px !important;
  font-size: 0.98rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.005em !important;
  border-radius: 12px !important;
}

/* Filter card titles */
.control-card .panel-title {
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.10em !important;
  text-transform: uppercase !important;
  margin-bottom: 14px !important;
  color: var(--muted-color) !important;
}

/* Inputs / selects: bigger, taller, rounder */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="number"],
select,
textarea {
  border-radius: var(--r-md) !important;
  font-size: 1rem !important;
  height: var(--h-tap) !important;
  padding: 0 18px !important;
  font-weight: 500 !important;
  border: 1px solid var(--card-border) !important;
}
textarea { height: auto !important; padding: 14px 18px !important; }

/* CTA buttons: bigger, full-width, premium feel */
.cta-premium {
  height: var(--h-tap) !important;
  padding: 0 22px !important;
  border-radius: 18px !important;
  font-size: 1.02rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.005em !important;
  margin-top: 18px !important;
}

/* Wallet page: stronger hierarchy */
.wallet-summary { padding: 26px var(--pad-card) !important; }
.wallet-balance { font-size: 1.9rem !important; font-weight: 800 !important; letter-spacing: -0.015em !important; }
.wallet-label { font-size: 0.78rem !important; font-weight: 700 !important; letter-spacing: 0.10em !important; }
.wallet-action {
  height: var(--h-tap) !important;
  padding: 0 22px !important;
  border-radius: var(--r-md) !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
}

/* My Orders cards */
.order-card { border-radius: var(--r-lg) !important; padding: 22px 24px !important; }
.order-card-head .order-id { font-size: 1.1rem !important; font-weight: 700 !important; letter-spacing: -0.01em !important; }
.order-card-head .order-date { font-size: 0.82rem !important; font-weight: 500 !important; }
.order-card-body .row .label { font-size: 0.72rem !important; font-weight: 700 !important; letter-spacing: 0.10em !important; text-transform: uppercase !important; }
.order-card-body .row .value { font-weight: 600 !important; }
.order-card-foot .view-link { font-size: 0.92rem !important; font-weight: 700 !important; letter-spacing: -0.005em !important; }

/* Order details */
#leadsContainer .order-detail-topbar h2 { font-size: 1.15rem !important; font-weight: 700 !important; letter-spacing: -0.01em !important; }
.lead-card { border-radius: var(--r-lg) !important; padding: 20px 22px !important; gap: 14px !important; }
.lead-card .lead-name { font-size: 1.06rem !important; font-weight: 700 !important; letter-spacing: -0.005em !important; }
.lead-card .lead-record-id { font-size: 0.78rem !important; font-weight: 600 !important; letter-spacing: 0.06em !important; }
.lead-rows .row .label { font-size: 0.72rem !important; font-weight: 700 !important; letter-spacing: 0.10em !important; }

.unlock-all-card {
  border-radius: var(--r-lg) !important;
  padding: 22px 24px !important;
}
.unlock-all-card .title { font-size: 1.06rem !important; font-weight: 700 !important; letter-spacing: -0.005em !important; }
.unlock-all-card .sub { font-size: 0.92rem !important; }
.unlock-all-card .price { font-size: 1.08rem !important; font-weight: 800 !important; padding: 10px 16px !important; }

.cta-outline {
  height: var(--h-tap) !important;
  border-radius: var(--r-md) !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
}

/* People Search form */
.people-search-form { padding: 26px var(--pad-card) !important; gap: 18px !important; }
.people-search-form .form-label {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.10em !important;
  margin-bottom: 6px !important;
}

/* Section titles (Search Results etc.) */
.section-title {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.012em !important;
  margin: 6px 0 8px !important;
}

/* Empty/help text alignment */
.empty-state h3 { font-size: 1.2rem !important; font-weight: 700 !important; letter-spacing: -0.005em !important; }
.empty-state p { font-size: 0.96rem !important; }

/* Drawer items — keep current portal layout, just bigger taps + bolder font */
body > #menuDropdown a,
body > #menuDropdown .menu-footer a,
body > #menuDropdown .menu-footer .link-button {
  padding: 16px 24px !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
}
body > #menuDropdown .user-info { padding: 6px 24px 20px !important; }
body > #menuDropdown .user-info .name { font-size: 1.02rem !important; font-weight: 700 !important; letter-spacing: -0.005em !important; }
body > #menuDropdown .user-info .balance { font-size: 0.92rem !important; font-weight: 700 !important; }

/* ============================================================
   Typography lock — match Blackbird/Apple SF feel
   Stack uses system fonts first (no new imports).
   Weights per spec:
   - large headings: 800
   - section titles: 700
   - body: 500
   - labels: uppercase, letter-spacing 0.08em, 700
   - buttons: 700
   ============================================================ */

:root {
  --font-app: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;
}

html, body, input, select, textarea, button {
  font-family: var(--font-app) !important;
}

/* Body */
body {
  font-weight: 500 !important;
  letter-spacing: 0.005em !important;
}

/* Large headings (page hero / wallet balance / app titles) */
.search-hero .info-static,
.wallet-balance,
.empty-state h3 {
  font-weight: 800 !important;
  letter-spacing: -0.018em !important;
}

/* Section titles (Search Results, Order #, etc.) */
.section-title,
.app-topbar h1,
#leadsContainer .order-detail-topbar h2,
.order-card-head .order-id,
.lead-card .lead-name,
.unlock-all-card .title,
.order-details h3,
body > #menuDropdown .user-info .name {
  font-weight: 700 !important;
  letter-spacing: -0.012em !important;
}

/* Labels — uppercase, letter-spaced, 700 */
.panel-title,
.form-label,
.wallet-label,
.order-card-body .row .label,
.lead-rows .row .label,
.lead-card .lead-record-id,
.eyebrow,
.metric-label,
.hero-eyebrow {
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  font-weight: 700 !important;
  font-size: 0.72rem !important;
  color: var(--muted-color) !important;
}

/* Buttons — 700 weight across the board */
.cta-premium,
.cta-outline,
.wallet-action,
.mode-pill,
.tab-button,
.primary-action,
.add-button,
#showOrderBtn,
#searchPremiumBtn,
.order-card-foot .view-link {
  font-weight: 700 !important;
  letter-spacing: -0.005em !important;
}

/* Mode pills look better at 600 when active for emphasis vs 700 inactive */
.mode-pill.active { font-weight: 800 !important; }

/* Slightly tighten numerals so balances and order ids feel tabular */
.wallet-balance,
#userBalance,
.order-card-body .row .value,
.unlock-all-card .price {
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   DARK-ONLY MODE — Blackbird palette
   This block is intentionally last so it wins the cascade.
   The :root[data-theme="light"] overrides earlier in this file
   become unreachable because theme.js always sets data-theme="dark".
   ============================================================ */

:root,
:root[data-theme="dark"] {
  color-scheme: dark;

  /* Surfaces */
  --bg-color:     #000000;
  --section-bg:   #050816;
  --card-bg:      #111318;
  --card-elev:    #181A20;
  --bg-layer:     #000000;

  /* Text */
  --text-color:   #FFFFFF;
  --muted-color:  #A1A1AA;

  /* Borders & shadows */
  --card-border:  rgba(255, 255, 255, 0.10);
  --shadow:       0 18px 44px rgba(0, 0, 0, 0.55);

  /* Accents (kept purple — already in use) */
  --accent:           #8B5CF6;
  --accent-strong:    #6C63FF;
  --accent-secondary: #6C63FF;
  --pill-active-bg:   rgba(124, 58, 237, 0.22);
  --pill-active-fg:   #F8FAFC;

  /* Status */
  --danger:   #EF4444;
  --success:  #22C55E;
}

/* Body backdrop pure black, no gradient/glow */
body { background: #000000 !important; }
.app-background { display: none !important; }

/* Hide the theme toggle entirely (no HTML edit needed) */
.theme-toggle { display: none !important; }
/* Re-balance the topbar so the title centres without the toggle on the right */
.app-topbar {
  grid-template-columns: auto 1fr auto;
}
.app-topbar > .menu-wrapper { justify-self: start; }
.app-topbar > h1 { justify-self: center; }

/* Cards: solid Blackbird surfaces */
.glass-panel,
.control-card,
.info-panel,
.order-card,
.lead-card,
.wallet-summary,
.wallet-action,
.people-search-form,
.search-results-section .results-list > div,
#orderSummary .state-container,
#showerror {
  background: var(--card-bg) !important;
  border: 1px solid var(--card-border) !important;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Elevated card variant for stronger hierarchy */
.unlock-all-card,
.cta-premium {
  background: linear-gradient(120deg, #6C63FF 0%, #8B5CF6 100%) !important;
  border: 1px solid rgba(139, 92, 246, 0.55) !important;
  color: #FFFFFF !important;
  box-shadow: 0 14px 38px rgba(108, 99, 255, 0.30) !important;
}

/* Inputs / selects on pure black background */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="number"],
select,
textarea {
  background: var(--card-elev) !important;
  color: var(--text-color) !important;
  border: 1px solid var(--card-border) !important;
}
input::placeholder { color: var(--muted-color) !important; opacity: 1; }

/* Mode-pill rail */
.mode-pills {
  background: var(--card-bg) !important;
  border: 1px solid var(--card-border) !important;
}
.mode-pill { color: var(--muted-color) !important; }
.mode-pill.active {
  background: var(--pill-active-bg) !important;
  color: #FFFFFF !important;
  border-color: var(--accent) !important;
}

/* Drawer + backdrop */
body > #menuDropdown {
  background: #0B0D12 !important;
  border-right: 1px solid var(--card-border) !important;
  box-shadow: 6px 0 28px rgba(0, 0, 0, 0.55) !important;
}
.menu-backdrop.visible {
  background: rgba(0, 0, 0, 0.55) !important;
}

/* Status colours */
.user-info .balance,
.wallet-balance { color: var(--success) !important; }
.insufficient-funds,
.error-message { color: var(--danger) !important; }

/* Search hero — pure-black bg, white headline, muted subline */
.search-hero .info-static { color: #FFFFFF !important; }
.search-hero .info-static-sub { color: var(--muted-color) !important; }

/* Custom selection (less broken-looking on pure black) */
::selection {
  background: rgba(124, 58, 237, 0.35);
  color: #FFFFFF;
}

/* ============================================================
   SF Pro scale & rhythm
   Mirrors Apple HIG type scale + iOS spacing rhythm.
   ============================================================ */

:root {
  /* Apple HIG type scale (pt converted ~1:1 to px) */
  --t-large-title: 34px;   /* Large Title */
  --t-title-1:     28px;
  --t-title-2:     22px;
  --t-title-3:     20px;
  --t-headline:    17px;
  --t-body:        17px;
  --t-callout:     16px;
  --t-subhead:     15px;
  --t-footnote:    13px;
  --t-caption-1:   12px;
  --t-caption-2:   11px;

  /* Rhythm */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 56px;

  /* Override earlier ones used by the rest of the file */
  --r-lg: 24px;
  --r-md: 14px;
  --gap-section: 32px;
  --pad-page: 22px;
  --pad-card: 26px;
  --h-tap: 58px;
}

/* Base body — iOS Body */
body {
  font-size: var(--t-body) !important;
  line-height: 1.42 !important;
  font-weight: 500 !important;
  letter-spacing: -0.003em !important;
}

/* Page rhythm */
.app-shell {
  padding: var(--space-3) var(--pad-page) calc(var(--space-8) + 60px) !important;
  gap: var(--gap-section) !important;
}

/* Topbar — iOS Headline */
.app-topbar h1 {
  font-size: var(--t-headline) !important;
  font-weight: 600 !important;
  letter-spacing: -0.012em !important;
}

/* HERO — iOS Large Title, big and breathy */
.search-hero {
  padding: var(--space-6) var(--space-1) var(--space-2) !important;
  margin: 0 !important;
}
.search-hero .info-static {
  font-size: var(--t-large-title) !important;
  line-height: 1.08 !important;
  font-weight: 800 !important;
  letter-spacing: -0.024em !important;
  margin: 0 0 var(--space-3) !important;
}
.search-hero .info-static-sub {
  font-size: var(--t-subhead) !important;
  line-height: 1.4 !important;
  font-weight: 500 !important;
}

/* Section titles — Title 2 */
.section-title {
  font-size: var(--t-title-2) !important;
  font-weight: 700 !important;
  letter-spacing: -0.015em !important;
  margin: var(--space-4) 0 var(--space-2) !important;
}

/* Big numerical displays — Title 1 */
.wallet-balance,
.unlock-all-card .price {
  font-size: var(--t-title-1) !important;
  font-weight: 800 !important;
  letter-spacing: -0.018em !important;
}
.order-totals .final-total {
  font-size: var(--t-title-3) !important;
  font-weight: 700 !important;
}

/* Card / row titles — Headline */
.order-card-head .order-id,
.lead-card .lead-name,
.unlock-all-card .title,
#leadsContainer .order-detail-topbar h2,
body > #menuDropdown .user-info .name,
.order-details h3 {
  font-size: var(--t-headline) !important;
  font-weight: 700 !important;
  letter-spacing: -0.012em !important;
}

/* Helper / subline text — Subhead */
.info-static-sub,
.unlock-all-card .sub,
.results-helper,
.orders-hint,
.tabs-hint,
.empty-state p,
.hero-subtitle {
  font-size: var(--t-subhead) !important;
  font-weight: 500 !important;
  color: var(--muted-color) !important;
}

/* Labels — Caption 2 (11px) all-caps tracked */
.panel-title,
.form-label,
.wallet-label,
.order-card-body .row .label,
.lead-rows .row .label,
.lead-card .lead-record-id,
.eyebrow,
.metric-label,
.hero-eyebrow {
  font-size: var(--t-caption-2) !important;
  letter-spacing: 0.10em !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  margin-bottom: var(--space-2) !important;
}

/* Body-row values — Callout */
.order-card-body .row .value,
.lead-rows .row .value,
.wallet-value {
  font-size: var(--t-callout) !important;
  font-weight: 600 !important;
}

/* CTAs — Headline weight, 17px */
.cta-premium,
.cta-outline,
.wallet-action,
#searchPremiumBtn,
#showOrderBtn,
.primary-action,
.add-button {
  font-size: var(--t-headline) !important;
  font-weight: 700 !important;
  letter-spacing: -0.005em !important;
  height: var(--h-tap) !important;
}

/* Mode pills — Body weight, prominent */
.mode-pill {
  font-size: var(--t-callout) !important;
  font-weight: 600 !important;
  padding: 14px 16px !important;
}
.mode-pill.active { font-weight: 700 !important; }

/* Drawer items — iOS Body */
body > #menuDropdown a,
body > #menuDropdown .menu-footer a,
body > #menuDropdown .menu-footer .link-button {
  font-size: var(--t-body) !important;
  font-weight: 600 !important;
  padding: 18px 26px !important;
}

/* Cards: more breathing, less border noise */
.glass-panel,
.control-card,
.info-panel,
.order-card,
.lead-card,
.wallet-summary,
.wallet-action,
.people-search-form {
  padding: var(--pad-card) !important;
  border-radius: var(--r-lg) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
}
.mode-pills {
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
}

/* Pull inputs in line with the new rhythm */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="number"],
select,
textarea {
  font-size: var(--t-body) !important;
  height: var(--h-tap) !important;
  padding: 0 18px !important;
  border-radius: var(--r-md) !important;
}
textarea { height: auto !important; padding: 14px 18px !important; }

/* Tighten the form filter stack spacing */
.filter-stack { gap: var(--space-4) !important; }
.people-search-form { gap: var(--space-5) !important; }

/* Order summary panel — more rhythm */
#orderSummary { padding: var(--space-6) var(--pad-page) calc(var(--space-8) + 60px) !important; }
#orderSummary h2 {
  font-size: var(--t-title-2) !important;
  font-weight: 700 !important;
  letter-spacing: -0.015em !important;
  margin-bottom: var(--space-4) !important;
}
#orderSummary .state-container { padding: var(--space-4) var(--space-5) !important; }
.order-totals { line-height: 1.7 !important; }

/* Wallet summary breathes */
.wallet-summary { padding: var(--space-6) var(--pad-card) !important; gap: var(--space-3) !important; }
.wallet-actions { gap: var(--space-3) !important; }

/* My Orders list rhythm */
.orders-list { gap: var(--space-3) !important; }
.order-card { padding: var(--space-5) var(--pad-card) !important; }
.order-card-body { gap: var(--space-2) !important; margin-bottom: var(--space-3) !important; }
.order-card-foot { padding-top: var(--space-3) !important; }

/* Search results rhythm */
.search-results-section { gap: var(--space-4) !important; }
.results-list { gap: var(--space-4) !important; }

/* Tabular numerals stay */
.wallet-balance,
#userBalance,
.order-card-body .row .value,
.unlock-all-card .price,
.order-totals .final-total {
  font-variant-numeric: tabular-nums;
}

/* Remove visual clutter: drop heavy shadows on flat dark surfaces */
.glass-panel,
.control-card,
.info-panel,
.order-card,
.lead-card,
.wallet-summary,
.wallet-action,
.people-search-form {
  box-shadow: none !important;
}

/* Keep the hero CTA's gradient + glow as the one accent moment */
.cta-premium,
.unlock-all-card {
  box-shadow: 0 14px 38px rgba(108, 99, 255, 0.30) !important;
}

/* ============================================================
   LAYOUT NORMALIZATION — final, cascade-winning.
   Fixes:
   1. Empty .states-panel / #showerror cards hidden when no content
   2. All cards aligned to same edges with consistent 24px gap
   3. Single max-width 430px mobile container
   4. Topbar truly centres title in viewport (grid: 1fr auto 1fr)
   5. Hamburger sized consistently with header height
   6. One unified card style (radius 28px, padding 24px, .08 border)
   ============================================================ */

/* === Page container — true mobile width === */
.app-shell {
  width: 100% !important;
  max-width: 430px !important;
  margin: 0 auto !important;
  padding: 0 20px 40px !important;
  gap: 24px !important;       /* unified section gap */
  box-sizing: border-box !important;
}
.app-shell * { box-sizing: border-box; }

/* === Topbar — true centre alignment === */
.app-topbar {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 16px 0 !important;
  min-height: 76px !important;
  margin: 0 !important;
  background: transparent !important;
}
.app-topbar > .menu-wrapper {
  grid-column: 1;
  justify-self: start;
}
.app-topbar > h1 {
  grid-column: 2;
  justify-self: center;
  text-align: center !important;
  margin: 0 !important;
  white-space: nowrap;
}
.app-topbar .theme-toggle { display: none !important; }
/* Remove the sticky behaviour we tried earlier — keep it in normal flow */
.app-topbar { position: static !important; }
.app-topbar::after { display: none !important; }

/* Hamburger button sized to header */
.app-topbar .menu-wrapper > .dropdown-btn {
  width: 48px !important;
  height: 48px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--card-bg) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
}

/* === Hero block sits flush under topbar === */
.search-hero {
  padding: 8px 0 0 !important;
  margin: 0 !important;
  text-align: left;
}
.search-hero .info-static  { margin: 0 0 8px !important; }
.search-hero .info-static-sub { margin: 0 !important; }

/* === Mode-pills flush full width === */
.mode-pills {
  margin: 0 !important;
  padding: 6px !important;
  border-radius: 18px !important;
}

/* === Filter stack: same 24px gap as page === */
.filter-stack {
  display: flex !important;
  flex-direction: column !important;
  gap: 24px !important;
  margin: 0 !important;
}
/* control-grid sits as a flex column inside filter-stack, no grid */
.filter-stack .control-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 24px !important;
  margin: 0 !important;
}

/* === Unified card style — apply to ALL cards on Search Leads === */
.app-shell .glass-panel,
.app-shell .control-card,
.app-shell .info-panel,
.app-shell .order-card,
.app-shell .lead-card,
.app-shell .wallet-summary,
.app-shell .wallet-action,
.app-shell .people-search-form {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 24px !important;
  border-radius: 28px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: var(--card-bg) !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

/* CTA card breathes a touch more vertically; button stays inside */
.app-shell .info-panel {
  padding: 28px 24px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
}
.app-shell .info-panel > div { margin: 0 0 4px; }
.app-shell .info-panel #info:empty { display: none !important; }
.app-shell .info-panel .cta-premium {
  width: 100% !important;
  height: 60px !important;
  border-radius: 18px !important;
  margin-top: 14px !important;
}

/* Inputs / selects unified */
.app-shell input[type="text"],
.app-shell input[type="search"],
.app-shell input[type="email"],
.app-shell input[type="number"],
.app-shell select,
.app-shell textarea {
  width: 100% !important;
  height: 60px !important;
  border-radius: 16px !important;
  padding: 0 18px !important;
  box-sizing: border-box !important;
  background: var(--card-elev) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
}
.app-shell textarea { height: auto !important; padding: 16px 18px !important; }

/* === Hide accidental empty cards === */
/* Results "states-panel" — only show once #content has children */
.states-panel:has(> #content:empty) { display: none !important; }
.app-shell #showerror:has(.error-message:empty) {
  display: none !important;
}
/* Fallback for browsers w/o :has() — minimal no-content treatment */
@supports not selector(:has(*)) {
  .app-shell #content:empty { display: none; }
  .app-shell .states-panel  { background: transparent !important; border: none !important; padding: 0 !important; }
  .app-shell #showerror .error-message:empty + ::before { content: none; }
}

/* main element shouldn't add extra padding */
.app-shell main.app-main {
  display: flex !important;
  flex-direction: column !important;
  gap: 24px !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

/* ============================================================
   COMPACT DENSITY PASS — MyFitnessPal-style tightness
   - Smaller card pad / radius
   - Shorter inputs (52px) and pills (~46px)
   - Section gap drops to 18px
   - Strip the CTA's wrapping card so the button stands alone
   - Compact, lighter, native-mobile feel
   ============================================================ */

:root {
  --pad-card-c:  18px;   /* compact card padding */
  --r-card-c:    20px;   /* compact card radius */
  --r-input-c:   14px;   /* compact input radius */
  --gap-page-c:  18px;   /* compact section gap */
  --h-input-c:   52px;   /* compact input height */
  --h-cta-c:     56px;   /* compact CTA height */
}

/* Page rhythm — tighter */
.app-shell {
  gap: var(--gap-page-c) !important;
  padding: 0 20px 32px !important;
}
.app-shell main.app-main { gap: var(--gap-page-c) !important; }

/* Topbar a touch shorter */
.app-topbar {
  padding: 12px 0 !important;
  min-height: 64px !important;
}
.app-topbar .menu-wrapper > .dropdown-btn {
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
}

/* Hero — tighten the gap to the form */
.search-hero { padding: 4px 0 0 !important; }
.search-hero .info-static {
  font-size: 28px !important;
  line-height: 1.1 !important;
  margin: 0 0 6px !important;
}
.search-hero .info-static-sub {
  font-size: 14px !important;
  line-height: 1.4 !important;
}

/* Segmented control — tighter & lower-profile */
.mode-pills {
  padding: 4px !important;
  border-radius: 14px !important;
  background: var(--card-bg) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
}
.mode-pill {
  padding: 10px 14px !important;
  font-size: 14px !important;
  border-radius: 10px !important;
  height: 40px !important;
}
.mode-pill.active {
  background: var(--pill-active-bg) !important;
  border-color: var(--accent) !important;
}

/* All filter cards become compact */
.app-shell .glass-panel,
.app-shell .control-card,
.app-shell .people-search-form,
.app-shell .wallet-summary {
  padding: var(--pad-card-c) !important;
  border-radius: var(--r-card-c) !important;
}
.filter-stack,
.filter-stack .control-grid {
  gap: 12px !important;
}

/* Tiny label sitting above input with minimal margin */
.control-card .panel-title {
  font-size: 10.5px !important;
  letter-spacing: 0.12em !important;
  margin-bottom: 8px !important;
}

/* Compact inputs — MFP search-bar style */
.app-shell input[type="text"],
.app-shell input[type="search"],
.app-shell input[type="email"],
.app-shell input[type="number"],
.app-shell select {
  height: var(--h-input-c) !important;
  font-size: 15px !important;
  padding: 0 16px !important;
  border-radius: var(--r-input-c) !important;
  background: #151821 !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  color: #FFFFFF !important;
}
.app-shell input::placeholder { color: #8B93A7 !important; opacity: 1; }
.app-shell input:focus,
.app-shell select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 1px rgba(139,92,246,0.35) !important; /* subtle, no giant glow */
  outline: none;
}

/* CTA — strip the wrapping card; button stands on its own */
.app-shell .info-panel {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
}
.app-shell .info-panel > div { margin: 0 !important; }
.app-shell .info-panel #info:empty { display: none !important; }
.app-shell .info-panel #info { font-size: 14px !important; color: var(--muted-color) !important; margin: 0 0 12px !important; }
.app-shell .info-panel .cta-premium {
  height: var(--h-cta-c) !important;
  font-size: 16px !important;
  border-radius: 16px !important;
  margin: 0 !important;
}

/* People-search form compact */
.app-shell .people-search-form { padding: 18px !important; gap: 14px !important; }
.app-shell .people-search-form .form-label {
  font-size: 10.5px !important;
  letter-spacing: 0.12em !important;
  margin-bottom: 6px !important;
}
.app-shell .people-search-form #submit.cta-premium {
  height: var(--h-cta-c) !important;
  font-size: 16px !important;
  border-radius: 16px !important;
  margin-top: 6px !important;
}

/* Wallet page — compact */
.app-shell .wallet-summary { padding: 20px !important; gap: 10px !important; }
.app-shell .wallet-balance { font-size: 24px !important; }
.app-shell .wallet-action {
  padding: 0 18px !important;
  height: var(--h-cta-c) !important;
  border-radius: var(--r-input-c) !important;
  font-size: 15px !important;
}

/* My Orders cards — compact */
.app-shell .order-card {
  padding: 16px 18px !important;
  border-radius: var(--r-card-c) !important;
}
.app-shell .order-card-head .order-id { font-size: 15px !important; }
.app-shell .order-card-head .order-date { font-size: 12px !important; }
.app-shell .order-card-body .row .label { font-size: 10.5px !important; }
.app-shell .order-card-body .row .value { font-size: 14px !important; }
.app-shell .order-card-foot .view-link { font-size: 13px !important; }

/* Title sizes a bit more restrained */
.section-title { font-size: 18px !important; margin: 4px 0 2px !important; }

/* ============================================================
   RESULTS VISIBILITY FIX
   Two bugs from the previous rounds:
   1. CTA was rendered above the results in DOM, so state cards
      appeared below the CTA — easily missed off-screen.
   2. `.states-panel:has(> #content:empty) { display: none }` was
      hiding the wrap, and iOS Safari sometimes doesn't invalidate
      :has(:empty) on innerHTML mutations, leaving the panel hidden
      even after JS adds state cards.

   Fix (pure CSS, no HTML/JS changes):
   - Flatten .info-panel via display: contents so its children
     become direct siblings of .states-panel inside .app-main's flex
     column.
   - Use CSS `order` to place: total text (1), state cards (2), CTA (3).
   - Strip .states-panel chrome; its inner .state-container cards
     already have their own surface styling.
   - Drop the :has(:empty) hide; rely on the natural empty state
     (no visible chrome) instead.
   ============================================================ */

/* Make info-panel transparent in the layout tree so its children
   flow alongside .states-panel. */
.app-shell .info-panel {
  display: contents !important;
}

/* Re-order siblings within .app-main */
.app-shell .info-panel > div    { order: 1 !important; }   /* "Total X leads available" text */
.app-shell .states-panel        { order: 2 !important; }   /* state result cards */
.app-shell #showOrderBtn        { order: 3 !important; }   /* (hidden by default) */
.app-shell #searchPremiumBtn,
.app-shell .info-panel > .cta-premium {
  order: 4 !important;                                     /* CTA last */
}
.app-shell #showerror           { order: 5 !important; }   /* errors last */

/* States panel: no wrapping chrome — let cards inside speak for themselves */
.app-shell .states-panel {
  display: block !important;                /* override the :has(:empty) hide */
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
/* Override the previous :has(:empty) hide rule explicitly */
.app-shell .states-panel:has(> #content:empty) {
  display: block !important;
}
/* When #content has no children, the wrap is invisible (no chrome anyway). */
.app-shell #content {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}

/* The CTA gets a touch of top spacing now that it sits below results */
.app-shell #searchPremiumBtn,
.app-shell .info-panel > .cta-premium {
  margin-top: 8px !important;
}

/* "Total X leads available" line — make it a clear small caption above the result list */
.app-shell .info-panel > div > #info {
  font-size: 13px !important;
  color: var(--muted-color) !important;
  margin: 0 0 4px !important;
}

/* ============================================================
   STATE / RESULT CARD — compact mobile layout
   - Strip oversized padding / min-height / inline margins
   - 64x64 flag thumbnail
   - Cleaner row hierarchy
   - Bigger, easier-to-tap quantity stepper
   ============================================================ */

.app-shell .state-container {
  background: var(--card-bg) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 22px !important;
  padding: 16px 18px !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  position: relative;
}
.app-shell .state-container.selected {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 1px var(--accent), 0 6px 18px rgba(108,99,255,0.20) !important;
}

/* Header row: title + selected badge */
.app-shell .state-container h2 {
  font-size: 16px !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em !important;
  margin: 0 !important;
  padding-right: 88px;     /* leave room for the absolute SELECTED pill */
}

/* Override the inline-style flex wrapper inside (margin:10px; gap:20px) */
.app-shell .state-container > div[style] {
  display: flex !important;
  align-items: center !important;
  margin: 0 !important;
  gap: 12px !important;
}

/* Flag thumbnail compact */
.app-shell .state-flag img {
  width: 64px !important;
  height: 64px !important;
  border-radius: 12px !important;
  object-fit: contain !important;
  background: #FFFFFF !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
}

/* Info column */
.app-shell .state-info {
  flex: 1 !important;
  min-width: 0;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}
.app-shell .state-info p {
  font-size: 13px !important;
  margin: 0 !important;
  color: var(--muted-color) !important;
}

/* Quantity + Add row */
.app-shell .lead-input-container {
  display: flex !important;
  gap: 8px !important;
  align-items: center !important;
  margin-top: 4px !important;
}
.app-shell .lead-input-container input[type="number"] {
  width: 72px !important;
  min-width: 72px !important;
  height: 44px !important;
  padding: 0 8px 0 12px !important;
  border-radius: 12px !important;
  background: var(--card-elev) !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  color: #FFFFFF !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  text-align: center !important;
  -moz-appearance: textfield;
}
/* Keep the native step arrows on WebKit but enlarge by zoom-style scaling */
.app-shell .lead-input-container input[type="number"]::-webkit-inner-spin-button,
.app-shell .lead-input-container input[type="number"]::-webkit-outer-spin-button {
  opacity: 1 !important;
  height: 44px !important;
  margin-left: 4px !important;
  cursor: pointer;
}

.app-shell .add-button {
  flex: 1 !important;
  height: 44px !important;
  border-radius: 12px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  padding: 0 16px !important;
  background: linear-gradient(120deg, var(--accent-strong), var(--accent)) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(139,92,246,0.4) !important;
}
.app-shell .add-button.added {
  background: linear-gradient(120deg, var(--accent-strong), var(--accent)) !important;
}

/* SELECTED pill — smaller, anchored top-right */
.app-shell .state-container.selected::before {
  content: "Selected" !important;
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
  background: var(--pill-active-bg) !important;
  color: #FFFFFF !important;
  border: 1px solid var(--accent) !important;
  border-radius: 999px !important;
  padding: 3px 10px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.10em !important;
  text-transform: uppercase !important;
}

/* Subtotal line — compact, full-width below */
.app-shell .state-subtotal {
  font-size: 13px !important;
  font-weight: 600 !important;
  margin: 6px 0 0 !important;
  color: var(--accent) !important;
}

/* ============================================================
   ROUNDED-SHEET PASS — iOS bottom-sheet feel
   - Body backdrop slightly different from app-shell so the sheet's
     rounded top corners are actually visible
   - App-shell becomes a rounded "sheet" surface
   - All inputs / search become pill shapes
   - Segmented tabs become pills
   - CTA becomes pill
   - Result cards get bigger radii + tighter padding
   ============================================================ */

/* Body backdrop — slightly dark navy so the black sheet stands out */
body {
  background: #0B0E18 !important;
}

/* The sheet itself */
.app-shell {
  background: #000000 !important;
  border-radius: 32px 32px 0 0 !important;
  padding: 18px 22px 40px !important;
  max-width: 430px !important;
  margin: 0 auto !important;
  position: relative;
  min-height: 100dvh;
  /* iOS-like grab handle hint above the sheet */
  overflow: visible !important;
}
.app-shell::before {
  content: "";
  position: absolute;
  top: 8px; left: 50%;
  transform: translateX(-50%);
  width: 44px; height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  pointer-events: none;
}

/* Topbar — slight extra top padding to clear the grab handle */
.app-topbar {
  padding: 18px 0 8px !important;
  min-height: 62px !important;
}
.app-topbar .menu-wrapper > .dropdown-btn {
  background: #1A1D22 !important;
  border-radius: 14px !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
}

/* Search/text/select inputs — PILL shape */
.app-shell input[type="text"],
.app-shell input[type="search"],
.app-shell input[type="email"],
.app-shell input[type="number"],
.app-shell select {
  height: 56px !important;
  border-radius: 999px !important;
  background: #1A1D22 !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  padding: 0 22px !important;
  color: #FFFFFF !important;
  font-size: 15px !important;
}
.app-shell select { padding-right: 40px !important; }
.app-shell input::placeholder { color: #8B8F9A !important; opacity: 1; }
.app-shell input:focus,
.app-shell select:focus {
  border-color: rgba(139,92,246,0.7) !important;
  box-shadow: none !important;
  outline: none;
}

/* Cards — bigger radii, slightly tighter */
.app-shell .glass-panel,
.app-shell .control-card,
.app-shell .people-search-form,
.app-shell .wallet-summary {
  background: #111318 !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 28px !important;
  padding: 20px !important;
}

/* Segmented tabs — pill rail with pill active state */
.app-shell .mode-pills {
  height: 56px !important;
  border-radius: 999px !important;
  padding: 5px !important;
  background: #111318 !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  display: flex !important;
  align-items: stretch !important;
}
.app-shell .mode-pill {
  height: auto !important;
  border-radius: 999px !important;
  font-size: 14px !important;
  padding: 0 18px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  color: var(--muted-color) !important;
  border: 1px solid transparent !important;
}
.app-shell .mode-pill.active {
  background: #2B1E4A !important;
  color: #FFFFFF !important;
  border-color: #8B5CF6 !important;
}

/* CTA button — pure pill */
.app-shell .cta-premium,
.app-shell #searchPremiumBtn,
.app-shell .people-search-form #submit.cta-premium {
  height: 60px !important;
  border-radius: 999px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  padding: 0 28px !important;
  background: linear-gradient(120deg, #6C63FF 0%, #8B5CF6 100%) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(139,92,246,0.4) !important;
  box-shadow: 0 14px 38px rgba(108, 99, 255, 0.30) !important;
}

/* Wallet action rows — pill */
.app-shell .wallet-action {
  height: 60px !important;
  border-radius: 999px !important;
  padding: 0 22px !important;
}

/* Result (state) cards — compact + bigger radii */
.app-shell .state-container {
  border-radius: 28px !important;
  padding: 16px 18px !important;
}
.app-shell .state-flag img {
  width: 56px !important;
  height: 56px !important;
  border-radius: 14px !important;
}
.app-shell .lead-input-container input[type="number"] {
  width: 70px !important;
  min-width: 70px !important;
  height: 44px !important;
  border-radius: 999px !important;
  padding: 0 12px !important;
  font-size: 14px !important;
}
.app-shell .add-button {
  height: 44px !important;
  border-radius: 999px !important;
  padding: 0 18px !important;
  font-size: 14px !important;
}
.app-shell .state-container.selected::before {
  border-radius: 999px !important;
  padding: 4px 12px !important;
  font-size: 10px !important;
}

/* Order cards (My Orders) — bigger radii */
.app-shell .order-card { border-radius: 28px !important; padding: 18px 20px !important; }

/* Drawer rounded right edge (subtle iOS feel) */
body > #menuDropdown {
  border-radius: 0 28px 28px 0 !important;
}

/* Subtotal text + helper */
.app-shell .state-subtotal {
  border-radius: 999px;
  background: rgba(139,92,246,0.12);
  padding: 4px 12px;
  align-self: flex-start;
}

/* ============================================================
   COMPACT MOBILE LOCK — final
   Diagnosed root cause: .state-container { min-height: 200px } at
   L514 was never overridden. Plus several elements bigger than the
   user's spec. This block aligns all values to the spec exactly.
   ============================================================ */

/* Page container: 414 max-width, 18 px sides, 16 px gap */
.app-shell {
  max-width: 414px !important;
  padding: 14px 18px 32px !important;
  gap: 16px !important;
}
.app-shell main.app-main { gap: 16px !important; }

/* Hero: 34 px / 1.05, 16 px below */
.app-shell .search-hero {
  padding: 4px 0 0 !important;
  margin: 0 0 0 !important;
}
.app-shell .search-hero .info-static {
  font-size: 34px !important;
  line-height: 1.05 !important;
  margin: 0 0 16px !important;
  letter-spacing: -0.02em !important;
  font-weight: 800 !important;
}
.app-shell .search-hero .info-static-sub {
  font-size: 15px !important;
  line-height: 1.4 !important;
}

/* Cards: 18 px padding, 24 px radius, no min-height */
.app-shell .glass-panel,
.app-shell .control-card,
.app-shell .people-search-form,
.app-shell .wallet-summary,
.app-shell .order-card {
  padding: 18px !important;
  border-radius: 24px !important;
  min-height: 0 !important;
}

/* Inputs: 52 px, font 18 px, pill */
.app-shell input[type="text"],
.app-shell input[type="search"],
.app-shell input[type="email"],
.app-shell input[type="number"],
.app-shell select {
  height: 52px !important;
  font-size: 18px !important;
  padding: 0 20px !important;
  border-radius: 999px !important;
}

/* Tabs: 52 px pill rail */
.app-shell .mode-pills {
  height: 52px !important;
  border-radius: 999px !important;
  padding: 4px !important;
}
.app-shell .mode-pill {
  font-size: 14px !important;
  padding: 0 16px !important;
}

/* CTA: 56 px pill */
.app-shell .cta-premium,
.app-shell #searchPremiumBtn,
.app-shell .people-search-form #submit.cta-premium {
  height: 56px !important;
  font-size: 16px !important;
  padding: 0 24px !important;
}

/* Wallet rows: 56 px pill */
.app-shell .wallet-action {
  height: 56px !important;
  padding: 0 20px !important;
}

/* RESULT CARDS — the actual fix */
.app-shell .state-container {
  min-height: 0 !important;      /* kills the 200px floor */
  padding: 16px !important;
  border-radius: 24px !important;
  gap: 8px !important;
}
.app-shell .state-flag img {
  width: 56px !important;
  height: 56px !important;
  border-radius: 12px !important;
}
.app-shell .state-info p {
  font-size: 13px !important;
  margin: 0 !important;
}
.app-shell .state-container h2 {
  font-size: 15px !important;
  margin: 0 !important;
}
.app-shell .lead-input-container input[type="number"] {
  width: 64px !important;
  min-width: 64px !important;
  height: 40px !important;
  font-size: 14px !important;
}
.app-shell .add-button {
  height: 40px !important;
  font-size: 13px !important;
  padding: 0 16px !important;
}

/* Hamburger button: keep compact */
.app-shell .app-topbar .menu-wrapper > .dropdown-btn {
  width: 42px !important;
  height: 42px !important;
}
.app-shell .app-topbar {
  padding: 14px 0 6px !important;
  min-height: 56px !important;
}

/* ============================================================
   FINAL TIGHTENING — match user spec exactly
   - Hide #searchPremiumBtn (duplicate CTA)
   - #showOrderBtn becomes the single pill CTA, auto-shown by addButton()
   - Tighter page padding / card padding
   - Result card title bumped to 20px, body 15px (was 15/13)
   - Add button bumped to 44px
   ============================================================ */

/* 1) Remove the duplicate CTA entirely */
.app-shell #searchPremiumBtn { display: none !important; }

/* 2) Page padding 16 all sides */
.app-shell {
  padding: 14px 16px 32px !important;
  gap: 14px !important;
}
.app-shell main.app-main { gap: 14px !important; }

/* 3) Cards 16 padding, 22 radius */
.app-shell .glass-panel,
.app-shell .control-card,
.app-shell .people-search-form,
.app-shell .wallet-summary,
.app-shell .order-card {
  padding: 16px !important;
  border-radius: 22px !important;
}

/* 4) Inputs 50 / 17 */
.app-shell input[type="text"],
.app-shell input[type="search"],
.app-shell input[type="email"],
.app-shell input[type="number"],
.app-shell select {
  height: 50px !important;
  font-size: 17px !important;
  padding: 0 18px !important;
}

/* 5) Tabs 50 */
.app-shell .mode-pills { height: 50px !important; }

/* 6) Result cards — title 20, body 15, image 52, qty 42, Add 44 */
.app-shell .state-container {
  padding: 14px !important;
  border-radius: 22px !important;
  gap: 10px !important;
  min-height: 0 !important;
}
.app-shell .state-container h2 {
  font-size: 20px !important;
  font-weight: 700 !important;
  letter-spacing: -0.012em !important;
  margin: 0 !important;
}
.app-shell .state-info p {
  font-size: 15px !important;
  margin: 0 !important;
}
.app-shell .state-flag img {
  width: 52px !important;
  height: 52px !important;
  border-radius: 12px !important;
}
.app-shell .lead-input-container input[type="number"] {
  width: 64px !important;
  min-width: 64px !important;
  height: 42px !important;
  font-size: 14px !important;
  border-radius: 999px !important;
}
.app-shell .add-button {
  height: 44px !important;
  font-size: 14px !important;
  padding: 0 18px !important;
  border-radius: 999px !important;
}
.app-shell .state-container.selected::before {
  padding: 3px 9px !important;
  font-size: 9.5px !important;
  border-radius: 999px !important;
}

/* 7) Show Order Summary — the now-only CTA, pill, 54 px */
.app-shell #showOrderBtn,
.app-shell .primary-action {
  height: 54px !important;
  border-radius: 999px !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  padding: 0 24px !important;
  width: 100% !important;
  background: linear-gradient(120deg, #6C63FF 0%, #8B5CF6 100%) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(139,92,246,0.4) !important;
  box-shadow: 0 14px 38px rgba(108, 99, 255, 0.30) !important;
  margin-top: 4px !important;
}

/* 8) Hero a touch tighter */
.app-shell .search-hero { padding: 2px 0 0 !important; }
.app-shell .search-hero .info-static { margin: 0 0 12px !important; }

/* ============================================================
   COMPACT ADD BUTTON + LIST-ITEM RESULT CARD
   - Add button no longer flex:1 (stretching), now compact inline pill
   - Inline cart SVG icon via ::before (no JS, no external asset)
   - Tighter card padding + thumbnail
   - Title sits next to the body, not on its own oversized row
   - One clear surface; remove nested borders / shadows
   ============================================================ */

/* Card itself — slightly tighter, one clear surface */
.app-shell .state-container {
  padding: 12px !important;
  border-radius: 20px !important;
  gap: 8px !important;
  background: var(--card-bg) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  box-shadow: none !important;
}
.app-shell .state-container.selected {
  border-color: rgba(139, 92, 246, 0.5) !important;
  box-shadow: 0 0 0 1px rgba(139,92,246,0.35) !important;
}

/* Title compact, no oversized row */
.app-shell .state-container h2 {
  font-size: 16px !important;
  font-weight: 700 !important;
  letter-spacing: -0.012em !important;
  margin: 0 !important;
  padding-right: 80px;   /* room for selected pill */
}

/* Inner flex row inherits inline style; flatten it */
.app-shell .state-container > div[style] {
  display: flex !important;
  align-items: center !important;
  margin: 0 !important;
  gap: 10px !important;
}

/* Smaller thumbnail */
.app-shell .state-flag img {
  width: 48px !important;
  height: 48px !important;
  border-radius: 10px !important;
}

/* Info column */
.app-shell .state-info {
  flex: 1 !important;
  min-width: 0;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}
.app-shell .state-info p {
  font-size: 13px !important;
  margin: 0 !important;
  color: var(--muted-color) !important;
  line-height: 1.3 !important;
}

/* Quantity + Add row — sits below rate/available, compact, RIGHT-aligned */
.app-shell .lead-input-container {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-top: 6px !important;
  justify-content: flex-end !important;
  align-self: flex-end !important;
}

/* Quantity input: compact pill */
.app-shell .lead-input-container input[type="number"] {
  width: 76px !important;
  min-width: 76px !important;
  height: 40px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  border-radius: 999px !important;
  padding: 0 12px !important;
  background: var(--card-elev) !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  color: #FFFFFF !important;
  text-align: center !important;
}

/* Add button: COMPACT inline pill with cart icon — no flex stretching */
.app-shell .add-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  flex: 0 0 auto !important;        /* stop stretching */
  width: auto !important;
  height: 40px !important;
  padding: 0 16px !important;
  border-radius: 999px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  background: linear-gradient(135deg, #6D5EF7 0%, #8B5CF6 100%) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(139,92,246,0.45) !important;
  box-shadow: none !important;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.app-shell .add-button:hover { filter: brightness(1.05); transform: translateY(-1px); }
.app-shell .add-button:active { transform: translateY(0); filter: brightness(0.95); }

/* Cart icon via ::before — inline SVG data URI, no external asset */
.app-shell .add-button::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M3 4h2l2.4 11.4a2 2 0 0 0 2 1.6h8.2a2 2 0 0 0 2-1.5L21.5 8H7'/><circle cx='10' cy='20' r='1.5' fill='black'/><circle cx='17' cy='20' r='1.5' fill='black'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M3 4h2l2.4 11.4a2 2 0 0 0 2 1.6h8.2a2 2 0 0 0 2-1.5L21.5 8H7'/><circle cx='10' cy='20' r='1.5' fill='black'/><circle cx='17' cy='20' r='1.5' fill='black'/></svg>") center/contain no-repeat;
}

/* Added state: same compact size, swap icon to a checkmark */
.app-shell .add-button.added::before {
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M4 12l5 5L20 6'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M4 12l5 5L20 6'/></svg>") center/contain no-repeat;
}

/* Smaller selected pill so it doesn't bulk up the card */
.app-shell .state-container.selected::before {
  content: "Added" !important;
  top: 10px !important;
  right: 10px !important;
  padding: 2px 8px !important;
  font-size: 9.5px !important;
  letter-spacing: 0.08em !important;
  border-radius: 999px !important;
  background: rgba(139, 92, 246, 0.18) !important;
  border: 1px solid rgba(139, 92, 246, 0.55) !important;
  color: #C4B5FD !important;
}

/* Subtotal line tightly under the qty+Add row */
.app-shell .state-subtotal {
  font-size: 12px !important;
  font-weight: 600 !important;
  margin: 6px 0 0 !important;
  align-self: flex-end !important;
  background: rgba(139, 92, 246, 0.12) !important;
  color: #C4B5FD !important;
  border-radius: 999px !important;
  padding: 3px 10px !important;
}

/* ============================================================
   RESULT CARD CLEANUP — one clean card, no nesting
   - Final-strip .states-panel chrome (kills the outer wrap that
     was sneaking back via .glass-panel rules)
   - Remove the cart/check ::before icon (button now uses plain
     text labels from JS: "Add" / "Added ✓")
   - Remove the duplicate "ADDED" selected pill — button text is enough
   - Restore title 20px / 700, meta 15px / muted
   - Keep compact pill stepper + Add button
   ============================================================ */

/* 1) Definitively strip the outer wrap */
.app-shell .states-panel,
.app-shell .states-panel.glass-panel {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* 2) Result card — single clear surface */
.app-shell .state-container {
  background: #111318 !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 22px !important;
  padding: 16px !important;
  gap: 10px !important;
  min-height: 0 !important;
  box-shadow: none !important;
  position: relative;
}
.app-shell .state-container.selected {
  border-color: rgba(139, 92, 246, 0.55) !important;
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.30) !important;
}

/* 3) Title + meta sizing */
.app-shell .state-container h2 {
  font-size: 20px !important;
  font-weight: 700 !important;
  letter-spacing: -0.012em !important;
  margin: 0 !important;
  padding-right: 0 !important;   /* no badge to reserve space for */
}
.app-shell .state-info p {
  font-size: 15px !important;
  margin: 0 !important;
  color: #A1A1AA !important;
  line-height: 1.35 !important;
}

/* 4) Flatten the inline-style inner flex row */
.app-shell .state-container > div[style] {
  display: flex !important;
  align-items: center !important;
  margin: 0 !important;
  gap: 12px !important;
}

/* 5) Thumbnail 48x48, radius 14 */
.app-shell .state-flag img {
  width: 48px !important;
  height: 48px !important;
  border-radius: 14px !important;
  object-fit: contain !important;
  background: #FFFFFF !important;
}

/* 6) Quantity + Add pinned right */
.app-shell .lead-input-container {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-top: 6px !important;
  align-self: flex-end !important;
  justify-content: flex-end !important;
}
.app-shell .lead-input-container input[type="number"] {
  width: 72px !important;
  min-width: 72px !important;
  height: 40px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  border-radius: 999px !important;
  padding: 0 12px !important;
  background: #1A1D22 !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  color: #FFFFFF !important;
  text-align: center !important;
}

/* 7) Add button: compact pill, PLAIN TEXT (no icon) */
.app-shell .add-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  width: auto !important;
  height: 42px !important;
  padding: 0 18px !important;
  border-radius: 999px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  gap: 0 !important;
  background: linear-gradient(135deg, #6D5EF7 0%, #8B5CF6 100%) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(139,92,246,0.45) !important;
  box-shadow: none !important;
}
/* Remove the icon ::before from the previous round (revert to text-only) */
.app-shell .add-button::before,
.app-shell .add-button.added::before {
  content: none !important;
  display: none !important;
  -webkit-mask: none !important;
          mask: none !important;
}

/* 8) Hide the duplicate SELECTED badge — button text is enough */
.app-shell .state-container.selected::before {
  content: none !important;
  display: none !important;
}

/* 9) Subtotal pill — small, only visible when selected */
.app-shell .state-subtotal {
  font-size: 13px !important;
  font-weight: 600 !important;
  margin: 6px 0 0 !important;
  align-self: flex-end !important;
  background: rgba(139, 92, 246, 0.14) !important;
  color: #C4B5FD !important;
  border: 1px solid rgba(139, 92, 246, 0.30) !important;
  border-radius: 999px !important;
  padding: 4px 12px !important;
}

/* ============================================================
   BANK SEARCH BAR — compact mobile-search pattern
   - Inline SVG search icon on the left via ::before
   - Pill input, 50px height (left padding for icon)
   - Tighter Bank card (12-14px padding)
   - Smaller "BANK" panel-title
   - No inner Search button (would conflict with autocomplete)
   - Dropdown alignment unchanged (matches the pill width)
   ============================================================ */

/* Tighten the Bank card specifically (target by descendant input id) */
.app-shell .control-card:has(#bankSearch) {
  padding: 14px !important;
  border-radius: 22px !important;
}
.app-shell .control-card:has(#bankSearch) > .panel-title {
  font-size: 10.5px !important;
  letter-spacing: 0.12em !important;
  margin-bottom: 8px !important;
  font-weight: 700 !important;
  color: var(--muted-color) !important;
}

/* Search container: relative + room for the icon */
.app-shell .bank-search-container {
  position: relative !important;
}
.app-shell .bank-search-container::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background: #8B8F9A;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='11' cy='11' r='7' fill='none' stroke='black' stroke-width='2'/><line x1='16.5' y1='16.5' x2='21' y2='21' stroke='black' stroke-width='2' stroke-linecap='round'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='11' cy='11' r='7' fill='none' stroke='black' stroke-width='2'/><line x1='16.5' y1='16.5' x2='21' y2='21' stroke='black' stroke-width='2' stroke-linecap='round'/></svg>") center/contain no-repeat;
  pointer-events: none;
  z-index: 1;
}

/* Bank input — pill, compact, room for icon */
.app-shell #bankSearch {
  height: 50px !important;
  border-radius: 999px !important;
  background: #1A1D22 !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  color: #FFFFFF !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  padding: 0 18px 0 44px !important;     /* 44px left to clear the icon */
  letter-spacing: -0.005em;
}
.app-shell #bankSearch::placeholder {
  color: #8B8F9A !important;
  opacity: 1 !important;
}
.app-shell #bankSearch:focus {
  border-color: #8B5CF6 !important;
  outline: none !important;
  box-shadow: none !important;
}
.app-shell #bankSearch:focus + .bank-dropdown,
.app-shell #bankSearch:focus ~ .bank-dropdown {
  border-color: rgba(139,92,246,0.30) !important;
}
/* Icon turns purple when input is focused */
.app-shell .bank-search-container:focus-within::before {
  background: #8B5CF6 !important;
}

/* Dropdown follows the pill exactly — already absolute; reaffirm rounding */
.app-shell .bank-dropdown {
  margin-top: 8px !important;
  border-radius: 16px !important;
  background: #15171D !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  box-shadow: 0 12px 28px rgba(0,0,0,0.45) !important;
  max-height: 260px !important;
  overflow-y: auto !important;
}
.app-shell .bank-dropdown .bank-option {
  padding: 12px 16px !important;
  font-size: 14px !important;
  color: #FFFFFF !important;
  cursor: pointer;
}
.app-shell .bank-dropdown .bank-option:hover,
.app-shell .bank-dropdown .bank-option.active {
  background: rgba(139, 92, 246, 0.18) !important;
}

/* Fallback for browsers without :has() — apply tightening to ALL control-cards
   (the city/state/age cards already match anyway, so no visible loss) */
@supports not selector(:has(*)) {
  .app-shell .control-card { padding: 14px !important; }
  .app-shell .control-card .panel-title {
    font-size: 10.5px !important;
    letter-spacing: 0.12em !important;
    margin-bottom: 8px !important;
  }
}

/* ============================================================
   CUSTOM AGE DROPDOWN (replaces native <select>)
   - JS in enhance.js builds this alongside the hidden <select>
   - On choice: writes select.value + fires 'change' so existing
     onchange="updateStates()" still triggers.
   ============================================================ */

.custom-select {
  position: relative !important;
  width: 100% !important;
}
.custom-select .custom-select-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  width: 100% !important;
  height: 50px !important;
  padding: 0 16px 0 18px !important;
  border-radius: 999px !important;
  background: #1A1D22 !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  color: #FFFFFF !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  cursor: pointer;
  letter-spacing: -0.005em;
  transition: border-color 0.15s ease;
}
.custom-select.is-open .custom-select-btn,
.custom-select:focus-within .custom-select-btn {
  border-color: #8B5CF6 !important;
}
.custom-select-label {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.custom-select-label.is-placeholder { color: #8B8F9A; font-weight: 500; }

/* Chevron via CSS mask, rotates when open */
.custom-select-chev {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  background: #FFFFFF;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/></svg>") center/contain no-repeat;
  transition: transform 0.15s ease;
}
.custom-select.is-open .custom-select-chev { transform: rotate(180deg); }

/* Menu */
.custom-select-menu {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  left: 0 !important;
  right: 0 !important;
  margin: 0 !important;
  padding: 6px !important;
  list-style: none !important;
  background: #111318 !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  border-radius: 18px !important;
  box-shadow: 0 14px 30px rgba(0,0,0,0.55) !important;
  max-height: 240px !important;
  overflow-y: auto !important;
  z-index: 80 !important;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s linear 0.12s;
}
.custom-select.is-open .custom-select-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s linear 0s;
}

/* Options */
.custom-select-option {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  height: 44px !important;
  padding: 0 14px !important;
  border-radius: 12px !important;
  color: #FFFFFF !important;
  font-size: 15px !important;
  cursor: pointer;
  transition: background 0.12s ease;
}
.custom-select-option:hover {
  background: rgba(139, 92, 246, 0.18) !important;
}
.custom-select-option.is-selected {
  background: rgba(139, 92, 246, 0.22) !important;
  color: #C4B5FD !important;
  font-weight: 600 !important;
}
.custom-select-option.is-selected::after {
  content: "";
  width: 14px;
  height: 14px;
  background: #C4B5FD;
  flex: 0 0 auto;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M5 12l5 5L20 7'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M5 12l5 5L20 7'/></svg>") center/contain no-repeat;
}

/* Placeholder option (Choose age range...) — muted in the list */
.custom-select-option.is-placeholder-option {
  color: #8B8F9A !important;
  font-style: italic;
}

/* Make sure the parent Age card doesn't clip the dropdown */
.app-shell .control-card,
.app-shell .age-fieldset { overflow: visible !important; }
.app-shell .filter-stack,
.app-shell main.app-main,
.app-shell { overflow: visible !important; }

/* Bump the Age card's stacking when its menu is open so it overlays siblings */
.app-shell .control-card:has(.custom-select.is-open) {
  position: relative !important;
  z-index: 60 !important;
}

/* ============================================================
   QUANTITY STEPPER (custom minus / input / plus)
   - Injected by enhance.js into every .lead-input-container
   - Hides native browser spinner arrows
   - Mobile-tappable; red minus, green plus, pill input in middle
   ============================================================ */

/* Reflow the row: minus | input | plus | Add button */
.app-shell .lead-input-container {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin-top: 6px !important;
  align-self: flex-end !important;
  flex-wrap: wrap !important;
  justify-content: flex-end !important;
}

/* Minus / Plus circles */
.app-shell .qty-btn {
  width: 38px !important;
  height: 38px !important;
  border-radius: 999px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  flex: 0 0 auto !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  transition: transform 0.12s ease, filter 0.12s ease, background 0.12s ease;
  user-select: none;
  -webkit-user-select: none;
}
.app-shell .qty-btn:active { transform: scale(0.94); }
.app-shell .qty-minus {
  background: #3A1A1A !important;
  border-color: rgba(239,68,68,0.45) !important;
  color: #FCA5A5 !important;
}
.app-shell .qty-minus:hover { background: #4A1F1F !important; }
.app-shell .qty-plus {
  background: #122E22 !important;
  border-color: rgba(34,197,94,0.45) !important;
  color: #86EFAC !important;
}
.app-shell .qty-plus:hover { background: #17402B !important; }

/* Editable number pill in the middle */
.app-shell .lead-input-container input[type="number"] {
  width: 60px !important;
  min-width: 60px !important;
  height: 40px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  text-align: center !important;
  border-radius: 999px !important;
  padding: 0 8px !important;
  background: #1A1D22 !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  color: #FFFFFF !important;
  -moz-appearance: textfield !important;
  appearance: textfield !important;
}
/* Hide native spinner */
.app-shell .lead-input-container input[type="number"]::-webkit-inner-spin-button,
.app-shell .lead-input-container input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none !important;
  appearance: none !important;
  margin: 0 !important;
}
.app-shell .lead-input-container input[type="number"]:focus {
  border-color: #8B5CF6 !important;
  outline: none !important;
}

/* Add button sits right of the stepper, slight extra spacing */
.app-shell .lead-input-container .add-button {
  margin-left: 4px !important;
}

/* On very narrow widths, let the stepper wrap to its own row above Add */
@media (max-width: 360px) {
  .app-shell .lead-input-container {
    gap: 6px !important;
  }
  .app-shell .lead-input-container .add-button {
    margin-left: 0 !important;
  }
}
