@font-face {
    font-family: "GENISO";
    src: local("GENISO"), url("/Fonts/GENISO.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

:root {
    --bg: #0b111c;
    --panel: #151d2a;
    --panel2: #1b2433;
    --line: #2a3850;
    --text: #eef6ff;
    --muted: #9eb2cc;
    --construction-axis-x: #f87171;
    --construction-axis-y: #4ade80;
    --construction-axis-z: #60a5fa;
    --field: #09111d;
    --accent: #f28a08;
    --bom-grid-line: color-mix(in srgb, var(--text) 18%, transparent);
    --menu-density: 1;
    --topbar-control-height: 30px;
    --project-panel-width: 360px;
    --bom-panel-width: 440px;
    --bom-description-column-width: 240px;
}

* {
    box-sizing: border-box;
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0) transparent;
}

*:hover {
    scrollbar-color: rgba(156, 163, 175, 0.72) transparent;
}

*::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: transparent;
}

*:hover::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.72);
}

*::-webkit-scrollbar-button {
    width: 0;
    height: 0;
    display: none;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, Segoe UI, Arial, sans-serif;
    display: grid;
    grid-template-columns: var(--project-panel-width) minmax(0, 1fr);
}

body.browser-open {
    grid-template-columns: var(--project-panel-width) var(--bom-panel-width) minmax(0, 1fr);
}

body[data-theme="day"] {
    --construction-axis-x: #dc2626;
    --construction-axis-y: #16803c;
    --construction-axis-z: #1e40af;
    --bg: #e8edf2;
    --panel: #f7f9fb;
    --panel2: #ffffff;
    --line: #c3cedb;
    --text: #1f2937;
    --muted: #5d6b7a;
    --field: #ffffff;
    --accent: #69727c;
    --bom-grid-line: color-mix(in srgb, var(--text) 16%, transparent);
}

.panel {
    grid-column: 1;
    grid-row: 1;
    height: 100vh;
    overflow: auto;
    background: linear-gradient(180deg, var(--panel2), var(--panel));
    border-right: 1px solid var(--line);
    padding: calc(18px * var(--menu-density));
}

.project-panel-resize-handle {
    position: fixed;
    top: 0;
    bottom: 0;
    left: calc(var(--project-panel-width) - 5px);
    z-index: 45;
    width: 10px;
    border: 0;
    background: transparent;
    cursor: col-resize;
    touch-action: none;
}

.project-panel-resize-handle::after {
    content: "";
    position: absolute;
    top: 0;
    right: 4px;
    bottom: 0;
    width: 1px;
    background: color-mix(in srgb, var(--line) 82%, transparent);
    transition: width 120ms ease, background-color 120ms ease;
}

.project-panel-resize-handle:hover::after,
.project-panel-resize-handle:focus-visible::after,
body.project-panel-resizing .project-panel-resize-handle::after {
    width: 3px;
    background: color-mix(in srgb, #38bdf8 78%, var(--line));
}

.project-panel-resize-handle:focus-visible {
    outline: 0;
}

body.project-panel-resizing,
body.project-panel-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
}

.app-header {
    display: flex;
    gap: calc(14px * var(--menu-density));
    align-items: center;
    margin-bottom: calc(20px * var(--menu-density));
}

.badge {
    width: calc(78px * var(--menu-density));
    height: calc(46px * var(--menu-density));
    border-radius: calc(8px * var(--menu-density));
    background: transparent;
    display: grid;
    place-items: center;
    padding: 2px;
    overflow: hidden;
}

.badge img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
}

h1 {
    font-size: calc(21px * var(--menu-density));
    margin: 0;
}

header p,
.topbar p {
    margin: calc(3px * var(--menu-density)) 0 0;
    color: var(--muted);
    font-size: calc(13.333px * var(--menu-density));
}

#summary {
    font-size: 11px;
    line-height: 1.35;
}

.app-header > div:has(#generatorType) { min-width: 0; }
.app-header #generatorType {
    appearance: none;
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    height: auto;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: inherit;
    letter-spacing: 0;
    box-shadow: none;
    cursor: pointer;
}
.app-header #generatorType:focus-visible { outline: 1px solid var(--muted); outline-offset: 3px; }
.app-header #generatorType option { color: CanvasText; background: Canvas; }
body[data-generator-type="straight"] .spiral-only { display: none !important; }
body[data-generator-type="straight"] #addFlightButton { display: none !important; }
body[data-generator-type="straight"] .straight-export-blocked { opacity: .38; cursor: not-allowed; }

#summary:empty {
    display: none;
}

.command-status {
    margin: 3px 0 0;
    color: color-mix(in srgb, var(--muted) 74%, transparent);
    font-size: 10px;
    line-height: 1.25;
    min-height: 13px;
    max-width: 720px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.command-status[data-mode="error"] {
    color: color-mix(in srgb, #ef4444 72%, var(--muted));
}

.command-status[data-mode="success"] {
    color: color-mix(in srgb, #22c55e 82%, var(--muted));
}

.command-status[data-cache="building"] {
    color: color-mix(in srgb, #facc15 84%, var(--muted));
}

.command-status[data-mode="progress"] {
    position: relative;
    color: color-mix(in srgb, #38bdf8 78%, var(--muted));
    padding-bottom: 5px;
}

.command-status[data-mode="progress"]::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--line) 72%, transparent);
}

.command-status[data-mode="progress"]::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 1;
    width: 38%;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent 0%, #38bdf8 45%, transparent 90%);
    animation: command-status-progress 1.2s linear infinite;
}

.command-status[data-mode="progress"][data-progress]::before {
    width: var(--progress-value, 0%);
    background: linear-gradient(90deg, #0ea5e9, #38bdf8);
    animation: none;
}

@keyframes command-status-progress {
    from { transform: translateX(-120%); }
    to { transform: translateX(320%); }
}

.stats-panel {
    position: absolute;
    left: 18px;
    top: 18px;
    z-index: 10;
    width: min(330px, calc(100% - 36px));
    color: var(--text);
    background: color-mix(in srgb, var(--panel2) 58%, transparent);
    border: 1px solid color-mix(in srgb, var(--text) 22%, transparent);
    border-radius: 8px;
    /* Avoid filtered WebGL backdrop layers, which corrupt on some GPU drivers. */
    box-shadow: none;
    backdrop-filter: none;
    overflow: hidden;
}

.stats-content {
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.6;
}

.stats-line {
    white-space: nowrap;
}

.stats-line.stats-wrap {
    white-space: normal;
    overflow-wrap: anywhere;
}

.stats-line-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.webcon-version {
    margin-left: auto;
    color: color-mix(in srgb, var(--text) 58%, transparent);
    font-size: 10px;
    font-weight: 600;
    text-align: right;
}

.halfcage-opening-info {
    color: #008ee6;
}

.stats-warning {
    color: #ef4444;
    font-weight: 900;
}

.stats-total-height {
    font-weight: 900;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.stats-flight-tab-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 7px 0 5px;
}

.stats-flight-tabs {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    max-width: 100%;
    overflow: visible;
}

.stats-flight-tab {
    flex: 0 0 auto;
    border: 1px solid color-mix(in srgb, var(--text) 20%, transparent);
    border-radius: 6px 6px 0 0;
    min-height: 20px;
    padding: 2px 7px;
    background: color-mix(in srgb, var(--panel) 56%, transparent);
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-weight: 400;
    font-size: 11px;
    line-height: 1.05;
}

.stats-flight-tab.is-active {
    border-color: #38d7c2;
    color: var(--text);
    background: color-mix(in srgb, #38d7c2 14%, var(--panel));
}

.stats-flight-alert {
    color: #ef4444;
    margin-left: 4px;
    font-weight: 1000;
}

.stats-panel.is-collapsed .stats-extra {
    display: none;
}

.stats-toggle {
    width: 100%;
    border: 0;
    border-top: 1px solid color-mix(in srgb, var(--text) 16%, transparent);
    background: color-mix(in srgb, var(--panel) 34%, transparent);
    color: var(--muted);
    cursor: pointer;
    font-weight: 900;
    letter-spacing: 0;
    padding: 4px 0 6px;
}

.stats-toggle:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--line) 36%, transparent);
}

.steps-suggestion {
    display: none;
    color: #ef4444;
    font-weight: 900;
    margin-left: 6px;
}

.steps-suggestion.is-visible {
    display: inline;
}

.browser-toggle {
    width: calc(46px * var(--menu-density));
    height: calc(46px * var(--menu-density));
    margin-left: auto;
    border: 1px solid color-mix(in srgb, var(--text) 72%, transparent);
    border-radius: calc(14px * var(--menu-density));
    color: var(--text);
    background: transparent;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: calc(20px * var(--menu-density));
    font-weight: 900;
    line-height: 1;
    position: relative;
}

.browser-toggle::before {
    content: "";
    width: calc(23px * var(--menu-density));
    height: calc(20px * var(--menu-density));
    background: currentColor;
    -webkit-mask: var(--icon-bom-panel) center / contain no-repeat;
    mask: var(--icon-bom-panel) center / contain no-repeat;
    transform: translateX(1.8px) scaleX(-1);
    transition: transform 120ms ease;
}

.browser-toggle::after {
    content: none;
}

.browser-toggle[aria-expanded="true"]::before {
    transform: translateX(-1.8px) scaleX(1);
}

.browser-toggle:hover {
    border-color: var(--text);
    background: color-mix(in srgb, var(--line) 35%, transparent);
}

section {
    background: linear-gradient(180deg, var(--panel2), var(--panel));
    border: 1px solid var(--line);
    border-radius: calc(16px * var(--menu-density));
    padding: calc(13px * var(--menu-density));
    margin-bottom: calc(11px * var(--menu-density));
}

h2 {
    margin: 0 0 calc(11px * var(--menu-density));
    font-size: calc(15px * var(--menu-density));
}

.section-header-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    cursor: pointer;
    font: inherit;
    font-size: calc(15px * var(--menu-density));
    font-weight: 800;
    text-align: left;
}

.section-chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 120ms ease;
    margin-right: 4px;
}

.section-header-toggle[aria-expanded="true"] .section-chevron {
    transform: rotate(-135deg);
}

.collapsible-section.is-collapsed .collapsible-section-content {
    display: none;
}

.collapsible-section-content {
    padding-top: calc(8px * var(--menu-density));
}

label {
    display: block;
    color: var(--muted);
    font-size: calc(12px * var(--menu-density));
    margin: calc(8px * var(--menu-density)) 0;
}

.panel .menu-field {
    position: relative;
    margin: calc(7px * var(--menu-density)) 0 calc(5px * var(--menu-density));
    padding-top: calc(6px * var(--menu-density));
}

.panel .menu-field-legend {
    position: absolute;
    top: calc(6px * var(--menu-density) + 0.5px);
    transform: translateY(-50%);
    left: calc(10px * var(--menu-density));
    z-index: 2;
    max-width: calc(100% - calc(20px * var(--menu-density)));
    padding: 0 calc(3px * var(--menu-density));
    overflow: hidden;
    background: transparent;
    color: var(--muted);
    font-size: calc(10px * var(--menu-density));
    font-weight: 400;
    line-height: calc(12px * var(--menu-density));
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

body[data-theme="night"] .panel .menu-field-legend {
    background: transparent;
}

.panel .menu-field > input,
.panel .menu-field > select,
.panel .menu-field > .direction-control {
    margin-top: 0;
}

.panel .menu-field > .direction-control select {
    margin-top: 0;
}

.panel .menu-field > .steps-suggestion {
    position: static;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    font-size: calc(12px * var(--menu-density));
    font-weight: 400;
    line-height: calc(14px * var(--menu-density));
    text-align: right;
    white-space: normal;
    overflow-wrap: anywhere;
    grid-column: 2;
    grid-row: 1;
}

.panel .menu-field:has(> .steps-suggestion.is-visible) {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
    column-gap: calc(8px * var(--menu-density));
    row-gap: calc(4px * var(--menu-density));
    padding-top: 0;
}

.panel .menu-field:has(> .steps-suggestion.is-visible) > .menu-field-legend {
    position: static;
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    transform: translateY(calc(-50% + 0.5px));
    max-width: 100%;
    padding-left: calc(13px * var(--menu-density));
}

.panel .menu-field:has(> .steps-suggestion.is-visible) > input {
    grid-column: 1 / -1;
    grid-row: 2;
}

.panel .menu-field > .steps-suggestion.is-visible {
    display: block;
}

.project-rev-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 74px;
    gap: calc(12px * var(--menu-density));
    align-items: end;
    padding-bottom: 0;
    margin-bottom: calc(4px * var(--menu-density));
}

.project-rev-row label {
    margin: 0;
}

.project-state-country-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px;
    gap: calc(10px * var(--menu-density));
    align-items: end;
}

body[data-generator-type="straight"] .project-state-country-row { grid-template-columns: minmax(0, 1fr); }

input,
select {
    width: 100%;
    margin-top: calc(5px * var(--menu-density));
    background: var(--field);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: calc(10px * var(--menu-density));
    padding: calc(8px * var(--menu-density)) calc(10px * var(--menu-density));
    font-weight: 700;
    font-size: calc(13.333px * var(--menu-density));
}

input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 800;
}

.checkbox-field input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
    accent-color: #38d7c2;
}

.checkbox-field.is-disabled {
    color: color-mix(in srgb, var(--muted) 62%, transparent);
}

input::placeholder {
    color: color-mix(in srgb, var(--muted) 70%, transparent);
    font-weight: 400;
}

.conditional-field {
    margin-top: -4px;
}

.conditional-field[hidden] {
    display: none;
}

.surface-finish-row,
.construction-color-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 86px;
    gap: calc(10px * var(--menu-density));
    align-items: end;
}

.surface-finish-row:has(.conditional-field[hidden]),
.construction-color-row:has(.conditional-field[hidden]) {
    grid-template-columns: minmax(0, 1fr);
}

.surface-finish-row label,
.construction-color-row label {
    margin-bottom: 0;
}

.project-data-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 86px;
    gap: calc(10px * var(--menu-density));
    align-items: end;
}

.landing-size-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: calc(10px * var(--menu-density));
    align-items: end;
}

.landing-size-row label {
    margin-bottom: 0;
}

.landing-rails-field {
    position: relative;
    min-width: 0;
    margin-top: calc(7px * var(--menu-density));
    margin-bottom: calc(5px * var(--menu-density));
    padding-top: calc(6px * var(--menu-density));
}

.landing-rails-label-row {
    position: absolute;
    top: calc(6px * var(--menu-density) + 0.5px);
    transform: translateY(-50%);
    left: calc(10px * var(--menu-density));
    right: calc(7px * var(--menu-density));
    z-index: 2;
    min-height: calc(12px * var(--menu-density));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: calc(8px * var(--menu-density));
    margin-bottom: 0;
    pointer-events: none;
}

.landing-rails-label-row label {
    min-width: 0;
    margin: 0;
    padding: 0 calc(3px * var(--menu-density));
    overflow: hidden;
    background: transparent;
    font-size: calc(10px * var(--menu-density));
    font-weight: 400;
    line-height: calc(12px * var(--menu-density));
    text-overflow: ellipsis;
    white-space: nowrap;
}

