/* Dossier panels (consoles, charts, cards) and the 3D page: stage, view chips, floor control, Walk,
   the technical-layers panel and the first-use hint. Tokens and dark mode come from layout.css. */
.console { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 22px;
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 28px; }
.console > * { min-width: 0; }
.controls { display: grid; gap: 18px; align-content: start; }
.design-options { margin: 0; border-block: 1px solid var(--line); padding: 8px 0 16px; }
.design-option-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 24px; }
@media (max-width: 640px) { .design-option-grid { grid-template-columns: minmax(0, 1fr); } }
.design-options summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.design-options select { max-width: 100%; width: 100%; min-height: 44px; box-sizing: border-box;
  padding: 8px 10px; color: var(--ink); background: var(--panel); border: 1px solid var(--line);
  border-radius: 4px; }
.design-options button { color: var(--ink); background: var(--panel); border: 1px solid var(--line);
  border-radius: 4px; padding: 8px 12px; min-height: 44px; }
.design-options > div { margin-top: 12px; }
#design-options { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.design-appearance label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.controls label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.controls output { font-family: var(--f-data); color: var(--sun); font-weight: 600; }
input[type="range"] { width: 100%; accent-color: var(--forest); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.gantt { position: relative; overflow-x: auto; } .gantt svg { display: block; font-family: var(--f-data); }
.gantt-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted);
  margin: 6px 0 14px; }
.gantt-legend i { display: inline-block; width: 18px; height: 8px; border-radius: 2px; margin-right: 6px;
  vertical-align: middle; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px 20px; }
.kpi { border-top: 2px solid var(--ink); padding-top: 8px; }
.kpi .v { font: 600 24px/1.2 var(--f-data); font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 13px; color: var(--muted); }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.legend { display: flex; gap: 18px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px;
  vertical-align: -1px; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg);
  font: 12px/1.4 var(--f-data);
  padding: 6px 8px; border-radius: 4px; white-space: nowrap; transform: translate(-50%, -110%); }
.note { font-size: 14px; color: var(--muted); max-width: 72ch; }
.verdict { border-left: 3px solid var(--sun); padding: 4px 0 4px 14px; max-width: 72ch; }
ol.todo { margin: 0; padding-left: 22px; display: grid; gap: 8px; max-width: 76ch; }
footer { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; }
.chk { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.chk i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.readout { font: 13px var(--f-data); color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 18px;
  display: grid; gap: 10px; align-content: start; }
.card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.card dt { color: var(--muted); } .card dd { margin: 0; font-variant-numeric: tabular-nums; }
#systems-detail { display: grid; gap: 16px; }
.detail-body { display: grid; gap: 18px; }
caption { text-align: left; font: 600 15px var(--f-display); font-stretch: 112%; padding: 4px 0 8px; }
.detail-notes { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; display: grid;
  gap: 4px; }
@media (max-width: 820px) { .split, .console { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: no-preference) { .kpi .v { transition: color .2s; } }
/* 3D page: a near full-bleed stage. Phones (< 720 px) stack title, view chips, canvas and floors/Walk above the
   shell's bottom tab bar; wider screens put chips and floors in one row and open the technical layers beside it. */
#model3d { --tabbar: calc(64px + env(safe-area-inset-bottom, 0px)); --gutter: 24px; --chrome: 220px;
  --viewer-h: clamp(420px, calc(100vh - var(--chrome)), 1200px);
  margin-inline: calc(50% - 50vw + var(--gutter)); gap: 10px 16px;
  position: relative; grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "top top" "views bottom" "stage stage"; }
#model3d.layers-open { grid-template-columns: minmax(0, 1fr) auto minmax(300px, 360px);
  grid-template-areas: "top top top" "views bottom bottom" "stage stage panel"; }
