/* financeninja — Monochrome Signal layout (2026-10-20). Loaded last; overrides the older component styles.
   Rules: hairlines not boxes, text links not buttons, one black button per decision, orange once. */

body { font: 400 var(--fs-md)/1.6 var(--font-ui); letter-spacing: -.003em; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--ink); }
.muted { color: var(--muted); } .small { font-size: var(--fs-sm); }
.num { font-variant-numeric: tabular-nums; }
.linkbtn { border: 0; background: none; padding: 0; font: inherit; color: var(--ink); cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.linkbtn:hover { text-decoration-color: var(--ink); }
.kbd { font: 500 10.5px/1 var(--font-mono); padding: 2px 4px; border-radius: 4px; border: 1px solid var(--line); color: var(--faint); background: none; }
.eyebrow { font-size: 11px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.h1 { font-size: 34px; line-height: 1.2; font-weight: 750; letter-spacing: -.025em; margin: 6px 0 0; }
.lede { font-size: var(--fs-lg); color: var(--muted); line-height: 1.6; margin: 10px 0 0; }
.lede a { color: var(--ink); }

/* buttons: black for the decision, outline for the rest */
.btn { height: 38px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: none; }
.btn:hover { background: var(--surface-2); border-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: none; }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.block { width: 100%; }
.btn .ico { display: none; }
.tbtn { border: 0; background: none; padding: 4px 0; font: inherit; font-size: var(--fs-sm); color: var(--muted); cursor: pointer; border-bottom: 1.5px solid transparent; }
.tbtn:hover { color: var(--ink); }
.tbtn[aria-pressed="true"] { color: var(--ink); font-weight: 650; border-bottom-color: var(--ink); }
.tbtn .num { color: var(--faint); font-weight: 500; margin-left: 2px; }

/* the older components, made quiet */
.card { border-radius: var(--r-lg); box-shadow: none; border: 1px solid var(--line); }
.card.raised { box-shadow: none; border: 1px solid var(--line); }
.chip { background: none; border: 1px solid var(--line); color: var(--muted); font-weight: 600; }
.chip.good, .chip.bad, .chip.warn, .chip.accent { background: none; }
.chip.good { color: var(--good-ink); border-color: currentColor; } .chip.bad { color: var(--bad-ink); border-color: currentColor; }
.chip.warn { color: var(--warn-ink); border-color: currentColor; } .chip.accent { color: var(--ink); border-color: var(--line-strong); }
.session-card::before { display: none; }
.src-tag { background: none !important; color: var(--muted) !important; padding: 0; font-weight: 700; letter-spacing: .04em; }
.tip { background: none; border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 0 8px 8px 0; }
.tip .ico { display: none; }
svg.ico { opacity: .75; }

/* ---------- shell ---------- */
.shell { grid-template-columns: var(--sidebar-w) 1fr; }
.sidebar { padding: 26px 16px 18px; gap: 0; background: var(--page); border-right: 1px solid var(--line); }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 0 10px 22px; color: var(--ink); text-decoration: none; }
.brand-name { font-size: 18px; font-weight: 780; letter-spacing: -.03em; }
.brand-rule { display: block; width: 100%; height: 1px; background: var(--ink); margin: 8px 0 7px; position: relative; }
.brand-rule::after { content: ""; position: absolute; right: 0; top: -1.5px; width: 24px; height: 4px; background: var(--signal); }  /* the one orange signature */
.brand-sub { font-size: 12px; color: var(--muted); }
.nav-group { padding: 10px 0 6px; }
.nav-h { font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 0 10px 4px; }
.nav-item { display: flex; align-items: center; padding: 6px 10px; border-radius: 6px; color: var(--ink-2); font-weight: 500; font-size: 14.5px; text-decoration: none; gap: 8px; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav-item[aria-current="page"] { background: none; box-shadow: none; color: var(--ink); font-weight: 700; }
.nav-item[aria-current="page"]::before { content: ""; width: 3px; height: 16px; background: var(--ink); border-radius: 2px; margin-left: -10px; margin-right: 7px; }
.nav-item .count { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 500; }
.nav-foot { margin-top: auto; padding: 12px 0 0; border-top: 1px solid var(--line); }
.nav-who { display: flex; justify-content: space-between; padding: 8px 10px 0; font-size: 12.5px; color: var(--muted); }
.nav-who .linkbtn { color: var(--muted); font-size: 12.5px; }
.topbar { height: var(--topbar-h); padding: 0 40px; gap: 18px; background: color-mix(in srgb, var(--page) 92%, transparent); }
.topbar .linkbtn { font-size: var(--fs-sm); color: var(--muted); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.topbar .linkbtn:hover { color: var(--ink); }
.crumbs { font-size: var(--fs-sm); }
.crumbs a { text-decoration: none; }
.crumbs .ico { opacity: .5; }

.wrap { max-width: 1320px; margin: 0 auto; padding: 28px 40px 96px; }
.p-head { padding-bottom: 24px; margin-bottom: 8px; border-bottom: 1px solid var(--ink); }
.continue { margin: 14px 0 0; font-size: var(--fs-lg); }

/* tables: rules, not boxes */
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.tbl th { text-align: left; font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 12px 8px 0; border-bottom: 1.5px solid var(--ink); }
.tbl td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr[data-href] { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl td a { text-decoration: none; }
.tbl tbody tr:hover td a { text-decoration: underline; text-decoration-color: var(--ink); }

/* ---------- Today ---------- */
.t-head { padding-bottom: 22px; border-bottom: 1px solid var(--ink); }
.t-count { margin: 8px 0 0; font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.t-count .num { font-family: var(--font-num); font-size: 64px; font-weight: 800; letter-spacing: -.04em; margin-right: 10px; vertical-align: -6px; }
.t-head .lede { max-width: 70ch; }
.t-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; padding-top: 28px; align-items: start; }
.t-side { display: flex; flex-direction: column; gap: 36px; position: sticky; top: calc(var(--topbar-h) + 16px); }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 8px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.sec-h h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.005em; }
.steps { list-style: none; counter-reset: st; padding: 0; margin: 0 0 18px; }
.steps li { counter-increment: st; position: relative; padding: 0 0 14px 28px; }
.steps li::before { content: counter(st); position: absolute; left: 0; top: 0; font: 650 12px/22px var(--font-num); color: var(--muted); }
.st-main { display: flex; justify-content: space-between; gap: 12px; line-height: 1.45; }
.st-main b { font-weight: 650; }
.st-min { color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.st-links { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; font-size: var(--fs-sm); }
.t-or { margin: 10px 0 0; text-align: center; }
.t-or .linkbtn { color: var(--ink-2); }
.qnote textarea { width: 100%; resize: vertical; border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; font: 400 var(--fs-md)/1.5 var(--font-ui); background: var(--surface); color: var(--ink); }
.qnote textarea:focus { outline: none; border-color: var(--ink); box-shadow: var(--ring); }
.nlist { list-style: none; padding: 0; margin: 10px 0 0; }
.nlist li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.nlist .prose { font-family: var(--font-ui); font-size: var(--fs-sm); line-height: 1.55; color: var(--ink-2); }
.nlist .prose p { margin: 0; }
.nmeta { font-size: 11.5px; color: var(--faint); margin-top: 4px; }
.nlist.big .prose { font-family: var(--font-read); font-size: 16px; color: var(--ink); }
.nlist blockquote { margin: 0 0 6px; padding-left: 10px; border-left: 2px solid var(--line-strong); color: var(--muted); font-size: var(--fs-sm); }
.t-day { padding: 16px 18px; border: 1px solid var(--ink); border-radius: var(--r-lg); }

/* ---------- calendar ---------- */
.cal-bar { display: flex; justify-content: space-between; align-items: baseline; gap: 12px 24px; flex-wrap: wrap; }
.cal-title { display: flex; align-items: baseline; gap: 14px; }
.cal-title h2 { margin: 0; font-size: 28px; font-weight: 750; letter-spacing: -.025em; }
.cal-title h2 span { font-weight: 400; color: var(--muted); }
.cal-sub { color: var(--muted); font-size: var(--fs-sm); }
.cal-tools { display: flex; gap: 28px; align-items: baseline; }
.cal-views, .cal-nav { display: flex; gap: 16px; align-items: baseline; }
.cal-nav .tbtn[data-step] { font-size: 18px; line-height: 1; padding: 0 2px; color: var(--ink); }
.cal-opts { display: flex; gap: 20px; margin: 12px 0 14px; }
.tcheck { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-sm); color: var(--muted); cursor: pointer; user-select: none; position: relative; }
.tcheck input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tcheck span { width: 13px; height: 13px; border: 1.5px solid var(--line-strong); border-radius: 3px; display: inline-grid; place-items: center; }
.tcheck input:checked + span { background: var(--ink); border-color: var(--ink); }
.tcheck input:checked + span::after { content: ""; width: 6px; height: 3px; border-left: 1.5px solid var(--page); border-bottom: 1.5px solid var(--page); transform: rotate(-45deg) translate(1px, -1px); }
.tcheck input:checked ~ * , .tcheck:has(input:checked) { color: var(--ink); }
.tcheck input:focus-visible + span { box-shadow: var(--ring); }
.cal-loading { padding: 120px 0; text-align: center; color: var(--faint); font-size: var(--fs-sm); }

.cal-wd { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1.5px solid var(--ink); }
.cal-wd span { padding: 0 8px 6px; font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cal-wd .is-fri { color: var(--bad-ink); }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(104px, auto); }
.cal-cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 7px 8px 9px; border: 0; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); background: none; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell:hover { background: var(--surface-2); }
.cal-cell.is-sel { background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--ink); }
.cal-cell.is-out .cal-dn b { color: var(--faint); font-weight: 400; }
.cal-cell.is-out .cal-evs { opacity: .45; }
.cal-dn { display: flex; justify-content: space-between; align-items: center; min-height: 24px; }
.cal-dn b { font-family: var(--font-num); font-size: 14px; font-weight: 650; min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-dn small { font-size: 10.5px; color: var(--faint); }
.cal-cell.is-past .cal-dn b { color: var(--muted); font-weight: 500; }
.cal-cell.is-fri .cal-dn b, .cal-cell.is-hol .cal-dn b { color: var(--bad-ink); }
.cal-cell.is-today .cal-dn b { background: var(--ink); color: var(--page); }
.cal-cell.is-exam .cal-dn b { box-shadow: inset 0 0 0 2px var(--signal); }
.cal-evs { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ev { display: block; min-width: 0; font-size: 12px; line-height: 1.35; color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; background: none; padding: 0; border-radius: 0; white-space: normal; }
.ev b { font-weight: 700; color: var(--ink); }
.ev em { font-style: normal; color: var(--muted); }
.ev-lesson.is-done, .ev-done { color: var(--muted); }
.ev-lesson.is-done b { color: var(--muted); }
.ev-quiet { color: var(--faint); }
.ev-hol { color: var(--bad-ink); text-align: right; -webkit-line-clamp: 1; font-family: system-ui, -apple-system, Tahoma, sans-serif; }
.ev-exam { color: var(--ink); font-weight: 750; }
.ev-more { font-size: 11px; color: var(--faint); }
.ev-none { font-size: 12px; color: var(--faint); }
.ev .ico { display: none; }

.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1.5px solid var(--ink); min-height: 460px; }
.cal-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 0 10px 12px; border: 0; border-right: 1px solid var(--line); background: none; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.cal-col:last-child { border-right: 0; }
.cal-col:hover, .cal-col.is-sel { background: var(--surface-2); }
.cal-colhead { display: flex; align-items: baseline; gap: 6px; padding: 10px 0 8px; border-bottom: 1px solid var(--line); }
.cal-colhead span { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cal-colhead b { font-family: var(--font-num); font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.cal-colhead small { margin-left: auto; font-size: 10.5px; color: var(--faint); }
.cal-col.is-today .cal-colhead b { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; }
.cal-col.is-fri .cal-colhead b, .cal-col.is-hol .cal-colhead b { color: var(--bad-ink); }
.cal-col.is-past .cal-colhead b { color: var(--muted); }
.cal-col .ev { -webkit-line-clamp: 6; font-size: 12.5px; }

.cal-year { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px 36px; padding-top: 4px; }
.ym-name { border: 0; background: none; padding: 0 0 6px; font: 700 15px/1.2 var(--font-ui); color: var(--ink); cursor: pointer; }
.ym-name:hover { text-decoration: underline; }
.ym-wd, .ym-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); justify-items: center; }
.ym-wd span { padding: 2px 0 4px; font-size: 10px; font-weight: 650; color: var(--faint); }
.ym-d { position: relative; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; font: 500 12px/1 var(--font-num); color: var(--ink); }
.ym-d:hover { background: var(--surface-3); }
.ym-d.is-out { cursor: default; background: none; }
.ym-d.is-past { color: var(--faint); }
.ym-d.is-fri, .ym-d.is-hol { color: var(--bad-ink); }
.ym-d.is-today { background: var(--ink); color: var(--page); font-weight: 700; }
.ym-d.is-sel { box-shadow: 0 0 0 1.5px var(--ink); }
.ym-d.is-exam { box-shadow: inset 0 0 0 2px var(--signal); font-weight: 700; }
.ym-d.dot-plan::after, .ym-d.dot-review::after, .ym-d.dot-done::after { content: ""; position: absolute; left: 50%; bottom: 1px; width: 3px; height: 3px; margin-left: -1.5px; border-radius: 50%; background: var(--ink); }
.ym-d.dot-review::after { background: var(--faint); }
.ym-d.dot-done::after { background: var(--good); }
.ym-d.is-today::after { background: var(--page); }

.dd-head { margin-bottom: 10px; }
.dd-date { font-weight: 700; font-size: var(--fs-lg); }
.dd-sub { font-size: var(--fs-sm); color: var(--muted); }
.dd p { margin: 0 0 8px; }
.dd-hol { color: var(--bad-ink); text-align: right; font-family: system-ui, -apple-system, Tahoma, sans-serif; }
.dd-lesson { padding: 6px 0 10px; }
.dd-code { font-size: 11.5px; color: var(--muted); }
.dd-title { font-weight: 650; margin: 2px 0 6px; line-height: 1.4; }
.dd-links { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--fs-sm); }
.dd-plain, .dd-done { color: var(--ink-2); font-size: var(--fs-sm); }
.dd.big { max-width: 640px; padding-top: 6px; }
.dd.big .dd-title { font-size: var(--fs-xl); }
.cal-dayview { border-top: 1.5px solid var(--ink); padding-top: 16px; }

/* ---------- book contents (CFA, Schweser) ---------- */
.toc-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; padding-top: 28px; align-items: start; }
.toc-index { position: sticky; top: calc(var(--topbar-h) + 20px); display: flex; flex-direction: column; }
.toc-index a { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); text-decoration: none; color: var(--ink-2); }
.toc-index a:hover { color: var(--ink); }
.toc-topic { padding-bottom: 36px; scroll-margin-top: 80px; }
.toc-topic-h { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.toc-topic-h h2 { margin: 0; font-size: var(--fs-xl); font-weight: 720; letter-spacing: -.015em; }
.toc-tbl .c-n { width: 44px; color: var(--muted); }
.toc-tbl .c-d { width: 150px; }
.toc-tbl .c-q { width: 90px; text-align: right; }
.toc-tbl .c-r { width: 52px; text-align: center; }
.toc-tbl tr.is-next td:nth-child(2) a { font-weight: 700; }
.toc-tbl tr.is-next td:first-child { color: var(--ink); font-weight: 700; }

/* ---------- reading (CFA module, Schweser reading) ---------- */
.reading { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 48px; align-items: start; }
.toc-side { position: sticky; top: calc(var(--topbar-h) + 20px); max-height: calc(100vh - var(--topbar-h) - 40px); overflow-y: auto; display: flex; flex-direction: column; font-size: var(--fs-sm); }
.toc-side-h { padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1.5px solid var(--ink); font-weight: 700; }
.toc-side-h a { text-decoration: none; }
.toc-side > a { display: grid; grid-template-columns: 26px 1fr; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); color: var(--muted); text-decoration: none; line-height: 1.4; }
.toc-side > a:hover { color: var(--ink); }
.toc-side > a.here { color: var(--ink); font-weight: 650; }
.toc-prog { height: 2px; background: var(--line); margin-top: 12px; }
.toc-prog i { display: block; height: 100%; background: var(--ink); }
.r-main { min-width: 0; max-width: 860px; }
.r-head { padding-bottom: 14px; }
.r-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.r-title-row .btn { margin-top: 10px; flex: none; }
.r-done { margin-top: 16px; flex: none; font-size: var(--fs-sm); font-weight: 650; white-space: nowrap; }
.r-meta { margin: 10px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.ttabs { display: flex; gap: 26px; border-bottom: 1.5px solid var(--ink); margin-bottom: 24px; overflow-x: auto; position: sticky; top: var(--topbar-h); z-index: 5; background: var(--page); }
.ttabs a { padding: 10px 0 9px; text-decoration: none; color: var(--muted); font-weight: 550; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1.5px; }
.ttabs a .num { color: var(--faint); font-weight: 500; font-size: var(--fs-sm); }
.ttabs a:hover { color: var(--ink); }
.ttabs a[aria-selected="true"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--ink); }
.pdf { width: 100%; height: calc(100vh - 210px); min-height: 640px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); }
.r-note { margin: 0 0 10px; }
.r-next { margin: 22px 0 0; font-size: var(--fs-lg); }
.r-pager { display: flex; justify-content: space-between; gap: 24px; margin-top: 48px; padding-top: 14px; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.r-pager a { text-decoration: none; color: var(--muted); }
.r-pager a:hover { color: var(--ink); }
.sum h2 { font: 700 var(--fs-xl)/1.3 var(--font-ui); letter-spacing: -.01em; margin: 34px 0 12px; }
.sum h2:first-child { margin-top: 4px; }
.sum .keypoints li::before { background: none; color: var(--muted); font-family: var(--font-num); }
.examples .example { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
.example > summary { padding: 11px 0; font-family: var(--font-ui); }
.example .ex-n { background: none; color: var(--muted); }
.q-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.q-head p { margin: 0; }
.tfilters { display: flex; gap: 28px; flex-wrap: wrap; }
.tfilters > span { display: flex; gap: 14px; }
.qtbl .c-s { width: 24px; color: var(--faint); font-weight: 700; }
.qtbl .c-s.right { color: var(--good-ink); } .qtbl .c-s.wrong { color: var(--bad-ink); }
.qtbl td:nth-child(2) { font-family: var(--font-read); font-size: 15px; line-height: 1.5; }
.qtbl .c-src { width: 170px; text-align: right; white-space: nowrap; }
.clist { padding-left: 22px; margin: 0; }
.clist li { padding: 10px 0 12px; border-bottom: 1px solid var(--line); }
.clist .prose { font-size: 16px; }
.c-front { font-weight: 650; margin-bottom: 4px; }
.c-st { margin-top: 4px; }
.fsheet .fs-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.fsheet .formula-expr { background: none; padding: 0; }
.sw-text .reader { max-width: none; }
.sw-text .prose, .sw-text .reader { font-size: var(--fs-read); }
.reader .los { background: none; border-left: 3px solid var(--ink); border-radius: 0; padding: 4px 0 4px 12px; color: var(--ink); }
.reader .callout { background: var(--surface-2); border: 0; border-left: 3px solid var(--line-strong); border-radius: 0; }
.reader .quiz-cta { background: none; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; padding: 12px 0; color: var(--ink); }
.reader .quiz-cta .ico { display: none; }
.reader .kc { background: none; border: 1px solid var(--line); border-radius: 8px; }
.reader .kc-head .ico { display: none; }
.r-notes { margin-top: 36px; }
.r-notes h2 { font-size: var(--fs-lg); margin: 0 0 6px; }

/* ---------- phone ---------- */
.fab { font: 650 13px/1 var(--font-ui); }
@media (max-width: 1180px) {
  .t-grid { grid-template-columns: 1fr; gap: 36px; }
  .t-side { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px; }
  .cal-year { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .reading, .toc-layout { grid-template-columns: 1fr; gap: 20px; }
  .toc-side, .toc-index { position: static; max-height: none; }
  .toc-side > a:not(.here) { display: none; }
  .toc-index { flex-direction: row; flex-wrap: wrap; gap: 4px 16px; }
  .toc-index a { border: 0; padding: 2px 0; }
}
@media (max-width: 760px) {
  .wrap { padding: 18px 16px calc(var(--bottombar-h) + 90px); }
  .topbar { padding: 0 16px; }
  .h1 { font-size: 26px; }
  .t-count { font-size: 24px; } .t-count .num { font-size: 46px; }
  .cal-tools { gap: 16px; width: 100%; justify-content: space-between; }
  .cal-views, .cal-nav { gap: 12px; }
  .cal-month { grid-auto-rows: 58px; }
  .cal-cell { padding: 4px 3px; align-items: center; }
  .cal-dn { justify-content: center; } .cal-dn small { display: none; }
  .cal-evs { flex-direction: row; gap: 3px; justify-content: center; }
  .cal-month .ev { width: 5px; height: 5px; padding: 0; border-radius: 50%; font-size: 0; background: var(--ink); -webkit-line-clamp: unset; }
  .cal-month .ev-hol { background: var(--bad); } .cal-month .ev-done, .cal-month .ev-lesson.is-done { background: var(--good); }
  .cal-month .ev-quiet, .cal-month .ev-more { display: none; }
  .cal-week { grid-template-columns: 1fr; min-height: 0; }
  .cal-col { border-right: 0; border-bottom: 1px solid var(--line); }
  .cal-year { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .ym-d { width: 22px; height: 22px; font-size: 11px; }
  .toc-tbl .c-d, .toc-tbl .c-q { display: none; }
  .r-title-row { flex-direction: column; gap: 6px; }
  .ttabs { gap: 18px; }
  .pdf { height: 70vh; min-height: 420px; }
  .qtbl .c-src { display: none; }
  .bottombar a { font-size: 12px; font-weight: 600; }
}

/* ---------- round 2 (2026-10-20): action first, quieter calendar, reading gets the width ---------- */
/* Today: tonight is the dominant element; where you stand is a narrow column beside it */
.t-hero { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; padding-bottom: 30px; border-bottom: 1.5px solid var(--ink); align-items: end; }
.t-h1 { margin: 10px 0 18px; font-size: 32px; line-height: 1.2; font-weight: 750; letter-spacing: -.025em; max-width: 26ch; }
.t-steps { list-style: none; counter-reset: s; padding: 0; margin: 0 0 22px; max-width: 520px; }
.t-steps li { counter-increment: s; display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-top: 1px solid var(--line); }
.t-steps li:last-child { border-bottom: 1px solid var(--line); }
.t-steps li span:first-child::before { content: counter(s) "  "; white-space: pre; color: var(--faint); font: 600 12.5px var(--font-num); }
.t-act { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.btn.lg { height: 46px; padding: 0 28px; font-size: 15.5px; border-radius: 8px; }
.t-or { font-size: var(--fs-sm); color: var(--muted); }
.t-alt { margin: 14px 0 0; font-size: var(--fs-sm); color: var(--muted); }
.t-alt .linkbtn { color: var(--ink-2); }
.t-stand { margin: 0; display: flex; flex-direction: column; }
.t-stand > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.t-stand dt { font-size: var(--fs-sm); color: var(--muted); }
.t-stand dt a { color: var(--muted); text-decoration: none; }
.t-stand dt a:hover { color: var(--ink); text-decoration: underline; }
.t-stand dd { margin: 0; font: 700 18px/1 var(--font-num); text-align: right; }
.t-stand dd small { font: 500 12px var(--font-ui); color: var(--muted); }
.t-stand dd em { display: block; font: 600 11.5px var(--font-ui); font-style: normal; color: var(--warn-ink); margin-top: 4px; }
.t-stand .ts-main { padding: 0 0 12px; border-bottom: 1.5px solid var(--ink); align-items: flex-end; }
.t-stand .ts-main dd { font-size: 56px; font-weight: 800; letter-spacing: -.04em; }
.t-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; padding-top: 30px; }
.t-side { gap: 28px; }

/* calendar: shorter rows, one date per cell, red only for real holidays */
.cal-month { grid-auto-rows: minmax(84px, auto); }
.cal-dn { justify-content: flex-start; }
.cal-cell.is-past:not(.is-today) { background: none; }
.cal-cell.is-past .cal-evs { opacity: .6; }

/* reading: the text gets the width; contents and links sit in a narrow right column */
.reading { grid-template-columns: minmax(0, 1fr) 250px; gap: 56px; }
.r-main { max-width: 820px; }
.r-h1 { margin: 8px 0 0; font-size: 30px; line-height: 1.2; font-weight: 750; letter-spacing: -.022em; }
.r-rail { position: sticky; top: calc(var(--topbar-h) + 24px); display: flex; flex-direction: column; gap: 28px; max-height: calc(100vh - var(--topbar-h) - 40px); overflow-y: auto; font-size: var(--fs-sm); padding-top: 6px; }
.rr-h { font-size: 11px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding-bottom: 8px; border-bottom: 1.5px solid var(--ink); margin-bottom: 4px; }
.rr-h a { color: var(--muted); text-decoration: none; }
.rr-block > a:not(.here):not(.toc-link) { line-height: 1.45; }
.r-rail .toc-side { position: static; max-height: none; overflow: visible; }
.r-rail .toc-side > a { padding: 6px 0; }
.r-end { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.q-src { font-size: 13px; font-weight: 700; margin: 26px 0 6px; padding-bottom: 6px; border-bottom: 1.5px solid var(--ink); }
.q-src:first-of-type { margin-top: 6px; }
.qtbl td { border-bottom-color: var(--line); }
.qtbl .c-src { width: 90px; }

@media (max-width: 1180px) {
  .t-hero { grid-template-columns: 1fr; gap: 28px; }
  .t-stand { display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 28px; }
  .t-stand .ts-main { grid-column: 1 / -1; }
  .reading { grid-template-columns: 1fr; }
  .r-rail { position: static; max-height: none; order: -1; flex-direction: row; flex-wrap: wrap; gap: 8px 28px; }
  .r-rail .toc-side > a:not(.here) { display: none; }
}
@media (max-width: 760px) {
  .t-h1 { font-size: 24px; }
  .t-stand .ts-main dd { font-size: 44px; }
  .cal-month { grid-auto-rows: 54px; }
  .r-h1 { font-size: 24px; }
}

/* ---------- stage 2 and 3 pages (2026-10-20) ---------- */
.wrap.narrow { max-width: 980px; }
.sec-title { font-size: 15px; font-weight: 700; margin: 34px 0 10px; padding-bottom: 8px; border-bottom: 1.5px solid var(--ink); }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl tfoot td { border-top: 1.5px solid var(--ink); border-bottom: 0; font-weight: 700; }
.empty-line { color: var(--muted); padding: 28px 0; border-bottom: 1px solid var(--line); }
.find { width: 100%; height: 36px; border: 0; border-bottom: 1px solid var(--line-strong); background: none; color: var(--ink); font: inherit; font-size: var(--fs-md); padding: 0 2px; border-radius: 0; }
.find:focus { outline: none; border-bottom-color: var(--ink); }
.page-ttabs { position: static; margin: 22px 0 24px; }

/* questions: filter words on the left, the list on the right */
.flayout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; }
.fcol { position: sticky; top: calc(var(--topbar-h) + 20px); max-height: calc(100vh - var(--topbar-h) - 40px); overflow-y: auto; display: flex; flex-direction: column; gap: 22px; }
.fgrp-h { font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding-bottom: 6px; }
.fl { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 4px 0 4px 10px; border: 0; border-left: 2px solid transparent; background: none; font: inherit; font-size: var(--fs-sm); color: var(--muted); text-align: left; cursor: pointer; }
.fl:hover { color: var(--ink); }
.fl .num { color: var(--faint); font-size: 12px; }
.fl[aria-pressed="true"] { color: var(--ink); font-weight: 650; border-left-color: var(--ink); }
.fsel { width: 100%; height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-sm); padding: 0 8px; }
.fbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-bottom: 12px; margin-bottom: 4px; }
.fbar-act { display: flex; align-items: center; gap: 18px; }
.flist .q-src a { text-decoration: none; }
.flist .q-src a:hover { text-decoration: underline; }
.q-sub { margin-top: 3px; font-family: var(--font-ui); }
.more { margin: 22px 0 0; }
.mtbl td { padding: 12px 12px 12px 0; vertical-align: middle; }
.m-act { white-space: nowrap; }
.m-act a, .m-act .linkbtn { margin-left: 10px; }

/* flashcards */
.fc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 64px; padding-top: 28px; align-items: start; }
.fc-n { font: 800 96px/1 var(--font-num); letter-spacing: -.05em; }
.fc-l { font-size: var(--fs-lg); color: var(--muted); margin: 4px 0 24px; }
.fc-only { margin: 16px 0 0; }
.fc-due .sec-title { margin-top: 0; }
.fc-grid .sec-title:first-child { margin-top: 0; }
.upchart { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; height: 150px; align-items: end; border-bottom: 1px solid var(--ink); }
.upchart > div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 3px; position: relative; }
.upchart i { width: 100%; background: var(--ink); border-radius: 2px 2px 0 0; }
.upchart span { font-size: 11px; color: var(--muted); }
.upchart small { position: absolute; bottom: -20px; font-size: 10.5px; color: var(--faint); }
.upchart + .sec-title { margin-top: 40px; }