.landing-toe-plate-button {
    margin-right: 8px;
    flex: 0 0 auto;
    margin: 1px 0;
    min-height: 0;
    border: 1px solid color-mix(in srgb, #38d7c2 55%, var(--line));
    border-radius: 5px;
    padding: 1px calc(7px * var(--menu-density));
    background: color-mix(in srgb, #38d7c2 8%, var(--panel));
    color: var(--muted);
    font: 800 calc(10px * var(--menu-density))/1.2 Inter, Segoe UI, Arial, sans-serif;
    cursor: pointer;
    pointer-events: auto;
}
.handrail-elongation { justify-self: end; margin: 0; min-height: 18px; }
.straight-handrail-side { position: relative; display: grid; gap: 2px; }
.straight-handrail-checkbox[hidden] { display: none; }
.straight-handrail-side .menu-field.has-properties { margin: 0; padding-top: 0; }
.straight-handrail-side .has-properties .menu-field-legend { top: 0.5px; }
.straight-handrail-side .has-properties select {
    --properties-border: var(--line);
    border-color: var(--properties-border);
    box-shadow: inset 0 0 0 1px var(--field), inset 0 0 0 2px var(--properties-border);
}
.straight-handrail-side .properties-modified select { --properties-border: #22c55e; }
.handrail-properties-menu { position: fixed; z-index: 16000; background: var(--panel); border: 1px solid var(--line); padding: 4px; }
.handrail-properties-dialog { color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; width: 340px; max-width: calc(100vw - 24px); }
.handrail-properties-dialog h3 { font-size: 15px; margin: 0 0 12px; }
.handrail-properties-dialog fieldset { margin: 8px 0; border: 1px solid var(--line); }
.handrail-properties-dialog label { display: grid; grid-template-columns: 1fr 100px; gap: 8px; align-items: center; margin: 8px 0; }
.handrail-properties-dialog input { width: 100%; box-sizing: border-box; color: var(--text); background: var(--bg); border: 1px solid var(--line); padding: 5px; }
.handrail-properties-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-top: 12px; }
.handrail-properties-dialog button, .handrail-properties-menu button { padding: 5px 10px; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 3px; }

.landing-toe-plate-button.is-active {
    border-color: #22c55e;
    background: color-mix(in srgb, #22c55e 28%, var(--field));
    color: var(--text);
}

.landing-toe-plate-button:disabled {
    border-color: color-mix(in srgb, var(--line) 70%, transparent);
    background: color-mix(in srgb, var(--field) 72%, var(--panel));
    color: color-mix(in srgb, var(--muted) 58%, transparent);
    cursor: not-allowed;
}

.landing-rails-field > select {
    width: 100%;
    margin-top: 0;
}

.flight-landing-heading-row {
    min-height: calc(30px * var(--menu-density));
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: calc(5px * var(--menu-density));
    margin-bottom: calc(7px * var(--menu-density));
}

.flight-landing-heading-row h3 {
    margin: 0;
}

.landing-geometry-row {
    min-width: 0;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(54px, 0.45fr) minmax(104px, 1fr) minmax(104px, 1fr);
    gap: calc(7px * var(--menu-density));
    align-items: center;
}

.landing-geometry-editor-button,
.landing-profile-select,
.landing-type-select {
    width: 100%;
    margin: 0;
    height: calc(28px * var(--menu-density));
    min-height: calc(28px * var(--menu-density));
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--field);
    color: var(--text);
    font: 800 calc(11px * var(--menu-density))/1 Inter, Segoe UI, Arial, sans-serif;
}

.landing-geometry-editor-button {
    cursor: pointer;
}

.landing-geometry-editor-button:hover,
.landing-geometry-editor-button:focus-visible {
    border-color: #38d7c2;
    background: color-mix(in srgb, #38d7c2 14%, var(--field));
}

.landing-type-select {
    padding: 0 calc(8px * var(--menu-density));
}

.landing-profile-select {
    padding: 0 calc(7px * var(--menu-density));
}

.landing-type-select option:disabled {
    color: color-mix(in srgb, var(--muted) 55%, transparent);
}

.landing-type-select.is-custom,
#flightLandingRailsInput.is-custom {
    color: color-mix(in srgb, var(--muted) 72%, transparent);
}

.flight-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: calc(9px * var(--menu-density));
}

.flight-section-heading h2 {
    margin-bottom: 0;
}

.flight-section-heading .flight-tabs {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

.flight-section-heading.has-flight-tabs h2 {
    display: none;
}

.flight-add-button {
    width: calc(28px * var(--menu-density));
    height: calc(28px * var(--menu-density));
    border: 1px solid color-mix(in srgb, #38d7c2 65%, var(--line));
    border-radius: 50%;
    background: color-mix(in srgb, #38d7c2 13%, var(--panel));
    color: var(--text);
    cursor: pointer;
    position: relative;
    display: block;
    padding: 0;
    font-size: 0;
    line-height: 1;
}

.flight-add-button::before {
    content: "";
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(18px * var(--menu-density));
    height: calc(18px * var(--menu-density));
    background: currentColor;
    -webkit-mask: url("/assets/icons/flight-add.png") center / contain no-repeat;
    mask: url("/assets/icons/flight-add.png") center / contain no-repeat;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.flight-add-button:hover,
.flight-add-button:focus-visible {
    border-color: #38d7c2;
    background: color-mix(in srgb, #38d7c2 25%, var(--panel));
}

.flight-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 calc(9px * var(--menu-density));
    overflow: visible;
}

.locked-field {
    color: color-mix(in srgb, var(--muted) 70%, transparent);
}

.locked-field input:disabled {
    color: color-mix(in srgb, var(--muted) 72%, transparent);
    background: color-mix(in srgb, var(--field) 72%, var(--panel));
    border-color: color-mix(in srgb, var(--line) 72%, transparent);
    cursor: not-allowed;
    opacity: 1;
}

.flight-tabs[hidden] {
    display: none;
}

.flight-tab {
    flex: 0 0 auto;
    min-width: 58px;
    border: 1px solid var(--line);
    border-radius: 7px 7px 0 0;
    background: color-mix(in srgb, var(--field) 72%, transparent);
    color: var(--muted);
    cursor: pointer;
    min-height: calc(20px * var(--menu-density));
    padding: calc(3px * var(--menu-density)) calc(7px * var(--menu-density));
    font-size: calc(11px * var(--menu-density));
    font-weight: 400;
    line-height: 1.05;
}

.flight-tab.is-active {
    border-color: #38d7c2;
    color: var(--text);
    background: color-mix(in srgb, #38d7c2 14%, var(--field));
}

.flight-tab.is-straight {
    min-width: 66px;
}

.straight-flight-editor {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: calc(8px * var(--menu-density));
}

.straight-flight-editor[hidden] {
    display: none;
}

body[data-generator-type="straight"] .straight-flight-editor { align-items: start; }
body[data-generator-type="straight"] .straight-flight-editor .menu-field > input,
body[data-generator-type="straight"] .straight-flight-editor .menu-field > select {
    box-sizing: border-box;
    height: calc(36px * var(--menu-density));
    min-width: 0;
}
body[data-generator-type="straight"] .straight-count-field:has(> .steps-suggestion.is-visible) {
    display: block;
    padding-top: calc(6px * var(--menu-density));
}
body[data-generator-type="straight"] .straight-count-field:has(> .steps-suggestion.is-visible) > .menu-field-legend {
    position: absolute;
    top: calc(6px * var(--menu-density) + 0.5px);
    transform: translateY(-50%);
    padding-inline: calc(3px * var(--menu-density));
}
body[data-generator-type="straight"] .straight-count-field > .steps-suggestion {
    position: absolute;
    top: calc(6px * var(--menu-density) + 0.5px);
    right: calc(10px * var(--menu-density));
    transform: translateY(-50%);
    max-width: 40%;
    font-size: calc(10px * var(--menu-density));
    line-height: calc(12px * var(--menu-density));
    white-space: nowrap;
}
body[data-generator-type="straight"] .straight-flight-editor > .menu-field:has(> #straightFlightRailsInput) { display: none; }
body[data-generator-type="straight"] .straight-rail-mode-field select { font-size: 10px; padding-inline: 5px 16px; }
body[data-generator-type="straight"] .straight-handrail-side { align-content: start; }
body[data-generator-type="straight"] .straight-count-reset {
    top: calc(24px * var(--menu-density));
    transform: translateY(-50%);
}

.standalone-sizing-only[hidden] { display: none !important; }
body[data-generator-type="straight"] .straight-count-field > input { padding-right: 48px; }
.straight-count-reset {
    position: absolute; right: 7px; top: 9px; width: 28px; height: 26px;
    border: 0; border-radius: 3px; padding: 5px; background: transparent; color: inherit;
}
.straight-count-reset::before {
    content: ''; display: block; width: 18px; height: 18px; background: currentColor;
    -webkit-mask: var(--icon-view-rotate-ccw) center / contain no-repeat;
    mask: var(--icon-view-rotate-ccw) center / contain no-repeat;
}
.straight-count-reset:hover { background: var(--panel-bg, #283542); }
.straight-count-reset:disabled { opacity: .4; cursor: default; }
.straight-sizing-warning { grid-column: 1 / -1; color: #ef4444; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
#straightDepthExpressionError[hidden] { display: none; }
#straightFlightDepthInput[aria-invalid="true"] { border-color: #ef4444; }

.straight-handrail-side {
    min-width: 0;
    padding-top: calc(5px * var(--menu-density));
    border-top: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
}

.straight-handrail-side > label:first-child {
    display: grid;
}

.straight-handrail-checkbox {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    align-items: center;
    gap: 5px;
    margin-top: calc(4px * var(--menu-density));
    color: var(--muted);
    font-size: calc(10px * var(--menu-density));
    line-height: 1.15;
}

.straight-handrail-checkbox input {
    width: 14px;
    height: 14px;
    margin: 0;
}

.straight-handrail-side.is-disabled {
    opacity: 0.58;
}

.flight-section-heading.has-flight-tabs .flight-tab {
    min-width: 0;
    padding-inline: calc(6px * var(--menu-density));
}

.flight-landing {
    border-top: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
    margin-top: calc(11px * var(--menu-density));
    padding-top: calc(10px * var(--menu-density));
}

.flight-landing h3 {
    margin: 0 0 calc(6px * var(--menu-density));
    color: var(--text);
    font-size: calc(13px * var(--menu-density));
}

.flight-context-menu {
    position: fixed;
    z-index: 120;
    min-width: 148px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel2);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.flight-context-menu[hidden] {
    display: none;
}

.flight-context-menu button {
    width: 100%;
    border: 0;
    border-radius: 5px;
    padding: 7px 10px;
    background: transparent;
    color: #ef4444;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 400;
    text-align: left;
}

.flight-context-menu button:hover {
    background: color-mix(in srgb, #ef4444 13%, transparent);
}

.flight-context-menu .flight-context-rename {
    color: var(--text);
}

.flight-context-menu .flight-context-rename:hover {
    background: color-mix(in srgb, #38bdf8 18%, transparent);
}

input:focus,
select:focus {
    outline: 1px solid #68e1d3;
}

input.field-warning,
select.field-warning {
    border-color: #facc15;
    outline: 0;
}

input.field-error,
select.field-error {
    border-color: #ef4444;
    outline: 0;
}

.section-more,
.main-more {
    margin: calc(4px * var(--menu-density)) 0 0;
    border-top: 0;
}

section:has(.section-more.is-collapsed),
section:has(.main-more.is-collapsed) {
    padding-bottom: 0;
}

.section-more-content,
.main-more-content {
    padding-top: calc(2px * var(--menu-density));
}

.section-more.is-collapsed .section-more-content,
.main-more.is-collapsed .main-more-content {
    display: none;
}

.section-more-toggle,
.main-more-toggle {
    width: 100%;
    border: 0;
    border-top: 0;
    background: color-mix(in srgb, var(--panel) 34%, transparent);
    color: var(--muted);
    cursor: pointer;
    font-weight: 900;
    letter-spacing: 0;
    padding: calc(4px * var(--menu-density)) 0 calc(5.5px * var(--menu-density));
    margin-top: 0;
    font-size: calc(11px * var(--menu-density));
    line-height: 1;
}

.section-more-toggle:hover,
.main-more-toggle:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--line) 36%, transparent);
}

.direction-control {
    position: relative;
    display: block;
}

.direction-control select {
    padding-right: calc(78px * var(--menu-density));
}

.direction-icon {
    position: absolute;
    right: calc(42px * var(--menu-density));
    top: 50%;
    width: calc(28px * var(--menu-density));
    height: calc(28px * var(--menu-density));
    transform: translateY(-50%);
    pointer-events: none;
    display: grid;
    place-items: center;
    color: #68e1d3;
    font-size: calc(27px * var(--menu-density));
    font-weight: 900;
    line-height: 1;
}

.direction-icon.clockwise {
    transform: translateY(-50%);
}

.validation {
    color: #ef4444;
    line-height: 1.45;
}

.viewport {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    height: 100vh;
    display: grid;
    grid-template-rows: 72px 1fr;
}

body.browser-open .viewport {
    grid-column: 3;
    grid-row: 1;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}

.topbar h2 {
    font-size: 23px;
    margin: 0;
}

.mobile-topbar-brand {
    display: none;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.command-status-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
}

.command-status-row .command-status {
    flex: 0 1 auto;
}

.command-stop-button {
    flex: 0 0 auto;
    min-width: 42px;
    height: 19px;
    margin-top: 3px;
    padding: 0 7px;
    border: 1px solid color-mix(in srgb, #ef4444 72%, var(--line));
    border-radius: 3px;
    color: color-mix(in srgb, #ef4444 84%, var(--text));
    background: color-mix(in srgb, var(--panel2) 90%, transparent);
    font-size: 9px;
    font-weight: 700;
    line-height: 17px;
    letter-spacing: 0;
    cursor: pointer;
}

.command-open-button {
    flex: 0 0 auto;
    min-width: 42px;
    height: 19px;
    margin-top: 1px;
    padding: 0 7px;
    border: 1px solid color-mix(in srgb, #22c55e 68%, var(--line));
    border-radius: 3px;
    color: color-mix(in srgb, #22c55e 82%, var(--text));
    background: color-mix(in srgb, var(--panel2) 90%, transparent);
    font-size: 9px;
    font-weight: 700;
    line-height: 17px;
    letter-spacing: 0;
    cursor: pointer;
}

.command-open-button:hover:not(:disabled) {
    color: #ffffff;
    background: #15803d;
}

.command-open-button:disabled {
    opacity: 0.55;
    cursor: wait;
}

.command-open-folder-button {
    min-width: 66px;
    color: color-mix(in srgb, #38bdf8 82%, var(--text));
    border-color: color-mix(in srgb, #38bdf8 68%, var(--line));
}

.command-open-folder-button:hover:not(:disabled) {
    color: #ffffff;
    background: #0369a1;
}

.command-stop-button:hover:not(:disabled) {
    color: #ffffff;
    background: #b91c1c;
}

.command-stop-button:disabled {
    opacity: 0.55;
    cursor: wait;
}

@media (min-width: 901px) {
    .topbar-actions > .save-files-menu {
        order: -2;
    }

    .topbar-actions > .measures-toggle {
        order: -1;
    }
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--topbar-control-height);
    min-height: var(--topbar-control-height);
    font-size: 9px;
    line-height: 1;
    color: var(--text);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 0 12px;
    cursor: pointer;
    font-weight: 800;
}

.mobile-panel-toggle,
.mobile-browser-toggle,
.mobile-data-toggle,
.mobile-components-toggle,
.mobile-info-toggle {
    display: none;
}

.app-info-menu {
    position: relative;
    display: flex;
    align-items: center;
    height: var(--topbar-control-height);
}

.app-info-toggle {
    box-sizing: border-box;
    width: var(--topbar-control-height);
    height: var(--topbar-control-height);
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
    line-height: 1;
}

.app-info-toggle:hover,
.app-info-toggle[aria-expanded="true"] {
    border-color: color-mix(in srgb, var(--text) 58%, var(--line));
    background: color-mix(in srgb, var(--line) 36%, transparent);
}

.app-info-card {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 45;
    width: 292px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--panel) 96%, #000 4%);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
}

.app-info-card[aria-hidden="true"] {
    display: none;
}

.app-info-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.app-info-card-header strong {
    display: block;
    margin-top: 2px;
    color: var(--text);
    font-size: 15px;
    letter-spacing: 0;
}

.app-info-kicker,
.app-info-status,
.app-info-note,
.software-list dd {
    color: var(--muted);
}

.app-info-kicker {
    display: block;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0;
}

.app-info-status {
    padding: 3px 7px;
    border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
    border-radius: 999px;
    font-size: 9px;
    font-weight: 900;
}

.app-info-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 10px 0;
}

.app-info-actions button {
    width: 100%;
    border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
    border-radius: 7px;
    background: color-mix(in srgb, var(--panel2) 64%, transparent);
    color: var(--text);
    cursor: pointer;
    padding: 7px 9px;
    text-align: left;
    font-size: 11px;
    font-weight: 800;
}

.app-info-actions button:hover {
    border-color: color-mix(in srgb, var(--text) 42%, var(--line));
    background: color-mix(in srgb, var(--line) 42%, transparent);
}

.app-info-section {
    padding-top: 3px;
}

.app-info-section h3 {
    margin: 0 0 7px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0;
}

.software-list {
    margin: 0;
}

.software-list div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 0;
    border-top: 1px solid color-mix(in srgb, var(--line) 48%, transparent);
}

.software-list div:first-child {
    border-top: 0;
}

.software-list dt {
    color: var(--text);
    font-size: 11px;
    font-weight: 850;
}

.software-list dd {
    margin: 0;
    font-size: 10px;
    text-align: right;
}

.app-info-note {
    margin: 10px 0 0;
    font-size: 10px;
    line-height: 1.35;
}

.save-files-menu,
.language-menu {
    position: relative;
}

.topbar-actions > .save-files-menu,
.topbar-actions > .measures-toggle,
.topbar-actions > .language-menu,
.topbar-actions > .refresh-project-button {
    flex: 0 0 128px;
}

.topbar-actions > #themeToggle {
    min-width: 138px;
}

.topbar-actions > .save-files-menu > summary,
.topbar-actions > .measures-toggle,
.topbar-actions > .language-menu > summary,
.topbar-actions > .refresh-project-button {
    position: relative;
    box-sizing: border-box;
    width: 128px;
    min-width: 128px;
    justify-content: center;
}

.refresh-project-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.refresh-project-icon {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

.save-files-menu summary,
.language-menu summary {
    list-style: none;
    user-select: none;
    padding-right: 24px;
    padding-left: 24px;
}

.save-files-menu summary::-webkit-details-marker,
.language-menu summary::-webkit-details-marker {
    display: none;
}

.save-files-menu summary::after,
.language-menu summary::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    width: 12px;
    height: 12px;
    background-color: currentColor;
    mask: var(--icon-menu-dropdown) center / contain no-repeat;
    -webkit-mask: var(--icon-menu-dropdown) center / contain no-repeat;
    transform: translateY(-50%);
}

.save-files-menu[open] summary::after,
.language-menu[open] summary::after {
    transform: translateY(-50%) rotate(180deg);
}

.save-files-panel,
.language-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 40;
    min-width: 278px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel) 96%, #000 4%);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.32);
}

.language-panel {
    min-width: 158px;
}

.language-menu summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.language-menu img {
    width: 17px;
    height: 13px;
    border-radius: 2px;
    object-fit: cover;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 18%, transparent);
    flex: 0 0 auto;
}

.language-panel button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    padding: 8px 9px;
    text-align: left;
    cursor: pointer;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.03em;
}

.language-panel button:hover,
.language-panel button.is-active {
    background: color-mix(in srgb, var(--line) 42%, transparent);
}

.save-files-section {
    padding: 6px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.save-files-section:last-child {
    border-bottom: 0;
}

.save-files-heading {
    padding: 4px 8px 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0;
}

.freecad-version-switch {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px 7px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 850;
}

.freecad-version-switch span {
    margin-right: 4px;
}

.freecad-version-switch label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 22px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
}

.freecad-version-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.freecad-version-switch label:has(input:checked) {
    border-color: #38bdf8;
    background: color-mix(in srgb, #38bdf8 22%, transparent);
}

.preferences-submenu {
    min-width: 190px;
}

.preferences-model-rgb label {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
}

.preferences-model-rgb {
    display: grid;
    gap: 6px;
    padding: 7px 8px 3px;
    border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.preferences-model-rgb label.is-current > span {
    color: #38bdf8;
}

.preferences-model-rgb[hidden] {
    display: none;
}

.preferences-model-color .model-color-swatch {
    width: 76px;
    height: 25px;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 5px;
    box-shadow: inset 0 0 0 2px var(--panel2);
    cursor: pointer;
}

.rail-section-colours-modal {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: none;
    place-items: center;
    padding: 20px;
    background: rgba(2, 6, 23, 0.68);
}

.rail-section-colours-modal.is-open {
    display: grid;
}

.rail-section-colours-dialog {
    width: min(470px, 100%);
    max-height: calc(100dvh - 40px);
    overflow: auto;
    color: var(--text);
    background: var(--panel2);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.rail-section-colours-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.rail-section-colours-header h2 {
    margin: 0;
    font-size: 15px;
}

.rail-section-colours-header button {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

#railSectionColorRows {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    padding: 16px;
}

.rail-section-color-row {
    display: grid;
    grid-template-columns: minmax(30px, 1fr) 30px;
    align-items: center;
    gap: 5px;
}

.rail-section-color-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rail-section-color-row input[type="color"] {
    width: 30px;
    height: 24px;
    padding: 1px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--panel2);
    cursor: pointer;
}

.rail-section-colours-actions {
    display: flex;
    justify-content: flex-end;
    padding: 10px 16px 14px;
    border-top: 1px solid var(--line);
}

.rail-section-colours-actions button {
    min-width: 92px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--field);
    color: var(--text);
    cursor: pointer;
}

@media (max-width: 520px) {
    #railSectionColorRows {
        grid-template-columns: 1fr;
    }
}

.model-color-picker-modal {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: none;
    place-items: center;
    background: rgba(0, 0, 0, 0.42);
}

.model-color-picker-modal.is-open {
    display: grid;
}

.model-color-picker-dialog {
    width: min(450px, calc(100vw - 20px));
    color: #111;
    background: #f4f4f4;
    border: 1px solid #777;
    border-radius: 7px;
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.5);
    font: 12px Arial, sans-serif;
}

.model-color-picker-dialog header {
    height: 31px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 8px;
    border-bottom: 1px solid #d0d0d0;
}

.model-color-picker-dialog header button {
    width: 36px;
    height: 30px;
    border: 0;
    background: transparent;
    color: #111;
    font-size: 22px;
    cursor: pointer;
}

.model-color-picker-body {
    display: grid;
    grid-template-columns: 214px 1fr;
    gap: 10px;
    padding: 7px 8px 6px;
}

.model-color-picker-dialog section {
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #111;
    box-shadow: none;
}

.model-color-picker-dialog span,
.model-color-picker-dialog label {
    color: #111;
}

.model-color-swatches-panel {
    display: grid;
    align-content: start;
    gap: 5px;
}

.model-color-basic-swatches,
.model-color-custom-swatches {
    display: grid;
    grid-template-columns: repeat(8, 20px);
    gap: 4px 6px;
}

.model-color-swatch-button {
    width: 20px;
    height: 17px;
    padding: 0;
    border: 1px solid #888;
    box-shadow: inset 0 0 0 1px #fff;
    cursor: pointer;
}

.model-color-swatch-button.is-selected {
    outline: 2px solid #111;
    outline-offset: 1px;
}

.model-color-custom-swatches {
    margin-bottom: 11px;
}

.model-color-swatches-panel > button,
.model-color-picker-dialog footer button,
.model-color-editor > button {
    min-height: 22px;
    border: 1px solid #c8c8c8;
    border-radius: 4px;
    background: #fff;
    color: #111;
    font: inherit;
}

.model-color-editor {
    position: relative;
    display: grid;
    grid-template-columns: 176px 22px;
    grid-template-rows: 187px 44px 24px 24px;
    gap: 4px 8px;
}

.model-color-sv-field {
    position: relative;
    grid-column: 1 / 2;
    width: 176px;
    height: 187px;
    background-color: red;
    background-image: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent);
    cursor: crosshair;
    touch-action: none;
}

.model-color-sv-field span {
    position: absolute;
    width: 10px;
    height: 10px;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #111;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.model-color-hue-field {
    position: relative;
    grid-column: 2;
    width: 14px;
    height: 187px;
    margin-left: 4px;
    background: linear-gradient(to bottom, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
    border: 1px solid #aaa;
    cursor: ns-resize;
    touch-action: none;
}

.model-color-hue-field span {
    position: absolute;
    left: -5px;
    width: 22px;
    border-top: 2px solid #111;
    transform: translateY(-1px);
    pointer-events: none;
}

.model-color-preview {
    grid-column: 1;
    width: 62px;
    height: 44px;
    border: 1px solid #aaa;
}

.model-color-values {
    position: absolute;
    top: 191px;
    left: 70px;
    width: 136px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 19px);
    align-content: start;
    gap: 3px 8px;
}

.model-color-values label {
    display: grid;
    grid-template-columns: 30px 34px;
    align-items: center;
}

.model-color-values input {
    width: 34px;
    height: 19px;
    padding: 1px 3px;
    border: 1px solid #bbb;
    border-radius: 0 !important;
    background: #fff;
    color: #111;
    font: inherit;
}

.model-color-solid-label {
    grid-column: 1;
    grid-row: 3;
    width: 62px;
    font-size: 10px;
}

.model-color-editor > button {
    grid-column: 1 / 3;
    grid-row: 4;
}

.model-color-picker-dialog footer {
    display: flex;
    gap: 8px;
    padding: 0 8px 7px;
}

.model-color-picker-dialog footer button {
    min-width: 64px;
}

.model-color-picker-dialog footer button:first-child {
    border-color: #1683d8;
}

@media (max-width: 520px) {
    .model-color-picker-body {
        grid-template-columns: 1fr;
    }

    .model-color-editor {
        width: 206px;
    }
}

.preferences-menu-freecad-version {
    padding: 7px 8px 8px;
    gap: 6px;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.preferences-menu-freecad-version span {
    min-width: 58px;
}

.preferences-menu-freecad-version label {
    min-width: 36px;
    height: 22px;
}

.save-files-panel button {
    width: 100%;
    display: block;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    padding: 7px 8px;
    text-align: left;
    cursor: pointer;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0;
}

.save-files-panel button:hover:not(:disabled) {
    background: color-mix(in srgb, var(--line) 42%, transparent);
}

.save-files-panel .file-menu-command {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr) 13px;
    align-items: center;
    column-gap: 7px;
}

.save-files-panel .file-menu-command::before {
    content: "";
    width: 16px;
    height: 16px;
    background-color: currentColor;
    mask: var(--file-command-icon) center / contain no-repeat;
    -webkit-mask: var(--file-command-icon) center / contain no-repeat;
}

.save-files-panel .file-menu-command-open {
    --file-command-icon: var(--icon-file-open);
}

.save-files-panel .file-menu-command-save {
    --file-command-icon: var(--icon-file-save);
}

.save-files-panel .file-menu-command-save::after {
    content: "";
}

.save-files-submenu-host {
    position: relative;
}

.save-files-submenu-host > button {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 13px;
    align-items: center;
    column-gap: 7px;
}

.save-files-submenu-host > button::after {
    content: "";
    display: block;
    width: 13px;
    height: 13px;
    justify-self: end;
    background-color: currentColor;
    mask: var(--icon-menu-submenu) center / contain no-repeat;
    -webkit-mask: var(--icon-menu-submenu) center / contain no-repeat;
}

.save-files-submenu {
    position: absolute;
    top: -8px;
    right: calc(100% + 8px);
    z-index: 45;
    min-width: 260px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel) 97%, #000 3%);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.34);
    opacity: 0;
    visibility: hidden;
    transform: translateX(4px);
    pointer-events: none;
    transition: opacity 120ms ease, transform 120ms ease;
}

.save-files-submenu.preferences-submenu {
    top: auto;
    bottom: -8px;
    max-height: calc(100vh - 24px);
    overflow: visible;
}

.save-files-submenu-host.is-open > .save-files-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

.save-files-submenu button {
    white-space: nowrap;
}

.open-project-submenu {
    min-width: 310px;
    max-width: min(460px, calc(100vw - 32px));
}

@media (min-width: 901px) {
    .open-project-submenu {
        left: calc(100% + 8px);
        right: auto;
    }
}

@media (max-width: 900px) {
    .open-project-submenu {
        position: static;
        display: none;
        min-width: 0;
        max-width: 100%;
        margin: 4px 0;
        transform: none;
        box-shadow: none;
    }
    .save-files-submenu-host.is-open > .open-project-submenu { display: block; }
    .open-project-submenu button { white-space: normal; overflow-wrap: anywhere; }
}

.open-project-submenu .built-in-project-button {
    display: grid;
    gap: 1px;
    text-align: left;
    border-color: color-mix(in srgb, var(--accent) 65%, var(--border));
}

.built-in-project-button span {
    color: var(--accent);
}

.built-in-project-button small {
    color: var(--muted);
    font-size: 9px;
    font-weight: 400;
}

.recent-projects-list {
    display: grid;
    gap: 2px;
    max-height: min(440px, calc(100vh - 180px));
    overflow-y: auto;
}

.recent-projects-list button {
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-projects-empty {
    padding: 7px 8px;
    color: var(--muted);
    font-size: 10px;
}

.preferences-number-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 58px;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    color: var(--text);
    font-size: 11px;
    font-weight: 750;
}

.preferences-number-row input {
    width: 58px;
    min-width: 0;
    height: 24px;
    padding: 2px 5px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--panel-2);
    color: var(--text);
    text-align: right;
}

.save-files-panel button:disabled {
    color: color-mix(in srgb, var(--muted) 58%, transparent);
    cursor: default;
}

.save-files-panel .stp-export-button {
    width: 44px;
    min-width: 44px;
    height: 28px;
    display: inline-block;
    color: #fff;
    text-align: center;
    padding: 7px 12px;
    margin: 2px 8px;
    background: radial-gradient(ellipse at center, #e51d25 0 58%, #1e3eb7 59% 68%, transparent 69%);
    background-position: center;
    background-repeat: no-repeat;
    background-size: 80% 80%;
    text-indent: 0;
    border: 1px solid #1e3eb7;
    text-shadow: 1px 1px 0 #1e3eb7;
}

.mobile-email-action {
    display: none;
}

.stp-export-button {
    color: #fff;
    border-color: #1e3eb7;
    background: radial-gradient(ellipse at center, #e51d25 0 58%, #1e3eb7 59% 68%, transparent 69%);
    background-position: center;
    background-repeat: no-repeat;
    background-size: 80% 80%;
    min-width: 44px;
    letter-spacing: 0;
    text-shadow: 1px 1px 0 #1e3eb7;
}

.components-editor-launchers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: calc(7px * var(--menu-density));
    margin-top: calc(5px * var(--menu-density));
}

.floor-walls-editor-toggle {
    width: 100%;
    height: calc(36px * var(--menu-density));
    min-height: calc(36px * var(--menu-density));
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel2) 68%, transparent);
    color: var(--text);
    padding: calc(4px * var(--menu-density)) calc(6px * var(--menu-density));
    cursor: pointer;
    font-size: calc(9.5px * var(--menu-density));
    font-weight: 800;
    line-height: 1.08;
}

.floor-walls-editor-toggle.is-active {
    border-color: #22c55e;
    background: color-mix(in srgb, #22c55e 20%, var(--panel2));
    box-shadow: 0 0 0 1px color-mix(in srgb, #22c55e 30%, transparent);
}

.floor-walls-panel {
    position: fixed;
    left: 378px;
    top: 236px;
    z-index: 62;
    width: min(330px, calc(100% - 36px));
    color: var(--text);
    background: color-mix(in srgb, var(--panel2) 64%, transparent);
    border: 1px solid color-mix(in srgb, var(--text) 22%, transparent);
    border-radius: 8px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(6px);
    max-height: calc(100dvh - 24px);
    overflow-x: hidden;
    overflow-y: auto;
}

.floor-walls-panel.is-hidden {
    display: none;
}

.floor-walls-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 43px;
    padding: 7px 10px;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    font-weight: 400;
    cursor: move;
    user-select: none;
    touch-action: none;
}

.floor-walls-header button {
    cursor: pointer;
}

.landing-geometry-window {
    position: fixed;
    left: max(380px, calc(50vw - 560px));
    top: 54px;
    z-index: 72;
    width: min(1240px, calc(100vw - 404px));
    max-height: calc(100vh - 78px);
    max-height: calc(100dvh - 78px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--text) 28%, var(--line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel2) 96%, transparent);
    color: var(--text);
    box-shadow: 0 20px 54px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(10px);
}

.landing-geometry-window.is-hidden {
    display: none;
}

.landing-geometry-header {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 12px 9px 15px;
    border-bottom: 1px solid var(--line);
    cursor: move;
    user-select: none;
    touch-action: none;
}

.landing-geometry-window-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
}

