/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; }

:root {
  --bg:        hsl(45, 2%, 5%);
  --surface:   hsl(45, 2%, 12%);
  --surface-2: hsl(45, 2%, 16%);
  --border:    hsl(45, 2%, 24%);
  --text:      hsl(45, 4%, 93%);
  --text-mut:  hsl(45, 2%, 60%);
  --text-faint:hsl(45, 2%, 36%);
  --white:     #ffffff;
  --green:     #52d693;
  --red:       #e86363;
  --blue:      #5e9be8;
  --orange:    #daa040;
  --cyan:      #4dc4b0;
  --beta:      #5e9be8;
  --red-bg:    rgba(224, 114, 114, 0.06);
  --orange-bg: rgba(212, 169, 78, 0.06);
  --orange-bdr:rgba(212, 169, 78, 0.3);
  /* Pill colors: fill (bg) / text */
  --pill-green-fill:   hsla(145, 35%, 25%, 0.3);
  --pill-green-text:   hsl(145, 35%, 70%);
  --pill-green-border: hsl(145, 35%, 35%);
  --contra-num-coral:  hsla(4, 90%, 65%, 0.85);
  --contra-num-amber:  hsla(48, 85%, 60%, 0.85);
  --pill-lilac-fill:   hsla(275, 25%, 25%, 0.4);
  --pill-lilac-text:   hsl(275, 25%, 70%);
  --pill-lilac-border: hsl(275, 25%, 33%);
  --pill-blue-fill:    hsla(214, 40%, 25%, 0.35);
  --pill-blue-text:    hsl(214, 45%, 72%);
  --pill-blue-border:  hsl(214, 40%, 38%);
  --pill-red-fill:     hsla(4, 55%, 28%, 0.35);
  --pill-red-text:     hsl(4, 65%, 75%);
  --pill-red-border:   hsl(4, 55%, 42%);
  --pill-amber-fill:   hsla(41, 45%, 25%, 0.35);
  --pill-amber-text:   hsl(41, 50%, 70%);
  --pill-amber-border: hsl(41, 45%, 38%);
  --pill-gray-fill:    hsla(45, 4%, 22%, 0.4);
  --pill-gray-text:    hsl(45, 4%, 84%);
  --pill-gray-border:  hsl(45, 4%, 42%);
  /* Population colors: fill (tab bg) / border */
  --pop-adult-fill:      hsl(214, 50%, 21%);
  --pop-adult-border:    hsl(214, 55%, 60%);
  --pop-pediatric-fill:  hsl(340, 40%, 21%);
  --pop-pediatric-border:hsl(340, 45%, 60%);
  --pop-neonatal-fill:   hsl(41, 60%, 21%);
  --pop-neonatal-border: hsl(41, 55%, 60%);
  --route-fill:          hsl(41, 60%, 21%);
  --route-border:        hsl(41, 55%, 60%);
  --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
}

/* ===== APP LAYOUT ===== */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  width: 100%;
}

/* ===== PICKER SIDEBAR ===== */
.picker-sidebar {
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
}

.btn-next-x { display: none; font-size: 16px; }
.btn-next-arrow { display: flex; }
.picker-sidebar--open .btn-next-x { display: flex; }
.picker-sidebar--open .btn-next-arrow { display: none; }

.picker-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.18s ease;
}

.picker-sidebar--open {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.picker-sidebar--open .picker-body {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: hidden;
}

.picker-sidebar--open .picker-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.picker-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.picker-search-wrap::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%238b949e'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.099zm-5.242 1.656a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}

.picker-search {
  flex: 1;
  min-width: 0;
  height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 10px 0 32px;
  color: var(--text);

  font-size: 16px;
  outline: none;
  -webkit-appearance: none;
}

.picker-search::placeholder {
  color: var(--text-faint);
}

.picker-search:focus {
  border-color: var(--beta);
}
.picker-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  cursor: pointer;
  background: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 4l8 8M12 4l-8 8' stroke='%235e9be8' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.sort-btn {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 9px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-mut);

  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.sort-btn:hover {
  background: var(--border);
  color: var(--text);
}

/* ===== FILTER CHIPS ===== */
.drug-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-mut);
  white-space: nowrap;
  text-transform: uppercase;
}
.filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 14px;
  background: var(--bg);
}

.filter-clear-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 14px;

  color: var(--beta);
  background: rgba(94, 155, 232, 0.08);
  border: 1px solid rgba(94, 155, 232, 0.3);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}

.filter-clear-inline:hover {
  background: rgba(94, 155, 232, 0.18);
  color: var(--beta);
}

.filter-open-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;

  color: var(--text-mut);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.filter-open-btn:hover {
  background: var(--border);
  color: var(--text);
}

.filter-open-btn--active {
  background: rgba(94, 155, 232, 0.08);
  border-color: var(--beta);
  color: var(--beta);
}

.filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: var(--beta);
  color: #000;
}

/* ===== FILTER MODAL ===== */
.filter-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-end;
}

.filter-modal[hidden] {
  display: none;
}

.filter-modal-inner {
  background: var(--surface);
  width: 100%;
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  border-radius: 16px 16px 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  overflow: hidden;
}

@media (min-width: 768px) {
  .filter-modal {
    align-items: center;
    justify-content: center;
  }
  .filter-modal-inner {
    width: 460px;
    max-height: 70dvh;
    border-radius: 12px;
    border-bottom: 1px solid var(--border);
  }
}

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

.filter-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.filter-modal-close {
  background: none;
  border: none;
  color: var(--text-mut);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 999px;
  line-height: 1;

}

.filter-modal-close:hover {
  color: var(--text);
  background: var(--surface-2);
}

.filter-active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--beta);
  background: rgba(94, 155, 232, 0.12);
  border: 1px solid rgba(94, 155, 232, 0.3);
}

.active-filter-chip-x {
  background: none;
  border: none;
  color: var(--beta);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.7;

}

.active-filter-chip-x:hover {
  opacity: 1;
}

.filter-result-count {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mut);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.filter-tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.filter-tab {
  flex: 1;
  padding: 10px;
  font-size: 15px;
  font-weight: 500;

  color: var(--text-mut);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}

.filter-tab--active {
  color: var(--beta);
  border-bottom-color: var(--beta);
}

.filter-tab-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.filter-class-search {
  position: sticky;
  top: 0;
  z-index: 1;
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: var(--surface-2);
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 16px;
  outline: none;
}

.filter-class-search::placeholder {
  color: var(--text-faint);
}

