/* Aurora Studio Web component styles (scoped by the .asw- prefix). */

:root {
    --asw-title-bar: #100F14;
    --asw-window: #16151B;
    --asw-canvas: #16151B;
    --asw-editor-surface: #131218;
    --asw-panel: #1A1921;
    --asw-panel-hi: #201E28;
    --asw-control: #211F29;
    --asw-hover: #2B2834;
    --asw-border: #322F3C;
    --asw-border-soft: rgba(236, 233, 242, .06);
    --asw-ink: #ECE9F2;
    --asw-ink-soft: #C9C3D3;
    --asw-muted: #8B8696;
    --asw-faint: #5A5666;
    --asw-signal: #9A6FE0;
    --asw-signal-dim: #6B4FA6;
    --asw-signal-soft: rgba(154, 111, 224, .16);
    --asw-synapse: #D9C6FF;
    --asw-ok: #5BC48A;
    --asw-warning: #E0A93F;
    --asw-error: #E2664E;
    --asw-input: #5FB2C4;
    --asw-processing: #CCA557;
    --asw-output: #D58C6B;
    --asw-other: #9097BE;
    --asw-black: #000;
    /* ANPR route view (R7-64): shares of runs, always with words next to the colour. The CPU blue stays clearly
       apart from the Video teal (--asw-input). */
    --asw-lane: var(--asw-ok);
    --asw-cpu: #4F7FE8;
    --asw-cpu-ink: #9DB7F5;
    --asw-lane-panel: var(--asw-panel-hi);
}

.asw-shell {
    position: relative;
    --asw-log-collapsed-height: 46px;
    display: grid;
    grid-template-columns: 320px 1fr 360px;
    grid-template-rows: 100%;
    height: calc(100dvh - var(--asw-shell-offset, 56px));
    background: var(--asw-window);
    color: var(--asw-ink);
    font-family: "Segoe UI", system-ui, sans-serif;
    overflow: hidden;
}

.asw-shell--diagnostics {
    padding-bottom: var(--asw-log-collapsed-height);
}

.asw-shell,
.asw-shell * {
    box-sizing: border-box;
}

.asw-shell--no-left {
    grid-template-columns: 1fr 360px;
}

.asw-shell--no-right {
    grid-template-columns: 320px 1fr;
}

.asw-shell--no-left.asw-shell--no-right {
    grid-template-columns: 1fr;
}

.asw-panel {
    overflow: auto;
    min-width: 0;
    min-height: 0;
    border-right: 1px solid var(--asw-border);
    background: var(--asw-panel);
    padding: 12px;
    scrollbar-color: var(--asw-faint) var(--asw-panel);
    scrollbar-width: thin;
}

.asw-panel--hidden {
    display: none !important;
}

.asw-panel--right {
    border-right: none;
    border-left: 1px solid var(--asw-border);
}

.asw-panel h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--asw-muted);
    margin: 4px 0 10px;
}

.asw-panel-section {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--asw-border);
}

.asw-panel-section:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
}

/* ---- device / cortex tree ---- */
.asw-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
}

.asw-item:hover {
    background: var(--asw-hover);
}

.asw-item.is-active {
    background: var(--asw-signal-soft);
    border-color: var(--asw-signal);
}

.asw-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
}

.asw-row:hover {
    background: var(--asw-hover);
}

.asw-row-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asw-row-main {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.asw-row-main > .asw-row-name {
    flex: 0 1 auto;
}

.asw-row-meta {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--asw-muted);
    font-size: 10px;
    line-height: 1.2;
}

.asw-twisty {
    width: 14px;
    flex: 0 0 14px;
    color: var(--asw-muted);
    text-align: center;
    font-size: 11px;
}

.asw-children {
    margin: 2px 0 8px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.asw-device-folder {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.asw-device-folder + .asw-device-folder {
    margin-top: 6px;
}

.asw-device-folder-children {
    margin-bottom: 10px;
}

.asw-row.asw-folder {
    font-size: 12px;
    font-weight: 600;
}

.asw-folder-online {
    cursor: default;
    background: rgba(91, 196, 138, .045);
}

.asw-folder-online:hover {
    background: rgba(91, 196, 138, .045);
}

.asw-muted {
    color: var(--asw-muted);
}

.asw-item .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--asw-faint);
    flex: 0 0 8px;
}

.asw-row .dot,
.asw-cortex-group-head .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--asw-faint);
    flex: 0 0 8px;
}

.asw-item .dot.online,
.asw-row .dot.online,
.asw-cortex-group-head .dot.online {
    background: var(--asw-ok);
    box-shadow: 0 0 10px rgba(91, 196, 138, .42);
}

.asw-cortex-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.asw-cortex-group + .asw-cortex-group {
    margin-top: 4px;
}

.asw-cortex-group-head {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 24px;
    padding: 2px 8px;
    color: var(--asw-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.asw-cortex-group-toggle {
    width: 100%;
    border: 0;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.asw-cortex-group-toggle:hover {
    background: rgba(236, 233, 242, .04);
    color: var(--asw-ink-soft);
}

.asw-count {
    margin-left: auto;
    min-width: 20px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(236, 233, 242, .07);
    color: var(--asw-ink-soft);
    font-size: 10px;
    letter-spacing: 0;
}

.asw-cortex-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 2px 0 8px;
}

.asw-cortex-section-head {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 22px;
    padding: 0 6px 0 2px;
    color: var(--asw-muted);
    font-size: 10px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.asw-cortex-section-head::before {
    content: "";
    width: 12px;
    height: 1px;
    background: var(--asw-border);
}

.asw-cortex {
    position: relative;
    min-height: 48px;
    align-items: flex-start;
    gap: 9px;
    margin-left: 2px;
    padding: 8px 9px;
    border-color: rgba(236, 233, 242, .07);
    background: rgba(19, 18, 24, .52);
    box-shadow: inset 3px 0 0 rgba(144, 151, 190, .4);
}

.asw-cortex:hover {
    background: rgba(43, 40, 52, .74);
    border-color: rgba(236, 233, 242, .14);
}

.asw-cortex.is-running {
    border-color: rgba(91, 196, 138, .2);
    background: rgba(91, 196, 138, .055);
    box-shadow: inset 3px 0 0 var(--asw-ok);
}

.asw-cortex.is-running:hover {
    background: rgba(91, 196, 138, .095);
}

.asw-cortex.is-active {
    border-color: var(--asw-signal);
    box-shadow: inset 3px 0 0 var(--asw-signal), 0 0 0 1px rgba(154, 111, 224, .28);
}

.asw-cortex-icon {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    border: 1px solid rgba(144, 151, 190, .28);
    background: rgba(144, 151, 190, .12);
}

.asw-cortex-icon span {
    position: relative;
    width: 13px;
    height: 13px;
    border: 1.5px solid var(--asw-ink-soft);
    border-radius: 4px;
}

.asw-cortex-icon span::before,
.asw-cortex-icon span::after {
    content: "";
    position: absolute;
    width: 5px;
    height: 1.5px;
    background: var(--asw-ink-soft);
    right: -5px;
}

.asw-cortex-icon span::before {
    top: 3px;
}

.asw-cortex-icon span::after {
    bottom: 3px;
}

.asw-cortex-icon.is-running {
    border-color: rgba(91, 196, 138, .38);
    background: rgba(91, 196, 138, .14);
    animation: asw-cortex-process-pulse 1.7s ease-in-out infinite;
}

.asw-cortex-icon.is-running span {
    border-color: var(--asw-ok);
}

.asw-cortex-icon.is-running span::before,
.asw-cortex-icon.is-running span::after {
    background: var(--asw-ok);
}

.asw-cortex-text {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.asw-cortex-title {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.asw-cortex-kind {
    flex: 0 0 auto;
    border: 1px solid rgba(236, 233, 242, .1);
    border-radius: 999px;
    padding: 1px 5px;
    color: var(--asw-muted);
    background: rgba(236, 233, 242, .045);
    font-size: 9px;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.asw-cortex-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 0;
}

.asw-cortex-state {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    line-height: 1.3;
}

.asw-cortex-state::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--asw-faint);
}

.asw-cortex-state.running {
    color: var(--asw-ok);
}

.asw-cortex-state.running::before {
    background: var(--asw-ok);
    box-shadow: 0 0 9px rgba(91, 196, 138, .55);
}

.asw-cortex-state.stopped {
    color: var(--asw-muted);
}

.asw-cortex-chip {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(224, 169, 63, .14);
    color: var(--asw-warning);
    font-size: 10px;
    line-height: 1;
}

.asw-cortex.is-renaming {
    align-items: flex-start;
}

.asw-cortex-rename {
    display: grid;
    gap: 7px;
    width: 100%;
    min-width: 0;
}

.asw-cortex-rename-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.asw-cortex-rename-input {
    width: 100%;
    min-width: 0;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 8px;
    background: #fff;
    color: #17121f;
    padding: 5px 8px;
    font: inherit;
}

.asw-cortex-rename-input:focus {
    outline: none;
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(154, 111, 224, .34);
}

.asw-cortex-rename-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    min-width: 0;
}

@keyframes asw-running-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(91, 196, 138, .38), 0 0 10px rgba(91, 196, 138, .42);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(91, 196, 138, 0), 0 0 14px rgba(91, 196, 138, .62);
    }
}

@keyframes asw-cortex-process-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(91, 196, 138, .28);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(91, 196, 138, 0);
    }
}

.asw-item .sub {
    color: var(--asw-muted);
    font-size: 11px;
}

.asw-nav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 4px 0 10px;
}

.asw-nav-head h3 {
    margin: 0;
}

.asw-nav-connect,
.asw-nav-disconnect {
    flex: 0 0 auto;
    min-height: 28px;
    border: 1px solid var(--asw-border);
    border-radius: 6px;
    background: transparent;
    color: var(--asw-ink-soft);
    padding: 0 9px;
    font-size: 12px;
    cursor: pointer;
}

.asw-nav-connect {
    border-color: rgba(91, 196, 138, .42);
    color: #d8f6e4;
    background: rgba(91, 196, 138, .12);
}

.asw-nav-connect:hover,
.asw-nav-disconnect:hover {
    background: var(--asw-hover);
    color: var(--asw-ink);
}

.asw-nav-connect:disabled,
.asw-nav-disconnect:disabled {
    cursor: default;
    opacity: .58;
}

.asw-nav-search {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px;
}

.asw-nav-search input {
    min-width: 0;
    flex: 1 1 auto;
    height: 30px;
    border: 1px solid var(--asw-border);
    border-radius: 6px;
    background: var(--asw-editor-surface);
    color: var(--asw-ink);
    padding: 5px 8px;
    font-size: 12px;
}

.asw-nav-search input::placeholder {
    color: var(--asw-muted);
}

.asw-nav-search input:focus {
    outline: none;
    border-color: var(--asw-signal);
    box-shadow: 0 0 0 1px rgba(154, 111, 224, .28);
}

.asw-nav-clear {
    flex: 0 0 auto;
    height: 30px;
    border: 1px solid var(--asw-border);
    border-radius: 6px;
    background: transparent;
    color: var(--asw-ink-soft);
    padding: 0 8px;
    font-size: 12px;
    cursor: pointer;
}

.asw-nav-clear:hover {
    background: var(--asw-hover);
    color: var(--asw-ink);
}

.asw-credential-prompt {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 8px 0 10px;
    padding: 10px;
    border: 1px solid rgba(224, 169, 63, .34);
    border-radius: 8px;
    background: rgba(224, 169, 63, .08);
}

.asw-credential-prompt label {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: var(--asw-muted);
    font-size: 11px;
}

.asw-credential-prompt input {
    height: 30px;
    min-width: 0;
    border: 1px solid var(--asw-border);
    border-radius: 6px;
    background: var(--asw-editor-surface);
    color: var(--asw-ink);
    padding: 5px 8px;
    font-size: 12px;
}

.asw-credential-prompt input:focus {
    outline: none;
    border-color: var(--asw-warning);
    box-shadow: 0 0 0 1px rgba(224, 169, 63, .22);
}

