:root {
    color-scheme: light;
    --bg: #f5f2fb;
    --bg-wash: #ebe4f7;
    --surface: #ffffff;
    --surface-lavender: #fbf8ff;
    --surface-strong: #f0e9fb;
    --line: #ded3ef;
    --line-strong: #bba7df;
    --text: #211a32;
    --text-muted: #625772;
    --text-soft: #7a708b;
    --purple-950: #261047;
    --purple-850: #3c1b6e;
    --purple-700: #6d36c5;
    --purple-600: #8050df;
    --purple-500: #9368f0;
    --purple-200: #dfd1ff;
    --purple-100: #f1eaff;
    --magenta: #c026d3;
    --cyan: #0e7490;
    --green: #047857;
    --amber: #b45309;
    --red: #b91c1c;
    --panel-bg: rgba(255, 255, 255, 0.88);
    --panel-border: var(--line);
    --app-bg: var(--bg);
    --muted: var(--text-muted);
    --accent: var(--purple-700);
    --accent-strong: var(--purple-850);
    --danger: var(--red);
    --focus: var(--purple-600);
    --control-bg: var(--surface);
    --control-hover: var(--surface-lavender);
    --shadow: 0 18px 44px rgba(61, 37, 110, 0.12);
    --shadow-tight: 0 8px 20px rgba(61, 37, 110, 0.12);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    color: var(--text);
    background:
        radial-gradient(circle at 18% 4%, rgba(147, 104, 240, 0.2), transparent 30rem),
        radial-gradient(circle at 86% 8%, rgba(192, 38, 211, 0.12), transparent 28rem),
        linear-gradient(160deg, var(--bg), #f9f7fe 42%, var(--bg-wash));
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

button,
input,
select,
textarea {
    font: inherit;
    letter-spacing: 0;
}

button {
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
label.toolbar-button:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(128, 80, 223, 0.16);
}

h1:focus {
    outline: none;
}

.designer-app {
    display: grid;
    grid-template-rows: minmax(68px, auto) minmax(0, 1fr);
    gap: 18px;
    width: 100vw;
    height: 100dvh;
    padding: 18px;
    overflow: hidden;
}

.designer-topbar {
    position: relative;
    z-index: 40;
    display: grid;
    grid-template-columns: minmax(190px, 260px) minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    min-width: 0;
    min-height: 68px;
    padding: 12px 14px;
    border: 1px solid rgba(119, 82, 178, 0.22);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow-tight);
    backdrop-filter: blur(16px);
}

.designer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.designer-brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--purple-200);
    border-radius: 50%;
    color: #ffffff;
    background: linear-gradient(135deg, var(--purple-700), var(--magenta));
    box-shadow: 0 8px 18px rgba(128, 80, 223, 0.22);
    font-size: 1.05rem;
    font-weight: 850;
}

.designer-brand-text {
    min-width: 0;
}

.designer-brand-text h1 {
    margin: 0;
    color: var(--purple-950);
    font-size: 1rem;
    font-weight: 850;
    line-height: 1.1;
}

.designer-brand-text span {
    display: block;
    overflow: hidden;
    margin-top: 2px;
    color: var(--text-soft);
    font-size: 0.76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.designer-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    min-width: 0;
}

.designer-top-actions form,
.admin-nav form {
    margin: 0;
}

.scope-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--purple-100);
    color: var(--purple-850);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.top-action-link,
.top-action-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--purple-850);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.top-action-link:hover,
.top-action-button:hover {
    border-color: var(--line-strong);
    background: var(--surface-lavender);
}

.top-action-link svg,
.top-action-button svg {
    width: 15px;
    height: 15px;
}

.designer-main {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 360px minmax(360px, 1fr) 320px;
    gap: 18px;
    min-height: 0;
    overflow: hidden;
}

.page-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 2px 0 4px;
    overflow-x: auto;
}

.page-tab {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    max-width: 150px;
    padding: 0 12px;
    border: 1px solid rgba(222, 211, 239, 0.96);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.72);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}

.page-tab span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-tab:hover {
    border-color: var(--purple-300);
    color: var(--purple-850);
}

.page-tab.is-active {
    border-color: var(--purple-500);
    background: var(--purple-100);
    color: var(--purple-900);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1);
}

.top-toolbar-shell {
    position: relative;
    min-width: 0;
    overflow: visible;
}

.top-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    padding: 0;
    overflow-x: auto;
    overflow-y: visible;
    background: transparent;
    border-bottom: 0;
}

.top-toolbar:has(.toolbar-popover) {
    overflow: visible;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: max-content;
    padding: 4px;
    border: 1px solid rgba(222, 211, 239, 0.86);
    border-radius: var(--radius);
    background: rgba(251, 248, 255, 0.76);
}

.view-mode-segment {
    gap: 4px;
}

.toolbar-group:last-child {
    border-right: 1px solid rgba(222, 211, 239, 0.86);
}

.toolbar-spacer {
    margin-left: 0;
}

.toolbar-button,
.secondary-button,
.primary-button,
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    background: var(--control-bg);
    white-space: nowrap;
}

label.secondary-button {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.toolbar-button {
    padding: 0 10px;
    font-size: 13px;
}

.toolbar-button svg,
.secondary-button svg,
.icon-button svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.toolbar-button:hover,
.secondary-button:hover,
.icon-button:hover {
    background: var(--surface-lavender);
    border-color: var(--line-strong);
    color: var(--purple-850);
}

.toolbar-button:disabled,
.secondary-button:disabled,
.icon-button:disabled {
    color: var(--muted);
    background: #f8fafc;
    border-color: var(--line);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.62;
}

.toolbar-button.is-active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--purple-700), var(--magenta));
    border-color: transparent;
    box-shadow: 0 8px 18px rgba(128, 80, 223, 0.22);
}

.toolbar-popover-root {
    position: relative;
}

.toolbar-menu-root {
    position: relative;
}

.toolbar-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 30;
    min-width: 210px;
    padding: 12px;
    border: 1px solid rgba(222, 211, 239, 0.92);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.save-options-menu {
    display: grid;
    gap: 4px;
    min-width: 190px;
    padding: 6px;
    z-index: 70;
}

.save-menu-item {
    display: grid;
    grid-template-columns: 18px 1fr;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 34px;
    padding: 0 8px;
    border: 0;
    border-radius: var(--radius);
    color: var(--text);
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
}

.save-menu-item:hover,
.save-menu-item:focus-visible {
    outline: none;
    color: var(--purple-850);
    background: var(--surface-lavender);
}

.save-menu-item svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.grid-options-popover {
    display: grid;
    gap: 10px;
}