.filter-list-item {
  display: block;
  width: 100%;
  padding: 11px 16px;
  text-align: left;
  font-size: 18px;

  font-weight: 400;
  color: var(--text-mut);
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.filter-list-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.filter-list-item--active {
  color: var(--beta);
  background: rgba(94, 155, 232, 0.08);
  font-weight: 500;
}

.filter-modal-footer {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.filter-clear-btn {
  flex: 1;
  padding: 10px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;

  color: var(--text-mut);
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.filter-clear-btn:hover {
  color: var(--text);
  background: var(--border);
}

.filter-apply-btn {
  flex: 2;
  padding: 10px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;

  color: #000;
  background: var(--beta);
  border: none;
  cursor: pointer;
  transition: opacity 0.12s;
}

.filter-apply-btn:hover {
  opacity: 0.85;
}

.active-filter-pills {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 12px 12px;
  background: var(--bg);
}
.active-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.active-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;

  cursor: default;
}
.active-pill--category {
  color: var(--blue);
  background: rgba(106, 159, 223, 0.12);
  border: 1px solid rgba(106, 159, 223, 0.3);
}
.active-pill--class {
  color: var(--green);
  background: rgba(107, 201, 159, 0.12);
  border: 1px solid rgba(107, 201, 159, 0.3);
}
.active-pill-x {
  background: none;
  border: none;
  font-size: 10px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.6;

}
.active-pill--category .active-pill-x { color: var(--blue); }
.active-pill--class .active-pill-x { color: var(--green); }
.active-pill-x:hover { opacity: 1; }

.picker-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.picker-item {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 0;
  color: var(--text-mut);
  cursor: pointer;
  border-left: 2px solid transparent;
  border-bottom: 1px solid rgba(51, 53, 56, 0.4);
  user-select: none;
}

.picker-item:hover {
  background: var(--surface-2);
  border-left-color: rgba(94, 155, 232, 0.3);
}
.picker-item:hover .picker-generic {
  color: var(--text);
}

.picker-item--active {
  background: rgba(94, 155, 232, 0.14);
  border-left-color: var(--beta);
}
.picker-item--active .picker-generic {
  color: var(--text);
}
.picker-item--active .picker-trade {
  color: var(--text-mut);
}

.picker-generic {
  font-size: 19px;
  color: var(--text);
}
.picker-trade {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-faint);
}

/* ===== CARD AREA ===== */
.card-area {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ===== MODE TOGGLE (Field Drugs / Home Meds) ===== */
.mode-toggle {
  display: flex;
  gap: 8px;
  padding: 8px 12px 0;
  background: var(--bg);
}
.mode-toggle-btn {
  flex: 1;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--text-mut);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.mode-toggle-btn:hover {
  color: var(--text);
}
.mode-toggle-btn--active {
  background: rgba(94, 155, 232, 0.08);
  color: var(--beta);
  border-color: var(--beta);
}

/* ===== PICKER TOGGLE ROW (drug name + prev/next) ===== */
.picker-toggle-row {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 10px 12px;
  background: var(--bg);
}

#btn-prev { margin-right: 8px; }
#btn-next { margin-left: 8px; }
.picker-sidebar--open #btn-prev { margin-right: 0; }

.picker-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-mut);
  cursor: pointer;
  opacity: 1;
  transition: color 0.12s, background 0.12s, width 0.22s ease, opacity 0.18s ease, padding 0.22s ease, margin 0.22s ease, border-width 0.22s ease;
}

.picker-sidebar--open #btn-prev {
  width: 0;
  opacity: 0;
  padding: 0;
  margin: 0;
  border-width: 0;
  pointer-events: none;
}

.picker-nav-btn:hover {
  color: var(--text);
  background: var(--border);
}

.picker-nav-btn svg {
  width: 18px;
  height: 18px;
}

/* ===== CARD CONTAINER ===== */
#card-container {
  display: flex;
  justify-content: center;
  padding: 0;
  flex: 1;
}

/* ===== CARD ===== */
.card {
  width: 100%;
  max-width: 480px;
  height: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
}

/* ===== DESKTOP LAYOUT ===== */
@media (min-width: 768px) {
  body {
    height: 100dvh;
    overflow: hidden;
  }

  .app-layout {
    flex-direction: row;
    height: 100dvh;
    overflow: hidden;
  }

  .picker-sidebar {
    width: clamp(260px, 35vw, 460px);
    flex-shrink: 0;
    border-bottom: none;
    border-right: 1px solid var(--border);
    position: static;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .picker-body {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    border-top: none;
    max-height: none;
    transition: none;
  }

  .picker-list {
    max-height: none;
    flex: 1;
    overflow-y: auto;
  }

  .card-area {
    flex: 1;
    overflow: hidden;
  }

  #card-container {
    flex: 1;
    overflow-y: auto;
    align-items: flex-start;
    padding: 16px 24px 24px;
  }

  .picker-generic { font-size: 15px; }
  .picker-item { padding: 8px 14px; }

}


/* ===== HEADER ===== */
.card-header {
  text-align: center;
  padding: 32px 14px 28px;
  background: var(--surface);
  background-image: linear-gradient(180deg, hsla(45, 20%, 60%, 0.06) 0%, transparent 100%);
  border-radius: 12px;
}

.drug-name {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
  margin-bottom: 6px;
}

.drug-trade-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-top: 5px;
  letter-spacing: 0.01em;
}

.drug-class-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
}
.drug-class-pill {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 3px 12px;
  border-radius: 999px;
}

/* ===== SECTIONS ===== */
.section {
  background: var(--surface);
  padding: 10px 14px 13px;
  overflow: hidden;
  border-radius: 0 0 12px 12px;
}

.section-label {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0;
  padding: 10px 14px 8px;
  background: var(--surface-2);
  border-radius: 12px 12px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.summary-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
}

/* ===== MOA ENTRIES ===== */
.moa-entry {
  padding-bottom: 12px;
}
.moa-entry:last-child {
  padding-bottom: 0;
}
.moa-entry--divider {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.moa-target-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.moa-target-row .hl {
  font-family: var(--font-mono);
  font-size: 15px;
  padding: 2px 6px;
  white-space: normal;
  flex-shrink: 1;
  word-break: break-word;
}
.moa-action-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-mut);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 3px;
}
.moa-result {
  font-size: 15px;
  font-weight: 700;
  color: #6bc99f;
  margin-top: 8px;
  margin-bottom: 10px;
}
.moa-brief {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}
.moa-brief strong {
  color: var(--text);
}

/* MOA tier labels (dose-dependent drugs) */
.moa-tier-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cyan);
}
.moa-tier-category {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--orange);
}
.moa-tier-range {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
}

/* ===== HIGHLIGHTS ===== */
.hl {
  font-weight: 600;
  padding: 0 4px;
  border-radius: 3px;
}
.hl--alpha   { color: var(--red); background: rgba(232, 99, 99, 0.1); }
.hl--beta    { color: var(--beta);  background: rgba(106, 159, 223, 0.1); }
.hl--neutral { color: var(--text);  background: var(--surface-2); }
.hl--warn  { color: var(--orange);background: var(--orange-bg); }
.hl--danger{ color: var(--red);   background: var(--red-bg); font-weight: 700; }
.hl--ci    { color: var(--red);   background: var(--red-bg); font-weight: 700; }

/* ===== DOSE SECTION ===== */
.section--dose {
  padding: 12px 14px;
}

/* ===== DOSE TAB LABEL ===== */
.dose-tab-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 6px;
}

