/* Section rhythm (2026-11-29): reading pages alternate deep plum and light paper, in the book's
   own colors, so each section reads as its own block. The build marks every second reading
   section with class="paper". Loaded last. */
:root { --pp-bg: #e3dcea; --pp-card: #efe9f1; --pp-ink: #1b1538; --pp-text: #3a3460; --pp-muted: #6c6691; --pp-line: #e6e0f3; --pp-accent: #6a48e0; --pp-wash: #efeafd; }

section.paper { background: var(--pp-bg) !important; color: var(--pp-text) !important; position: relative; }
section.paper::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(106,72,224,.25), transparent); }
section.paper h2, section.paper h3, section.paper h4, section.paper b, section.paper strong, section.paper .plain-h { color: var(--pp-ink) !important; }
section.paper p, section.paper li, section.paper dd, section.paper td, section.paper figcaption { color: var(--pp-text) !important; }
section.paper .sub-h, section.paper .muted, section.paper .lc-note { color: var(--pp-muted) !important; }
section.paper a:not(.btn):not(.lesson-card) { color: var(--pp-accent) !important; }

/* containers on paper: white cards with a soft edge */
section.paper .proof, section.paper .demo, section.paper .key-idea, section.paper .panel, section.paper .lesson-card,
section.paper .idea-card, section.paper .next-grid a, section.paper .table-wrap {
  background: var(--pp-card) !important; box-shadow: 0 0 0 1px var(--pp-line), 0 18px 40px -28px rgba(40,24,110,.35) !important; color: var(--pp-text) !important; }