.topbar-grid-options-popover {
    top: calc(100% + 8px);
    right: 42px;
    left: auto;
    z-index: 70;
}

.toolbar-check,
.toolbar-number {
    display: grid;
    gap: 6px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
}

.toolbar-check {
    grid-template-columns: auto 1fr;
    align-items: center;
    text-transform: none;
}

.toolbar-number input {
    height: 34px;
    min-width: 0;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    background: #ffffff;
}

.file-input {
    position: fixed;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.wire-button {
    min-width: 68px;
}

.wire-swatch {
    display: inline-block;
    width: 22px;
    height: var(--wire-width, 3px);
    min-height: 2px;
    border-radius: 999px;
    background: var(--wire-color);
}

.left-panel,
.right-panel,
.symbol-palette,
.object-list-panel,
.properties-panel {
    min-height: 0;
}

.left-panel {
    display: grid;
    grid-template-rows: minmax(0, 1fr) minmax(150px, min(31dvh, 245px));
    gap: 14px;
    overflow: hidden;
    background: transparent;
    border-right: 0;
}

.right-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
    overflow: hidden;
    background: transparent;
}

.right-panel:has(.canvas-legend[hidden]) {
    grid-template-rows: minmax(0, 1fr);
}

.symbol-palette,
.object-list-panel,
.properties-panel {
    background: var(--panel-bg);
    border: 1px solid rgba(123, 88, 182, 0.22);
    border-radius: var(--radius);
    box-shadow: var(--shadow-tight);
    overflow: auto;
}

.symbol-palette {
    border-bottom: 1px solid rgba(123, 88, 182, 0.22);
}

.properties-panel {
    border-left: 1px solid rgba(123, 88, 182, 0.22);
}

.panel-title {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    height: 42px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 850;
    text-transform: uppercase;
    color: var(--purple-850);
    background: rgba(251, 248, 255, 0.96);
    border-bottom: 1px solid var(--panel-border);
    backdrop-filter: blur(12px);
}

.panel-search {
    display: grid;
    gap: 5px;
    padding: 10px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
}

.panel-search span {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.panel-search input {
    width: 100%;
    height: 34px;
    min-width: 0;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    background: #ffffff;
}

.panel-search input:focus {
    outline: 0;
    border-color: var(--purple-600);
    box-shadow: 0 0 0 3px rgba(128, 80, 223, 0.16);
}

.palette-group {
    padding: 12px 10px 4px;
}

.palette-section,
.palette-subgroup {
    display: grid;
    gap: 8px;
    padding: 10px;
}

.palette-section + .palette-section {
    border-top: 1px solid var(--line);
}

.palette-subgroup {
    padding: 0 0 0 12px;
    border-left: 2px solid var(--purple-100);
}

.palette-toggle {
    width: 100%;
    min-height: 34px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-lavender);
    color: var(--purple-850);
    font-size: 12px;
    font-weight: 850;
    text-align: left;
    text-transform: uppercase;
}

.palette-toggle.is-system {
    color: #ffffff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--purple-700), var(--magenta));
    box-shadow: 0 8px 18px rgba(128, 80, 223, 0.16);
}

.palette-toggle.is-subgroup {
    background: #ffffff;
}

.palette-caret {
    display: inline-grid;
    place-items: center;
    color: currentColor;
    font-weight: 900;
}

.palette-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.42);
    font-size: 11px;
    font-weight: 850;
}

.palette-group h2 {
    margin: 0 4px 8px;
    font-size: 12px;
    font-weight: 850;
    color: var(--text-muted);
    text-transform: uppercase;
}

.symbol-list {
    display: grid;
    gap: 6px;
}

.symbol-tile {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    align-items: center;
    min-height: 38px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    background: #ffffff;
    cursor: grab;
    text-align: left;
}

.symbol-tile:active {
    cursor: grabbing;
}

body.is-palette-dragging,
body.is-palette-dragging * {
    cursor: grabbing !important;
}

.palette-drag-preview {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 30px;
    padding: 6px;
    border: 1px solid rgba(91, 76, 120, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 12px 30px rgba(23, 16, 39, 0.18);
    opacity: 0.86;
    pointer-events: none;
}

.symbol-tile > span:last-child {
    overflow: hidden;
    font-size: 13px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.symbol-tile-label {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.symbol-tile-label > span,
.symbol-tile-label > small {
    overflow: hidden;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.symbol-tile-label > span {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.12;
}

.symbol-tile-label > small {
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.1;
}

.symbol-tile:hover {
    background: var(--surface-lavender);
    border-color: var(--line-strong);
    color: var(--purple-850);
}

.symbol-tile.is-active {
    border-color: var(--accent);
    box-shadow: inset 3px 0 0 var(--accent), 0 8px 18px rgba(128, 80, 223, 0.12);
}

.wire-tile {
    grid-template-columns: 36px minmax(0, 1fr);
    min-height: 44px;
}

.wire-path-mark {
    position: relative;
    display: inline-block;
    width: 28px;
    height: 18px;
}

.wire-path-mark::before {
    content: "";
    position: absolute;
    left: 1px;
    right: 1px;
    top: 50%;
    height: var(--wire-width, 3px);
    border-radius: 999px;
    background: var(--wire-color);
    transform: translateY(-50%);
}

.wire-tile-label {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.wire-tile-label > span,
.wire-tile-label > small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wire-tile-label > span {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.15;
}

.wire-tile-label > small {
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.1;
}

.fixture-symbol-tile {
    align-items: center;
}

.fixture-tile-label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.fixture-tile-label strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    min-height: 20px;
    padding: 0 5px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    background: #ffffff;
    font-size: 11px;
    font-weight: 900;
}

.fixture-tile-label span {
    overflow: hidden;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.symbol-mark {
    position: relative;
    width: 18px;
    height: 18px;
    border: 3px solid var(--symbol-color);
    background: color-mix(in srgb, var(--symbol-color) 14%, white);
    box-sizing: border-box;
}

.symbol-mark.is-circle {
    border-radius: 999px;
}

.symbol-mark.is-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-color: var(--line-strong);
    color: var(--purple-850);
    background: #ffffff;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
}

.symbol-mark.is-cone {
    position: relative;
    width: 24px;
    height: 18px;
    border: 0;
    background: transparent;
}

.symbol-mark.is-cone::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 2px;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 15px solid color-mix(in srgb, var(--symbol-color) 38%, transparent);
}

.symbol-mark.is-cone::after {
    content: "";
    position: absolute;
    left: 1px;
    top: 4px;
    width: 10px;
    height: 10px;
    border: 3px solid var(--symbol-color);
    border-radius: 999px;
    background: #ffffff;
}

.symbol-mark.is-tv,
.symbol-mark.is-touch-panel,
.symbol-mark.is-shade,
.symbol-mark.is-dmark {
    width: 24px;
    height: 17px;
}

.symbol-mark.is-wall-speaker,
.symbol-mark.is-rack {
    width: 18px;
    height: 24px;
}

.symbol-mark.is-speaker::before,
.symbol-mark.is-subwoofer::before {
    content: "";
    position: absolute;
    inset: 3px;
    border: 2px solid var(--symbol-color);
    border-radius: 999px;
}

.symbol-mark.is-speaker::after,
.symbol-mark.is-subwoofer::after,
.symbol-mark.is-wap::after,
.symbol-mark.is-junction::after,
.symbol-mark.is-generic::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: var(--symbol-color);
    transform: translate(-50%, -50%);
}

.symbol-mark.is-subwoofer::after {
    width: 7px;
    height: 7px;
    background: transparent;
    border: 2px solid var(--symbol-color);
}

.symbol-mark.is-wap::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 4px;
    width: 12px;
    height: 7px;
    border: 2px solid var(--symbol-color);
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
    transform: translateX(-50%);
}

.symbol-mark.is-wap::after {
    top: 13px;
}

.symbol-mark.is-tv::before,
.symbol-mark.is-touch-panel::before {
    content: "";
    position: absolute;
    left: 4px;
    right: 4px;
    top: 4px;
    bottom: 5px;
    border: 2px solid var(--symbol-color);
}

.symbol-mark.is-tv::after,
.symbol-mark.is-touch-panel::after {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 2px;
    height: 2px;
    background: var(--symbol-color);
}

.symbol-mark.is-wall-speaker::before {
    content: "";
    position: absolute;
    left: 4px;
    right: 4px;
    top: 5px;
    height: 2px;
    background: var(--symbol-color);
    box-shadow: 0 5px 0 var(--symbol-color), 0 10px 0 var(--symbol-color);
}

.symbol-mark.is-keypad::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 5px;
    width: 3px;
    height: 3px;
    border-radius: 999px;
    background: var(--symbol-color);
    box-shadow:
        5px 0 0 var(--symbol-color),
        10px 0 0 var(--symbol-color),
        0 5px 0 var(--symbol-color),
        5px 5px 0 var(--symbol-color),
        10px 5px 0 var(--symbol-color),
        0 10px 0 var(--symbol-color),
        5px 10px 0 var(--symbol-color),
        10px 10px 0 var(--symbol-color);
}

