/* Letter codes page. Palette: ink #0C1C2E, blue #1577E6, dark blue #0B4A9E, green #16A65A, sun #F0A92E, coral #E5604D (wrong only). */
.article{--lc-ink:#0C1C2E;--lc-blue:#1577E6;--lc-dk:#0B4A9E;--lc-green:#16A65A;--lc-sun:#F0A92E;--lc-coral:#E5604D;--lc-line:#BCD0E6;--lc-tint:#E7F1FE;min-width:0;}
.article *{min-width:0;}
.article svg{max-width:100%;}

@media(max-width:620px){
  .lc-fig{margin:10px 0;}
}

/* undo the article list styling inside kit parts and tool lists */
.ck-opt-c .lc-code{background:none;padding:0;}

/* figure cards */
.lc-fig{margin:18px 0;padding:12px 10px;background:#fff;border:2px solid var(--lc-line);border-radius:18px;overflow:hidden;}
.lc-fig svg{display:block;width:100%;height:auto;font-family:'Nunito',system-ui,sans-serif;}
.lc-ringfig{max-width:520px;margin-left:auto;margin-right:auto;}
.lc-hero-fallback{font-weight:900;color:var(--lc-ink);padding:8px;}
.lc-replay{margin:-6px 0 14px;display:flex;justify-content:flex-end;}
.lc-fig + .lc-replay{margin-top:-8px;}

/* code tiles under a rail */
.lc-tiles{margin:6px 6px 2px;display:grid;gap:8px;}
.lc-trow{display:flex;align-items:center;gap:6px;}
.lc-trow em{font-style:normal;font-weight:900;font-size:13px;color:#46586C;width:52px;flex:none;}
.lc-tile{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border:2px solid var(--lc-line);border-radius:11px;background:#fff;font-weight:900;font-size:22px;color:var(--lc-ink);flex:none;}
.lc-tile.is-out{background:var(--lc-green);border-color:#0C8A48;color:#fff;}
.lc-code{display:inline-block;font-weight:900;letter-spacing:.09em;background:var(--lc-tint);border-radius:8px;padding:0 7px;color:var(--lc-ink);}

/* worked example beside every interactive */
.lc-plain{margin:14px 0 20px;padding:12px 16px;border-left:5px solid var(--lc-blue);background:#F4F8FD;border-radius:0 12px 12px 0;font-weight:600;line-height:1.6;}
.lc-plain b{display:block;font-size:12px;letter-spacing:.5px;text-transform:uppercase;color:var(--lc-dk);margin-bottom:3px;}
[data-ex]{font-weight:800;white-space:nowrap;}
.lc-plain [data-ex],.article p [data-ex]{white-space:normal;}

/* mirror pairs */
.lc-pairs{display:grid;grid-template-columns:repeat(auto-fill,minmax(92px,1fr));gap:8px;margin:12px 0 16px;}
.lc-pairs span{display:flex;flex-direction:column;align-items:center;padding:8px 6px;background:#fff;border:2px solid var(--lc-line);border-radius:12px;font-weight:900;font-size:19px;letter-spacing:.14em;color:var(--lc-ink);}
.lc-pairs i{font-style:normal;font-size:12.5px;letter-spacing:0;color:var(--lc-dk);margin-top:2px;}

/* tool cards */
.lc-tool{margin:16px 0;padding:16px;background:#fff;border:2px solid var(--lc-line);border-radius:18px;display:grid;gap:12px;}
.lc-tool .ck-controls{display:flex;flex-wrap:wrap;gap:12px;align-items:center;}
.lc-rng{display:flex;align-items:center;gap:10px;flex:1 1 220px;flex-wrap:wrap;}
.lc-rng label{font-weight:800;font-size:14.5px;color:var(--lc-ink);flex:1 0 100%;}
.lc-rng .ck-range{flex:1 1 140px;}
.lc-rng b{min-width:44px;text-align:center;font-weight:900;font-size:18px;color:var(--lc-dk);}
.lc-rng[hidden],.lc-pane[hidden],#cStep2[hidden]{display:none;}
.lc-word{display:flex;align-items:center;gap:10px;font-weight:800;flex-wrap:wrap;}
.lc-word input,.lc-btns input{font:inherit;font-weight:900;font-size:20px;letter-spacing:.14em;text-transform:uppercase;width:11ch;max-width:100%;padding:8px 12px;border:2px solid var(--lc-line);border-radius:12px;color:var(--lc-ink);background:#fff;}
.lc-word input:focus,.lc-btns input:focus{outline:3px solid var(--lc-blue);outline-offset:1px;}
.lc-btns{display:flex;flex-wrap:wrap;gap:10px;align-items:center;}
.lc-pairline{margin:0;font-weight:800;font-size:18px;}
.lc-pairline i{font-style:normal;color:var(--lc-blue);margin:0 6px;}
.lc-hint,.lc-msg{margin:0;font-weight:700;font-size:15px;color:#46586C;}
.lc-msg.is-good{color:#0C8A48;}
.lc-msg.is-bad{color:#B8402F;}
.lc-rows{list-style:none;margin:0;padding:0;display:grid;gap:6px;}
.lc-rows:empty{display:none;}
.lc-rows li{display:grid;grid-template-columns:auto 1fr auto;gap:10px;align-items:center;}
.lc-work{font-weight:700;font-size:14.5px;color:#46586C;text-align:center;border-bottom:2px dashed var(--lc-line);padding-bottom:2px;line-height:1.3;}
.lc-rows .lc-tile{width:38px;height:38px;font-size:20px;}
.lc-slips{padding-left:20px;}
.lc-slips li{margin:8px 0;}
.lc-slips [data-bad]{font-weight:900;letter-spacing:.08em;color:#B8402F;background:#FDECE8;border-radius:8px;padding:0 7px;}
.lc-levelbar{display:grid;gap:8px;}

/* quiz stem */
.lc-stem{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center;margin:6px 0 10px;padding:10px 12px;background:#F4F8FD;border-radius:14px;}
.lc-stem-h{font-weight:900;font-size:12px;letter-spacing:.5px;text-transform:uppercase;color:var(--lc-dk);flex:1 0 100%;}
.lc-ex{display:inline-flex;align-items:center;gap:6px;font-weight:900;}
.lc-ex i{font-style:normal;color:var(--lc-blue);}
.lc-ex.is-ask b{color:var(--lc-sun);font-size:22px;}
.lc-rule{font-weight:800;}
.lc-why{margin:6px 0;padding-left:20px;font-weight:600;line-height:1.55;}
.lc-why-h{margin:10px 0 2px;font-weight:900;}

/* printable */
.lc-sheet{margin:14px 0;padding:18px;background:#fff;border:2px solid var(--lc-line);border-radius:14px;}
.lc-sheet h3{margin:0 0 6px;font-size:19px;}
.lc-name{margin:0 0 10px;font-weight:700;color:#46586C;}
.lc-sheet ol{margin:0;padding-left:24px;display:grid;gap:12px;}
.lc-sheet li p{margin:0;font-weight:600;line-height:1.5;}
.lc-opts{display:flex;flex-wrap:wrap;gap:4px 18px;margin-top:3px !important;font-weight:800 !important;letter-spacing:.06em;}
.lc-answers li{font-weight:600;line-height:1.5;}

/* family tree */
.lc-tree{max-width:620px;margin:0 auto;}

/* animation: final state is the default, so reduced motion and no-JS are complete */
.lc-pre .lc-hop{stroke-dasharray:1;stroke-dashoffset:1;}
.lc-pre .lc-ah,.lc-pre .lc-hl,.lc-pre .lc-col,.lc-pre .lc-cell,.lc-pre .lc-tile.is-out,.lc-pre .lc-tb,.lc-pre .lc-t0,.lc-pre .lc-tl{opacity:0;}
.lc-play .lc-hop{stroke-dasharray:1;stroke-dashoffset:1;animation:lcdraw .7s ease var(--d,0s) forwards;}
.lc-play .lc-ah,.lc-play .lc-hl,.lc-play .lc-col,.lc-play .lc-cell,.lc-play .lc-tile.is-out,.lc-play .lc-tb{animation:lcfade .45s ease var(--d,0s) both;}
.lc-play .lc-t0,.lc-play .lc-tl{animation:lcfade .4s ease both;}
.lc-run li{animation:lcfade .35s ease calc(var(--i,0) * .12s) both;}
@keyframes lcdraw{from{stroke-dashoffset:1}to{stroke-dashoffset:0}}
@keyframes lcfade{from{opacity:0}to{opacity:1}}
@media (prefers-reduced-motion: reduce){
  .lc-play .lc-hop,.lc-play .lc-ah,.lc-play .lc-hl,.lc-play .lc-col,.lc-play .lc-cell,.lc-play .lc-tile.is-out,.lc-play .lc-tb,.lc-run li{animation:none !important;}
  .lc-pre .lc-hop{stroke-dasharray:none;stroke-dashoffset:0;}
  .lc-pre .lc-ah,.lc-pre .lc-hl,.lc-pre .lc-col,.lc-pre .lc-cell,.lc-pre .lc-tile.is-out,.lc-pre .lc-tb,.lc-pre .lc-t0,.lc-pre .lc-tl{opacity:1;}
}

@media (max-width:420px){
  .lc-trow em{width:40px;font-size:12px;}
  .lc-tile{width:36px;height:36px;font-size:19px;}
  .lc-tool{padding:12px;}
  .lc-fig{padding:8px 4px;}
}

/* print: only the worksheet and its answers */
@media print{
  header.nav,.ih-hero,.sidebar,.footer,.band,.related,.ck-cta,.lc-noprint,.crumbs,[data-ck-types],[data-ck-hub],.lc-printwrap ~ *,
  .article > *:not(.lc-printwrap){display:none !important;}
  body{background:#fff !important;}
  .post-wrap{padding:0 !important;max-width:none !important;}
  .post-layout{display:block !important;}
  .article{max-width:none !important;padding:0 !important;box-shadow:none !important;border:0 !important;}
  .lc-printwrap{display:block !important;}
  .lc-sheet{border:0;padding:0;margin:0;}
  .lc-sheet h3{font-size:20pt;}
  .lc-sheet ol{gap:3pt;font-size:11pt;}
  .lc-sheet h3{margin:0 0 6pt;}
  .lc-name{margin:0 0 8pt;}
  @page{margin:10mm;}
  #sheetQ{gap:4pt;}
  .lc-sheet li,.lc-sheet li p{line-height:1.3 !important;margin-top:0 !important;margin-bottom:0 !important;}
  .lc-sheet h3{font-size:16pt;}
  #sheetQ li,#sheetQ li p,#sheetQ li *{font-size:11.5pt !important;}
  .lc-sheet li{break-inside:avoid;}
  .lc-answers{break-before:page;page-break-before:always;}
}

/* round 2: wrap chip rows, tidy select and worksheet name line */
.ck-types-row{flex-wrap:wrap;overflow:visible;scroll-snap-type:none;}
.ck-types-row>li{flex:1 1 92px;min-width:0;}
.ck-types-row .ck-chip{width:100%;}
.lc-name{display:flex;gap:18px;align-items:flex-end;}
.lc-nm,.lc-dt{display:block;border-bottom:2px solid #46586C;min-height:26px;padding-right:4px;}
.lc-nm{flex:2 1 0;}
.lc-dt{flex:1 1 0;}

/* portrait iPad in CTAs: cap height near 420px at phone width */
.ck-duo .ck-ipad{--w:min(62cqw,290px);margin-inline:0;}
.ck-duo{padding-bottom:0;}
.ck-duo .ck-phone{--w:min(34cqw,150px);}
.ck-cta-band .ck-ipad{--w:min(100cqw,290px);}
.ck-ipad .ck-screen img{display:block;width:100%;height:100%;object-fit:cover;}
