/* ================= iPad lecture reader: paper pages with a fixed layout ================= */
body.in-lecture main.rd-page { max-width: none; margin: 0; padding: 0 0 calc(80px + var(--safe-b)); }

/* top bar */
.rd-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 10px 18px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); transition: transform .35s var(--ease), opacity .3s; }
.rd-bar .t { min-width: 0; display: grid; flex: 0 1 240px; }
.rd-bar .t .eyebrow { font-size: 10px; }
.rd-bar .t b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-modes { flex: 1; display: flex; justify-content: center; min-width: 0; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: color-mix(in srgb, var(--text) 6%, transparent); }
.seg button { padding: 7px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: background .2s, color .2s, box-shadow .2s; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.rd-tools { display: flex; gap: 6px; }
.rd-bar .icon-btn.on { background: var(--dept); color: #fff; border-color: var(--dept); }
.rd-progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--dept); }
@media (max-width: 820px) { .rd-bar .t { display: none; } }
@media (max-width: 600px) { .seg button { padding: 7px 8px; font-size: 12px; } .rd-bar { gap: 6px; padding-left: 10px; padding-right: 10px; } .rd-tools .icon-btn { width: 36px; height: 36px; } }

/* the document: a fixed 760 px column, scaled as one piece */
.rd-stage { padding: 28px 0 10px; }
.rd-stage[hidden] { display: none; }
.rd-doc { position: relative; margin: 0 auto; }
.rd-in { position: relative; width: 760px; transform-origin: 0 0; }
#pages.fade { animation: rdFade .35s var(--ease); }
@keyframes rdFade { from { opacity: 0; } to { opacity: 1; } }
.rd-other { max-width: 680px; margin: 0 auto; padding: 28px 20px; }
.rd-other[hidden] { display: none; }

/* a page */
.pg { position: relative; margin: 0 0 28px; padding: 58px 60px 40px 120px; background: var(--surface); border-radius: 4px; box-shadow: 0 1px 3px rgba(20, 20, 10, .06), 0 14px 36px rgba(20, 20, 10, .07); font: 400 17px/1.62 var(--sans); color: var(--text); -webkit-text-size-adjust: none; text-size-adjust: none; }
.pg-head { position: absolute; top: 24px; left: 120px; right: 60px; display: flex; justify-content: space-between; gap: 20px; font: 600 10.5px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pg-head span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-title { position: relative; margin: 8px 0 24px; }
.pg-n { position: absolute; left: -92px; top: 0; width: 68px; text-align: right; font: 500 36px/1 var(--serif); color: var(--dept); }
.pg h2 { margin: 0; font: 600 32px/1.15 var(--serif); letter-spacing: -.01em; }
.pg h2::after { content: ''; display: block; width: 56px; height: 4px; margin-top: 14px; border-radius: 4px; background: color-mix(in srgb, var(--dept) 55%, transparent); }
.pg h3 { display: flex; gap: 12px; align-items: baseline; margin: 28px 0 8px; font: 600 21px var(--serif); }
.pg h3 .k { font: 500 21px var(--serif); color: var(--dept); }
.pg h4 { margin: 28px 0 8px; font: 700 12.5px var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--dept); }
.pg h4.red { color: var(--bad); }
.pg p { margin: 0 0 14px; }
.pg b { font-weight: 650; }
.pg .muted { color: var(--muted); }
.pg .small { font-size: 14px; }
.pg .blk { position: relative; }

/* author highlights look like a marker stroke */
.pg mark { padding: 0 1px; color: inherit; background: linear-gradient(transparent 56%, var(--hl-y) 56%); }
.hl-line { background: linear-gradient(transparent 58%, var(--hl-y) 58%); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
/* the student's highlights */
.pg mark.uh { padding: 1px 0; border-radius: 2px; cursor: pointer; }
.pg mark.uh.c-y { background: var(--hl-y); } .pg mark.uh.c-g { background: var(--hl-g); }
.pg mark.uh.c-b { background: var(--hl-b); } .pg mark.uh.c-p { background: var(--hl-p); }

/* margin labels instead of boxes */
.n { position: relative; margin: 8px 0 18px; }
.n p:last-child { margin-bottom: 0; }
.mtag { position: absolute; left: -104px; top: 5px; width: 84px; text-align: right; font: 800 9.5px/1.3 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.n-key .mtag { color: color-mix(in srgb, var(--warn) 80%, var(--text)); }
.n-often .mtag, .n-warn .mtag { color: var(--bad); }
.n-often::before, .n-warn::before { content: ''; position: absolute; left: -12px; top: 5px; bottom: 5px; width: 2.5px; border-radius: 2px; background: color-mix(in srgb, var(--bad) 60%, transparent); }
.n-pearl .mtag { color: var(--ok); }
.n-pearl p { font-style: italic; }
.n-exam .mtag, .n-check .mtag, .n-case .mtag, .n-mnemo .mtag { color: var(--dept); }
.n-deep p { font-size: 15.5px; color: var(--muted); }
.n-deep p b { color: var(--text); }
.n-case .stem { font-style: italic; }
.n-case .ask { font-weight: 650; margin-top: 6px; }
.ans { display: inline-flex; align-items: center; gap: 2px; padding: 2px 0; font: 700 14px var(--sans); color: var(--dept); }
.ans svg.i { width: 15px; height: 15px; }

/* lists */
.pg ul.dash { list-style: none; margin: 0 0 16px; padding: 0; }
.pg ul.dash li { position: relative; margin: 5px 0; padding-left: 20px; }
.pg ul.dash li::before { content: ''; position: absolute; left: 1px; top: .8em; width: 9px; height: 2px; border-radius: 2px; background: var(--dept); }
.pg ol.num { list-style: none; counter-reset: n; margin: 0 0 16px; padding: 0; }
.pg ol.num li { counter-increment: n; position: relative; margin: 9px 0; padding-left: 34px; }
.pg ol.num li::before { content: counter(n); position: absolute; left: 0; top: -1px; font: 600 18px var(--serif); color: var(--dept); }

/* tables: lines only */
.pg table.rule { width: 100%; margin: 4px 0 22px; border-collapse: collapse; font-size: 15px; line-height: 1.45; border-top: 2px solid var(--text); border-bottom: 2px solid var(--text); }
.pg table.rule th { padding: 10px 10px 8px; text-align: left; font: 700 11.5px var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--dept); border-bottom: 1px solid var(--text); }
.pg table.rule td { padding: 9px 10px; vertical-align: top; border-bottom: 1px solid var(--line); }
.pg table.rule tr:last-child td { border-bottom: 0; }
.pg table.rule td:first-child { font-weight: 600; }

/* steps */
.pg ol.steps { list-style: none; counter-reset: s; margin: 0 0 18px; padding: 0; }
.pg ol.steps li { counter-increment: s; position: relative; display: grid; gap: 2px; padding: 2px 0 16px 46px; }
.pg ol.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--dept); background: var(--surface); color: var(--dept); font: 700 13px var(--sans); }
.pg ol.steps li:not(:last-child)::after { content: ''; position: absolute; left: 14px; top: 31px; bottom: 3px; width: 1.5px; background: color-mix(in srgb, var(--dept) 30%, transparent); }
.pg ol.steps span { font-size: 15.5px; color: var(--muted); }

/* two columns */
.pg .two { display: grid; grid-template-columns: 1fr 1fr; margin: 6px 0 18px; }
.pg .two > div { padding: 0 0 0 24px; }
.pg .two > .l { padding: 0 24px 0 0; border-right: 1px solid var(--line-2); }
.pg .two h4 { margin-top: 0; }

/* a + b + c, one drug per line */
.pg .plus { display: grid; grid-template-columns: 22px auto 1fr; align-items: baseline; column-gap: 10px; row-gap: 4px; margin: 4px 0 22px; }
.pg .plus b { font: 600 20px var(--serif); }
.pg .plus .eg { font-size: 14px; color: var(--muted); }
.pg .plus .op { font: 400 22px/1 var(--sans); color: var(--dept); text-align: center; }