.symbol-mark.is-dimmer::before,
.symbol-mark.is-switch::before,
.symbol-mark.is-fan-switch::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 4px;
    width: 2px;
    height: 10px;
    background: var(--symbol-color);
    transform: translateX(-50%);
}

.symbol-mark.is-dimmer::before,
.symbol-mark.is-switch::before,
.symbol-mark.is-three-way-switch::before {
    content: "S";
    left: 0;
    right: 0;
    top: 1px;
    width: auto;
    height: auto;
    background: transparent;
    color: var(--symbol-color);
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    transform: none;
}

.symbol-mark.is-dimmer::before {
    content: "SD";
    font-size: 10px;
}

.symbol-mark.is-three-way-switch::before {
    content: "S3";
    font-size: 10px;
}

.symbol-mark.is-dimmer::after,
.symbol-mark.is-switch::after,
.symbol-mark.is-three-way-switch::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 13px;
    width: 10px;
    height: 2px;
    background: var(--symbol-color);
    transform: rotate(-35deg);
}

.symbol-mark.is-switch::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 10px;
    width: 10px;
    height: 2px;
    background: var(--symbol-color);
    transform: rotate(-35deg);
}

.symbol-mark.is-fan-switch::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 5px;
    width: 8px;
    height: 8px;
    border: 2px solid var(--symbol-color);
    border-radius: 999px;
    background: #ffffff;
}

.symbol-mark.is-duplex-outlet::before,
.symbol-mark.is-gfci-outlet::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 4px;
    width: 2px;
    height: 10px;
    border-radius: 999px;
    background: var(--symbol-color);
    box-shadow: 7px 0 0 var(--symbol-color);
}

.symbol-mark.is-gfci-outlet::after {
    content: "G";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    color: var(--symbol-color);
    font-size: 8px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
}

.symbol-mark.is-gang-box {
    width: 18px;
    height: 18px;
}

.symbol-mark.is-gang-box::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 4px;
    width: 8px;
    height: 10px;
    border: 2px solid var(--symbol-color);
    background: linear-gradient(
        90deg,
        transparent calc(50% - 1px),
        var(--symbol-color) calc(50% - 1px),
        var(--symbol-color) calc(50% + 1px),
        transparent calc(50% + 1px));
    transform: translateX(-50%);
}

.symbol-mark.is-gang-box::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 6px;
    width: 3px;
    height: 3px;
    background: var(--symbol-color);
    border-radius: 999px;
    box-shadow: 0 7px 0 var(--symbol-color);
    transform: translateX(-50%);
}

.symbol-mark.is-can-light::before,
.symbol-mark.is-downlight::before,
.symbol-mark.is-light-fixture::before,
.symbol-mark.is-art-light::before,
.symbol-mark.is-pendant::before,
.symbol-mark.is-chandelier::before,
.symbol-mark.is-decorative-light::before {
    content: "";
    position: absolute;
    inset: 4px;
    border: 2px solid var(--symbol-color);
    border-radius: 999px;
}

.symbol-mark.is-downlight::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 7px;
    width: 10px;
    height: 10px;
    border: 2px solid var(--symbol-color);
    border-radius: 999px;
}

.symbol-mark.is-can-light::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 7px;
    width: 10px;
    height: 10px;
    background:
        linear-gradient(90deg, transparent 42%, var(--symbol-color) 42%, var(--symbol-color) 58%, transparent 58%),
        linear-gradient(0deg, transparent 42%, var(--symbol-color) 42%, var(--symbol-color) 58%, transparent 58%);
}

.symbol-mark.is-art-light::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 7px;
    width: 14px;
    height: 10px;
    background:
        linear-gradient(25deg, transparent 43%, var(--symbol-color) 43%, var(--symbol-color) 57%, transparent 57%),
        linear-gradient(155deg, transparent 43%, var(--symbol-color) 43%, var(--symbol-color) 57%, transparent 57%);
}

.symbol-mark.is-pendant::after {
    content: "";
    position: absolute;
    left: 11px;
    top: 3px;
    width: 2px;
    height: 13px;
    background: var(--symbol-color);
    box-shadow: 0 9px 0 2px var(--symbol-color);
}

.symbol-mark.is-chandelier::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 7px;
    width: 14px;
    height: 9px;
    border-bottom: 2px solid var(--symbol-color);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 -4px 0 -2px var(--symbol-color);
}

