/* OpenBill static pages (drug/, class/, drugs/): the receipt look of the app, as one shared
   stylesheet served from assets/site.css. The pages' CSP is style-src 'self' and font-src 'self',
   so there is no inline style and the fonts come from assets/fonts/ (IBM Plex, SIL OFL). */

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2');
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2');
}

:root {
  --paper: #fbfaf6;
  --surface: #ffffff;
  --ink: #1b1b19;
  --ink-2: #4c4a44;
  --rule: #cdc8bd;
  --rule-strong: #1b1b19;
  --accent: #b3261e;
  --chip-ink: #1b1b19;
  --inverse-ink: #fbfaf6;
  --measure: 40rem;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121211;
    --surface: #1a1a18;
    --ink: #ecebe6;
    --ink-2: #b6b3aa;
    --rule: #3d3b36;
    --rule-strong: #ecebe6;
    --accent: #ff8b7b;
    --chip-ink: #ecebe6;
    --inverse-ink: #121211;
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0 16px 48px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

body > * {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}

h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.25;
}

p,
li,
dd,
dt {
  overflow-wrap: anywhere;
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--ink);
  z-index: 10;
}

.skip:focus {
  top: 8px;
}

/* ---- Masthead: a stamp, not a logo ---- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  padding: 8px 0 6px;
  border-bottom: 1px solid var(--rule);
}

.stamp {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 4px 12px 5px;
  border: 2px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: 2px;
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  line-height: 1.1;
  transform: rotate(-1.5deg);
}

.stamp-name {
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: 0.24em;
  margin-right: -0.24em;
}

.stamp-sub {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  margin-right: -0.18em;
}

.masthead-line {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ink-2);
}

/* ---- Breadcrumb and letters ---- */

.crumbs ol,
.letters ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 4px;
  margin: 0;
  padding: 6px 0 0;
  list-style: none;
  font-size: 0.875rem;
}

.crumbs li + li::before {
  content: '/';
  padding: 0 6px 0 2px;
  color: var(--ink-2);
}

.crumbs a,
.letters a,
.letters span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.crumbs [aria-current] {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-2);
}

.letters a,
.letters span {
  justify-content: center;
  min-width: 44px;
  font-family: var(--mono);
  border: 1px solid var(--rule);
}

.letters span[aria-current] {
  background: var(--ink);
  color: var(--inverse-ink);
  border-color: var(--ink);
}

/* ---- Title ---- */

.page-title {
  margin: 12px 0 4px;
  font-size: 1.5rem;
  letter-spacing: 0.01em;
}

.lede {
  margin: 0 0 8px;
  color: var(--ink-2);
}

/* ---- The card ---- */

.card {
  margin-top: 10px;
  padding: 12px 16px 16px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 3px double var(--rule-strong);
  border-bottom: 3px double var(--rule-strong);
}