/* ===== DOSE CHIPS ===== */
.dose-chips {
  display: flex;
  flex-wrap: wrap;
  column-gap: 6px;
  row-gap: 7px;
  margin-bottom: 10px;
}
.dose-chip {
  font-size: 14px;
  color: var(--text-mut);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s, border-color 0.15s, border-style 0.15s;
}
.dose-chip:hover {
  color: var(--text);
  border-color: var(--text-mut);
  border-style: solid;
  background: var(--surface-2);
}
.dose-chip--active,
.dose-chip--active:hover {
  color: var(--white);
  background: var(--pill-green-fill);
  border: 1px solid var(--pill-green-border);
}

/* ===== POP TABS ===== */
.pop-tabs {
  display: flex;
  flex-direction: row;
  column-gap: 6px;
  row-gap: 7px;
  margin-bottom: 10px;
}
.pop-tab {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-mut);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;

  white-space: nowrap;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.pop-tab--active,
.pop-tab--active:hover {
  color: var(--white);
  background: var(--pop-adult-fill);
  border-color: var(--pop-adult-border);
}
.pop-tab--active[data-pop="Pediatric"],
.pop-tab--active:hover[data-pop="Pediatric"] {
  background: var(--pop-pediatric-fill);
  border-color: var(--pop-pediatric-border);
}
.pop-tab--active[data-pop="Neonatal"],
.pop-tab--active:hover[data-pop="Neonatal"] {
  background: var(--pop-neonatal-fill);
  border-color: var(--pop-neonatal-border);
}

/* ===== ROUTE TABS ===== */
.route-tab-wrap {
  display: flex;
  flex-direction: column;
}
.route-tabs {
  display: flex;
  flex-direction: row;
  column-gap: 6px;
  row-gap: 7px;
  margin-bottom: 10px;
}
.route-tab {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-mut);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.route-tab--active,
.route-tab--active:hover {
  color: var(--white);
  background: var(--route-fill);
  border-color: var(--route-border);
}

/* ===== DOSE BLOCKS ===== */
.dose-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dose-routes-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dose-routes {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.dose-route {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dose-amt-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 0;
}
.dose-amt-row .dose-amt {
  flex: 1;
  min-width: 0;
}
.dose-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.dose-meta-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 14px;
  background: var(--surface-2);
}
.dose-meta-cell--note {
  grid-column: 1 / -1;
  padding-top: 12px;
  padding-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dose-meta-cell--empty .dose-meta-value {
  color: var(--text-faint);
}
.dose-route-note {
  font-size: 15px;
  color: var(--text);
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.dose-route-note-arrow {
  font-weight: 400;
  flex-shrink: 0;
}
.dose-amt {
  font-size: 32px;
  font-weight: 700;
  font-family: 'Barlow Semi Condensed', sans-serif;
  color: var(--text);
  line-height: 1;
  overflow-wrap: break-word;
}
.dose-amt--md {
  font-size: 26px;
  line-height: 1.1;
}
.dose-amt--lg {
  font-size: 20px;
  line-height: 1.2;
}
.dose-meta-label,
.note-section-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.dose-meta-label {
  color: var(--text-faint);
}
.dose-meta-value {
  font-size: 17px;
  font-weight: 400;
  color: var(--text);
}
.dose-meta-value--sm { font-size: 14px; }
.indication-notes-wrap {
  margin-top: 10px;
}
.indication-notes,
.dose-gen-notes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-left: 3px solid;
  border-radius: 0 4px 4px 0;
}
.indication-notes {
  border-color: var(--pill-green-border);
  background: var(--pill-green-fill);
}
.dose-gen-notes--adult {
  border-color: var(--pop-adult-border);
  background: color-mix(in srgb, var(--pop-adult-fill) 30%, transparent);
}
.dose-gen-notes--pediatric {
  border-color: var(--pop-pediatric-border);
  background: color-mix(in srgb, var(--pop-pediatric-fill) 30%, transparent);
}
.dose-gen-notes--neonatal {
  border-color: var(--pop-neonatal-border);
  background: color-mix(in srgb, var(--pop-neonatal-fill) 30%, transparent);
}
.indication-note,
.dose-note {
  font-size: 15px;
  color: var(--text-mut);
  line-height: 1.4;
  display: flex;
  gap: 6px;
}
.indication-note::before,
.dose-note::before {
  content: '•';
  flex-shrink: 0;
}
.note-section-label {
  margin-bottom: 2px;
}
.note-section-label--indication { color: var(--pill-green-text); }
.note-section-label--adult      { color: var(--pop-adult-border); }
.note-section-label--pediatric  { color: var(--pop-pediatric-border); }
.note-section-label--neonatal   { color: var(--pop-neonatal-border); }
.dose-formulation-row {
  margin-bottom: 4px;
}
.dose-formulation-badge {
  font-size: 17px;
  font-weight: 400;
  color: var(--text-mut);
  background: transparent;
  border: none;
  padding: 0;
  white-space: nowrap;
  text-align: left;
  align-self: flex-start;
}
.dose-sameas-note {
  font-size: 15px;
  color: var(--text-faint);
  font-style: italic;
  padding: 2px 0;
}

/* ===== CONTRAINDICATIONS ===== */
.contra-key {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px dotted var(--border);
}
.contra-key-label {
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}
.contra-key-label--coral {
  color: var(--contra-num-coral);
}
.contra-key-label--amber {
  color: var(--contra-num-amber);
}


/* ===== PILL LIST ===== */
.pill-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  column-gap: 6px;
  row-gap: 7px;
}
.pill-list li {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid transparent;
  padding: 4px 12px;
  border-radius: 999px;
}
.pill-list--indications li {
  background: var(--pill-green-fill);
  color: var(--pill-green-text);
  border-color: var(--pill-green-border);
}
.pill-list--adverse li {
  background: var(--pill-lilac-fill);
  color: var(--pill-lilac-text);
  border-color: var(--pill-lilac-border);
}
.pill-list--comorbidities li {
  background: var(--pill-red-fill);
  color: var(--pill-red-text);
  border-color: var(--pill-red-border);
}
.pill-list--polypharmacy li {
  background: var(--pill-gray-fill);
  color: hsl(45, 4%, 70%);
  border-color: var(--pill-gray-border);
  cursor: pointer;
  user-select: none;
  transition: border-color 120ms ease, color 120ms ease;
}
.pill-list--polypharmacy li.poly-key--active {
  border-color: var(--text);
  color: var(--text);
  font-weight: 600;
}
.poly-examples {
  margin-top: 10px;
  font-size: 15px;
  color: var(--text-mut);
  line-height: 1.5;
}
.poly-examples::before {
  content: "\2192";
  margin-right: 8px;
  color: var(--text-faint);
}
.poly-examples__empty {
  font-style: italic;
  opacity: 0.75;
}
/* ===== CONTRAINDICATION LIST ===== */
.contra-cols {
  display: flex;
  gap: 12px;
}
.contra-cols .contra-list {
  flex: 1 1 0;
}
.contra-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.contra-list li {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.contra-list li::before {
  content: attr(data-num);
  display: block;
  flex-shrink: 0;
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 1px;
}
.contra-item--absolute::before {
  color: var(--contra-num-coral);
}
.contra-item--relative::before {
  color: var(--contra-num-amber);
}

/* ===== PRECAUTION LIST ===== */
.precaution-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.precaution-item {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  padding-left: 10px;
  border-left: 2px solid var(--orange-bdr);
}
.precaution-item strong {
  color: var(--text);
}
/* ===== FOOTER ===== */
.card-footer {
  text-align: center;
  padding: 12px 0 16px;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.card-footer p {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.card-source {
  color: var(--text-mut) !important;
}

/* ===== AUTH GATE ===== */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
}

/* Legacy card — used by the signed-in/unpaid Stripe view */
.auth-card {
  width: 100%;
  max-width: 380px;
  padding: 28px 24px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

/* ===== AUTH GATE — SIGNED-OUT LANDING (allemsdrugs-landing.html) ===== */
.auth-gate.signed-out {
  /* --blue and --cyan match the app's :root palette so the landing matches. */
  --blue:    #5e9be8;
  --coral:   #D56A6A;
  --cyan:    #4dc4b0;
  --amber:   #D9A54F;
  --purple:  #9B7FD4;
  --navy:    hsl(45, 2%, 5%);
  --navy2:   hsl(45, 2%, 12%);
  --navy3:   hsl(45, 2%, 16%);
  --text:    hsl(45, 4%, 93%);
  --muted:   hsl(45, 2%, 60%);
  --border:  hsl(45, 2%, 22%);

  display: block;
  padding: 0;
  background: var(--navy);
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}
.auth-gate.signed-out::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(94,155,232,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 80%, rgba(77,196,176,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 30% 20% at 10% 90%, rgba(213,106,106,0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}
.auth-gate.signed-out .page {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 24px calc(120px + env(safe-area-inset-bottom, 0px));
  max-width: 480px;
  margin: 0 auto;
}
/* Stop flex from shrinking children when total content > 100svh */
.auth-gate.signed-out .page > * { flex-shrink: 0; }

/* Logo badge */
.auth-gate.signed-out .badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(94,155,232,0.08);
  border: 1px solid rgba(94,155,232,0.22);
  border-radius: 100px;
  padding: 6px 14px;
  margin-bottom: 28px;
  animation: auth-fadeDown 0.6s ease both;
}
.auth-gate.signed-out .badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 8px var(--blue);
  animation: auth-pulse 2.4s ease infinite;
}
.auth-gate.signed-out .badge-text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--blue);
  text-transform: uppercase;
}

/* Headline */
.auth-gate.signed-out .headline {
  font-family: 'Barlow', sans-serif;
  font-weight: 900;
  font-size: clamp(38px, 10.5vw, 58px);
  line-height: 1;
  letter-spacing: -0.025em;
  text-align: center;
  margin-bottom: 18px;
  color: var(--text);
  white-space: nowrap;
  animation: auth-fadeUp 0.7s 0.1s ease both;
}
.auth-gate.signed-out .headline-tld {
  font-size: 0.5em;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0;
  margin-left: 2px;
  vertical-align: baseline;
}
.auth-gate.signed-out .headline-ems {
  /* Logo gradient locked to original colors regardless of variable remap. */
  background: linear-gradient(135deg, #D56A6A 0%, #C97AAF 30%, #6B9FE8 70%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-gate.signed-out .subhead {
  font-size: 15px;
  font-weight: 300;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.01em;
  margin-bottom: 22px;
  line-height: 1.5;
  animation: auth-fadeUp 0.7s 0.2s ease both;
}

/* Stats */
.auth-gate.signed-out .stats {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-bottom: 18px;
  animation: auth-fadeUp 0.7s 0.3s ease both;
  width: 100%;
}
.auth-gate.signed-out .stat-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  justify-content: center;
}
.auth-gate.signed-out .stat-num {
  font-family: 'Barlow', sans-serif;
  font-weight: 900;
  font-size: 80px;
  line-height: 1;
  letter-spacing: -0.03em;
  min-width: 100px;
  text-align: right;
}
.auth-gate.signed-out .stat-num.blue { color: var(--blue); text-shadow: 0 0 40px rgba(94,155,232,0.3); }
.auth-gate.signed-out .stat-num.cyan { color: var(--cyan); text-shadow: 0 0 40px rgba(77,196,176,0.3); }
.auth-gate.signed-out .stat-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  margin-top: 8px;
  font-family: 'Barlow', sans-serif;
  text-align: left;
}
.auth-gate.signed-out .stat-label__sub {
  font-weight: 300;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1;
}
.auth-gate.signed-out .stat-label__main {
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.1;
}
.auth-gate.signed-out .stat-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0;
  width: 100%;
  justify-content: center;
}
.auth-gate.signed-out .stat-divider-line {
  flex: 1;
  max-width: 60px;
  height: 1px;
  background: var(--border);
}
.auth-gate.signed-out .stat-divider-plus {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 18px;
  color: var(--muted);
}