/* ---- diagram host ---- */
.asw-diagram-host {
    position: relative;
    height: 100%;
    width: 100%;
    background:
        radial-gradient(circle at 1px 1px, rgba(236, 233, 242, .08) 1px, transparent 0) 0 0 / 22px 22px,
        var(--asw-canvas);
    overflow: hidden;
}

.asw-diagram-toolbar {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 15;
    max-width: min(420px, calc(100% - 20px));
    pointer-events: none;
}

.asw-connect-strip {
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(236, 233, 242, .12);
    border-radius: 8px;
    background: rgba(16, 15, 20, .9);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .28);
    padding: 5px 6px 5px 9px;
    color: var(--asw-muted);
    font-size: 11px;
    pointer-events: auto;
}

.asw-connect-strip.is-active {
    border-color: rgba(95, 178, 196, .46);
    color: var(--asw-ink-soft);
}

.asw-connect-strip.is-error {
    border-color: rgba(226, 102, 78, .58);
    background: rgba(44, 25, 23, .94);
    color: #FFD6CF;
}

.asw-connect-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.asw-connect-copy span {
    min-width: 0;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asw-connect-copy small {
    min-width: 0;
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--asw-muted);
    font-size: 10px;
    line-height: 1.2;
}

.asw-connect-strip.is-error .asw-connect-copy small {
    color: #F1B1A5;
}

.asw-connect-strip select {
    height: 24px;
    min-width: 112px;
    border: 1px solid var(--asw-border);
    border-radius: 6px;
    background: var(--asw-editor-surface);
    color: var(--asw-ink);
    font-size: 11px;
}

.asw-diagram-host .diagram-link path {
    stroke: var(--asw-synapse);
    stroke-width: 1.7;
    cursor: pointer;
}

.asw-diagram-host .diagram-link:hover path {
    stroke: var(--asw-signal);
}

.asw-diagram-host .diagram-link.selected path,
.asw-diagram-host .diagram-link.asw-studio-selected-link path {
    stroke: var(--asw-signal);
    stroke-width: 3.2;
    filter: drop-shadow(0 0 6px rgba(154, 111, 224, .42));
}

/* A wire that carries one named message other than IMAGE (car left: THRESHOLD_LP_REMOVED) is dashed;
   its label is the message name. The wire runs on a route of its own, clear of the node cards
   (MessageWireLayout); the label stays on one line there, also with the rate behind the name. */
.asw-diagram-host .diagram-link.asw-message-link path:not(.asw-link-hit-target) {
    stroke-dasharray: 7 5;
}

.asw-diagram-host .diagram-link.asw-message-link div.default-link-label {
    white-space: nowrap;
}

/* "Add custom message": a wire for a message other than IMAGE, chosen in three steps (MessageWirePicker).
   A bar between the designer tools and the canvas while the button is on: the canvas gets lower, nothing
   of it is covered. */
.asw-icon-tab.asw-message-wire-button {
    padding: 0 9px;
    white-space: nowrap;
}

.asw-wire-picker {
    flex: 0 0 auto;
    margin: 6px 10px 2px;
    border: 1px solid rgba(217, 198, 255, .28);
    border-radius: 8px;
    background: rgba(16, 15, 20, .96);
    padding: 8px 11px 9px;
    color: var(--asw-ink);
    font-size: 12px;
}

.asw-wire-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.asw-wire-picker-steps {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
    max-width: 1100px;
}

.asw-wire-picker-steps label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    color: var(--asw-muted);
    font-size: 11px;
}

.asw-wire-picker-steps select {
    height: 28px;
    min-width: 0;
    border: 1px solid var(--asw-border);
    border-radius: 6px;
    background: var(--asw-editor-surface);
    color: var(--asw-ink);
    font-size: 12px;
}

.asw-wire-picker-summary {
    margin: 8px 0 0;
    color: var(--asw-synapse);
}

.asw-wire-picker-empty {
    margin: 0 0 4px;
    color: var(--asw-muted);
}

.asw-wire-picker-note {
    margin: 8px 0 0;
    color: var(--asw-muted);
    font-size: 11px;
    line-height: 1.35;
}

@media (max-width: 760px) {
    .asw-wire-picker-steps {
        grid-template-columns: 1fr;
    }
}

/* The design's warnings (crop name rule): a bar above the canvas, never a save blocker. */
.asw-design-warnings {
    flex: 0 0 auto;
    margin: 6px 10px 2px;
    border: 1px solid rgba(224, 169, 63, .35);
    border-radius: 8px;
    background: rgba(16, 15, 20, .96);
    padding: 6px 11px 7px;
    color: var(--asw-ink);
    font-size: 12px;
}

.asw-design-warnings-head {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 0;
    background: none;
    padding: 0;
    color: var(--asw-warning);
    font: inherit;
    cursor: pointer;
}

.asw-design-warnings-head span {
    color: var(--asw-muted);
    font-size: 11px;
}

.asw-design-warnings-list {
    max-height: 132px;
    overflow-y: auto;
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
}

.asw-design-warning {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    border: 0;
    border-radius: 6px;
    background: none;
    padding: 4px 6px;
    color: var(--asw-ink-soft);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.asw-design-warning:hover,
.asw-design-warning:focus-visible {
    background: var(--asw-hover);
}

.asw-design-warning strong {
    color: var(--asw-warning);
    font-weight: 600;
}

.asw-design-warnings-note {
    margin: 4px 0 0;
    color: var(--asw-muted);
    font-size: 11px;
}

.asw-diagram-host .diagram-link path.asw-link-hit-target,
.asw-diagram-host .diagram-link:hover path.asw-link-hit-target,
.asw-diagram-host .diagram-link.selected path.asw-link-hit-target {
    stroke: transparent;
    stroke-width: 14;
    fill: none;
    filter: none;
    pointer-events: stroke;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.asw-diagram-host .diagram-link div.default-link-label {
    min-width: 0;
    padding: 2px 6px;
    border: 1px solid rgba(217, 198, 255, .28);
    background: rgba(19, 18, 24, .88);
    color: var(--asw-synapse);
    border-radius: 6px;
    font-size: 10px;
}

.asw-diagram-host .diagram-link.selected div.default-link-label,
.asw-diagram-host .diagram-link.asw-studio-selected-link div.default-link-label {
    border-color: rgba(154, 111, 224, .72);
    background: rgba(40, 31, 57, .94);
    color: var(--asw-ink);
    box-shadow: 0 0 0 1px rgba(154, 111, 224, .3), 0 0 12px rgba(154, 111, 224, .28);
}

.asw-diagram-host .diagram-node.selected .asw-axon-card {
    border-color: var(--asw-signal);
    box-shadow: 0 0 0 1px rgba(154, 111, 224, .38), 0 14px 32px rgba(0, 0, 0, .42);
}

/* ---- axon node card ---- */
.asw-axon-card {
    position: relative;
    width: 200px;
    background: var(--asw-control);
    border: 1px solid var(--asw-border);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .36);
    overflow: visible;
    user-select: none;
    cursor: pointer;
}

.asw-axon-card.is-draft {
    border-style: dashed;
}

.asw-axon-card.is-selected,
.asw-axon-card:focus-visible {
    outline: none;
    border-color: var(--asw-signal);
    box-shadow: 0 0 0 1px rgba(154, 111, 224, .38), 0 14px 32px rgba(0, 0, 0, .42);
}

.asw-axon-card.is-connection-source {
    border-color: var(--asw-input);
    box-shadow: 0 0 0 1px rgba(95, 178, 196, .42), 0 14px 32px rgba(0, 0, 0, .42);
}

.asw-axon-card.is-connection-target {
    border-color: var(--asw-ok);
    box-shadow: 0 0 0 1px rgba(91, 196, 138, .38), 0 14px 32px rgba(0, 0, 0, .42);
}

.asw-axon-card.is-connection-route {
    border-color: var(--asw-synapse);
    box-shadow: 0 0 0 1px rgba(154, 111, 224, .42), 0 14px 32px rgba(0, 0, 0, .42);
}

.asw-axon-card.is-connection-invalid {
    border-color: rgba(226, 102, 78, .52);
}

.asw-axon-card .accent {
    height: 4px;
    width: 100%;
    border-radius: 7px 7px 0 0;
}

.asw-connect-port {
    position: absolute;
    top: 50%;
    z-index: 4;
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(236, 233, 242, .16);
    border-radius: 50%;
    color: var(--asw-ink-soft);
    background: rgba(19, 18, 24, .94);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .3);
    transform: translateY(-50%);
    cursor: copy;
    padding: 0;
}

.asw-connect-port::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 10px color-mix(in srgb, currentColor 52%, transparent);
}

.asw-connect-port.is-input {
    left: -11px;
    border-color: rgba(91, 196, 138, .42);
    color: var(--asw-ok);
    background:
        radial-gradient(circle at center, rgba(91, 196, 138, .18), rgba(19, 18, 24, .94) 62%),
        rgba(19, 18, 24, .94);
}

.asw-connect-port.is-output {
    right: -11px;
    border-color: rgba(95, 178, 196, .46);
    color: var(--asw-input);
    background:
        radial-gradient(circle at center, rgba(95, 178, 196, .18), rgba(19, 18, 24, .94) 62%),
        rgba(19, 18, 24, .94);
    cursor: grab;
}

.asw-connect-port.is-output:active {
    cursor: grabbing;
}

.asw-connect-port:hover,
.asw-connect-port:focus-visible {
    outline: none;
    background: var(--asw-hover);
    color: var(--asw-ink);
}

.asw-connect-port.is-input:hover,
.asw-connect-port.is-input:focus-visible {
    border-color: var(--asw-ok);
    box-shadow: 0 0 0 2px rgba(91, 196, 138, .2), 0 8px 18px rgba(0, 0, 0, .3);
}

.asw-connect-port.is-output:hover,
.asw-connect-port.is-output:focus-visible {
    border-color: var(--asw-input);
    box-shadow: 0 0 0 2px rgba(95, 178, 196, .2), 0 8px 18px rgba(0, 0, 0, .3);
}

.asw-axon-card.is-connection-source .asw-connect-port.is-output {
    border-color: var(--asw-input);
    color: var(--asw-input);
    box-shadow: 0 0 0 2px rgba(95, 178, 196, .24), 0 0 16px rgba(95, 178, 196, .38);
}

.asw-axon-card.is-connection-target .asw-connect-port.is-input {
    border-color: var(--asw-ok);
    color: var(--asw-ok);
    box-shadow: 0 0 0 2px rgba(91, 196, 138, .24), 0 0 16px rgba(91, 196, 138, .38);
}

.asw-axon-card.is-connection-route .asw-connect-port {
    border-color: var(--asw-synapse);
    color: var(--asw-synapse);
    box-shadow: 0 0 0 2px rgba(154, 111, 224, .22), 0 0 16px rgba(154, 111, 224, .34);
}

.asw-axon-card.is-connection-invalid .asw-connect-port.is-input {
    border-color: var(--asw-error);
    color: var(--asw-error);
    box-shadow: 0 0 0 2px rgba(226, 102, 78, .18), 0 0 16px rgba(226, 102, 78, .24);
}

.asw-axon-head {
    padding: 8px 10px 4px;
}

.asw-axon-name {
    display: block;
    font-weight: 600;
    font-size: 13px;
}

.asw-axon-type {
    display: block;
    font-size: 11px;
    color: var(--asw-muted);
}

.asw-axon-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 10px 10px;
}

.asw-chip {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--asw-hover);
    color: var(--asw-ink-soft);
}

.asw-chip.in {
    background: rgba(91, 196, 138, .16);
    color: var(--asw-ok);
}

.asw-chip.out {
    background: var(--asw-signal-soft);
    color: var(--asw-synapse);
}

.asw-chip.queue {
    background: rgba(224, 169, 63, .16);
    color: var(--asw-warning);
}

.asw-chip.loss {
    background: rgba(226, 102, 78, .16);
    color: var(--asw-error);
}

.asw-chip.route {
    background: var(--asw-signal-soft);
    color: var(--asw-synapse);
}

.asw-chip.design {
    background: rgba(95, 178, 196, .14);
    color: #A8DDE7;
}

