/* Approved sandbox visual language, scoped to the production project section. */
.solution-map { display:block; min-width:0; font-size:13px; container-type:inline-size; --commands:#83b5df; --states:#79baa4; --automations:#bc9ddd; --can:#d4b477; }
.solution-map h1,.solution-map h2,.solution-map h3,.solution-map p { margin:0; }
.solution-map button { cursor:pointer; font-weight:500; line-height:1.3; min-height:28px; }
.solution-map button:disabled { cursor:default; opacity:.4; }
.solution-map button:focus-visible { outline:2px solid var(--blue-dark); outline-offset:3px; }
.solution-map button[hidden] { display:none; }
.solution-map .sm-heading { padding:0 0 16px; display:flex; align-items:center; justify-content:space-between; gap:20px; }
.solution-map .sm-eyebrow { color:var(--muted); font-size:10px; letter-spacing:1.7px; text-transform:uppercase; margin-bottom:7px; display:block; }
.solution-map .sm-heading h1 { font-size:25px; letter-spacing:-.6px; font-weight:650; }
.solution-map .sm-heading h1 small { font-size:13px; font-weight:400; letter-spacing:0; color:var(--subtle); margin-left:12px; }
.solution-map .sm-heading p { color:var(--muted); margin-top:7px; font-size:12px; }
.solution-map .sm-toolbar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.solution-map .sm-btn { display:inline-flex; gap:7px; align-items:center; justify-content:center; border:1px solid var(--line); color:var(--ink); background:var(--panel); padding:8px 11px; border-radius:6px; font-size:12px; white-space:nowrap; }
.solution-map .sm-btn:hover { background:#202a35; border-color:#455566; }
.solution-map .sm-btn.primary { background:#244963; border-color:#4d7da1; color:#e8f3ff; }
.solution-map .sm-btn.quiet { background:transparent; }
.solution-map .sm-btn.active { background:var(--blue-soft); border-color:var(--blue); color:var(--blue-dark); }
.solution-map .sm-dot { width:6px; height:6px; border-radius:50%; background:var(--states); display:inline-block; flex-shrink:0; }
.solution-map .sm-workspace { display:grid; grid-template-columns:minmax(0,1fr); gap:14px; }
.solution-map .sm-canvas-wrap { position:relative; }
.solution-map .sm-map-shell { min-width:0; border:1px solid var(--line); border-radius:10px; overflow:hidden; background:#0d1218; }
.solution-map .sm-map-bar { min-height:48px; padding:9px 14px; border-bottom:1px solid var(--line-soft); display:flex; align-items:center; justify-content:space-between; gap:8px; }
.solution-map .sm-map-bar .sm-btn { font-size:11px; padding:5px 8px; }
.solution-map .sm-map-bar > div { display:flex; gap:6px; align-items:center; }
.solution-map .sm-map-bar > div:last-child { flex-wrap:wrap; justify-content:flex-end; }
.solution-map .sm-entity-picker { background:var(--panel); border:1px solid var(--line); border-radius:5px; color:var(--ink); font-size:11px; padding:5px 7px; width:174px; min-width:0; }
.solution-map .sm-entity-picker:focus-visible,.solution-map .sm-viewport:focus-visible { outline:2px solid var(--blue-dark); outline-offset:-2px; }
.solution-map .sm-counts { display:flex; flex-wrap:wrap; gap:6px 18px; padding:7px 14px; color:var(--muted); font-size:11px; border-bottom:1px solid var(--line-soft); }
.solution-map .sm-counts > span { display:flex; align-items:center; gap:6px; }
.solution-map .sm-counts strong { color:var(--accent); font-size:12px; font-variant-numeric:tabular-nums; }
.solution-map .sm-map-bar small,.solution-map .sm-zoom { color:var(--muted); font-size:11px; }
.solution-map .sm-zoom { min-width:36px; text-align:center; }
.solution-map .sm-preview-status { padding:6px 14px; font-size:10px; color:var(--muted); border-bottom:1px solid var(--line-soft); }
.solution-map .sm-preview-status.unverified { color:var(--amber); background:#201e19; }
.solution-map .sm-viewport { height:max(260px,calc(100dvh - 390px)); overflow:auto; background-image:radial-gradient(#26313c 1px,transparent 1px); background-size:20px 20px; position:relative; overscroll-behavior:contain; }
.solution-map .sm-sizer { position:relative; min-width:100%; min-height:100%; }
.solution-map .sm-board { position:absolute; top:0; left:0; transform-origin:top left; }
.solution-map .sm-icon { width:18px; height:18px; flex-shrink:0; display:block; }
.solution-map .sm-device { position:absolute; border:1px solid #3a4a59; border-radius:16px; background:#111a23; box-shadow:inset 0 1px 0 #ffffff04; }
.solution-map .sm-device-head { height:56px; display:flex; align-items:center; justify-content:space-between; margin:0 24px; border-bottom:1px solid #2b3946; gap:20px; }
.solution-map .sm-device-identity { display:flex; align-items:center; gap:13px; }
.solution-map .sm-device-identity > .sm-icon { width:30px; height:30px; color:#91afc4; }
.solution-map .sm-device-head h2 { font-size:16px; font-weight:600; letter-spacing:.7px; }
.solution-map .sm-device-head p { color:#91a4b4; font-size:13px; margin-top:5px; }
.solution-map .sm-device-project { text-align:right; font-size:13px; color:#b5c4d0; max-width:360px; overflow-wrap:anywhere; }
.solution-map .sm-device-project small { display:block; color:var(--subtle); font-size:10px; margin-top:5px; }
.solution-map .sm-device-foot { position:absolute; bottom:15px; left:24px; color:#708390; font-size:10px; }
.solution-map .sm-external { position:absolute; width:116px; padding:12px 9px; border:1px solid #34404b; border-radius:10px; background:#141a21; }
.solution-map .sm-external-icon { margin-bottom:9px; color:#8da6ba; }
.solution-map .sm-external-icon .sm-icon { width:24px; height:24px; }
.solution-map .sm-external h2 { font-size:14px; font-weight:600; letter-spacing:.4px; }
.solution-map .sm-external > strong { display:block; font-size:12px; font-weight:500; margin-top:9px; color:#b5c4d0; }
.solution-map .sm-external p { font-size:11px; color:var(--muted); margin-top:9px; line-height:1.6; }
.solution-map .sm-host { left:16px; top:110px; width:98px; }
.solution-map .sm-can-bus { left:1320px; top:112px; border-color:#4b4434; }
.solution-map .sm-can-bus .sm-external-icon,.solution-map .sm-can-bus h2 { color:var(--can); }
.solution-map .sm-gateway { position:absolute; width:52px; text-align:center; color:#a2b8ca; z-index:3; background:#142330; border:1px solid #405466; border-radius:6px; padding:6px 3px; pointer-events:none; }
.solution-map .sm-gateway > span { display:inline-block; margin-right:4px; font-size:13px; }
.solution-map .sm-gateway strong { font-size:12px; font-weight:600; }
.solution-map .sm-gateway small { display:block; font-size:9px; margin-top:3px; color:#839aaa; }
.solution-map .sm-gateway::before,.solution-map .sm-gateway::after { content:''; position:absolute; width:12px; top:13px; border-top:1px solid #435566; }
.solution-map .sm-gateway::before { right:100%; }
.solution-map .sm-gateway::after { left:100%; }
.solution-map .sm-uart { left:122px; top:130px; }
.solution-map .sm-can-port { left:1254px; top:130px; color:var(--can); border-color:#62573d; background:#26231c; }
.solution-map .sm-can-port::before,.solution-map .sm-can-port::after { border-color:#62573d; }
.solution-map .sm-can-port.inactive { color:var(--subtle); border-style:dashed; background:#151a1e; }
.solution-map .sm-physical { left:1320px; top:284px; border-style:dashed; background:#10171e; }
.solution-map .sm-physical h2 { font-size:10px; color:var(--subtle); letter-spacing:1px; margin-bottom:10px; }
.solution-map .sm-physical > div { display:flex; align-items:center; gap:7px; margin-top:12px; color:#829ca7; }
.solution-map .sm-physical strong { display:block; color:#adbdc7; font-size:12px; font-weight:500; }
.solution-map .sm-physical small { display:block; color:#82939f; font-size:9px; margin-top:4px; }
.solution-map .sm-physical > p { font-size:9px; color:#798994; margin-top:17px; }
.solution-map .sm-peripheral-port { position:absolute; left:1254px; top:331px; width:52px; color:#82939f; background:#111a23; border:1px dashed #3b4a56; border-radius:5px; font-size:9px; text-align:center; padding:7px 2px; pointer-events:none; }
.solution-map .sm-peripheral-port::after { content:''; position:absolute; width:12px; left:100%; top:50%; border-top:1px dashed #3b4a56; }
.solution-map .commands { --accent:var(--commands); }
.solution-map .states { --accent:var(--states); }
.solution-map .automations { --accent:var(--automations); }
.solution-map .can { --accent:var(--can); }
.solution-map .sm-region { position:absolute; border:1px solid #26313b; border-radius:10px; background:rgb(18 24 32 / 94%); padding:12px; }
.solution-map .sm-region-head { display:flex; align-items:center; gap:7px; margin-bottom:6px; height:18px; }
.solution-map .sm-region-head > .sm-icon { color:var(--accent); width:16px; height:16px; }
.solution-map .sm-region h2 { font-size:13px; font-weight:600; line-height:18px; }
.solution-map .sm-region-head > small { margin-left:auto; font-size:11px; color:var(--subtle); }
.solution-map .sm-region-sub { color:var(--subtle); font-size:10px; line-height:12px; height:12px; margin-bottom:12px; }
.solution-map .sm-cards { min-width:0; }
.solution-map .sm-region-empty { font-size:11px; line-height:1.7; color:var(--subtle); padding:7px 0; }
.solution-map .sm-card { position:absolute; display:flex; align-items:center; border:1px solid #2b3642; border-radius:7px; background:#18212b; min-height:44px; transition:opacity 180ms,border-color 180ms,background 180ms; }
.solution-map .sm-card:hover { border-color:#56677b; background:#1e2935; }
.solution-map .sm-card.selected { border-color:var(--accent); background:color-mix(in srgb,var(--accent) 12%,#15202a); box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 12%,transparent); }
.solution-map .sm-card.related { border-color:color-mix(in srgb,var(--accent) 65%,#29333e); }
.solution-map .sm-card.dimmed { opacity:.65; }
.solution-map .sm-card.dimmed:hover,.solution-map .sm-card.dimmed:focus-within { opacity:1; }
.solution-map .sm-select { display:flex; align-items:center; gap:8px; width:100%; min-height:42px; white-space:normal; padding:9px; color:inherit; border:0; background:transparent; flex:1; text-align:left; min-width:0; justify-content:flex-start; }
.solution-map .sm-select strong { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; font-size:14px; font-weight:550; overflow-wrap:anywhere; line-height:18px; }
.solution-map .sm-node-name { min-width:0; text-align:left; }
.solution-map .sm-node-icon { color:var(--accent); opacity:.75; }
.solution-map .sm-node-icon .sm-icon { width:14px; height:14px; }
.solution-map .sm-origin { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; font-size:9px; line-height:12px; color:#b1a1c6; margin-top:3px; overflow-wrap:anywhere; }
.solution-map .sm-edges { position:absolute; inset:0; overflow:visible; pointer-events:none; z-index:2; }
.solution-map .sm-edge > path { fill:none; stroke:#89b5d6; stroke-width:1.4; opacity:.75; }
.solution-map .sm-edges marker path { fill:#89b5d6; stroke:none; }
.solution-map .sm-edge rect { fill:#101b25; stroke:#33495b; }
.solution-map .sm-edges text { font-family:inherit; font-size:10px; fill:#c0d5e6; }
.solution-map .sm-map-foot { padding:7px 14px; min-height:39px; align-items:center; border-top:1px solid var(--line); display:flex; justify-content:space-between; color:var(--subtle); font-size:10px; gap:12px; }
.solution-map .sm-selection { display:flex; align-items:center; gap:10px; min-width:0; }
.solution-map .sm-selection > strong { color:var(--ink); font-size:11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.solution-map .sm-selection .sm-btn { padding:4px 8px; min-height:25px; font-size:10px; }
.solution-map .sm-inspector { position:absolute; z-index:5; right:12px; top:12px; bottom:12px; width:300px; border:1px solid #425569; border-radius:10px; background:var(--panel); box-shadow:0 8px 32px #0008; display:flex; flex-direction:column; min-width:0; }
.solution-map .sm-inspector[hidden],.solution-map .sm-add-options[hidden] { display:none; }
.solution-map .sm-inspector-head { padding:12px 16px; border-bottom:1px solid var(--line-soft); display:flex; justify-content:space-between; align-items:center; color:var(--muted); font-size:11px; }
.solution-map .sm-inspector-head .sm-btn { padding:4px 7px; font-size:10px; }
.solution-map .sm-inspector-body { padding:18px 16px; flex:1; min-height:0; overflow:auto; }
.solution-map .sm-inspector-body h2 { font-size:18px; margin:14px 0 9px; overflow-wrap:anywhere; }
.solution-map .sm-inspector-body p { color:var(--muted); font-size:12px; line-height:1.7; overflow-wrap:anywhere; }
.solution-map .sm-empty-icon { width:44px; height:44px; border:1px solid #345068; background:#172634; border-radius:12px; display:grid; place-items:center; color:var(--blue-dark); }
.solution-map .sm-inspector-body h3 { font-size:10px; text-transform:uppercase; color:var(--subtle); letter-spacing:1px; margin:26px 0 12px; }
.solution-map .sm-rel { display:block; white-space:normal; width:100%; text-align:left; border:1px solid var(--line-soft); background:#151d26; padding:10px; border-radius:6px; color:var(--ink); margin-top:7px; }
.solution-map .sm-rel span { font-size:10px; color:var(--blue-dark); display:block; margin-bottom:4px; overflow-wrap:anywhere; }
.solution-map .sm-rel strong { font-size:12px; font-weight:500; overflow-wrap:anywhere; }
.solution-map .sm-rel small { display:block; color:var(--subtle); font-size:10px; margin-top:5px; }
.solution-map .sm-hint { padding:14px 18px; border-top:1px solid var(--line-soft); color:var(--subtle); font-size:11px; line-height:1.7; }
.solution-map .sm-tip { padding:14px; background:#101923; border:1px solid #273e51; border-radius:7px; color:var(--muted); font-size:12px; line-height:1.7; margin-top:18px; }
.solution-map .sm-details { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.3fr); gap:7px 10px; font-size:11px; line-height:1.6; margin:16px 0; }
.solution-map .sm-details dt { color:var(--subtle); }
.solution-map .sm-details dd { margin:0; color:var(--muted); overflow-wrap:anywhere; }
.solution-map .sm-source-actions { display:grid; grid-template-columns:minmax(0,1fr); gap:6px; margin-top:16px; }
.solution-map .sm-source-actions .sm-btn { white-space:normal; text-align:left; justify-content:flex-start; min-width:0; overflow-wrap:anywhere; }
.solution-map .sm-source-link { color:#b4a2d1; border:0; background:transparent; padding:5px 0; font-size:11px; display:block; text-align:left; overflow-wrap:anywhere; }
.solution-map .sm-context-warning { color:var(--amber); border-left:2px solid #62573d; padding:8px 10px; margin:12px 0; font-size:11px; }
.solution-map .sm-add-menu { position:relative; }
.solution-map .sm-add-trigger { padding:10px 16px; font-weight:650; font-size:13px; }
.solution-map .sm-add-trigger > span:first-child { font-size:19px; line-height:1; }
.solution-map .sm-chevron { margin-left:12px; color:#a9c6dc; }
.solution-map .sm-add-options { position:absolute; top:calc(100% + 8px); right:0; width:288px; z-index:20; padding:6px; border:1px solid #415367; border-radius:10px; background:#18212b; box-shadow:0 16px 40px #0007; }
.solution-map .sm-add-options button { display:flex; align-items:center; gap:12px; width:100%; padding:12px 10px; border:0; border-radius:5px; background:transparent; color:var(--ink); text-align:left; font-size:13px; }
.solution-map .sm-add-options button:hover,.solution-map .sm-add-options button:focus-visible { background:#263646; }
.solution-map .sm-add-options small { display:block; margin-top:4px; color:var(--muted); font-size:10px; font-weight:400; }
.solution-map .sm-add-options button > span:last-child { margin-left:auto; color:var(--muted); }
.solution-map .sm-sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@container (max-width:1000px) { .solution-map .sm-heading h1 small {display:none;} .solution-map .sm-map-bar small {display:none;} }
@container (max-width:1320px) { .solution-map .sm-inspector {width:min(360px,calc(100% - 24px));} }
@container (max-width:760px) { .solution-map .sm-heading {align-items:flex-start;flex-wrap:wrap;gap:10px;} .solution-map .sm-map-bar {flex-wrap:wrap;} .solution-map .sm-map-foot {flex-wrap:wrap;} .solution-map .sm-hint {padding:8px 12px;} .solution-map .sm-inspector-body {padding:12px;} }
@container (max-width:460px) { .solution-map .sm-map-bar {flex-wrap:wrap;} .solution-map .sm-map-foot > span:last-child {display:none;} .solution-map .sm-toolbar {gap:5px;} }
@media (prefers-reduced-motion:reduce) { .solution-map .sm-card {transition:none;} }

/* Native top-layer State editing. The background map stays mounted and unchanged. */
.solution-map-host { position:relative; min-width:0; }
html:has(dialog.sm-state-editor[open]) { overflow:hidden; scrollbar-gutter:stable; }
body:has(dialog.sm-state-editor[open]) { overflow:hidden; }
dialog.sm-state-editor {
  --sm-modal-edge:clamp(16px,3vw,56px); --sm-modal-gap:clamp(12px,3vh,40px);
  position:fixed; inset:var(--sm-modal-gap) var(--sm-modal-edge) var(--sm-modal-gap) auto;
  width:min(580px,calc(100% - 2 * var(--sm-modal-edge))); height:min(860px,calc(100dvh - 2 * var(--sm-modal-gap)));
  max-width:none; max-height:calc(100dvh - 2 * var(--sm-modal-gap)); min-height:0;
  margin:auto 0; padding:0; overflow:hidden; flex-direction:column;
  border:1px solid #507568; border-radius:14px; background:var(--panel); color:var(--ink);
  box-shadow:0 24px 80px #000a,0 0 0 1px #a9d5c00a;
}
dialog.sm-state-editor:not([open]) { display:none; }
dialog.sm-state-editor[open] { display:flex; }
dialog.sm-state-editor::backdrop { background:rgb(3 8 14 / 42%); }
.sm-state-editor-head { display:flex; flex-shrink:0; align-items:flex-start; justify-content:space-between; gap:20px; padding:22px 24px 18px; border-bottom:1px solid var(--line-soft); }
.sm-state-editor-head > div { min-width:0; }
.solution-map .sm-state-editor .sm-state-editor-head h2 { margin:0; font-size:21px; font-weight:650; letter-spacing:-.3px; }
.solution-map .sm-state-editor .sm-state-editor-entity { margin:9px 0 0; color:var(--states,#79baa4); font-size:17px; line-height:1.4; overflow-wrap:anywhere; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.sm-state-editor-head .button { flex-shrink:0; min-width:74px; }
.solution-map .sm-state-editor .sm-state-editor-notice { flex-shrink:0; margin:0; padding:12px 24px; color:var(--muted); font-size:12px; line-height:1.5; border-bottom:1px solid var(--line-soft); }
.sm-state-editor-body { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; padding:18px; }
.sm-state-editor-body .detail-panel { padding:16px; min-width:0; }
.sm-state-editor-body .compact-detail-heading h2 { overflow-wrap:anywhere; }
.sm-state-editor-body .form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.sm-state-editor-body input,.sm-state-editor-body textarea,.sm-state-editor-body select { min-width:0; width:100%; box-sizing:border-box; }
.sm-state-editor button:focus-visible,.sm-state-editor input:focus-visible,.sm-state-editor select:focus-visible,.sm-state-editor textarea:focus-visible,.sm-state-editor-body:focus-visible { outline:2px solid var(--blue-dark); outline-offset:2px; }
.sm-state-editor-body:focus-visible { outline-offset:-3px; }
@media(max-width:1400px) { dialog.sm-state-editor { width:min(560px,calc(100% - 2 * var(--sm-modal-edge))); } }
@media(max-width:700px) {
  dialog.sm-state-editor { --sm-modal-edge:12px; --sm-modal-gap:12px; border-radius:12px; }
  .sm-state-editor-head { padding:16px; gap:12px; }
  .solution-map .sm-state-editor .sm-state-editor-head h2 { font-size:18px; }
  .solution-map .sm-state-editor .sm-state-editor-notice { padding:10px 16px; }
  .sm-state-editor-body { padding:10px; }
  .sm-state-editor-body .form-grid { grid-template-columns:minmax(0,1fr); }
  .sm-state-editor-body .span-two { grid-column:auto; }
}

/* Reused command fields fit the approved modal surface. */
.sm-state-editor-body .shared-command-detail { min-width:0; max-width:none; }
.sm-state-editor-body .shared-command-detail .field-table-head,
.sm-state-editor-body .shared-command-detail .field-table-row { grid-template-columns:minmax(0,1.2fr) minmax(80px,.8fr) minmax(70px,.6fr); gap:10px; }
.sm-state-editor-body .shared-command-detail .field-table-head > span:last-child { display:none; }
.sm-state-editor-body .shared-command-detail .field-table-row > .row-actions { grid-column:1/-1; justify-content:flex-end; }
.sm-state-editor-body .shared-command-detail .derived-layout code { white-space:normal; overflow-wrap:anywhere; }
@media(max-width:700px) {
  .sm-state-editor-body .shared-command-detail .field-table-head { display:none; }
  .sm-state-editor-body .shared-command-detail .field-table-row { grid-template-columns:minmax(0,1fr) minmax(0,.8fr); }
  .sm-state-editor-body .shared-command-detail .length-cell { grid-column:1/-1; }
}

/* Automation detail uses the same native shell with an opt-in wider surface. */
dialog.sm-state-editor.sm-automation-editor { width:min(1120px,calc(100% - 2 * var(--sm-modal-edge))); }
.sm-automation-editor .shared-automation-detail { display:grid; gap:16px; min-width:0; }
.sm-automation-editor .automation-primary-config { grid-template-columns:minmax(0,1fr) minmax(0,.7fr) minmax(0,.9fr); }
.shared-automation-detail .timeline-wrap { min-width:0; }
.sm-automation-editor .timeline-wrap { max-height:clamp(200px,40vh,420px); overflow:auto; }
@media(max-width:700px) {
  .sm-automation-editor .automation-primary-config { grid-template-columns:minmax(0,1fr); }
  .sm-automation-editor .automation-detail .assignment-row { grid-template-columns:minmax(0,1fr) minmax(0,.85fr) auto; }
  .sm-automation-editor .assignment-heading { align-items:flex-start; flex-wrap:wrap; gap:6px; }
  .sm-automation-editor .assignment-heading > span { min-width:0; flex:1 1 150px; }
  .sm-automation-editor .automation-step-heading { gap:6px; }
}

/* CAN reuses the approved modal; mapping controls need a little more width. */
dialog.sm-state-editor.sm-can-editor { width: min(880px, calc(100% - 2 * var(--sm-modal-edge))); }
.sm-can-editor :is(.field, .binding-grid, .payload-binding-mapping, .can-trigger-fields) { min-width: 0; }
.sm-can-editor :is(input, select, textarea) { max-width: 100%; min-width: 0; }
.sm-dismiss-layer { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 20px; background: rgb(9 13 22 / 72%); border-radius: inherit; }
.sm-dismiss-confirm { width: min(440px, 100%); padding: 24px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel, #151b29); box-shadow: 0 20px 65px #0008; }
.sm-dismiss-confirm h3 { margin: 0 0 12px; }
.sm-dismiss-confirm p { line-height: 1.5; color: var(--muted); }
.sm-dismiss-confirm .button-row { flex-wrap: wrap; }
@media (max-width: 600px) {
    .sm-can-editor :is(.payload-binding-mapping, .binding-grid, .protection-grid) { grid-template-columns: minmax(0, 1fr); }
    .sm-can-editor .inline-form { flex-wrap: wrap; }
    .sm-can-editor .payload-binding-head { min-width: 0; }
    .sm-can-editor .payload-binding-summary { min-width: 0; overflow-wrap: anywhere; }
}

/* Project-scoped settings retain the map's spatial composition. */
.sm-configure-interface {font:inherit;color:inherit;cursor:pointer;}
.sm-configure-interface:hover,.sm-configure-interface:focus-visible {border-color:var(--sm-can);outline:2px solid #60d2e2;outline-offset:4px;}
.can-native-wizard {position:fixed;inset:0;margin:auto;max-height:calc(100dvh - 32px);max-width:calc(100vw - 32px);color:var(--ink);background:var(--panel);overflow:hidden;}
.can-native-wizard:not([open]) {display:none;}
.can-native-wizard::backdrop {background:rgba(5,10,18,.35);}
.automation-import-wizard > :is(.compact-editor,.dependency-empty) {grid-row:3;min-height:0;overflow:auto;}
html:has(.can-native-wizard[open]) {overflow:hidden;}
.can-bus-disclosure>summary {cursor:pointer;font-weight:600;padding:6px;}
.can-bus-disclosure[open]>summary {margin-bottom:12px;}
@media(max-width:600px) {.can-native-wizard {max-height:calc(100dvh - 16px);max-width:calc(100vw - 16px);}}

.sm-state-editor .can-bus-fields {grid-template-columns:repeat(2,minmax(0,1fr));}
.sm-state-editor .can-bus-fields>.field:first-child {grid-column:1 / -1;}
@media(max-width:600px) {.sm-state-editor .can-bus-fields {grid-template-columns:minmax(0,1fr);}}

/* Boundary buttons must not inherit the application button's horizontal flex/nowrap. */
.solution-map button.sm-can-bus {display:block;white-space:normal;text-align:left;height:auto;line-height:1.4;}
.solution-map .sm-can-bus p {overflow-wrap:anywhere;}
/* Only bus settings size to content; accepted entity editor sizes are unchanged. */
dialog.sm-state-editor.sm-settings-modal {height:auto;bottom:auto;margin:0;}
.sm-settings-modal .sm-state-editor-body {flex:0 1 auto;}
.solution-map .sm-settings-modal .sm-state-editor-entity {display:none;}
.solution-map .sm-settings-modal .sm-state-editor-notice {padding:8px 24px;border-bottom:0;font-size:11px;}
.sm-settings-modal .can-bus-heading {justify-content:flex-end;}

/* Workspace identification, navigation and authoring take precedence over explanatory copy. */
.solution-map .sm-heading {padding-bottom:14px;}
.solution-map .sm-heading h1 {margin:0;}
.solution-map .sm-viewport {height:max(260px,calc(100dvh - 300px));}
.solution-map .sm-map-foot[hidden] {display:none;}
.solution-map .sm-region-head {margin-bottom:18px;}
.solution-map .sm-context-details {margin-top:20px;}
.solution-map .sm-context-details>summary {cursor:pointer;color:var(--muted);font-size:12px;font-weight:600;}
.solution-map .sm-context-details[open]>summary {margin-bottom:12px;}
.solution-map .sm-context-details p+p {margin-top:10px;}

/* Shared Property fields retain their list styling inside the compact modal. */
.sm-state-editor .properties-row { grid-template-columns:minmax(0,1fr) minmax(110px,1fr); }
.sm-state-editor .properties-cell .properties-mobile-label { display:block; }
.sm-state-editor .properties-item { min-width:0; }
@media(max-width:460px) { .sm-state-editor .properties-row { grid-template-columns:minmax(0,1fr); } }

dialog.sm-state-editor.sm-property-editor { width:min(520px,calc(100% - 2 * var(--sm-modal-edge))); height:fit-content; }
.sm-property-editor .properties-toggle input { width:16px; }

.sm-property-editor .sm-state-editor-body { flex:0 1 auto; }

/* One native modal; the production DBC workspace owns its internal navigation. */
dialog.sm-state-editor.sm-dbc-workspace { inset:16px; margin:auto; width:calc(100% - 32px); height:calc(100dvh - 32px); max-height:calc(100dvh - 32px); }
.sm-dbc-workspace .sm-state-editor-entity { display:none; }
.sm-dbc-workspace .candbc-page { min-width:0; }
.sm-dbc-workspace :is(.candbc-browser-list,.candbc-output-list) { max-height:none; overflow:visible; }
.sm-dbc-workspace .candbc-assets { flex-shrink:0; }
@media(max-width:700px) {dialog.sm-state-editor.sm-dbc-workspace {inset:8px;width:calc(100% - 16px);height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);} .sm-dbc-workspace .candbc-workspace {grid-template-columns:minmax(0,1fr);} }

/* The Studio shell remains; the map fills its remaining workspace. */
.app-shell.map-workspace { height:100dvh; min-height:0; display:flex; flex-direction:column; overflow:hidden; }
.map-workspace > .topbar { flex-shrink:0; }
.map-workspace .editor-layout { flex:1; min-height:0; overflow:hidden; }
.map-workspace .sidebar { overflow:auto; min-height:0; }
.map-workspace .center-panel { padding:0; display:flex; flex-direction:column; min-height:0; overflow:hidden; gap:0; }
.map-workspace .center-panel > :not(.solution-map-host) { flex-shrink:0; }
.map-workspace .solution-map-host { flex:1; min-height:0; display:flex; flex-direction:column; }
.solution-map { flex:1; min-height:0; display:flex; flex-direction:column; }
.solution-map .sm-heading { padding:10px 16px; gap:8px; flex-shrink:0; }
.solution-map .sm-heading h1 { font-size:17px; }
.solution-map .sm-toolbar { gap:6px; }
.solution-map .sm-workspace,.solution-map .sm-map-shell { flex:1; min-height:0; display:flex; flex-direction:column; gap:0; }
.solution-map .sm-map-shell { border:0; border-radius:0; position:relative; }
.solution-map .sm-canvas-wrap { flex:1; min-height:0; display:flex; }
.solution-map .sm-viewport { flex:1; min-width:0; height:auto; overflow:scroll; scrollbar-width:none; -ms-overflow-style:none; }
.solution-map .sm-viewport::-webkit-scrollbar { display:none; width:0; height:0; }
.solution-map .sm-viewport.sm-panning,.solution-map .sm-viewport.sm-panning * { cursor:grabbing; user-select:none; }
.solution-map .sm-map-foot { border-top:0; position:absolute; bottom:15px; left:0; right:15px; z-index:4; background:#0d1218ed; }
.solution-map .sm-view-controls { position:relative; }
.solution-map .sm-view-controls > summary { cursor:pointer; }
.solution-map .sm-view-options { position:absolute; right:0; top:calc(100% + 6px); z-index:12; width:240px; max-width:calc(100vw - 32px); padding:12px; display:flex; gap:8px; flex-wrap:wrap; background:var(--panel); border:1px solid var(--line); border-radius:8px; box-shadow:0 6px 24px #0008; }
.solution-map .sm-view-options .sm-entity-picker { width:100%; }
.solution-map .sm-view-options small { color:var(--muted); line-height:1.5; }
@media(max-width:860px) {
 .map-workspace .editor-layout { grid-template-rows:auto minmax(0,1fr); }
 .map-workspace .sidebar { max-height:24dvh; }
 .solution-map .sm-heading { flex-wrap:wrap; padding:8px; }
 .solution-map .sm-heading h1 { font-size:15px; }
 .solution-map .sm-toolbar { flex-wrap:wrap; }
 .solution-map .sm-toolbar { position:relative; }
 .solution-map .sm-view-controls { position:static; }
 .solution-map .sm-btn { padding:6px 8px; }
}

/* Studio owns the compact global header; project identity stays on the canvas. */
.project-workspace .editor-layout { grid-template-columns:minmax(0,1fr); }
.project-workspace .topbar { display:flex; align-items:center; gap:12px; padding:8px 16px; min-width:0; }
.project-workspace .brand-block { flex:0 0 auto; }
.project-workspace .brand-link { flex-direction:row; gap:7px; }
.project-workspace .brand-logo { width:104px; }
.project-workspace .brand-product { font-size:11px; }
.workspace-navigation-actions { display:flex; gap:4px; align-items:center; flex:0 0 auto; }
.workspace-navigation-actions .button { min-height:30px; padding:6px 9px; }
#workspace-nav-toggle { width:32px; font-size:17px; padding:4px; }
.project-workspace .topbar-actions { margin-left:auto; min-width:0; width:auto; flex-direction:row; flex-wrap:nowrap; gap:8px; align-items:center; }
.project-workspace .topbar-actions .auth-cluster { min-width:0; flex-wrap:nowrap; gap:6px; }
.project-workspace .topbar-actions label[title="Local development QA identity"] select { width:160px; min-height:30px; padding:4px 7px; font-size:11px; }
.project-workspace .topbar-actions label[title="Local development QA identity"] > span { display:none; }
.project-workspace .account-menu-trigger { min-width:0; max-width:180px; min-height:30px; }
.project-workspace .account-menu-trigger > span:first-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.project-workspace .topbar-actions > .button { flex:0 0 auto; min-height:30px; }
.solution-map .sm-heading { align-items:flex-start; padding:14px 18px 12px; gap:12px; }
.sm-project-identity { flex:1 1 260px; min-width:0; }
.solution-map .sm-project-identity h1 { font-size:21px; line-height:1.25; overflow-wrap:anywhere; margin:0; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
.sm-project-description { color:var(--muted); font-size:12px; line-height:1.45; margin:5px 0 0; overflow-wrap:anywhere; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
.sm-project-meta { display:flex; gap:12px; flex-wrap:wrap; margin-top:6px; color:var(--muted); font-size:11px; line-height:1.4; }
.sm-project-meta > span { min-width:0; overflow-wrap:anywhere; }
.solution-map .sm-toolbar { flex:0 1 auto; flex-wrap:wrap; justify-content:flex-end; gap:5px; }
.project-workspace .center-panel > :is(.source-page,.builds-page,.generation-page) { width:100%; margin-inline:auto; min-width:0; }
.project-workspace .source-page,.project-workspace .builds-page { max-width:1440px; }
.project-workspace .generation-page { max-width:1120px; }
.workspace-confirm,.workspace-drawer { color:var(--ink); background:var(--panel); border:1px solid var(--line); }
.workspace-confirm { width:min(520px,calc(100vw - 32px)); padding:24px; border-radius:10px; }
.workspace-confirm h2 { margin-top:0; }
.workspace-confirm::backdrop,.workspace-drawer::backdrop { background:#0008; }
.workspace-drawer { margin:0; inset:0 auto 0 0; width:min(340px,90vw); height:100dvh; max-height:100dvh; max-width:90vw; padding:0; }
.workspace-drawer > header { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:12px 16px; }
.workspace-drawer h2 { font-size:17px; margin:0; }
.project-workspace .workspace-drawer .sidebar { max-height:none; height:calc(100dvh - 68px); overflow:auto; border:0; padding:12px; }
@media(max-width:860px) { .map-workspace .editor-layout { grid-template-rows:minmax(0,1fr); } }
@media(max-width:700px) {
 .project-workspace .topbar { flex-wrap:wrap; gap:6px 8px; padding:6px 10px; }
 .project-workspace .brand-logo { width:84px; }
 .workspace-navigation-actions { flex:1 1 auto; justify-content:flex-end; }
 .workspace-navigation-actions .button { padding:6px 8px; }
 .project-workspace .topbar-actions { flex:1 0 100%; margin-left:0; flex-wrap:wrap; gap:6px; }
 .project-workspace .topbar-actions label[title="Local development QA identity"] select { width:136px; }
 .project-workspace .account-menu-trigger { max-width:126px; }
 .solution-map .sm-heading { flex-wrap:wrap; padding:10px; gap:9px; }
 .solution-map .sm-project-identity { flex-basis:100%; }
 .solution-map .sm-project-identity h1 { font-size:18px; }
 .solution-map .sm-toolbar { width:100%; justify-content:flex-start; }
}
