/* ===== 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%);
  /* 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;
  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;
}

/* ===== 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; }

/* ===== 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);
}
/* ===== 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);
}