/* formulas */
.find + a, .toc-index .find { margin-bottom: 10px; }
.fm-topic { padding-bottom: 28px; }
.fm-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.fm-row.flash { background: var(--signal-soft); }
.fm-body .formula-name { font-weight: 650; margin-bottom: 6px; }
.fm-body .formula-expr { background: none; padding: 0; font-size: 14px; }
.fm-body .vars { margin-top: 8px; }
.fm-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.fm-side .linkbtn { font-size: 12.5px; color: var(--muted); }
.formula-editor { margin-top: 10px; }

/* confusion pairs */
.pairs { border-top: 1.5px solid var(--ink); margin-top: 8px; }
.pair { border-bottom: 1px solid var(--line); }
.pair > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; padding: 14px 0; }
.pair > summary::-webkit-details-marker { display: none; }
.pair-q { font-weight: 600; }
.pair[open] .pair-q { color: var(--ink); }
.pair-a { margin: 0 0 16px 186px; font-size: 16px; }

/* more */
.more-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; padding-top: 28px; align-items: start; }
.more-links { display: flex; flex-direction: column; border-top: 1.5px solid var(--ink); }
.more-links > a, .more-links > .linkbtn { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: var(--fs-md); width: 100%; }
.more-links .num { color: var(--muted); }
.notes-tools { display: flex; gap: 24px; align-items: center; margin: -4px 0 6px; }
.notes-tools .find { max-width: 320px; }
.note-area { width: 100%; min-height: 120px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; font: 400 16px/1.55 var(--font-read); background: var(--surface); color: var(--ink); }
.nlist .nmeta .linkbtn { font-size: 11.5px; color: var(--faint); }
.nlist .nmeta .linkbtn:hover { color: var(--ink); }