.landing-geometry-header-main {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 18px;
}

.landing-geometry-title-block {
    flex: 0 0 auto;
}

.landing-geometry-title-block h2,
.landing-geometry-title-block p {
    white-space: nowrap;
}

.landing-geometry-construction-actions {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.landing-geometry-construction-actions button {
    min-width: 88px;
    height: 27px;
    padding: 2px 9px;
    border: 1px solid #2563eb;
    border-radius: 5px;
    color: var(--text);
    background: color-mix(in srgb, #2563eb 10%, var(--field));
    cursor: pointer;
    font-size: 9px;
    font-weight: 800;
    white-space: nowrap;
}

.landing-geometry-construction-actions > label {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    font-size: 11px;
    font-weight: 400;
    color: var(--text);
}

.landing-geometry-construction-actions > label input {
    width: 14px;
    height: 14px;
    margin: 0;
}

.landing-geometry-construction-actions button:hover,
.landing-geometry-construction-actions button:focus-visible {
    border-color: #38d7c2;
}

.landing-geometry-construction-actions button:disabled {
    border-color: var(--line);
    color: var(--muted);
    background: color-mix(in srgb, var(--field) 62%, var(--panel));
    cursor: not-allowed;
    opacity: 0.55;
}

.landing-geometry-icon-button {
    position: relative;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--text);
    background: var(--field);
    cursor: pointer;
}

.landing-geometry-icon-button:hover,
.landing-geometry-icon-button:focus-visible {
    border-color: #38d7c2;
}

.landing-geometry-popout::before {
    content: "";
    width: 13px;
    height: 11px;
    border: 1.5px solid currentColor;
}

.landing-geometry-popout::after {
    content: "↗";
    position: absolute;
    right: 4px;
    top: 1px;
    padding-left: 1px;
    background: var(--field);
    font: 700 12px/1 Arial, sans-serif;
}

.landing-geometry-rotate-popover {
    position: absolute;
    right: 70px;
    top: 36px;
    z-index: 6;
    width: 174px;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel2);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    cursor: default;
}

.landing-geometry-rotate-popover[hidden] {
    display: none;
}

.landing-geometry-rotate-popover label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 10px;
}

.landing-geometry-rotate-input-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 18px;
    align-items: center;
}

.landing-geometry-rotate-input-wrap input {
    width: 100%;
    height: 29px;
    margin: 0;
    padding: 4px 7px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--text);
    background: var(--field);
}

.landing-geometry-rotate-input-wrap > span {
    text-align: right;
}

.landing-geometry-rotate-popover > button {
    width: 100%;
    height: 28px;
    margin-top: 7px;
    border: 1px solid #2563eb;
    border-radius: 4px;
    color: var(--text);
    background: color-mix(in srgb, #2563eb 14%, var(--field));
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
}

.landing-geometry-header h2,
.landing-geometry-header p,
.landing-geometry-constraints h3 {
    margin: 0;
    letter-spacing: 0;
}

.landing-geometry-header h2 {
    font-size: 15px;
}

.landing-geometry-header p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.landing-geometry-close {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: grid;
    place-items: center;
    padding: 0 0 2px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--field);
    color: var(--text);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.landing-geometry-close:hover,
.landing-geometry-close:focus-visible {
    border-color: #ef4444;
}

.landing-geometry-body {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 158px;
    overflow: hidden;
}

.landing-geometry-preview-panel {
    min-width: 0;
    min-height: 0;
    padding: 10px 12px 12px;
    border-right: 1px solid var(--line);
}

.landing-geometry-preview-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 24px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.landing-geometry-alignment-controls {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-inline: auto;
    text-transform: none;
}

.landing-geometry-alignment-controls > span {
    white-space: nowrap;
}

.landing-geometry-alignment-controls button {
    height: 20px;
    padding: 0 7px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--text);
    background: var(--field);
    cursor: pointer;
    font-size: 9px;
    font-weight: 700;
}

.landing-geometry-alignment-controls button.is-active {
    border-color: #38d7c2;
    background: color-mix(in srgb, #38d7c2 16%, var(--field));
}

.landing-geometry-alignment-controls button:disabled {
    color: var(--muted);
    cursor: not-allowed;
    opacity: 0.45;
}

.landing-geometry-preview-stage {
    position: relative;
    width: min(100%, calc((100vh - 188px) * 760 / 560));
    height: auto;
    min-height: 430px;
    aspect-ratio: 760 / 560;
    margin-inline: auto;
    border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
    background: color-mix(in srgb, var(--field) 72%, transparent);
    overflow: hidden;
    overscroll-behavior: contain;
}

.landing-geometry-preview-stage.is-panning {
    cursor: grabbing;
}

.landing-geometry-preview-stage.is-panning .landing-geometry-model-preview,
.landing-geometry-preview-stage.is-panning .landing-geometry-preview {
    transition: none;
}

.landing-geometry-preview-rotation-controls {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 7;
    width: 42px;
    height: 42px;
}

.landing-geometry-rotate-button {
    position: absolute;
    padding: 0;
    border: 0;
    color: var(--text);
    background: transparent;
    cursor: pointer;
}

.landing-geometry-rotate-left,
.view-cube .view-roll-left {
    top: 0;
    left: 0;
    width: 23px;
    height: 16px;
}

.landing-geometry-rotate-right,
.view-cube .view-roll-right {
    right: 0;
    bottom: 0;
    width: 16px;
    height: 23px;
}

.landing-geometry-rotate-button:hover,
.landing-geometry-rotate-button:focus-visible {
    color: #38d7c2;
    filter: drop-shadow(0 0 2px color-mix(in srgb, #38d7c2 65%, transparent));
    outline: 0;
}

.landing-geometry-rotate-button::before,
.view-cube .view-roll-left::before,
.view-cube .view-roll-right::before {
    content: "";
    position: absolute;
    display: block;
    background: currentColor;
    -webkit-mask: center / contain no-repeat;
    mask: center / contain no-repeat;
}

.landing-geometry-rotate-left::before,
.view-cube .view-roll-left::before {
    top: 1px;
    left: 1px;
    width: 21px;
    height: 13px;
    -webkit-mask-image: var(--icon-view-rotate-ccw);
    mask-image: var(--icon-view-rotate-ccw);
}

.landing-geometry-rotate-right::before,
.view-cube .view-roll-right::before {
    right: 1px;
    bottom: 1px;
    width: 13px;
    height: 21px;
    -webkit-mask-image: var(--icon-view-rotate-cw);
    mask-image: var(--icon-view-rotate-cw);
}

.landing-geometry-preview-rotation-controls .landing-geometry-rotate-popover {
    top: 0;
    right: 48px;
}

.landing-geometry-model-preview,
.landing-geometry-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    transform-origin: 50% 50%;
    transition: transform 140ms ease;
}

.landing-geometry-preview {
    pointer-events: auto;
}

.landing-geometry-preview > :not([data-dimension-key]):not([data-landing-rail-side]),
.landing-geometry-preview defs {
    pointer-events: none;
}

.landing-geometry-tool-panel,
.landing-geometry-context-menu {
    position: absolute;
    z-index: 10;
    width: 190px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--panel);
    box-shadow: 0 8px 22px rgb(0 0 0 / 32%);
    color: var(--text);
}

#landingGeometryWallPanel {
    width: 250px;
    max-height: calc(100% - 55px);
    overflow-y: auto;
    gap: 10px;
}
#landingGeometryWallPanel p { margin: 0; font-size: 12px; line-height: 1.45; }
#landingGeometryWallPanel > button {
    padding: 8px 10px;
    border: 1px solid #64748b;
    border-radius: 6px;
    background: #172334;
    color: #f1f5f9;
    cursor: pointer;
}
#landingGeometryWallPanel > button:hover { background: #244362; }
#landingWallAdd { border-color: #22c55e !important; }
.landing-geometry-tool-panel {
    top: 38px;
    right: 8px;
    display: grid;
    gap: 7px;
}

.landing-geometry-tool-panel[hidden],
.landing-geometry-context-menu[hidden] {
    display: none;
}

.landing-geometry-tool-panel header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
}

.landing-geometry-tool-panel header button {
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--text);
    background: var(--field);
}

.landing-geometry-tool-panel label,
.landing-geometry-side-options label {
    display: grid;
    gap: 3px;
    font-size: 10px;
    color: var(--muted);
}

.landing-geometry-side-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
}

.landing-geometry-side-options label {
    grid-template-columns: 16px 1fr;
    align-items: center;
    color: var(--text);
}

.landing-geometry-side-options input {
    margin: 0;
}

.landing-geometry-tool-panel select,
.landing-geometry-tool-panel input {
    width: 100%;
    height: 28px;
    padding: 3px 7px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--text);
    background: var(--field);
}

.landing-geometry-context-menu {
    width: 130px;
    padding: 4px;
}

.landing-geometry-context-menu button {
    width: 100%;
    min-height: 26px;
    border: 0;
    border-radius: 3px;
    color: var(--text);
    background: transparent;
    text-align: left;
}

.landing-geometry-context-menu button:hover,
.landing-geometry-context-menu button:focus-visible {
    background: color-mix(in srgb, #38bdf8 18%, var(--field));
}

.landing-geometry-preview [data-landing-rail-side] {
    pointer-events: all;
    cursor: context-menu;
}

.landing-geometry-preview .landing-preview-rail-hit {
    fill: transparent;
    stroke: none;
    pointer-events: all;
}

.landing-geometry-preview .landing-preview-rail {
    fill: none;
    stroke: #38bdf8;
    stroke-width: 5;
    stroke-linecap: round;
    opacity: 0.9;
}

.landing-geometry-preview [data-landing-rail-side].is-active .landing-preview-rail {
    stroke: #67e8f9;
    filter: drop-shadow(0 0 4px #38bdf8);
}

.landing-geometry-constraints {
    min-width: 0;
    overflow: auto;
    display: grid;
    align-content: start;
    justify-items: end;
    padding: 12px 10px 12px 6px;
}

.landing-geometry-constraints-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 28px;
    margin-bottom: 8px;
    width: 128px;
}

.landing-geometry-constraints h3 {
    font-size: 13px;
}

.landing-geometry-constraint-warning {
    width: 30px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 4px;
    color: transparent;
    font-size: 13px;
    font-weight: 900;
}

.landing-geometry-constraint-warning > span {
    display: block;
    line-height: 1;
    transform: translateY(-0.5px);
}

.landing-geometry-constraint-warning.is-visible {
    animation: landing-constraint-warning 1.2s steps(1, end) infinite;
}

@keyframes landing-constraint-warning {
    0% {
        color: #fff;
        border-color: #ef4444;
        background: #dc2626;
    }
    25% {
        color: transparent;
        border-color: transparent;
        background: transparent;
    }
    50% {
        color: #111827;
        border-color: #facc15;
        background: #facc15;
    }
    75%, 100% {
        color: transparent;
        border-color: transparent;
        background: transparent;
    }
}

.landing-geometry-constraint-rows {
    display: grid;
    gap: 5px;
    width: 128px;
}

.landing-geometry-constraint-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
}

.landing-geometry-constraint-row label {
    min-width: 0;
    margin: 0;
    color: var(--muted);
    font-size: 9px;
    font-weight: 500;
}

.landing-geometry-constraint-input-wrap {
    display: grid;
    grid-template-columns: 100px 25px;
    align-items: center;
    gap: 3px;
    margin-top: 1px;
}

.landing-geometry-constraint-row input {
    width: 100%;
    height: 25px;
    margin: 0;
    padding: 1px 7px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--field);
    color: var(--text);
    font-size: 11px;
    line-height: 1;
}

