/* The online companion of a Smarter Stronger book (/companion/). Night palette of the hub, one calm reading column,
   activities as quiet cards that light up gold when they are right. Mobile first, checked at 390 and 1280. */
.comp-page main { min-height: 70vh; }
.cp { max-width: 860px; margin: 0 auto; padding: 120px 20px 80px; }
.cp-boot { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 120px 0; color: var(--muted); }
.cp-spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .15); border-top-color: var(--gold); animation: cp-spin 1s linear infinite; }
@keyframes cp-spin { to { transform: rotate(360deg); } }
.cp .eyebrow { margin: 0 0 8px; }
.cp h1 { font: 500 clamp(2rem, 5vw, 3.1rem)/1.06 var(--serif); margin: 0 0 12px; letter-spacing: -.01em; }
.cp .lead { color: var(--muted); font-size: 1.1rem; margin: 0 0 18px; max-width: 640px; }
.cp-back { display: inline-block; margin: 0 0 22px; color: var(--muted); text-decoration: none; font-size: .9rem; }
.cp-back:hover { color: var(--ink); }
.cp-note { color: var(--faint); font-size: .9rem; margin: 16px 0 0; }
.cp-link { background: none; border: 0; padding: 0; color: var(--gold); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.cp-card { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }

/* Home */
.cp-hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.cp-hero-lumo { width: 150px; height: auto; filter: drop-shadow(0 18px 40px rgba(255, 190, 90, .25)); }
.cp-levels { display: grid; gap: 34px; padding-top: 34px; }
.cp-level-h { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: baseline; margin-bottom: 14px; }
.cp-level-n { font: 700 .7rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.cp-level-h h2 { font: 500 1.45rem/1.1 var(--serif); margin: 0; letter-spacing: .04em; }
.cp-level-h p { grid-column: 2; margin: 4px 0 0; color: var(--faint); font-size: .92rem; }
.cp-missions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cp-m { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; transition: border-color .2s, transform .2s, background .2s; min-height: 76px; }
a.cp-m:hover { border-color: rgba(255, 217, 138, .35); transform: translateY(-2px); background: rgba(255, 217, 138, .035); color: var(--ink); }
.cp-m .cp-ring { grid-row: 1 / 3; }
.cp-m-n { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.cp-m-t { font: 500 1rem/1.25 var(--serif); }
.cp-m-tag { position: absolute; top: 10px; right: 12px; font-size: .7rem; color: var(--gold); }
.cp-m-tag.soon { color: var(--faint); }
.cp-m.soon { opacity: .5; }
.cp-m.locked .cp-m-t { color: var(--muted); }
.cp-ring svg { display: block; transform: rotate(-90deg); }
.cp-ring circle { fill: none; stroke-width: 3; }
.cp-ring .bg { stroke: rgba(255, 255, 255, .1); }
.cp-ring .fg { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset .6s cubic-bezier(.2, .7, .2, 1); }

/* Mission */
.cp-mhead { padding-bottom: 6px; }
.cp-bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .08); overflow: hidden; margin: 6px 0 18px; }
.cp-bar i { display: block; height: 100%; width: var(--p, 0%); background: linear-gradient(90deg, var(--gold), var(--amber)); border-radius: 4px; transition: width .5s cubic-bezier(.2, .7, .2, 1); }
.cp-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px 4px; position: sticky; top: 64px; z-index: 5; background: linear-gradient(var(--night) 70%, transparent); }
.cp-tabs::-webkit-scrollbar { display: none; }
.cp-tabs a { flex: none; display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: .88rem; white-space: nowrap; }
.cp-tabs a.on { color: #1a1205; background: linear-gradient(135deg, var(--gold), var(--amber)); border-color: transparent; }
.cp-tab-n { font-weight: 700; font-size: .75rem; opacity: .75; }
.cp-stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding-top: 22px; }
.cp-stage-h { font: 500 1.6rem/1.2 var(--serif); margin: 6px 0 0; }
.cp-why { padding: 18px 20px; border-left: 2px solid var(--gold); background: rgba(255, 217, 138, .04); border-radius: 0 12px 12px 0; color: var(--muted); }
.cp-why p { margin: 0 0 8px; color: var(--ink); }
.cp-why ul { margin: 0; padding-left: 18px; font-size: .92rem; }
.cp-p { margin: 0; line-height: 1.7; }
.cp-h { font: 500 1.3rem/1.2 var(--serif); margin: 14px 0 0; }
.cp-k { margin: 0 0 10px; font: 700 .7rem/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.cp-b { padding: 20px 22px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); line-height: 1.65; }
.cp-b > div > p:last-child, .cp-b p:last-child { margin-bottom: 0; }
.cp-case { background: rgba(255, 255, 255, .055); border-color: rgba(255, 255, 255, .14); font-size: 1.05rem; }
.cp-idea { border-color: rgba(140, 180, 255, .25); background: rgba(120, 160, 255, .05); }
.cp-idea .cp-k { color: #a9c3ff; }
.cp-method ol { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.cp-coach { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; border-style: dashed; }
.cp-coach-lumo { width: 64px; height: 64px; }
.cp-trap .cp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; }
.cp-wrong, .cp-right { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 12px 14px; border-radius: 12px; }
.cp-wrong { background: rgba(255, 120, 100, .08); } .cp-wrong > span { color: #ff9b8a; font-weight: 700; }
.cp-right { background: rgba(120, 220, 160, .08); } .cp-right > span { color: #8fe0b0; font-weight: 700; }
.cp-teacher { border-color: rgba(214, 140, 255, .3); background: rgba(200, 130, 255, .05); } .cp-teacher .cp-k { color: #d9a6ff; }
.cp-tw { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.cp-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.cp-table th { text-align: left; font: 600 .75rem/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cp-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cp-table tr:last-child td { border-bottom: 0; }
.fr { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; font-size: .82em; line-height: 1.05; margin: 0 .12em; }
.fr > span:first-child { border-bottom: 1px solid currentColor; padding: 0 .2em; }

/* Worked example, revealed line by line */
.cp-think-rows { display: grid; gap: 2px; margin-bottom: 12px; }
.cp-think-r { display: grid; grid-template-columns: 1fr 1.2fr; gap: 14px; padding: 10px 12px; border-radius: 10px; }
.cp-think-r:not(.head) { opacity: 0; max-height: 0; padding-block: 0; overflow: hidden; transition: opacity .4s, max-height .4s, padding .3s; }
.cp-think-r.in { opacity: 1; max-height: 300px; padding-block: 10px; background: rgba(255, 255, 255, .03); }
.cp-think-r.head { font: 600 .72rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.cp-think-r .t { color: var(--muted); font-style: italic; }

/* Activities */
.cp-ex { display: grid; gap: 14px; }
.cp-q-meta { display: flex; gap: 10px; align-items: center; }
.cp-q-meta:empty { display: none; }
.cp-stars { color: var(--gold); letter-spacing: .1em; font-size: .85rem; }
.cp-tag { font-size: .72rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.cp-q-t { font-size: 1.04rem; }
.cp-ans { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cp-in, .cp-ta, .cp-sel { background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .16); border-radius: 12px; color: var(--ink); font: 500 1.05rem/1.4 var(--sans); padding: 12px 14px; }
.cp-in { width: 170px; }
.cp-ta { width: 100%; resize: vertical; font-size: 1rem; }
.cp-in:focus, .cp-ta:focus, .cp-sel:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 217, 138, .16); }
.cp-in.ok { border-color: #8fe0b0; color: #c9f5da; }
.cp-in.shake { animation: cp-shake .35s; }
@keyframes cp-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.cp-unit { color: var(--muted); }
.btn.sm { padding: 11px 18px; font-size: .92rem; }
.cp-fb:empty { display: none; }
.cp-fb { padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .04); color: var(--ink); animation: cp-in .3s ease both; }
.cp-fb.good { background: rgba(120, 220, 160, .09); border: 1px solid rgba(120, 220, 160, .22); }
.cp-fb.bad { background: rgba(255, 170, 90, .07); border: 1px solid rgba(255, 170, 90, .2); }
@keyframes cp-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.cp-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cp-chip { border: 1px solid rgba(255, 217, 138, .35); background: rgba(255, 217, 138, .06); color: var(--gold); border-radius: 999px; padding: 8px 14px; font: 500 .88rem/1 var(--sans); cursor: pointer; }
.cp-chip.ghost { border-color: var(--line); background: none; color: var(--muted); }
.cp-chip:hover { background: rgba(255, 217, 138, .12); }
.cp-chip.on, .cp-chip[aria-pressed="true"] { background: var(--gold); color: #1a1205; border-color: var(--gold); }
.cp-chip.bad { box-shadow: 0 0 0 2px #ff9b8a; }
.cp-hints { display: grid; gap: 8px; margin-top: 8px; }
.cp-hints:empty { display: none; }
.cp-hint { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 217, 138, .05); animation: cp-in .3s ease both; }
.cp-hint > span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 700 .75rem/1 var(--sans); background: rgba(255, 217, 138, .2); color: var(--gold); }
.cp-sol { margin: 0; padding: 12px 14px 12px 34px; border-radius: 10px; background: rgba(120, 220, 160, .06); display: grid; gap: 4px; animation: cp-in .3s ease both; }
.cp-opts, .cp-lines { display: grid; gap: 8px; }
.cp-opt, .cp-line { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; text-align: left; width: 100%; padding: 12px 14px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .02); color: var(--ink); font: 400 1rem/1.5 var(--sans); transition: border-color .2s, background .2s; }
.cp-opt:hover:not(:disabled), .cp-line:hover:not(:disabled) { border-color: rgba(255, 217, 138, .35); }
.cp-opt:disabled, .cp-line:disabled { cursor: default; }
.cp-opt-l, .cp-line-n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font: 700 .78rem/1 var(--sans); background: rgba(255, 255, 255, .07); color: var(--muted); }
.cp-opt.ok, .cp-line.no { border-color: rgba(120, 220, 160, .5); background: rgba(120, 220, 160, .08); }
.cp-opt.no, .cp-line.fine { border-color: rgba(255, 155, 138, .4); opacity: .75; }
.cp-line { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 1.02rem; }
.cp-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.cp-tool { border-radius: 999px; padding: 8px 14px; font: 600 .85rem/1 var(--sans); cursor: pointer; border: 1px solid; background: none; }
.r-v { color: #ffd98a; border-color: rgba(255, 217, 138, .45); } .r-d { color: #9fd0ff; border-color: rgba(159, 208, 255, .45); }
.r-c { color: #f2a6ff; border-color: rgba(242, 166, 255, .45); } .r-x { color: #a7aec4; border-color: rgba(167, 174, 196, .45); }
.cp-tool.on { color: #0b1230; } .cp-tool.r-v.on { background: #ffd98a; } .cp-tool.r-d.on { background: #9fd0ff; } .cp-tool.r-c.on { background: #f2a6ff; } .cp-tool.r-x.on { background: #a7aec4; }
.cp-tagtext { font-size: 1.12rem; line-height: 2.1; margin: 0; text-align: left; word-spacing: normal; }
.cp-chunk { cursor: pointer; border-radius: 6px; padding: 2px 3px; transition: background .15s; border-bottom: 1px dashed rgba(255, 255, 255, .22); }
.cp-chunk.plain { border-bottom-color: transparent; }
.cp-chunk:hover { background: rgba(255, 255, 255, .06); }
.cp-chunk:focus-visible { outline: 2px solid var(--gold); }
.cp-chunk[data-role="v"] { background: rgba(255, 217, 138, .22); box-shadow: inset 0 -2px #ffd98a; border-radius: 999px; padding: 2px 8px; }
.cp-chunk[data-role="d"] { background: rgba(159, 208, 255, .16); box-shadow: inset 0 -2px #9fd0ff; }
.cp-chunk[data-role="c"] { background: rgba(242, 166, 255, .14); outline: 1.5px solid #f2a6ff; }
.cp-chunk[data-role="x"] { text-decoration: line-through; opacity: .55; }
.cp-chunk.miss { box-shadow: 0 0 0 2px #ff9b8a !important; }
.cp-order { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: o; }
.cp-order li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font-family: ui-monospace, Menlo, monospace; counter-increment: o; }
.cp-order li::before { content: counter(o); color: var(--faint); font: 700 .8rem var(--sans); width: 16px; }
.cp-order li.bad { border-color: rgba(255, 155, 138, .45); }
.cp-order-t { flex: 1; }
.cp-order-b { display: flex; gap: 4px; }
.cp-order-b button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--ink); cursor: pointer; font-size: 1rem; }
.cp-order-b button:disabled { opacity: .3; cursor: default; }
.cp-match { display: grid; gap: 10px; }
.cp-match-r { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 12px; border: 1px solid transparent; }
.cp-match-r.ok { border-color: rgba(120, 220, 160, .4); } .cp-match-r.bad { border-color: rgba(255, 155, 138, .35); }
.cp-sel { width: 100%; font-size: .95rem; padding: 10px 12px; }
.cp-mem-text { position: relative; padding: 16px 18px; border-radius: 12px; background: rgba(255, 255, 255, .05); font-size: 1.05rem; }
.cp-count { position: absolute; top: -12px; right: 12px; min-width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #1a1205; font-weight: 700; }
.cp-timer { --p: 0%; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; grid-auto-flow: column; gap: 2px;
  background: conic-gradient(var(--gold) var(--p), rgba(255, 255, 255, .08) 0); position: relative; }
.cp-timer::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--night); }
.cp-timer > * { position: relative; } .cp-timer b { font: 600 1.4rem/1 var(--serif); } .cp-timer span { color: var(--faint); font-size: .8rem; }
.cp-model { padding: 14px 16px; border-radius: 12px; background: rgba(120, 220, 160, .05); border: 1px solid rgba(120, 220, 160, .18); animation: cp-in .3s ease both; }
.cp-model > div { margin-bottom: 12px; }
.cp-saved { color: var(--faint); font-size: .8rem; }
.cp-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.cp-flash { display: grid; gap: 10px; align-content: start; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .025); min-height: 120px; }
.cp-card-q { font: 500 1.05rem/1.4 var(--serif); }
.cp-card-a { color: var(--muted); animation: cp-in .3s ease both; }
.cp-check ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.cp-check label { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; cursor: pointer; }
.cp-check input { width: 20px; height: 20px; accent-color: #ffb547; margin-top: 3px; }
.cp-rule { color: var(--muted); font-size: .92rem; margin-top: 12px !important; }
.cp-jr { display: grid; gap: 8px; margin-top: 10px; color: var(--muted); }
.cp-bars svg { width: 100%; height: auto; max-width: 600px; }
.cp-bars rect.on { fill: #ffb547; } .cp-bars rect.off { fill: rgba(255, 255, 255, .08); }
.cp-bars text { fill: var(--ink); font: 600 16px var(--sans); }
.cp-cap { color: var(--muted); font-size: .92rem; margin: 8px 0 0; }
.cp-next { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }

/* Gate */
.cp-gate { max-width: 640px; }
.cp-gate-card { margin-top: 22px; padding: 26px; border-radius: var(--radius); border: 1px solid rgba(255, 217, 138, .3); background: var(--card); box-shadow: 0 30px 80px -40px rgba(255, 170, 60, .35); }
.cp-gate-card h2 { font: 500 1.5rem/1.2 var(--serif); margin: 0 0 8px; }
.cp-gate-card p { color: var(--muted); margin: 0 0 14px; }
.cp-gate-list { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 6px; color: var(--muted); font-size: .92rem; }
.cp-review .cp-cards { margin-top: 18px; }

@media (max-width: 760px) {
  .cp { padding: 96px 16px 60px; }
  .cp-hero { grid-template-columns: 1fr; }
  .cp-hero-lumo { display: none; }
  .cp-missions { grid-template-columns: 1fr; }
  .cp-tabs { top: 58px; margin: 0 -16px; padding: 0 16px 4px; }
  .cp-tab-l { display: none; }
  .cp-tabs a { padding: 9px 13px; }
  .cp-tabs a.on .cp-tab-l { display: inline; }
  .cp-b { padding: 16px; }
  .cp-trap .cp-cols, .cp-cards, .cp-match-r, .cp-think-r { grid-template-columns: 1fr; }
  .cp-think-r .t { padding-left: 10px; border-left: 2px solid var(--line); }
  .cp-think-r.head { display: none; }
  .cp-table thead { display: none; }
  .cp-table tr { display: grid; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .cp-table td { border: 0; padding: 3px 14px; }
  .cp-table td::before { content: attr(data-h); display: block; font: 600 .68rem/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
  .cp-next { flex-direction: column-reverse; }
  .cp-next .btn { justify-content: center; }
  .cp-in { flex: 1; min-width: 0; }
  .cp-coach { grid-template-columns: 1fr; }
  .cp-coach-lumo { width: 48px; height: 48px; }
}
@media (prefers-reduced-motion: reduce) { .cp *, .cp *::before { animation: none !important; transition: none !important; } }
button.btn-ghost { background: transparent; font: inherit; cursor: pointer; }

/* ---------- Generated companions: the book's own blocks, in the night palette ---------- */
.cp-html { line-height: 1.7; overflow-wrap: anywhere; }
.cp-html > :first-child { margin-top: 0; }
.cp-html > :last-child { margin-bottom: 0; }
.cp-html h2 { font: 500 1.45rem/1.25 var(--serif); margin: 30px 0 12px; }
.cp-html h3 { font: 600 1.08rem/1.35 var(--sans); margin: 22px 0 8px; }
.cp-html p { margin: 0 0 12px; }
.cp-html ul, .cp-html ol { padding-left: 1.3em; margin: 0 0 12px; }
.cp-html li { margin: 4px 0; }
.cp-html strong { color: var(--ink); font-weight: 650; }
.cp-html mark { background: rgba(255, 196, 92, .2); color: inherit; padding: 0 3px; border-radius: 3px; }
.cp-html .gap { display: inline-block; width: 1.6em; }
.cp-html .blank { display: inline-block; min-width: 3em; border-bottom: 1.5px solid var(--faint); margin: 0 3px; transform: translateY(-3px); }
.cp-html .box { display: inline-block; width: .9em; height: .9em; border: 1.5px solid var(--faint); border-radius: 3px; vertical-align: -.1em; }
.cp-html .box.on { background: var(--gold); border-color: var(--gold); }
.cp-html svg.ic { width: 1.1em; height: 1.1em; vertical-align: -.18em; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.cp-html svg.ic-echauffe, .cp-html svg.ic-star { fill: currentColor; stroke: none; }
.cp-html .stars, .cp-q-meta .stars { display: inline-flex; gap: 2px; color: var(--gold); }
.cp-html .stars .off { color: rgba(255, 255, 255, .2); }
.cp-html .katex { font-size: 1.08em; }
.cp-html .katex-display { margin: 10px 0; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.tx:not(.done) { font-family: var(--mono, ui-monospace, monospace); font-size: .9em; color: var(--muted); }
/* tables */
.cp-html table.tb { width: 100%; border-collapse: collapse; margin: 6px 0 16px; font-size: .95rem; display: block; overflow-x: auto; }
.cp-html table.tb th { text-align: left; font: 700 .72rem/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.cp-html table.tb td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
/* boxes */
.cp-html .b { margin: 18px 0; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .025); }
.cp-html .bt { font: 700 .72rem/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 0 0 10px; display: flex; gap: 8px; align-items: center; }
.cp-html .b.idea { border: 0; border-left: 3px solid var(--gold); border-radius: 0 14px 14px 0; background: rgba(255, 196, 92, .06); }
.cp-html .b.key { border-color: rgba(255, 196, 92, .35); display: grid; grid-template-columns: 26px 1fr; gap: 10px; }
.cp-html .b.key > svg.ic { color: var(--gold); width: 22px; height: 22px; }
.cp-html .b.method { border-color: rgba(255, 255, 255, .16); }
.cp-html .b.method ol { list-style: none; padding: 0; counter-reset: st; }
.cp-html .b.method ol > li { counter-increment: st; position: relative; padding-left: 40px; margin: 0 0 12px; min-height: 28px; }
.cp-html .b.method ol > li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: #1a1205; font: 800 .82rem/28px var(--sans); text-align: center; }
.cp-html .b.example { background: rgba(120, 160, 255, .05); border-color: rgba(120, 160, 255, .22); }
.cp-html .b.example > .bt { color: #a9c1ff; }
.cp-html .think table.tb td:last-child { font-style: italic; color: var(--muted); }
.cp-html .think table.tb tr[hidden] { display: none; }
.cp-html .think + .cp-chips, .cp-html .cp-chips { margin: 4px 0 6px; }
.cp-html .b.trap { border-color: rgba(255, 128, 102, .35); }
.cp-html .b.trap > .bt { color: #ff9c86; }
.cp-html .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; }
.cp-html .wrong, .cp-html .right { border-radius: 12px; padding: 12px 14px; }
.cp-html .wrong { background: rgba(255, 110, 90, .08); border: 1px solid rgba(255, 110, 90, .25); }
.cp-html .right { background: rgba(80, 210, 140, .07); border: 1px solid rgba(80, 210, 140, .25); }
.cp-html .wrong .tag, .cp-html .right .tag { display: block; font: 700 .68rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px; }
.cp-html .wrong .tag { color: #ff9c86; } .cp-html .right .tag { color: #7fe0a8; }
.cp-html .b.lumo-say { display: grid; grid-template-columns: 56px minmax(0, 1fr); max-width: 100%; position: static; transform: none; opacity: 1; font: inherit; color: inherit; text-shadow: none; white-space: normal; pointer-events: auto; /* resets the homepage .lumo-say from hub.css */ gap: 14px; align-items: start; border: 0; background: none; padding: 0; }
.cp-html .b.lumo-say img.lumo, .cp-html .b.lumo-say svg.glow { width: 56px; height: 56px; }
.cp-html .b.lumo-say .bubble { padding: 16px 18px; border-radius: 16px; border: 1px solid rgba(255, 196, 92, .28); background: rgba(255, 196, 92, .06); }
.cp-html .b.plain, .cp-html .b.note, .cp-html .b.goal { background: rgba(255, 255, 255, .03); }
.cp-html .b.script, .cp-html .prof { border-color: rgba(214, 140, 255, .3); background: rgba(200, 130, 255, .05); }
.cp-html .prof { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 16px 18px; border-radius: 14px; border: 1px solid; margin: 16px 0; }
.cp-html .chip, .cp-tag { display: inline-block; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--line); font: 600 .72rem/1.6 var(--sans); color: var(--muted); }
.cp-html .seq, .cp-html .seqs .seq { display: inline-block; padding: 1px 8px; border-radius: 99px; font: 700 .68rem/1.6 var(--sans); background: rgba(255, 255, 255, .08); margin-right: 4px; }
/* course badges: maths sequences (CST, TS, SN) and science courses (ST, EST, chemistry, physics), as in the printed books */
.cp-html .seq.s-cst { background: rgba(46, 125, 107, .55); } .cp-html .seq.s-ts { background: rgba(47, 90, 134, .6); } .cp-html .seq.s-sn { background: rgba(122, 63, 143, .55); }
.cp-html .seq.s-st { background: rgba(47, 111, 143, .6); } .cp-html .seq.s-ste { background: rgba(181, 86, 43, .6); }
.cp-html .seq.s-chi { background: rgba(46, 125, 91, .6); } .cp-html .seq.s-phy { background: rgba(74, 79, 163, .65); }
.cp-html .b.seqbox { border-left: 3px solid rgba(255, 255, 255, .25); }
.cp-html .b.seqbox.s-cst { border-left-color: #3fa88f; } .cp-html .b.seqbox.s-ts { border-left-color: #4f86bf; } .cp-html .b.seqbox.s-sn { border-left-color: #a865c0; }
.cp-html .b.seqbox.s-st { border-left-color: #4d9cc4; } .cp-html .b.seqbox.s-ste { border-left-color: #d9733f; }
.cp-html .b.seqbox.s-chi { border-left-color: #43a878; } .cp-html .b.seqbox.s-phy { border-left-color: #7c82d9; }
.cp-html .seqhead { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; } .cp-html .seqt { font-weight: 700; }
/* figures are drawn for paper: they sit on a light card */
.cp-html figure { margin: 18px 0; padding: 16px; border-radius: 14px; background: #fbfaf6; color: #1b2033; text-align: center; overflow-x: auto; }
.cp-html figure svg { max-width: 100%; height: auto; }
.cp-html figure.small svg { max-width: 62%; }
.cp-html figcaption { margin-top: 8px; font-size: .85rem; color: #555b70; }
.cp-html figure .katex { color: #1b2033; }
.cp-html .lumo-inline { display: none; }
/* exercises from the book */
.cp-bookex .cp-q-meta { flex-wrap: wrap; }
.cp-ex-l { font: 700 .72rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.cp-ex-t { font-weight: 600; color: var(--ink); }
.cp-bookex.k-game .cp-ex-l { color: #8fd4ff; }
.cp-bookex.k-warm .cp-ex-l { color: #ffb38a; }
.cp-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 8px; }
.cp-steps:empty { display: none; }
.cp-steps li { counter-increment: s; position: relative; padding: 10px 14px 10px 44px; border-radius: 12px; background: rgba(80, 210, 140, .06); border: 1px solid rgba(80, 210, 140, .2); animation: cp-in .35s ease both; }
.cp-steps li::before { content: counter(s); position: absolute; left: 12px; top: 10px; width: 22px; height: 22px; border-radius: 50%; background: rgba(80, 210, 140, .25); color: #bff0d3; font: 700 .75rem/22px var(--sans); text-align: center; }
.cp-steps li > :last-child { margin-bottom: 0; }
.cp-rate .cp-k { margin-top: 4px; }
.cp-m.review .cp-m-n { color: var(--gold); }
@keyframes cp-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  .cp-html .cols { grid-template-columns: 1fr; }
  .cp-html .b { padding: 16px; }
  .cp-html .b.lumo-say { grid-template-columns: 40px minmax(0, 1fr); gap: 10px; }
  .cp-html .b.lumo-say img.lumo { width: 40px; height: 40px; }
  .cp-html table.tb { font-size: .88rem; }
  .cp-html table.tb td, .cp-html table.tb th { padding: 8px; }
}
/* the five years */
.cp-lib .btns { margin-bottom: 8px; }
.cp-lib-sub { margin-top: 34px; } .cp-lib-sub h2 { font: 500 1.5rem/1.2 var(--serif); margin: 0; }
.cp-lib-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; margin: 18px 0 8px; }
.cp-lib-card { display: grid; gap: 6px; text-decoration: none; color: var(--ink); }
.cp-lib-card img { width: 100%; height: auto; aspect-ratio: 900 / 1165; border-radius: 6px; box-shadow: 0 18px 40px rgba(0, 0, 0, .5); transition: transform .35s cubic-bezier(.2, .7, .2, 1); margin-bottom: 8px; }
.cp-lib-card:hover img { transform: translateY(-5px); }
.cp-lib-y { font: 500 1.15rem/1.2 var(--serif); }
.cp-lib-s { font-size: .82rem; color: var(--faint); }
@media (max-width: 820px) { .cp-lib-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
/* figure drawing classes (engine/figures.py), as in the printed book */
.cp-html figure { --fi: #161c34; --fl: #d9822a; --fls: #fdf1e1; --fli: #8a4d06; --fn: #141d47; --fs: #7a819c; }
.cp-html svg.fig { display: block; max-width: 100%; height: auto; margin: 0 auto; overflow: visible; }
.cp-html .f-ink { stroke: var(--fi); fill: none; } .cp-html .f-soft { stroke: #9aa0b8; fill: none; } .cp-html .f-grid { stroke: #e3e6ee; fill: none; }
.cp-html .f-edge { stroke: #b8bdd0; fill: none; } .cp-html .f-acc { stroke: var(--fl); fill: none; } .cp-html .f-acc2 { stroke: var(--fn); fill: none; }
.cp-html .f-acc-fill { fill: color-mix(in srgb, var(--fl) 70%, white); } .cp-html .f-acc-soft { fill: var(--fls); } .cp-html .f-acc2-fill { fill: var(--fn); }
.cp-html .f-acc2-soft { fill: #eef0f7; } .cp-html .f-ink-fill { fill: var(--fi); } .cp-html .f-soft-fill { fill: #e9ebf2; } .cp-html .f-paper-fill { fill: #fff; }
.cp-html .none-stroke { stroke: none; }
.cp-html .t-ink { fill: var(--fi); } .cp-html .t-soft { fill: var(--fs); } .cp-html .t-acc { fill: var(--fli); } .cp-html .t-acc2 { fill: var(--fn); } .cp-html .t-paper { fill: #fff; }
.cp-html .t-lv1 { fill: #e8932a; } .cp-html .t-lv2 { fill: #2f67d8; } .cp-html .t-lv3 { fill: #0f9488; } .cp-html .t-lv4 { fill: #7357e8; } .cp-html .t-lv5 { fill: #e2573a; } .cp-html .t-lv6 { fill: #1f8f55; }
.cp-html figure figcaption { font-style: italic; }
.cp-ans-multi { flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.cp-part { display: inline-flex; align-items: center; gap: 6px; }
.cp-part-l { font-weight: 700; color: var(--muted); }
.cp-part .cp-in { width: 120px; }
.cp-in.bad { border-color: rgba(255, 120, 100, .6); }
.cp [hidden] { display: none !important; }
.cp .tx:not(.d) .katex { white-space: normal; } /* long inline formulas wrap between terms on phones */
.cp .tx.d { display: block; max-width: 100%; overflow-x: auto; overflow-y: hidden; }
.cp-html .b.plain, .cp-html .tx.d { max-width: 100%; overflow-x: auto; overflow-y: hidden; } /* a long worked line scrolls instead of widening the page */