/* ---- absolutely-positioned fallback canvas (lib-free) ---- */
.asw-graph-fallback {
    position: absolute;
    inset: 0;
}

.asw-graph-fallback .node {
    position: absolute;
}

.asw-graph-fallback svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.asw-graph-fallback .edge {
    stroke: var(--asw-synapse);
    stroke-width: 1.5;
    fill: none;
}

.asw-graph-fallback .edge-label {
    fill: var(--asw-muted);
    font-size: 10px;
}

/* ---- stream viewer ---- */
.asw-stream {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
    background: var(--asw-black);
    display: block;
}

.asw-stream-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    font-size: 11px;
    color: var(--asw-muted);
    margin-top: 6px;
}

.asw-stream-meta span {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* ---- misc ---- */
.asw-btn {
    background: var(--asw-signal);
    color: var(--asw-ink);
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 0 0 1px rgba(217, 198, 255, .18) inset;
}

.asw-btn:hover {
    background: var(--asw-signal-dim);
}

.asw-btn:disabled {
    opacity: .5;
    cursor: default;
}

.asw-status {
    font-size: 12px;
    color: var(--asw-muted);
    margin: 8px 0;
}

.asw-status.err {
    color: var(--asw-error);
}

.asw-status.ok {
    color: var(--asw-ok);
}

.asw-status.warn {
    color: var(--asw-warning);
}

.asw-empty {
    color: var(--asw-faint);
    font-size: 13px;
    padding: 20px;
    text-align: center;
}

/* ---- device details ---- */
.asw-device-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.asw-device-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    font-size: 14px;
}

.asw-device-guid {
    margin-top: 4px;
    color: var(--asw-faint);
    font-size: 11px;
    overflow-wrap: anywhere;
}

.asw-device-summary {
    display: none;
}

.asw-health {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.asw-health-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: var(--asw-muted);
}

.asw-health-row strong {
    color: var(--asw-ink);
    font-weight: 600;
}

.asw-meter {
    height: 6px;
    border-radius: 999px;
    background: var(--asw-editor-surface);
    overflow: hidden;
}

.asw-meter span {
    display: block;
    height: 100%;
    max-width: 100%;
    border-radius: inherit;
    background: var(--asw-ok);
}

.asw-kv {
    display: grid;
    grid-template-columns: minmax(82px, max-content) minmax(0, 1fr);
    gap: 5px 12px;
    margin: 12px 0 0;
    font-size: 12px;
}

.asw-kv dt {
    color: var(--asw-muted);
}

.asw-kv dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--asw-ink-soft);
}

.asw-log-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.asw-log-inline-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.asw-log-live-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border: 1px solid var(--asw-border);
    border-radius: 999px;
    background: var(--asw-control);
    color: var(--asw-muted);
    font-size: 11px;
}

.asw-log-live-chip.is-live {
    border-color: rgba(91, 196, 138, .42);
    background: rgba(91, 196, 138, .12);
    color: var(--asw-ok);
}

.asw-log-drawer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    height: min(var(--asw-log-drawer-height, 320px), calc(100% - 56px));
    min-height: 180px;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--asw-border);
    background: rgba(26, 25, 33, .98);
    box-shadow: 0 -18px 48px rgba(0, 0, 0, .42);
    transform: translateY(calc(100% - var(--asw-log-collapsed-height)));
    transition: transform .2s ease;
}

.asw-log-drawer.is-open {
    transform: translateY(0);
}

.asw-log-grip {
    position: absolute;
    top: 5px;
    left: 50%;
    width: 58px;
    height: 4px;
    border-radius: 999px;
    background: rgba(236, 233, 242, .24);
    transform: translateX(-50%);
}

.asw-log-drawer-head {
    min-height: var(--asw-log-collapsed-height);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px 7px;
    border-bottom: 1px solid var(--asw-border);
    background: var(--asw-title-bar);
}

.asw-log-title {
    min-width: 150px;
    max-width: 360px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: transparent;
    color: var(--asw-ink);
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.asw-log-toggle-icon {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(236, 233, 242, .16);
    border-radius: 6px;
    background: rgba(236, 233, 242, .06);
    color: var(--asw-ink-soft);
}

.asw-log-toggle-icon svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.asw-log-title:hover .asw-log-toggle-icon {
    border-color: rgba(154, 111, 224, .52);
    background: var(--asw-signal-soft);
    color: var(--asw-ink);
}

.asw-log-title-label {
    font-size: 13px;
    font-weight: 700;
}

.asw-log-title small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--asw-muted);
    font-size: 11px;
}

.asw-log-title small.err {
    color: var(--asw-error);
}

.asw-log-height {
    margin-left: auto;
    min-width: 178px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--asw-muted);
    font-size: 11px;
}

.asw-log-height input {
    width: 132px;
    accent-color: var(--asw-signal);
}

.asw-log-drawer:not(.is-open) .asw-log-height {
    opacity: .45;
    pointer-events: none;
}

.asw-log-drawer-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 10px 12px 12px;
}

.asw-log-drawer:not(.is-open) .asw-log-drawer-body {
    visibility: hidden;
}

.asw-log-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--asw-ink-soft);
    font-size: 12px;
}

.asw-log-preview {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
    margin: 0;
    padding: 8px;
    border: 1px solid var(--asw-border);
    border-radius: 6px;
    background: var(--asw-editor-surface);
    color: var(--asw-ink-soft);
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 11px;
    line-height: 1.35;
    white-space: pre-wrap;
    scrollbar-color: var(--asw-faint) var(--asw-editor-surface);
    scrollbar-width: thin;
}

.asw-log-stream {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--asw-border);
    border-radius: 6px;
    background: var(--asw-editor-surface);
    scrollbar-color: var(--asw-faint) var(--asw-editor-surface);
    scrollbar-width: thin;
}

.asw-log-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 11px;
    line-height: 1.35;
    color: var(--asw-ink-soft);
}

.asw-log-table th,
.asw-log-table td {
    padding: 5px 8px;
    border-bottom: 1px solid rgba(236, 233, 242, .06);
    vertical-align: top;
    text-align: left;
}

.asw-log-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #181620;
    color: var(--asw-muted);
    font-weight: 600;
}

.asw-log-table th:nth-child(1),
.asw-log-table td:nth-child(1) {
    width: 94px;
}

.asw-log-table th:nth-child(2),
.asw-log-table td:nth-child(2) {
    width: 72px;
}

.asw-log-table th:nth-child(3),
.asw-log-table td:nth-child(3) {
    width: 229px;
}

.asw-log-table--live-studio th:nth-child(3),
.asw-log-table--live-studio td:nth-child(3) {
    width: 249px;
}

.asw-log-table td {
    overflow-wrap: anywhere;
}

.asw-log-row.is-trace {
    color: var(--asw-muted);
}

.asw-log-row.is-debug {
    color: #9FB5D9;
}

.asw-log-row.is-info {
    color: var(--asw-ink-soft);
}

.asw-log-row.is-warn {
    color: #F1C982;
}

.asw-log-row.is-error {
    color: #FF9B86;
}

.asw-log-row.is-fatal {
    color: #FFC5BB;
    background: rgba(226, 102, 78, .12);
}

.asw-log-row.is-system {
    color: #95D9E6;
}

.asw-log-row td:nth-child(2) span {
    font-weight: 700;
}

.asw-log-empty {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    place-items: center;
    border: 1px dashed var(--asw-border);
    border-radius: 6px;
    background: rgba(19, 18, 24, .74);
    color: var(--asw-muted);
    font-size: 12px;
}

/* ---- node icon ---- */
.asw-axon-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
    flex: 0 0 auto;
}

.asw-axon-cardtop {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px 4px;
}

.asw-axon-cardtop .asw-axon-head {
    padding: 0;
    min-width: 0;
}

.asw-axon-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- inspector + settings editors ---- */
.asw-inspector {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 auto;
    min-height: 0;
}

.asw-inspector-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.asw-inspector-head .title {
    font-size: 15px;
    font-weight: 600;
}

.asw-inspector-head .sub {
    font-size: 11px;
    color: var(--asw-muted);
}

.asw-inspector-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--asw-border);
}

.asw-inspector-panel {
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: auto;
    scrollbar-color: var(--asw-faint) var(--asw-panel);
    scrollbar-width: thin;
}

.asw-inspector-panel--editor {
    gap: 0;
    overflow: hidden;
}

.asw-inspector-editor-scroll {
    min-height: 0;
    flex: 1 1 auto;
    overflow: auto;
    padding: 0 4px 14px 0;
    scrollbar-color: var(--asw-faint) var(--asw-panel);
    scrollbar-width: thin;
}

.asw-telemetry-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.asw-telemetry-grid > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    border: 1px solid var(--asw-border);
    border-radius: 6px;
    background: var(--asw-editor-surface);
}

.asw-telemetry-grid span {
    color: var(--asw-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.asw-telemetry-grid strong {
    color: var(--asw-ink);
    font-size: 17px;
}

.asw-flow-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.asw-flow-section {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.asw-flow-link {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 8px;
    border: 1px solid var(--asw-border);
    border-radius: 6px;
    background: var(--asw-editor-surface);
    font-size: 12px;
}

.asw-flow-link strong,
.asw-flow-link span,
.asw-flow-link small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asw-flow-link strong {
    color: var(--asw-ink-soft);
    font-weight: 600;
}

.asw-flow-link span {
    color: var(--asw-synapse);
}

.asw-flow-link small {
    color: var(--asw-muted);
}

.asw-flow-empty {
    min-height: 52px;
    display: grid;
    place-items: center;
    border: 1px dashed var(--asw-border);
    border-radius: 6px;
    color: var(--asw-muted);
    font-size: 12px;
}

.asw-route-rate-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.asw-editor {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.asw-tab-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.asw-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.asw-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
}

.asw-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
    min-width: 0;
}

.asw-field-label {
    color: var(--asw-muted);
}

.asw-field.is-invalid .asw-field-label {
    color: #F1B1A5;
}

.asw-field input,
.asw-field select,
.asw-editor-toolbar select,
.asw-editor-toolbar input {
    background: var(--asw-editor-surface);
    color: var(--asw-ink);
    border: 1px solid var(--asw-border);
    border-radius: 6px;
    padding: 5px 7px;
    font-size: 12px;
    width: 100%;
}

.asw-field.is-invalid input,
.asw-field.is-invalid select {
    border-color: rgba(226, 102, 78, .68);
    box-shadow: 0 0 0 1px rgba(226, 102, 78, .18);
}

.asw-field-error {
    color: #F1B1A5;
    font-size: 11px;
    line-height: 1.25;
}

.asw-field input:focus,
.asw-field select:focus,
.asw-editor-toolbar select:focus,
.asw-editor-toolbar input:focus,
.asw-editor textarea:focus {
    outline: none;
    border-color: var(--asw-signal);
    box-shadow: 0 0 0 1px rgba(154, 111, 224, .28);
}

/* A viewer's NODE settings (and any field that cannot change now): shown as values, plainly not editable. */
.asw-field input:disabled,
.asw-field select:disabled,
.asw-editor textarea:disabled,
.asw-editor-toolbar select:disabled,
.asw-editor-toolbar input:disabled {
    background: transparent;
    border-style: dashed;
    opacity: .85;
    cursor: default;
}

.asw-editor input[type="checkbox"]:disabled,
.asw-editor input[type="radio"]:disabled {
    cursor: default;
}

.asw-status.asw-view-only {
    color: var(--asw-muted);
}

.asw-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--asw-ink-soft);
}

.asw-canvas {
    position: relative;
    border: 1px solid var(--asw-border);
    border-radius: 6px;
    overflow: hidden;
    cursor: crosshair;
    max-width: 100%;
}

.asw-canvas img {
    display: block;
}

.asw-crop-editor {
    gap: 14px;
}

.asw-crop-toolbar .asw-field {
    min-width: 160px;
}

.asw-ipcamera-editor .asw-crop-toolbar {
    align-items: flex-end;
}

.asw-source-crop-toolbar {
    gap: 8px;
}