/* progress */
.ptbl td, .ptbl th { padding-right: 18px; }
.p-two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 56px; }
.actchart { display: flex; align-items: flex-end; gap: 2px; height: 120px; border-bottom: 1px solid var(--ink); }
.actchart i { flex: 1; background: var(--ink); min-width: 2px; border-radius: 1px 1px 0 0; }
.actchart i.is-today { background: var(--signal); }
.act-axis { display: flex; justify-content: space-between; margin-top: 6px; }
.levels { display: flex; flex-direction: column; gap: 6px; }
.lv-row { display: grid; grid-template-columns: 220px 1fr; align-items: center; gap: 12px; }
.lv-tiles { display: flex; gap: 3px; flex-wrap: wrap; }
.levels .tile { width: 14px; height: 14px; border-radius: 3px; display: inline-block; vertical-align: -2px; margin-right: 4px; }
.lv-key { margin-top: 10px; }

/* settings: sections divided by rules, choices as words */
.settings .settings-cols { columns: 2 420px; column-gap: 56px; padding-top: 12px; }
.settings .card { border: 0; border-top: 1.5px solid var(--ink); border-radius: 0; padding: 14px 0 22px; margin: 18px 0 0; }
.settings .card .h3 { font-size: 15px; font-weight: 700; }
.settings .set-row { grid-template-columns: 160px 1fr; }
.settings .set-row > label { font-weight: 500; color: var(--muted); }
.seg { background: none; padding: 0; gap: 14px; border-radius: 0; }
.seg-btn { padding: 4px 0; border-radius: 0; color: var(--muted); font-weight: 500; border-bottom: 1.5px solid transparent; }
.seg-btn[aria-pressed="true"] { background: none; box-shadow: none; color: var(--ink); font-weight: 700; border-bottom-color: var(--ink); }
.seg.multi .seg-btn[aria-pressed="true"] { background: none; color: var(--ink); }
.input { border-radius: 8px; border-color: var(--line-strong); height: 38px; }
.settings .order li { border-color: var(--line); }

