/* BetterSPICE website: the user manual online. On top of ../assets/site.css (its tokens, fonts and motion rules):
 * a sticky contents sidebar, a reading column, and the manual's own blocks (steps, callouts, figures, tables, index).
 * Motion: colour changes --motion-micro linear; the mobile drawer moves over --motion-state with --ease-move. Nothing scales. */
:root { --mside-w: 272px; --read: 820px; --top-h: 61px; }
body.manual { overflow-x: hidden; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 60; background: var(--accent); color: var(--on-accent); padding: 8px 14px; font-weight: 600; text-decoration: none; border-radius: var(--radius-surface); }
.skip:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ layout */
.mlayout { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; display: grid; grid-template-columns: var(--mside-w) minmax(0, 1fr); column-gap: 48px; align-items: start; }
.mside { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; border-right: 1px solid var(--rule); }
.mside-in { padding: 28px 20px 48px 0; }
.mside-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.mside-title { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text); text-decoration: none; }
.mside-title span { color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }
.mside-close { display: none; width: 40px; height: 40px; margin-right: -8px; border: 0; background: none; color: var(--soft); cursor: pointer; align-items: center; justify-content: center; border-radius: var(--radius-surface); }
.mmain { min-width: 0; padding: 48px 0 0; }
.mc { max-width: var(--read); }
.mscrim, .mtoggle { display: none; }

/* ------------------------------------------------------------ search */
.msearch { position: relative; margin: 0 0 10px; }
.msearch input { width: 100%; height: 40px; padding: 0 34px 0 34px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-surface); color: var(--text);
  font: 500 15px/1 Barlow, sans-serif; transition: border-color var(--motion-micro) linear; -webkit-appearance: none; appearance: none; }
.msearch input::placeholder { color: var(--muted); }
.msearch input::-webkit-search-cancel-button { display: none; }
.msearch input:focus { outline: none; border-color: var(--accent); }
.ms-ico { position: absolute; left: 11px; top: 12px; color: var(--muted); pointer-events: none; }
.ms-key { position: absolute; right: 8px; top: 10px; height: 20px; pointer-events: none; transition: opacity var(--motion-micro) linear; }
.msearch input:focus ~ .ms-key, .msearch.has ~ .ms-key, .msearch.has .ms-key { opacity: 0; }
.msr { margin: 0 0 18px; border-top: 1px solid var(--rule); }
.msr[hidden] { display: none; }
.msr-i { display: block; padding: 10px 10px 10px 12px; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--soft); font-size: 14px; line-height: 1.4;
  border-left: 2px solid transparent; transition: background-color var(--motion-micro) linear, border-color var(--motion-micro) linear; }
.msr-i .rt { display: block; color: var(--text); font-weight: 600; font-size: 15px; }
.msr-i .rm { display: block; font-size: 12px; color: var(--muted); letter-spacing: .04em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.msr-i .rs { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.msr-i mark { background: none; color: var(--accent); }
.msr-i.on, .msr-i:hover { background: var(--surface); border-left-color: var(--accent); }
.msr-none { padding: 12px 2px; font-size: 14px; color: var(--muted); }
.msr-more { padding: 10px 2px; font-size: 12px; color: var(--muted); }
.mside.searching .mtoc { display: none; }

/* ------------------------------------------------------------ sidebar contents */
.mtoc { font-size: 14px; line-height: 1.35; }
.mtoc ul { list-style: none; margin: 0; padding: 0; }
.mtoc a { display: grid; grid-template-columns: 26px 1fr; column-gap: 6px; padding: 5px 8px 5px 10px; margin-left: -10px; text-decoration: none; color: var(--muted);
  border-left: 2px solid transparent; transition: color var(--motion-micro) linear, border-color var(--motion-micro) linear; }
.mtoc .mt-top a, .mt-ref a { grid-template-columns: 1fr; }
.mtoc a .tn, .mtoc a .hn { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--muted); }
.mtoc a.on { color: var(--text); border-left-color: var(--accent); font-weight: 600; }
.mtoc a.on .tn { color: var(--accent); }
.mt-top { margin-bottom: 8px !important; }
.mt-end { margin-top: 18px !important; padding-top: 10px !important; border-top: 1px solid var(--rule) !important; }
.mt-part { margin-top: 14px; }
.mtoc a.mt-ph { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--soft); padding-top: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.mtoc a.mt-ph .tn { color: var(--accent); }
.mtoc a.mt-ph.on { color: var(--text); border-left-color: var(--accent); }
.mt-ref { margin-top: 22px; padding-top: 4px; border-top: 2px solid var(--rule); }
.mt-ref a { font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--text); }
.mt-subs { margin: 2px 0 8px 26px !important; border-left: 1px solid var(--rule); }
.mt-subs a { grid-template-columns: 38px 1fr; margin-left: -1px; padding: 4px 6px 4px 10px; font-size: 13px; }
.mt-subs a.on { color: var(--text); border-left-color: var(--accent); font-weight: 500; }
.mt-subs a.on .hn { color: var(--accent); }