.asw-source-crop-enable {
    min-height: 32px;
    padding: 5px 8px;
    border: 1px solid var(--asw-border);
    border-radius: 6px;
    background: var(--asw-editor-surface);
    white-space: nowrap;
}

.asw-source-crop-enable:has(input:checked) {
    border-color: rgba(91, 196, 138, .38);
    background: rgba(91, 196, 138, .08);
}

.asw-crop-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
    gap: 14px;
    align-items: start;
}

.asw-crop-preview {
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.asw-crop-canvas {
    background: #09090d;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .02);
    touch-action: none;
    user-select: none;
}

.asw-crop-canvas > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
}

.asw-source-crop-canvas {
    max-width: 100%;
    background:
        linear-gradient(45deg, rgba(255,255,255,.035) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,.035) 25%, transparent 25%),
        #09090d;
    background-size: 24px 24px;
}

.asw-source-crop-blank {
    position: absolute;
    inset: 0;
    min-width: 0;
    display: grid;
    place-items: center;
    padding: 12px;
    color: var(--asw-muted);
    font-size: 12px;
    text-align: center;
}

.asw-source-crop-blank span {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.asw-crop-canvas.is-rect {
    cursor: crosshair;
}

.asw-crop-canvas.is-poly {
    cursor: copy;
}

.asw-crop-canvas.is-poly .asw-overlay {
    pointer-events: all;
}

.asw-poly-shape {
    pointer-events: none;
    vector-effect: non-scaling-stroke;
}

.asw-poly-point {
    cursor: grab;
    pointer-events: all;
}

.asw-poly-point:active {
    cursor: grabbing;
}

.asw-poly-hit {
    fill: rgba(154, 111, 224, .001);
    stroke: transparent;
    pointer-events: all;
}

.asw-poly-handle {
    fill: var(--asw-signal);
    stroke: rgba(255, 255, 255, .92);
    stroke-width: 2px;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .45));
    pointer-events: all;
}

.asw-poly-handle.is-selected {
    fill: #F0B54D;
    stroke: #FFF7D7;
}

.asw-crop-placeholder {
    min-height: 360px;
    width: 100%;
    display: grid;
    place-items: center;
    border: 1px dashed var(--asw-border);
    border-radius: 6px;
    background:
        linear-gradient(45deg, rgba(255,255,255,.025) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,.025) 25%, transparent 25%),
        var(--asw-editor-surface);
    background-size: 22px 22px;
    color: var(--asw-muted);
    font-size: 12px;
}

.asw-crop-sidebar {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-left: 1px solid var(--asw-border);
    padding-left: 14px;
}

.asw-crop-form {
    grid-template-columns: 1fr 1fr;
}

.asw-crop-kv {
    margin-top: 4px;
}

.asw-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.asw-divider {
    height: 1px;
    background: var(--asw-border);
    margin: 4px 0;
}

.asw-saverow {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.asw-inspector-actions {
    flex: 0 0 auto;
    padding: 12px 0 0;
    border-top: 1px solid var(--asw-border);
    background: var(--asw-panel);
    box-shadow: 0 -10px 22px rgba(0, 0, 0, .16);
}

.asw-node-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin: 8px 0 10px;
}

.asw-node-summary-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
}

.asw-node-summary-type {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    color: var(--asw-muted);
}

.asw-axon-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(10, 9, 13, .64);
}

.asw-axon-modal {
    width: min(1120px, calc(100vw - 48px));
    max-height: min(820px, calc(100dvh - 48px));
    min-height: min(560px, calc(100dvh - 48px));
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--asw-border);
    border-radius: 8px;
    background: var(--asw-panel);
    color: var(--asw-ink);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
}

.asw-axon-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--asw-border);
    background: var(--asw-title-bar);
}

.asw-axon-modal-kicker {
    color: var(--asw-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.asw-axon-modal-name {
    margin-top: 2px;
    font-size: 15px;
    font-weight: 600;
}

.asw-modal-close {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--asw-border);
    border-radius: 6px;
    background: transparent;
    color: var(--asw-ink-soft);
    cursor: pointer;
    font-size: 14px;
}

.asw-modal-close:hover {
    background: var(--asw-hover);
    color: var(--asw-ink);
}

.asw-unsaved-prompt {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(7, 7, 10, .58);
    backdrop-filter: blur(2px);
}

.asw-unsaved-box {
    width: min(360px, 100%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(224, 169, 63, .42);
    border-radius: 8px;
    background: var(--asw-panel);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .42);
}

.asw-unsaved-box strong {
    color: var(--asw-ink);
    font-size: 13px;
}

.asw-unsaved-box p {
    margin: 0;
    color: var(--asw-ink-soft);
    font-size: 12px;
}

.asw-unsaved-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.asw-confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(7, 7, 10, .62);
    backdrop-filter: blur(4px);
}

.asw-confirm-dialog {
    width: min(520px, calc(100vw - 32px));
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(95, 178, 196, .28);
    border-radius: 8px;
    background: var(--asw-panel);
    color: var(--asw-ink);
    box-shadow: 0 24px 64px rgba(0, 0, 0, .48);
}

.asw-confirm-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(95, 178, 196, .16);
    color: #BDEEF6;
    font-size: 17px;
    font-weight: 700;
    box-shadow: 0 0 0 1px rgba(95, 178, 196, .28) inset;
}

.asw-confirm-dialog.is-warning {
    border-color: rgba(224, 169, 63, .38);
}

.asw-confirm-dialog.is-warning .asw-confirm-icon {
    background: rgba(224, 169, 63, .16);
    color: #F4D391;
    box-shadow: 0 0 0 1px rgba(224, 169, 63, .32) inset;
}

.asw-confirm-dialog.is-danger {
    border-color: rgba(226, 102, 78, .42);
}

.asw-confirm-dialog.is-danger .asw-confirm-icon {
    background: rgba(226, 102, 78, .16);
    color: #F1B1A5;
    box-shadow: 0 0 0 1px rgba(226, 102, 78, .34) inset;
}

.asw-confirm-dialog.is-save .asw-confirm-icon {
    background: rgba(91, 196, 138, .15);
    color: #BDEED0;
    box-shadow: 0 0 0 1px rgba(91, 196, 138, .3) inset;
}

.asw-confirm-dialog.is-run .asw-confirm-icon {
    background: rgba(119, 144, 255, .15);
    color: #CAD2FF;
    box-shadow: 0 0 0 1px rgba(119, 144, 255, .3) inset;
}

.asw-confirm-content {
    min-width: 0;
}

.asw-confirm-kicker {
    color: var(--asw-muted);
    font-size: 11px;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.asw-confirm-content h2 {
    margin: 4px 0 8px;
    color: var(--asw-ink);
    font-size: 18px;
    line-height: 1.2;
}

.asw-confirm-content p {
    margin: 0;
    color: var(--asw-ink-soft);
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.asw-confirm-content .asw-confirm-detail {
    margin-top: 8px;
    color: var(--asw-muted);
    font-size: 12px;
}

.asw-confirm-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.asw-btn-danger {
    background: rgba(226, 102, 78, .88);
    box-shadow: 0 0 0 1px rgba(255, 211, 204, .18) inset;
}

.asw-btn-danger:hover {
    background: rgba(226, 102, 78, 1);
}

@media (max-width: 520px) {
    .asw-confirm-dialog {
        grid-template-columns: 1fr;
    }

    .asw-confirm-actions {
        justify-content: stretch;
    }

    .asw-confirm-actions > button {
        flex: 1 1 auto;
    }
}

.asw-axon-modal-body {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 16px;
    scrollbar-color: var(--asw-faint) var(--asw-panel);
    scrollbar-width: thin;
}

.asw-axon-modal-body:has(.asw-inspector-actions) {
    padding-bottom: 0;
}

.asw-axon-modal-body .asw-inspector-actions {
    margin: 0 -16px;
    padding: 12px 16px 16px;
}

.asw-axon-modal-body .asw-form {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.asw-axon-modal-body .asw-canvas img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 980px) {
    .asw-telemetry-grid,
    .asw-flow-grid {
        grid-template-columns: 1fr;
    }

    .asw-crop-workspace {
        grid-template-columns: 1fr;
    }

    .asw-crop-sidebar {
        border-left: 0;
        border-top: 1px solid var(--asw-border);
        padding-left: 0;
        padding-top: 12px;
    }
}

/* ---- per-node editor sections ---- */
.asw-section {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.asw-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--asw-muted);
    margin: 12px 0 2px;
}

.asw-subgroup-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--asw-ink-soft);
    margin: 16px 0 2px;
}

.asw-subgroup-title.asw-muted {
    font-size: 11px;
    font-weight: 400;
    color: var(--asw-muted);
    margin-top: 12px;
}

.asw-field--full {
    grid-column: 1 / -1;
}

.asw-editor textarea {
    background: var(--asw-editor-surface);
    color: var(--asw-ink);
    border: 1px solid var(--asw-border);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
    width: 100%;
    resize: vertical;
    font-family: inherit;
}

.asw-section input[type=number] {
    background: var(--asw-editor-surface);
    color: var(--asw-ink);
    border: 1px solid var(--asw-border);
    border-radius: 6px;
    padding: 5px 7px;
    font-size: 12px;
    max-width: 160px;
}

.asw-section input:disabled {
    opacity: .45;
}

.asw-anpr-threshold-editor .asw-section-title {
    margin-top: 14px;
}

.asw-lpr-modules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
}

.asw-lpr-module {
    border: 1px solid var(--asw-border);
    border-radius: 6px;
    background: var(--asw-editor-surface);
    padding: 10px;
    min-width: 0;
}

.asw-lpr-module-head {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 0;
}

.asw-lpr-module-head strong {
    display: block;
    font-size: 13px;
}

.asw-lpr-module-head small {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: var(--asw-muted);
}

.asw-lpr-module-mark {
    width: 36px;
    height: 26px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 700;
    color: var(--asw-ink);
    background: rgba(95, 178, 196, .16);
    box-shadow: 0 0 0 1px rgba(95, 178, 196, .28) inset;
}

.asw-lpr-module-mark.is-region {
    background: #1d4fa3;
    color: #f4d35e;
    box-shadow: 0 0 0 1px rgba(244, 211, 94, .32) inset;
}

.asw-lpr-country-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 10px;
}

.asw-lpr-country {
    font-size: 10px;
    line-height: 1;
    padding: 4px 5px;
    border-radius: 4px;
    color: var(--asw-ink-soft);
    background: var(--asw-hover);
}

.asw-threshold-list-panel {
    gap: 8px;
}

.asw-threshold-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--asw-border);
    border-radius: 6px;
}

.asw-threshold-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
    font-size: 12px;
}

.asw-threshold-table th,
.asw-threshold-table td {
    padding: 7px 8px;
    text-align: left;
    border-bottom: 1px solid var(--asw-border);
    white-space: nowrap;
}

.asw-threshold-table th {
    color: var(--asw-muted);
    font-weight: 600;
    background: rgba(255, 255, 255, .03);
}

.asw-threshold-table tbody tr:last-child td {
    border-bottom: none;
}

.asw-threshold-table tbody tr.is-passed {
    background: rgba(91, 196, 138, .08);
}

.asw-threshold-empty {
    border: 1px dashed var(--asw-border);
    border-radius: 6px;
    color: var(--asw-muted);
    font-size: 12px;
    padding: 12px;
}

/* ---- center: design/view modes ---- */
.asw-center {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

.asw-modebar {
    min-height: 40px;
    height: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    align-content: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--asw-title-bar);
    border-bottom: 1px solid var(--asw-border);
}

.asw-modebar-layout {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-left: 6px;
    border-left: 1px solid var(--asw-border);
}

.asw-modebar-tools {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
    padding-left: 6px;
    border-left: 1px solid var(--asw-border);
}

.asw-modebar-title {
    flex: 1 1 180px;
    min-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--asw-muted);
    font-size: 12px;
}

.asw-modebar-actions {
    margin-left: auto;
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.asw-workmode-chip {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--asw-border);
    border-radius: 999px;
    padding: 2px 9px;
    color: var(--asw-ink-soft);
    background: rgba(236, 233, 242, .045);
    font-size: 11px;
    white-space: nowrap;
}