section.paper .lesson-card b { color: var(--pp-ink) !important; }
section.paper .lesson-card > span:last-child { color: var(--pp-muted) !important; }
section.paper .lesson-card:hover { box-shadow: 0 0 0 1px #b9a8f5, 0 20px 40px -24px rgba(106,72,224,.45) !important; }
section.paper .key-idea { background: var(--pp-wash) !important; box-shadow: inset 4px 0 0 var(--pp-accent), 0 0 0 1px var(--pp-line) !important; }
section.paper .formula { background: var(--pp-wash) !important; color: var(--pp-ink) !important; box-shadow: inset 0 0 0 1px var(--pp-line) !important; }
section.paper .qed { color: var(--pp-ink) !important; }
section.paper table.data { background: var(--pp-card); border-radius: 16px; box-shadow: 0 0 0 1px var(--pp-line); overflow: hidden; }
section.paper table.data thead th { background: var(--pp-wash) !important; color: #4b4482 !important; }
section.paper table.data tbody td { color: var(--pp-text) !important; border-top-color: var(--pp-line) !important; }
section.paper table.data tbody td b { color: var(--pp-ink) !important; }
section.paper table.data tbody tr:hover td { background: #faf8ff !important; }
section.paper .btn-soft { background: var(--pp-wash) !important; color: var(--pp-ink) !important; box-shadow: inset 0 0 0 1px var(--pp-line) !important; }
section.paper figure img { box-shadow: 0 0 0 1px var(--pp-line), 0 20px 40px -26px rgba(40,24,110,.4); }

/* section headings get a clear start */
.ls > .wrap > h2.plain-h, .idea-sec h2, .course-part h2.plain-h { position: relative; padding-top: 18px; }
.ls > .wrap > h2.plain-h::before, .course-part h2.plain-h::before { content: ''; position: absolute; top: 0; left: 0; width: 44px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, #a78bfa, #f0abfc); }
section.paper .ls-h::before { background: var(--pp-accent); }
.ls { padding: 80px 0 72px !important; }

/* note tiles: note names are never loose letters */
.nr { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: baseline; margin: 0 1px; }
.nt { display: inline-grid; place-items: center; min-width: 1.9em; height: 1.65em; padding: 0 .35em; border-radius: 7px; font: 600 .86em/1 'Inter', sans-serif; font-variant-numeric: tabular-nums;
  background: rgba(167,139,250,.18); color: #fff; box-shadow: inset 0 0 0 1px rgba(206,194,255,.28); position: relative; top: -.08em; }
section.paper .nt { background: var(--pp-wash); color: var(--pp-ink); box-shadow: inset 0 0 0 1px #d8cff5; }
h1 .nt, h2 .nt, h3 .nt { font-size: .7em; }

/* ---- content components (see docs/COMPONENTS.md) ---- */
.ls .in-short { margin: 0 0 30px; padding: 22px 26px; border-radius: 18px; max-width: 760px; box-sizing: border-box; background: linear-gradient(135deg, rgba(167,139,250,.22), rgba(240,171,252,.08)); box-shadow: 0 0 0 1px rgba(206,194,255,.22); }
.ls .in-short h3 { margin: 0 0 10px !important; font-size: 17px !important; color: #fff !important; }
.ls .in-short ul { margin: 0 !important; padding-left: 20px !important; }
.ls .in-short li { font-size: 17.5px !important; margin: 4px 0; }
section.paper .in-short { background: linear-gradient(135deg, #ece5ff, #f7efff) !important; box-shadow: 0 0 0 1px var(--pp-line) !important; }
.ls .steps { list-style: none; counter-reset: s; padding: 0 !important; margin: 26px 0 !important; display: grid; gap: 12px; max-width: 760px !important; }
.ls .steps > li { counter-increment: s; position: relative; padding: 18px 20px 18px 66px !important; border-radius: 16px; background: linear-gradient(180deg, var(--card-top), var(--card-bot)); box-shadow: 0 0 0 1px var(--card-edge); max-width: none !important; }
.ls .steps > li::before { content: counter(s); position: absolute; left: 18px; top: 17px; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font: 700 15px 'Inter', sans-serif; color: #fff; background: linear-gradient(135deg, #8b5cf6, #c084fc); }
.ls .steps > li > b:first-child { display: block; color: #fff; margin-bottom: 2px; }
section.paper .steps > li { background: var(--pp-card) !important; box-shadow: 0 0 0 1px var(--pp-line), 0 14px 30px -24px rgba(40,24,110,.35) !important; }
.ls .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 26px 0; max-width: 1000px; }
.ls .cards > div { padding: 20px 22px; border-radius: 16px; background: linear-gradient(180deg, var(--card-top), var(--card-bot)); box-shadow: 0 0 0 1px var(--card-edge); }
.ls .cards > div h3 { margin: 0 0 6px !important; font-size: 17.5px !important; color: #fff !important; }
.ls .cards > div p { margin: 0 !important; font-size: 16.5px !important; line-height: 1.6 !important; }
section.paper .cards > div { background: var(--pp-card) !important; box-shadow: 0 0 0 1px var(--pp-line), 0 14px 30px -24px rgba(40,24,110,.35) !important; }
.ls .two-col { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 40px; align-items: start; margin: 26px 0; max-width: 1080px; }
.ls .two-col > :last-child { position: sticky; top: 90px; }
.ls .compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 26px 0; max-width: 900px; }
.ls .compare > div { padding: 20px 22px; border-radius: 16px; background: rgba(255,255,255,.04); box-shadow: 0 0 0 1px var(--card-edge); }
.ls .compare > div:first-child { box-shadow: inset 4px 0 0 #a78bfa, 0 0 0 1px var(--card-edge); }
.ls .compare > div:last-child { box-shadow: inset 4px 0 0 #f0abfc, 0 0 0 1px var(--card-edge); }
.ls .compare h3 { margin: 0 0 6px !important; font-size: 17px !important; }
section.paper .compare > div { background: var(--pp-card) !important; }
.ls .quote { margin: 28px 0; padding: 4px 0 4px 24px; max-width: 720px; border-left: 3px solid #a78bfa; }
.ls .quote p { font-size: 21px !important; line-height: 1.55 !important; color: #fff !important; margin: 0 0 8px !important; }
.ls .quote cite { font-style: normal; font-size: 15px; color: #b6afd9; }
section.paper .quote p { color: var(--pp-ink) !important; } section.paper .quote cite { color: var(--pp-muted); }
@media (max-width: 860px) { .ls .two-col, .ls .compare { grid-template-columns: 1fr; gap: 18px; } .ls .two-col > :last-child { position: static; } }

/* live formula calculators */
.calc { margin: 30px 0; padding: 26px 28px 24px; border-radius: 20px; max-width: 760px; box-sizing: border-box;
  background: radial-gradient(120% 140% at 0% 0%, rgba(124,92,255,.28), transparent 55%), linear-gradient(180deg, #241c5c, #191446);
  box-shadow: 0 0 0 1px rgba(206,194,255,.22), 0 30px 60px -34px rgba(20,10,70,.9); color: #e9e4ff; }
.calc-head h3 { margin: 0 0 10px !important; font-size: 19px !important; color: #fff !important; }
.calc-formula { font: 500 18px/1.6 'Inter', sans-serif; color: #fff; padding: 12px 16px; border-radius: 12px; background: rgba(6,4,24,.45); overflow-wrap: anywhere; }
.calc var, .formula var, .proof var { font-family: 'Cambria Math', 'STIX Two Math', Georgia, serif; font-style: italic; font-size: 1.08em; }
.calc-in { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 16px; margin: 18px 0 6px; }
.calc-in label { display: flex; flex-direction: column; gap: 6px; }
.calc-in label span { font-size: 13.5px; color: #c9c3ec; line-height: 1.35; }
.calc-in input { font: 600 17px 'Inter', sans-serif; color: #fff; background: rgba(255,255,255,.07); border: 0; border-radius: 12px; padding: 12px 14px; box-shadow: inset 0 0 0 1px rgba(206,194,255,.25); outline: none; }
.calc-in input:focus { box-shadow: inset 0 0 0 2px #a78bfa; }
.calc-steps { margin: 14px 0 0 !important; padding: 0 !important; list-style: none; counter-reset: st; display: grid; gap: 8px; max-width: none !important; }
.calc-steps li { counter-increment: st; position: relative; padding: 10px 14px 10px 48px !important; border-radius: 12px; background: rgba(255,255,255,.05); font-size: 16.5px !important; line-height: 1.55 !important; color: #e2ddf7 !important; overflow-wrap: anywhere; max-width: none !important; }
.calc-steps li::before { content: counter(st); position: absolute; left: 12px; top: 10px; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font: 700 13px 'Inter', sans-serif; background: rgba(167,139,250,.3); color: #fff; }
.calc-steps .cl-small { font-size: 15px; color: #c9c3ec; }
.calc-res { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: linear-gradient(90deg, rgba(167,139,250,.28), rgba(240,171,252,.14)); }
.calc-res span { font: 700 19px 'Inter', sans-serif; color: #fff; }
.calc-err { color: #fecaca !important; margin: 12px 0 0 !important; }
.calc-more { display: inline-block; margin-top: 12px; font-size: 15px; color: #c9b8ff !important; }
section.paper .calc { box-shadow: 0 0 0 1px rgba(60,40,150,.3), 0 30px 60px -30px rgba(40,24,110,.55) !important; }
section.paper .calc h3, section.paper .calc b, section.paper .calc span { color: #fff !important; }
section.paper .calc li, section.paper .calc p { color: #e2ddf7 !important; }
section.paper .calc label span { color: #c9c3ec !important; }
section.paper .calc a { color: #d8ccff !important; }
section.paper .calc .nt { background: rgba(167,139,250,.22); color: #fff; box-shadow: inset 0 0 0 1px rgba(206,194,255,.3); }
.lab-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.lab-grid .calc { margin: 0; max-width: none; }
@media (max-width: 980px) { .lab-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .calc { padding: 20px 18px; } .calc-formula { font-size: 16px; } }

/* home quote slider with arrows */
#quote .q-stage { display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; align-items: center; gap: 24px; }
#quote .q-body { min-height: 190px; display: flex; flex-direction: column; justify-content: center; }
#quote .q-arrow { width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(206,194,255,.25); transition: background .15s; }
#quote .q-arrow:hover { background: rgba(167,139,250,.3); }
#quote .q-arrow svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#quote .q-foot { display: flex; align-items: center; gap: 16px; margin: 26px 80px 0; }
#quote .q-foot .q-progress { flex: 1; margin: 0; }
#quote #q-count { font: 600 14px 'Inter', sans-serif; color: #b6afd9; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 700px) { #quote .q-stage { grid-template-columns: 1fr 1fr; } #quote .q-body { grid-column: 1 / -1; grid-row: 1; min-height: 0; } #quote .q-arrow { justify-self: start; } #quote #q-next { justify-self: end; } #quote .q-foot { margin: 20px 0 0; } }

/* footer */
footer.end { background: radial-gradient(90% 120% at 10% 0%, rgba(124,92,255,.18), transparent 60%), #0b0718 !important; padding: 72px 0 36px !important; border-top: 1px solid rgba(206,194,255,.1) !important; }
.end-cta { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 28px; align-items: center; padding: 26px 30px; border-radius: 22px; background: linear-gradient(120deg, #2c2170, #1c1650 60%, #2a1a5c); box-shadow: 0 0 0 1px rgba(206,194,255,.2), 0 40px 80px -50px rgba(124,92,255,.8); }
.end-cta img { width: 84px; height: auto; border-radius: 6px; box-shadow: 0 16px 30px -12px rgba(0,0,0,.8); }
.end-cta h3 { margin: 0 0 6px; font-size: 24px; color: #fff; }
.end-cta p { margin: 0; color: #cfc8f2; font-size: 16.5px; }
.end-cta-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.end-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 32px; margin: 56px 0 44px; }
.end-col { display: flex; flex-direction: column; gap: 4px; }
.end-col h4 { margin: 0 0 10px; font: 600 15px 'Inter', sans-serif; color: #fff; }
.end-col a { color: #b6afd9 !important; font-size: 15px; line-height: 1.5; padding: 3px 0; text-decoration: none; }
.end-col a:hover { color: #fff !important; }
footer.end .legal { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 24px; border-top: 1px solid rgba(206,194,255,.1); color: #8d86b5; font-size: 14px; }
.legal-links { display: flex; gap: 20px; } .legal-links a { color: #8d86b5 !important; } .legal-links a:hover { color: #fff !important; }
@media (max-width: 980px) { .end-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .end-cta { grid-template-columns: auto 1fr; } .end-cta-btns { grid-column: 1 / -1; } }
@media (max-width: 520px) { .end-cta { grid-template-columns: 1fr; text-align: left; } .end-cta img { width: 70px; } }

/* resources page */
.res-head { padding: 40px 0 8px; }
.res-tools { display: grid; gap: 18px; }
.res-search { display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.res-search span { font-size: 14px; color: #c9c3ec; }
.res-search input { font: 500 17px 'Inter', sans-serif; color: #fff; background: rgba(255,255,255,.07); border: 0; border-radius: 14px; padding: 14px 18px; box-shadow: inset 0 0 0 1px rgba(206,194,255,.25); outline: none; }
.res-search input:focus { box-shadow: inset 0 0 0 2px #a78bfa; }
.res-jump { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.res-jump a { color: #c9b8ff; font-size: 15.5px; text-decoration: none; padding: 4px 0; border-bottom: 1px solid transparent; }
.res-jump a:hover { color: #fff; border-bottom-color: #a78bfa; }
.res-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 26px; }
.res-item { display: flex; flex-direction: column; gap: 10px; padding: 22px 24px; border-radius: 18px; background: linear-gradient(180deg, var(--card-top), var(--card-bot)); box-shadow: 0 0 0 1px var(--card-edge); }
.res-item[hidden], .res-topic[hidden] { display: none !important; }
.ls .res-item p { max-width: none; margin: 0; }
.ls .res-cite { font-size: 15.5px !important; line-height: 1.55 !important; color: #b9b2df !important; }
.ls .res-learn { font-size: 17px !important; line-height: 1.6 !important; color: #fff !important; }
.res-link { margin-top: auto; font-size: 15px; font-weight: 600; color: #c9b8ff !important; text-decoration: none; }
.res-link:hover { text-decoration: underline; }
section.paper .res-item { background: var(--pp-card) !important; box-shadow: 0 0 0 1px var(--pp-line), 0 14px 30px -24px rgba(40,24,110,.35) !important; }
section.paper .res-cite { color: var(--pp-muted) !important; }
section.paper .res-learn { color: var(--pp-ink) !important; }
.res-none { text-align: center; color: #c9c3ec; padding: 40px 0; }
@media (max-width: 860px) { .res-list { grid-template-columns: 1fr; } }

/* contrast fixes (tests/contrast.py) */
.btn-ink, .btn-purple, .btn-primary, .nav-right .btn-ink, .nav-links a.btn-ink { background: #6d4aea !important; color: #fff !important; }
.btn-ink:hover, .btn-primary:hover, .nav-right .btn-ink:hover { background: #5b39d6 !important; }
section.paper .key-idea h3, section.paper .in-short h3, section.paper .cards h3, section.paper .compare h3, section.paper .steps > li > b:first-child, section.paper .proof > b { color: var(--pp-ink) !important; }
.mx i, .matrix i, .nh i, .mtx i { color: #a6a0d2 !important; }
section.paper .calc a.calc-more:not(.btn) { color: #d8ccff !important; }
.hero p.body, .hero .book-hint { color: #cdc7ee !important; }

/* other works */
.works-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 26px; }
.works-item { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 22px; padding: 22px; border-radius: 18px; background: linear-gradient(180deg, var(--card-top), var(--card-bot)); box-shadow: 0 0 0 1px var(--card-edge); }
.works-cover img, .works-nocover { width: 110px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; display: block; box-shadow: 0 14px 28px -14px rgba(0,0,0,.8); background: #2a2060; }
.works-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ls .works-body h3 { margin: 0 !important; font-size: 19px !important; color: #fff !important; line-height: 1.3; }
.ls .works-sub { margin: 0 !important; font-size: 15px !important; color: #c9b8ff !important; }
.ls .works-sum { margin: 6px 0 0 !important; font-size: 16.5px !important; line-height: 1.6 !important; color: #ddd8f5 !important; }
.works-foot { margin-top: auto; padding-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.works-foot span { font-size: 14px; color: #b6afd9; }
section.paper .works-item { background: var(--pp-card) !important; box-shadow: 0 0 0 1px var(--pp-line), 0 14px 30px -24px rgba(40,24,110,.35) !important; }
section.paper .works-body h3 { color: var(--pp-ink) !important; } section.paper .works-sub { color: var(--pp-accent) !important; }
section.paper .works-sum { color: var(--pp-text) !important; } section.paper .works-foot span { color: var(--pp-muted) !important; }
@media (max-width: 900px) { .works-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .works-item { grid-template-columns: 84px minmax(0, 1fr); gap: 16px; padding: 18px; } .works-cover img, .works-nocover { width: 84px; } }
@media (min-width: 981px) { body.has-side .res-jump { display: none; } }
footer.end .legal { align-items: center; }
section.paper var, section.paper .formula var, section.paper .proof var { color: inherit !important; }
section.paper .proof ol > li::before { color: var(--pp-ink) !important; background: var(--pp-wash) !important; }
html, body { overflow-x: clip; }

/* row analyzer: notes and the nine groups as cards */
.note-strip { grid-template-columns: repeat(12, minmax(0, 1fr)) !important; }
@media (max-width: 1180px) { .note-strip { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; row-gap: 12px !important; } }
.win-title { margin: 40px 0 16px !important; font-size: 22px !important; color: #fff !important; }
.win-list { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.win-list .win { display: grid !important; grid-template-columns: auto 1fr !important; grid-template-areas: "n notes" "what what" "key key"; gap: 12px 12px !important; align-items: center; padding: 18px 20px !important; border: 0 !important; border-radius: 16px; background: linear-gradient(180deg, var(--card-top), var(--card-bot)); box-shadow: 0 0 0 1px var(--card-edge); }
.win-list .win > :nth-child(1) { grid-area: n; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: rgba(167,139,250,.22); color: #fff !important; font: 700 13px 'Inter', sans-serif; }
.win-list .win > :nth-child(2) { grid-area: notes; }
.win-list .win > :nth-child(3) { grid-area: what; }
.win-list .win > :nth-child(4) { grid-area: key; color: #b6afd9 !important; font-size: 14.5px; text-align: left !important; }
.win-list .win .win-what b { display: block; color: #fff; font-size: 16.5px; }
.win-list .win .win-what span { display: block; color: #cfc8f2; font-size: 15px; line-height: 1.45; margin-top: 2px; }
.win-list .win.t1 { box-shadow: inset 0 3px 0 #c084fc, 0 0 0 1px var(--card-edge); }
.win-list .win.t2 { box-shadow: inset 0 3px 0 #a78bfa, 0 0 0 1px var(--card-edge); }
.win-list .win.t3 { box-shadow: inset 0 3px 0 #8b7fd6, 0 0 0 1px var(--card-edge); }
.win-list .win.t4, .win-list .win.t5, .win-list .win.t6 { box-shadow: inset 0 3px 0 #5e5791, 0 0 0 1px var(--card-edge); }
@media (max-width: 1180px) { .win-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .win-list { grid-template-columns: 1fr; } }

/* softer light sections, steps as one column, readable notes on paper */
.ls ol.steps, .ls .steps { grid-template-columns: 1fr !important; }
section.paper .formula *, section.paper .proof li, section.paper .proof span { color: var(--pp-ink) !important; }
section.paper .formula .muted, section.paper .formula small { color: var(--pp-muted) !important; }
section.paper .cards > div h3, section.paper .compare > div h3, section.paper .in-short h3 { color: var(--pp-ink) !important; }
section.paper table.data tbody tr:hover td { background: #efe9f5 !important; }

/* ---- menus: one wide panel under the bar (Stripe layout, site colors) ---- */
@media (min-width: 1061px) {
  .nav .wrap { position: relative; }
  .nav-more { position: static !important; }
  .nav-more .menu.mega { position: absolute !important; left: 50% !important; right: auto !important; top: calc(100% + 1px) !important; transform: translate(-50%, -6px); width: min(1180px, calc(100vw - 48px)) !important; min-width: 0 !important; max-width: none !important;
    padding: 0 !important; border-radius: 0 0 22px 22px !important; overflow: hidden; background: #17113a !important; box-shadow: 0 0 0 1px rgba(206,194,255,.14), 0 40px 90px -30px rgba(0,0,0,.85) !important;
    opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s; display: block !important; }
  .nav-more.open .menu.mega { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0); transition: opacity .18s ease, transform .18s ease; }
  .mega-in { display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
  .mega-main { padding: 30px 34px 0; display: flex; flex-direction: column; }
  .mega-cols { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 0 30px; }
  .mega-col { display: flex; flex-direction: column; min-width: 0; }
  .mega-col h3 { margin: 0 0 12px !important; padding-bottom: 12px; border-bottom: 1px solid rgba(206,194,255,.14); font: 600 14.5px 'Inter', sans-serif !important; color: #e9e4ff !important; letter-spacing: 0; text-transform: none; }
  .nav-more .mega-col a { display: block; padding: 8px 0 !important; border-radius: 0 !important; background: none !important; text-decoration: none; }
  .nav-more .mega-col a b { display: block; font-size: 15.5px !important; font-weight: 600 !important; color: #c9b8ff !important; line-height: 1.3; transition: color .12s; }
  .nav-more .mega-col a span { display: block; font-size: 14px !important; color: #a9a3cf !important; line-height: 1.4; margin-top: 2px; }
  .nav-more .mega-col a:hover b { color: #fff !important; }
  .mega-foot { display: block; margin: 22px -34px 0; padding: 16px 34px; border-top: 1px solid rgba(206,194,255,.12); color: #c9b8ff !important; font-weight: 600; font-size: 15px; text-decoration: none; }
  .mega-foot:hover { color: #fff !important; }
  .mega-side { background: #1f1849; border-left: 1px solid rgba(206,194,255,.12); padding: 30px 26px; }
  .nav-more .mega-feature { display: flex !important; flex-direction: column; gap: 6px; padding: 0 !important; background: none !important; text-decoration: none; }
  .mega-feature img { width: 100%; height: 150px; object-fit: cover; object-position: center 25%; border-radius: 14px; margin-bottom: 10px; box-shadow: 0 0 0 1px rgba(206,194,255,.16); }
  .nav-more .mega-feature b { color: #fff !important; font-size: 17px !important; }
  .nav-more .mega-feature span { color: #b6afd9 !important; font-size: 14.5px !important; line-height: 1.45; }
  .mega-feature em { font-style: normal; color: #c9b8ff; font-weight: 600; font-size: 14.5px; margin-top: 4px; }
  .mega-feature:hover em { color: #fff; }
  .nav-more:not([data-many]) .mega-cols[style*="--cols:1"] { max-width: 420px; }
}
@media (max-width: 1060px) {
  .mega-side { display: none; }
  .mega-col h3 { margin: 14px 12px 6px; font: 600 14px 'Inter', sans-serif; color: #c9b8ff; }
  .mega-foot { display: block; padding: 12px; color: #c9b8ff; font-weight: 600; }
}
@media (min-width: 1061px) {
  .mega-col h3 { min-height: 2.7em; display: flex; align-items: flex-end; box-sizing: content-box; }
  .mega-cols[style*="--cols:1"] .mega-col h3 { min-height: 0; }
  .nav-more .menu.mega a.mega-foot { margin: 22px -34px 0 !important; padding: 16px 34px !important; border-radius: 0 !important; }
}
.lesson-grid-cards { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
@media (max-width: 1100px) { .lesson-grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
@media (max-width: 700px) { .lesson-grid-cards { grid-template-columns: 1fr !important; } }
.mega-feature img[src*="cover"] { object-fit: contain !important; background: #f4eee4; padding: 8px 0; box-sizing: border-box; }
.era .era-year, .era:nth-child(n) .era-year { color: #c9b8ff !important; }
.intent-grid a.intent { text-decoration: none; display: block; }
/* tool pages: the tool sits right under the title */
.page-hero + section { padding-top: 8px !important; }
.tool-lede { margin: 0 0 22px !important; font-size: 17px !important; color: #c9c3ec !important; }
.page-hero + section { padding-top: 36px !important; }

/* light sections always win over the old alternating-band rules */
html body main section.paper, html body main section.paper:nth-of-type(even) { background: var(--pp-bg) !important; }
html body main section.paper::after { display: none !important; }
/* article quotes are not the home quote band */
.ls .quote, .ls blockquote { background: none !important; box-shadow: none !important; }
section.paper blockquote p, section.paper .quote p { color: var(--pp-ink) !important; }
section.paper blockquote cite, section.paper .quote cite, section.paper cite i { color: var(--pp-muted) !important; }
section.paper i, section.paper em { color: inherit !important; }
:root { --pp-muted: #5a5482; }
html body main section.paper.paper.paper { background: var(--pp-bg) !important; }
section.paper table.data td, section.paper table.data td * { color: var(--pp-text) !important; }
section.paper table.data td .muted, section.paper table.data td.muted { color: var(--pp-muted) !important; }
section.paper .fb-key { background: #3a2f78 !important; color: #fff !important; border-color: #3a2f78 !important; }
section.paper .fb-key:hover { background: #5b39d6 !important; }
section.paper .fb-math .now { color: #6a2fb8 !important; } section.paper .fb-math .done { color: var(--pp-ink) !important; }
/* an invisible bridge between the menu name and its panel */
@media (min-width: 1061px) { .nav-more .menu.mega::before { content: ''; position: absolute; left: 0; right: 0; top: -14px; height: 14px; } .nav-more.open > button::after { content: ''; position: absolute; left: -12px; right: -12px; top: 100%; height: 22px; } .nav-more > button { position: relative; } }
section.paper .fb-ix, section.paper .fb-slot i, section.paper .fb span { color: var(--pp-muted) !important; }
section#five.paper table.data td:last-child, section#five.paper table.data td { color: var(--pp-text) !important; }
section.paper [class^="fb"] span:not(.nt):not(.now):not(.done) { color: var(--pp-muted) !important; }

/* formal proofs: line label, statement, justification */
.proof ol > li:has(.pl) { display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(140px, 32%); gap: 4px 14px; align-items: baseline; padding: 8px 0 !important; border-top: 1px solid rgba(206,194,255,.1); list-style: none; }
.proof ol:has(.pl) { padding-left: 0 !important; list-style: none; counter-reset: none; }
.proof ol:has(.pl) > li::before { content: none !important; display: none !important; }
.proof .pl { font: 700 14.5px 'Inter', sans-serif; color: #c9b8ff; }
.proof .pj { font-size: 14.5px; line-height: 1.45; color: #b6afd9; font-style: italic; }
section.paper .proof .pl { color: #5b39d6 !important; } section.paper .proof .pj { color: var(--pp-muted) !important; }
section.paper .proof ol > li:has(.pl) { border-top-color: var(--pp-line); }
@media (max-width: 700px) { .proof ol > li:has(.pl) { grid-template-columns: 36px minmax(0, 1fr); } .proof .pj { grid-column: 2; } }
/* FAQ pages */
.faq-list details.qa { max-width: 860px; }
/* flat menus: one list flowing into columns */
@media (min-width: 1061px) {
  .mega-col.flow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 30px; }
  .mega-cols[style*="--cols:1"] { max-width: none; }
  .mega-col:not(:has(h3)) { padding-top: 4px; }
}
@media (min-width: 1061px) {
  .nav-more .menu.mega.mega-sm { width: min(780px, calc(100vw - 48px)) !important; }
  .nav-more .menu.mega.mega-md { width: min(1000px, calc(100vw - 48px)) !important; }
  .menu.mega.mega-sm .mega-in { grid-template-columns: minmax(0, 1fr) 280px; }
}
section.paper, html body main section.paper.paper.paper { border-radius: 0 !important; }

/* light bands are back (owner, 2026-11-29): soft lavender, never stark white */
:root { --pp-bg: #e3dcea; --pp-card: #efe9f1; --pp-ink: #1b1538; --pp-text: #3a3460; --pp-muted: #5a5482; --pp-line: #d4cbe4; --pp-accent: #5b39d6; --pp-wash: #e9e2f3; }
html body main section.paper, html body main section.paper.paper.paper { background: var(--pp-bg) !important; }

/* ---- the hero look across the site: cover typeface, white with a purple glow, layered light ---- */
.page-hero { background: radial-gradient(640px 420px at 82% 20%, rgba(124,92,255,.42), transparent 70%), radial-gradient(480px 360px at 96% 90%, rgba(217,70,239,.22), transparent 70%), radial-gradient(560px 420px at 4% 100%, rgba(59,130,246,.12), transparent 70%) !important; }
.page-hero h1, .page-hero h1.plain-h.big { font-family: 'Cover', 'Fira Condensed', sans-serif !important; font-weight: 800 !important; text-transform: uppercase; letter-spacing: 0 !important; line-height: .95 !important; font-size: clamp(46px, 6vw, 88px) !important; color: #fff !important; text-shadow: 0 18px 54px rgba(124,92,255,.42); }
.page-hero .sub-h { font-size: clamp(18px, 1.6vw, 21px) !important; color: #d8d2f5 !important; max-width: 760px; }

/* images are never chopped (tests/crops.py) */
@media (min-width: 1061px) {
  .mega-feature img { height: auto !important; max-height: 230px; object-fit: contain !important; background: #140f38; }
}
.era-img img, .idea-pic img { object-position: 50% 18% !important; }
@media (max-width: 860px) {
  .era-img img, .idea-pic img { aspect-ratio: 4 / 5 !important; height: auto !important; max-height: 420px; width: 100%; }
  .era-img, .idea-pic { max-width: 340px; }
}
.era-img img { height: auto !important; aspect-ratio: auto !important; max-height: 460px; object-fit: contain !important; }
/* editions: the cover beside the heading */
.ed-top { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: center; }
.ed-cover { width: 220px; height: auto; border-radius: 6px; box-shadow: 0 0 0 1px rgba(206,194,255,.18), 0 40px 70px -30px rgba(0,0,0,.9), 0 0 80px -20px rgba(124,92,255,.5); transform: rotate(-2deg); }
@media (max-width: 700px) { .ed-top { grid-template-columns: 1fr; gap: 24px; } .ed-cover { width: 170px; } }
/* definitions before a proof */
.ls dl.defs { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px 16px; margin: 22px 0 28px; max-width: 760px; padding: 20px 22px; border-radius: 16px; background: rgba(255,255,255,.04); box-shadow: 0 0 0 1px var(--card-edge); }
.ls dl.defs dt { font: 700 15px 'Inter', sans-serif; color: #c9b8ff; }
.ls dl.defs dd { margin: 0; font-size: 17px; line-height: 1.6; color: #ddd8f5; }
section.paper dl.defs { background: var(--pp-card) !important; box-shadow: 0 0 0 1px var(--pp-line) !important; }
section.paper dl.defs dt { color: var(--pp-accent) !important; } section.paper dl.defs dd { color: var(--pp-text) !important; }
.proof .ps { min-width: 0; }

/* calculators: formula, where, how it works, then the lab */
.calc-where { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 16px 0 0; padding: 14px 16px; border-radius: 12px; background: rgba(6,4,24,.3); }
.calc-where .cw-h { grid-column: 1 / -1; font: 600 14px 'Inter', sans-serif; color: #c9b8ff; margin-bottom: 2px; }
.calc-where dt { font: 500 16px/1.5 'Inter', sans-serif; color: #fff; white-space: nowrap; }
.calc-where dd { margin: 0; font-size: 15.5px; line-height: 1.5; color: #d8d2f5; }
.calc-how { margin-top: 14px; }
.calc-how b { font-size: 14px; color: #c9b8ff; font-weight: 600; }
.calc-how p { margin: 4px 0 0 !important; font-size: 16px !important; line-height: 1.6 !important; color: #e2ddf7 !important; max-width: none !important; }
.calc-lab { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(206,194,255,.16); }
.calc-lab .cl-h { display: block; font-size: 14px; font-weight: 600; color: #c9b8ff; }
.calc-lab .calc-in { margin-top: 10px; }
section.paper .calc dt, section.paper .calc dd, section.paper .calc .calc-how p { color: #e2ddf7 !important; }
section.paper .calc dt { color: #fff !important; }
@media (max-width: 600px) { .calc-where { grid-template-columns: 1fr; } .calc-where dt { white-space: normal; } }
.calc-what { margin: 14px 0 0 !important; font-size: 16.5px !important; line-height: 1.55 !important; color: #fff !important; max-width: none !important; }
.calc-what b { display: block; font-size: 14px; font-weight: 600; color: #c9b8ff; margin-bottom: 2px; }
section.paper .calc .calc-what { color: #fff !important; }
/* the same layout for formulas written into pages (docs/COMPONENTS.md: formula card) */
.formula-card { margin: 30px 0; padding: 26px 28px 24px; border-radius: 20px; max-width: 760px; box-sizing: border-box; background: radial-gradient(120% 140% at 0% 0%, rgba(124,92,255,.22), transparent 55%), linear-gradient(180deg, #241c5c, #191446); box-shadow: 0 0 0 1px rgba(206,194,255,.22), 0 30px 60px -34px rgba(20,10,70,.9); }
.formula-card > h3 { margin: 0 0 10px !important; font-size: 19px !important; color: #fff !important; }
.ls .formula-card .formula { margin: 0 !important; max-width: none !important; background: rgba(6,4,24,.45) !important; color: #fff !important; box-shadow: none !important; }
.ls .formula-card .formula * { color: #fff !important; }
.ls .formula-card p, .ls .formula-card dd { color: #e2ddf7 !important; }
.ls .formula-card .calc { margin: 18px 0 0; padding: 18px 0 0; background: none; box-shadow: none; border-top: 1px solid rgba(206,194,255,.16); border-radius: 0; max-width: none; }
.ls .formula-card .calc .calc-head { display: none; }
/* logo mark beside the name in the ribbon */
.nav .brand { display: inline-flex; align-items: center; gap: 10px; }
.nav .brand .brand-mark { width: 28px; height: 28px; flex: none; border-radius: 7px; box-shadow: 0 0 0 1px rgba(206,194,255,.18); }
footer.end .brand .brand-mark { width: 24px; height: 24px; }
/* phone: the menu button never overflows */
@media (max-width: 1060px) { .nav .wrap { padding-left: 16px; padding-right: 16px; box-sizing: border-box; max-width: 100vw; } .nav-burger { margin-right: 0; flex: none; } }
@media (max-width: 1060px) {
  .nav .wrap { padding: 0 14px !important; margin: 0 !important; width: 100% !important; max-width: none !important; display: flex !important; align-items: center; gap: 10px; }
  .nav .brand { margin-right: auto; min-width: 0; }
  .nav-right { gap: 8px; }
  .nav-right .nav-ask { display: none !important; }
  .nav-burger { display: block !important; flex: none; }
}
@media (max-width: 380px) { .nav .brand span { font-size: 16px; } .nav-right .btn { padding: 8px 12px !important; } }
.topic-sum { margin-top: 18px !important; }
/* formula cards stay dark inside light sections: their text stays light */
section.paper .formula-card > h3 { color: #fff !important; }
section.paper .formula-card .calc-what b, section.paper .formula-card .calc-how b, section.paper .formula-card .cl-h, section.paper .formula-card .cw-h { color: #c9b8ff !important; }
section.paper .formula-card p, section.paper .formula-card dd, section.paper .formula-card li, section.paper .formula-card span { color: #e2ddf7 !important; }
section.paper .formula-card dt, section.paper .formula-card .calc-what, section.paper .formula-card b:not(.cl-h) { color: #fff !important; }
/* FAQ questions on light sections */
section.paper details.qa { background: var(--pp-card) !important; box-shadow: 0 0 0 1px var(--pp-line) !important; }
section.paper details.qa summary { color: var(--pp-ink) !important; }
section.paper details.qa .ans p, section.paper details.qa p.src { color: var(--pp-text) !important; }
section.paper details.qa a { color: var(--pp-accent) !important; }
.ak-top { padding-top: 12px !important; }
/* note tiles inside dark cards on light sections use the dark tile style */
section.paper .formula-card .nt, section.paper .calc .nt, section.paper .formula-card span.nt { background: rgba(167,139,250,.24) !important; color: #fff !important; box-shadow: inset 0 0 0 1px rgba(206,194,255,.32) !important; }
.tier.tier-4, .tier.tier-5 { color: #b3abd8 !important; }
/* definitions: one row per definition (dt + dd wrapped in a div) */
.ls dl.defs { display: block !important; padding: 6px 22px !important; }
.ls dl.defs > div { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 4px 20px; padding: 14px 0; border-top: 1px solid rgba(206,194,255,.14); }
.ls dl.defs > div:first-child { border-top: 0; }
.ls dl.defs dt { font: 600 16px/1.45 'Inter', sans-serif !important; color: #fff; }
.ls dl.defs dt .pl { display: inline-block; min-width: 30px; margin-right: 6px; color: #c9b8ff; font-weight: 700; }
.ls dl.defs dd { margin: 0; font-size: 16.5px; line-height: 1.6; }
section.paper dl.defs > div { border-top-color: var(--pp-line); }
section.paper dl.defs dt { color: var(--pp-ink) !important; } section.paper dl.defs dt .pl { color: var(--pp-accent) !important; }
@media (max-width: 760px) { .ls dl.defs > div { grid-template-columns: 1fr; } }
html body section.paper .formula-card .calc-what > b, html body section.paper .formula-card .calc-how > b, html body section.paper .formula-card .cw-h, html body section.paper .formula-card .cl-h { color: #c9b8ff !important; }
html body .ls .formula-card > h3 { color: #fff !important; }

/* two-level menus: entries with pages under them fill the side pane */
@media (min-width: 1061px) {
  .nav-more .menu.mega.mega-fly { width: min(880px, calc(100vw - 48px)) !important; }
  .menu.mega.mega-fly .mega-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
  .nav-more .mega-col a.has-kids b { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .mk-arrow { width: 7px; height: 7px; border-right: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg); opacity: .7; flex: none; }
  .nav-more .mega-col a.cur { background: rgba(167,139,250,.12) !important; border-radius: 10px !important; padding-left: 10px !important; padding-right: 10px !important; margin: 0 -10px; }
  .nav-more .mega-col a.cur b { color: #fff !important; }
  .mega-kids h4 { margin: 0 0 10px; padding-bottom: 10px; border-bottom: 1px solid rgba(206,194,255,.14); font: 600 14.5px 'Inter', sans-serif; }
  .nav-more .mega-kids h4 a { color: #e9e4ff !important; text-decoration: none; padding: 0 !important; }
  .nav-more .mega-kids > a { display: block; padding: 8px 0 !important; color: #c9b8ff !important; font-size: 15.5px; font-weight: 600; text-decoration: none; background: none !important; border-radius: 0 !important; }
  .nav-more .mega-kids > a:hover { color: #fff !important; }
  .mega-kids[data-for="/faq"] { columns: 2; column-gap: 24px; } .mega-kids[data-for="/faq"] h4 { column-span: all; }
}
@media (max-width: 1060px) { .mega-side { display: block !important; } .mega-kids { display: none !important; } .mega-feat-wrap { display: none; } .mk-arrow { display: none; } }
@media (max-width: 1060px) {
  .mega-kids { display: block !important; padding: 4px 12px 10px 24px; }
  .mega-kids[hidden] { display: block !important; }
  .mega-kids h4 { margin: 10px 0 4px; font: 600 13.5px 'Inter', sans-serif; color: #b6afd9; }
  .mega-kids h4 a { color: inherit !important; }
  .mega-kids > a { display: block; padding: 7px 0; color: #e2ddf7 !important; font-size: 15px; }
}
/* three columns: entries, the pages under the hovered entry, the picture card */
@media (min-width: 1061px) {
  .nav-more .menu.mega.mega-fly { width: min(1180px, calc(100vw - 48px)) !important; }
  .menu.mega.mega-fly .mega-in { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 280px; }
  .menu.mega .mega-kids-col { background: #1b1446; border-left: 1px solid rgba(206,194,255,.12); }
  .menu.mega .mega-feat-col { background: #1f1849; border-left: 1px solid rgba(206,194,255,.12); }
  .menu.mega:not(.mega-fly) .mega-in { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 1060px) { .mega-feat-col { display: none !important; } }

/* A to Z bar for the glossary and the bibliography */
.az-bar { display: flex; flex-wrap: wrap; gap: 4px; margin: 18px 0 8px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.05); box-shadow: 0 0 0 1px var(--card-edge); position: sticky; top: 72px; z-index: 5; backdrop-filter: blur(10px); }
.az-bar a, .az-bar span { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; font: 700 15px 'Inter', sans-serif; text-decoration: none; }
.az-bar a { color: #fff !important; background: rgba(167,139,250,.16); }
.az-bar a:hover { background: #6d4aea; }
.az-bar span { color: rgba(206,194,255,.32); }
.az-letter, .az-letter-h { font-family: 'Cover', 'Fira Condensed', sans-serif !important; font-weight: 800 !important; font-size: 40px !important; color: #c9b8ff !important; margin: 34px 0 12px !important; scroll-margin-top: 140px; }
.res-topic { scroll-margin-top: 140px; }
.res-topic-l { font-size: 13px; font-weight: 600; color: #c9b8ff; }
section.paper .res-topic-l { color: var(--pp-accent); }
section.paper .az-letter-h { color: var(--pp-accent) !important; }
section.paper .az-bar a { color: var(--pp-ink) !important; background: var(--pp-wash); }
@media (min-width: 981px) { body.has-side .res-jump { display: none; } }
@media (max-width: 700px) { .az-bar { top: 64px; gap: 3px; padding: 8px; } .az-bar a, .az-bar span { width: 28px; height: 30px; font-size: 13.5px; } }

/* glossary as a dictionary */
.dict { padding: 18px 0 20px; border-top: 1px solid rgba(206,194,255,.14); max-width: 820px; scroll-margin-top: 150px; }
.dict:target { background: rgba(167,139,250,.1); border-radius: 12px; padding-left: 14px; padding-right: 14px; }
.dict .hw { display: inline; margin: 0 8px 0 0 !important; font: 700 22px/1.3 Georgia, 'Times New Roman', serif !important; color: #fff !important; letter-spacing: 0; text-transform: none; }
.dict .pos { font: italic 16px Georgia, 'Times New Roman', serif; color: #c9b8ff; }
.dict .senses { margin: 8px 0 0 !important; padding-left: 22px !important; }
.dict .senses li { font-size: 17px !important; line-height: 1.6 !important; color: #e2ddf7 !important; margin: 4px 0; max-width: none !important; }
.dict .senses li .pos { margin-right: 6px; }
.dict .ex { display: block; margin-top: 2px; font-style: italic; color: #b6afd9; font-size: 16px; }
.dict .ex::before { content: '\201C'; } .dict .ex::after { content: '\201D'; }
.dict .see, .dict .more { margin: 8px 0 0 !important; font-size: 15px !important; color: #b6afd9 !important; }
.dict .see a, .dict .more a { color: #c9b8ff !important; }
.dict .senses:has(> li:only-child) { list-style: none; padding-left: 0 !important; }
section.paper .dict { border-top-color: var(--pp-line); }
section.paper .dict .hw { color: var(--pp-ink) !important; }
section.paper .dict .pos, section.paper .dict .see a, section.paper .dict .more a { color: var(--pp-accent) !important; }
section.paper .dict .senses li { color: var(--pp-text) !important; }
section.paper .dict .ex, section.paper .dict .see, section.paper .dict .more { color: var(--pp-muted) !important; }
/* charts are drawn for a dark ground: on light sections their panels stay dark */
section.paper .panel:has(svg), section.paper .census-panel, section.paper .s-fig:has(svg), section.paper #survey-scatter, section.paper #onset-chart, section.paper #hist, section.paper #rel-bars {
  background: linear-gradient(180deg, #241c5c, #191446) !important; box-shadow: 0 0 0 1px rgba(60,40,150,.3), 0 24px 50px -30px rgba(40,24,110,.55) !important; border-radius: 16px; }
section.paper .panel:has(svg) *, section.paper #survey-scatter *, section.paper #onset-chart *, section.paper #hist *, section.paper #rel-bars * { color: #e2ddf7 !important; }
section.paper #survey-scatter, section.paper #onset-chart, section.paper #hist, section.paper #rel-bars { padding: 14px; }
@media (min-width: 1061px) { .nav-more .menu.mega { top: calc(100% - 1px) !important; margin-top: 0 !important; border-top: 0 !important; } }
/* final pass: long buttons wrap on phones, short ones never do, portraits keep faces */
@media (max-width: 700px) { .actions .btn { white-space: normal !important; max-width: 100%; height: auto !important; text-align: center; line-height: 1.35; padding-top: 12px !important; padding-bottom: 12px !important; } }
#analyzer .btn, .ni-actions .btn { white-space: nowrap !important; }
img[src*="berg.jpg"], img[src*="schoenberg.jpg"], img[src*="webern.jpg"] { object-position: 50% 12% !important; }
.spread img { object-fit: contain !important; }
button.btn:not(.demo .btn) { white-space: nowrap; }

/* ---- phone and tablet menu: a full-screen drawer with collapsed sections ---- */
.mk-inline { display: none; }
@media (max-width: 1060px) {
  .nav .nav-links { display: none !important; }
  .nav.open .nav-links { display: block !important; position: fixed; top: 64px; left: 0; right: 0; bottom: 0; overflow-y: auto; overscroll-behavior: contain; background: #0e0a28; padding: 8px 18px 40px; z-index: 60; border-top: 1px solid rgba(206,194,255,.12); }
  .nav.open .nav-more { display: block !important; position: static !important; border-bottom: 1px solid rgba(206,194,255,.12); }
  .nav.open .nav-more > button { display: flex !important; width: 100%; align-items: center; justify-content: space-between; padding: 16px 2px !important; font: 600 19px 'Inter', sans-serif !important; color: #fff !important; background: none; border: 0; box-shadow: none !important; border-radius: 0 !important; }
  .nav.open .nav-more > button svg { transition: transform .2s; width: 14px; height: 10px; }
  .nav.open .nav-more.open > button svg { transform: rotate(180deg); }
  .nav.open .nav-more .menu.mega { display: none !important; position: static !important; transform: none !important; width: auto !important; min-width: 0 !important; opacity: 1 !important; visibility: visible !important; pointer-events: auto !important; background: none !important; box-shadow: none !important; border-radius: 0 !important; padding: 0 0 14px !important; }
  .nav.open .nav-more.open .menu.mega { display: block !important; }
  .nav.open .menu.mega .mega-in { display: block !important; }
  .nav.open .menu.mega .mega-main { padding: 0 !important; }
  .nav.open .menu.mega .mega-side, .nav.open .menu.mega .mega-kids-col, .nav.open .menu.mega .mega-feat-col { display: none !important; }
  .nav.open .mega-col { display: block !important; }
  .nav.open .nav-more .mega-col > a { display: block !important; padding: 11px 4px !important; margin: 0 !important; background: none !important; border-radius: 0 !important; }
  .nav.open .nav-more .mega-col > a b { font-size: 16.5px !important; color: #e9e4ff !important; display: block; }
  .nav.open .nav-more .mega-col > a span { display: none !important; }
  .nav.open .mk-arrow { display: none !important; }
  .nav.open .mk-inline { display: block; margin: -4px 0 6px 14px; padding-left: 12px; border-left: 2px solid rgba(167,139,250,.35); }
  .nav.open .mk-inline a { display: block; padding: 8px 4px; font-size: 15px; color: #c9c3ec !important; text-decoration: none; }
  .nav.open .mega-foot { display: block !important; margin: 6px 0 0 !important; padding: 11px 4px !important; border: 0 !important; color: #c9b8ff !important; font-size: 15px; }
  .nav.open .nav-plain { display: block; padding: 16px 2px; font-size: 19px; border-bottom: 1px solid rgba(206,194,255,.12); }
  body:has(.nav.open) { overflow: hidden; }
}
@media (max-width: 1060px) {
  .nav.open .nav-links { height: calc(100vh - 64px) !important; height: calc(100dvh - 64px) !important; bottom: auto !important; }
  .nav.open { overflow: visible !important; }
}
/* tables and long citations never run past the edge */
#five table.data td:last-child, .ls table.data td { white-space: normal !important; overflow-wrap: anywhere; }
.ls table.data { table-layout: auto; width: 100% !important; max-width: 100% !important; }
.res-item, .res-cite, .res-learn { min-width: 0; overflow-wrap: anywhere; }
.res-list > * { min-width: 0; }
.ls .formula-card, .ls .formula-card * { min-width: 0; }
.ls p, .ls li, .ls dd { overflow-wrap: break-word; }
@media (max-width: 420px) { .ls .formula .eq, .calc-formula { font-size: 15px !important; } }
#fb-math, .fb-math { display: flex !important; flex-wrap: wrap !important; white-space: normal !important; max-width: 100% !important; row-gap: 6px; }

/* refined hover in menus: no boxes, a thin accent and brighter text */
@media (min-width: 1061px) {
  .nav-more .menu.mega a, .nav-more .menu.mega a:hover, .nav-more .mega-col a.cur { background: none !important; box-shadow: none !important; }
  .nav-more .mega-col > a { position: relative; margin: 0 !important; padding-left: 14px !important; padding-right: 0 !important; border-radius: 0 !important; transition: transform .16s ease; }
  .nav-more .mega-col > a::before { content: ''; position: absolute; left: 0; top: 50%; width: 2px; height: 0; border-radius: 2px; background: linear-gradient(180deg, #c9b8ff, #f0abfc); transform: translateY(-50%); transition: height .18s ease; }
  .nav-more .mega-col > a:hover::before, .nav-more .mega-col > a.cur::before, .nav-more .mega-col > a:focus-visible::before { height: 70%; }
  .nav-more .mega-col > a:hover, .nav-more .mega-col > a.cur { transform: translateX(3px); }
  .nav-more .mega-col > a:hover b, .nav-more .mega-col > a.cur b { color: #fff !important; }
  .nav-more .mega-col > a:hover span, .nav-more .mega-col > a.cur span { color: #d8d2f5 !important; }
  .nav-more .mega-kids > a { transition: color .15s, transform .15s; }
  .nav-more .mega-kids > a:hover { transform: translateX(3px); }
  .nav-more .mega-feature { transition: transform .2s ease; } .nav-more .mega-feature:hover { transform: translateY(-2px); }
  .nav-more .mega-col > a:focus-visible { outline: none; }
}
/* Discussion in the ribbon: easy to spot, not loud */
@media (min-width: 1061px) {
  .nav-links { gap: 6px; }
  .nav-plain.nav-discuss { color: #d8ccff !important; padding: 7px 14px !important; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(201,184,255,.35); transition: background .15s, box-shadow .15s; }
  .nav-plain.nav-discuss:hover, .nav-plain.nav-discuss.active { background: rgba(167,139,250,.16) !important; box-shadow: inset 0 0 0 1px rgba(201,184,255,.6); color: #fff !important; }
}
@media (max-width: 1060px) { .nav.open .nav-plain.nav-discuss { color: #d8ccff !important; } }
@media (min-width: 1061px) { .nav-plain.nav-discuss { border-radius: 10px !important; } }
.nav-more > button, .nav-plain, .nav-right a { white-space: nowrap !important; }
@media (min-width: 1061px) and (max-width: 1240px) {
  .nav-links { gap: 0 !important; }
  .nav-more > button { padding-left: 9px !important; padding-right: 9px !important; }
  .nav-right .nav-ask { display: none !important; }
}

/* ribbon polish: one height, one type scale, a right-sized button */
@media (min-width: 1061px) {
  .nav .wrap { height: 64px !important; display: flex !important; align-items: center !important; }
  .nav .brand { font-size: 18px !important; font-weight: 700 !important; letter-spacing: -0.01em; }
  .nav-links { align-items: center !important; height: 100%; }
  .nav-more { height: 100%; display: flex !important; align-items: center; }
  .nav-more > button { height: 64px; display: inline-flex !important; align-items: center; gap: 6px; font-size: 15px !important; font-weight: 600 !important; }
  .nav-plain { font-size: 15px !important; font-weight: 600 !important; }
  .nav-plain.nav-discuss { height: 36px; display: inline-flex !important; align-items: center; padding: 0 14px !important; }
  .nav-right { display: flex !important; align-items: center !important; gap: 18px !important; }
  .nav-right .nav-ask { font-size: 14.5px !important; font-weight: 600 !important; color: #d8d2f5 !important; padding: 0 !important; }
  .nav-right .nav-ask:hover { color: #fff !important; }
  .nav-right .btn, .nav-right .btn.btn-ink { height: 38px !important; min-height: 0 !important; padding: 0 16px !important; font-size: 14.5px !important; font-weight: 600 !important; border-radius: 10px !important; display: inline-flex !important; align-items: center; line-height: 1 !important; box-shadow: 0 6px 18px -8px rgba(109,74,234,.8) !important; }
}
@media (max-width: 1060px) { .nav-right .btn, .nav-right .btn.btn-ink { height: 36px !important; padding: 0 14px !important; font-size: 14px !important; border-radius: 10px !important; display: inline-flex !important; align-items: center; } }
@media (max-width: 1060px) { html body header.nav .nav-right a.btn { height: 36px !important; min-height: 0 !important; padding: 0 14px !important; font-size: 14px !important; line-height: 1 !important; border-radius: 10px !important; display: inline-flex !important; align-items: center !important; } }
@media (min-width: 1061px) {
  .nav-plain, .nav-plain:hover, .nav-plain.active { background: none !important; box-shadow: none !important; border-radius: 0 !important; height: 64px; display: inline-flex !important; align-items: center; padding: 0 12px !important; }
  .nav-plain.active { box-shadow: inset 0 -2px 0 #c6b8ff !important; }
  .nav-plain:hover { color: #fff !important; }
}
