/* Scoped addition: existing HUD, bench, shop and drag targets keep their geometry. */
#coach-btn{margin-top:3px;color:#f6dda0}#coach-btn:disabled{opacity:.45}
.coach-settings{border:1px solid #526582;border-radius:9px;padding:12px;margin:15px 0;color:#cbd9e9}.coach-settings legend{color:#ffdf91;font-weight:800}.coach-settings p,.coach-settings small{font-size:12px;display:block}.coach-settings label{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:9px 0}.coach-settings select{background:#20344e;color:white;border:1px solid #6a809e;border-radius:5px;max-width:65%;padding:6px}
#coach-result{border:1px solid #607d9c;border-radius:9px;background:#172a42;padding:10px;margin:12px 0;text-align:left;color:#e3eaf2}#coach-result[hidden]{display:none}#coach-result h3{font-size:14px;margin:0 0 7px;color:#f6dfa2}#coach-result h3 small{font-size:10px;color:#adbdce;float:right}#coach-result dl{margin:0;max-height:166px;overflow:auto;overscroll-behavior:contain}#coach-result dt{font-size:11px;color:#8ed8c9;font-weight:800;margin-top:7px}#coach-result dd{font-size:12px;line-height:1.6;margin:2px 0 7px}#coach-result button{display:block;margin:8px 0 0;width:100%;padding:7px;border:1px solid #7586a1;border-radius:6px;background:#29405c;color:#fff}
#combat-result.has-coach{position:fixed;top:50%;left:50%;width:min(490px,calc(100vw - 32px));max-height:calc(100dvh - 24px);overflow:auto;overscroll-behavior:contain;box-sizing:border-box;z-index:90}#combat-result.has-coach #result-continue:not([hidden]){position:sticky;bottom:0;z-index:1;display:block;width:100%;margin-top:8px}
.coach-content{font-size:13px;line-height:1.7;color:#d5e0ef}.coach-content p{overflow-wrap:anywhere}.coach-disclosure,.coach-note{color:#aebed3;font-size:12px}.coach-actions{display:flex;gap:8px;flex-wrap:wrap}.coach-actions button,.coach-content summary{padding:9px;background:#223750;border:1px solid #56708e;border-radius:6px;color:#e9f1ff;cursor:pointer}.coach-actions button:disabled{opacity:.4;cursor:default}.coach-summary{color:#f1d895}.coach-advice,.coach-diagnosis{border:1px solid #4c6485;background:#182940;border-radius:9px;margin:10px 0;padding:12px}.coach-advice h3,.coach-diagnosis h3{font-size:14px;margin:0 0 5px;color:#f4dfa3}.coach-advice p{margin:0}.coach-diagnosis{border-color:#b47d76}.coach-delta{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.coach-delta span{background:#213d48;padding:3px 7px;border-radius:4px;font-size:12px}.coach-delta b{color:#92e1c3}.coach-content details{margin:12px 0}.coach-unit-list{display:grid;gap:6px}.coach-unit-list>span{background:#20334a;padding:6px;border-radius:5px}.coach-roster{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:8px}.coach-roster article{background:#21334b;border:1px solid #425b7b;border-radius:6px;padding:10px}.coach-roster p{font-size:12px}
@media(max-height:500px){#combat-result.has-coach{padding:10px 16px}#combat-result.has-coach .result-sparkles{display:none}#combat-result.has-coach h2{font-size:25px;margin:2px}#combat-result.has-coach #result-description{font-size:10px;margin:5px}#combat-result.has-coach .result-rewards{margin:6px;gap:5px;flex-wrap:wrap}#coach-result dl{max-height:110px}.coach-content{font-size:12px}.coach-advice{padding:9px}}
@media(prefers-reduced-motion:reduce){#coach-result{animation:none}}
#strategy-overlay:has(.coach-content) .strategy-panel>header{position:sticky;top:-20px;background:#26344f;z-index:2;padding-bottom:6px}
@media(max-height:500px){body.playing #combat-result.has-coach #result-title{font-size:30px;letter-spacing:-1px;margin:3px 0}#coach-result dl{max-height:160px}#coach-result dd{font-size:11px}}
@media(max-height:500px) and (min-width:600px){
 #combat-result.has-coach{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:5px 12px;width:min(770px,calc(100vw - 36px));padding:10px 14px}
 #combat-result.has-coach #result-overline{grid-column:1;grid-row:1;margin:0;font-size:9px}
 #combat-result.has-coach #result-title{grid-column:1;grid-row:2}
 #combat-result.has-coach #result-description{grid-column:1;grid-row:3;max-height:95px;overflow:auto;line-height:1.4;margin:0}
 #combat-result.has-coach #result-rewards{grid-column:1;grid-row:4;font-size:10px;margin:2px;flex-wrap:wrap}
 #combat-result.has-coach #result-rewards span{padding:4px 6px}
 #combat-result.has-coach #battle-analysis-btn{grid-column:1;grid-row:5;padding:5px}
 #combat-result.has-coach #coach-result{grid-column:2;grid-row:1 / span 5;margin:0;padding:9px;text-shadow:none}
 #combat-result.has-coach #coach-result dl{max-height:195px}
 #combat-result.has-coach #result-continue{grid-column:1 / -1;grid-row:6;margin-top:3px;padding:8px}
}
.coach-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin:10px 0}.coach-tabs button{background:#223750;color:#dce6f4;border:1px solid #56708e;border-radius:6px;padding:9px 4px;font-size:12px;font-weight:700;cursor:pointer}.coach-tabs button[aria-selected=true]{color:#ffe3a0;border-color:#e0bf78;background:#354462}.coach-tabs button:focus-visible{outline:2px solid #9de5f5;outline-offset:2px}.coach-compare{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px;font-size:12px}.coach-compare b{color:#a9e8d0;text-align:right}.coach-content li{margin:5px 0;overflow-wrap:anywhere}.coach-content small{color:#aebed3}.coach-content #coach-tabpanel{min-width:0}.coach-content #coach-tabpanel>h3{font-size:13px;color:#ecdaa7}.coach-content [role=tabpanel] .coach-advice p+p{border-top:1px solid #445775;padding-top:8px;margin-top:8px}
@media(max-height:500px){.coach-tabs button{padding:7px 2px;font-size:11px}.coach-tabs{gap:3px}.coach-content .coach-compare{font-size:11px}.coach-content>.coach-advice{padding:7px;margin:6px 0}}
.coach-overview{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.25fr);gap:8px}.coach-overview>.coach-advice{min-width:0}
@media(max-height:500px){#strategy-overlay:has(.coach-content) .strategy-panel>header{padding-bottom:4px}#strategy-overlay:has(.coach-content) #strategy-title{font-size:20px;margin:3px 0}.coach-disclosure{font-size:10px;line-height:1.25;margin:3px 0}.coach-disclosure br{display:none}.coach-actions button{padding:5px 8px;font-size:11px}.coach-summary{font-size:10px;line-height:1.3;margin:4px 0}.coach-overview{gap:5px}.coach-overview>.coach-advice{margin:3px 0;padding:6px}.coach-overview h3{font-size:12px;margin-bottom:2px}.coach-overview p{font-size:11px;line-height:1.4}.coach-tabs{position:sticky;top:45px;z-index:1;background:#26344f;padding:3px 0;margin:3px 0}}

/* Timeout evidence stays inside the existing result card, including when coach is off. */
#combat-result.has-judgment{position:fixed;top:50%;left:50%;max-height:calc(100dvh - 24px);width:min(600px,calc(100vw - 32px));overflow:auto;overscroll-behavior:contain;z-index:90}
#combat-result.has-judgment #result-continue:not([hidden]){position:sticky;bottom:0;z-index:1;display:block;width:100%}
body.playing #combat-result.judgment-win #result-title{color:#b8ecff;filter:drop-shadow(0 3px #244c72)}
.judgment-summary{display:block;text-align:left;line-height:1.5}.judgment-summary strong,.judgment-summary small{display:block;margin:4px 0}.judgment-metrics{display:grid;grid-template-columns:minmax(0,1.6fr) repeat(2,minmax(0,1fr));gap:3px 8px;font-size:11px;margin:7px 0}.judgment-metrics b{white-space:normal}.judgment-criteria{display:grid;grid-template-columns:1fr 1fr;gap:0 8px}.judgment-criteria small{font-size:10px}
@media(max-height:500px){body.playing #combat-result.has-judgment #result-title{font-size:28px;letter-spacing:-1px;margin:4px 0}#combat-result.has-judgment .result-sparkles{display:none}#combat-result.has-judgment{padding:10px 14px}#combat-result.has-judgment.has-coach{width:min(800px,calc(100vw - 32px))}#combat-result.has-judgment #result-description{max-height:180px;overflow:auto;margin:4px 0}.judgment-metrics{font-size:10px}}

body.playing #combat-result.has-judgment #result-description{background:rgba(12,25,40,.94)}
@media(max-height:500px){.judgment-summary>strong::after{content:'아래로 스크롤하여 전체 판정 근거 확인';display:block;color:#b9d7ea;font-size:9px;font-weight:400}}
#coach-fold{display:none}
#strategy-overlay.coach-floating{position:fixed!important;inset:auto;display:block!important;padding:0!important;background:none!important;backdrop-filter:none!important;transform:none!important;z-index:110;pointer-events:auto}
#strategy-overlay.coach-floating.hidden{display:none!important}
#strategy-overlay.coach-floating .strategy-panel{position:static!important;box-sizing:border-box;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;margin:0!important;padding:0!important;transform:none!important;display:flex;flex-direction:column;overflow:hidden;border:1px solid #56708e;border-radius:8px;box-shadow:0 2px 8px #0004;background:#182940!important}
#strategy-overlay.coach-floating .strategy-panel>header{position:relative!important;top:0!important;display:flex;align-items:center;flex:0 0 44px;min-height:44px;padding:0 4px 0 8px!important;gap:2px;background:#26344f}
#strategy-overlay.coach-floating .strategy-panel>header>small{display:none}
#strategy-overlay.coach-floating #strategy-title{order:-1;flex:1;min-width:0;font-size:13px!important;margin:0!important;line-height:1.2}
#strategy-overlay.coach-floating #strategy-close,#strategy-overlay.coach-floating #coach-fold{display:block;position:static!important;transform:none!important;flex:0 0 44px;width:44px;height:44px;min-height:44px;padding:0;margin:0;font-size:12px}
#strategy-overlay.coach-floating #strategy-content{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:8px;scrollbar-width:thin}
#strategy-overlay.coach-floating.coach-collapsed #strategy-content{display:none}
#strategy-overlay.coach-floating .coach-overview{grid-template-columns:1fr}
#strategy-overlay.coach-floating .coach-tabs{position:static;grid-template-columns:1fr 1fr}
#strategy-overlay.coach-floating .coach-tabs button,#strategy-overlay.coach-floating .coach-actions button,#strategy-overlay.coach-floating summary{min-height:44px}
#strategy-overlay.coach-floating .coach-compare{display:block}
#strategy-overlay.coach-floating .coach-compare>b{display:block;text-align:left;margin-bottom:5px}

#strategy-overlay.coach-floating .coach-content{display:flex;flex-direction:column}
#strategy-overlay.coach-floating .coach-overview{order:-3}
#strategy-overlay.coach-floating .coach-tabs{order:-2}
#strategy-overlay.coach-floating #coach-tabpanel{order:-1}
#strategy-overlay.coach-floating .coach-advice{margin:4px 0;padding:8px}

/* Work coach contract: same analysis, compact nonmodal material and controls. */
#strategy-overlay.coach-floating .strategy-panel{border:1px solid #91b6a8;border-radius:6px;background:#132e3af5!important;box-shadow:0 4px 9px #061a2655;font-size:13px;line-height:1.5}
#strategy-overlay.coach-floating .strategy-panel>header{padding-left:12px!important;background:none}
#strategy-overlay.coach-floating #strategy-title{font-size:14px!important;color:#f0d995}
#strategy-overlay.coach-floating #coach-fold,#strategy-overlay.coach-floating #strategy-close{font-size:22px;border:0;background:transparent}
#strategy-overlay.coach-floating #strategy-content{padding:0 12px 12px}
#strategy-overlay.coach-floating .coach-advice{padding:8px 0;border:0;border-bottom:1px solid #91b6a855;border-radius:0;background:none;box-shadow:none}
#strategy-overlay.coach-floating .coach-advice h3{font-size:13px;color:#f0d995}
#strategy-overlay.coach-floating .coach-tabs{grid-template-columns:repeat(4,minmax(0,1fr));gap:2px}
#strategy-overlay.coach-floating .coach-tabs button{font-size:11px;padding:2px;min-width:0}
/* 결정 146: 결론 → 상태 줄 → 추천 행동 카드 → 접힌 근거. 같은 분석 결과를 CoachPanel.arrange가 재배치, 여기서는 표시만. 본문 13px 이상 */
#strategy-overlay.coach-floating .coach-tools{display:flex;gap:2px;margin:0}
#strategy-overlay.coach-floating .coach-tools button{flex:0 0 44px;width:44px;height:44px;min-height:44px;padding:0;background:none;border:0;color:#b7f9ec;font-size:18px;line-height:1;cursor:pointer}
#strategy-overlay.coach-floating .coach-tools button:disabled{opacity:.35;cursor:default}
#strategy-overlay.coach-floating .coach-verdict{order:0;margin:0 0 4px;font-size:15px;font-weight:800;line-height:1.4;color:#fff4cf}
#strategy-overlay.coach-floating .coach-summary{order:0;margin:0 0 6px;font-size:13px;line-height:1.45;color:#d0e0e4}
#strategy-overlay.coach-floating .coach-cards{order:0;display:flex;flex-direction:column;gap:6px}
#strategy-overlay.coach-floating .coach-cards .coach-advice{position:relative;margin:0;padding:8px 8px 8px 38px;background:#0a2133f0;border:1px solid #b7f9ec44}
#strategy-overlay.coach-floating .coach-cards .coach-advice::before{content:attr(data-coach-icon);position:absolute;left:8px;top:8px;width:22px;height:22px;display:grid;place-items:center;border-radius:50%;background:#16304a;border:1px solid #b7f9ec88;color:#ffd866;font-size:12px;line-height:1}
#strategy-overlay.coach-floating .coach-cards .coach-advice h3{margin:0;font-size:13px;color:#b7f9ec}#strategy-overlay.coach-floating .coach-cards .coach-advice p{margin:2px 0 0;font-size:13px;line-height:1.45;color:#f6f7ee}
#strategy-overlay.coach-floating .coach-evidence{order:0;margin-top:8px}#strategy-overlay.coach-floating .coach-evidence>summary{font-size:13px;color:#b7f9ec;cursor:pointer}
#strategy-overlay.coach-floating #strategy-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
