/*
 * public/m33-static/proto-body.css — the Body view
 * (lib/views/htmls/proto/body.ejs; ADR 0087 phase 3, rule 10a).
 *
 * Served from /m33/ by the Proto host. Colours are the shell's --m33-*
 * tokens (rule 10b); physical reads in the anatomy discipline colour, the
 * planned state is dashed and faint like the class graph's.
 */
#m33-body{height:100%;min-height:calc(100vh - 190px);overflow:auto;padding:14px 18px 24px;box-sizing:border-box;font-family:system-ui,-apple-system,sans-serif;color:var(--m33-text,#e6e9f2)}
.m33-body-head{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:14px}
.m33-body-head h1{font-size:16px;font-weight:600;margin:0}
.m33-body-kind{font:600 11px/1 system-ui,sans-serif;padding:5px 8px;border-radius:999px;border:1px solid var(--m33-border,rgba(255,255,255,0.14));color:var(--m33-text-muted,#8a93a6)}
.m33-body-kind-physical{color:var(--m33-disc-anatomy,#e0a458);border-color:var(--m33-disc-anatomy,#e0a458)}
.m33-body-modes{display:flex;gap:4px;margin-left:auto}
.m33-body-mode{background:var(--m33-card,rgba(255,255,255,0.05));border:1px solid var(--m33-border,rgba(255,255,255,0.14));color:var(--m33-text,#e6e9f2);font:600 11px/1 system-ui,sans-serif;padding:6px 10px;border-radius:7px;cursor:pointer;user-select:none}
.m33-body-mode[aria-disabled="true"]{opacity:0.45;cursor:default}
/* 2D / 3D switch: two radios ahead of the header and the item; CSS only. */
.m33-body-radio{position:absolute;opacity:0;pointer-events:none}
#m33-body-m2d:checked ~ .m33-body-head label[for="m33-body-m2d"],
#m33-body-m3d:checked ~ .m33-body-head label[for="m33-body-m3d"]{border-color:var(--m33-accent,var(--m33-disc-sociology));background:color-mix(in srgb,var(--m33-accent,var(--m33-disc-sociology)) 22%,transparent)}
#m33-body-m2d:focus-visible ~ .m33-body-head label[for="m33-body-m2d"],
#m33-body-m3d:focus-visible ~ .m33-body-head label[for="m33-body-m3d"]{outline:2px solid var(--m33-accent,var(--m33-disc-sociology));outline-offset:2px}
.m33-body-plan3d{display:none}
#m33-body-m3d:checked ~ .m33-body-item .m33-body-plan2d{display:none}
#m33-body-m3d:checked ~ .m33-body-item .m33-body-plan3d{display:block}
/* Render (ADR 0088): the third radio; the ray-traced figure. */
#m33-body-mrender:checked ~ .m33-body-head label[for="m33-body-mrender"]{border-color:var(--m33-accent,var(--m33-disc-sociology));background:color-mix(in srgb,var(--m33-accent,var(--m33-disc-sociology)) 22%,transparent)}
.m33-body-render{display:none}
#m33-body-mrender:checked ~ .m33-body-item .m33-body-plan2d{display:none}
#m33-body-mrender:checked ~ .m33-body-item .m33-body-render{display:block}
.m33-body-render-canvas{display:block;width:100%;height:min(62vh,560px);border-radius:10px;background:var(--m33-panel,#f2f2f0);cursor:grab}
.m33-body-render-status{font:500 11px/1.3 system-ui,sans-serif;color:var(--m33-text-muted,#8a93a6)}
.m33-body-render-bad{color:var(--m33-bad,#e06c75)}
/* Dimensions toggle: a checkbox beside the radios; on by default; CSS only. */
#m33-body-dims:checked ~ .m33-body-head label[for="m33-body-dims"]{border-color:var(--m33-accent,var(--m33-disc-sociology));background:color-mix(in srgb,var(--m33-accent,var(--m33-disc-sociology)) 22%,transparent)}
#m33-body-dims:not(:checked) ~ .m33-body-item .m33-body-dimline{display:none}

.m33-body-item{display:flex;gap:18px;flex-wrap:wrap;align-items:flex-start;margin-bottom:20px}
.m33-body-plan{flex:1 1 100%;margin:0;padding:12px;background:var(--m33-panel,rgba(255,255,255,0.02));border:1px solid var(--m33-border,rgba(255,255,255,0.08));border-radius:10px}
.m33-body-plan figcaption{font-size:12px;color:var(--m33-text-muted,#8a93a6);margin-bottom:8px}
.m33-body-plan svg{width:100%;height:calc(100vh - 290px);min-height:320px;display:block}
.m33-body-floor{fill:color-mix(in srgb,var(--m33-disc-anatomy,#e0a458) 8%,transparent);stroke:var(--m33-disc-anatomy,#e0a458);stroke-width:4}
.m33-body-door{stroke:var(--m33-bg,#0d1020);stroke-width:6;stroke-dasharray:10 6}
/* SVG text takes its size from its <svg font-size>, scaled to the drawing. */
.m33-body-dim,.m33-body-label{fill:var(--m33-text-muted,#8a93a6)}
.m33-body-empty{font-style:italic;fill:var(--m33-text-muted,#8a93a6)}
.m33-body-iso-floor{fill:color-mix(in srgb,var(--m33-disc-anatomy,#e0a458) 10%,transparent);stroke:var(--m33-disc-anatomy,#e0a458);stroke-width:2}
.m33-body-iso-wall{fill:color-mix(in srgb,var(--m33-disc-anatomy,#e0a458) 5%,transparent);stroke:var(--m33-disc-anatomy,#e0a458);stroke-width:2;stroke-linejoin:round}
.m33-body-iso-end{fill:color-mix(in srgb,var(--m33-disc-anatomy,#e0a458) 9%,transparent)}
.m33-body-iso-door{fill:var(--m33-bg,#0d1020);stroke:var(--m33-disc-anatomy,#e0a458);stroke-width:1.5;stroke-dasharray:8 5}
.m33-body-iso-near{stroke:var(--m33-disc-anatomy,#e0a458);stroke-width:1.5;stroke-dasharray:6 6;opacity:0.6}
.m33-body-iso-cut{fill:none;stroke:var(--m33-disc-anatomy,#e0a458);stroke-width:1.2;stroke-dasharray:6 6;opacity:0.55}
.m33-body-3d-tools{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}
.m33-body-hint{font-size:11px;color:var(--m33-text-muted,#8a93a6);visibility:hidden}
.m33-body-live3d .m33-body-hint{visibility:visible}
.m33-body-live3d .m33-body-3d{cursor:grab;touch-action:none;user-select:none}
.m33-body-live3d .m33-body-3d.m33-body-dragging{cursor:grabbing}
.m33-body-scale{stroke:var(--m33-text-muted,#8a93a6);stroke-width:2}
.m33-body-nominal{font:600 10px/1 system-ui,sans-serif;padding:3px 6px;border-radius:999px;border:1px dashed var(--m33-warn,#e0b44a);color:var(--m33-warn,#e0b44a);margin-left:4px}

.m33-body-side-panel{flex:0 1 260px}
.m33-body-side-panel h2,.m33-body-side h2{font-size:12px;font-weight:600;letter-spacing:0.06em;text-transform:uppercase;color:var(--m33-text-muted,#8a93a6);margin:0 0 8px}
.m33-body-budgets{list-style:none;margin:0;padding:0}
.m33-body-budgets li{display:flex;justify-content:space-between;gap:10px;padding:7px 0;border-bottom:1px solid var(--m33-border,rgba(255,255,255,0.07));font-size:13px}
.m33-body-bname{text-transform:capitalize}
.m33-body-bfig{color:var(--m33-text,#e6e9f2)}
.m33-body-bnone{color:var(--m33-text-muted,#8a93a6);font-style:italic}
.m33-body-note,.m33-body-digital,.m33-body-what,.m33-body-none{font-size:12px;color:var(--m33-text-muted,#8a93a6);line-height:1.5}
.m33-body-digital{margin:0 0 18px}

.m33-body-sides{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}
.m33-body-side{padding:12px;background:var(--m33-panel,rgba(255,255,255,0.02));border:1px solid var(--m33-border,rgba(255,255,255,0.08));border-radius:10px}
.m33-body-side-physical{border-color:color-mix(in srgb,var(--m33-disc-anatomy,#e0a458) 45%,transparent)}
.m33-body-count{font-weight:400;margin-left:4px}
.m33-body-what{margin:0 0 8px}
.m33-body-side ul{list-style:none;margin:0;padding:0}
.m33-body-side li{display:flex;justify-content:space-between;gap:8px;padding:5px 0;font-size:13px;border-bottom:1px solid var(--m33-border,rgba(255,255,255,0.05))}
.m33-body-state{font-size:11px;color:var(--m33-text-muted,#8a93a6)}
.m33-body-state-instance{color:var(--m33-good,#5cc28a)}
.m33-body-state-planned{border:1px dashed var(--m33-border,rgba(255,255,255,0.2));border-radius:999px;padding:0 6px}

/* Right panel: the physical anatomy (body-right.ejs). */
.m33-body-anatomy h3{margin:0 0 4px}
.m33-body-ahead{font-size:12px;font-weight:600;letter-spacing:0.06em;text-transform:uppercase;color:var(--m33-text-muted,#8a93a6);margin:16px 0 4px}
.m33-body-system{border:1px solid var(--m33-border,rgba(255,255,255,0.08));border-radius:8px;padding:6px 10px;margin:6px 0}
.m33-body-system summary{display:flex;justify-content:space-between;cursor:pointer;font-size:13px;font-weight:600;list-style:none}
.m33-body-system summary::-webkit-details-marker{display:none}
.m33-body-system ul,.m33-body-modules{list-style:none;margin:4px 0 0;padding:0}
.m33-body-system li,.m33-body-modules li{display:flex;justify-content:space-between;gap:8px;padding:4px 0;font-size:12.5px;border-top:1px solid var(--m33-border,rgba(255,255,255,0.05))}
.m33-body-details{margin-top:14px}
.m33-body-anatomy .m33-body-sides{grid-template-columns:1fr}
.m33-body-layer{font-size:12px;font-weight:600;margin:12px 0 2px;color:var(--m33-text,#e6e9f2)}
.m33-body-realized{font-size:11.5px;color:var(--m33-accent,var(--m33-disc-sociology));margin:6px 0 0}
.m33-body-infra summary{font-weight:500}
.m33-body-infra li span:last-child{text-align:right}
.m33-body-group{font-size:11px;font-weight:600;letter-spacing:0.05em;text-transform:uppercase;color:var(--m33-text-muted,#8a93a6);margin:10px 0 2px}
/* The subsystems line lives in the summary, so a collapsed card still shows it. */
.m33-body-system summary{flex-wrap:wrap}
.m33-body-system summary .m33-body-realized{flex-basis:100%;font-weight:400;padding-left:12px}
.m33-body-system summary::before{content:'\25B8';display:inline-block;width:12px;color:var(--m33-text-muted,#8a93a6)}
.m33-body-system[open] summary::before{content:'\25BE'}
.m33-body-system summary .m33-body-sname{flex:1;text-align:left;margin-left:4px}

/* Infrastructure in the drawing (schematic). One colour per subsystem, used
   by both plans and the legend — the shell's own tokens (rule 10b). */
.m33-body-sub{fill:none;stroke-width:2.5;vector-effect:non-scaling-stroke}
.m33-body-sub polygon,.m33-body-sub rect{vector-effect:non-scaling-stroke}
.m33-body-sub-raised-floor{fill:color-mix(in srgb,var(--m33-disc-ontogeny) 22%,transparent);stroke:var(--m33-disc-ontogeny);stroke-width:1.5}
.m33-body-sub-insulated-walls{stroke:var(--m33-disc-psychology);stroke-dasharray:6 4;stroke-width:2}
.m33-body-sub-side-door{stroke:var(--m33-good,#5cc28a);stroke-width:6;fill:color-mix(in srgb,var(--m33-good,#5cc28a) 25%,transparent)}
.m33-body-sub-virtual-windows{stroke:var(--m33-disc-epistemics);stroke-width:5;fill:color-mix(in srgb,var(--m33-disc-epistemics) 30%,transparent)}
.m33-body-sub-virtual-windows.m33-body-sub-camera{fill:var(--m33-disc-epistemics);stroke-width:1}
.m33-body-sub-solar-roof{stroke:var(--m33-warn,#e0b44a);stroke-width:1;fill:color-mix(in srgb,var(--m33-warn,#e0b44a) 8%,transparent);stroke-dasharray:3 3}
.m33-body-sub-starlink{stroke:var(--m33-text,#e6e9f2);stroke-width:2;fill:color-mix(in srgb,var(--m33-text,#e6e9f2) 30%,transparent)}
.m33-body-sub-electrical-wiring{stroke:var(--m33-disc-physiology);stroke-width:3;stroke-dasharray:10 4}
.m33-body-sub-water-plumbing{stroke:var(--m33-disc-sociology);stroke-width:3}
.m33-body-legend{list-style:none;display:flex;flex-wrap:wrap;gap:6px 14px;margin:10px 0 0;padding:0;font-size:12px;color:var(--m33-text,#e6e9f2)}
.m33-body-legend li{display:flex;align-items:center;gap:6px}
.m33-body-legend-note{color:var(--m33-text-muted,#8a93a6);font-style:italic}
.m33-body-key{width:14px;height:10px;border-radius:2px;display:inline-block;border:2px solid currentColor}
.m33-body-key-raised-floor{color:var(--m33-disc-ontogeny);background:color-mix(in srgb,var(--m33-disc-ontogeny) 30%,transparent)}
.m33-body-key-insulated-walls{color:var(--m33-disc-psychology);border-style:dashed}
.m33-body-key-side-door{color:var(--m33-good,#5cc28a)}
.m33-body-key-virtual-windows{color:var(--m33-disc-epistemics)}
.m33-body-key-solar-roof{color:var(--m33-warn,#e0b44a);border-style:dashed}
.m33-body-key-starlink{color:var(--m33-text,#e6e9f2);border-radius:50%}
.m33-body-key-electrical-wiring{color:var(--m33-disc-physiology);border-style:dashed}
.m33-body-key-water-plumbing{color:var(--m33-disc-sociology)}
/* Zones: the service area at the door end, walled off from the lab. */
.m33-body-zone rect,.m33-body-zone polygon{fill:none;stroke:none}
.m33-body-zone-end rect,.m33-body-zone-end polygon{fill:color-mix(in srgb,var(--m33-disc-anatomy) 16%,transparent)}
.m33-body-zname{fill:var(--m33-text,#e6e9f2);font-weight:600}
.m33-body-zsub{fill:var(--m33-text-muted,#8a93a6)}
.m33-body-sub-partition{stroke:var(--m33-text,#e6e9f2);stroke-width:4;fill:color-mix(in srgb,var(--m33-text,#e6e9f2) 10%,transparent)}
/* A glass wall across an end (Mark III's bedroom): the accent, thin, doubled — glass, not a partition. */
.m33-body-sub-glass-wall{stroke:var(--m33-accent);stroke-width:3;stroke-dasharray:14 4}
/* The fold-down deck off the bedroom's glass wall, outside the box. */
.m33-body-sub-deck{fill:color-mix(in srgb,var(--m33-accent) 14%,transparent);stroke:var(--m33-accent);stroke-width:2}
.m33-body-key-wall-vestibule{color:var(--m33-text,#e6e9f2)}
/* The sliding pocket door: the doorway solid, the pocket it slides into dashed. */
.m33-body-sub-pocket-door{stroke:var(--m33-accent,#4a86ff);stroke-width:5;fill:color-mix(in srgb,var(--m33-accent,#4a86ff) 25%,transparent)}
.m33-body-sub-pocket-door .m33-body-pocket,.m33-body-sub-pocket-door polyline{stroke-dasharray:4 4;stroke-width:2;fill:none}
.m33-body-key-pocket-door{color:var(--m33-accent,#4a86ff)}
/* Level 2 features: the research desk and its wall of monitors. */
.m33-body-sub-block{stroke:var(--m33-disc-meta);stroke-width:2;fill:color-mix(in srgb,var(--m33-disc-meta) 30%,transparent)}
.m33-body-sub-monitors{stroke:var(--m33-accent-hover,var(--m33-accent));stroke-width:6;fill:color-mix(in srgb,var(--m33-accent-hover,var(--m33-accent)) 40%,transparent)}
.m33-body-key-research-desk{color:var(--m33-disc-meta);background:color-mix(in srgb,var(--m33-disc-meta) 30%,transparent)}
/* Wall names, for talking about the box. */
.m33-body-wallname{fill:var(--m33-text,#e6e9f2);font-weight:600;letter-spacing:0.02em}
.m33-body-sub-workbenches{stroke:var(--m33-text-muted,#8a93a6);fill:color-mix(in srgb,var(--m33-text-muted,#8a93a6) 35%,transparent)}
.m33-body-key-workbenches{color:var(--m33-text-muted,#8a93a6);background:color-mix(in srgb,var(--m33-text-muted,#8a93a6) 35%,transparent)}
.m33-body-sub-battery-server-rack{stroke:var(--m33-bad,#e06c75);fill:color-mix(in srgb,var(--m33-bad,#e06c75) 30%,transparent)}
.m33-body-key-battery-server-rack{color:var(--m33-bad,#e06c75);background:color-mix(in srgb,var(--m33-bad,#e06c75) 30%,transparent)}
/* The design version (Mark I, …) beside the agent kind. */
.m33-body-mark{color:var(--m33-text,#e6e9f2);border-color:var(--m33-text-muted,#8a93a6)}
/* Mark I sitting area. */
/* Its own tone — a blend of two shell tokens — so it never reads as the plumbing. */
.m33-body-sub-herrakra-chair{--seat:color-mix(in srgb,var(--m33-good,#5cc28a) 55%,var(--m33-accent,#4a86ff));stroke:var(--seat);fill:color-mix(in srgb,var(--seat) 30%,transparent)}
.m33-body-key-herrakra-chair{--seat:color-mix(in srgb,var(--m33-good,#5cc28a) 55%,var(--m33-accent,#4a86ff));color:var(--seat);background:color-mix(in srgb,var(--seat) 30%,transparent)}
/* Furniture that moves (on casters) draws dashed. */
.m33-body-sub-mobile,.m33-body-sub-mobile polygon{stroke-dasharray:5 4}
/* Chairs draw as parts: the frame and arms as lines, the seat and back filled. */
.m33-body-sub-chair polyline{fill:none;stroke-width:2.5}
.m33-body-chair-frame{fill:var(--seat)}
/* Dimension lines: thin, the text colour, on top of everything. */
.m33-body-dimline line,.m33-body-dimline polyline{stroke:var(--m33-text,#e6e9ef);stroke-width:1;fill:none;vector-effect:non-scaling-stroke}
.m33-body-dimline text{fill:var(--m33-text,#e6e9ef);stroke:var(--m33-bg,#0f1218);stroke-width:3px;paint-order:stroke;font-weight:600}
.m33-body-dimline-aisle line,.m33-body-dimline-aisle polyline{stroke-dasharray:4 3}
/* Marks: one chip per design; the one shown is lit. */
.m33-body-marks{display:inline-flex;gap:6px}
a.m33-body-mark{text-decoration:none;opacity:.6}
a.m33-body-mark-on,a.m33-body-mark:hover{opacity:1}
a.m33-body-mark-on{border-color:var(--m33-accent,var(--m33-disc-sociology))}
/* Roof raised toggle: checkbox beside the radios; stowed hides what stands in the room on top. */
#m33-body-raised:checked ~ .m33-body-head label[for="m33-body-raised"]{border-color:var(--m33-accent,var(--m33-disc-sociology));background:color-mix(in srgb,var(--m33-accent,var(--m33-disc-sociology)) 22%,transparent)}
#m33-body-raised:not(:checked) ~ .m33-body-item .m33-body-upper{display:none}
/* Mark II: the rising roof (dashed, it is above), its lifts, the ladder and hatch, the room on top. */
.m33-body-sub-rising-roof{--roof:var(--m33-disc-ontogeny,#f472b6);stroke:var(--roof);fill:color-mix(in srgb,var(--roof) 10%,transparent);stroke-dasharray:7 4}
.m33-body-sub-rising-roof polyline{fill:none;stroke-dasharray:none}
.m33-body-roofsec-label{fill:var(--m33-disc-ontogeny,#f472b6);stroke:none}
.m33-body-key-rising-roof{color:var(--m33-disc-ontogeny,#f472b6);background:color-mix(in srgb,var(--m33-disc-ontogeny,#f472b6) 10%,transparent);border-style:dashed}
.m33-body-sub-actuator,.m33-body-sub-roof-lifts{stroke:var(--m33-bad,#e06c75);fill:var(--m33-bad,#e06c75);stroke-width:3}
.m33-body-sub-actuator polyline{fill:none;stroke-width:4}
.m33-body-key-roof-lifts{color:var(--m33-bad,#e06c75);background:var(--m33-bad,#e06c75)}
.m33-body-sub-ladder{stroke:var(--m33-text,#e6e9f2);fill:color-mix(in srgb,var(--m33-text,#e6e9f2) 6%,transparent)}
.m33-body-sub-ladder polyline,.m33-body-sub-ladder line{fill:none;stroke-width:1.5}
.m33-body-hatch,.m33-body-sub-ladder polygon{stroke-dasharray:4 3;fill:color-mix(in srgb,var(--m33-text,#e6e9f2) 12%,transparent)}
.m33-body-key-roof-ladder{color:var(--m33-text,#e6e9f2)}
.m33-body-upper{stroke-dasharray:3 3;opacity:.85}
.m33-body-render-inside{display:inline-flex;align-items:center;gap:6px}
.m33-body-render-inside input{margin:0;accent-color:var(--m33-accent,#4a86ff)}
.m33-body-render-inside:has(input:checked){border-color:var(--m33-accent,var(--m33-disc-sociology));background:color-mix(in srgb,var(--m33-accent,var(--m33-disc-sociology)) 22%,transparent)}
/* Valance lighting: a band along the top of the walls; warm, it is the light. */
.m33-body-sub-valance,.m33-body-sub-valance-lighting{stroke:var(--m33-warn,#e0b44a);fill:color-mix(in srgb,var(--m33-warn,#e0b44a) 28%,transparent);stroke-width:1}
.m33-body-key-valance-lighting{color:var(--m33-warn,#e0b44a);background:color-mix(in srgb,var(--m33-warn,#e0b44a) 28%,transparent)}
.m33-body-render-tint{display:inline-flex;align-items:center;gap:6px;font:600 11px/1 system-ui,sans-serif;color:var(--m33-text-muted,#8a93a6)}
.m33-body-render-tint input{width:110px;accent-color:var(--m33-accent,#4a86ff)}
.m33-body-render-tint output{min-width:3ch;color:var(--m33-text,#e6e9f2)}
/* The floor valance (uplighting): the same band at the foot of the walls, a cooler tone so it reads apart from the ceiling's. */
.m33-body-sub-floor-valance{stroke:var(--m33-disc-physiology,#34d399);fill:color-mix(in srgb,var(--m33-disc-physiology,#34d399) 25%,transparent);stroke-dasharray:3 2}
.m33-body-key-floor-valance{color:var(--m33-disc-physiology,#34d399);background:color-mix(in srgb,var(--m33-disc-physiology,#34d399) 25%,transparent)}
/* The desk lamp: warm, it is a light. */
.m33-body-sub-desk-lamp,.m33-body-sub-lamp{stroke:var(--m33-warn,#e0b44a);fill:color-mix(in srgb,var(--m33-warn,#e0b44a) 45%,transparent);stroke-width:1.5}
.m33-body-sub-lamp polyline{fill:none;stroke-width:2.5}
.m33-body-key-desk-lamp{color:var(--m33-warn,#e0b44a);background:color-mix(in srgb,var(--m33-warn,#e0b44a) 45%,transparent);border-radius:50%}
.m33-body-render-lights{display:inline-flex;flex-wrap:wrap;gap:4px 12px}
.m33-body-render-lights .m33-body-render-tint input{width:80px}
[data-render-eye][aria-pressed="true"]{border-color:var(--m33-accent,var(--m33-disc-sociology));background:color-mix(in srgb,var(--m33-accent,var(--m33-disc-sociology)) 22%,transparent)}