/* Pills */
.auth-gate.signed-out .pills-section {
  width: 100%;
  margin-top: 4px;
  margin-bottom: 10px;
  animation: auth-fadeUp 0.7s 0.4s ease both;
}
.auth-gate.signed-out .pills-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 16px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  margin-top: 36px;
  margin-bottom: 14px;
  animation: auth-fadeUp 0.7s 0.3s ease both;
}
.auth-gate.signed-out .pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.auth-gate.signed-out .pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 100px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid;
  cursor: default;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.auth-gate.signed-out .pill:hover { transform: translateY(-2px); }
.auth-gate.signed-out .pill-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.auth-gate.signed-out .pill-blue   { color: var(--blue);   border-color: rgba(94,155,232,0.3);  background: rgba(94,155,232,0.07); }
.auth-gate.signed-out .pill-blue   .pill-dot { background: var(--blue); }
.auth-gate.signed-out .pill-blue:hover { background: rgba(94,155,232,0.14); box-shadow: 0 4px 20px rgba(94,155,232,0.15); }
.auth-gate.signed-out .pill-coral  { color: var(--coral);  border-color: rgba(213,106,106,0.3); background: rgba(213,106,106,0.07); }
.auth-gate.signed-out .pill-coral  .pill-dot { background: var(--coral); }
.auth-gate.signed-out .pill-coral:hover { background: rgba(213,106,106,0.14); box-shadow: 0 4px 20px rgba(213,106,106,0.15); }
.auth-gate.signed-out .pill-amber  { color: var(--amber);  border-color: rgba(217,165,79,0.3);  background: rgba(217,165,79,0.07); }
.auth-gate.signed-out .pill-amber  .pill-dot { background: var(--amber); }
.auth-gate.signed-out .pill-amber:hover { background: rgba(217,165,79,0.14); box-shadow: 0 4px 20px rgba(217,165,79,0.15); }
.auth-gate.signed-out .pill-cyan   { color: var(--cyan);   border-color: rgba(77,196,176,0.3); background: rgba(77,196,176,0.07); }
.auth-gate.signed-out .pill-cyan   .pill-dot { background: var(--cyan); }
.auth-gate.signed-out .pill-blue:hover { background: rgba(77,196,176,0.14); box-shadow: 0 4px 20px rgba(77,196,176,0.15); }
.auth-gate.signed-out .pill-purple { color: var(--purple); border-color: rgba(155,127,212,0.3); background: rgba(155,127,212,0.07); }
.auth-gate.signed-out .pill-purple .pill-dot { background: var(--purple); }
.auth-gate.signed-out .pill-purple:hover { background: rgba(155,127,212,0.14); box-shadow: 0 4px 20px rgba(155,127,212,0.15); }
.auth-gate.signed-out .pill-muted  { color: var(--muted);  border-color: rgba(107,122,148,0.25); background: rgba(107,122,148,0.07); }
.auth-gate.signed-out .pill-muted  .pill-dot { background: var(--muted); }
.auth-gate.signed-out .pill-muted:hover { background: rgba(107,122,148,0.14); }

