/* Shared shell additions: engineering schematics, CAD viewer, AI side panel,
   workspace modals, pop-out cards. Loaded on every route. All colours use
   the app's tokens, so light, dark and accent themes carry over. */

/* --- schematics ------------------------------------------------------------ */
.sx { width: 100%; height: auto; display: block; border-radius: var(--r-tile); background: var(--surface-2); border: 1px solid var(--line); font-family: inherit; }
.sx__grid path { stroke: var(--line); stroke-width: .6; fill: none; }
.sx__grid path.is-major { stroke: var(--line-2); stroke-width: .8; }
.sx__title text { font-size: 13px; font-weight: 700; fill: var(--text); }
.sx__title .sx__sub { font-size: 10.5px; font-weight: 500; fill: var(--muted); }
.sx :is(.sx__body, .sx__aperture, .sx__block, .sx__gearbox, .sx__sheet) { fill: color-mix(in srgb, var(--text) 4%, transparent); stroke: var(--text); stroke-width: 1.5; }
.sx .is-ghost { fill: none; stroke: var(--line-2); stroke-dasharray: 4 4; }
.sx :is(.sx__glass) { fill: color-mix(in srgb, var(--sky) 18%, transparent); stroke: color-mix(in srgb, var(--sky) 60%, transparent); stroke-width: 1; }
.sx :is(.sx__door, .sx__leaf) { fill: color-mix(in srgb, var(--text) 8%, transparent); stroke: var(--text); stroke-width: 1.2; }
.sx__rail { fill: color-mix(in srgb, var(--slate) 45%, transparent); }
.sx__wheel circle { fill: var(--text); stroke: var(--surface-2); stroke-width: 4; }
.sx__wheel .sx__hub, .sx__rim { fill: var(--surface-2); stroke: var(--muted); stroke-width: 1.5; }
.sx__bolt { fill: var(--muted); }
.sx :is(.sx__member, .sx__outrigger, .sx__brace, .sx__pipe, .sx__duct, .sx__spring) { stroke: var(--text); stroke-width: 2.2; fill: none; stroke-linecap: round; }
.sx .sx__brace { stroke-width: 1; stroke: var(--muted); }
.sx .sx__outrigger { stroke-width: 1.6; }
.sx :is(.sx__axle) { fill: color-mix(in srgb, var(--slate) 35%, transparent); stroke: var(--text); stroke-width: 1.2; }
.sx .is-hi:not(text) { stroke: var(--coral) !important; }
.sx :is(rect, path, circle).is-hi:not(.sx__member):not(.sx__diag):not(.sx__outrigger) { fill: color-mix(in srgb, var(--coral) 18%, transparent); }
.sx__tanks.is-hi rect { fill: color-mix(in srgb, var(--coral) 22%, transparent); stroke: var(--coral); stroke-width: 1.4; }
.sx__weld { fill: color-mix(in srgb, var(--coral) 30%, transparent); stroke: var(--coral); stroke-width: 1.5; }
.sx__cut { fill: var(--surface-2); stroke: var(--coral); stroke-dasharray: 3 2; stroke-width: 1; }
.sx__panel rect:first-child { fill: color-mix(in srgb, var(--sky) 10%, transparent); stroke: var(--text); stroke-width: 1.1; }
.sx__panel.is-hi rect:first-child { stroke: var(--coral); fill: color-mix(in srgb, var(--coral) 10%, transparent); }
.sx__plabel, .sx__panel text { font-size: 9.5px; fill: var(--muted); font-weight: 600; }
.sx__dim path { stroke: var(--muted); stroke-width: .8; fill: none; }
.sx__dim text { font-size: 9.5px; fill: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.sx__call path { stroke: var(--text); stroke-width: .8; fill: none; }
.sx__call > circle:not(.sx__badge) { fill: var(--text); }
.sx__badge { fill: var(--ink); }
.sx__n { font-size: 10px; font-weight: 800; fill: var(--on-ink); }
.sx__label { font-size: 10.5px; font-weight: 600; fill: var(--text); }
.sx__datum circle { fill: var(--surface-2); stroke: var(--teal); stroke-width: 2; }
.sx__datum text { font-size: 10px; font-weight: 800; fill: var(--teal); }
.sx__diag { stroke-width: 1.4; stroke-dasharray: 6 4; fill: none; }
.sx__axis { stroke: var(--line-2); stroke-dasharray: 10 3 2 3; fill: none; }
.sx__livery { fill: color-mix(in srgb, var(--accent-ink, var(--sky)) 55%, transparent); }
.sx__livery.is-b { stroke: var(--coral); stroke-width: 3; }
.sx__dft circle { fill: var(--teal); stroke: var(--surface-2); stroke-width: 2; }
.sx__dft text, .sx__node text, .sx__engine text, .sx__air text { font-size: 9.5px; font-weight: 600; fill: var(--muted); }
.sx__seat { fill: color-mix(in srgb, var(--iris) 14%, transparent); stroke: var(--text); stroke-width: .9; }
.sx__aisle { stroke: var(--line-2); stroke-dasharray: 2 4; }
.sx__driver { fill: color-mix(in srgb, var(--amber) 20%, transparent); stroke: var(--amber); }
.sx__standee { fill: color-mix(in srgb, var(--teal) 10%, transparent); stroke: var(--teal); stroke-dasharray: 4 3; }
.sx__ramp rect, .sx__ramp.is-hi, path.sx__ramp { fill: color-mix(in srgb, var(--sky) 16%, transparent); stroke: var(--sky); stroke-width: 2.4; }
.sx__ramp text { font-size: 18px; fill: var(--sky); }
.sx__engine rect { fill: color-mix(in srgb, var(--plum) 20%, transparent); stroke: var(--plum); }
.sx__wire path { stroke: var(--amber); stroke-width: 2; fill: none; }
.sx__wire path.is-b { stroke: var(--rose); stroke-width: 1.4; stroke-dasharray: 5 3; }
.sx__node rect { fill: var(--surface-2); stroke: var(--text); stroke-width: 1.2; }
.sx__node.is-hi rect, rect.sx__node.is-hi { stroke: var(--coral); fill: color-mix(in srgb, var(--coral) 16%, transparent); }
.sx__air path { stroke: var(--sky); stroke-width: 2.5; fill: none; }
.sx__air circle { fill: color-mix(in srgb, var(--sky) 16%, transparent); stroke: var(--sky); stroke-width: 1.5; }
.sx__check circle { fill: var(--surface-2); stroke: var(--text); stroke-width: 1.4; }
.sx__check.is-hi circle { stroke: var(--coral); fill: color-mix(in srgb, var(--coral) 18%, transparent); }
.sx__check text { font-size: 10px; font-weight: 800; fill: var(--text); }
.sx__legend text { font-size: 10.5px; fill: var(--muted); font-weight: 600; }
.sx__cyl { fill: color-mix(in srgb, var(--plum) 18%, transparent); stroke: var(--text); }
.sx :is(.sx__turbo, .sx__flywheel) { fill: color-mix(in srgb, var(--amber) 16%, transparent); stroke: var(--text); stroke-width: 1.4; }
.sx__acunit { stroke-width: 1.6; }
.sx__flow { stroke: var(--sky); stroke-width: 2; stroke-dasharray: 3 3; }
.sx__guard { fill: none; stroke: var(--line-2); stroke-dasharray: 3 3; }
.sx__floor, .sx__ground { stroke: var(--text); stroke-width: 2; fill: none; }
.sx__ground { stroke: var(--muted); stroke-dasharray: 8 4; }
.sx__bay { stroke-width: 1.6; }
.sx__restraint { fill: color-mix(in srgb, var(--teal) 14%, transparent); stroke: var(--teal); }
.sx__cone { fill: color-mix(in srgb, var(--sky) 10%, transparent); stroke: color-mix(in srgb, var(--sky) 40%, transparent); }
.sx__actuator { fill: var(--coral); }

/* schematic gallery */
.sx-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.sx-card { display: grid; gap: 8px; padding: 10px; border-radius: var(--r-tile); background: var(--glass-2); border: 1px solid var(--line); text-align: left; font: inherit; color: inherit; cursor: pointer; }
.sx-card:hover { border-color: var(--line-2); }
.sx-card b { font-size: var(--fs-sm); }
.sx-card small { color: var(--muted); font-size: var(--fs-2xs); }

/* --- CAD viewer -------------------------------------------------------------- */
.cadv { display: grid; gap: 10px; }
.cadv__bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cadv__tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cadv__tools .search { min-width: 220px; }
.cadv__clip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); font-size: var(--fs-xs); }
.cadv__clip select { font: inherit; border: 0; background: transparent; color: var(--text); }
.cadv__clip input { width: 90px; accent-color: var(--coral); }
.cadv__stage { position: relative; }
.cadv__vp { position: relative; height: clamp(320px, 52vh, 620px); border-radius: var(--r-tile); overflow: hidden; border: 1px solid var(--line); background: var(--raised); }
.cadv__canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.cadv__canvas:active { cursor: grabbing; }
.cadv__top, .cadv__bottom { position: absolute; left: 12px; right: 12px; display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); pointer-events: none; }
.cadv__top { top: 10px; }
.cadv__bottom { bottom: 10px; text-transform: none; letter-spacing: 0; }
.cadv__bottom .ico { width: 13px; height: 13px; vertical-align: -2px; color: var(--teal); }
.cadv__msg { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; color: var(--muted); font-size: var(--fs-sm); padding: 24px; }
.cadv__msg .ico { width: 22px; height: 22px; color: var(--rose); }
.cadv__msg--static { position: static; min-height: 220px; border-radius: var(--r-tile); border: 1px dashed var(--line-2); }
.cadv__spin { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--coral); animation: cadv-spin .8s linear infinite; }
@keyframes cadv-spin { to { transform: rotate(360deg); } }
.cadv__links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.cadv__note { margin: 0 0 8px; color: var(--muted); font-size: var(--fs-xs); }
.cadv__lib { margin: 0; padding: 0; list-style: none; display: grid; max-height: 460px; overflow: auto; }
.cadv__lib li { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.cadv__lib b { display: block; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cadv__lib small { color: var(--muted); font-size: var(--fs-2xs); }
.cadv__lib .grow { flex: 1; min-width: 0; }
.cadv__fmt { flex: none; width: 42px; text-align: center; font-size: 10px; font-weight: 800; text-transform: uppercase; padding: 3px 0; border-radius: 6px; background: var(--well); }
.cadv__fmt--glb { background: color-mix(in srgb, var(--teal) 16%, transparent); color: var(--teal); }
.cadv__fmt--step, .cadv__fmt--stp { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.cadv__fmt--stl, .cadv__fmt--obj { background: color-mix(in srgb, var(--sky) 16%, transparent); color: var(--sky); }
.cadv__empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 40px 20px; border-radius: var(--r-tile); border: 1px dashed var(--line-2); color: var(--muted); }
.cadv__empty .ico { width: 30px; height: 30px; }
.cadv__empty b { color: var(--text); }
.cadv__upload { cursor: pointer; }

/* --- AI side panel ------------------------------------------------------------- */
.ai-panel { position: fixed; top: 12px; right: 12px; bottom: 12px; z-index: 60; width: min(440px, calc(100vw - 24px)); display: grid; grid-template-rows: auto auto 1fr auto;
  border-radius: var(--r-card); background: var(--glass-3, var(--raised)); border: 1px solid var(--rim); box-shadow: var(--shadow-pop); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); overflow: hidden; }
.ai-panel[hidden] { display: none; }
html.has-ai .app { padding-right: min(460px, 34vw); transition: padding .3s var(--ease); }
@media (max-width: 1100px) { html.has-ai .app { padding-right: 0; } }
.ai-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px 16px; }
.ai-head__mark { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--ink); color: var(--on-ink); flex: none; }
.ai-head__mark .ico { width: 18px; height: 18px; }
.ai-head b { display: block; font-size: var(--fs-md); }
.ai-head small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--fs-2xs); }
.ai-head small i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.ai-head small i.is-off { background: var(--bad); }
.ai-head .grow { flex: 1; min-width: 0; }
.ai-ctx { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 10px; border-bottom: 1px solid var(--line); }
.ai-ctx .chip { font-size: var(--fs-2xs); padding: 3px 9px; }
.ai-log { overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.ai-msg { display: grid; gap: 6px; max-width: 100%; }
.ai-msg--user { justify-items: end; }
.ai-msg--user .ai-bubble { background: var(--ink); color: var(--on-ink); border-radius: 16px 16px 4px 16px; }
.ai-bubble { padding: 10px 13px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-md); line-height: 1.5; overflow-wrap: anywhere; }
.ai-msg--user .ai-bubble { border: 0; }
.ai-bubble p { margin: 0 0 6px; }
.ai-bubble p:last-child { margin: 0; }
.ai-bubble ul, .ai-bubble ol { margin: 4px 0 6px; padding-left: 18px; }
.ai-bubble code { font-size: .9em; background: var(--well); border-radius: 5px; padding: 1px 5px; }
.ai-bubble a { color: var(--sky); font-weight: 600; }
.ai-bubble table { border-collapse: collapse; font-size: var(--fs-xs); margin: 6px 0; }
.ai-bubble td, .ai-bubble th { border: 1px solid var(--line-2); padding: 3px 6px; text-align: left; }
.ai-trace { display: flex; flex-wrap: wrap; gap: 4px; }
.ai-trace span { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; color: var(--muted); padding: 2px 8px; border-radius: 999px; background: var(--well); }
.ai-trace span .ico { width: 11px; height: 11px; }
.ai-trace span.is-run { color: var(--amber); }
.ai-action { display: grid; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent); background: color-mix(in srgb, var(--amber) 8%, transparent); }
.ai-action b { font-size: var(--fs-sm); }
.ai-action small { color: var(--muted); font-size: var(--fs-xs); }
.ai-action__btns { display: flex; gap: 6px; }
.ai-action.is-done { border-color: color-mix(in srgb, var(--teal) 45%, transparent); background: color-mix(in srgb, var(--teal) 8%, transparent); }
.ai-suggest { display: grid; gap: 6px; }
.ai-suggest button { text-align: left; font: inherit; font-size: var(--fs-sm); padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer; }
.ai-suggest button:hover { background: var(--well); }
.ai-hello { display: grid; gap: 10px; padding: 6px 2px; }
.ai-hello h3 { margin: 0; font-size: var(--fs-xl); letter-spacing: -.01em; }
.ai-hello p { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.ai-foot { padding: 10px 12px 12px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.ai-input { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 18px; border: 1px solid var(--line-2); background: var(--surface-2); }
.ai-input textarea { flex: 1; min-height: 22px; max-height: 140px; resize: none; border: 0; outline: 0; background: transparent; font: inherit; font-size: var(--fs-md); color: var(--text); padding: 6px 0; }
.ai-input:focus-within { border-color: var(--text); }
.ai-foot__meta { display: flex; justify-content: space-between; color: var(--faint); font-size: 10.5px; padding: 0 6px; }
.ai-typing { display: inline-flex; gap: 3px; padding: 4px 0; }
.ai-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: ai-dot 1s infinite ease-in-out; }
.ai-typing i:nth-child(2) { animation-delay: .15s; } .ai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ai-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.dock__btn.is-ai { background: var(--coral); color: #fff; }

/* --- workspace modal and pop-outs -------------------------------------------------- */
.ws { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: max(16px, 2vw); }
.ws[hidden] { display: none; }
.ws__scrim { position: absolute; inset: 0; background: color-mix(in srgb, #000 42%, transparent); backdrop-filter: blur(6px); }
.ws__win { position: relative; width: min(1320px, 100%); height: min(900px, 100%); display: grid; grid-template-rows: auto auto 1fr; border-radius: 28px; background: var(--bg); border: 1px solid var(--rim); box-shadow: var(--shadow-pop); overflow: hidden; }
.ws__head { display: flex; align-items: center; gap: 14px; padding: 18px 22px 12px; }
.ws__head .grow { flex: 1; min-width: 0; }
.ws__head small { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.ws__head h2 { margin: 2px 0 0; font-size: var(--fs-3xl); letter-spacing: -.02em; }
.ws__pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.ws__tabs { display: flex; gap: 2px; padding: 0 18px 10px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.ws__tab { appearance: none; border: 0; background: transparent; font: inherit; font-weight: 600; font-size: var(--fs-sm); padding: 8px 14px; border-radius: 999px; color: var(--muted); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.ws__tab[aria-selected="true"] { background: var(--ink); color: var(--on-ink); }
.ws__tab b { font-size: 10px; opacity: .7; }
.ws__body { overflow-y: auto; padding: 18px 22px 28px; }
.ws__grid { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); align-items: start; }
.ws__grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 960px) { .ws__grid, .ws__grid--3 { grid-template-columns: minmax(0, 1fr); } .ws { padding: 0; } .ws__win { border-radius: 0; height: 100%; } }
.ws-sec { display: grid; gap: 10px; }
.ws-sec > h3 { margin: 0; font-size: var(--fs-md); display: flex; align-items: center; gap: 8px; }
.ws-steps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.ws-steps li { display: grid; gap: 4px; padding: 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-xs); }
.ws-steps li b { font-size: var(--fs-sm); }
.ws-steps li.is-done { border-color: color-mix(in srgb, var(--teal) 45%, transparent); }
.ws-steps li.is-now { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 8%, transparent); }
@media (max-width: 960px) { .ws-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ws-field { display: grid; gap: 4px; }
.ws-field > span { font-size: var(--fs-2xs); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ws-field textarea, .ws-field input, .ws-field select { font: inherit; font-size: var(--fs-sm); color: var(--text); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 9px 11px; resize: vertical; }
.ws-field textarea { min-height: 70px; }
.ws-why { margin: 0; padding: 0; list-style: none; counter-reset: why; display: grid; gap: 6px; }
.ws-why li { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: center; }
.ws-why li::before { counter-increment: why; content: counter(why); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--well); }
.ws-fish { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ws-fish div { padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-xs); }
.ws-fish b { display: block; font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.ws-timeline { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.ws-timeline li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: start; }
.ws-timeline .ico { width: 16px; height: 16px; }
.ws-timeline__dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--well); }
.ws-timeline small { color: var(--muted); font-size: var(--fs-2xs); display: block; }
.ws-bom { width: 100%; }
.ws-bom td .meter { min-width: 70px; }

.popout-btn .ico { width: 15px; height: 15px; }
.card.is-popped { position: fixed !important; inset: max(16px, 3vw); z-index: 75; overflow: auto; margin: 0 !important; grid-area: auto !important; box-shadow: var(--shadow-pop); background: var(--bg); }
.popout-scrim { position: fixed; inset: 0; z-index: 74; background: color-mix(in srgb, #000 40%, transparent); backdrop-filter: blur(6px); }
.popout-ph { border-radius: var(--r-card); border: 1.5px dashed var(--line-2); display: grid; place-items: center; color: var(--muted); font-size: var(--fs-sm); min-height: 120px; }
.popout-btn--float { position: absolute; top: 12px; right: 12px; z-index: 3; }
.card.is-popped .popout-btn--float { position: sticky; float: right; }
.cadv__bottom span { display: inline-flex; align-items: center; gap: 4px; }

/* --- plant network ------------------------------------------------------------ */
.plant-chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 10px; margin-right: 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; text-align: left; }
.plant-chip[hidden] { display: none; }
.plant-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.plant-chip[data-state="on"] i { background: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 25%, transparent); }
.plant-chip span { display: grid; line-height: 1.15; }
.plant-chip b { font-size: var(--fs-sm); font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plant-chip small { font-size: var(--fs-2xs); color: var(--muted); }
.plant-chip:hover { background: var(--well); }
@media (max-width: 760px) { .plant-chip span { display: none; } .plant-chip { padding: 0 14px; } }
.plant-dlg { border: 0; padding: 0; border-radius: var(--r-card, 20px); background: var(--surface); color: var(--ink); width: min(520px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgb(0 0 0 / 0.25); }
.plant-dlg::backdrop { background: rgb(10 12 16 / 0.42); backdrop-filter: blur(3px); }
.plant-dlg .mform { padding: 22px; }
.plant-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.plant-list li { display: flex; align-items: center; gap: 10px; }
.plant-list li span { display: grid; }
.plant-list small { color: var(--muted); font-size: var(--fs-xs); }

/* --- reference buses in the CAD viewer --------------------------------------------- */
.cadv__refnote { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 0; font-size: var(--fs-xs); color: var(--muted); }
.cadv__refnote .ico { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.cadv__lib--ref { margin-bottom: 14px; }
.cadv__lib--ref li { background: color-mix(in srgb, var(--iris, #6d5efc) 5%, transparent); }

/* --- phone layout fixes ----------------------------------------------------------------- */
/* A section pane never grows wider than the screen; a long segmented picker scrolls. */
.eng .eng-pane { min-width: 0; max-width: 100%; }
.eng .eng-pane > .toolbar { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.eng .eng-pane > .toolbar::-webkit-scrollbar { display: none; }
.eng .eng-pane > .toolbar .seg { min-width: max-content; }
@media (max-width: 520px) {
  /* Dashboard "on the floor": the progress bar takes its own line. */
  .floor__row { flex-wrap: wrap; }
  .floor__txt { flex: 1 1 0; min-width: 0; }
  .floor__prog { flex: 1 1 100%; width: auto; padding-left: 14px; }
}

/* --- topology workbench (Design › Topology) ------------------------------------ */
.topo-modes { display: flex; gap: 6px; margin: -4px 0 10px; }
.topo-hist { display: block; width: 100%; height: auto; }
.topo-hist text { font-size: 10px; fill: var(--muted); }
.topo-hist__goal { stroke: var(--teal); stroke-dasharray: 4 4; }
.topo-hist__goal-t { fill: var(--teal) !important; }
.topo-aside { align-self: start; position: sticky; top: 16px; }
.topo-verdict { padding: 18px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 10px; }
.topo-verdict small { color: var(--muted); letter-spacing: 0.08em; font-size: var(--fs-2xs); }
.topo-verdict h3 { margin: 0; font-size: 1.25rem; }
.topo-verdict ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: var(--fs-sm); }
.topo-verdict li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: start; }
.topo-verdict li .ico { width: 16px; height: 16px; color: var(--teal); margin-top: 2px; }
.topo-verdict p { margin: 0; font-size: var(--fs-xs); }
.topo-verdict .d-actions { flex-wrap: wrap; }
.topo-rule { display: grid; grid-template-columns: 18px 1fr; gap: 8px; margin: 0 0 12px; font-size: var(--fs-sm); color: var(--muted); }
.topo-rule .ico { width: 16px; height: 16px; color: var(--teal); margin-top: 2px; }
.topo-rule b { color: var(--ink); }
.topo-cands { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.topo-cand { display: grid; gap: 8px; align-content: start; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); min-width: 0; }
.topo-cand.is-chosen { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal) inset; }
.topo-cand figure { position: relative; margin: 0; border-radius: 12px; overflow: hidden; background: var(--well); aspect-ratio: 4 / 3; }
.topo-cand figure img { display: block; width: 100%; height: 100%; object-fit: contain; }
.topo-cand__badge { position: absolute; top: 8px; left: 8px; display: inline-flex; gap: 4px; align-items: center; padding: 3px 8px; border-radius: 999px; background: var(--teal); color: #fff; font-size: var(--fs-2xs); font-weight: 600; }
.topo-cand__badge .ico { width: 12px; height: 12px; }
.topo-cand header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.topo-cand dl { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 0; }
.topo-cand dt { font-size: var(--fs-2xs); color: var(--muted); }
.topo-cand dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.topo-cand dd.bad { color: var(--rose); }
.topo-cand small { color: var(--muted); font-size: var(--fs-xs); }
.topo-cand .d-actions { flex-wrap: wrap; }
.fx-curve > .topo-bars, .topo-bars { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; gap: 9px; margin: 16px 0; }
.topo-bars > div { display: grid; grid-template-columns: minmax(0, 120px) 1fr 34px; align-items: center; gap: 10px; font-size: var(--fs-2xs); color: var(--muted); }
.topo-bars > div > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topo-bars__track { display: block; height: 6px; border-radius: 9px; background: var(--well); overflow: hidden; }
.topo-bars__track i { display: block; height: 100%; border-radius: 9px; background: var(--teal); }
.topo-bars b { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.topo-verdict a.btn--primary { color: var(--on-primary); }
