/*
 * Card-format cheatsheets (views/cheatsheet-cards.ejs).
 * docs/CHEATSHEET-REDESIGN-PLAN.md. A sheet to scan, not an article: the
 * model, "before the interview", then cards in columns. Every class is
 * .cc-*; tokens come from the .cd scope in cheatsheets-v2.css (--paper,
 * --card, --ink*, --rule*, --orange*), and the one colour meaning a sheet
 * carries comes from --cc-l1..3, set per scale below.
 */

.cc {
   --cc-top: 72px;              /* the sticky .lts-header */
   --cc-code: #EFEDE8;
   --cc-code-edge: #DAD8D0;
   --cc-sunk: #E2E0DA;
   --cc-l0: var(--rule2);
   /* risk (default) */
   --cc-l1: #256E4C; --cc-l1s: #DCE8DF;
   --cc-l2: #8F5E00; --cc-l2s: #EFE3C6;
   --cc-l3: #B3261E; --cc-l3s: #F3DAD6;
}
/* The sheet page itself (views/cheatsheet-cards.ejs), in both views: cards
   stand off the page, and secondary text passes 4.5:1 (5.4:1 on the page,
   was 4.7:1). The faintest grey (--ink4, 2.5:1) is left for bars and rules. */
.cc-page { --card: #FDFCFA; --ink3: #5E5D56; --orangeD: #A8400A; }
.cc-page .cc-hint, .cc-page .cc-snip__note, .cc-page .cc-snip__label, .cc-page .cc-mx__head,
.cc-page .cc-jump__lab, .cc-page .cc-next__m, .cc-page .cc-search input::placeholder { color: var(--ink3); }
.cc-page .cc-card { border-color: #D3D1C9; }
.cc--cost { --cc-l1: #256E4C; --cc-l1s: #DCE8DF; --cc-l2: #8F5E00; --cc-l2s: #EFE3C6; --cc-l3: #B3261E; --cc-l3s: #F3DAD6; }
.cc--era  { --cc-l1: #7A796F; --cc-l1s: #E4E2DC; --cc-l2: #232320; --cc-l2s: #E2E0DA; --cc-l3: #1F5F8B; --cc-l3s: #DCE7F0; }

.cc-main { max-width: 1320px; margin: 0 auto; padding: 0 28px 48px; }
@media (max-width: 900px) { .cc-main { padding: 0 16px 32px; } }

/* ── header ─────────────────────────────────────────────────────────── */
.cc-head { padding: 4px 0 14px; }
.cc-head__row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.cc-head h1 {
   margin: 0; font-family: 'Instrument Sans', system-ui, sans-serif;
   font-weight: 600; font-size: clamp(26px, 2.8vw, 34px); line-height: 1.1;
   letter-spacing: -0.02em; color: var(--ink); text-wrap: balance;
}
.cc-meta { display: flex; flex-wrap: wrap; align-items: center; font: 12.5px 'Fragment Mono', ui-monospace, monospace; color: var(--ink3); }
.cc-meta > span:not(:first-child)::before { content: "·"; margin: 0 10px; color: var(--ink4); }
.cc-pdf { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--rule2); border-radius: 8px; background: var(--card); color: var(--ink2); font: 500 13px/1 'Instrument Sans', system-ui, sans-serif; text-decoration: none; }
.cc-pdf:hover { border-color: var(--ink3); color: var(--ink); }
@media (max-width: 720px) { .cc-pdf { margin-left: 0; } }
.cc-jump { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; }
.cc-jump__lab { font: 600 10px/1 'Fragment Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--ink4); margin-right: 4px; }
.cc-jump a { text-decoration: none; color: var(--ink2); padding: 3px 10px; border: 1px solid var(--rule2); border-radius: 999px; background: var(--card); }
.cc-jump a:hover { border-color: var(--ink3); color: var(--ink); }
.cc-jump a.cc-jump--alt { border-style: dashed; }

/* ── toolbar ────────────────────────────────────────────────────────── */
.cc-tb {
   position: sticky; top: var(--cc-top); z-index: 30;
   margin: 0 -28px; padding: 9px 28px;
   background: var(--paper); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
   display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px;
}
@supports (backdrop-filter: blur(4px)) {
   .cc-tb { background: rgba(233, 232, 227, 0.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
}
@media (max-width: 900px) {
   .cc-tb { position: static; margin: 0 -16px; padding: 9px 16px; backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--paper); }
}
.cc-search { position: relative; flex: 1 1 220px; max-width: 360px; margin: 0; }
.cc-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink4); pointer-events: none; }
.cc-search input {
   width: 100%; height: 36px; box-sizing: border-box;
   border: 1px solid var(--rule2); border-radius: 8px; background: var(--card); color: var(--ink);
   font: 14px 'Instrument Sans', system-ui, sans-serif; padding: 0 34px 0 33px;
}
.cc-search input::placeholder { color: var(--ink4); }
.cc-search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 11px/1 'Fragment Mono', monospace; color: var(--ink4); border: 1px solid var(--rule2); border-radius: 4px; padding: 3px 5px; background: var(--paper); }
@media (hover: none) { .cc-search kbd { display: none; } }
.cc-seg { display: inline-flex; border: 1px solid var(--rule2); border-radius: 8px; padding: 2px; background: var(--card); }
.cc-seg button { border: 0; background: none; font: 500 13px/1 'Instrument Sans', system-ui, sans-serif; color: var(--ink3); padding: 8px 12px; border-radius: 6px; cursor: pointer; }
.cc-seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.cc-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--rule2); border-radius: 999px; background: var(--card); color: var(--ink2); font: 500 13px/1 'Instrument Sans', system-ui, sans-serif; padding: 8px 12px; cursor: pointer; }
.cc-chip[aria-pressed="true"] { border-color: var(--cc-l3); color: var(--cc-l3); background: var(--cc-l3s); }
.cc-hint { font-size: 12px; color: var(--ink4); }
@media (max-width: 720px), (hover: none) { .cc-hint { display: none; } }
.cc-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-left: auto; font-size: 12px; color: var(--ink3); }
.cc-legend > span { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 900px) { .cc-legend { margin-left: 0; } }
.cc-stats[hidden] { display: none; }
.cc-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font: 12px 'Fragment Mono', monospace; color: var(--ink3); }
.cc-stats b { color: var(--ink); font-weight: 400; }
.cc-stats__note { font-family: 'Instrument Sans', system-ui, sans-serif; font-size: 12.5px; }
.cc-stats__note a { color: var(--orangeD); }

