/* CitePack Decision Map — the frame around every page (production-readiness audit 2026-10-15 § 5, items 3, 6, 7):
 * one focus ring, the skip link, the phone page menu, the strip key, type and contrast. Loaded last, so it settles what
 * the page files leave open; it removes no display. */

/* contrast: every small grey on paper, on a grey tile and on white reads at 4.5:1 or better */
.lens small { color: var(--muted); }

/* one designed focus ring, keyboard only; a region focused by the app (the page, a drawer, a pop-up) shows none */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--first); outline-offset: 2px; }
.switch:has(select:focus-visible) .ms-face, .hastip:focus-visible, button.cf-mini:focus-visible { outline: 2px solid var(--first); outline-offset: 2px; }
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }
.skip { position: fixed; top: 8px; left: 8px; z-index: 200; padding: 9px 16px; border-radius: 10px; background: var(--navy); color: var(--card);
  font-size: 14px; font-weight: 600; box-shadow: 0 8px 24px rgba(19, 33, 63, .3); transform: translateY(-180%); transition: transform .14s ease-out; }
.skip:focus, .skip:focus-visible { transform: none; outline: 2px solid var(--card); outline-offset: -4px; }

/* type: headlines in the one sans, semibold; the serif stays only for words an AI engine wrote */
.hero h1 { font: 650 clamp(24px, 2.5vw, 34px)/1.18 var(--sans); letter-spacing: -.022em; }
.hero2 { font: 500 17px/1.4 var(--sans); }
.qhero h1 { font: 650 clamp(23px, 2.4vw, 32px)/1.22 var(--sans); letter-spacing: -.02em; }
.cf-ph h2 { font: 650 28px/1.15 var(--sans); letter-spacing: -.02em; }
.cf-ord b { font: 650 26px/1.1 var(--sans); letter-spacing: -.02em; }
.sy-big { font: 650 24px/1.15 var(--sans); letter-spacing: -.02em; }

/* the strip key: what each colour of the answer strip means, said once beside it */
.st-key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 7px 0 0; font-size: 12px; line-height: 1.4; color: var(--muted); }
.st-key .sk-l { color: var(--ink2); font-weight: 550; }
.st-key .sk { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.st-key .st-c { display: inline-block; width: 14px; height: 8px; flex: none; }

/* the page menu: the side list on a wide screen; on a phone a button that opens it as a sheet */
.nav-tog { display: none; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes dim-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 760px) {
  .nav { overflow: visible; padding: 8px 16px; }
  .nav-tog { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 12px 9px 14px; border: 1px solid var(--line2); border-radius: 10px;
    background: var(--card); text-align: left; font-size: 14px; box-shadow: var(--shadow); }
  .nav-tog .nt-l { color: var(--muted); font-size: 12.5px; }
  .nav-tog b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
  .nav-tog .nt-c::after { content: "▾"; color: var(--muted); font-size: 12px; }
  .nav > ul { display: none; }
  .nav.open::before { content: ""; position: fixed; inset: 0; z-index: 94; background: rgba(21, 23, 28, .34); animation: dim-in .16s ease-out; }
  .nav.open > ul { display: grid; gap: 2px; position: fixed; z-index: 95; left: 0; right: 0; bottom: 0; width: auto; max-height: 82vh; overflow-y: auto;
    padding: 12px 12px calc(18px + env(safe-area-inset-bottom)); background: var(--paper); border-radius: 18px 18px 0 0;
    box-shadow: 0 -18px 48px rgba(20, 22, 28, .22); animation: sheet-up .18s ease-out; overscroll-behavior: contain; }
  .nav.open .lens { flex-direction: column; gap: 1px; white-space: normal; padding: 10px 12px; font-size: 15px; }
  .nav.open .ngroup { margin: 12px 12px 2px; white-space: normal; align-self: auto; }
  .nav.open .qnav b { font-size: 14px; }
  .nav.open .qnav small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; }
  .nav-tog[aria-expanded="true"] .nt-c::after { content: "▴"; }

  /* the Viewing bar with its answer strip scrolls with the page on a phone: the strip and its key stay, the screen stays free */
  .subj:has(.strip) { position: static; }
  /* the strip key and the engine choice wrap on a phone: every entry is on screen, none behind a sideways swipe */
  .st-key { gap: 3px 12px; font-size: 11.5px; margin-top: 6px; }
  .st-key .sk-l { flex-basis: 100%; }
  .qsubj .qscope { display: flex; flex-wrap: wrap; }
  .qsubj .qscope .seg { flex: 1 1 auto; justify-content: center; }
  .qsubj { padding-top: 10px; padding-bottom: 10px; }
  /* the answer drawer is a sheet over the page on a phone: the page behind dims and a tap on it closes the drawer */
  .drawer-dim { pointer-events: auto; background: rgba(21, 23, 28, .3); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* AI engines on a phone (item 8): a row's explanation once, in the first full card; what an engine shows nothing for,
   together on one line at its card's foot */
@media (max-width: 760px) {
  .ecard:not(.desc) .erow .el small { display: none; }
  .erow.enone .el b { color: var(--muted); font-weight: 550; font-size: 13px; }
  .erow.enone .nol, .erow.enone .nf, .erow.enone .nf > div, .erow.enone .nol .sub { display: inline; margin: 0; }
  .erow.enone .nf + .nf::before { content: " · "; color: var(--muted); }
}
@media (max-width: 760px) { .erow.enone .nol .sub::before { content: " · "; color: var(--muted); } }

/* a pointer click never leaves a ring behind; the keyboard always shows where it is */
html:not(.kbd) :focus-visible { outline: none; }