.symbol-mark.is-decorative-light::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 7px;
    width: 10px;
    height: 10px;
    border: 2px solid var(--symbol-color);
    transform: rotate(45deg);
}

.symbol-mark.is-light-fixture::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 5px;
    width: 14px;
    height: 14px;
    background:
        linear-gradient(45deg, transparent 46%, var(--symbol-color) 46%, var(--symbol-color) 54%, transparent 54%),
        linear-gradient(135deg, transparent 46%, var(--symbol-color) 46%, var(--symbol-color) 54%, transparent 54%);
}

.symbol-mark.is-ceiling-fan::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: var(--symbol-color);
    transform: translate(-50%, -50%);
}

.symbol-mark.is-ceiling-fan::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 13px;
    height: 13px;
    background:
        linear-gradient(90deg, transparent 44%, var(--symbol-color) 44%, var(--symbol-color) 56%, transparent 56%),
        linear-gradient(0deg, transparent 44%, var(--symbol-color) 44%, var(--symbol-color) 56%, transparent 56%);
    transform: translate(-50%, -50%) rotate(35deg);
}

.symbol-mark.is-exhaust-fan::before {
    content: "";
    position: absolute;
    inset: 4px;
    border: 2px solid var(--symbol-color);
    border-radius: 3px;
}

.symbol-mark.is-exhaust-fan::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 10px;
    background:
        linear-gradient(90deg, transparent 43%, var(--symbol-color) 43%, var(--symbol-color) 57%, transparent 57%),
        linear-gradient(0deg, transparent 43%, var(--symbol-color) 43%, var(--symbol-color) 57%, transparent 57%);
    transform: translate(-50%, -50%) rotate(45deg);
}

.symbol-mark.is-exhaust-fan-light::before {
    content: "";
    position: absolute;
    inset: 4px;
    border: 2px solid var(--symbol-color);
    border-radius: 3px;
}

.symbol-mark.is-exhaust-fan-light::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background:
        radial-gradient(circle at center, var(--symbol-color) 0 2px, transparent 2px),
        linear-gradient(90deg, transparent 43%, var(--symbol-color) 43%, var(--symbol-color) 57%, transparent 57%),
        linear-gradient(0deg, transparent 43%, var(--symbol-color) 43%, var(--symbol-color) 57%, transparent 57%);
    transform: translate(-50%, -50%) rotate(45deg);
}

.symbol-mark.is-wall-art-light {
    width: 22px;
    height: 16px;
}

.symbol-mark.is-sconce {
    width: 20px;
    height: 16px;
    border-radius: 0;
}

.symbol-mark.is-sconce::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 4px;
    width: 4px;
    height: 8px;
    background: var(--symbol-color);
}

.symbol-mark.is-sconce::after {
    content: "";
    position: absolute;
    left: 9px;
    top: 4px;
    width: 8px;
    height: 8px;
    border: 2px solid var(--symbol-color);
    border-left: 0;
    border-radius: 0 999px 999px 0;
}

.symbol-mark.is-landscape-light::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 5px;
    width: 12px;
    height: 8px;
    border: 2px solid var(--symbol-color);
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
    transform: translateX(-50%);
}

.symbol-mark.is-landscape-light::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 3px;
    width: 2px;
    height: 10px;
    background: var(--symbol-color);
    box-shadow: -5px 8px 0 0 var(--symbol-color), 5px 8px 0 0 var(--symbol-color);
    transform: translateX(-50%);
}

.symbol-mark.is-floodlight {
    width: 22px;
    height: 16px;
}

.symbol-mark.is-floodlight::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 5px;
    width: 5px;
    height: 6px;
    background: var(--symbol-color);
}

.symbol-mark.is-floodlight::after {
    content: "";
    position: absolute;
    left: 10px;
    top: 3px;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 10px solid color-mix(in srgb, var(--symbol-color) 62%, transparent);
}

.symbol-mark.is-rect-led-light,
.symbol-mark.is-fluorescent-fixture {
    width: 26px;
    height: 16px;
    border-radius: 0;
}

.symbol-mark.is-rect-led-light::before {
    content: "";
    position: absolute;
    left: 4px;
    right: 4px;
    top: 50%;
    height: 2px;
    background: var(--symbol-color);
    transform: translateY(-50%);
}

.symbol-mark.is-rect-led-light::after {
    content: "";
    position: absolute;
    inset: 4px;
    border: 2px solid var(--symbol-color);
}

.symbol-mark.is-fluorescent-fixture {
    width: 30px;
    height: 12px;
}

.symbol-mark.is-fluorescent-fixture::before {
    content: "";
    position: absolute;
    left: 5px;
    right: 5px;
    top: 3px;
    bottom: 3px;
    border-top: 2px solid var(--symbol-color);
    border-bottom: 2px solid var(--symbol-color);
}

.symbol-mark.is-fluorescent-fixture::after {
    content: "";
    position: absolute;
    inset: 3px;
    border: 2px solid var(--symbol-color);
}

.symbol-mark.is-wall-art-light::before {
    content: "";
    position: absolute;
    left: 4px;
    right: 4px;
    top: 3px;
    height: 3px;
    background: var(--symbol-color);
}

.symbol-mark.is-wall-art-light::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 7px;
    width: 10px;
    height: 7px;
    background:
        linear-gradient(25deg, transparent 43%, var(--symbol-color) 43%, var(--symbol-color) 57%, transparent 57%),
        linear-gradient(155deg, transparent 43%, var(--symbol-color) 43%, var(--symbol-color) 57%, transparent 57%);
}

.symbol-mark.is-light-fixture {
    overflow: hidden;
}

.symbol-mark.is-light-fixture span {
    display: none;
}

.symbol-mark.is-data-jack::before,
.symbol-mark.is-data-jack::after {
    content: "";
    position: absolute;
    top: 5px;
    width: 5px;
    height: 8px;
    border: 2px solid var(--symbol-color);
    background: #ffffff;
}

.symbol-mark.is-data-jack::before {
    left: 3px;
}

.symbol-mark.is-data-jack::after {
    right: 3px;
}

.symbol-mark.is-shade::before {
    content: "";
    position: absolute;
    left: 5px;
    right: 5px;
    top: 5px;
    height: 3px;
    border-radius: 999px;
    background: var(--symbol-color);
}

.symbol-mark.is-shade::after {
    content: "";
    position: absolute;
    right: 5px;
    top: 5px;
    width: 2px;
    height: 9px;
    background: var(--symbol-color);
}