/* ── marks ──────────────────────────────────────────────────────────── */
.cc-meter { display: inline-flex; gap: 2px; align-items: flex-end; vertical-align: middle; flex: none; }
.cc-meter i { display: block; width: 4px; height: 11px; border-radius: 1px; background: var(--cc-l0); }
.cc-meter[data-n="1"] i:nth-child(1) { background: var(--cc-l1); }
.cc-meter[data-n="2"] i:nth-child(-n+2) { background: var(--cc-l2); }
.cc-meter[data-n="3"] i { background: var(--cc-l3); }
.cc-meter--none { width: 16px; }
.cc-lvl { display: inline-flex; gap: 2px; flex: none; align-self: center; }
.cc-lvl i { width: 5px; height: 5px; border-radius: 50%; background: var(--rule2); }
.cc-lvl[data-l="1"] i:nth-child(1), .cc-lvl[data-l="2"] i:nth-child(-n+2), .cc-lvl[data-l="3"] i { background: var(--ink3); }

/* ── model ──────────────────────────────────────────────────────────── */
.cc-eyebrow { display: flex; align-items: center; gap: 8px; margin: 0; font: 600 10.5px/1 'Fragment Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); }
.cc-model { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 22px; padding: 22px 0 18px; align-items: start; }
@media (max-width: 900px) { .cc-model { grid-template-columns: minmax(0, 1fr); } }
.cc-points { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 11px; }
.cc-points li { position: relative; padding-left: 16px; max-width: 60ch; font-size: 15.5px; line-height: 1.5; color: var(--ink2); }
.cc-points li::before { content: ""; position: absolute; left: 1px; top: .66em; width: 5px; height: 5px; border-radius: 50%; background: var(--ink3); }
.cc-points strong { color: var(--ink); font-weight: 600; }
.cc-k { font: 0.86em 'Fragment Mono', ui-monospace, monospace; background: var(--cc-code); border: 1px solid var(--cc-code-edge); border-radius: 4px; padding: 1px 5px; white-space: nowrap; color: var(--ink); }
/* Code with a long token (inline.js codeSpan) wraps at its <wbr> points, and mid-word only as a last resort. */
.cc-k--wrap { white-space: normal; overflow-wrap: anywhere; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.cc-diagram { margin: 0; background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px 12px; }
.cc-scroll { overflow-x: auto; }
.cc-svg { display: block; width: 100%; height: auto; }
.cc-svg--lanes { min-width: 600px; }
.cc-cap { margin: 8px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--ink3); }

/* diagram marks */
.cc-dg-box { fill: var(--cc-sunk); stroke: var(--rule2); }
.cc-dg-name { fill: var(--ink); font: 600 13px 'Instrument Sans', system-ui, sans-serif; }
.cc-dg-sub { fill: var(--ink3); font: 11px 'Fragment Mono', monospace; }
.cc-dg-lane { stroke: var(--rule2); stroke-width: 1; stroke-dasharray: 2 4; }
.cc-dg-line { stroke: var(--ink); stroke-width: 1.6; fill: none; }
.cc-dg-head, .cc-dg-dot { fill: var(--ink); }
.cc-dg-lbl { fill: var(--ink); font: 12px 'Fragment Mono', monospace; stroke: var(--card); stroke-width: 6px; paint-order: stroke; stroke-linejoin: round; }
.cc-dg-soft { fill: var(--ink3); }
.cc-dg-band { fill: var(--ink4); font: 600 9.5px 'Fragment Mono', monospace; letter-spacing: .1em; }
.cc-dg-arrow.cc-t--1 .cc-dg-line { stroke: var(--cc-l1); } .cc-dg-arrow.cc-t--1 .cc-dg-head, .cc-dg-arrow.cc-t--1 .cc-dg-dot, .cc-dg-arrow.cc-t--1 .cc-dg-lbl { fill: var(--cc-l1); }
.cc-dg-arrow.cc-t--2 .cc-dg-line { stroke: var(--cc-l2); } .cc-dg-arrow.cc-t--2 .cc-dg-head, .cc-dg-arrow.cc-t--2 .cc-dg-dot, .cc-dg-arrow.cc-t--2 .cc-dg-lbl { fill: var(--cc-l2); }
.cc-dg-arrow.cc-t--3 .cc-dg-line { stroke: var(--cc-l3); } .cc-dg-arrow.cc-t--3 .cc-dg-head, .cc-dg-arrow.cc-t--3 .cc-dg-dot, .cc-dg-arrow.cc-t--3 .cc-dg-lbl { fill: var(--cc-l3); }

.cc-mini { display: grid; gap: 10px; margin: 4px 0 8px; }
.cc-mini--2 { grid-template-columns: 1fr 1fr; }
.cc-mini--3 { grid-template-columns: 1fr 1fr 1fr; }
.cc-mini--1 .cc-mini__fig { max-width: 300px; }
@media (max-width: 520px) { .cc-mini--2, .cc-mini--3 { grid-template-columns: minmax(0, 1fr); } }
.cc-mini__fig { margin: 0; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 8px 8px 6px; }
.cc-mini__fig figcaption { margin-top: 4px; font-size: 11.5px; line-height: 1.35; color: var(--ink3); }
.cc-mini__fig figcaption b { display: block; margin-bottom: 2px; font: 600 10px 'Fragment Mono', monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.cc-g-edge { stroke: var(--ink3); stroke-width: 1.5; fill: none; }
.cc-g-edge--ghost { stroke: var(--ink4); stroke-dasharray: 2 2.5; stroke-width: 1.3; }
.cc-g-head { fill: var(--ink3); }
.cc-g-node, .cc-g-box { fill: var(--card); stroke: var(--ink); stroke-width: 1.5; }
.cc-g-node.cc-t--strong { fill: var(--ink); }
.cc-g-box.cc-t--strong { fill: var(--ink); }
.cc-g-txt { fill: var(--ink2); font: 10px 'Fragment Mono', monospace; }
.cc-g-txt--in { font-size: 10px; fill: var(--ink); }
.cc-g-txt--in.cc-t--strong { fill: var(--paper); }
.cc-g-node.cc-t--ghost { fill: none; stroke: var(--ink4); stroke-dasharray: 2 2.5; stroke-width: 1.3; }
.cc-g-txt.cc-t--ghost { fill: var(--ink4); }
.cc-g-node.cc-t--1, .cc-g-box.cc-t--1 { fill: var(--cc-l1s); stroke: var(--cc-l1); } .cc-g-txt.cc-t--1 { fill: var(--cc-l1); }
.cc-g-node.cc-t--2, .cc-g-box.cc-t--2 { fill: var(--cc-l2s); stroke: var(--cc-l2); } .cc-g-txt.cc-t--2 { fill: var(--cc-l2); }
.cc-g-node.cc-t--3, .cc-g-box.cc-t--3 { fill: var(--cc-l3s); stroke: var(--cc-l3); } .cc-g-txt.cc-t--3 { fill: var(--cc-l3); }
.cc-strip { margin: 4px 0 8px; }
.cc-svg--strip { max-width: 320px; }
.cc-strip .cc-cap { margin-top: 2px; }
.cc-s-cell { fill: var(--cc-sunk); }
.cc-s-cell.cc-t--1 { fill: var(--cc-l1s); } .cc-s-cell.cc-t--2 { fill: var(--cc-l2s); } .cc-s-cell.cc-t--3 { fill: var(--cc-l3s); }
.cc-s-cell--outline.cc-t--3 { stroke: var(--cc-l3); stroke-width: 1.5; }
.cc-s-cell--outline.cc-t--2 { stroke: var(--cc-l2); stroke-width: 1.5; }
.cc-s-cell--outline.cc-t--1 { stroke: var(--cc-l1); stroke-width: 1.5; }
.cc-s-n { fill: var(--ink3); font: 10px 'Fragment Mono', monospace; }
.cc-s-n--hit { fill: var(--cc-l3); }
.cc-s-lab { fill: var(--ink4); font: 10px 'Fragment Mono', monospace; }
.cc-tl { margin: 4px 0 8px; }
.cc-svg--timeline { max-width: 360px; }
.cc-tl .cc-cap { margin-top: 6px; }
.cc-tl-name { fill: var(--ink); font: 600 10.5px 'Instrument Sans', system-ui, sans-serif; }
.cc-tl-rail { stroke: var(--rule2); stroke-width: 1; stroke-dasharray: 2 3; }
.cc-tl-bar { fill: var(--cc-sunk); }
.cc-tl-txt { fill: var(--ink); font: 9px 'Fragment Mono', monospace; }
.cc-tl-tick { fill: var(--ink); stroke: var(--card); stroke-width: 1.5; }
.cc-tl-lab { fill: var(--ink2); font: 9px 'Fragment Mono', monospace; }
.cc-tl-axis { stroke: var(--ink4); stroke-width: 1; }
.cc-tl-head { fill: var(--ink4); }
.cc-tl-axlab { fill: var(--ink4); font: 9px 'Fragment Mono', monospace; }
.cc-tl-bar.cc-t--strong { fill: var(--ink); } .cc-tl-txt.cc-t--strong { fill: var(--paper); }
.cc-tl-bar.cc-t--ghost { fill: var(--card); stroke: var(--ink4); stroke-dasharray: 2 2.5; stroke-width: 1.2; } .cc-tl-txt.cc-t--ghost { fill: var(--ink3); }
.cc-tl-tick.cc-t--ghost { fill: var(--card); stroke: var(--ink4); } .cc-tl-lab.cc-t--ghost { fill: var(--ink4); }
.cc-tl-bar.cc-t--1 { fill: var(--cc-l1s); stroke: var(--cc-l1); } .cc-tl-txt.cc-t--1, .cc-tl-lab.cc-t--1, .cc-tl-tick.cc-t--1 { fill: var(--cc-l1); }
.cc-tl-bar.cc-t--2 { fill: var(--cc-l2s); stroke: var(--cc-l2); } .cc-tl-txt.cc-t--2, .cc-tl-lab.cc-t--2, .cc-tl-tick.cc-t--2 { fill: var(--cc-l2); }
.cc-tl-bar.cc-t--3 { fill: var(--cc-l3s); stroke: var(--cc-l3); } .cc-tl-txt.cc-t--3, .cc-tl-lab.cc-t--3, .cc-tl-tick.cc-t--3 { fill: var(--cc-l3); }

.cc-sub { margin: 0 0 8px; font-size: 13px; color: var(--ink3); }

/* ── card grid ──────────────────────────────────────────────────────── */
.cc-grid { columns: 3 330px; column-gap: 18px; padding: 6px 0 12px; }
.cc-grp { margin: 0; scroll-margin-top: 140px; }
.cc-model { scroll-margin-top: 140px; }
@media (max-width: 900px) { .cc-grp, .cc-model, .cc-card, .cc-row { scroll-margin-top: 72px; } }
.cc-keep { break-inside: avoid; }
.cc-grp__h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 12px 2px 9px; border-top: 2px solid var(--ink); }
.cc-grp__h h2 { margin: 0; font: 600 11px/1 'Fragment Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.cc-grp__h small { font-size: 12.5px; color: var(--ink3); }
.cc-card { break-inside: avoid; margin: 0 0 12px; padding: 12px 14px; background: var(--card); border: 1px solid var(--rule); border-radius: 8px; scroll-margin-top: 140px; }
/* A link from Guided practice's finish screen lands on one card (#c-<id>). */
@media screen { .cc-card:target { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange); } }
.cc-card__h { margin: 0 0 6px; font: 600 15px/1.3 'Instrument Sans', system-ui, sans-serif; letter-spacing: -.005em; color: var(--ink); text-wrap: balance; }
.cc-row { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.2fr) 16px; gap: 3px 10px; align-items: baseline; padding: 5px 0; border-top: 1px solid var(--rule); scroll-margin-top: 140px; }
.cc--none .cc-row { grid-template-columns: minmax(0, .9fr) minmax(0, 1.2fr); }
.cc-rows > .cc-row:first-child { border-top: 0; }
.cc-task { font-size: 13px; line-height: 1.38; color: var(--ink2); }
.cc-ans { display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; min-width: 0; }
.cc-text { font-size: 13px; line-height: 1.4; color: var(--ink); }
.cc-cmd {
   position: relative; font: 12.5px/1.4 'Fragment Mono', ui-monospace, monospace; color: var(--ink);
   background: var(--cc-code); border: 1px solid var(--cc-code-edge); border-radius: 4px; padding: 1px 6px;
   cursor: copy; overflow-wrap: anywhere; transition: border-color .12s;
}
.cc-cmd:hover { border-color: var(--ink4); }
/* Lines break between tokens; a single token too long for its column wraps
   inside itself rather than spilling out of the chip. */
