/* VantagePath Studio. Field in the centre, outline left, inspector right,
   timeline below. Side panels become slide-over sheets on smaller screens. */

:root {
  --paper: #f1ede4; --paper-2: #e7e1d5; --paper-3: #faf8f2; --ink: #171715; --muted: #5f5c56;
  --line: rgba(23,23,21,.18); --line-strong: rgba(23,23,21,.55);
  --acid: #d9ff48; --blue: #2546ff; --red: #d23b30; --amber: #c98f00; --green: #3a8a4a;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --topbar: 60px; --outline: 288px; --inspector: 340px; --target: 40px; --radius: 6px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font: 14px/1.4 var(--sans); overflow: hidden; }
button, input, select { color: inherit; font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .35; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }
a { color: inherit; }
.sr-only { clip: rect(0 0 0 0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }
.mono { font-family: var(--mono); }
.muted, .hint { color: var(--muted); }
.hint { font-size: 12px; line-height: 1.5; margin: 10px 0 0; }

/* ---------------------------------------------------------------- top bar */
.studio { display: grid; grid-template-rows: var(--topbar) minmax(0, 1fr); height: 100dvh; }
.topbar { align-items: center; background: var(--paper); border-bottom: 1px solid var(--ink); display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); padding: 0 16px; z-index: 30; }
.brand-block { align-items: center; display: flex; gap: 12px; min-width: 0; }
.brand-mark { align-items: center; background: var(--ink); color: var(--acid); display: inline-flex; flex: none; font: 700 13px var(--mono); height: 36px; justify-content: center; width: 36px; }
.title-stack { display: flex; flex-direction: column; min-width: 0; }
.eyebrow { color: var(--muted); font: 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
#document-title { font-size: 18px; font-weight: 600; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#document-title:hover { background: var(--paper-2); }
.topbar-tools { align-items: center; display: flex; gap: 10px; }
.file-actions { align-items: center; display: flex; gap: 6px; justify-content: flex-end; }
.file-actions button, .sheet-toggle { background: none; border: 1px solid transparent; border-radius: var(--radius); font-size: 13px; min-height: var(--target); padding: 0 12px; }
.file-actions button:hover, .sheet-toggle:hover { border-color: var(--line-strong); }
.primary, .file-actions .primary { background: var(--acid); border: 1px solid var(--ink) !important; font-weight: 700; }
.sheet-toggle { border-color: var(--line-strong); display: none; }
.sheet-toggle[aria-expanded="true"] { background: var(--ink); color: var(--paper); }
.save-state { align-items: center; color: var(--muted); display: inline-flex; font-size: 12px; gap: 6px; margin-right: 6px; white-space: nowrap; }
.save-state i { background: var(--green); border-radius: 50%; height: 8px; width: 8px; }
.save-state.is-error { color: var(--red); font-weight: 600; }
.save-state.is-error i { background: var(--red); }
.segmented { border: 1px solid var(--ink); border-radius: var(--radius); display: inline-grid; grid-auto-columns: 1fr; grid-auto-flow: column; overflow: hidden; }
.segmented button { background: none; border: 0; font-size: 13px; min-height: 36px; padding: 0 12px; white-space: nowrap; }
.segmented button + button { border-left: 1px solid var(--ink); }
.segmented button.is-active { background: var(--ink); color: var(--paper); }
.dot { border-radius: 50%; display: inline-block; height: 8px; margin-right: 6px; width: 8px; }
.dot.red { background: var(--red); } .dot.blue { background: var(--blue); }
.icon-group { display: inline-flex; }
.icon-group button, .icon-button { align-items: center; background: none; border: 1px solid var(--line-strong); display: inline-flex; font-size: 18px; height: var(--target); justify-content: center; min-width: var(--target); padding: 0; }
.icon-group button:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.icon-group button:last-child { border-left: 0; border-radius: 0 var(--radius) var(--radius) 0; }
.icon-button { border-radius: var(--radius); }
.icon-button.accent { background: var(--acid); border-color: var(--ink); }
.phone-only { display: none; }

/* -------------------------------------------------------------- workspace */
.workspace { display: grid; grid-template-columns: var(--outline) minmax(0, 1fr) var(--inspector); min-height: 0; overflow: clip; position: relative; }
.sheet { background: var(--paper); min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.outline { border-right: 1px solid var(--ink); }
.inspector { border-left: 1px solid var(--ink); display: flex; flex-direction: column; }
.sheet-head { align-items: center; background: var(--paper); border-bottom: 1px solid var(--line); display: flex; gap: 8px; padding: 12px 16px; position: sticky; top: 0; z-index: 2; }
.sheet-head h2 { flex: 1; font-size: 20px; font-weight: 600; letter-spacing: -.03em; margin: 0; }
.sheet-close { display: none; }
.sheet-backdrop { background: rgba(23,23,21,.35); inset: 0; position: absolute; z-index: 19; }
.panel { border-bottom: 1px solid var(--line); padding: 14px 16px; }
.panel-label { align-items: baseline; display: flex; font: 600 12px var(--mono); gap: 8px; justify-content: space-between; letter-spacing: .04em; text-transform: uppercase; }
.panel-label small { color: var(--muted); font-weight: 400; letter-spacing: 0; text-transform: none; }

/* Inputs */
.field-pair, .field-trio { display: grid; gap: 10px 12px; grid-template-columns: 1fr 1fr; margin-top: 12px; }
.field-trio { grid-template-columns: 1fr 1fr 1fr; }
.field-pair label, .field-trio label, .stacked { display: flex; flex-direction: column; font-size: 12px; gap: 4px; min-width: 0; }
.field-pair label > span, .field-trio label > span, .stacked > span { color: var(--muted); }
.field-pair em { font-style: normal; }
input[type="number"], input:not([type]), select { background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius); font-size: 14px; min-height: var(--target); min-width: 0; padding: 0 10px; width: 100%; }
input:disabled { background: var(--paper-2); color: var(--muted); }
.stacked { margin-top: 12px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.button-row button, .control-toolbar button, .route-tool-buttons button, .check-fix { background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius); font-size: 13px; min-height: var(--target); padding: 0 12px; }
.button-row .primary { background: var(--acid); }
.button-row button:hover, .route-tool-buttons button:hover { border-color: var(--ink); }
.danger { color: var(--red); }
.readout-row { align-items: baseline; display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 12px; }
.readout-row span { color: var(--muted); font-size: 12px; }
.readout-row b { font: 600 16px var(--mono); }
.readout-row small { color: var(--muted); font-size: 12px; }
.text-button { background: none; border: 0; font-size: 13px; min-height: 32px; text-decoration: underline; }

/* Robot start */
#robot-start { border-bottom: 1px solid var(--line); padding: 14px 16px; }
.start-card.is-selected { box-shadow: inset 4px 0 var(--acid); margin: -14px -16px; padding: 14px 16px 14px 20px; }
.start-head { align-items: center; display: flex; gap: 8px; }
.start-head h2 { flex: 1; font-size: 15px; margin: 0; }
.start-badge, .point-badge { background: var(--ink); border-radius: 4px; color: var(--paper); font: 700 12px var(--mono); padding: 3px 6px; }

/* Route tree */
.route-tree { list-style: none; margin: 0; padding: 0 0 24px; }
.route { border-bottom: 1px solid var(--line); }
.route-head { align-items: center; background: none; border: 0; display: grid; gap: 10px; grid-template-columns: auto 1fr auto; min-height: 52px; padding: 8px 16px; text-align: left; width: 100%; }
.route.is-active > .route-head { background: var(--paper-2); box-shadow: inset 4px 0 var(--acid); }
.route-index { color: var(--muted); font: 12px var(--mono); }
.outline-main { display: flex; flex-direction: column; min-width: 0; }
.outline-main strong { overflow-wrap: anywhere; }
.outline-main small { color: var(--muted); font-size: 12px; }
.route-tools { display: grid; gap: 8px; padding: 10px 16px; }
.route-tool-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.route-tool-buttons button { font-size: 12px; min-height: 34px; padding: 0 10px; }
.outline-list { list-style: none; margin: 0; padding: 0 8px; }
.outline-point, .outline-segment { align-items: center; border-radius: var(--radius); display: flex; gap: 4px; }
.outline-row { align-items: center; background: none; border: 0; border-radius: var(--radius); display: flex; flex: 1; gap: 10px; min-height: var(--target); min-width: 0; padding: 4px 8px; text-align: left; }
.outline-row:hover { background: var(--paper-2); }
.outline-point.is-selected .outline-row { background: var(--acid); }
.outline-segment { margin-left: 12px; }
.outline-segment .outline-row { border-left: 2px dashed var(--line-strong); border-radius: 0 var(--radius) var(--radius) 0; }
.outline-segment.is-current .outline-row { background: rgba(37,70,255,.08); border-left: 2px solid var(--blue); }
.seg-arrow { color: var(--muted); font-size: 12px; }
.direction-chip { background: #fff; border: 1px solid var(--line-strong); border-radius: 999px; font: 12px var(--mono); min-height: 32px; padding: 0 10px; white-space: nowrap; }
.direction-chip.is-reverse { background: var(--ink); color: var(--paper); }
.row-flag { align-items: center; border-radius: 50%; color: #fff; display: inline-flex; font: 700 12px var(--mono); height: 20px; justify-content: center; margin-left: auto; width: 20px; }
.row-flag.is-warning { background: var(--amber); } .row-flag.is-error { background: var(--red); }
.add-row { background: none; border: 1px dashed var(--line-strong); border-radius: var(--radius); margin: 8px 16px 0; min-height: var(--target); width: calc(100% - 32px); }
.add-row:hover { border-color: var(--ink); }

/* Inspector */
.checks-panel { background: var(--paper-3); }
.checks-list { display: grid; gap: 8px; list-style: none; margin: 10px 0 0; padding: 0; }
.check { --severity: var(--muted); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 8px; padding: 10px 12px; }
.check.is-error { --severity: var(--red); background: rgba(210,59,48,.06); }
.check.is-warning { --severity: var(--amber); background: rgba(201,143,0,.08); }
.check.is-info { --severity: var(--blue); }
.check.is-ok { --severity: var(--green); color: var(--muted); font-size: 13px; }
.check-body b::before, .check.is-ok span::before { background: var(--severity); border-radius: 50%; content: ""; display: inline-block; height: 8px; margin-right: 7px; vertical-align: 1px; width: 8px; }
.check-body { background: none; border: 0; display: grid; gap: 3px; padding: 0; text-align: left; }
.check-body b { font-size: 13px; }
.check-body span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.check-body:hover b { color: var(--blue); }
.check-fix { background: var(--acid); border-color: var(--ink); font-weight: 600; justify-self: start; }
.stat-grid { display: grid; gap: 8px; grid-template-columns: repeat(4, 1fr); margin: 12px 0; }
.stat-grid div { background: var(--paper-3); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px; }
.stat-grid dt { color: var(--muted); font-size: 11px; }
.stat-grid dd { font: 600 14px var(--mono); margin: 2px 0 0; white-space: nowrap; }
.stat-grid small { color: var(--muted); font-size: 11px; font-weight: 400; }
.inspector .segmented { display: grid; width: 100%; }
.control-toolbar { align-items: center; display: flex; font-size: 13px; justify-content: space-between; margin-top: 14px; }
.control-list { display: grid; gap: 6px; margin-top: 8px; }
.control-row { align-items: center; border-radius: var(--radius); display: grid; gap: 6px; grid-template-columns: 40px 1fr 1fr 40px; }
.control-row > button { background: none; border: 0; font: 600 13px var(--mono); min-height: var(--target); }
.control-row > button:first-child { color: #075185; }
.control-row.is-selected { background: #d8eeff; }
.danger-link { background: none; border: 0; color: var(--red); font-size: 13px; margin: auto 16px 16px; min-height: var(--target); padding: 0 8px; text-align: left; text-decoration: underline; }
.danger-link.is-armed { background: var(--red); border-radius: var(--radius); color: #fff; text-decoration: none; }

/* ------------------------------------------------------------------ stage */
.stage { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; min-width: 0; }
.canvas-toolbar { align-items: center; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; padding: 8px 12px; }
.tool-group { align-items: center; display: flex; flex-wrap: wrap; gap: 6px; }
.tool { background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius); font-size: 13px; min-height: var(--target); padding: 0 12px; }
.tool:hover { border-color: var(--ink); }
.tool-group select { min-height: 36px; width: auto; }
.check-chip { align-items: center; border: 1px solid var(--line-strong); border-radius: 999px; display: inline-flex; font-size: 13px; gap: 6px; min-height: 36px; padding: 0 12px; }
.check-chip input { accent-color: var(--ink); height: 16px; margin: 0; width: 16px; }
.field-stage { background: #ded9ce; min-height: 0; overflow: hidden; position: relative; }
#field { display: block; height: 100%; inset: 0; position: absolute; touch-action: none; user-select: none; width: 100%; }
.readouts { display: flex; flex-direction: column; gap: 6px; pointer-events: none; position: absolute; right: 10px; top: 10px; }
.readouts output { background: rgba(241,237,228,.92); border: 1px solid var(--ink); font: 12px var(--mono); padding: 4px 8px; text-align: right; }
#heading-readout { color: var(--blue); }
.timeline { border-top: 1px solid var(--ink); display: grid; gap: 6px; padding: 8px 12px 10px; }
.playback-controls { align-items: center; display: grid; gap: 10px; grid-template-columns: var(--target) minmax(0, 1fr) auto; }
.play-button { background: var(--acid); border: 1px solid var(--ink); border-radius: 50%; font-size: 13px; height: var(--target); width: var(--target); }
#path-scrubber { accent-color: var(--ink); width: 100%; }
#playback-time { font: 12px var(--mono); white-space: nowrap; }
.graph-wrap { height: 56px; position: relative; }
#speed-graph { background: var(--paper-3); border: 1px solid var(--line); border-radius: var(--radius); cursor: ew-resize; display: block; height: 100%; touch-action: none; width: 100%; }
.graph-peak { color: var(--muted); font: 11px var(--mono); left: 6px; pointer-events: none; position: absolute; top: 3px; }
.timeline-foot { align-items: baseline; display: flex; flex-wrap: wrap; font-size: 12px; gap: 4px 12px; justify-content: space-between; }
#path-summary { font: 600 12px var(--mono); }
.field-credit { color: var(--muted); font-size: 11px; }

/* ---------------------------------------------------------------- dialogs */
.drawer { background: var(--paper); border: 1px solid var(--ink); border-radius: 10px 0 0 10px; color: var(--ink); height: 100dvh; margin: 0 0 0 auto; max-height: 100dvh; max-width: min(520px, 100vw); padding: 0; width: 100%; }
.drawer.wide { max-width: min(760px, 100vw); }
.drawer::backdrop { background: rgba(23,23,21,.4); }
.drawer-head { align-items: center; background: var(--paper); border-bottom: 1px solid var(--ink); display: flex; justify-content: space-between; padding: 12px 16px; position: sticky; top: 0; }
.drawer-head h2 { font-size: 20px; margin: 0; }
.drawer-body { padding-bottom: 24px; }
.drawer-body > .field-pair, .drawer-body > .hint, .drawer-body > .button-row, .drawer-body > .code-preview { margin-left: 16px; margin-right: 16px; }
.code-preview { background: #111; border-radius: var(--radius); color: #e8f5b0; font: 12px/1.5 var(--mono); max-height: 55dvh; overflow: auto; padding: 12px; white-space: pre; }
.mirror-grid { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin-top: 12px; }
.mirror-grid button { align-items: flex-start; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius); display: flex; flex-direction: column; gap: 2px; min-height: 76px; padding: 10px; text-align: left; }
.mirror-grid button:hover { border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.mirror-grid .mirror-primary { background: var(--acid); border-color: var(--ink); grid-column: 1 / -1; }
.mirror-grid b { font-size: 20px; font-weight: 500; }
.mirror-grid span { font-size: 13px; font-weight: 600; }
.mirror-grid small { color: var(--muted); font-size: 12px; }
.shortcuts { display: grid; gap: 6px; margin: 10px 0 0; }
.shortcuts div { display: grid; gap: 8px; grid-template-columns: minmax(120px, 40%) 1fr; }
.shortcuts dt { font: 600 12px var(--mono); }
.shortcuts dd { color: var(--muted); font-size: 13px; margin: 0; }

.toast { background: var(--ink); border-radius: var(--radius); bottom: 20px; color: var(--paper); font-size: 13px; left: 50%; max-width: min(520px, calc(100vw - 32px)); opacity: 0; padding: 10px 14px; pointer-events: none; position: fixed; transform: translate(-50%, 8px); transition: opacity .2s, transform .2s; z-index: 100; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------------------------------------- field SVG */
.field-floor { fill: #303739; }
.tile-grid { stroke: rgba(255,255,255,.24); stroke-width: .35; }
.field-wall { fill: none; stroke: #111; stroke-width: 1.2; }
.alliance-zone-red { fill: var(--red); fill-opacity: .10; }
.alliance-zone-blue { fill: var(--blue); fill-opacity: .10; }
.zone-hidden { display: none; }
.path-shadow { fill: none; stroke: #f5f1e8; stroke-linecap: round; stroke-width: 2.4; pointer-events: none; }
.path-curve { cursor: pointer; fill: none; stroke: var(--ink); stroke-linecap: round; stroke-width: 1.15; }
.path-curve.is-current { stroke: var(--blue); stroke-width: 1.4; }
.path-curve.reversed { stroke-dasharray: 3 1.6; }
.inactive-hit { fill: none; pointer-events: stroke; stroke: transparent; stroke-width: 4; cursor: pointer; }
.inactive-curve { fill: none; opacity: .55; pointer-events: none; stroke: #f5f1e8; stroke-dasharray: 1.2 1.2; stroke-width: .8; }
.inactive-route:hover .inactive-curve { opacity: 1; }
.control-line { stroke: #fff; stroke-dasharray: 1.5 1.5; stroke-width: .65; pointer-events: none; }
.bezier-guide { stroke: #69bfff; stroke-dasharray: 1 1.5; stroke-width: .4; }
.anchor-hit { fill: transparent; cursor: grab; }
.anchor { cursor: grab; fill: #fff; stroke: var(--ink); stroke-width: .8; }
.anchor.is-start { stroke-width: 1.1; }
.anchor.selected { fill: var(--acid); stroke-width: 1.2; }
.handle { cursor: crosshair; fill: var(--acid); stroke: var(--ink); stroke-width: .7; }
.anchor-label { fill: var(--ink); font: 700 3px var(--mono); paint-order: stroke; pointer-events: none; stroke: rgba(241,237,228,.9); stroke-linejoin: round; stroke-width: 1px; }
.marker-hit { cursor: grab; fill: transparent; }
.control-diamond { fill: #42b5ff; pointer-events: none; stroke: #062d4a; stroke-width: .55; }
.control-marker.selected .control-diamond { fill: #b5e6ff; stroke: #fff; stroke-width: .85; }
.control-label { fill: #06456f; font-size: 2.5px; }
.robot-box { cursor: grab; fill: var(--acid); fill-opacity: .36; pointer-events: all; stroke: #fff; stroke-width: .7; }
.playback-robot:hover .robot-box { fill-opacity: .55; stroke: var(--acid); }
.playback-robot.is-dragging .robot-box { cursor: grabbing; fill-opacity: .62; }
.robot-nose { pointer-events: none; stroke: var(--ink); stroke-linecap: round; stroke-width: 1.1; }
.stop-marker path { fill: #c9372c; stroke: #fff; stroke-width: .45; }
.stop-marker.is-warning path { fill: #e0a100; stroke: var(--ink); }
.issue-marker circle { fill: none; stroke-dasharray: 1.2 .8; stroke-width: .7; }
.issue-marker.is-warning circle { stroke: #e0a100; } .issue-marker.is-error circle { stroke: var(--red); } .issue-marker.is-info circle { stroke: var(--blue); }
.issue-marker text { fill: #e0a100; font: 700 3.4px var(--mono); paint-order: stroke; stroke: #111; stroke-width: .5px; text-anchor: middle; }

/* Speed graph */
.graph-area { fill: rgba(37,70,255,.14); }
.graph-area.is-reverse { fill: rgba(23,23,21,.12); }
.graph-line { fill: none; stroke: var(--blue); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.graph-turn { fill: rgba(201,143,0,.18); }
.graph-stop { stroke: var(--red); stroke-width: 2; vector-effect: non-scaling-stroke; }
.graph-playhead { stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }

/* Phase 3: budget, waits, markers, speed limits, footprint */
#route-budget { border-bottom: 1px solid var(--line); padding: 12px 16px; }
.budget-text { align-items: baseline; display: flex; font-size: 12px; justify-content: space-between; }
.budget-text span { color: var(--muted); }
.budget-text b { font: 600 13px var(--mono); }
.budget-bar { background: var(--paper-2); border-radius: 999px; height: 8px; margin-top: 6px; overflow: hidden; }
.budget-bar i { background: var(--green); display: block; height: 100%; }
.budget.is-over .budget-bar i { background: var(--red); }
.budget.is-over .budget-text b { color: var(--red); }
.inline-field { align-items: center; display: flex; font-size: 12px; gap: 8px; }
.inline-field span { color: var(--muted); white-space: nowrap; }
.inline-field input { max-width: 96px; }
.stacked em { color: var(--muted); font-size: 11px; font-style: normal; }
.marker-head, .marker-row { display: grid; gap: 6px; grid-template-columns: 1fr 76px 40px; }
.marker-head { color: var(--muted); font-size: 11px; margin-top: 8px; }
.marker-list { display: grid; gap: 6px; margin-top: 4px; }
.marker-row { align-items: center; border-radius: var(--radius); }
.marker-row.is-selected { background: #ffe9f6; }
.marker-row > button { background: none; border: 0; font-size: 16px; min-height: var(--target); }
.event-flag { fill: #ff4fb3; stroke: #3a0626; stroke-width: .35; }
.event-dot { fill: #fff; stroke: #3a0626; stroke-width: .35; }
.event-marker { cursor: grab; }
.event-marker.selected .event-flag { fill: #ffd1ec; }
.event-label { fill: #5a0a3b; font-size: 2.6px; }
.footprint { fill: none; pointer-events: none; stroke: rgba(217,255,72,.55); stroke-width: .35; }
.graph-marker { stroke: #ff4fb3; stroke-dasharray: 3 3; stroke-width: 1.5; vector-effect: non-scaling-stroke; }

.log-overlay polyline { fill: none; pointer-events: none; stroke: #ff8a00; stroke-linejoin: round; stroke-width: .7; }
.log-overlay circle, .log-overlay rect { fill: #ff8a00; stroke: #111; stroke-width: .3; }

/* ------------------------------------------------------------ responsive */
/* Laptop: routes slide over; inspector stays. */
@media (max-width: 1279px) {
  .workspace { grid-template-columns: minmax(0, 1fr) var(--inspector); }
  .outline { border-right: 1px solid var(--ink); bottom: 0; left: 0; position: absolute; top: 0; transform: translateX(-100%); transition: transform .2s; width: min(var(--outline), 92vw); z-index: 20; }
  .outline.is-open { transform: none; }
  .sheet-toggle[data-sheet="outline"] { display: inline-flex; align-items: center; }
  .outline .sheet-close { display: inline-flex; }
  .eyebrow { display: none; }
}
/* Tablet and phone: both panels slide over the field. */
@media (max-width: 899px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto; height: auto; padding: 8px 12px; row-gap: 8px; }
  .studio { grid-template-rows: auto minmax(0, 1fr); }
  .topbar-tools { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .inspector { border-left: 1px solid var(--ink); bottom: 0; position: absolute; right: 0; top: 0; transform: translateX(100%); transition: transform .2s; width: min(var(--inspector), 92vw); z-index: 20; }
  .inspector.is-open { transform: none; }
  .sheet-toggle { display: inline-flex; align-items: center; }
  .inspector .sheet-close { display: inline-flex; }
  .save-state span { display: none; }
}
@media (max-width: 599px) {
  body { overflow: auto; }
  .studio { height: auto; min-height: 100dvh; }
  .file-actions button:not(.primary):not([data-action="open-settings"]) { display: none; }
  .topbar-tools { gap: 6px; }
  .topbar-tools > .icon-group { display: none; }
  .phone-only { display: inline-flex; }
  .alliance-switch button { font-size: 12px; padding: 0 7px; }
  .alliance-switch .dot { margin-right: 3px; }
  .sheet-toggle { padding: 0 9px; }
  .stage { grid-template-rows: auto auto auto; }
  .field-stage { aspect-ratio: 1; }
  .workspace { min-height: calc(100dvh - 110px); }
  .drawer { border-radius: 0; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .timeline-foot { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