.landing-geometry-constraint-row input:focus {
    border-color: #f59e0b;
    outline: 1px solid color-mix(in srgb, #f59e0b 62%, transparent);
}

.landing-geometry-constraint-row input:disabled {
    border-color: color-mix(in srgb, var(--line) 72%, var(--panel));
    color: color-mix(in srgb, var(--muted) 82%, transparent);
    background: color-mix(in srgb, var(--panel) 82%, var(--field));
    cursor: not-allowed;
    opacity: 0.68;
}

.landing-driven-toggle {
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: color-mix(in srgb, var(--field) 84%, transparent);
    color: color-mix(in srgb, var(--muted) 50%, transparent);
    cursor: pointer;
    font-size: 0;
}

.landing-driven-symbol {
    position: relative;
    width: 22px;
    height: 13px;
    display: block;
    color: currentColor;
    background:
        linear-gradient(currentColor, currentColor) left center / 1px 13px no-repeat,
        linear-gradient(currentColor, currentColor) right center / 1px 13px no-repeat,
        linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat;
}

.landing-driven-symbol::before {
    content: "(";
    position: absolute;
    left: 4px;
    top: 50%;
    padding: 0 1px 0 2px;
    background: var(--field);
    font: 700 12px/13px Arial, sans-serif;
    transform: translateY(-53%);
}

.landing-driven-symbol::after {
    content: ")";
    position: absolute;
    right: 4px;
    top: 50%;
    padding: 0 2px 0 1px;
    background: var(--field);
    font: 700 12px/13px Arial, sans-serif;
    transform: translateY(-53%);
}

.landing-driven-symbol > span {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    padding: 0 1px;
    background: var(--field);
    font: 800 11px/13px Arial, sans-serif;
    transform: translate(-50%, -53%);
}

.landing-driven-toggle.is-driven {
    border-color: #facc15;
    background: color-mix(in srgb, #facc15 18%, var(--field));
    color: #facc15;
    box-shadow: 0 0 0 1px color-mix(in srgb, #facc15 24%, transparent);
}

body[data-theme="day"] .landing-driven-toggle.is-driven {
    border-color: #d97706;
    color: #b45309;
    background: color-mix(in srgb, #facc15 24%, var(--field));
}

.landing-geometry-action {
    width: 128px;
    height: 31px;
    margin-top: 6px;
    border: 1px solid #2563eb;
    border-radius: 5px;
    background: color-mix(in srgb, #2563eb 10%, var(--field));
    color: var(--text);
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
}

.landing-geometry-action:disabled {
    border-color: var(--line);
    background: color-mix(in srgb, var(--field) 68%, var(--panel));
    color: var(--muted);
    cursor: not-allowed;
    opacity: 0.58;
}

.landing-geometry-constraint-status {
    width: 128px;
    min-height: 22px;
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.2;
}

.landing-geometry-constraint-status.is-error {
    color: #ef4444;
}

.landing-geometry-constraint-status.is-valid {
    color: #22c55e;
}

.landing-geometry-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 9px 12px;
    border-top: 1px solid var(--line);
}

.landing-geometry-footer button {
    min-width: 88px;
    height: 31px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--field);
    color: var(--text);
    cursor: pointer;
    font-size: 10px;
    font-weight: 900;
}

.landing-geometry-footer button.is-primary {
    border-color: #22c55e;
    background: color-mix(in srgb, #22c55e 18%, var(--field));
}

.landing-geometry-preview .landing-preview-geometry-guide {
    fill: transparent;
    stroke: none;
}

.landing-geometry-preview .landing-preview-label {
    fill: var(--text);
    font: 700 17px/1 Inter, Segoe UI, sans-serif;
    text-anchor: middle;
}

.landing-geometry-preview .landing-preview-part-label {
    fill: var(--muted);
    font: 400 13px/1 Inter, Segoe UI, sans-serif;
    text-anchor: middle;
}

.landing-geometry-preview .landing-preview-axis-x,
.landing-geometry-preview .landing-preview-axis-y {
    stroke-width: 2;
}

.landing-geometry-preview .landing-preview-axis-x {
    stroke: #ef4444;
}

.landing-geometry-preview .landing-preview-axis-y {
    stroke: #22c55e;
}

.landing-geometry-preview .landing-preview-axis-label-x,
.landing-geometry-preview .landing-preview-axis-label-y {
    font: 800 14px/1 Inter, Segoe UI, sans-serif;
}

.landing-geometry-preview .landing-preview-axis-label-x {
    fill: #ef4444;
}

.landing-geometry-preview .landing-preview-axis-label-y {
    fill: #22c55e;
}

.landing-geometry-preview .landing-preview-cp {
    fill: var(--field);
    stroke: var(--text);
    stroke-width: 3;
}

.landing-geometry-preview .landing-preview-dimension-line,
.landing-geometry-preview .landing-preview-extension-line,
.landing-geometry-preview .landing-preview-angle-line {
    fill: none;
    stroke: #0ea5e9;
    stroke-width: 1;
}

.landing-geometry-preview .landing-preview-angle-reference {
    fill: none;
    stroke: #0ea5e9;
    stroke-width: 1;
}

.landing-geometry-preview .landing-preview-dimension-text {
    fill: #ef4444;
    font: 700 12px/1 "GENISO", "ISOCPEUR", sans-serif;
    text-anchor: middle;
    paint-order: stroke;
    stroke: color-mix(in srgb, var(--field) 94%, transparent);
    stroke-width: 1.75px;
    stroke-linejoin: round;
}

.landing-geometry-preview .landing-preview-dimension-name {
    fill: #ef4444;
    font: 700 8.4px/1 "GENISO", "ISOCPEUR", sans-serif;
    text-anchor: middle;
    dominant-baseline: middle;
    stroke: none;
    paint-order: normal;
}

.landing-geometry-preview .landing-preview-dimension-value {
    dominant-baseline: middle;
}

.landing-geometry-preview .landing-preview-angle-value {
    dominant-baseline: middle;
}

body.landing-editor-popout {
    display: block;
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
    background: var(--bg);
}

body.landing-editor-popout .landing-geometry-window {
    position: relative;
    inset: auto;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
}

body.landing-editor-popout .landing-geometry-header {
    cursor: default;
}

.landing-geometry-preview [data-dimension-key] {
    transition: filter 120ms ease, opacity 120ms ease;
    pointer-events: bounding-box;
    cursor: pointer;
}

.landing-geometry-preview [data-dimension-key].is-active {
    filter: drop-shadow(0 0 4px #facc15);
}

.landing-geometry-preview [data-dimension-key].is-active .landing-preview-dimension-line,
.landing-geometry-preview [data-dimension-key].is-active .landing-preview-extension-line,
.landing-geometry-preview [data-dimension-key].is-active .landing-preview-angle-line {
    stroke: #facc15;
    stroke-width: 1.2;
}

.landing-geometry-preview [data-dimension-key].is-active .landing-preview-dimension-text,
.landing-geometry-preview [data-dimension-key].is-active .landing-preview-dimension-name {
    fill: #facc15;
}

@media (prefers-reduced-motion: reduce) {
    .landing-geometry-constraint-warning.is-visible {
        animation: none;
        color: #111827;
        border-color: #facc15;
        background: #facc15;
    }
}

.floor-walls-header button,
.floor-walls-tabs button {
    border: 1px solid var(--line);
    border-radius: 5px;
    background: color-mix(in srgb, var(--panel2) 74%, transparent);
    color: var(--text);
    cursor: pointer;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0;
}

.floor-walls-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.floor-walls-header button {
    min-width: 38px;
    height: 28px;
    margin: 0;
    padding: 0 9px;
    font-weight: 800;
    line-height: 1;
}

.floor-walls-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    padding: 8px 10px 0;
    border-bottom: 1px solid var(--line);
}

.floor-walls-panel[data-group="construction"] .floor-walls-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.floor-walls-tabs button {
    height: 25px;
    border-radius: 6px 6px 0 0;
    border-bottom: 0;
    background: color-mix(in srgb, var(--panel2) 48%, transparent);
}

.floor-walls-tabs button.is-active {
    border-color: #22c55e;
    background: color-mix(in srgb, #22c55e 18%, var(--panel2));
    box-shadow: inset 0 2px 0 #22c55e;
}

.floor-walls-panel[data-group="static"] [data-editor-group-panel="construction"],
.floor-walls-panel[data-group="construction"] [data-editor-group-panel="static"] {
    display: none;
}

.floor-walls-item-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 7px;
    padding: 8px 10px 0;
}

.floor-walls-item-row select,
.floor-walls-item-row button {
    min-height: 28px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: color-mix(in srgb, var(--panel2) 68%, transparent);
    color: var(--text);
    font-size: 11px;
    line-height: 1.25;
    margin: 0;
    vertical-align: middle;
}

.floor-walls-item-row select {
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    height: auto;
    padding: 4px 9px;
    font-weight: 400;
    overflow-y: hidden;
}

.floor-walls-item-row select option {
    min-height: 20px;
    padding: 3px 5px;
    font-weight: 400;
}

.floor-walls-item-row select option:checked {
    font-weight: 800;
}

.floor-walls-item-row button {
    height: 28px;
    font-weight: 800;
    cursor: pointer;
    padding: 0 10px;
    display: inline-grid;
    place-items: center;
}

.floor-walls-item-row button:hover {
    border-color: #ef4444;
    background: color-mix(in srgb, #ef4444 18%, var(--panel2));
}

.floor-walls-pillar-row {
    padding: 8px 10px 0;
}

.floor-walls-console-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 10px 0;
}

.floor-walls-console-row label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 400;
}

.floor-walls-console-row select {
    height: 30px;
    padding: 5px 7px;
    font-size: 11px;
    font-weight: 400;
}

.floor-walls-pillar-row label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
}

.floor-walls-pillar-row select {
    height: 30px;
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 400;
}

.floor-walls-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 10px 10px;
}

.floor-walls-grid label:nth-child(n + 4) {
    grid-column: span 1;
}

.floor-walls-panel[data-mode="floor"] #floorWallsPlanOffsetLabel,
.floor-walls-panel[data-mode="wall"] #floorWallsPlanOffsetLabel {
    grid-column: 1;
    grid-row: 2;
}

.floor-walls-panel[data-mode="floor"] #floorWallsPlanRotationLabel,
.floor-walls-panel[data-mode="wall"] #floorWallsPlanRotationLabel {
    grid-column: 2;
    grid-row: 2;
}

.floor-walls-panel[data-mode="floor"] .floor-walls-hidden-action,
.floor-walls-panel[data-mode="wall"] .floor-walls-hidden-action {
    grid-column: 3;
    grid-row: 2;
}

.floor-walls-panel[data-mode="floor"] #floorWallsThicknessLabel,
.floor-walls-panel[data-mode="wall"] #floorWallsThicknessLabel {
    grid-column: 1;
    grid-row: 3;
}

.floor-walls-panel[data-mode="floor"] .floor-only,
.floor-walls-panel[data-mode="wall"] .wall-only {
    grid-column: 2;
    grid-row: 3;
}

.floor-walls-panel[data-mode="floor"] #floorWallsAddItem,
.floor-walls-panel[data-mode="wall"] #floorWallsAddItem {
    grid-column: 3;
    grid-row: 3;
}

.floor-walls-panel[data-mode="floor"] .wall-only,
.floor-walls-panel[data-mode="floor"] .pillar-only,
.floor-walls-panel[data-mode="floor"] .console-only,
.floor-walls-panel[data-mode="wall"] .floor-only,
.floor-walls-panel[data-mode="wall"] .pillar-only,
.floor-walls-panel[data-mode="wall"] .console-only,
.floor-walls-panel[data-mode="pillar"] .floor-only,
.floor-walls-panel[data-mode="pillar"] .wall-only,
.floor-walls-panel[data-mode="pillar"] .console-only:not(.pillar-only),
.floor-walls-panel[data-mode="pillar"] .static-only,
.floor-walls-panel[data-mode="pillar"] #floorWallsBLabel,
.floor-walls-panel[data-mode="pillar"] #floorWallsTotalLabel,
.floor-walls-panel[data-mode="sandwich-console"] .floor-only,
.floor-walls-panel[data-mode="sandwich-console"] .wall-only,
.floor-walls-panel[data-mode="sandwich-console"] .pillar-only:not(.console-only),
.floor-walls-panel[data-mode="sandwich-console"] .static-only,
.floor-walls-panel[data-mode="sandwich-console"] .standard-console-only,
.floor-walls-panel[data-mode="sandwich-console"] #floorWallsALabel,
.floor-walls-panel[data-mode="sandwich-console"] #floorWallsBLabel,
.floor-walls-panel[data-mode="sandwich-console"] #floorWallsTotalLabel,
.floor-walls-panel[data-mode="sandwich-console"] #floorWallsThicknessLabel {
    display: none;
}

.floor-walls-panel[data-mode="standard-console"] .floor-only,
.floor-walls-panel[data-mode="standard-console"] .wall-only,
.floor-walls-panel[data-mode="standard-console"] .pillar-only:not(.console-only),
.floor-walls-panel[data-mode="standard-console"] .static-only,
.floor-walls-panel[data-mode="standard-console"] .sandwich-console-only,
.floor-walls-panel[data-mode="standard-console"] #floorWallsALabel,
.floor-walls-panel[data-mode="standard-console"] #floorWallsBLabel,
.floor-walls-panel[data-mode="standard-console"] #floorWallsTotalLabel,
.floor-walls-panel[data-mode="standard-console"] #floorWallsThicknessLabel {
    display: none;
}

.floor-walls-grid label {
    margin: 0;
    font-size: 10px;
    color: var(--muted);
    font-weight: 400;
}

.floor-walls-grid input {
    height: 30px;
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 400;
}

.floor-walls-panel[data-mode="standard-console"] .console-length-field {
    grid-column: 1 / -1;
}

.standard-console-only input[readonly] {
    background: color-mix(in srgb, var(--field) 75%, var(--muted));
    color: var(--muted);
    cursor: default;
}

.floor-walls-grid-action {
    align-self: end;
    height: 30px;
    border: 1px solid #2563eb;
    border-radius: 5px;
    background: color-mix(in srgb, var(--panel2) 68%, transparent);
    color: var(--text);
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
    padding: 0 9px;
}

.floor-walls-grid-action:hover {
    border-color: #38bdf8;
    background: color-mix(in srgb, #2563eb 20%, var(--panel2));
}

.floor-walls-hidden-action.is-active {
    border-color: #22c55e;
    background: color-mix(in srgb, #22c55e 28%, var(--panel2));
    color: var(--text);
}

.floor-walls-panel[data-mode="pillar"] #floorWallsAddItem,
.floor-walls-panel[data-mode="pillar"] .floor-walls-rotate-action,
.floor-walls-panel[data-mode="pillar"] .floor-walls-insert-action {
    grid-column: 3;
}

.floor-walls-panel[data-mode="pillar"] .floor-walls-insert-action {
    grid-row: 3;
}

.floor-walls-panel[data-mode="pillar"] .floor-walls-rotate-action {
    grid-row: 4;
}

.floor-walls-panel[data-mode="pillar"] #floorWallsAddItem {
    grid-row: 5;
}

.floor-walls-panel[data-mode="sandwich-console"] .floor-walls-grid,
.floor-walls-panel[data-mode="standard-console"] .floor-walls-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 8px;
}

.floor-walls-panel[data-mode="sandwich-console"] .floor-walls-insert-action,
.floor-walls-panel[data-mode="standard-console"] .floor-walls-insert-action {
    grid-column: 1;
}

.floor-walls-panel[data-mode="sandwich-console"] .floor-walls-insert-action,
.floor-walls-panel[data-mode="standard-console"] .floor-walls-insert-action,
.floor-walls-panel[data-mode="sandwich-console"] .floor-walls-edit-insert-action,
.floor-walls-panel[data-mode="standard-console"] .floor-walls-edit-insert-action {
    grid-row: 1;
}

.floor-walls-panel[data-mode="sandwich-console"] .floor-walls-edit-insert-action,
.floor-walls-panel[data-mode="standard-console"] .floor-walls-edit-insert-action {
    grid-column: 2;
}

.floor-walls-panel[data-mode="sandwich-console"] #floorWallsAddItem,
.floor-walls-panel[data-mode="standard-console"] #floorWallsAddItem {
    grid-column: 1 / -1;
    grid-row: 2;
}

.components-editor-launchers .floor-walls-editor-toggle {
    font-size: 12px;
    line-height: 1;
    padding-inline: 8px;
}

.component-move-panel {
    position: fixed;
    z-index: 1250;
    width: min(360px, calc(100vw - 24px));
    left: 50%;
    top: 22%;
    transform: translateX(-50%);
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel2);
    color: var(--text);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.42);
}

.component-move-panel[hidden] { display: none; }
.component-move-panel header,
.component-move-panel footer { display: flex; align-items: center; gap: 8px; padding: 9px 10px; }
.component-move-panel header { justify-content: space-between; border-bottom: 1px solid var(--line); cursor: move; }
.component-move-panel footer { justify-content: flex-end; border-top: 1px solid var(--line); }
.component-move-panel button { height: 28px; min-width: 64px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: var(--text); font-weight: 800; }
.component-move-panel button.is-primary { border-color: #22c55e; }
.component-move-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 10px; }
.component-move-fields label { color: var(--muted); font-size: 10px; font-weight: 400; }
.component-move-fields input { height: 29px; padding: 5px 7px; font-size: 12px; }
.component-transform-heading { padding: 10px 10px 0; font-size: 12px; color: var(--muted); }
.component-transform-hint { margin: 8px 10px 0; font-size: 10px; color: var(--muted); }
.component-move-fields label.is-transform-active input { outline: 2px solid var(--transform-axis-color); outline-offset: 2px; }
.component-move-fields label:has(.construction-axis-x) { --transform-axis-color: var(--construction-axis-x); }
.component-move-fields label:has(.construction-axis-y) { --transform-axis-color: var(--construction-axis-y); }
.component-move-fields label:has(.construction-axis-z) { --transform-axis-color: var(--construction-axis-z); }
.construction-axis-x { color: var(--construction-axis-x); }
.construction-axis-y { color: var(--construction-axis-y); }
.construction-axis-z { color: var(--construction-axis-z); }
.construction-axes {
    position: absolute;
    left: 12px;
    bottom: calc(var(--viewer-feedback-height, 43px) + 55px);
    width: clamp(96px, 12vw, 140px);
    height: clamp(96px, 12vw, 140px);
    z-index: 4;
    pointer-events: none;
    border-radius: 50%;
    background: color-mix(in srgb, var(--bg) 72%, transparent);
}
.construction-axes text { font: 14px system-ui, sans-serif; fill: currentColor; }
.quick-construction { position:absolute; left:12px; bottom:calc(var(--viewer-feedback-height, 43px) + 55px + clamp(96px, 12vw, 140px) + 8px); z-index:8; display:flex; align-items:flex-end; gap:6px; max-width:calc(100% - 24px); }
#quickConstructionToggle { writing-mode:vertical-rl; transform:rotate(180deg); height:104px; width:28px; flex:0 0 28px; padding:6px 3px; font-size:12px; font-weight:400; letter-spacing:0; border:1px solid var(--line); border-radius:6px; color:var(--text); background:var(--panel); }
#quickConstructionToggle[aria-expanded="true"] { border-color:#22c55e; }
#quickConstructionTools { display:flex; flex-wrap:wrap; gap:4px; padding:4px; border:1px solid var(--line); border-radius:6px; background:var(--panel); }
#quickConstructionTools[hidden] { display:none; }
#quickConstructionTools button { width:76px; height:76px; padding:2px; border:1px solid transparent; border-radius:4px; background:var(--panel2); }
#quickConstructionTools button[aria-pressed="true"] { border-color:#22c55e; background:color-mix(in srgb,#22c55e 18%,var(--panel)); }
#quickConstructionTools button:hover { border-color:var(--text); }
#quickConstructionTools img { display:block; width:100%; height:100%; object-fit:contain; }
@media (max-width:900px) {
    #quickConstructionTools { display:grid; grid-template-columns:repeat(2,64px); }
    #quickConstructionTools button { width:64px; height:64px; padding:0; }
    #quickConstructionToggle { height:96px; }
}
@media (max-width:900px) and (max-height:600px) {
    .quick-construction { left:48px; max-width:calc(100% - 60px); }
    .construction-axes { left:48px; }
    #quickConstructionTools { grid-template-columns:repeat(4,64px); }
    #quickConstructionToggle { height:84px; }
}