.cc-tok { display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
.cc-cmd.is-copied::after { content: "Copied"; position: absolute; right: 0; top: -22px; font: 500 11px/1 'Instrument Sans', system-ui, sans-serif; background: var(--ink); color: var(--paper); padding: 4px 6px; border-radius: 4px; white-space: nowrap; }
.cc-row > .cc-meter { justify-self: end; align-self: center; }
@media (max-width: 520px) {
   .cc-row { grid-template-columns: minmax(0, 1fr) 16px; }
   .cc-row > .cc-task, .cc-row > .cc-ans { grid-column: 1; }
   .cc-row > .cc-meter { grid-column: 2; grid-row: 1; }
   .cc--none .cc-row { grid-template-columns: minmax(0, 1fr); }
}

.cc-tip, .cc-trap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: baseline; margin: 9px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--ink2); }
.cc-tip > b, .cc-trap > b { position: relative; top: -1px; padding: 3px 5px; border-radius: 3px; font: 600 9.5px/1 'Fragment Mono', monospace; letter-spacing: .08em; text-transform: uppercase; }
.cc-trap > b { color: var(--cc-l3); background: var(--cc-l3s); }
.cc--era .cc-trap > b, .cc--none .cc-trap > b { color: #B3261E; background: #F3DAD6; }
.cc-tip > b { color: var(--ink3); background: var(--cc-sunk); }
.cc-tip .cc-k, .cc-trap .cc-k { font-size: 11.5px; white-space: normal; }
.cc-asked { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--rule2); font-size: 12.5px; line-height: 1.4; color: var(--ink2); text-decoration: none; }
.cc-asked + .cc-asked { margin-top: 0; padding-top: 3px; border-top: 0; }
.cc-asked__lbl { flex: none; font: 600 9.5px/1 'Fragment Mono', monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--orangeD); }
.cc-asked__q { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-asked:hover .cc-asked__q { text-decoration: underline; text-underline-offset: 2px; }
/* One heading over a card's links; only the Comfortable view shows it. */
.cc-asks__h { display: none; }

/* matrix card */
.cc-mx__head, .cc-row--mx { display: grid; grid-template-columns: minmax(0, 1fr) repeat(var(--cc-mx-cols, 3), 40px) 16px; gap: 0 6px; align-items: center; }
.cc--none .cc-mx__head, .cc--none .cc-row--mx { grid-template-columns: minmax(0, 1fr) repeat(var(--cc-mx-cols, 3), 40px); }
.cc-mx__head { padding: 4px 0 6px; font: 600 9.5px/1 'Fragment Mono', monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--ink4); }
.cc-mx__head span { text-align: center; }
.cc-row--mx { padding: 7px 0; }
.cc-mx__lead { display: grid; gap: 3px; }
.cc-dot { justify-self: center; width: 12px; height: 12px; border-radius: 50%; border: 1.6px solid var(--ink3); box-sizing: border-box; }
.cc-dot--on { background: var(--ink); border-color: var(--ink); }
.cc-dot--bad { background: #B3261E; border-color: #B3261E; border-radius: 2px; }
.cc-mx__key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12px; color: var(--ink3); }
.cc-mx__key > span { display: inline-flex; align-items: center; gap: 6px; }
.cc-mx__key .cc-dot { width: 10px; height: 10px; }

