/* Quiet surfaces and flat mini-training cards, shared by every locale. */
html[data-theme=color]{
  --theme-bg:#dce8d5;--theme-surface:#eaf0e4;--theme-card:#bdd2b4;
  --theme-soft:#adc69f;--theme-text:#263c2c;--theme-muted:#445b43;
  --theme-accent:#701c32;--theme-border:#91ae86;--theme-action:#32593d;
  --tile-0:#bdd2b4;--tile-1:#bdd2b4;--tile-2:#bdd2b4;--tile-3:#bdd2b4;
  --coach-top-left:#dce8d5;--coach-top-right:#dce8d5;
  --quiet-card:#bdd2b4;--quiet-hover:#adc69f;--quiet-edge:#91ae86;--quiet-ink:#294533;
}
html[data-theme=light]{
  --theme-bg:#faf9f6;--theme-surface:#fffefa;--theme-card:#f0efea;
  --theme-soft:#e6e4dd;--theme-text:#352e30;--theme-muted:#62595b;
  --theme-accent:#701c32;--theme-border:#d6d1c8;--theme-action:#701c32;
  --tile-0:#f0efea;--tile-1:#f0efea;--tile-2:#f0efea;--tile-3:#f0efea;
  --coach-top-left:#faf9f6;--coach-top-right:#faf9f6;
  --quiet-card:#f0efea;--quiet-hover:#e6e4dd;--quiet-edge:#d6d1c8;--quiet-ink:#352e30;
}
html[data-theme=dark]{--quiet-card:#24323d;--quiet-hover:#2c3d48;--quiet-edge:#42535d;--quiet-ink:#edf2ee}
html[data-theme=mono]{--quiet-card:#e8e8e8;--quiet-hover:#dedede;--quiet-edge:#c5c5c5;--quiet-ink:#252525}
html:is([data-theme=light],[data-theme=color]) body,
html:is([data-theme=light],[data-theme=color]) body main{background:var(--theme-bg)!important;color:var(--theme-text)!important}
html:is([data-theme=light],[data-theme=color]) body main>.hero{
  background:var(--theme-bg)!important;border-color:transparent!important;box-shadow:none!important
}
html[data-theme=color] body main>.hero{background:#ccdcbc!important}
html[data-theme] body :is(.learning-heading,.topic-group,.learning,#korys-content-panel){
  background:transparent!important;border-color:transparent!important;box-shadow:none!important
}
html[data-theme] body :is(.card,.card.maya,.topics,.korys-content-card,.content-card,.library-item,.content-entry),
html:is([data-theme],:root) body main>.brand-context{
  background:var(--quiet-card)!important;border:1px solid var(--quiet-edge)!important;box-shadow:none!important
}
html[data-theme] body .topic-grid :is(button.topic-tile,#mini-topic-button):not([data-flat-control]){
  background:var(--quiet-card)!important;color:var(--quiet-ink)!important;
  border:1px solid var(--quiet-edge)!important;box-shadow:none!important;
  transform:none!important;transition:background-color .15s ease,border-color .15s ease
}
html[data-theme] body .topic-grid :is(button.topic-tile,#mini-topic-button):not([data-flat-control]):is(:hover,:active){
  background:var(--quiet-hover)!important;box-shadow:none!important;transform:none!important
}
html[data-theme] body .topic-grid :is(button.topic-tile,#mini-topic-button):not([data-flat-control])>svg{
  border:1px solid var(--quiet-edge)!important;background:transparent!important;box-shadow:none!important
}
html[data-theme] body main>.hero>.korys-primary-nav :is(button,a.korys-coaches-shortcut,#primary-nav-button):not([data-flat-control]),
html[data-theme] body :is(.appearance-toggle,.language-nav select,.korys-menu-toggle){
  background:var(--quiet-card)!important;color:var(--quiet-ink)!important;
  border:1px solid var(--quiet-edge)!important;box-shadow:none!important
}
html[data-theme] body .topic-grid :is(button.topic-tile,#mini-topic-button):focus-visible{
  outline:2px solid var(--theme-accent,#701c32)!important;outline-offset:3px
}
html[data-theme] body main>.hero>.korys-primary-nav :is(button,a.korys-coaches-shortcut,#primary-nav-button):not([data-flat-control]):is(:hover,[aria-pressed=true]){
  background:var(--quiet-hover)!important;color:var(--quiet-ink)!important;
  border-color:var(--quiet-edge)!important;box-shadow:none!important
}
html:is([data-theme=light],[data-theme=color]) body .lesson-dialog{
  background:var(--theme-surface)!important;border:1px solid var(--quiet-edge)!important
}
html:is([data-theme=light],[data-theme=color]) body :is(.campus,.coach-portrait,main>.portrait img){
  mix-blend-mode:multiply
}
/* Never hide a valid portrait while a theme asset is loading. Single-layer
   rendering avoids WebKit's composite-mask black/transparent image failures. */
html[data-theme] body img[data-original-coach-src]{visibility:visible!important;opacity:1!important;animation:none!important}
html[data-theme=dark] body :is(.campus,.coach-portrait,main>.portrait img){
  visibility:visible!important;opacity:1!important;mix-blend-mode:normal!important;
  filter:none!important;mask-image:none!important;-webkit-mask-image:none!important;
  mask-composite:add!important;-webkit-mask-composite:source-over!important
}