.floor-walls-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
    padding: 0 10px 10px;
}

.floor-walls-actions button {
    border: 1px solid #2563eb;
    border-radius: 14px;
    background: color-mix(in srgb, var(--panel2) 68%, transparent);
    color: var(--text);
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
    padding: 6px 9px;
}

.floor-walls-actions button:hover,
.floor-walls-actions button.is-active {
    border-color: #38bdf8;
    background: color-mix(in srgb, #2563eb 20%, var(--panel2));
}

.floor-walls-panel[data-group="construction"] #floorWallsHideFloors,
.floor-walls-panel[data-group="construction"] #floorWallsHideWalls,
.floor-walls-panel[data-group="construction"] #floorWallsEditInsertion {
    display: none;
}

.proposal-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    background: rgba(0, 0, 0, 0.62);
}

.proposal-modal.is-open {
    display: grid;
    place-items: center;
}

.app-message-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    place-items: center;
    background: rgba(0, 0, 0, 0.62);
}

.app-message-modal.is-open {
    display: grid;
}

.app-message-dialog {
    width: min(520px, calc(100vw - 40px));
    background: var(--panel2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.app-message-dialog h2 {
    margin: 0 0 12px;
    font-size: 14px;
    letter-spacing: 0;
}

.app-message-dialog pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--muted);
    font: 12px/1.45 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.app-message-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.app-message-actions button {
    min-width: 86px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: color-mix(in srgb, var(--accent) 22%, var(--panel));
    color: var(--text);
    cursor: pointer;
    font-weight: 800;
    padding: 8px 14px;
}

.project-open-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 1210;
    display: none;
    place-items: center;
    background: rgba(0, 0, 0, 0.64);
}

.project-open-preview-modal.is-open {
    display: grid;
}

.outputs-cleanup-modal {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: none;
    place-items: center;
    padding: 24px;
    background: rgba(2, 6, 23, 0.72);
}

.outputs-cleanup-modal.is-open {
    display: grid;
}

.outputs-cleanup-dialog {
    width: min(720px, 100%);
    max-height: min(720px, calc(100vh - 48px));
    display: flex;
    flex-direction: column;
    gap: 14px;
    color: var(--text);
    background: var(--panel2);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    padding: 18px;
}

.outputs-cleanup-header h2 {
    margin: 0;
    font-size: 18px;
}

.outputs-cleanup-header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.outputs-cleanup-list {
    min-height: 160px;
    max-height: 430px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--field) 78%, transparent);
}

.preferences-modal {
    position: fixed;
    inset: 0;
    z-index: 72;
    display: none;
    place-items: center;
    padding: 24px;
    background: rgba(2, 6, 23, 0.68);
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    border: 0;
    box-sizing: border-box;
}

.preferences-modal::backdrop {
    background: transparent;
}

.preferences-modal.is-open {
    display: grid;
}

.preferences-dialog {
    width: min(680px, 100%);
    max-height: calc(100dvh - 24px);
    color: var(--text);
    background: var(--panel2);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
    overflow-x: hidden;
    overflow-y: auto;
}

.preferences-window-controls {
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 0 10px;
    color: var(--muted);
}

.preferences-window-controls span::before {
    content: "";
    display: block;
    width: 8px;
    border-top: 2px solid currentColor;
}

.preferences-window-controls button {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.preferences-header {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 4px 34px 10px;
}

.preferences-header-copy > span {
    display: block;
    color: var(--muted);
    font-size: 14px;
}

.preferences-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 0;
    font-size: 20px;
    font-weight: 650;
}

.spacemouse-device-identity {
    min-width: 210px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.spacemouse-device-identity span {
    max-width: 120px;
    color: var(--text);
    font-size: 12px;
    text-align: right;
}

.spacemouse-device-meta {
    display: grid;
    justify-items: end;
    gap: 3px;
}

.spacemouse-device-meta small {
    max-width: 150px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.2;
    text-align: right;
}

.spacemouse-device-identity img {
    width: 132px;
    height: 70px;
    object-fit: contain;
}

.browser-app-mark {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #38bdf8 0 26%, #ffffff 27% 31%, transparent 32%),
        conic-gradient(#ef4444 0 33%, #facc15 0 66%, #22c55e 0);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 18%, transparent);
}

.browser-app-mark[data-browser="firefox"] {
    background:
        radial-gradient(circle at 58% 52%, #312e81 0 32%, transparent 34%),
        conic-gradient(from 210deg, #f97316, #facc15 30%, #ef4444 58%, #7c3aed 84%, #f97316);
}

.browser-app-mark[data-browser="edge"] {
    background: conic-gradient(from 210deg, #0ea5e9, #22c55e 42%, #0f766e 64%, #2563eb);
}

.browser-app-mark[data-browser="browser"] {
    background: color-mix(in srgb, var(--muted) 65%, transparent);
}

.preferences-divider {
    height: 1px;
    background: #38bdf8;
}

.spacemouse-preferences {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 28px;
    padding: 22px 28px 26px;
}

.spacemouse-preferences h3 {
    margin: 0 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

.spacemouse-navigation-panel label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    font-size: 13px;
}

.spacemouse-navigation-panel h3:nth-of-type(2) {
    margin-top: 26px;
}

.spacemouse-preferences input[type="checkbox"],
.spacemouse-preferences input[type="radio"] {
    width: 14px;
    height: 14px;
    accent-color: #38bdf8;
}

.spacemouse-speed-panel h3 {
    margin-bottom: 8px;
}

.spacemouse-axis-headings,
.spacemouse-axis-row {
    display: grid;
    grid-template-columns: 58px 54px minmax(150px, 1fr) 62px;
    align-items: center;
    column-gap: 10px;
}

.spacemouse-axis-headings {
    color: var(--text);
    font-size: 12px;
    padding-bottom: 6px;
    text-align: center;
}

.spacemouse-axis-row {
    min-height: 46px;
}

.spacemouse-axis-row input[type="range"] {
    width: 100%;
    accent-color: #38bdf8;
}

.spacemouse-axis-check {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    justify-self: center;
    cursor: pointer;
}

.spacemouse-axis-row input[type="checkbox"] {
    margin: 0;
}

.spacemouse-axis-icon {
    display: block;
    max-width: 54px;
    max-height: 44px;
    width: auto;
    height: auto;
    justify-self: center;
    object-fit: contain;
    image-rendering: auto;
}

.spacemouse-master-speed {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 50px;
    align-items: center;
    gap: 14px;
    margin: 0 18px 3px;
    padding: 11px 14px;
    border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
    border-radius: 4px;
}

.spacemouse-master-speed label {
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

.spacemouse-master-speed input {
    width: 100%;
    accent-color: #38bdf8;
}

.spacemouse-master-speed output {
    color: var(--muted);
    font-size: 12px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.preferences-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 28px 14px;
    border-top: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
}

.spacemouse-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 166px;
    height: 30px;
}

.spacemouse-brand-mark {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    background: url("/assets/icons/spacemouse-brand.bmp") center top / 104px auto no-repeat;
    filter: invert(1) grayscale(1) brightness(1.35);
    mix-blend-mode: screen;
}

.spacemouse-brand-wordmark {
    width: 130px;
    height: 22px;
    background: url("/assets/icons/spacemouse-brand.bmp") center bottom / 130px auto no-repeat;
    filter: invert(1) grayscale(1) brightness(1.35);
    mix-blend-mode: screen;
}

body[data-theme="day"] .spacemouse-brand-mark,
body[data-theme="day"] .spacemouse-brand-wordmark {
    filter: grayscale(1);
    mix-blend-mode: multiply;
}

.preferences-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.spacemouse-connection-actions {
    padding: 0 24px 12px;
    flex-wrap: wrap;
}
.spacemouse-connection-actions button {
    white-space: normal;
    max-width: 100%;
}

.preferences-actions button {
    min-width: 112px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--field);
    color: var(--text);
    padding: 8px 14px;
    cursor: pointer;
}

.preferences-actions button:hover {
    background: color-mix(in srgb, var(--line) 38%, var(--field));
}

.outputs-cleanup-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
    font-size: 12px;
}

.outputs-cleanup-item:last-child {
    border-bottom: 0;
}

.outputs-cleanup-item strong,
.outputs-cleanup-item span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.outputs-cleanup-item span {
    color: var(--muted);
}

.outputs-cleanup-empty {
    padding: 18px;
    color: var(--muted);
    font-size: 12px;
}

.outputs-cleanup-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.outputs-cleanup-actions button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--field);
    color: var(--text);
    cursor: pointer;
    font-weight: 800;
    padding: 8px 12px;
}

.outputs-cleanup-actions button:hover {
    border-color: var(--accent);
}

.project-open-preview-dialog {
    width: min(760px, calc(100vw - 42px));
    background: var(--panel2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 26px 76px rgba(0, 0, 0, 0.48);
    padding: 14px;
}

.project-open-preview-header h2 {
    margin: 0;
    font-size: 15px;
    letter-spacing: 0;
}

.project-open-preview-header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    word-break: break-word;
}

.project-open-preview-content {
    display: block;
    margin-top: 12px;
}

.project-open-preview-meta {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: color-mix(in srgb, var(--panel) 84%, transparent);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 12px;
    align-content: start;
    font-size: 12px;
}

.project-open-preview-meta dt {
    color: var(--muted);
}

.project-open-preview-meta dd {
    margin: 0;
    color: var(--text);
    word-break: break-word;
}

.project-open-preview-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.project-open-preview-actions button {
    min-width: 92px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
    font-weight: 800;
    padding: 8px 14px;
}

.project-open-preview-actions #projectOpenPreviewOpen {
    background: color-mix(in srgb, var(--accent) 28%, var(--panel));
    border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
}

.proposal-warning-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.62);
}

.proposal-warning-dialog {
    width: min(520px, calc(100vw - 40px));
    background: var(--panel2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
    padding: 20px;
}

.proposal-warning-dialog h2 {
    color: #ef4444;
    margin-bottom: 10px;
}

.proposal-warning-dialog p {
    margin: 0 0 14px;
    font-weight: 800;
}

.warning-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 14px 0 18px;
    line-height: 1.35;
}

.warning-check input {
    width: auto;
    margin: 2px 0 0;
}

.proposal-warning-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.proposal-warning-actions button {
    color: var(--text);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 9px 16px;
    cursor: pointer;
    font-weight: 800;
}

.proposal-warning-actions button:hover {
    background: color-mix(in srgb, #2563eb 32%, transparent);
}

.required-data-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    place-items: center;
    background: rgba(0, 0, 0, 0.62);
}

.required-data-modal.is-open {
    display: grid;
}

.required-data-dialog {
    width: min(520px, calc(100vw - 40px));
    background: var(--panel2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
    padding: 20px;
}

.required-data-dialog h2 {
    margin: 0 0 14px;
    color: var(--text);
}

.required-data-fields {
    display: grid;
    gap: 10px;
}

.required-data-fields label {
    margin: 0;
}

.required-data-fields label small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.required-data-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.required-data-actions button {
    color: var(--text);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 9px 16px;
    cursor: pointer;
    font-weight: 800;
}

.required-data-actions button:hover {
    background: color-mix(in srgb, #2563eb 32%, transparent);
}

.proposal-dialog {
    width: min(1180px, calc(100vw - 48px));
    height: min(860px, calc(100vh - 48px));
    display: grid;
    grid-template-rows: 58px 1fr;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
}

.proposal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px 0 18px;
    border-bottom: 1px solid var(--line);
}

.proposal-header h2 {
    margin: 0;
}

#proposalPreview {
    width: 100%;
    height: 100%;
    border: 0;
    background: #f5f5f5;
}

.model-browser {
    position: relative;
    grid-column: 2;
    grid-row: 1;
    display: none;
    height: 100vh;
    overflow: hidden;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    background: linear-gradient(180deg, var(--panel2), var(--panel));
    border-right: 1px solid var(--line);
    --bom-browser-header-height: 72px;
}

body.browser-open .model-browser {
    display: grid;
}

.bom-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: none;
    width: 9px;
    border: 0;
    background: transparent;
    cursor: col-resize;
    touch-action: none;
}

body.browser-open .bom-resize-handle {
    display: block;
}

.bom-resize-handle::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 2px;
    background: color-mix(in srgb, var(--line) 82%, transparent);
    transition: width 120ms ease, background-color 120ms ease;
}

.bom-resize-handle:hover::after,
.bom-resize-handle:focus-visible::after,
body.bom-resizing .bom-resize-handle::after {
    width: 4px;
    background: color-mix(in srgb, #38bdf8 78%, var(--line));
}

.bom-resize-handle:focus-visible {
    outline: 0;
}

body.bom-resizing,
body.bom-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
}

.browser-header {
    position: sticky;
    top: 0;
    z-index: 9;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, var(--panel2), var(--panel));
}

.browser-header > div {
    min-width: 0;
    margin-right: auto;
}

.browser-header h2 {
    margin: 0;
    font-size: 16px;
}

.browser-header p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.bom-fold-toggle,
.bom-catalog-setup-button {
    width: 23px;
    height: 23px;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--text) 72%, transparent);
    border-radius: 7px;
    color: var(--text);
    background: transparent;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    flex: 0 0 auto;
}

.bom-fold-toggle {
    font-size: 0;
}

.bom-fold-toggle img,
.bom-catalog-setup-button img {
    width: 15px;
    height: 15px;
    display: block;
    pointer-events: none;
}

.preferences-choice-menu > button {
    display: flex;
    align-items: center;
    gap: 12px;
}

.preferences-choice-menu > button > span {
    min-width: 0;
    flex: 1 1 auto;
}

.preferences-choice-menu > button > strong {
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
}

.preferences-choice-menu > button::after {
    flex: 0 0 auto;
}

.preferences-choice-submenu {
    min-width: 210px;
}

.preferences-choice-submenu [role="menuitemradio"][aria-checked="true"] {
    color: #38bdf8;
    background: color-mix(in srgb, #38bdf8 16%, transparent);
}

.preferences-choice-submenu [role="menuitemradio"][aria-checked="true"]::before {
    content: "✓";
    display: inline-block;
    width: 18px;
}

.preferences-choice-submenu [role="menuitemradio"][aria-checked="false"]::before {
    content: "";
    display: inline-block;
    width: 18px;
}

.bom-prices-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0;
    margin: 0;
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    white-space: nowrap;
}

.bom-prices-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.bom-price-button-face {
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    border: 1px solid color-mix(in srgb, var(--text) 72%, transparent);
    border-radius: 7px;
    background: transparent;
    cursor: pointer;
}

.bom-price-button-face img {
    width: 15px;
    height: 15px;
    pointer-events: none;
}