/* Auth card (overrides legacy .auth-card inside signed-out) */
.auth-gate.signed-out .auth-card {
  width: 100%;
  max-width: none;
  margin: 0;
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  animation: auth-fadeUp 0.7s 0.5s ease both;
  position: relative;
  overflow: hidden;
  display: block;
  gap: 0;
  box-shadow: none;
}
.auth-gate.signed-out .auth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(94,155,232,0.4), transparent);
}
.auth-gate.signed-out .auth-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
  line-height: normal;
}
.auth-gate.signed-out .auth-cta {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 6px;
}
.auth-gate.signed-out .auth-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.5;
}
.auth-gate.signed-out .input-wrap {
  position: relative;
  margin-bottom: 12px;
}
.auth-gate.signed-out .input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}
.auth-gate.signed-out .email-input {
  width: 100%;
  background: var(--navy3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px 14px 44px;
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-gate.signed-out .email-input::placeholder { color: var(--muted); }
.auth-gate.signed-out .email-input:focus {
  border-color: rgba(94,155,232,0.4);
  box-shadow: 0 0 0 3px rgba(94,155,232,0.08);
}
.auth-gate.signed-out .btn-magic {
  width: 100%;
  padding: 15px 24px;
  background: linear-gradient(135deg, var(--blue) 0%, #4683C5 100%);
  color: #0D1A14;
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 24px rgba(94,155,232,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.auth-gate.signed-out .btn-magic:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(94,155,232,0.35);
}
.auth-gate.signed-out .btn-magic:active { transform: translateY(0); }
.auth-gate.signed-out .btn-magic:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.auth-gate.signed-out .auth-note {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  min-height: 0;
  margin: 0;
}
.auth-gate.signed-out .auth-note:not(:empty) { margin-top: 14px; }
.auth-gate.signed-out .auth-note.auth-msg--ok  { color: var(--blue); }
.auth-gate.signed-out .auth-note.auth-msg--err { color: var(--coral); }

/* ===== AUTH GATE — SIGNED-IN UNPAID (modal over the app) ===== */
.auth-gate.signed-in-unpaid {
  /* Mirrors .signed-out — see comment there for variable rename intent. */
  --blue:    #5e9be8;
  --coral:   #D56A6A;
  --cyan:    #4dc4b0;
  --navy:    hsl(45, 2%, 5%);
  --navy2:   hsl(45, 2%, 12%);
  --navy3:   hsl(45, 2%, 16%);
  --text:    hsl(45, 4%, 93%);
  --muted:   hsl(45, 2%, 60%);
  --border:  hsl(45, 2%, 22%);

  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: hsla(45, 2%, 5%, 0.32);
  backdrop-filter: blur(4px) saturate(110%);
  -webkit-backdrop-filter: blur(4px) saturate(110%);
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  animation: auth-backdropFade 0.35s ease both;
  overflow-y: auto;
}

@keyframes auth-backdropFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.auth-gate.signed-in-unpaid .checkout-page {
  width: 100%;
  max-width: 380px;
  margin: auto;
}

.auth-gate.signed-in-unpaid .checkout-modal {
  position: relative;
  width: 100%;
  background: linear-gradient(180deg, hsla(45, 2%, 14%, 0.96) 0%, hsla(45, 2%, 8%, 0.96) 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  animation: auth-modalIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.auth-gate.signed-in-unpaid .checkout-modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(94,155,232,0.55), transparent);
  border-radius: 20px 20px 0 0;
}

@keyframes auth-modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.auth-gate.signed-in-unpaid .checkout-modal > * { flex-shrink: 0; }

/* Badge — centered above headline */
.auth-gate.signed-in-unpaid .badge {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(94,155,232,0.1);
  border: 1px solid rgba(94,155,232,0.24);
  border-radius: 100px;
  padding: 5px 12px;
  margin: 0;
}
.auth-gate.signed-in-unpaid .badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 8px var(--blue);
  animation: auth-pulse 2.4s ease infinite;
}
.auth-gate.signed-in-unpaid .badge-text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--blue);
  text-transform: uppercase;
}

.auth-gate.signed-in-unpaid .checkout-headline {
  font-family: 'Barlow', sans-serif;
  font-weight: 900;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--text);
  text-align: center;
}

.auth-gate.signed-in-unpaid .checkout-email {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin: -6px 0 0;
  text-align: center;
  word-break: break-all;
}

/* Feature bullets */
.auth-gate.signed-in-unpaid .checkout-features {
  list-style: none;
  margin: 4px 0 0;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-gate.signed-in-unpaid .checkout-feature {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: start;
  gap: 12px;
}
.auth-gate.signed-in-unpaid .checkout-feature__check {
  color: var(--blue);
  filter: drop-shadow(0 0 4px rgba(94,155,232,0.5));
  margin-top: 2px;
}
.auth-gate.signed-in-unpaid .checkout-feature__label {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.4;
}

/* Price line — inline "$19  Lifetime Access" */
.auth-gate.signed-in-unpaid .checkout-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 2px 0;
  flex-wrap: wrap;
}
.auth-gate.signed-in-unpaid .checkout-price__amount {
  font-family: 'Barlow', sans-serif;
  font-weight: 900;
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--blue);
  text-shadow: 0 0 28px rgba(94,155,232,0.3);
}
.auth-gate.signed-in-unpaid .checkout-price__heading {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* CTA — same gradient as landing */
.auth-gate.signed-in-unpaid .checkout-cta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 24px;
  background: linear-gradient(135deg, var(--blue) 0%, #4683C5 100%);
  color: #0D1A14;
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(94,155,232,0.32), 0 0 0 1px rgba(94,155,232,0.18);
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  margin-top: 4px;
}
.auth-gate.signed-in-unpaid .checkout-cta:hover {
  opacity: 0.94;
  transform: translateY(-1px);
  box-shadow: 0 10px 32px rgba(94,155,232,0.4), 0 0 0 1px rgba(94,155,232,0.22);
}
.auth-gate.signed-in-unpaid .checkout-cta:active { transform: translateY(0); }
.auth-gate.signed-in-unpaid .checkout-cta:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}
.auth-gate.signed-in-unpaid .checkout-cta__arrow { transition: transform 0.2s; }
.auth-gate.signed-in-unpaid .checkout-cta:hover .checkout-cta__arrow {
  transform: translateX(2px);
}