.asw-workmode-chip.is-live,
.asw-cortex-mode.is-live {
    border-color: rgba(91, 196, 138, .38);
    background: rgba(91, 196, 138, .1);
}

.asw-workmode-chip.is-design,
.asw-cortex-mode.is-design {
    border-color: rgba(95, 178, 196, .38);
    background: rgba(95, 178, 196, .1);
}

.asw-workmode-chip.is-readonly,
.asw-cortex-mode.is-readonly {
    border-color: rgba(224, 169, 63, .34);
    background: rgba(224, 169, 63, .08);
}

.asw-modebar-notice {
    min-width: 0;
    max-width: min(520px, 44vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--asw-warning);
    font-size: 11px;
}

.asw-modebar-notice.err {
    color: var(--asw-error);
}

.asw-design-toast {
    position: absolute;
    z-index: 30;
    top: 52px;
    right: 16px;
    max-width: min(460px, calc(100% - 32px));
    border: 1px solid rgba(91, 196, 138, .34);
    border-radius: 8px;
    background: rgba(21, 31, 27, .96);
    color: var(--asw-ink);
    padding: 9px 11px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .34);
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
    pointer-events: none;
}

.asw-design-toast.err {
    border-color: rgba(226, 102, 78, .48);
    background: rgba(44, 25, 23, .96);
    color: #FFD6CF;
}

.asw-dirty-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border: 1px solid rgba(224, 169, 63, .48);
    border-radius: 999px;
    background: rgba(224, 169, 63, .12);
    color: var(--asw-warning);
    font-size: 11px;
}

.asw-center-content {
    flex: 1;
    min-height: 0;
    position: relative;
}

.asw-center-content > .asw-diagram-host {
    height: 100%;
}

.asw-designer-shell {
    height: 100%;
    min-height: 0;
}

.asw-designer-shell.is-dirty {
    box-shadow: inset 0 0 0 1px rgba(224, 169, 63, .4);
}

.asw-designer-shell.has-toolbox {
    display: grid;
    grid-template-columns: minmax(236px, 282px) minmax(0, 1fr);
}

.asw-designer-shell > .asw-diagram-host {
    min-width: 0;
}

.asw-simple-view {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: auto;
    padding: 12px;
    background:
        radial-gradient(circle at 1px 1px, rgba(236, 233, 242, .05) 1px, transparent 0) 0 0 / 22px 22px,
        var(--asw-canvas);
    scrollbar-color: var(--asw-faint) var(--asw-canvas);
    scrollbar-width: thin;
}

.asw-simple-head {
    position: sticky;
    top: 0;
    z-index: 2;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--asw-border);
    border-radius: 8px;
    background: rgba(16, 15, 20, .96);
    padding: 9px 11px;
    box-shadow: 0 12px 26px rgba(0, 0, 0, .2);
}

.asw-simple-head > div {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.asw-simple-head span:not(.asw-chip) {
    color: var(--asw-muted);
    font-size: 11px;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.asw-simple-head strong {
    color: var(--asw-ink);
    font-size: 16px;
}

.asw-simple-groups {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.asw-simple-group {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.asw-simple-group-title {
    min-height: 24px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--asw-muted);
    font-size: 11px;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.asw-simple-group-title::before {
    content: "";
    width: 18px;
    height: 1px;
    background: var(--asw-border);
}

.asw-simple-group-title small {
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(236, 233, 242, .07);
    color: var(--asw-ink-soft);
    font-size: 10px;
    letter-spacing: 0;
}

.asw-simple-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.asw-simple-node {
    --asw-node-accent: var(--asw-other);
    width: 100%;
    min-height: 52px;
    display: grid;
    grid-template-columns: 4px 34px minmax(180px, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(236, 233, 242, .08);
    border-radius: 8px;
    background: rgba(19, 18, 24, .72);
    color: var(--asw-ink);
    padding: 8px 10px 8px 0;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.asw-simple-node:hover,
.asw-simple-node:focus-visible {
    outline: none;
    border-color: color-mix(in srgb, var(--asw-node-accent) 55%, var(--asw-border));
    background: color-mix(in srgb, var(--asw-node-accent) 9%, rgba(19, 18, 24, .82));
}

.asw-simple-node.is-selected {
    border-color: color-mix(in srgb, var(--asw-node-accent) 72%, var(--asw-border));
    background: color-mix(in srgb, var(--asw-node-accent) 13%, rgba(19, 18, 24, .86));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--asw-node-accent) 24%, transparent);
}

.asw-simple-node-accent {
    align-self: stretch;
    width: 4px;
    border-radius: 8px 0 0 8px;
    background: var(--asw-node-accent);
}

.asw-simple-node .asw-axon-icon {
    width: 26px;
    height: 26px;
}

.asw-simple-node-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.asw-simple-node-main strong,
.asw-simple-node-main small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asw-simple-node-main strong {
    color: var(--asw-ink);
    font-size: 15.5px;
    font-weight: 720;
    line-height: 1.15;
}

.asw-simple-node-main small {
    color: var(--asw-muted);
    font-size: 11.5px;
    line-height: 1.2;
}

.asw-simple-node-metrics {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.asw-simple-node-metrics span {
    min-height: 22px;
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(236, 233, 242, .09);
    border-radius: 999px;
    background: rgba(236, 233, 242, .045);
    color: var(--asw-ink-soft);
    padding: 2px 7px;
    font-size: 10px;
    white-space: nowrap;
}

.asw-simple-node-action {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid color-mix(in srgb, var(--asw-node-accent) 48%, var(--asw-border));
    border-radius: 6px;
    background: color-mix(in srgb, var(--asw-node-accent) 12%, transparent);
    color: var(--asw-ink);
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
}

.asw-simple-empty {
    min-height: 160px;
    display: grid;
    place-items: center;
    border: 1px dashed var(--asw-border);
    border-radius: 8px;
    background: rgba(19, 18, 24, .72);
    color: var(--asw-muted);
    font-size: 13px;
}

.asw-toolbox {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-right: 1px solid var(--asw-border);
    background: linear-gradient(180deg, rgba(32, 30, 40, .92), rgba(26, 25, 33, .96));
    padding: 12px;
    overflow: hidden;
}

.asw-toolbox-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.asw-toolbox-head strong {
    font-size: 14px;
}

.asw-toolbox-kicker {
    margin-bottom: 2px;
    color: var(--asw-muted);
    font-size: 10px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.asw-toolbox-search {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--asw-muted);
    font-size: 11px;
}

.asw-toolbox-search input {
    width: 100%;
    height: 32px;
    border: 1px solid var(--asw-border);
    border-radius: 6px;
    background: var(--asw-editor-surface);
    color: var(--asw-ink);
    padding: 6px 8px;
    font-size: 12px;
}

.asw-toolbox-search input:focus {
    outline: none;
    border-color: var(--asw-signal);
    box-shadow: 0 0 0 1px rgba(154, 111, 224, .28);
}

.asw-toolbox-list {
    min-height: 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 2px;
    scrollbar-color: var(--asw-faint) transparent;
    scrollbar-width: thin;
}

.asw-toolbox-empty {
    border: 1px dashed var(--asw-border);
    border-radius: 6px;
    background: rgba(19, 18, 24, .5);
    color: var(--asw-muted);
    padding: 12px;
    font-size: 12px;
}

.asw-toolbox-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.asw-toolbox-group-head {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--asw-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.asw-toolbox-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--asw-toolbox-accent);
    box-shadow: 0 0 10px color-mix(in srgb, var(--asw-toolbox-accent) 42%, transparent);
}

.asw-toolbox-item {
    --asw-toolbox-accent: var(--asw-other);
    width: 100%;
    min-height: 54px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--asw-border);
    border-left-color: var(--asw-toolbox-accent);
    border-radius: 8px;
    background: var(--asw-control);
    color: var(--asw-ink);
    cursor: pointer;
    padding: 7px;
    text-align: left;
    font: inherit;
}

.asw-toolbox-item:hover {
    background: var(--asw-hover);
    border-color: color-mix(in srgb, var(--asw-toolbox-accent) 54%, var(--asw-border));
}

.asw-toolbox-item:focus-visible {
    outline: none;
    border-color: var(--asw-toolbox-accent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--asw-toolbox-accent) 46%, transparent);
}

.asw-toolbox-item.is-unknown {
    opacity: .82;
}

.asw-toolbox-icon {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: color-mix(in srgb, var(--asw-toolbox-accent) 18%, transparent);
    color: var(--asw-ink);
    font-size: 12px;
    font-weight: 700;
}

.asw-toolbox-icon img {
    width: 18px;
    height: 18px;
}

.asw-toolbox-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.asw-toolbox-text strong,
.asw-toolbox-text small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asw-toolbox-text strong {
    font-size: 12px;
    font-weight: 600;
}

.asw-toolbox-text small {
    color: var(--asw-muted);
    font-size: 10px;
}

.asw-toolbox-add {
    position: relative;
    width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    border-radius: 6px;
    border: 1px solid color-mix(in srgb, var(--asw-toolbox-accent) 46%, var(--asw-border));
    background: color-mix(in srgb, var(--asw-toolbox-accent) 10%, transparent);
    color: color-mix(in srgb, var(--asw-toolbox-accent) 72%, var(--asw-ink-soft));
    opacity: .86;
}

.asw-toolbox-add::before,
.asw-toolbox-add::after {
    content: "";
    position: absolute;
    width: 9px;
    height: 1.5px;
    border-radius: 2px;
    background: currentColor;
}

.asw-toolbox-add::after {
    transform: rotate(90deg);
}

.asw-toolbox-item:hover .asw-toolbox-add,
.asw-toolbox-item:focus-visible .asw-toolbox-add {
    border-color: color-mix(in srgb, var(--asw-toolbox-accent) 70%, var(--asw-border));
    background: color-mix(in srgb, var(--asw-toolbox-accent) 18%, transparent);
    color: var(--asw-ink);
    opacity: 1;
}

.asw-design-node-tools {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--asw-border);
}

.asw-design-link-tools {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--asw-border);
}

.asw-link-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin: 8px 0 10px;
}

.asw-link-summary > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    border: 1px solid rgba(217, 198, 255, .12);
    border-radius: 6px;
    background: rgba(217, 198, 255, .055);
    padding: 7px 8px;
}

.asw-link-summary span {
    color: var(--asw-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.asw-link-summary strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--asw-ink);
    font-size: 12px;
}

.asw-design-tool-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--asw-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.asw-canvas-flow-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid rgba(95, 178, 196, .24);
    border-radius: 8px;
    background: rgba(95, 178, 196, .075);
    padding: 8px;
}

.asw-canvas-flow-card > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.asw-canvas-flow-card strong {
    color: var(--asw-ink);
    font-size: 12px;
}

.asw-canvas-flow-card span:not(.asw-chip) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--asw-muted);
    font-size: 11px;
}

.asw-subscription-builder,
.asw-advanced-editor,
.asw-advanced-fields {
    border: 1px solid rgba(236, 233, 242, .08);
    border-radius: 8px;
    background: rgba(19, 18, 24, .38);
}

.asw-subscription-builder {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-color: rgba(95, 178, 196, .24);
    background: rgba(95, 178, 196, .06);
    padding: 8px;
}

.asw-advanced-editor summary,
.asw-advanced-fields summary {
    min-height: 32px;
    display: flex;
    align-items: center;
    padding: 7px 9px;
    color: var(--asw-ink-soft);
    font-size: 12px;
    cursor: pointer;
}

.asw-advanced-editor[open] summary,
.asw-advanced-fields[open] summary {
    border-bottom: 1px solid var(--asw-border);
}

.asw-advanced-editor .asw-design-link-grid,
.asw-advanced-editor .asw-design-node-actions,
.asw-advanced-editor .asw-status {
    margin: 8px;
}

.asw-advanced-fields {
    grid-column: 1 / -1;
    margin-top: 10px;
}

.asw-advanced-fields .asw-form {
    padding: 8px;
}

.asw-design-link-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(86px, .46fr);
    gap: 7px;
}

.asw-design-node-tools label,
.asw-design-link-tools label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--asw-muted);
    font-size: 11px;
}