.bom-prices-toggle input:checked + .bom-price-button-face {
    border-color: #38bdf8;
    background: color-mix(in srgb, #38bdf8 18%, transparent);
}

.bom-fold-toggle[aria-expanded="true"] img {
    transform: scaleX(-1);
}

.bom-unhide-button {
    position: absolute;
    left: calc(12px + clamp(96px, 12vw, 140px) / 2);
    bottom: calc(var(--viewer-feedback-height, 43px) + 12px);
    transform: translateX(-50%);
    z-index: 5;
    min-width: 105px;
    height: 34.5px;
    border: 1px solid color-mix(in srgb, #60a5fa 86%, transparent);
    border-radius: 7px;
    color: #ffffff;
    background: #2563eb;
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
    flex: 0 0 auto;
}

.bom-unhide-button[hidden] {
    display: none;
}

.bom-unhide-button:hover {
    background: #1d4ed8;
}

.bom-fold-toggle:hover,
.bom-catalog-setup-button:hover {
    border-color: var(--text);
    background: color-mix(in srgb, var(--line) 35%, transparent);
}

.browser-tree {
    min-height: 0;
    overflow: auto;
    padding: 8px 0 12px 0;
    font-size: 11px;
    line-height: 1.15;
}

.bom-table-header,
.bom-total-row {
    display: grid;
    grid-template-columns: 20px minmax(14.4ch, 1fr) 42px 42px 66px 34px 68px 54px;
    gap: 2px;
    align-items: center;
    padding: 6px 6px 6px 2px;
    border-bottom: 1px solid var(--line);
    color: color-mix(in srgb, var(--text) 72%, transparent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0;
}

.bom-table-header {
    position: sticky;
    top: var(--bom-browser-header-height);
    z-index: 8;
    background: var(--panel);
    text-transform: uppercase;
}

.bom-table-header span {
    min-width: 0;
    line-height: 1.05;
    overflow-wrap: anywhere;
    white-space: normal;
}

.bom-total-row {
    position: sticky;
    bottom: 0;
    z-index: 9;
    border-top: 1px solid var(--line);
    border-bottom: 0;
    color: var(--text);
    background: var(--panel);
}

.bom-table-header span:nth-child(n+4),
.bom-total-row span:nth-child(n+4) {
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    justify-self: stretch;
    text-align: right;
    font-variant-numeric: tabular-nums;
    overflow-wrap: normal;
    white-space: nowrap;
}

.bom-table-header span:nth-child(n+4),
.bom-total-row span:nth-child(n+4),
.bom-artnr,
.bom-pcs,
.bom-price,
.bom-unit,
.bom-value,
.bom-weight {
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-left: 1px solid var(--bom-grid-line);
    padding-left: 4px;
}

.bom-table-header span:nth-child(n+4) {
    justify-content: center;
    padding-left: 0;
    text-align: center;
}

#bomPartNumberHeader,
#bomDescriptionHeader {
    align-self: stretch;
    display: flex;
    align-items: center;
}

.bom-total-row > span:nth-child(n) {
    border-left: 0;
    padding-left: 0;
}

.bom-total-price-status {
    grid-column: 5 / 7;
    color: #ef4444;
    font-weight: 400;
    justify-content: flex-end;
    overflow: hidden;
    text-overflow: ellipsis;
    display: grid;
    gap: 1px;
    line-height: 1.05;
    text-align: right;
}

.bom-total-price-status:empty {
    display: block;
}

.bom-total-incomplete {
    color: #ef4444;
    font-weight: 400;
}

.bom-total-missing-price {
    color: #ef4444;
    font-weight: 400;
}

.bom-total-missing-weight {
    color: #38bdf8;
    font-weight: 400;
}

.browser-tree details {
    margin: 0;
}

.browser-tree summary,
.tree-item {
    min-height: 18px;
    display: grid;
    grid-template-columns: 20px minmax(14.4ch, 1fr) 42px 42px 66px 34px 68px 54px;
    align-items: center;
    column-gap: 2px;
    color: var(--text);
    border-radius: 4px;
    padding: 2px 6px 2px 2px;
    cursor: default;
    list-style: none;
}

body.bom-descriptions-visible .bom-table-header,
body.bom-descriptions-visible .bom-total-row,
body.bom-descriptions-visible .browser-tree summary,
body.bom-descriptions-visible .tree-item {
    grid-template-columns: 20px minmax(14.4ch, 1fr) var(--bom-description-column-width) 42px 42px 66px 34px 68px 54px;
}

body:not(.bom-prices-visible) .bom-table-header,
body:not(.bom-prices-visible) .bom-total-row,
body:not(.bom-prices-visible) .browser-tree summary,
body:not(.bom-prices-visible) .tree-item {
    grid-template-columns: 20px minmax(14.4ch, 1fr) 42px 42px 54px;
}

body.bom-descriptions-visible:not(.bom-prices-visible) .bom-table-header,
body.bom-descriptions-visible:not(.bom-prices-visible) .bom-total-row,
body.bom-descriptions-visible:not(.bom-prices-visible) .browser-tree summary,
body.bom-descriptions-visible:not(.bom-prices-visible) .tree-item {
    grid-template-columns: 20px minmax(14.4ch, 1fr) var(--bom-description-column-width) 42px 42px 54px;
}

body.bom-descriptions-visible .bom-total-price-status {
    grid-column: 6 / 8;
}

body:not(.bom-descriptions-visible) #bomDescriptionHeader,
body:not(.bom-descriptions-visible) .bom-description-text,
body:not(.bom-descriptions-visible) .bom-total-description {
    display: none !important;
}

body:not(.bom-prices-visible) #bomPriceHeader,
body:not(.bom-prices-visible) #bomUnitHeader,
body:not(.bom-prices-visible) #bomValueHeader,
body:not(.bom-prices-visible) .bom-price,
body:not(.bom-prices-visible) .bom-unit,
body:not(.bom-prices-visible) .bom-value,
body:not(.bom-prices-visible) .bom-total-price-status {
    display: none !important;
}

.bom-artnr {
    color: color-mix(in srgb, var(--text) 68%, transparent);
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.bom-artnr-empty {
    color: transparent;
}

.bom-weight,
.bom-pcs,
.bom-unit,
.bom-value {
    color: color-mix(in srgb, var(--text) 68%, transparent);
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.bom-unit {
    color: color-mix(in srgb, var(--muted) 82%, transparent);
    text-transform: none;
}

.bom-pcs {
    color: color-mix(in srgb, var(--text) 72%, transparent);
}

.bom-value {
    color: color-mix(in srgb, var(--text) 72%, transparent);
}

.bom-value-zero {
    color: #ef4444;
    font-weight: 400;
}

.bom-weight-na {
    color: color-mix(in srgb, var(--muted) 78%, transparent);
}

.bom-weight-unknown {
    color: #38bdf8;
    font-weight: 400;
}

.bom-row-label {
    display: contents;
}

.bom-part-number {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 5px;
    font-size: 10px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.bom-description-text {
    min-width: 0;
    color: color-mix(in srgb, var(--muted) 82%, transparent);
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bom-profile-label {
    color: color-mix(in srgb, var(--muted) 82%, transparent);
    font-size: inherit;
    line-height: inherit;
}

.bom-description-toggle {
    width: 15px;
    height: 15px;
    display: inline-grid;
    place-items: center;
    align-self: center;
    justify-self: start;
    margin-left: 1px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.bom-description-toggle span {
    width: 15px;
    height: 15px;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--muted) 72%, transparent);
    border-radius: 2px;
    background: var(--field);
    transition: transform 120ms ease, border-color 120ms ease, color 120ms ease;
}

.bom-description-toggle img {
    width: 9px;
    height: 9px;
    display: block;
    margin: 0;
    object-fit: contain;
}

.bom-description-toggle[aria-expanded="true"] span {
    border-color: color-mix(in srgb, var(--text) 72%, transparent);
    background: var(--field);
    transform: rotate(180deg);
}

.bom-description-toggle:focus-visible span {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

.bom-price {
    color: color-mix(in srgb, var(--text) 68%, transparent);
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.bom-catalog-modal {
    position: fixed;
    inset: 0;
    z-index: 52;
    display: none;
    place-items: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.52);
}

.bom-catalog-modal[aria-hidden="false"] {
    display: grid;
}

.bom-catalog-dialog {
    width: min(1040px, 96vw);
    max-height: 86vh;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel2);
    color: var(--text);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
    padding: 18px;
}

.bom-catalog-header h2 {
    margin: 0;
    font-size: 18px;
}

.bom-catalog-header p {
    min-height: 16px;
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.bom-catalog-header p[data-mode="error"] {
    color: #ef4444;
    font-weight: 400;
}

.bom-catalog-grid,
.bom-catalog-map {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.bom-catalog-map {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bom-catalog-dialog label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.bom-catalog-dialog select,
.bom-catalog-dialog input[type="file"],
.bom-catalog-dialog input[type="text"] {
    min-width: 0;
    width: 100%;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--field);
    color: var(--text);
    padding: 0 8px;
    font: inherit;
}

.bom-article-assignment {
    margin-top: 18px;
}

.bom-article-assignment-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.bom-article-assignment-title h3 {
    margin: 0;
    font-size: 13px;
}

.bom-article-assignment-table {
    max-height: min(340px, 42vh);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.bom-article-assignment-head,
.bom-article-assignment-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.45fr) minmax(110px, 0.75fr) 72px minmax(92px, 0.75fr) minmax(92px, 0.75fr);
    gap: 6px;
    align-items: center;
    padding: 4px 6px;
}

.bom-article-assignment-head {
    position: sticky;
    top: 0;
    z-index: 1;
    color: var(--muted);
    background: var(--panel2);
    border-bottom: 1px solid var(--line);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.bom-article-assignment-head span {
    min-width: 0;
    line-height: 1.1;
    overflow-wrap: anywhere;
    white-space: normal;
}

.bom-article-assignment-row {
    border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.bom-article-assignment-row:last-child {
    border-bottom: 0;
}

.bom-article-assignment-name {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 10px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bom-article-assignment-default {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
}

.bom-article-assignment-row input[type="text"] {
    height: 28px;
    font-size: 11px;
    font-weight: 600;
}

.bom-article-assignment-separate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bom-article-assignment-shared {
    grid-column: 4 / 6;
}

.bom-article-assignment-row:not(.is-separated) .bom-article-assignment-bas,
.bom-article-assignment-row:not(.is-separated) .bom-article-assignment-pro {
    display: none;
}

.bom-article-assignment-row.is-separated .bom-article-assignment-shared {
    display: none;
}

.bom-catalog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.bom-catalog-actions-top {
    justify-content: flex-start;
}

.bom-catalog-actions button {
    min-width: 92px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--field);
    color: var(--text);
    cursor: pointer;
    font-weight: 900;
}

.bom-catalog-actions button:hover {
    border-color: var(--text);
}

.browser-tree summary::-webkit-details-marker {
    display: none;
}

.browser-tree summary::before {
    content: "";
    width: 9px;
    height: 9px;
    display: inline-grid;
    place-items: center;
    align-self: start;
    margin-top: 3px;
    margin-left: calc(var(--bom-tree-depth, 0) * 2px);
    background: var(--icon-bom-fold) center / contain no-repeat;
}

.browser-tree details[open] > summary::before {
    transform: rotate(90deg);
}

.browser-tree summary:hover,
.tree-item:hover {
    background: color-mix(in srgb, var(--line) 55%, transparent);
}

.browser-tree summary.is-hovered,
.tree-item.is-hovered {
    outline: 1px solid color-mix(in srgb, var(--text) 85%, transparent);
    outline-offset: -1px;
}

body[data-theme="day"] .browser-tree summary.is-hovered,
body[data-theme="day"] .tree-item.is-hovered {
    outline-color: #2563eb;
}

.browser-tree summary.is-selected,
.tree-item.is-selected {
    background: color-mix(in srgb, #2563eb 32%, transparent);
    color: var(--text);
}

.browser-tree summary.is-dimmed,
.browser-tree .tree-item.is-dimmed {
    opacity: 0.3;
}

.browser-tree summary.is-hidden-target,
.browser-tree .tree-item.is-hidden-target {
    opacity: 0.42;
    text-decoration: line-through;
}

.browser-tree summary.has-hidden-children,
.browser-tree .tree-item.has-hidden-children {
    box-shadow: inset 3px 0 0 #2563eb;
}

.browser-tree .bom-part-number {
    padding-left: calc(var(--bom-tree-depth, 0) * 5px);
}

.tree-item {
    color: var(--muted);
}

.tree-item::before {
    content: "";
    width: 9px;
    height: 9px;
    align-self: start;
    margin-top: 2px;
}

.tree-item.muted {
    opacity: 0.7;
}

.tree-icon {
    width: 9px;
    height: 9px;
    border: 1px solid var(--line);
    background: var(--field);
    display: inline-block;
    margin-top: 2px;
    flex: 0 0 auto;
}

.tree-icon.folder,
.tree-icon.assembly {
    border: 0;
    background: var(--icon-bom-folder) center / contain no-repeat;
}

.bom-logical-folder > summary .tree-icon.folder {
    background: #86efac;
    -webkit-mask: var(--icon-bom-folder) center / contain no-repeat;
    mask: var(--icon-bom-folder) center / contain no-repeat;
}

.tree-icon.part {
    border: 1px solid #429bff;
    border-radius: 0;
    background: transparent;
    box-sizing: border-box;
}

#viewer {
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

#loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 20px;
    z-index: 5;
    background: var(--bg);
}

.hidden {
    display: none !important;
}

canvas {
    display: block;
}

.hint {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 20px;
    width: fit-content;
    max-width: calc(100% - 40px);
    box-sizing: border-box;
    color: var(--muted);
    background: #0f1724cc;
    border: 1px solid #2a3850;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.35;
    pointer-events: none;
}

.selection-context-menu {
    position: fixed;
    z-index: 30;
    display: none;
    min-width: 128px;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel2);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
    font-size: 0.67rem;
}

.selection-context-menu.is-open {
    display: block;
}

.cube-display-menu button::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 8px;
    border: 1px solid currentColor;
    border-radius: 50%;
    vertical-align: middle;
}

.cube-display-menu button[aria-checked="true"]::before {
    background: currentColor;
}

.cube-display-menu button[role="menuitemcheckbox"]::before {
    border-radius: 1px;
}

.cube-display-menu hr {
    margin: 3px 0;
    border: 0;
    border-top: 1px solid var(--line);
}

.selection-context-menu button {
    width: 100%;
    display: block;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    padding: 6px 8px;
    text-align: left;
    cursor: pointer;
    font-weight: 400;
    font: inherit;
    line-height: 1.15;
}

.selection-context-menu button[hidden] {
    display: none;
}

/* Pseudo-elements survive the menu's translated textContent updates. */
.selection-context-menu button[data-component-action="move"],
.selection-context-menu button[data-tree-action="isolate"],
.selection-context-menu button[data-straight-context-action="rename"],
.selection-context-menu button[data-copy-context],
.selection-context-menu button[data-advanced-parameters],
.flight-context-rename {
    position: relative;
    min-height: 25px;
    padding-left: 30px;
}

.selection-context-menu button[data-component-action="move"]::before,
.selection-context-menu button[data-tree-action="isolate"]::before,
.selection-context-menu button[data-straight-context-action="rename"]::before,
.selection-context-menu button[data-straight-context-action="rename"]::after,
.selection-context-menu button[data-copy-context]::before,
.selection-context-menu button[data-copy-context]::after,
.selection-context-menu button[data-advanced-parameters]::before,
.selection-context-menu button[data-advanced-parameters]::after,
.flight-context-rename::before,
.flight-context-rename::after {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: var(--context-action-icon) center / contain no-repeat;
    pointer-events: none;
}

.selection-context-menu button[data-component-action="move"] {
    --context-action-icon: url('/assets/icons/night/context-move-rotate.png');
}

:root { --context-icon-blue: #28b8e9; --context-icon-gray: #d4e0ed; }
body[data-theme="day"] { --context-icon-blue: #008bbb; --context-icon-gray: #6d7782; }

.selection-context-menu button[data-tree-action="isolate"]::before {
    top: 4px;
    transform: none;
    background: radial-gradient(circle at 4px 4px, var(--context-icon-gray) 3px, transparent 3px),
        radial-gradient(circle at 12px 4px, var(--context-icon-gray) 3px, transparent 3px),
        radial-gradient(circle at 4px 12px, var(--context-icon-blue) 3px, transparent 3px),
        radial-gradient(circle at 12px 12px, var(--context-icon-gray) 3px, transparent 3px);
}

.selection-context-menu button[data-straight-context-action="rename"]::before,
.flight-context-rename::before {
    background: var(--context-icon-gray);
    mask: url('/assets/icons/context-rename-boxes.svg') center / 16px no-repeat;
}
.selection-context-menu button[data-straight-context-action="rename"]::after,
.flight-context-rename::after {
    background: var(--context-icon-blue);
    mask: url('/assets/icons/context-rename-cursor.svg') center / 16px no-repeat;
}
.selection-context-menu button[data-copy-context]::before {
    background: var(--context-icon-gray);
    mask: url('/assets/icons/context-copy-back.svg') center / 16px no-repeat;
}
.selection-context-menu button[data-copy-context]::after {
    background: var(--context-icon-blue);
    mask: url('/assets/icons/context-copy-front.svg') center / 16px no-repeat;
}
.selection-context-menu button[data-advanced-parameters]::before {
    background: var(--context-icon-gray);
    mask: url('/assets/icons/context-adjust-gray.svg') center / 16px no-repeat;
}
.selection-context-menu button[data-advanced-parameters]::after {
    background: var(--context-icon-blue);
    mask: url('/assets/icons/context-adjust-blue.svg') center / 16px no-repeat;
}

.straight-advanced-dialog {
    width: min(380px, calc(100vw - 32px));
    box-sizing: border-box;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel2);
    color: var(--text);
}
.straight-advanced-dialog::backdrop { background: rgb(0 0 0 / 40%); }
.straight-advanced-dialog header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.straight-advanced-dialog h3 { font-size: 14px; font-weight: 500; margin: 0; flex: 1; }
.straight-advanced-dialog label { display: grid; grid-template-columns: minmax(0, 1fr) 96px; align-items: center; gap: 12px; margin: 12px 0; }
.straight-advanced-dialog input { box-sizing: border-box; width: 100%; color: var(--text); background: var(--panel); border: 1px solid var(--line); padding: 6px; }
.straight-advanced-dialog footer { display: flex; justify-content: space-between; margin-top: 18px; }
.straight-advanced-dialog button { position: relative; min-width: 30px; height: 30px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; }
.straight-advanced-dialog .dialog-close-cross { border: 0; background: transparent; width: 28px; flex: 0 0 28px; }
.dialog-close-cross::before, .dialog-close-cross::after { content: ''; position: absolute; top: 14px; left: 6px; width: 16px; height: 2px; background: #df4242; transform: rotate(45deg); }
.dialog-close-cross::after { transform: rotate(-45deg); }
.advanced-reset::before { content: ''; position: absolute; inset: 7px; border: 1.5px solid currentColor; border-left-color: transparent; border-radius: 50%; }
.advanced-reset::after { content: ''; position: absolute; left: 5px; top: 6px; width: 5px; height: 5px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; }

body[data-theme="day"] .selection-context-menu button[data-component-action="move"] {
    --context-action-icon: url('/assets/icons/day/context-move-rotate.png');
}


.selection-context-submenu {
    position: relative;
}

.selection-context-submenu-toggle::after {
    content: "";
    float: right;
    width: 12px;
    height: 12px;
    background-color: currentColor;
    mask: var(--icon-menu-submenu) center / contain no-repeat;
    -webkit-mask: var(--icon-menu-submenu) center / contain no-repeat;
}

.selection-context-submenu-panel {
    position: absolute;
    top: 0;
    left: calc(100% - 1px);
    display: none;
    min-width: 104px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel2);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
}

.selection-context-combo-panel {
    min-width: 300px;
    padding: 6px;
}

.selection-context-combo-panel select {
    width: 100%;
    min-height: 30px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--panel);
    color: var(--text);
    padding: 4px 24px 4px 6px;
    font: inherit;
}

.selection-context-submenu:hover .selection-context-submenu-panel,
.selection-context-submenu:focus-within .selection-context-submenu-panel {
    display: block;
}

.origin-tree-row {
    color: var(--muted);
}

.origin-tree-row.is-origin-visible::before {
    content: "✓";
    width: 15px;
    height: 15px;
    display: inline-grid;
    place-items: center;
    border-radius: 3px;
    background: #334155;
    color: #67e8f9;
    font-size: 11px;
    line-height: 1;
    flex: 0 0 15px;
}

.selection-context-menu button[data-origin-action].is-active::before {
    content: "✓";
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border-radius: 3px;
    background: #334155;
    color: #67e8f9;
}

.selection-context-menu > button:last-child,
.selection-context-submenu-panel button:last-child {
    border-bottom: 0;
}

.selection-context-menu button:hover,
.selection-context-menu button.is-active {
    background: color-mix(in srgb, #2563eb 32%, transparent);
}

.measure-menu-color {
    display: grid;
    grid-template-columns: 1fr 34px;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    color: var(--text);
    font-size: 11px;
    font-weight: 750;
}

.measure-menu-color input {
    width: 34px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: transparent;
}

.additional-component-readout { padding: 8px 10px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.additional-component-readout[hidden] { display: none; }
.additional-component-coordinates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 5px 0 8px; }
.additional-component-coordinates label { display: flex; align-items: center; gap: 4px; min-width: 0; }
.additional-component-coordinates input { width: 100%; min-width: 0; height: 28px; padding: 4px; font-size: 11px; text-align: right; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 3px; }
.surface-tools { display: none; padding: 8px 10px; }
.floor-walls-panel[data-mode="surface"] .surface-tools { display: grid; gap: 8px; }
.floor-walls-panel[data-mode="surface"] > .floor-walls-grid,
.floor-walls-panel[data-mode="surface"] > .floor-walls-pillar-row,
.floor-walls-panel[data-mode="surface"] > .floor-walls-console-row,
.floor-walls-panel[data-mode="surface"] > .floor-walls-actions { display: none; }
.surface-plane-buttons, .surface-command-buttons { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.surface-tools button, .surface-move-dialog button {
    border: 1px solid var(--line); border-radius: 5px; background: var(--panel2);
    color: var(--text); padding: 5px 8px; font-size: 11px; cursor: pointer;
}
.surface-tools button.is-active { border-color: var(--text); background: color-mix(in srgb,var(--text) 15%,var(--panel2)); }
.surface-tools button:disabled { opacity: .4; cursor: default; }
#surfaceSize { min-height: 18px; font-size: 11px; color: var(--muted); }
.surface-move-dialog {
    border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: var(--panel); color: var(--text);
    width: min(300px,calc(100vw - 40px)); font-size: 12px;
}
.surface-move-dialog::backdrop { background: #0006; }
.surface-move-dialog form { display: grid; gap: 12px; }
.surface-move-dialog input { width: 100%; box-sizing: border-box; }
.surface-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

.measures-panel {
    position: absolute;
    top: 122px;
    left: 18px;
    z-index: 24;
    width: min(330px, calc(100% - 36px));
    max-height: calc(100vh - 156px);
    overflow: auto;
    border: 1px solid color-mix(in srgb, var(--text) 22%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel2) 58%, transparent);
    color: var(--text);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(6px);
    font-size: 12px;
    line-height: 1.6;
}

.measures-panel.is-hidden {
    display: none;
}

.measures-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    font-weight: 400;
}

.measures-header-actions {
    display: inline-flex;
    gap: 6px;
}

.measures-text-size {
    height: 14px;
    margin: -7px 10px 2px;
    position: relative;
}

.measures-text-size input[type="range"] {
    appearance: none;
    display: block;
    width: 100%;
    height: 14px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    accent-color: var(--text);
    cursor: ew-resize;
}

.measures-text-size input::-webkit-slider-runnable-track {
    height: 1px;
    background: var(--line);
}

.measures-text-size input::-webkit-slider-thumb {
    appearance: none;
    width: 10px;
    height: 10px;
    margin-top: -4.5px;
    border: 1px solid var(--text);
    border-radius: 50%;
    background: var(--panel2);
}

.measures-text-size input::-moz-range-track {
    height: 1px;
    background: var(--line);
}

.measures-text-size input::-moz-range-thumb {
    width: 9px;
    height: 9px;
    border: 1px solid var(--text);
    border-radius: 50%;
    background: var(--panel2);
}

.measures-text-size input:focus-visible {
    outline: 1px solid var(--text);
    outline-offset: 2px;
}

@media (max-width: 900px) {
    .measures-panel {
        left: 40px;
        width: min(330px, calc(100% - 50px));
    }
}

.measures-header button,
.measure-row button,
.measure-row select {
    border: 1px solid var(--line);
    border-radius: 5px;
    background: color-mix(in srgb, var(--panel2) 76%, transparent);
    color: var(--text);
    font-size: 10px;
    font-weight: 400;
    cursor: pointer;
    padding: 5px 7px;
}

.measure-row button.is-active {
    border-color: #facc15;
    background: color-mix(in srgb, #facc15 24%, var(--panel2));
}

.measures-list {
    padding: 0 10px 8px;
}

.measures-empty {
    padding: 12px 0;
    color: var(--muted);
    font-size: 11px;
}

.measure-row {
    position: relative;
    padding: 9px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
}

.measure-row.is-selected {
    background: color-mix(in srgb, var(--line) 30%, transparent);
    margin: 0 -10px;
    padding-inline: 10px;
}

.measure-row.is-orphaned {
    background: color-mix(in srgb, #ed3434 25%, var(--panel2));
    box-shadow: inset 3px 0 #ed3434;
    margin: 0 -10px;
    padding-inline: 10px;
}

.measure-row select {
    min-width: 64px;
}

.measure-row-main {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 8px;
}

.measure-row-main.is-angle {
    grid-template-columns: auto minmax(62px, 1fr) auto auto auto;
}

.measure-row-actions {
    display: grid;
    gap: 3px;
    width: 52px;
}

.measures-panel .measure-row-actions button {
    min-height: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 9px;
    line-height: 16px;
}

.measure-row strong {
    font-size: 12px;
    font-weight: 400;
    color: var(--text);
}

.measure-row.is-selected strong {
    color: var(--measure-selected, #ff0000);
}

.measure-axis-values {
    display: flex;
    gap: 10px;
    padding: 6px 0 0 54px;
    font-size: 11px;
    font-weight: 400;
}

.axis-x { color: #ef4444; }
.axis-y { color: #22c55e; }
.axis-z { color: #38bdf8; }

.measure-precision-popover {
    position: absolute;
    right: 0;
    top: 34px;
    z-index: 4;
    display: grid;
    gap: 2px;
    min-width: 86px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel2);
}

.measure-pick-combo {
    position: fixed;
    z-index: 200;
    min-width: 245px;
    max-width: 340px;
    display: none;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: color-mix(in srgb, var(--panel) 97%, #000 3%);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
    color: var(--text);
}

.measure-pick-combo.is-open {
    display: block;
}

.measure-pick-combo-title {
    padding: 7px 9px 5px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.measure-pick-combo-list {
    max-height: 178px;
    overflow: auto;
    padding: 4px;
}

.measure-pick-combo button {
    width: 100%;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text);
    text-align: left;
    padding: 6px;
    font-size: 11px;
    cursor: pointer;
}

.measure-pick-combo button.is-active,
.measure-pick-combo button:hover {
    background: color-mix(in srgb, #facc15 24%, transparent);
}

.ifc-rotation-submenu [data-ifc-rotate-axis="x"] {
    color: #ef4444;
}

.ifc-rotation-submenu [data-ifc-rotate-axis="y"] {
    color: #22c55e;
}

.ifc-rotation-submenu [data-ifc-rotate-axis="z"] {
    color: #3b82f6;
}

.selection-context-submenu [data-ifc-context-action="rotate-x"] {
    color: #ef4444;
}

.selection-context-submenu [data-ifc-context-action="rotate-y"] {
    color: #22c55e;
}

.selection-context-submenu [data-ifc-context-action="rotate-z"] {
    color: #3b82f6;
}

.ifc-context-transparency {
    min-width: 208px;
    padding: 7px 8px 8px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
}

.ifc-context-transparency label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 5px;
    line-height: 1.15;
}

.ifc-context-transparency output {
    min-width: 34px;
    color: var(--muted);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.ifc-context-transparency input[type="range"] {
    display: block;
    width: 100%;
    height: 16px;
    margin: 0;
    accent-color: #38bdf8;
    cursor: ew-resize;
}

.ifc-config-modal,
.ifc-origin-modal {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.58);
}

.ifc-config-modal {
    pointer-events: none;
}

.ifc-config-modal.is-open,
.ifc-origin-modal.is-open {
    display: flex;
}

.ifc-progress-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: none;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.64);
}

.ifc-progress-modal.is-open {
    display: grid;
}

.ifc-progress-dialog {
    display: grid;
    grid-template-columns: 132px minmax(220px, 1fr);
    align-items: center;
    gap: 20px;
    width: min(520px, calc(100vw - 36px));
    min-height: 180px;
    border: 1px solid color-mix(in srgb, #5eead4 32%, var(--line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel) 88%, #020617);
    color: var(--text);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.56);
    padding: 20px;
}

.ifc-progress-ring {
    --ifc-progress-value: 0%;
    --ifc-sub-progress-value: 0%;
    position: relative;
    display: grid;
    place-items: center;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, color-mix(in srgb, var(--panel) 90%, #020617) 0 47%, transparent 48%),
        conic-gradient(#67e8f9 var(--ifc-progress-value), color-mix(in srgb, #164e63 50%, transparent) 0);
    box-shadow: 0 0 24px rgba(103, 232, 249, 0.25);
}

.ifc-progress-ring::before {
    content: "";
    position: absolute;
    inset: 9px;
    border-radius: 50%;
    border: 8px solid color-mix(in srgb, #0e7490 34%, transparent);
    border-top-color: #a5f3fc;
    animation: ifc-progress-spin 1.15s linear infinite;
}

.ifc-progress-ring::after {
    content: "";
    position: absolute;
    inset: 28px;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, color-mix(in srgb, var(--panel) 92%, #020617) 0 58%, transparent 59%),
        conic-gradient(#facc15 var(--ifc-sub-progress-value), color-mix(in srgb, #713f12 48%, transparent) 0);
    box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.16);
}

.ifc-progress-modal[data-sub-progress="none"] .ifc-progress-ring::after {
    display: none;
}

.ifc-progress-modal[data-sub-progress="indeterminate"] .ifc-progress-ring::after {
    background: none;
    border: 5px solid color-mix(in srgb, #facc15 24%, transparent);
    border-top-color: #fde68a;
    border-right-color: #facc15;
    animation: ifc-progress-spin 0.82s linear infinite reverse;
}

.ifc-progress-ring span {
    position: relative;
    z-index: 2;
    font-size: 20px;
    font-weight: 800;
    color: #a5f3fc;
}

.ifc-progress-copy h2 {
    margin: 0 0 6px;
    font-size: 16px;
    letter-spacing: 0;
}

.ifc-progress-copy p {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 12px;
}

.ifc-progress-copy ol {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ifc-progress-copy li {
    color: var(--muted);
    font-size: 12px;
}

.ifc-progress-copy li::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 8px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--muted) 48%, transparent);
}

.ifc-progress-copy li.is-active {
    color: var(--text);
}

.ifc-progress-copy li.is-active::before {
    background: #67e8f9;
    box-shadow: 0 0 10px rgba(103, 232, 249, 0.7);
}

.ifc-progress-copy li.is-done::before {
    background: #22c55e;
}

.ifc-config-modal.is-busy .ifc-config-dialog {
    pointer-events: none;
}

@keyframes ifc-progress-spin {
    to {
        transform: rotate(360deg);
    }
}

.ifc-config-dialog {
    display: grid;
    grid-template-rows: auto minmax(260px, 1fr) auto auto;
    gap: 12px;
    width: min(980px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
    padding: 14px;
    pointer-events: auto;
}

.ifc-origin-dialog {
    display: block;
    width: min(420px, calc(100vw - 40px));
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
    padding: 14px;
}

.ifc-config-header,
.ifc-config-toolbar,
.ifc-placement-panel,
.ifc-config-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ifc-config-header {
    justify-content: space-between;
    cursor: move;
    user-select: none;
    touch-action: none;
}

.ifc-config-header h2 {
    margin: 0;
    font-size: 18px;
}

.ifc-config-header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.ifc-config-header button,
.ifc-config-toolbar button,
.ifc-panel-heading button,
.ifc-placement-panel button,
.ifc-config-actions button {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel2);
    color: var(--text);
    padding: 7px 10px;
    cursor: pointer;
}

.ifc-config-dialog.is-dragging {
    user-select: none;
}

.ifc-panel-heading button {
    padding: 6px 8px;
    font-size: 11px;
    white-space: nowrap;
}

.ifc-config-toolbar input,
.ifc-panel-heading input,
.ifc-placement-panel input,
.ifc-origin-fields input {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--input);
    color: var(--text);
    padding: 7px 9px;
}

.ifc-config-toolbar input {
    min-width: 220px;
    margin-left: auto;
}

.ifc-panel-heading {
    display: grid;
    grid-template-columns: auto minmax(70px, 1fr) auto auto auto;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    transform: translateY(-6px);
    margin-bottom: -6px;
}

.ifc-config-body {
    display: grid;
    grid-template-columns: minmax(230px, 0.34fr) minmax(420px, 1fr);
    gap: 12px;
    min-height: 0;
}

.ifc-column {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 4px;
    min-height: 0;
}

.ifc-class-panel,
.ifc-tree-panel {
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel2);
    padding: 2px 3px;
    --ifc-row-height: 14px;
    --ifc-row-gap: 6px;
    --ifc-row-step: calc(var(--ifc-row-height) + var(--ifc-row-gap));
    --ifc-row-indent: 12px;
    --ifc-icon-size: 12px;
    --ifc-check-size: 10px;
    --ifc-row-font-size: 9px;
}

.ifc-panel-heading h3 {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.ifc-visible-toggle {
    display: inline-grid;
    grid-template-columns: auto 14px;
    align-items: center;
    gap: 5px;
    color: var(--text);
    font-size: 11px;
    white-space: nowrap;
}

.ifc-visible-toggle input {
    width: 13px;
    height: 13px;
    margin: 0;
}

.ifc-class-row,
.ifc-tree-row {
    display: flex;
    align-items: center;
    gap: 2px;
    min-height: var(--ifc-row-step);
    font-size: var(--ifc-row-font-size);
    font-weight: 400;
    line-height: 1;
}

.ifc-class-row span,
.ifc-class-row small,
.ifc-tree-row span,
.ifc-tree-row small {
    font-size: var(--ifc-row-font-size);
    font-weight: 400;
    line-height: 1;
}

.ifc-check-list {
    display: block;
}

.ifc-check-list .ifc-class-row,
.ifc-tree-row {
    display: grid;
    grid-template-columns: var(--ifc-icon-size) var(--ifc-check-size) minmax(72px, 1fr) minmax(24px, auto);
    align-items: center;
    column-gap: 2px;
    width: 100%;
    min-width: 0;
    white-space: nowrap;
    padding: 0 1px var(--ifc-row-gap);
    border-radius: 3px;
    cursor: default;
}

.ifc-check-list .ifc-class-row[data-ifc-depth] {
    padding-left: calc(var(--ifc-depth, 0) * var(--ifc-row-indent) + 1px);
}

.ifc-class-row > .ifc-tree-icon,
.ifc-tree-row > .ifc-tree-icon {
    grid-column: 1;
}

.ifc-class-row > input,
.ifc-tree-row > input,
.ifc-tree-row > .ifc-tree-spacer {
    grid-column: 2;
    grid-row: 1;
}

.ifc-class-row > span:not(.ifc-tree-branch):not(.ifc-tree-icon),
.ifc-tree-row > span:not(.ifc-tree-branch):not(.ifc-tree-icon):not(.ifc-tree-spacer) {
    grid-column: 3;
    min-width: 0;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ifc-check-list .ifc-class-row small {
    grid-column: 4;
    color: var(--muted);
    font-weight: 400;
    text-align: right;
}

.ifc-check-list input,
.ifc-tree-row input {
    justify-self: end;
    width: var(--ifc-check-size);
    height: var(--ifc-check-size);
    margin: 0;
}

.ifc-tree-row {
    position: relative;
    padding-left: calc(var(--ifc-depth, 0) * var(--ifc-row-indent) + 1px);
    font-weight: 400;
    border-radius: 3px;
    cursor: default;
}

.ifc-class-row {
    position: relative;
}

.ifc-tree-branch {
    position: absolute;
    left: calc((var(--ifc-depth, 0) * var(--ifc-row-indent)) - 6px);
    top: 0;
    flex: 0 0 0;
    width: 0;
    height: var(--ifc-row-step);
    pointer-events: none;
}

.ifc-class-row > .ifc-tree-branch,
.ifc-tree-row > .ifc-tree-branch {
    grid-column: auto;
}

.ifc-tree-branch::before {
    content: "";
    position: absolute;
    left: 0;
    top: calc(-1 * var(--ifc-row-gap));
    bottom: calc(-1 * var(--ifc-row-gap));
    border-left: 1px solid color-mix(in srgb, var(--muted) 70%, transparent);
}

.ifc-tree-node > .ifc-class-row:last-child > .ifc-tree-branch::before,
.ifc-tree-node > .ifc-tree-row:last-child > .ifc-tree-branch::before,
.ifc-tree-node > .ifc-tree-node:last-child > summary > .ifc-tree-branch::before,
.ifc-tree > .ifc-tree-node:last-child > summary > .ifc-tree-branch::before,
[data-ifc-lazy-children] > .ifc-tree-node:last-child > summary > .ifc-tree-branch::before {
    bottom: auto;
    height: calc(var(--ifc-row-gap) + var(--ifc-row-height) / 2);
}

.ifc-tree-branch::after {
    content: "";
    position: absolute;
    left: 0;
    top: calc(var(--ifc-row-height) / 2);
    width: 5px;
    border-top: 1px solid color-mix(in srgb, var(--muted) 70%, transparent);
}

.ifc-class-row[style*="--ifc-depth:0"] .ifc-tree-branch::before,
.ifc-class-row[style*="--ifc-depth:0"] .ifc-tree-branch::after,
.ifc-tree-row[style*="--ifc-depth:0"] .ifc-tree-branch::before,
.ifc-tree-row[style*="--ifc-depth:0"] .ifc-tree-branch::after {
    display: none;
}

.ifc-tree-icon {
    flex: 0 0 var(--ifc-icon-size);
    width: var(--ifc-icon-size);
    height: var(--ifc-icon-size);
    border-radius: 2px;
    background: linear-gradient(135deg, #7dd3fc, #2563eb);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26);
    position: relative;
    overflow: hidden;
}

.ifc-tree-icon.folder::before,
.ifc-tree-icon.folder::after {
    content: "";
    position: absolute;
    background: rgba(191, 239, 255, 0.82);
}

.ifc-tree-icon.folder::before {
    left: 50%;
    top: 1px;
    bottom: 1px;
    width: 1px;
    transform: translateX(-0.5px);
}

.ifc-tree-icon.folder::after {
    left: 1px;
    right: 1px;
    top: 50%;
    height: 1px;
    transform: translateY(-0.5px);
}

.ifc-tree-icon.element {
    border-radius: 0;
    background: var(--icon-file-ifc) center / contain no-repeat;
    box-shadow: none;
}

.ifc-tree-icon.ifc-logo {
    border-radius: 0;
    background: var(--icon-file-ifc) center / contain no-repeat;
    box-shadow: none;
}

.ifc-tree-node {
    margin: 0;
    position: relative;
    line-height: 1;
}

.ifc-tree-node summary {
    cursor: pointer;
    list-style: none;
    margin: 0;
}

.ifc-tree-node > summary.ifc-tree-row {
    margin-bottom: var(--ifc-row-gap);
}

.ifc-tree-node summary::-webkit-details-marker {
    display: none;
}

.ifc-tree-empty {
    color: var(--text);
    font-size: 15px;
    line-height: 1.45;
    padding: 6px 4px;
}

.ifc-tree-lazy-placeholder {
    color: var(--muted);
    min-height: var(--ifc-row-height);
    font-size: var(--ifc-row-font-size);
    line-height: var(--ifc-row-height);
    padding: 0 0 0 calc(var(--ifc-depth, 0) * var(--ifc-row-indent) + var(--ifc-icon-size) + var(--ifc-check-size) + 7px);
    padding-bottom: var(--ifc-row-gap);
}

.ifc-tree-spacer {
    flex: 0 0 var(--ifc-check-size);
    width: var(--ifc-check-size);
}

.ifc-class-row:hover,
.ifc-tree-row:hover,
.ifc-class-row.is-selected,
.ifc-tree-row.is-selected {
    background: color-mix(in srgb, #60a5fa 18%, transparent);
}

.ifc-tree-context-menu {
    position: fixed;
    z-index: 92;
    display: none;
    min-width: 170px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel2);
    color: var(--text);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

.ifc-tree-context-menu.is-open {
    display: block;
}

.ifc-tree-context-menu button {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--text);
    padding: 6px 8px;
    text-align: left;
    font-size: 11px;
    cursor: pointer;
}

.ifc-tree-context-menu button:hover {
    background: color-mix(in srgb, #2563eb 28%, transparent);
}

.ifc-tree-context-menu button:disabled {
    color: var(--muted);
    opacity: 0.55;
    cursor: default;
}

.ifc-tree-context-menu button:disabled:hover {
    background: transparent;
}

.ifc-tree-context-menu hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 5px 2px;
}

.ifc-placement-panel {
    display: grid;
    gap: 8px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.ifc-placement-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.ifc-placement-row [data-ifc-rotate-axis="x"] {
    color: #ef4444;
}

.ifc-placement-row [data-ifc-rotate-axis="y"] {
    color: #22c55e;
}

.ifc-placement-row [data-ifc-rotate-axis="z"] {
    color: #3b82f6;
}

.ifc-placement-panel label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.ifc-placement-panel input {
    width: 86px;
}

.ifc-origin-fields {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 12px 0;
}

.ifc-origin-fields label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.ifc-origin-fields input {
    width: 100%;
}

.ifc-config-actions {
    justify-content: flex-end;
}

.ifc-manual-transform-panel {
    position: fixed;
    top: 108px;
    right: auto;
    left: max(450px, calc(50vw - 215px));
    z-index: 1260;
    display: none;
    width: min(430px, calc(100vw - 32px));
    pointer-events: none;
}

.ifc-manual-transform-panel.is-open {
    display: block;
}

.ifc-manual-transform-dialog {
    overflow: hidden;
    border: 1px solid color-mix(in srgb, #38bdf8 46%, var(--line));
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    box-shadow: 0 22px 56px rgba(0, 0, 0, 0.46);
    pointer-events: auto;
}

.ifc-manual-transform-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 8px 10px 8px 12px;
    border-bottom: 1px solid var(--line);
    cursor: move;
    user-select: none;
    touch-action: none;
}

.ifc-manual-transform-header h2 {
    margin: 0;
    font-size: 15px;
    letter-spacing: 0;
}

.ifc-manual-transform-header span {
    display: block;
    overflow: hidden;
    max-width: 330px;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ifc-manual-transform-header button,
.ifc-manual-transform-body button,
.ifc-manual-transform-actions button {
    min-height: 30px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel2);
    color: var(--text);
    font-weight: 800;
    cursor: pointer;
}

.ifc-manual-transform-header button {
    width: 30px;
    padding: 0;
    font-size: 18px;
}

.ifc-manual-transform-body {
    display: grid;
    gap: 9px;
    padding: 11px 12px;
}

.ifc-manual-axis-row,
.ifc-manual-operation-row,
.ifc-manual-transform-actions {
    display: flex;
    align-items: flex-end;
    gap: 7px;
}

.ifc-manual-operation-row[hidden] {
    display: none;
}

.ifc-manual-axis-row > span {
    align-self: center;
    min-width: 82px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.ifc-manual-axis-buttons {
    display: grid;
    grid-template-columns: repeat(3, 34px);
    gap: 3px;
}

.ifc-manual-axis-buttons button {
    padding: 0;
}

.ifc-manual-axis-buttons [data-ifc-manual-axis="x"] { color: #ef4444; }
.ifc-manual-axis-buttons [data-ifc-manual-axis="y"] { color: #22c55e; }
.ifc-manual-axis-buttons [data-ifc-manual-axis="z"] { color: #3b82f6; }

.ifc-manual-axis-buttons button.is-active,
.ifc-manual-transform-body button.is-active {
    border-color: #facc15;
    box-shadow: inset 0 0 0 1px #facc15;
    color: #facc15;
}

.ifc-manual-axis-row > button {
    flex: 1;
    padding: 0 9px;
}

.ifc-manual-axis-value {
    min-height: 17px;
    color: #38bdf8;
    font-size: 11px;
    font-weight: 800;
}

.ifc-manual-operation-row label {
    display: grid;
    flex: 1;
    gap: 3px;
    margin: 0;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
}

.ifc-manual-operation-row input {
    width: 100%;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--input);
    color: var(--text);
    padding: 4px 8px;
    margin: 0;
    font-weight: 800;
}

.ifc-manual-operation-row button {
    padding: 0 10px;
    white-space: nowrap;
}

.ifc-manual-transform-actions {
    justify-content: flex-end;
    padding: 9px 12px;
    border-top: 1px solid var(--line);
}

.ifc-manual-transform-actions button {
    min-width: 88px;
    padding: 0 12px;
}

#ifcManualTransformApply {
    border-color: #16a34a;
    background: color-mix(in srgb, #16a34a 24%, var(--panel2));
}

#ifcManualTransformCloseButton {
    border-color: #2563eb;
}

body.ifc-manual-picking-edge canvas { cursor: crosshair; }
body.ifc-manual-drag-ready canvas { cursor: grab; }
body.ifc-manual-dragging canvas { cursor: grabbing; }

.required-switch {
    display: grid;
    gap: 8px;
}

.required-switch span {
    color: var(--text);
    font-weight: 800;
}

.view-cube {
    position: fixed;
    top: 64px;
    right: 18px;
    z-index: 12;
    width: 196px;
    height: 196px;
    pointer-events: auto;
    filter: none;
    perspective: 360px;
}

.view-cube button {
    position: absolute;
    box-sizing: border-box;
    border: 0;
    cursor: pointer;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
    transition: filter 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.view-cube button:hover {
    filter: brightness(1.16);
    z-index: 6;
}

.view-home {
    top: 34px;
    left: 8px;
    right: auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: grid !important;
    place-items: center;
    color: var(--text) !important;
    background: color-mix(in srgb, var(--panel2) 74%, transparent);
    border: 1px solid color-mix(in srgb, var(--text) 42%, transparent) !important;
    font-size: 16px !important;
    line-height: 1;
    padding: 0 0 3px;
}

.view-home:hover {
    border-color: #68e1d3 !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, #68e1d3 32%, transparent);
}

.view-roll-controls {
    position: absolute;
    top: 14.5px;
    right: 52.5px;
    z-index: 4;
    width: 42px;
    height: 42px;
}

.view-roll-controls[hidden] {
    display: none;
}

.view-cube .view-roll-left,
.view-cube .view-roll-right {
    position: absolute;
    padding: 0;
    border: 0;
    color: var(--text);
    background: transparent;
    font-size: 0;
    line-height: 1;
}

.view-cube .view-roll-left:hover,
.view-cube .view-roll-right:hover {
    color: #68e1d3;
    filter: drop-shadow(0 0 2px color-mix(in srgb, #68e1d3 65%, transparent));
}

.view-cube-canvas {
    position: absolute;
    left: 42px;
    top: 10px;
    width: 112px;
    height: 112px;
    z-index: 2;
    transform-origin: 50% 58%;
    transform-style: preserve-3d;
}

.view-cube-canvas canvas {
    display: block;
    width: 112px !important;
    height: 112px !important;
    position: relative;
    z-index: 2;
}

.view-cube-secondary {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 29px;
    height: 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    z-index: 3;
}

.view-cube-mode-row {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 54px;
    height: 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px 42px;
    gap: 4px;
    z-index: 3;
}

.view-cube .view-transparency-toggle,
.view-cube .view-grid-toggle,
.view-cube .view-projection-toggle {
    position: static;
    height: 20px;
    border-radius: 4px;
    color: var(--text);
    background: color-mix(in srgb, var(--panel2) 74%, transparent);
    border: 1px solid color-mix(in srgb, var(--text) 26%, transparent) !important;
    font-size: 9px;
    font-weight: 400;
}

.view-cube .view-grid-toggle,
.view-cube .view-projection-toggle {
    min-width: 0;
    font-size: 8px;
    padding: 0;
}

.view-cube .view-transparency-toggle.is-off,
.view-cube .view-grid-toggle.is-off,
.view-cube .view-projection-toggle.is-ortho {
    color: #fca5a5;
}

.view-cube .view-transparency-toggle:hover,
.view-cube .view-grid-toggle:hover,
.view-cube .view-projection-toggle:hover {
    border-color: #68e1d3 !important;
    background: color-mix(in srgb, #68e1d3 28%, var(--panel2));
    box-shadow: 0 0 0 1px #68e1d3, 0 0 12px color-mix(in srgb, #68e1d3 52%, transparent);
}

.view-cube-secondary button {
    position: static;
    height: 20px;
    border-radius: 4px;
    color: var(--text);
    background: color-mix(in srgb, var(--panel2) 74%, transparent);
    border: 1px solid color-mix(in srgb, var(--text) 26%, transparent);
    font-size: 9px;
    font-weight: 400;
}

.view-cube-secondary button:hover {
    border-color: #68e1d3;
    background: color-mix(in srgb, #68e1d3 28%, var(--panel2));
    box-shadow: 0 0 0 1px #68e1d3, 0 0 12px color-mix(in srgb, #68e1d3 52%, transparent);
}


body[data-theme="day"] .hint {
    background: #ffffffcc;
    border-color: #cbd5e1;
}

@media (min-width: 901px) and (max-height: 1080px) {
    :root {
        --menu-density: 0.8;
    }
}

@media (min-width: 901px) and (max-width: 2559px) {
    body.browser-open {
        grid-template-columns: var(--project-panel-width) var(--bom-panel-width) minmax(0, 1fr);
    }

}

.view-home img {
    width: 15px;
    height: 15px;
    display: block;
}

body[data-theme="day"] .view-home {
    background: #ffffff;
}

body[data-theme="day"] .view-home img {
    filter: brightness(0);
}

.app-info-toggle img,
.mobile-info-toggle img {
    width: 15px;
    height: 15px;
    display: block;
    margin: auto;
}

body[data-theme="day"] .app-info-toggle img,
body[data-theme="day"] .mobile-info-toggle img {
    filter: brightness(0);
}

@media (max-width: 900px) {
    :root {
        --menu-density: 0.84;
        --mobile-topbar-height: 64px;
        --topbar-control-height: 23px;
    }

    body {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        overflow: visible;
        max-width: 100vw;
    }

    body.browser-open {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }

    .landing-geometry-header {
        align-items: flex-start;
        gap: 8px;
    }

    .landing-geometry-header-main {
        display: grid;
        gap: 5px;
    }

    .landing-geometry-construction-actions {
        gap: 3px;
    }

    .landing-geometry-construction-actions button {
        min-width: 0;
        height: 24px;
        padding: 1px 6px;
        font-size: 8px;
    }

    .panel {
        position: fixed;
        top: var(--mobile-topbar-height);
        left: 0;
        bottom: auto;
        z-index: 40;
        width: min(80vw, 318px);
        height: calc(100vh - var(--mobile-topbar-height));
        height: calc(100dvh - var(--mobile-topbar-height));
        max-height: none;
        border-right: 1px solid var(--line);
        border-bottom: 0;
        padding: 8px;
        background: color-mix(in srgb, var(--panel) 78%, transparent);
        backdrop-filter: blur(10px);
        box-shadow: 18px 0 42px rgba(0, 0, 0, 0.36);
        transform: translateX(-105%);
        transition: transform 280ms ease;
    }

    .project-panel-resize-handle {
        display: none;
    }

    .panel .app-header {
        display: block;
        margin: 0 0 8px 36px;
    }

    .panel .app-header .badge,
    .panel .app-header h1,
    .panel .app-header .browser-toggle { display: none; }

    .panel section {
        margin-bottom: 8px;
        padding: 9px;
        border-radius: 6px;
    }

    .panel label {
        margin: 6px 0;
    }

    .panel input,
    .panel select {
        min-height: 29px;
        padding-top: 5px;
        padding-bottom: 5px;
    }

    .main-geometry-pair {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 8px;
        align-items: end;
    }

    .main-geometry-pair label {
        min-width: 0;
    }

    .main-geometry-steps-pair:has(.steps-suggestion.is-visible) {
        grid-template-columns: minmax(0, 1fr);
    }

    .panel .components-editor-launchers {
        display: none;
    }

    body.mobile-panel-open .panel {
        transform: translateX(0);
    }

    .viewport {
        grid-column: 1;
        grid-row: 1;
        height: 100vh;
        height: 100dvh;
        min-height: 100dvh;
        max-width: 100vw;
        overflow-x: hidden;
        grid-template-rows: var(--mobile-topbar-height) 1fr;
    }

    body.browser-open .viewport {
        grid-column: 1;
        grid-row: 1;
    }

    .topbar {
        position: relative;
        z-index: 1300;
        min-height: var(--mobile-topbar-height);
        height: var(--mobile-topbar-height);
        gap: 5px;
        padding: 3px 6px;
        align-items: center;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        background: color-mix(in srgb, var(--panel) 72%, transparent);
        backdrop-filter: blur(8px);
        overflow: visible;
    }

    .topbar h2 {
        display: none;
    }

    .mobile-topbar-brand {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        opacity: 0.58;
        pointer-events: none;
        user-select: none;
        transform: translateY(4px);
    }

    .mobile-topbar-brand img {
        width: 42px;
        height: 25px;
        object-fit: contain;
    }

    .mobile-topbar-brand span {
        color: var(--text);
        font-size: 13px;
        font-weight: 900;
        letter-spacing: 0;
    }

    .topbar-actions {
        gap: 3px;
        row-gap: 2px;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-items: flex-start;
        align-content: flex-start;
        min-width: 0;
        max-width: 100%;
        overflow: visible;
    }

    .mobile-edge-toggle {
        display: inline-flex;
        position: fixed;
        left: 3px;
        z-index: 1500;
        width: 74px;
        height: 26px;
        min-width: 74px;
        padding: 0 6px;
        border-radius: 7px;
        transform: rotate(-90deg);
        transform-origin: center;
        background: color-mix(in srgb, var(--panel) 38%, transparent);
        border-color: color-mix(in srgb, var(--text) 62%, transparent);
        color: color-mix(in srgb, var(--text) 96%, transparent);
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.36);
        backdrop-filter: blur(8px);
        pointer-events: auto;
    }

    body.mobile-panel-open .mobile-edge-toggle,
    body.browser-open .mobile-edge-toggle,
    body.mobile-stats-open .mobile-edge-toggle,
    body.mobile-info-open .mobile-edge-toggle,
    body.mobile-components-open .mobile-edge-toggle {
        z-index: 39;
    }

    body:has(.floor-walls-panel:not(.is-hidden)) .mobile-edge-toggle {
        visibility: hidden;
    }

    .mobile-components-toggle {
        width: 92px;
        min-width: 92px;
    }

    .mobile-info-toggle {
        left: 12px;
        width: 26px;
        min-width: 26px;
        height: 26px;
        padding: 0;
        border-radius: 50%;
        transform: none;
        font-family: Georgia, "Times New Roman", serif;
        font-size: 14px;
        font-weight: 900;
    }

    .mobile-edge-toggle[aria-expanded="true"],
    .mobile-edge-toggle[aria-pressed="true"],
    .mobile-edge-toggle.is-active {
        background: color-mix(in srgb, var(--accent) 34%, transparent);
        border-color: color-mix(in srgb, var(--accent) 72%, transparent);
    }

    .topbar-actions > .save-files-menu,
    .topbar-actions > .language-menu,
    .topbar-actions > .refresh-project-button {
        flex: 0 0 66px;
        min-width: 66px;
    }

    .topbar-actions > #themeToggle {
        flex: 0 0 48px;
        min-width: 48px;
        width: 48px;
    }

    .topbar-actions > .save-files-menu {
        flex-basis: 44px;
        min-width: 44px;
    }

    .topbar-actions > .save-files-menu > summary,
    .topbar-actions > .language-menu > summary,
    .topbar-actions > .refresh-project-button {
        width: 66px;
        min-width: 66px;
        height: 23px;
        min-height: 23px;
        padding: 4px 5px;
        font-size: 7px;
        line-height: 1;
    }

    .topbar-actions > .save-files-menu > summary {
        width: 44px;
        min-width: 44px;
        padding-left: 5px;
        padding-right: 5px;
    }

    .save-files-panel,
    .language-panel {
        position: fixed;
        top: var(--mobile-topbar-height);
        z-index: 1600;
        min-width: 0;
        max-height: calc(100vh - var(--mobile-topbar-height) - 8px);
        max-height: calc(100dvh - var(--mobile-topbar-height) - 8px);
        overflow: auto;
    }

    .save-files-panel {
        left: 8px;
        right: 8px;
        max-width: calc(100vw - 16px);
    }

    .language-panel {
        right: 8px;
        width: 176px;
        max-width: calc(100vw - 16px);
    }

    .topbar-actions > #themeToggle {
        height: 23px;
        min-height: 23px;
        padding: 4px 5px;
        font-size: 7px;
        line-height: 1;
    }

    .language-menu summary img {
        width: 14px;
        height: 10px;
    }

    .topbar .command-status,
    .topbar #summary {
        font-size: 6px;
        line-height: 1.1;
    }

    .mobile-email-action {
        display: block;
    }

    .model-browser {
        position: fixed;
        top: 0;
        left: 0;
        bottom: auto;
        z-index: 1450;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        border-right: 0;
        border-top: 0;
        background: color-mix(in srgb, var(--panel) 76%, transparent);
        backdrop-filter: blur(10px);
        box-shadow: 18px 0 42px rgba(0, 0, 0, 0.36);
        transform: translateX(-105%);
        transition: transform 280ms ease;
        --bom-browser-header-height: 48px;
    }

    .bom-resize-handle {
        display: none !important;
    }

    .model-browser .browser-header {
        min-height: 48px;
        padding: 0 8px;
        gap: 6px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 24px 24px 24px;
    }

    .browser-header h2 {
        font-size: 13px;
    }

    .browser-header p {
        display: none;
    }

    .bom-fold-toggle,
    .bom-catalog-setup-button {
        width: 22px;
        height: 22px;
    }

    .bom-prices-toggle {
        grid-column: 2;
    }

    .bom-catalog-setup-button {
        grid-column: 3;
    }

    .bom-fold-toggle {
        grid-column: 4;
    }

    body.browser-open .model-browser {
        display: grid;
        transform: translateX(0);
    }

    .app-info-menu {
        position: static;
    }

    .app-info-toggle {
        display: none;
    }

    .app-info-card {
        position: fixed;
        top: var(--mobile-topbar-height);
        left: 0;
        right: auto;
        z-index: 41;
        width: min(88vw, 350px);
        max-height: calc(100vh - var(--mobile-topbar-height));
        max-height: calc(100dvh - var(--mobile-topbar-height));
        overflow: auto;
        border-radius: 0 8px 8px 0;
        background: color-mix(in srgb, var(--panel) 78%, transparent);
        backdrop-filter: blur(10px);
    }

    .stats-panel,
    .hint {
        display: none !important;
    }

    body.mobile-stats-open .stats-panel {
        display: block !important;
        position: fixed;
        top: var(--mobile-topbar-height);
        left: 0;
        z-index: 41;
        width: min(88vw, 350px);
        max-height: calc(100vh - var(--mobile-topbar-height));
        max-height: calc(100dvh - var(--mobile-topbar-height));
        overflow: auto;
        border-radius: 0 8px 8px 0;
    }

    .floor-walls-panel {
        position: fixed;
        left: 8px;
        top: calc(var(--mobile-topbar-height) + 8px);
        z-index: 41;
    }

    .landing-geometry-window {
        left: 8px;
        top: calc(var(--mobile-topbar-height) + 8px);
        width: calc(100vw - 16px);
        max-height: calc(100dvh - var(--mobile-topbar-height) - 16px);
        z-index: 1420;
    }

    .ifc-manual-transform-panel {
        top: calc(var(--mobile-topbar-height) + 8px);
        right: auto;
        left: 8px;
        width: calc(100vw - 16px);
    }

    .ifc-manual-axis-row,
    .ifc-manual-operation-row {
        flex-wrap: wrap;
    }

    .ifc-manual-axis-row > span {
        width: 100%;
    }

    .landing-geometry-body {
        display: block;
        overflow: auto;
    }

    .landing-geometry-preview-panel {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .landing-geometry-preview-stage {
        height: auto;
        min-height: 0;
        aspect-ratio: 760 / 560;
    }

    .landing-geometry-constraints {
        overflow: visible;
        justify-items: end;
    }

    .view-cube {
        top: 8px;
        right: 8px;
        width: 132px;
        height: 132px;
        perspective: 240px;
        filter: none;
    }

    .view-home {
        top: 52px;
        left: 31px;
        width: 18px;
        height: 18px;
        font-size: 11px !important;
    }

    .view-roll-controls {
        top: 9px;
        right: 22px;
        width: 32px;
        height: 32px;
    }

    .view-cube .view-roll-left,
    .view-cube .view-roll-right {
        position: absolute;
    }

    .view-cube .view-roll-left {
        width: 19px;
        height: 13px;
    }

    .view-cube .view-roll-right {
        width: 13px;
        height: 19px;
    }

    .view-cube .view-roll-left::before {
        width: 16px;
        height: 10px;
    }

    .view-cube .view-roll-right::before {
        width: 10px;
        height: 16px;
    }

    .view-cube-canvas {
        left: 28px;
        top: 6px;
        width: 76px;
        height: 76px;
    }

    .view-cube-canvas canvas {
        width: 76px !important;
        height: 76px !important;
    }

    .view-cube-mode-row {
        left: -8px;
        right: 16px;
        top: 19px;
        bottom: auto;
        height: 17px;
        grid-template-columns: minmax(0, 1fr) 30px 34px;
        gap: 3px;
    }

    .view-cube-secondary {
        left: -8px;
        right: 16px;
        top: 0;
        bottom: auto;
        height: 17px;
        gap: 3px;
    }

    .view-cube .view-transparency-toggle,
    .view-cube .view-grid-toggle,
    .view-cube .view-projection-toggle,
    .view-cube-secondary button {
        height: 17px;
        font-size: 7px;
        border-radius: 3px;
    }

    .bom-table-header,
    .bom-total-row {
        grid-template-columns: 18px minmax(11.2ch, 1fr) 38px 34px 54px 30px 56px 46px;
        font-size: 8px;
    }

    .browser-tree summary,
    .tree-item {
        grid-template-columns: 18px minmax(11.2ch, 1fr) 38px 34px 54px 30px 56px 46px;
        min-height: 15px;
        padding-top: 1px;
        padding-bottom: 1px;
        font-size: 9px;
    }

    body.bom-descriptions-visible .bom-table-header,
    body.bom-descriptions-visible .bom-total-row,
    body.bom-descriptions-visible .browser-tree summary,
    body.bom-descriptions-visible .tree-item {
        grid-template-columns: 18px minmax(11.2ch, 1fr) min(var(--bom-description-column-width), 42vw) 38px 34px 54px 30px 56px 46px;
    }

    body:not(.bom-prices-visible) .bom-table-header,
    body:not(.bom-prices-visible) .bom-total-row,
    body:not(.bom-prices-visible) .browser-tree summary,
    body:not(.bom-prices-visible) .tree-item {
        grid-template-columns: 18px minmax(11.2ch, 1fr) 38px 34px 46px;
    }

    body.bom-descriptions-visible:not(.bom-prices-visible) .bom-table-header,
    body.bom-descriptions-visible:not(.bom-prices-visible) .bom-total-row,
    body.bom-descriptions-visible:not(.bom-prices-visible) .browser-tree summary,
    body.bom-descriptions-visible:not(.bom-prices-visible) .tree-item {
        grid-template-columns: 18px minmax(11.2ch, 1fr) min(var(--bom-description-column-width), 42vw) 38px 34px 46px;
    }

    .browser-tree {
        font-size: 9px;
        padding-bottom: 48px;
    }

    .bom-part-number,
    .bom-description-text {
        font-size: 8.5px;
    }

    .bom-catalog-grid,
    .bom-catalog-map {
        grid-template-columns: 1fr;
    }
}
.stay-placement-panel {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 35;
    display: flex;
    gap: 6px;
    padding: 6px;
    max-width: calc(100% - 24px);
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 6px;
    flex-wrap: wrap;
}
.stay-placement-panel[hidden] { display: none; }
.stay-placement-panel select { min-width: 96px; }
.stay-placement-panel button, .stay-placement-panel select {
    color: var(--text);
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 5px 8px;
    min-height: 28px;
    font: 12px Arial, sans-serif;
}