.auth-gate.signed-in-unpaid .checkout-msg {
  margin: 0;
  min-height: 0;
  font-size: 12.5px;
  text-align: center;
  color: var(--muted);
  font-family: 'IBM Plex Sans', sans-serif;
}
.auth-gate.signed-in-unpaid .checkout-msg:empty { display: none; }
.auth-gate.signed-in-unpaid .checkout-msg--err { color: var(--coral); }
.auth-gate.signed-in-unpaid .checkout-msg--ok  { color: var(--blue); }

/* Redeem code (secondary path under the Stripe CTA) */
.auth-gate.signed-in-unpaid .redeem-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.auth-gate.signed-in-unpaid .redeem-label {
  margin: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}
.auth-gate.signed-in-unpaid .redeem-form {
  display: flex;
  gap: 6px;
}
.auth-gate.signed-in-unpaid .redeem-input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.auth-gate.signed-in-unpaid .redeem-input::placeholder {
  color: var(--muted);
  opacity: 0.5;
  text-transform: uppercase;
}
.auth-gate.signed-in-unpaid .redeem-input:focus {
  outline: none;
  border-color: var(--blue);
}
.auth-gate.signed-in-unpaid .redeem-btn {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.auth-gate.signed-in-unpaid .redeem-btn:hover { border-color: var(--blue); color: var(--blue); }
.auth-gate.signed-in-unpaid .redeem-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.auth-gate.signed-in-unpaid .redeem-msg {
  margin: 0;
  min-height: 0;
  font-size: 12px;
  text-align: center;
  color: var(--muted);
  font-family: 'IBM Plex Sans', sans-serif;
}
.auth-gate.signed-in-unpaid .redeem-msg:empty { display: none; }
.auth-gate.signed-in-unpaid .redeem-msg--err { color: var(--coral); }

/* Footer row: Stripe trust · Sign out */
.auth-gate.signed-in-unpaid .checkout-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}
.auth-gate.signed-in-unpaid .checkout-trust {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.auth-gate.signed-in-unpaid .checkout-trust svg { color: var(--blue); }
.auth-gate.signed-in-unpaid .checkout-footer__sep {
  color: var(--muted);
  opacity: 0.5;
  font-size: 11px;
}
.auth-gate.signed-in-unpaid .checkout-signout {
  padding: 6px 0;
  background: none;
  border: none;
  color: var(--muted);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s;
}
.auth-gate.signed-in-unpaid .checkout-signout:hover { color: var(--text); }

/* Success state */
.auth-gate.signed-in-unpaid .checkout-modal--success {
  align-items: center;
  text-align: center;
  padding: 28px 22px;
  gap: 16px;
}
.auth-gate.signed-in-unpaid .checkout-modal--success .checkout-headline {
  font-size: 36px;
}
.auth-gate.signed-in-unpaid .checkout-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 8px 0 4px;
}
.auth-gate.signed-in-unpaid .checkout-success__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 16px var(--blue), 0 0 32px rgba(94,155,232,0.4);
  animation: auth-pulse 1.6s ease infinite;
}
.auth-gate.signed-in-unpaid .checkout-success__text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-align: center;
}

@keyframes auth-fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes auth-fadeDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes auth-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.8); }
}

/* ===== DEEP LANDING (below the sign-in card) ===== */
.auth-gate.signed-out .lp-cue {
  width: 100%;
  margin: 28px auto 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.auth-gate.signed-out .lp-cue__text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 16px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.auth-gate.signed-out .lp-cue__arrow {
  display: inline-block;
  font-size: 18px;
  line-height: 1;
  color: var(--blue);
  text-shadow: 0 0 10px rgba(94,155,232,0.4);
  animation: lp-bounce 1.6s ease-in-out infinite;
}
@keyframes lp-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(3px); }
}

.auth-gate.signed-out .lp-section {
  width: 100%;
  margin-top: 44px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.auth-gate.signed-out .lp-section.lp-in-view { opacity: 1; transform: translateY(0); }
.auth-gate.signed-out .lp-section--demo { margin-top: 32px; }
.auth-gate.signed-out .lp-section--why  { margin-top: 48px; }

.auth-gate.signed-out .lp-h2 {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: clamp(24px, 6vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.018em;
  color: var(--text);
  text-align: center;
  margin: 4px 0 6px;
}
.auth-gate.signed-out .lp-body {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.65;
  color: var(--muted);
  text-align: center;
  max-width: 42ch;
  margin: 0 auto;
}
.auth-gate.signed-out .lp-body strong {
  color: var(--text);
  font-weight: 500;
}
/* Colorful bullet list */
.auth-gate.signed-out .lp-bullets {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
}
.auth-gate.signed-out .lp-bullet {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--text);
}
.auth-gate.signed-out .lp-bullet__mark {
  font-family: 'Barlow', sans-serif;
  font-weight: 900;
  font-size: 22px;
  line-height: 1.05;
  text-align: center;
}
.auth-gate.signed-out .lp-bullet--blue  .lp-bullet__mark { color: var(--blue);  text-shadow: 0 0 12px rgba(94,155,232,0.45); }
.auth-gate.signed-out .lp-bullet--cyan  .lp-bullet__mark { color: var(--cyan);  text-shadow: 0 0 12px rgba(77,196,176,0.45); }
.auth-gate.signed-out .lp-bullet--amber .lp-bullet__mark { color: var(--amber); text-shadow: 0 0 12px rgba(217,165,79,0.45); }
.auth-gate.signed-out .lp-bullet__text { color: var(--text); }
.auth-gate.signed-out .lp-bullet__text strong { color: var(--text); font-weight: 600; }
.auth-gate.signed-out .lp-num {
  font-family: 'Barlow', sans-serif;
  font-style: normal;
  font-weight: 900;
  font-size: 1.1em;
  color: var(--blue);
  letter-spacing: -0.01em;
}

/* Inline color highlights (echo the pill palette) */
.auth-gate.signed-out .lp-hl {
  font-weight: 600;
  padding: 0 1px;
  border-radius: 3px;
}
.auth-gate.signed-out .lp-hl--blue   { color: var(--blue);   background: rgba(94,155,232,0.10); }
.auth-gate.signed-out .lp-hl--coral  { color: var(--coral);  background: rgba(213,106,106,0.10); }
.auth-gate.signed-out .lp-hl--amber  { color: var(--amber);  background: rgba(217,165,79,0.10); }
.auth-gate.signed-out .lp-hl--cyan   { color: var(--cyan);   background: rgba(77,196,176,0.10); }
.auth-gate.signed-out .lp-hl--purple { color: var(--purple); background: rgba(155,127,212,0.10); }

/* Pull-quote — Why we made this */
.auth-gate.signed-out .lp-quote {
  margin: 0;
  padding: 0;
  text-align: center;
}
.auth-gate.signed-out .lp-quote__text {
  font-family: 'Barlow', sans-serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(18px, 4.6vw, 22px);
  line-height: 1.45;
  letter-spacing: -0.005em;
  color: var(--text);
  margin: 0 auto 14px;
  max-width: 38ch;
}
.auth-gate.signed-out .lp-quote__text:last-of-type { margin-bottom: 0; }

/* Byline above the quote */
.auth-gate.signed-out .lp-quote__attr {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 22px;
}
.auth-gate.signed-out .lp-quote__attr-line {
  flex: 0 0 36px;
  height: 1px;
  background: var(--coral);
  opacity: 0.55;
}
.auth-gate.signed-out .lp-quote__attr-text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--coral);
  white-space: nowrap;
}

