@layer legacy {
html:root{--kecb-ink:#17191a}

/* DEPLOY-741 — ratified reader type floor and compact semantic scale.
   This layer is present on every public HTML page, so legacy bundles can resolve
   shared type tokens without introducing another stylesheet request. */
:root{
  --kecb-text-floor:.875rem;
  --kecb-chrome-floor:.875rem;
  --kecb-type-micro:.875rem;
  --kecb-type-small:.9375rem;
  --kecb-type-body:1rem;
  --kecb-type-subhead:1.125rem;
}
/* KECB DEPLOY-736 — semantic surface purpose, restrained texture, cross-craft cards */
:root{--kecb-paper:#f6f0e6;--kecb-paper-deep:#eee3d4;--kecb-night:#1b1512;--kecb-night-soft:#2a211c;--kecb-night-ink:#f5efe6;--kecb-rust:#8f3f32;--kecb-line:rgba(88,64,48,.19)}
body.surface-purpose-workbench{background-color:var(--kecb-paper)}
body.surface-purpose-workbench main{background-color:var(--kecb-paper);background-image:radial-gradient(circle at 18% 12%,rgba(72,52,39,.028) 0 1px,transparent 1.25px),radial-gradient(circle at 82% 68%,rgba(72,52,39,.02) 0 1px,transparent 1.2px),linear-gradient(100deg,rgba(255,255,255,.17),rgba(111,78,56,.018) 45%,rgba(255,255,255,.12));background-size:19px 19px,23px 23px,100% 100%}
body.surface-purpose-workbench :is(.chapter-main,.recipe-card,.bar2-shell,.kitchen-panel,.tool-card,.academy-card){background-clip:padding-box}
body.surface-purpose-night{background:var(--kecb-night)}
body.surface-purpose-night main{background:var(--kecb-paper);position:relative}
body.surface-purpose-night :is(.tonight-hero,.vp-hero,.visual-hero,.sh-hero,.artist-halls-hero,.emerging-hero,.dl-hero,.dir-hero){background-color:var(--kecb-night);background-image:radial-gradient(circle at 78% 18%,rgba(188,121,82,.13) 0 1px,transparent 1.4px),linear-gradient(118deg,#181210 0%,#241b17 56%,#31211a 100%);background-size:22px 22px,100% 100%;border-bottom:1px solid rgba(242,221,197,.22);box-shadow:inset 0 -1px rgba(0,0,0,.25)}
body.surface-purpose-night :is(.tonight-hero,.vp-hero,.visual-hero,.sh-hero,.artist-halls-hero,.emerging-hero,.dl-hero,.dir-hero) :is(h1,h2,p,.eyebrow,.vp-kicker,.vp-location,.tonight-kicker,.artist-halls-kicker,.emerging-kicker){color:var(--kecb-night-ink)}
body.surface-purpose-night :is(.tonight-hero,.vp-hero,.visual-hero,.sh-hero,.artist-halls-hero,.emerging-hero,.dl-hero,.dir-hero) a:not(.button):not([data-night-light-link]){color:#f0c8aa}
body.surface-purpose-night :is(.vp-tag,.dir-tag){border-color:rgba(245,239,230,.28);background:rgba(255,255,255,.08);color:var(--kecb-night-ink)}
body.surface-purpose-night :is(.tonight-hero,.vp-hero,.visual-hero,.sh-hero,.artist-halls-hero,.emerging-hero,.dl-hero,.dir-hero)::after{content:"";display:block;height:3px;margin-top:1.1rem;background:linear-gradient(90deg,transparent,rgba(199,118,84,.65) 18%,rgba(234,195,156,.45) 50%,rgba(199,118,84,.65) 82%,transparent);opacity:.55}
.kecb-cross-craft-card{display:grid;grid-template-columns:minmax(150px,24%) minmax(0,1fr);gap:1rem;align-items:stretch;margin:1.35rem auto;padding:.7rem;border:1px solid rgba(96,72,53,.19);border-radius:var(--kecb-radius-card);background:#fffaf3;box-shadow:var(--kecb-shadow-card);max-width:min(100%,74rem)}
.kecb-cross-craft-visual{min-height:112px;border-radius:var(--kecb-radius-card);overflow:hidden;display:grid;place-items:center;position:relative;background:linear-gradient(135deg,#1e1815,#38271f);color:#f4eadf}
.kecb-cross-craft-visual img{width:100%;height:100%;min-height:112px;object-fit:cover;display:block;filter:saturate(.86) contrast(1.02)}
.kecb-cross-craft-visual::after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(120deg,rgba(255,255,255,.03),rgba(151,82,53,.12));box-shadow:inset 0 0 0 1px rgba(255,255,255,.08)}
.kecb-cross-craft-symbols{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:.45rem;width:88%;font-size:max(var(--kecb-type-meta), max(14px,.76rem));font-weight:900;letter-spacing:.12em;text-align:center}.kecb-cross-craft-symbols span:nth-child(2){font-size:max(var(--kecb-type-meta), 1.2rem);letter-spacing:0;color:#dc9f75}.kecb-cross-craft-symbols span:first-child,.kecb-cross-craft-symbols span:last-child{padding:.55rem .35rem;border-block:1px solid rgba(245,239,230,.25)}
.kecb-cross-craft-copy{align-self:center;padding:.35rem .45rem .35rem 0}.kecb-cross-craft-kicker{margin:0 0 .18rem;color:#8f3f32;font-size:max(var(--kecb-type-meta), max(14px,.76rem));font-weight:900;letter-spacing:.08em;text-transform:uppercase}.kecb-cross-craft-copy h2{margin:.05rem 0 .25rem;font-size:max(var(--kecb-type-meta), clamp(1.05rem,1.8vw,1.35rem));line-height:1.15;color:#261e19}.kecb-cross-craft-copy p{margin:.2rem 0 .55rem;max-width:62ch;color:#57483e;font-size:max(var(--kecb-type-meta), max(14px,.91rem));line-height:1.5}.kecb-cross-craft-link{display:inline-flex;align-items:center;gap:.3rem;font-weight:850;color:#7c352b;text-decoration-thickness:1.5px;text-underline-offset:.18em;font-size:max(var(--kecb-type-meta), max(14px,.9rem))}
body.surface-purpose-workbench .kecb-cross-craft-card{background:rgba(255,250,243,.9);box-shadow:var(--kecb-shadow-card)}
@media(max-width:680px){.kecb-cross-craft-card{grid-template-columns:96px minmax(0,1fr);gap:.7rem;padding:.6rem;margin:1rem 0}.kecb-cross-craft-visual,.kecb-cross-craft-visual img{min-height:96px}.kecb-cross-craft-symbols{grid-template-columns:1fr;gap:.14rem;font-size:max(var(--kecb-type-meta), 13px)}.kecb-cross-craft-symbols span:nth-child(2){transform:rotate(90deg);font-size:max(var(--kecb-type-meta), 1rem)}.kecb-cross-craft-copy{padding:.15rem .15rem .15rem 0}.kecb-cross-craft-copy h2{font-size:max(var(--kecb-type-meta), 1rem)}.kecb-cross-craft-copy p{font-size:max(var(--kecb-type-meta), 13px);line-height:1.42}}
@media(prefers-reduced-transparency:reduce){body.surface-purpose-night :is(.tonight-hero,.vp-hero,.visual-hero,.sh-hero,.artist-halls-hero,.emerging-hero,.dl-hero,.dir-hero){background-image:none}.kecb-cross-craft-card{background:#fffaf3}}
@media print{body.surface-purpose-workbench main,body.surface-purpose-night main{background:#fff}.kecb-cross-craft-card{box-shadow:var(--kecb-shadow-none);break-inside:avoid}}

/* DEPLOY-737 final visual QA: outrank the legacy surface-light safety layer only on semantic night heroes. */
html:root body.surface-purpose-night :is(.tonight-hero,.vp-hero,.visual-hero,.sh-hero,.artist-halls-hero,.emerging-hero,.dl-hero,.dir-hero).surface-light{
  background:linear-gradient(118deg,#181210 0%,#241b17 56%,#31211a 100%);
  background-image:radial-gradient(circle at 78% 18%,rgba(188,121,82,.13) 0 1px,transparent 1.4px),linear-gradient(118deg,#181210 0%,#241b17 56%,#31211a 100%);
  background-size:22px 22px,100% 100%;
  color:var(--kecb-night-ink);
}
html:root body.surface-purpose-night :is(.tonight-hero,.vp-hero,.visual-hero,.sh-hero,.artist-halls-hero,.emerging-hero,.dl-hero,.dir-hero).surface-light :is(h1,h2,h3,h4,p,li,dd,span,small,strong,.eyebrow,.vp-kicker,.vp-location,.tonight-kicker,.tonight-eyebrow,.artist-halls-kicker,.artist-halls-eyebrow,.emerging-kicker,.dl-kicker,.dir-kicker,.sh-kicker):not([data-night-light-link] *){color:var(--kecb-night-ink)}
html:root body.surface-purpose-night :is(.tonight-hero,.vp-hero,.visual-hero,.sh-hero,.artist-halls-hero,.emerging-hero,.dl-hero,.dir-hero).surface-light h1 :is(em,span,strong){color:inherit}
html:root body.surface-purpose-night :is(.tonight-hero,.vp-hero,.visual-hero,.sh-hero,.artist-halls-hero,.emerging-hero,.dl-hero,.dir-hero).surface-light a:not(.button):not([data-night-light-link]){color:#f0c8aa}
html:root body.surface-purpose-night :is(.tonight-hero,.vp-hero,.visual-hero,.sh-hero,.artist-halls-hero,.emerging-hero,.dl-hero,.dir-hero).surface-light::before{background:none;background-image:none;box-shadow:var(--kecb-shadow-none)}
html:root body.surface-purpose-night :is(.tonight-hero,.vp-hero,.visual-hero,.sh-hero,.artist-halls-hero,.emerging-hero,.dl-hero,.dir-hero).surface-light::after{content:"";display:block;height:3px;margin-top:1.1rem;background:linear-gradient(90deg,transparent,rgba(199,118,84,.65) 18%,rgba(234,195,156,.45) 50%,rgba(199,118,84,.65) 82%,transparent);opacity:.55;box-shadow:var(--kecb-shadow-none)}
/* DEPLOY-737 QA closure for high-specificity utility text inherited from light heroes. */
html:root body.surface-purpose-night .tonight-hero.surface-light #meta-line,
html:root body.surface-purpose-night .tonight-hero.surface-light .tonight-utility{color:#d8cabc}
html:root body.surface-purpose-night .tonight-hero.surface-light .tonight-explore-links>summary{color:#f0c8aa}
html:root body.surface-purpose-night .dl-hero.surface-light .dl-utility-line,
html:root body.surface-purpose-night .dl-hero.surface-light .dl-utility-line :is(span,small,strong){color:#d8cabc}
html:root body.surface-purpose-night .vp-hero.surface-light :is(.vp-wrap,.vp-tags){color:var(--kecb-night-ink)}


/* ---------- DEPLOY 740: audit remediation — complete surface ownership ---------- */
/* Tool book-credit belongs to light tool heroes: background, border, foreground and link move together. */
html:root body main .tool-book-credit{
  background:#fffaf0;
  color:#514a43;
  border-color:#c8b9a5;
}
html:root body main .tool-book-credit a{
  color:#712d24;
  text-decoration-color:currentColor;
}
/* Directory region controls are a light panel regardless of hero ancestry. */
html:root body main .dir-region-panel{
  background:#fffaf0;
  color:#18232b;
  border-color:#c8b9a5;
}
html:root body main .dir-region-panel :is(p,span,small,li,label){
  color:#4a443f;
  opacity:1;
}
html:root body main .dir-region-panel :is(a,button){
  color:#5f241d;
}
/* Give the two previous AA near-misses comfortable headroom. */
html:root body main .academy-lesson-map summary small,
html:root body main .pulse-meta{
  color:#4a443f;
  opacity:1;
}
/* Homepage brand identity is visible inside the primary heading without making the hero bulky. */
html:root body .tonight-hero h1 .tonight-brand-name{
  display:block;
  margin:0 0 .28rem;
  font-family:var(--kecb-sans,system-ui,sans-serif);
  font-size:max(var(--kecb-type-meta), max(14px,.28em));
  font-weight:800;
  line-height:1.2;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:#f0c8aa;
}
html:root body .tonight-hero h1 .tonight-brand-title{display:block}
/* Role-related navigation remains a deliberately dark, warm component. Keep its foreground and surface coupled. */
html:root body main .role-related{
  background:linear-gradient(135deg,#2b1711,#6b3822);
  background-image:linear-gradient(135deg,#2b1711,#6b3822);
  color:#fff;
  border-color:rgba(107,56,34,.55);
}
html:root body main .role-related :is(h1,h2,h3,h4,p,li,span,small,strong,b){color:#f7eee5}
html:root body main .role-related a{color:#fff;border-color:rgba(255,255,255,.28)}
/* Directory hero descendants carry legacy on-dark colors at higher specificity; own the complete light panel at the same scope. */
html:root body main .dir-hero .dir-region-panel{background:#fffaf0;color:#18232b;border-color:#c8b9a5}
html:root body main .dir-hero .dir-region-panel :is(h1,h2,h3,h4,strong,b,label){color:#18232b}
html:root body main .dir-hero .dir-region-panel :is(p,span,small,li){color:#4a443f;opacity:1}
html:root body main .dir-hero .dir-region-panel :is(a,button){color:#5f241d}
/* Exception inside the night hero: the search/filter panel is intentionally light. */
html:root body.surface-purpose-night main .dir-hero.surface-light .dir-region-panel :is(h1,h2,h3,h4,strong,b,label){color:#18232b}
html:root body.surface-purpose-night main .dir-hero.surface-light .dir-region-panel :is(p,span,small,li){color:#4a443f;opacity:1}
html:root body.surface-purpose-night main .dir-hero.surface-light .dir-region-panel :is(a,button){color:#5f241d}

/* DEPLOY-744 — shared readable type floor without force-cascade overrides. */
:root{--kecb-visible-text-floor:14px}
main :where(.book-source-volume,.book-source-copy p:last-child,.book-source-actions .button,.tool-book-credit,.tool-suite-wrap>nav[aria-label="Breadcrumb"],.speakeasy-disclaimer-open,.tool-disclaimer-open){font-size:max(var(--kecb-type-meta), 14px)}
main :where(.role-book-route-card>span,.role-entry-card>b,.role-step a,.role-related-links a){font-size:max(var(--kecb-type-meta), 14px)}
main .k2-subnav a{font-size:max(var(--kecb-type-meta), 14px)}
body[data-reader-page="true"] main :where(.eyebrow,.toc-group h3,.toc-group a span,.chapter-tools .reader-controls button,.pager-link small){font-size:max(var(--kecb-type-meta), 14px)}


/* DEPLOY-746 — final microcopy readability closure. */
body.tonight-page .tonight-filter-label{font-size:max(var(--kecb-type-meta), 14px)}
html:root body main .dir-quick-regions>span{font-size:max(var(--kecb-type-meta), 14px)}
html:root body main .pr-library-link{font-size:max(var(--kecb-type-meta), 14px)}
}