.asw-design-node-tools input,
.asw-design-link-tools input,
.asw-design-link-tools select {
    width: 100%;
    height: 31px;
    border: 1px solid var(--asw-border);
    border-radius: 6px;
    background: var(--asw-editor-surface);
    color: var(--asw-ink);
    padding: 5px 8px;
    font-size: 12px;
}

.asw-design-link-tools select {
    appearance: none;
    padding-right: 22px;
    background:
        linear-gradient(45deg, transparent 50%, var(--asw-muted) 50%) calc(100% - 12px) 13px / 5px 5px no-repeat,
        linear-gradient(135deg, var(--asw-muted) 50%, transparent 50%) calc(100% - 7px) 13px / 5px 5px no-repeat,
        var(--asw-editor-surface);
}

.asw-design-node-tools input:focus,
.asw-design-link-tools input:focus,
.asw-design-link-tools select:focus {
    outline: none;
    border-color: var(--asw-signal);
    box-shadow: 0 0 0 1px rgba(154, 111, 224, .28);
}

.asw-design-node-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.asw-design-link-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.asw-design-link-row {
    min-height: 30px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(236, 233, 242, .08);
    border-radius: 6px;
    background: rgba(19, 18, 24, .54);
    padding: 4px 4px 4px 8px;
    color: var(--asw-ink-soft);
    font-size: 11px;
}

.asw-design-link-row.is-actionable {
    cursor: pointer;
}

.asw-design-link-row.is-actionable:hover,
.asw-design-link-row.is-actionable:focus-visible {
    outline: none;
    border-color: rgba(154, 111, 224, .42);
    background: rgba(154, 111, 224, .1);
}

.asw-design-link-row.is-selected {
    border-color: rgba(154, 111, 224, .62);
    background: rgba(154, 111, 224, .14);
    box-shadow: inset 3px 0 0 var(--asw-signal);
}

.asw-design-link-row.is-incoming {
    border-left-color: rgba(95, 178, 196, .42);
}

.asw-design-link-row span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asw-design-link-row strong {
    color: var(--asw-synapse);
    font-weight: 600;
}

.asw-link-remove {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(226, 102, 78, .34);
    border-radius: 6px;
    background: transparent;
    color: #F1B1A5;
    cursor: pointer;
    font-size: 11px;
}

.asw-link-remove:hover {
    background: rgba(226, 102, 78, .14);
    color: var(--asw-ink);
}

.asw-link-remove:disabled {
    opacity: .5;
    cursor: default;
}

.asw-tab {
    background: transparent;
    color: var(--asw-ink-soft);
    border: 1px solid var(--asw-border);
    border-radius: 6px;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 12px;
}

.asw-tab:hover {
    background: var(--asw-hover);
    color: var(--asw-ink);
}

.asw-tab-static,
.asw-tab-static:hover {
    cursor: default;
    background: var(--asw-signal-soft);
    color: var(--asw-ink);
    border-color: var(--asw-signal);
}

.asw-runtime-tab {
    min-width: 66px;
    font-weight: 650;
}

.asw-runtime-tab.is-run {
    border-color: rgba(91, 196, 138, .54);
    background: rgba(91, 196, 138, .13);
    color: #DFFBE9;
}

.asw-runtime-tab.is-run:hover,
.asw-runtime-tab.is-run:focus-visible {
    border-color: var(--asw-ok);
    background: rgba(91, 196, 138, .2);
}

.asw-runtime-tab.is-stop {
    border-color: rgba(226, 102, 78, .52);
    background: rgba(226, 102, 78, .11);
    color: #F7D1CA;
}

.asw-runtime-tab.is-stop:hover,
.asw-runtime-tab.is-stop:focus-visible {
    border-color: var(--asw-error);
    background: rgba(226, 102, 78, .18);
}

.asw-tab-danger {
    border-color: rgba(226, 102, 78, .48);
    color: #F1B1A5;
}

.asw-tab-danger:hover {
    background: rgba(226, 102, 78, .14);
    color: var(--asw-ink);
}

.asw-tab-primary {
    border-color: rgba(91, 196, 138, .5);
    color: #BDEED0;
}

.asw-tab-primary:hover {
    background: rgba(91, 196, 138, .12);
    color: var(--asw-ink);
}

.asw-tab:disabled {
    opacity: .48;
    cursor: default;
    background: transparent;
    color: var(--asw-muted);
}

.asw-tab.is-active {
    background: var(--asw-signal-soft);
    color: var(--asw-ink);
    border-color: var(--asw-signal);
}

.asw-icon-tab {
    min-width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--asw-border);
    border-radius: 6px;
    background: transparent;
    color: var(--asw-ink-soft);
    padding: 0 7px;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
}

.asw-icon-tab:hover {
    background: var(--asw-hover);
    color: var(--asw-ink);
}

.asw-icon-tab.is-active {
    background: var(--asw-signal-soft);
    color: var(--asw-ink);
    border-color: var(--asw-signal);
}

.asw-icon-tab:disabled {
    opacity: .45;
    cursor: default;
    background: transparent;
    color: var(--asw-muted);
}

.asw-current-cortex {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.asw-cortex-mode {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid var(--asw-border);
    border-radius: 8px;
    padding: 8px 9px;
    background: var(--asw-editor-surface);
}

.asw-cortex-mode strong {
    color: var(--asw-ink);
    font-size: 12px;
}

.asw-cortex-mode small {
    color: var(--asw-muted);
    font-size: 11px;
}

.asw-cortex-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 6px;
}

.asw-cortex-power {
    width: 100%;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--asw-border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--asw-ink);
    cursor: pointer;
    text-align: left;
    font: inherit;
}

.asw-cortex-power span {
    font-size: 18px;
    font-weight: 700;
}

.asw-cortex-power strong {
    color: rgba(236, 233, 242, .68);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.asw-cortex-power.is-stop {
    border-color: rgba(226, 102, 78, .55);
    background: linear-gradient(135deg, rgba(226, 102, 78, .24), rgba(226, 102, 78, .08));
}

.asw-cortex-power.is-stop:hover {
    background: linear-gradient(135deg, rgba(226, 102, 78, .32), rgba(226, 102, 78, .12));
}

.asw-cortex-power.is-run {
    border-color: rgba(74, 190, 137, .5);
    background: linear-gradient(135deg, rgba(74, 190, 137, .22), rgba(74, 190, 137, .08));
}

.asw-cortex-power.is-run:hover {
    background: linear-gradient(135deg, rgba(74, 190, 137, .3), rgba(74, 190, 137, .12));
}

.asw-cortex-power:disabled {
    opacity: .52;
    cursor: default;
}

.asw-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    color: var(--asw-ink-soft);
    font-size: 12px;
    cursor: pointer;
}

.asw-switch input {
    width: 14px;
    height: 14px;
    accent-color: var(--asw-signal);
}

.asw-switch:has(input:disabled) {
    opacity: .55;
    cursor: default;
}

.asw-autostart-card {
    width: 100%;
    min-height: 52px;
    gap: 10px;
    border: 1px solid var(--asw-border);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--asw-editor-surface);
}

.asw-autostart-card:has(input:checked) {
    border-color: rgba(238, 178, 75, .56);
    background: rgba(238, 178, 75, .1);
}

.asw-autostart-card input {
    width: 18px;
    height: 18px;
}

.asw-autostart-card span {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.asw-autostart-card strong {
    color: var(--asw-ink);
    font-size: 13px;
}

.asw-autostart-card small {
    color: var(--asw-muted);
    font-size: 11px;
}

/* ---- view-mode live dashboard ---- */
.asw-liveview {
    position: absolute;
    inset: 0;
    overflow: auto;
    padding: 12px;
    background:
        radial-gradient(circle at 1px 1px, rgba(236, 233, 242, .055) 1px, transparent 0) 0 0 / 22px 22px,
        var(--asw-canvas);
    scrollbar-color: var(--asw-faint) var(--asw-canvas);
    scrollbar-width: thin;
}

.asw-stream-wall {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.asw-live-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--asw-border);
    border-radius: 8px;
    background: rgba(16, 15, 20, .96);
    box-shadow: 0 12px 26px rgba(0, 0, 0, .18);
    backdrop-filter: blur(10px);
}

.asw-liveview .asw-live-toolbar {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: -12px -12px 0;
    border-radius: 0;
}

.asw-live-title {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.asw-live-title span {
    font-size: 13px;
    font-weight: 700;
}

.asw-live-title small {
    color: var(--asw-muted);
    font-size: 11px;
}

.asw-live-actions {
    display: flex;
    gap: 6px;
}

.asw-stream-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    align-content: start;
    padding-top: 2px;
}

.asw-stream-grid.is-focused {
    grid-template-columns: minmax(0, 1fr);
}

.asw-stream-tile,
.asw-runtime-node {
    background: var(--asw-control);
    border: 1px solid var(--asw-border);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
}

.asw-stream-tile.is-streaming {
    border-color: rgba(154, 111, 224, .72);
    box-shadow: 0 0 0 1px rgba(154, 111, 224, .18), 0 12px 30px rgba(0, 0, 0, .32);
}

.asw-stream-tile.is-selected {
    border-color: rgba(143, 211, 255, .62);
}

.asw-stream-head,
.asw-runtime-node-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.asw-stream-title,
.asw-runtime-node-head > div {
    min-width: 0;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
}

.asw-stream-title strong,
.asw-runtime-node-head strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    font-size: 13px;
}

.asw-stream-title span,
.asw-runtime-node-head span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    color: var(--asw-muted);
}

.asw-stream-actions {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.asw-stream-focus-button,
.asw-stream-action-button {
    width: 34px;
    height: 30px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
}

.asw-stream-focus-button svg,
.asw-stream-action-button svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.asw-stream-action-button.is-busy svg {
    animation: asw-stream-action-pulse 1s ease-in-out infinite;
}

@keyframes asw-stream-action-pulse {
    0%, 100% {
        opacity: .55;
        transform: scale(.96);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

.asw-livepanel-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.asw-stream-stage {
    min-height: 170px;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--asw-border-soft);
    border-radius: 6px;
    background: var(--asw-editor-surface);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.asw-stream-grid.is-focused .asw-stream-stage {
    min-height: 340px;
}

.asw-stream-placeholder {
    height: 100%;
    min-width: 0;
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 5px;
    color: var(--asw-muted);
    background:
        linear-gradient(145deg, rgba(154, 111, 224, .10), transparent 46%),
        var(--asw-editor-surface);
}

.asw-stream-placeholder span,
.asw-stream-placeholder small {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.asw-stream-placeholder small {
    color: var(--asw-faint);
}

.asw-runtime-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.asw-runtime-node {
    padding: 9px;
    gap: 7px;
}

.asw-live-empty {
    min-height: 180px;
    display: grid;
    place-items: center;
    color: var(--asw-muted);
    border: 1px dashed var(--asw-border);
    border-radius: 8px;
    background: rgba(19, 18, 24, .74);
    font-size: 13px;
}

.asw-streams-panel .asw-stream-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.asw-streams-panel .asw-stream-grid.is-focused {
    grid-template-columns: minmax(0, 1fr);
}

.asw-dps-editor {
    gap: 12px;
}

.asw-dps-server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.asw-dps-server {
    border: 1px solid var(--asw-border);
    border-radius: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, .025);
}

.asw-dps-server .asw-section-title {
    margin-top: 0;
}

.asw-dps-server-fields {
    grid-template-columns: 1fr;
}

.asw-dps-stream-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.asw-dps-stream-toolbar > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.asw-dps-stream-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.asw-tab.asw-dps-rebuild {
    border-color: rgba(224, 169, 63, .72);
    background: rgba(224, 169, 63, .12);
    color: #F2D189;
    font-weight: 700;
    box-shadow: 0 0 0 1px rgba(224, 169, 63, .12) inset;
}

.asw-tab.asw-dps-rebuild:hover {
    background: rgba(224, 169, 63, .18);
    color: var(--asw-ink);
}

.asw-tab.asw-dps-rebuild:disabled {
    border-color: var(--asw-border);
    background: transparent;
    color: var(--asw-muted);
    box-shadow: none;
}

.asw-dps-stream-toolbar strong {
    font-size: 13px;
}

.asw-dps-stream-toolbar span {
    color: var(--asw-muted);
    font-size: 11px;
}

.asw-dps-source-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.asw-dps-stream-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.asw-dps-stream-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.2fr) minmax(160px, 1fr) auto auto;
    gap: 8px;
    align-items: end;
    border: 1px solid var(--asw-border-soft);
    border-radius: 8px;
    padding: 8px;
    background: var(--asw-editor-surface);
}

.asw-dps-stream-toggle {
    align-self: center;
    min-height: 30px;
}

@media (max-width: 1100px) {
    .asw-shell {
        grid-template-columns: 280px minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) minmax(180px, 34%);
        height: calc(100dvh - var(--asw-shell-offset, 56px));
        min-height: 0;
        overflow: hidden;
    }

    .asw-panel--right {
        grid-column: 1 / -1;
        grid-row: 2;
        min-height: 0;
        border-left: none;
        border-top: 1px solid var(--asw-border);
    }

    .asw-shell--no-left {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) minmax(180px, 34%);
    }

    .asw-shell--no-left .asw-panel--right {
        grid-column: 1;
        grid-row: 2;
    }

    .asw-shell--no-right {
        grid-template-columns: 280px minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
    }

    .asw-shell--no-left.asw-shell--no-right {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
    }

    .asw-shell--simple-only.asw-shell--no-left {
        grid-template-rows: minmax(0, 1fr);
    }

    .asw-shell--simple-only .asw-panel--right {
        display: none;
    }

    .asw-shell--simple-only .asw-modebar-layout {
        display: none;
    }
}