/* snippet - a line longer than the card wraps, indented under its start,
   instead of running into a scroll area whose bar most readers never see. */
.cc-snip { display: grid; grid-template-columns: minmax(0, 1fr); margin: 4px 0 8px; padding: 8px 10px; overflow-x: auto; background: var(--cc-code); border: 1px solid var(--cc-code-edge); border-radius: 6px; font: 12px/1.55 'Fragment Mono', ui-monospace, monospace; color: var(--ink); }
.cc-snip__label { margin-top: 4px; font: 600 9.5px/1.4 'Fragment Mono', monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--ink4); }
.cc-snip__label:first-child { margin-top: 0; }
.cc-snip__line { display: flex; gap: 16px; justify-content: space-between; white-space: pre-wrap; }
.cc-snip__t { min-width: 0; padding-left: 2ch; text-indent: -2ch; overflow-wrap: anywhere; }
.cc-snip__line--dim .cc-snip__t { color: var(--ink4); }
.cc-snip__note { flex: none; max-width: 45%; font: 11px 'Instrument Sans', system-ui, sans-serif; color: var(--ink4); white-space: normal; text-align: right; }

/* Code shows every character as typed: Fragment Mono's ligatures draw === as
   three bars and => as an arrow. site-fonts.css turns them off for <code>,
   but the PDF doesn't load that file, and a snippet or a diagram label isn't
   a <code>. */
.cc code, .cc-snip, .cc-svg text { font-variant-ligatures: none; }

.cc-empty { padding: 20px 0 30px; font-size: 14px; color: var(--ink3); }

/* ── filters ────────────────────────────────────────────────────────── */
.cc-row[hidden], .cc-card[hidden], .cc-grp[hidden] { display: none !important; }

/* ── quiz ───────────────────────────────────────────────────────────── */
.cc.is-quiz .cc-row:not(.is-shown) { cursor: pointer; }
.cc.is-quiz .cc-row:not(.is-shown) .cc-cmd,
.cc.is-quiz .cc-row:not(.is-shown) .cc-text {
   color: transparent !important; user-select: none; cursor: pointer; border-radius: 4px;
   background: repeating-linear-gradient(135deg, var(--cc-code) 0 5px, var(--cc-code-edge) 5px 6px);
   border-color: var(--cc-code-edge);
}
.cc.is-quiz .cc-row:not(.is-shown) .cc-cmd *,
.cc.is-quiz .cc-row:not(.is-shown) .cc-text * { visibility: hidden; }
.cc.is-quiz .cc-row--mx:not(.is-shown) .cc-dot { background: none; border-color: var(--rule2); border-radius: 50%; }
.cc-judge { display: none; }
.cc.is-quiz .is-shown > .cc-judge { display: flex; grid-column: 1 / -1; flex-wrap: wrap; justify-content: flex-end; gap: 6px; padding-top: 3px; }
.cc-judge button { border: 1px solid var(--rule2); background: var(--card); color: var(--ink3); border-radius: 999px; padding: 4px 9px; font: 500 11.5px/1 'Instrument Sans', system-ui, sans-serif; cursor: pointer; }
[data-j="knew"] > .cc-judge .cc-judge__knew { background: #DCE8DF; color: #256E4C; border-color: #256E4C; }
[data-j="shaky"] > .cc-judge .cc-judge__shaky { background: #EFE3C6; color: #8F5E00; border-color: #8F5E00; }
[data-j="unknown"] > .cc-judge .cc-judge__unknown { background: #F3DAD6; color: #B3261E; border-color: #B3261E; }

/* phone quiz: one card at a time */
.cc-deck { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--paper); padding: calc(12px + env(safe-area-inset-top, 0px)) 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
.cc-deck[hidden] { display: none; }
.cc-deck__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font: 12px 'Fragment Mono', monospace; color: var(--ink3); }
.cc-deck__close { border: 1px solid var(--rule2); background: var(--card); border-radius: 999px; padding: 6px 12px; font: 500 13px 'Instrument Sans', system-ui, sans-serif; color: var(--ink2); }
.cc-deck__body { flex: 1; overflow-y: auto; margin: 12px 0; }
.cc-deck__body .cc-card { margin: 0; }
.cc-deck__nav { display: flex; gap: 10px; }
.cc-deck__nav button { flex: 1; border: 1px solid var(--rule2); background: var(--card); border-radius: 10px; padding: 12px; font: 600 14px 'Instrument Sans', system-ui, sans-serif; color: var(--ink); }
.cc-deck__nav button:disabled { color: var(--ink4); }

/* ── answer drawer ──────────────────────────────────────────────────── */
.cc-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 70; width: min(560px, 100%); display: flex; flex-direction: column; background: var(--card); border-left: 1px solid var(--rule); box-shadow: -18px 0 40px rgba(0, 0, 0, .12); }
.cc-drawer[hidden] { display: none; }
.cc-drawer__head { display: flex; align-items: flex-start; gap: 12px; padding: calc(16px + env(safe-area-inset-top, 0px)) 20px 12px; border-bottom: 1px solid var(--rule); }
.cc-drawer__title { flex: 1; margin: 0; font: 600 17px/1.3 'Instrument Sans', system-ui, sans-serif; color: var(--ink); }
.cc-drawer__x { flex: none; border: 1px solid var(--rule2); background: var(--paper); border-radius: 999px; width: 32px; height: 32px; font-size: 16px; line-height: 1; color: var(--ink2); cursor: pointer; }
.cc-drawer__body { flex: 1; overflow-y: auto; padding: 14px 20px 20px; font-size: 15px; line-height: 1.6; color: var(--ink2); }
.cc-drawer__body pre { overflow-x: auto; padding: 10px 12px; background: var(--cc-code); border: 1px solid var(--cc-code-edge); border-radius: 6px; font: 12.5px/1.5 'Fragment Mono', monospace; }
.cc-drawer__body code { font-family: 'Fragment Mono', monospace; font-size: .9em; }
.cc-drawer__body table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.cc-drawer__body th, .cc-drawer__body td { border-top: 1px solid var(--rule); padding: 6px 8px; text-align: left; vertical-align: top; }
.cc-drawer__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--rule); font-size: 13px; }
.cc-drawer__foot a { font-weight: 600; color: var(--orangeD); text-decoration: none; }
.cc-drawer__lock { display: grid; gap: 10px; }
.cc-drawer__lock .cs-pro__cta { justify-self: start; }
.cc-scrim { position: fixed; inset: 0; z-index: 65; background: rgba(35, 35, 32, .28); }
.cc-scrim[hidden] { display: none; }

