:root {
  color-scheme: light;
  --ink: #182033;
  --muted: #667085;
  --line: #dce2ea;
  --paper: #ffffff;
  --surface: #eef3f6;
  --navy: #143247;
  --blue: #176b83;
  --blue-soft: #e5f1f5;
  --tone-low-bg: #e3f1fb;
  --tone-low-ink: #165c86;
  --tone-reference-bg: #edf0f4;
  --tone-reference-ink: #4b5565;
  --tone-high-bg: #fee7e3;
  --tone-high-ink: #982e26;
  --tone-variable-bg: #efe8fa;
  --tone-variable-ink: #6941a5;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 90% 0%, rgba(77, 137, 176, 0.12), transparent 26rem),
    var(--surface);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.home-medical {
  background-color: #edf3f6;
  background-image:
    linear-gradient(rgba(64, 105, 126, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(64, 105, 126, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #f6f9fa 0, #edf3f6 28rem);
  background-size: 24px 24px, 24px 24px, 100% 100%;
}

.home-medical .page-shell {
  padding-top: 0.75rem;
}

button, input, select, textarea { font: inherit; }

button:focus-visible, [role="tab"]:focus-visible, a:focus-visible {
  outline: 3px solid rgba(45, 111, 159, 0.35);
  outline-offset: 3px;
}

.drug-detail-link:focus-visible, .modal-close:focus-visible {
  outline: 3px solid rgba(45, 111, 159, 0.35);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--navy);
  color: white;
  border-radius: 0.5rem;
  transform: translateY(-200%);
}

.skip-link:focus { transform: translateY(0); }

.page-shell {
  width: min(1440px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.eyebrow, .category-kicker {
  margin: 0 0 0.45rem;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

h1 {
  margin-bottom: 0.6rem;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.intro {
  max-width: 45rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.page-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.page-links a {
  padding: 0.45rem 0.7rem;
  border: 1px solid #c9d3de;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #255b7f;
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: none;
}

.page-links a:hover,
.page-links a[aria-current="page"] {
  border-color: #7da9c8;
  background: var(--blue-soft);
}

.page-links .manager-nav-link {
  border-color: #4f8b78;
  background: #e8f5ef;
  color: #185d47;
}

.page-links .manager-nav-link:hover,
.page-links .manager-nav-link[aria-current="page"] {
  border-color: #2f755f;
  background: #d8eee5;
  color: #104c3a;
}

.controls { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.control-button {
  min-height: 2.65rem;
  padding: 0.65rem 0.95rem;
  border: 1px solid #cbd3de;
  border-radius: 0.65rem;
  background: var(--paper);
  color: #344054;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.control-button:hover:not(:disabled), .control-button.active {
  border-color: #7da9c8;
  background: var(--blue-soft);
  color: #174d72;
}

.control-button:disabled { opacity: 0.55; cursor: wait; }

.comparison-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.tabs {
  display: flex;
  gap: 0.3rem;
  overflow-x: auto;
  padding: 0.55rem;
  border-bottom: 1px solid var(--line);
  background: #e9edf2;
}

.tab {
  flex: 0 0 auto;
  padding: 0.72rem 1rem;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  color: #5b6879;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.tab:hover { background: rgba(255, 255, 255, 0.62); }

.tab[data-tone="recreational"] {
  order: 999;
  margin-inline-start: auto;
  border: 1px solid transparent;
  background: transparent;
  color: #778291;
  font-size: 0.78rem;
  font-weight: 700;
}

.tab[data-tone="recreational"]::before {
  display: inline-block;
  width: 1px;
  height: 1rem;
  margin-right: 0.65rem;
  background: #b8c0ca;
  content: "";
  vertical-align: -0.18rem;
}

.tab[data-tone="recreational"]:hover {
  background: rgba(255, 255, 255, 0.52);
  color: #556170;
}

.tab[data-tone="recreational"].active {
  border-color: #cbd3dc;
  background: #f7f9fb;
  color: #44515f;
  box-shadow: inset 0 -2px 0 #7e8c9b;
}

.tab[data-tone="recreational"].active::before { background: #8f9ba8; }

.tab.active {
  background: white;
  color: #164c71;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.11);
}

.manager-feature {
  display: grid;
  grid-template-columns: auto minmax(16rem, 1.25fr) minmax(13rem, 0.85fr) auto;
  align-items: center;
  gap: 1.15rem;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid #9bc8b7;
  border-left: 0.42rem solid #2f8064;
  border-radius: 0.9rem;
  background: linear-gradient(115deg, #f2fbf7, #e8f5ef);
  box-shadow: 0 8px 22px rgba(24, 89, 68, 0.08);
}

.manager-feature-mark {
  display: grid;
  width: 3.3rem;
  height: 3.3rem;
  place-items: center;
  border-radius: 0.85rem;
  background: #226c54;
  color: white;
  font-family: Georgia, serif;
  font-size: 1.22rem;
  font-weight: 800;
  box-shadow: 0 0.38rem 0.8rem rgba(24, 89, 68, 0.2);
}

.manager-feature-copy h2 { margin-bottom: 0.28rem; color: #183f33; font-size: 1.2rem; letter-spacing: -0.025em; }
.manager-feature-copy p:last-child { margin: 0; color: #4b6b61; font-size: 0.78rem; line-height: 1.5; }
.manager-feature-status { display: grid; gap: 0.18rem; padding-left: 1rem; border-left: 1px solid #bad9ce; }
.manager-feature-status strong { color: #245947; font-size: 0.82rem; }
.manager-feature-status span { color: #5e756d; font-size: 0.7rem; line-height: 1.4; }
.manager-feature-action { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.72rem 0.85rem; border-radius: 0.62rem; background: #226c54; color: white; font-size: 0.77rem; font-weight: 850; text-decoration: none; white-space: nowrap; }
.manager-feature-action:hover { background: #18523f; }

.manager-priority-hero {
  position: sticky;
  top: 0.75rem;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(19rem, 0.86fr) minmax(30rem, 1.14fr);
  gap: 0;
  margin-bottom: 1.4rem;
  overflow: hidden;
  border: 1px solid #a9bec9;
  border-top: 0.3rem solid #19758a;
  border-radius: 0.75rem;
  background: #f9fbfc;
  box-shadow: 0 12px 30px rgba(25, 58, 74, 0.16);
}

.manager-priority-intro {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 1.1rem 1.25rem;
  border-right: 1px solid #cfdae0;
}

.manager-priority-brand { display: grid; grid-template-columns: auto 1fr; gap: 0.9rem; align-items: start; }
.manager-priority-mark {
  display: grid;
  width: 3.6rem;
  height: 3.6rem;
  place-items: center;
  border-radius: 0.55rem;
  background: #176b83;
  color: white;
  font-family: Georgia, serif;
  font-size: 1.35rem;
  font-weight: 800;
  box-shadow: 0 0.35rem 0.8rem rgba(23, 107, 131, 0.2);
}
.manager-priority-intro h1 { max-width: 37rem; margin-bottom: 0.4rem; color: #16384b; font-size: clamp(1.45rem, 2.2vw, 2rem); letter-spacing: -0.035em; }
.manager-priority-intro .intro { max-width: 37rem; color: #526c79; font-size: 0.82rem; line-height: 1.45; }
.manager-priority-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.8rem; }
.manager-primary-link, .manager-secondary-link {
  display: inline-flex;
  min-height: 2.85rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 0.95rem;
  border-radius: 0.65rem;
  font-size: 0.8rem;
  font-weight: 850;
  text-decoration: none;
}
.manager-primary-link { border: 1px solid #176b83; background: #176b83; color: white; box-shadow: 0 0.35rem 0.8rem rgba(23, 107, 131, 0.16); }
.manager-primary-link:hover { background: #11566a; }
.manager-secondary-link { border: 1px solid #9cb7c3; background: #fff; color: #295a6e; }
.manager-secondary-link:hover { background: white; }
.priority-local-status { align-self: flex-start; margin-top: 0.55rem; background: #edf4f6; }

.manager-priority-dashboard {
  min-width: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}
.manager-priority-stats { display: grid; grid-template-columns: 0.8fr 1.2fr; border-bottom: 1px solid #d6e0e5; background: #f2f7f9; }
.manager-priority-stats > div { display: grid; align-content: start; gap: 0.24rem; padding: 0.95rem 1rem; }
.manager-priority-stats > div + div { border-left: 1px solid #d6e0e5; }
.manager-priority-stats span { color: #607987; font-size: 0.62rem; font-weight: 900; letter-spacing: 0.055em; text-transform: uppercase; }
.manager-priority-stats strong { color: #1b4b60; font-size: 0.78rem; line-height: 1.45; }
.priority-today-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 1rem 0.4rem; }
.priority-today-heading h2 { margin: 0; color: #16384b; font-size: 1.2rem; letter-spacing: -0.03em; }
.priority-today-heading time { padding-top: 0.2rem; color: #647970; font-size: 0.68rem; font-weight: 800; }
.priority-today-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; padding: 0.6rem 1rem 1rem; }
.priority-today-list:empty { display: none; }
.priority-empty { margin: 0; padding: 1.3rem 1rem 1.5rem; color: #718079; font-size: 0.77rem; text-align: center; }
.priority-empty[hidden], .priority-more[hidden] { display: none; }
.priority-more { margin: -0.45rem 1rem 1rem; color: #37697b; font-size: 0.68rem; font-weight: 800; }

.supporting-content {
  display: grid;
  gap: 0.65rem;
}

.supporting-content-label {
  margin: 0.25rem 0 0.15rem;
  color: #637985;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.explore-panel {
  overflow: clip;
  border: 1px solid #cbd8de;
  border-radius: 0.72rem;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 3px 10px rgba(26, 55, 70, 0.04);
}

.explore-panel > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  min-height: 5rem;
  padding: 0.85rem 1rem;
  color: #203d4b;
  cursor: pointer;
  list-style: none;
}

.explore-panel > summary::-webkit-details-marker { display: none; }
.explore-panel > summary:hover { background: #f4f8fa; }
.explore-panel > summary:focus-visible { outline: 3px solid rgba(23, 107, 131, 0.3); outline-offset: -3px; }

.explore-panel-icon {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  border: 1px solid #b5ccd6;
  border-radius: 0.5rem;
  background: #e9f3f6;
  color: #176b83;
  font-family: Georgia, serif;
  font-weight: 800;
}

.explore-panel-kicker { display: block; margin-bottom: 0.2rem; color: #647b87; font-size: 0.62rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.explore-panel summary strong { display: block; margin-bottom: 0.15rem; color: #173b4b; font-size: 1rem; }
.explore-panel summary small { display: block; max-width: 55rem; color: #6a7e88; font-size: 0.76rem; line-height: 1.45; }
.explore-panel-action { color: #176b83; font-size: 0.72rem; font-weight: 850; white-space: nowrap; }
.explore-panel-action::after { display: inline-block; margin-left: 0.5rem; content: "+"; font-size: 1rem; }
.explore-panel[open] > summary { border-bottom: 1px solid #cbd8de; background: #f0f6f8; }
.explore-panel[open] .explore-panel-action::after { content: "−"; }
.explore-panel-content { padding: 1rem; background: #f7fafb; }
.information-icon { border-radius: 50%; font-family: Georgia, serif; font-style: italic; }

.explore-panel .reference-hero { margin-bottom: 0.9rem; }
.explore-panel .reference-hero h2 { font-size: 1.5rem; }
.explore-panel .methodology { margin-top: 0; background: #fff; }

.reference-hero { align-items: flex-end; margin-bottom: 1rem; padding-top: 0.2rem; }
.reference-hero h2 { margin-bottom: 0.45rem; font-size: clamp(1.65rem, 3vw, 2.35rem); letter-spacing: -0.045em; }

.category-summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.category-summary h2 {
  margin-bottom: 0.45rem;
  font-size: 1.45rem;
  letter-spacing: -0.025em;
}

.category-note { max-width: 60rem; margin-bottom: 0; color: var(--muted); line-height: 1.55; }

.category-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.category-facts[hidden] { display: none; }

.category-fact {
  display: grid;
  gap: 0.12rem;
  max-width: 30rem;
  padding: 0.52rem 0.68rem;
  border: 1px solid #d8e1e9;
  border-radius: 0.58rem;
  background: #f7f9fb;
}

.category-fact span {
  color: #667085;
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.category-fact strong { color: #344054; font-size: 0.78rem; line-height: 1.4; }

.strength-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.42rem;
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.strength-legend[hidden] { display: none; }
.legend-title { color: #344054; font-weight: 800; }
.legend-note { margin-left: 0.15rem; font-style: italic; }

.legend-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.44rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 800;
}

.record-count {
  flex: 0 0 auto;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: #f0f3f7;
  color: #526174;
  font-size: 0.78rem;
  font-weight: 800;
}

.table-wrap { overflow: auto; max-height: 68vh; }

table { width: 100%; min-width: 980px; border-collapse: separate; border-spacing: 0; }

th {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 0;
  border-bottom: 1px solid #0e1728;
  background: var(--navy);
  color: white;
  text-align: left;
}

.sort-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 0.9rem;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.065em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.sort-button:hover { background: #222e45; }
.sort-indicator { color: #92a0b7; font-size: 0.75rem; }

td {
  padding: 0.82rem 0.9rem;
  border-bottom: 1px solid #e4e8ee;
  color: #344054;
  font-size: 0.82rem;
  line-height: 1.4;
  vertical-align: middle;
}

.parent-row { background: #f1f6fa; }
.parent-row:hover { background: #e8f1f8; }
.parent-row td { height: 4.15rem; }

.drug-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 15rem;
}

.item-identity {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.item-identity.compact { gap: 0.38rem; }

.form-thumbnail {
  width: 3.1rem;
  height: 2.25rem;
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid #cbd9e3;
  border-radius: 0.48rem;
  background: #edf4f8;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.form-thumbnail.compact { width: 2.45rem; height: 1.8rem; border-radius: 0.38rem; }

.identity-thumbnail {
  width: 3.1rem;
  height: 2.25rem;
  flex: 0 0 auto;
  justify-content: center;
  padding: 0.18rem;
  overflow: hidden;
  border: 1px solid #cbd9e3;
  border-radius: 0.48rem;
  background: #edf4f8;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.identity-thumbnail.compact { width: 2.45rem; height: 1.8rem; border-radius: 0.38rem; }
.identity-thumbnail .pill-face-wrap:nth-child(2), .identity-thumbnail small { display: none; }
.identity-thumbnail .pill-face { width: 2.35rem; height: 1.25rem; min-width: 0; }
.identity-thumbnail.shape-round .pill-face { width: 1.5rem; height: 1.5rem; }
.identity-thumbnail .pill-imprint { max-width: 90%; font-size: 0.33rem; }

.multi-identity-thumbnail {
  display: flex;
  width: 3.5rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
}
.multi-identity-thumbnail .identity-thumbnail { width: 2rem; margin: 0 -0.55rem; transform: scale(0.78); }
.multi-identity-thumbnail .identity-thumbnail:nth-child(2) { z-index: 2; transform: scale(0.9); }
.multi-identity-thumbnail.compact { width: 2.8rem; }

.form-thumbnail-fallback {
  display: inline-grid;
  width: 3.1rem;
  height: 2.25rem;
  flex: 0 0 auto;
  place-items: center;
  padding: 0.2rem;
  border: 1px dashed #b8c5d0;
  border-radius: 0.48rem;
  color: #748193;
  font-size: 0.52rem;
  line-height: 1.15;
  text-align: center;
}

.expand-button {
  display: inline-grid;
  width: 1.7rem;
  height: 1.7rem;
  flex: 0 0 1.7rem;
  place-items: center;
  border: 1px solid #bfd0de;
  border-radius: 50%;
  background: white;
  color: #2f658a;
  cursor: pointer;
  transition: transform 150ms ease;
}

.expand-button[aria-expanded="true"] { transform: rotate(90deg); }

.drug-name { color: #101828; font-size: 1.04rem; font-weight: 850; letter-spacing: -0.02em; }

.drug-detail-link {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: rgba(45, 111, 159, 0.42);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.drug-detail-link:hover {
  color: #0e5d91;
  text-decoration-color: currentColor;
}

.flat-drug-name {
  color: #667085;
  font-size: 0.79rem;
  font-weight: 750;
}

.class-badge {
  display: inline-flex;
  padding: 0.28rem 0.48rem;
  border-radius: 0.38rem;
  background: #dceaf4;
  color: #255b7f;
  font-size: 0.64rem;
  font-weight: 850;
  white-space: nowrap;
}

.item-resource-link {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.44rem;
  border: 1px solid #b9d7cd;
  border-radius: 999px;
  background: #eef9f5;
  color: #17624b;
  font-size: 0.63rem;
  font-weight: 850;
  line-height: 1.15;
  text-decoration: none;
  white-space: nowrap;
}

.item-resource-link:hover { border-color: #70aa96; background: #e1f4ed; color: #0e503c; }

.sub-row { display: none; background: #fff; }
.sub-row.visible { display: table-row; }
.sub-row td:first-child { padding-left: 3.3rem; color: #667085; font-weight: 700; }
.sub-row:hover { background: #fafbfc; }

.commercial-name { color: #164c71; font-weight: 850; }
.parent-name-label { color: #667085; font-size: 0.76rem; font-weight: 750; }
.muted { color: #8a94a5; }

.flat-row { background: #fff; }
.flat-row:hover { background: #f8fbfd; }

.flat-brand-cell {
  position: relative;
  padding-left: 1.15rem;
}

.flat-brand-cell::before {
  position: absolute;
  top: 0.78rem;
  bottom: 0.78rem;
  left: 0.42rem;
  width: 0.22rem;
  border-radius: 999px;
  background: #4a8bb7;
  content: "";
}

.flat-brand-name {
  display: inline-block;
  color: #123f5e;
  font-size: 1.03rem;
  font-weight: 900;
  letter-spacing: -0.018em;
  line-height: 1.18;
}

.metric {
  display: inline-flex;
  min-width: 3.5rem;
  max-width: 14rem;
  justify-content: center;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  background: #edf0f4;
  color: #5d6877;
  font-size: 0.73rem;
  font-weight: 850;
  line-height: 1.3;
  text-align: center;
}

.metric.numeric { font-variant-numeric: tabular-nums; }
.metric:not(.numeric) { border-radius: 0.5rem; }

.tone-low { border-color: #b8d9ed; background: var(--tone-low-bg); color: var(--tone-low-ink); }
.tone-below { border-color: #b9dfd0; background: #e7f5ef; color: #22634d; }
.tone-reference { border-color: #d3d8df; background: var(--tone-reference-bg); color: var(--tone-reference-ink); }
.tone-above { border-color: #f2d28f; background: #fff3d8; color: #825000; }
.tone-high { border-color: #f1b9b1; background: var(--tone-high-bg); color: var(--tone-high-ink); }
.tone-variable { border-color: #d8c5ef; background: var(--tone-variable-bg); color: var(--tone-variable-ink); }
.tone-neutral { border-color: #ccd6e1; background: #edf3f7; color: #44596c; }
.tone-unavailable { border-color: #dde1e6; background: #f4f5f7; color: #7b8492; font-weight: 750; }

.error-message { margin: 1rem 1.5rem; padding: 0.9rem 1rem; border-radius: 0.6rem; background: #fff0f0; color: #9b2c2c; }

.methodology {
  display: grid;
  grid-template-columns: minmax(13rem, 0.7fr) minmax(0, 1.8fr);
  gap: 2rem;
  margin-top: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.72);
}

.methodology h2 { margin-bottom: 0; font-size: 1.25rem; }
.methodology-copy { color: var(--muted); font-size: 0.88rem; line-height: 1.6; }
.methodology-copy p { margin-bottom: 0.7rem; }
.methodology-copy ul { margin: 0 0 0.9rem; padding-left: 1.2rem; }
.methodology-copy li + li { margin-top: 0.35rem; }
.source-links { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.source-links a { color: #1e5f8b; font-weight: 750; }

.drug-modal {
  width: min(760px, calc(100% - 1.5rem));
  max-width: none;
  max-height: min(88vh, 860px);
  padding: 0;
  overflow: hidden;
  border: 1px solid #cfd8e2;
  border-radius: 1rem;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 85px rgba(10, 20, 35, 0.3);
}

.drug-modal::backdrop { background: rgba(15, 23, 42, 0.62); backdrop-filter: blur(3px); }
.drug-modal[open] { animation: modal-in 150ms ease-out; }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(0.5rem) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-shell { display: grid; grid-template-rows: auto minmax(0, 1fr); max-height: min(88vh, 860px); }

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #f5f8fa;
}

.modal-header h2 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.05rem); letter-spacing: -0.035em; }

.modal-close {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  flex: 0 0 2.4rem;
  place-items: center;
  border: 1px solid #c8d3de;
  border-radius: 50%;
  background: white;
  color: #425266;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover { border-color: #7da9c8; background: var(--blue-soft); color: #174d72; }
.modal-scroll { overflow-y: auto; overscroll-behavior: contain; padding: 1.25rem; }
.modal-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem; margin-bottom: 0.85rem; }
.modal-meta-text { color: #667085; font-size: 0.74rem; font-weight: 800; }
.modal-summary { margin-bottom: 1rem; color: #344054; font-size: 1rem; line-height: 1.62; }
.modal-identity-section,
.modal-media-section {
  margin-bottom: 1rem;
  padding: 0.9rem;
  border: 1px solid #cedde7;
  border-radius: 0.8rem;
  background: #f3f8fb;
}

.modal-identity-section { border-color: #c8d8c5; background: #f4f8f1; }
.modal-identity-section[hidden],
.modal-media-section[hidden] { display: none; }

.pill-identity-card {
  display: grid;
  grid-template-columns: minmax(15rem, 0.95fr) minmax(16rem, 1.05fr);
  gap: 1rem;
  align-items: start;
}

.pill-gallery-guidance { margin: 0 0 0.8rem; color: #536453; font-size: 0.74rem; line-height: 1.55; }
.pill-identity-gallery { display: grid; gap: 0.85rem; }
.pill-identity-gallery .pill-identity-card { padding: 0.8rem; border: 1px solid #d4dfd1; border-radius: 0.72rem; background: rgba(255, 255, 255, 0.72); }

.pill-visual-column { min-width: 0; }
.pill-identity-visual {
  --pill-fill: #e4e6e8;
  position: relative;
  display: flex;
  min-height: 8.5rem;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0.65rem 1.6rem;
  border: 1px solid #d3ddd0;
  border-radius: 0.72rem;
  background: linear-gradient(145deg, #fff, #eef3eb);
}

.pill-face-wrap { display: grid; justify-items: center; gap: 0.42rem; }
.pill-face-wrap small { color: #71806f; font-size: 0.61rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }

.pill-face {
  position: relative;
  display: grid;
  width: 6.2rem;
  height: 3.25rem;
  min-width: 3.25rem;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(47, 58, 49, 0.38);
  border-radius: 48% / 42%;
  background: var(--pill-fill);
  box-shadow: inset 0 0.3rem 0.55rem rgba(255, 255, 255, 0.48), inset 0 -0.25rem 0.45rem rgba(35, 45, 37, 0.12), 0 0.45rem 0.8rem rgba(39, 53, 43, 0.14);
}

.shape-round .pill-face { width: 4.45rem; height: 4.45rem; border-radius: 50%; }
.shape-oval .pill-face { width: 6.1rem; height: 3.65rem; border-radius: 50%; }
.shape-oblong .pill-face { width: 6.7rem; height: 3rem; border-radius: 1.4rem; }
.shape-capsule .pill-face { width: 6.8rem; height: 2.95rem; border-radius: 1.55rem; }
.shape-square .pill-face { width: 4.5rem; height: 4.5rem; border-radius: 0.75rem; }
.shape-rectangle .pill-face { width: 6rem; height: 3.55rem; border-radius: 0.6rem; }
.shape-diamond .pill-face { width: 4.3rem; height: 4.3rem; border-radius: 0.55rem; transform: rotate(45deg); }
.shape-diamond .pill-imprint, .shape-diamond .pill-score { transform: rotate(-45deg); }
.shape-almond .pill-face { width: 6rem; height: 3.1rem; border-radius: 75% 35% 75% 35% / 70% 35% 70% 35%; }

.pill-imprint {
  position: relative;
  z-index: 2;
  max-width: 84%;
  color: rgba(37, 44, 39, 0.78);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.015em;
  line-height: 1.08;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.pill-score { position: absolute; z-index: 1; width: 1px; height: 84%; background: rgba(39, 47, 41, 0.36); }
.pill-score.multiple::after { position: absolute; width: 3.2rem; height: 1px; top: 50%; left: 50%; background: rgba(39, 47, 41, 0.36); content: ""; transform: translate(-50%, -50%); }
.pill-size-scale { position: absolute; bottom: 0.5rem; left: 50%; color: #637260; font-size: 0.61rem; font-weight: 800; transform: translateX(-50%); }
.pill-size-scale::before { display: inline-block; width: 2.5rem; margin-right: 0.35rem; border-top: 1px solid #778573; content: ""; vertical-align: middle; }

.pill-identity-metadata {
  display: grid;
  grid-template-columns: minmax(7rem, 0.7fr) minmax(8rem, 1.3fr);
  margin: 0;
  overflow: hidden;
  border: 1px solid #d3ddd0;
  border-radius: 0.68rem;
  background: white;
}

.pill-identity-metadata dt,
.pill-identity-metadata dd { margin: 0; padding: 0.48rem 0.6rem; border-bottom: 1px solid #e3e9e0; font-size: 0.7rem; line-height: 1.35; }
.pill-identity-metadata dt { color: #61705f; font-weight: 850; }
.pill-identity-metadata dd { color: #344432; overflow-wrap: anywhere; }
.pill-identity-metadata dt:nth-last-of-type(1), .pill-identity-metadata dd:last-child { border-bottom: 0; }
.pill-identity-note { margin: 0.55rem 0 0; color: #6e5a3e; font-size: 0.66rem; font-weight: 700; line-height: 1.45; }
.pill-identity-source { margin: 0.65rem 0 0; color: #687665; font-size: 0.66rem; line-height: 1.45; }
.pill-identity-source a, .identity-notice a { color: #2d6b55; font-weight: 800; }

.identity-notice { padding: 0.85rem 0.95rem; border: 1px solid #d7decf; border-radius: 0.7rem; background: white; }
.identity-notice strong { color: #40503d; font-size: 0.82rem; }
.identity-notice p { margin: 0.38rem 0 0.48rem; color: #5e6b5b; font-size: 0.75rem; line-height: 1.5; }
.identity-not-applicable { border-color: #e1d4bd; background: #fffaf1; }

.modal-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.modal-section-heading h3 {
  margin: 0;
  color: #344054;
  font-size: 0.72rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.modal-section-heading span { color: #8a5b1f; font-size: 0.66rem; font-weight: 850; }

.modal-media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.65rem;
}

.modal-media-card {
  overflow: hidden;
  margin: 0;
  border: 1px solid #d6e0e7;
  border-radius: 0.65rem;
  background: white;
}

.modal-media-card img,
.modal-media-fallback {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: #edf3f7;
}

.modal-media-fallback {
  place-content: center;
  padding: 1rem;
  color: #748193;
  font-size: 0.72rem;
  text-align: center;
}

.modal-media-card figcaption { display: grid; gap: 0.18rem; padding: 0.58rem 0.65rem 0.68rem; }
.modal-media-card figcaption strong { color: #24364a; font-size: 0.76rem; }
.modal-media-card figcaption span { color: #697689; font-size: 0.66rem; line-height: 1.4; }

.modal-media-caveat {
  margin: 0.65rem 0 0;
  color: #6e5a3e;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.45;
}
.modal-pro-con-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }

.modal-list, .modal-context {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: #f8fafb;
}

.modal-list h3, .modal-context h3 {
  margin: 0 0 0.5rem;
  color: #344054;
  font-size: 0.72rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.modal-list ul, .modal-name-list { margin: 0; padding-left: 1.1rem; }
.modal-list li, .modal-name-list li { color: #526174; font-size: 0.82rem; line-height: 1.52; }
.modal-list li + li, .modal-name-list li + li { margin-top: 0.38rem; }
.modal-pros { border-color: #b9dfd0; background: #f1faf6; }
.modal-cons { border-color: #efcbc5; background: #fff7f5; }
.modal-context { margin-top: 0.8rem; }
.modal-context p { margin: 0; color: #526174; font-size: 0.84rem; line-height: 1.55; }
.modal-disclaimer { margin: 0.9rem 0 0; color: #7b8492; font-size: 0.72rem; font-style: italic; line-height: 1.5; }

.modal-resource-section {
  margin-top: 0.8rem;
  padding: 0.9rem 1rem;
  border: 1px solid #b9d7cd;
  border-radius: 0.75rem;
  background: #eef9f5;
}

.modal-resource-section[hidden] { display: none; }
.modal-resource-section > h3 { margin: 0 0 0.6rem; color: #245947; font-size: 0.72rem; letter-spacing: 0.055em; text-transform: uppercase; }
.modal-resource-list { display: grid; gap: 0.7rem; }
.modal-resource-card h4 { margin: 0 0 0.35rem; color: #183f33; font-size: 0.92rem; }
.modal-resource-card p { margin: 0; color: #3e6659; font-size: 0.8rem; line-height: 1.52; }
.modal-resource-links { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.55rem; }
.modal-resource-links a { padding: 0.38rem 0.55rem; border: 1px solid #84b6a5; border-radius: 0.45rem; background: white; color: #17624b; font-size: 0.72rem; font-weight: 850; text-decoration: none; }
.modal-resource-links a:hover { border-color: #4b9279; background: #e5f5ef; }
.modal-resource-card .modal-resource-caution { margin-top: 0.6rem; color: #754e14; font-size: 0.73rem; font-weight: 750; }

.guide-page { max-width: 1240px; }
.guide-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 1.2rem; }

.guide-intro {
  display: grid;
  grid-template-columns: minmax(13rem, 0.65fr) minmax(0, 1.7fr);
  gap: 1.5rem;
  margin-bottom: 1rem;
  padding: 1.2rem 1.3rem;
  border: 1px solid #c9d9e5;
  border-left: 0.42rem solid var(--blue);
  border-radius: 0.85rem;
  background: #f2f8fc;
}

.guide-intro h2 { margin: 0; font-size: 1.18rem; }
.guide-intro > p { margin: 0; color: #526174; line-height: 1.62; }
.category-guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }

.category-guide-card {
  display: flex;
  flex-direction: column;
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--paper);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.055);
}

.category-guide-card > header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.65rem; padding-bottom: 0.8rem; border-bottom: 1px solid #e5e9ee; }
.category-guide-card h2 { margin: 0; font-size: 1.22rem; letter-spacing: -0.025em; }
.guide-number { color: #8ca0b4; font-size: 0.68rem; font-weight: 900; letter-spacing: 0.08em; }
.guide-card-count { padding: 0.3rem 0.45rem; border-radius: 999px; background: #eef2f5; color: #667085; font-size: 0.66rem; font-weight: 850; }
.category-guide-card h3 { margin: 0 0 0.38rem; color: #526174; font-size: 0.68rem; letter-spacing: 0.055em; text-transform: uppercase; }
.category-guide-card p { margin: 0; color: #526174; font-size: 0.84rem; line-height: 1.58; }
.guide-purpose { margin-top: 0.9rem; }
.guide-purpose p { color: #25364a; font-size: 0.9rem; font-weight: 700; }
.guide-purpose + div { margin-top: 0.75rem; }
.guide-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 0.9rem; }
.guide-detail-grid section { padding: 0.75rem; border-radius: 0.65rem; background: #f6f8fa; }
.guide-detail-grid ul { margin: 0; padding-left: 1.05rem; color: #58677a; font-size: 0.76rem; line-height: 1.5; }
.guide-detail-grid li + li { margin-top: 0.28rem; }
.guide-detail-grid .guide-considerations { background: #fff8ee; }

.guide-catalog-link {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 1rem;
  color: #1e5f8b;
  font-size: 0.78rem;
  font-weight: 850;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.guide-methodology { margin-top: 1rem; }

.mix-page { max-width: 1240px; }

.mix-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.3rem;
}

.mix-count {
  flex: 0 0 auto;
  padding: 0.55rem 0.78rem;
  border-radius: 999px;
  background: #e8edf3;
  color: #526174;
  font-size: 0.78rem;
  font-weight: 850;
}

.emergency-notice {
  display: grid;
  grid-template-columns: minmax(12rem, 0.55fr) minmax(0, 1.8fr);
  gap: 1.5rem;
  margin-bottom: 1rem;
  padding: 1.2rem 1.3rem;
  border: 1px solid #efb0aa;
  border-left: 0.42rem solid #b43a31;
  border-radius: 0.85rem;
  background: #fff1ef;
}

.emergency-notice h2 { margin-bottom: 0; color: #8e2e28; font-size: 1.18rem; }
.emergency-notice p:last-child { margin: 0; color: #653d39; line-height: 1.58; }

.interaction-builder {
  margin-bottom: 1.25rem;
  overflow: hidden;
  border: 1px solid #cbd8e3;
  border-radius: 1rem;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.builder-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.3rem;
  border-bottom: 1px solid var(--line);
  background: #f4f8fb;
}

.builder-heading h2 { margin-bottom: 0.4rem; font-size: 1.4rem; letter-spacing: -0.025em; }
.builder-heading p:last-child { max-width: 51rem; margin: 0; color: #58677a; font-size: 0.84rem; line-height: 1.55; }
.builder-heading .control-button { flex: 0 0 auto; }

.interaction-workspace {
  display: grid;
  grid-template-columns: minmax(19rem, 1.15fr) minmax(15rem, 0.85fr);
  min-height: 25rem;
}

.drug-picker { padding: 1rem; border-right: 1px solid var(--line); }
.drug-picker .search-field input { min-height: 2.8rem; }

.picker-status, .selection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.65rem 0 0.45rem;
  color: #697689;
  font-size: 0.68rem;
}

.picker-status strong { color: #3e4d60; }

.drug-options {
  display: grid;
  gap: 0.35rem;
  max-height: 20rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.25rem 0.25rem 0.25rem 0;
}

.drug-option {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.65rem;
  padding: 0.62rem 0.7rem;
  border: 1px solid #d9e0e7;
  border-radius: 0.62rem;
  background: #fafbfc;
  cursor: pointer;
}

.drug-option:hover { border-color: #9ebcd2; background: #f2f8fc; }
.drug-option.selected { border-color: #5e9ac1; background: #eaf4fb; box-shadow: inset 0 0 0 1px #b8d7eb; }
.drug-option:has(input:disabled) { cursor: not-allowed; opacity: 0.52; }
.drug-option input { width: 1rem; height: 1rem; margin: 0; accent-color: #2d6f9f; }
.drug-option > span { display: grid; gap: 0.12rem; min-width: 0; }
.drug-option strong { color: #26364a; font-size: 0.82rem; }
.drug-option small { overflow: hidden; color: #758193; font-size: 0.65rem; text-overflow: ellipsis; white-space: nowrap; }
.picker-empty { margin: 0; padding: 1.5rem 0.8rem; color: var(--muted); font-size: 0.8rem; text-align: center; }

.selection-panel { padding: 1rem; background: #fbfcfd; }
.selection-heading { margin-top: 0; }
.selection-heading h3 { margin: 0; color: #344054; font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; }
.selection-heading span { font-weight: 850; }
.selected-drugs { display: grid; gap: 0.48rem; }

.selected-drug {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.62rem 0.65rem 0.62rem 0.78rem;
  border: 1px solid #bdd2e1;
  border-radius: 0.62rem;
  background: white;
}

.selected-drug > span { display: grid; gap: 0.1rem; }
.selected-drug strong { color: #173f5c; font-size: 0.82rem; }
.selected-drug small { color: #758193; font-size: 0.64rem; }
.selected-drug button {
  display: grid;
  width: 1.7rem;
  height: 1.7rem;
  flex: 0 0 1.7rem;
  place-items: center;
  border: 1px solid #d2d9e1;
  border-radius: 50%;
  background: #f7f8fa;
  color: #667085;
  cursor: pointer;
}
.selected-drug button:hover { border-color: #d49c96; background: #fff1ef; color: #902b24; }
.selection-empty { margin: 1rem 0 0; padding: 1rem; border: 1px dashed #cbd4de; border-radius: 0.65rem; color: #758193; font-size: 0.78rem; line-height: 1.5; text-align: center; }
.selection-empty[hidden] { display: none; }

.interaction-analysis { padding: 1rem; border-top: 1px solid var(--line); background: #f7f9fb; }
.interaction-analysis[hidden] { display: none; }

.analysis-status {
  padding: 0.9rem 1rem;
  border: 1px solid #d7dde4;
  border-left-width: 0.42rem;
  border-radius: 0.68rem;
  background: white;
}
.analysis-status h3 { margin: 0 0 0.25rem; font-size: 1.02rem; }
.analysis-status p { margin: 0; color: #58677a; font-size: 0.78rem; line-height: 1.5; }
.analysis-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.45rem; margin-top: 0.75rem; }
.analysis-stats > span { display: grid; gap: 0.12rem; padding: 0.5rem 0.58rem; border: 1px solid rgb(86 103 122 / 18%); border-radius: 0.5rem; background: rgb(255 255 255 / 62%); }
.analysis-stats small { color: #697689; font-size: 0.58rem; font-weight: 800; letter-spacing: 0.035em; text-transform: uppercase; }
.analysis-stats strong { color: #344054; font-size: 0.76rem; }
.status-critical { border-color: #e8aaa4; border-left-color: #b43a31; background: #fff4f2; }
.status-critical h3 { color: #8e2e28; }
.status-very-high { border-color: #efd09a; border-left-color: #c77b00; background: #fff9ec; }
.status-very-high h3 { color: #7b4a00; }
.status-high { border-color: #d8c5ef; border-left-color: #7952b3; background: #faf7fe; }
.status-high h3 { color: #604092; }
.status-unmatched { border-color: #cbd4de; border-left-color: #778597; background: #f7f9fb; }
.status-unmatched h3 { color: #46566a; }

.coverage-note { margin: 0.65rem 0 0.85rem; color: #654f23; font-size: 0.75rem; font-weight: 750; line-height: 1.45; }
.pair-results { display: grid; gap: 0.8rem; }
.pair-analysis { overflow: hidden; border: 1px solid #d9e0e7; border-radius: 0.78rem; background: white; }
.pair-analysis > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; padding: 0.78rem; border-bottom: 1px solid #e3e8ed; background: #f5f7f9; }
.pair-names { display: flex; flex-wrap: wrap; align-items: center; gap: 0.38rem; }

.analysis-drug-chip { display: grid; gap: 0.05rem; padding: 0.35rem 0.48rem; border: 1px solid #cbd8e3; border-radius: 0.48rem; background: white; }
.analysis-drug-chip strong { color: #173f5c; font-size: 0.75rem; }
.analysis-drug-chip small { color: #7b8795; font-size: 0.57rem; }
.risk-unmatched { border-color: #d1d7df; background: #edf0f4; color: #5f6a79; }
.risk-caution { border-color: #c8d9e7; background: #eef5fa; color: #315d7c; }

.rule-result { padding: 0.9rem; }
.rule-result + .rule-result { border-top: 1px solid #e1e6eb; }
.rule-result > h4, .unmatched-copy h4 { margin: 0 0 0.35rem; color: #2c3b4e; font-size: 0.9rem; }
.rule-interaction, .unmatched-copy p { margin: 0; color: #58677a; font-size: 0.77rem; line-height: 1.55; }
.rule-onset { margin: 0.55rem 0 0; padding: 0.52rem 0.62rem; border-left: 0.22rem solid #83abc7; border-radius: 0 0.42rem 0.42rem 0; background: #f1f7fb; color: #536579; font-size: 0.7rem; line-height: 1.5; }
.rule-onset strong { color: #315d7c; }
.rule-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.55rem; margin-top: 0.75rem; }
.rule-list { padding: 0.7rem; border-radius: 0.58rem; background: #f6f8fa; }
.rule-list.mechanism { background: #eef5fa; }
.rule-list.amplifier { background: #faf6eb; }
.rule-list.warning { background: #fff6ee; }
.rule-list.response { background: #edf7f1; }
.rule-list h5 { margin: 0 0 0.35rem; color: #4a596c; font-size: 0.64rem; letter-spacing: 0.045em; text-transform: uppercase; }
.rule-list ul { margin: 0; padding-left: 1rem; color: #5c6878; font-size: 0.69rem; line-height: 1.45; }
.rule-list li + li { margin-top: 0.2rem; }
.rule-sources { margin: 0.65rem 0 0; color: #7a8594; font-size: 0.63rem; line-height: 1.45; }
.rule-sources a { color: #28658e; font-weight: 750; }
.unmatched-copy { padding: 0.9rem; }

.global-guidance { overflow: hidden; border: 1px solid #cbd8e3; border-radius: 0.78rem; background: white; }
.global-guidance summary { padding: 0.78rem 0.9rem; background: #edf4f8; color: #244d69; font-size: 0.8rem; font-weight: 850; cursor: pointer; }
.global-guidance > p { margin: 0; padding: 0.8rem 0.9rem 0; color: #58677a; font-size: 0.73rem; line-height: 1.55; }
.global-guidance-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; padding: 0.8rem 0.9rem 0.9rem; }

.browse-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin: 1.4rem 0 0.8rem; }
.browse-heading h2 { margin: 0; font-size: 1.3rem; }
.browse-heading > p { max-width: 36rem; margin: 0; color: var(--muted); font-size: 0.78rem; line-height: 1.5; }

.mix-controls {
  display: grid;
  grid-template-columns: minmax(15rem, 0.7fr) minmax(0, 1.6fr);
  gap: 1rem;
  margin-bottom: 0.8rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--paper);
}

.search-field { display: grid; gap: 0.38rem; }
.search-field span, .filter-label { color: #526174; font-size: 0.7rem; font-weight: 850; letter-spacing: 0.045em; text-transform: uppercase; }

.search-field input {
  width: 100%;
  min-height: 2.55rem;
  padding: 0.6rem 0.72rem;
  border: 1px solid #cbd3de;
  border-radius: 0.55rem;
  background: white;
  color: var(--ink);
}

.filter-buttons { display: flex; flex-wrap: wrap; gap: 0.42rem; margin-top: 0.38rem; }

.filter-button {
  padding: 0.45rem 0.62rem;
  border: 1px solid #cbd3de;
  border-radius: 999px;
  background: #f7f9fb;
  color: #526174;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.filter-button:hover, .filter-button.active { border-color: #7da9c8; background: var(--blue-soft); color: #174d72; }

.mix-caveat {
  margin: 0 0 1rem;
  padding: 0.72rem 0.9rem;
  border-radius: 0.65rem;
  background: #fff7df;
  color: #684f0c;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.5;
}

.combination-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }

.combination-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--paper);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.055);
}

.combination-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 1rem;
  border-bottom: 1px solid #e2e7ed;
  background: #f6f8fa;
}

.substance-pair { display: flex; flex-wrap: wrap; align-items: center; gap: 0.42rem; }

.substance-chip {
  display: grid;
  gap: 0.1rem;
  padding: 0.42rem 0.55rem;
  border: 1px solid #c9d9e5;
  border-radius: 0.55rem;
  background: white;
}

.substance-chip strong { color: #173f5c; font-size: 0.83rem; }
.substance-chip small { color: #758193; font-size: 0.61rem; font-weight: 750; }
.pair-plus { color: #7a8798; font-size: 1rem; font-weight: 900; }

.risk-tier {
  flex: 0 0 auto;
  padding: 0.33rem 0.48rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 900;
  white-space: nowrap;
}

.risk-critical { border-color: #e8aaa4; background: #fee7e3; color: #902b24; }
.risk-very-high { border-color: #efd09a; background: #fff1d2; color: #7b4a00; }
.risk-high { border-color: #d8c5ef; background: #efe8fa; color: #6941a5; }

.interaction-summary {
  margin: 0;
  padding: 1rem 1rem 0.45rem;
  color: #26364a;
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.52;
}

.mix-context { margin: 0; padding: 0 1rem 0.9rem; color: var(--muted); font-size: 0.78rem; line-height: 1.5; }

.mix-detail-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid #e7ebf0; }
.mix-detail { padding: 0.85rem 1rem; }
.mix-detail + .mix-detail { border-left: 1px solid #e7ebf0; }
.mix-detail h2 { margin-bottom: 0.45rem; color: #344054; font-size: 0.72rem; letter-spacing: 0.045em; text-transform: uppercase; }
.mix-detail ul { margin: 0; padding-left: 1.05rem; color: #58677a; font-size: 0.75rem; line-height: 1.5; }
.mix-detail li + li { margin-top: 0.25rem; }
.warning-list { background: #fffaf2; }

.card-sources { margin: 0; padding: 0.7rem 1rem; border-top: 1px solid #e7ebf0; color: #7a8594; font-size: 0.66rem; line-height: 1.45; }
.card-sources a { color: #28658e; font-weight: 750; }

.empty-state { padding: 2rem; border: 1px dashed #c7d0da; border-radius: 0.8rem; background: white; color: var(--muted); text-align: center; }

.manager-page { max-width: 1240px; }
.manager-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 1.25rem; }
.local-status { flex: 0 0 auto; padding: 0.55rem 0.72rem; border: 1px solid #abd1c2; border-radius: 999px; background: #eaf7f1; color: #2b6c57; font-size: 0.72rem; font-weight: 850; }
.local-status span { margin-right: 0.25rem; color: #3b9c76; }

.manager-safety {
  display: grid;
  grid-template-columns: minmax(15rem, 0.75fr) minmax(0, 1.5fr);
  gap: 1.5rem;
  margin-bottom: 0.85rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid #e4c889;
  border-left: 0.42rem solid #b77c18;
  border-radius: 0.85rem;
  background: #fff9e9;
}

.manager-safety h2 { margin: 0; color: #6f4b10; font-size: 1.08rem; line-height: 1.3; }
.manager-safety > p { margin: 0; color: #69583a; font-size: 0.82rem; line-height: 1.6; }

.manager-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(8rem, 0.5fr)) minmax(14rem, 1.3fr);
  margin-bottom: 0.85rem;
  overflow: hidden;
  border: 1px solid #cddbd6;
  border-radius: 0.85rem;
  background: white;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.045);
}

.manager-overview > div { display: grid; gap: 0.2rem; padding: 0.85rem 1rem; }
.manager-overview > div + div { border-left: 1px solid #dce5e1; }
.manager-overview span { color: #6a7d76; font-size: 0.65rem; font-weight: 850; letter-spacing: 0.04em; text-transform: uppercase; }
.manager-overview strong { color: #234a3d; font-size: 1.25rem; }
.manager-overview .manager-next-summary strong { font-size: 0.86rem; line-height: 1.45; }

.medication-workspace { display: grid; grid-template-columns: minmax(20rem, 0.88fr) minmax(22rem, 1.12fr); gap: 0.85rem; align-items: start; }
.medication-editor, .medication-plan, .upcoming-card, .today-card { border: 1px solid var(--line); border-radius: 0.95rem; background: white; box-shadow: var(--shadow); }
.medication-editor, .medication-plan { overflow: hidden; }

.today-card { margin-bottom: 0.85rem; overflow: hidden; border-color: #a9cfc1; }
.today-heading { background: linear-gradient(110deg, #edf8f3, #f7fbf9); }
.today-heading time { color: #557269; font-size: 0.72rem; font-weight: 800; }
.today-doses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.58rem; padding: 0.9rem; }
.today-dose { display: grid; grid-template-columns: auto 1fr; gap: 0.28rem 0.62rem; align-items: center; padding: 0.72rem; border: 1px solid #cbdcd5; border-left: 0.32rem solid #2f8064; border-radius: 0.66rem; background: #fbfdfc; }
.today-dose.is-earlier { border-left-color: #9aa8a3; background: #f6f8f7; opacity: 0.82; }
.today-dose-status { grid-column: 1 / -1; color: #2c7159; font-size: 0.58rem; font-weight: 900; letter-spacing: 0.05em; text-transform: uppercase; }
.today-dose.is-earlier .today-dose-status { color: #6f7d78; }
.today-dose time { color: #173f33; font-size: 1rem; font-weight: 900; }
.today-dose > div { display: grid; gap: 0.08rem; }
.today-dose > div strong { color: #234a3d; font-size: 0.82rem; }
.today-dose > div span { color: #667a72; font-size: 0.68rem; font-weight: 750; }
.today-reminder-badge { grid-column: 1 / -1; width: fit-content; padding: 0.18rem 0.38rem; border-radius: 999px; background: #e8f2fb; color: #285f87; font-size: 0.57rem; font-weight: 850; }
.today-as-directed { display: flex; align-items: flex-start; gap: 0.8rem; padding: 0.72rem 0.9rem; border-top: 1px solid #e0e8e5; background: #fafcfb; }
.today-as-directed[hidden] { display: none; }
.today-as-directed > strong { flex: 0 0 auto; color: #5f706a; font-size: 0.68rem; }
.today-as-directed > div { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.today-as-directed > div span { padding: 0.23rem 0.42rem; border: 1px solid #d4dfdb; border-radius: 999px; background: white; color: #586b64; font-size: 0.63rem; }

.manager-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); background: #f5f8f7; }
.manager-section-heading h2 { margin: 0; font-size: 1.25rem; letter-spacing: -0.025em; }
.manager-section-heading > span, .editor-mode { color: #6b7d76; font-size: 0.68rem; font-weight: 800; }
.editor-mode { padding: 0.32rem 0.5rem; border: 1px solid #c8d9d2; border-radius: 999px; background: white; }

#medicationForm { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; padding: 1.05rem 1.1rem 1.15rem; }
.manager-field { display: grid; align-content: start; gap: 0.35rem; min-width: 0; }
.manager-field-wide, .dose-fieldset, .weekday-fields, .time-fields, .interval-fields, .text-reminder-fields, .form-error, .form-actions { grid-column: 1 / -1; }
.manager-field > span, .manager-field > label, .field-legend, .weekday-fields legend, .time-fields legend { color: #485b54; font-size: 0.68rem; font-weight: 850; letter-spacing: 0.035em; text-transform: uppercase; }
.manager-field span em { color: #84918c; font-style: normal; font-weight: 650; text-transform: none; }
.manager-field small { color: #7a8883; font-size: 0.65rem; line-height: 1.4; }
.manager-field input, .manager-field select, .manager-field textarea, .dose-time-input {
  width: 100%;
  min-height: 2.55rem;
  padding: 0.58rem 0.68rem;
  border: 1px solid #c5d1cc;
  border-radius: 0.55rem;
  background: white;
  color: var(--ink);
}
.manager-field textarea { min-height: 4.7rem; resize: vertical; line-height: 1.45; }
.manager-field input:focus, .manager-field select:focus, .manager-field textarea:focus, .dose-time-input:focus { border-color: #4f9078; outline: 3px solid rgba(65, 143, 113, 0.16); }

.medication-name-field { position: relative; z-index: 4; container-type: inline-size; }
.medication-autocomplete { position: absolute; top: calc(100% + 0.35rem); right: 0; left: 0; z-index: 20; overflow: hidden; border: 1px solid #aebfb8; border-radius: 0.72rem; background: white; box-shadow: 0 14px 30px rgba(27, 55, 45, 0.18); }
.medication-autocomplete[hidden] { display: none; }
.medication-autocomplete-heading { display: flex; justify-content: space-between; gap: 0.8rem; padding: 0.58rem 0.68rem; border-bottom: 1px solid #dce5e1; background: #f3f8f6; }
.medication-autocomplete-heading strong { color: #35574b; font-size: 0.68rem; }
.medication-autocomplete-heading span { color: #718079; font-size: 0.62rem; font-weight: 750; }
.medication-suggestions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.42rem; max-height: 19rem; overflow-y: auto; padding: 0.5rem; }
.medication-suggestion { display: grid; gap: 0.16rem; min-width: 0; padding: 0.55rem 0.6rem; border: 1px solid #d7e1dd; border-radius: 0.52rem; background: #fbfdfc; color: #2e4d42; text-align: left; cursor: pointer; }
.medication-suggestion strong { overflow: hidden; font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.medication-suggestion span { overflow: hidden; color: #718079; font-size: 0.59rem; font-weight: 650; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.medication-suggestion:hover, .medication-suggestion.is-active { border-color: #4f9078; background: #eaf6f1; outline: 2px solid rgba(65, 143, 113, 0.13); }
.medication-suggestion-empty { margin: 0; padding: 0.85rem; color: #6c7d76; font-size: 0.7rem; line-height: 1.45; }
.medication-suggestion-empty[hidden], .medication-suggestions[hidden] { display: none; }
@container (max-width: 36rem) { .medication-suggestions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 25rem) { .medication-suggestions { grid-template-columns: 1fr; } }

.dose-fieldset { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 0; padding: 0.8rem; border: 1px solid #d7e1dd; border-radius: 0.68rem; background: #f8faf9; }
.dose-fieldset .field-legend { grid-column: 1 / -1; }
.custom-dose-field[hidden] { display: none; }
.weekday-fields, .time-fields { margin: 0; padding: 0.8rem; border: 1px solid #d7e1dd; border-radius: 0.68rem; }
.weekday-fields[hidden], .time-fields[hidden], .interval-fields[hidden], #dailyFrequencyField[hidden] { display: none; }
.weekday-fields legend, .time-fields legend { padding: 0 0.3rem; }
.weekday-options { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.32rem; }
.weekday-options label { display: grid; justify-items: center; gap: 0.3rem; padding: 0.42rem 0.2rem; border: 1px solid #d4ddd9; border-radius: 0.45rem; background: #f8faf9; color: #52665e; font-size: 0.64rem; font-weight: 800; cursor: pointer; }
.weekday-options input { width: 1rem; height: 1rem; margin: 0; accent-color: #34785f; }
.time-field-help { margin: 0 0 0.55rem; color: #75847f; font-size: 0.66rem; line-height: 1.45; }
.time-input-list { display: grid; gap: 0.5rem; margin-bottom: 0.55rem; }
.time-input-row { display: grid; grid-template-columns: 1fr auto; gap: 0.45rem; align-items: end; }
.time-input-label { display: grid; gap: 0.28rem; }
.time-slot-label { color: #52665e; font-size: 0.64rem; font-weight: 850; }
.time-input-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.4rem; }
.time-picker-button { min-height: 2.55rem; padding: 0.52rem 0.65rem; border: 1px solid #a7c6ba; border-radius: 0.55rem; background: #eef8f4; color: #27634f; font-size: 0.67rem; font-weight: 850; cursor: pointer; white-space: nowrap; }
.time-picker-button:hover, .time-picker-button:focus-visible { border-color: #4f9078; background: #e1f2eb; outline: 3px solid rgba(65, 143, 113, 0.14); }
.remove-time-button { width: 2.55rem; min-height: 2.55rem; border: 1px solid #d6cbc8; border-radius: 0.55rem; background: #fff8f6; color: #91463e; font-size: 1.15rem; cursor: pointer; }
.remove-time-button[hidden], #addTimeButton[hidden] { display: none; }
.secondary-action { padding: 0.45rem 0.62rem; border: 1px solid #a7c6ba; border-radius: 0.5rem; background: #eef8f4; color: #27634f; font-size: 0.7rem; font-weight: 850; cursor: pointer; }
.interval-fields { display: grid; grid-template-columns: 0.7fr 1.3fr; gap: 0.75rem; }
.input-suffix { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.5rem; }
.input-suffix em { color: #677871; font-size: 0.75rem; font-style: normal; }
.form-actions { display: flex; gap: 0.55rem; padding-top: 0.2rem; }
.primary-action { min-height: 2.65rem; padding: 0.65rem 1rem; border: 1px solid #226c54; border-radius: 0.62rem; background: #226c54; color: white; font-size: 0.8rem; font-weight: 850; cursor: pointer; }
.primary-action:hover { background: #18523f; }
.form-error { margin: 0; padding: 0.62rem 0.7rem; border: 1px solid #e2aaa4; border-radius: 0.52rem; background: #fff3f1; color: #8e2e28; font-size: 0.75rem; font-weight: 750; line-height: 1.45; }
.form-error[hidden] { display: none; }
.text-danger-button { border: 0; background: transparent; color: #9a3e36; font-size: 0.7rem; font-weight: 850; cursor: pointer; }
.text-danger-button:disabled { color: #a8b0ad; cursor: default; }

.text-reminder-fields { margin: 0; padding: 0.85rem; border: 1px solid #c9d9e5; border-radius: 0.72rem; background: #f6fafe; }
.text-reminder-fields legend { padding: 0 0.3rem; color: #365d79; font-size: 0.68rem; font-weight: 900; letter-spacing: 0.035em; text-transform: uppercase; }
.text-reminder-fields legend span { color: #778b99; font-weight: 700; text-transform: none; }
.reminder-toggle { display: grid; grid-template-columns: auto 1fr; gap: 0.62rem; align-items: start; cursor: pointer; }
.reminder-toggle input, .reminder-consent input { width: 1rem; height: 1rem; margin: 0.15rem 0 0; accent-color: #2d6f9f; }
.reminder-toggle > span { display: grid; gap: 0.12rem; }
.reminder-toggle strong { color: #254d68; font-size: 0.78rem; }
.reminder-toggle small { color: #6d8290; font-size: 0.64rem; line-height: 1.4; }
.text-reminder-details { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid #d8e4ec; }
.text-reminder-details[hidden] { display: none; }
.reminder-consent { display: grid; grid-template-columns: auto 1fr; grid-column: 1 / -1; gap: 0.55rem; color: #586e7d; font-size: 0.67rem; line-height: 1.45; cursor: pointer; }
.sms-integration-status { margin: 0.7rem 0 0; padding: 0.5rem 0.62rem; border-radius: 0.48rem; background: #eaf1f6; color: #536d7f; font-size: 0.65rem; line-height: 1.45; }
.sms-ready, .sms-synced { background: #e7f5ef; color: #27634f; }
.sms-error { background: #fff1ef; color: #8e3d35; }

.sms-verification { display: grid; grid-template-columns: auto minmax(8rem, 1fr) auto; grid-column: 1 / -1; gap: 0.55rem; align-items: end; padding: 0.7rem; border: 1px solid #d5e2ea; border-radius: 0.58rem; background: white; }
.verification-code-field[hidden], #verifyPhoneButton[hidden] { display: none; }
.phone-verification-status { grid-column: 1 / -1; margin: 0; color: #657a88; font-size: 0.65rem; line-height: 1.45; }
.phone-verification-status.is-verified { color: #27634f; font-weight: 800; }

.plan-risk-panel { margin-bottom: 0.85rem; overflow: hidden; border: 2px solid #cfd9d5; border-left-width: 0.55rem; border-radius: 0.9rem; background: white; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07); }
.plan-risk-panel[hidden] { display: none; }
.plan-risk-critical { border-color: #bd4037; box-shadow: 0 9px 28px rgba(160, 47, 39, 0.16); }
.plan-risk-very-high { border-color: #c77a12; box-shadow: 0 9px 28px rgba(173, 103, 11, 0.14); }
.plan-risk-high { border-color: #7e57ad; box-shadow: 0 9px 24px rgba(104, 65, 151, 0.12); }
.plan-risk-caution { border-color: #5b7892; }
.plan-risk-unmatched { border-color: #91a59d; }
.plan-risk-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem; border-bottom: 1px solid #e1e8e5; background: #f5f8f7; }
.plan-risk-critical .plan-risk-heading { background: #fff1ef; }
.plan-risk-very-high .plan-risk-heading { background: #fff7e8; }
.plan-risk-high .plan-risk-heading { background: #f8f3fd; }
.plan-risk-heading h2 { margin: 0; font-size: 1.22rem; }
.plan-risk-level { flex: 0 0 auto; padding: 0.4rem 0.58rem; border: 1px solid #cad5d1; border-radius: 999px; background: white; font-size: 0.68rem; }
.plan-risk-summary { margin: 0; padding: 0.85rem 1.1rem; color: #344c44; font-size: 0.82rem; font-weight: 750; line-height: 1.55; }
.plan-risk-warnings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; padding: 0 1.1rem 1rem; }
.plan-risk-warning { overflow: hidden; border: 1px solid #d8e0dd; border-radius: 0.68rem; background: #fcfdfc; }
.plan-risk-warning.warning-critical { border-color: #e3a7a2; }
.plan-risk-warning.warning-very-high { border-color: #e5c17e; }
.plan-risk-warning.warning-high { border-color: #cdb9e4; }
.plan-risk-warning > header { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.65rem 0.72rem; border-bottom: 1px solid #e5ebe8; background: #f7f9f8; }
.plan-risk-warning h3 { margin: 0; color: #263e35; font-size: 0.82rem; }
.plan-risk-warning h4 { margin: 0; padding: 0.65rem 0.72rem 0.15rem; color: #354b43; font-size: 0.78rem; }
.plan-risk-warning > p:not(.plan-risk-action):not(.plan-risk-sources) { margin: 0; padding: 0.2rem 0.72rem 0.45rem; color: #5b6c65; font-size: 0.7rem; line-height: 1.5; }
.plan-risk-warning ul { margin: 0; padding: 0.2rem 1.5rem 0.65rem; color: #53645d; font-size: 0.68rem; line-height: 1.48; }
.plan-risk-action { margin: 0; padding: 0.6rem 0.72rem; border-top: 1px solid #eadbd8; background: #fff5f3; color: #812f29; font-size: 0.68rem; font-weight: 800; line-height: 1.45; }
.plan-risk-sources { margin: 0; padding: 0.55rem 0.72rem; border-top: 1px solid #e5ebe8; color: #718079; font-size: 0.62rem; line-height: 1.45; }
.plan-risk-sources a, .plan-risk-limit a { color: #28658e; font-weight: 800; }
.plan-risk-limit { margin: 0; padding: 0.75rem 1.1rem; border-top: 1px solid #e1e8e5; background: #f8faf9; color: #65756f; font-size: 0.67rem; line-height: 1.5; }
.plan-risk-unmatched-copy { grid-column: 1 / -1; margin: 0; padding: 0.75rem; border: 1px solid #d7e1dd; border-radius: 0.62rem; background: #f8faf9; color: #65756f; font-size: 0.72rem; line-height: 1.5; }

.medication-list { display: grid; gap: 0.65rem; max-height: 43rem; overflow-y: auto; padding: 0.9rem; }
.medication-card { overflow: hidden; border: 1px solid #d6e0dc; border-radius: 0.72rem; background: #fcfdfc; }
.medication-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.8rem; padding: 0.78rem 0.85rem; border-bottom: 1px solid #e1e8e5; background: #f3f8f6; }
.medication-card > header div { display: grid; gap: 0.12rem; }
.medication-card > header span { color: #72827c; font-size: 0.61rem; font-weight: 800; text-transform: uppercase; }
.medication-card h3 { margin: 0; color: #234a3d; font-size: 1rem; }
.medication-dose { flex: 0 0 auto; padding: 0.34rem 0.5rem; border-radius: 999px; background: #dff1e9; color: #1d624b; font-size: 0.72rem; }
.medication-schedule { margin: 0; padding: 0.72rem 0.85rem 0.2rem; color: #344c44; font-size: 0.8rem; font-weight: 800; line-height: 1.45; }
.medication-instructions { margin: 0; padding: 0.2rem 0.85rem 0.7rem; color: #718079; font-size: 0.7rem; line-height: 1.45; }
.plan-pill-section { display: grid; gap: 0.45rem; margin: 0.35rem 0.85rem 0.65rem; padding: 0.62rem; border: 1px solid #d9e2de; border-radius: 0.58rem; background: white; }
.plan-pill-section > strong { color: #596c64; font-size: 0.62rem; letter-spacing: 0.04em; text-transform: uppercase; }
.plan-pill-section > small { color: #7b8984; font-size: 0.59rem; line-height: 1.4; }
.plan-pill-gallery { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.plan-pill-example { display: grid; min-width: 4.7rem; justify-items: center; gap: 0.2rem; padding: 0.38rem; border: 1px solid #d8e1dd; border-radius: 0.5rem; background: #f8faf9; }
.plan-pill-example.is-dose-match { border-color: #5c9c83; outline: 2px solid rgba(53, 126, 95, 0.12); background: #eff8f4; }
.plan-pill-example > small { color: #60736b; font-size: 0.55rem; font-weight: 800; }
.plan-pill-drawing { --pill-fill: #e4e6e8; display: grid; min-height: 2rem; place-items: center; }
.plan-pill-drawing .pill-face { width: 3.4rem; height: 1.55rem; min-width: 1.55rem; transform: none; }
.plan-pill-drawing.shape-round .pill-face { width: 2rem; height: 2rem; }
.plan-pill-drawing.shape-oval .pill-face { width: 3.2rem; height: 1.75rem; }
.plan-pill-drawing.shape-oblong .pill-face, .plan-pill-drawing.shape-capsule .pill-face { width: 3.5rem; height: 1.48rem; }
.plan-pill-drawing .pill-imprint { font-size: 0.38rem; }
.plan-pill-drawing .pill-score.multiple::after { width: 1.7rem; }
.medication-card-actions { display: flex; gap: 0.4rem; padding: 0.58rem 0.85rem; border-top: 1px solid #e5ebe8; background: white; }
.medication-card-actions button { padding: 0.36rem 0.55rem; border: 1px solid #c9d4d0; border-radius: 0.42rem; background: #f8faf9; color: #52665e; font-size: 0.68rem; font-weight: 800; cursor: pointer; }
.medication-card-actions button[data-action="delete"] { margin-left: auto; border-color: #dfc0bc; color: #92443c; }
.medication-reminder-state { align-self: center; margin-right: auto; color: #2d648a; font-size: 0.61rem; font-weight: 850; }
.medication-reminder-state + button { margin-left: 0; }
.manager-empty { margin: 0.9rem; padding: 2.2rem 1rem; border: 1px dashed #bfcfc9; border-radius: 0.7rem; background: #f8faf9; text-align: center; }
.manager-empty[hidden] { display: none; }
.manager-empty strong { color: #53665f; font-size: 0.88rem; }
.manager-empty p { max-width: 24rem; margin: 0.4rem auto 0; color: #7b8984; font-size: 0.72rem; line-height: 1.5; }

.upcoming-card { margin-top: 0.85rem; overflow: hidden; }
.upcoming-doses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.55rem; padding: 0.9rem; }
.upcoming-dose { display: grid; grid-template-columns: 1fr auto; gap: 0.16rem 0.55rem; padding: 0.68rem 0.72rem; border: 1px solid #d8e2de; border-radius: 0.62rem; background: #fafcfb; }
.upcoming-dose time { grid-column: 1 / -1; color: #6d7e77; font-size: 0.62rem; font-weight: 850; text-transform: uppercase; }
.upcoming-dose strong { color: #244c3f; font-size: 0.8rem; }
.upcoming-dose span { color: #51685f; font-size: 0.7rem; font-weight: 800; }
.manager-empty-inline { margin: 0; padding: 1.35rem; color: #7a8883; font-size: 0.78rem; text-align: center; }
.manager-empty-inline[hidden] { display: none; }
.manager-methodology { margin-top: 0.85rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  .page-shell { width: min(100% - 1rem, 1440px); padding-top: 1.5rem; }
  .hero { align-items: stretch; flex-direction: column; gap: 1.2rem; }
  .controls { display: grid; grid-template-columns: 1fr 1fr; }
  .category-summary { flex-direction: column; }
  .methodology { grid-template-columns: 1fr; gap: 1rem; }
  .mix-hero { align-items: stretch; flex-direction: column; gap: 1rem; }
  .mix-count { align-self: flex-start; }
  .emergency-notice, .mix-controls, .combination-grid, .interaction-workspace, .rule-detail-grid, .global-guidance-grid { grid-template-columns: 1fr; }
  .analysis-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drug-picker { border-right: 0; border-bottom: 1px solid var(--line); }
  .builder-heading, .browse-heading { align-items: stretch; flex-direction: column; }
  .builder-heading .control-button { align-self: flex-start; }
  .pair-analysis > header { flex-direction: column; }
  .mix-detail-grid { grid-template-columns: 1fr; }
  .mix-detail + .mix-detail { border-top: 1px solid #e7ebf0; border-left: 0; }
  .combination-card > header { flex-direction: column; }
  .modal-pro-con-grid, .pill-identity-card, .guide-intro, .category-guide-grid, .guide-detail-grid { grid-template-columns: 1fr; }
  .pill-identity-visual { min-height: 7.5rem; gap: 0.55rem; }
  .pill-face { transform: scale(0.88); }
  .shape-diamond .pill-face { transform: rotate(45deg) scale(0.82); }
  .guide-hero { align-items: stretch; flex-direction: column; gap: 1rem; }
  .guide-hero .mix-count { align-self: flex-start; }
  .category-guide-card > header { grid-template-columns: auto 1fr; }
  .guide-card-count { grid-column: 2; justify-self: start; }
  .modal-section-heading { align-items: flex-start; flex-direction: column; gap: 0.2rem; }
  .manager-feature { grid-template-columns: auto 1fr; }
  .manager-feature-status, .manager-feature-action { grid-column: 1 / -1; }
  .manager-feature-status { padding-top: 0.7rem; padding-left: 0; border-top: 1px solid #bad9ce; border-left: 0; }
  .manager-feature-action { justify-content: center; }
  .manager-priority-hero { position: static; grid-template-columns: 1fr; margin-bottom: 1.1rem; padding: 0; }
  .manager-priority-intro { padding: 1rem; border-right: 0; border-bottom: 1px solid #cfdae0; }
  .manager-priority-dashboard { margin: 0; }
  .explore-panel-content { padding: 0.7rem; }
  .manager-hero { align-items: stretch; flex-direction: column; gap: 1rem; }
  .local-status { align-self: flex-start; }
  .manager-safety, .medication-workspace { grid-template-columns: 1fr; }
  .manager-overview { grid-template-columns: 1fr 1fr; }
  .manager-overview .manager-next-summary { grid-column: 1 / -1; border-top: 1px solid #dce5e1; border-left: 0; }
  #medicationForm, .dose-fieldset, .interval-fields, .text-reminder-details, .plan-risk-warnings { grid-template-columns: 1fr; }
  .sms-verification { grid-template-columns: 1fr; }
  .phone-verification-status { grid-column: 1; }
  .dose-fieldset .field-legend { grid-column: 1; }
  .weekday-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .upcoming-doses, .today-doses { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .manager-priority-brand { grid-template-columns: 1fr; }
  .manager-priority-mark { width: 3rem; height: 3rem; border-radius: 0.82rem; font-size: 1.1rem; }
  .manager-priority-actions { display: grid; }
  .manager-priority-stats, .priority-today-list { grid-template-columns: 1fr; }
  .manager-priority-stats > div + div { border-top: 1px solid #d4e3dd; border-left: 0; }
  .priority-today-heading { align-items: flex-start; flex-direction: column; gap: 0.15rem; }
  .explore-panel > summary { grid-template-columns: auto minmax(0, 1fr); }
  .explore-panel-action { display: none; }
  .manager-overview, .upcoming-doses, .today-doses { grid-template-columns: 1fr; }
  .manager-overview .manager-next-summary { grid-column: 1; }
  .manager-overview > div + div { border-top: 1px solid #dce5e1; border-left: 0; }
  .weekday-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-actions { align-items: stretch; flex-direction: column; }
  .today-as-directed { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