@media (max-width: 760px) {
    .asw-dps-stream-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .asw-shell {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(110px, 24%) minmax(0, 1fr) minmax(120px, 26%);
        height: calc(100dvh - var(--asw-shell-offset, 56px));
        min-height: 0;
        overflow: hidden;
    }

    .asw-panel {
        border-right: none;
        border-bottom: 1px solid var(--asw-border);
        max-height: none;
    }

    .asw-center {
        min-height: 0;
    }

    .asw-panel--right {
        grid-column: 1;
        grid-row: 3;
        max-height: none;
    }

    .asw-shell--no-left {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) minmax(120px, 30%);
    }

    .asw-shell--no-left .asw-panel--right {
        grid-row: 2;
    }

    .asw-shell--no-right {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(110px, 28%) minmax(0, 1fr);
    }

    .asw-shell--no-left.asw-shell--no-right {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr);
    }

    .asw-modebar {
        flex-wrap: wrap;
        height: auto;
        min-height: 40px;
        padding: 6px 8px;
    }

    .asw-modebar-title {
        flex: 1 1 100%;
        margin-left: 0;
        order: 2;
    }

    .asw-shell--simple-only .asw-modebar-notice {
        flex: 1 1 100%;
        max-width: none;
        order: 2;
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        line-height: 1.3;
    }

    .asw-shell--simple-only .asw-modebar-title {
        order: 3;
    }

    .asw-simple-view {
        padding: 8px;
    }

    .asw-simple-node {
        grid-template-columns: 4px 30px minmax(0, 1fr);
        gap: 8px;
        padding-right: 8px;
    }

    .asw-simple-node-metrics,
    .asw-simple-node-action {
        grid-column: 3;
        justify-content: flex-start;
    }

    .asw-simple-node-action {
        width: max-content;
    }
}

/* ---- single-device Studio embed ---- */
.asw-device-studio {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    height: calc(100dvh - var(--asw-shell-offset, 56px));
    min-width: 0;
    overflow: hidden;
    background: var(--asw-window);
    color: var(--asw-ink);
    font-family: "Segoe UI", system-ui, sans-serif;
}

.asw-device-studio,
.asw-device-studio * {
    box-sizing: border-box;
}

.asw-device-studio--rail {
    grid-template-columns: 300px minmax(0, 1fr);
    grid-template-rows: 100%;
}

.asw-device-studio-rail,
.asw-device-studio-main {
    min-width: 0;
}

.asw-device-studio-main {
    overflow: hidden;
}

.asw-device-studio .asw-device-studio-workspace {
    height: 100%;
    min-height: 0;
    --asw-shell-offset: 0px;
}

.asw-device-studio-topbar {
    display: grid;
    grid-template-columns: minmax(220px, .85fr) auto minmax(300px, 1.15fr);
    gap: 10px 14px;
    align-items: center;
    min-width: 0;
    padding: 9px 12px;
    border-bottom: 1px solid var(--asw-border);
    background: var(--asw-panel);
}

.asw-device-studio-topbar > .asw-status {
    margin: 0;
}

.asw-device-studio-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-width: 0;
}

.asw-device-studio-top-device {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}

.asw-device-studio-top-name {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.asw-device-studio-head {
    align-items: start;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--asw-border);
}

.asw-device-studio-head h3 {
    margin: 0 0 2px;
    color: var(--asw-muted);
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.asw-device-studio-name {
    min-width: 0;
    overflow: hidden;
    color: var(--asw-ink);
    font-size: 15px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asw-device-studio-top-device .asw-device-studio-name {
    flex: 0 1 auto;
}

.asw-device-studio-subtitle {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--asw-muted);
    font-size: 10px;
    line-height: 1.2;
}

.asw-device-studio-top-device .asw-chip {
    flex: 0 0 auto;
}

.asw-device-studio-connect,
.asw-device-studio-top-actions,
.asw-device-studio-cortex-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.asw-device-studio-connect {
    margin-bottom: 12px;
}

.asw-device-studio-top-actions {
    justify-content: center;
}

.asw-device-studio-cortex-toolbar {
    justify-content: flex-end;
    min-width: 0;
}

.asw-device-studio-cortex-picker {
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr);
    gap: 8px;
    align-items: center;
    min-width: min(100%, 340px);
}

.asw-device-studio-cortex-picker span,
.asw-device-studio-inline-form label span {
    color: var(--asw-muted);
    font-size: 11px;
}

.asw-device-studio-cortex-picker select,
.asw-device-studio-inline-form input {
    width: 100%;
    min-width: 0;
    height: 30px;
    border: 1px solid var(--asw-border);
    border-radius: 8px;
    background: var(--asw-control);
    color: var(--asw-ink);
    padding: 4px 8px;
    font: inherit;
}

.asw-device-studio-cortex-picker select:focus,
.asw-device-studio-inline-form input:focus {
    outline: 1px solid var(--asw-signal);
    border-color: var(--asw-signal);
}

.asw-device-studio-cortex-picker select.is-running {
    border-color: color-mix(in srgb, var(--asw-ok) 72%, var(--asw-border));
    background:
        linear-gradient(0deg, rgba(91, 196, 138, .16), rgba(91, 196, 138, .16)),
        var(--asw-control);
    color: #E9FFF2;
    box-shadow: inset 0 0 0 1px rgba(91, 196, 138, .14);
}

.asw-device-studio-cortex-picker select.is-running:focus {
    outline-color: var(--asw-ok);
    border-color: var(--asw-ok);
}

.asw-device-studio-flow-option.is-running {
    background: #153523;
    color: #E9FFF2;
}

.asw-device-studio-cortexes {
    margin-top: 12px;
}

.asw-device-studio-cortex-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.asw-device-studio-cortex {
    align-items: flex-start;
    cursor: pointer;
}

.asw-device-studio-cortex .asw-cortex-text {
    display: grid;
    gap: 4px;
}

.asw-device-studio-row-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    max-width: 60px;
}

.asw-device-studio-icon {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(236, 233, 242, .14);
    border-radius: 6px;
    background: rgba(236, 233, 242, .045);
    color: var(--asw-ink-soft);
    cursor: pointer;
    padding: 0;
}

.asw-device-studio-icon:hover {
    background: var(--asw-hover);
    color: var(--asw-ink);
}

.asw-device-studio-icon.is-danger {
    border-color: rgba(226, 102, 78, .36);
    background: rgba(226, 102, 78, .08);
    color: #F1B1A5;
}

.asw-device-studio-icon.is-danger:hover {
    background: rgba(226, 102, 78, .14);
    color: var(--asw-ink);
}

.asw-device-studio-icon:disabled {
    opacity: .48;
    cursor: default;
    background: transparent;
    color: var(--asw-muted);
}

.asw-device-studio-icon svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.asw-device-studio-inline-form,
.asw-device-studio-confirm {
    display: grid;
    gap: 10px;
    margin: 2px 0 8px 34px;
    padding: 10px;
    border: 1px solid var(--asw-border);
    border-radius: 8px;
    background: rgba(19, 18, 24, .68);
}

.asw-device-studio-top-form {
    grid-column: 1 / -1;
    grid-template-columns: minmax(220px, 340px) auto;
    align-items: end;
    margin: 0;
}

.asw-device-studio-confirm.asw-device-studio-top-form {
    grid-template-columns: minmax(220px, 1fr) auto;
    align-items: center;
}