@supports (height: 100dvh) { #model3d { --viewer-h: clamp(420px, calc(100dvh - var(--chrome)), 1200px); } }
#model3d .viewer-top { grid-area: top; display: flex; align-items: center; gap: 12px; min-width: 0; }
#model3d .viewer-title { flex: 1; min-width: 0; font-size: clamp(18px, 2.2vw, 26px); line-height: 1.15; }
/* the title wraps rather than truncating when the toggle leaves it too little room */
#model3d .viewer-controls { grid-area: views; min-width: 0; }
#model3d .viewer-bottom { grid-area: bottom; display: flex; align-items: center; gap: 10px; min-width: 0; }
#model3d .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
  white-space: nowrap; }
#model3d .chips { display: flex; gap: 8px; }
#model3d .views .chips { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scrollbar-width: none; padding: 2px 0; }
#model3d .views .chips::-webkit-scrollbar { display: none; }
#model3d .views .chk { flex: none; scroll-snap-align: start; min-height: 44px; padding: 8px 14px;
  font: 600 15px var(--f-body); color: var(--ink); white-space: nowrap; touch-action: manipulation; }
#model3d .views .chk span { font-size: 18px; line-height: 1; }
#model3d .chk:hover { border-color: var(--forest); }
#model3d .floors .chips { gap: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--panel);
  padding: 3px; }
.floors .chips button { min-height: 44px; padding: 6px 14px; border: 0; border-radius: 999px; background: none;
  color: var(--ink); font: 600 14px/1.15 var(--f-body); white-space: nowrap; cursor: pointer;
  touch-action: manipulation; }
.floors .chips button[aria-pressed="true"] { background: var(--forest); color: var(--bg); }
.layers-toggle, .tech-close, .hint-close { min-height: 44px; min-width: 44px; display: inline-flex;
  align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--ink); font: 600 14px var(--f-body); cursor: pointer;
  touch-action: manipulation; }
.layers-toggle { padding: 6px 16px; }
.layers-toggle[aria-expanded="true"] { border-color: var(--forest); background: var(--forest); color: var(--bg); }
.walk-cta { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 20px 6px 14px;
  border: 2px solid var(--forest); border-radius: 999px; background: var(--forest); color: var(--bg);
  font: 700 16px var(--f-body); white-space: nowrap; cursor: pointer; touch-action: manipulation;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14); }
.walk-cta .walk-icon { font-size: 22px; line-height: 1; }
.walk-cta .walk-on, .walk-cta[aria-pressed="true"] .walk-off { display: none; }
.walk-cta[aria-pressed="true"] { background: var(--panel); color: var(--forest); }
.walk-cta[aria-pressed="true"] .walk-on { display: inline; }
.walk-cta:disabled, .walk-overlay:disabled { opacity: 0.5; cursor: progress; }
.viewer-stage { display: contents; } /* its children are #model3d grid items; credits flow below the controls */
#env-credits, #field-retention { grid-column: 1 / -1; }
#viewer { position: relative; grid-area: stage; height: var(--viewer-h); border-radius: 8px; overflow: hidden;
  background: #cfe0ea; border: 1px solid var(--line); touch-action: manipulation; }
#viewer canvas { display: block; width: 100%; height: 100%; touch-action: none; }
#viewer .walk-overlay { display: none; } /* the Walk button below the stage is the entry */
.viewer-hint { position: absolute; grid-area: stage; z-index: 7; left: 50%; bottom: 12px; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 24px); box-sizing: border-box; display: flex; align-items: center;
  gap: 8px; padding: 4px 4px 4px 14px; border-radius: 12px; background: rgba(23, 36, 43, 0.88); color: #fff;
  font-size: 14px; line-height: 1.35; }
