/* InternDoor: coding practice, /problems and /problems/<slug> (17 Nov 2026). Hand-committed; loaded by CODE_ASSETS
   in src/pages.js and nowhere else. Classes ck-* (shared pieces, the /problems list cki-*) and cw-* (the workspace).
   The careers pages use cx-*: never reuse that prefix here. */
/* Editor colours (CodeMirror reads only these), difficulty pips, statement pieces, buttons. */
:root {
  --cm-bg: var(--card);
  --cm-ink: var(--ink-15);
  --cm-caret: var(--ink);
  --cm-gutter: #5d5d66;
  --cm-sel: rgba(200, 255, 0, .16);
  --cm-line: rgba(255, 255, 255, .03);
  --cm-match: rgba(255, 255, 255, .1);
  --cm-kw: #f4f4f5;
  --cm-str: #d8c48d;
  --cm-num: #f3a683;
  --cm-com: #7d7d87;
  --cm-fn: #93cff0;
  --cm-type: #e7aec6;
  --cm-prop: #c9d4dc;
  --cm-punct: #a1a1aa;
  --cm-bad: var(--hot);
}
:root[data-theme="light"] {
  --cm-gutter: #a1a1aa;
  --cm-sel: rgba(74, 97, 0, .16);
  --cm-line: rgba(9, 9, 11, .03);
  --cm-match: rgba(9, 9, 11, .08);
  --cm-kw: #09090b;
  --cm-str: #7a5c00;
  --cm-num: #b4410c;
  --cm-com: #71717a;
  --cm-fn: #0b5d86;
  --cm-type: #9d2a5c;
  --cm-prop: #3f3f46;
  --cm-punct: #52525b;
}
.ck { color: var(--ink); }
.ck code { font-family: var(--mono); font-size: .875em; }

/* Difficulty: three pips, one to three filled. Never colour-coded red: --hot means errors only. */
.ck-pips { display: inline-flex; align-items: center; gap: 3px; font-size: var(--t-micro); color: var(--ink-2); }
.ck-pips i { width: 6px; height: 6px; border-radius: 50%; background: var(--rule-2); }
.ck-pips[data-level="1"] i:nth-child(-n+1), .ck-pips[data-level="2"] i:nth-child(-n+2), .ck-pips[data-level="3"] i:nth-child(-n+3) { background: var(--ink-15); }
.ck-pips b { font-weight: 500; margin-left: 5px; }

.ck-reported { margin: 0; font-size: var(--t-small); color: var(--ink-2); }
.ck-reported a { color: inherit; }
.ck-sources { margin-top: var(--s5); font-size: var(--t-small); color: var(--ink-2); }
.ck-sources summary { cursor: pointer; color: var(--ink-15); }
.ck-sources ul { margin: var(--s2) 0; padding-left: 1.1em; }
.ck-sources a { color: var(--ink-15); }

.ck-statement p { margin: 0 0 var(--s3); font-size: var(--t-body); line-height: var(--t-body-lh); max-width: 68ch; text-wrap: pretty; }
.ck-statement code, .ck-ex code, .ck-cons code { background: var(--card-2); border-radius: 6px; padding: .08em .35em; }
.ck-ex { margin: var(--s4) 0; padding: var(--s3) var(--s4); background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-2); }
.ck-ex figcaption { font-size: var(--t-small); font-weight: 600; margin-bottom: var(--s2); }
.ck-ex dl, .ck-case dl { margin: 0; display: grid; gap: var(--s2); }
.ck-ex dl > div, .ck-case dl > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--s3); }
.ck-ex dt, .ck-case dt { font-size: var(--t-small); color: var(--ink-2); }
.ck-ex dd, .ck-case dd { margin: 0; overflow-wrap: anywhere; }
.ck-ex code, .ck-case code { background: none; padding: 0; }
.ck-ex p { margin: var(--s2) 0 0; font-size: var(--t-small); color: var(--ink-2); }
.ck-cons { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; font-size: var(--t-small); }
.ck-hint { margin-top: var(--s2); font-size: var(--t-small); }
.ck-hint summary { cursor: pointer; color: var(--ink-15); }
.ck-hint p { margin: var(--s2) 0 0; color: var(--ink-2); }

