[hidden]{display:none!important}
.pattern-picker{display:flex;gap:1.5rem;align-items:end;justify-content:space-between;flex-wrap:wrap}
.pattern-picker label,#patternPracticeControls>label{display:grid;grid-template-columns:minmax(0,1fr);gap:.5rem;min-width:0;font-weight:700;max-width:100%}
#patternApp .chess-select{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;appearance:none;-webkit-appearance:none;padding-right:2.2rem;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10'%3E%3Cpath d='m2 2 6 6 6-6' fill='none' stroke='%23102b43' stroke-width='2'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right .7rem center;background-size:14px 9px}
.pattern-picker select,#patternVariant{max-width:100%;width:100%;min-width:0}
.pattern-picker>label{flex:1 1 310px;max-width:700px}
.pattern-picker p{margin:.5rem 0;color:#374e67;font-weight:700}
.pattern-modes{display:flex;flex-wrap:wrap;gap:.65rem;margin:1.2rem 0}
.pattern-modes [aria-pressed=true]{background:#2443bd;color:white;border-color:#2443bd}
#patternTitle{margin:.6rem 0;font-size:clamp(1.4rem,3vw,1.9rem)}
#patternIntro,.pattern-warning{line-height:1.6;max-width:90ch}
.pattern-warning{border-left:4px solid #b67e0b;padding:.65rem 1rem;background:#fff6dd;color:#624500;border-radius:0 12px 12px 0}
.pattern-layout{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:1.5rem;align-items:start;margin-top:1rem}
.pattern-layout .board-area{min-width:0;width:100%;justify-content:stretch}
.pattern-layout .coach-panel{min-width:0;display:grid;grid-template-columns:minmax(0,1fr);gap:.8rem}
#patternGoal{font-size:1.2rem;line-height:1.5;margin:0}
#patternBoard{--board-size:min(43vw,550px);width:100%;height:auto;aspect-ratio:1;max-width:550px;margin:auto;grid-template-rows:repeat(8,minmax(0,1fr));grid-template-columns:repeat(8,minmax(0,1fr))}
#patternBoard .chess-square{min-height:0;min-width:0;aspect-ratio:1}
#patternBoard .piece-glyph{font-size:clamp(24px,4.1vw,48px);line-height:1}
#patternBoard .piece-glyph.white{color:#fffef7;-webkit-text-stroke:1px #183754;text-shadow:none}
#patternBoard .piece-glyph.black{color:#142f49;-webkit-text-stroke:0;text-shadow:none}
#patternBoard .pattern-piece{display:block;width:86%;height:86%;position:relative;z-index:1;pointer-events:none;filter:drop-shadow(0 1px 1px #0002)}
#patternBoard .rank-label,#patternBoard .file-label{font-size:clamp(9px,1vw,12px);color:#102a43;font-weight:800}
#patternBoard .chess-square:focus-visible{outline:4px solid #112b4e;outline-offset:-4px;z-index:2}
#patternBoard .pattern-last{box-shadow:inset 0 0 0 3px #927127}
#patternBoard .selected{box-shadow:inset 0 0 0 4px #2443bd}
#patternFeedback{font-size:1.05rem;line-height:1.6;min-height:5rem;padding:1rem}
.pattern-board-tools,.pattern-layout .coach-actions{display:flex;flex-wrap:wrap;gap:.6rem;margin:.5rem 0}
.pattern-board-tools{justify-content:space-between}
.pattern-layout .chess-btn{white-space:normal;min-height:44px;max-width:100%;text-align:center}
.pattern-layout button:focus-visible,.pattern-modes button:focus-visible{outline:3px solid #112b4e;outline-offset:3px}
.pattern-turn{font-weight:750;line-height:1.4;margin:0 0 .5rem;color:#304866}
.pattern-evidence{font-size:.95rem;line-height:1.6;color:#405571;border-top:1px solid #cad6e9;padding-top:1rem}
.pattern-about{max-width:90ch;margin:1.6rem 0;line-height:1.65}
.pattern-about h2{font-size:1.25rem}.chess-source summary{min-height:44px;cursor:pointer;align-content:center}
.pattern-layout .puzzle-move-form{margin:0}.pattern-layout .puzzle-move-form label{flex:1 1 90px;grid-template-columns:minmax(0,1fr)}
.pattern-layout .puzzle-move-form>button{width:100%}
.pattern-layout .board-caption{font-size:.85rem;line-height:1.5;font-weight:500}
@media(max-width:850px){.pattern-layout{grid-template-columns:minmax(0,1fr);gap:1rem}#patternBoard{max-width:550px;--board-size:min(100vw - 60px,550px)}#patternBoard .piece-glyph{font-size:clamp(24px,7.5vw,48px)}}
@media(max-width:420px){.chess-shell{padding-inline:10px}.trainer-card{padding:10px}.pattern-board-tools>*{flex:1 1 110px}.pattern-modes>*{flex:1 1 100%}#patternBoard{border-width:3px;border-radius:10px}#patternBoard .piece-glyph{font-size:clamp(23px,7.8vw,33px)}.pattern-picker label{flex-basis:100%}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}#patternBoard *{animation:none!important;transition:none!important}}
@media(max-width:700px){
  body:has(#patternApp) .utc-header__inner{display:flex!important;flex-direction:row;flex-wrap:wrap}
  body:has(#patternApp) .utc-header .utc-brand{flex:0 1 auto;min-width:0;max-width:100%;white-space:normal}
  body:has(#patternApp) .utc-header .utc-brand>span:last-child{min-width:0;overflow-wrap:anywhere}
  body:has(#patternApp) .utc-header .level-picker{flex:0 0 auto;max-width:100%}
  body:has(#patternApp) .utc-header .utc-nav{display:flex;flex-wrap:wrap;order:3;flex:0 0 100%;width:100%}
  body:has(#patternApp) .utc-header .utc-nav a{flex:0 0 auto;white-space:nowrap;overflow-wrap:normal}
}
