/* Battle command reference, v12. One responsive composition for live play. */
.view-battle .brand:before{display:none}
.view-battle{--ink:#10282b;--gold:#ac9567;--jade:#80cfca;--paper:#e8e1d1;--font-body:"PMingLiU","MingLiU","Songti TC","Noto Serif TC",serif;--font-calligraphy:"DFKai-SB","BiauKai","KaiTi","STKaiti",serif;--font-numeric:Georgia,"Times New Roman",serif;--serif:var(--font-body);font-family:var(--font-body);background:var(--ink);color:#eee4ce;overflow:hidden}
.view-battle button,.view-battle input,.view-battle select{font-family:inherit}
.view-battle button:focus-visible,.view-battle summary:focus-visible{outline:2px solid #cfb777;outline-offset:3px}
.view-battle button{border-radius:1px}.view-battle [hidden]{display:none!important}
.view-battle .masthead{height:64px;padding:0 20px;gap:22px;position:relative;z-index:20;background:radial-gradient(ellipse at 60% 0,#30403e80,transparent 65%),repeating-linear-gradient(134deg,#c0ad8604 0 1px,transparent 1px 5px),#10262a;border-bottom:2px solid #a68c5e;box-shadow:0 3px 16px #0005}
.view-battle .brand{flex-shrink:0;gap:8px}.view-battle .brand h1{font:34px var(--font-calligraphy);letter-spacing:2px;color:#e3c38e;white-space:nowrap}.view-battle .brand .seal{display:none}.view-battle .brand div>span{display:none}.view-battle .prototype{display:none}.view-battle .top-right{margin-left:0}.view-battle .icon-button{border:0;background:transparent;color:#d8bf8e;font-size:24px;min-height:36px;height:36px;width:36px}
.view-battle .masthead .battle-top{display:flex;flex:1;justify-content:space-between;align-items:center;gap:20px;margin:0;min-height:0}
.view-battle .phase-heading>div{display:flex;gap:12px;align-items:center}.view-battle .round-badge{font-size:17px;color:#e7d8bc;white-space:nowrap;margin:0}.view-battle .phase-heading h2{font:21px var(--font-calligraphy);letter-spacing:2px;margin:0;white-space:nowrap}.view-battle .phase-pill{display:none}
.view-battle .battle-stats{display:flex;gap:22px;align-items:center;width:auto;padding:0;border:0}.view-battle .stat{display:flex;align-items:center;gap:9px;color:#b8b39f;font-size:13px;white-space:nowrap}.view-battle .stat b{font:26px var(--font-numeric);color:var(--jade);margin:0}.view-battle #enemyScore{color:#dc8277}.view-battle .stat:nth-child(2){display:none}.view-battle .clock{order:-1;padding-right:20px;border-right:1px solid #a78f5d40;font:25px var(--font-numeric);min-width:88px;color:#e2cfaa;white-space:nowrap}.view-battle .clock.urgent{color:#ee9a80}.view-battle .battle-stats>button{padding:5px 9px;background:transparent;border:1px solid #a78f5d50;min-height:32px;font-size:12px;color:#d7c7a6}
.view-battle .battle-shell{height:calc(100dvh - 64px);padding:0;max-width:none;position:relative}.view-battle .battle-layout,.view-battle .battle-layout.orders-open,.view-battle .battle-layout:not(.orders-open){display:grid;grid-template-columns:minmax(0,1fr) clamp(310px,24vw,410px);gap:0;max-width:none;margin:0;width:100%;height:100%;align-items:stretch}
.view-battle .battle-stage{display:grid;grid-template-rows:minmax(0,1fr) clamp(132px,19.5vh,195px) 32px;min-width:0;min-height:0;overflow:hidden;position:relative}
.view-battle .field-wrap{position:relative;min-height:0;overflow:hidden;border:0;border-bottom:2px solid #8c7c54;background:#68704b}.view-battle .canvas-wrap{position:absolute;inset:0;width:100%;height:100%!important;min-height:0!important;aspect-ratio:auto!important}.view-battle .canvas-wrap:after{content:"";position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 60px #18241b30}.view-battle .field-top{display:none}
.view-battle .campaign-time{display:block;position:absolute;top:14px;left:16px;width:198px;z-index:7;padding:8px 12px;background:linear-gradient(90deg,#172e2bdc,#172e2b8c);border:1px solid #b8a67550;pointer-events:none;box-shadow:0 3px 10px #0002}.view-battle .campaign-time>b{font:22px var(--font-calligraphy);color:#e6d6b2;margin:0 8px 0 0}.view-battle .campaign-time>span{font-size:10px;color:#c8ccba}.view-battle .day-timeline{display:flex;gap:5px;margin-top:7px}.view-battle .day-timeline span{font-size:0;border:0;padding:0;height:3px;flex:1;background:#d0ceb339}.view-battle .day-timeline .current{background:#e3c985}
.view-battle .enemy-intel,.view-battle .battle-dispatch{position:absolute;top:85px;left:16px;z-index:9;font-size:12px;color:#e1d3af}.view-battle .battle-dispatch{left:115px}.view-battle .enemy-intel summary,.view-battle .battle-dispatch summary{cursor:pointer;list-style:none;padding:6px 10px;background:#102a28d9;border:1px solid #b59d6950}.view-battle .enemy-roster,.view-battle .battle-dispatch .event-strip{width:280px;max-width:75vw;margin:0;padding:12px;background:#102a28f2;border:1px solid #b59d6950;line-height:1.9;font-size:12px}.view-battle .event-strip b{display:none}.view-battle .events{white-space:normal}.view-battle .guide,.view-battle .connection{position:absolute;top:124px;left:16px;right:16px;max-width:430px;z-index:9;font-size:12px}.view-battle .connection:empty,.view-battle .guide:empty{display:none}
.view-battle .field-hint{bottom:13px;left:16px;z-index:7;max-width:46%;background:#132c29dc;border-left:2px solid #c9b079;padding:7px 10px;font-size:12px;line-height:1.5;color:#ece1c4}.view-battle .map-tools{top:auto;bottom:13px;right:12px;z-index:10;display:flex;gap:3px;max-width:none;padding:4px;background:#10282beb;border:1px solid #b39a6a70}.view-battle .map-tools>.view-preset,.view-battle .camera-options>summary{width:auto;min-width:0;min-height:30px;padding:6px 9px;font-size:11px;line-height:18px;border:0;background:#29413e;color:#e3d6b8;list-style:none;cursor:pointer}.view-battle .map-tools>.view-preset:hover,.view-battle .camera-options>summary:hover{background:#3d5750}.view-battle .camera-options{position:relative}.view-battle .camera-options-body{position:absolute;bottom:39px;right:-4px;display:grid;grid-template-columns:repeat(4,38px);gap:4px;padding:9px;background:#132d2bf5;border:1px solid #b39a6a80}.view-battle .camera-options-body button{width:auto;min-width:0;min-height:34px;padding:4px;font-size:15px}.view-battle .camera-options-body #moveCamera{grid-column:span 2;font-size:11px}
.view-battle .unit-cards{position:static;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;padding:10px 14px;margin:0;overflow:visible;background:repeating-linear-gradient(135deg,#d8c8a505 0 1px,transparent 1px 6px),linear-gradient(110deg,#112b2c,#203737 55%,#102729);border-bottom:1px solid #a18a5a60}
.view-battle .unit-card{display:grid;grid-template-columns:45% minmax(0,1fr);grid-template-rows:1fr;gap:0;min-width:0;min-height:0;height:100%;padding:0;overflow:hidden;position:relative;text-align:left;border:1px solid #8c7e5a9c;background:linear-gradient(105deg,#253a37,#10282b);box-shadow:inset 0 0 0 3px #a9956310;transition:border-color .15s,box-shadow .15s;flex:auto}
.view-battle .unit-card:hover{border-color:#d2be89}.view-battle .unit-card.selected{border-color:#f4e2b5;background:linear-gradient(100deg,#354c42,#173133);box-shadow:0 0 0 1px #e9d4a5,0 0 12px #efdb9e8c,inset 0 0 16px #e6ca8a16}.view-battle .unit-card.lost{filter:grayscale(.8);opacity:.55}
.view-battle .unit-card .headshot{display:block;position:relative;float:none;width:100%;height:100%;min-height:0;margin:0;border:0;border-right:1px solid #9d8c6050;overflow:hidden;background:radial-gradient(ellipse at 50% 38%,#72776e,#333f3e 65%,#142d2f)}.view-battle .unit-card .headshot img{position:static;width:100%;height:100%;display:block;object-fit:cover;object-position:52% 48%;margin:0;transform:scale(1.08)}
.view-battle .unit-copy{display:flex;flex-direction:column;justify-content:center;align-items:stretch;min-width:0;gap:0;padding:9px 8px}.view-battle .unit-name{font:clamp(18px,1.7vw,29px) var(--font-calligraphy);line-height:1.2;color:#f2e1bc;letter-spacing:1px;white-space:nowrap;padding:0;border-bottom:1px solid #baaa7750;padding-bottom:7px}.view-battle .unit-type{font-size:12px;margin:8px 0 0;color:#cdcbb3;white-space:nowrap}.view-battle .unit-type b{font-weight:400;color:#e7d9b5;font-size:17px;margin-right:5px}.view-battle .unit-number{display:flex;align-items:baseline;gap:5px;font:22px var(--font-numeric);line-height:1.2;margin:9px 0 0;color:#eee6d5;white-space:nowrap}.view-battle .unit-number small{font:11px var(--font-body);color:#bfc6b3}.view-battle .morale-row{display:flex;align-items:center;gap:6px;margin-top:9px;font-size:11px;color:#bfc6b3}.view-battle .morale-bars{display:flex;flex:1;gap:3px;margin:0;min-width:0}.view-battle .morale-bars i{flex:1;min-width:0;height:9px;transform:skewX(-18deg);border:1px solid #83c8bd55;background:#183a3a}.view-battle .morale-bars i.on{background:linear-gradient(#b1e7db,#75c5bd)}.view-battle .morale-bars.low i.on{background:#cf8a65}.view-battle .unit-status{display:none}.view-battle .unit-slot{position:absolute;top:4px;left:4px;z-index:2;font:15px var(--font-numeric);padding:3px 5px;background:#152e2ded;border:1px solid #c3ae79a0;color:#eee1c0}
.view-battle .field-legend{grid-row:3;display:flex;align-items:center;gap:23px;min-width:0;white-space:nowrap;margin:0;padding:5px 18px;border:0;background:#10282b;color:#c3c1ac;font-size:12px;line-height:1.4}.view-battle .field-legend span:last-child{margin-left:auto;color:#a7b9ae}.view-battle .base-bars{display:none}.view-battle .battle-command-dock{display:none}
.view-battle .orders-panel{position:relative;display:flex;flex-direction:column;min-height:0;height:100%;max-height:none!important;overflow:auto;gap:0;padding:0 19px 0;border:0;border-left:5px double #927d56;color:#282e29;background:radial-gradient(ellipse at 20% 12%,#fff9e3a8,transparent 55%),repeating-linear-gradient(135deg,#7d633908 0 1px,transparent 1px 4px),linear-gradient(105deg,#d9d0bd,#eee8d9 60%,#d9d0bd);box-shadow:inset 0 0 0 5px #50483018,inset 9px 0 20px #66543922}
.view-battle .orders-panel .panel-toggle{display:none}.view-battle .order-title{display:none}.view-battle .command-title{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-shrink:0;padding:15px 0 13px;border-bottom:1px solid #9a8c705e;margin-bottom:14px}.view-battle .command-title strong{font:51px var(--font-calligraphy);letter-spacing:5px;color:#151e1e;line-height:1.1;white-space:nowrap}.view-battle .command-title span{font:12px var(--font-calligraphy);line-height:1.8;letter-spacing:1px;color:#5b584b}.view-battle .command-title i{writing-mode:vertical-rl;background:#92443b;color:#e9d7b5;border:1px solid #b99f76;padding:3px 1px;font:10px var(--font-calligraphy);font-style:normal}
.view-battle .commander-heading{display:grid;grid-template-columns:46% minmax(0,1fr);gap:15px;align-items:stretch;border:0;padding:0;margin:0 0 15px;min-height:0;flex-shrink:0}.view-battle .commander-heading:before{display:none}.view-battle .commander-portrait{position:relative;width:100%;height:clamp(165px,23vh,242px);padding:0;margin:0;overflow:hidden;border:1px solid #786b4b;outline:2px solid #d1c29e;outline-offset:2px;background:radial-gradient(ellipse at 50% 38%,#93988d,#465453 70%,#203536);box-shadow:inset 0 0 20px #0005}.view-battle .commander-portrait img{display:block;width:100%;height:100%;object-fit:cover;object-position:52% 48%;transform:scale(1.04)}.view-battle .commander-details{display:flex;flex-direction:column;justify-content:center;min-width:0}.view-battle .commander-heading h3{font:clamp(31px,2.8vw,47px) var(--font-calligraphy);color:#202724;line-height:1.15;letter-spacing:2px;margin:0 0 6px;white-space:nowrap}.view-battle .commander-motto{font:15px var(--font-calligraphy);color:#645d4b;letter-spacing:2px;padding-bottom:10px;margin-bottom:10px;border-bottom:1px solid #8f80604d}.view-battle .commander-type{display:flex;align-items:center;gap:7px;font:22px var(--font-calligraphy);margin-bottom:9px;white-space:nowrap}.view-battle .troop-glyph{font-size:22px;border:1px solid #766b4c80;padding:1px 4px;color:#444f44}.view-battle .commander-specialty{font-size:11px;line-height:1.6;color:#77715e;margin-bottom:10px}.view-battle .commander-stat{display:flex;align-items:center;justify-content:space-between;gap:6px;line-height:1.7;font-size:13px;white-space:nowrap}.view-battle .commander-stat b{font:23px var(--font-numeric);font-weight:400}.view-battle .commander-stat .morale-bars{flex:0 1 85px}.view-battle .commander-stat .morale-bars i{height:10px;border-color:#427b7155}
.view-battle .draft-heading{flex-shrink:0;margin:0 0 10px;padding:5px 8px;border:0;border-left:2px solid #a28c5a;background:#9e8d6020;color:#645d49;font-size:11px}.view-battle .passive-box{background:transparent;padding:0;border:0;color:#65624f;font-size:12px;line-height:1.7;margin:0 0 14px}.view-battle .commander-heading+.passive-box{display:none}
.view-battle .command-tabs{display:grid;grid-template-columns:repeat(3,1fr);flex-shrink:0;gap:4px;margin:0 -4px 19px;border:0}.view-battle .command-tabs button{min-height:47px;padding:9px 2px;font:21px var(--font-calligraphy);letter-spacing:2px;color:#363e34;border:1px solid #a1947880;background:linear-gradient(#d2cebd,#ded9c9);box-shadow:inset 0 1px 0 #fff7}.view-battle .command-tabs button[aria-selected=true]{position:relative;background:linear-gradient(135deg,#315c5b,#193e41);color:#f6ebd2;border-color:#3a5a52;box-shadow:inset 0 0 0 2px #b6a06a3a}.view-battle .command-tabs button[aria-selected=true]:after{content:"";position:absolute;bottom:-7px;left:calc(50% - 7px);border-width:7px 7px 0;border-style:solid;border-color:#24494a transparent transparent}
.view-battle .command-pane{flex:1 0 auto;min-height:145px}.view-battle .command-pane>.label{display:block;font:20px var(--font-calligraphy);color:#383e32;letter-spacing:1px;margin:0 0 12px}.view-battle .route-actions{display:flex;gap:5px;margin:0 0 12px}.view-battle .route-actions button{min-height:32px;padding:5px 8px;background:#f3eddf50;border:1px solid #a7997a;font-size:12px;color:#4e5548}.view-battle .route-actions button.active{background:#285553;color:#fff1ce}.view-battle .orders-list{margin:0;padding:0;border:1px solid #aa9c7e80;border-radius:2px;overflow:hidden}.view-battle .orders-list li{display:flex;align-items:center;gap:10px;margin:0;padding:13px 10px;min-height:57px;border:0;border-bottom:1px solid #aa9c7e70;background:#ffffff0a;font-size:15px;line-height:1.45;color:#30392f}.view-battle .orders-list li:last-child{border-bottom:0}.view-battle .orders-list li>span:first-child{flex:0 0 29px;width:29px;height:29px;border-radius:50%;display:grid;place-items:center;font:21px var(--font-numeric);color:#f9f1db;background:linear-gradient(135deg,#5d9690,#235956);padding:0;box-shadow:inset 0 0 0 1px #ffffff50}.view-battle .orders-list li>span:nth-child(2){flex:1;min-width:0}.view-battle .orders-list small{font-size:11px;color:#777968;margin-top:3px;line-height:1.5}.view-battle .orders-list .remove{font:27px var(--font-body);min-width:30px;min-height:36px;padding:0;border:0;color:#565d50;background:transparent}.view-battle .orders-list li.muted{display:block;padding:19px 15px;font-size:13px;color:#7c7a68;line-height:1.8}.view-battle .forecast-note{font-size:11px;line-height:1.7;color:#7e7964;margin:12px 0 18px}
.view-battle .segmented{display:flex;flex-direction:column;gap:8px}.view-battle .segmented button{min-height:44px;padding:12px;text-align:left;font-size:15px;background:#e3dbc8;color:#4d5549;border-color:#a89978}.view-battle .segmented button.active{background:#2d5953;color:#eee2c2}.view-battle .retreat-row{display:flex;flex-wrap:wrap;font-size:14px;gap:8px;line-height:1.7}.view-battle .retreat-row input{width:68px;background:#f5eedf;color:#394637;border-color:#a99b7c}.view-battle .retreat-row select{width:100%;background:#f5eedf;color:#394637;border-color:#a99b7c;margin-top:10px}.view-battle .retreat-position{min-height:42px;font-size:14px;margin-top:15px;background:#e3dccb;color:#465440;border-color:#a99b7c}
.view-battle .deploy-note{font-size:14px;line-height:1.9;color:#656755;margin:12px 0 15px}.view-battle .deploy-info{font-size:14px;padding:12px 0;border-bottom:1px solid #a99b7c60}.view-battle .watch-heading{padding:10px 0}.view-battle .watch-heading h3{font:23px var(--font-calligraphy)}.view-battle .watch-heading p{font-size:14px}.view-battle .watch-seal{display:none}
.view-battle .orders-panel .command-footer{flex-shrink:0;position:sticky;bottom:0;z-index:5;margin:auto -19px 0;padding:22px 24px 25px;border:0;border-top:1px solid #a99b7c40;background:linear-gradient(#e6dfcfed,#d3c9b5);box-shadow:0 -6px 18px #e4dccda0}.view-battle .command-footer>.primary{width:100%;min-height:59px;font:29px var(--font-calligraphy);letter-spacing:4px;color:#fff0d7;border:1px solid #793b32;background:linear-gradient(115deg,#884237,#a25343 55%,#7c3932);box-shadow:inset 0 0 0 3px #d3a57840,inset 0 0 0 5px #6b322e60,0 3px 5px #6d4a3b30;padding:10px 8px;clip-path:polygon(0 7px,7px 7px,7px 0,calc(100% - 7px) 0,calc(100% - 7px) 7px,100% 7px,100% calc(100% - 7px),calc(100% - 7px) calc(100% - 7px),calc(100% - 7px) 100%,7px 100%,7px calc(100% - 7px),0 calc(100% - 7px))}.view-battle .command-footer p{font:12px var(--font-calligraphy);line-height:1.7;text-align:center;color:#7d7764;margin:10px 0 0}.view-battle .command-footer>#clearDraft{width:100%;min-height:44px;background:#2c514b;color:#eee0c0;font-size:17px}.view-battle .phase-progress{position:absolute;bottom:0;left:0;width:100%;height:2px;margin:0;z-index:22;background:transparent}.view-battle .expanded-map{position:fixed!important;inset:70px 12px 12px!important;width:auto!important;height:auto!important;z-index:30}.view-battle .toast{bottom:190px}
@media(min-width:761px) and (max-width:1250px){.view-battle .masthead{gap:16px;padding-inline:14px}.view-battle .brand h1{font-size:27px}.view-battle .round-badge{font-size:14px}.view-battle .phase-heading h2{font-size:17px}.view-battle .phase-heading>div{gap:6px}.view-battle .battle-stats{gap:12px}.view-battle .stat{font-size:11px;gap:6px}.view-battle .stat b{font-size:22px}.view-battle .clock{font-size:22px;min-width:65px;padding-right:12px}.view-battle .unit-cards{gap:7px;padding:9px}.view-battle .unit-copy{padding:7px}.view-battle .unit-name{font-size:20px;letter-spacing:0}.view-battle .unit-type{font-size:10px}.view-battle .unit-number{font-size:19px}.view-battle .morale-row{font-size:10px;gap:3px}.view-battle .morale-bars{gap:2px}.view-battle .field-legend{font-size:10px;gap:14px;padding-inline:12px}.view-battle .map-tools>.view-preset{font-size:10px;padding-inline:7px}.view-battle #sceneryMode,.view-battle #visualQuality{max-width:80px}.view-battle .field-hint{font-size:10px;max-width:36%}}
@media(min-width:761px) and (max-height:800px){.view-battle .command-title{padding:10px 0;margin-bottom:11px}.view-battle .command-title strong{font-size:43px}.view-battle .commander-portrait{height:160px}.view-battle .commander-heading{margin-bottom:11px;gap:11px}.view-battle .commander-heading h3{font-size:33px}.view-battle .commander-motto{margin-bottom:7px;padding-bottom:7px}.view-battle .commander-specialty{margin-bottom:6px}.view-battle .commander-type{font-size:20px;margin-bottom:6px}.view-battle .command-tabs{margin-bottom:16px}.view-battle .command-tabs button{min-height:42px;font-size:20px}.view-battle .command-pane>.label{font-size:18px;margin-bottom:10px}.view-battle .orders-list li{padding:10px;min-height:50px;font-size:14px}.view-battle .orders-panel .command-footer{padding:16px 21px}.view-battle .command-footer>.primary{min-height:51px;font-size:25px}.view-battle .forecast-note{margin:8px 0 12px;font-size:10px}}
@media(max-width:1000px) and (min-width:761px){.view-battle .brand h1{font-size:23px}.view-battle .round-badge{font-size:12px}.view-battle .battle-stats{gap:7px}.view-battle .stat{font-size:0;gap:0}.view-battle .stat b{font-size:22px}.view-battle .battle-stats>button{font-size:10px;padding:4px 6px}.view-battle .unit-card{grid-template-columns:43% minmax(0,1fr)}.view-battle .unit-copy{padding:5px}.view-battle .unit-name{font-size:16px}.view-battle .unit-number{font-size:16px}.view-battle .morale-row>span,.view-battle .unit-type b{display:none}.view-battle .field-legend span:last-child{display:none}.view-battle #sceneryMode,.view-battle #visualQuality{display:none}.view-battle .field-hint{max-width:48%}}
@media(max-width:760px){
 .view-battle .masthead{height:84px;padding:5px 10px;gap:0;flex-wrap:wrap;align-content:center}.view-battle .brand h1{font-size:24px;letter-spacing:1px}.view-battle .top-right{margin-left:auto}.view-battle .icon-button{width:30px;height:30px;min-height:30px;font-size:20px}.view-battle .masthead .battle-top{flex-basis:100%;order:3;gap:8px;min-height:34px;padding-top:4px}.view-battle .phase-heading>div{gap:7px}.view-battle .round-badge{font-size:11px}.view-battle .phase-heading h2{font-size:14px;letter-spacing:1px}.view-battle .battle-stats{gap:8px;width:auto}.view-battle .stat{font-size:0;gap:0}.view-battle .stat b{font-size:19px}.view-battle .clock{font-size:18px;min-width:48px;padding-right:8px}.view-battle .battle-stats>button{min-height:27px;padding:3px 5px;font-size:10px}.view-battle #battleHome{display:none}
 .view-battle .battle-shell{height:calc(100dvh - 84px)}.view-battle .battle-layout,.view-battle .battle-layout.orders-open,.view-battle .battle-layout:not(.orders-open){display:block;height:100%}.view-battle .battle-stage{height:100%;display:grid;grid-template-rows:minmax(0,1fr) 130px 24px;padding-bottom:55px}.view-battle .field-wrap{height:auto;min-height:0}.view-battle .canvas-wrap{min-height:0!important}.view-battle .campaign-time{top:8px;left:8px;width:160px;padding:7px 9px}.view-battle .campaign-time>b{font-size:17px}.view-battle .campaign-time>span{font-size:9px}.view-battle .enemy-intel,.view-battle .battle-dispatch{top:68px;left:8px;font-size:10px}.view-battle .battle-dispatch{left:92px}.view-battle .guide,.view-battle .connection{top:104px;left:8px;right:8px;font-size:11px}.view-battle .field-hint{left:8px;bottom:48px;max-width:80%;padding:4px 7px;font-size:10px}.view-battle .map-tools{bottom:8px;right:8px;padding:3px}.view-battle .map-tools>.view-preset,.view-battle .camera-options>summary{min-height:27px;padding:4px 7px;font-size:10px}.view-battle #sceneryMode,.view-battle #visualQuality{display:none}.view-battle .camera-options-body{bottom:34px}
 .view-battle .unit-cards{position:static;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));height:130px;padding:7px;gap:5px;border:0;z-index:12}.view-battle .unit-card{display:grid;grid-template-columns:1fr;grid-template-rows:58% 42%;height:100%;min-height:0;min-width:0;gap:0;flex:auto}.view-battle .unit-card .headshot{width:100%;height:100%;float:none;border:0;border-bottom:1px solid #b0a07a50}.view-battle .unit-card .headshot img{object-fit:cover;object-position:50% 39%;transform:scale(1.1)}.view-battle .unit-copy{padding:3px 4px;justify-content:center;gap:0}.view-battle .unit-name{font-size:14px;letter-spacing:0;line-height:1.15;text-align:center;border:0;padding:0}.view-battle .unit-number{justify-content:center;gap:2px;font-size:13px;margin:3px 0 0;line-height:1}.view-battle .unit-number small{font-size:9px}.view-battle .unit-type{display:none}.view-battle .morale-row{margin-top:4px}.view-battle .morale-row>span{display:none}.view-battle .morale-bars{gap:2px}.view-battle .morale-bars i{height:4px}.view-battle .unit-slot{font-size:10px;padding:1px 3px;top:2px;left:2px}.view-battle .field-legend{position:static;grid-row:3;height:auto;padding:4px 8px;gap:9px;font-size:9px}.view-battle .field-legend span:last-child{display:none}
 .view-battle .orders-panel{position:fixed;top:92px;right:8px;bottom:218px;left:8px;display:none;height:auto;max-height:none!important;padding:0 15px;border:3px double #a68d61;background-color:var(--paper);z-index:25;box-shadow:0 10px 50px #071d1e9c;overflow:auto}.view-battle .orders-panel.expanded{display:flex;top:92px;right:8px;bottom:218px;left:8px;width:auto;max-height:none!important;padding:0 15px}.view-battle .orders-panel.expanded>*{display:revert}.view-battle .orders-panel .panel-toggle{display:block;position:absolute;top:10px;right:10px;left:auto;bottom:auto;width:auto;min-height:28px;height:auto;margin:0;padding:4px 7px;border:1px solid #a79b7d;background:#ddd5c3;color:#4e5b4a;font-size:11px;z-index:1}.view-battle .command-title{display:flex!important;padding:11px 0;margin-bottom:11px}.view-battle .command-title strong{font-size:34px}.view-battle .command-title span{font-size:11px;max-width:120px;padding-right:20px}.view-battle .command-title i{display:none}.view-battle .commander-heading{display:grid!important;grid-template-columns:90px 1fr;gap:14px;margin-bottom:12px}.view-battle .commander-portrait{width:90px;height:118px}.view-battle .commander-heading h3{font-size:31px;margin-bottom:4px}.view-battle .commander-motto{font-size:12px;display:inline-block;padding-bottom:5px;margin-bottom:6px}.view-battle .commander-type{font-size:16px;margin-bottom:6px}.view-battle .commander-specialty{display:none}.view-battle .commander-stat{font-size:12px;justify-content:flex-start;gap:15px}.view-battle .commander-stat b{font-size:18px}.view-battle .commander-stat .morale-bars i{height:7px}.view-battle .command-tabs{display:grid!important;margin-bottom:15px}.view-battle .command-tabs button{min-height:38px;font-size:17px}.view-battle .command-pane{min-height:100px}.view-battle .command-pane>.label{font-size:17px}.view-battle .orders-list li{font-size:14px;min-height:49px;padding:8px}.view-battle .forecast-note{font-size:10px}.view-battle .draft-heading{font-size:10px}.view-battle .orders-panel .command-footer{position:sticky;left:auto;right:auto;bottom:0;margin:auto -15px 0;padding:12px 15px;background:linear-gradient(#e7dfcfee,#d7cdb8);z-index:5}.view-battle .command-footer>.primary{min-height:43px;font-size:22px}.view-battle .command-footer p{font-size:10px;line-height:1.5;margin-top:6px}.view-battle .deploy-note{font-size:13px}.view-battle .deploy-info{padding:8px 0;font-size:12px}
 .view-battle .battle-command-dock{position:absolute;display:flex;align-items:center;justify-content:center;bottom:0;left:0;right:0;gap:8px;height:55px;min-height:55px;margin:0;padding:6px 8px;background:#10282b;border-top:1px solid #a18a5a60;z-index:23}.view-battle .battle-command-dock button{width:auto;min-width:0;min-height:39px;margin:0;padding:7px 9px;flex:1;font:17px var(--font-calligraphy);white-space:nowrap}.view-battle #mobileOrders{flex:0 0 36%;background:#294b47;color:#eee0bd;border-color:#a9956260}.view-battle .battle-command-dock>span{font-size:11px}.view-battle .expanded-map{inset:90px 6px 215px!important}.view-battle .toast{bottom:220px;font-size:12px}
}
@media(max-width:360px){.view-battle .masthead{padding-inline:7px}.view-battle .round-badge{font-size:10px}.view-battle .phase-heading h2{font-size:12px}.view-battle .battle-stats{gap:5px}.view-battle .clock{font-size:16px;min-width:43px;padding-right:5px}.view-battle .unit-cards{gap:4px;padding-inline:5px}.view-battle .unit-copy{padding-inline:2px}.view-battle .unit-name{font-size:13px}}
.view-battle .orders-panel{background:linear-gradient(#ffffff20,#ffffff08),url('assets/command-paper-v12.webp') center top/100% 112%;background-color:#e8e1d1}
@media(min-width:761px){.view-battle .orders-panel{overflow:hidden}.view-battle .commander-portrait{height:clamp(155px,21vh,214px)}.view-battle .command-pane{flex:1 1 0;min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:#aa9a77 transparent}.view-battle .orders-panel .command-footer{position:relative;margin-top:10px;padding-bottom:70px;background:linear-gradient(#ede6d6b0,transparent);border:0;box-shadow:none}.view-battle .command-footer p{color:#645c4b;text-shadow:0 1px 2px #f8efd9}}
@media(min-width:761px) and (max-height:800px){.view-battle .orders-panel .command-footer{padding-bottom:58px}}
@media(max-width:760px){.view-battle .orders-panel .command-footer{background:#e5dcc9f5}}
.view-battle .campaign-time>span{white-space:nowrap}
@media(max-width:760px){.view-battle .orders-panel.expanded{height:calc(100dvh - 310px);align-self:stretch}.view-battle .command-title span{padding-right:44px;max-width:150px}.view-battle .commander-heading{flex-shrink:0}.view-battle .command-pane{flex-shrink:0}.view-battle .orders-list li{background:#f5efdf55}}
@media(min-width:761px) and (max-width:1000px){.view-battle .unit-card{grid-template-columns:1fr;grid-template-rows:62% 38%}.view-battle .unit-copy{display:grid;grid-template-columns:1fr 1fr;gap:3px;padding:5px}.view-battle .unit-name{grid-column:1/-1;text-align:center;padding:0;border:0;font-size:17px}.view-battle .unit-type{margin:0;font-size:10px}.view-battle .unit-number{margin:0;font-size:15px;justify-content:flex-end}.view-battle .unit-number small{display:none}.view-battle .morale-row{grid-column:1/-1;margin:0}.view-battle .unit-card .headshot img{object-position:50% 38%}}

/* Brief phase announcement; never intercept battlefield input. */
.phase-transition{position:fixed;inset:0;z-index:90;display:grid;place-items:center;pointer-events:none;background:radial-gradient(ellipse at center,#081d2444,transparent 65%);animation:phase-cue-fade 1.8s ease both}
.phase-transition-card{text-align:center;padding:22px 55px;border-block:1px solid #c8aa63aa;background:linear-gradient(90deg,transparent,#102c2df2 18%,#102c2df2 82%,transparent);color:#eddbaf;box-shadow:0 12px 65px #0003;animation:phase-cue-enter .36s ease-out both;min-width:min(440px,90vw)}
.phase-transition-card>span{display:block;font-size:12px;letter-spacing:.3em;color:#c3ae7f}.phase-transition-card>strong{display:block;margin:10px 0;font:clamp(30px,5vw,48px) var(--serif);letter-spacing:.2em;text-shadow:0 2px 15px #0008}.phase-transition-card>p{font-size:12px;letter-spacing:.18em;color:#adc9bf}
.phase-action .phase-transition-card{border-color:#cf9979}.phase-action .phase-transition-card>strong{color:#f2c7a1}
@keyframes phase-cue-fade{0%{opacity:0}15%,70%{opacity:1}100%{opacity:0}}
@keyframes phase-cue-enter{from{transform:translateY(10px) scale(.96)}to{transform:translateY(0) scale(1)}}
@media(prefers-reduced-motion:reduce){.phase-transition{animation:none}.phase-transition-card{animation:none}}

/* A closed command page gives the battlefield the full desktop width. */
@media(min-width:761px){
 .view-battle .battle-layout:not(.orders-open){grid-template-columns:minmax(0,1fr)}
 .view-battle .orders-panel[hidden]{display:none!important}
 .view-battle .orders-panel .panel-toggle{display:block;position:absolute;top:12px;right:12px;width:auto;min-height:30px;padding:4px 8px;background:#ded4bd;color:#4e5145;border:1px solid #a49778;font-size:12px;z-index:6}
}

/* Keep the warm brush-gold title treatment across rebuilt offline files. */
.masthead .brand{gap:10px;min-width:0}
.masthead .brand-wordmark{display:flex;align-items:center;gap:18px;min-width:0}
.masthead .brand h1{white-space:nowrap;font-family:"DFKai-SB","BiauKai","KaiTi","STKaiti",serif;font-size:clamp(25px,2.4vw,35px);font-weight:700;line-height:1.15;letter-spacing:.08em;color:#e8d2a1;background:linear-gradient(165deg,#fff1ca 8%,#d6b982 40%,#f1d7a2 65%,#aa8854 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;filter:drop-shadow(1px 2px 0 #090f0d) drop-shadow(0 0 3px #b89a6355)}
.masthead .brand-dot{font-size:.65em;vertical-align:.08em;margin:0 .06em;color:#d3ae73;-webkit-text-fill-color:#d3ae73}
.masthead .brand-wordmark>span{white-space:nowrap;font-family:"DFKai-SB","BiauKai","KaiTi",serif;font-size:13px;letter-spacing:.17em;color:#b6aa8d;text-shadow:0 1px 2px #061111}
.masthead{background:linear-gradient(100deg,#101c1d 0%,#1a2c2e 60%,#111f21 100%);border-bottom:2px solid #a88d5e;box-shadow:inset 0 -1px #e0c18a44,0 3px 12px #07110d66}
.view-home .masthead,.view-battle .masthead{background:linear-gradient(100deg,#101c1d 0%,#1a2c2e 60%,#111f21 100%);border-bottom:2px solid #a88d5e}
.view-battle .brand h1{font-size:28px;letter-spacing:.07em}
.view-battle .brand-wordmark>span{font-size:11px;letter-spacing:.1em}
@media(max-width:1100px){.masthead .brand-wordmark>span{display:none}}

/* Ink-weighted brush lettering for the title; the text stays selectable and accessible. */
.masthead .brand{gap:0}
.masthead .brand h1{font-weight:900;letter-spacing:.045em;-webkit-text-stroke:.85px #d5b47d;paint-order:stroke fill;filter:drop-shadow(1px 2px 0 #070d0c) drop-shadow(0 0 2px #e2c58966);transform:skew(-3deg)}
.view-battle .brand h1{letter-spacing:.045em}
@media(max-width:760px){.masthead .brand h1,.view-battle .brand h1{letter-spacing:.015em;-webkit-text-stroke:.55px #d5b47d}}


/* Mobile command interface v2.0: real font files, readable cards and an optional order sheet. */
@font-face{font-family:CommandKai;src:url('assets/fonts/wenkai.woff2') format('woff2');font-weight:500;font-style:normal;font-display:swap}
@font-face{font-family:CommandSerif;src:url('assets/fonts/serif.woff2') format('woff2');font-weight:600;font-style:normal;font-display:swap}
:root{--font-body:CommandSerif,"Songti TC",serif;--font-calligraphy:CommandKai,"BiauKai",serif;--font-numeric:CommandSerif,Georgia,serif}
.view-battle{--font-body:CommandSerif,"Songti TC",serif;--font-calligraphy:CommandKai,"BiauKai",serif;--font-numeric:CommandSerif,Georgia,serif;font-synthesis:none;font-weight:600;--paper:#f1e8d3}
.view-battle .unit-name,.view-battle .command-tabs button,.view-battle .commander-heading h3,.view-battle .primary,.view-battle .phase-heading h2{font-family:var(--font-calligraphy);font-weight:500}
.view-battle .field-hint{font-size:16px;max-width:70%;background:#122a27;pointer-events:none}
.view-battle .field-legend{font-size:14px}.view-battle .command-pane>.label,.view-battle .segmented button,.view-battle .retreat-row,.view-battle .retreat-position,.view-battle .orders-list li,.view-battle .deploy-note,.view-battle .deploy-info{font-size:16px;color:#202c29}
.view-battle .orders-list small,.view-battle .forecast-note,.view-battle .command-footer p{font-size:14px;color:#4f5d54}
.view-battle .command-tabs button,.view-battle .route-actions button,.view-battle .segmented button,.view-battle .retreat-position,.view-battle input,.view-battle select{min-height:48px;font-size:16px}
.view-battle .route-actions{gap:8px;flex-wrap:wrap}.view-battle .route-actions button{flex:1;padding:8px}.view-battle .orders-list .remove{min-width:48px;min-height:48px}
.view-battle .unit-alert{position:absolute;top:3px;right:3px;z-index:3;background:#8f3b32;color:#fff3df;font:600 16px/24px var(--font-body);min-width:24px;text-align:center;border:1px solid #f1c994}
.view-battle .unit-card.lost{opacity:1;filter:grayscale(1)}
.view-battle .selection-summary,.view-battle .mobile-panel-heading{display:none}
.view-battle .map-tools{padding:0;background:transparent;border:0;gap:8px;align-items:flex-end}
.view-battle .map-tools>button,.view-battle .camera-options>summary{display:grid;place-items:center;min-width:56px;min-height:48px;padding:8px;font:600 16px/1.4 var(--font-body);background:#173c36;border:1px solid #9c956e;color:#f5ecd8}
.view-battle .camera-options-body{bottom:56px;grid-template-columns:repeat(2,minmax(96px,1fr));width:244px;max-height:60dvh;overflow:auto;gap:8px;background:#16332f;padding:12px}
.view-battle .camera-options-body button{font:600 16px/1.4 var(--font-body);min-height:48px;width:auto;padding:8px;color:#f5ecd8;background:#284e46;white-space:normal}
.view-battle .camera-options-body #moveCamera{font-size:16px;grid-column:1/-1}
.view-battle .camera-options-body #sceneryMode,.view-battle .camera-options-body #visualQuality{max-width:none}
.view-battle .enemy-intel,.view-battle .battle-dispatch{display:none}
.battle-intel{color:#202c29;background:#f1e8d3;max-width:560px;width:calc(100% - 24px);max-height:85dvh;font:600 16px/1.7 var(--font-body);padding:24px;border:2px solid #a88a58}
.battle-intel::backdrop{background:#071b20aa}.battle-intel h2{font:500 28px var(--font-calligraphy);margin-bottom:20px}.battle-intel h3{font-size:18px;margin-top:20px}.battle-intel .intel-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:16px}.battle-intel button{min-height:48px;font-size:16px}.battle-intel .intel-close{float:right}.battle-intel .base-bars{display:flex;font-size:16px;margin-bottom:12px;gap:16px}.battle-intel .enemy-roster,.battle-intel .event-strip{display:block;position:static;background:transparent;color:#202c29;font-size:16px;padding:0;width:auto;border:0;line-height:1.8}.battle-intel .event-strip b{display:none}.battle-intel .events{white-space:normal}.battle-intel .enemy-roster{margin-bottom:20px}
.route-choice{max-width:420px;width:calc(100% - 24px);font:600 16px/1.7 var(--font-body);background:#f1e8d3;color:#202c29;padding:24px;border:2px solid #a88a58}.route-choice::backdrop{background:#071b20aa}.route-choice h2{font:500 26px var(--font-calligraphy)}.route-choice .result-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:20px}.route-choice button{min-height:48px;font-size:16px}
@media(max-width:1023px),(max-height:599px){
 .view-battle{--battle-head:64px;--army-rail:104px;--summary-height:56px;--command-dock:72px;--safe-bottom:env(safe-area-inset-bottom,0px);--safe-top:env(safe-area-inset-top,0px);height:100dvh;overflow:hidden}
 .view-battle .masthead{height:calc(var(--battle-head) + var(--safe-top));padding:var(--safe-top) 10px 0;display:flex;gap:6px;border-bottom:1px solid #a88a58}
 .view-battle .masthead .brand,.view-battle .prototype,.view-battle .phase-pill,.view-battle .battle-stats>button{display:none}
 .view-battle .masthead .battle-top{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;width:100%;padding:0;flex:1}
 .view-battle .phase-heading>div{display:flex;align-items:flex-start;flex-direction:column;gap:2px}
 .view-battle .round-badge{font:600 14px/1.25 var(--font-body);color:#d1d7c5}.view-battle .phase-heading h2{font:500 20px/1.2 var(--font-calligraphy);letter-spacing:0}
 .view-battle .battle-stats{display:grid;grid-template-columns:auto auto;gap:0 8px;align-items:center;padding:0}
 .view-battle .stat{font:600 14px/1.2 var(--font-body);gap:4px;display:flex;color:#e0e5d5}.view-battle .stat b{font:600 20px/1.3 var(--font-numeric)}
 .view-battle .stat:nth-child(2){display:none}.view-battle .clock{grid-column:1/-1;grid-row:1;order:0;text-align:right;font:600 24px/1.2 var(--font-numeric);border:0;padding:0;min-width:0}
 .view-battle .top-right{margin:0;display:block}.view-battle .icon-button{width:48px;height:48px;min-height:48px;font-size:24px;background:#1b3935;border:1px solid #8c8e6e}
 .view-battle .battle-shell{height:calc(100dvh - var(--battle-head) - var(--safe-top));padding:0;max-width:none}
 .view-battle .battle-layout,.view-battle .battle-layout.orders-open,.view-battle .battle-layout:not(.orders-open){display:block;height:100%;padding:0;width:100%}
 .view-battle .battle-stage{display:grid;height:100%;grid-template-rows:minmax(0,1fr) var(--army-rail) var(--summary-height);padding:0 0 calc(var(--command-dock) + var(--safe-bottom));overflow:hidden}
 .view-battle .field-wrap{height:auto;min-height:0;border:0;border-bottom:1px solid #a88a58;grid-row:1}
 .view-battle .field-legend{display:none}.view-battle .canvas-wrap{position:absolute;inset:0;height:100%!important;min-height:0!important}
 .view-battle .campaign-time{top:10px;left:10px;width:auto;min-width:78px;padding:8px 10px;pointer-events:none;background:#142e29eb;border:1px solid #a88a5877}
 .view-battle .campaign-time>b{font:500 20px/1.2 var(--font-calligraphy);margin:0}.view-battle .campaign-time>span{display:none}.view-battle .day-timeline{gap:3px;margin-top:6px}.view-battle .day-timeline span{height:4px}
 .view-battle .field-hint{display:none}.view-battle .field-hint.active-hint{display:block;bottom:68px;left:10px;max-width:calc(100% - 20px);font-size:16px;padding:8px 12px}
 .view-battle .map-tools{bottom:12px;right:10px;max-width:calc(100% - 20px);display:flex;gap:8px;z-index:10}
 .view-battle .camera-options>summary,.view-battle .map-tools>button{min-height:48px;font-size:16px;min-width:56px}
 .view-battle .guide,.view-battle .connection{top:68px;left:10px;right:10px;font-size:16px;line-height:1.5;max-height:120px;overflow:auto;background:#132e29f5;color:#f5ecd8;z-index:11}
 .view-battle .unit-cards{position:static;grid-row:2;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));height:var(--army-rail);padding:6px 8px;gap:6px;margin:0;border:0;z-index:12;background:#122a27;overflow:visible}
 .view-battle .unit-card{display:grid;grid-template-columns:1fr;grid-template-rows:52px minmax(0,1fr);width:100%;height:100%;min-height:0;padding:0;gap:0;border:1px solid #7f8766;overflow:hidden;background:#183b33}
 .view-battle .unit-card.selected{border-color:#e5c68c;box-shadow:0 0 0 2px #e5c68c;background:#254b3d}
 .view-battle .unit-card .headshot{height:52px;width:100%;min-height:0;float:none;border:0;background:#44544b}
 .view-battle .unit-card .headshot img{width:100%;height:100%;object-fit:cover;object-position:center 32%;transform:none}
 .view-battle .unit-copy{padding:3px 3px 4px;display:flex;flex-direction:column;justify-content:space-between;gap:3px;min-width:0}
 .view-battle .unit-name{display:block;width:100%;font:500 18px/1.1 var(--font-calligraphy);color:#f7edda;letter-spacing:0;white-space:nowrap;text-align:center;padding:0;border:0}
 .view-battle .unit-number,.view-battle .unit-type,.view-battle .unit-slot,.view-battle .unit-status,.view-battle .morale-row>span{display:none}
 .view-battle .morale-row{margin:0;display:block}.view-battle .morale-bars{display:flex;gap:3px;margin:0}.view-battle .morale-bars i{height:5px;border:0;transform:none;background:#415c50}.view-battle .morale-bars i.on{background:#a0e0cc}.view-battle .morale-bars.low i.on{background:#ecae75}
 .view-battle .selection-summary{grid-row:3;display:flex;justify-content:space-between;align-items:center;gap:8px;padding:4px 12px;background:#eee5d0;color:#202c29;border-top:1px solid #ad976f;min-width:0;height:var(--summary-height)}
 .view-battle .selected-copy{min-width:0;display:grid;gap:2px;font:600 16px/1.35 var(--font-body)}.view-battle .selected-copy b{font:600 20px/1.2 var(--font-numeric)}.view-battle .selected-copy .order-summary{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.view-battle .selection-summary button{flex:0 0 48px;min-height:48px;width:48px;padding:0;background:transparent;border:0;font:600 16px var(--font-body);color:#204c40}
 .view-battle .battle-command-dock{position:absolute;bottom:0;left:0;right:0;display:flex;align-items:center;gap:8px;height:calc(var(--command-dock) + var(--safe-bottom));min-height:0;padding:8px 10px calc(8px + var(--safe-bottom));margin:0;border:0;background:#122a27;z-index:26}
 .view-battle .battle-command-dock button{flex:1;min-width:0;width:auto;min-height:56px;height:56px;padding:8px;font:500 24px/1.2 var(--font-calligraphy);letter-spacing:1px;white-space:nowrap}
 .view-battle #mobileOrders{flex:0 0 88px;background:#244d42;color:#f5ecd8;border:1px solid #879273;font-size:22px}.view-battle .battle-command-dock .primary{background:#8f3b32;color:#fff0d8;border:1px solid #c5916c;box-shadow:inset 0 0 0 3px #5b231f55;clip-path:none}
 .view-battle .battle-command-dock button:disabled{opacity:1;background:#4b5146;color:#eee8d8;border-color:#828773}
 .view-battle .orders-panel,.view-battle .orders-panel.expanded{position:absolute;top:auto;left:8px;right:8px;bottom:calc(var(--command-dock) + var(--safe-bottom) + var(--army-rail) + var(--summary-height));width:auto;height:min(55dvh,calc(100% - var(--command-dock) - var(--safe-bottom) - var(--army-rail) - var(--summary-height) - 8px));max-height:none!important;padding:0 12px 12px;border:1px solid #b59a69;background:#f1e8d3;box-shadow:0 -8px 32px #071b2055;overflow:hidden;z-index:25;display:flex;flex-direction:column;gap:0}
 .view-battle .orders-panel[hidden]{display:none!important}.view-battle .orders-panel.expanded>*{display:revert}
 .view-battle .orders-panel .command-title,.view-battle .orders-panel .commander-heading,.view-battle .orders-panel .panel-toggle,.view-battle .orders-panel>.draft-heading,.view-battle .deploy-info{display:none!important}
 .view-battle .mobile-panel-heading{display:flex!important;flex:0 0 auto;align-items:center;justify-content:space-between;gap:8px;margin:0 -12px 8px;padding:10px 12px;border-bottom:1px solid #b5a281;background:#f1e8d3}
 .view-battle .mobile-panel-heading h3{font:500 26px/1.2 var(--font-calligraphy);color:#202c29;letter-spacing:0;margin:0}.view-battle .mobile-panel-heading p{font:600 16px/1.4 var(--font-body);margin:3px 0 0;color:#4f5d54}.view-battle #closeOrders{width:48px;min-width:48px;height:48px;min-height:48px;padding:0;color:#202c29;background:#e1d5bd;border:1px solid #978366;font-size:24px}
 .view-battle .command-tabs{display:grid!important;grid-template-columns:repeat(3,1fr);gap:8px;flex:0 0 auto;margin:0 0 12px}.view-battle .command-tabs button{min-height:48px;font:500 22px/1.2 var(--font-calligraphy);letter-spacing:0;padding:8px}
 .view-battle .command-tabs button[aria-selected=true]:after{display:none}.view-battle .command-pane{flex:1 1 0;min-height:0;overflow:auto;overscroll-behavior:contain;padding-bottom:4px}.view-battle .command-pane>.label{font:600 16px/1.5 var(--font-body);margin:0 0 8px;color:#202c29}
 .view-battle .route-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:8px}.view-battle .route-actions button{min-height:48px;font:600 16px/1.4 var(--font-body);padding:8px 2px;background:#e5dac4;color:#202c29}.view-battle .route-actions button.active{background:#244d42;color:#f5ecd8}
 .view-battle .orders-list li{font:600 16px/1.5 var(--font-body);gap:8px;min-height:56px;padding:6px 8px;background:#f8f0df}.view-battle .orders-list li.muted{font-size:16px;color:#4f5d54;padding:12px}.view-battle .orders-list small{font-size:14px;color:#4f5d54;display:block}.view-battle .orders-list .remove{min-width:48px;min-height:48px;font-size:26px}
 .view-battle .orders-panel .command-footer{flex:0 0 auto;position:static;margin:8px 0 0;padding:0;background:transparent;box-shadow:none;border:0}.view-battle .command-footer:has(#ready){display:none!important}.view-battle .command-footer p,.view-battle .forecast-note{display:none}.view-battle .command-footer>#clearDraft{min-height:48px;font-size:16px}
 .view-battle .deploy-note{overflow:auto;min-height:0;flex:1;font-size:16px;line-height:1.7;margin:0;padding:4px}.view-battle .retreat-row input,.view-battle .retreat-row select,.view-battle .retreat-position{font-size:16px;min-height:48px}.view-battle .retreat-position{width:100%;margin-top:12px}
 .view-battle .toast{bottom:calc(var(--command-dock) + var(--safe-bottom) + var(--army-rail) + var(--summary-height) + 16px);font:600 16px/1.5 var(--font-body);max-width:calc(100% - 24px);background:#142e29;color:#f5ecd8;padding:12px;z-index:60}
 .view-battle .expanded-map{inset:calc(var(--battle-head) + var(--safe-top)) 0 calc(var(--command-dock) + var(--safe-bottom) + var(--army-rail) + var(--summary-height))!important}
 .phase-transition-card>span,.phase-transition-card>p{font-size:16px;letter-spacing:0}
}

@media(max-height:599px) and (orientation:landscape){
 .view-battle #ordersPanel.expanded{height:calc(100dvh - var(--battle-head) - var(--safe-top) - var(--army-rail) - var(--safe-bottom))}
}
@media(max-width:359px){.view-battle{--army-rail:100px}.view-battle .unit-name{font-size:16px}.view-battle .unit-cards{gap:4px;padding-inline:5px}.view-battle .masthead{padding-inline:6px}.view-battle .stat{gap:2px;font-size:14px}.view-battle .stat b{font-size:18px}.view-battle .round-badge{font-size:14px}.view-battle .phase-heading h2{font-size:18px}.view-battle #mobileOrders{flex-basis:76px}}
@media(max-height:699px) and (orientation:portrait){.view-battle{--army-rail:96px;--summary-height:52px}.view-battle .unit-card{grid-template-rows:48px 1fr}.view-battle .unit-card .headshot{height:48px}.view-battle .orders-panel.expanded{top:8px;bottom:calc(var(--command-dock) + var(--safe-bottom));height:auto;z-index:27}.view-battle .orders-panel.expanded .mobile-panel-heading{margin-bottom:8px}}
@media(max-height:599px) and (orientation:landscape){
 .view-battle{--battle-head:52px;--army-rail:84px;--summary-height:0px;--command-dock:0px}
 .view-battle .phase-heading>div{flex-direction:row;align-items:center;gap:8px}.view-battle .battle-stats{display:flex;gap:16px}.view-battle .clock{order:-1}.view-battle .battle-stage{grid-template-rows:minmax(0,1fr) var(--army-rail);padding-bottom:var(--safe-bottom)}
 .view-battle .unit-cards{padding-right:236px;gap:6px}.view-battle .unit-card{grid-template-rows:44px 1fr}.view-battle .unit-card .headshot{height:44px}.view-battle .unit-name{font-size:16px}.view-battle .morale-bars i{height:5px}.view-battle .unit-copy{gap:2px;padding:2px}
 .view-battle .selection-summary{display:none}.view-battle .battle-command-dock{left:auto;width:232px;bottom:var(--safe-bottom);height:84px;padding:12px 8px;gap:8px}.view-battle .battle-command-dock button{font-size:22px}.view-battle #mobileOrders{flex-basis:68px;font-size:20px}
 .view-battle .orders-panel.expanded{top:0;bottom:calc(var(--army-rail) + var(--safe-bottom));right:8px;left:auto;width:min(390px,60vw);height:auto;z-index:25}.view-battle .mobile-panel-heading{padding:5px 12px;margin-bottom:6px}.view-battle .mobile-panel-heading h3{font-size:24px}.view-battle .mobile-panel-heading p{display:none}.view-battle .command-tabs{margin-bottom:8px}.view-battle .command-tabs button{font-size:20px}.view-battle .route-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.view-battle .campaign-time{top:8px;padding:6px 8px}.view-battle .map-tools{bottom:8px}
}

/* Deployment confirmation stays at the right edge of the battlefield tools. */
.view-battle .map-tools>#finishDeployment{width:auto;min-width:112px;min-height:48px;padding:10px 16px;background:linear-gradient(#b9a06a,#89713f);border:1px solid #e4ce97;color:#172b25;font:700 17px/1.4 var(--font-body);white-space:nowrap;box-shadow:0 3px 12px #071c1b55}
.view-battle .map-tools>#finishDeployment:hover:not(:disabled){background:linear-gradient(#d2bc87,#a4894e)}
.view-battle .map-tools>#finishDeployment:disabled{opacity:.65;cursor:default}
@media(max-width:760px){.view-battle .map-tools>#finishDeployment{min-width:104px;padding:8px 12px;font-size:16px}}
/* Portrait grade is visible on each battle card without replacing morale. */
.view-battle .unit-card .headshot .jade-row{bottom:2px}
.view-battle .unit-card .headshot .jade{width:12px;height:12px}
.view-battle .commander-portrait .jade-row{bottom:7px}
@media(max-width:1023px),(max-height:599px){
 .view-battle .unit-card .headshot .jade-row{bottom:1px;padding:0 1px;gap:0;border-width:0;background:#112b28dd}
 .view-battle .unit-card .headshot .jade{width:10px;height:10px}
}

/* Action speed is always beside the phase clock, including when orders are closed. */
.view-battle .action-speed{display:flex;align-items:center;gap:6px;white-space:nowrap}
.view-battle .action-speed button{min-width:43px;border-color:#a88d5e;color:#f0dab2;font:700 15px var(--font-numeric)}
.view-battle .action-speed button[aria-pressed="true"]{background:#365750;border-color:#80cfca;color:#e5fbef}
.view-battle .action-speed span{font-size:11px;color:#cfc2a4;max-width:100px;white-space:normal;line-height:1.15}
@media(max-width:760px){.view-battle .action-speed{gap:3px}.view-battle .action-speed button{min-width:38px;padding:4px}.view-battle .action-speed span{font-size:10px;max-width:63px}}

/* Reference-inspired gold brush wordmark; shared by home and battle headers. */
.masthead .brand{min-width:0;text-decoration:none;gap:0}
.masthead .brand:before{display:none}
.masthead .brand-wordmark{display:flex;align-items:center;gap:24px;min-width:0}
.masthead .brand-wordmark h1{position:relative;flex:none;width:246px;height:72px;margin:0;background:url('assets/brand-title-v1.webp') center/contain no-repeat;font-size:0;letter-spacing:0}
.brand-title-text{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.masthead .brand-wordmark>.brand-tagline{display:block;font:500 17px/1.5 CommandKai,'DFKai-SB','BiauKai',serif;letter-spacing:.14em;color:#b9ad93;white-space:nowrap;text-shadow:0 1px 3px #0008}
body:not(.view-battle) .masthead{min-height:80px;height:auto;background:radial-gradient(ellipse at 45% 0,#31413b50,transparent 70%),repeating-linear-gradient(132deg,#bca57204 0 1px,transparent 1px 5px),#102326;border-bottom:1px solid #a88a5855}
.view-battle .masthead .brand-wordmark{gap:14px}
.view-battle .masthead .brand-wordmark h1{width:210px;height:60px}
.view-battle .masthead .brand-wordmark>.brand-tagline{font-size:13px;letter-spacing:.08em}
@media(max-width:1100px){.view-battle .masthead .brand-wordmark>.brand-tagline{display:none}}
@media(max-width:760px){body:not(.view-battle) .masthead{padding:4px 16px 10px;gap:12px;min-height:102px}.masthead .brand-wordmark{flex-direction:column;align-items:flex-start;gap:0}.masthead .brand-wordmark h1{width:222px;height:66px}.masthead .brand-wordmark>.brand-tagline{font-size:14px;letter-spacing:.16em;padding-left:8px}.masthead .prototype{display:none}.masthead .top-right{flex:none;gap:0}}

/* Current terrain and activity remain visible independently of card selection. */
.view-battle .unit-card{padding-top:22px;border-width:2px}
.view-battle .unit-card.state-marching{--activity-color:#73cf8a}
.view-battle .unit-card.state-guarding{--activity-color:#69aef1}
.view-battle .unit-card.state-fighting{--activity-color:#f07168}
.view-battle .unit-card.state-inactive{--activity-color:#89958c}
.view-battle .unit-card[class*="state-"]{border-color:var(--activity-color);box-shadow:inset 0 0 0 1px var(--activity-color)}
.view-battle .unit-card.selected{outline:2px solid #efd7a1;outline-offset:2px}
/* Keep native click/double-click targeting stable while card contents refresh. */
.view-battle .unit-card *{pointer-events:none}
.view-battle .unit-card .unit-slot{top:25px}
.view-battle .unit-indicators{position:absolute;top:0;left:0;right:0;height:22px;display:flex;align-items:center;justify-content:center;gap:5px;padding:2px 4px;background:#102523f5;border-bottom:1px solid #8b9e8050;z-index:3;white-space:nowrap}
.view-battle .unit-indicators svg{display:block;width:13px;height:13px;flex:none}
.view-battle .unit-indicators>span{display:inline-flex;align-items:center;gap:1px;min-width:0}
.view-battle .unit-indicators .activity-icon{color:var(--activity-color);padding-right:4px;border-right:1px solid #8b9e8070}
.view-battle .terrain-icon{color:#e4d6b4}
.view-battle .terrain-effect.benefit{color:#a2e1bc}.view-battle .terrain-effect.penalty{color:#f0b18d}
.view-battle .terrain-effect small{font:10px/1 var(--font-numeric)}
.view-battle .unit-card{container-type:inline-size;container-name:army-card}
@container army-card (max-width:300px){.view-battle .terrain-effect small{display:none}}
@container army-card (max-width:110px){.view-battle .unit-indicators>.terrain-effect{display:none}}
.view-battle .terrain-details{font:13px/1.6 var(--font-body);color:#394b41;background:#e1d7be80;padding:8px 10px;margin:8px 0;border-left:2px solid #697e65}
@media(min-width:1001px){.view-battle .unit-copy{padding-top:3px;padding-bottom:3px}.view-battle .unit-type,.view-battle .unit-number,.view-battle .morale-row{margin-top:5px}}
@media(max-width:1250px){.view-battle .terrain-effect small{display:none}.view-battle .unit-indicators{gap:5px}}
@media(max-width:760px){.view-battle .unit-card{padding-top:18px;grid-template-rows:32px minmax(0,1fr)}.view-battle .unit-card .headshot{height:32px}.view-battle .unit-indicators{height:18px;gap:2px;padding:1px}.view-battle .unit-indicators svg{width:9px;height:11px}.view-battle .unit-indicators .activity-icon{padding-right:2px}.view-battle .unit-copy{gap:2px;padding:2px}.view-battle .terrain-details{font-size:14px}}
@media(max-width:359px){.view-battle .unit-indicators{gap:1px}.view-battle .unit-indicators svg{width:8px}}

.view-battle .policy-note{font:15px/1.8 var(--font-body);color:#344c42;background:#e7dfcba0;border-left:3px solid #688575;padding:10px 12px;margin:12px 0}
.view-battle #command-combat .segmented{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}

/* v16: action view keeps essential army information in a compact rail. */
.view-battle .map-tools #armyCardSize{font-size:11px;min-height:32px;padding:5px 8px;width:auto}
@media(min-width:1024px) and (min-height:600px){
 .view-battle[data-battle-phase="action"]:not(.expanded-army-cards) .battle-stage{grid-template-rows:minmax(0,1fr) 112px 32px}
 .view-battle[data-battle-phase="action"]:not(.expanded-army-cards) .unit-cards{padding:7px 14px;gap:10px}
 .view-battle[data-battle-phase="action"]:not(.expanded-army-cards) .unit-card{grid-template-columns:30% minmax(0,1fr)}
 .view-battle[data-battle-phase="action"]:not(.expanded-army-cards) .unit-copy{display:grid;grid-template-columns:1fr auto;grid-template-rows:23px 21px 15px;align-content:center;align-items:center;gap:1px 5px;padding:3px 8px}
 .view-battle[data-battle-phase="action"]:not(.expanded-army-cards) .unit-name{font-size:21px;letter-spacing:0;border:0;padding:0}
 .view-battle[data-battle-phase="action"]:not(.expanded-army-cards) .unit-type{font-size:10px;margin:0;text-align:right}
 .view-battle[data-battle-phase="action"]:not(.expanded-army-cards) .unit-type b{font-size:14px;margin-right:2px}
 .view-battle[data-battle-phase="action"]:not(.expanded-army-cards) .unit-number{grid-column:1/-1;font-size:18px;margin:0}
 .view-battle[data-battle-phase="action"]:not(.expanded-army-cards) .morale-row{grid-column:1/-1;margin:0;font-size:10px}
 .view-battle[data-battle-phase="action"]:not(.expanded-army-cards) .morale-bars i{height:6px}
 .view-battle[data-battle-phase="action"]:not(.expanded-army-cards) .unit-slot{font-size:11px;top:24px;padding:1px 3px}
}
@media(max-width:1023px),(max-height:599px){.view-battle .map-tools #armyCardSize{display:none}}

/* The turn confirmation belongs to the battlefield, beside the map controls. */
.view-battle[data-battle-phase="command"] .map-tools{flex-wrap:wrap;justify-content:flex-end}
.view-battle .map-tools>#ready{width:auto;min-width:150px;min-height:52px;padding:9px 17px;background:linear-gradient(115deg,#884237,#a25343 55%,#813b32);border:1px solid #e3b599;color:#fff0d7;font:500 23px/1.2 var(--font-calligraphy);letter-spacing:2px;white-space:nowrap;box-shadow:0 3px 12px #071c1b66}
.view-battle .map-tools>#ready:hover:not(:disabled){background:linear-gradient(115deg,#9b4e40,#bb6653 55%,#94473b)}
.view-battle .map-tools>#ready:disabled{opacity:.72;cursor:default}
.view-battle[data-battle-phase="command"] .orders-panel .command-footer{display:none}
@media(max-width:1023px),(max-height:599px){.view-battle .map-tools>#ready{min-width:126px;min-height:48px;padding:8px 12px;font-size:19px}.view-battle[data-battle-phase="command"] .orders-panel .command-footer{display:none}}
@media(max-width:1023px),(max-height:599px){.view-battle .map-tools #ordersToggle{display:none}}
@media(max-width:360px){.view-battle[data-battle-phase="command"] .field-hint.active-hint{bottom:142px}}
.field-legend .terrain-key{position:relative;display:inline-block;margin:0 10px}
.terrain-key summary{display:flex;align-items:center;gap:3px;cursor:pointer;list-style:none;padding:2px 7px;color:#dfd0ac;border:1px solid #b69a6759;border-radius:14px}
.terrain-key summary::-webkit-details-marker{display:none}
.terrain-key summary svg{width:18px;height:18px}
.terrain-key summary:focus-visible{outline:2px solid #b0d6c7;outline-offset:3px}
.field-legend .terrain-key>span{position:absolute;bottom:32px;left:0;white-space:nowrap;padding:8px 12px;background:#142d29;border:1px solid #b69a67;color:#ede1bf;z-index:30}

.unit-type b svg,.troop-glyph svg{display:inline-block;vertical-align:-.12em}
.view-battle .mobile-troop-trait{display:inline-flex;align-items:center;gap:6px;color:#425f54;font:600 16px/1.5 var(--font-body);margin-top:5px}
.mobile-troop-trait svg{width:19px;height:22px}
.view-battle .commander-specialty{font-size:14px;line-height:1.5}

.view-battle .unit-type b svg{width:17px;height:17px}
.view-battle .troop-glyph svg{width:22px;height:22px}
@media(max-width:1000px) and (min-width:761px){.view-battle .unit-type b{display:inline-flex;vertical-align:middle;margin-right:3px}.view-battle .unit-type b svg{width:13px;height:13px}}
/* Overall intent remains above the route / attack / retreat tabs. */
.view-battle .orders-panel.expanded>.action-policy-controls{display:grid;flex:0 0 auto;grid-template-columns:auto minmax(0,1fr);gap:10px;align-items:center;padding:12px 0;border-block:1px solid #8e765a55;margin:10px 0}
.action-policy-controls label{font-weight:700;font-size:18px;color:#463727}
.action-policy-controls select{width:100%;min-height:48px;padding:8px;font:inherit;font-size:18px;color:#312d23;background:#f4e7cf;border:1px solid #8e765a;border-radius:4px}
.action-policy-help{grid-column:1/-1;font-size:16px;line-height:1.4;color:#544a3b}
.action-policy-help summary{cursor:pointer;min-height:32px;display:flex;align-items:center;gap:4px}.action-policy-help summary:before{content:'▸'}.action-policy-help[open] summary:before{content:'▾'}
.action-policy-controls .action-policy-note{grid-column:1/-1;font-size:16px;line-height:1.5;margin:0;color:#544a3b}
.action-policy-controls .lure-position{grid-column:1/-1;min-height:48px;font-size:17px;color:#502e65;background:#e8dded;border:1px solid #9474a1}
.action-policy-controls .lure-position.active{background:#6e447e;color:#fff}
.lure-point-status{grid-column:1/-1;font-size:16px;line-height:1.4;color:#634578}
.orders-panel .segmented button:disabled{opacity:.6;cursor:default}
.orders-panel .segmented button.active:disabled{opacity:1;box-shadow:inset 0 0 0 2px #675236}
@media(max-width:1023px),(max-height:599px){.action-policy-controls .action-policy-note{font-size:16px}.view-battle .orders-panel.expanded>.action-policy-controls{margin:6px 0;padding:8px 0;gap:6px}.view-battle .orders-panel.expanded>.terrain-details{display:none}.view-battle .action-policy-help[open]{max-height:140px;overflow:auto}}
/* Single-screen command editor: compact identity, fixed intent and bounded panes. */
.view-battle #ordersPanel.expanded{display:flex;flex-direction:column;gap:8px;padding:12px;overflow:hidden;min-height:0}
.view-battle #ordersPanel>.command-title,.view-battle #ordersPanel>.commander-heading,.view-battle #ordersPanel>.terrain-details,.view-battle #ordersPanel>.draft-heading,.view-battle #ordersPanel>.panel-toggle{display:none!important}
.view-battle #ordersPanel>.mobile-panel-heading{display:flex!important;flex:0 0 84px;min-height:0;align-items:center;gap:8px;margin:0;padding:0 0 8px;border-bottom:1px solid #aa957255;background:transparent}
.view-battle #ordersPanel .mobile-panel-heading>div{flex:1;min-width:0}
.view-battle #commandArmy{display:block;width:100%;max-width:100%;min-width:0;height:36px;min-height:36px;padding:0 16px 0 0;border:0;box-shadow:none;background:transparent;font:500 22px/1.2 var(--font-calligraphy);color:#263930;text-overflow:ellipsis}
.view-battle #ordersPanel .mobile-panel-heading p{font:400 14px/1.3 var(--font-body);margin:2px 0 0;white-space:nowrap}
.view-battle .command-avatar{flex:0 0 64px;width:64px;height:76px;min-height:64px;padding:0;border:1px solid #99845b;background:#394e46;overflow:hidden}
.view-battle .command-avatar img{display:block;width:100%;height:100%;object-fit:cover}
.view-battle #closeOrders,.view-battle #ordersPanel .mobile-panel-heading>#clearDraft{flex:0 0 44px;width:44px;min-width:44px;height:44px;min-height:44px;padding:0;margin:0;font-size:20px;line-height:1;background:#e1d5bd;color:#263930;border:1px solid #99845b}
.view-battle #ordersPanel .mobile-panel-heading>#clearDraft{font:500 16px var(--font-body)}
.view-battle #ordersPanel>.action-policy-controls{display:grid;flex:0 0 auto;grid-template-columns:64px minmax(0,1fr) 44px;gap:6px;align-items:center;margin:0;padding:0;border:0;min-height:0}
.view-battle .action-policy-controls label{font-size:16px;white-space:nowrap}
.view-battle #actionPolicy{min-height:44px;height:44px;font-size:17px;padding:4px 6px;margin:0}
.view-battle .command-help-button{width:44px;min-width:44px;height:44px;min-height:44px;padding:0;margin:0;font:600 20px var(--font-body);color:#36564a;background:#e7ddc8;border:1px solid #9c8c6c}
.view-battle #ordersPanel .lure-position{grid-column:1/-1;min-height:44px;height:44px;margin:0;padding:4px 8px;font-size:16px;white-space:nowrap}
.view-battle #ordersPanel>.command-tabs{display:grid!important;flex:0 0 44px;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:0;min-height:0}
.view-battle #ordersPanel .command-tabs button{min-height:44px;height:44px;padding:4px;font-size:20px;letter-spacing:0}
.view-battle #ordersPanel .command-tabs button:after{display:none}
.view-battle #ordersPanel>.command-pane{display:flex;flex:1 1 0;flex-direction:column;gap:6px;min-height:0;overflow:hidden;padding:0;margin:0}
.view-battle #ordersPanel .command-section-heading{display:flex;flex:0 0 36px;align-items:center;justify-content:space-between;gap:6px;min-height:0}
.view-battle #ordersPanel .command-section-heading .label{font:500 16px/1.3 var(--font-body);letter-spacing:0;margin:0;min-width:0;color:#344c42}
.view-battle #ordersPanel .command-section-heading .command-help-button{height:36px;min-height:36px;width:36px;min-width:36px;font-size:18px}
.view-battle #ordersPanel .policy-note,.view-battle #ordersPanel .forecast-note,.view-battle #ordersPanel>.command-footer{display:none!important}
.view-battle #ordersPanel #command-combat .segmented{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;flex:0 0 auto;margin:0}
.view-battle #ordersPanel .segmented button{height:48px;min-height:48px;padding:6px;text-align:center;font-size:17px}
.view-battle #ordersPanel .orders-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:64px;gap:6px;flex:0 0 auto;list-style:none;border:0;border-radius:0;margin:0;padding:0;overflow:hidden}
.view-battle #ordersPanel .orders-list li{display:block;min-width:0;min-height:0;height:64px;margin:0;padding:0;border:0;background:transparent;overflow:hidden}
.view-battle #ordersPanel .route-node-summary{display:grid;grid-template-columns:20px minmax(0,1fr);grid-template-rows:1fr 1fr;gap:1px 3px;align-items:center;width:100%;height:64px;min-height:44px;padding:5px 4px;background:#f8efdc;color:#263e32;border:1px solid #ab9976;text-align:left}
.view-battle .route-node-number{grid-row:1/-1;display:grid;place-items:center;width:20px;height:28px;background:#37675d;color:#fff2d5;font:500 17px var(--font-numeric)}
.view-battle .route-node-name{font:500 16px/1.3 var(--font-body);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.view-battle #ordersPanel .route-node-summary small{font:400 14px/1.3 var(--font-body);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0;color:#506457}
.view-battle #ordersPanel .orders-list li.muted{grid-column:1/-1;height:64px;display:flex;align-items:center;padding:8px;font-size:16px;line-height:1.5;background:#eee4cd}
.view-battle #ordersPanel .route-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;flex:0 0 44px;margin:0}
.view-battle #ordersPanel .route-actions button{min-width:0;min-height:44px;height:44px;padding:4px 1px;font-size:15px;letter-spacing:0;white-space:nowrap}
.view-battle #ordersPanel .retreat-row{display:grid;grid-template-columns:auto 64px 20px minmax(0,1fr);gap:4px;align-items:center;flex:0 0 44px;margin:0;font-size:16px;line-height:1.3}
.view-battle #ordersPanel .retreat-row input,.view-battle #ordersPanel .retreat-row select{width:100%;min-width:0;height:44px;min-height:44px;margin:0;padding:3px;font-size:16px}
.view-battle #ordersPanel .retreat-position{height:44px;min-height:44px;margin:0;padding:5px;font-size:16px;width:100%;flex:0 0 44px}
.view-battle #ordersPanel .deploy-note{overflow:hidden;flex:0 1 auto;margin:4px 0;font-size:16px;line-height:1.5;padding:0}
.view-battle #ordersPanel .watch-heading{padding:0}.view-battle #ordersPanel .watch-heading h3{font-size:20px;margin:0 0 8px}.view-battle #ordersPanel .watch-heading p{display:none}
.view-battle #ordersPanel .watch-objectives{margin:0}.view-battle #ordersPanel .objective-row{padding:6px 0;font-size:16px}
.command-help-dialog{box-sizing:border-box;width:min(440px,calc(100vw - 24px));max-width:none;max-height:calc(100dvh - 24px);padding:16px;border:1px solid #a0885b;background:#f2e7d0;color:#263930;overflow:hidden}
.command-help-dialog::backdrop{background:#102620a8}
.command-help-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}
.command-help-heading h3{margin:0;font:500 24px/1.3 var(--font-calligraphy);color:#263930}
.command-help-heading button{width:44px;min-width:44px;height:44px;min-height:44px;padding:0;font-size:24px}
.command-help-dialog>p{font:400 17px/1.6 var(--font-body);margin:14px 0;color:#344c42}
.command-help-footer{display:flex;align-items:center;justify-content:flex-end;gap:8px}
.command-help-footer button{min-height:44px;padding:6px 14px;font-size:17px}
@media(max-width:1023px),(max-height:599px){
 .view-battle #ordersPanel.expanded{position:absolute;top:8px;bottom:calc(var(--command-dock) + var(--safe-bottom));left:8px;right:8px;width:auto;height:calc(100% - var(--command-dock) - var(--safe-bottom) - 16px);align-self:stretch;max-height:none!important;z-index:25;padding:10px;gap:6px}
 .view-battle #ordersPanel>.mobile-panel-heading{flex-basis:80px;padding-bottom:4px}
 .view-battle #ordersPanel .retreat-row{grid-template-columns:auto 58px 16px minmax(0,1fr)}
 .view-battle #ordersPanel .mobile-panel-heading p{font-size:14px}
}
@media(max-height:699px) and (orientation:portrait){
 .view-battle #ordersPanel .orders-list{grid-auto-rows:56px}.view-battle #ordersPanel .orders-list li,.view-battle #ordersPanel .route-node-summary{height:56px}
 .view-battle #ordersPanel .command-avatar{flex-basis:56px;width:56px;height:64px;min-height:64px}.view-battle #ordersPanel>.mobile-panel-heading{flex-basis:68px}.view-battle #ordersPanel .mobile-panel-heading p{display:none}
}
@media(max-height:599px) and (orientation:landscape){
 .view-battle #ordersPanel.expanded:has(.command-tabs){display:grid;grid-template-columns:minmax(200px,.85fr) minmax(0,1.15fr);grid-template-rows:44px minmax(0,1fr);gap:8px 14px;top:6px;bottom:6px;left:6px;right:6px;height:calc(100% - 12px);padding:8px}
 .view-battle #ordersPanel:has(.command-tabs)>.mobile-panel-heading{grid-column:1;grid-row:1;padding:0;border:0}
 .view-battle #ordersPanel:has(.command-tabs)>.action-policy-controls{grid-column:1;grid-row:2;align-self:start}
 .view-battle #ordersPanel:has(.command-tabs)>.command-tabs{grid-column:2;grid-row:1}
 .view-battle #ordersPanel:has(.command-tabs)>.command-pane{grid-column:2;grid-row:2}
 .view-battle #ordersPanel .command-avatar{display:none}.view-battle #ordersPanel .mobile-panel-heading p{display:none}
 .view-battle #commandArmy{font-size:20px}
 .view-battle .battle-layout.orders-open+#battleCommandDock{left:14px;right:auto;width:calc((100% - 54px)*.425);bottom:14px;height:56px;padding:0;background:transparent;border:0}
 .view-battle .battle-layout.orders-open+#battleCommandDock button{height:48px;min-height:48px;font-size:18px;letter-spacing:0;padding:4px}
 .view-battle .battle-layout.orders-open+#battleCommandDock #mobileOrders{flex:0 0 64px;font-size:18px}
 .view-battle #ordersPanel .orders-list{grid-auto-rows:56px}.view-battle #ordersPanel .orders-list li,.view-battle #ordersPanel .route-node-summary{height:56px}
 .view-battle #ordersPanel .command-section-heading{flex-basis:32px}.view-battle #ordersPanel .command-section-heading .command-help-button{min-height:32px;height:32px}
 .command-help-dialog{width:min(640px,calc(100vw - 24px));padding:12px 16px}.command-help-dialog>p{margin:8px 0;line-height:1.5}
}
@media(max-height:599px) and (orientation:portrait), (max-height:360px) and (orientation:landscape){
 .view-battle #ordersPanel .orders-list{grid-auto-rows:48px;gap:4px}.view-battle #ordersPanel .orders-list li,.view-battle #ordersPanel .route-node-summary{height:48px}
 .view-battle #ordersPanel>.command-pane{gap:4px}.view-battle #ordersPanel .command-section-heading{flex-basis:32px}
}

/* Post-match playtest: one question at a time, readable touch targets. */
#resultDialog{max-width:670px;padding:24px;scrollbar-gutter:stable}
#resultDialog .result-stats{margin:14px 0}#resultDialog .result-stats>div{padding:12px;font-size:16px}
#resultDialog .reason,#resultDialog .turning-points p{font-size:16px}
.playtest-feedback h3{font-size:24px;margin:0 0 8px}.playtest-feedback p{font-size:16px;line-height:1.5}
.playtest-feedback .survey-intro,.playtest-feedback .survey-storage{font-size:14px;line-height:1.5}
.survey-progress{color:#546454;margin:12px 0 8px}.playtest-feedback h4{font-size:18px;line-height:1.6;margin:0 0 12px}
.survey-options{display:grid;gap:8px}.survey-options button{text-align:left;min-height:48px;padding:10px 14px;font-size:16px;line-height:1.5;white-space:normal}
.survey-options button[aria-pressed="true"]{background:#315c45;color:#fff5dd}.survey-options button:focus-visible,.playtest-next button:focus-visible{outline:3px solid #167387;outline-offset:2px}
.survey-back{font-size:16px;min-height:48px;margin:8px 0}.playtest-next{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
#resultDialog .playtest-next button{font-size:16px;min-height:56px;padding:10px 6px;white-space:normal}
.playtest-exports{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.playtest-exports button{flex:1;min-height:48px;font-size:16px;padding:8px}
@media(max-width:600px){#resultDialog{padding:18px 14px;width:calc(100% - 20px);box-sizing:border-box}.playtest-next{grid-template-columns:1fr 1fr}.playtest-next .primary{grid-column:1/-1}.playtest-exports{flex-direction:column}}

#resultDialog .turning-points,#resultDialog .playtest-reward{text-align:left;padding:12px 0;border-top:1px solid #b6aa8644}#resultDialog details>summary{font-size:16px;min-height:48px;display:list-item;align-content:center;cursor:pointer}#resultDialog .playtest-feedback{padding-top:10px}#resultDialog .result-content h2{margin:8px 0}#resultDialog .reason{margin:6px 0}

#resultDialog .playtest-next .primary{background:#873d33;color:#fff0d6;border-color:#c78765}#resultDialog .playtest-next .primary:hover:not(:disabled){background:#a74c3d}

.telemetry-note{font-size:14px;line-height:1.6;max-width:800px;color:#dfd6bd;padding:12px 0}

/* Live force overview uses only the compact public totals and five slot states. */
.view-battle .masthead .battle-top{min-width:0;gap:12px}
.view-battle .force-overview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;flex:1 1 350px;min-width:0;max-width:490px}
.view-battle .force-side{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto 7px;gap:4px 8px;align-items:center;min-width:0;color:#e0e1d3}
.view-battle .force-line{grid-column:1/-1;display:flex;align-items:baseline;gap:4px;min-width:0;white-space:nowrap;font:600 13px/1.2 var(--font-body)}
.view-battle .force-line b{font:700 20px/1 var(--font-numeric);color:#a7e2cf;font-variant-numeric:tabular-nums}
.view-battle .force-side-1 .force-line b{color:#f0a493}
.view-battle .force-line small{font-size:11px}.view-battle .force-presence{margin-left:auto;font-size:11px;color:#d7d2bc}
.view-battle .force-bar{height:7px;min-width:20px;overflow:hidden;background:#56706b65;border:1px solid #86b6a77a}
.view-battle .force-bar i{display:block;height:100%;background:linear-gradient(90deg,#478f7d,#9ce4bc);transition:width .2s linear}
.view-battle .force-side-1 .force-bar{border-color:#d995897a;background:#79534e65}
.view-battle .force-side-1 .force-bar i{background:linear-gradient(90deg,#a94f48,#eea484)}
.view-battle .force-slots{display:flex;gap:3px;align-items:center;justify-content:flex-end}
.view-battle .force-slot{display:grid;place-items:center;width:16px;height:16px;border:1px solid #a0d0bd;background:#346e5d;color:#eef8e8;font:700 11px/1 var(--font-numeric)}
.view-battle .force-side-1 .force-slot{border-color:#dfa296;background:#8e4942}
.view-battle .force-slot.out,.view-battle .force-side-1 .force-slot.out{border-color:#8d8d81;background:#323d3b;color:#b7b5a7}
@media(max-width:1500px) and (min-width:1024px){
 .view-battle .masthead .brand-wordmark>.brand-tagline{display:none}
 .view-battle .battle-stats{gap:11px}
 .view-battle .force-overview{max-width:420px;gap:8px}
}
@media(max-width:1199px) and (min-width:1024px){
 .view-battle .battle-stats .stat{display:none}
 .view-battle .battle-stats .clock{padding-right:8px;min-width:68px}
 .view-battle .force-overview{max-width:none}
}
@media(max-width:1023px),(max-height:599px){
 .view-battle .masthead .battle-top{display:grid;grid-template-columns:86px minmax(0,1fr) auto;gap:5px}
 .view-battle .phase-heading{grid-column:1;grid-row:1;min-width:0}
 .view-battle .force-overview{grid-column:2;grid-row:1;grid-template-columns:minmax(0,1fr);gap:2px;max-width:none;align-content:center}
 .view-battle .force-side{grid-template-rows:auto 5px;gap:2px 5px}
 .view-battle .force-line{font-size:11px;line-height:1;gap:3px}
 .view-battle .force-line b{font-size:15px}.view-battle .force-line small{font-size:9px}.view-battle .force-presence{font-size:10px}
 .view-battle .force-bar{height:5px}.view-battle .force-slots{gap:2px}
 .view-battle .force-slot{width:11px;height:11px;font-size:9px}
 .view-battle .battle-stats{grid-column:3;grid-row:1;display:flex;justify-content:center;align-items:center}
 .view-battle .battle-stats .stat{display:none}
 .view-battle .battle-stats .action-speed{display:flex;position:absolute;top:calc(100% + 8px);right:10px;z-index:21;margin:0;padding:3px;background:#102b29ec;border:1px solid #a88d5e}
 .view-battle .battle-stats .action-speed button{min-width:44px;min-height:44px;padding:5px;font-size:16px}
 .view-battle .battle-stats .action-speed span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 .view-battle .battle-stats .clock{grid-column:auto;grid-row:auto;font-size:18px;min-width:0}
}
@media(max-width:599px){
 .view-battle .masthead{gap:3px;padding-inline:5px}
 .view-battle .masthead .battle-top{grid-template-columns:54px minmax(0,1fr) auto;gap:3px}
 .view-battle .round-badge{font-size:11px}.view-battle .phase-heading h2{font-size:13px;letter-spacing:0}
 .view-battle .force-presence,.view-battle .force-line small{display:none}
 .view-battle .force-line b{margin-left:auto;font-size:14px}
 .view-battle .force-slots{gap:1px}.view-battle .force-slot{width:10px;height:10px;font-size:8px}
 .view-battle .battle-stats .clock{font-size:15px}
}
@media(max-height:599px) and (orientation:landscape){
 .view-battle .phase-heading>div{flex-direction:column;align-items:flex-start;gap:1px}
}

/* Show the active action policy even when the army rail is compact. */
.view-battle .unit-card .headshot .unit-policy{position:absolute;left:0;right:0;bottom:0;z-index:2;display:block;padding:2px 1px;background:#102523ed;border-top:1px solid #bcaa7559;color:#f4dfaa;font:500 12px/1.2 var(--font-body);text-align:center;white-space:nowrap;letter-spacing:0}
.view-battle .unit-card .headshot .jade-row{bottom:20px}
@media(max-width:760px){.view-battle .unit-card .headshot .unit-policy{font-size:10px;padding:1px 0}.view-battle .unit-card .headshot .jade-row{bottom:15px}}

/* Five commander portraits identify the surviving armies on each side. */
.view-battle .force-side{grid-template-columns:minmax(0,1fr);grid-template-rows:auto 5px 29px;gap:2px}
.view-battle .force-line,.view-battle .force-bar,.view-battle .force-slots{grid-column:1}
.view-battle .force-slots{justify-content:flex-start;gap:3px;min-width:0}
.view-battle .force-slot{position:relative;display:block;flex:none;width:29px;height:29px;overflow:hidden;border:2px solid #a0d0bd;background:#274e44;box-shadow:0 0 0 1px #173a34}
.view-battle .force-side-1 .force-slot{border-color:#dfa296;background:#663b38;box-shadow:0 0 0 1px #58302d}
.view-battle .force-slot img{display:block;width:100%;height:100%;object-fit:cover;object-position:50% 28%}
.view-battle .force-slot.out,.view-battle .force-side-1 .force-slot.out{border-color:#7d8982;background:#323d3b;box-shadow:none}
.view-battle .force-slot.out img{filter:grayscale(1) brightness(.55)}
.view-battle .force-slot.out::after{content:'×';position:absolute;inset:0;display:grid;place-items:center;background:#101a1a4d;color:#fff5e2;font:700 22px/1 var(--font-body);text-shadow:0 1px 3px #000}
@media(min-width:1024px) and (max-width:1199px){.view-battle .force-slots{gap:2px}.view-battle .force-slot{width:25px;height:29px}}
@media(max-width:1023px),(max-height:599px){
 .view-battle{--battle-head:90px}
 .view-battle .masthead .battle-top{grid-template-columns:minmax(0,1fr) auto;grid-template-rows:29px 52px;gap:2px 5px}
 .view-battle .phase-heading{grid-column:1;grid-row:1}
 .view-battle .phase-heading>div{flex-direction:row;align-items:baseline;gap:6px}
 .view-battle .phase-heading h2{font-size:17px}
 .view-battle .battle-stats{grid-column:2;grid-row:1}
 .view-battle .force-overview{grid-column:1/-1;grid-row:2;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;align-content:stretch}
 .view-battle .force-side{grid-template-rows:15px 4px 28px;gap:2px}
 .view-battle .force-line b{font-size:15px}
 .view-battle .force-bar{height:4px}
 .view-battle .force-slots{gap:3px}
 .view-battle .force-slot{width:clamp(22px,calc((100vw - 110px)/10),28px);height:28px}
 .view-battle .force-slot.out::after{font-size:19px}
 .view-battle .battle-stats .action-speed{top:calc(100% + 8px)}
}
@media(max-width:599px){
 .view-battle .masthead .battle-top{grid-template-rows:28px 52px}
 .view-battle .phase-heading h2{font-size:13px}
 .view-battle .force-slots{gap:1px}
 .view-battle .force-slot{width:clamp(24px,calc((100vw - 80px)/10),29px);height:28px}
}
@media(max-height:599px) and (orientation:landscape){
 .view-battle{--battle-head:84px}
 .view-battle .masthead .battle-top{grid-template-rows:24px 52px}
 .view-battle .phase-heading>div{flex-direction:row;align-items:baseline;gap:5px}
 .view-battle .phase-heading h2{font-size:15px}
}
@media(max-width:359px) and (max-height:599px) and (orientation:portrait){
 .view-battle:has(#ordersPanel.expanded){--battle-head:64px}
 .view-battle:has(#ordersPanel.expanded) .masthead .battle-top{grid-template-rows:14px 44px}
 .view-battle:has(#ordersPanel.expanded) .phase-heading h2{display:none}
 .view-battle:has(#ordersPanel.expanded) .force-side{grid-template-rows:12px 3px 24px;gap:1px}
 .view-battle:has(#ordersPanel.expanded) .force-line b{font-size:12px}
 .view-battle:has(#ordersPanel.expanded) .force-slot{width:24px;height:24px}
 .view-battle:has(#ordersPanel.expanded) .force-slot.out::after{font-size:17px}
}
@media(max-height:360px) and (orientation:landscape){
 .view-battle:has(#ordersPanel.expanded){--battle-head:52px}
 .view-battle:has(#ordersPanel.expanded) .masthead .battle-top{grid-template-rows:10px 38px}
 .view-battle:has(#ordersPanel.expanded) .phase-heading h2{display:none}
 .view-battle:has(#ordersPanel.expanded) .round-badge{font-size:10px}
 .view-battle:has(#ordersPanel.expanded) .force-side{grid-template-rows:10px 3px 20px;gap:1px}
 .view-battle:has(#ordersPanel.expanded) .force-line{font-size:10px}
 .view-battle:has(#ordersPanel.expanded) .force-line b{font-size:11px}
 .view-battle:has(#ordersPanel.expanded) .force-slot{width:24px;height:20px}
 .view-battle:has(#ordersPanel.expanded) .force-slot.out::after{font-size:16px}
 .view-battle:has(#ordersPanel.expanded) .battle-stats .clock{font-size:13px}
}
/* Small phones use the full available screen height for the enlarged identity. */
@media(max-height:599px) and (orientation:portrait){
 .view-battle #ordersPanel.expanded{position:fixed;top:8px;bottom:calc(var(--command-dock) + var(--safe-bottom));height:auto}
}

.view-battle #ordersPanel .tactical-select{grid-column:1/-1;width:100%;min-width:0;min-height:44px;height:44px;margin:0;padding:4px 8px;font-size:16px}
.target-command{position:absolute;z-index:25;width:224px;max-width:calc(100% - 16px);padding:10px;background:#172e2cf5;color:#f7ebd1;border:1px solid #bea16b;border-radius:8px;box-shadow:0 5px 20px #0008;font:600 15px/1.5 var(--font-body)}
.target-command button{min-height:44px;padding:6px 10px}.target-command .target-action{display:flex;align-items:center;gap:8px;width:calc(100% - 32px)}.target-command svg{width:28px;height:28px;flex:none}.target-command #cancelTargetCommand{position:absolute;right:3px;top:10px;padding:3px;min-width:30px}.target-command p{font-size:13px;margin:8px 0}.target-command>div{display:flex;gap:8px}

/* Layered orders: choose a purpose, place its route, then tune execution. */
.view-battle #ordersPanel>.command-tabs{flex:0 0 44px}
.view-battle #ordersPanel .command-tabs button{font:600 15px/1.3 var(--font-body);white-space:normal}
.view-battle #ordersPanel>.command-pane{overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#a48e62 transparent;gap:10px;padding:0 3px 6px 0}
.view-battle #ordersPanel>.command-pane[hidden],.view-battle #ordersPanel>.command-policy-summary[hidden]{display:none!important}
.view-battle #ordersPanel .action-policy-controls{display:block;margin:0;padding:0;border:0;min-height:0}
.view-battle #ordersPanel .action-policy-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-top:8px}
.view-battle #ordersPanel .action-policy-grid button{position:relative;display:flex;min-width:0;min-height:76px;padding:10px 3px;flex-direction:column;justify-content:center;align-items:center;gap:7px;color:#344a3c;background:linear-gradient(135deg,#f8efdb,#e1d5bb);border:1px solid #aa9470;box-shadow:inset 0 0 0 1px #fff5;border-radius:3px}
.view-battle #ordersPanel .action-policy-grid strong{font:600 18px/1.3 var(--font-calligraphy);white-space:nowrap}
.view-battle #ordersPanel .action-policy-grid small{font:400 11px/1.4 var(--font-body);letter-spacing:0;white-space:nowrap}
.view-battle #ordersPanel .action-policy-grid button.active{color:#fff2c9;background:linear-gradient(135deg,#386c60,#21493f);border-color:#496e53;box-shadow:inset 0 0 0 2px #c4ac6a}
.view-battle #ordersPanel .action-policy-grid button.active:after{content:'✓';position:absolute;top:3px;right:5px;color:#f2d692;font:700 13px/1 var(--font-body)}
.view-battle #ordersPanel .command-policy-summary{display:flex;flex:0 0 auto;align-items:center;justify-content:space-between;gap:6px;padding:0 0 4px;border-bottom:1px solid #a9947055;color:#45604d;font-size:12px}
.view-battle #ordersPanel .command-policy-summary button{min-height:38px;margin:0;padding:4px 8px;background:#dbd6bd;border:1px solid #a29470;color:#284b3e;font:600 17px/1.3 var(--font-body)}
.view-battle #ordersPanel .command-policy-summary button span{padding-left:5px;font-size:12px;font-weight:400}
.view-battle #ordersPanel .command-step-note{margin:4px 0;color:#536052;font:400 13px/1.5 var(--font-body)}
.view-battle #ordersPanel .command-step-actions{display:flex;flex:0 0 auto;gap:6px;padding-top:8px;margin-top:auto}
.view-battle #ordersPanel .command-step-actions button{min-width:0;min-height:44px;flex:1;padding:6px 3px;font:500 14px/1.4 var(--font-body);letter-spacing:0}
.view-battle #ordersPanel .tuning-overview{display:flex;align-items:center;justify-content:space-between;gap:6px;flex:none}
.view-battle #ordersPanel .tuning-overview>span{font:500 13px var(--font-body);color:#506b55}
.view-battle #ordersPanel .tuning-overview>span.modified{color:#8b501f}
.view-battle #ordersPanel #resetPolicyDefaults{min-height:38px;padding:4px 7px;font:500 13px/1.3 var(--font-body);color:#415345;background:#eee1c8;border:1px solid #a89470}
.view-battle #ordersPanel .tuning-field{display:flex;flex-direction:column;gap:5px;flex:0 0 auto;padding:0 0 8px;border-bottom:1px solid #ac98733b;min-width:0}
.view-battle #ordersPanel .tuning-field>label,.view-battle #ordersPanel .tuning-field .command-section-heading>label{display:flex;align-items:center;gap:8px;font:600 16px/1.4 var(--font-body);color:#304d3d}
.view-battle #ordersPanel .tuning-field select{width:100%;min-width:0;margin:0;min-height:44px;height:44px;padding:5px 8px;font:400 16px/1.3 var(--font-body);color:#263c2d;background:#f8efdc;border:1px solid #a99570;border-radius:3px}
.view-battle #ordersPanel .tuning-field select option:disabled{color:#8a8171}
.view-battle #ordersPanel .tuning-modified{font:500 11px/1.3 var(--font-body);color:#8b501f;background:#e9d0a2;border-radius:3px;padding:2px 5px;white-space:nowrap}
.view-battle #ordersPanel .tuning-rule{margin:0;color:#6c614c;font:400 12px/1.5 var(--font-body)}
.view-battle #ordersPanel .command-advanced{flex:0 0 auto;border:1px solid #ab9871;background:#e8ddc7;padding:0;border-radius:3px;color:#344c3d}
.view-battle #ordersPanel .command-advanced>summary{cursor:pointer;min-height:44px;padding:11px 9px;font:600 15px/1.4 var(--font-body)}
.view-battle #ordersPanel .command-advanced>summary span{display:block;font-size:12px;font-weight:400;margin-top:3px;padding-left:15px;color:#65705b}
.view-battle #ordersPanel .advanced-tuning-body{display:flex;flex-direction:column;gap:10px;padding:4px 10px 10px}
.view-battle #ordersPanel .route-actions{grid-template-columns:repeat(3,minmax(0,1fr))}
.view-battle #ordersPanel .tuning-retreat .command-section-heading{flex-basis:32px}
.view-battle #ordersPanel button:disabled,.view-battle #ordersPanel select:disabled,.view-battle #ordersPanel input:disabled{opacity:.62;cursor:not-allowed}
@media(max-width:380px){
 .view-battle #ordersPanel .command-tabs button{font-size:13px}
 .view-battle #ordersPanel .action-policy-grid strong{font-size:17px}
 .view-battle #ordersPanel .action-policy-grid small{font-size:10px}
}
@media(max-height:599px) and (orientation:landscape){
 .view-battle #ordersPanel.expanded:has(.command-tabs){grid-template-columns:minmax(180px,.75fr) minmax(0,1.25fr);grid-template-rows:44px minmax(0,1fr)}
 .view-battle #ordersPanel:has(.command-tabs)>.command-policy-summary{grid-column:1;grid-row:2;align-self:start;flex-direction:column;align-items:flex-start;border:0;padding:5px}
 .view-battle #ordersPanel:has(.command-tabs)>.command-pane{grid-column:2;grid-row:2;overflow:auto}
 .view-battle #ordersPanel .action-policy-grid button{min-height:64px;padding:6px 2px;gap:4px}
 .view-battle #ordersPanel .action-policy-grid strong{font-size:17px}
}
/* Keep the four everyday settings together; advanced fields retain full labels. */
.view-battle #ordersPanel #command-tuning>.tuning-field:not(.tuning-retreat){display:grid;grid-template-columns:88px minmax(0,1fr);align-items:center;column-gap:8px;row-gap:4px}
.view-battle #ordersPanel #command-tuning>.tuning-field:not(.tuning-retreat)>label{flex-wrap:wrap;gap:3px;font-size:15px}
.view-battle #ordersPanel #command-tuning>.tuning-field:not(.tuning-retreat)>.tuning-rule{grid-column:1/-1}

/* The editor overlays a stable battlefield: opening it never changes map projection. */
@media(min-width:1024px) and (min-height:600px){
 .view-battle{--orders-width:clamp(310px,30vw,380px)}
 .view-battle .battle-layout,.view-battle .battle-layout.orders-open,.view-battle .battle-layout:not(.orders-open){grid-template-columns:minmax(0,1fr)}
 .view-battle #ordersPanel.expanded{position:absolute;top:8px;right:8px;bottom:auto;left:auto;width:var(--orders-width);height:calc(100% - clamp(146px,19.5vh,195px) - 48px);z-index:25;box-shadow:0 8px 32px #071b2060;border:1px solid #a58e65}
 .view-battle .orders-open .map-tools{right:calc(var(--orders-width) + 24px);max-width:calc(100% - var(--orders-width) - 40px);flex-wrap:wrap;justify-content:flex-end}
 .view-battle .orders-open .field-hint{max-width:calc(100% - var(--orders-width) - 48px);bottom:112px}
 .view-battle .unit-status{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:30px;margin-top:5px;font-size:12px;line-height:1.3;color:#e5d6b6}
 .view-battle .unit-name{padding-bottom:3px}.view-battle .unit-type{margin-top:4px}.view-battle .unit-number{margin-top:4px}.view-battle .morale-row{margin-top:4px}
}
.view-battle #field[data-input-mode="route"],.view-battle #field[data-input-mode="point"]{cursor:crosshair}
.view-battle #field[data-input-mode="pan"]{cursor:grab}
.view-battle .map-tools #stopDrawing[aria-pressed="true"],.view-battle .map-tools #panMap[aria-pressed="true"]{background:#b69a57;color:#172f29;border-color:#f3d798}
.view-battle .map-tools{flex-wrap:wrap;justify-content:flex-end;max-width:calc(100% - 24px)}
.view-battle #reviewOrders{font-size:14px}
@media(min-width:1024px) and (min-height:600px){
 .view-battle .battle-stage,.view-battle[data-battle-phase="action"]:not(.expanded-army-cards) .battle-stage{grid-template-rows:minmax(0,1fr) clamp(146px,19.5vh,195px) 32px}
 .view-battle .unit-card,.view-battle[data-battle-phase="action"]:not(.expanded-army-cards) .unit-card{grid-template-columns:30% minmax(0,1fr)}
 .view-battle .unit-copy,.view-battle[data-battle-phase="action"]:not(.expanded-army-cards) .unit-copy{display:grid;grid-template-columns:1fr auto;grid-template-rows:22px 20px 8px 32px;align-content:center;align-items:center;gap:1px 4px;padding:3px 6px;min-height:0}
 .view-battle .unit-name,.view-battle[data-battle-phase="action"]:not(.expanded-army-cards) .unit-name{font-size:18px;letter-spacing:0;border:0;padding:0}
 .view-battle .unit-type,.view-battle[data-battle-phase="action"]:not(.expanded-army-cards) .unit-type{margin:0;font-size:10px;text-align:right}
 .view-battle .unit-type b{display:none}
 .view-battle .unit-number,.view-battle[data-battle-phase="action"]:not(.expanded-army-cards) .unit-number{grid-column:1/-1;margin:0;font-size:18px}
 .view-battle .morale-row,.view-battle[data-battle-phase="action"]:not(.expanded-army-cards) .morale-row{grid-column:1/-1;margin:0;font-size:9px}
 .view-battle .morale-bars i{height:5px}
 .view-battle .unit-status{grid-column:1/-1;margin:0;min-height:0;max-height:32px;font-size:11px;line-height:15px}
}
.command-review-dialog{box-sizing:border-box;width:min(900px,calc(100vw - 24px));max-width:none;max-height:calc(100dvh - 24px);padding:20px;border:2px solid #a58a59;background:#f2e8d3;color:#233b32;font:500 16px/1.5 var(--font-body);overflow:hidden}
.command-review-dialog[open]{display:flex;flex-direction:column;gap:12px}
.command-review-dialog::backdrop{background:#071b20b8}
.review-heading{display:flex;justify-content:space-between;align-items:start;gap:14px;flex-shrink:0}
.review-heading h2{margin:0;font:500 28px/1.4 var(--font-calligraphy)}.review-heading p{margin:4px 0 0;font-size:14px;color:#4c6155}
.review-heading button{min-width:44px;min-height:44px;font-size:24px}
.review-body{overflow:auto;min-height:0;padding-right:5px;scrollbar-gutter:stable}
.command-review-summary{margin:0 0 10px;padding:10px;background:#dce5d5;border-left:4px solid #46715d}
.command-review-list{display:grid;gap:10px}
.command-review-row{padding:12px;background:#fbf5e8;border:1px solid #b8a584;border-radius:4px}
.command-review-row.has-error{border-left:4px solid #a54634}.command-review-row.has-warning{border-left:4px solid #b28731}.command-review-row.is-inactive{background:#e3dfd3;color:#596059}
.command-review-head{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.command-review-unit{min-height:44px;padding:6px 12px;background:#254e40;color:#fff2d7;font-size:18px}
.command-review-timeframe{font-size:13px;padding:3px 8px;border-radius:20px;background:#e3e9de;color:#34513f}
.command-review-policy{font-weight:700;color:#6c4831}
.command-review-details{display:grid;grid-template-columns:70px minmax(0,1fr) 70px minmax(0,1fr);gap:4px 10px;margin:10px 0 0;font-size:14px}
.command-review-details dt{color:#657060}.command-review-details dd{margin:0;overflow-wrap:anywhere}
.command-review-issues{margin:8px 0 0;padding-left:22px;font-size:14px}.command-review-issues .is-error{color:#933923}.command-review-issues .is-warning{color:#805b13}.command-review-note{font-size:13px;color:#5f685b;margin:6px 0 0}
.review-actions{display:flex;justify-content:flex-end;gap:10px;flex-shrink:0;padding-top:10px;border-top:1px solid #bbab8a}
.review-actions button{min-height:48px;padding:8px 18px;font-size:17px}.review-actions button:disabled{opacity:.5;cursor:not-allowed}
@media(max-width:600px){.command-review-dialog{padding:12px;gap:8px}.review-heading h2{font-size:24px}.command-review-details{grid-template-columns:66px minmax(0,1fr)}.review-actions button{flex:1;padding:7px}.view-battle #reviewOrders{min-height:40px;padding:5px;font-size:12px}}
