/* Preparation owns its layout. Screen width adds separation, never stretches paper menus. */
#preparation{grid-template-rows:104px minmax(0,1fr) 180px;padding:16px 24px;gap:12px}
#preparation .prep-main{grid-template-columns:370px minmax(0,1fr) 430px;gap:24px}
#preparation .prep-equipment,#preparation .prep-posts{width:100%;max-height:790px;align-self:start;height:100%;padding:12px 14px 8px;min-height:0}
#preparation .prep-equipment h2,#preparation .prep-posts h2{font-size:25px;line-height:28px;margin:0 0 6px;padding-bottom:7px;white-space:nowrap}
#preparation #prepEquipment,#preparation #prepOfficers{overflow:visible;min-height:0;grid-template-rows:repeat(8,minmax(0,1fr))}
#preparation #prepOfficers{grid-template-rows:repeat(6,minmax(0,1fr))}
#preparation .equipment-slot,#preparation .prep-officer{padding:4px 0;gap:10px;overflow:visible;min-height:0}
#preparation .equipment-slot>img{width:48px;height:48px}
#preparation .equipment-slot small,#preparation .prep-officer small{font-size:14px;line-height:17px;letter-spacing:.2px;margin:0}
#preparation .equipment-slot b{font-size:21px;line-height:23px}
#preparation .equipment-count{font-size:14px;line-height:18px}
#preparation .prep-officer .officer-mini{width:72px;height:72px;aspect-ratio:1;object-fit:contain;object-position:center;border:2px solid #987148;background:#d8bc85;box-shadow:inset 0 0 0 2px #f3ddb2}
#preparation .prep-officer b{font:600 25px/26px var(--font-display);white-space:nowrap}
#preparation .prep-officer .officer-level{display:inline;font:14px/17px var(--font-body);margin:0}
#preparation .prep-skills{display:flex;gap:6px;margin:5px 0 0;letter-spacing:0}
#preparation .prep-skill{display:block;width:36px;height:36px;margin:0;flex:none;position:relative;border:1px solid #906635;background:#dac08e;box-shadow:inset 0 0 0 2px #f2deae;cursor:help;outline-offset:2px;overflow:hidden}
#preparation .prep-skill>img{width:100%;height:100%;padding:3px;object-fit:contain;border:0;background:none}
#preparation .prep-skill.locked>img{opacity:.22;filter:grayscale(1)}
#preparation .skill-lock{position:absolute;left:6px;top:4px;width:18px;height:20px;fill:#ddc298;stroke:#694a2c;stroke-width:2}
#preparation .prep-skill .unlock-level{position:absolute;right:2px;bottom:0;font:700 15px/16px var(--font-body);color:#4d3420}
#preparation .passive-mark{position:absolute;right:1px;bottom:0;font:700 17px/16px var(--font-body);font-style:normal;color:#4c674d;background:#f1dfbacc}
#preparation .skill-cooldown{position:absolute;inset:0;background:conic-gradient(#291c15b8 var(--cooldown),#291c1510 0);display:grid;place-items:center;font:700 23px var(--font-body);font-style:normal;color:#fff1d0;text-shadow:0 1px 3px #000}
#preparation .panel-hint{font-size:14px;line-height:18px;padding-top:5px}
#preparation .prep-bottom{grid-template-columns:130px 220px 440px 144px 144px 240px;justify-content:space-between;gap:12px;padding:10px 18px;align-items:center}
#preparation .prep-bottom>div{min-width:0;max-height:100%}
#preparation #prepVital,#preparation #prepMovement,#preparation #prepLedger{display:grid;grid-template-columns:1fr;gap:7px;align-content:center}
#preparation .prep-stat{display:grid;grid-template-columns:36px 1fr;align-items:center;gap:6px;min-height:38px;width:100%;padding:0;background:none;border:0;box-shadow:none;color:#3d2a1e;position:relative}
#preparation button.prep-stat{border:1px solid #9c784a55;background:#dabc8233;padding:1px 3px}
#preparation .prep-stat>img,#preparation .prep-stat>svg{width:34px;height:34px;object-fit:contain;filter:drop-shadow(0 1px 1px #754d2333)}
#preparation .prep-stat>svg{fill:#cf9c48;stroke:#79522d;stroke-width:1.4}
#preparation .prep-stat>b,#preparation #prepVital .hold-stat{font:500 27px/32px var(--font-body);text-align:center;white-space:nowrap;font-variant-numeric:tabular-nums}
#preparation .prep-ledger{position:static;transform:none;left:auto;top:auto;white-space:normal}
#preparation .battle-launch{font:600 26px/29px var(--font-display);width:100%;min-height:84px;padding:10px;letter-spacing:1px}
#preparation .battle-launch span{font:16px/19px var(--font-body);margin-top:5px;letter-spacing:0}
/* Diagram captions are grid items; no absolute text can drift onto the model. */
#preparation #prepMasts .mast-diagram{height:144px;padding:0;display:grid;grid-auto-flow:column;grid-template-rows:1fr 18px;gap:0 8px;min-width:0;align-items:center}
#preparation #prepMasts .mast-condition{height:122px;min-width:0;justify-content:center;gap:2px;grid-row:1}
#preparation #prepMasts .model-mast{width:52px;height:72px}
#preparation #prepMasts .mast-condition small{font:15px/18px var(--font-body)}
#preparation #prepMasts .mast-condition b{font:500 23px/26px var(--font-body);text-align:center}
#preparation #prepMasts .mast-condition em{font:16px/26px var(--font-body)}
#preparation #prepMasts figcaption{position:static;grid-row:2;grid-column:1/-1;font:14px/18px var(--font-display);letter-spacing:1px;text-align:center}
#preparation #prepHull .hull-diagram{display:grid;grid-template-columns:82px minmax(0,1fr) 82px;grid-template-rows:45px 42px 45px;align-items:center;width:100%;height:132px;min-width:0;max-width:none;margin:0}
#preparation #prepHull .horizontal-hull{position:static;transform:none;grid-column:2;grid-row:2;width:100%;height:42px;max-width:none;overflow:visible}
#preparation #prepHull .hull-facet{position:static;transform:none;min-width:0;text-align:center}
#preparation #prepHull .facet-3{grid-column:2;grid-row:1}
#preparation #prepHull .facet-1{grid-column:2;grid-row:3}
#preparation #prepHull .facet-2{grid-column:1;grid-row:2}
#preparation #prepHull .facet-0{grid-column:3;grid-row:2}
#preparation #prepHull .hull-facet small{font:15px/18px var(--font-body);margin:0}
#preparation #prepHull .hull-facet span{display:flex;align-items:center;justify-content:center;gap:4px;font:500 20px/23px var(--font-body);margin:0;white-space:nowrap}
.hull-facet .stat-icon{width:19px;height:19px;object-fit:contain;display:inline-block;vertical-align:middle}
#preparation #prepHull .hull-facet .stat-icon{width:20px;height:20px}
#preparation #prepPopover{overflow:visible;touch-action:auto;padding:15px;width:390px}
#preparation #prepPopover h3{font:600 22px/25px var(--font-display);margin:0 28px 12px 0;padding-bottom:8px}
#preparation .officer-candidate{min-height:116px;padding:10px;gap:12px;margin-bottom:8px}
#preparation .officer-candidate:last-child{margin-bottom:0}
#preparation .officer-candidate>.candidate-portrait{width:82px;height:82px;aspect-ratio:1;object-fit:contain;object-position:center;border:2px solid #967047;background:#d5b886}
#preparation .officer-candidate b{font:600 26px/28px var(--font-display)}
#preparation .officer-candidate small{font:14px/18px var(--font-body);margin:2px 0}
#preparation .officer-candidate em{font:15px/18px var(--font-display);margin:6px 0 0}
#preparation .officer-candidate .prep-skills{margin:3px 0 0}
#prepTooltip{position:fixed;z-index:190;width:280px;max-width:calc(100vw - 24px);padding:9px 12px;border:3px double #926c3e;pointer-events:none}
#prepTooltip[hidden]{display:none}#prepTooltip>b{display:block;font:600 22px/24px var(--font-display);margin-bottom:3px}#prepTooltip>span{display:block;font:17px/21px var(--font-body)}
@media(max-width:1800px){#preparation .prep-main{grid-template-columns:310px minmax(0,1fr) 360px;gap:16px}#preparation .prep-bottom{grid-template-columns:116px 212px 370px 126px 120px 210px;padding:8px 14px;gap:10px}#preparation .prep-officer b{font-size:23px}#preparation .prep-officer .officer-mini{width:64px;height:64px}#preparation .prep-skill{width:32px;height:32px}#preparation .prep-equipment h2,#preparation .prep-posts h2{font-size:23px}}
@media(max-width:1400px){#preparation{padding:10px 14px;gap:8px}#preparation .prep-main{grid-template-columns:275px minmax(0,1fr) 325px;gap:12px}#preparation .prep-bottom{grid-template-columns:105px 196px 326px 112px 100px 190px;padding:8px 10px;gap:8px}#preparation .prep-equipment,#preparation .prep-posts{padding:7px 10px}#preparation .prep-equipment h2,#preparation .prep-posts h2{font-size:21px;line-height:24px;padding-bottom:4px;margin-bottom:4px}#preparation .equipment-slot>img{width:38px;height:38px}#preparation .equipment-slot b{font-size:18px;line-height:20px}#preparation .equipment-slot small,#preparation .prep-officer small{font-size:13px;line-height:16px}#preparation .equipment-count{font-size:13px;line-height:16px}#preparation .prep-officer b{font-size:22px;line-height:24px}#preparation .prep-officer .officer-mini{width:58px;height:58px}#preparation .prep-skill{width:30px;height:30px}#preparation .prep-skills{margin-top:3px}#preparation .prep-stat{grid-template-columns:30px 1fr;gap:3px}#preparation .prep-stat>img,#preparation .prep-stat>svg{width:29px;height:29px}#preparation .prep-stat>b,#preparation #prepVital .hold-stat{font-size:24px;line-height:29px}#preparation #prepHull .hull-diagram{grid-template-columns:72px minmax(0,1fr) 72px}#preparation #prepHull .hull-facet span{font-size:18px;gap:2px}#preparation #prepHull .hull-facet .stat-icon{width:18px;height:18px}#preparation #prepMasts .model-mast{width:44px;height:66px}#preparation #prepMasts .mast-condition b{font-size:21px}#preparation .battle-launch{font-size:23px}#preparation .battle-launch span{font-size:14px}}
@media(max-height:850px){#preparation{grid-template-rows:82px minmax(0,1fr) 168px;padding-top:10px;padding-bottom:10px;gap:8px}#preparation .prep-heading h1{font-size:35px;margin:1px 0 5px}#preparation .prep-heading>span{font-size:17px}#preparation .prep-heading button{min-height:32px;padding:5px 18px}#preparation .prep-officer{padding:2px 0}#preparation .prep-officer .officer-mini{width:56px;height:56px}#preparation .prep-skill{width:26px;height:26px}#preparation .prep-officer b{font-size:21px;line-height:22px}#preparation .prep-officer small,#preparation .prep-officer .officer-level{font-size:13px;line-height:15px}#preparation .prep-skills{margin-top:2px}#preparation .skill-lock{width:14px;height:16px;left:4px;top:2px}#preparation .equipment-slot>img{width:38px;height:38px}#preparation .panel-hint{font-size:13px;line-height:16px;padding-top:3px}#preparation .preview-controls span{display:none}}
