:root {
  color-scheme: light;
  --ink: #18383e;
  --muted: #7b8b8f;
  --line: #e4eaeb;
  --bg: #f4f7f7;
  --teal: #178d83;
  --teal-light: #e7f5f1;
  --network: #427cb9;
  --cpu: #258d7c;
  --gpu: #8965ba;
  --orange: #c77824;
  --row-height: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-synthesis: none;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }
button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid #64b8ae; outline-offset: 3px; }
input, select, textarea { color: var(--ink); }
input::placeholder, textarea::placeholder { color: #a0adaf; }
button, a, input, select { touch-action: manipulation; }
svg { flex-shrink: 0; width: 18px; height: 18px; vertical-align: middle; }
h1, h2, h3, p { margin: 0; }
button { transition: background .15s, border-color .15s, box-shadow .15s, color .15s; }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 9px; background: #c5d1d2; background-clip: padding-box; }
* { scrollbar-width: thin; scrollbar-color: #c5d1d2 transparent; }

.status-dot { flex: 0 0 auto; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #37a88f; }
.app-shell { min-width: 0; }
.topbar { min-height: 58px; padding: 8px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff; }
.eyebrow { display: block; margin-bottom: 5px; color: #8c9b9d; font-size: 9px; font-weight: 650; letter-spacing: 2px; }
h1 { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 650; letter-spacing: -.5px; }
.version-tag { padding: 2px 7px; border: 1px solid #d8e7e3; border-radius: 5px; color: #50837a; background: #f5faf8; font-size: 10px; font-weight: 500; letter-spacing: 0; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.save-status { margin-right: 4px; color: #7d9390; font-size: 11px; }
.save-status svg { width: 12px; height: 12px; margin-right: 5px; }
.save-status.unsaved { color: #b08140; }
.button { min-height: 36px; padding: 8px 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #dbe4e4; border-radius: 7px; background: #fff; color: #3b595e; font-size: 12px; font-weight: 550; line-height: 1.4; white-space: nowrap; }
.button svg { width: 15px; height: 15px; }
.button:hover { background: #f1f6f5; border-color: #bdceca; }
.button.quiet { border-color: transparent; background: transparent; }
.button.quiet:hover { background: #edf3f2; }
.button.dark { color: #fff; border-color: #214b50; background: #214b50; }
.button.dark:hover { background: #123b41; }
.button.primary { color: #fff; border-color: #16867b; background: #16867b; }
.button.primary:hover { background: #107468; }
.button.danger { color: #b34f4b; border-color: #ebd3d0; background: #fffaf9; }
.button.danger:hover { background: #fbe9e6; border-color: #dca8a3; }
.icon-button { width: 32px; height: 32px; padding: 6px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #7b9395; }
.icon-button svg { width: 16px; height: 16px; }
.icon-button:hover { color: var(--teal); border-color: #9dc8c0; background: #f0f8f5; }
.add-button { border-color: #d0e4de; background: #eaf5f0; color: #297e6d; font-size: 23px; font-weight: 300; }
main { min-width: 0; padding: 10px 12px 0; }
.project-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.breadcrumb { margin-bottom: 10px; color: #8b999c; font-size: 10px; }
.breadcrumb span { margin: 0 8px; color: #bdc9ca; }
h2 { color: #17383d; font-size: 22px; font-weight: 650; letter-spacing: -.65px; overflow-wrap: anywhere; }
.project-heading p { margin-top: 6px; color: #8a9a9c; font-size: 12px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.metric-card { position: relative; min-width: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 2px 4px #18383e02; }
.metric-label { color: #7d9294; font-size: 11px; font-weight: 500; }
.metric-value { margin-top: 4px; color: #23444a; font-size: 23px; font-weight: 650; line-height: 1.05; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.metric-unit { margin-left: 5px; color: #8a9d9e; font-size: 11px; font-weight: 450; letter-spacing: 0; }
.metric-meta { margin-top: 4px; color: #647d80; font-size: 11px; line-height: 1.4; }
.metric-meta.warning, .metric-card.warning .metric-value { color: #bc742b; }
.metric-icon { position: absolute; top: 9px; right: 10px; display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid #edf1f0; border-radius: 7px; color: #91aaa7; background: #fafcfb; }
.metric-icon svg { width: 15px; height: 15px; }

.workspace { --library-width: clamp(180px, 15vw, 220px); --details-width: clamp(240px, 19vw, 280px); --bom-width: clamp(350px, 25vw, 420px); display: grid; grid-template-columns: var(--library-width) minmax(0, 1fr) var(--details-width) var(--bom-width); gap: 8px; align-items: stretch; min-width: 0; min-height: 0; }
/* Equal specificity keeps the narrow layout authoritative for all eight states. */
.workspace:where(.library-collapsed) { grid-template-columns: minmax(0, 1fr) var(--details-width) var(--bom-width); }
.workspace:where(.details-collapsed) { grid-template-columns: var(--library-width) minmax(0, 1fr) var(--bom-width); }
.workspace:where(.bom-collapsed) { grid-template-columns: var(--library-width) minmax(0, 1fr) var(--details-width); }
.workspace:where(.library-collapsed.details-collapsed) { grid-template-columns: minmax(0, 1fr) var(--bom-width); }
.workspace:where(.library-collapsed.bom-collapsed) { grid-template-columns: minmax(0, 1fr) var(--details-width); }
.workspace:where(.details-collapsed.bom-collapsed) { grid-template-columns: var(--library-width) minmax(0, 1fr); }
.workspace:where(.library-collapsed.details-collapsed.bom-collapsed) { grid-template-columns: minmax(0, 1fr); }
.workspace.library-collapsed .library-panel, .workspace.details-collapsed .rack-panel { display: none; }
.panel { min-height: 0; min-width: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid #dfe7e7; border-radius: 11px; background: #fff; box-shadow: 0 3px 10px #274d4b03; }
.panel-heading { flex: 0 0 auto; min-height: 46px; padding: 8px 11px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #edf1f1; }
.section-index { display: block; color: #97a8a8; font-size: 9px; font-weight: 550; letter-spacing: 1.5px; }
h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 5px; font-size: 15px; font-weight: 650; letter-spacing: -.2px; overflow-wrap: anywhere; }
.count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 19px; height: 18px; padding: 0 5px; border-radius: 4px; background: #f0f4f3; color: #8c9e9e; font-size: 10px; font-weight: 550; }
.muted-label { color: #647d80; font-size: 11px; font-weight: 400; letter-spacing: 0; }
.live-label { display: flex; flex-shrink: 0; align-items: center; gap: 5px; color: #79a299; font-size: 9px; }
.live-label .status-dot { width: 5px; height: 5px; }
.library-tools { flex-shrink: 0; padding: 10px; }
.search-box { display: flex; align-items: center; gap: 7px; height: 35px; padding: 0 10px; border: 1px solid #e2e8e8; border-radius: 6px; color: #a0b1b1; background: #fafcfc; }
.search-box svg { width: 14px; height: 14px; }
.search-box input { width: 100%; min-width: 0; padding: 4px 0; border: 0; outline: 0; background: transparent; font-size: 11px; }
.search-box:focus-within { outline: 2px solid #93c8bc; outline-offset: 1px; }
.search-box input:focus-visible { outline: 0; }
.filters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; margin-top: 11px; padding: 3px; border: 1px solid #e9eeee; border-radius: 6px; background: #f5f8f7; }
.filters button { padding: 5px 0; border: 0; border-radius: 4px; color: #8b9b9e; background: transparent; font-size: 10px; line-height: 1.5; }
.filters button:hover { color: #387b6e; }
.filters button.active { color: #367d6c; background: #fff; box-shadow: 0 1px 4px #193a3410; font-weight: 650; }
.library-list { min-height: 100px; flex: 1; overflow-y: auto; padding: 1px 10px 10px; }
.device-card { position: relative; margin-bottom: 8px; padding: 10px; border: 1px solid #e3e9e9; border-radius: 8px; background: #fff; cursor: grab; transition: border-color .15s, background .15s, box-shadow .15s; }
.device-card:hover { border-color: #b9cdca; box-shadow: 0 2px 6px #183e3308; }
.device-card.selected { border-color: #76b9a9; background: #f8fcfa; box-shadow: inset 0 0 0 1px #cce7df; }
.device-card:active { cursor: grabbing; }
.device-card-top { display: flex; align-items: center; gap: 9px; width: 100%; min-width: 0; padding: 0; border: 0; text-align: left; background: transparent; }
.device-card-top > :not(.device-type-icon) { min-width: 0; flex: 1; }
.device-type-icon { width: 31px; height: 33px; flex-shrink: 0; display: grid; place-items: center; border: 1px solid #dbe7f3; border-radius: 6px; background: #eff5fc; color: var(--network); }
.device-type-icon svg { width: 17px; height: 17px; }
.device-card[data-type="cpu"] .device-type-icon { border-color: #d7ebe4; background: #edf8f4; color: var(--cpu); }
.device-card[data-type="gpu"] .device-type-icon { border-color: #e5dcf0; background: #f5f0fb; color: var(--gpu); }
.device-name { display: block; color: #34535b; font-size: 11px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.device-type { display: block; margin-top: 3px; color: #9aa9ab; font-size: 9px; }
.device-specs { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.spec-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border: 1px solid #edf0ef; border-radius: 4px; background: #fafcfc; color: #758f94; font-size: 9px; font-variant-numeric: tabular-nums; }
.spec-pill svg { width: 11px; height: 11px; }
.device-card-actions { display: flex; align-items: center; gap: 3px; margin-left: auto; }
.device-card-actions .button { min-height: 27px; padding: 4px 7px; border-color: #e7eded; border-radius: 5px; color: #7b9194; font-size: 10px; }
.device-card-actions .button:first-child { flex: 1; color: #538d7e; background: #f6fbf8; }
.device-card-actions .icon-button { width: 27px; height: 27px; border-color: transparent; }
.device-card-actions svg { width: 13px; height: 13px; }
.mini-button { display: inline-flex; align-items: center; gap: 3px; min-height: 26px; padding: 4px 5px; border: 1px solid #e2ede6; border-radius: 4px; background: #f7fbf8; color: #719981; font-size: 9px; white-space: nowrap; }
.mini-button:hover { color: #39744d; border-color: #b4cdbd; background: #edf7ef; }
.library-footer { display: flex; flex: 0 0 auto; align-items: flex-start; gap: 6px; padding: 8px 10px; border-top: 1px solid #edf1f0; color: #9aacab; background: #fcfdfc; font-size: 10px; line-height: 1.8; }
.library-footer > span:first-child { flex-shrink: 0; }
.library-footer svg { width: 12px; height: 12px; margin-top: 3px; }
.library-empty { padding: 40px 15px; text-align: center; color: #91a3a4; font-size: 12px; }

.room-toolbar { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 7px 11px; border-bottom: 1px solid #eef2f1; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 13px; font-size: 9px; color: #8e9fa1; }
.legend > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.legend-dot { width: 5px; height: 5px; border-radius: 50%; }
.legend-dot.normal { background: #6fae98; }
.legend-dot.warning { background: #d4a162; }
.floor-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 12px; background-color: #f8faf9; background-image: radial-gradient(#d8e1de .7px, transparent .7px); background-size: 13px 13px; }
.floor-grid { display: grid; grid-template-columns: repeat(var(--columns, 2), minmax(150px, 1fr)); gap: 12px 10px; align-content: start; }
.rack-card { min-width: 150px; position: relative; display: flex; flex-direction: column; min-height: 180px; padding: 10px 10px 8px; text-align: left; border: 1px solid #dfe8e5; border-radius: 8px; background: #fff; color: var(--ink); box-shadow: 0 2px 3px #27473d03; cursor: pointer; }
.rack-card:hover { border-color: #a7c3ba; box-shadow: 0 3px 8px #2b564210; }
.rack-card.selected { border-color: #65a993; box-shadow: 0 0 0 2px #d1e9df; background: #fefffe; }
.rack-card.selected::before { content: ""; position: absolute; left: 12px; right: 12px; top: -1px; height: 3px; border-radius: 0 0 3px 3px; background: #59a38d; }
.rack-card.overloaded { border-color: #dfb987; background: #fffdfa; }
.rack-card.overloaded.selected { box-shadow: 0 0 0 2px #f4e6d3; }
.rack-card.overloaded.selected::before { background: #c98e46; }
.rack-card.conflicted { border-color: #d8a499; background: #fffbf9; }
.rack-card.conflicted.selected { box-shadow: 0 0 0 2px #f0dcd5; }
.rack-card.conflicted.selected::before { background: #c78370; }
.rack-card.drag-over { border-color: #168d77; box-shadow: 0 0 0 3px #afddce; background: #ecf8f0; }
.rack-card-top { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.rack-card-name { color: #47655f; font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.rack-card-position { color: #a3b1ad; font-size: 8px; font-weight: 400; white-space: nowrap; }
.rack-card-body { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.rack-mini-face { flex: 0 0 36px; width: 36px; height: 74px; padding: 4px; display: flex; flex-direction: column; gap: 3px; border: 1px solid #d8e3df; border-radius: 3px; background: #f4f7f5; }
.rack-mini-face i { display: block; flex: 1; min-height: 3px; border-radius: 1px; background: #e4ebe7; }
.rack-mini-face i.occupied { background: #7fb29d; }
.rack-mini-face i.network { background: #a6bfdc; }
.rack-mini-face i.cpu { background: #94c4b0; }
.rack-mini-face i.gpu { background: #baacd3; }
.rack-card-data { flex: 1; min-width: 0; }
.rack-data-row { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; column-gap: 4px; color: #9aaba6; font-size: 9px; }
.rack-data-row strong, .rack-data-row b { color: #627e72; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.rack-data-row small { color: #9bad9e; font-size: 8px; font-weight: 400; white-space: nowrap; }
.rack-data-row + .rack-data-row { margin-top: 5px; }
.capacity-bar { display: block; height: 4px; margin: 6px 0 13px; overflow: hidden; border-radius: 3px; background: #edf2ef; }
.capacity-bar > span { display: block; height: 100%; max-width: 100%; border-radius: inherit; background: #83b19c; }
.capacity-bar.power-bar { margin-bottom: 0; }
.power-bar > span { background: #acc5b6; }
.rack-card.overloaded .power-bar > span { background: #d49b57; }
.rack-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; padding-top: 8px; color: #8ba294; font-size: 9px; }
.rack-card-bottom svg { width: 11px; height: 11px; }
.rack-warning { display: flex; align-items: center; gap: 4px; margin-top: 8px; padding-top: 7px; border-top: 1px solid #f2e9dc; color: #bb8138; font-size: 9px; }
.rack-warning svg { width: 11px; height: 11px; }
.rack-conflict-badge { display: flex; align-items: center; gap: 4px; margin-top: 7px; padding-top: 7px; border-top: 1px solid #f0e0d9; color: #b16b56; font-size: 9px; line-height: 1.5; }
.rack-conflict-badge svg { width: 11px; height: 11px; }
.floor-caption { min-width: max-content; display: flex; align-items: center; justify-content: center; gap: 10px; margin: 28px 10px 2px; color: #b1beb6; font-size: 9px; letter-spacing: .2px; }
.floor-line { width: 26px; height: 1px; background: #dce5de; }
.room-footer { flex: 0 0 auto; min-height: 32px; display: flex; align-items: center; gap: 6px; padding: 7px 11px; border-top: 1px solid #e7eeeb; color: #8fa299; background: #fff; font-size: 10px; }
.room-footer svg { width: 13px; height: 13px; }

.rack-summary { flex: 0 0 auto; padding: 10px 11px; }
.rack-stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rack-stat-row.secondary { margin-top: 9px; color: #9aaa9f; font-size: 9px; }
.rack-stat-row.secondary > span:last-child { text-align: right; }
.rack-stat-row.secondary b { color: #748d7b; font-weight: 500; }
.rack-stat { min-width: 0; padding: 8px 10px; border: 1px solid #e8eeeb; border-radius: 6px; background: #fafcfb; }
.rack-stat > span, .rack-stat > label { display: block; color: #98a9a3; font-size: 9px; }
.rack-stat strong { display: block; margin-top: 4px; color: #53796a; font-size: 16px; line-height: 1.2; font-weight: 650; font-variant-numeric: tabular-nums; }
.rack-stat small { margin-left: 4px; font-size: 9px; font-weight: 400; color: #9aaa9f; }
.rack-stat .warning, .rack-stat.warning strong { color: #c18335; }
.rack-power-warning { display: flex; gap: 6px; align-items: flex-start; margin-top: 9px; padding: 8px; border: 1px solid #efdfc6; border-radius: 5px; color: #b28244; background: #fffbf4; font-size: 10px; line-height: 1.6; }
.rack-power-warning svg { width: 12px; height: 12px; margin-top: 2px; }
.rack-conflict-warning { display: flex; gap: 6px; align-items: flex-start; margin-top: 9px; padding: 8px; border: 1px solid #e8cec2; border-radius: 5px; color: #b06e54; background: #fff7ef; font-size: 10px; line-height: 1.6; }
.rack-conflict-warning svg { width: 12px; height: 12px; margin-top: 2px; }
.rack-instructions { display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; gap: 6px; min-height: 29px; margin: 0 11px 8px; color: #8faaa0; font-size: 9px; line-height: 1.65; }
.placement-hint { display: flex; align-items: center; gap: 6px; padding: 7px 9px; border: 1px solid #d5e7dd; border-radius: 5px; background: #f0f8f1; color: #578b69; font-size: 10px; }
.rack-instructions .placement-hint { display: block; min-width: 0; overflow-wrap: anywhere; }
.text-button { flex-shrink: 0; padding: 5px 0 5px 5px; border: 0; color: #8da291; background: transparent; font-size: 10px; }
.text-button:hover { color: #39754b; }
.placement-hint svg { width: 12px; height: 12px; }
.rack-scroll { flex: 1; min-height: 120px; overflow-y: auto; padding: 0 12px 10px 5px; }
.rack-elevation { position: relative; padding: 0; isolation: isolate; }
.u-row { display: grid; grid-template-columns: 28px minmax(0, 1fr); height: var(--row-height); cursor: pointer; }
.u-number { padding-right: 7px; display: flex; align-items: center; justify-content: flex-end; color: #a6b4ad; font-size: 8px; font-variant-numeric: tabular-nums; line-height: 1; user-select: none; }
.u-slot { position: relative; width: 100%; height: 16px; padding: 0; margin: 0; border-top: 0; border-left: 5px solid #e0e7e3; border-right: 5px solid #e0e7e3; border-bottom: 1px solid #e5ece8; border-radius: 0; background: #f5f8f5; }
.u-row:first-child .u-slot { border-top: 1px solid #dfe8e2; }
.u-slot::before, .u-slot::after { content: ""; position: absolute; top: 5px; width: 2px; height: 4px; border-radius: 1px; background: #bccbc1; }
.u-slot::before { left: -3.5px; }
.u-slot::after { right: -3.5px; }
.u-row:hover .u-slot { background: #e9f3e9; }
.u-row.hover-valid .u-slot { background: #ccebd7; border-color: #78b88e; }
.u-row.hover-invalid .u-slot { background: #f7dcd5; border-color: #d69684; }
.rack-device { position: absolute; z-index: 2; left: 28px; right: 0; min-height: 0; margin: 0; padding: 1px 10px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; overflow: hidden; border: 1px solid #a5bfdb; border-left: 5px solid #88aad0; border-right: 5px solid #88aad0; border-radius: 2px; background: #e2edf9; color: #4874a2; cursor: grab; line-height: 1.15; }
.rack-device:active { cursor: grabbing; }
.rack-device.network { border-color: #a5bfdb; border-left-color: #88aad0; border-right-color: #88aad0; background: #e2edf9; color: #4874a2; }
.rack-device.cpu { border-color: #9bc7b5; border-left-color: #81b49f; border-right-color: #81b49f; background: #e0f0e7; color: #447d63; }
.rack-device.gpu { border-color: #bfafd7; border-left-color: #aa91c7; border-right-color: #aa91c7; background: #eee7f6; color: #7d629f; }
.rack-device.selected { z-index: 3; outline: 2px solid #327c65; outline-offset: -2px; box-shadow: inset 0 0 0 1px #fff9; }
.rack-device.conflicted { z-index: 4; border-color: #cb8c7b; background: #fae4dd; color: #a5604e; }
.rack-device.conflicted.selected { z-index: 5; outline-color: #a4553f; }
.rack-device:hover { filter: brightness(.97); }
.rack-device-grip { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); opacity: .35; font-size: 12px; }
.rack-device.single-u { padding-top: 0; padding-bottom: 0; }
.device-onrack-name { max-width: 100%; overflow: hidden; font-size: 9px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.device-onrack-meta { max-width: 100%; margin-top: 3px; overflow: hidden; color: currentColor; opacity: .72; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.selected-device-detail { flex: 0 0 auto; padding: 9px 11px; border-top: 1px solid #e8eee9; background: #fcfdfc; }
.selected-device-detail:empty { display: none; }
.selection-title { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 650; overflow-wrap: anywhere; }
.selection-title strong { min-width: 0; flex: 1; }
.selection-title .device-type-icon { width: 27px; height: 28px; }
.selection-title .icon-button { width: 26px; height: 26px; border: 0; }
.device-type-icon.cpu { border-color: #d7ebe4; background: #edf8f4; color: var(--cpu); }
.device-type-icon.gpu { border-color: #e5dcf0; background: #f5f0fb; color: var(--gpu); }
.selection-meta { margin-top: 3px; color: #92a39a; font-size: 10px; }
.selection-actions { display: flex; align-items: center; gap: 6px; margin-top: 9px; }
.selection-actions .button { min-height: 29px; padding: 5px 8px; font-size: 10px; }
.selection-actions select { max-width: 140px; min-width: 0; height: 29px; padding: 3px 6px; border: 1px solid #dce5de; border-radius: 5px; background: #fff; font-size: 10px; }
.conflict-list { max-height: 125px; margin: 0 0 10px; padding: 9px; overflow-y: auto; border: 1px solid #eddace; border-radius: 6px; color: #b58160; background: #fffbf6; font-size: 10px; line-height: 1.6; }
.conflict-list > strong, .conflict-list > p { display: block; margin-bottom: 5px; font-size: 10px; }
.conflict-item { margin-top: 4px; }
.conflict-item button, button.conflict-item { display: block; width: 100%; padding: 5px 7px; border: 1px solid #eeded4; border-radius: 4px; color: #aa7255; background: #fff; font-size: 10px; line-height: 1.6; text-align: left; overflow-wrap: anywhere; }
.conflict-item button:hover, button.conflict-item:hover { background: #f9ede3; border-color: #d8b79e; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 130px; padding: 25px; color: #9aaba5; font-size: 11px; text-align: center; line-height: 1.8; }
.empty-icon { margin-bottom: 12px; color: #b9c8c0; }
.empty-icon svg { width: 28px; height: 28px; }
.selected-device-detail .empty-state { flex-direction: row; min-height: 34px; gap: 7px; padding: 3px 0; font-size: 10px; }
.selected-device-detail .empty-state svg { width: 14px; height: 14px; }
.app-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 14px; padding: 12px 2px; color: #9dacad; font-size: 9px; }
.app-footer > span:first-child { letter-spacing: 1px; }
.footer-separator { margin: 0 8px; color: #c6cfce; }

.app-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; overflow: auto; border: 1px solid #d7e3de; border-radius: 14px; background: #fff; color: var(--ink); box-shadow: 0 20px 100px #102e3938; }
.app-dialog::backdrop { background: #152f3c55; backdrop-filter: blur(3px); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 21px 24px 17px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { font-size: 18px; }
.dialog-header p { margin-top: 5px; color: #91a3a0; font-size: 11px; }
.dialog-body { padding: 22px 24px; }
.dialog-footer { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 16px 24px; border-top: 1px solid #e8eeeb; background: #fafcfb; }
.dialog-footer > .danger:first-child { margin-right: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.form-field { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.form-field.wide, .form-grid > .wide { grid-column: 1 / -1; }
.form-field > label, .form-field > span { color: #607a71; font-size: 12px; font-weight: 550; }
.form-field > small { color: #98a9a0; font-size: 10px; line-height: 1.7; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 38px; padding: 9px 10px; border: 1px solid #dce5df; border-radius: 6px; background: #fff; font-size: 12px; }
.form-field textarea { resize: vertical; min-height: 75px; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: #6eac95; }
.form-help { color: #98a9a0; font-size: 10px; line-height: 1.7; }
.form-error { margin-top: 13px; color: #b8604f; font-size: 11px; line-height: 1.7; }
.form-error:empty { display: none; }
.notice { margin-top: 16px; padding: 11px 13px; border: 1px solid #dce9e0; border-radius: 7px; color: #72937f; background: #f4f9f4; font-size: 11px; line-height: 1.8; }
.notice.warn, .notice.warning { border-color: #ecddc4; color: #b17f3b; background: #fffaf0; }
.notice:first-child { margin-top: 0; }
.notice + .form-grid { margin-top: 20px; }
.inline-check { display: flex; align-items: flex-start; gap: 8px; color: #6f867c; font-size: 11px; line-height: 1.8; }
.inline-check input { flex: 0 0 auto; width: 15px; min-height: 15px; height: 15px; margin: 3px 0 0; accent-color: #36856b; }
.detail-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; margin: 14px 0; color: #617d6f; font-size: 12px; }
.detail-list dt { color: #9bab9f; }
.detail-list dd { margin: 0; text-align: right; }
.toast-region { position: fixed; z-index: 100; right: 24px; bottom: 24px; display: flex; flex-direction: column; align-items: flex-end; gap: 9px; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 8px; max-width: min(430px, calc(100vw - 48px)); padding: 12px 17px; border: 1px solid #bdd8c8; border-radius: 9px; color: #35654d; background: #f5fcf6; box-shadow: 0 5px 24px #20352b1a; font-size: 12px; line-height: 1.7; pointer-events: auto; animation: toast-in .2s ease-out; }
.toast svg { width: 16px; height: 16px; margin-top: 2px; }
.toast.error { border-color: #e2bcb2; color: #a35d4d; background: #fff6f2; }
.toast.warning { border-color: #e8d0a9; color: #a27b3b; background: #fffbef; }
.rack-feedback { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; padding: 9px 10px; border-top: 1px solid #cce1d5; border-bottom: 1px solid #cce1d5; color: #35654d; background: #f0f9f2; }
.rack-feedback > svg { width: 16px; height: 16px; }
.rack-feedback-text { flex: 1; min-width: 0; font-size: 11px; }
.rack-feedback-text strong, .rack-feedback-text > span { display: block; }
.rack-feedback-text > span { overflow: hidden; color: #6a8373; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.rack-feedback .button { flex: 0 0 auto; min-height: 32px; padding: 6px 10px; border-color: #95bd9f; background: #fff; color: #28643b; }
.rack-feedback .icon-button { flex: 0 0 auto; width: 26px; height: 30px; padding: 5px; border-color: transparent; background: transparent; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Shared workspace, project home, and reusable rack configurations. */
.workspace-nav { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 6px 12px; border-bottom: 1px solid var(--line); background: #fff; }
.workspace-nav .nav-spacer { flex: 1 1 20px; }
.workspace-nav #project-switch { min-width: 140px; max-width: min(290px, 100%); min-height: 32px; padding: 5px 31px 5px 11px; border: 1px solid #dce6e2; border-radius: 7px; background-color: #f8fbf9; color: #486f64; font-size: 12px; text-overflow: ellipsis; }
.workspace-nav .button[aria-current="page"], .workspace-nav .button.active { border-color: #c7e2d8; background: #edf8f2; color: #277b64; }
.project-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.project-heading > div:first-child { min-width: 0; }
.rack-preset-actions { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; flex-wrap: wrap; gap: 5px 10px; padding: 5px 11px; border-bottom: 1px solid #edf1ee; background: #fcfdfc; }
.rack-preset-actions .text-button { min-height: 27px; padding: 3px 0; color: #648f7e; }
.rack-preset-actions .text-button:hover { color: #1e7259; }

.projects-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 25px 40px; padding: 32px; overflow: hidden; border: 1px solid #d3e6de; border-radius: 13px; background: linear-gradient(115deg, #eaf5f0 0%, #f4faf6 65%, #e5f1ed 100%); }
.hero-copy { min-width: 0; max-width: 650px; }
.hero-copy .eyebrow { margin-bottom: 10px; color: #639186; font-size: 9px; letter-spacing: 2px; }
.hero-copy h2 { color: #1a4945; font-size: clamp(24px, 2.2vw, 33px); line-height: 1.4; letter-spacing: -.8px; }
.hero-copy p { margin-top: 12px; color: #6e8d84; font-size: 12px; line-height: 1.9; overflow-wrap: anywhere; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.hero-actions .button { min-height: 40px; padding: 10px 15px; }
.workspace-totals { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding-top: 23px; border-top: 1px solid #d5e6de; }
.workspace-totals > * { min-width: 0; }
.workspace-totals > * + * { padding-left: 25px; border-left: 1px solid #d5e6de; }
.workspace-totals span { display: block; color: #73978a; font-size: 11px; }
.workspace-totals b, .workspace-totals strong { display: block; margin-top: 4px; color: #315d52; font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.3; }
.projects-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 30px 0 15px; }
.projects-heading h3 { margin: 0; font-size: 16px; }
.projects-heading > span { color: #849993; font-size: 11px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); align-items: stretch; gap: 16px; }
.project-card { min-width: 0; display: flex; flex-direction: column; gap: 19px; padding: 22px; border: 1px solid #dfe8e4; border-radius: 11px; background: #fff; box-shadow: 0 3px 8px #234f4203; }
.project-card.current { border-color: #99c7b4; box-shadow: inset 0 3px 0 #71ae96; }
.project-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.project-card-top > div { min-width: 0; }
.project-card-top > div:first-child { flex: 1; }
.project-symbol { display: inline-flex; align-items: center; justify-content: center; width: 37px; height: 37px; margin-bottom: 11px; border: 1px solid #dcebe3; border-radius: 9px; background: #f0f7f3; color: #568f77; font-size: 17px; }
.project-symbol svg { width: 20px; height: 20px; }
.project-card h3 { margin: 0; font-size: 16px; line-height: 1.5; }
.project-card p { margin-top: 6px; color: #8a9e95; font-size: 11px; line-height: 1.8; overflow-wrap: anywhere; }
.project-card-top > span { flex: 0 0 auto; padding: 3px 7px; border-radius: 5px; background: #edf7f0; color: #68977c; font-size: 10px; }
.project-card-stats { display: flex; align-items: stretch; flex-wrap: wrap; gap: 12px 17px; padding: 13px 0; border-top: 1px solid #edf1ef; border-bottom: 1px solid #edf1ef; color: #7b9588; font-size: 11px; }
.project-card-stats > * { min-width: 0; }
.project-card-stats span { line-height: 1.8; }
.project-card-stats b, .project-card-stats strong { color: #4a7260; font-weight: 650; font-variant-numeric: tabular-nums; }
.project-card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.project-card-actions .button { min-height: 33px; padding: 7px 10px; font-size: 11px; }
.project-card-actions .button:first-child { margin-right: auto; }
.project-empty { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 13px; min-height: 220px; padding: 35px 24px; border: 1px dashed #c9dcd2; border-radius: 11px; background: #fafdfb; color: #7b9889; text-align: center; line-height: 1.8; }
.project-empty h3 { margin: 0; color: #4f7d65; }
.project-empty p { max-width: 460px; }

.app-dialog.wide-dialog { width: min(880px, calc(100vw - 32px)); }
.dialog-header > div, .dialog-body { min-width: 0; }
.dialog-header .icon-button { flex: 0 0 auto; }
.preset-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.preset-card { display: flex; flex-direction: column; min-width: 0; padding: 18px; border: 1px solid #dfe8e2; border-radius: 9px; background: #fcfefc; }
.preset-card h3 { margin: 0; color: #365f4d; font-size: 14px; }
.preset-card p { margin-top: 6px; color: #8b9f92; font-size: 11px; line-height: 1.8; overflow-wrap: anywhere; }
.preset-card-stats { display: flex; flex-wrap: wrap; gap: 6px 13px; margin: 13px 0; color: #6a8e75; font-size: 11px; font-variant-numeric: tabular-nums; }
.preset-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 11px; border-top: 1px solid #e8eee8; }
.preset-actions .button { min-height: 32px; padding: 6px 9px; font-size: 11px; }
.preset-actions .button:first-child { margin-right: auto; }
.preset-editor-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 23px 0 12px; }
.preset-editor-toolbar h3 { margin: 0; font-size: 13px; }
.preset-device-table { display: block; width: 100%; max-width: 100%; overflow-x: auto; border: 1px solid #e0e8e2; border-spacing: 0; border-radius: 8px; background: #fff; font-size: 11px; }
.preset-device-table table { width: 100%; min-width: 560px; border-collapse: collapse; }
.preset-device-table:where(table) { border-collapse: collapse; }
.preset-device-table th { padding: 10px; background: #f5f9f6; color: #7b9684; font-size: 10px; font-weight: 550; text-align: left; white-space: nowrap; }
.preset-device-table td { padding: 9px 10px; border-top: 1px solid #e9eeea; vertical-align: middle; }
.preset-device-table th:first-child, .preset-device-table td:first-child { width: 48%; min-width: 210px; }
.preset-device-table th:nth-child(2), .preset-device-table td:nth-child(2) { width: 95px; min-width: 90px; }
.preset-device-table th:nth-child(3), .preset-device-table td:nth-child(3) { min-width: 115px; }
.preset-device-table th:last-child, .preset-device-table td:last-child { width: 50px; }
.preset-device-row input, .preset-device-row select { min-height: 36px; max-width: 100%; padding: 7px 9px; border: 1px solid #dce5df; border-radius: 6px; background: #fff; color: #456a56; font-size: 12px; }
.preset-device-row select { width: 100%; min-width: 190px; }
.preset-device-row input[type="number"] { width: 75px; }
.preset-device-row td > span { color: #80988a; font-size: 10px; line-height: 1.6; }
.preset-device-row .button { min-height: 32px; padding: 6px 9px; font-size: 11px; }
.preset-preview.notice { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 18px; }
.preset-preview.notice > span { display: inline-block; }
.project-form-summary { font-variant-numeric: tabular-nums; }

.deploy-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 15px 0 10px; }
.deploy-tools .button { min-height: 31px; padding: 6px 10px; font-size: 11px; }
.deploy-targets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; max-height: 280px; padding: 3px 5px 3px 3px; overflow-y: auto; overscroll-behavior: contain; }
.deploy-target { min-width: 0; display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid #dfe7e1; border-radius: 7px; background: #fff; cursor: pointer; }
.deploy-target:hover { border-color: #a9c8b6; background: #f8fcf8; }
.deploy-target:has(input:checked) { border-color: #8dbba5; background: #f0f8f1; }
.deploy-target input[type="checkbox"] { flex: 0 0 auto; width: 16px; height: 16px; min-height: 16px; margin: 2px 0 0; padding: 0; accent-color: #378469; }
.deploy-target > span { min-width: 0; }
.deploy-target strong { display: block; color: #4d735b; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.deploy-target small { display: block; margin-top: 4px; color: #8ba18f; font-size: 10px; line-height: 1.7; }
.deployment-review { display: grid; gap: 10px; max-height: 380px; margin-top: 16px; padding-right: 5px; overflow-y: auto; overscroll-behavior: contain; }
.deployment-review article, .deployment-item { min-width: 0; padding: 14px 16px; border: 1px solid #e7dfd1; border-radius: 8px; background: #fffdfa; }
.deployment-item h4, .deployment-review article h4 { margin: 0; color: #735f41; font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.deployment-item p, .deployment-review article p { margin-top: 5px; color: #95866c; font-size: 11px; line-height: 1.8; }
.deployment-item ul, .deployment-review article ul { max-height: 130px; margin: 9px 0 0; padding-left: 19px; overflow-y: auto; color: #8a795f; font-size: 11px; line-height: 1.9; overflow-wrap: anywhere; }
.deployment-item li + li { margin-top: 2px; }
.deploy-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 16px; margin-top: 15px; padding: 12px 14px; border: 1px solid #d6e7dc; border-radius: 7px; background: #f1f8f2; color: #587f65; font-size: 12px; line-height: 1.7; font-variant-numeric: tabular-nums; }
.shared-library-list { display: grid; gap: 9px; }
.shared-library-item { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 14px; border: 1px solid #e1e9e3; border-radius: 8px; background: #fff; }
.shared-library-item > span { min-width: 0; }
.shared-library-item strong { display: block; color: #456b56; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.shared-library-item small { display: block; margin-top: 4px; color: #8a9f90; font-size: 10px; line-height: 1.7; }
.shared-library-item .button { flex: 0 0 auto; min-height: 32px; padding: 6px 10px; font-size: 11px; }

/* Read-only current-project BOM: compact entries fit the 350–420px sidebar. */
.bom-content { flex: 1; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 12px; overflow-wrap: anywhere; }
.bom-project { font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.bom-status { margin-top: 8px; padding: 8px 10px; font-size: 10px; }
.bom-summary, .bom-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 12px 0; }
.bom-summary > div { min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #f8fbf9; }
.bom-summary > div:last-child { grid-column: 1 / -1; }
.bom-summary dt, .bom-specs dt { color: #607a71; font-size: 10px; }
.bom-summary dd { margin: 4px 0 0; font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bom-summary small { font-size: 10px; font-weight: 400; }
.bom-help { margin-bottom: 12px; color: #607a71; font-size: 11px; line-height: 1.8; }
.bom-items { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.bom-item { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.bom-category { color: #607a71; font-size: 10px; }
.bom-item h4 { margin: 3px 0 0; font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.bom-specs > div { min-width: 0; }
.bom-specs dd { margin: 3px 0 0; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bom-distribution { padding-top: 8px; border-top: 1px solid var(--line); }
.bom-distribution h5 { margin: 0 0 6px; color: #607a71; font-size: 10px; font-weight: 500; }
.bom-racks { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; padding: 0; list-style: none; overflow-wrap: anywhere; }
.bom-racks li { min-width: 0; max-width: 100%; padding: 3px 6px; border-radius: 4px; background: #f0f7f3; font-size: 10px; }
.bom-racks b { color: #486f64; font-weight: 600; }
.bom-panel .empty-state { color: #607a71; }

/* Planner chrome stays compact so the floor plan receives the available space. */
.planner-active .topbar-title > .eyebrow,
.planner-active .breadcrumb,
.planner-active .project-heading p,
.planner-active .section-index,
.planner-active .floor-caption { display: none; }
.planner-active .panel-heading h3 { margin-top: 0; }
.planner-active .topbar { min-height: 50px; }
.planner-active .app-footer { flex: 0 0 auto; padding: 5px 2px; font-size: 8px; }
.workspace-nav .button, .project-actions .button { min-height: 32px; padding: 6px 10px; }
.room-panel > .panel-heading { flex-wrap: wrap; gap: 6px 10px; }
.room-panel > .panel-heading > div:first-child { min-width: 0; }
.room-view-actions { display: flex; min-width: 0; align-items: center; flex-wrap: wrap; gap: 5px; margin-left: auto; }
.room-view-actions .button { min-height: 29px; padding: 5px 8px; font-size: 11px; }
.room-view-actions .button[aria-expanded="true"] { border-color: #c7e2d8; background: #edf8f2; color: #277b64; }
.library-panel, .rack-panel { overflow-y: auto; overscroll-behavior: contain; }

@media (min-width: 1201px) {
  body.planner-active { height: 100dvh; overflow: hidden; }
  .planner-active .app-shell { display: flex; flex-direction: column; height: 100dvh; min-height: 0; }
  .planner-active .topbar, .planner-active .workspace-nav { flex: 0 0 auto; }
  .planner-active main { display: flex; flex-direction: column; flex: 1; min-height: 0; }
  .planner-active #planner-view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
  .planner-active .project-heading, .planner-active .metrics { flex: 0 0 auto; }
  .planner-active .workspace { flex: 1; grid-template-rows: minmax(0, 1fr); }
}

@media (max-width: 1200px) {
  .topbar { flex-wrap: wrap; }
  .topbar-actions { margin-left: auto; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .room-panel { order: -1; height: clamp(420px, 70dvh, 720px); }
  .library-panel { height: 390px; }
  .rack-panel { height: 650px; }
  .bom-panel { max-height: 700px; }
  .rack-scroll { padding-left: max(5px, calc((100% - 560px) / 2)); padding-right: max(12px, calc((100% - 560px) / 2)); }
  .project-heading { align-items: flex-start; }
  .project-actions { gap: 6px; }
  .projects-hero { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 24px; }
  .hero-actions { justify-content: flex-start; }
  .workspace-nav .nav-spacer { flex-basis: 0; min-width: 0; }
  .workspace-nav #project-switch { flex: 1 1 170px; }
}

@media (max-width: 620px) {
  .topbar { padding: 8px; gap: 7px; }
  h1 { font-size: 17px; }
  .eyebrow { margin-bottom: 3px; font-size: 8px; letter-spacing: 1.2px; }
  .topbar-actions { flex: 1 1 100%; gap: 5px; }
  .save-status { flex: 1; min-width: 0; margin: 0; font-size: 9px; }
  .topbar-actions .button { min-height: 32px; padding: 6px 8px; font-size: 11px; }
  main { padding: 8px 8px 0; }
  .workspace-nav { gap: 5px; padding: 6px 8px; }
  .workspace-nav .button { min-height: 32px; padding: 6px 8px; font-size: 11px; }
  .workspace-nav #project-switch { min-width: 0; max-width: none; width: calc(100% - 105px); flex: 1 1 calc(100% - 120px); font-size: 13px; }
  .workspace-nav .nav-spacer { display: none; }
  .project-heading { flex-wrap: wrap; gap: 6px; }
  .project-actions { flex: 1 1 100%; justify-content: flex-start; }
  .project-actions .button { min-height: 32px; padding: 6px 8px; font-size: 11px; }
  h2 { font-size: 20px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .metric-card { padding: 8px 10px; }
  .metric-value { font-size: 22px; }
  .metric-label { font-size: 10px; }
  .metric-meta { font-size: 9px; }
  .metric-icon { top: 8px; right: 8px; width: 22px; height: 22px; }
  .room-panel { height: max(420px, 68dvh); }
  .library-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 8px; }
  .device-card { margin-bottom: 0; padding: 8px; }
  .device-card-top { gap: 6px; }
  .device-name { font-size: 10px; }
  .device-type-icon { width: 25px; height: 29px; }
  .device-type-icon svg { width: 15px; height: 15px; }
  .device-card-actions { margin-left: 0; flex-basis: 100%; justify-content: flex-end; }
  .mini-button { min-height: 32px; padding-left: 7px; padding-right: 7px; }
  .device-card-actions .icon-button { min-height: 32px; width: 29px; }
  .library-empty { grid-column: 1 / -1; }
  .room-view-actions { gap: 4px; }
  .room-view-actions .button { font-size: 10px; padding: 5px 7px; }
  .floor-scroll { padding: 10px; }
  .room-toolbar { gap: 4px 8px; }
  .legend { gap: 8px; }
  .rack-instructions { min-height: 35px; font-size: 10px; }
  .selection-actions .button { min-height: 35px; }
  .filters button { min-height: 31px; }
  .app-footer { font-size: 8px; }
  .projects-hero { gap: 20px; padding: 20px 16px; border-radius: 10px; }
  .hero-copy h2 { font-size: 24px; }
  .hero-copy p { margin-top: 10px; font-size: 11px; }
  .hero-actions { gap: 7px; }
  .hero-actions .button { min-height: 38px; padding: 9px 12px; font-size: 11px; }
  .workspace-totals { gap: 10px; padding-top: 20px; }
  .workspace-totals > * + * { padding-left: 12px; }
  .workspace-totals span { font-size: 9px; }
  .workspace-totals b, .workspace-totals strong { font-size: 23px; }
  .projects-heading { align-items: flex-start; margin-top: 22px; gap: 10px; }
  .projects-heading h3 { font-size: 15px; }
  .projects-heading > span { max-width: 50%; font-size: 10px; text-align: right; }
  .project-grid, .preset-list, .deploy-targets { grid-template-columns: minmax(0, 1fr); }
  .project-card { gap: 16px; padding: 18px; }
  .project-card-actions .button { min-height: 35px; }
  .rack-preset-actions .text-button { min-height: 31px; }
  .form-grid { gap: 15px 12px; }
  .dialog-header, .dialog-body { padding-left: 18px; padding-right: 18px; }
  .dialog-footer { padding: 14px 18px; }
  .form-field input, .form-field select, .preset-device-row input, .preset-device-row select { font-size: 16px; }
  .preset-editor-toolbar { margin-top: 20px; }
  .preset-device-table td { padding: 8px; }
  .preset-card { padding: 15px; }
  .preset-actions .button, .shared-library-item .button, .deploy-tools .button { min-height: 35px; }
  .deploy-targets { gap: 8px; }
  .deploy-target { padding: 11px; }
  .deployment-review { max-height: 310px; }
  .deployment-review article, .deployment-item { padding: 12px; }
  .shared-library-item { gap: 10px; padding: 12px; }
  .toast-region { right: 10px; bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