.symbol-mark.is-rack::before {
    content: "";
    position: absolute;
    left: 4px;
    right: 4px;
    top: 5px;
    height: 2px;
    background: var(--symbol-color);
    box-shadow:
        0 5px 0 var(--symbol-color),
        0 10px 0 var(--symbol-color),
        0 15px 0 var(--symbol-color);
}

.symbol-mark.is-hv-panel {
    width: 18px;
    height: 24px;
}

.symbol-mark.is-hv-panel::before {
    content: "";
    position: absolute;
    left: 5px;
    right: 5px;
    top: 5px;
    bottom: 5px;
    border-left: 2px solid var(--symbol-color);
    border-right: 2px solid var(--symbol-color);
}

.symbol-mark.is-hv-panel::after {
    content: "";
    position: absolute;
    left: 4px;
    right: 4px;
    top: 8px;
    height: 2px;
    background: var(--symbol-color);
    box-shadow: 0 5px 0 var(--symbol-color), 0 10px 0 var(--symbol-color);
}

.symbol-mark.is-junction::before {
    content: "";
    position: absolute;
    left: 4px;
    right: 4px;
    top: 50%;
    height: 2px;
    background: var(--symbol-color);
    transform: translateY(-50%);
}

.symbol-mark.is-junction::after {
    width: 2px;
    height: 14px;
    border-radius: 0;
}

.symbol-mark.is-dmark::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 4px;
    width: 2px;
    height: 9px;
    background: var(--symbol-color);
    transform: translateX(-50%);
}

.symbol-mark.is-dmark::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 5px;
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: var(--symbol-color);
    box-shadow: 10px 5px 0 var(--symbol-color);
}

.symbol-mark.is-stub::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 8px;
    width: 12px;
    height: 2px;
    background: var(--symbol-color);
    transform: rotate(-35deg);
}

.symbol-mark.is-stub::after {
    content: "";
    position: absolute;
    right: 3px;
    top: 4px;
    width: 7px;
    height: 2px;
    background: var(--symbol-color);
}

.symbol-mark.is-generic::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 5px;
    width: 8px;
    height: 8px;
    border: 2px solid var(--symbol-color);
    background: #ffffff;
}

.object-list-title {
    justify-content: space-between;
}

.schedule-modal {
    width: min(1180px, calc(100vw - 56px));
    max-height: calc(100dvh - 72px);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    border: 1px solid rgba(123, 88, 182, 0.24);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.schedule-tabs {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-lavender);
    overflow-x: auto;
}

.schedule-tab {
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.schedule-tab.is-active {
    color: #ffffff;
    border-color: transparent;
    background: var(--purple-700);
}

.schedule-table-wrap {
    display: grid;
    align-content: start;
    gap: 10px;
    min-height: 0;
    padding: 12px;
    overflow: auto;
}

.schedule-table {
    width: 100%;
    min-width: 1320px;
    border-collapse: collapse;
    font-size: 12px;
}

.schedule-table th,
.schedule-table td {
    padding: 6px;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.schedule-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: var(--purple-850);
    background: var(--purple-100);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.schedule-table input,
.schedule-table select {
    width: 100%;
    min-width: 90px;
    height: 30px;
    padding: 0 7px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
}

.schedule-table select {
    color: var(--text);
}

.schedule-table .schedule-code-input {
    min-width: 54px;
    text-align: center;
    font-weight: 850;
    text-transform: uppercase;
}

.schedule-table .schedule-color-input {
    min-width: 46px;
    padding: 2px;
}

.schedule-table td:last-child,
.schedule-table th:last-child {
    width: 42px;
    text-align: center;
}

.schedule-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--line);
    background: var(--surface-lavender);
}

.area-edit-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.object-groups {
    display: grid;
    gap: 10px;
    padding: 10px;
}

.object-group {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
}

.object-group-toggle {
    width: 100%;
    min-height: 34px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: var(--surface-lavender);
    color: var(--purple-850);
    font-size: 12px;
    font-weight: 850;
    text-align: left;
    text-transform: uppercase;
}

.object-group-caret {
    display: inline-grid;
    place-items: center;
    color: var(--text-soft);
    font-weight: 900;
}

.object-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border: 1px solid var(--purple-200);
    border-radius: 999px;
    color: var(--purple-850);
    background: var(--purple-100);
    font-size: 12px;
}

.object-table-wrap {
    overflow: auto;
}

.object-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 12px;
    background: #ffffff;
}

.object-table th,
.object-table td {
    padding: 7px 8px;
    border-bottom: 1px solid #ece5f6;
    vertical-align: top;
}

.object-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: var(--purple-850);
    background: #f5efff;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
}

.object-table th:nth-child(1),
.object-table td:nth-child(1) {
    width: 34%;
}

.object-table th:nth-child(2),
.object-table td:nth-child(2) {
    width: 20%;
}

.object-table th:nth-child(3),
.object-table td:nth-child(3) {
    width: 20%;
}

.object-table th:nth-child(4),
.object-table td:nth-child(4) {
    width: 26%;
}

.object-table tbody tr {
    cursor: pointer;
}

.object-table tbody tr:hover {
    background: #f8f2ff;
}

.object-table tbody tr.is-selected {
    background: var(--purple-100);
    box-shadow: inset 3px 0 0 var(--purple-700);
}

.table-sort-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-height: 26px;
    padding: 0;
    border: 0;
    color: var(--purple-850);
    background: transparent;
    font: inherit;
    font-weight: 800;
    text-align: left;
}

.table-sort-button span {
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 700;
}

.object-kind {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    margin-bottom: 5px;
    padding: 0 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text-muted);
    background: #ffffff;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.object-kind.is-symbol {
    border-color: var(--purple-200);
    color: var(--purple-850);
    background: var(--purple-100);
}

.object-kind.is-wire {
    border-color: #f2b2b2;
    color: #9b1c1c;
}

.object-kind.is-area {
    border-color: #93c5fd;
    color: #075985;
    background: #eff6ff;
}

.object-kind.is-label {
    border-color: #d9d2e6;
    color: var(--text-muted);
    background: #f1eef7;
}

.object-type {
    display: block;
    overflow-wrap: anywhere;
    color: var(--text);
    font-weight: 700;
    line-height: 1.25;
}

.object-id,
.object-label {
    display: block;
    line-height: 1.25;
}

.object-id {
    color: var(--purple-850);
    font-size: 11px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.object-label {
    overflow-wrap: anywhere;
}

.object-text-input {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 6px 7px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    background: #ffffff;
    font: inherit;
    resize: vertical;
}

.object-text-input.is-compact {
    min-height: 32px;
    resize: vertical;
}

.object-text-input:focus {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(128, 80, 223, 0.16);
    outline-offset: 1px;
    border-color: var(--accent);
}

.canvas-stage {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    padding: 14px;
    border: 1px solid rgba(123, 88, 182, 0.24);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 245, 255, 0.94)),
        linear-gradient(90deg, rgba(128, 80, 223, 0.08), rgba(192, 38, 211, 0.04));
    box-shadow: var(--shadow);
}