/* ── Device frame (around the live demo) — full-bleed to viewport edges ── */
.auth-gate.signed-out .lp-device {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-top: 8px;
  background: var(--navy2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  overflow: hidden;
  box-shadow:
    0 30px 60px -20px rgba(0,0,0,0.6),
    0 0 60px -20px rgba(94,155,232,0.18);
}
.auth-gate.signed-out .lp-device::before { display: none; }
.auth-gate.signed-out .lp-device__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  border-bottom: 1px solid var(--border);
}
.auth-gate.signed-out .lp-device__dots { display: inline-flex; gap: 6px; }
.auth-gate.signed-out .lp-device__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.auth-gate.signed-out .lp-device__dot--coral { background: var(--coral); }
.auth-gate.signed-out .lp-device__dot--amber { background: var(--amber); }
.auth-gate.signed-out .lp-device__dot--blue  { background: var(--blue); }
.auth-gate.signed-out .lp-device__title {
  flex: 1;
  text-align: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-gate.signed-out .lp-device__live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue);
}
.auth-gate.signed-out .lp-device__live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 8px var(--blue);
  animation: auth-pulse 2.4s ease infinite;
}

/* ── Live demo body — restore drug-card design tokens ── */
.auth-gate.signed-out .lp-demo {
  padding: 14px;
  background: hsl(45, 2%, 5%);
  /* Restore globals so the embedded drug card paints correctly */
  --bg:        hsl(45, 2%, 5%);
  --surface:   hsl(45, 2%, 12%);
  --surface-2: hsl(45, 2%, 16%);
  --border:    hsl(45, 2%, 24%);
  --text:      hsl(45, 4%, 93%);
  --text-mut:  hsl(45, 2%, 60%);
  --text-faint:hsl(45, 2%, 36%);
  --blue:      #5e9be8;
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
}
.auth-gate.signed-out .lp-demo .card {
  width: 100%;
  max-width: 100%;
  height: auto;
}
.auth-gate.signed-out .lp-demo__fallback {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* Final CTA */
.auth-gate.signed-out .lp-section--final {
  margin-top: 56px;
  align-items: center;
  text-align: center;
  gap: 22px;
}
.auth-gate.signed-out .lp-final__title {
  font-family: 'Barlow', sans-serif;
  font-weight: 900;
  font-size: clamp(34px, 8.5vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--text);
  margin: 0;
}
.auth-gate.signed-out .lp-final__btn {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
  color: #0D1A14;
  background: linear-gradient(135deg, var(--blue) 0%, #4683C5 100%);
  border: none;
  border-radius: 14px;
  padding: 16px 28px;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow:
    0 8px 28px rgba(94,155,232,0.3),
    0 0 0 1px rgba(94,155,232,0.15);
}
.auth-gate.signed-out .lp-final__btn:hover {
  opacity: 0.94;
  transform: translateY(-1px);
  box-shadow:
    0 12px 36px rgba(94,155,232,0.4),
    0 0 0 1px rgba(94,155,232,0.2);
}
.auth-gate.signed-out .lp-final__btn:active { transform: translateY(0); }

/* Floating pricing modal — pinned at top, slides down when demo enters view */
.auth-gate.signed-out .lp-price-banner {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 12px;
  right: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 12px 12px 18px;
  background: linear-gradient(135deg, var(--blue) 0%, #4683C5 100%);
  border-radius: 18px;
  box-shadow:
    0 16px 40px -10px rgba(0,0,0,0.55),
    0 4px 24px -8px rgba(94,155,232,0.55);
  color: #0D1A14;
  transform: translateY(calc(-100% - 24px));
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1),
              opacity 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.auth-gate.signed-out .lp-price-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
}
.auth-gate.signed-out .lp-price-banner__new {
  font-family: 'Barlow', sans-serif;
  font-weight: 900;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.025em;
  color: #0D1A14;
  flex-shrink: 0;
}
.auth-gate.signed-out .lp-price-banner__copy {
  flex: 1;
  min-width: 0;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  color: #0D1A14;
  margin: 0;
}
.auth-gate.signed-out .lp-price-banner__cta {
  flex-shrink: 0;
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--blue);
  background: #0D1A14;
  border: none;
  border-radius: 100px;
  padding: 10px 18px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.auth-gate.signed-out .lp-price-banner__cta:hover {
  background: #1A2D24;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}
.auth-gate.signed-out .lp-price-banner__cta:active { transform: translateY(0); }
@media (max-width: 380px) {
  .auth-gate.signed-out .lp-price-banner { gap: 10px; padding-left: 14px; }
  .auth-gate.signed-out .lp-price-banner__new { font-size: 28px; }
  .auth-gate.signed-out .lp-price-banner__copy { font-size: 12px; }
  .auth-gate.signed-out .lp-price-banner__cta { padding: 9px 14px; font-size: 13px; }
}

/* ================ DESKTOP RESPONSIVE PASS ================ */
@media (min-width: 768px) {
  /* Page container — wider column, more padding */
  .auth-gate.signed-out .page {
    max-width: 640px;
    padding: 56px 32px 160px;
  }

  /* Headline + tagline */
  .auth-gate.signed-out .headline { font-size: clamp(58px, 8vw, 80px); }
  .auth-gate.signed-out .subhead { font-size: 18px; margin-bottom: 32px; }

  /* Stats — no margin-top: pills-label.margin-bottom provides the gap */
  .auth-gate.signed-out .stats { margin-bottom: 24px; }
  .auth-gate.signed-out .stat-num { font-size: 100px; min-width: 130px; }
  .auth-gate.signed-out .stat-label__main { font-size: 36px; }
  .auth-gate.signed-out .stat-label__sub { font-size: 15px; }

  /* Pills */
  .auth-gate.signed-out .pills-label { font-size: 18px; margin-top: 48px; margin-bottom: 18px; }
  .auth-gate.signed-out .pill { font-size: 14px; padding: 9px 18px; }
  .auth-gate.signed-out .pills { gap: 10px; }

  /* Cue (LIVE DEMO ⬇) */
  .auth-gate.signed-out .lp-cue { margin-top: 36px; gap: 10px; }
  .auth-gate.signed-out .lp-cue__text { font-size: 18px; }
  .auth-gate.signed-out .lp-cue__arrow { font-size: 22px; }

  /* Sign-in card */
  .auth-gate.signed-out .auth-card { padding: 28px 32px; border-radius: 22px; }
  .auth-gate.signed-out .auth-cta { font-size: 28px; }
  .auth-gate.signed-out .auth-sub { font-size: 15px; margin-bottom: 20px; }
  .auth-gate.signed-out .input-wrap { margin-bottom: 14px; }
  .auth-gate.signed-out .input-icon { left: 18px; }
  .auth-gate.signed-out .email-input {
    font-size: 16px;
    padding: 16px 18px 16px 48px;
  }
  .auth-gate.signed-out .btn-magic {
    font-size: 18px;
    padding: 18px 28px;
  }

  /* Live demo — cancel full-bleed, restore proper framing */
  .auth-gate.signed-out .lp-device {
    position: static;
    left: auto;
    right: auto;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 22px;
  }
  .auth-gate.signed-out .lp-demo { padding: 18px; }

  /* Bullets */
  .auth-gate.signed-out .lp-bullets {
    gap: 22px;
    max-width: 540px;
    margin-inline: auto;
  }
  .auth-gate.signed-out .lp-bullet {
    grid-template-columns: 28px 1fr;
    gap: 16px;
    font-size: 17px;
    line-height: 1.65;
  }
  .auth-gate.signed-out .lp-bullet__mark { font-size: 26px; }

  /* Quote */
  .auth-gate.signed-out .lp-quote__text {
    font-size: clamp(22px, 2.6vw, 28px);
    margin-bottom: 18px;
  }

  /* Final CTA */
  .auth-gate.signed-out .lp-section--final { gap: 26px; }
  .auth-gate.signed-out .lp-final__title { font-size: clamp(48px, 5.6vw, 64px); }
  .auth-gate.signed-out .lp-final__btn {
    font-size: 19px;
    padding: 20px 36px;
    border-radius: 16px;
  }

  /* Pricing banner — centered, capped width */
  .auth-gate.signed-out .lp-price-banner {
    top: calc(20px + env(safe-area-inset-top, 0px));
    left: 50%;
    right: auto;
    width: min(640px, calc(100vw - 32px));
    transform: translate(-50%, calc(-100% - 32px));
    padding: 14px 14px 14px 22px;
    gap: 18px;
  }
  .auth-gate.signed-out .lp-price-banner.is-visible {
    transform: translate(-50%, 0);
  }
  .auth-gate.signed-out .lp-price-banner__new { font-size: 38px; }
  .auth-gate.signed-out .lp-price-banner__copy { font-size: 14px; }
  .auth-gate.signed-out .lp-price-banner__cta {
    font-size: 15px;
    padding: 12px 22px;
  }

  /* Section vertical rhythm */
  .auth-gate.signed-out .lp-section { margin-top: 64px; }
  .auth-gate.signed-out .lp-section--demo { margin-top: 48px; }
  .auth-gate.signed-out .lp-section--why { margin-top: 64px; }
  .auth-gate.signed-out .lp-section--final { margin-top: 80px; }
}

@media (min-width: 1100px) {
  .auth-gate.signed-out .page { max-width: 720px; }
}

/* Legacy classes still used by the signed-in/unpaid Stripe view */
.auth-title {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.3;
}
.auth-sub {
  font-size: 13px;
  color: var(--text-mut);
  line-height: 1.5;
}

.auth-btn {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  background: var(--blue);
  color: hsl(45, 2%, 8%);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, opacity 0.15s ease;
}
.auth-btn:hover { filter: brightness(1.05); }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-link {
  align-self: flex-start;
  margin-top: 4px;
  padding: 4px 0;
  background: none;
  border: none;
  color: var(--text-mut);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}
.auth-link:hover { color: var(--text); }
.auth-msg {
  min-height: 18px;
  font-size: 12px;
  color: var(--text-mut);
}
.auth-msg--ok { color: var(--green); }
.auth-msg--err { color: var(--red); }
.auth-status {
  font-size: 13px;
  color: var(--text-mut);
  text-align: center;
}

/* User menu icon + popover (signed-in users) */
.user-menu-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-mut);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  align-self: center;
  padding: 0;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.user-menu-btn:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--text-mut);
}
.user-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: hsla(45, 2%, 4%, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: 'IBM Plex Sans', -apple-system, sans-serif;
}
.user-menu[hidden] { display: none; }
.user-menu-panel {
  position: relative;
  width: 100%;
  max-width: 320px;
  padding: 32px 24px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.user-menu__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-mut);
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.user-menu__close:hover {
  color: var(--text);
  background: var(--surface-2);
}
.user-menu__email {
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-menu__signout {
  align-self: flex-start;
  padding: 0;
  background: none;
  border: none;
  color: var(--text-mut);
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
}
.user-menu__signout:hover { color: var(--text); }
.user-menu__support {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-mut);
  line-height: 1.4;
}