.viewer-hint .hint-close { border-color: rgba(255, 255, 255, 0.35); background: transparent; color: #fff; }
.viewer-hint[hidden], .tech-layers[hidden] { display: none; }
.tech-layers { grid-area: panel; max-height: var(--viewer-h); box-sizing: border-box; overflow-y: auto;
  overscroll-behavior: contain; background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  display: grid; align-content: start; }
.tech-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.tech-head h3 { flex: 1; font-size: 17px; }
.tech-body { display: grid; gap: 16px; padding: 14px 16px 18px; }
.tech-body .grp { display: grid; gap: 8px; }
#model3d .tech-body .lbl { position: static; width: auto; height: auto; clip-path: none; font: 600 12px var(--f-data);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tech-body .chips { flex-wrap: wrap; }
.tech-body .seg button { min-height: 44px; padding: 8px 14px; touch-action: manipulation; }
.tech-body .layers { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.tech-body .layers .lbl { grid-column: 1 / -1; }
.tech-body .layers .chk { min-height: 44px; box-sizing: border-box; border-radius: 10px; padding: 6px 12px; }
.tech-body .layers .chk input { width: 20px; height: 20px; margin: 0; accent-color: var(--forest); }
.tech-body .sun { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.tech-body .sun .lbl, .tech-body .sun #sun-readout { grid-column: 1 / -1; }
.tech-body select { min-height: 44px; padding: 8px 10px; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.tech-body input[type="range"] { min-height: 44px; margin: 0; }
.tech-body .design-options { border-bottom: 0; padding-bottom: 0; }
.tech-body .design-options summary { min-height: 44px; display: flex; align-items: center; }
.tech-body .design-option-grid { grid-template-columns: minmax(0, 1fr); }
.tech-body .note { font-size: 13px; }
@media (max-width: 719.98px) {
  #model3d { --gutter: 0px; --chrome: 186px; --viewer-h: calc(100vh - var(--tabbar) - var(--chrome));
    gap: 8px; }
  #model3d, #model3d.layers-open { grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "top" "views" "stage" "bottom"; }
  @supports (height: 100svh) { #model3d { --viewer-h: calc(100svh - var(--tabbar) - var(--chrome)); } }
  @supports (height: 100dvh) { #model3d { --viewer-h: calc(100dvh - var(--tabbar) - var(--chrome)); } }
  #model3d .viewer-top, #model3d .viewer-bottom { padding-inline: 12px; }
  #model3d .views .chips { padding-inline: 12px; scroll-padding-inline: 12px; }
  #model3d .viewer-title { font-size: 18px; }
  #viewer { border-radius: 0; border-inline: 0; min-height: 280px; }
  .layers-toggle { padding: 6px 12px; font-size: 13px; }
  .floors { flex: 1; min-width: 0; } .floors .chips button { flex: 1; padding: 4px 8px; font-size: 13px; }
  .walk-cta { padding: 6px 14px 6px 10px; font-size: 15px; }
  .tech-layers { position: fixed; z-index: 900; left: 0; right: 0; bottom: var(--tabbar); max-height: 60vh;
    max-height: 60dvh; border-radius: 16px 16px 0 0; border-inline: 0; box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.25); }
}
@media (min-width: 720px) and (max-height: 520px) { /* phone landscape: chips and toggle above, floors below */
  #model3d { --gutter: 8px; --chrome: 124px; --viewer-h: max(220px, calc(100vh - var(--chrome)));
    gap: 8px 12px; }
  #model3d, #model3d.layers-open { grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "views top" "stage stage" "bottom bottom"; }
  .tech-layers { position: fixed; z-index: 900; top: 0; right: 0; bottom: 0; width: min(360px, 50vw);
    max-height: none; border-radius: 12px 0 0 12px; box-shadow: -8px 0 28px rgba(0, 0, 0, 0.25); }
  @supports (height: 100dvh) { #model3d { --viewer-h: max(220px, calc(100dvh - var(--chrome))); } }
  #model3d .viewer-title { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .tech-layers:not([hidden]) { animation: tech-in 0.18s ease-out; }
  #model3d .views .chips { scroll-behavior: smooth; }
}
@keyframes tech-in { from { opacity: 0; transform: translateY(12px); } }