.canvas-empty-state {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 3;
    display: grid;
    gap: 6px;
    width: min(320px, calc(100% - 64px));
    padding: 14px 16px;
    border: 1px dashed rgba(128, 80, 223, 0.38);
    border-radius: var(--radius);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.74);
    box-shadow: var(--shadow-tight);
    text-align: center;
    pointer-events: none;
    transform: translate(-50%, -50%);
    backdrop-filter: blur(8px);
}

.canvas-empty-state strong {
    color: var(--purple-850);
    font-size: 13px;
    font-weight: 850;
}

.canvas-empty-state span {
    font-size: 12px;
    line-height: 1.35;
}

.canvas-host {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(90deg, rgba(109, 54, 197, 0.06) 1px, transparent 1px),
        linear-gradient(0deg, rgba(109, 54, 197, 0.06) 1px, transparent 1px),
        #fbf8ff;
    background-size: 24px 24px;
}

.canvas-legend {
    grid-row: 1;
    width: 100%;
    max-height: 50vh;
    overflow: auto;
    border: 1px solid rgba(17, 24, 39, 0.22);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-tight);
    scrollbar-gutter: stable;
}

.canvas-legend[hidden] {
    display: none;
}

.canvas-legend[hidden] + .properties-panel {
    grid-row: 1;
}

.canvas-legend-title {
    padding: 8px 10px 7px;
    border-bottom: 1px solid rgba(17, 24, 39, 0.12);
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
}

.canvas-legend-table {
    display: grid;
}

.canvas-legend-header,
.canvas-legend-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    padding: 0 10px;
}

.canvas-legend-header {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}

.canvas-legend-row {
    border-top: 1px solid rgba(17, 24, 39, 0.08);
    color: var(--text);
    font-size: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.legend-symbol {
    flex: 0 0 auto;
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--legend-color);
    border-radius: 3px;
    background: color-mix(in srgb, var(--legend-color) 18%, #ffffff);
}

.legend-symbol.is-circle {
    border-radius: 999px;
}

.legend-name {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.legend-name strong {
    min-width: 18px;
    color: var(--text);
    font-size: 11px;
    font-weight: 900;
}

.legend-name span {
    overflow: hidden;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.legend-count {
    color: var(--text);
    font-size: 12px;
    font-weight: 850;
    text-align: right;
}

.canvas-zoom-hud {
    position: absolute;
    right: 26px;
    bottom: 26px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px;
    border: 1px solid rgba(222, 211, 239, 0.9);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-tight);
    backdrop-filter: blur(12px);
}

.zoom-range {
    width: 128px;
    height: 24px;
    accent-color: var(--purple-700);
}

.zoom-percent {
    min-width: 48px;
    color: var(--purple-850);
    font-size: 12px;
    font-weight: 850;
    text-align: center;
}

.canvas-container {
    width: 100% !important;
    height: 100% !important;
}

.properties-panel {
    grid-row: 2;
    padding-bottom: 18px;
}

.empty-panel {
    margin: 16px 14px;
    padding: 16px 0;
    color: var(--muted);
    font-size: 13px;
    border-bottom: 1px solid var(--panel-border);
}

.property-stack {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.property-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--panel-border);
}

.property-heading strong,
.modal-header strong {
    color: var(--purple-950);
    font-weight: 850;
}

.property-actions {
    display: flex;
    gap: 6px;
}

.property-stack label {
    display: grid;
    gap: 5px;
    min-width: 0;
    font-size: 12px;
    font-weight: 850;
    color: var(--text-muted);
    text-transform: uppercase;
}

.property-stack input[type="text"],
.property-stack input[type="number"],
.property-stack input[type="color"],
.property-stack select,
.property-stack textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
    color: var(--text);
}

.property-stack input:focus,
.property-stack select:focus,
.property-stack textarea:focus,
.type-editor input:focus,
.type-editor select:focus {
    outline: 0;
    border-color: var(--purple-600);
    box-shadow: 0 0 0 3px rgba(128, 80, 223, 0.16);
}

.property-stack input[type="text"],
.property-stack input[type="number"],
.property-stack select {
    height: 34px;
    padding: 0 9px;
}

.property-stack input[type="color"] {
    height: 34px;
    padding: 3px;
}

.property-stack textarea {
    min-height: 76px;
    padding: 8px 9px;
    resize: vertical;
}

.property-stack label.is-rule-disabled {
    color: var(--muted);
}

.property-stack label.is-rule-disabled input,
.property-stack label.is-rule-disabled select {
    color: var(--muted);
    background: #f8fafc;
}

.property-rule-note {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.3;
    text-transform: none;
}

.field-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
}

.toggle-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.toggle-row label {
    display: inline-flex;
    grid-template-columns: none;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    text-transform: none;
}

.wire-point-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.group-layout-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.mini-heading {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.empty-inline {
    padding: 8px 0;
    color: var(--muted);
    font-size: 12px;
}

.cable-drop-stack {
    display: grid;
    gap: 8px;
}

.gang-box-stack {
    display: grid;
    gap: 10px;
}

.gang-slot-list {
    display: grid;
    gap: 10px;
}

.gang-slot-card {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
}

.gang-slot-title {
    color: var(--purple-850);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.cable-drop-row {
    display: grid;
    grid-template-columns: minmax(78px, 0.8fr) minmax(0, 1fr) 32px;
    gap: 6px;
    align-items: center;
}

.cable-drop-row select,
.cable-drop-row input {
    min-width: 0;
}

.secondary-button,
.primary-button {
    min-height: 36px;
    padding: 0 12px;
    font-weight: 700;
}

.secondary-button.danger-soft {
    color: var(--red);
    border-color: #fecaca;
    background: #fff1f2;
}

.primary-button {
    color: #ffffff;
    background: linear-gradient(135deg, var(--purple-700), var(--magenta));
    border-color: transparent;
    box-shadow: 0 8px 18px rgba(128, 80, 223, 0.22);
}

.primary-button:hover {
    background: linear-gradient(135deg, var(--purple-850), var(--magenta));
}

.icon-button {
    width: 32px;
    height: 32px;
    padding: 0;
}

.icon-button.danger {
    color: var(--danger);
}

.toast-status {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 20;
    max-width: min(420px, calc(100vw - 36px));
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--purple-850);
    background: #ffffff;
    box-shadow: var(--shadow);
    font-size: 13px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(38, 16, 71, 0.34);
    backdrop-filter: blur(6px);
}

.manage-types-modal {
    display: grid;
    grid-template-rows: 48px minmax(0, 1fr);
    width: min(920px, calc(100vw - 40px));
    max-height: min(720px, calc(100dvh - 40px));
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px;
    border-bottom: 1px solid var(--panel-border);
    background: var(--surface-lavender);
}

.confirm-modal {
    width: min(440px, calc(100vw - 40px));
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow);
}