/* the study session and a single question: same quiet frame */
.qcard { border: 0; padding: 8px 0; }
.opt { border-radius: 8px; border-width: 1px; }
.opt .letter { background: none; border: 1px solid var(--line-strong); }
.opt.chosen { background: var(--surface-2); border-color: var(--ink); }
.opt.chosen .letter { background: var(--ink); color: var(--page); }
.verdict { border-radius: 0; background: none; border-left: 3px solid currentColor; padding: 8px 14px; }
.session-top { border-bottom: 1px solid var(--line); }
.bar { background: var(--line); height: 3px; } .bar > i { background: var(--ink); }
.q-meta .chip { border: 0; padding: 0; height: auto; margin-right: 6px; }
.q-meta .src-chip .src-tag { margin-right: 4px; }

@media (max-width: 980px) {
  .flayout, .more-grid, .fc-grid, .p-two { grid-template-columns: 1fr; gap: 28px; }
  .fcol { position: static; max-height: none; flex-direction: row; flex-wrap: wrap; }
  .fgrp { min-width: 200px; }
  .fm-row { grid-template-columns: 1fr; }
  .fm-side { flex-direction: row; justify-content: flex-start; }
  .pair > summary { grid-template-columns: 1fr; gap: 2px; }
  .pair-a { margin-left: 0; }
  .lv-row { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }          /* the sidebar is hidden on phones; its column must go too */
  .t-stand { grid-template-columns: 1fr 1fr; }
  .t-stand > div { flex-direction: column; align-items: flex-start; gap: 2px; }
  .t-stand dd { text-align: left; }
  .t-stand .ts-main { flex-direction: row; align-items: flex-end; }
  .cal-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .t-act { gap: 12px; }
}
@media (max-width: 1180px) {
  .t-grid { grid-template-columns: 1fr; gap: 32px; }
  .t-side { position: static; }
}
/* the exam-trap box was a two-column grid (icon | text); with the icon gone the text fell into the 22px column */
.tip { display: block; padding: 12px 16px; margin-top: 20px; font-family: var(--font-read); font-size: 16px; line-height: 1.6; }
.tip b { font-family: var(--font-ui); font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--warn-ink); margin-right: 4px; }