/* Buttons the designs share */
.ck-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--rule-2); background: var(--card-2); color: var(--ink); font: 500 .875rem var(--ui); cursor: pointer; transition: border-color .16s, background .16s, transform var(--d-press) var(--snap); }
@media (hover: hover) { .ck-btn:hover { border-color: var(--ink-3); } }
.ck-btn:active { transform: scale(.97); }
.ck-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.ck-btn.is-cta { background: var(--cta); color: var(--cta-ink); border-color: transparent; font-weight: 600; }
@media (hover: hover) { .ck-btn.is-cta:hover { filter: brightness(1.06); } }
.ck-btn[aria-busy="true"] { pointer-events: none; opacity: 1; }
.ck-btn[aria-busy="true"]::after { content: ''; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: ck-spin .7s linear infinite; }
@keyframes ck-spin { to { transform: rotate(360deg); } }
.ck-kbd { font: .6875rem var(--mono); color: inherit; opacity: 1; border: 1px solid currentColor; border-radius: 5px; padding: 1px 4px; }
.ck-btn .ck-kbd { border-color: color-mix(in srgb, currentColor 40%, transparent); }
.ck-select { height: 36px; padding: 0 30px 0 12px; border-radius: var(--r-pill); border: 1px solid var(--rule-2); background: var(--card-2); color: var(--ink); font: 500 .875rem var(--ui); appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 15px) 16px, calc(100% - 10px) 16px; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }
.ck-input { width: 100%; min-height: 84px; padding: var(--s3); border-radius: var(--r); border: 1px solid var(--rule-2); background: var(--card); color: var(--ink); font: .875rem/1.5 var(--mono); resize: vertical; }
.ck-input:focus-visible, .ck-select:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.ck .cm-scroller { scrollbar-width: thin; scrollbar-color: var(--rule-2) transparent; }

/* The coding workspace (his pick, 17 Nov 2026: "workbench and focus both, give the user option to choose"). One page,
   two layouts the reader switches between and keeps: Split (problem | code, console under the code) and Focus (the
   code is the page, the problem a glass card you put away). Glass only on what floats over the code: the tool bar,
   the dock, the result panel, the problem card, menus. Motion: the layout morphs (view transition, names worn only
   while it runs), results rise, Accepted counts up and draws its tick. Classes cw-*. */
.ck-w { padding: 0; }
body:has(.ck-w) .foot, body:has(.ck-w) .outro { display: none; }

.cw {
  --cw-doc: 44%; --cw-con: 250px; --cw-brief: 440px; --cw-top: 66px; --cw-low: 28px;
  position: relative; height: calc(100dvh - var(--bar-h)); overflow: hidden; background: var(--bg); color: var(--ink);
}
.cw[data-layout="focus"] { --cw-top: 70px; --cw-low: 104px; background: var(--cm-bg); }

/* ---------- glass: a real layer under the content, never on the element that moves or fades ---------- */
.cw-glass {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: var(--lg-panel);
  -webkit-backdrop-filter: blur(14px) saturate(var(--lg-sat)); backdrop-filter: blur(14px) saturate(var(--lg-sat));
  box-shadow: inset 0 0 0 .5px var(--lg-rim), inset 1px 1.5px 0 -.5px var(--lg-hi), var(--lg-shade);
}
html.cw-bends .cw-glass.is-bent { -webkit-backdrop-filter: var(--cw-f,) blur(5px) saturate(var(--lg-sat)); backdrop-filter: var(--cw-f,) blur(5px) saturate(var(--lg-sat)); }
.cw-float > :not(.cw-glass) { position: relative; }

/* ---------- company crests (the logo over its initials, like the site's crest) ---------- */
.cw-crest {
  position: relative; flex: none; width: 28px; height: 28px; border-radius: 7px; overflow: hidden;
  display: grid; place-items: center; background: var(--card-2); color: var(--ink-2); font: 600 10px/1 var(--ui);
  box-shadow: 0 0 0 1px var(--rule);
}
.cw-crest img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.cw-stack { display: inline-flex; align-items: center; flex: none; }
.cw-stack .cw-crest { width: 22px; height: 22px; border-radius: 6px; font-size: 8px; box-shadow: 0 0 0 2px var(--cw-ring, var(--bg)); }
.cw-stack .cw-crest + .cw-crest { margin-left: -6px; }
.cw-stack .cw-crest:nth-child(1) { z-index: 3; } .cw-stack .cw-crest:nth-child(2) { z-index: 2; }
.cw-stack .cw-more { margin-left: 6px; font: 500 var(--t-micro) var(--ui); color: var(--ink-2); font-variant-numeric: tabular-nums; }

.cw-asked { margin: 2px 0 var(--s5); }
.cw-asked-t { margin: 0 0 var(--s2); font-size: var(--t-small); color: var(--ink-2); }
.cw-asked-t a { color: inherit; }
.cw-cos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cw-co {
  display: inline-flex; align-items: center; gap: 9px; padding: 4px 12px 4px 4px; border-radius: 11px;
  background: var(--card); border: 1px solid var(--rule); font-size: var(--t-small); font-weight: 500; color: var(--ink);
  animation: cw-rise .42s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms + 80ms);
}
.cw-co small { font-size: var(--t-micro); color: var(--ink-2); font-weight: 400; }
@keyframes cw-rise { from { opacity: 0; transform: translateY(6px); } }