.confirm-modal-body {
    display: grid;
    gap: 16px;
    padding: 16px;
}

.confirm-modal-body p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.45;
}

.open-project-modal {
    display: grid;
    grid-template-rows: 48px minmax(0, 1fr);
    width: min(760px, calc(100vw - 40px));
    max-height: min(760px, calc(100dvh - 40px));
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow);
}

.open-project-body {
    display: grid;
    gap: 14px;
    min-height: 0;
    padding: 14px;
    overflow: auto;
}

.open-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.open-action-card {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    grid-template-areas:
        "icon title"
        "icon text";
    align-items: center;
    gap: 2px 10px;
    min-height: 88px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    background: var(--control-bg);
    text-align: left;
    cursor: pointer;
}

button.open-action-card {
    font: inherit;
}

.open-action-card:hover,
.open-action-card:focus-visible {
    outline: none;
    border-color: var(--line-strong);
    background: var(--surface-lavender);
    color: var(--purple-850);
}

.open-action-card svg {
    grid-area: icon;
    width: 22px;
    height: 22px;
    stroke-width: 2;
}

.open-action-title {
    grid-area: title;
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.open-action-text {
    grid-area: text;
    min-width: 0;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.35;
}

.open-dialog-status {
    padding: 9px 10px;
    border: 1px solid rgba(222, 211, 239, 0.92);
    border-radius: var(--radius);
    color: var(--purple-850);
    background: var(--surface-lavender);
    font-size: 13px;
}

.project-start-modal {
    display: grid;
    grid-template-rows: 48px minmax(0, 1fr);
    width: min(720px, calc(100vw - 40px));
    max-height: min(740px, calc(100dvh - 40px));
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow);
}

