/* Soft Landing v1 tokens (directive §12). System fonts only; Georgia for display titles. */
:root {
  --canvas: #F7F3EE; --surface: #FFFCF8; --text: #2E3430; --muted: #5F665F;
  --primary: #45685E; --primary-pressed: #355248; --plum: #6D5978;
  --control: #7A847A; --divider: #DEDCD5;
  --feeling: #EEE8F2; --care: #F5E3D7; --working: #E6EEE8; --more: #E5EDF2;
  --error-text: #954B45; --error-bg: #F7E8E5;
  --radius: 24px; --target: 52px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--text);
  font: 18px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
main { max-width: 980px; margin: 0 auto; padding: 8px 20px 64px; }
h1, h2, h3 { line-height: 1.25; margin: 0.6em 0 0.4em; }
h2 { font-size: 22px; } h3 { font-size: 19px; }
p { margin: 0.5em 0; }
a { color: var(--primary); }
.display { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(32px, 6vw, 46px); }
.question { font-size: clamp(24px, 3.6vw, 28px); font-weight: 600; }
.lede { font-size: 19px; }
.quiet, .hint { color: var(--muted); font-size: 16px; }
.eyebrow { color: var(--muted); font-size: 16px; margin-bottom: 0; }
.status { color: var(--plum); font-size: 16px; }
.prewrap { white-space: pre-wrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--surface); padding: 8px 12px; z-index: 10; }

.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  max-width: 980px; margin: 0 auto; padding: 14px 20px; }
.brand { font-family: Georgia, serif; font-size: 20px; color: var(--text); text-decoration: none; }
.account { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.whoami { color: var(--muted); font-size: 16px; }

.panel { background: var(--surface); border-radius: var(--radius); padding: 24px 28px; margin: 16px 0;
  border: 1px solid var(--divider); }
.narrow { max-width: 620px; margin-left: auto; margin-right: auto; }
.center { text-align: center; }
.center .stack { align-items: center; }
.stack { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 12px 0; }
.home .stack { max-width: 360px; margin: 24px auto 0; }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--target);
  padding: 12px 22px; border-radius: 999px; font: inherit; font-weight: 600; text-decoration: none;
  cursor: pointer; border: 2px solid var(--primary); background: transparent; color: var(--primary);
}
button.primary, .button.primary { background: var(--primary); color: #fff; }
button.primary:active, .button.primary:active { background: var(--primary-pressed); border-color: var(--primary-pressed); }
button.secondary, .button.secondary { background: var(--surface); }
button.link, .button.link { border: 0; background: none; padding: 8px 4px; min-height: 44px; text-decoration: underline; font-weight: 500; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--plum); outline-offset: 3px; }

label { font-weight: 600; }
input, textarea, select {
  font: inherit; font-size: 18px; color: var(--text); background: var(--surface); width: 100%;
  border: 1.5px solid var(--control); border-radius: 14px; padding: 12px 14px; min-height: var(--target);
}
textarea { resize: vertical; }
fieldset { border: 0; padding: 0; margin: 4px 0; }
legend { font-weight: 600; margin-bottom: 8px; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; align-items: center; gap: 12px; min-height: var(--target); padding: 8px 14px;
  border: 1.5px solid var(--control); border-radius: 16px; background: var(--surface); font-weight: 500; cursor: pointer; }
.choice input { width: 22px; height: 22px; min-height: 0; margin: 0; accent-color: var(--primary); }
.choice:has(input:checked) { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.person { background: var(--canvas); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }

.messages { max-width: 980px; margin: 0 auto; padding: 0 20px; }
.msg { border-radius: 14px; padding: 10px 16px; background: var(--working); }
.msg.error { background: var(--error-bg); color: var(--error-text); }
.msg.info { background: var(--more); }
.net { max-width: 980px; margin: 8px auto; padding: 10px 16px; border-radius: 14px; background: var(--error-bg); color: var(--error-text); }
.note { background: var(--more); border-radius: 14px; padding: 10px 14px; }
.disclosure { background: var(--working); border-radius: 14px; padding: 10px 14px; font-size: 16px; }

.session-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 16px; }
.stage { background: var(--surface); border-radius: var(--radius); padding: 24px 28px; border: 1px solid var(--divider); }
.session-foot { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; align-items: center; }
.advance { margin-top: 20px; }
.handoff { text-align: center; padding: 40px 0; }