/* ---------- a question: reading width, choices as rows (also used inside study sessions) ---------- */
.qpage .qp { max-width: 760px; }
.qp .eyebrow { margin-bottom: 14px; }
.qp-body .stem { font-family: var(--font-read); font-size: 20px; line-height: 1.55; margin: 0 0 22px; }
.qp-body .vignette { background: none; border-left: 2px solid var(--line-strong); border-radius: 0; padding: 4px 0 4px 16px; }
.options { gap: 0; border-top: 1px solid var(--line); }
.opt { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; padding: 14px 10px 14px 4px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; font-size: 17px; }
.opt:hover { background: var(--surface-2); border-color: var(--line); }
.opt .letter { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-strong); background: none; font: 650 13px/1 var(--font-ui); color: var(--ink-2); }
.opt.chosen { background: var(--surface-2); }
.opt.correct { background: var(--good-soft); box-shadow: inset 3px 0 0 var(--good); border-color: var(--line); }
.opt.correct .letter { background: var(--good); border-color: var(--good); color: #fff; }
.opt.wrong { background: var(--bad-soft); box-shadow: inset 3px 0 0 var(--bad); border-color: var(--line); }
.opt.wrong .letter { background: var(--bad); border-color: var(--bad); color: #fff; }
.opt .state .ico { display: none; }
.opt .state { font-size: 12.5px; }
.options.compact { border-top: 0; display: flex; gap: 10px; }
.options.compact .opt { border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 14px; }
.verdict { margin: 22px 0 6px; padding: 0 0 0 12px; border-left: 3px solid currentColor; background: none !important; font-weight: 700; font-size: 16px; }
.verdict.good { color: var(--good-ink); } .verdict.bad { color: var(--bad-ink); }
.why { margin: 8px 0 0; display: flex; gap: 14px; flex-wrap: wrap; align-items: baseline; }
.explain { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.explain .eyebrow { margin-bottom: 8px; }
.selfgrade { margin-top: 18px; }
.qp-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 36px; padding-top: 14px; border-top: 1.5px solid var(--ink); font-size: var(--fs-sm); color: var(--muted); }
.qp-foot .linkbtn, .qp-foot a { color: var(--ink-2); }
.qp-next { font-size: var(--fs-md); font-weight: 650; color: var(--ink) !important; }
.crop-wrap { border: 0; padding: 0; }
.crop-label { font-size: 11px; color: var(--faint); }
.crop-label .ico { display: none; }
/* the session screen: same quiet frame, the question in the reading column */
.session-body .qcard { max-width: 760px; margin: 0 auto; }
.session-body .stem { font-family: var(--font-read); font-size: 20px; line-height: 1.55; }
.session-actions { background: color-mix(in srgb, var(--page) 94%, transparent); }
.session-actions .btn.ghost, .qp-foot .btn.ghost { border: 0; }
/* the old reader's ".toc { max-height: 60vh; overflow-y: auto }" also caught the new book contents and trapped them in a
   small scroll box, so the page did not scroll and the topic links had nothing to move. */
.toc-layout .toc { max-height: none; overflow: visible; }

/* ---------- Today v3 (1405-07-28): calendar first; days to exam, Start and the module map beside it ---------- */
.t2-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; align-items: start; }
.t2-main { display: flex; flex-direction: column; gap: 44px; min-width: 0; }
.t2-side { display: flex; flex-direction: column; gap: 30px; position: sticky; top: calc(var(--topbar-h) + 16px); }
.t2 .t-stand .ts-main dd { font-size: 64px; }
.t2-start { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: -12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.t2-what { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: var(--fs-sm); line-height: 1.35; }
.t2-what a { color: var(--ink); }
.t2-start .btn { flex: none; }
.levels.compact { gap: 5px; }
.levels.compact .lv-row { grid-template-columns: 30px 1fr; gap: 8px; }
.levels.compact .lv-t { color: var(--muted); text-decoration: none; font: 600 11.5px var(--font-num); letter-spacing: .03em; }
.levels.compact .lv-t:hover { color: var(--ink); }
.levels.compact .lv-tiles { gap: 3px; flex-wrap: nowrap; }
.levels.compact .tile { width: 12px; height: 12px; margin: 0; border-radius: 2px; }
.levels.compact .lv-key { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; }
.levels.compact .lv-key .tile { width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px; }
.t2-topics .sec-h { margin-bottom: 4px; }
.notes-page .notes-tools { margin: 18px 0 10px; }
.notes-page .notes-tools .btn { margin-left: auto; }
@media (max-width: 1180px) {
  .t2-grid { grid-template-columns: 1fr; gap: 36px; }
  .t2-side { position: static; order: -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px 48px; }
}
@media (max-width: 760px) {
  .t2 .t-stand .ts-main dd { font-size: 48px; }
  .t2-topics .ptbl th:nth-child(2), .t2-topics .ptbl td:nth-child(2), .t2-topics .ptbl th:nth-child(4), .t2-topics .ptbl td:nth-child(4) { display: none; }
}

/* answer keys when the choices are printed in the question (1405-07-28): three square keys in one row */
.options.compact { display: flex; align-items: center; gap: 10px; border-top: 0; margin-top: 14px; }
.options.compact .opt-hint { font-size: var(--fs-sm); color: var(--muted); margin: 0 8px 0 0; line-height: 48px; }
.options.compact .opt { position: relative; flex: none; width: 56px; height: 48px; padding: 0; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.options.compact .opt:hover:not(:disabled) { border-color: var(--ink); }
.options.compact .opt .letter { border: 0; width: auto; height: auto; font: 700 17px var(--font-ui); background: none; color: var(--ink); }
.options.compact .opt-text { display: none; }
.options.compact .opt .state { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 6px; white-space: nowrap; font-size: 11.5px; }
.options.compact .opt .state .ico { display: none; }
.options.compact .opt.correct { border-color: var(--good); box-shadow: inset 0 0 0 1px var(--good); }
.options.compact .opt.correct .letter, .options.compact .opt.correct .state { color: var(--good); }
.options.compact .opt.wrong { border-color: var(--bad); }
.options.compact .opt.wrong .letter, .options.compact .opt.wrong .state { color: var(--bad); }
.options.compact .opt.dim { opacity: .45; }
.options.compact:has(.state:not(:empty)) { margin-bottom: 26px; }

/* Questions by topic (1405-07-28) */
.toc-index a.here { color: var(--ink); font-weight: 700; }
.toc-topic-h .linkbtn { margin-left: auto; }
.qtopic tr[data-href] { cursor: pointer; }
.qtopic tr.is-empty td { color: var(--faint); }
.qtopic td.r, .qtopic th.r { width: 96px; }
/* Explore: filters left, the count and the start on the right; no list of questions */
.ex-pane { padding-top: 4px; }
.ex-count { display: flex; align-items: flex-end; gap: 16px; padding-bottom: 14px; border-bottom: 1.5px solid var(--ink); }
.ex-count > .num { font: 800 64px/0.9 var(--font-num); letter-spacing: -.04em; }
.ex-count > span:last-child { font-size: var(--fs-md); line-height: 1.35; padding-bottom: 4px; }
.ex-stats { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
.ex-stats > div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ex-stats dt { color: var(--muted); font-size: var(--fs-sm); } .ex-stats dd { margin: 0; font: 700 16px var(--font-num); }
.ex-stats dd small { font-weight: 500; color: var(--muted); margin-left: 4px; }
.ex-go { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 26px; }
.ex-size { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); color: var(--muted); margin-right: 8px; }

/* module page: the summary under the title, tabs with the book link at the end */
.m-sum { margin: 22px 0 6px; padding: 16px 0 6px; border-top: 1px solid var(--line); }
.m-sum .keypoints { margin: 0; }
.m-sum .tip { margin-top: 14px; }
.m-big { margin-top: 12px; } .m-big > summary { list-style: none; cursor: pointer; }
.m-big > summary::-webkit-details-marker { display: none; }
.m-big[open] > summary { margin-bottom: 8px; color: var(--ink); }
.ttabs .tt-ext { margin-left: auto; font-size: var(--fs-sm); color: var(--muted); border-bottom: 0 !important; }
.ttabs .tt-ext:hover { color: var(--ink); }
.q-verdict { font-size: var(--fs-md); margin: 18px 0 12px; }
.qsum { margin-bottom: 4px; }
.q-acts { white-space: nowrap; } .q-acts .linkbtn + .linkbtn { margin-left: 14px; }
.r-note { margin: 18px 0; }

/* the written module text */
.mtext .r-h2 { scroll-margin-top: 80px; margin-top: 2em; }
.mtext h3 { scroll-margin-top: 80px; }
.mtext .t-math { margin: 1.1em 0; padding: 12px 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 18px; overflow-x: auto; }
.mtext .t-math-l { grid-column: 1 / -1; font: 650 11px var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.mtext .t-math .formula-tex { font-size: 1.12em; }
.mtext .fm-link { color: var(--ink); text-decoration-style: dotted; text-underline-offset: 3px; }
.mtext .t-math .fm-link { color: var(--muted); white-space: nowrap; }
.mtext .t-table { margin: 1.3em 0; overflow-x: auto; }
.mtext .t-table table { border-collapse: collapse; font: 400 14.5px/1.45 var(--font-ui); min-width: 60%; }
.mtext .t-table th { text-align: left; font-weight: 650; border-bottom: 1.5px solid var(--ink); padding: 6px 14px 6px 0; }
.mtext .t-table td { border-bottom: 1px solid var(--line); padding: 6px 14px 6px 0; font-variant-numeric: tabular-nums; }
.mtext figcaption { font: 500 12.5px/1.45 var(--font-ui); color: var(--muted); margin-top: 6px; }
.mtext .t-fig { margin: 1.5em 0; color: var(--ink); }
.mtext .t-fig svg { width: 100%; max-width: 680px; height: auto; display: block; }
.mtext .callout.t-key { background: none; border-left: 3px solid var(--ink); }
.mtext .callout.t-trap { background: none; border-left: 3px solid var(--warn-ink); }
.mtext .callout.t-trap .callout-kind { color: var(--warn-ink); }
.mtext .tex { white-space: nowrap; }

/* Progress, analysed (1405-07-28): one ink colour, thin bars, numbers at the tip */
.pa section { margin-top: 44px; }
.pa .sec-h { display: flex; align-items: baseline; gap: 14px; justify-content: space-between; border-bottom: 1.5px solid var(--ink); padding-bottom: 8px; margin-bottom: 4px; }
.pa .sec-h h2 { margin: 0; font-size: 17px; font-weight: 720; }
.pa-note { margin: 10px 0 6px; max-width: 760px; }
.pa-stats { margin: 6px 0 0; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 0 40px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.pa-stats > div { display: flex; flex-direction: column; gap: 4px; }
.pa-stats dt { font-size: var(--fs-sm); color: var(--muted); }
.pa-stats dd { margin: 0; font: 750 30px/1.05 var(--font-num); letter-spacing: -.02em; }
.pa-stats dd small { font: 500 13px var(--font-ui); color: var(--muted); letter-spacing: 0; }
.pa-stats p { margin: 0; }
.pa-stats .pa-hero dd { font-size: 64px; font-weight: 800; letter-spacing: -.04em; }
.pa-stats .pa-hero dd small { font: 700 28px var(--font-num); color: var(--ink); }
.hb { display: grid; grid-template-columns: minmax(80px, 1fr) 72px; align-items: center; gap: 10px; }
.hb-track { display: block; height: 10px; }
.hb-bar { display: block; height: 10px; background: var(--ink); border-radius: 0 4px 4px 0; min-width: 2px; }
.hb-v { font-size: 13px; white-space: nowrap; }
.pa-tbl .pa-gain, th.pa-gain { width: 30%; }
td.pa-gain .hb { min-width: 200px; }
.pa-finds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
.pa-find { padding: 16px 0 14px; border-bottom: 1px solid var(--line); }
.pa-find h3 { margin: 0 0 10px; font-size: 15px; font-weight: 700; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.pa-tag { font: 600 12px var(--font-ui); color: var(--ink-2); white-space: nowrap; }
.pa-find.is-maybe h3 { color: var(--muted); } .pa-find.is-maybe .pa-tag { color: var(--faint); font-weight: 500; }
.pa-find.is-maybe .hb-bar { background: var(--line-strong); }
.pa-pair { display: flex; flex-direction: column; gap: 7px; }
.pa-row { display: grid; grid-template-columns: 190px minmax(0, 1fr) 70px; align-items: center; gap: 12px; font-size: var(--fs-sm); }
.pa-n { text-align: right; white-space: nowrap; } .pa-n::after { content: " answers"; }
.pa-adv { margin: 10px 0 0; font: 400 15px/1.5 var(--font-read); color: var(--ink-2); }
.pa .p-two { gap: 48px; }
.pa-weeks { display: flex; gap: 2px; align-items: flex-end; padding-top: 14px; }
.pa-wk { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.pa-col { display: flex; align-items: flex-end; height: 120px; width: 100%; justify-content: center; border-bottom: 1px solid var(--ink); }
.pa-col i { display: block; width: min(24px, 70%); background: var(--ink); border-radius: 4px 4px 0 0; min-height: 2px; }
.pa-wd { font-size: 11px; white-space: nowrap; }
@media (max-width: 980px) {
  .pa-stats { grid-template-columns: 1fr 1fr; gap: 18px 28px; }
  .pa-finds { grid-template-columns: 1fr; }
  .pa-row { grid-template-columns: 130px minmax(0, 1fr) 40px; }
  .pa-tbl th:nth-child(2), .pa-tbl td:nth-child(2), .pa-tbl th:nth-child(4), .pa-tbl td:nth-child(4) { display: none; }
  .pa-wd { display: none; }
}
.mock-switch { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; margin: 10px 0 0; }
.mock-switch label { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; color: var(--ink); }
.mock-switch input { accent-color: var(--ink); width: 15px; height: 15px; }

/* fixes Amir saw on Windows (1405-07-28): no visible scrollbars in the rail or the tabs; section names use the full width */
.r-rail, .ttabs, .toc-side, .mtext .t-math { scrollbar-width: none; -ms-overflow-style: none; }
.r-rail::-webkit-scrollbar, .ttabs::-webkit-scrollbar, .toc-side::-webkit-scrollbar, .mtext .t-math::-webkit-scrollbar { display: none; }
.ttabs { overflow-y: hidden; }
.mt-toc .toc-link { display: block; width: 100%; }
.mt-toc .toc-link > span { display: block; }
.mtext .t-math .katex-display { margin: 0; }
.mtext .t-math .formula-tex { min-width: 0; overflow-x: auto; scrollbar-width: none; }

/* moving charts (1405-07-28): one ink, hairline grid, controls as quiet rows */
.mtext .t-viz { margin: 1.8em 0; padding: 16px 0 12px; border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--line); }
.vz-title { font: 700 14px var(--font-ui); margin-bottom: 8px; }
.vz-legend { display: flex; gap: 18px; flex-wrap: wrap; font: 500 12.5px var(--font-ui); color: var(--ink-2); margin-bottom: 4px; }
.vz-legend span { display: inline-flex; align-items: center; gap: 6px; } .vz-legend svg { color: var(--ink); }
.vz-plot { position: relative; color: var(--ink); }
.vz-plot svg { width: 100%; height: auto; display: block; touch-action: none; user-select: none; }
.vz-plot text { font: 500 12px var(--font-ui); fill: var(--muted); }
.vz-plot .vz-lab { fill: var(--ink-2); font-weight: 600; }
.vz-plot .vz-end, .vz-plot .vz-ptl, .vz-plot .vz-bv { fill: var(--ink); font-weight: 600; }
.vz-grid { stroke: var(--line); stroke-width: 1; }
.vz-zero, .vz-axis { stroke: var(--ink); stroke-width: 1; }
.vz-line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.vz-dot { fill: currentColor; stroke: var(--page); stroke-width: 2; }
.vz-pt { fill: currentColor; stroke: var(--page); stroke-width: 2.5; }
.vz-ref { stroke: currentColor; stroke-width: 1.5; }
.vz-cross { stroke: var(--line-strong); stroke-width: 1; }
.vz-hit, .vz-grab { fill: transparent; }
.vz-grab { cursor: ns-resize; }
.vz-bar { fill: currentColor; } .vz-bar.neg { fill: currentColor; fill-opacity: .45; }
.vz-tip { position: absolute; top: 8px; pointer-events: none; background: var(--page); border: 1px solid var(--line-strong); border-radius: 6px; padding: 6px 9px; font: 500 12px/1.45 var(--font-ui); display: flex; flex-direction: column; min-width: 150px; color: var(--ink); }
.vz-controls { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; margin-top: 10px; }
.vz-ctl { display: grid; grid-template-columns: auto 180px 80px; gap: 10px; align-items: center; font: 500 13px var(--font-ui); color: var(--ink-2); }
.vz-ctl input { accent-color: var(--ink); width: 180px; }
.vz-ctl b { font-size: 13px; color: var(--ink); }
.vz-play { font-size: 13px; }
.vz-read { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px 32px; }
.vz-read > div { display: flex; gap: 8px; align-items: baseline; }
.vz-read dt { font: 500 12.5px var(--font-ui); color: var(--muted); } .vz-read dd { margin: 0; font: 700 15px var(--font-num); }
.vz-hint { margin: 6px 0 0; }
@media (max-width: 760px) { .vz-ctl { grid-template-columns: 1fr 72px; } .vz-ctl .vz-ctl-l { grid-column: 1 / -1; } .vz-ctl input { width: 100%; } }

/* Amir 1405-07-28: centre tables and diagrams, give table cells air, one typeface inside diagrams */
.mtext .t-table, .mtext .t-fig { display: flex; flex-direction: column; align-items: center; }
.mtext .t-table table { margin: 0 auto; min-width: 0; }
.mtext .t-table th, .mtext .t-table td { padding: 7px 16px; }
.mtext .t-table th:first-child, .mtext .t-table td:first-child { padding-left: 4px; }
.mtext .t-table figcaption, .mtext .t-fig figcaption { align-self: stretch; text-align: center; max-width: 640px; margin: 8px auto 0; }
.mtext .t-fig svg { margin: 0 auto; }
.mtext .t-fig svg text { font-family: var(--font-ui); }
/* checked-against-the-book line, book-page links, the flag button (1405-07-28) */
.audit-line { margin: 4px 0 18px; padding: 8px 0; border-bottom: 1px solid var(--line); line-height: 1.5; }
.mtext .src-link { margin-left: 12px; font: 500 12px var(--font-ui); color: var(--muted); text-decoration: none; white-space: nowrap; vertical-align: 2px; }
.mtext .src-link:hover { color: var(--ink); text-decoration: underline; }
.hl-btn.hl-flag { background: var(--page); color: var(--bad-ink); border: 1px solid var(--bad); }
.m-sum-text .mtext { font-size: 16.5px; }
.m-sum-text .mtext .r-li { margin: 0 0 6px; }
.m-more > summary { list-style: none; cursor: pointer; margin: 2px 0 6px; } .m-more > summary::-webkit-details-marker { display: none; }
.m-more[open] > summary { display: none; }
.vz-line.light { stroke-opacity: .4; }

/* ---------- practice runs (1405-07-29): inside the normal frame, menu kept, a way back, no exam look ---------- */
body.in-run .topbar, body.in-run .fab { display: none !important; }
body.in-run .session-actions { left: var(--sidebar-w); }
.session-top { grid-template-columns: auto minmax(0, 760px) auto; }
.session-top .row.between { flex-wrap: wrap; gap: 4px 16px; }
.run-back { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.run-back:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.run-right { display: inline-flex; gap: 16px; align-items: baseline; }
.run-mode { display: inline-flex; gap: 10px; align-items: baseline; font-size: var(--fs-sm); }
.run-mode[hidden] { display: none; }
.run-mode .linkbtn { color: var(--muted); text-decoration: none; }
.run-mode .linkbtn:hover { color: var(--ink); }
.run-mode .linkbtn[aria-pressed="true"] { color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--ink); text-underline-offset: 4px; }
.run-note { margin: 14px 0 0; }
/* the question box: .card.raised kept its border while .qcard set padding to 0 left/right, so the text sat on the line */
.card.raised.qcard { padding: 24px 30px 26px; }

/* the results page of an "answers at the end" run */
.results { max-width: 760px; margin: 0 auto; }
.results .lede { margin: 8px 0 0; }
.res-tools { color: var(--muted); margin: 14px 0 12px; }
.res-list { list-style: none; padding: 0; margin: 0; border-top: 1.5px solid var(--ink); }
.res { border-bottom: 1px solid var(--line); }
.res > details > summary { display: grid; grid-template-columns: 30px 84px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 13px 4px; cursor: pointer; list-style: none; }
.res > details > summary::-webkit-details-marker { display: none; }
.res > details > summary:hover { background: var(--surface-2); }
.res > details[open] > summary { border-bottom: 1px solid var(--line); }
.res-n { color: var(--muted); font-weight: 650; }
.res-mark { font-weight: 700; font-size: 14px; }
.res-mark.good { color: var(--good-ink); } .res-mark.bad { color: var(--bad-ink); }
.res-what { font-size: 15px; }
.res-body { padding: 18px 4px 28px 46px; }
.res-body .stem { font-size: 18px; }

@media (max-width: 760px) {
  body.in-run .session-actions { left: 0; bottom: var(--bottombar-h); }
  body.in-run .session-body { padding-bottom: 210px; }
  .card.raised.qcard { padding: 18px 16px 20px; }
  .run-mode > .meta { display: none; }
  .res > details > summary { grid-template-columns: 24px 64px minmax(0, 1fr); }
  .res-src { display: none; }
  .res-body { padding: 14px 0 22px; }
}
/* "why did you miss it": the label on its own line, the four taps under it, flush left (they were pushed in by the old flex row) */
.why { display: block; margin: 18px 0 0; }
.why > .meta { display: block; margin: 0 0 8px; }
.why > .row { gap: 8px; margin: 0; padding: 0; }
/* the chosen letter (answers at the end) must read at a glance: solid, not a slightly darker outline */
.options.compact .opt.chosen { background: var(--ink); border-color: var(--ink); color: var(--page); }
.opt.chosen:not(.correct):not(.wrong) { box-shadow: inset 3px 0 0 var(--ink); }
.options.compact .opt.chosen { box-shadow: none; }
.options.compact .opt.chosen .letter { color: var(--page); }
/* phones: the three letter keys stay one row (an old phone rule stacked them into a column) */
@media (max-width: 760px) {
  .options.compact { flex-direction: row; flex-wrap: wrap; }
  .options.compact .opt-hint { flex-basis: 100%; line-height: 1.4; margin: 0 0 2px; }
}
