/* DailyCA Notes public site
   Same family as DailyCA (navy ink, Anek Latin + Anek Kannada), but built around one idea:
   the four-step revision ladder (Read, Day 3, Day 7, Day 30). Teal marks work done,
   marigold marks what is due today, red marks what is overdue. Everything else stays quiet. */

:root {
  --paper: #F5F7F8;
  --card: #FFFFFF;
  --ink: #17203A;
  --ink-2: #4A5470;
  --ink-3: #6F7891;
  --rule: #DCE1EA;
  --teal: #0E6E6A;
  --teal-soft: #DCEEEB;
  --marigold: #F2B01E;
  --marigold-soft: #FDF0CC;
  --bad: #B3261E;
  --bad-soft: #FBE6E4;
  --ok: #1E7B45;
  --font: "Anek Latin", "Anek Kannada", "Noto Sans Kannada", system-ui, sans-serif;
  --radius: 6px;
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.55;
}
img { max-width: 100%; height: auto; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; font-variation-settings: "wdth" 82; font-weight: 700; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.muted { color: var(--ink-3); }
.empty { background: var(--card); border: 1px dashed var(--rule); border-radius: var(--radius); padding: 22px; color: var(--ink-2); }

/* ---------- Buttons ---------- */
.btn, .search button {
  display: inline-block; font: inherit; font-weight: 600; font-size: 15px;
  background: var(--ink); color: #fff; border: 0; border-radius: var(--radius);
  padding: 9px 16px; cursor: pointer; text-decoration: none; line-height: 1.3;
}
.btn:hover, .search button:hover { background: var(--teal); color: #fff; }
.btn--quiet { background: var(--card); color: var(--ink); border: 1px solid var(--rule); }
.btn--quiet:hover { background: var(--teal-soft); color: var(--ink); }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--teal); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.chip { display: inline-block; font-size: 14px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--teal-soft); color: var(--teal); text-decoration: none; }
.chip:hover { background: var(--teal); color: #fff; }

/* ---------- Top bars ---------- */
.crossbar { background: var(--ink); font-size: 14px; }
.crossbar a { color: #D6DBEA; display: inline-block; padding: 5px 0; text-decoration: none; }
.crossbar a:hover { color: #fff; text-decoration: underline; }
.masthead { background: var(--card); border-bottom: 1px solid var(--rule); }
.masthead__row { display: flex; align-items: center; gap: 20px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); margin-right: auto; }
/* The mark is the revision ladder itself: four steps, rising */
.brand__mark { display: flex; align-items: flex-end; gap: 3px; height: 40px; }
.brand__mark i { display: block; width: 9px; border-radius: 2px; background: var(--teal); }
.brand__mark i:nth-child(1) { height: 13px; }
.brand__mark i:nth-child(2) { height: 22px; }
.brand__mark i:nth-child(3) { height: 31px; }
.brand__mark i:nth-child(4) { height: 40px; background: var(--ink); }
.brand__text b { display: block; font-size: 24px; line-height: 1; font-variation-settings: "wdth" 78; font-weight: 800; }
.brand__text small { display: block; color: var(--ink-3); font-size: 14px; margin-top: 3px; }
.search { display: flex; gap: 6px; flex: 0 1 380px; }
.search input { flex: 1; min-width: 0; font: inherit; font-size: 15px; padding: 8px 12px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); color: var(--ink); }
.search--page { margin: 0 0 24px; }
.revlink { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; padding: 6px 2px; }
.revlink__short { display: none; }
.revlink[aria-current] { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--marigold); }
.revlink__n { background: var(--marigold); color: var(--ink); font-size: 13px; font-weight: 700; min-width: 22px; height: 22px; border-radius: 11px; display: inline-grid; place-items: center; padding: 0 6px; }
.subjects { border-top: 1px solid var(--rule); }
.subjects__inner { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.subjects__inner::-webkit-scrollbar { display: none; }
.subjects a { white-space: nowrap; padding: 10px 12px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 15px; border-bottom: 3px solid transparent; }
.subjects a:hover { color: var(--ink); }
.subjects a[aria-current] { color: var(--ink); border-bottom-color: var(--teal); }
.flash { margin: 16px 0 0; padding: 10px 14px; border-radius: var(--radius); background: var(--teal-soft); color: var(--ink); }
.flash--err { background: var(--bad-soft); color: var(--bad); }
main.wrap { padding-top: 28px; padding-bottom: 48px; min-height: 50vh; }

/* ---------- Home ---------- */
.intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: end; padding: 12px 0 28px; border-bottom: 1px solid var(--rule); margin-bottom: 28px; }
.intro h1 { font-size: clamp(30px, 5vw, 48px); font-variation-settings: "wdth" 75; max-width: 16ch; margin-bottom: .25em; }
.intro p { color: var(--ink-2); max-width: 58ch; margin: 0; }
.ladder { list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-end; gap: 6px; }
.ladder li { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; width: 70px; border-radius: 4px 4px 0 0; background: var(--teal); color: #fff; padding: 8px 4px; }
.ladder li:nth-child(1) { height: 64px; }
.ladder li:nth-child(2) { height: 86px; }
.ladder li:nth-child(3) { height: 108px; }
.ladder li:nth-child(4) { height: 130px; background: var(--ink); }
.ladder b { font-size: 26px; line-height: 1; font-variation-settings: "wdth" 75; }
.ladder li:first-child b { font-size: 18px; }
.ladder span { font-size: 12px; opacity: .85; }
.section-h { font-size: 22px; margin: 28px 0 12px; }
.section-h--bad { color: var(--bad); }
.section-h--due { color: #8A5A00; }
.duebox { background: var(--marigold-soft); border: 1px solid #EDD48E; border-radius: var(--radius); padding: 18px 20px; margin-bottom: 8px; }
.duebox h2 { font-size: 20px; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.scard { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px; color: var(--ink); text-decoration: none; }
.scard:hover { border-color: var(--teal); }
.scard__icon { font-size: 28px; line-height: 1; margin-bottom: 4px; }
.scard__name { font-size: 21px; font-weight: 700; font-variation-settings: "wdth" 82; line-height: 1.2; }
.scard__text { color: var(--ink-2); font-size: 15px; }
.scard__meta { color: var(--ink-3); font-size: 14px; margin-top: auto; padding-top: 8px; }
.bar { display: block; height: 6px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.bar__fill { display: block; height: 100%; width: 0; background: var(--teal); }
.bar__label { font-size: 13px; color: var(--ink-3); }
.progress-line { display: grid; grid-template-columns: minmax(120px, 280px) auto; gap: 12px; align-items: center; margin-top: 8px; }
.tlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.trow { padding: 12px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; }
.trow__title { font-weight: 600; font-size: 18px; text-decoration: none; color: var(--ink); }
.trow__title:hover { color: var(--teal); text-decoration: underline; }
.trow .dots { align-self: center; }
.trow__path { grid-column: 1 / -1; font-size: 14px; color: var(--ink-3); }
.trow__text { grid-column: 1 / -1; margin: 4px 0 0; color: var(--ink-2); font-size: 15px; }

/* ---------- Exams ---------- */
.egrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.ecard { border-top: 4px solid var(--ink); }
.ecard.is-mine { border-color: var(--teal); border-top-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.ecard__mine { align-self: flex-start; font-size: 12px; font-weight: 700; background: var(--teal); color: #fff; border-radius: 3px; padding: 1px 7px; margin-bottom: 2px; }
.subjects a.subjects__exams { color: var(--ink); }
.subjects a.myexam { border-bottom: 0; }
.subjects a.myexam, .myexam { align-self: center; white-space: nowrap; font-size: 14px; font-weight: 700; text-decoration: none; color: var(--teal); background: var(--teal-soft); border-radius: 99px; padding: 3px 12px; margin: 0 6px 0 2px; }
.subjects a.myexam:hover, .myexam:hover { background: var(--teal); color: #fff; }
.exam-head__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.exam-head__actions [aria-pressed="true"] { background: var(--teal-soft); border-color: var(--teal); color: var(--teal); }
.unit__desc { margin: -2px 0 8px; color: var(--ink-2); font-size: 15px; }
.unit__count { font-size: 14px; }
.syllabus__path { display: block; font-size: 13px; color: var(--ink-3); }
.inexams { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -6px 0 16px; font-size: 14px; }
.revfilter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; font-weight: 600; }
.revfilter select { font: inherit; font-weight: 400; padding: 7px 10px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--card); color: var(--ink); }
.ptable tr.is-current td { background: var(--teal-soft); }
.narrow--wide { max-width: 1000px; }

/* ---------- Revision dots ---------- */
.dots { display: inline-flex; gap: 3px; align-items: center; vertical-align: middle; }
.dots i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #B8C0D2; background: transparent; }
.dots i.on { background: var(--teal); border-color: var(--teal); }
.dots.is-due i:not(.on) { border-color: #C98E00; }
.dots.is-overdue i:not(.on) { border-color: var(--bad); }

/* ---------- Subject and chapter pages ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; }
.crumbs { font-size: 14px; color: var(--ink-3); margin-bottom: 10px; }
.crumbs a { color: var(--ink-2); }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: clamp(28px, 4vw, 40px); font-variation-settings: "wdth" 76; display: flex; align-items: center; gap: 12px; }
.page-head__icon { font-size: .85em; }
.page-head__lead { color: var(--ink-2); max-width: 65ch; margin: 0 0 6px; }
.chapter { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; }
.chapter__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.chapter__head h2 { font-size: 21px; margin: 0; display: flex; gap: 10px; align-items: baseline; }
.chapter__head h2 a { color: var(--ink); text-decoration: none; }
.chapter__head h2 a:hover { color: var(--teal); text-decoration: underline; }
.chapter__n { color: var(--teal); font-variation-settings: "wdth" 75; min-width: 1.2em; }
.syllabus { margin: 0; padding-left: 1.6em; }
.syllabus li { padding: 6px 0; border-bottom: 1px solid #EEF1F5; }
.syllabus li:last-child { border-bottom: 0; }
.syllabus li::marker { color: var(--ink-3); font-size: 15px; }
.syllabus a { font-weight: 500; }
.syllabus .dots { margin-left: 10px; }
.syllabus--big li { padding: 12px 0; }
.syllabus--big a { font-size: 19px; font-weight: 600; }
.syllabus--big p { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; }
.lvl { font-size: 12px; font-weight: 600; border-radius: 3px; padding: 1px 6px; margin-left: 8px; vertical-align: middle; white-space: nowrap; }
.lvl--basic { background: #EEF1F6; color: var(--ink-2); }
.lvl--intermediate { background: #E6EEFB; color: #2C4F8C; }
.lvl--advanced { background: #F3E8F7; color: #6B2F7F; }
.cta { margin: 24px 0; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.box { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px 20px; margin: 20px 0; }
.box h2 { font-size: 19px; }
.pdflist { margin: 0; padding-left: 1.2em; }
.pdflist li { padding: 4px 0; }

/* ---------- Topic page ---------- */
.topic { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 40px; align-items: start; }
.rail { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.rail__box { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; }
.rail__box summary { cursor: pointer; list-style: none; }
.rail__box summary::-webkit-details-marker { display: none; }
.rail__box summary span { display: block; font-size: 13px; }
.rail__box summary b { display: block; font-size: 17px; line-height: 1.25; font-variation-settings: "wdth" 85; }
.rail__list { margin: 10px 0 12px; padding-left: 1.4em; font-size: 15px; }
.rail__list li { padding: 4px 0; }
.rail__list li::marker { color: var(--ink-3); }
.rail__list a { color: var(--ink-2); text-decoration: none; }
.rail__list a:hover { color: var(--teal); text-decoration: underline; }
.rail__list .is-current a { color: var(--ink); font-weight: 700; }
.rail__list .dots { margin-left: 6px; }
.rail__ad { margin-top: 16px; }
.topic__main { max-width: 760px; min-width: 0; }
.topic__head h1 { font-size: clamp(30px, 4.4vw, 44px); font-variation-settings: "wdth" 76; margin-bottom: 8px; }
.topic__meta { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; color: var(--ink-3); font-size: 15px; margin: 0 0 18px; }
.topic__meta .lvl { margin-left: 0; }
.topic__img { display: block; border-radius: var(--radius); margin: 0 0 20px; }

/* The revision tracker: four steps that rise like the brand mark */
.rev { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px 10px; margin: 0 0 22px; }
.rev--end { margin-top: 32px; }
.rev__title { margin: 0 0 10px; font-weight: 700; }
.rev__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.rev__step label { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; cursor: pointer; padding: 8px 10px; border-radius: 5px; border: 1px solid var(--rule); background: var(--paper); height: 100%; }
.rev__step input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rev__box { grid-row: span 2; width: 24px; height: 24px; border-radius: 5px; border: 2px solid #9BA4BA; background: var(--card); display: grid; place-items: center; }
.rev__name { font-weight: 600; font-size: 15px; line-height: 1.2; }
.rev__date { font-size: 13px; color: var(--ink-3); line-height: 1.3; }
.rev__step input:focus-visible + .rev__box { outline: 3px solid var(--marigold); outline-offset: 2px; }
.rev__step.is-done label { background: var(--teal-soft); border-color: #B4DAD4; }
.rev__step.is-done .rev__box { background: var(--teal); border-color: var(--teal); }
.rev__step.is-done .rev__box::after { content: ""; width: 7px; height: 12px; border: solid #fff; border-width: 0 3px 3px 0; transform: translateY(-1px) rotate(45deg); }
.rev__step.is-done .rev__date { color: var(--teal); }
.rev__step.is-due label { background: var(--marigold-soft); border-color: var(--marigold); }
.rev__step.is-due .rev__box { border-color: #C98E00; }
.rev__step.is-due .rev__date { color: #7A5200; font-weight: 600; }
.rev__step.is-overdue label { background: var(--bad-soft); border-color: #E7B2AD; }
.rev__step.is-overdue .rev__box { border-color: var(--bad); }
.rev__step.is-overdue .rev__date { color: var(--bad); font-weight: 600; }
.rev__step.is-waiting .rev__name { color: var(--ink-2); }
.rev__note { margin: 8px 0 0; font-size: 13px; color: var(--ink-3); }

.keypoints { background: var(--card); border-left: 4px solid var(--teal); border-radius: 0 var(--radius) var(--radius) 0; padding: 14px 18px; margin: 0 0 22px; }
.keypoints h2 { font-size: 18px; margin-bottom: 6px; }
.keypoints ul { margin: 0; padding-left: 1.2em; }
.keypoints li { padding: 2px 0; }
.toc { margin: 0 0 22px; border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 16px; background: var(--card); }
.toc summary { cursor: pointer; font-weight: 600; }
.toc ol { margin: 8px 0 4px; padding-left: 1.3em; }

/* Notes body */
.notes { font-size: 18px; line-height: 1.72; overflow-wrap: break-word; }
.notes > *:first-child { margin-top: 0; }
.notes h2 { font-size: 26px; margin: 1.6em 0 .5em; padding-top: .3em; border-top: 1px solid var(--rule); }
.notes h3 { font-size: 21px; margin: 1.3em 0 .4em; }
.notes h4 { font-size: 18px; margin: 1.2em 0 .3em; }
.notes p, .notes ul, .notes ol { margin: 0 0 1em; }
.notes li { margin-bottom: .3em; }
.notes img { border-radius: 4px; margin: 1em 0; }
.notes blockquote { margin: 1em 0; padding: 4px 18px; border-left: 4px solid var(--rule); color: var(--ink-2); }
.notes table { border-collapse: collapse; width: 100%; font-size: 16px; line-height: 1.45; margin: 1em 0; display: block; overflow-x: auto; }
.notes th, .notes td { border: 1px solid var(--rule); padding: 7px 10px; text-align: left; vertical-align: top; }
.notes th { background: #EEF2F6; }
.notes code { background: #EEF2F6; padding: 1px 5px; border-radius: 3px; font-size: .9em; }
.notes pre { background: #EEF2F6; padding: 12px 14px; border-radius: var(--radius); overflow-x: auto; font-size: 15px; line-height: 1.5; }
.notes .katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
/* Note blocks inserted from the editor */
.nb { border-radius: var(--radius); padding: 12px 16px; margin: 1.2em 0; border: 1px solid var(--rule); background: var(--card); }
.nb > :last-child { margin-bottom: 0; }
.nb__title { font-weight: 700; font-size: 15px; margin: 0 0 4px !important; }
.nb--key { border-left: 4px solid var(--teal); }
.nb--key .nb__title { color: var(--teal); }
.nb--formula { background: #F1F4FA; border-color: #D2DBEC; text-align: left; }
.nb--formula .nb__title { color: #2C4F8C; }
.nb--example { border-left: 4px solid #6B2F7F; }
.nb--example .nb__title { color: #6B2F7F; }
.nb--tip { background: var(--marigold-soft); border-color: #EDD48E; }
.nb--tip .nb__title { color: #7A5200; }

.download { margin: 24px 0; }
.practice { margin-top: 36px; padding-top: 20px; border-top: 2px solid var(--ink); }
.practice h2 { font-size: 26px; margin-bottom: 2px; }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 32px; }
.prevnext a { display: block; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 16px; text-decoration: none; color: var(--ink); font-weight: 600; line-height: 1.3; }
.prevnext a:hover { border-color: var(--teal); }
.prevnext small { display: block; color: var(--ink-3); font-weight: 400; font-size: 13px; margin-bottom: 2px; }
.prevnext__next { text-align: right; grid-column: 2; }

/* ---------- Practice questions ---------- */
.quiz { margin-top: 14px; }
.qcard { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--card); padding: 14px 16px; margin: 0 0 14px; }
.qcard legend { display: flex; gap: 10px; font-weight: 600; padding: 0; margin-bottom: 10px; float: left; width: 100%; }
.qcard legend + * { clear: both; }
.qcard__n { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 14px; display: grid; place-items: center; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 5px; border: 1px solid transparent; cursor: pointer; }
.opt:hover { background: var(--paper); }
.opt input { margin-top: 5px; }
.opt__key { font-weight: 700; color: var(--ink-3); min-width: 1em; }
.opt.is-right { background: #E6F4EA; border-color: #A9D5B6; }
.opt.is-right .opt__key { color: var(--ok); }
.opt.is-wrong { background: var(--bad-soft); border-color: #E7B2AD; }
.opt.is-wrong .opt__key { color: var(--bad); }
.qcard__why { margin: 10px 0 0; padding: 8px 10px; background: var(--paper); border-radius: 5px; font-size: 15px; }
.quiz__bar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; position: sticky; bottom: 0; background: var(--paper); padding: 12px 0; }
.quiz__score { margin: 0; font-weight: 700; }

/* ---------- My revisions ---------- */
.revsum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 8px; }
.revsum p { margin: 0; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 14px; }
.revsum b { display: block; font-size: 30px; line-height: 1; font-variation-settings: "wdth" 75; }
.revsum span { font-size: 14px; color: var(--ink-3); }
.revsum p:nth-child(1) b { color: var(--bad); }
.revsum p:nth-child(2) b { color: #8A5A00; }
.revsum p:nth-child(4) b { color: var(--teal); }
.duelist { list-style: none; margin: 0 0 8px; padding: 0; }
.due { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 10px 0 10px 12px; border-bottom: 1px solid var(--rule); border-left: 4px solid var(--rule); }
.due--overdue { border-left-color: var(--bad); }
.due--today { border-left-color: var(--marigold); }
.duebox .due { border-bottom-color: #EDD48E; }
.due__title { font-weight: 600; }
.due__info { grid-column: 1; font-size: 14px; color: var(--ink-2); }
.due__done { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 15px; white-space: nowrap; }
.tablewrap { overflow-x: auto; }
.ptable { border-collapse: collapse; width: 100%; font-size: 15px; }
.ptable th, .ptable td { padding: 8px 10px; border-bottom: 1px solid var(--rule); text-align: left; }
.ptable .num { text-align: right; font-variant-numeric: tabular-nums; }
.backup textarea { width: 100%; font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--rule); border-radius: var(--radius); margin: 6px 0 10px; }
.backup__row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.field { display: block; font-weight: 600; margin-top: 14px; }

/* ---------- Misc ---------- */
.pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin: 28px 0; }
.ad { margin: 20px 0; text-align: center; }
.ad__label { display: block; font-size: 11px; color: var(--ink-3); margin-bottom: 4px; }
.ad img { margin: 0 auto; }
.empty-page { padding: 40px 0; }

/* ---------- Footer ---------- */
.foot { background: var(--ink); color: #C9CFDF; padding: 36px 0 20px; margin-top: 20px; }
.foot__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.foot b { color: #fff; font-size: 20px; }
.foot p { margin: 4px 0 16px; }
.foot nav a { display: block; color: #C9CFDF; padding: 3px 0; text-decoration: none; }
.foot nav a:hover { color: #fff; text-decoration: underline; }
.foot .foot__copy { font-size: 14px; color: #8C95AE; margin: 24px auto 0; }
.subscribe label { display: block; font-weight: 600; color: #fff; margin-bottom: 6px; }
.subscribe__row { display: flex; gap: 6px; max-width: 420px; }
.subscribe input[type=email] { flex: 1; min-width: 0; font: inherit; font-size: 15px; padding: 8px 12px; border-radius: var(--radius); border: 0; }
.foot .btn { background: var(--teal); }
.foot .btn:hover { background: #fff; color: var(--ink); }

/* ---------- Small screens ---------- */
@media (max-width: 900px) {
  .masthead__row { flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; }
  .layout, .topic { grid-template-columns: 1fr; gap: 20px; }
  .rail { position: static; max-height: none; }
  .rail__ad { display: none; }
  .intro { grid-template-columns: 1fr; }
  .ladder li { width: 62px; }
  .foot__grid { grid-template-columns: 1fr 1fr; }
  .foot__grid > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .masthead__row { gap: 12px; }
  .brand__text b { font-size: 21px; }
  .brand__mark { height: 32px; }
  .brand__mark i { width: 7px; }
  .brand__mark i:nth-child(1) { height: 10px; }
  .brand__mark i:nth-child(2) { height: 17px; }
  .brand__mark i:nth-child(3) { height: 24px; }
  .brand__mark i:nth-child(4) { height: 32px; }
  .revlink__full { display: none; }
  .revlink__short { display: inline; }
  .rail__box summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .rail__box summary::after { content: "Show topics"; font-size: 14px; font-weight: 600; color: var(--teal); white-space: nowrap; }
  .rail__box[open] summary::after { content: "Hide"; }
  .wrap { padding: 0 16px; }
  .brand__text small { display: none; }
  .notes { font-size: 17px; }
  .rev__steps { grid-template-columns: 1fr 1fr; }
  .revsum { grid-template-columns: 1fr 1fr; }
  .prevnext { grid-template-columns: 1fr; }
  .prevnext__next { grid-column: 1; }
  .chapter { padding: 14px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Print: notes only ---------- */
@media print {
  .crossbar, .masthead, .rail, .rev, .ad, .foot, .prevnext, .noprint, .quiz__bar, .crumbs, .download, .toc { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .topic { display: block; }
  .topic__main { max-width: none; }
  .notes { font-size: 12pt; line-height: 1.5; }
  .notes h2 { page-break-after: avoid; }
  .qcard { page-break-inside: avoid; }
  a { color: var(--ink); text-decoration: none; }
}
