/* ListaWG — Trench Crusade: 40K-style layout. All rules/data unchanged. */
#tcModule {--tc-edge:var(--line,#524e43);--tc-paper:var(--panel,#252521);--tc-card:var(--panel2,#302e28);--tc-ink:var(--text,#eee9dd);--tc-soft:var(--muted,#b4afa2);--tc-gold:var(--accent,#c9a350);background:var(--bg);color:var(--tc-ink);padding:clamp(12px,2.2vw,28px);min-height:100dvh}
#tcModule .tc-shell{max-width:1520px;width:100%;margin-inline:auto}
#tcModule .tc-head{align-items:center;justify-content:center;min-height:88px;padding:8px 0 16px;margin-bottom:10px;border-bottom:1px solid var(--tc-edge)}
#tcModule .tc-head-identity{flex:0 1 auto;text-align:center;min-width:0}
#tcModule .tc-head-identity .lw-game-logo{max-height:96px;max-width:min(460px,92vw);width:auto;height:auto;object-fit:contain}
#tcModule .tc-menu-view{max-width:1180px;margin:16px auto}
#tcModule .tc-menu-intro{padding:12px 4px 18px;border-bottom:1px solid var(--tc-edge);margin-bottom:18px}
#tcModule .tc-menu-intro h3{font:700 clamp(19px,2vw,26px)/1.25 Georgia,'Times New Roman',serif;color:var(--tc-ink);letter-spacing:0;margin:4px 0 7px}
#tcModule .tc-menu-intro p{font-size:14px;line-height:1.5}
#tcModule .tc-menu-actions{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
#tcModule .tc-menu-card{min-height:110px;border:1px solid var(--tc-edge);border-radius:8px;background:var(--tc-paper);box-shadow:0 2px 8px rgba(0,0,0,.08);padding:15px;transition:border-color .15s,background .15s;cursor:pointer}
#tcModule .tc-menu-card:hover,#tcModule .tc-menu-card:focus-visible{border-color:var(--tc-gold);background:var(--tc-card)}
#tcModule .tc-menu-card strong{font:700 16px/1.3 Georgia,'Times New Roman',serif}
#tcModule .tc-menu-card small{font-size:12px;line-height:1.45}
#tcModule .tc-menu-card>span{color:var(--tc-gold)}
#tcModule .tc-menu-primary{border-color:var(--tc-gold);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--tc-gold) 24%,transparent)}
#tcModule .tc-faction-dropdown{background:var(--tc-paper);border:1px solid var(--tc-edge);border-radius:8px;padding:18px}
#tcModule .tc-faction-options{grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
#tcModule .tc-faction-option{min-height:66px;border-radius:6px;border:1px solid var(--tc-edge);background:var(--tc-card);color:var(--tc-ink);font-size:14px;gap:8px}
#tcModule .tc-faction-option:hover,#tcModule .tc-faction-option:focus-visible{border-color:var(--tc-gold);background:var(--tc-paper)}
#tcModule .tc-faction-option span{font-size:10px;white-space:normal;text-align:right}
#tcModule .tc-builder-nav{position:relative;display:flex;flex-wrap:wrap;padding:11px 14px;margin-top:12px;background:var(--tc-paper);border:1px solid var(--tc-edge);border-radius:8px;gap:12px;min-height:54px}
#tcModule .tc-builder-nav>div{text-align:right;min-width:0}
#tcModule .tc-builder-nav strong{color:var(--tc-gold);font:700 clamp(15px,1.45vw,20px)/1.25 Georgia,'Times New Roman',serif}
#tcModule .tc-builder-nav button{border-radius:6px;background:var(--tc-card);font:700 13px/1.3 Georgia,'Times New Roman',serif;min-height:40px}
#tcModule .tc-builder-nav button:hover{border-color:var(--tc-gold)}
#tcModule .tc-builder-grid{grid-template-columns:minmax(300px,.9fr) minmax(430px,1.25fr);gap:14px;align-items:start}
#tcModule .tc-roster-panel,#tcModule .tc-catalog-panel,#tcModule .tc-faction-select{background:var(--tc-paper);border:1px solid var(--tc-edge);border-radius:8px;padding:clamp(12px,1.5vw,20px);min-width:0}
#tcModule .tc-roster-panel{position:sticky;top:16px;max-height:calc(100dvh - 35px);overflow:auto;overscroll-behavior:contain}
#tcModule .tc-catalog-stack{min-width:0}
#tcModule .tc-roster-panel h3,#tcModule .tc-catalog-head h3,#tcModule .tc-section-title h3{font:700 clamp(16px,1.45vw,20px)/1.3 Georgia,'Times New Roman',serif}
#tcModule .tc-unit-card,#tcModule .tc-faction-card{background:var(--tc-card);border:1px solid var(--tc-edge);border-radius:7px}
#tcModule .tc-unit-card{margin:9px 0;padding:14px}
#tcModule .tc-unit-main h4{font:700 16px/1.3 Georgia,'Times New Roman',serif}
#tcModule .tc-unit-stats span{background:var(--tc-paper);border-radius:4px;min-width:52px}
#tcModule .tc-unit-stats small{font-size:10px}
#tcModule .tc-unit-stats b{font-size:12px}
#tcModule .tc-unit-cost b,#tcModule .tc-total b{color:var(--tc-gold)}
#tcModule button,#tcModule input,#tcModule select,#tcModule textarea{font-family:inherit}
#tcModule button:focus-visible,#tcModule input:focus-visible,#tcModule select:focus-visible,#tcModule textarea:focus-visible{outline:2px solid var(--tc-gold);outline-offset:2px}
#tcModule .tc-unit-foot button,#tcModule .tc-qty button{border-radius:5px;min-height:36px}
/* Higher-than-module modal, fixed to viewport; outer scroll remains inside dialog. */
#tcModule .tc-saved-modal{position:fixed;inset:0;z-index:50010;display:flex;align-items:center;justify-content:center;box-sizing:border-box;height:100dvh;max-height:100dvh;padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));overflow:auto}
#tcModule .tc-saved-modal[hidden]{display:none!important}
#tcModule .tc-saved-dialog{box-sizing:border-box;margin:auto;width:min(900px,100%);max-height:calc(100dvh - 28px);overflow-y:auto;overscroll-behavior:contain;border-radius:8px;background:var(--tc-paper)}
@media(max-width:1050px){#tcModule .tc-builder-grid{grid-template-columns:minmax(0,1fr)}#tcModule .tc-roster-panel{position:static;max-height:none;overflow:visible}#tcModule .tc-faction-options{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){#tcModule{padding:12px max(10px,env(safe-area-inset-right)) 16px max(10px,env(safe-area-inset-left))}#tcModule .tc-head{min-height:64px}#tcModule .tc-head-identity{text-align:center}#tcModule .tc-head-identity .lw-game-logo{max-height:70px}#tcModule .tc-menu-actions,#tcModule .tc-faction-options{grid-template-columns:1fr}#tcModule .tc-menu-card{min-height:86px}#tcModule .tc-builder-nav{align-items:stretch;flex-direction:column}#tcModule .tc-builder-nav>div{text-align:left}#tcModule .tc-builder-nav button{width:100%}#tcModule .tc-faction-dropdown{padding:12px}#tcModule .tc-roster-panel,#tcModule .tc-catalog-panel{padding:12px}#tcModule .tc-saved-dialog{max-height:calc(100dvh - 24px)}}