/* ---------- the problem ---------- */
.cw-doc { position: relative; min-height: 0; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.cw-doc > .cw-glass { display: none; }
.cw-doc-head { position: relative; flex: none; padding: 20px 28px 0; }
.cw-doc-body { position: relative; padding: 4px 28px 64px; }
.cw-handle { display: none; }
.cw-crumbs { display: flex; align-items: center; gap: 6px; font-size: var(--t-small); color: var(--ink-2); min-height: 32px; }
.cw-crumbs a { color: var(--ink-2); text-decoration: none; }
@media (hover: hover) { .cw-crumbs a:hover { color: var(--ink); } }
.cw-title-row { display: flex; align-items: flex-start; gap: var(--s3); }
.cw-title-row h1 { flex: 1; min-width: 0; }
.cw-pill.cw-hide { display: none; flex: none; margin-top: 4px; }
.cw[data-layout="focus"] .cw-pill.cw-hide { display: inline-flex; background: var(--lg-pill); }
.cw-doc h1 { margin: var(--s2) 0 var(--s3); font: 600 1.75rem/1.15 var(--display); letter-spacing: -.025em; text-wrap: balance; }
.cw-meta { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); font-size: var(--t-small); color: var(--ink-2); }
.cw-doc-body h2 { margin: var(--s5) 0 var(--s2); font: 600 var(--t-title)/1.3 var(--display); letter-spacing: -.01em; }
.cw-next { display: flex; justify-content: space-between; gap: var(--s3); margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--rule); font-size: var(--t-small); }
.cw-next a { color: var(--ink-15); text-decoration: none; }
@media (hover: hover) { .cw-next a:hover { color: var(--ink); } }

/* ---------- buttons on glass ---------- */
.cw-pill {
  display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--ink);
  font: 500 .8125rem var(--ui); padding: 8px 12px; border-radius: var(--r-pill); cursor: pointer; white-space: nowrap;
  transition: background-color .16s, scale .14s var(--snap);
}
.cw-pill[aria-expanded="true"] { background: var(--lg-pill); }
@media (hover: hover) { .cw-pill:hover { background: var(--lg-hover); } .cw-pill[aria-expanded="true"]:hover { background: var(--lg-pill); } }
.cw-pill:active { scale: .96; }
.cw-pill:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.cw-pill.is-quiet { color: var(--ink-2); }
.cw-chev::after { content: ''; display: inline-block; width: 6px; height: 6px; margin: 0 2px 0 2px; border-right: 1.5px solid var(--ink-2); border-bottom: 1.5px solid var(--ink-2); transform: translateY(-2px) rotate(45deg); transition: transform .2s var(--ease-out); }
[aria-expanded="true"] > .cw-chev::after { transform: translateY(1px) rotate(225deg); }
.cw-sep { width: 1px; height: 18px; background: var(--lg-rim); margin: 0 3px; flex: none; }

/* The layout switch: the site's tab well, and glass.js lays its spring lens in (IDGlass.tabs). */
.cw-seg { position: relative; display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--lg-well); box-shadow: inset 0 0 0 .5px var(--lg-rim); flex: none; }
.cw-seg > [role="tab"] { position: relative; border: 0; background: none; color: var(--ink-2); padding: 6px 12px; border-radius: var(--r-pill); font: 500 .8125rem var(--ui); cursor: pointer; white-space: nowrap; transition: color .2s var(--ease-out), scale .35s var(--spring); }
.cw-seg:not(.has-ind) > [aria-selected="true"] { background: var(--lg-pill); }
.cw-seg > [aria-selected="true"] { color: var(--ink); }
.cw-seg > [role="tab"]:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

/* ---------- the code ---------- */
.cw-work { position: relative; min-height: 0; min-width: 0; }
.cw-editor { position: relative; min-height: 0; background: var(--cm-bg); }
.cw .cw-editor > .cm-editor { position: absolute; inset: 0; height: auto; }
.cw .cw-editor .cm-editor .cm-content { padding-top: var(--cw-top); padding-bottom: var(--cw-low); }

.cw-bar { position: absolute; z-index: 6; top: 10px; left: 10px; right: 10px; display: flex; align-items: center; gap: 4px; padding: 5px; min-height: 46px; border-radius: var(--r-pill); }
.cw-tools { display: flex; align-items: center; gap: 2px; min-width: 0; }
.cw-gap { flex: 1; }
.cw-act { display: flex; align-items: center; gap: 6px; flex: none; }
.cw-act .ck-btn { height: 36px; }
.cw-saved { font-size: var(--t-micro); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .2s; }
.cw-saved.is-on { opacity: 1; }