.asw-device-studio-inline-form label {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.asw-device-studio-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.asw-device-studio-confirm {
    border-color: rgba(226, 102, 78, .32);
    background: rgba(44, 24, 24, .6);
}

.asw-device-studio-confirm div:first-child {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.asw-device-studio-confirm strong {
    color: var(--asw-ink);
    font-size: 12px;
}

.asw-device-studio-confirm span {
    color: var(--asw-muted);
    font-size: 11px;
}

@media (max-width: 1100px) {
    .asw-device-studio {
        height: calc(100dvh - var(--asw-shell-offset, 56px));
        min-height: 0;
        overflow: hidden;
    }

    .asw-device-studio--rail {
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .asw-device-studio-main {
        min-height: 0;
        overflow: hidden;
    }

    .asw-device-studio .asw-device-studio-workspace {
        height: 100%;
        min-height: 0;
    }

    .asw-device-studio-topbar {
        grid-template-columns: minmax(220px, 1fr) auto;
    }

    .asw-device-studio-cortex-toolbar,
    .asw-device-studio-top-form {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .asw-device-studio,
    .asw-device-studio--rail {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        min-height: 0;
    }

    .asw-device-studio-rail {
        max-height: none;
    }

    .asw-device-studio-topbar,
    .asw-device-studio-top-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .asw-device-studio-top-actions,
    .asw-device-studio-cortex-toolbar {
        justify-content: flex-start;
    }

    .asw-device-studio-cortex-picker {
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
    }

    .asw-device-studio-row-actions {
        max-width: none;
        justify-content: flex-start;
        padding-left: 34px;
        width: 100%;
    }

    .asw-device-studio-inline-form,
    .asw-device-studio-confirm {
        margin-left: 2px;
    }
}

/* ---- Stream quality + fit-to-view controls (StreamingWall toolbar) ---- */
.asw-stream-quality {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 2px 8px;
    border: 1px solid var(--asw-border);
    border-radius: 8px;
    background: var(--asw-control);
}

.asw-stream-quality-label {
    font-size: 11px;
    color: var(--asw-ink-soft);
    min-width: 48px;
    text-align: center;
}

.asw-stream-quality input[type="range"] {
    width: 90px;
    accent-color: var(--asw-signal);
}

.asw-quality-presets {
    display: inline-flex;
    gap: 2px;
}

.asw-quality-presets .asw-tab {
    padding: 2px 7px;
    font-size: 11px;
}

.asw-quality-presets .asw-tab.is-active {
    color: var(--asw-ink);
    border-color: var(--asw-signal);
}

.asw-stream-fit {
    font-size: 12px;
    color: var(--asw-ink-soft);
    white-space: nowrap;
}

/* ---- Database node status ---- */
.asw-db-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

/* ---- Log node panel ---- */
.asw-log-editor .asw-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.asw-log-editor input[type="search"] {
    flex: 1 1 160px;
    min-width: 140px;
}

.asw-log-level-filter {
    min-width: 96px;
}

.asw-log-empty {
    padding: 18px;
    text-align: center;
    color: var(--asw-muted);
    border: 1px dashed var(--asw-border);
    border-radius: 8px;
}

.asw-log-table-wrap {
    max-height: 420px;
    overflow: auto;
    border: 1px solid var(--asw-border);
    border-radius: 8px;
}

.asw-log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.asw-log-table th,
.asw-log-table td {
    padding: 4px 8px;
    text-align: left;
    border-bottom: 1px solid var(--asw-border-soft);
    vertical-align: top;
}

.asw-log-table thead th {
    position: sticky;
    top: 0;
    background: var(--asw-panel-hi);
    z-index: 1;
}

.asw-log-time {
    white-space: nowrap;
    color: var(--asw-muted);
    font-variant-numeric: tabular-nums;
}

.asw-log-origin {
    white-space: nowrap;
    color: var(--asw-ink-soft);
}

.asw-log-message {
    word-break: break-word;
}

.asw-log-table tr.is-error td,
.asw-log-table tr.is-fatal td {
    color: #F08B8B;
}

.asw-log-table tr.is-warn td {
    color: #E4C36B;
}

.asw-log-table tr.is-debug td,
.asw-log-table tr.is-trace td {
    color: var(--asw-muted);
}

.asw-log-table tr.is-system td {
    font-weight: 600;
}

/* ---- ANPR threshold runtime extras ---- */
.asw-threshold-passed-layout {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.asw-threshold-passed-layout .asw-threshold-table-wrap {
    flex: 1 1 auto;
    min-width: 0;
}

.asw-threshold-passed-table tbody tr {
    cursor: pointer;
}

.asw-threshold-passed-table tbody tr.is-selected td {
    background: var(--asw-hover);
}

.asw-threshold-thumb-cell {
    width: 64px;
}

.asw-threshold-thumb {
    display: block;
    max-width: 60px;
    max-height: 26px;
    border-radius: 3px;
    object-fit: contain;
}

.asw-threshold-preview {
    flex: 0 0 220px;
    margin: 0;
    padding: 8px;
    border: 1px solid var(--asw-border);
    border-radius: 8px;
    background: var(--asw-panel);
    text-align: center;
}

.asw-threshold-preview img {
    max-width: 100%;
    border-radius: 4px;
}

.asw-threshold-preview figcaption {
    margin-top: 6px;
    font-size: 12px;
    letter-spacing: .06em;
    color: var(--asw-ink-soft);
}

.asw-threshold-table td.is-width-warn {
    color: #F08B8B;
    font-weight: 600;
}

/* ---- ANPR license-plate test tool ---- */
.asw-lp-test {
    display: flex;
    gap: 8px;
    align-items: center;
}

.asw-lp-test input {
    flex: 1 1 auto;
    text-transform: uppercase;
}

/* ---- Read-only copy rows (e.g. MediaServer RTSP link) ---- */
.asw-copy-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.asw-copy-row input[readonly] {
    flex: 1 1 auto;
    color: var(--asw-ink-soft);
}

/* ---- DPS preset row ---- */
.asw-dps-preset-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

/* ---- Secret fields and the camera link panel (R7 camera link fields, part C) ---- */
.asw-secret-field {
    gap: 4px;
}

.asw-secret-row,
.asw-secret-input,
.asw-link-preview,
.asw-secret-reveal-actions,
.asw-link-watch-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.asw-secret-input input {
    flex: 1 1 160px;
    min-width: 0;
}

/* A tick inside a field keeps its own size (".asw-field input" makes inputs full width). */
.asw-secret-field .asw-inline input[type="checkbox"] {
    width: auto;
    flex: 0 0 auto;
}

.asw-secret-mask,
.asw-secret-text,
.asw-secret-value,
.asw-link-preview code {
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 12px;
    color: var(--asw-ink-soft);
    overflow-wrap: anywhere;
    min-width: 0;
}

.asw-secret-text {
    display: block;
    padding: 6px 8px;
    border: 1px solid var(--asw-border);
    border-radius: 6px;
    background: var(--asw-editor-surface);
    white-space: pre-wrap;
}

.asw-field-hint {
    color: var(--asw-muted);
    font-size: 11px;
    line-height: 1.3;
}

.asw-field-hint.warn {
    color: var(--asw-warning);
}

.asw-link-editor {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.asw-link-preview .asw-field-label {
    font-size: 12px;
}

.asw-secret-reveal {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid var(--asw-warning);
    border-radius: 6px;
    background: var(--asw-editor-surface);
}

.asw-secret-value {
    color: var(--asw-ink);
    user-select: all;
}

.asw-secret-escapes {
    margin: 0;
    padding-left: 18px;
    font-size: 11px;
    color: var(--asw-muted);
}

.asw-link-watch {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid var(--asw-border);
    border-left: 3px solid var(--asw-signal);
    border-radius: 6px;
    background: var(--asw-panel-hi);
    font-size: 12px;
}

.asw-link-watch.is-ok {
    border-left-color: var(--asw-ok);
}

.asw-link-watch.is-warn {
    border-left-color: var(--asw-warning);
}

.asw-link-watch.is-error {
    border-left-color: var(--asw-error);
}

.asw-save-review {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid var(--asw-warning);
    border-radius: 6px;
    background: var(--asw-panel-hi);
    font-size: 12px;
}

.asw-save-review-title {
    font-weight: 600;
    color: var(--asw-ink);
}

.asw-save-review ul {
    margin: 0;
    padding-left: 18px;
    color: var(--asw-ink-soft);
}

.asw-save-review-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.asw-link-problems,
.asw-link-changes {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
}

.asw-link-changes ul {
    margin: 0;
    padding-left: 18px;
    color: var(--asw-ink-soft);
}

/* The editor stays mounted while another inspector tab shows. */
.asw-inspector-panel[hidden] {
    display: none !important;
}

/* ---- ANPR route view (R7-64): the GPU lane panel, share bars, group summary, ANPR queue, plate share ---- */

/* The FLOW's GPU lane: a card with a coloured edge by state (green on, amber off, muted no lane or no report). */
.asw-lane {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    border: 1px solid var(--asw-border);
    border-left: 4px solid var(--asw-lane);
    border-radius: 8px;
    background: var(--asw-lane-panel);
    padding: 9px 11px 10px;
    color: var(--asw-ink);
    font-size: 12px;
}

.asw-lane.is-off {
    border-left-color: var(--asw-warning);
}

.asw-lane.is-none,
.asw-lane.is-stale {
    border-left-color: var(--asw-muted);
}

.asw-lane.is-unknown {
    border: 1px dashed var(--asw-faint);
    border-left: 4px dashed var(--asw-faint);
    background: transparent;
}

.asw-lane.is-compact {
    margin-top: 12px;
    padding: 8px 10px 9px;
}

.asw-lane-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    min-width: 0;
}

.asw-lane-state {
    color: var(--asw-lane);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.asw-lane.is-off .asw-lane-state {
    color: var(--asw-warning);
}

.asw-lane.is-none .asw-lane-state,
.asw-lane.is-stale .asw-lane-state {
    color: var(--asw-ink-soft);
    font-weight: 600;
}

.asw-lane.is-unknown .asw-lane-state {
    color: var(--asw-muted);
    font-weight: 600;
}

.asw-lane-gpu {
    min-width: 0;
    color: var(--asw-muted);
    font-size: 11px;
    overflow-wrap: anywhere;
}

.asw-lane-load {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    color: var(--asw-muted);
}

.asw-lane-meter {
    flex: 1 1 80px;
    min-width: 60px;
    max-width: 220px;
}

.asw-lane-meter span {
    background: var(--asw-lane);
}

.asw-lane-busy {
    color: var(--asw-ink);
    font-size: 13px;
}

.asw-lane-runs {
    color: var(--asw-ink-soft);
}

.asw-lane-note {
    margin: 0;
    color: var(--asw-muted);
    font-size: 11px;
    line-height: 1.35;
}

.asw-lane-details summary {
    width: max-content;
    max-width: 100%;
    color: var(--asw-ink-soft);
    font-size: 11px;
    cursor: pointer;
}

.asw-lane-details[open] summary {
    margin-bottom: 6px;
}

.asw-lane-details dl {
    display: grid;
    grid-template-columns: minmax(92px, max-content) minmax(0, 1fr);
    gap: 4px 12px;
    margin: 0;
    font-size: 11.5px;
}

.asw-lane-details dt {
    color: var(--asw-muted);
}

.asw-lane-details dt.is-sub {
    padding-left: 10px;
}

.asw-lane-details dd {
    margin: 0;
    min-width: 0;
    color: var(--asw-ink-soft);
    overflow-wrap: anywhere;
}

.asw-lane-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 14px;
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
    color: var(--asw-muted);
    font-size: 11px;
}

/* The share bar: GPU lane green, CPU blue, OpenCV DNN grey (only when runs went there), the words next to it. */
.asw-share-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.asw-share-block.is-card {
    flex: 1 1 100%;
}

.asw-share {
    display: flex;
    width: 100%;
    max-width: 320px;
    height: 8px;
    border-radius: 4px;
    background: var(--asw-editor-surface);
    overflow: hidden;
}

.asw-share i {
    display: block;
    height: 100%;
}

.asw-share i.lane {
    background: var(--asw-lane);
}

.asw-share i.cpu {
    background: var(--asw-cpu);
}

.asw-share i.dnn {
    background: var(--asw-muted);
}

.asw-share-text {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
    color: var(--asw-ink-soft);
    font-size: 11px;
}

.asw-share-text small {
    color: var(--asw-muted);
    font-size: 10.5px;
}

.asw-share-key {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.asw-share-key::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--asw-lane);
}

.asw-share-key.cpu::before {
    background: var(--asw-cpu);
}

.asw-share-key.dnn::before {
    background: var(--asw-muted);
}

.asw-share-key.lane {
    color: var(--asw-ok);
}

.asw-share-key.cpu {
    color: var(--asw-cpu-ink);
}

.asw-share-key.dnn {
    color: var(--asw-ink-soft);
}

/* Cards: the ANPR queue from 0 (neutral; amber only when full) and the plate share of a source NODE. */
.asw-chip.anpr-queue {
    background: var(--asw-hover);
    color: var(--asw-ink);
}

.asw-chip.plate {
    background: rgba(79, 127, 232, .14);
    color: var(--asw-cpu-ink);
}

.asw-axon-card .asw-share {
    max-width: none;
}

/* The simplified list: a group's summary in the metric pills. */
.asw-simple-node-metrics span.is-loss {
    border-color: rgba(226, 102, 78, .35);
    color: var(--asw-error);
}

.asw-simple-node-metrics .asw-share-chip {
    gap: 8px;
}

.asw-simple-node-metrics .asw-share-chip .asw-share-key {
    min-height: 0;
    border: 0;
    background: none;
    padding: 0;
}

/* The NODE window (Connections tab): the ANPR section. */
.asw-anpr-detail dl {
    display: grid;
    grid-template-columns: minmax(96px, max-content) minmax(0, 1fr);
    gap: 6px 12px;
    margin: 0 0 8px;
    font-size: 12px;
}

.asw-anpr-detail dt {
    color: var(--asw-muted);
}

.asw-anpr-detail dd {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 0;
    min-width: 0;
    color: var(--asw-ink-soft);
    overflow-wrap: anywhere;
}

.asw-anpr-warning {
    color: var(--asw-warning);
}

.asw-anpr-muted {
    color: var(--asw-muted);
}

/* The lane OFF notice while live: a runtime problem line under the mode bar (amber, as the design warnings). */
.asw-runtime-notice {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
    margin: 6px 10px 2px;
    border: 1px solid rgba(224, 169, 63, .35);
    border-radius: 8px;
    background: rgba(16, 15, 20, .96);
    padding: 6px 11px 7px;
    color: var(--asw-ink);
    font-size: 12px;
    line-height: 1.35;
}

.asw-runtime-notice strong {
    color: var(--asw-warning);
    font-weight: 600;
}

@media (max-width: 760px) {
    .asw-lane-details dl,
    .asw-anpr-detail dl {
        grid-template-columns: minmax(0, 1fr);
        gap: 1px 0;
    }

    .asw-lane-details dd,
    .asw-anpr-detail dd {
        margin-bottom: 5px;
    }

    .asw-runtime-notice {
        margin: 4px 8px 2px;
    }
}
