#open-loft { color: #efd49d; background: #b3813a26; }
#loft-desk {
 --loft-ink: #eddfbe;
 --loft-muted: #9fb6ac;
 --loft-line: #b4cbaf28;
 --loft-gold: #efbe73;
 width: min(1080px, calc(100vw - 28px));
 max-width: none;
 max-height: calc(100dvh - 28px);
 padding: 20px 24px 16px;
 color: var(--loft-ink);
 background: radial-gradient(ellipse at 90% 0%, #23413c 0%, #142b29 53%, #101f20 100%);
 border-color: #a0baa463;
 border-radius: 12px;
 box-shadow: 0 26px 100px #040d0ee8;
}
#loft-desk::backdrop { background: #071516c4; backdrop-filter: blur(5px); }
.loft-heading { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.loft-heading p { color: var(--loft-gold); font-size: 9px; letter-spacing: .22em; margin: 0 0 4px; }
.loft-heading p span { color: var(--loft-muted); margin: 0 4px; }
#loft-desk h2 { color: var(--loft-ink); margin: 0; font-size: clamp(24px, 3.2vw, 38px); letter-spacing: .1em; }
.loft-metrics { display: flex; flex: 1; justify-content: flex-end; gap: 18px; }
.loft-metrics div { display: grid; gap: 2px; min-width: 68px; }
.loft-metrics b { color: #dce9d4; font: 16px ui-monospace, Consolas, monospace; white-space: nowrap; }
.loft-metrics small, .loft-editbar label { color: var(--loft-muted); font-size: 10px; letter-spacing: .07em; }
#loft-tabs { display: none; }
.mobile-layout #loft-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-bottom: 6px; }
#loft-tabs button { min-height: 34px; font-size: 12px; }
.mobile-layout .loft-workbench { display: block; }
.mobile-layout .loft-longitudinal, .mobile-layout .loft-detail { display: contents; }
.mobile-layout #loft-desk .loft-card:not(.mobile-current) { display: none; }
#loft-desk button, #loft-desk select, #loft-desk input:not([type=checkbox]) {
 border: 1px solid var(--loft-line);
 border-radius: 5px;
 color: var(--loft-ink);
 background: #25423b;
}
#loft-desk button:hover:not(:disabled), #loft-desk button[aria-pressed=true] { border-color: #eab971a0; background: #665032; color: #ffe2ac; }
#loft-desk button:focus-visible, #loft-desk select:focus-visible, #loft-desk input:focus-visible { outline: 2px solid var(--loft-gold); outline-offset: 1px; }
#loft-desk .loft-close { width: 39px; min-height: 39px; font-size: 25px; align-self: flex-start; }
.loft-workbench { display: grid; grid-template-columns: minmax(0, 1.46fr) minmax(0, 1fr); gap: 10px; }
.loft-longitudinal, .loft-detail { display: grid; align-content: start; gap: 10px; min-width: 0; }
.loft-card { border: 1px solid var(--loft-line); border-radius: 7px; min-width: 0; background: #0d2022af; overflow: hidden; }
.loft-card header { display: flex; align-items: baseline; gap: 8px; padding: 8px 12px 0; white-space: nowrap; }
.loft-card header span { color: var(--loft-gold); font: 10px ui-monospace, monospace; }
#loft-desk .loft-card h3 { color: var(--loft-ink); font: 13px system-ui, sans-serif; margin: 0; }
.loft-card header small { margin-left: auto; color: #829d96; font-size: 9px; overflow: hidden; text-overflow: ellipsis; }
.loft-card svg { display: block; width: 100%; max-height: 245px; }
.loft-perspective svg { max-height: 112px; }
.loft-grid line { stroke: #8cb9b024; stroke-width: .7; }
.loft-grid line.datum { stroke: #9fc9c156; stroke-dasharray: 4 3; }
.loft-grid text { fill: #88a6a3; font: 9px ui-monospace, monospace; }
.loft-fill { fill: #589d9221; stroke: #95c1af7a; stroke-width: 1.1; }
.loft-line, .selected-line, .loft-station { fill: none; stroke: #8fcab1a6; stroke-width: 1.3; }
.loft-station { stroke: #86bcab57; stroke-dasharray: 4 4; }
.loft-station.current { stroke: #efbe738a; }
.reflected { opacity: .55; }
.selected-line { stroke: #f3cb8e; stroke-width: 2; }
.loft-handle { fill: #deb87f; stroke: transparent; stroke-width: 16; paint-order: stroke; cursor: grab; touch-action: none; }
.loft-handle.active { fill: #ffe3ac; filter: drop-shadow(0 0 4px #ffb842); }
.loft-preview-board { fill: hsl(var(--hue) 18% calc(28% * var(--shade))); stroke: #112321; stroke-width: .7; cursor: pointer; }
.loft-preview-board.queued { fill: hsl(var(--hue) 44% calc(55% * var(--shade))); }
.loft-preview-board.laid { fill: hsl(153 24% calc(53% * var(--shade))); cursor: default; }
.loft-preview-board:hover { stroke: #ffe2a9; stroke-width: 1.3; }
.loft-patterns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 8px; padding: 0 8px 8px; }
.loft-patterns > div { display: flex; align-items: center; gap: 2px; min-width: 0; }
.loft-patterns b { color: var(--loft-muted); flex: none; font-weight: 400; font-size: 10px; margin-right: 3px; }
#loft-desk .loft-patterns button { font-size: 11px; min-width: 0; flex: 1; height: 23px; padding: 0; }
.loft-editbar { display: grid; grid-template-columns: 1.35fr 1.25fr repeat(4, 1fr); gap: 9px; margin-top: 11px; }
.loft-editbar label { display: grid; gap: 3px; min-width: 0; }
#loft-desk .loft-editbar input, #loft-desk .loft-editbar select { width: 100%; padding: 5px 8px; font-size: 13px; min-width: 0; min-height: 33px; color-scheme: dark; }
.loft-commands, .loft-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.loft-commands > div, .loft-footer > div { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.loft-commands button, .loft-footer button { min-height: 32px; padding: 4px 9px; font-size: 11px; white-space: nowrap; }
.loft-footer { padding-top: 10px; border-top: 1px solid var(--loft-line); }
#loft-status { margin: 0; color: var(--loft-muted); line-height: 1.55; }
#loft-status.invalid { color: #ffb49b; }
.loft-attach { font-size: 10px; margin-right: 4px; color: var(--loft-muted); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.loft-attach select { min-height: 32px; }
#loft-build { background: #dfb577 !important; color: #272312 !important; font-weight: 700; }
@media (max-width: 770px) {
 #loft-desk { padding: 12px; max-height: calc(100dvh - 18px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
 .loft-heading { flex-wrap: wrap; gap: 8px; }
 .loft-metrics { order: 3; flex-basis: 100%; justify-content: space-between; gap: 3px; }
 .loft-metrics div { min-width: 0; }
 #loft-desk .loft-close { margin-left: auto; }
 .loft-metrics b { font-size: 14px; }
 .loft-workbench { grid-template-columns: 1fr; }
 .loft-detail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 .loft-patterns { grid-template-columns: 1fr; }
 .loft-editbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
 #loft-desk .loft-editbar input, #loft-desk .loft-editbar select { font-size: 16px; }
 .loft-footer { align-items: flex-start; flex-direction: column; }
 .loft-commands button, .loft-footer button { min-height: 38px; }
}
@media (max-width: 480px) {
 .loft-detail { grid-template-columns: 1fr; }
 .loft-patterns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 #loft-desk .loft-patterns button { height: 34px; }
 .loft-card header small { font-size: 8px; }
}