/* "Show the problem" in Focus once it is put away: the card folds into this pill (same view-transition name). */
.cw-show { display: none; position: absolute; z-index: 6; left: 12px; top: 12px; align-items: center; gap: 10px; padding: 5px 5px 5px 8px; border: 0; border-radius: var(--r-pill); color: var(--ink); font: 500 .8125rem var(--ui); cursor: pointer; max-width: calc(100% - 400px); min-height: 46px; --cw-ring: #1b1b1f; }
:root[data-theme="light"] .cw-show { --cw-ring: #f2f2f4; }
.cw-show-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-15); }
.cw-show b { font-weight: 500; background: var(--lg-pill); padding: 7px 12px; border-radius: var(--r-pill); white-space: nowrap; }
.cw-show:active { scale: .98; }
.cw-show:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- the console: test cases and results ---------- */
.cw-console { position: relative; min-height: 0; display: flex; flex-direction: column; background: var(--bg-2); }
.cw-console > .cw-glass { display: none; }
.cw-con-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px 8px; flex: none; }
.cw-sum { margin-left: auto; font-size: var(--t-small); color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-sum.is-good { color: var(--accent); }
.cw-sum.is-bad { color: var(--hot); }
.cw-cases-panel, .cw-out { flex: 1; min-height: 0; overflow: auto; padding: 2px 14px 18px; }
.cw-console[data-tab="cases"] .cw-out, .cw-console[data-tab="result"] .cw-cases-panel { display: none; }
.cw-out > .cw-glass, .cw-out-hide, .cw-dock-act { display: none; }
.cw-out-in { position: relative; }
.cw-out { position: relative; }

.cw-cases { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--s3); }
.cw-cases > button { border: 1px solid var(--rule-2); background: var(--card); color: var(--ink-2); padding: 6px 12px; border-radius: var(--r-pill); font: 500 .8125rem var(--ui); cursor: pointer; transition: color .16s, border-color .16s, background-color .16s, scale .14s var(--snap); }
.cw-cases > button[aria-checked="true"] { color: var(--ink); border-color: var(--ink-3); background: var(--card-2); }
.cw-cases > button:active { scale: .96; }
.cw-cases > button:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.cw-casebox { animation: cw-fade .2s var(--ease-out); }
.cw-dl { margin: 0; display: grid; gap: var(--s2); }
.cw-dl > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--s3); }
.cw-dl dt { font-size: var(--t-small); color: var(--ink-2); }
.cw-dl dd { margin: 0; overflow-wrap: anywhere; }
.cw-own { display: grid; gap: 6px; font-size: var(--t-small); color: var(--ink-2); }
.cw-empty { margin: 0; color: var(--ink-2); font-size: var(--t-small); }
@keyframes cw-fade { from { opacity: 0; } }

/* Waiting: an honest "running" line with a sweep (the judge answers in one piece, so no fake percentage). */
.cw-wait { display: grid; gap: 10px; padding: 4px 0; }
.cw-wait p { margin: 0; font-size: var(--t-small); color: var(--ink-15); }
.cw-sweep { position: relative; height: 3px; border-radius: 2px; background: var(--rule); overflow: hidden; }
.cw-sweep::after { content: ''; position: absolute; inset: 0; width: 38%; border-radius: inherit; background: linear-gradient(90deg, transparent, var(--ink-3), transparent); animation: cw-sweep 1.1s linear infinite; }
@keyframes cw-sweep { from { transform: translateX(-100%); } to { transform: translateX(270%); } }

/* ---------- a result ---------- */
.cw-res { display: grid; gap: var(--s3); }
.cw-res > * { animation: cw-rise .34s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms); }
.cw-vrow { display: flex; align-items: center; gap: 10px; }
.cw-vmark { width: 26px; height: 26px; flex: none; }
.cw-vmark circle { fill: none; stroke: currentColor; stroke-width: 2; opacity: .3; }
.cw-vmark path { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; animation: cw-draw .42s var(--ease-out) .14s forwards; }
@keyframes cw-draw { to { stroke-dashoffset: 0; } }
.cw-verdict { margin: 0; font: 600 1.25rem/1.2 var(--display); letter-spacing: -.015em; }
.cw-res.is-good .cw-vrow { color: var(--accent); }
.cw-res.is-bad .cw-vrow { color: var(--hot); }
.cw-res.is-bad .cw-vrow { animation: cw-rise .34s var(--ease-out) both, cw-nudge .36s var(--snap) .12s; }
@keyframes cw-nudge { 20% { transform: translateX(-4px); } 45% { transform: translateX(3px); } 70% { transform: translateX(-2px); } }
.cw-stats { margin: -4px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--t-small); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cw-stats b { color: var(--ink); font-weight: 600; }
.cw-meter { position: relative; height: 6px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.cw-meter i { position: absolute; inset: 0; border-radius: inherit; background: var(--ink-3); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); transition: transform .7s var(--ease-out); }
.cw-res.is-good .cw-meter i { background: var(--accent); }
.cw-note { margin: 0; font-size: var(--t-small); color: var(--ink-15); }
.cw-case { padding: var(--s3); border-radius: var(--r); background: var(--card); border: 1px solid var(--rule); }
.cw-case h4 { margin: 0 0 var(--s2); font-size: var(--t-small); font-weight: 600; }
.cw-mark { font-weight: 500; color: var(--accent); margin-left: 6px; }
.cw-mark.is-bad { color: var(--hot); }
.cw-pre { margin: 0; padding: var(--s3); background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); font: .8125rem/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; color: var(--ink-15); }
.cw-outx summary { cursor: pointer; font-size: var(--t-small); color: var(--ink-15); margin-bottom: var(--s2); }