.project-start-title {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.project-start-title span {
    overflow: hidden;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-start-body {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 14px;
    min-height: 0;
    padding: 14px;
    overflow: auto;
}

.project-start-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.project-start-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    min-height: 42px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    background: #ffffff;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.project-start-tab:hover,
.project-start-tab:focus-visible {
    outline: none;
    border-color: var(--line-strong);
    background: var(--surface-lavender);
    color: var(--purple-850);
}

.project-start-tab.is-active {
    color: #ffffff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--purple-700), var(--magenta));
    box-shadow: 0 8px 18px rgba(128, 80, 223, 0.18);
}

.project-start-tab svg,
.project-start-empty svg,
.project-start-import-drop svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.project-start-status {
    padding: 9px 10px;
    border: 1px solid rgba(222, 211, 239, 0.92);
    border-radius: var(--radius);
    color: var(--purple-850);
    background: var(--surface-lavender);
    font-size: 13px;
}

.project-start-panel {
    display: grid;
    align-content: start;
    gap: 14px;
    min-height: 0;
}

.project-start-field {
    display: grid;
    gap: 6px;
    min-width: 0;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.project-start-field input {
    width: 100%;
    min-width: 0;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    background: #ffffff;
    text-transform: none;
}

.project-start-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.project-start-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.project-start-list-header strong {
    min-width: 0;
    overflow: hidden;
    color: var(--purple-950);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-start-projects {
    display: grid;
    gap: 6px;
    max-height: 360px;
    overflow: auto;
}

.project-start-project-row {
    display: grid;
    grid-template-columns: minmax(120px, 1.15fr) minmax(180px, 1.35fr) minmax(130px, 1fr) minmax(120px, 0.8fr);
    align-items: center;
    gap: 6px 10px;
    min-height: 50px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    background: #ffffff;
    text-align: left;
}

.project-start-project-row:hover,
.project-start-project-row:focus-visible {
    outline: none;
    border-color: var(--line-strong);
    background: var(--surface-lavender);
}

.project-start-project-name,
.project-start-project-counts,
.project-start-project-source,
.project-start-project-updated {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-start-project-name {
    color: var(--purple-950);
    font-weight: 850;
}

.project-start-project-counts,
.project-start-project-source,
.project-start-project-updated,
.project-start-empty,
.project-start-import-text {
    color: var(--text-muted);
    font-size: 12px;
}

.project-start-project-tags {
    display: flex;
    grid-column: 1 / -1;
    flex-wrap: wrap;
    gap: 6px;
}

.project-start-project-tags span {
    min-height: 22px;
    padding: 3px 7px;
    border: 1px solid rgba(222, 211, 239, 0.92);
    border-radius: 999px;
    color: var(--text-soft);
    background: var(--surface-lavender);
    font-size: 11px;
    font-weight: 800;
}

.project-start-empty {
    display: grid;
    place-items: center;
    gap: 7px;
    min-height: 112px;
    padding: 18px 10px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    text-align: center;
}

.project-start-import-drop {
    display: grid;
    justify-items: center;
    gap: 7px;
    min-height: 170px;
    padding: 28px 18px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    color: var(--purple-850);
    background: var(--surface-lavender);
    text-align: center;
    cursor: pointer;
}

.project-start-import-drop:hover,
.project-start-import-drop:focus-within {
    border-color: var(--purple-700);
    background: var(--purple-100);
}

.project-start-import-drop.is-disabled {
    cursor: not-allowed;
    opacity: 0.64;
}

.project-start-import-drop svg {
    width: 28px;
    height: 28px;
}

.project-start-import-title {
    color: var(--purple-950);
    font-size: 14px;
    font-weight: 850;
}

.project-start-file-input {
    position: fixed;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.kos-project-list {
    display: grid;
    gap: 10px;
    min-height: 0;
}

.kos-project-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.kos-project-list-items {
    display: grid;
    gap: 6px;
    max-height: 290px;
    overflow: auto;
}

.kos-project-row {
    display: grid;
    grid-template-columns: minmax(120px, 1.35fr) minmax(190px, 1.3fr) minmax(120px, 1fr) minmax(130px, 0.8fr);
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    background: #ffffff;
    text-align: left;
}

.kos-project-row:hover,
.kos-project-row:focus-visible {
    outline: none;
    border-color: var(--line-strong);
    background: var(--surface-lavender);
}

.kos-project-name,
.kos-project-meta,
.kos-project-source,
.kos-project-updated {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kos-project-name {
    font-weight: 800;
}

.kos-project-meta,
.kos-project-source,
.kos-project-updated,
.empty-project-list {
    color: var(--text-muted);
    font-size: 12px;
}

.empty-project-list {
    padding: 18px 10px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    text-align: center;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.manage-types-body {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 0;
}

.type-list {
    display: grid;
    align-content: start;
    gap: 6px;
    padding: 12px;
    overflow: auto;
    border-right: 1px solid var(--panel-border);
    background: var(--surface-lavender);
}

.type-list-button {
    display: grid;
    gap: 2px;
    min-height: 44px;
    padding: 7px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    background: #ffffff;
    text-align: left;
}

.type-list-button.is-active {
    border-color: var(--accent);
    background: var(--purple-100);
    box-shadow: inset 3px 0 0 var(--accent);
}

.type-list-button span {
    overflow: hidden;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.18;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.type-list-button small {
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
}

.type-editor {
    display: grid;
    align-content: start;
    gap: 12px;
    min-width: 0;
    padding: 14px;
    overflow: auto;
}

.type-editor label {
    display: grid;
    gap: 5px;
    min-width: 0;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.type-editor input,
.type-editor select {
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    background: #ffffff;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--panel-border);
}

.command-console-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 72px 24px 24px;
    background: rgba(15, 23, 42, 0.28);
}

.command-console {
    width: min(920px, calc(100vw - 48px));
    max-height: calc(100vh - 112px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
}

.command-console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.command-console-header div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.command-console-header span {
    color: #64748b;
    font-size: 12px;
}

.command-console-body {
    display: grid;
    grid-template-rows: auto minmax(180px, 1fr) auto auto minmax(120px, 0.7fr);
    gap: 10px;
    min-height: 0;
    padding: 14px;
}

.command-console-help,
.command-console-actions,
.command-console-examples {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.command-console-input {
    width: 100%;
    min-height: 180px;
    resize: vertical;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    line-height: 1.45;
}

.command-console-output {
    min-height: 120px;
    overflow: auto;
    margin: 0;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 12px;
    line-height: 1.45;
}

.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #334155;
    font-size: 12px;
}

.link-button {
    border: 0;
    background: transparent;
    color: #2563eb;
    font: inherit;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
}

.ai-help-page {
    min-height: 100vh;
    padding: 32px;
    background: #f1f5f9;
}

.ai-help-panel {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
}

.ai-help-panel h1,
.ai-help-panel h2 {
    margin: 0 0 10px;
}

.ai-help-panel p {
    color: #475569;
}

.ai-help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 20px 0;
}

.ai-help-grid article {
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.ai-object-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
    padding: 0;
    list-style: none;
}

.ai-object-list li {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.ai-object-list span {
    color: #64748b;
    font-size: 13px;
}

.login-page,
.admin-page {
    width: 100vw;
    height: 100dvh;
    overflow: auto;
}

.login-page {
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-panel {
    display: grid;
    gap: 18px;
    width: min(420px, calc(100vw - 40px));
    padding: 24px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.login-brand h1 {
    margin: 0;
    color: var(--purple-950);
    font-size: 1.1rem;
}

.login-brand span {
    color: var(--text-soft);
    font-size: 0.84rem;
}

.login-form {
    display: grid;
    gap: 14px;
}

.login-form label,
.admin-add-user label {
    display: grid;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.login-form input,
.admin-add-user input {
    min-width: 0;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
}

.login-status {
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 0.84rem;
    font-weight: 750;
}

.login-status.error {
    border: 1px solid #fecaca;
    color: var(--red);
    background: #fff1f2;
}

.login-status.warning {
    border: 1px solid #fde68a;
    color: var(--amber);
    background: #fffbeb;
}

.auth-redirect {
    padding: 24px;
}

.admin-page {
    display: grid;
    grid-template-rows: auto minmax(0, auto) minmax(0, auto);
    gap: 18px;
    padding: 18px;
}

.admin-header,
.admin-section {
    width: min(1180px, 100%);
    margin: 0 auto;
    border: 1px solid rgba(119, 82, 178, 0.22);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow-tight);
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 68px;
    padding: 12px 14px;
}

.admin-nav,
.admin-actions,
.admin-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

.admin-section {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.admin-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.admin-section-header h2 {
    margin: 0;
    color: var(--purple-950);
    font-size: 1rem;
}

.admin-section-header p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.admin-add-user {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.admin-user-table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.admin-user-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    background: var(--surface);
}

.admin-user-table th,
.admin-user-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 0.84rem;
}

.admin-user-table th {
    color: var(--text-soft);
    background: var(--surface-lavender);
    font-size: 0.74rem;
    font-weight: 850;
    text-transform: uppercase;
}

.admin-user-table tr:last-child td {
    border-bottom: 0;
}

.admin-role-chip,
.admin-result {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 8px;
    border: 1px solid var(--purple-200);
    border-radius: var(--radius);
    color: var(--purple-850);
    background: var(--purple-100);
    font-size: 0.76rem;
    font-weight: 800;
}

.admin-role-chip.muted {
    border-color: var(--line);
    color: var(--text-muted);
    background: var(--surface-lavender);
}

.admin-empty {
    color: var(--text-soft);
}

@media (max-width: 1180px) {
    .designer-topbar {
        grid-template-columns: 1fr;
    }

    .top-toolbar,
    .designer-top-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .admin-header,
    .admin-section-header,
    .admin-actions,
    .admin-nav {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-add-user {
        grid-template-columns: 1fr;
    }
}

.blazor-error-boundary {
    padding: 1rem;
    color: #ffffff;
    background: #b32121;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

@media (max-width: 980px) {
    .designer-main {
        grid-template-columns: 300px minmax(320px, 1fr);
    }

    .right-panel {
        display: none;
    }

    .open-actions-grid {
        grid-template-columns: 1fr;
    }

    .kos-project-row {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .project-start-tabs,
    .project-start-project-row {
        grid-template-columns: 1fr;
    }

    .project-start-project-tags {
        grid-column: auto;
    }

    .project-start-actions {
        justify-content: stretch;
    }

    .project-start-actions .primary-button {
        width: 100%;
    }
}

@media (max-width: 1400px) {
    .toolbar-button {
        min-width: 34px;
        padding: 0 8px;
    }

    .top-toolbar .toolbar-button > span {
        display: none;
    }

    .wire-button span:last-child {
        display: inline;
    }

    .toolbar-group {
        gap: 5px;
        padding: 4px;
    }
}

@media (max-width: 720px) {
    .designer-app {
        padding: 10px;
        gap: 10px;
    }

    .designer-main {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .left-panel {
        display: none;
    }

    .wire-button span:last-child {
        display: inline;
    }
}
