/* R16: one measured top rail for short phones. Natural row height supports
   enlarged text; original controls and world/input projection are untouched. */
.r16-phone-rail{display:none}
.battle.r16-short-phone .r16-phone-rail{display:grid;position:absolute;z-index:5;top:calc(8px + env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4px 6px;pointer-events:none;align-items:start}
.battle.r16-short-phone .r16-phone-rail>.hud-top,
.battle.r16-short-phone .r16-phone-rail>.vitals,
.battle.r16-short-phone .r16-phone-rail>.objective-pill,
.battle.r16-short-phone .r16-phone-rail>.world-strip,
.battle.r16-short-phone .r16-phone-rail>.field-coach{position:relative;inset:auto;transform:none;width:auto;max-width:none;margin:0;min-width:0;box-sizing:border-box}
.battle.r16-short-phone .r16-phone-rail>.hud-top{grid-column:1/-1;min-height:44px;padding:0;gap:5px}
.battle.r16-short-phone .r16-phone-rail>.vitals{grid-column:1/-1;padding:5px 8px}
.battle.r16-short-phone .r16-phone-rail>.objective-pill{padding:6px 7px;min-height:44px}
.battle.r16-short-phone .r16-phone-rail>.objective-pill>div:first-child{flex-wrap:wrap;gap:2px 6px;line-height:1.35}
.battle.r16-short-phone .r16-phone-rail>.objective-pill #goal{white-space:normal}
.battle.r16-short-phone .r16-phone-rail>.objective-pill #goalValue{margin-left:auto}
.battle.r16-short-phone .r16-phone-rail>.world-strip{padding:0 4px 3px}
.battle.r16-short-phone .r16-phone-rail .objective-nav{padding:4px;gap:2px;min-height:44px}
.battle.r16-short-phone .r16-phone-rail .objective-nav>span{white-space:normal;overflow-wrap:anywhere}
.battle.r16-short-phone .r16-phone-rail .coast-rule>div:first-child{display:block;line-height:1.3}
.battle.r16-short-phone .r16-phone-rail #coastPhase{display:block;margin:0;white-space:normal}
.battle.r16-short-phone .r16-phone-rail>.field-coach{grid-column:1/-1;display:block;padding:5px 7px;border:1px solid #6e9169;border-radius:8px;background:#244d3e;color:#f4f5da;text-align:left}
.battle.r16-short-phone .r16-phone-rail>.field-coach[hidden]{display:none}
.battle.r16-short-phone .r16-phone-rail>.field-coach .field-coach-icon,
.battle.r16-short-phone .r16-phone-rail>.field-coach .field-coach-steps,
.battle.r16-short-phone .r16-phone-rail>.field-coach div>small,
.battle.r16-short-phone .r16-phone-rail>.field-coach div>b{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.battle.r16-short-phone .r16-phone-rail>.field-coach div>span{display:block;font-size:12px;line-height:1.4;white-space:normal}
.battle.r16-short-phone[data-hud-readability=large] .r16-phone-rail>.field-coach div>span{font-size:14px}

/* Transient notices flow below the rail instead of being covered by it. */
.battle.r16-short-phone .r16-phone-rail>.battle-notice{display:none;position:relative;inset:auto;transform:none;grid-column:1/-1;max-width:none;width:auto;margin:0;white-space:normal;overflow:visible;line-height:1.4}
.battle.r16-short-phone .r16-phone-rail>.battle-notice.visible{display:block}

/* A mission-first rail: optional branch details open through the same real
   44px chooser. The selected target still has its world arrow and distance. */
.battle.r16-short-phone .r16-phone-rail{grid-template-columns:minmax(0,1fr) 50px}
.battle.r16-short-phone .r16-phone-rail .objective-nav{justify-content:center}
.battle.r16-short-phone .r16-phone-rail .objective-nav::after{content:'支线';font-size:12px;line-height:1.3;color:#294f50}
.battle.r16-short-phone .r16-phone-rail .objective-nav>span,
.battle.r16-short-phone .r16-phone-rail .objective-nav>b,
.battle.r16-short-phone .r16-phone-rail #coastTitle{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.battle.r16-short-phone .r16-phone-rail>.world-strip{padding:0;border:0;background:transparent;box-shadow:none}
.battle.r16-short-phone .r16-phone-rail>.objective-pill{padding:5px 7px}
.battle.r16-short-phone .r16-phone-rail>.objective-pill .coast-rule{margin:3px 0 0;padding:3px 0 0;text-align:left;border-top:1px solid #b8c7a7}
.battle.r16-short-phone .r16-phone-rail>.objective-pill .coast-rule>small{display:none}
.battle.r16-short-phone .r16-phone-rail>.objective-pill #coastPhase{font-size:11px;line-height:1.3;margin:0;white-space:normal}
.battle.r16-short-phone .r16-phone-rail>.vitals:not(.ink-low):not(.ink-flow) .ink-state{display:none}
/* Ground and enemies remain legible in the gaps between the unchanged
   physical touch targets. Keep each button's own contrast surface. */
.battle.r16-short-phone .control-shade{background:linear-gradient(transparent,#edf1e11a 65%,#eef1e54d)}
/* These exact reasons are already printed on the button (缺墨 / energy %).
   Retain the associated description for assistive tech without a duplicate row. */
.battle.r16-short-phone .skill-wrap:has(button[data-availability="ink"])>.action-availability,
.battle.r16-short-phone .skill-wrap:has(button[data-availability="energy"])>.action-availability{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