/* mnemonic */
.pg .mn { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.pg .mn span { font-size: 16.5px; }
.pg .mn b { margin-right: 1px; font: 600 26px var(--serif); color: var(--dept); }

/* figures */
.pg .fig { margin: 10px 0 24px; }
.pg .fig svg, .pg .fig img { display: block; width: 100%; max-width: 460px; height: auto; margin: 0 auto; }
.pg .fig figcaption { margin-top: 8px; font-size: 13.5px; font-style: italic; color: var(--muted); }
.pg .fig.wide img { max-width: 100%; }
.pg .fig.box img { max-width: min(100%, 560px); border-radius: 2px; }
.pg .fig img { -webkit-user-drag: none; -webkit-touch-callout: none; user-select: none; pointer-events: none; }
/* tables copied from the source lecture keep its look: a solid header band and shaded rows */
.pg table.src { width: 100%; border-collapse: separate; border-spacing: 0 2px; margin: 6px 0 22px; font-size: 14.5px; line-height: 1.42; }
.pg table.src th, .pg table.src td { padding: 7px 10px; text-align: left; vertical-align: top; background: #ECEFF3; border-right: 2px solid var(--surface); }
.pg table.src tbody tr:nth-child(even) > * { background: #F5F7F9; }
.pg table.src thead th { background: #3A4D63; color: #fff; font-weight: 700; }
.pg table.src tbody th { font-weight: 700; width: 28%; }
.pg table.src td.side { background: #F5F7F9 !important; vertical-align: middle; width: 16%; }
.pg table.src tr.foot td { background: #F5F7F9; }
.pg table.src .ind { display: block; padding-left: 26px; }
.pg table.src ul { margin: 0; padding-left: 16px; }
.pg table.src ul li { margin: 0 0 4px; }
.pg table.src.cols4 th, .pg table.src.cols4 td { width: 25%; }
.pg table.src.two-col tbody th { width: 46%; }

/* page foot */
.pg-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 34px; padding-top: 16px; border-top: 1px dashed var(--line-2); }
.qlink { display: inline-flex; align-items: center; gap: 8px; font: 700 14.5px var(--sans); color: var(--dept); }
.qlink.ok { color: var(--ok); } .qlink.bad { color: var(--bad); }
.done-btn { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--line-2); font: 600 14px var(--sans); color: var(--muted); transition: color .2s, border-color .2s; }
.done-btn.on { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }

/* cover */
.pg.cover { padding-top: 96px; padding-bottom: 56px; }
.cv-top { font: 700 12px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--dept); }
.pg.cover h1 { margin: 16px 0 14px; font: 600 50px/1.06 var(--serif); letter-spacing: -.015em; }
.cv-sub { max-width: 520px; font-size: 19px; color: var(--muted); }
.cv-facts { margin: 24px 0 34px; padding: 14px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); font-size: 14px; color: var(--muted); }
.cv-facts b { color: var(--text); }

/* end page */
.pg ol.next { list-style: none; margin: 18px 0 8px; padding: 0; }
.pg ol.next li + li { border-top: 1px solid var(--line); }
.pg ol.next button { width: 100%; display: flex; align-items: center; gap: 18px; padding: 16px 0; text-align: left; }
.pg ol.next .nn { width: 34px; display: grid; place-items: center; font: 500 30px/1 var(--serif); color: var(--dept); }
.pg ol.next .tx { flex: 1; display: grid; }
.pg ol.next .tx b { font: 600 20px var(--serif); }
.pg ol.next .tx span { font-size: 14.5px; color: var(--muted); }
.pg ol.next .chev { color: var(--muted); }
.pg a.st { font-weight: 600; color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }

/* ink and notes live inside each page */
canvas.pink { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; }
.inking canvas.pink { pointer-events: auto; touch-action: none; cursor: crosshair; }
.inking .pg { -webkit-user-select: none; user-select: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--dept) 30%, transparent), 0 14px 36px rgba(20, 20, 10, .07); }
.inking .rd-bar { visibility: hidden; }
.pnotes { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.pnotes .fnote { pointer-events: auto; width: 214px; }
.pnotes .fnote.min { width: 38px; }
.placing .pg { cursor: copy; }
.placing .pg:has(.pnotes) { box-shadow: 0 0 0 2px color-mix(in srgb, var(--warn) 45%, transparent), 0 14px 36px rgba(20, 20, 10, .07); }
.qpop-body p { margin: 8px 0 0; line-height: 1.55; }

/* full screen: only the pages, on a soft desk; plain white paper */
body.lec-focus { background: color-mix(in srgb, var(--bg) 82%, var(--text) 9%); }
body.lec-focus .rd-bar { position: fixed; top: calc(10px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); width: auto; padding: 6px 8px; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: 0 10px 28px rgba(20, 20, 10, .12); }
body.lec-focus .rd-bar .t, body.lec-focus .rd-modes, body.lec-focus .rd-progress { display: none; }
body.lec-focus .rd-bar .icon-btn { background: transparent; border-color: transparent; }
body.lec-focus .rd-bar .icon-btn.on { background: var(--dept); color: #fff; }
body.lec-focus .rd-page.bar-hide .rd-bar { transform: translate(-50%, -90px); opacity: 0; }
body.lec-focus .rd-page.bar-hide .page-chip { transform: translate(-50%, 90px); opacity: 0; }
body.lec-focus .rd-stage { padding-top: 70px; }
.pg table.src.cg th, .pg table.src.cg td { width: auto; }

/* notes, pearls and questions: each kind has its own soft card, so it stands out from the lecture text */
.pg .n { --c: var(--dept); margin: 14px 0 20px; padding: 12px 16px 13px 18px; background: color-mix(in srgb, var(--c) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 24%, transparent); border-left: 4px solid color-mix(in srgb, var(--c) 70%, var(--surface)); border-radius: 10px; }
.pg .n::before { display: none; }
.pg .n .mtag { position: static; display: block; width: auto; margin: 0 0 5px; text-align: left; font-size: 10.5px; letter-spacing: .09em; color: color-mix(in srgb, var(--c) 82%, var(--text)); }
.pg .n p { margin: 0 0 6px; }
.pg .n-key { --c: #C9962B; }
.pg .n-key .hl-line { background: none; }
.pg .n-often { --c: #D2556B; }
.pg .n-warn { --c: #E07B39; }
.pg .n-pearl { --c: #3F9A6B; }
.pg .n-pearl p { font-style: normal; }
.pg .n-exam { --c: var(--dept); }
.pg .n-mnemo { --c: #7B61C9; }
.pg .n-deep { --c: #7C8794; }
.pg .n-case { --c: #2A9D8F; }
.pg .n-check { --c: #4A7BD0; border-style: dashed; border-left-style: solid; }
.pg .n .ans { margin-top: 4px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); color: color-mix(in srgb, var(--c) 85%, var(--text)); }
/* the page question: a clear button of its own */
.pg-foot .qlink { padding: 9px 16px 9px 12px; border-radius: 12px; background: color-mix(in srgb, #4A7BD0 9%, var(--surface)); border: 1px solid color-mix(in srgb, #4A7BD0 35%, transparent); color: #3A66B5; box-shadow: 0 2px 6px rgba(40, 70, 130, .08); }
.pg-foot .qlink.ok { background: color-mix(in srgb, var(--ok) 10%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 40%, transparent); color: var(--ok); }
.pg-foot .qlink.bad { background: color-mix(in srgb, var(--bad) 8%, var(--surface)); border-color: color-mix(in srgb, var(--bad) 35%, transparent); color: var(--bad); }

/* ================= landscape sheets: every page is a fixed 1180 x 820 sheet, the shape of an iPad held sideways ================= */
.rd-in { width: 1180px; }
.pg.sheet { width: 1180px; height: 820px; margin: 0 0 24px; padding: 0; overflow: hidden; font: 400 18px/1.55 var(--sans); scroll-snap-align: start; }
.pg.sheet .pg-head { top: 22px; left: 64px; right: 64px; }
.pg.sheet .pg-body { position: absolute; top: 58px; left: 64px; width: 1052px; height: 712px; display: flex; flex-direction: column; gap: 14px; }
.pg.sheet .pg-num { position: absolute; left: 0; right: 0; text-align: center; bottom: 16px; font: 600 12px var(--sans); letter-spacing: .08em; color: var(--muted); }
.pg.sheet .pg-title { margin: 4px 0 2px; display: flex; align-items: baseline; gap: 16px; }
.pg.sheet .pg-n { position: static; width: auto; text-align: left; font-size: 34px; }
.pg.sheet h2 { font-size: 30px; }
.pg.sheet h2::after { margin-top: 10px; }
.seg2 { display: grid; grid-template-columns: 504px 504px; column-gap: 44px; align-items: start; }
.seg2 .c, .pg.measure .m-wide, .pg.measure .m-col { display: flex; flex-direction: column; gap: 12px; }
.seg2 .c { min-height: 1px; }
.seg2 .c:nth-child(2) { position: relative; }
.seg2 .c:nth-child(2)::before { content: ''; position: absolute; left: -22px; top: 4px; bottom: 4px; width: 1px; background: var(--line); }
.seg2 .c:nth-child(2):empty::before { display: none; }
.pg.sheet .blk, .pg.sheet .unit { display: flow-root; margin: 0; }
.pg.sheet .blk.cont { margin-top: -8px; }
.pg.sheet .blk > :first-child, .pg.sheet .unit > :first-child { margin-top: 0; }
.pg.sheet .blk > :last-child, .pg.sheet .unit > :last-child { margin-bottom: 0; }
.pg.sheet h4 { margin: 0 0 6px; }
.pg.sheet .n { margin: 0; }
.pg.sheet ul.dash { margin: 0; }
.pg.sheet ul.dash li { margin: 0; }
.pg.sheet table.rule, .pg.sheet table.src, .pg.sheet .fig, .pg.sheet .two, .pg.sheet .plus, .pg.sheet ol.steps { margin-bottom: 0; }
.pg.sheet .fig img { width: auto; max-width: 100%; max-height: 430px; }
.pg.sheet .fig.box img { max-width: min(100%, 600px); }
.pg.sheet .fitbox { overflow: hidden; }
.pg.sheet .fitbox > .fitin { transform-origin: 50% 0; }
.pg.sheet .pg-foot { margin: 6px 0 0; }
.pg.measure { position: absolute; left: -30000px; top: 0; height: auto; visibility: hidden; pointer-events: none; box-shadow: none; }
.pg.measure .m-wide { width: 1052px; flex: none; } .pg.measure .m-col { width: 504px; flex: none; }
.pg.measure { display: block; }
/* cover and end sheets */
.pg.sheet.cover { display: grid; grid-template-columns: 560px 1fr; column-gap: 64px; align-content: center; padding: 0 80px; }
.pg.sheet.cover h1 { font-size: 52px; }
.pg.sheet.cover .cv-r { border-left: 1px solid var(--line); padding-left: 48px; }
.pg.sheet.cover .cv-r h4 { margin-top: 0; }
.pg.sheet.end { padding: 70px 120px; }
.pg.sheet.end .pg-title { margin-bottom: 10px; }
/* turn pages one at a time when the iPad is sideways */
@media (orientation: landscape) { html:has(.rd-page .pg.sheet) { scroll-snap-type: y proximity; } }
.pg.sheet .sheet-foot { position: absolute; left: 64px; right: 64px; bottom: 9px; z-index: 5; margin: 0; padding: 0; border: 0; }
.pg.sheet .sheet-foot .qlink, .pg.sheet .sheet-foot .done-btn { padding-top: 6px; padding-bottom: 6px; }

/* ---------- page navigation, quiet and modern (rail of ticks, glass capsule, question button) ---------- */
@media (min-width: 900px) {
  .rd-page .page-dots { right: 14px; gap: 0; padding: 10px 6px; border-radius: 14px; background: color-mix(in srgb, var(--surface) 70%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .rd-page .page-dots button { width: 34px; height: 18px; border: 0; background: none; border-radius: 0; box-shadow: none; transform: none; display: flex; align-items: center; justify-content: flex-end; }
  .rd-page .page-dots button > span { display: none; }
  .rd-page .page-dots button::before { content: ''; width: 12px; height: 3px; border-radius: 3px; background: color-mix(in srgb, var(--text) 22%, transparent); transition: width .25s ease, background-color .25s ease; }
  .rd-page .page-dots button.done::before { background: color-mix(in srgb, var(--dept) 45%, transparent); }
  .rd-page .page-dots button:hover::before { width: 20px; background: color-mix(in srgb, var(--text) 50%, transparent); }
  .rd-page .page-dots button.on { background: none; transform: none; }
  .rd-page .page-dots button.on::before { width: 28px; background: var(--dept); }
  .rd-page .page-dots em { right: 44px; border-radius: 8px; box-shadow: 0 6px 18px rgba(20, 30, 45, .10); }
}
.rd-page .page-chip { padding: 9px 18px 11px; gap: 10px; border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); box-shadow: 0 10px 30px rgba(20, 30, 45, .12); overflow: hidden; }
.rd-page .page-chip .pt { order: 1; color: var(--text); font-weight: 650; }
.rd-page .page-chip .pn { order: 2; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; font-size: .92em; }
.rd-page .page-chip .pbar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: color-mix(in srgb, var(--text) 8%, transparent); }
.rd-page .page-chip .pbar b { display: block; height: 100%; width: 0; background: var(--dept); border-radius: 0 3px 3px 0; transition: width .35s ease; }
.pg.sheet .sheet-foot { justify-content: flex-end; }
.pg.sheet .sheet-foot .qlink { gap: 10px; padding: 8px 16px 8px 9px; border-radius: 12px; border: 0; background: #1F2A37; color: #fff; font: 650 14px var(--sans); box-shadow: 0 6px 16px rgba(20, 30, 45, .16); }
.pg.sheet .sheet-foot .qlink svg.i { width: 26px; height: 26px; padding: 6px; border-radius: 8px; background: rgba(255, 255, 255, .14); }
.pg.sheet .sheet-foot .qlink.ok { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); color: var(--ok); box-shadow: none; }
.pg.sheet .sheet-foot .qlink.ok svg.i { background: color-mix(in srgb, var(--ok) 18%, transparent); }
.pg.sheet .sheet-foot .qlink.bad { background: color-mix(in srgb, var(--bad) 10%, var(--surface)); color: var(--bad); box-shadow: none; }
.pg.sheet .sheet-foot .qlink.bad svg.i { background: color-mix(in srgb, var(--bad) 16%, transparent); }
.pg ul.dash li.num { padding-left: 26px; }
.pg ul.dash li.num::before { display: none; }
.pg ul.dash li.num .nn { position: absolute; left: 0; top: .18em; width: 19px; height: 19px; border-radius: 6px; display: grid; place-items: center; font: 750 11.5px var(--sans); color: var(--dept); background: color-mix(in srgb, var(--dept) 11%, transparent); }

/* ---------- note boxes: a labelled tab on a soft card (no side stripe) ---------- */
.pg .n { position: relative; margin: 16px 0 18px; padding: 15px 17px 12px; border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); border-left-width: 1px; border-radius: 3px 14px 14px 14px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 8%, var(--surface)), color-mix(in srgb, var(--c) 4%, var(--surface))); box-shadow: 0 1px 0 color-mix(in srgb, var(--c) 10%, transparent), 0 8px 22px -14px color-mix(in srgb, var(--c) 45%, transparent); }
.pg .n .mtag { position: absolute; top: -10px; left: -1px; display: inline-block; margin: 0; padding: 3px 10px 3px 9px; border-radius: 7px 7px 7px 2px; background: var(--c); color: #fff; font: 700 10.5px/1.3 var(--sans); letter-spacing: .05em; text-transform: none; }
.pg .n-key .mtag { color: #3A2A08; }
.pg .n-check { border-style: dashed; }
.pg .n .ans { border-radius: 10px; }
.pg.sheet .n { margin: 10px 0 0; }

/* =====================================================================
   Clean modern finish for the lecture sheets (one type scale, one table style, soft highlights)
   ===================================================================== */
.pg.sheet { color: #1F2733; }
.pg.sheet p, .pg.sheet li { line-height: 1.55; }
/* sub-headings: sentence case, dark, with a short accent bar */
.pg.sheet h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font: 650 15px/1.3 var(--sans); letter-spacing: 0; text-transform: none; color: #1F2733; }
.pg.sheet h4::before { content: ''; flex: none; width: 4px; height: 15px; border-radius: 2px; background: var(--dept); }
.pg.sheet .two h4::before { background: color-mix(in srgb, var(--dept) 55%, transparent); }
/* the owner's highlights: a soft marker stroke, not a block of yellow */
.pg.sheet mark { background: linear-gradient(transparent 58%, rgba(255, 207, 72, .5) 58%, rgba(255, 207, 72, .5) 92%, transparent 92%); padding: 0 1px; }
/* captions */
.pg.sheet .fig figcaption { margin-top: 8px; font: 400 13.5px/1.45 var(--sans); font-style: normal; text-transform: none; letter-spacing: 0; color: #6B7684; }
.pg.sheet .fig figcaption b { color: #3B4654; font-weight: 650; }
.pg.sheet .fig img { border-radius: 10px; }
/* every table, from the notes or from the source, in one quiet style */
.pg.sheet table.rule, .pg.sheet table.src { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid #E3E7ED; border-radius: 12px; overflow: hidden; font-size: 15px; line-height: 1.45; background: var(--surface); }
.pg.sheet table.rule th, .pg.sheet table.src thead th { padding: 10px 14px; background: #F3F5F8; color: #3B4654; font: 650 13.5px var(--sans); letter-spacing: 0; text-transform: none; text-align: left; border: 0; border-bottom: 1px solid #E3E7ED; }
.pg.sheet table.rule td, .pg.sheet table.src td, .pg.sheet table.src tbody th { padding: 9px 14px; background: transparent; border: 0; border-top: 1px solid #EEF1F4; vertical-align: top; }
.pg.sheet table.src tbody tr:first-child > *, .pg.sheet table.rule tbody tr:first-child td { border-top: 0; }
.pg.sheet table.src tbody tr:nth-child(even) > *, .pg.sheet table.rule tbody tr:nth-child(even) td { background: #FAFBFC; }
.pg.sheet table.src tbody th, .pg.sheet table.rule td:first-child { font-weight: 600; color: #1F2733; }
.pg.sheet table.src td.side { background: #F7F9FB !important; border-right: 1px solid #EEF1F4; font-weight: 600; }
.pg.sheet table.src tr.foot td { background: #F7F9FB; color: #4A5563; font-size: 14px; }
/* "A + B + C" regimens as clean chips */
.pg.sheet .plus { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pg.sheet .plus b { padding: 6px 12px; border-radius: 10px; background: color-mix(in srgb, var(--dept) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--dept) 22%, transparent); font: 650 15px var(--sans); color: #1F2733; }
.pg.sheet .plus .eg { font-size: 13px; color: #6B7684; margin-left: -4px; }
.pg.sheet .plus .eg:empty { display: none; }
.pg.sheet .plus .op { color: #9AA4B1; font-weight: 600; }
.pg.sheet .plus .op:empty { display: none; }
/* section title */
.pg.sheet .pg-title h2 { letter-spacing: -.01em; }
.pg.sheet .pg-head { color: #9AA4B1; }
.pg .cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pg .cols3 .col { padding: 12px 16px 10px; border: 1px solid #E3E7ED; border-radius: 12px; background: #FAFBFC; }
.pg .cols3 h5 { margin: 0 0 6px; font: 650 14.5px var(--sans); color: var(--dept); }
.pg .cols3 ul.dash { margin: 0; }

/* nothing floats over the page: the page number lives in the sheet header; the rail shows only while scrolling */
.rd-page .page-chip { display: none !important; }
.rd-page .page-dots { opacity: 0; pointer-events: none; transition: opacity .35s ease; }
.rd-page.scrolling .page-dots, .rd-page .page-dots:hover { opacity: 1; pointer-events: auto; }

/* one clean system typeface for reading (SF on iPad, Segoe on Windows) */
.pg.sheet { --read: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Inter, Roboto, sans-serif; font-family: var(--read); }
.pg.sheet h1, .pg.sheet h2, .pg.sheet h4, .pg.sheet h5, .pg.sheet .pg-n, .pg.sheet .plus b, .pg.sheet table, .pg.sheet .fig figcaption, .pg.sheet .mtag, .pg.sheet .cv-l h1 { font-family: var(--read); }
.pg.sheet .pg-title h2 { font-weight: 700; font-size: 28px; letter-spacing: -.02em; }
.pg.sheet .pg-n { font-weight: 700; font-size: 28px; letter-spacing: -.02em; color: color-mix(in srgb, var(--dept) 75%, white); }
.pg.sheet .cv-l h1 { font-weight: 750; letter-spacing: -.025em; }
/* a section that starts part-way down a sheet: a hairline and air above it */
.pg.sheet .pg-body > .sec-start:not(:first-child) { margin-top: 20px; padding-top: 20px; border-top: 1px solid #E9EDF2; }
.pg.sheet .sec-q { display: flex; justify-content: flex-end; }
.pg.sheet .sec-q .qlink { gap: 10px; padding: 7px 15px 7px 8px; border-radius: 11px; border: 1px solid color-mix(in srgb, var(--dept) 25%, transparent); background: color-mix(in srgb, var(--dept) 6%, var(--surface)); color: var(--dept); font: 650 14px var(--read); }
.pg.sheet .sec-q .qlink svg.i { width: 24px; height: 24px; padding: 5px; border-radius: 7px; background: var(--dept); color: #fff; }
.pg.sheet .sec-q .qlink.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); background: color-mix(in srgb, var(--ok) 7%, var(--surface)); }
.pg.sheet .sec-q .qlink.ok svg.i { background: var(--ok); }
.pg.sheet .sec-q .qlink.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); background: color-mix(in srgb, var(--bad) 6%, var(--surface)); }
.pg.sheet .sec-q .qlink.bad svg.i { background: var(--bad); }

/* pen toolbar: one floating row, like a notes app */
.rd-page .pen-row { gap: 4px; padding: 6px 8px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); box-shadow: 0 14px 36px rgba(20, 30, 45, .16); }
.rd-page .pen-bar .tools { display: flex; gap: 2px; flex: none; }
.rd-page .pen-bar .tool { min-width: 60px; padding: 6px 6px 5px; border-radius: 11px; color: #6B7684; font: 600 10.5px var(--sans); }
.rd-page .pen-bar .tool.on { background: color-mix(in srgb, var(--dept) 11%, var(--surface)); color: var(--dept); }
.rd-page .pen-bar .tool:disabled { opacity: .35; }
.rd-page .pen-bar .tool.redo svg.i { transform: scaleX(-1); }
.rd-page .pen-bar .lw { width: 34px; height: 34px; border-radius: 10px; }
.rd-page .pen-bar .lw i { width: 18px; }
.rd-page .pen-bar .lw.on { background: #EEF1F5; box-shadow: none; }
.rd-page .pen-bar .sws { gap: 5px; }
.rd-page .pen-bar .sw { width: 24px; height: 24px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); transition: transform .15s ease; }
.rd-page .pen-bar .sw.on { transform: scale(1.12); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--c); }
.rd-page .pen-hint { font-weight: 500; }
.pg.sheet ol.num li::before { font: 650 15px/1.6 var(--read); top: 0; width: 22px; text-align: center; color: var(--dept); }
/* cover: reading time and the key to the note boxes */
.cv-key { margin: 22px 0 30px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.cv-key .ck-time { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--muted); }
.cv-key .ck-h { margin: 14px 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cv-key .ck-row { display: flex; flex-wrap: wrap; gap: 6px; }
.cv-key .ck { --c: var(--dept); padding: 4px 10px 4px 9px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: color-mix(in srgb, var(--c) 82%, var(--text)); background: color-mix(in srgb, var(--c) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 24%, transparent); border-left: 3px solid color-mix(in srgb, var(--c) 70%, var(--surface)); }
.cv-key .n-often { --c: #D2556B; } .cv-key .n-pearl { --c: #3F9A6B; } .cv-key .n-key { --c: #C9962B; } .cv-key .n-warn { --c: #E07B39; }
/* highlighter layer: under the pen ink, blended so the words keep their colour */
canvas.phl { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; mix-blend-mode: darken; }
/* colour panel: one swatch on the bar opens it */
.rd-page .pen-bar .pen-row { position: relative; }
.rd-page .pen-bar .sw.cur { width: 28px; height: 28px; border-radius: 50%; background: var(--c); border: 2.5px solid var(--surface); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--c) 70%, #000); }
.rd-page .pal { position: absolute; transform: translateX(-50%); padding: 12px 14px 14px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); border: 1px solid var(--line); box-shadow: 0 16px 40px -12px rgba(20, 30, 45, .28); animation: palIn .16s ease; z-index: 5; }
@keyframes palIn { from { opacity: 0; transform: translate(-50%, -4px); } }
.rd-page .pal-h { font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 2px 10px; }
.rd-page .pal-g { display: grid; grid-template-columns: repeat(6, 32px); gap: 10px; }
.rd-page .pal .sw { width: 32px; height: 32px; border-radius: 50%; background: var(--c); border: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); transition: transform .12s ease; }
.rd-page .pal .sw:active { transform: scale(.9); }
.rd-page .pal .sw.on { box-shadow: 0 0 0 2.5px var(--surface), 0 0 0 4.5px color-mix(in srgb, var(--c) 75%, #000); }

/* =====================================================================
   Paper and print: each kind of note has its own object, not a box.
   exam tip = taped index card · always asked = ink stamp · pearl = a pearl
   key point = ribbon bookmark · caution = warning tape · case = patient file
   check yourself = tear-off ticket · page question = exam slip
   ===================================================================== */
.pg.sheet { --read: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-feature-settings: 'cv11', 'cv05', 'calt'; color: #1F2630; }
.pg.sheet h2, .pg.sheet .pg-title h2 { letter-spacing: -.022em; }
.pg.sheet h4 { letter-spacing: -.01em; }

/* words the lecture marks as important: a pencil underline, not a highlight */
.pg.sheet mark { padding: 0 0 3px; color: inherit; font-weight: 600; -webkit-box-decoration-break: clone; box-decoration-break: clone;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 6' preserveAspectRatio='none'%3E%3Cpath d='M1.5 4.3C10 2.9 18 4.9 27 3.6S44 2.7 58.5 3.9' fill='none' stroke='%23E39B2E' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") left bottom / 100% 5px no-repeat; }

/* reset every earlier box style */
.pg.sheet .n { --c: var(--dept); margin: 12px 0 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.pg.sheet .n::before, .pg.sheet .n::after { content: none; display: block; }
.pg.sheet .n .mtag { position: static; display: block; margin: 0 0 6px; padding: 0; border-radius: 0; background: none; box-shadow: none; transform: none;
  font: 700 10.5px/1.2 var(--read); letter-spacing: .14em; text-transform: uppercase; color: color-mix(in srgb, var(--c) 85%, #1F2630); }
.pg.sheet .n p { margin: 0 0 6px; }
.pg.sheet .n p:last-child { margin-bottom: 0; }

/* exam tip: an index card held on by a strip of tape, top corner folded */
.pg.sheet .n.n-exam { margin-top: 18px; padding: 15px 20px 14px; background: #FCFAF3; border-radius: 3px;
  box-shadow: 0 1px 1px rgba(60, 50, 20, .06), 0 10px 18px -12px rgba(60, 50, 20, .35); }
.pg.sheet .n.n-exam::before { content: ''; position: absolute; top: -9px; left: 50%; width: 82px; height: 19px; transform: translateX(-50%) rotate(-2.2deg);
  background: rgba(214, 228, 245, .82); box-shadow: 0 1px 2px rgba(40, 60, 90, .1); }
.pg.sheet .n.n-exam::after { content: ''; position: absolute; top: 0; right: 0; width: 20px; height: 20px;
  background: linear-gradient(225deg, var(--surface) 50%, #EAE3CC 50%); box-shadow: -1px 1px 2px rgba(60, 50, 20, .12); border-bottom-left-radius: 3px; }
.pg.sheet .n.n-exam .mtag { padding-bottom: 7px; margin-bottom: 9px; border-bottom: 1.5px solid rgba(220, 90, 90, .42); color: var(--dept); }

/* always asked: an ink stamp, and an exercise-book margin line beside the text */
.pg.sheet .n.n-often { margin-top: 16px; padding: 0 0 0 18px; }
.pg.sheet .n.n-often::before { content: ''; position: absolute; left: 2px; top: 34px; bottom: 3px; width: 2px; border-left: 1px solid rgba(206, 60, 84, .6); border-right: 1px solid rgba(206, 60, 84, .6); }
.pg.sheet .n.n-often .mtag { display: inline-block; margin: 2px 0 10px -18px; padding: 4px 9px 3px; border: 3px double #C93A52; border-radius: 4px; color: #C93A52;
  font: 800 11px/1.2 var(--read); letter-spacing: .16em; transform: rotate(-3deg); transform-origin: left center; opacity: .9;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='40'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.4 2.1'/%3E%3C/filter%3E%3Crect width='120' height='40' filter='url(%23n)'/%3E%3C/svg%3E");
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='40'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.4 2.1'/%3E%3C/filter%3E%3Crect width='120' height='40' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* clinical pearl: a pearl in the margin, the words set a little larger */
.pg.sheet .n.n-pearl { margin-top: 16px; padding: 2px 0 2px 54px; min-height: 44px; }
.pg.sheet .n.n-pearl::before { content: ''; position: absolute; left: 4px; top: 4px; width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff 0 9%, #F4F1EA 20%, #E2DCCD 52%, #BDB39C 88%, #A99E86 100%);
  box-shadow: inset -3px -4px 7px rgba(120, 104, 70, .28), 0 4px 8px -2px rgba(90, 80, 50, .3); }
.pg.sheet .n.n-pearl::after { content: ''; position: absolute; left: 13px; top: 42px; width: 16px; height: 4px; border-radius: 50%; background: rgba(90, 80, 50, .12); filter: blur(1.5px); }
.pg.sheet .n.n-pearl .mtag { color: #2F7D57; }
.pg.sheet .n.n-pearl p { font-size: 1.04em; line-height: 1.55; color: #24302A; }

/* key point: a ribbon bookmark */
.pg.sheet .n.n-key { margin-top: 16px; padding: 0 0 0 30px; }
.pg.sheet .n.n-key::before { content: ''; position: absolute; left: 5px; top: -6px; width: 13px; height: 32px; background: linear-gradient(90deg, #D99A2B, #E8B347);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%); }
.pg.sheet .n.n-key .mtag { color: #A86F12; }
.pg.sheet .n.n-key p { font-weight: 550; }

/* caution: a strip of warning tape */
.pg.sheet .n.n-warn { margin-top: 18px; padding: 0 2px 0 0; }
.pg.sheet .n.n-warn::before { content: ''; position: relative; display: block; width: 100%; height: 7px; margin-bottom: 9px; border-radius: 1px;
  background: repeating-linear-gradient(-45deg, #F0B239 0 9px, #3A3A3A 9px 18px); opacity: .82; }
.pg.sheet .n.n-warn .mtag { color: #B5561A; }

/* case: a patient file with a tab */
.pg.sheet .n.n-case { margin-top: 30px; padding: 15px 18px 14px; background: #F5F0E4; border-radius: 0 9px 9px 9px; box-shadow: 0 1px 0 rgba(90, 70, 30, .08); }
.pg.sheet .n.n-case .mtag { position: absolute; top: -21px; left: 0; height: 21px; margin: 0; padding: 5px 16px 0 13px; background: #F5F0E4; border-radius: 8px 14px 0 0; color: #7A5A24; }
.pg.sheet .n.n-case .stem { font-style: normal; }
.pg.sheet .n.n-case .ask { margin-top: 8px; font-weight: 650; }
.pg.sheet .n.n-case .ans, .pg.sheet .n.n-check .ans { margin-top: 10px; padding: 0; border: 0; background: none; border-radius: 0; font: 650 13.5px var(--read); color: #7A5A24; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }

/* check yourself: a tear-off ticket with notches and a big question mark */
.pg.sheet .n.n-check { margin-top: 16px; padding: 14px 64px 14px 22px; background: #EEF3FB;
  -webkit-mask: radial-gradient(circle 8px at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 8px at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 8px at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 8px at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat; border-radius: 6px; }
.pg.sheet .n.n-check::after { content: '?'; position: absolute; right: 18px; top: 50%; transform: translateY(-52%); font: 800 58px/1 var(--read); color: rgba(58, 102, 181, .16); }
.pg.sheet .n.n-check .mtag { color: #3A66B5; }
.pg.sheet .n.n-check .ans { color: #3A66B5; }

/* mnemonic: letter tiles */
.pg.sheet .n.n-mnemo .mtag { color: #6A4FC0; }
.pg.sheet .n.n-mnemo .mn b { display: inline-grid; place-items: center; width: 22px; height: 24px; margin-right: 4px; border-radius: 4px; background: #fff; border: 1px solid #DCD3F3; border-bottom-width: 3px; color: #6A4FC0; font-weight: 800; }

/* deeper: a quiet footnote */
.pg.sheet .n.n-deep .mtag { color: #8A939E; }
.pg.sheet .n.n-deep p { font-size: .94em; color: #5B6470; }

/* the page question: an exam slip with a tear-off stub */
.pg.sheet .sec-q { margin-top: 18px; }
.pg.sheet .slip { display: grid; grid-template-columns: 78px 1fr auto; align-items: center; min-height: 86px; background: #fff; border: 1px solid #DDE3EA; border-radius: 12px;
  box-shadow: 0 8px 20px -14px rgba(20, 40, 70, .35);
  -webkit-mask: radial-gradient(circle 9px at 78px 0, #0000 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle 9px at 78px 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
          mask: radial-gradient(circle 9px at 78px 0, #0000 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle 9px at 78px 100%, #0000 98%, #000) bottom / 100% 51% no-repeat; }
.pg.sheet .slip .stub { align-self: stretch; display: grid; place-content: center; justify-items: center; gap: 2px; border-right: 2px dashed #DDE3EA; background: color-mix(in srgb, var(--dept) 7%, #fff); border-radius: 12px 0 0 12px; }
.pg.sheet .slip .stub small { font: 700 9.5px var(--read); letter-spacing: .16em; text-transform: uppercase; color: var(--dept); }
.pg.sheet .slip .stub b { font: 800 30px/1 var(--read); color: var(--dept); }
.pg.sheet .slip .sb { padding: 12px 18px; display: grid; gap: 4px; }
.pg.sheet .slip .sl { font: 650 11.5px var(--read); color: #7A8594; }
.pg.sheet .slip .sb p { margin: 0; font-size: 14px; line-height: 1.45; color: #2B3440; }
.pg.sheet .slip .qlink { margin-right: 18px; gap: 8px; padding: 11px 18px 11px 14px; border: 0; border-radius: 10px; background: var(--dept); color: #fff; font: 650 14px var(--read); white-space: nowrap; box-shadow: 0 6px 14px -8px var(--dept); }
.pg.sheet .slip .qlink svg.i { width: 16px; height: 16px; padding: 0; background: none; }
.pg.sheet .slip .qlink.ok { background: color-mix(in srgb, var(--ok) 12%, #fff); color: var(--ok); box-shadow: none; }
.pg.sheet .slip .qlink.bad { background: color-mix(in srgb, var(--bad) 10%, #fff); color: var(--bad); box-shadow: none; }

/* cover: exam weight as answer-sheet bubbles */
.cv-weight { display: flex; align-items: center; gap: 14px; margin: 26px 0 0; }
.cv-weight .bub { display: flex; gap: 6px; padding: 9px 11px; border-radius: 12px; border: 1px solid #DDE3EA; background: #fff; }
.cv-weight .bub i { width: 17px; height: 17px; border-radius: 50%; border: 1.5px dashed color-mix(in srgb, var(--dept) 55%, #fff); }
.cv-weight .bub i.f { border: 0; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--dept) 60%, #fff), var(--dept) 70%); }
.cv-weight .wt { display: grid; gap: 2px; font-size: 14.5px; color: #3A4350; }
.cv-weight .wt b { color: #1F2630; }
.cv-weight .wt small { font-size: 12px; color: #8A939E; }
.cv-weight.nb { padding-left: 12px; border-left: 2px solid #D5DBE2; }
.cv-weight.nb .wt b { font-size: 13.5px; font-weight: 650; color: #5A6470; letter-spacing: .01em; }
.cover .cv-facts { margin-top: 18px; }

/* cover: the key, drawn with the same objects */
.cv-key .ck-row { gap: 14px 18px; align-items: center; }
.cv-key .ck { --c: none; display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; font: 600 13px var(--read); color: #3A4350; }
.cv-key .ck i { display: block; flex: none; }
.cv-key .k-often i { font: 800 9.5px/1 var(--read); font-style: normal; letter-spacing: .14em; text-transform: uppercase; color: #C93A52; padding: 4px 7px 3px; border: 3px double #C93A52; border-radius: 3px; transform: rotate(-3deg); }
.cv-key .k-exam i { position: relative; width: 26px; height: 18px; background: #FCFAF3; border-radius: 2px; box-shadow: 0 1px 2px rgba(60, 50, 20, .25); }
.cv-key .k-exam i::after { content: ''; position: absolute; top: 0; right: 0; width: 7px; height: 7px; background: linear-gradient(225deg, var(--surface) 50%, #E3DBC1 50%); }
.cv-key .k-pearl i { width: 17px; height: 17px; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #fff 0 10%, #EDE8DD 30%, #C9BFA8 90%); box-shadow: 0 2px 3px rgba(90, 80, 50, .3); }
.cv-key .k-key i { width: 9px; height: 20px; background: #E0A73A; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%); }
.cv-key .k-warn i { width: 26px; height: 7px; background: repeating-linear-gradient(-45deg, #F0B239 0 5px, #3A3A3A 5px 10px); opacity: .85; }

/* page by page: sheets side by side, one on the screen */
html.no-x, html.no-x body { overflow: hidden; overscroll-behavior: none; }
.sideways .rd-in { width: max-content; will-change: transform; }
.sideways #pages { display: flex; gap: 56px; align-items: flex-start; }
.sideways .pg.sheet { margin: 0; flex: none; }
.sideways .rd-stage { padding-top: 14px; padding-bottom: 0; touch-action: pan-y; }
.sideways .page-dots { display: none !important; }
.pg-flash { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 8px); padding: 6px 14px; border-radius: 99px; background: rgba(30, 38, 50, .78); color: #fff; font: 600 13px var(--sans); letter-spacing: .02em; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 30; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.pg-flash.show { opacity: 1; transform: translate(-50%, 0); }

/* small fixes */
.pg.sheet .sec-q { display: block; }
.cv-weight .wt { display: block; }
.cv-weight .wt small { display: block; margin-top: 2px; }

/* ---- revision: no lines under words; every note keeps a box of its own ---- */
.pg.sheet mark { background: none; padding: 0; font-weight: 650; color: #14202E; }
.pg.sheet .n.n-often, .pg.sheet .n.n-pearl, .pg.sheet .n.n-key, .pg.sheet .n.n-warn { border-radius: 12px; }
/* always asked: rose paper, an exercise-book margin, the stamp at the top */
.pg.sheet .n.n-often { padding: 12px 18px 14px 34px; background: #FDF5F6; box-shadow: inset 0 0 0 1px rgba(201, 58, 82, .14); }
.pg.sheet .n.n-often::before { left: 16px; top: 0; bottom: 0; }
.pg.sheet .n.n-often .mtag { margin: 0 0 10px -4px; background: #FDF5F6; }
/* clinical pearl: a soft shell-coloured box with the pearl resting in it */
.pg.sheet .n.n-pearl { padding: 14px 18px 14px 64px; background: linear-gradient(135deg, #F7F5EF, #F1F4F0); box-shadow: inset 0 0 0 1px rgba(120, 110, 80, .12); }
.pg.sheet .n.n-pearl::before { left: 15px; top: 15px; }
.pg.sheet .n.n-pearl::after { left: 24px; top: 53px; }
/* key point: a cream box with a ribbon bookmark hanging over its top edge */
.pg.sheet .n.n-key { padding: 13px 18px 14px 40px; background: #FFF8EA; box-shadow: inset 0 0 0 1px rgba(217, 154, 43, .2); }
.pg.sheet .n.n-key::before { left: 15px; top: -5px; }
/* caution: warning tape runs along the top of the box */
.pg.sheet .n.n-warn { padding: 0 18px 14px; background: #FFF7EF; box-shadow: inset 0 0 0 1px rgba(224, 123, 57, .2); overflow: hidden; }
.pg.sheet .n.n-warn::before { width: auto; margin: 0 -18px 12px; border-radius: 0; height: 8px; }

/* =====================  notes, final: one soft icon set, a box each  ===================== */
.pg.sheet .n { --c: var(--dept); margin-top: 14px; padding: 13px 18px 14px; border-radius: 14px; overflow: visible;
  background: color-mix(in srgb, var(--c) 5.5%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 15%, transparent); -webkit-mask: none; mask: none; }
.pg.sheet .n::before, .pg.sheet .n::after { content: none !important; }
.pg.sheet .n .mtag { display: flex; align-items: center; gap: 9px; margin: 0 0 8px; padding: 0; border: 0; background: none; transform: none; opacity: 1; -webkit-mask: none; mask: none;
  font: 700 11px/1 var(--read); letter-spacing: .1em; text-transform: uppercase; color: color-mix(in srgb, var(--c) 88%, #17202B); }
.ni { display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 9px; background: color-mix(in srgb, var(--c) 14%, #fff); }
.ni svg { width: 16px; height: 16px; fill: color-mix(in srgb, var(--c) 22%, transparent); stroke: var(--c); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pg.sheet .n p { font-size: 1em; font-weight: 400; color: #1F2630; }
.pg.sheet .n.n-often { --c: #D24D68; }
.pg.sheet .n.n-exam  { --c: var(--dept); }
.pg.sheet .n.n-pearl { --c: #2F9572; }
.pg.sheet .n.n-key   { --c: #C98A1E; }
.pg.sheet .n.n-warn  { --c: #E0712F; }
.pg.sheet .n.n-check { --c: #5B6FD6; }
.pg.sheet .n.n-case  { --c: #2B8C9E; }
.pg.sheet .n.n-mnemo { --c: #8460CF; }
.pg.sheet .n.n-deep  { --c: #7D8794; background: #F7F8FA; }
/* the exam tip keeps a folded corner */
.pg.sheet .n.n-exam { border-top-right-radius: 0; }
.pg.sheet .n.n-exam::after { content: '' !important; position: absolute; top: 0; right: 0; width: 18px; height: 18px; background: linear-gradient(225deg, var(--surface) 50%, color-mix(in srgb, var(--c) 18%, #fff) 50%); border-bottom-left-radius: 4px; box-shadow: -1px 1px 2px rgba(20, 40, 80, .1); }
/* check yourself keeps its ticket notches */
.pg.sheet .n.n-check { padding-right: 22px; -webkit-mask: radial-gradient(circle 7px at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 7px at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle 7px at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 7px at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat; }
/* a case keeps its file tab */
.pg.sheet .n.n-case { margin-top: 16px; }
.pg.sheet .n.n-case .stem { font-style: normal; }
.pg.sheet .n .ans { margin-top: 10px; padding: 7px 13px; border-radius: 9px; border: 0; background: #fff; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 28%, transparent); font: 650 13px var(--read); color: color-mix(in srgb, var(--c) 90%, #17202B); text-decoration: none; }
.pg.sheet .n.n-mnemo .mn b { border-color: color-mix(in srgb, var(--c) 30%, #fff); color: var(--c); }

/* cover key with the same icons */
.cv-key .ck { --c: var(--dept); gap: 8px; font: 600 13px var(--read); color: #3A4350; }
.cv-key .ck .ni { width: 24px; height: 24px; border-radius: 8px; }
.cv-key .ck .ni svg { width: 14px; height: 14px; }
.cv-key .ck.n-often { --c: #D24D68; } .cv-key .ck.n-pearl { --c: #2F9572; } .cv-key .ck.n-key { --c: #C98A1E; } .cv-key .ck.n-warn { --c: #E0712F; }
/* make the final note style win over every earlier, more specific rule */
.pg.sheet .n[class] { margin-top: 14px; padding: 13px 18px 14px; min-height: 0; border-radius: 14px; background: color-mix(in srgb, var(--c) 5.5%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 15%, transparent); overflow: visible; }
.pg.sheet .n.n-exam[class] { border-top-right-radius: 0; }
.pg.sheet .n.n-deep[class] { background: #F7F8FA; }
.pg.sheet .n[class] .mtag { position: static; display: flex; height: auto; margin: 0 0 8px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; transform: none; opacity: 1; -webkit-mask: none; mask: none;
  font: 700 11px/1 var(--read); letter-spacing: .1em; color: color-mix(in srgb, var(--c) 88%, #17202B); }
.pg.sheet .n[class] p { font-size: 1em; font-weight: 400; line-height: inherit; color: #1F2630; }
.pg.sheet .n[class] p b { font-weight: 650; }
.pg.sheet .n[class] .ans { text-decoration: none; padding: 7px 13px; border-radius: 9px; background: #fff; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 28%, transparent); color: color-mix(in srgb, var(--c) 90%, #17202B); }
.pg.sheet.cover { align-items: center; justify-content: normal; }
/* pinch on the pages is handled by the reader (the screen itself never zooms) */
.rd-page .rd-stage { touch-action: pan-x pan-y; }
.rd-page.sideways .rd-stage { touch-action: none; }

/* end sheets: key points as a textbook chapter close, then a quiet rail of next steps */
.pg.sheet.end { display: flex; flex-direction: column; padding: 56px 72px 40px; }
.pg.sheet.end .end-h { margin-bottom: 26px; }
.pg.sheet.end .end-h .ey { display: block; font: 650 12px/1 var(--read, var(--sans)); letter-spacing: .14em; text-transform: uppercase; color: var(--dept); margin-bottom: 12px; }
.pg.sheet.end .end-h h2 { font: 700 30px/1.15 var(--read, var(--sans)); letter-spacing: -.02em; }
.pg.sheet.end .end-h h2::after { display: none; }
.pg.sheet.end .kp-wrap { flex: 1; min-height: 0; }
.pg.sheet.end ol.kp { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 56px; column-rule: 1px solid var(--line); counter-reset: kp; }
.pg.sheet.end ol.kp li { break-inside: avoid; position: relative; padding: 9px 0 9px 44px; font: 400 15.5px/1.5 var(--read, var(--sans)); color: var(--ink); counter-increment: kp; }
.pg.sheet.end ol.kp li + li { border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.pg.sheet.end ol.kp li::before { content: counter(kp, decimal-leading-zero); position: absolute; left: 0; top: 11px; font: 650 13px/1 var(--read, var(--sans)); color: var(--dept); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.pg.sheet.end ol.kp li b, .pg.sheet.end ol.kp li strong { font-weight: 650; }
.pg.sheet.end .nx { display: flex; margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; gap: 0; }
.pg.sheet.end .nx-i { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 6px 22px; text-align: left; color: var(--ink); text-decoration: none; background: none; border: 0; border-radius: 14px; transition: background .2s ease; }
.pg.sheet.end .nx-i + .nx-i { border-left: 1px solid var(--line); border-radius: 0; }
.pg.sheet.end .nx-i:first-child { padding-left: 0; }
.pg.sheet.end .nx-i i { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--dept-soft); color: var(--dept); }
.pg.sheet.end .nx-i span { display: grid; gap: 3px; min-width: 0; }
.pg.sheet.end .nx-i b { font: 650 15.5px/1.2 var(--read, var(--sans)); }
.pg.sheet.end .nx-i small { font: 400 12.5px/1.3 var(--read, var(--sans)); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg.sheet.end .nx-i:hover b, .pg.sheet.end .nx-i:active b { color: var(--dept); }
.pg.sheet.end ol.kp li { font-size: 16.5px; padding-top: 11px; padding-bottom: 11px; }
.pg.sheet.end ol.kp li::before { top: 14px; }
.pg.sheet.end .nx-i small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* a section that opens at the top of the right column */
.pg.sheet .seg2 > .c > .sec-start { margin-top: 0; padding-top: 0; border-top: 0; }
.pg.sheet .seg2 > .c > .sec-start .pg-title { margin-bottom: 6px; }

/* quick review: one fact per row, the topic named first, rows well spaced so each stands on its own */
.pg.sheet .rv-h { display: flex; align-items: baseline; gap: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.pg.sheet .rv-h h4 { margin: 0; padding: 0; border: 0; font: 650 13px/1 var(--read, var(--sans)); letter-spacing: .12em; text-transform: uppercase; color: var(--dept); }
.pg.sheet .rv-h h4::before { display: none; }
.pg.sheet .rv-h span { font: 400 14px/1 var(--read, var(--sans)); color: var(--muted); }
.pg.sheet .rv { display: grid; grid-template-columns: 34px 1fr; gap: 0 10px; padding: 12px 0 14px; border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent); }
.pg.sheet .rv-n { font: 650 13px/1.9 var(--read, var(--sans)); color: var(--dept); font-variant-numeric: tabular-nums; }
.pg.sheet .rv-t b { display: block; font: 650 13px/1.3 var(--read, var(--sans)); letter-spacing: .02em; color: var(--ink); margin: 2px 0 4px; }
.pg.sheet .rv-t p { margin: 0; font: 400 16px/1.5 var(--read, var(--sans)); color: var(--ink); }
.pg.sheet.end ol.kp li .kl { display: block; font: 650 12.5px/1.3 var(--read, var(--sans)); letter-spacing: .03em; color: var(--ink); margin-bottom: 2px; }
.pg.sheet.end ol.kp li .kl { display: inline; font-size: inherit; letter-spacing: 0; color: var(--dept); margin: 0; }
.pg.sheet.end ol.kp li .kl::after { content: '\2002'; }
.pg.sheet.end ol.kp li { font-size: 15.5px; padding-top: 8px; padding-bottom: 8px; }
.pg.sheet.end ol.kp li::before { top: 11px; }
.rd-other:has(.exam) { max-width: 1160px; padding: 28px 40px; }

/* high yield only: the rest fades back so the examined facts stand out; nothing moves on the page */
.pg .blk { transition: opacity .25s ease, filter .25s ease; }

/* finished: the student ticks the lecture as studied */
.rd-bar .fin-btn.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.pg.sheet.end .end-h { position: relative; padding-right: 210px; }
.pg.sheet.end .end-h .fin { position: absolute; top: 2px; right: 0; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px 10px 12px; border-radius: 999px; border: 1.5px solid color-mix(in srgb, var(--ok) 45%, var(--line)); color: var(--ok); background: var(--surface); font: 650 14px/1 var(--sans); transition: background .2s, color .2s; }
.pg.sheet.end .end-h .fin svg.i { width: 16px; height: 16px; }
.pg.sheet.end .end-h .fin.on { background: var(--ok); border-color: var(--ok); color: #fff; }

/* importance: the chosen level stays clear with a mark in the margin; the rest fades back; nothing moves on the page */
.rd-page.hy-2 .pg .blk.lv3, .rd-page.hy-1 .pg .blk.lv3, .rd-page.hy-1 .pg .blk.lv2 { opacity: .38; filter: saturate(.3); }
.rd-page.hy-1 .pg .blk.lv1::after, .rd-page.hy-2 .pg .blk.lv1::after, .rd-page.hy-2 .pg .blk.lv2::after { content: ''; position: absolute; left: -14px; top: 3px; bottom: 3px; width: 3px; border-radius: 3px; background: var(--dept); }
.rd-page.hy-2 .pg .blk.lv2::after { opacity: .35; }
.rd-page .pg .blk.cont::after { top: 0; }

/* display panel: night mode, page turning, importance */
.disp { position: fixed; top: 70px; right: 18px; z-index: 40; width: 360px; display: grid; gap: 14px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0, 0, 0, .14); animation: fade .2s ease; }
.disp[hidden] { display: none; }
.disp-r { display: grid; gap: 7px; }
.disp-r > span { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.disp-r .seg { display: flex; }
.disp-r .seg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 6px; }
.disp-r .seg svg.i { width: 15px; height: 15px; }
.disp-k { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.disp-k b { color: var(--text); font-weight: 650; }
.disp-k i { display: inline-block; width: 3px; height: 12px; border-radius: 2px; margin: 0 6px -1px 0; background: var(--dept); }
.disp-k i.k2 { opacity: .35; margin-left: 4px; }
body.lec-focus .disp { top: 60px; }

/* night: the pages keep their day colours and are turned, as a whole, into soft dark paper (as reading apps do);
   photographs and scanned tables are turned back, so they look as they are, only a little dimmer */
[data-theme='dark'] .rd-page .pg.sheet {
  --bg: #F4F2EC; --surface: #FFFFFF; --surface-2: #EFECE4; --line: #E2DDD2; --line-2: #D3CDBF; --text: #17191C; --muted: #6F6B63;
  --ok: #1F8A5B; --warn: #B7791F; --bad: #C0392B; --skin: #F1E6DA; --dept-soft: color-mix(in srgb, var(--dept) 12%, #fff);
  color-scheme: light; background: #fff;
}
[data-theme='dark'] .rd-page .pg.sheet:not(.blank) { filter: invert(.88) hue-rotate(180deg); }
[data-theme='dark'] .rd-page .pg.sheet:not(.blank) img { filter: invert(1) hue-rotate(180deg); }

/* ---------- add menu: a picture on this page, or a blank page after it ---------- */
.addm { position: fixed; z-index: 40; width: 330px; display: grid; gap: 4px; padding: 8px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0, 0, 0, .14); animation: fade .18s ease; }
.addm[hidden] { display: none; }
.addm button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 12px; background: none; text-align: left; color: var(--text); cursor: pointer; }
.addm button:active, .addm button:hover { background: var(--surface-2); }
.addm i { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--dept-soft); color: var(--dept); }
.addm b { display: block; font-size: 15px; }
.addm small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; margin-top: 1px; }
.rd-tools [data-act=add].on { background: var(--dept-soft); color: var(--dept); }

/* ---------- the student's pictures, under the pen and the highlighter ---------- */
.ppics { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.upic { position: absolute; margin: 0; pointer-events: auto; border-radius: 6px; cursor: pointer; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.upic img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 6px; pointer-events: none; box-shadow: 0 1px 3px rgba(20, 20, 10, .12); }
.upic.gone { display: none; }
.upic.on { outline: 2.5px solid var(--dept); outline-offset: 3px; cursor: move; touch-action: none; }
.upic.dragging { opacity: .9; }
.upic-x, .upic-rs { display: none; }
.upic.on .upic-x { display: grid; place-items: center; position: absolute; top: -16px; right: -16px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--bad); color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .22); cursor: pointer; }
.upic.on .upic-rs { display: block; position: absolute; right: -13px; bottom: -13px; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--dept); box-shadow: 0 3px 10px rgba(0, 0, 0, .18); cursor: nwse-resize; touch-action: none; }
.upic.on .upic-rs::after { content: ''; position: absolute; inset: -12px; } /* a bigger target for a finger */
.inking .upic.on { outline: none; }
.inking .upic .upic-x, .inking .upic .upic-rs { display: none; }

/* ---------- blank pages: paper colour and lines chosen by the student ---------- */
.pg.sheet.blank { --rule: rgba(46, 74, 110, .16); --pad: 64px; background-color: #FFFFFF; }
.pg.sheet.blank.bg-cream { background-color: #FBF6E8; --rule: rgba(120, 96, 50, .18); }
.pg.sheet.blank.bg-black { background-color: #1D1E21; --rule: rgba(255, 255, 255, .13); --text: #ECEAE4; --muted: #A3A09A; --surface: #2A2B2F; --surface-2: #34363A; --line: #3A3C41; color: var(--text); }
.pg.sheet.blank.bg-black canvas.phl { mix-blend-mode: lighten; }
.pg.sheet.blank::after { content: ''; position: absolute; left: 0; right: 0; top: 66px; bottom: 0; pointer-events: none; }
.pg.sheet.blank.rule-lined::after { background-image: linear-gradient(to bottom, transparent 33px, var(--rule) 33px, var(--rule) 34px); background-size: 100% 34px; }
.pg.sheet.blank.rule-lined::before { content: ''; position: absolute; top: 66px; bottom: 0; left: 96px; width: 1px; background: color-mix(in srgb, #D9534F 40%, transparent); pointer-events: none; }
.pg.sheet.blank.rule-grid::after { left: 6px; right: 6px; background-image: linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px); background-size: 28px 28px; }
.pg.sheet.blank.rule-dots::after { left: 6px; right: 6px; background-image: radial-gradient(circle, var(--rule) 1.4px, transparent 1.9px); background-size: 28px 28px; }
.pg.sheet.blank.rule-dots { --rule: rgba(46, 74, 110, .32); }
.pg.sheet.blank.rule-dots.bg-cream { --rule: rgba(120, 96, 50, .34); }
.pg.sheet.blank.rule-dots.bg-black { --rule: rgba(255, 255, 255, .26); }
.bk-bar { position: absolute; top: 16px; left: 64px; right: 64px; z-index: 5; display: flex; align-items: center; gap: 8px; }
.bk-t { display: inline-flex; align-items: center; gap: 7px; font: 600 10.5px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.bk-bar .sp { flex: 1; }
.bk-b { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--muted); font: 600 13px var(--sans); cursor: pointer; }
.bk-b.on { color: var(--dept); border-color: color-mix(in srgb, var(--dept) 40%, transparent); }
.bk-b[data-bk=del] { padding: 0 9px; }
.bk-style { position: absolute; top: 56px; right: 64px; z-index: 6; display: grid; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 16px 40px -12px rgba(20, 30, 45, .28); animation: fade .16s ease; }
.bk-style[hidden] { display: none; }
.bk-r { display: grid; gap: 6px; }
.bk-r > span { font: 600 12px var(--sans); color: var(--muted); }
.bk-r .seg button { display: inline-flex; align-items: center; gap: 6px; }
.pp { width: 13px; height: 13px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); }
.pp-white { background: #fff; } .pp-cream { background: #FBF6E8; } .pp-black { background: #1D1E21; }
.inking .bk-bar, .inking .bk-style { visibility: hidden; }

/* marks in other colours (==g:...==), red words (!!...!!) */
.pg mark.m-y { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 6' preserveAspectRatio='none'%3E%3Cpath d='M1.5 4.3C10 2.9 18 4.9 27 3.6S44 2.7 58.5 3.9' fill='none' stroke='%23E39B2E' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") left bottom / 100% 5px no-repeat; } .pg mark.m-g { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 6' preserveAspectRatio='none'%3E%3Cpath d='M1.5 4.3C10 2.9 18 4.9 27 3.6S44 2.7 58.5 3.9' fill='none' stroke='%232E9E6A' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") left bottom / 100% 5px no-repeat; } .pg mark.m-b { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 6' preserveAspectRatio='none'%3E%3Cpath d='M1.5 4.3C10 2.9 18 4.9 27 3.6S44 2.7 58.5 3.9' fill='none' stroke='%232F6FB5' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") left bottom / 100% 5px no-repeat; }
.pg mark.m-p { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 6' preserveAspectRatio='none'%3E%3Cpath d='M1.5 4.3C10 2.9 18 4.9 27 3.6S44 2.7 58.5 3.9' fill='none' stroke='%23C2417A' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") left bottom / 100% 5px no-repeat; } .pg mark.m-r { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 6' preserveAspectRatio='none'%3E%3Cpath d='M1.5 4.3C10 2.9 18 4.9 27 3.6S44 2.7 58.5 3.9' fill='none' stroke='%23C0392B' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") left bottom / 100% 5px no-repeat; }
.pg .tx-r { color: var(--bad); font-weight: 600; } .pg .tx-b { color: #1F5FA8; font-weight: 600; } .pg .tx-g { color: #1E7A4C; font-weight: 600; } .pg .tx-o { color: #C25A00; font-weight: 600; } .pg .tx-p { color: #7A3E9D; font-weight: 600; }
.pg .hl { padding: 0 2px; border-radius: 3px; -webkit-box-decoration-break: clone; box-decoration-break: clone; } .pg .hl-y { background: var(--hl-y); } .pg .hl-g { background: var(--hl-g); } .pg .hl-b { background: var(--hl-b); } .pg .hl-p { background: var(--hl-p); }
.pg .al-center { text-align: center; } .pg .al-right { text-align: right; } .pg .bord img { border: 1.5px solid var(--line); border-radius: 6px; }
/* table looks chosen in the admin: lines (default), grid, coloured header, plain; banded rows; first column not bold */
.pg table.ts-grid, .pg table.ts-grid th, .pg table.ts-grid td { border: 1px solid color-mix(in srgb, var(--text) 25%, transparent); }
.pg table.ts-head { border: 0; } .pg table.ts-head th { background: var(--dept); color: #fff; border: 0; } .pg table.ts-head td { border-bottom: 1px solid var(--line); }
.pg table.ts-plain { border: 0; } .pg table.ts-plain th { border-bottom: 1.5px solid var(--line); color: var(--text); }
.pg table.band tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--dept) 6%, transparent); }
.pg table.nofirst td:first-child { font-weight: inherit; }
/* sections laid out by hand: each box sits where the admin put it */
.pg.sheet .pg-body .blk.fx { position: absolute; margin: 0; }
.pg .bx { padding: 14px 18px; border-radius: 12px; }
.pg .bx > :first-child, .pg .bx .bz > :first-child { margin-top: 0; } .pg .bx > :last-child, .pg .bx .bz > :last-child { margin-bottom: 0; }
.pg .bx-y { background: var(--st-y); } .pg .bx-g { background: var(--st-g); } .pg .bx-b { background: var(--st-b); } .pg .bx-p { background: var(--st-p); }
.pg .bx-n { background: color-mix(in srgb, var(--text) 5%, transparent); } .pg .bx-o { border: 1.5px solid var(--line); }