/* Card board */
.board { margin: 16px 0; }
.save-state { font-size: 16px; color: var(--muted); min-height: 1.6em; }
.save-state.error { color: var(--error-text); }
.boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.box { border-radius: 20px; padding: 14px 16px; border: 2px solid transparent; min-height: 170px; display: flex; flex-direction: column; gap: 8px; }
.box h2 { font-size: 19px; margin: 0; }
.box.drop-target { border-color: var(--plum); border-style: dashed; }
.cat-working { background: var(--working); } .cat-feeling { background: var(--feeling); }
.cat-care { background: var(--care); } .cat-more { background: var(--more); }
.placed, .deck { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.placed { flex-direction: column; flex: 1; }
.card {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--target); padding: 8px 16px;
  border-radius: 16px; border: 1.5px solid var(--control); background: var(--surface); font: inherit; font-weight: 500;
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; color: var(--text);
}
.card[aria-pressed="true"] { border-color: var(--plum); box-shadow: 0 0 0 3px var(--plum); }
.card.dragging { opacity: 0.85; cursor: grabbing; position: fixed; z-index: 20; pointer-events: none; }
.placed-card { background: var(--surface); border-radius: 16px; padding: 10px 12px; border: 1.5px solid var(--divider); display: flex; flex-direction: column; gap: 8px; }
.placed-card.shared { border-color: var(--primary); }
.placed-card .label { font-weight: 600; }
.placed-card .controls { display: flex; flex-wrap: wrap; gap: 6px; }
.placed-card .controls button { min-height: 44px; padding: 6px 12px; font-size: 16px; }
.placed-card textarea { font-size: 17px; min-height: 44px; }
.tray { margin: 8px 0 14px; background: var(--canvas); border-radius: 20px; padding: 14px 16px; }
.board-status { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px;
  background: var(--surface); padding: 6px 0; }
.board-status .save-state { margin: 0; font-weight: 600; }
.board-status .board-hint { margin: 0; flex: 1 1 240px; }
.custom { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-top: 12px; }
.custom label { width: 100%; }
.custom input { flex: 1 1 220px; }

.proposal { border-top: 1px solid var(--divider); padding: 12px 0; }
.proposals { list-style: none; padding: 0; }
.recap ul, .panel ul { padding-left: 20px; }
details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--primary); font-weight: 600; }

@media (prefers-reduced-motion: no-preference) {
  /* Movement only: text is never faded, so contrast is full from the first frame. */
  .msg, .note { animation: settle 240ms ease-out 1; }
  @keyframes settle { from { transform: translateY(4px); } to { transform: none; } }
}