.card-kicker {
  margin: 0 0 4px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.fig,
.spread {
  padding: 10px 0 8px;
}

.fig + .fig,
.spread + .fig {
  border-top: 1px solid var(--rule);
}

.fig-label {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fig-value {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 2px 0 0;
}

.fig-value > span {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.amount {
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.amount-unit {
  font-size: 1.5rem;
}

.unknown {
  font-size: 1.5rem;
  font-weight: 600;
}

.multiple {
  font-size: 2.75rem;
  font-weight: 600;
  line-height: 1.05;
  color: var(--accent);
}

.arith {
  margin: 0;
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.arith-note {
  font-family: var(--sans);
  color: var(--ink-2);
}

.prov {
  margin: 2px 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.why {
  margin: 6px 0 0;
  font-size: 0.875rem;
  color: var(--ink-2);
}

.not-yours {
  margin: 0;
  font-size: 0.875rem;
}

.rule {
  height: 0;
  margin: 4px 0;
  border: 0;
  border-top: 1px solid var(--rule-strong);
}

.spread-sentence {
  margin: 2px 0;
  font-weight: 600;
}

.caveat {
  margin: 6px 0 0;
  font-size: 0.875rem;
}

.caveat-extreme {
  padding-left: 10px;
  border-left: 2px solid var(--rule-strong);
}

.fresh {
  margin: 8px 0 0;
  font-size: 0.875rem;
}

.fresh-stale {
  font-weight: 600;
}

.card-cta {
  margin: 14px 0 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  font-weight: 600;
  border: 1px solid var(--rule-strong);
  text-decoration: none;
}

.button:hover {
  text-decoration: underline;
}

.card-cta .why {
  display: block;
}

.card .why a,
.more-link a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.page-generic {
  margin-top: 0.25rem;
  font-family: var(--mono);
  color: var(--ink-2);
  font-size: 0.875rem;
}

/* State chips: neutral, told apart by their text and border style, never by colour. */

.chip {
  display: inline-block;
  padding: 1px 7px;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  white-space: nowrap;
  color: var(--chip-ink);
  border: 1px solid var(--chip-ink);
  vertical-align: 0.15em;
}

.chip-filed {
  border-style: solid;
}

.chip-published {
  border: 3px double var(--chip-ink);
  padding: 0 5px;
}

.chip-derived {
  border-style: dashed;
}

.chip-estimated {
  border: 2px dotted var(--chip-ink);
  padding: 0 6px;
}

.chip-stale {
  background: var(--ink);
  color: var(--inverse-ink);
  border-color: var(--ink);
  font-weight: 600;
}

/* ---- Prose ---- */

.prose {
  margin-top: 28px;
}

.prose h2 {
  margin: 0 0 6px;
  padding-top: 12px;
  font-size: 1.125rem;
  border-top: 1px solid var(--rule-strong);
}

.prose h3 {
  margin: 18px 0 6px;
  font-size: 1rem;
}

.prose p {
  margin: 8px 0;
}

.prose .prov {
  margin-top: 4px;
}

.ask {
  margin: 8px 0;
  padding-left: 1.2em;
}

.ask li + li {
  margin-top: 6px;
}

.faq dl {
  margin: 8px 0;
}

.faq dt {
  margin-top: 14px;
  font-weight: 600;
}

.faq dd {
  margin: 4px 0 0;
}

.honesty {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.honesty li + li {
  margin-top: 4px;
}

.honesty-one {
  margin-top: 16px;
  font-size: 0.875rem;
}

/* ---- Lists ---- */

.ndc-list,
.link-list,
.product-list {
  margin: 6px 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}

.ndc-list li {
  padding: 6px 0;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--rule);
}

.link-list li,
.product-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 10px;
  border-bottom: 1px solid var(--rule);
}

.link-list a,
.product-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 0;
  font-weight: 600;
}

.item-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  padding-bottom: 6px;
  font-size: 0.8125rem;
  color: var(--ink-2);
}

.link-list .item-meta {
  padding-bottom: 0;
}

.item-flag {
  font-size: 0.75rem;
  color: var(--ink-2);
  border-bottom: 1px dotted var(--ink-2);
}

/* ---- Comparison tables: labelers, other strengths and forms ---- */

.compare {
  width: 100%;
  margin: 6px 0;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.compare th,
.compare td {
  padding: 6px 8px 6px 0;
  text-align: left;
  vertical-align: top;
  font-weight: 400;
  border-bottom: 1px solid var(--rule);
  overflow-wrap: anywhere;
}

.compare th:last-child,
.compare td:last-child {
  padding-right: 0;
}

.compare thead th {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  border-bottom-color: var(--rule-strong);
}

.compare .num {
  white-space: nowrap;
  overflow-wrap: normal;
}

.compare td.num {
  font-family: var(--mono);
}

.compare a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
}

.compare .self th strong {
  font-weight: 600;
}

.compare .item-meta {
  padding-bottom: 0;
}

.more-link {
  font-size: 0.875rem;
}

details.ndcs {
  margin: 12px 0;
}

details.ndcs > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  font-weight: 600;
  border: 1px solid var(--rule-strong);
  cursor: pointer;
}

/* ---- Footer ---- */

.site-footer {
  margin-top: 40px;
  padding-top: 14px;
  border-top: 3px double var(--rule-strong);
  font-size: 0.875rem;
}

.footer-head {
  margin: 16px 0 4px;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.footer-sources,
.footer-links {
  margin: 4px 0;
  padding: 0;
  list-style: none;
}

.footer-sources li {
  margin: 6px 0;
}

.footer-sources .mono {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.footer-sources a,
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
}

.build-line {
  font-size: 0.75rem;
  color: var(--ink-2);
}

@media (min-width: 40rem) {
  .page-title {
    font-size: 1.875rem;
  }
}

/* ---- The press kit (press/index.html) ---- */

.press-card {
  margin-top: 12px;
}

.press-card .card-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.press-facts {
  margin: 4px 0;
  padding: 0;
  list-style: none;
}

.press-facts li {
  margin: 4px 0;
}

.press-count {
  font-family: var(--mono);
  font-weight: 600;
}

.paste {
  margin: 8px 0 0;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--rule-strong);
}

.paste p {
  margin: 0;
}

.press-media {
  margin: 12px 0 20px;
}

.press-media img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}

.press-media figcaption {
  margin-top: 6px;
  font-size: 0.875rem;
  color: var(--ink-2);
}

.press-get {
  display: block;
}

.press-get a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.press-tall img,
.press-phone img {
  max-width: min(100%, 360px);
}

.press-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: 0 20px;
  align-items: start;
}

.press-wordmark img {
  padding: 12px;
  background: #fbfaf6;
}

.press-on-dark img {
  background: #1b1b19;
}
