/* Visual language carried over from Kestral Empire's current HUD: chamfered
   "ink" panels and buttons with an ice-cyan edge, KestralSignal type, and the
   original icon set. Colours and geometry follow MinimalHudV137 / SystemHudV63. */
@font-face{font-family:Kestral;src:url(/fonts/KestralSignal-Medium.ttf);font-display:swap}
@font-face{font-family:Kestral;src:url(/fonts/KestralSignal-Bold.ttf);font-weight:700;font-display:swap}
:root{color-scheme:dark;--ink:#060E12;--ice:#3BDEF0;--cyan:#2EE0FF;--light:#E3F0F5;--text:#F0F7FF;--muted:#8FA8B8;--dim:#596E7A;--edge:#668291;--line:#38636B;
  --amber:#FFA61F;--good:#55E57A;--bad:#FF5C59;--gold:#FFC959;
  --sl:env(safe-area-inset-left,0px);--sr:env(safe-area-inset-right,0px);--st:env(safe-area-inset-top,0px);--sb:env(safe-area-inset-bottom,0px)}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{height:100%;margin:0;overflow:hidden;background:#000;color:var(--text);font-family:Kestral,system-ui,sans-serif;font-size:14px;overscroll-behavior:none;user-select:none;-webkit-user-select:none}
h1,h2,h3,p{margin:0}
h2{font-size:16px;letter-spacing:.14em;color:var(--cyan)}
h3{font-size:11px;letter-spacing:.18em;color:var(--muted);text-transform:uppercase;margin:12px 0 6px}
small{color:var(--muted);font-size:12px}
[hidden]{display:none!important}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* chamfered shapes */
button,.k{--c:7px;--e:var(--edge);--f:var(--ink);position:relative;isolation:isolate;border:0;background:var(--e);
  clip-path:polygon(var(--c) 0,calc(100% - var(--c)) 0,100% var(--c),100% calc(100% - var(--c)),calc(100% - var(--c)) 100%,var(--c) 100%,0 calc(100% - var(--c)),0 var(--c))}
button::before,.k::before{content:"";position:absolute;inset:1.3px;background:var(--f);clip-path:inherit;z-index:-1}
button{font:inherit;font-weight:700;letter-spacing:.07em;color:#E8F2F5;padding:9px 12px;min-height:42px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:7px;text-align:center}
button::after{content:"";position:absolute;right:12px;bottom:4px;width:min(34px,28%);height:2px;background:var(--ice);opacity:.85}
button:hover,button:focus-visible{--f:#0B161E;outline:none}
button:active{--f:#0E3B42;--e:var(--ice)}
button:disabled{--f:#060B0D;--e:#3B4F57;color:var(--dim);cursor:default}
button:disabled::after{opacity:.2}
button.on,button.primary{--f:#08292F;--e:var(--ice);color:var(--ice)}
button.danger{--e:var(--bad);color:#FFD2CC}button.danger::after{background:var(--bad)}
button.big{font-size:20px;padding:14px 60px;min-height:58px;letter-spacing:.24em;--c:11px}
button.wide{width:100%;margin:6px 0}
button img{width:22px;height:22px;object-fit:contain}
.k{--c:16px;--e:#4A616B;--f:linear-gradient(0deg,rgba(5,8,11,.98),rgba(11,19,23,.98))}
.k::after{content:"";position:absolute;inset:0;pointer-events:none;background:
  linear-gradient(#4A7A87,#4A7A87) 27px 6px/21px 1px no-repeat,linear-gradient(#4A7A87,#4A7A87) calc(100% - 27px) 6px/21px 1px no-repeat,
  linear-gradient(#4A7A87,#4A7A87) 27px calc(100% - 6px)/21px 1px no-repeat,linear-gradient(var(--ice),var(--ice)) calc(100% - 25px) calc(100% - 12px)/42px 2px no-repeat}
.backed{--f:linear-gradient(rgba(4,9,12,.55),rgba(4,9,12,.55)),url(/ui/PanelBackdrop.jpg) center/100% 100%,#05080B}

.backdrop{position:fixed;inset:0;display:none;background:#000 center/cover}
body[data-screen="menu"] #preview3d,body[data-screen="loadout"] #preview3d,body[data-screen="game"] #scene3d{display:block}
body[data-screen="loadout"] #preview3d{right:min(46vw,520px)}
#flash{position:fixed;inset:0;background:#d6f8ff;opacity:0;pointer-events:none;z-index:40}
#flash.go{animation:flash .9s ease-out}
@keyframes flash{0%{opacity:.95}100%{opacity:0}}

#message{position:fixed;z-index:30;top:calc(var(--st) + 78px);left:50%;transform:translateX(-50%);max-width:min(560px,60vw);padding:6px 16px;background:rgba(6,14,18,.86);border-bottom:2px solid var(--ice);text-align:center;font-size:13px;pointer-events:none}
#message:empty{display:none}
body[data-screen="game"]:not([data-sheet="space"]) #message{display:none}
#message.danger{border-color:var(--bad);color:#FFD2CC;background:rgba(48,8,8,.88);animation:pulse 1s infinite}
@keyframes pulse{50%{box-shadow:0 0 22px rgba(255,92,89,.55)}}
body[data-screen="menu"] #message,body[data-screen="loadout"] #message{top:auto;bottom:calc(var(--sb) + 14px)}
body[data-screen="loadout"] #message{left:calc((100vw - min(46vw,520px))/2)}
#net{position:fixed;z-index:50;top:calc(var(--st) + 8px);left:50%;transform:translateX(-50%);padding:8px 18px;background:#3a2204;border-bottom:2px solid var(--amber);color:#FFE2BD;font-weight:700}

/* start menu */
#menu{position:fixed;inset:0;display:none;align-items:center;justify-content:center;text-align:center;padding:calc(var(--st) + 18px) 24px calc(var(--sb) + 18px);
  background:radial-gradient(ellipse at 50% 46%,rgba(0,0,0,.08),rgba(0,0,0,.62) 78%),linear-gradient(180deg,rgba(0,0,0,.35),transparent 22%,transparent 72%,rgba(0,0,0,.55))}
body[data-screen="menu"] #menu{display:flex}
#menu:before,#menu:after{content:"";position:absolute;left:14px;right:14px;height:34px;pointer-events:none;opacity:.8}
#menu:before{top:calc(var(--st) + 12px);border-top:1px solid rgba(59,222,240,.55);clip-path:polygon(0 0,26% 0,24% 100%,0 100%,0 0,100% 0,100% 100%,88% 100%,86% 0)}
#menu:after{bottom:calc(var(--sb) + 12px);border-bottom:1px solid rgba(59,222,240,.55);background:linear-gradient(90deg,rgba(59,222,240,.5) 0 70px,transparent 70px calc(100% - 70px),rgba(59,222,240,.5) calc(100% - 70px)) bottom/100% 1px no-repeat}
.brand{position:absolute;top:calc(var(--st) + 20px);left:calc(var(--sl) + 28px);display:flex;align-items:center;gap:12px;letter-spacing:.42em;font-size:13px;font-weight:700;color:var(--light)}
.brand img{width:30px;height:30px;object-fit:contain}
.menuTicks{position:absolute;top:calc(var(--st) + 22px);right:calc(var(--sr) + 28px);display:flex;align-items:center;gap:4px}
.menuTicks i{width:5px;height:12px;background:var(--ice);transform:skewX(-28deg)}.menuTicks b{width:54px;height:12px;border:1px solid rgba(59,222,240,.6);transform:skewX(-28deg);margin-left:4px}
.menuCore{display:flex;flex-direction:column;align-items:center;max-height:100%}
#menu .emblem{height:clamp(56px,17vh,150px);width:auto;filter:drop-shadow(0 0 18px rgba(255,201,89,.35));margin-bottom:-.5vh}
#menu h1{font-size:clamp(34px,8.4vw,112px);line-height:1;letter-spacing:.02em;font-style:italic;font-weight:700;color:#fff;transform:skewX(-6deg);text-shadow:0 4px 0 rgba(0,0,0,.35),0 0 34px rgba(46,224,255,.35);white-space:nowrap}
.rule{width:min(660px,74vw);height:10px;margin:clamp(6px,1.6vh,16px) 0 clamp(4px,1vh,10px);background:linear-gradient(90deg,transparent,var(--ice) 18%,var(--ice) 82%,transparent) center/100% 2px no-repeat;position:relative}
.rule:after{content:"";position:absolute;left:50%;top:1px;width:36px;height:9px;transform:translateX(-50%);background:var(--ice);clip-path:polygon(0 0,100% 0,50% 100%)}
.tag{color:var(--light);font-size:clamp(11px,1.75vw,24px);letter-spacing:.42em;font-style:italic;font-weight:700;margin-bottom:clamp(10px,4.4vh,54px);text-shadow:0 2px 6px #000;white-space:nowrap}
.menuButtons{display:flex;flex-direction:column;align-items:center;gap:clamp(6px,1.5vh,14px)}
.menuButtons button{width:min(352px,64vw);min-height:clamp(38px,6.2vh,54px);font-size:clamp(13px,1.9vh,20px);letter-spacing:.22em;gap:18px;--c:12px;--f:rgba(6,20,28,.82);--e:#2a8fa3}
.menuButtons button:hover,.menuButtons button:focus-visible{--f:rgba(11,48,58,.9);--e:var(--ice)}
.menuButtons svg{width:1.5em;height:1.5em;fill:currentColor}.menuButtons svg.line{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.menuButtons button.play{width:min(404px,72vw);min-height:clamp(46px,8.2vh,78px);font-size:clamp(20px,3.6vh,40px);letter-spacing:.14em;color:#fff;text-shadow:0 2px 0 rgba(90,50,0,.55);
  --c:16px;--e:#FFE39A;--f:linear-gradient(180deg,#F4BC3A,#C9820E 62%,#A4640A);margin-bottom:clamp(2px,1vh,12px)}
.menuButtons button.play:hover,.menuButtons button.play:focus-visible{--f:linear-gradient(180deg,#FFCD55,#DB9416 62%,#B6720E);--e:#fff}
.menuButtons button.play::after{background:#fff;opacity:.6}
.menuButtons button.play:disabled{--f:linear-gradient(180deg,#7d6a3c,#5a4517);--e:#8a7a4a;color:#d8cfb8}
#menuNote a{color:var(--ice)}
#menuNote{position:absolute;bottom:calc(var(--sb) + 22px);left:0;right:0;color:var(--muted)}
#menuDialog{position:fixed;z-index:45;left:50%;top:50%;transform:translate(-50%,-50%);width:min(460px,92vw);padding:22px;display:flex;flex-direction:column;gap:12px}
#dialogBody{display:flex;flex-direction:column;gap:10px;color:var(--light);line-height:1.45}
#dialogBody .chips button.on{--f:#08292F}
@media (max-height:460px){.brand{font-size:11px}.brand img{width:22px;height:22px}#menuNote{font-size:10px;bottom:calc(var(--sb) + 16px)}}
@media (orientation:portrait){#menu h1{font-size:clamp(34px,12.5vw,84px)}.tag{letter-spacing:.2em;font-size:clamp(10px,2.9vw,18px)}}
/* pre-match */
#loadout{position:fixed;top:0;bottom:0;right:0;width:min(46vw,520px);padding:calc(var(--st) + 14px) calc(var(--sr) + 16px) calc(var(--sb) + 12px) 18px;display:flex;flex-direction:column;gap:8px;
  background:linear-gradient(rgba(4,9,12,.6),rgba(4,9,12,.6)),url(/ui/PanelBackdrop.jpg) center/100% 100%,#05080B;border-left:2px solid #4A616B;box-shadow:-1px 0 0 #122129 inset}
.steps{display:flex;gap:6px;list-style:none;margin:0;padding:0}
.steps li{flex:1;font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--dim);border-top:2px solid #233a44;padding-top:5px}
.steps li.done{border-color:#2f8fa0;color:var(--muted)}.steps li.now{border-color:var(--ice);color:var(--text)}
.step{flex:1;min-height:0;display:flex;flex-direction:column}
.scroll{flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;padding-right:4px}
.nav{display:flex;gap:8px;justify-content:space-between;padding-top:10px}
.nav button{min-width:110px}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chips button{flex:1 1 auto;min-height:40px;padding:7px 10px;font-size:12px}
.hint{color:var(--muted);margin:6px 0 10px}
.balance{display:flex;flex-direction:column;gap:2px;margin-bottom:8px}
#prime{display:flex;align-items:center;gap:8px;font-size:20px;font-weight:700;color:var(--text)}
#prime:before{content:"";width:26px;height:26px;background:url(/ui/icons/Prime.png) center/contain no-repeat}
.fxCard{display:grid;grid-template-columns:1fr auto;gap:4px 8px;align-items:center;padding:9px 10px;margin-bottom:7px;background:rgba(8,20,28,.5);border-bottom:2px solid rgba(46,82,99,.5)}
.fxCard.sel{border-color:var(--cyan);background:rgba(8,41,47,.6)}
.fxCard b{font-size:14px}.fxCard small{grid-column:1}
.fxCard .btns{grid-column:2;grid-row:1/3;display:flex;gap:5px}
.fxCard button{min-height:38px;padding:6px 9px;font-size:11px}
.benefit{display:flex;flex-direction:column;align-items:flex-start;width:100%;text-align:left;margin-bottom:8px;padding:11px 14px;gap:2px}
.benefit small{font-weight:400;letter-spacing:0}
#summary{display:grid;grid-template-columns:auto 1fr;gap:6px 14px;margin-bottom:10px}
#summary span{color:var(--muted)}
.searching{display:flex;align-items:center;gap:10px;margin:10px 0;color:var(--cyan);font-weight:700}
.searching:before{content:"";width:18px;height:18px;border-radius:50%;border:3px solid #1d4450;border-top-color:var(--cyan);animation:spin .9s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* HUD */
#game{position:fixed;inset:0;pointer-events:none}
#game>*{pointer-events:auto}
#hudTop{position:absolute;top:calc(var(--st) + 10px);left:calc(var(--sl) + 10px);right:calc(var(--sr) + 10px);display:flex;justify-content:space-between;align-items:flex-start;gap:8px;pointer-events:none}
/* home system panel: Kestral's 320-unit design grid, scaled with --u */
.home{--u:clamp(.64,calc(20vw / 320px),1);--u:clamp(0.66px,calc(20vw / 320),1px);width:calc(320 * var(--u));min-width:272px;padding-bottom:16px}
.homeHead{display:flex;align-items:center;gap:calc(14 * var(--u));padding:calc(16 * var(--u)) calc(16 * var(--u)) calc(10 * var(--u))}
.homeHead img{width:calc(86 * var(--u));height:calc(86 * var(--u));min-width:54px;min-height:54px;object-fit:contain}
.homeHead i{width:1px;align-self:stretch;background:rgba(66,122,143,.8)}
.homeText{min-width:0;display:flex;flex-direction:column}
.eyebrow{font-size:max(10px,calc(15 * var(--u)));letter-spacing:.14em;color:var(--cyan);font-weight:700}
#systemName{font-size:max(17px,calc(30 * var(--u)));line-height:1.1;text-transform:uppercase;white-space:nowrap;overflow:hidden}
#callsign{font-size:max(11px,calc(17 * var(--u)));color:#9EBAC9;white-space:nowrap;overflow:hidden}
.hrow{position:relative;display:flex;justify-content:space-between;align-items:center;gap:8px;margin:0 16px;padding:5px 0 5px 10px;border-top:1px solid rgba(56,99,107,.65);font-size:12px;font-weight:700}
.hrow:before{content:"";position:absolute;left:0;top:50%;width:3px;height:14px;transform:translateY(-50%);background:var(--a,var(--cyan))}
.hrow span:last-child{color:var(--a,var(--cyan));white-space:nowrap}
.hrow em{font-style:normal}
.hrow .meter{position:absolute;left:10px;right:0;bottom:1px;height:2px;background:rgba(46,82,99,.4)}
.hrow .meter i{display:block;height:100%;background:var(--a,var(--cyan));transition:width .4s}
.clock::after{display:none}
.clock{--c:10px;text-align:center;min-width:128px;padding:6px 14px 8px}
.clock b{display:flex;align-items:center;justify-content:center;gap:6px;font-size:22px;letter-spacing:.08em}
.clock b:before{content:"";width:18px;height:18px;background:url(/ui/icons/Clock.png) center/contain no-repeat;opacity:.9}
.clock span{display:block;font-size:11px;color:var(--muted)}
#collapse.soon{color:var(--bad);font-weight:700}
.res{display:grid;grid-template-columns:repeat(3,auto);gap:4px 6px}
.res span{display:flex;align-items:center;gap:6px;padding:3px 10px 3px 6px;font-size:15px;font-weight:700;white-space:nowrap;background:rgba(8,20,28,.42);border-bottom:2px solid rgba(46,224,255,.55)}
.res img{width:24px;height:24px;object-fit:contain}
#feed{position:absolute;left:calc(var(--sl) + 10px);bottom:calc(var(--sb) + 66px);width:min(300px,40vw);pointer-events:none}
#log{font-size:11px;line-height:1.5;color:#b9d8e1;white-space:pre-line;text-shadow:0 1px 3px #000}
#targetCard{position:absolute;right:calc(var(--sr) + 10px);top:calc(var(--st) + 86px);width:min(240px,42vw);padding:10px 12px 12px;--e:#8a3a34}
#targetCard b{display:block;color:#FFD9D2}
#targetCard small{display:block;margin:2px 0 8px}
.row{display:flex;gap:6px}.row button{flex:1}
#targetClear{flex:0 0 42px}
#quick{position:absolute;right:calc(var(--sr) + 10px);bottom:calc(var(--sb) + 66px);display:flex;flex-wrap:wrap-reverse;justify-content:flex-end;align-items:flex-end;gap:6px;max-width:min(560px,58vw)}
#quick button{min-height:46px;font-size:12px}
#supplies{display:flex;gap:6px}
#supplies button{--e:var(--gold);color:var(--gold)}
#resetCamera{font-size:18px;padding:6px 12px}
#again{position:absolute;left:50%;transform:translateX(-50%);bottom:calc(var(--sb) + 66px)}
#mobileNav{position:absolute;left:calc(var(--sl) + 10px);right:calc(var(--sr) + 10px);bottom:calc(var(--sb) + 8px);display:flex;gap:6px}
#mobileNav button{flex:1;min-height:48px;font-size:13px}
#mobileNav button img{width:26px;height:26px}
#mobileNav button.active{--f:#08292F;--e:var(--ice);color:var(--ice)}

.sheet{position:absolute;z-index:20;padding:14px 16px;display:flex;flex-direction:column;gap:8px;top:calc(var(--st) + 10px);bottom:calc(var(--sb) + 62px)}
.sheet>h2{display:flex;align-items:center;gap:8px}.sheet>h2 img{width:26px;height:26px}
#commandPanel{right:calc(var(--sr) + 10px);width:min(420px,94vw)}
#researchPanel{left:calc(var(--sl) + 10px);right:calc(var(--sr) + 10px)}
#mapPanel{left:calc(var(--sl) + 10px);right:calc(var(--sr) + 10px);display:grid;grid-template-columns:1fr minmax(210px,300px);grid-template-rows:auto 1fr;gap:8px 14px;
  --f:#05080B}
#mapPanel h2{grid-column:1/-1}
/* The map itself is painted on the canvas by starmap.js; the buttons are invisible tap targets over each star. */
.mapWrap{position:relative;min-height:0;overflow:hidden;background:#000 url(/ui/StellarMapBackground.jpg) center/cover}
#mapCanvas{position:absolute;inset:0;width:100%;height:100%}
.stellar-field{position:absolute;inset:0}
button.star{position:absolute;transform:translate(-50%,-50%);min-height:0;padding:0;background:none;clip-path:none;border-radius:50%}
button.star::before,button.star::after{display:none}
button.star:focus-visible{outline:2px solid var(--ice)}
.mapSide{display:flex;flex-direction:column;gap:8px;min-height:0;overflow-y:auto;padding:10px;background:rgba(1,4,7,.55)}
.map-info{color:var(--text);line-height:1.5}
.warn{border-bottom:2px solid var(--bad);padding:9px;background:rgba(48,8,8,.7)}
.warn p{margin-bottom:8px;font-size:12px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.grid2 button{font-size:11px;padding:7px 6px;min-height:44px}
/* research: Kestral layout - discipline rail, node canvas, detail panel */
.rsWrap{flex:1;min-height:0;display:grid;grid-template-columns:21.5% minmax(0,1fr) minmax(200px,30%);gap:12px}
.rail{display:flex;flex-direction:column;gap:6px;overflow-y:auto}
.rail button{justify-content:flex-start;font-size:12px;min-height:40px}
.rsCanvas{position:relative;overflow:auto;-webkit-overflow-scrolling:touch;background:linear-gradient(180deg,rgba(5,17,27,.73),rgba(9,48,71,.65)),repeating-linear-gradient(0deg,transparent 0 calc(64px * var(--k) - 1px),#081419 0 calc(64px * var(--k))),repeating-linear-gradient(90deg,transparent 0 calc(64px * var(--k) - 1px),#081419 0 calc(64px * var(--k)));--k:.7}
#rsField{position:relative;width:calc(830px * var(--k));height:calc(335px * var(--k));min-width:100%;min-height:100%}
#rsLines{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}
#rsLines path{fill:none;stroke:#224959;stroke-width:max(1px,calc(2px * var(--k)))}
.rsHint{position:absolute;right:10px;bottom:6px;color:var(--muted);pointer-events:none}
button.node{position:absolute;width:calc(250px * var(--k));height:calc(132px * var(--k));padding:calc(10px * var(--k));justify-content:flex-start;gap:calc(10px * var(--k));text-align:left;--c:calc(10px * var(--k));min-height:0}
button.node::after{display:none}
button.node.sel{--e:var(--gold)}
.node img{width:27%;height:auto;max-height:100%}
.node div{min-width:0;display:flex;flex-direction:column;justify-content:space-between;align-self:stretch;flex:1}
.node b{font-size:max(11px,calc(19px * var(--k)));line-height:1.15;color:#F0F7FF;letter-spacing:0}
.node span{align-self:flex-start;padding:2px 7px;background:rgba(5,26,33,.85);font-size:max(9px,calc(15px * var(--k)));color:var(--muted);letter-spacing:.04em}
.node.done span{color:#2EE0FF}.node.open span,.node.busy span{color:#40DBF2}
.rsDetail{display:flex;flex-direction:column;gap:5px;min-height:0;overflow-y:auto;padding:10px;background:rgba(1,4,7,.5)}
.rsDetail b.title{font-size:19px;line-height:1.1}
.rsDetail .cap{color:var(--cyan);font-size:11px;letter-spacing:.14em}
.rsDetail h3{margin:6px 0 0}
.rsDetail .met{color:var(--cyan)}.rsDetail .unmet{color:#E67366}
.tiles{display:grid;grid-template-columns:1fr 1fr;gap:5px}
.tiles span{display:flex;align-items:center;gap:6px;padding:4px 6px;background:rgba(8,20,28,.6);border-bottom:2px solid rgba(46,224,255,.45);font-weight:700;font-size:12px}
.tiles span.short{border-color:var(--bad);color:#FFB3AD}
.tiles img{width:20px;height:20px}
#contacts{display:flex;flex-direction:column;gap:6px;color:var(--muted)}
#results{position:absolute;z-index:25;left:50%;top:50%;transform:translate(-50%,-50%);width:min(440px,92vw);padding:24px;text-align:center;display:flex;flex-direction:column;gap:9px}
#results h2{font-size:26px;letter-spacing:.22em}
#resultPlacement{font-size:17px}#resultReward{color:var(--gold);font-weight:700}
#results details{text-align:left}

/* portrait and short layouts */
@media (orientation:portrait){
  body[data-screen="loadout"] #preview3d{right:0;bottom:58vh}
  #loadout{top:auto;left:0;width:auto;height:58vh;border-left:0;border-top:2px solid #4A616B;padding-top:12px}
  body[data-screen="loadout"] #message{left:50%;bottom:auto;top:calc(var(--st) + 10px)}
  #hudTop{flex-wrap:wrap}.home{order:3;--u:.72px}.clock{flex:0 0 auto}
  #message{top:auto;bottom:calc(var(--sb) + 124px);max-width:90vw}
  #mobileNav button{font-size:10px;padding:6px 2px;letter-spacing:.02em;flex-direction:column;gap:2px}#mobileNav button img{width:20px;height:20px}
  #mapPanel{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr) auto}
  .rsWrap{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr) auto}.rail{flex-direction:row}.rail button{flex:1;justify-content:center;padding:6px 4px;font-size:10px}
  #targetCard{top:calc(var(--st) + 160px)}
  #quick{max-width:94vw}
}
@media (max-height:460px){
  .home{--u:.66px}.hrow{padding:3px 0 3px 10px;font-size:11px}
  .clock b{font-size:17px}.clock{padding:4px 12px 6px}
  .res span{font-size:13px;padding:2px 8px 2px 5px}.res img{width:20px;height:20px}
  #message{top:calc(var(--st) + 62px)}#targetCard{top:calc(var(--st) + 66px)}
  h3{margin:8px 0 4px}button{min-height:38px}
  #quick button{min-height:40px}#mobileNav button{min-height:42px}
  .sheet{bottom:calc(var(--sb) + 56px);padding:10px 12px}#feed,#quick,#again{bottom:calc(var(--sb) + 58px)}
  #log{max-height:52px;overflow:hidden}
}