/* Protected Turn Protocol: one private question dominates; handoff replaces the whole prompt. */
.private-prompt { max-width: 680px; margin: 0 auto; padding: 12px 0; }
.private-prompt .question { font-size: clamp(28px, 4.5vw, 38px); margin-top: 8px; }
.private-form { margin-top: 24px; }
.private-form > .primary { width: 100%; margin-top: 8px; }
.private-assurance { border-top: 1px solid var(--divider); margin-top: 20px; padding-top: 12px; }
.private-context { border-radius: 20px; margin: 20px 0; padding: 18px 20px; }
.private-context .reflection { background: var(--surface); border-radius: 14px; padding: 12px 14px; }
.private-cover { min-height: 58vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.private-cover .privacy-mark { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; margin: 0;
  background: var(--working); color: var(--primary); font-size: 34px; font-weight: 700; }
.private-cover form, .private-cover .primary { width: min(100%, 420px); }
.shared-reveal { max-width: 720px; margin: 0 auto; text-align: center; padding: 40px 0; }
.independent-answers { display: grid; grid-template-columns: minmax(0, 760px); gap: 16px; margin: 20px 0; }
.independent-answers .person { margin: 0; }
@media (max-width: 680px) {
  .independent-answers { grid-template-columns: 1fr; }
  .stage { padding: 20px 18px; }
}

.private-form #private-save-state.error { color: var(--error-text); font-weight: 600; }

/* Original Weavewell vector mark: two private strands meeting without pictographic glyphs. */
.weave-mark { width: 96px; height: 96px; overflow: visible; }
.weave-strand, .weave-knot {
  fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 7;
}
.weave-strand-a { stroke: var(--primary); }
.weave-strand-b { stroke: var(--plum); }
.weave-knot { stroke: var(--surface); stroke-width: 4; }
.wait-state { text-align: center; }
.wait-state #wait-status { min-height: 1.55em; }
.wait-state #wait-status.error { color: var(--error-text); font-weight: 600; }

/* Weavewell brand lockup and anonymous editorial library. */
.brand-lockup { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { width: 36px; height: 36px; flex: 0 0 auto; overflow: visible; }
.brand-strand { fill: none; stroke-linecap: round; stroke-width: 4.5; }
.brand-strand-a { stroke: var(--primary); }
.brand-strand-b { stroke: var(--plum); }
.button.compact { min-height: 44px; padding: 8px 18px; }

.resource-hero, .article-hero {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.65fr);
  align-items: center; gap: 32px; padding: 44px 0 32px;
}
.resource-hero .display, .article-hero .display { max-width: 760px; }

/* Semantic illustrations (owner: core/artwork.py). One renderer, fixed palette roles, two sizes. */
.article-figure { margin: 0; display: grid; gap: 10px; justify-items: center; }
.illustration { display: block; overflow: visible; stroke-linecap: round; stroke-linejoin: round; }
.illustration-hero { width: 100%; max-width: 340px; height: auto; }
.illustration-thumb { width: 34px; height: 26px; flex: 0 0 auto; }
.illustration-caption { color: var(--muted); font-size: 15px; line-height: 1.45; text-align: center; max-width: 36ch; }
.ill-field { fill: var(--working); stroke: var(--primary); stroke-width: 1.25; opacity: 0.9; }
.ill-organ { fill: var(--care); stroke: none; }
.ill-wall { fill: var(--working); stroke: var(--primary); stroke-width: 3.5; }
.ill-membrane { fill: var(--surface); stroke: var(--primary); stroke-width: 1.75; }
.ill-envelope { fill: var(--feeling); stroke: var(--plum); stroke-width: 2.25; }
.ill-capsid { fill: var(--surface); stroke: var(--primary); stroke-width: 2; }
.ill-line { fill: none; stroke: var(--primary); stroke-width: 1.75; }
.ill-line-plum { fill: none; stroke: var(--plum); stroke-width: 1.75; }
.ill-strand { fill: none; stroke: var(--primary); stroke-width: 3.25; }
.ill-strand-plum { fill: none; stroke: var(--plum); stroke-width: 3.25; }
.ill-dot { fill: var(--plum); stroke: var(--surface); stroke-width: 1.5; }
.ill-dot-ink { fill: var(--primary); stroke: none; }
.ill-dot-soft { fill: var(--care); stroke: var(--primary); stroke-width: 1; }
.ill-paper { fill: var(--surface); stroke: var(--divider); stroke-width: 1.5; }
.ill-band { fill: var(--plum); fill-opacity: 0.18; stroke: none; }
.ill-dash { fill: none; stroke: var(--primary); stroke-width: 1.25; stroke-dasharray: 4 4; }
.illustration-thumb .ill-line, .illustration-thumb .ill-line-plum, .illustration-thumb .ill-dash { stroke-width: 3; }
.illustration-thumb .ill-field { opacity: 0.6; }
.topic-list li a { display: flex; align-items: center; gap: 10px; }

/* Gateway: the anonymous threshold. Mobile-first: the card (and its primary control) renders FIRST so
   the Google button lands inside the first screen of a phone; the explanatory copy follows. Desktop
   restores reading order (copy left, card right) via grid placement. */
.gateway-page main { max-width: 1120px; padding-top: 0; }
.gateway {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; gap: 14px; padding: 14px 0 28px; border-radius: 28px;
}
.gateway-copy { order: 2; }
.gateway-card { order: 1; }
.gateway-compact { padding-top: 36px; min-height: 60vh; align-content: center; }
.weave-sky { position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: linear-gradient(170deg, var(--canvas) 0%, var(--working) 58%, var(--feeling) 100%); }
.weave-sky-svg { width: 100%; height: 100%; display: block; }
.sky-glow { stroke: none; opacity: 0.55; }
.sky-glow-a { fill: var(--surface); }
.sky-glow-b { fill: var(--care); opacity: 0.45; }
.sky-strand { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; opacity: 0.85; }
.sky-strand-a { stroke: var(--primary); stroke-width: 7; }
.sky-strand-b { stroke: var(--plum); stroke-width: 7; }
.sky-strand-c { stroke: var(--primary); stroke-width: 3.5; opacity: 0.45; }
.sky-knot { fill: var(--surface); stroke: var(--plum); stroke-width: 4; transform-box: fill-box; transform-origin: center; }
.gateway-copy { position: relative; padding: 6px 22px 0; max-width: 620px; }
.gateway-copy .display { font-size: clamp(30px, 6.4vw, 50px); margin: 4px 0 8px; }
.gateway-copy .lede { margin: 0; font-size: 18px; }
.gateway-card {
  position: relative; margin: 0 14px; padding: 18px 18px 18px; display: grid; gap: 14px;
  background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius);
  box-shadow: 0 18px 50px -30px rgba(46, 52, 48, 0.45);
}
.gateway-card .gateway-lead { margin: 0; }
.gateway-card .gateway-lead .eyebrow { margin: 0 0 2px; }
.gateway-card .gateway-lead .card-title { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(26px, 6vw, 34px); line-height: 1.15; margin: 0; }
.gateway-compact .gateway-card { max-width: 520px; width: calc(100% - 28px); justify-self: center; }
.gateway-card .display { font-size: clamp(28px, 6vw, 38px); margin: 4px 0 8px; }
.gateway-card .eyebrow { margin: 0; }
.gateway-fine { color: var(--muted); font-size: 15px; line-height: 1.5; margin: -4px 0 0; }
.google-form { margin: 0; }
.google-button {
  width: 100%; min-height: 56px; gap: 14px; border: 1.5px solid var(--control); background: #fff;
  color: var(--text); font-size: 18px; font-weight: 600; border-radius: 16px;
  transition: background-color 120ms ease-out, border-color 120ms ease-out, transform 100ms ease-out;
}
.google-button:hover { border-color: var(--primary); background: #fff; }
.google-button:active { transform: scale(0.99); background: var(--canvas); }
.google-button[aria-busy="true"] { color: var(--muted); border-color: var(--divider); cursor: progress; }
.google-mark { width: 22px; height: 22px; flex: 0 0 auto; }
.button.wide { width: 100%; }
.gateway-email { display: grid; gap: 12px; }
.gateway-email .field { display: grid; gap: 6px; }
.field-error { color: var(--error-text); font-size: 16px; margin: 0; }
.link-row { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; }
.assurances { list-style: none; margin: 4px 0 0; padding: 14px 0 0; display: grid; gap: 12px; border-top: 1px solid var(--divider); }
.assurances li { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; line-height: 1.5; color: var(--muted); }
.assurances strong { color: var(--text); font-weight: 600; }
.assurance-mark { width: 30px; height: 30px; flex: 0 0 auto; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mark-stroke { stroke: var(--primary); stroke-width: 2; fill: var(--working); }
.mark-stroke-plum { stroke: var(--plum); stroke-width: 2.2; fill: none; }
.mark-dot { fill: var(--plum); }
.gateway-secondary { display: grid; gap: 8px; padding-top: 4px; }
.gateway-secondary .quiet { margin: 0; }

/* Motion: strands draw themselves in from both edges, knots settle, then one slow breath at rest. */
@media (prefers-reduced-motion: no-preference) {
  .sky-strand { stroke-dashoffset: 1; animation: sky-draw 2200ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards; }
  .sky-strand-b { animation-delay: 260ms; }
  .sky-strand-c { animation-delay: 620ms; animation-duration: 2600ms; }
  .sky-knot { opacity: 0; transform: scale(0.4); animation: sky-knot 520ms cubic-bezier(0.34, 1.3, 0.64, 1) forwards; }
  .sky-knot-1 { animation-delay: 1500ms; }
  .sky-knot-2 { animation-delay: 1750ms; }
  .sky-knot-3 { animation-delay: 1950ms; }
  .sky-knot-4 { animation-delay: 2150ms; }
  .weave-sky-svg { animation: sky-breathe 9s ease-in-out 2.6s infinite alternate; }
  @keyframes sky-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
  @keyframes sky-knot { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: scale(1); } }
  @keyframes sky-breathe { from { transform: translateY(0); } to { transform: translateY(-7px); } }
}

@media (min-width: 900px) {
  .gateway { grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); align-items: center; gap: 40px; padding: 56px 40px 56px 48px; min-height: 560px; }
  .gateway-copy { order: 1; }
  .gateway-card { order: 2; }
  .gateway-compact { grid-template-columns: 1fr; }
  .gateway-copy { padding: 0; }
  .gateway-card { margin: 0; padding: 28px 28px 24px; }
}
.review-status {
  display: inline-flex; min-height: 36px; align-items: center; margin: 0 0 12px;
  border: 1px solid var(--plum); border-radius: 999px; padding: 5px 12px;
  color: var(--plum); background: var(--surface); font-size: 15px; font-weight: 600;
}
.resource-feature {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr); gap: 28px;
  background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius);
  padding: 30px; margin: 12px 0 40px;
}
.resource-feature h2 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(28px, 4vw, 38px); font-weight: 400; }
.resource-feature-copy .button { margin-top: 16px; }
.resource-principles { display: grid; gap: 12px; align-content: center; }
.resource-principles p { margin: 0; padding: 14px 16px; border-radius: 16px; background: var(--canvas); }