/* ---------- the problem list: a glass menu that grows from its button ---------- */
.cw-pop { position: fixed; z-index: 60; border-radius: 18px; padding: 6px; transform-origin: var(--ox, 50%) var(--oy, 0); }
.cw-pop > .cw-glass { background: var(--lg-sheet); -webkit-backdrop-filter: blur(18px) saturate(var(--lg-sat)); backdrop-filter: blur(18px) saturate(var(--lg-sat)); }
.cw-pop[hidden] { display: none !important; }
.cw-pop.is-in { animation: cw-grow .2s var(--ease-out); }
.cw-pop.is-out { animation: cw-shrink .13s ease-in forwards; }
@keyframes cw-grow { from { opacity: 0; transform: scale(.95); } }
@keyframes cw-shrink { to { opacity: 0; transform: scale(.97); } }
.cw-pop-in { position: relative; display: grid; }
.cw-pop button.cw-opt, .cw-pop a.cw-opt { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; color: var(--ink); font: 500 .8125rem var(--ui); padding: 9px 10px; border-radius: 12px; cursor: pointer; text-decoration: none; }
@media (hover: hover) { .cw-pop .cw-opt:hover { background: var(--lg-hover); } }
.cw-pop .cw-opt[aria-checked="true"], .cw-pop .cw-opt[aria-current="page"] { background: var(--lg-pill); }
.cw-pop .cw-opt:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.cw-opt small { margin-left: auto; color: var(--ink-2); font-weight: 400; font-size: var(--t-micro); }
.cw-pop hr { border: 0; height: 1px; background: var(--lg-rim); margin: 4px 6px; }
.cw-pop-list { width: min(460px, calc(100vw - 24px)); }
.cw-pop-list .cw-pop-in { max-height: min(62vh, 560px); overflow: auto; }
.cw-pop-list h2 { margin: 6px 10px 2px; font: 600 var(--t-small) var(--ui); }
.cw-pop-list p.cw-pop-count { margin: 0 10px 6px; font-size: var(--t-micro); color: var(--ink-2); }
.cw-pop-list ol { list-style: none; margin: 0; padding: 0; display: grid; --cw-ring: #1d1d21; }
:root[data-theme="light"] .cw-pop-list ol { --cw-ring: #f6f6f7; }
.cw-pop-list a.cw-opt { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 10px; gap: 10px; }
.cw-pop-list .cw-n { font: var(--t-micro) var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cw-pop-list .cw-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-pop-list .cw-tick { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.cw-pop-list .cw-tick.is-no { background: none; }

/* The phone's floating Run / Submit (Split): above the tab bar. */
.cw-cap { display: none; }
.cw-panes { display: none; }

/* ---------- view transitions: names worn only while the layout changes ---------- */
:root.cw-vt .cw-doc, :root.cw-vt .cw-show { view-transition-name: cw-doc; }
:root.cw-vt .cw-editor { view-transition-name: cw-editor; }
:root.cw-vt .cw-bar { view-transition-name: cw-bar; }
:root.cw-vt .cw-act { view-transition-name: cw-act; }
:root.cw-vt .cw-console { view-transition-name: cw-console; }
:root.cw-vt::view-transition-old(root), :root.cw-vt::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-group(cw-doc), ::view-transition-group(cw-editor), ::view-transition-group(cw-bar),
::view-transition-group(cw-act), ::view-transition-group(cw-console) { animation-duration: .5s; animation-timing-function: cubic-bezier(.16, 1, .3, 1); }
/* The pieces keep their own size while their boxes move (clipped, never stretched). The two views cross-fade quickly
   with the browser's own plus-lighter blend (no dip in brightness), then the new one rides the rest of the move. */
::view-transition-old(cw-doc), ::view-transition-new(cw-doc), ::view-transition-old(cw-editor), ::view-transition-new(cw-editor),
::view-transition-old(cw-console), ::view-transition-new(cw-console), ::view-transition-old(cw-bar), ::view-transition-new(cw-bar) {
  width: 100%; height: 100%; object-fit: none; object-position: left top;
}
::view-transition-old(cw-doc), ::view-transition-old(cw-editor), ::view-transition-old(cw-console), ::view-transition-old(cw-bar) { animation: cw-vt-out .22s ease-out both; }
::view-transition-new(cw-doc), ::view-transition-new(cw-editor), ::view-transition-new(cw-console), ::view-transition-new(cw-bar) { animation: cw-vt-in .22s ease-out both; }
::view-transition-old(cw-act), ::view-transition-new(cw-act) { animation-duration: .5s; }
@keyframes cw-vt-out { to { opacity: 0; } }
@keyframes cw-vt-in { from { opacity: 0; } }

/* ================= laptop and wider ================= */
@media (min-width: 900px) {
  .cw { display: grid; grid-template-columns: minmax(320px, var(--cw-doc)) 8px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .cw-doc { grid-column: 1; grid-row: 1; overflow: auto; overscroll-behavior: contain; }
  .cw-grip { grid-column: 2; grid-row: 1; position: relative; z-index: 2; touch-action: none; cursor: col-resize; }
  .cw-work { grid-column: 3; grid-row: 1; display: grid; grid-template-rows: minmax(0, 1fr) 8px var(--cw-con); }
  .cw-grip-h { grid-row: 2; cursor: row-resize; touch-action: none; position: relative; }
  .cw-grip::after, .cw-grip-h::after { content: ''; position: absolute; background: var(--rule); transition: background-color .16s; }
  .cw-grip::after { inset: 0 3.5px; }
  .cw-grip-h::after { inset: 3.5px 0; }
  @media (hover: hover) { .cw-grip:hover::after, .cw-grip-h:hover::after { background: var(--ink-3); } }
  .cw-grip.is-drag::after, .cw-grip-h.is-drag::after, .cw-grip:focus-visible::after, .cw-grip-h:focus-visible::after { background: var(--accent); }
  .cw-grip:focus-visible, .cw-grip-h:focus-visible { outline: none; }
  .cw-console { grid-row: 3; }

  /* Focus */
  .cw[data-layout="focus"] { grid-template-columns: var(--cw-brief) 0 minmax(0, 1fr); }
  .cw[data-layout="focus"].is-away { grid-template-columns: 0 0 minmax(0, 1fr); }
  .cw[data-layout="focus"] .cw-grip, .cw[data-layout="focus"] .cw-grip-h { display: none; }
  .cw[data-layout="focus"] .cw-work { grid-template-rows: minmax(0, 1fr); }
  .cw[data-layout="focus"] .cw-doc { margin: 12px 0 12px 12px; border-radius: 20px; background: none; overflow: hidden; z-index: 3; }
  .cw[data-layout="focus"] .cw-doc > .cw-glass { display: block; background: var(--lg-sheet); }
  .cw[data-layout="focus"] .cw-doc-head { padding: 14px 18px 0; }
  .cw[data-layout="focus"] .cw-doc-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 4px 18px 28px; }
  .cw[data-layout="focus"] .cw-doc h1 { font-size: 1.375rem; margin-top: 4px; }
  .cw[data-layout="focus"] .cw-doc .ck-ex, .cw[data-layout="focus"] .cw-co { background: color-mix(in srgb, var(--card) 70%, transparent); }
  .cw[data-layout="focus"].is-away .cw-doc { display: none; }
  .cw[data-layout="focus"].is-away .cw-show { display: inline-flex; }
  .cw[data-layout="focus"] .cw-bar { left: auto; right: 12px; top: 12px; }
  .cw[data-layout="focus"] .cw-gap { display: none; }

  .cw[data-layout="focus"] .cw-console { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 5; flex-direction: row; align-items: center; gap: 8px; padding: 8px; border-radius: 22px; background: none; }
  .cw[data-layout="focus"] .cw-console > .cw-glass { display: block; }
  .cw[data-layout="focus"] .cw-con-head { display: none; }
  .cw[data-layout="focus"] .cw-console .cw-cases-panel { display: flex; flex: 1; min-width: 0; flex-wrap: wrap; align-items: center; padding: 0; overflow: visible; }
  .cw[data-layout="focus"] .cw-cases { margin: 0; gap: 2px; }
  .cw[data-layout="focus"] .cw-cases > button { border-color: transparent; background: none; padding: 8px 12px; }
  .cw[data-layout="focus"] .cw-cases > button[aria-checked="true"] { background: color-mix(in srgb, var(--ink) 10%, transparent); border-color: transparent; }
  .cw[data-layout="focus"] .cw-casebox { display: none; }
  .cw[data-layout="focus"] .cw-casebox.is-own { display: block; flex: 1 0 100%; padding: 6px 4px 2px; }
  .cw[data-layout="focus"] .cw-dock-act { display: flex; margin-left: auto; }

  .cw[data-layout="focus"] .cw-console .cw-out {
    display: flex; flex-direction: column; position: absolute; left: 0; right: 0; bottom: calc(100% + 10px); max-height: min(58vh, 540px);
    border-radius: 20px; padding: 0; overflow: visible; transform-origin: 50% 100%;
    transform: translateY(14px) scale(.97); visibility: hidden; pointer-events: none;
    transition: transform .2s var(--ease-out), visibility 0s .2s;
  }
  .cw[data-layout="focus"] .cw-console .cw-out > * { opacity: 0; transition: opacity .14s; }
  .cw[data-layout="focus"].out-up .cw-console .cw-out { transform: none; visibility: visible; pointer-events: auto; transition: transform .38s var(--ease-out), visibility 0s; }
  .cw[data-layout="focus"].out-up .cw-console .cw-out > * { opacity: 1; transition: opacity .2s; }
  .cw[data-layout="focus"] .cw-out > .cw-glass { display: block; background: var(--lg-sheet); }
  .cw[data-layout="focus"] .cw-out-in { overflow: auto; padding: 14px 18px 18px; }
  .cw[data-layout="focus"] .cw-out-hide { display: inline-flex; position: absolute; top: 10px; right: 10px; z-index: 1; }
  .cw[data-layout="focus"] .cw-vrow, .cw[data-layout="focus"] .cw-wait p { padding-right: 64px; }
  .cw[data-layout="focus"] .cw-case, .cw[data-layout="focus"] .cw-pre { background: color-mix(in srgb, var(--card) 70%, transparent); }
}
@media (min-width: 900px) and (max-width: 1279px) {
  .cw-act .ck-kbd { display: none; }
  .cw { --cw-brief: 400px; }
}

/* ================= phones and small tablets ================= */
@media (max-width: 899px) {
  .cw { --cw-top: 62px; }
  html.has-tabbar .cw { height: calc(100dvh - var(--bar-h) - var(--tb-h) - 26px - env(safe-area-inset-bottom)); }
  .cw-grip, .cw-grip-h { display: none; }
  .cw-doc, .cw-work { position: absolute; inset: 0; }
  .cw-editor { position: absolute; inset: 0; }
  .cw-act .ck-kbd { display: none; }
  .ck-select, .ck-input { font-size: 16px; }
  .cw-bar { top: 8px; left: 8px; right: 8px; }
  .cw-tools { flex: 1; }
  .cw-tools .cw-seg { margin-left: auto; }

  /* Split: one pane at a time under a glass switch; Run / Submit in a capsule. */
  .cw[data-layout="split"] { --cw-top: 116px; --cw-low: 96px; }
  .cw[data-layout="split"] .cw-panes { display: flex; position: absolute; z-index: 8; top: 8px; left: 0; right: 0; width: fit-content; margin: 0 auto; padding: 4px; border-radius: var(--r-pill); }
  .cw[data-layout="split"] .cw-bar { top: 62px; }
  .cw[data-layout="split"] .cw-bar .cw-gap { display: none; }
  .cw[data-layout="split"] .cw-doc { overflow: auto; padding-top: 52px; }
  .cw[data-layout="split"] .cw-doc-head { padding: 8px 16px 0; }
  .cw[data-layout="split"] .cw-doc-body { padding: 4px 16px 120px; }
  .cw[data-layout="split"][data-pane="problem"] .cw-work, .cw[data-layout="split"]:not([data-pane="problem"]) .cw-doc { visibility: hidden; }
  .cw[data-layout="split"][data-pane="code"] .cw-console { display: none; }
  .cw[data-layout="split"][data-pane="result"] .cw-editor, .cw[data-layout="split"][data-pane="result"] .cw-bar { display: none; }
  .cw[data-layout="split"][data-pane="result"] .cw-console { position: absolute; inset: 0; overflow: auto; padding: 60px 0 110px; background: var(--bg); }
  .cw[data-layout="split"][data-pane="result"] .cw-con-head { display: none; }
  .cw[data-layout="split"][data-pane="result"] .cw-cases-panel, .cw[data-layout="split"][data-pane="result"] .cw-out { display: block; flex: none; overflow: visible; padding: 4px 16px 8px; }
  .cw[data-layout="split"][data-pane="result"] .cw-out { padding-top: var(--s4); }
  .cw-in { animation: cw-in .26s var(--ease-out); }
  .cw-in.from-l { --cw-dx: -14px; }
  @keyframes cw-in { from { opacity: 0; transform: translateX(var(--cw-dx, 14px)); } }
  .cw[data-layout="split"] .cw-cap { display: flex; }
  .cw-cap { position: fixed; left: 0; right: 0; width: fit-content; margin: 0 auto; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 30; padding: 6px; border-radius: var(--r-pill); }
  html.has-tabbar .cw-cap { bottom: calc(var(--tb-h) + 26px + env(safe-area-inset-bottom)); }
  .cw-cap .cw-act .ck-btn { height: 44px; padding: 0 22px; }

  /* Focus: the problem is a glass sheet you drag up over the code; the dock sits above its edge. */
  .cw[data-layout="focus"] { --cw-low: 170px; }
  .cw[data-layout="focus"] .cw-doc { top: auto; height: 84%; z-index: 9; border-radius: 22px 22px 0 0; overflow: hidden; background: none; transform: translateY(var(--cw-y, calc(100% - 78px))); will-change: transform; }
  .cw[data-layout="focus"] .cw-doc > .cw-glass { display: block; background: color-mix(in srgb, var(--bg-2) 86%, transparent); }
  .cw[data-layout="focus"] .cw-doc-head { padding: 22px 16px 6px; touch-action: none; cursor: grab; }
  .cw[data-layout="focus"] .cw-handle { display: block; position: absolute; top: 8px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--rule-2); }
  .cw[data-layout="focus"] .cw-crumbs { display: none; }
  .cw[data-layout="focus"] .cw-doc h1 { font-size: 1.125rem; margin: 0 0 6px; }
  .cw[data-layout="focus"] .cw-doc-body { flex: 1; min-height: 0; overflow: auto; padding: 4px 16px 28px; overscroll-behavior: contain; }
  .cw[data-layout="focus"] .cw-console { position: absolute; left: 10px; right: 10px; bottom: 90px; z-index: 5; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px; border-radius: 22px; background: none; }
  .cw[data-layout="focus"] .cw-console > .cw-glass { display: block; }
  .cw[data-layout="focus"] .cw-console > :not(.cw-out), .cw[data-layout="focus"] .cw-console .cw-out > * { transition: opacity .2s; }
  .cw[data-layout="focus"].sheet-open .cw-console > :not(.cw-out) { opacity: 0; }
  .cw[data-layout="focus"].sheet-open .cw-console { pointer-events: none; }
  .cw[data-layout="focus"] .cw-con-head { display: none; }
  .cw[data-layout="focus"] .cw-console .cw-cases-panel { display: block; flex: 1 0 100%; order: 2; padding: 0; overflow: visible; min-width: 0; }
  .cw[data-layout="focus"] .cw-cases { margin: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 2px; }
  .cw[data-layout="focus"] .cw-cases > button { flex: none; border-color: transparent; background: none; }
  .cw[data-layout="focus"] .cw-cases > button[aria-checked="true"] { background: color-mix(in srgb, var(--ink) 10%, transparent); }
  .cw[data-layout="focus"] .cw-casebox { display: none; }
  .cw[data-layout="focus"] .cw-casebox.is-own { display: block; padding: 6px 4px 2px; }
  .cw[data-layout="focus"] .cw-dock-act { display: flex; flex: 1 0 100%; order: 1; }
  .cw[data-layout="focus"] .cw-dock-act .cw-act { flex: 1; }
  .cw[data-layout="focus"] .cw-dock-act .ck-btn { flex: 1; height: 44px; }
  .cw[data-layout="focus"] .cw-console .cw-out {
    display: flex; flex-direction: column; position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); max-height: calc(100dvh - var(--bar-h) - 330px);
    border-radius: 20px; padding: 0; overflow: visible; transform-origin: 50% 100%; transform: translateY(14px) scale(.97);
    visibility: hidden; pointer-events: none; transition: transform .2s var(--ease-out), visibility 0s .2s;
  }
  .cw[data-layout="focus"] .cw-console .cw-out > * { opacity: 0; }
  .cw[data-layout="focus"].out-up .cw-console .cw-out { transform: none; visibility: visible; pointer-events: auto; transition: transform .38s var(--ease-out), visibility 0s; }
  .cw[data-layout="focus"].out-up:not(.sheet-open) .cw-console .cw-out > * { opacity: 1; }
  .cw[data-layout="focus"] .cw-out > .cw-glass { display: block; background: color-mix(in srgb, var(--bg-2) 82%, transparent); }
  .cw[data-layout="focus"] .cw-out-in { overflow: auto; padding: 12px 14px 14px; }
  .cw[data-layout="focus"] .cw-out-hide { display: inline-flex; position: absolute; top: 6px; right: 6px; z-index: 1; }
  .cw[data-layout="focus"] .cw-vrow, .cw[data-layout="focus"] .cw-wait p { padding-right: 60px; }
}
@media (max-width: 360px) {
  .cw-tools .cw-chev, .cw-tools .cw-sep { display: none; }
  .cw-tools .cw-pill { padding: 8px 10px; }
  .cw-seg > [role="tab"] { padding: 6px 10px; }
}

/* ---------- before code.js has set the workspace up: the problem only (crawlers and failed scripts read it all) ---------- */
.cw:not(.is-ready) .cw-work, .cw:not(.is-ready) .cw-panes, .cw:not(.is-ready) .cw-cap { visibility: hidden; }
.cw-nojs, .cw-fail { margin: 0 0 var(--s4); padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--card); border: 1px solid var(--rule); font-size: var(--t-small); color: var(--ink-15); }
.cw-fail { position: relative; z-index: 1; margin: var(--cw-top) 16px 0; }
.cw-cos > li { display: flex; }
a.cw-co { text-decoration: none; transition: border-color .16s; }
@media (hover: hover) { a.cw-co:hover { border-color: var(--ink-3); } }
a.cw-co:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.ck-sources li + li { margin-top: 4px; }

/* ---------- /problems ---------- */
.cki-solved { margin: var(--s2) 0 0; min-height: 1.4em; font-size: var(--t-small); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cki-list { list-style: none; margin: var(--s5) 0 var(--s7); padding: 0; display: grid; max-width: 1040px; --cw-ring: var(--bg); }
.cki-list > li + li { border-top: 1px solid var(--rule); }
.cki-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(0, 300px) 96px 10px; gap: 16px; align-items: center; padding: 14px 12px; margin: 0 -12px; border-radius: var(--r-2); color: var(--ink); text-decoration: none; transition: background-color .16s; }
@media (hover: hover) { .cki-row:hover { background: var(--card); --cw-ring: var(--card); } }
.cki-row:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.cki-n { font: var(--t-micro) var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cki-main { display: grid; gap: 2px; min-width: 0; }
.cki-main b { font-weight: 600; font-size: var(--t-body); }
.cki-main span { font-size: var(--t-small); color: var(--ink-2); }
.cki-cos { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: var(--t-small); color: var(--ink-2); }
.cki-cos > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cki-tick { width: 8px; height: 8px; border-radius: 50%; }
.cki-row.is-solved .cki-tick { background: var(--accent); }
@media (max-width: 760px) {
  .cki-row { grid-template-columns: 22px minmax(0, 1fr) 10px; gap: 6px 12px; margin: 0 -8px; padding: 14px 8px; }
  .cki-cos, .cki-row .ck-pips { grid-column: 2; }
  .cki-tick { grid-column: 3; grid-row: 1; }
}
