/* AI Facts: "Read the Label"
   Shared styles for safety.html and uses.html.
   The visual world: a pharmacy counter. Facts panels, warning stickers, prescription labels.
   Senior-first: 20px base, AAA contrast, 56px controls, no hover-only info. */

:root {
  --paper: #FBF8F1;
  --paper-2: #F3EEE2;
  --white: #FFFFFF;
  --ink: #16181D;          /* 17:1 on paper */
  --ink-2: #363A42;        /* 10.8:1 on paper */
  --rule: #16181D;
  --line: #CFC7B6;

  /* Pharmacy sticker colors. White text on red/green/blue is above 7:1; ink on yellow is 12:1. */
  --red: #9B1C12;
  --red-soft: #FBE9E4;
  --green: #1B5E3B;
  --green-soft: #E3F1E8;
  --blue: #1B4A85;
  --blue-soft: #E4ECF7;
  --yellow: #FFD43B;
  --yellow-soft: #FFF3C4;
  --amber: #C7772A;

  --base: 20px;
  --maxw: 1180px;
  --radius: 14px;
  --tap: 56px;
  --focus: 0 0 0 4px var(--paper), 0 0 0 8px var(--blue);
  --font: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", Verdana, system-ui, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}
html[data-size="large"]  { --base: 23px; }
html[data-size="xlarge"] { --base: 27px; }

* { box-sizing: border-box; }
html { font-size: var(--base); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 1rem; line-height: 1.6;
}
img, svg { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
a { color: var(--blue); text-decoration-thickness: 2px; text-underline-offset: 4px; }
a[href^="tel:"] { white-space: nowrap; }
a:hover { text-decoration-thickness: 4px; }
strong, b { font-weight: 800; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
[hidden] { display: none !important; }
[tabindex="-1"]:focus { box-shadow: none; outline: none; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
@media (max-width: 600px) { .wrap { padding: 0 18px; } }

.skip { position: absolute; left: 16px; top: -100px; background: var(--ink); color: #fff; padding: 14px 20px; border-radius: 10px; z-index: 100; font-weight: 800; }
.skip:focus { top: 16px; }

.icon { width: 1.4em; height: 1.4em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }

/* ---------- Header: calm, one row on desktop, two short rows on phones ---------- */
.site-header { background: var(--white); border-bottom: 3px solid var(--ink); }
.site-header .wrap { display: flex; align-items: center; gap: 12px 22px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 16px; color: var(--ink); text-decoration: none; min-height: var(--tap); }
.brand-logo { display: block; height: 44px; width: auto; }
.brand-title { border-left: 2px solid var(--line); padding-left: 16px; font-weight: 800; font-size: 1rem; line-height: 1.15; white-space: nowrap; }
.nav { display: flex; gap: 8px; margin-left: auto; }
.nav a {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 8px 18px;
  color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1rem; line-height: 1.2; text-align: center;
  border: 2px solid transparent; border-radius: 12px;
}
.nav a:hover { background: var(--paper-2); }
.nav a[aria-current="page"] { background: var(--paper-2); border-color: var(--ink); box-shadow: inset 0 -5px 0 var(--ink); }
.textsize { display: flex; align-items: center; gap: 10px; }
.textsize-label { font-weight: 700; font-size: .9rem; white-space: nowrap; }
.textsize-btns { display: flex; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; }
.textsize button {
  font: inherit; font-weight: 800; min-height: 52px; min-width: 52px; padding: 0 10px; border: 0; background: var(--white); color: var(--ink); cursor: pointer;
  line-height: 1;
}
.textsize button + button { border-left: 2px solid var(--ink); }
.textsize button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.textsize button:focus-visible { box-shadow: inset 0 0 0 4px var(--blue); border-radius: 0; }
@media (max-width: 1180px) { .brand-title { display: none; } }
@media (max-width: 860px) {
  .site-header .wrap { justify-content: space-between; }
  .nav { order: 3; width: 100%; margin-left: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .nav a { padding: 6px 8px; }
}
@media (max-width: 600px) {
  .site-header .wrap { gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .brand-logo { height: 38px; }
  .textsize-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .textsize button { min-width: 50px; min-height: 50px; }
  .nav a { font-size: .9rem; min-height: 52px; }
}

/* Reminder bar */
.reminder { background: var(--yellow-soft); border-bottom: 2px solid var(--ink); }
.reminder .wrap { display: flex; gap: 14px; align-items: center; padding-top: 14px; padding-bottom: 14px; }
.reminder p { margin: 0; }
.reminder .icon { width: 36px; height: 36px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 64px; padding: 12px 28px;
  border-radius: 14px; border: 3px solid var(--ink); font: inherit; font-weight: 800; font-size: 1.05rem; line-height: 1.2;
  text-decoration: none; cursor: pointer; text-align: left; background: var(--white); color: var(--ink);
}
.btn:hover { background: var(--paper-2); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #2D313A; }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-red:hover { background: #7E150D; }
.btn-small { min-height: 52px; padding: 8px 18px; font-size: .95rem; border-width: 2px; }
.btn .icon { width: 28px; height: 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

.read-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 18px; font: inherit; font-weight: 700; font-size: .95rem;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--white); color: var(--ink); cursor: pointer;
}
.read-btn:hover { background: var(--paper-2); }
.read-btn[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.read-btn .icon { width: 26px; height: 26px; }

/* ---------- Sections ---------- */
section { padding: 48px 0; }
section + section { border-top: 2px solid var(--line); }
@media (max-width: 600px) { section { padding: 48px 0; } }
.section-head { max-width: 780px; margin-bottom: 32px; }
.section-head p { font-size: 1.1rem; color: var(--ink-2); }
.section-head .read-btn { margin-top: 4px; }
@media (min-width: 900px) {
  .section-head { max-width: none; display: grid; grid-template-columns: minmax(0, 780px) auto; column-gap: 32px; justify-content: space-between; }
  .section-head > * { grid-column: 1; }
  .section-head > .kicker { justify-self: start; }
  .section-head > .read-btn { grid-column: 2; grid-row: 1 / span 3; align-self: end; margin: 0 0 1em; white-space: nowrap; }
}
.kicker {
  display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase;
  margin-bottom: 14px; color: var(--ink);
}
.kicker::before { content: ""; width: 28px; height: 4px; background: currentColor; border-radius: 2px; }
.section-alt { background: var(--white); }
.section-warn { background: var(--red-soft); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
@media (max-width: 960px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.card { background: var(--white); border: 2px solid var(--ink); border-radius: var(--radius); padding: 28px; }
.card h3 { display: flex; gap: 12px; align-items: center; }
ul.clean, ol.clean { list-style: none; padding: 0; margin: 0; }
ul.ticks { list-style: none; padding: 0; margin: 0; }
ul.ticks li { position: relative; padding-left: 40px; margin-bottom: 14px; }
ul.ticks li::before {
  content: ""; position: absolute; left: 0; top: .2em; width: 26px; height: 26px; border-radius: 50%;
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center/18px no-repeat;
}
ul.crosses li::before {
  background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7 7 17'/%3E%3C/svg%3E") center/16px no-repeat;
}

/* ---------- Hero ---------- */
.hero { padding: 40px 0 52px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: start; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; gap: 44px; } }
.hero .lede { font-size: 1.25rem; max-width: 34ch; color: var(--ink-2); }
.hero h1 { margin-bottom: .35em; }
.part { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; padding: 6px 14px; border: 2px solid var(--ink); border-radius: 999px; margin-bottom: 22px; font-size: .9rem; background: var(--white); }
.hero-note { margin-top: 26px; display: flex; gap: 12px; align-items: flex-start; color: var(--ink-2); max-width: 36ch; }
.hero-note .icon { width: 30px; height: 30px; color: var(--ink); }

/* ---------- The Facts panel (modeled on an over-the-counter Drug Facts label) ---------- */
.facts {
  position: relative; background: var(--white); border: 3px solid var(--ink); padding: 18px 24px 20px; line-height: 1.45;
  box-shadow: 10px 10px 0 var(--paper-2), 10px 10px 0 2px var(--line);
}
.facts-title { padding-right: 96px; font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; margin: 0; line-height: 1.1; }
.facts-title small { font-size: .9rem; font-weight: 700; letter-spacing: 0; margin-left: 6px; }
.facts-row { border-top: 1px solid var(--ink); padding: 10px 0; }
.facts-row.heavy { border-top-width: 8px; margin-top: 8px; }
.facts-row.mid { border-top-width: 4px; }
.facts-row h3, .facts-row .fh { font-size: 1.05rem; font-weight: 800; display: inline; margin: 0; }
.facts-row p { margin: 0; display: inline; }
.facts-row ul { margin: 6px 0 0; padding-left: 1.2em; }
.facts-row li { margin-bottom: 2px; }
.facts-row .big-num { font-size: 1.35rem; font-weight: 800; white-space: nowrap; }
.facts-sticker {
  position: absolute; top: -26px; right: -14px; width: 120px; height: 120px; border-radius: 50%; background: var(--yellow);
  border: 3px solid var(--ink); display: grid; place-items: center; text-align: center; font-weight: 800; font-size: .85rem; line-height: 1.15;
  transform: rotate(8deg); padding: 10px;
}
@media (max-width: 600px) {
  .facts { padding: 16px 18px; box-shadow: 6px 6px 0 var(--paper-2), 6px 6px 0 2px var(--line); }
  .facts-sticker { width: 96px; height: 96px; font-size: .72rem; top: -30px; right: -6px; }
  .facts-title { font-size: 1.8rem; padding-right: 70px; }
  .facts-title small { display: block; margin: 4px 0 0; }
}

/* ---------- Warning stickers (the six rules) ---------- */
.stickers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; list-style: none; padding: 0; margin: 0; counter-reset: rule; }
@media (max-width: 960px) { .stickers { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .stickers { grid-template-columns: 1fr; } }
.sticker {
  border-radius: 18px; padding: 20px 22px 22px; border: 3px solid var(--ink); display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-content: start;
}
.sticker .s-icon { grid-row: span 2; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--white); color: var(--ink); border: 3px solid var(--ink); }
.sticker .s-icon .icon { width: 36px; height: 36px; }
.sticker .s-num { font-weight: 800; font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; align-self: end; }
.sticker h3 { font-size: 1.35rem; margin: 0; align-self: start; }
.sticker p { grid-column: 1 / -1; margin: 10px 0 0; font-size: 1.05rem; }
.sticker.yellow { background: var(--yellow); color: var(--ink); }
.sticker.red    { background: var(--red); color: #fff; border-color: var(--red); }
.sticker.green  { background: var(--green); color: #fff; border-color: var(--green); }
.sticker.blue   { background: var(--blue); color: #fff; border-color: var(--blue); }
.sticker.white  { background: var(--white); color: var(--ink); }
.sticker.red .s-icon, .sticker.green .s-icon, .sticker.blue .s-icon { border-color: #fff; }

/* ---------- Help numbers ---------- */
.helpline { display: flex; flex-direction: column; gap: 6px; }
.helpline .who { font-weight: 800; font-size: 1.15rem; }
.helpline .num {
  display: inline-flex; align-items: center; gap: 12px; font-size: 1.6rem; font-weight: 800; color: var(--ink); text-decoration: none;
  min-height: var(--tap); border-bottom: 3px solid var(--ink); align-self: flex-start; letter-spacing: .01em; word-break: break-word;
}
.helpline .num:hover { color: var(--blue); border-color: var(--blue); }
.helpline .num .icon { width: 30px; height: 30px; }
.helpline .note { color: var(--ink-2); margin: 6px 0 0; }

/* ---------- Callouts ---------- */
.callout { display: flex; gap: 18px; align-items: flex-start; background: var(--white); border: 3px solid var(--ink); border-left-width: 14px; border-radius: var(--radius); padding: 24px 28px; }
.callout .icon { width: 36px; height: 36px; }
.callout p { margin: 0; font-size: 1.1rem; }

/* ---------- Next-part band ---------- */
.next-band { background: var(--ink); color: #fff; padding: 40px 0; }
.next-band .wrap { display: flex; justify-content: space-between; align-items: center; gap: 28px; flex-wrap: wrap; }
.next-band h2 { margin: 0; color: #fff; max-width: 24ch; }
.next-band .kicker { color: var(--yellow); }
.next-band .btn { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.next-band .btn:hover { background: #fff; }
.next-band :focus-visible { box-shadow: 0 0 0 4px var(--ink), 0 0 0 8px var(--yellow); }

/* ---------- Footer (dark, carries the dark knapp.build logo) ---------- */
.site-footer { background: var(--ink); color: #fff; padding: 40px 0 44px; border-top: 3px solid #4A4F59; }
.site-footer .wrap { display: grid; gap: 22px; }
.footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.footer-logo { height: 54px; width: auto; display: block; }
.footer-free { font-size: 1.15rem; font-weight: 800; margin: 0; }
.footer-free .url { font-family: "Geist", var(--font); font-weight: 600; letter-spacing: -.01em; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 14px; list-style: none; padding: 0; margin: 0; }
.footer-links a { display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 0 16px; font-weight: 700; color: #fff; border: 2px solid #5A5F69; border-radius: 12px; text-decoration: none; }
.footer-links a:hover { border-color: #fff; }
.footer-links .icon { width: 24px; height: 24px; }
.site-footer .fine { color: #D9DBE0; margin: 0; }
.site-footer :focus-visible { box-shadow: 0 0 0 4px var(--ink), 0 0 0 8px var(--yellow); }

/* Status / live message */
.status { margin-top: 12px; font-weight: 700; }

/* ---------- Print: the sites print as clean reference sheets ---------- */
@media print {
  @page { margin: .5in; }
  html { font-size: 12pt; }
  body { background: #fff; }
  .site-header .textsize, .read-btn, .footer-links, .actions, .no-print, .skip, .nav, .next-band, .copy-row, .footer-links, .class-bar, .js-only, .class-only { display: none !important; }
  section { padding: 18pt 0; break-inside: auto; }
  .card, .sticker, .facts { break-inside: avoid; box-shadow: none; }
  .sticker.red, .sticker.green, .sticker.blue, .sticker.yellow { background: #fff !important; color: #000 !important; border-color: #000 !important; }
  a { color: #000; }
  .site-footer { background: #fff; color: #000; border-top: 2px solid #000; padding: 12pt 0; }
  .site-footer .fine { color: #000; }
  .footer-logo { content: url(brand/knapp-build-logo.svg); height: 40px; }
  html.print-card body > *:not(#walletcard-print) { display: none !important; }
}

/* Without JavaScript, hide controls that need it */
html:not(.js) .js-only { display: none !important; }
.class-only { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Contact line (not an emergency line) ---------- */
.contact { display: flex; gap: 18px; align-items: flex-start; background: var(--white); border: 3px solid var(--ink); border-radius: var(--radius); padding: 22px 26px; margin-top: 32px; max-width: 980px; }
.contact > .icon { width: 36px; height: 36px; margin-top: 2px; }
.contact p { margin: 0; }
.contact p + p { margin-top: 8px; color: var(--ink-2); }
.contact a[href^="mailto:"], .site-footer a[href^="mailto:"] { font-weight: 800; overflow-wrap: anywhere; }
.site-footer .contact-line { margin: 0; font-size: 1.05rem; }
.site-footer .contact-line a { color: #fff; }
.site-footer .contact-line + .fine { margin-top: -8px; }
.footer-links button { font: inherit; display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 0 16px; font-weight: 700; color: #fff; background: transparent; border: 2px solid #5A5F69; border-radius: 12px; cursor: pointer; }
.footer-links button:hover { border-color: #fff; }
.footer-links .teach { border-color: var(--yellow); }

/* ---------- Class view: one section at a time, for a projector ---------- */
.class-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--ink); color: #fff; border-top: 5px solid var(--yellow); padding: 10px 0 12px; }
.class-bar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.class-pos { flex: 1 1 320px; margin: 0; font-weight: 800; font-size: 1rem; line-height: 1.3; }
.class-pos small { display: block; font-weight: 700; font-size: .85rem; color: #E6E8EC; }
.class-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.class-bar .btn { min-height: 56px; padding: 8px 18px; font-size: 1rem; border-width: 2px; }
.class-bar .btn-yellow { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.class-bar .btn-ghost { background: transparent; color: #fff; border-color: #8A8F99; }
.class-bar .btn-ghost[aria-pressed="true"] { background: var(--blue); border-color: #fff; }
.class-bar :focus-visible { box-shadow: 0 0 0 4px var(--ink), 0 0 0 8px var(--yellow); }
@media (max-width: 700px) {
  .class-pos small { display: none; }
  .class-btns { display: grid; grid-template-columns: 1fr 1fr 1fr; width: 100%; gap: 8px; }
  .class-bar .btn { padding: 6px 8px; justify-content: center; text-align: center; font-size: .9rem; }
}
body.class-mode .site-header, body.class-mode .site-footer, body.class-mode .skip, body.class-mode .no-class { display: none !important; }
body.class-mode main > section { display: none; border-top: 0; }
body.class-mode main > section.is-current { display: block; min-height: calc(100vh - var(--class-bar-h, 140px)); padding-top: 40px; }
body.class-mode .class-only { display: block; }
body.class-mode { padding-bottom: var(--class-bar-h, 140px); }
.class-bar .btn:disabled { opacity: .4; cursor: default; }
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { box-shadow: none !important; outline: none; }