.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 20px; font-size: 16px; }
.article-shell { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 28px; align-items: start; }
.editorial-article { min-width: 0; }
.article-pages { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.article-pages.split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.editorial-page {
  min-width: 0; background: var(--surface); border: 1px solid var(--divider);
  border-radius: var(--radius); padding: 24px 26px;
}
.editorial-page h2 { font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 400; margin-top: 24px; }
.editorial-page h3 { font-size: 21px; margin-top: 24px; }
.editorial-page p { line-height: 1.62; }
.editorial-page a { text-underline-offset: 3px; }
.content-anchor { display: block; position: relative; top: -16px; visibility: hidden; }
.table-caption { color: var(--muted); font-size: 15px; font-style: italic; }

/* Sourced transmission risk + testing windows (owner: core/risk.py). Route switching is CSS-only:
   a :has() rule shows the checked route; without :has() every route is listed under its own title. */
.risk-panel { display: grid; gap: 18px; margin: 12px 0 22px; overflow-wrap: break-word; }
.risk, .testing { background: var(--surface); border: 1px solid var(--divider); border-radius: 20px; padding: 18px 18px 14px; }
.editorial-page .risk-title { font-size: 19px; margin: 0 0 10px; }
.risk-bottom-line { margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: var(--working); }
.risk-routes { border: 0; margin: 0 0 12px; padding: 0; min-width: 0; }
.risk-routes legend { padding: 0; margin-bottom: 8px; color: var(--muted); font-size: 15px; }
.risk-pills { position: relative; display: flex; flex-wrap: wrap; gap: 8px; }
.risk-pill {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 18px; border-radius: 999px;
  border: 1.5px solid var(--control); background: var(--surface); color: var(--text); font-weight: 600;
  cursor: pointer; user-select: none; -webkit-user-select: none;
}
.risk-route-input:checked + .risk-pill { background: var(--primary); border-color: var(--primary); color: #fff; }
.risk-route-input:focus-visible + .risk-pill { outline: 3px solid var(--plum); outline-offset: 2px; }
.risk-route { display: none; }
.risk-route[data-route="general"] { display: block; }
.risk-switch:has(.risk-route-input:not([value="general"]):checked) .risk-route[data-route="general"] { display: none; }
.risk-switch:has(.risk-route-input[value="oral"]:checked) .risk-route[data-route="oral"],
.risk-switch:has(.risk-route-input[value="vaginal"]:checked) .risk-route[data-route="vaginal"],
.risk-switch:has(.risk-route-input[value="anal"]:checked) .risk-route[data-route="anal"],
.risk-switch:has(.risk-route-input[value="kissing"]:checked) .risk-route[data-route="kissing"] { display: block; }
.risk-route-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@supports not selector(:has(*)) {
  .risk-routes { display: none; }
  .risk-route, .risk-route[data-route="general"] { display: block; margin-bottom: 14px; }
  .risk-route-title { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; font-weight: 700; margin: 0 0 6px; }
}
.risk-cells { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.risk-cell { min-width: 0; border: 1.5px solid var(--divider); border-radius: 16px; padding: 14px 16px; background: var(--canvas); }
.risk-cell-no_barrier { border-top: 4px solid var(--plum); }
.risk-cell-barrier { border-top: 4px solid var(--primary); }
.editorial-page .risk-cell p { margin: 0 0 8px; }
.editorial-page .risk-cell .risk-cell-title { font-weight: 700; margin-bottom: 6px; }
.risk-asterisk {
  display: inline-block; min-width: 24px; min-height: 24px; margin-left: 2px; text-align: center;
  font-weight: 700; color: var(--plum); text-decoration: none;
}
.risk-asterisk:focus-visible { outline: 3px solid var(--plum); outline-offset: 1px; border-radius: 6px; }
.risk-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; padding: 0; }
.risk-tag {
  display: inline-block; font-size: 14px; font-weight: 600; line-height: 1.3; border-radius: 999px;
  padding: 3px 10px; border: 1px solid var(--divider); background: var(--surface); color: var(--text);
}
.risk-tier { background: var(--more); border-color: var(--more); }
.risk-tag.confidence-high { background: var(--primary); border-color: var(--primary); color: #fff; }
.risk-tag.confidence-medium { background: var(--working); border-color: var(--primary); }
.risk-tag.confidence-low { background: transparent; border: 1px dashed var(--control); }
.editorial-page .risk-conditions, .editorial-page .risk-refs { font-size: 15px; color: var(--muted); line-height: 1.45; }
.editorial-page .risk-subhead { font-size: 17px; margin: 18px 0 8px; }
.risk-modifiers { margin: 0; padding-left: 20px; display: grid; gap: 8px; line-height: 1.55; }
.risk-more { margin-top: 12px; }
.risk-more .risk-modifiers { margin-top: 6px; }
.risk-sources { margin-top: 14px; }
.risk-sources summary, .testing-more summary, .risk-more summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.risk-sources ol { margin: 6px 0 0; padding-left: 22px; display: grid; gap: 6px; font-size: 15px; overflow-wrap: anywhere; }
.risk-note { background: var(--surface); border: 1px dashed var(--control); border-radius: 16px; padding: 14px 16px; }
.editorial-page .risk-note p { margin: 0 0 8px; }
.risk-legend { display: grid; gap: 6px; margin: 0 0 10px; }
.risk-legend div { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.risk-legend dt, .risk-legend dd { margin: 0; }
.editorial-page .testing-headline { font-weight: 600; margin: 0 0 10px; }
.editorial-page .testing-urgent { margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: var(--care); }
.assays { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.assay { min-width: 0; border: 1.5px solid var(--divider); border-radius: 16px; padding: 12px 14px; background: var(--canvas); }
.editorial-page .assay p { margin: 0 0 6px; }
.editorial-page .assay .assay-test { font-weight: 700; }
.testing-more { margin-top: 12px; }
@media (max-width: 560px) {
  .risk, .testing { padding: 14px 12px 10px; }
  .risk-cell, .assay { padding: 12px; }
}
.table-scroll {
  max-width: 100%; overflow-x: auto; margin: 18px 0 24px; border: 1px solid var(--divider);
  border-radius: 16px; background: var(--surface); -webkit-overflow-scrolling: touch;
}
.table-scroll:focus-visible { outline: 3px solid var(--plum); outline-offset: 3px; }
table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 16px; line-height: 1.48; }
th, td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--divider); }
th { background: var(--working); font-weight: 700; }
td p { margin: 0; }
tbody tr:last-child td { border-bottom: 0; }
.resource-nav {
  position: sticky; top: 16px; display: grid; gap: 8px; max-height: calc(100vh - 32px); overflow: auto;
  background: var(--surface); border: 1px solid var(--divider); border-radius: 18px; padding: 14px 16px;
}
.resource-nav-home { min-height: 44px; display: flex; align-items: center; font-weight: 700; }
.resource-nav details { border-top: 1px solid var(--divider); }
.resource-nav summary { font-size: 16px; }
.resource-nav ul { list-style: none; padding: 0 0 4px; margin: 0; }
.resource-nav li a { display: flex; min-height: 40px; align-items: center; padding: 5px 4px; font-size: 15px; }
.resource-nav a[aria-current="page"] { color: var(--text); font-weight: 700; text-decoration-thickness: 2px; }

@media (max-width: 1280px) {
  .article-shell { grid-template-columns: 1fr; }
  .resource-nav {
    position: static; max-height: none; grid-row: 1;
    grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start;
    padding: 12px;
  }
  .resource-nav-home { grid-column: 1 / -1; padding: 0 8px; }
  .resource-nav details { border: 1px solid var(--divider); border-radius: 12px; padding: 0 10px; }
  .resource-nav details[open] { grid-column: 1 / -1; }
  .resource-nav details[open] ul { columns: 2; column-gap: 24px; }
  .resource-nav li { break-inside: avoid; }
}

@media (max-width: 900px) {
  .resource-hero, .article-hero { grid-template-columns: 1fr; padding-top: 24px; }
  .illustration-hero { max-width: 300px; }
  .resource-feature { grid-template-columns: 1fr; }
  .article-pages.split { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .resource-nav { grid-template-columns: 1fr; }
  .resource-nav details[open] ul { columns: 1; }
}

@media (max-width: 560px) {
  main { padding-left: 16px; padding-right: 16px; }
  .bar { padding-left: 16px; padding-right: 16px; }
  .whoami { width: 100%; }
  .resource-hero, .article-hero { gap: 14px; }
  .illustration-hero { max-width: 260px; }
  .resource-feature, .editorial-page { padding: 20px 18px; }
  .editorial-page h2 { font-size: 26px; }
}

/* Author display rules must never override the native hidden state. */
[hidden] { display: none !important; }

.source-samples { max-width: 760px; color: var(--muted); font-size: 16px; line-height: 1.5; }

.public-resource main { max-width: 1280px; }

@media (min-width: 681px) and (max-width: 1280px) {
  .public-resource table { min-width: 100%; }
}

/* A blank table cell is the line a reader writes on — the prompt sheet on
   /resources/sexual-health/next-steps/ is built from them. No other table in the collection has
   an empty cell, so this selector is specific to that use by construction. */
td:empty { height: 2.4em; }

/* The public resource pages double as the no-account printable alternative (expansion R6, R14),
   so printing one must yield the article and nothing else: the bar, breadcrumbs, hero illustration
   and sidebar are navigation rather than content, and the on-screen table scroller cannot paginate.
   Every rule below is print-only; screen rendering is untouched. */
@media print {
  .skip, .bar, .net, .messages, .breadcrumbs, .resource-nav, .article-figure { display: none; }
  body { background: #fff; }
  main, .public-resource main { max-width: none; padding: 0; }
  .article-hero { display: block; padding: 0 0 12px; }
  .article-shell, .article-pages, .article-pages.split { display: block; }
  .editorial-page { background: none; border: 0; border-radius: 0; padding: 0; margin-bottom: 14px; }
  .editorial-page h2, .editorial-page h3 { break-after: avoid-page; page-break-after: avoid; }
  .table-scroll { overflow: visible; }
  table { min-width: 0; }
  th, td { border: 1px solid #555; }
  td:empty { height: 2.1cm; }
  a { color: inherit; text-decoration: none; }
}
