:root{font-family:Inter,ui-sans-serif,system-ui,sans-serif;color:#263430;background:#f3f5f1;font-size:13px;--green:#22644c;--border:#d8e0d8}
.map-analysis-controls { display:flex; flex-wrap:wrap; gap:10px 18px; align-items:center; margin:0 0 12px; }
.map-analysis-controls label { font-weight:600; }
.lens-switch { display:flex; flex-wrap:wrap; gap:8px; }
.lens-switch button { display:grid; grid-template-columns:24px 1fr; gap:3px 8px; text-align:left; padding:10px 16px; border-radius:10px; background:#fff; }
.lens-switch button > span { grid-row:span 2; align-self:center; font-size:24px; color:var(--green); }
.lens-switch small { color:#61746a; }
.lens-switch button[aria-pressed="true"] { background:#e3f0e8; border-color:var(--green); box-shadow:inset 0 -2px var(--green); }
.lens-switch button:focus-visible, .trip-direction button:focus-visible { outline:3px solid #287a59; outline-offset:3px; }
.trip-direction { margin-bottom:16px; }
.trip-direction button { flex:1; }
.trip-direction button[aria-pressed="true"] { background:white; color:var(--green); font-weight:700; }
#trip-hint { color:#61746a; font-size:12px; }
#trip-analysis { width:340px; flex:none; background:white; padding:18px; border:1px solid var(--border); border-radius:10px; max-height:85vh; overflow:auto; }
#trip-analysis h2 { margin-bottom:16px; }
#trip-analysis .field { display:flex; flex-direction:column; align-items:stretch; gap:6px; }
#trip-analysis p { line-height:1.5; }
.trip-total strong { font-size:24px; display:block; color:#22644c; }
.trip-scale { font-size:11px; color:#61746a; }
.trip-detail { padding:10px 0; border-block:1px solid var(--border); min-height:58px; }
.trip-table { width:100%; border-collapse:collapse; font-variant-numeric:tabular-nums; }
.trip-table th { font-size:11px; text-align:left; padding:8px 4px; }
.trip-table td { padding:4px; border-bottom:1px solid #edf0eb; }
.trip-table td:not(:first-child), .trip-table th:not(:first-child) { text-align:right; white-space:nowrap; }
.trip-table button { text-align:left; border:0; background:transparent; padding:6px 0; width:100%; }
.trip-table .trip-highlight { background:#e1f0ec; }
.trip-map #streets, .trip-map #highways, .trip-map #bike, .trip-map #transit { opacity:.25; }
.trip-map #halo { opacity:.1; }
.trip-bubble { fill:#279c87; fill-opacity:.3; stroke:#16826e; stroke-width:1; pointer-events:none; }
.trip-origin .trip-bubble { fill:none; stroke:#773aa8; stroke-width:4; }
.trip-highlight .trip-bubble { stroke:#174d43; stroke-width:3; fill-opacity:.55; }
.trip-origin.trip-highlight .trip-bubble { stroke:#773aa8; }
.trip-target { cursor:pointer; }
.trip-focus { display:none; fill:none; stroke:#174d43; stroke-width:2; stroke-dasharray:3 2; pointer-events:none; }
.trip-highlight .trip-focus { display:block; }
body[data-analysis="trips"] #legend, body[data-analysis="trips"] #legend + .caption, body[data-analysis="trips"] #simulation-panel { display:none; }
@media(max-width:900px) { body[data-analysis="trips"] .workspace { flex-direction:column; } body[data-analysis="trips"] .canvas-column { width:100%; } #trip-analysis { width:100%; max-height:none; } }
*{box-sizing:border-box}body{margin:0;font-family:inherit;background:#f3f5f1;color:#263430}main{max-width:1600px;margin:auto;padding:22px}header,.actions,.section-head,.statusbar{display:flex;align-items:center;justify-content:space-between;gap:10px}header{margin-bottom:16px}h1{font-size:27px;letter-spacing:-1px;margin:4px 0}h2{font-size:14px;margin:0}.eyebrow{font-size:10px;font-weight:700;letter-spacing:1.7px;color:#64776b}.actions{flex-wrap:wrap;justify-content:flex-end}button,select,input,textarea{font:inherit}button{border:1px solid var(--border);border-radius:6px;background:white;color:#334b3e;padding:8px 11px;cursor:pointer}button:hover{background:#eaf0e8}button:disabled{opacity:.4;cursor:default}button.primary,button.active{background:var(--green);border-color:var(--green);color:white}button.danger{color:#9c302d;border-color:#d7aaa4}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid #218675;outline-offset:2px}input,select,textarea{border:1px solid #cbd5ca;border-radius:4px;padding:6px;background:white;min-width:0;color:#263430}input[type=checkbox]{accent-color:var(--green);padding:0}input[type=color]{height:34px;width:100%;padding:3px}textarea{width:100%;min-height:82px;font:11px ui-monospace,monospace;resize:vertical}small,.muted{color:#6b776e}label{display:flex;gap:6px;align-items:center}.statusbar{font-size:12px;color:#5b6d60;margin-bottom:12px;min-height:24px}#message{max-width:75%;text-align:right}#save-status{white-space:nowrap}.workspace{display:flex;align-items:flex-start;gap:16px}.canvas-column{flex:1;min-width:0}.mapwrap{position:relative}#map{width:100%;height:72vh;min-height:500px;background:#fbfcf9;border:1px solid var(--border);border-radius:10px;touch-action:none;user-select:none;display:block}.zoom{position:absolute;right:12px;top:12px;display:grid;gap:4px}.zoom button{width:31px;height:31px;padding:0;font-size:17px}.canvas-badge{position:absolute;left:12px;bottom:12px;color:#718075;background:#fbfcf9e8;font-size:9px;font-weight:700;letter-spacing:1.4px;padding:6px 9px;border:1px solid #dfe6dd;border-radius:4px;pointer-events:none}.layers,.legend{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-top:12px}.layers{font-size:11px}.layers .lock{color:#748272;font-size:10px;margin-left:-8px;margin-right:4px}.legend button{padding:5px 8px;display:flex;align-items:center;gap:6px;font-size:11px}.swatch{display:inline-block;width:18px;height:4px;background:var(--route-color);border-radius:4px;flex:none}.caption,footer{font-size:11px;color:#748070;line-height:1.6}footer{margin-top:20px}.tools,.tool-settings{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.tool-settings{margin-top:8px;font-size:11px}.tool-settings select{padding:4px}#editor-toolbar{background:#e7eee4;border:1px solid var(--border);border-radius:8px;padding:12px;margin-bottom:14px}#tool-help{margin:9px 0 0;color:#516849;font-size:12px}#sidebar{width:310px;flex:none;background:white;border:1px solid var(--border);border-radius:10px;max-height:85vh;overflow:auto}#sidebar section{padding:14px;border-bottom:1px solid #e5ebe1}.section-head{margin-bottom:12px}.section-head button{padding:4px 7px;font-size:11px}#inspector p{line-height:1.6;color:#6b786c}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.field{display:flex;align-items:stretch;flex-direction:column;gap:4px;font-size:11px}.field.wide{grid-column:1/-1}.field input,.field select{width:100%}form .actions{justify-content:flex-start;margin-top:12px}form details{margin-top:12px}summary{cursor:pointer;color:#476047}#route-list{margin-top:10px;display:grid;gap:5px}.route-row{display:flex;align-items:center;gap:7px}.route-row button{flex:1;text-align:left;display:flex;gap:8px;align-items:center}#issues{max-height:230px;overflow:auto;margin-top:8px}.issue{display:block;width:100%;text-align:left;font-size:11px;line-height:1.5;padding:7px;margin:4px 0;border-left:3px solid #c5753f}.issue.error{border-left-color:#ad453d}#issue-count{font-size:10px}#find{width:100%}#search-results button{display:block;width:100%;text-align:left;font-size:11px;margin-top:4px}.review{margin-top:18px}.review summary{font-weight:600;padding:10px 0}table{border-collapse:collapse;width:100%;font-size:12px;margin:12px 0 24px}th,td{text-align:left;padding:6px 9px;border-bottom:1px solid var(--border)}th{color:#667965;font-weight:600}.selection{pointer-events:none}.edit-handle{cursor:move}.selected-handle{fill:#d9f9d6!important;stroke:#227449!important}.route-stops{display:flex;flex-direction:column;gap:4px;margin:10px 0}.stop-row{display:flex;align-items:center;gap:4px;font-size:11px}.stop-row span{flex:1}.stop-row button{padding:3px 7px}.allocation-row{display:grid;grid-template-columns:1fr 55px 60px 28px;gap:4px;margin:5px 0}.allocation-row select,.allocation-row input{width:100%;font-size:10px}.allocation-row button{padding:2px}dialog{border:1px solid var(--border);border-radius:12px;max-width:450px;padding:24px;color:#263430}dialog::backdrop{background:#1d302758}dialog p{white-space:pre-line;line-height:1.6;margin:16px 0 22px}#simulation{padding:0}#simulation:not(:empty){border:1px solid var(--border);background:white;border-radius:8px;padding:16px;margin-top:14px}.metric-row{display:flex;flex-wrap:wrap;gap:25px;margin-top:12px}.metric strong{display:block;font-size:23px}.metric span{font-size:11px;color:#667965}[hidden]{display:none!important}
@media(max-width:1000px){main{padding:12px}header{align-items:flex-start}header .actions{max-width:65%}#sidebar{width:275px}#map{min-height:460px}.layers{gap:6px}.layers .lock{margin-left:0}}@media(max-width:740px){header{flex-direction:column}header .actions{max-width:none;justify-content:flex-start}.workspace{flex-direction:column}#sidebar{width:100%;max-height:none}.statusbar{align-items:flex-start}#message{max-width:65%}#map{height:65vh;min-height:380px}.tools button{padding:7px}.layers .lock{margin-left:0}}
/* Viewing and editing share a map, but expose different actions. */
#map * { cursor:inherit; }
.route-order { display:flex; flex-direction:column; gap:2px; }
.route-row .route-order button { padding:1px 5px; font-size:11px; line-height:1.2; }
.route-row > button { min-width:0; }
body[data-mode="view"] .edit-only,
body[data-mode="view"] .layers .lock,
body[data-mode="edit"] .view-only { display: none !important; }
.project-status { display:block; font-size:11px; color:#657769; margin-top:4px; }
.mode-switch { display:flex; gap:2px; background:#e5ebe2; border:1px solid var(--border); border-radius:8px; padding:3px; }
.mode-switch button { border:0; background:transparent; min-width:60px; }
.mode-switch button.active { background:white; color:var(--green); box-shadow:0 1px 4px #26343018; font-weight:700; }
.project-menu { position:relative; }
.project-menu > summary { display:flex; gap:12px; align-items:center; list-style:none; padding:9px 12px; border:1px solid var(--border); border-radius:6px; background:white; }
.project-menu > summary::-webkit-details-marker { display:none; }
.project-menu > summary:focus-visible { outline:2px solid #218675; outline-offset:2px; }
.project-menu-panel { position:absolute; z-index:20; top:calc(100% + 8px); right:0; width:285px; padding:16px; background:white; border:1px solid var(--border); border-radius:10px; box-shadow:0 10px 35px #26343025; }
.project-menu-panel button { display:block; width:100%; text-align:left; margin:5px 0; }
.project-menu-panel p { font-size:11px; line-height:1.6; color:#657769; margin:8px 0 12px; }
#save-status { white-space:normal; }
.statusbar { justify-content:flex-start; }
#message { max-width:100%; text-align:left; }
.legend-item { display:inline-flex; align-items:center; gap:7px; font-size:11px; padding:4px 0; margin-right:8px; }
.simulation-panel { margin-top:20px; border:1px solid var(--border); border-radius:9px; background:white; }
.simulation-panel > summary { padding:15px; font-weight:600; }
.simulation-panel > summary span { font-weight:400; color:#748070; margin-left:10px; font-size:11px; }
.simulation-body { padding:0 16px 16px; }
.simulation-body > p { max-width:750px; line-height:1.65; color:#657769; margin:0 0 14px; }
/* Inspector: properties first, optional detail and immediate actions below. */
.editor-inspector, #sidebar { width:360px; flex:none; background:white; border:1px solid var(--border); border-radius:10px; overflow:auto; max-height:calc(100vh - 32px); position:sticky; top:16px; overscroll-behavior:contain; scrollbar-gutter:stable; }
.editor-inspector > section, #sidebar section { padding:16px; border-bottom:1px solid #e5ebe1; }
.editor-inspector .inspector-search { background:#f8faf6; }
.editor-inspector .field { gap:6px; color:#536659; }
.editor-inspector .field select { min-height:34px; font-size:12px; }
.inspector-search > label { font-weight:600; margin-bottom:8px; }
#find { padding:9px 10px; }
#search-results:not(:empty) { max-height:220px; overflow:auto; margin-top:8px; }
.selection-panel > .section-head { margin-bottom:16px; }
.selection-panel > .section-head h2 { color:#657769; font-size:12px; font-weight:500; }
.selection-heading { margin-bottom:16px; overflow-wrap:anywhere; }
.selection-heading .eyebrow { font-size:9px; letter-spacing:1.3px; }
.selection-heading h3 { font-size:20px; line-height:1.3; letter-spacing:-.4px; margin:6px 0 0; }
.inspector-empty { padding:14px 0 8px; }
.inspector-empty strong { font-size:15px; }
#inspector p { font-size:12px; line-height:1.55; margin:8px 0 12px; }
#inspector small { display:block; font-size:11px; line-height:1.5; }
.property-apply { position:sticky; top:0; z-index:2; display:flex; align-items:center; gap:12px; padding:10px 0; margin-bottom:16px; background:white; border-bottom:1px solid #e5ebe1; }
.property-apply button { flex-shrink:0; font-size:12px; font-weight:600; }
#property-status { font-size:11px; color:#6b776e; }
#property-status.pending { color:#92541f; font-weight:600; }
.property-group { border:0; padding:0; margin:0 0 18px; min-width:0; }
.property-group legend, .inspector-block h4 { font-size:12px; font-weight:650; padding:0; margin:0 0 12px; }
#inspector .form-grid { gap:12px; grid-template-columns:repeat(2,minmax(0,1fr)); }
#inspector .field { font-size:11px; gap:6px; color:#536659; min-width:0; }
#inspector .field input, #inspector .field select { min-height:34px; font-size:12px; }
.check-field > span:last-child { display:flex; align-items:center; min-height:34px; gap:6px; }
#inspector .check-field input { min-height:0; width:auto; }
#inspector details { margin:0; border-top:1px solid #e5ebe1; }
#inspector summary { padding:13px 0; font-size:12px; font-weight:600; line-height:1.4; }
summary:focus-visible { outline:2px solid #218675; outline-offset:2px; }
.details-body { padding:0 0 16px; }
.details-body > .field { margin:12px 0; }
.details-body > button { display:block; width:100%; margin:8px 0; }
#inspector .details-body .actions { display:grid; grid-template-columns:1fr; gap:8px; }
#inspector .details-body .actions button { width:100%; }
#inspector-feedback:not(:empty) { position:sticky; top:0; z-index:3; padding:10px; border:1px solid #cbd5ca; background:#eef4eb; font-size:12px; line-height:1.5; border-radius:6px; }
.node-warning { padding:10px; background:#fff2dd; border-radius:6px; }
.details-body .property-group { margin:4px 0 0; }
.details-body .property-group legend { color:#718075; font-weight:400; font-size:11px; }
.inspector-block { border-top:1px solid #e5ebe1; padding:16px 0; }
#inspector .actions { gap:6px; margin:10px 0; }
#inspector .actions button, .details-body > button { font-size:11px; min-height:32px; }
.object-actions { display:flex; justify-content:space-between; border-top:1px solid #e5ebe1; margin-top:8px; padding-top:16px; }
.object-actions button { font-size:11px; }
.allocation-head, .allocation-row { display:grid; grid-template-columns:minmax(0,1fr) 52px 70px 28px; gap:5px; }
.allocation-head { font-size:10px; color:#6b776e; margin-bottom:6px; }
.allocation-row { margin:6px 0; }
.allocation-row select, .allocation-row input { font-size:11px; padding:6px 3px; height:32px; }
.allocation-row button { min-height:32px; }
#inspector #allocation-budget { background:#edf4ec; color:#345b40; padding:10px; border-radius:5px; font-weight:600; font-size:11px; margin-bottom:8px; }
#inspector #allocation-budget.over-budget { background:#fff0e8; color:#95411f; }
.endpoint-key, #inspector code { overflow-wrap:anywhere; }
.stop-row { padding:7px 0; border-bottom:1px solid #eef1eb; gap:5px; }
.stop-row span { min-width:0; overflow-wrap:anywhere; line-height:1.5; }
.stop-row button { flex-shrink:0; min-width:28px; min-height:28px; }
.sidebar-section { border-bottom:1px solid #e5ebe1; }
.sidebar-section > summary { padding:16px; font-size:13px; font-weight:600; }
.sidebar-section > summary span { font-size:10px; font-weight:400; color:#718075; margin-left:6px; }
.sidebar-section-body { padding:0 16px 16px; }
.sidebar-section-body .section-head { font-size:11px; }
.route-row { gap:6px; }
.route-row > button { font-size:12px; }
.route-row .route-order button { min-height:23px; min-width:26px; }
#issues { max-height:none; }
@media (min-width:741px) and (max-width:1000px) { .editor-inspector, #sidebar { width:330px; } }
@media (max-width:740px) { .editor-inspector, #sidebar { position:static; width:100%; max-height:none; scrollbar-gutter:auto; } .property-apply { position:static; } }
@media(max-width:740px) { .project-menu-panel { right:0; width:min(285px,85vw); } header .actions { width:100%; } .project-menu { margin-left:auto; } .simulation-panel > summary span { display:block; margin:6px 0 0; } }

/* Tools share the inspector's quiet grouping and contextual detail. */
.studio-chrome { background:#fff; border:1px solid var(--border); border-radius:12px; margin-bottom:16px; }
.studio-header { padding:16px 18px 12px; margin:0; flex-wrap:wrap; }
.studio-chrome .statusbar { padding:0 18px; margin:0 0 12px; }
.studio-chrome .map-analysis-controls { padding:0 18px 12px; margin:0; }
.studio-chrome .lens-switch button { padding:8px 12px; }
.context-toolbar, #editor-toolbar { padding:0; margin:0; background:#fff; border:0; border-top:1px solid var(--border); border-radius:0 0 12px 12px; }
.tool-row { display:flex; flex-wrap:wrap; align-items:stretch; gap:12px 20px; padding:12px 14px; }
.tool-group { display:flex; flex-direction:column; gap:6px; }
.tool-group-label, .control-caption { font-size:9px; letter-spacing:1px; text-transform:uppercase; color:#718075; font-weight:650; }
.tool-group .tools { gap:3px; }
.tool-group button { border-color:transparent; padding:7px 9px; font-size:12px; background:transparent; }
.tool-group button:hover { background:#edf3e9; }
.tool-group button.active { background:var(--green); color:white; }
.history-tools { margin-left:auto; border-left:1px solid #e5ebe1; padding-left:16px; }
.tool-settings { margin:0; padding:9px 14px; gap:10px 16px; border-top:1px solid #e5ebe1; background:#f8faf6; border-radius:0 0 10px 10px; min-height:43px; }
.tool-settings > span { font-size:11px; font-weight:650; color:var(--green); }
.tool-settings small { font-size:10px; }
.tool-settings button { font-size:11px; padding:5px 9px; }
.tool-guide { margin-left:auto; position:relative; }
.tool-guide summary { font-size:11px; padding:4px; }
.tool-guide > p { position:absolute; right:0; top:100%; width:min(390px,80vw); margin:8px 0 0; padding:14px; background:#fff; border:1px solid var(--border); border-radius:8px; box-shadow:0 6px 22px #26343018; z-index:20; line-height:1.6; }
/* A slim footer belongs to the map frame, without covering map geometry. */
.mapwrap { display:grid; grid-template-columns:minmax(0,1fr); border:1px solid var(--border); border-radius:10px; background:#fbfcf9; isolation:isolate; }
#map { grid-area:1/1; border:0; border-radius:10px 10px 0 0; }
.zoom { z-index:2; }
.canvas-badge { top:12px; bottom:auto; z-index:1; font-size:8px; padding:5px 7px; opacity:.85; }
.map-controls { grid-area:2/1; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:6px 12px; padding:8px 10px; border-top:1px solid #e0e7dd; background:#f8faf6; border-radius:0 0 10px 10px; }
.map-controls .layers { margin:0; gap:3px; font-size:10px; }
.layers .control-caption { margin-right:6px; }
.map-controls .layers label { padding:5px 6px; gap:4px; border-radius:4px; cursor:pointer; white-space:nowrap; }
.map-controls .layers label:hover { background:#e8efe4; }
.map-controls .layers input { width:11px; height:11px; margin:0; }
.map-controls .layers label:has(input:not(:checked)) { color:#82907f; }
body[data-mode="edit"] .layers .layer-locked::after { content:"· locked"; font-size:9px; color:#906037; }
.display-actions { display:flex; gap:4px; margin-left:auto; }
.display-actions button { font-size:10px; padding:6px 8px; border-color:transparent; background:transparent; }
.display-actions button[aria-expanded="true"] { color:var(--green); background:#e4eee0; }
#lock-count { display:inline-block; min-width:14px; font-variant-numeric:tabular-nums; color:#718075; }
.map-popover { grid-area:1/1; align-self:end; justify-self:end; z-index:3; width:288px; max-width:calc(100% - 24px); max-height:min(470px,62vh); margin:12px; padding:14px; background:#fff; border:1px solid var(--border); border-radius:9px; box-shadow:0 8px 30px #26343020; }
.map-popover .section-head { align-items:flex-start; margin-bottom:10px; }
.map-popover h2 { font-size:13px; margin-bottom:4px; }
.map-popover .section-head button { min-width:28px; min-height:28px; padding:2px; font-size:18px; border-color:transparent; }
.map-popover small, .map-popover p { font-size:10px; line-height:1.5; color:#718075; }
.appearance { display:flex; flex-direction:column; }
.appearance-scroll { overflow:auto; overscroll-behavior:contain; padding-right:4px; }
.appearance fieldset { min-width:0; border:0; border-top:1px solid #e5ebe1; padding:12px 0 2px; margin:0 0 12px; }
.appearance legend { font-size:11px; font-weight:650; padding:0 8px 0 0; color:#476047; }
.appearance label { display:grid; grid-template-columns:1fr auto; gap:5px 8px; font-size:11px; margin-bottom:14px; }
.appearance input[type="range"] { grid-column:1/-1; grid-row:2; width:100%; padding:0; height:18px; accent-color:var(--green); cursor:pointer; }
.appearance output { grid-column:2; grid-row:1; font-size:10px; color:#718075; font-variant-numeric:tabular-nums; }
.appearance select { font-size:11px; }
.locks-panel { width:235px; overflow:auto; }
.locks-panel > label { padding:7px 0; font-size:12px; }
@media(max-width:1000px) { .tool-row { gap:12px; } .tool-group button { padding:7px; } .history-tools { padding-left:10px; } }
@media(max-width:740px) { .tool-row { gap:12px 18px; } .history-tools { margin-left:0; padding-left:0; border:0; } .tool-group button { font-size:11px; } .map-controls { gap:5px; } .map-controls .layers { flex-wrap:wrap; } .map-popover { max-height:32vh; width:270px; margin:8px; } .map-popover .section-head { margin-bottom:6px; } .appearance fieldset { padding-top:8px; } }

/* Compact shared navigation and one project history/save cluster. */
.studio-header { gap:12px 20px; padding:12px 14px; }
.studio-header h1 { font-size:18px; letter-spacing:-.5px; margin:0; white-space:nowrap; }
.mode-navigation { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
.mode-navigation .lens-switch { gap:3px; border-left:1px solid var(--border); padding-left:10px; }
.studio-chrome .lens-switch button { display:block; padding:8px 10px; font-size:12px; border-color:transparent; border-radius:6px; }
.project-controls { margin-left:auto; display:flex; flex-direction:column; align-items:flex-end; gap:3px; }
.save-actions { display:flex; align-items:center; gap:4px; }
.save-actions > button { min-height:32px; padding:6px 10px; }
.save-actions > button:not(.primary) { border-color:transparent; font-size:18px; }
.project-controls .project-status { margin:0; font-size:10px; }
.project-menu > summary { padding:7px 10px; font-size:12px; }
.studio-chrome { margin-bottom:8px; }
.statusbar { font-size:11px; min-height:0; margin-bottom:10px; }
.tool-row { padding:8px 14px; gap:8px 18px; }
.tool-group { gap:3px; }
.tool-settings { padding:6px 14px; min-height:35px; }
@media(max-width:740px) {
  .studio-header { gap:10px; }
  .mode-navigation { order:3; width:100%; }
  .project-controls { margin-left:auto; }
  .mode-navigation .lens-switch { flex:1; }
}

/* A viewport workspace: the map fills the frame behind inset inspectors. */
@media(min-width:741px) {
  html, body { height:100%; overflow:hidden; }
  main { height:100dvh; max-width:none; padding:12px 18px 18px; display:flex; flex-direction:column; min-height:0; }
}
.studio-chrome { flex:none; border:0; border-radius:0; background:transparent; margin:0 0 10px; }
.studio-header { padding:0; min-height:48px; }
.save-split { display:flex; align-items:stretch; }
.save-split #save-project { border-radius:6px 0 0 6px; padding:7px 14px; }
.save-split .project-menu > summary { height:100%; display:flex; align-items:center; padding:7px 10px; border-radius:0 6px 6px 0; border-color:var(--green); border-left-color:#ffffff55; background:var(--green); color:white; }
.save-split #save-project:disabled { opacity:1; background:#dce5dd; color:#728275; border-color:#dce5dd; }
.project-menu-panel { z-index:100; }
.map-stage { flex:1; min-height:0; position:relative; display:flex; flex-direction:column; border:1px solid var(--border); border-radius:12px; background:#fbfcf9; }
.map-stage .context-toolbar, .map-stage #editor-toolbar { flex:none; border-top:0; border-bottom:1px solid var(--border); border-radius:12px 12px 0 0; }
.map-stage .tool-settings { border-radius:0; }
.map-stage .statusbar { flex:none; margin:0; padding:0 12px; background:#f8faf6; }
.map-stage .statusbar:has(#message:empty) { display:none; }
.map-stage #message:not(:empty) { padding:5px 0; max-height:42px; overflow:auto; }
#schematic-workspace, #census-workspace { flex:1; min-height:0; position:relative; }
#schematic-workspace { display:block; }
#schematic-workspace .canvas-column, #schematic-workspace .mapwrap { height:100%; width:100%; min-height:0; }
#schematic-workspace .mapwrap { border:0; grid-template-rows:minmax(0,1fr) auto; overflow:hidden; }
#map { height:100%; min-height:0; width:100%; }
.map-controls { border-radius:0 0 12px 12px; }
#sidebar, #trip-analysis, #view-inspector, .census-inspector.editor-inspector { position:absolute; top:12px; right:12px; width:360px; max-height:calc(var(--map-height, 100%) - 24px); overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable; z-index:5; box-shadow:0 4px 24px #26343024; border-radius:10px; }
#view-inspector .simulation-panel { margin:16px 0 0; border:0; border-top:1px solid var(--border); border-radius:0; }
#view-inspector .simulation-panel > summary { padding:14px 0; }
#view-inspector .simulation-panel > summary span { display:block; margin:5px 0 0; }
#view-inspector .simulation-body { padding:0; }
#view-inspector .metric-row { gap:12px; }
#view-inspector #simulation { padding:10px; }
#view-inspector .legend { margin-bottom:10px; }
#schematic-workspace .zoom { right:396px; }
#schematic-workspace .map-popover { margin-right:396px; }
.map-info { position:absolute; bottom:var(--map-info-bottom, 60px); right:396px; width:30px; height:30px; padding:0; z-index:6; border-radius:50%; font-weight:700; box-shadow:0 2px 8px #26343020; }
#map-data-dialog { width:calc(100vw - 80px); max-width:1200px; max-height:calc(100dvh - 120px); padding:20px; overflow:auto; }
#map-data-dialog > .section-head { position:sticky; top:-20px; background:white; padding:12px 0; z-index:1; }
#map-data-dialog #tables { overflow:auto; }
#map-data-dialog table { white-space:nowrap; }
@media(max-width:740px) {
  main { padding:12px; }
  .map-stage { min-height:75vh; }
  #schematic-workspace .canvas-column { height:60vh; }
  #sidebar, #trip-analysis, #view-inspector, .census-inspector.editor-inspector { position:relative; top:auto; right:auto; width:calc(100% - 24px); max-height:55vh; margin:12px; }
  #schematic-workspace .zoom { right:12px; }
  #schematic-workspace .map-popover { margin-right:12px; }
  .map-info { position:absolute; top:12px; bottom:auto; right:12px; }
  .map-stage:has(.context-toolbar:not([hidden])) .map-info { top:auto; bottom:12px; }
  #map-data-dialog { width:calc(100vw - 24px); max-height:85dvh; }
}

/* Reserve the same control row for plain tools, sliders, and selects. */
.map-stage .tool-settings { min-height:44px; padding:7px 14px; }
.tool-settings > label, .tool-settings > span, .tool-settings > .tool-guide { min-height:28px; display:flex; align-items:center; }
.tool-settings select, .tool-settings button { height:28px; padding:3px 8px; }
.tool-settings input[type=range] { height:28px; padding:0; margin:0; }
@media(min-width:741px) {
  .map-stage .tool-settings { height:44px; flex-wrap:nowrap; }
  .tool-settings > label { white-space:nowrap; }
}
@media(min-width:741px) and (max-width:1000px) {
  .tool-settings { gap:8px; }
  .tool-settings > span, .tool-settings small { display:none; }
}
