/* Small, interruptible movements. No animation is needed to use a control. */
:root { --settle: cubic-bezier(.22, 1, .36, 1); }
body { -webkit-font-smoothing: antialiased; }
header nav a { display: inline-flex; align-items: center; min-height: 48px; }
:is(button, a, input, select, summary):focus-visible { outline: 3px solid var(--red); outline-offset: 4px; }
:is(button, .action, .tabs a) { min-height: 48px; }
.action { display: inline-flex; justify-content: center; align-items: center; text-align: center; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
button, .action, .tabs a, header nav a { transition: transform 180ms var(--settle), background-color 180ms ease, color 180ms ease; }
:is(button, .action):not(:disabled):active { transform: translateY(2px) scale(.98); transition-duration: 60ms; }
button:disabled { cursor: not-allowed; }
.intro h1 { text-wrap: balance; }
.lead { max-width: 38rem; }
.welcome { transform: rotate(1deg); }
.card { border-radius: 12px; border-top: 8px solid var(--blue); box-shadow: 0 0 0 2px var(--ink); border-left: 0; border-right: 0; border-bottom: 0; margin: 2px; }
.card:nth-child(3n + 2) { border-top-color: var(--yellow); }
.card:nth-child(3n) { border-top-color: #f6beb0; }
.card-body { padding: 24px; }
.card h3, .offer h3 { text-wrap: pretty; overflow-wrap: anywhere; }
.card .review { line-height: 1.6; }
.epic-shortcut { border-color: transparent; text-decoration: underline; text-underline-offset: 4px; }
.epic-shortcut:is(:focus-visible, :active) { background: #2f4662; color: var(--paper); }
.card-actions { gap: 4px; }
.card .action { border-radius: 8px; }
.resource-pagination { margin-left: 0; }
.tools > *, .catalog-tools > * { min-width: 0; }
.workspace-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.workspace-tabs button, .intro > *, .about > * { min-width: 0; }
.tools :is(input, select), .catalog-tools :is(input, select) { min-width: 0; min-height: 48px; font-size: 1rem; }
.workspace-tabs button { position: relative; }
.workspace-tabs button span { font-size: .875rem; line-height: 1.4; }
.offer-source { color: #42546a; margin-top: 0; }
.offer h3 { margin-top: 0; }
.supply-estimates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 20px 0 12px; }
.supply-estimate { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); }
.supply-estimate > span { font-weight: 700; }
.supply-estimate > strong { font: 700 1.75rem/1.1 Georgia, serif; color: var(--red); }
.supply-estimate > small { font-size: .75rem; line-height: 1.45; }
.estimate-note { max-width: 52rem; font-size: .8125rem; line-height: 1.55; color: #42546a; }
.estimate-unavailable { margin: 18px 0; padding: 16px; border-left: 5px solid var(--red); background: #f6dfb5; }
.estimate-unavailable p { margin-bottom: 0; }
.starting-price { margin: 18px 0; padding: 18px; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); }
.starting-price > span { display: block; font-weight: 700; }
.starting-price > strong { display: block; margin: 5px 0; font: 700 1.75rem/1.1 Georgia, serif; color: var(--red); }
.starting-price p { margin: 8px 0 0; }
.catalog-checkers { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--ink); }
.catalog-checkers > h3 { margin: 0 0 8px; font-size: 1.6rem; }
.catalog-checkers > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.catalog-checkers article { padding: 18px; border: 2px solid var(--ink); border-radius: 10px; background: white; }
.catalog-checkers h4 { margin: 0; font-size: 1.2rem; }
.catalog-checkers article p { min-height: 3.2em; }
.catalog-eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: 0; }
.catalog-tools { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.7fr) minmax(8rem, .6fr); align-items: start; }
.quantity-field { position: relative; display: block; }
.quantity-field input { padding-right: 5.5rem; }
.quantity-field > span { position: absolute; right: .75rem; top: .8rem; font-weight: 400; font-size: .875rem; pointer-events: none; }
.catalog-selection { display: grid; gap: .4rem; padding: 1.2rem; margin: 1rem 0; border-left: 5px solid var(--ink); background: var(--blue); border-radius: 0 8px 8px 0; }
.catalog-selection > span { font-size: .875rem; }
.catalog-selection > strong { font-size: 1.15rem; }
#catalog-results { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.offer-heading { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; align-items: baseline; }
.offer-heading p { margin-bottom: .5rem; font-size: .8rem; text-transform: capitalize; }
.freshness { font-size: .72rem; padding: .25rem .5rem; border-radius: 4px; background: #eaf0e5; color: #314b26; }
.freshness.outdated, .freshness.unavailable { background: #fff0c5; color: #684409; }
.prescription-label { font-size: .95rem; min-height: 2.8em; }
.offer-price { border-top: 1px solid #d8dcd9; padding-top: 1rem; }
.price-context { display: block; font-size: .85rem; }
.comparison-price { display: block; font: 700 2.75rem/1.15 Georgia, serif; margin: .4rem 0; letter-spacing: -.04em; }
.price-unconfirmed { font-size: 1.25rem; font-weight: 700; margin: .5rem 0; }
.offer-price > p { margin: .5rem 0; }
.offer .quote-button { margin: .5rem 0; }
.quote-status { font-size: .875rem; }
.destination-note { font-size: .8rem; line-height: 1.5; color: #42546a; }
.offer-conditions { border-top: 1px solid #d8dcd9; margin-top: 1rem; font-size: .85rem; }
.offer-conditions summary { cursor: pointer; padding: .9rem 0; min-height: 48px; }
.offer-conditions ul { padding-left: 1.2rem; }
.offer-conditions li { margin: .6rem 0; }
.catalog-related { border: 1px solid #a4acb4; border-radius: 8px; padding: 1rem; margin-top: 1.5rem; }
.catalog-related summary { cursor: pointer; font-weight: 700; min-height: 48px; }
.catalog-related article { padding: 1rem 0; border-top: 1px solid #a4acb4; }
.catalog-attribution { margin-top: 1.5rem; font-size: .75rem; color: #42546a; }
@media (max-width: 950px) {
  .catalog-tools { grid-template-columns: minmax(0, 1fr) 9rem; }
  .catalog-tools .medication-query { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  #catalog-results, .catalog-tools { grid-template-columns: minmax(0, 1fr); }
  .catalog-tools .medication-query { grid-column: auto; }
  .catalog-tools label:last-child { max-width: 14rem; }
  .prescription-label { min-height: 0; }
}
.offer dl { grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr); }
.offer dd, #catalog-sources { overflow-wrap: anywhere; }
.catalog-coverage summary { min-height: 48px; padding: 12px 0; }
#catalog-sources { overscroll-behavior: contain; }
.close { width: 48px; height: 48px; z-index: 1; }
dialog { overscroll-behavior: contain; max-height: 90dvh; }
.instruction-tabs { margin-right: 60px; }
.instruction-tabs button { min-width: 0; }
dialog :is(p, li, h2, h3, a) { overflow-wrap: anywhere; }
dialog[open] { animation: dialog-in 240ms var(--settle); }
dialog[open]::backdrop { animation: backdrop-in 180ms ease-out; }
.guides details[open] > div { animation: view-in 220ms var(--settle); }
.static-directory { padding-top: 32px; padding-bottom: 40px; }
.static-directory h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.static-directory h2 { margin-top: 40px; font-size: 2rem; }
.static-directory .resource-index { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 24px 0; }
.static-directory .resource-index a { padding: 10px 0; }
.static-directory article { padding: 24px 0; border-top: 1px solid #a4acb4; max-width: 52rem; }
.static-directory article h3 { font-size: 1.6rem; margin: 0 0 12px; }
.static-directory article p { margin: 10px 0; }
.static-directory article a { overflow-wrap: anywhere; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@media (hover: hover) and (pointer: fine) {
  .action:not(:disabled):hover { background: #2f4662; color: var(--paper); }
  header nav a:hover { color: #af3426; }
  .workspace-tabs button:not([aria-selected=true]):hover { background: #fff0c5; }
}
@media (max-width: 760px) {
  header { flex-wrap: wrap; gap: 4px; }
  header nav { width: 100%; margin: 0; justify-content: space-between; }
  .welcome { max-width: 280px; }
  .intro { gap: 24px; }
}
@media (max-width: 620px) {
  header { padding: 12px 20px 8px; }
  main { padding: 0 18px; }
  .intro { padding: 20px 0 14px; }
  .intro h1 { font-size: clamp(2.65rem, 11vw, 3.1rem); }
  .desktop { display: none; }
  .workspace-tabs { gap: 10px; margin: 18px 0 22px; }
  .workspace-tabs button { font-size: 1rem; line-height: 1.25; padding: 14px 12px; }
  .workspace-tabs button span { font-size: .8125rem; }
  .tabs a { display: flex; justify-content: center; align-items: center; font-size: .875rem; }
  .section-head { flex-wrap: wrap; gap: 6px; }
  .section-head p { margin: 0; }
  .card-body, .offer { padding: 20px; }
  .supply-estimates { grid-template-columns: 1fr; gap: 8px; }
  .supply-estimate { display: grid; grid-template-columns: 5rem auto; align-items: baseline; padding: 12px 14px; }
  .supply-estimate > strong { font-size: 1.5rem; }
  .supply-estimate > small { grid-column: 1 / -1; }
  .catalog-checkers > div { grid-template-columns: 1fr; }
  .catalog-checkers article p { min-height: auto; }
  .resource-pagination { gap: 10px; justify-content: space-between; font-size: .875rem; }
  .resource-pagination .action { font-size: .875rem; padding: 8px 12px; }
  .medication-prices { padding: 20px 16px; }
  .medication-prices h2 { font-size: 2rem; }
  .instruction-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 60px 24px 0; gap: 6px; }
  .instruction-tabs button { font-size: .875rem; line-height: 1.35; padding: 10px 6px; }
  .epic-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .epic-actions .action { width: 100%; border-radius: 8px; }
  dialog { padding: 20px; }
  dialog h2 { margin-right: 0; font-size: clamp(1.75rem, 6vw, 2rem); }
  #patient-sheet { padding: 16px; }
  #patient-sheet img { height: auto; }
  .tools { grid-template-columns: minmax(0, 1fr); }
  .guides { margin-left: 0; margin-right: 0; }
}
@media (max-width: 360px) {
  header, main { padding-left: 14px; padding-right: 14px; }
  header nav { font-size: .8125rem; gap: 8px; }
  .tools, .catalog-tools { grid-template-columns: minmax(0, 1fr); }
  .catalog-tools label:first-child { grid-column: auto; }
  .offer dl { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .offer dd { margin-bottom: 10px; }
  .resource-pagination { gap: 6px; }
  .resource-pagination .action { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  :is(button, .action):not(:disabled):active { transform: none; }
}
@media (prefers-contrast: more) { .review, .offer-source { color: var(--ink); } }
@media print { .card { box-shadow: none; border: 1px solid; } }