/* ------------------------------------------------------------ prev / next */
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: var(--read); margin: 72px 0 0; padding-top: 24px; border-top: 1px solid var(--rule); }
.pn a { display: block; padding: 16px 18px; border: 1px solid var(--rule); border-radius: var(--radius-surface); text-decoration: none; transition: border-color var(--motion-micro) linear; min-width: 0; }
.pn-next { text-align: right; }
.pn-k { display: block; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.pn-t { display: block; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.pn-n { color: var(--accent); margin-right: 8px; font-variant-numeric: tabular-nums; }
@media (hover: hover) { .pn a:hover { border-color: var(--muted); } .mtoc a:hover { color: var(--text); } }

/* ------------------------------------------------------------ reading: text */
.mc { color: var(--soft); font-size: 17px; line-height: 1.6; overflow-wrap: break-word; }
.mc p { max-width: 72ch; }
.mc b, .mc strong { color: var(--text); font-weight: 600; }
.mc a { color: var(--text); text-decoration: none; }
.mc a.xref, .mc p a, .mc li a, .mc td a, .mc dd a, .mc .goal a, .ct-more a { background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 1px no-repeat; transition: color var(--motion-micro) linear; }
.mc a.sref { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 1px no-repeat; }
.mc a.code { background: none; }
.mc a.code code { color: var(--accent); }
@media (hover: hover) { .mc a:hover { color: var(--accent-hi); } }
.mc pre, .mc pre.code { max-width: 100%; overflow-x: auto; margin: 10px 0 20px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--rule); border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-surface) var(--radius-surface) 0; font: 400 14px/1.6 var(--mono); color: var(--text); white-space: pre; tab-size: 4; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
.mc pre code { font-size: inherit; overflow-wrap: normal; }
.mc ol.steps > li, .mc li, .mc td, .mc dd { min-width: 0; }
.mc code { font-family: var(--mono); font-size: .84em; color: var(--text); overflow-wrap: anywhere; }
.mc .lead { font-size: 20px; line-height: 1.5; color: var(--text); font-weight: 500; margin: 0 0 28px; max-width: 64ch; }
.mc .dim { color: var(--muted); }
.mc .small { font-size: 14px; line-height: 1.5; }
.mc .n { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); white-space: nowrap; }
.mc .chord { white-space: nowrap; }
.mc .chord .plus { color: var(--muted); padding: 0 2px; }
.mc kbd { margin: 0 1px; color: var(--text); }
.mc .act, .mc .ui { color: var(--text); font-weight: 600; }
.mc .menu { color: var(--text); font-weight: 600; }
.mc .menu .sep { color: var(--muted); font-weight: 400; padding: 0 .3em; }
.mc .lbl { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-right: 10px; white-space: nowrap; }
.mc sup, .mc sub { line-height: 0; }
.mc h1.mh1, .mc h1.h2 { font-size: 52px; line-height: 1.04; font-weight: 800; letter-spacing: -.01em; color: var(--text); margin: 0 0 20px; }
.mc h2 { font-size: 44px; line-height: 1.08; font-weight: 800; color: var(--text); margin: 0; letter-spacing: -.01em; text-wrap: balance; }
.mc h2.mh2 { font-size: 30px; margin: 64px 0 20px; }
.mc h3 { font-size: 26px; line-height: 1.2; font-weight: 700; color: var(--text); margin: 64px 0 14px; padding-top: 22px; border-top: 1px solid var(--rule); text-wrap: balance; }
.mc h3 .hn { display: block; font-size: 13px; font-weight: 600; letter-spacing: .1em; color: var(--accent); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.mc h4 { font-size: 18px; line-height: 1.3; font-weight: 700; color: var(--text); margin: 32px 0 8px; }
.mc ul.bul, .mc ul { padding-left: 20px; margin: 0 0 20px; max-width: 72ch; }
.mc ul li { margin-bottom: 6px; }
.mc ul li::marker { color: var(--muted); }
.mc ol:not(.steps):not(.ct-list) { padding-left: 22px; }

/* chapter opener */
.mc .opener { display: grid; grid-template-columns: auto 1fr; column-gap: 28px; align-items: end; margin: 0 0 32px; padding: 0 0 28px; border-bottom: 1px solid var(--rule); }
.mc .opener .eyebrow { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 0 0 28px; color: var(--muted); }
.mc .opener .eyebrow b { color: var(--text); font-weight: 600; }
.mc .opener .eyebrow .kind { border: 1px solid var(--rule); border-radius: var(--radius-pill); padding: 3px 10px; color: var(--soft); letter-spacing: .12em; }
.mc .opener .eyebrow a { color: var(--muted); background: none; transition: color var(--motion-micro) linear; }
.mc .opener .eyebrow a.back { margin-left: auto; }
.mc .opener .num { font-size: 72px; line-height: .9; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.mc .opener .num::after { content: ""; display: block; width: 56px; height: 5px; background: var(--accent); margin-top: 14px; }
.mc .opener .minitoc { grid-column: 1 / -1; margin: 28px 0 0; columns: 2; column-gap: 32px; font-size: 14px; line-height: 1.35; }
.mc .minitoc a { display: grid; grid-template-columns: 42px 1fr; break-inside: avoid; padding: 5px 0; color: var(--soft); background: none; }
.mc .minitoc .hn { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
@media (min-width: 1081px) { .mc .opener .minitoc { display: none; } }

/* tables: scroll inside their box, never the page */
.mc .tscroll { max-width: 100%; overflow-x: auto; margin: 8px 0 28px; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
.mc .tscroll:focus-visible { outline-offset: 2px; }
.mc table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.45; margin: 0; }
.mc .tscroll table:has(th:nth-child(3)) { min-width: 560px; }
.mc table.params, .mc table.tpl, .mc table.facts4, .mc table.blocks { min-width: 760px; }
.mc .menurow .tscroll table { min-width: 0 !important; }
.mc caption.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mc th, .mc td { text-align: left; vertical-align: top; padding: 10px 16px 10px 0; border-bottom: 1px solid var(--rule); }
.mc th { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--muted); white-space: nowrap; }
.mc td:first-child { color: var(--text); }
.mc td:last-child, .mc th:last-child { padding-right: 0; }
.mc table.params, .mc table.tpl, .mc table.fields, .mc table.facts, .mc table.facts4, .mc table.blocks { font-size: 14px; }
.mc table.params td, .mc table.tpl td { padding: 8px 12px 8px 0; }
.mc .tkey { font-size: 13px; color: var(--muted); margin: -16px 0 28px; max-width: none; }
.mc table.legend td:first-child { width: 40px; }
.mc table.tasks .syn { color: var(--muted); font-size: .92em; }
.mc table.tasks td:last-child { white-space: nowrap; }
.mc table.src td { border: none; }

/* callouts */
.mc .adm { margin: 24px 0; padding: 16px 20px 16px; background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--soft); border-radius: 0 var(--radius-surface) var(--radius-surface) 0; font-size: 16px; max-width: 72ch; }
.mc .adm .sig { display: inline-block; margin-right: 10px; padding: 3px 9px; border-radius: var(--radius-pill); background: var(--soft); color: var(--ground); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; vertical-align: 1px; }
.mc .adm .t { color: var(--text); font-weight: 700; }
.mc .adm.tip { border-left-color: var(--accent); } .mc .adm.tip .sig { background: var(--accent); color: var(--on-accent); }
.mc .adm.caution { border-left-color: var(--warn); } .mc .adm.caution .sig { background: var(--warn); color: var(--ground); }
.mc .adm.warning { border-left-color: var(--danger); } .mc .adm.warning .sig { background: var(--danger); color: var(--text); }

/* steps */
.mc section.tut { counter-reset: st; }
.mc ol.steps { list-style: none; counter-reset: st; padding: 0; margin: 8px 0 28px; max-width: 72ch; }
.mc section.tut ol.steps { counter-reset: none; }
.mc ol.steps > li { counter-increment: st; position: relative; padding-left: 42px; margin: 0 0 16px; }
.mc ol.steps > li::before { content: counter(st); position: absolute; left: 0; top: 2px; width: 26px; height: 26px; border-radius: var(--radius-surface); background: var(--raised); border: 1px solid var(--rule);
  color: var(--text); font-size: 13px; font-weight: 700; line-height: 24px; text-align: center; font-variant-numeric: tabular-nums; }
.mc .see, .mc .ifsee { display: flex; align-items: baseline; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--rule); font-size: 15px; }
.mc .ifsee { border-top: none; padding-top: 2px; margin-top: 4px; }
.mc .ifsee .lbl { color: var(--warn); }
.mc .see > span:last-child, .mc .ifsee > span:last-child { min-width: 0; }
.mc .task h3 { border-top: 2px solid var(--soft); }
.mc .goal { font-size: 18px; color: var(--text); font-weight: 500; }
.mc .before, .mc .result, .mc .seealso { font-size: 15px; }
.mc .result { border-top: 1px solid var(--rule); padding-top: 10px; }
.mc .recover, .mc .ifnot { margin: 12px 0 28px; max-width: 72ch; }
.mc .recover .rh, .mc .ifnot .rh { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--warn); margin: 0 0 4px; }
.mc table.rec th { border-bottom-color: var(--warn); }
.mc .outcome { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 72ch; margin: 12px 0 28px; font-size: 15px; }
.mc .outcome > div { border-top: 2px solid var(--soft); padding-top: 10px; }
.mc .outcome .lbl { display: block; margin-bottom: 6px; }
.mc .ex { border: 1px solid var(--rule); border-left: 3px solid var(--soft); padding: 16px 20px 8px; margin: 24px 0 32px; max-width: 72ch; border-radius: 0 var(--radius-surface) var(--radius-surface) 0; }
.mc .exhead { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.mc .extitle { font-weight: 700; color: var(--text); margin: 4px 0 12px; }
.mc .exres { font-size: 15px; border-top: 1px solid var(--rule); padding-top: 10px; }

/* figures: the site's frame and zoom viewer */
.mc figure { margin: 24px 0 36px; }
.mc figure .shot { position: relative; display: inline-block; max-width: 100%; vertical-align: top; }
.mc figure .shot img { width: 100%; height: auto; }
.mc figure:not(.menu) .shot { display: block; }
.mc figure.narrow { max-width: 62%; }
.mc figure.menu img { width: auto; max-width: 100%; max-height: 560px; }
.mc .callout.shot { overflow: visible; }
.mc .callout.shot img { border-radius: var(--radius-surface); }
.mc figcaption { display: flex; gap: 12px; margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--muted); max-width: 72ch; }
.mc figcaption .fn { color: var(--text); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mc .g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.mc .g2 figure { margin-bottom: 16px; max-width: none !important; }
.mc .beside { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); column-gap: 28px; align-items: start; }
.mc .menurow { display: grid; grid-template-columns: minmax(0, 36%) minmax(0, 1fr); gap: 24px; align-items: start; }
.mc .menurow figure { margin-top: 4px; }
.mc .pin { position: absolute; transform: translate(-50%, -50%); width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  font-size: 13px; font-weight: 800; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; border: 2px solid var(--ground); pointer-events: none; }
.mc .pin.inline { position: static; transform: none; display: inline-block; vertical-align: -6px; pointer-events: auto; }