/* ── keep going ─────────────────────────────────────────────────────── */
.cc-next { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; padding: 4px 0 26px; }
.cc-next a { display: grid; gap: 3px; padding: 14px 16px; background: var(--card); border: 1px solid var(--rule); border-radius: 10px; text-decoration: none; }
.cc-next a:hover { border-color: var(--ink4); }
.cc-next__m { font: 600 10px/1 'Fragment Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--ink4); }
.cc-next__t { font-weight: 600; font-size: 15px; color: var(--ink); }
.cc-next__d { font-size: 13px; color: var(--ink3); }

/* ── the ladder: free to read -> free account -> Pro ─────────────────
   views/includes/cheatsheet-ladder.ejs; signed out and free readers only. */
.cc-ladder {
   position: relative; display: flex; align-items: center; gap: 12px 22px;
   margin: 2px 0 14px; padding: 11px 46px 11px 14px;
   background: var(--card); border: 1px solid var(--rule); border-radius: 12px;
}
.cc-ladder[hidden] { display: none; }
.cc-ladder__steps { flex: 1; min-width: 0; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 26px; }
.cc-ladder__steps li { position: relative; display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.cc-ladder__steps li + li::before {
   content: ""; position: absolute; left: -17px; top: 7px; width: 6px; height: 6px;
   border-top: 1.5px solid var(--ink4); border-right: 1.5px solid var(--ink4); transform: rotate(45deg);
}
.cc-ladder__mark {
   flex: none; width: 20px; height: 20px; margin-top: 1px; box-sizing: border-box; border-radius: 50%;
   display: inline-flex; align-items: center; justify-content: center;
   border: 1.5px solid var(--rule2); background: var(--paper); color: var(--ink3);
   font: 600 10.5px/1 'Fragment Mono', monospace;
}
.cc-ladder__mark svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cc-ladder li.is-done .cc-ladder__mark { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.cc-ladder li.is-next .cc-ladder__mark { background: var(--orangeS); border-color: var(--orange); color: var(--orangeD); }
.cc-ladder__txt { display: grid; gap: 1px; min-width: 0; font-size: 12.5px; line-height: 1.38; color: var(--ink3); }
.cc-ladder__txt b { font-size: 13px; font-weight: 600; color: var(--ink); }
.cc-ladder li.is-next .cc-ladder__txt b { color: var(--orangeD); }
.cc-ladder__mine { display: block; margin-top: 2px; font-weight: 600; color: var(--ink2); }
.cc-ladder__mine[hidden] { display: none; }
.cc-ladder__cta { flex: none; display: flex; align-items: center; gap: 14px; }
.cc-ladder__btn {
   display: inline-flex; align-items: center; padding: 9px 15px; border-radius: 9px;
   background: var(--ink); color: var(--paper); text-decoration: none; white-space: nowrap;
   font: 600 13.5px/1 'Instrument Sans', system-ui, sans-serif;
}
.cc-ladder__btn:hover { background: #000; color: #fff; }
.cc-ladder__btn--pro { background: linear-gradient(180deg, #F06A24, var(--orange)); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 2px 5px -1px rgba(194, 74, 11, .5); }
.cc-ladder__btn--pro:hover { background: var(--orangeD); }
.cc-ladder__price { margin-left: 8px; padding-left: 8px; border-left: 1px solid rgba(255, 255, 255, .45); font-weight: 500; }
.cc-ladder__alt { font-size: 13.5px; font-weight: 600; color: var(--orangeD); text-decoration: none; white-space: nowrap; }
.cc-ladder__alt:hover { text-decoration: underline; text-underline-offset: 2px; }
.cc-ladder__x {
   position: absolute; top: 50%; right: 10px; transform: translateY(-50%); width: 26px; height: 26px; padding: 0;
   display: inline-flex; align-items: center; justify-content: center;
   border: 0; border-radius: 6px; background: none; color: var(--ink4); cursor: pointer;
}
.cc-ladder__x:hover { background: var(--cc-sunk); color: var(--ink2); }
.cc-ladder__x svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.cc-ladder__short { display: none; }
@media (max-width: 1100px) {
   .cc-ladder { flex-wrap: wrap; }
   .cc-ladder__steps { flex-basis: 100%; }
   .cc-ladder__x { top: 10px; transform: none; }
}
@media (max-width: 720px) {
   .cc-ladder { flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px 42px 12px 14px; }
   .cc-ladder__steps { display: none; }
   .cc-ladder__short { display: block; margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--ink2); }
   .cc-ladder__short b { color: var(--ink); }
}

/* ── header actions: My sheet, Download PDF ─────────────────────────── */
.cc-acts { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: 8px; }
.cc-acts .cc-pdf { margin-left: 0; }
@media (max-width: 720px) { .cc-acts { margin-left: 0; } }

/* ── stars (signed in, free; My sheet gathers them - Pro) ───────────── */
.cc-card { position: relative; }
.cc-card:has(> .cc-star) > .cc-card__h { padding-right: 26px; }
.cc-star {
   position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; padding: 0;
   display: inline-flex; align-items: center; justify-content: center;
   border: 0; border-radius: 6px; background: none; color: var(--ink4); cursor: pointer;
   opacity: .55; transition: opacity .12s, color .12s, background .12s;
}
.cc-card:hover .cc-star, .cc-star:focus-visible, .cc-star[aria-pressed="true"] { opacity: 1; }
.cc-star:hover { background: var(--cc-sunk); color: var(--ink2); }
.cc-star[aria-pressed="true"] { color: var(--orange); }
.cc-star[aria-pressed="true"] svg { fill: currentColor; }
@media (hover: none) { .cc-star { opacity: 1; } }
.cc-star:disabled { cursor: progress; }

/* ── toast ──────────────────────────────────────────────────────────── */
.cc-toast {
   position: fixed; z-index: 80; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
   max-width: min(520px, calc(100vw - 32px)); box-sizing: border-box; padding: 10px 14px; border-radius: 10px;
   background: var(--ink); color: var(--paper); font-size: 13.5px; line-height: 1.45;
   box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .45);
}
.cc-toast[hidden] { display: none; }
.cc-toast a { color: #F5A06E; font-weight: 600; }

/* ── my misses: last time's Partly / Didn't know rows ───────────────── */
.cc-chip--miss[hidden] { display: none; }
.cc-chip--miss b { font: 12px 'Fragment Mono', monospace; font-weight: 400; color: var(--ink3); }
.cc-miss-bar { width: 3px; height: 12px; border-radius: 1px; background: #B3261E; }
.cc-chip--miss[aria-pressed="true"] { border-color: #B3261E; color: #B3261E; background: #F3DAD6; }
.cc-show-last .cc-row[data-last="unknown"], .cc-show-last .cc-row[data-last="shaky"] { position: relative; }
.cc-show-last .cc-row[data-last="unknown"]::before, .cc-show-last .cc-row[data-last="shaky"]::before {
   content: ""; position: absolute; left: -8px; top: 5px; bottom: 5px; width: 3px; border-radius: 1px; background: #B3261E;
}
.cc-show-last .cc-row[data-last="shaky"]::before { background: #B07A12; }
/* In Quiz me, a revealed row outlines what you said last time. */
.cc.is-quiz .is-shown[data-last="knew"]:not([data-j]) .cc-judge__knew,
.cc.is-quiz .is-shown[data-last="shaky"]:not([data-j]) .cc-judge__shaky,
.cc.is-quiz .is-shown[data-last="unknown"]:not([data-j]) .cc-judge__unknown { border-style: dashed; border-color: var(--ink3); color: var(--ink2); }

/* ── what Pro adds (views/includes/cheatsheet-pro-list.ejs) ─────────── */
.cc-prolist { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 26px; max-width: 760px; }
@media (max-width: 760px) { .cc-prolist { grid-template-columns: minmax(0, 1fr); } }
.cc-prolist li { position: relative; padding-left: 20px; font-size: 14.5px; line-height: 1.5; color: #B5B4AC; }
.cc-prolist li::before {
   content: ""; position: absolute; left: 2px; top: .42em; width: 9px; height: 5px;
   border-left: 2px solid var(--orange); border-bottom: 2px solid var(--orange); transform: rotate(-45deg);
}
.cc-prolist b { color: var(--paper); font-weight: 600; }
.cs-pro #cc-pro-title { font-size: 30px; letter-spacing: -0.03em; }
@media (max-width: 760px) { .cs-pro #cc-pro-title { font-size: 24px; } }
/* the same list in a light panel */
.cc-drawer__pro { display: grid; gap: 4px; }
.cc-drawer__pro-h { margin: 6px 0 0; font-weight: 600; color: var(--ink); }
.cc-drawer__pro .cc-prolist { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 8px; }
.cc-drawer__pro .cc-prolist li { color: var(--ink2); font-size: 14.5px; }
.cc-drawer__pro .cc-prolist b { color: var(--ink); }
.cc-drawer__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 16px; font-size: 13px; color: var(--ink3); }
.cc-drawer__signin { margin: 8px 0 0; font-size: 13px; color: var(--ink3); }
.cc-drawer__signin a { color: var(--orangeD); font-weight: 600; }
.cc-drawer__foot span { color: var(--ink3); }
.cc-drawer__fig { margin: 0 0 14px; }
.cc-drawer__fig img { display: block; width: 100%; height: auto; aspect-ratio: 297 / 209.5; border: 1px solid var(--rule); border-radius: 6px; background: #fff; box-shadow: 0 10px 26px -16px rgba(0, 0, 0, .35); }
.cc-drawer__fig.is-loading img { background: repeating-linear-gradient(135deg, #fff 0 10px, var(--cc-code) 10px 11px); }
.cc-drawer__fig figcaption { margin-top: 8px; font-size: 12.5px; line-height: 1.45; color: var(--ink3); }

/* ── My sheet (views/cheatsheet-my-sheet.ejs) ───────────────────────── */
.cc-grp__key { flex-basis: 100%; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font-size: 11.5px; color: var(--ink3); }
.cc-grp__key > span { display: inline-flex; align-items: center; gap: 5px; }
.cc-grp__src { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--orangeD); text-decoration: none; }
.cc-grp__src:hover { text-decoration: underline; }
.cc-mine-head { padding: 4px 0 14px; }
.cc-mine-head p { margin: 6px 0 0; max-width: 70ch; font-size: 14.5px; line-height: 1.5; color: var(--ink3); }
.cc-mine-key { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink3); }
.cc-mine-key > span { display: inline-flex; align-items: center; gap: 6px; }
.cc-mine-key .cc-miss-bar--shaky { background: #B07A12; }
.cc-mine-empty { margin: 26px 0 40px; padding: 26px 28px; background: var(--card); border: 1px solid var(--rule); border-radius: 12px; max-width: 720px; }
.cc-mine-empty h2 { margin: 0 0 8px; font: 600 20px/1.25 'Instrument Sans', system-ui, sans-serif; color: var(--ink); }
.cc-mine-empty p { margin: 0 0 10px; font-size: 14.5px; line-height: 1.55; color: var(--ink2); }
.cc-mine-empty ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; line-height: 1.7; }
.cc-mine-empty a { color: var(--orangeD); font-weight: 600; }
.cc-mine-empty a.cs-pro__cta { color: #fff; }
.cc-mine-empty .cc-mine-sheets { padding-left: 0; }
.cc-mine-empty .cc-prolist { padding-left: 0; }
.cc-mine-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 4px; }
.cc-mine-stats > div { padding: 10px 14px; background: var(--card); border: 1px solid var(--rule); border-radius: 10px; min-width: 120px; }
.cc-mine-stats b { display: block; font: 400 24px/1.1 'Fragment Mono', monospace; color: var(--ink); }
.cc-mine-stats span { font-size: 12.5px; color: var(--ink3); }
.cc-mine-sheets { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.cc-mine-sheets li { font-size: 14px; color: var(--ink2); }
.cc-mine-sheets a { color: var(--ink); font-weight: 600; text-decoration: none; }
.cc-mine-sheets a:hover { text-decoration: underline; }

/* ── Comfortable: the default reading view ────────────────────────────
   body.cc-comfy on the sheet page; Compact (the toolbar switch) drops the
   class and gets the dense layout above. Screen only: print and the PDF
   (its own document, no cc-comfy) keep their own sizes. Each group is its
   own section, its cards in columns of at least 470px (two at 1440, three
   from about 1900), and a contents rail sits beside it from 1100px. */
.cc-rail { display: none; }
.cc-density button[aria-pressed="true"] { background: var(--cc-sunk); color: var(--ink); font-weight: 600; }
@media screen {
   .cc-comfy .cc-main { max-width: 1840px; }
   .cc-comfy .cc-grid { columns: auto; display: flex; flex-direction: column; gap: 22px; padding-top: 12px; counter-reset: cc-grp; }
   .cc-comfy .cc-grp { counter-increment: cc-grp; columns: 3 470px; column-gap: 20px; }
   .cc-comfy .cc-keep { display: contents; }
   .cc-comfy .cc-grp__h {
      column-span: all; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; align-items: baseline;
      padding: 16px 0 20px; border-top: 2px solid var(--ink);
   }
   .cc-comfy .cc-grp__h::before { content: counter(cc-grp, decimal-leading-zero); font: 14px/1 'Fragment Mono', monospace; color: var(--orangeD); }
   .cc-comfy .cc-grp__h h2 { font: 600 26px/1.2 'Instrument Sans', system-ui, sans-serif; letter-spacing: -0.01em; text-transform: none; }
   .cc-comfy .cc-grp__h small { grid-column: 2; display: block; font-size: 16px; line-height: 1.4; }
   .cc-comfy .cc-grp__h small::first-letter { text-transform: uppercase; }

   .cc-comfy .cc-card { margin: 0 0 20px; padding: 18px 22px 16px; border-radius: 10px; box-shadow: 0 1px 2px rgba(35, 35, 32, .05); }
   .cc-comfy .cc-card:has(> .cc-star) > .cc-card__h { padding-right: 30px; }
   .cc-comfy .cc-star { top: 12px; right: 12px; width: 32px; height: 32px; }
   .cc-comfy .cc-card__h { margin-bottom: 6px; font-size: 19px; }
   .cc-comfy .cc-row:not(.cc-row--mx) { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) 20px; gap: 4px 16px; }
   .cc-comfy.cc--none .cc-row:not(.cc-row--mx) { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
   .cc-comfy .cc-row { padding: 10px 0; border-top-color: #E6E4DD; }
   .cc-comfy .cc-task, .cc-comfy .cc-text { font-size: 15px; line-height: 1.45; }
   .cc-comfy .cc-ans { gap: 6px; }
   .cc-comfy .cc-cmd { padding: 3px 8px; border-radius: 6px; font-size: 13.5px; line-height: 1.45; }
   .cc-comfy .cc-row > .cc-meter { align-self: start; margin-top: 4px; }
   .cc-comfy .cc-meter i { width: 5px; height: 14px; border-radius: 1.5px; }
   .cc-comfy .cc-meter--none { width: 20px; }
   /* 44px, not 40: the larger header text needs it for a 6-letter word (schema.js matrixColWord). */
   .cc-comfy .cc-mx__head, .cc-comfy .cc-row--mx { grid-template-columns: minmax(0, 1fr) repeat(var(--cc-mx-cols, 3), 44px) 20px; }
   .cc-comfy.cc--none .cc-mx__head, .cc-comfy.cc--none .cc-row--mx { grid-template-columns: minmax(0, 1fr) repeat(var(--cc-mx-cols, 3), 44px); }
   .cc-comfy .cc-mx__head { font-size: 10.5px; }
   .cc-comfy .cc-mx__key { font-size: 13px; }

   .cc-comfy .cc-tip, .cc-comfy .cc-trap { gap: 10px; margin-top: 10px; font-size: 14.5px; line-height: 1.5; }
   .cc-comfy .cc-tip > b, .cc-comfy .cc-trap > b { padding: 4px 6px; border-radius: 4px; font-size: 11px; }
   .cc-comfy .cc-tip > b { background: #E6E4DE; color: var(--ink2); }
   .cc-comfy .cc-trap { padding: 10px 12px; border-radius: 8px; background: #FBEFEC; color: var(--ink); }
   .cc-comfy .cc-tip .cc-k, .cc-comfy .cc-trap .cc-k { font-size: 13px; }
   .cc-comfy .cc-trap .cc-k { background: #FDFCFA; border-color: #E8C9C3; }

   .cc-comfy .cc-asks { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed #D3D1C9; }
   .cc-comfy .cc-asks__h { display: block; margin: 0; font: 600 11px/1 'Fragment Mono', monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--orangeD); }
   .cc-comfy .cc-asked, .cc-comfy .cc-asked + .cc-asked { align-items: baseline; gap: 14px; margin: 0; padding: 0; border: 0; font-size: 14.5px; line-height: 1.45; color: var(--ink); }
   .cc-comfy .cc-asked__lbl { display: none; }
   .cc-comfy .cc-asked__q { white-space: normal; overflow: visible; text-overflow: clip; }
   /* The level as a word; the element keeps its aria-label. */
   .cc-comfy .cc-asked .cc-lvl { align-self: baseline; }
   .cc-comfy .cc-asked .cc-lvl i { display: none; }
   .cc-comfy .cc-asked .cc-lvl::after { content: attr(title); font-size: 12.5px; color: var(--ink3); white-space: nowrap; }

   .cc-comfy .cc-snip { margin: 6px 0 10px; padding: 12px 14px; border-radius: 8px; font-size: 13.5px; line-height: 1.65; }
   .cc-comfy .cc-snip__note { font-size: 13px; }
   .cc-comfy .cc-snip__label { font-size: 11px; }
   .cc-comfy .cc-empty { font-size: 15px; }

   /* Contents rail: the model, then each group, the one in view marked. */
   .cc-body { min-width: 0; }
   .cc-comfy #cc-model-h { scroll-margin-top: calc(var(--cc-top) + var(--cc-tb-h, 58px) + 16px); }
   @media (min-width: 1100px) {
      .cc-comfy .cc-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; }
      .cc-comfy .cc-flow { min-width: 0; }
      .cc-comfy .cc-jump { display: none; }
      .cc-comfy .cc-rail {
         position: sticky; top: calc(var(--cc-top) + var(--cc-tb-h, 58px) + 20px);
         max-height: calc(100vh - var(--cc-top) - var(--cc-tb-h, 58px) - 40px); overflow-y: auto;
         display: flex; flex-direction: column; gap: 2px; padding: 22px 0 24px;
      }
   }
   /* Jump and rail targets land below the sticky toolbar, however many lines it wraps to. */
   @media (min-width: 901px) {
      .cc-page .cc-grp, .cc-page .cc-grp__h { scroll-margin-top: calc(var(--cc-top) + var(--cc-tb-h, 58px) + 16px); }
   }
   .cc-rail__h { margin: 0; padding: 0 12px 10px; font: 600 11.5px/1 'Fragment Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); }
   .cc-rail a { display: flex; align-items: baseline; gap: 12px; padding: 8px 12px; border-radius: 8px; font-size: 14.5px; line-height: 1.35; color: var(--ink2); text-decoration: none; }
   .cc-rail a:hover { background: rgba(253, 252, 250, .6); color: var(--ink); }
   .cc-rail a[aria-current="true"] { background: var(--card); box-shadow: 0 0 0 1px #D3D1C9; color: var(--ink); font-weight: 600; }
   .cc-rail__n { flex: none; width: 20px; font: 12.5px/1 'Fragment Mono', monospace; color: var(--ink3); }
   .cc-rail a[aria-current="true"] .cc-rail__n { color: var(--orangeD); }

   @media (max-width: 520px) {
      .cc-comfy .cc-row:not(.cc-row--mx) { grid-template-columns: minmax(0, 1fr) 20px; gap: 3px 12px; }
      .cc-comfy.cc--none .cc-row:not(.cc-row--mx) { grid-template-columns: minmax(0, 1fr); }
      .cc-comfy .cc-row > .cc-meter { grid-column: 2; grid-row: 1 / span 2; margin-top: 3px; }
      .cc-comfy .cc-task { font-size: 15px; line-height: 1.4; }
      .cc-comfy .cc-text { font-size: 16px; }
      .cc-comfy .cc-cmd { font-size: 14px; }
      .cc-comfy .cc-card { padding: 16px; border-radius: 12px; }
      .cc-comfy .cc-grp__h h2 { font-size: 23px; }
      .cc-comfy .cc-grp__h small { font-size: 15.5px; }
      .cc-comfy .cc-tip, .cc-comfy .cc-trap { font-size: 15px; }
      .cc-comfy .cc-asked, .cc-comfy .cc-asked + .cc-asked { flex-direction: column; gap: 2px; padding: 4px 0; font-size: 15px; }
      .cc-comfy .cc-asked .cc-lvl::after { font-size: 13px; }
   }
}

/* ── print: the sheet on paper, four columns, no chrome ─────────────── */
@media print {
   @page { size: A4 landscape; margin: 10mm; }
   .lts-header, .cc-tb, .cc-jump, .cd-breadcrumb, .cc-next, .cd-related, .cs-pro, .cd-share, footer, .cc-drawer, .cc-scrim, .cc-deck, .cc-asked, .cc-acts, .cc-star, .cc-toast, .cc-grp__src, .cc-ladder { display: none !important; }
   body.cc { background: #fff; }
   .cc-main { max-width: none; padding: 0; }
   .cc-head { padding: 0 0 6px; }
   .cc-head h1 { font-size: 20px; }
   .cc-model { gap: 12px; padding: 6px 0; }
   .cc-points li { font-size: 11px; }
   .cc-grid { columns: 4; column-gap: 8px; column-fill: auto; }
   .cc-model { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
   .cc-scroll { overflow: visible; }
   .cc-svg--lanes { min-width: 0; }
   .cc-snip { overflow: visible; }
   .cc-k, .cc-tip .cc-k, .cc-trap .cc-k { font-size: 0.9em; padding: 0 3px; }
   .cc-snip { font-size: 8.5px; }
   .cc-snip__line { white-space: pre-wrap; }
   .cc-card { margin-bottom: 6px; }
   .cc-grp__h { padding: 6px 2px 5px; }
   .cc-card__h { font-size: 11.5px; margin-bottom: 3px; }
   .cc-mini__fig { padding: 4px; }
   /* The PDF paginates the grid itself (services/cheatsheetCards/pdf.js). */
   .cc-ppage { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; align-items: start; }
   .cc-ppage:not(:last-child) { break-after: page; }
   .cc-pcol > * { break-inside: avoid; }
   .cc-row { padding: 2px 0; gap: 1px 8px; }
   .cc-task, .cc-text { font-size: 9px; line-height: 1.3; }
   .cc-cmd { font-size: 8.5px; line-height: 1.3; }
   .cc-tip, .cc-trap { font-size: 9px; margin-top: 5px; }
   .cc-grp__h h2 { font-size: 9px; }
   .cc-grp__h small { font-size: 9px; }
   /* Narrower dot columns, so the command column fits `useEffect(fn, [id])` on one line. */
   .cc-mx__head, .cc-row--mx { grid-template-columns: minmax(0, 1fr) repeat(var(--cc-mx-cols, 3), 28px) 16px; gap: 0 4px; }
   .cc--none .cc-mx__head, .cc--none .cc-row--mx { grid-template-columns: minmax(0, 1fr) repeat(var(--cc-mx-cols, 3), 28px); }
   .cc-mx__head { padding: 2px 0 3px; font-size: 7px; line-height: 1.15; letter-spacing: .02em; }
   .cc-row--mx { padding: 3px 0; }
   .cc-mx__key { font-size: 9px; margin-top: 4px; }
   .cc-model { padding: 0; gap: 10px; align-items: start; }
   .cc-points { margin-top: 6px; gap: 5px; }
   .cc-points li { font-size: 10px; line-height: 1.35; }
   .cc-diagram { padding: 6px 8px; }
   .cc-cap { font-size: 9px; margin-top: 3px; }
   .cc-card, .cc-diagram { border-color: #ccc; background: #fff; padding: 6px 8px; }
   .cc-row { padding: 3px 0; }
   .cc-task, .cc-text { font-size: 9.5px; }
   .cc-cmd { font-size: 9px; padding: 0 3px; background: #f3f3f3; }
   .cc-tip, .cc-trap { font-size: 9.5px; }
   * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