/* ===== POST-CHECKOUT WELCOME MODAL ===== */
.welcome-overlay {
  position: fixed;
  inset: 0;
  background: hsla(45, 2%, 4%, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
  animation: welcome-fade 0.3s ease both;
}
.welcome-modal {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: linear-gradient(180deg, hsl(45, 2%, 14%) 0%, hsl(45, 2%, 11%) 100%);
  border: 1px solid hsl(45, 2%, 22%);
  border-radius: 16px;
  padding: 36px 28px 28px;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.5),
    0 0 0 1px rgba(94,155,232,0.06),
    0 0 80px rgba(94,155,232,0.08);
  animation: welcome-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  font-family: 'Barlow', sans-serif;
}
.welcome-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(94,155,232,0.55), transparent);
}
.welcome-headline {
  margin: 0 0 8px;
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.1;
  color: hsl(45, 4%, 93%);
  text-shadow: 0 0 40px rgba(94,155,232,0.25);
}
.welcome-sub {
  margin: 0 0 24px;
  font-size: 15px;
  color: hsl(45, 2%, 60%);
  line-height: 1.4;
}
.welcome-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.welcome-list__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: hsl(45, 4%, 93%);
}
.welcome-list__mark {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(94,155,232,0.12);
  border: 1px solid rgba(94,155,232,0.3);
  color: #5e9be8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  margin-top: 1px;
}
.welcome-list__text strong {
  color: #5e9be8;
  font-weight: 600;
}
.welcome-cta {
  width: 100%;
  padding: 13px 18px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #5e9be8 0%, #4683C5 100%);
  color: hsl(45, 2%, 8%);
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow:
    0 4px 24px rgba(94,155,232,0.3),
    inset 0 1px 0 rgba(255,255,255,0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.welcome-cta:hover {
  transform: translateY(-1px);
  box-shadow:
    0 6px 28px rgba(94,155,232,0.4),
    inset 0 1px 0 rgba(255,255,255,0.22);
}
.welcome-cta:active { transform: translateY(0); }
.welcome-cta__arrow { transition: transform 0.2s ease; }
.welcome-cta:hover .welcome-cta__arrow { transform: translateX(2px); }

@keyframes welcome-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes welcome-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
@media (max-width: 380px) {
  .welcome-modal { padding: 32px 22px 24px; }
  .welcome-headline { font-size: 30px; }
}