/* part pages */
.mc .partpage { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-surface); padding: 56px 48px 40px; }
.mc .partpage .pnum { font-size: 128px; line-height: .85; font-weight: 800; color: var(--accent); letter-spacing: -.03em; }
.mc .partpage .pnum span { display: block; font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; line-height: 1; }
.mc .partpage h1.part { font-size: 48px; line-height: 1.05; font-weight: 800; color: var(--text); margin: 32px 0 0; letter-spacing: -.01em; }
.mc .partpage .rule { width: 120px; height: 6px; background: var(--accent); margin: 28px 0; }
.mc .partpage p { font-size: 19px; color: var(--soft); max-width: 60ch; }
.mc .partpage .plist { margin-top: 40px; }
.mc .partpage .plist a { display: grid; grid-template-columns: 52px 1fr; padding: 12px 0; border-top: 1px solid var(--rule); font-size: 18px; font-weight: 500; color: var(--text); background: none; transition: color var(--motion-micro) linear; }
.mc .partpage .plist .tn { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.mc .partpage.refdiv .pnum { font-size: 64px; color: var(--text); }

/* front matter: Start here */
.mc .front .kicker { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.mc .doors { display: grid; gap: 12px; margin: 12px 0 32px; }
.mc .door { display: grid; grid-template-columns: 250px minmax(0, 1fr); column-gap: 28px; padding: 18px 20px; border: 1px solid var(--rule); border-left: 3px solid var(--soft); border-radius: 0 var(--radius-surface) var(--radius-surface) 0; }
.mc .door .q { font-size: 20px; line-height: 1.25; font-weight: 800; color: var(--text); }
.mc .door .q span { display: block; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.mc .door .go { font-size: 16px; }
.mc .door .go > div { padding: 3px 0; }
.mc .door .go > div::before { content: "\2192\00a0"; color: var(--accent); font-weight: 700; }
.mc .door .go a.xref { background: none; }
@media (hover: hover) { .mc .door .go a.xref:hover { background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 1px no-repeat; } }
.mc .door.stuck { border-left-color: var(--warn); }
.mc .howto-find { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; font-size: 15px; border-top: 2px solid var(--soft); padding-top: 14px; }
.mc .howto-find .hf { display: block; font-weight: 700; color: var(--text); margin-bottom: 4px; }

/* quick reference card */
.mc .card .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; font-size: 15px; }
.mc .card h4 { border-top: 2px solid var(--soft); padding-top: 8px; margin: 20px 0 10px; }
.mc .card .keys { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 6px; align-items: baseline; }
.mc .card p { font-size: 15px; }

/* glossary and index */
.mc dl.gloss { columns: 2; column-gap: 40px; font-size: 15px; margin: 0; }
.mc dl.gloss > div { break-inside: avoid; margin: 0 0 16px; }
.mc dl.gloss dt { font-weight: 700; color: var(--text); }
.mc dl.gloss dd { margin: 2px 0 0; }
.mc dl.gloss .gref { color: var(--muted); font-size: .92em; white-space: nowrap; }
.mc .idx { columns: 3; column-gap: 32px; font-size: 14px; line-height: 1.45; }
.mc .idx .il { break-after: avoid; margin: 22px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--soft); font-size: 22px; font-weight: 800; color: var(--text); }
.mc .idx .il:first-child { margin-top: 0; }
.mc .idx .e { break-inside: avoid; padding: 1px 0 1px 14px; text-indent: -14px; }
.mc .idx .e.sub { padding-left: 28px; }
.mc .idx .pgs a, .mc .idx a { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.mc .idx .seex { font-style: italic; color: var(--muted); }

/* the contents page */
.contents .eyebrow b { color: var(--accent); }
.ct-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 8px; }
.ct-cta .btn small { margin-left: 2px; }
.ct-more { font-size: 16px; color: var(--soft); }
.ct-parts { display: grid; grid-template-columns: 1fr; gap: 0; }
.ct-part { padding: 28px 0 24px; border-top: 1px solid var(--rule); }
.ct-part h2 { font-size: 26px; line-height: 1.2; margin: 0 0 8px; }
.ct-part h2 a { display: inline-flex; align-items: baseline; gap: 14px; background: none; }
.ct-roman { display: inline-block; min-width: 40px; color: var(--accent); font-variant-numeric: tabular-nums; }
.ct-blurb { font-size: 16px; color: var(--muted); margin: 0 0 14px 54px; }
.ct-list { list-style: none; margin: 0 0 0 54px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
.ct-list a { display: grid; grid-template-columns: 34px 1fr auto; column-gap: 8px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--rule); background: none; color: var(--text); font-weight: 500; font-size: 16px; transition: color var(--motion-micro) linear; }
.ct-list .tn { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.ct-list .kind { font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--rule); border-radius: var(--radius-pill); padding: 2px 7px; white-space: nowrap; }
.ct-refdiv { margin: 24px 0 0; border-top: 2px solid var(--soft); padding: 16px 0 8px; }
.ct-refdiv a { font-size: 20px; font-weight: 700; color: var(--text); background: none; }
.ct-k { display: block; font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.ct-foot { display: flex; flex-wrap: wrap; gap: 12px 32px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--rule); font-size: 15px; }
.ct-foot a { color: var(--soft); background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 1px no-repeat; }

/* ------------------------------------------------------------ narrow screens: the sidebar becomes a drawer */
@media (max-width: 1080px) {
  .mlayout { grid-template-columns: minmax(0, 1fr); padding: 0 32px; }
  .mside { position: fixed; z-index: 55; top: 0; left: 0; bottom: 0; height: auto; width: min(360px, 88vw); background: var(--ground); border-right: 1px solid var(--rule);
    transform: translateX(-100%); visibility: hidden; transition: transform var(--motion-state) var(--ease-exit, cubic-bezier(0.4, 0, 1, 1)), visibility 0s linear var(--motion-state); }
  .mside.open { transform: none; visibility: visible; transition: transform var(--motion-state) var(--ease-move); }
  .mside-in { padding: 14px 20px 48px; }
  .mside-close { display: inline-flex; }
  .mscrim { display: block; position: fixed; inset: 0; z-index: 54; background: rgba(8, 8, 8, .72); opacity: 0; transition: opacity var(--motion-state) linear; }
  .mscrim.on { opacity: 1; }
  .mscrim[hidden] { display: none; }
  .mtoggle { display: inline-flex; align-items: center; gap: 8px; position: fixed; z-index: 50; right: 16px; bottom: 16px; height: 44px; padding: 0 16px; border: 1px solid var(--rule); border-radius: var(--radius-pill);
    background: var(--surface); color: var(--text); font: 600 13px/1 Barlow, sans-serif; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; transition: border-color var(--motion-micro) linear; }
  .mmain { padding-top: 36px; }
}
@media (max-width: 760px) {
  .mlayout { padding: 0 20px; }
  .mc { font-size: 16px; }
  .mc h1.mh1, .mc h1.h2 { font-size: 38px; }
  .mc h2 { font-size: 32px; }
  .mc h2.mh2 { font-size: 26px; margin-top: 48px; }
  .mc h3 { font-size: 22px; margin-top: 48px; }
  .mc .lead { font-size: 18px; }
  .mc .opener { column-gap: 18px; }
  .mc .opener .num { font-size: 52px; }
  .mc .opener .eyebrow a.back { margin-left: 0; }
  .mc .opener .minitoc { columns: 1; }
  .mc .g2, .mc .beside, .mc .menurow, .mc .outcome, .mc .howto-find, .mc .card .grid { grid-template-columns: minmax(0, 1fr); }
  .mc figure.narrow { max-width: 100%; }
  .mc .door { grid-template-columns: minmax(0, 1fr); row-gap: 10px; }
  .mc dl.gloss { columns: 1; }
  .mc .idx { columns: 1; }
  .mc .partpage { padding: 36px 22px 24px; }
  .mc .partpage .pnum { font-size: 88px; }
  .mc .partpage h1.part { font-size: 34px; }
  .mc .ex, .mc .adm { padding-left: 14px; padding-right: 14px; }
  .mc ol.steps > li { padding-left: 36px; }
  .mc .see, .mc .ifsee { flex-direction: column; gap: 2px; }
  .ct-blurb, .ct-list { margin-left: 0; }
  .ct-list { grid-template-columns: minmax(0, 1fr); }
  .ct-cta .btn { flex: 1 1 100%; justify-content: center; }
  .pn { grid-template-columns: minmax(0, 1fr); }
  .pn-next { text-align: left; }
  .mc .pin { width: 18px; height: 18px; font-size: 10px; line-height: 15px; border-width: 1.5px; }
}
@media (min-width: 761px) and (max-width: 1080px) { .mc .idx { columns: 2; } }
@media print { .mside, .mtoggle, .pn, header.top, .notice, footer { display: none !important; } .mlayout { display: block; } }
