@font-face {
  font-family: PlanCN;
  src: url('./assets/plan-font.otf?v=6f3c71f2cac9') format('opentype');
  font-display: swap;
}

:root {
  --red: #c9233a;
  --red-soft: #fbedef;
  --ink: #263f4e;
  --secondary: #4d6778;
  --muted: #5b7382;
  --line: #ccd8e0;
  --paper: #fff;
  --control-paper: #fffefd;
  --control-line: #d5dfe6;
  --control-shadow: 0 3px 14px rgba(36, 57, 69, .055), 0 1px 3px rgba(36, 57, 69, .025);
  --canvas: #f0f4f6;
  --shadow: 0 6px 24px rgba(36, 57, 69, .09), 0 1px 4px rgba(36, 57, 69, .04);
  --radius: 12px;
  --edge: 24px;
  --top: 18px;
  --toolbar-top: 22px;
  --case-top: 92px;
  --panel-top: 154px;
  --popover-top: 150px;
  --crumb-top: 94px;
}

* { box-sizing: border-box; }
html, body {
  width: 100%; height: 100%; margin: 0; overflow: hidden;
  background: var(--canvas); color: var(--ink);
  font-family: PlanCN, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px; -webkit-font-smoothing: antialiased;
}
body { overscroll-behavior: none; }
button, select, input { font: inherit; color: inherit; }
button, select { touch-action: manipulation; user-select: none; -webkit-tap-highlight-color: transparent; }
button {
  border: 0; cursor: pointer; background: transparent;
  transition: background-color .14s, color .14s, border-color .14s;
}
button:disabled { opacity: .45; cursor: default; }
button:hover { background: #edf2f5; }
button:active { background: #e4ecf1; }
button:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--red); outline-offset: 3px;
}
button svg { pointer-events: none; }
svg {
  display: block; width: 21px; height: 21px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}
h1, h2, h3, p, dl, dd { margin: 0; }
h2 { font-weight: 600; font-size: 16px; line-height: 1.45; }
[hidden] { display: none !important; }

/* The drawing always occupies the viewport. Controls never reserve a column. */
#plan-viewport, #plan-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%; margin: 0;
}
#plan-viewport { z-index: 0; }
#plan-canvas { display: block; background: var(--canvas); touch-action: none; cursor: grab; }
#plan-canvas.dragging, #plan-canvas.is-dragging, body.dragging #plan-canvas { cursor: grabbing; }
#plan-canvas.selecting, #plan-canvas.is-hovering { cursor: pointer; }
#plan-canvas:focus, #plan-canvas:focus-visible,
#room-canvas:focus, #room-canvas:focus-visible { outline: none; }
.floating-control { position: fixed; z-index: 10; }
.glass {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.brand-button.glass, .view-toolbar.glass, .case-toolbar.glass, .room-picker.glass,
.standalone.glass, .zoom-controls.glass {
  background: var(--control-paper); border-color: var(--control-line);
  border-radius: 14px; box-shadow: var(--control-shadow);
}

/* Top controls. Breadcrumbs have their own floating row below the brand. */
.top-left {
  top: var(--top); left: var(--edge); display: flex; align-items: center; gap: 10px;
}
.brand-button {
  height: 62px; padding: 0 16px; display: flex; align-items: center; gap: 14px;
  white-space: nowrap; flex-shrink: 0;
}
.brand-button.glass:hover { background: #fff; border-color: #c4d2dc; }
.anta-wordmark { font: italic 900 31px/1 Arial, sans-serif; letter-spacing: -1.8px; color: var(--red); }
.brand-divider { width: 1px; height: 32px; background: #dce4e9; }
.brand-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; text-align: left; }
.project-name { font-size: 15px; font-weight: 600; line-height: 1.25; color: var(--ink); white-space: nowrap; }
.project-subtitle { font-size: 12px; font-weight: 400; line-height: 1.3; color: var(--secondary); letter-spacing: .3px; }
.room-breadcrumb {
  position: fixed; top: var(--crumb-top); left: var(--edge);
  height: 42px; max-width: 320px; display: flex; align-items: center; gap: 7px;
  padding: 0 14px; font-size: 14px; color: var(--secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.room-breadcrumb button, .room-breadcrumb a {
  font: inherit; color: inherit; background: transparent; padding: 0; text-decoration: none;
}
.room-breadcrumb button { min-height: 36px; }
.room-breadcrumb strong { font-size: 14px; color: var(--ink); font-weight: 600; white-space: nowrap; }
.crumb-back { font-size: 14px; color: var(--secondary); white-space: nowrap; }
.crumb-divider { margin: 0 3px; color: #8da0ad; }
.view-toolbar {
  top: var(--toolbar-top); left: 50%; transform: translateX(-50%);
  height: 50px; padding: 5px 6px; display: flex; align-items: center; gap: 5px; white-space: nowrap;
}
.view-field {
  display: flex; align-items: center; gap: 5px; height: 40px; padding: 0 2px 0 9px;
  border-radius: 9px; background: #edf3f7; box-shadow: inset 0 0 0 1px #dce6ed;
}
.mode-tabs { display: flex; align-items: center; gap: 3px; }
.mode-button { height: 38px; min-width: 50px; padding: 0 13px; border: 1px solid transparent; border-radius: 8px; font-size: 14px; font-weight: 500; white-space: nowrap; color: var(--secondary); }
.mode-button:hover { color: var(--ink); background: #eef4f7; }
.mode-button[aria-pressed=true] { background: var(--red-soft); border-color: #ecc9d1; color: var(--red); font-weight: 650; }
.mode-select-field { display: none; }
.case-toolbar { right: var(--edge); top: var(--case-top); display: flex; align-items: center; gap: 7px; min-height: 48px; max-width: calc(100vw - 2 * var(--edge)); padding: 5px 6px; white-space: nowrap; }
.case-switches { display: flex; align-items: center; gap: 5px; }
.scheme-button { height: 36px; padding: 0 14px; border: 1px solid transparent; border-radius: 9px; font-size: 14px; font-weight: 550; color: var(--secondary); white-space: nowrap; }
.scheme-button[aria-pressed=true] { color: var(--red); border-color: #e5bac3; background: var(--red-soft); box-shadow: 0 1px 3px #67253408; }
.scheme-button:hover { background: #f5e9ec; color: var(--red); }
.case-compare { height: 36px; padding: 0 10px; display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--secondary); border-left: 1px solid var(--line); border-radius: 0; }
.case-compare svg { width: 18px; height: 18px; }
.case-toggle { position: relative; min-width: 70px; height: 36px; padding: 0 27px 0 10px; border: 1px solid #cbd8e1; border-radius: 8px; font-size: 13px; color: var(--secondary); background: #fff; white-space: nowrap; box-shadow: 0 1px 2px #263f4e05; }
.case-toggle::after { content: ""; position: absolute; top: 11px; right: 8px; width: 13px; height: 13px; opacity: .68; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3 5h10m-3-3 3 3-3 3M13 11H3m3-3-3 3 3 3' stroke='%234d6778' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; transition: transform .18s, opacity .18s; pointer-events: none; }
.case-toggle[aria-pressed=true] { color: #31586d; border-color: #c1d4df; background: #eef5f9; }
.case-toggle:hover { color: var(--red); border-color: #d9b8c1; background: #fff7f8; }
.case-toggle:hover::after { opacity: 1; }
.case-toggle:active { transform: translateY(1px); }
.case-actions { display: flex; align-items: center; gap: 6px; padding-left: 8px; border-left: 1px solid #dce5eb; }
.case-actions .icon-button { width: 36px; height: 36px; }
.case-actions .icon-button svg { width: 20px; height: 20px; }
.case-toolbar .load-basis { width: 122px; height: 36px; font-size: 13px; margin: 0; }
.view-symbol { width: 21px; height: 21px; color: #536f80; }
.control-divider { height: 26px; width: 1px; background: #d8e1e7; margin: 0 3px; flex-shrink: 0; }
.view-toolbar > .control-divider { height: 22px; background: #e0e7ec; margin: 0 2px; }
.icon-button {
  width: 40px; height: 40px; border-radius: 8px; display: inline-flex;
  align-items: center; justify-content: center; flex-shrink: 0; color: var(--secondary); padding: 9px;
}
.icon-button:hover, .label-button:hover { color: var(--ink); }
.icon-button[aria-expanded=true], .icon-button[aria-pressed=true], .icon-button.active,
.label-button[aria-expanded=true], .label-button.active { background: var(--red-soft); color: var(--red); }
.case-toolbar .icon-button[aria-expanded=true], .case-toolbar .label-button[aria-expanded=true] {
  box-shadow: inset 0 0 0 1px #efd2d8;
}
.icon-button.small { width: 36px; height: 36px; padding: 8px; }
.icon-button.small svg { width: 20px; height: 20px; }
.label-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 10px; border-radius: 8px;
  color: var(--secondary); font-size: 14px; white-space: nowrap;
}
.label-button svg { width: 19px; height: 19px; }
.case-toolbar #summary-button { gap: 7px; height: 36px; min-width: 140px; padding: 0 9px; font-size: 14px; }
.case-toolbar #summary-button > span { color: var(--secondary); }
.case-toolbar #summary-button strong { font: 650 17px/1.2 Arial,sans-serif; color: var(--ink); letter-spacing: .1px; }
.case-toolbar #summary-button[aria-expanded=true] strong, .case-toolbar #summary-button[aria-expanded=true] > span { color: var(--red); }
select {
  appearance: none; -webkit-appearance: none; border: 1px solid transparent;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='m3.5 5.25 3.5 3.5 3.5-3.5' stroke='%23556f80' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  border-radius: 7px; font-size: 14px; height: 40px; padding: 0 31px 0 9px;
  outline-offset: 2px; cursor: pointer; min-width: 0;
}
select:hover { background-color: #edf3f6; }
select:disabled { opacity: .45; cursor: default; }
select option { background: #fff; color: var(--ink); }
#view-select { width: 132px; font-size: 15px; font-weight: 600; color: #2e4d60; }
#view-select:hover { background-color: #e4edf3; }
.load-basis { width: 126px; font-size: 14px; border-color: #d5e0e7; background-color: #f3f7f9; margin-left: 1px; }
.top-right { right: var(--edge); top: var(--top); display: flex; align-items: center; gap: 10px; }
.room-picker { height: 54px; padding: 6px 8px 6px 13px; display: flex; align-items: center; gap: 5px; }
.room-picker > svg { width: 19px; height: 19px; color: #607b8b; }
#room-select { width: 174px; font-size: 14px; }
.standalone { width: 54px; height: 54px; border-radius: 12px; padding: 15px; }
.standalone svg { width: 23px; height: 23px; }
.standalone.glass:hover { background: #f2f6f8; border-color: #bdcdd8; }

/* Optional controls and numeric summaries. */
.popover { z-index: 30; top: var(--popover-top); left: 50%; transform: translateX(-50%); overflow: hidden; }
.popover-header {
  height: 55px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px 0 18px; border-bottom: 1px solid var(--line);
}
.popover-header h2 { font-size: 16px; color: var(--ink); }
.settings-popover { width: 316px; }
.settings-fields { padding: 10px 18px 16px; }
.settings-fields > label { display: grid; grid-template-columns: 50px minmax(0,1fr); align-items: center; gap: 12px; padding: 7px 0; }
.settings-fields > label > span { font-size: 13px; color: var(--secondary); }
.settings-fields select { width: 100%; height: 40px; font-size: 14px; background-color: #f5f8fa; border-color: #cfdae2; padding-left: 12px; }
.summary-popover { width: 386px; }
.summary-content {
  padding: 18px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 21px 20px;
}
.summary-content .metric, .summary-content > div:not(.metric-grid):not(.summary-grid) { min-width: 0; }
.summary-content small, .summary-content dt, .summary-content .metric-label {
  display: block; color: var(--secondary); font-size: 13px; line-height: 1.45; margin-bottom: 7px;
}
.summary-content strong, .summary-content .metric-value {
  display: block; color: var(--metric-color,var(--ink)); font-size: 24px; font-weight: 600;
  font-variant-numeric: tabular-nums; line-height: 1.2; letter-spacing: -.2px;
}
.summary-content strong small, .summary-content .metric-value small {
  display: inline; font-size: 12px; font-weight: 400; letter-spacing: 0; margin-left: 4px;
}
.summary-content .metric-grid, .summary-content .summary-grid {
  display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 21px 20px; grid-column: 1/-1;
}
.summary-content .full, .summary-content .wide { grid-column: 1/-1; }
.summary-content .summary-note, .summary-content .caption { font-size: 12px; color: var(--secondary); grid-column: 1/-1; }
.summary-content .primary strong { color: var(--red); }

/* Independent room preview. Four metrics receive two rows instead of being compressed. */
.room-float {
  right: var(--edge); top: var(--panel-top); width: 400px; height: 520px;
  min-width: 360px; max-width: min(560px,calc(100vw - 32px)); min-height: 375px;
  max-height: calc(100dvh - var(--panel-top) - 160px); resize: both; overflow: hidden;
  display: flex; flex-direction: column; z-index: 20; border-color: #bdcdd8;
  box-shadow: 0 12px 36px rgba(35,61,75,.13),0 2px 6px rgba(35,61,75,.04);
}
.float-header {
  height: 52px; min-height: 52px; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 0 11px 0 16px; border-bottom: 1px solid var(--line); background: #fff;
}
.float-header h2 {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 16px; color: var(--ink); font-weight: 600;
}
.float-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.room-float-handle, .equipment-float .float-header { cursor: move; touch-action: none; user-select: none; }
.room-float-handle:active { cursor: grabbing; }
.enter-button { height: 36px; font-size: 13px; padding: 0 7px; color: var(--red); gap: 4px; }
.enter-button svg { width: 17px; height: 17px; }
.enter-button:hover { background: var(--red-soft); color: var(--red); }
#room-canvas { display: block; width: 100%; height: 260px; min-height: 180px; flex: 1 1 260px; background: #fafcfd; touch-action: none; }
.room-float-metrics {
  display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 14px;
  padding: 13px 16px 14px; min-height: 79px; max-height: 220px; overflow-y: auto; overscroll-behavior: contain; align-content: start; border-top: 1px solid var(--line);
  background: #f7fafb; flex-shrink: 0; font-size: 13px; color: var(--secondary); font-variant-numeric: tabular-nums;
}
.room-float-metrics:has(> .metric:only-child) { grid-template-columns: 1fr; }
.room-float-metrics .metric { min-width: 0; }
.room-float-metrics small, .room-float-metrics .metric-label {
  display: block; font-size: 12px; color: var(--secondary); line-height: 1.45; margin-bottom: 6px;
}
.room-float-metrics strong, .room-float-metrics .metric-value {
  display: block; font-size: 22px; font-weight: 600; color: var(--metric-color,var(--ink));
  line-height: 1.2; white-space: nowrap; letter-spacing: -.25px;
}
.room-float-metrics strong small { display: inline; font-weight: 400; font-size: 12px; margin-left: 4px; }
.room-float-metrics > span { white-space: nowrap; }

/* The drill-down summary is content-sized and shares the detail slot with equipment. */
.context-panel { z-index: 20; right: var(--edge); top: var(--panel-top); width: 320px; max-height: calc(100dvh - var(--panel-top) - 170px); overflow: auto; scrollbar-width: thin; scrollbar-color: #b8cbd7 transparent; }
.context-panel > .float-header { position: sticky; top: 0; z-index: 1; padding-left: 16px; }
.context-panel .float-header h2 { font-size: 15px; }
.context-content { padding: 16px; font-size: 13px; color: var(--secondary); line-height: 1.65; }
.context-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 14px; }
.context-metrics .metric { min-width: 0; }
.context-metrics .metric > small, .context-metrics .metric-label { display: block; font-size: 12px; line-height: 1.4; margin-bottom: 6px; color: var(--secondary); }
.context-metrics .metric > strong, .context-metrics .metric-value { display: block; font-size: 22px; font-weight: 600; color: var(--metric-color,var(--ink)); line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.context-section { border-top: 1px solid #dbe4eb; margin-top: 16px; padding-top: 14px; }
.context-content h3 { font-size: 13px; font-weight: 650; color: var(--ink); margin-bottom: 10px; }
.context-list { margin: 0; padding: 0; list-style: none; }
.context-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13px; }
.context-row > :first-child { min-width: 0; }
.context-row > strong, .context-row > :last-child { color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.context-row strong { font-weight: 550; }
.context-row small { font-size: 12px; color: var(--secondary); }
.context-load-row { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 5px 10px; margin-top: 10px; font-size: 13px; }
.context-load-row strong { font-size: 17px; font-weight: 600; line-height: 1.3; color: var(--metric-color,var(--ink)); font-variant-numeric: tabular-nums; }
.context-load-row small { font-size: 12px; color: var(--secondary); }
.load-track { height: 6px; width: 100%; flex-basis: 100%; background: #e7eef3; border-radius: 3px; overflow: hidden; }
.load-fill { display: block; height: 100%; background: var(--metric-color,#678b9c); border-radius: inherit; max-width: 100%; }
.context-reopen { right: var(--edge); top: var(--panel-top); z-index: 20; height: 42px; padding: 0 13px; font-size: 13px; gap: 7px; }
.context-reopen svg { width: 18px; height: 18px; }
#context-panel:not([hidden]) ~ #context-reopen { display: none !important; }
.hover-card { z-index: 35; pointer-events: none; width: max-content; max-width: 270px; padding: 12px 14px; border-radius: 10px; color: var(--secondary); font-size: 12px; line-height: 1.65; box-shadow: 0 5px 20px #253e4d1a; }
.hover-card > strong, .hover-card h3, .hover-title, .hover-name { display: block; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.4; margin-bottom: 6px; }
.capacity-equivalent { grid-column: 1/-1; color: var(--secondary); font-size: 13px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.context-metrics + .capacity-equivalent { margin-top: 10px; }
.hover-card small, .hover-meta, .hover-metrics { display: block; color: var(--secondary); font-size: 12px; }
.hover-card .hover-metrics { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }

/* The public showroom remains part of the drawing, with a compact guided route. */
.exhibition-entry { left: var(--edge); top: var(--crumb-top); height: 42px; display: inline-flex; align-items: center; gap: 9px; padding: 0 12px; color: var(--ink); font-size: 13px; border-color: #d6c9c9; box-shadow: var(--control-shadow); }
.exhibition-entry-symbol { width: 19px; height: 19px; color: var(--red); }
.exhibition-entry-arrow { width: 17px; height: 17px; margin-left: 3px; color: #8a6f75; transition: transform .16s; }
.exhibition-entry:hover { background: #fff8f8; border-color: #d6aeb8; color: var(--red); }
.exhibition-entry:hover .exhibition-entry-arrow { transform: translateX(2px); }
body[data-depth=room] .exhibition-entry { display: none; }
.exhibition-nav { left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 5px; padding: 7px; max-width: calc(100vw - 500px); min-height: 62px; z-index: 22; border-color: #d5c6c9; box-shadow: 0 7px 26px #4b334d12,0 1px 4px #4b334d06; }
.exhibition-stops { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: auto; scrollbar-width: none; scroll-behavior: smooth; }
.exhibition-stops::-webkit-scrollbar { display: none; }
.exhibition-stop, .exhibition-stops > button { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 74px; min-height: 46px; padding: 5px 9px; border: 1px solid transparent; border-radius: 8px; color: var(--secondary); font-size: 12px; line-height: 1.3; white-space: nowrap; }
.exhibition-stop:hover, .exhibition-stops > button:hover { background: #f9f3f5; color: #95425e; }
.exhibition-stops > button:is(.active,[aria-pressed=true],[aria-current=step]) { background: #f9edf1; border-color: #e6c2ce; color: #9d3655; font-weight: 600; }
.exhibition-step-number, .exhibition-stop-number { font: 600 10px/1 Arial,sans-serif; letter-spacing: 1px; color: #8b9299; }
.exhibition-stops > button:is(.active,[aria-pressed=true],[aria-current=step]) :is(.exhibition-step-number,.exhibition-stop-number) { color: #ad5971; }
.exhibition-step-control { width: 30px; height: 40px; padding: 6px; border-radius: 7px; }
.exhibition-step-control svg { width: 18px; height: 18px; }
.exhibition-step-control:disabled { opacity: .25; }
.exhibition-progress { flex-shrink: 0; align-self: center; min-width: 27px; margin: 0 1px 0 3px; text-align: center; font: 500 11px/1.3 Arial,sans-serif; font-variant-numeric: tabular-nums; color: #7b7c85; white-space: nowrap; }
.exhibition-node-detail { color: var(--secondary); }
.exhibition-kicker { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; line-height: 1.4; letter-spacing: .7px; color: #aa4a65; margin-bottom: 8px; }
.exhibition-kicker::before { content: ""; width: 18px; height: 2px; background: #b7607a; border-radius: 2px; }
.exhibition-node-detail h3, .exhibition-node-title { color: var(--ink); font-size: 20px; font-weight: 600; line-height: 1.35; margin: 0 0 12px; letter-spacing: -.2px; }
.exhibition-node-detail > p { font-size: 13px; line-height: 1.65; color: var(--secondary); margin: 8px 0 12px; }
.exhibition-node-detail .context-list { margin-top: 8px; }
.exhibition-node-meta { color: var(--secondary); font-size: 12px; line-height: 1.6; }
.exhibition-node-notes { display: grid; gap: 6px; margin-top: 17px; padding: 11px 12px; border-left: 2px solid #c88597; border-radius: 0 6px 6px 0; background: #faf6f6; color: #596b75; font-size: 13px; line-height: 1.55; }
.exhibition-context .context-metrics { gap: 15px 12px; }
.exhibition-context .context-section { margin-top: 18px; padding-top: 16px; }
body[data-exhibition=active] #case-toolbar { display: none; }
.exhibition-links { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 12px; }
.exhibition-chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 6px 9px; border: 1px solid #cfdce5; border-radius: 7px; background: #f5f9fb; color: #355b70; font-size: 12px; line-height: 1.3; text-decoration: none; white-space: nowrap; }
.exhibition-chip svg { width: 15px; height: 15px; }
.exhibition-chip:hover { color: var(--red); background: #fff4f6; border-color: #e1bdc7; }
.exhibition-detail-open { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 43px; margin-top: 18px; padding: 10px 13px; border: 1px solid #d6b2b9; border-radius: 7px; background: #fff7f7; color: #a63743; font-size: 14px; font-weight: 650; }
.exhibition-detail-open:hover { background: #f9e9ec; border-color: #be7984; }
.load-policy-note { margin: 4px 16px 14px; color: #6e7c86; font-size: 12px; line-height: 1.5; }
.load-hold-note { grid-column: 1 / -1; padding: 9px 10px; margin-top: 8px; border-left: 3px solid #bb6a65; border-radius: 3px; background: #fbefed; color: #944a45; font-size: 12px; font-weight: 600; line-height: 1.5; }
.load-hold-summary { padding: 6px 9px; border: 1px solid #dbb6af; border-radius: 6px; background: #fff4f2; color: #934a45; font-size: 12px; white-space: nowrap; }
.load-hold-summary:hover { background: #f6dfdb; }
.context-panel:has(.exhibition-node-detail) { border-color: #d8c8ce; }
.context-panel:has(.exhibition-node-detail) > .float-header { background: #fffcfc; }
body:has(#exhibition-nav:not([hidden])) #mode-insight { display: none; }

/* Equipment dimensions stay secondary to the capacity and load values. */
.equipment-float {
  z-index: 21; right: var(--edge); top: var(--panel-top); width: 360px;
  max-height: calc(100dvh - var(--panel-top) - 80px); overflow: auto;
  scrollbar-width: thin; scrollbar-color: #b8cbd7 transparent;
}
.equipment-float .float-header { position: sticky; top: 0; z-index: 1; }
.equipment-float .float-header h2 { font-size: 16px; }
#equipment-elevation { display: block; width: 100%; height: 220px; background: #fafcfd; }
.equipment-content {
  padding: 16px 18px 19px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.5;
  display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px 18px; font-variant-numeric: tabular-nums;
}
.equipment-id { grid-column: 1/-1; font: 12px/1.4 Arial,sans-serif; color: var(--muted); letter-spacing: .3px; overflow-wrap: anywhere; }
.equipment-content .metric { min-width: 0; }
.equipment-content .metric small, .equipment-content .field small,
.equipment-content dt, .equipment-content .metric-label {
  display: block; color: var(--secondary); font-size: 12px; line-height: 1.4; margin-bottom: 6px;
}
.equipment-content .metric strong, .equipment-content .field strong,
.equipment-content dd, .equipment-content .metric-value {
  font-size: 22px; line-height: 1.2; color: var(--metric-color,var(--ink)); font-weight: 600; white-space: nowrap;
}
.equipment-content .metric:nth-child(2) { grid-column: 1/-1; }
.equipment-content .metric:nth-child(2) strong {
  font-size: 18px; font-weight: 500; color: var(--secondary); letter-spacing: -.2px; white-space: normal;
}
.functional-detail .equipment-content .metric:nth-child(2) { grid-column: auto; }
.functional-detail .equipment-content .metric:nth-child(2) strong { font-size: 22px; font-weight: 600; color: var(--metric-color,var(--ink)); }
.equipment-content strong small { font-size: 12px; display: inline; color: var(--secondary); margin-left: 4px; font-weight: 400; }
.equipment-content dl, .equipment-content .full, .equipment-content .wide { grid-column: 1/-1; }
.equipment-content dl > div, .equipment-content .kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; }
.equipment-content dl > div + div, .equipment-content .kv + .kv { border-top: 1px solid #e2e9ee; }
.equipment-content .kv { grid-column: 1/-1; }
.equipment-content .kv > span:first-child { color: var(--secondary); font-size: 13px; }
.equipment-content .kv > span:last-child { color: var(--ink); }
.equipment-content dl > div dt { margin: 0; }
.equipment-content .unit, .metric-unit {
  display: inline; font-size: 12px; font-weight: 400; color: var(--secondary); margin-left: 4px; letter-spacing: 0;
}
:is(.metric,.context-load-row)[data-load-state=low] { --metric-color: #275e4c; }
:is(.metric,.context-load-row)[data-load-state=near] { --metric-color: #795217; }
:is(.metric,.context-load-row)[data-load-state=high] { --metric-color: #a12f40; }
.metric[data-load-state=low] strong { color: #275e4c; }
.metric[data-load-state=near] strong { color: #795217; }
.metric[data-load-state=high] strong { color: #a12f40; }
.metric[data-load-state] strong .metric-unit,
.metric[data-load-state] strong small { color: var(--secondary); }

/* Legends sit above the scale; process summaries occupy a separate bottom line. */
.legend { left: var(--edge); bottom: 82px; max-width: min(780px,calc(100vw - 350px)); display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 11px 14px; color: var(--secondary); font-size: 13px; line-height: 1.5; z-index: 8; }
.legend-group { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; width: 100%; }
.legend-title { color: var(--ink); font-size: 13px; font-weight: 600; min-width: 30px; margin-right: 1px; }
.legend .legend-item, .legend > span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 13px; }
.legend .legend-swatch, .legend .swatch, .legend .legend-block { display: inline-block; width: 14px; height: 14px; flex-shrink: 0; border-radius: 3px; background: var(--swatch,currentColor); border: 1px solid rgba(50,74,86,.18); }
.legend .legend-line { display: inline-block; width: 28px; height: 0; flex-shrink: 0; border-top: 6px solid var(--swatch,currentColor); border-radius: 3px; }
.legend .legend-fixed, .legend .legend-mobile { display: inline-block; position: relative; width: 24px; height: 15px; flex-shrink: 0; border: 1.5px solid #638092; border-radius: 2px; background: repeating-linear-gradient(90deg,#f6f9fb 0 6px,#a3b5c0 6px 7px); }
.legend .legend-mobile { border-color: #607f73; background: repeating-linear-gradient(90deg,#e2eeea 0 6px,#91b3a6 6px 7px); border-bottom-width: 3px; }
.legend .legend-mobile:after { content: ""; position: absolute; bottom: -5px; left: -2px; right: -2px; height: 1px; background: #607f73; }
.legend .legend-ramp, .legend .heat-ramp { height: 9px; width: 120px; display: inline-block; border-radius: 5px; background: linear-gradient(90deg,#a0c8d5,#86a6b6,#dbc68e,#ce956a,#b85453); }
.legend small { color: var(--secondary); font-size: 12px; }
.legend-reference { padding-left: 12px; border-left: 1px solid #bdcdd7; font-size: 13px; color: var(--secondary); }
.mode-insight { left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100vw - 540px); min-height: 46px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; z-index: 9; color: var(--secondary); font-size: 13px; white-space: nowrap; }
.insight-title { font-size: 13px; font-weight: 650; color: var(--ink); padding-right: 12px; border-right: 1px solid #dce5eb; flex-shrink: 0; }
.flow-track { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.flow-track + .flow-track { border-left: 1px solid #d5e0e6; padding-left: 12px; }
.flow-step { font-size: 13px; color: var(--secondary); white-space: nowrap; }
.flow-arrow { color: #8ca0ad; font-size: 14px; }
.insight-metrics { display: flex; align-items: baseline; gap: 16px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.insight-metric { display: inline-flex; align-items: baseline; gap: 5px; font-size: 13px; white-space: nowrap; }
.insight-metric strong { font-size: 16px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.insight-metric small { font-size: 12px; color: var(--secondary); }
.bank-popover {
  left: 50%; bottom: 24px; transform: translateX(-50%); padding: 9px 11px;
  display: flex; gap: 8px; align-items: center; max-width: min(620px,calc(100vw - 40px));
  overflow: auto; z-index: 22; white-space: nowrap;
}
body[data-mode=load] .bank-popover { bottom: 156px; }
.bank-popover strong, .bank-popover > span, .bank-popover > label {
  font-size: 13px; font-weight: 500; color: var(--secondary); padding: 0 5px; flex-shrink: 0;
}
.bank-top, .bank-gaps { display: flex; align-items: center; gap: 6px; }
.bank-top > span { font-size: 13px; color: var(--secondary); margin: 0 4px; }
.bank-popover button {
  height: 38px; min-width: 38px; flex-shrink: 0; border-radius: 7px; padding: 0 11px;
  font-size: 14px; color: var(--secondary); background: #f1f6f9; border: 1px solid #cedbe4;
}
.bank-popover button:hover { background: #e6eff5; }
.bank-popover button.active, .bank-popover button[aria-pressed=true] { color: var(--red); background: var(--red-soft); border-color: #e6b6c0; }
.bank-popover select { height: 38px; background-color: #f5f8fa; border-color: #cfdae2; font-size: 13px; }
.bank-popover .bank-aisle-count { color: #37725b; padding: 0 6px; }
.bank-popover .bank-step { padding: 0; min-width: 32px; width: 32px; font-size: 23px; }
.bank-popover #bank-select { width: 128px; }
.bank-popover .bank-gap-select { width: 126px; }
.route-play {
  left: 150px; bottom: 24px; height: 46px; display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 0 15px; color: var(--secondary); font-size: 14px;
}
.route-play svg { width: 19px; height: 19px; }
.route-play .play-shape { fill: currentColor; stroke: none; }
.route-play[aria-pressed=true] { color: var(--red); border-color: #e6b6c0; background: var(--red-soft); }
.zoom-controls {
  right: var(--edge); bottom: 24px; display: flex; align-items: center;
  height: 52px; padding: 5px 7px; gap: 2px; z-index: 12;
}
.zoom-controls .icon-button { width: 38px; height: 40px; }
.zoom-controls .icon-button svg { width: 21px; height: 21px; }
#zoom-value { min-width: 53px; text-align: center; font: 550 13px/1.5 Arial,sans-serif; letter-spacing: .2px; color: var(--secondary); user-select: none; }
.zoom-controls .control-divider { height: 24px; margin: 0 4px; }
.toast {
  position: fixed; z-index: 100; left: 50%; bottom: 155px; transform: translate(-50%,8px);
  padding: 12px 18px; color: var(--secondary); font-size: 14px; line-height: 1.5;
  pointer-events: none; opacity: 0; transition: opacity .18s,transform .18s;
  max-width: calc(100vw - 40px); text-align: center; white-space: nowrap;
}
.toast.show, .toast.visible { opacity: 1; transform: translate(-50%,0); }
.loading { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; background: rgba(245,248,250,.65); pointer-events: none; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #cfdce4; border-top-color: var(--red); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive controls remain outside the drawing's reserved reading area. */
@media (min-width: 1800px) {
  :root { --edge: 32px; --top: 24px; --toolbar-top: 28px; --case-top: 98px; --panel-top: 160px; --popover-top: 156px; --crumb-top: 100px; }
  .brand-button { padding: 0 18px; }
  .anta-wordmark { font-size: 32px; }
  .room-float { width: 420px; height: 480px; }
  .equipment-float { width: 380px; }
  #equipment-elevation { height: 230px; }
}
@media (max-width: 1100px) {
  :root { --edge: 18px; }
  .brand-button { padding: 0 13px; gap: 12px; }
  .project-name { font-size: 14px; }
  #room-select { width: 150px; }
  .top-right { gap: 8px; }
  .room-breadcrumb { max-width: 320px; }
}
@media (max-width: 980px) {
  :root { --panel-top: 202px; --popover-top: 150px; --crumb-top: 150px; }
  .mode-tabs { display: none; }
  .mode-select-field { display: flex; }
  .view-toolbar { padding: 5px 6px; }
  .room-breadcrumb { max-width: 300px; }
  .exhibition-nav { bottom: 82px; max-width: calc(100vw - 2 * var(--edge)); }
  body:has(#exhibition-nav:not([hidden])) .legend { bottom: 158px; }
}
@media (min-width: 821px) and (max-width: 980px) {
  .context-panel { width: 280px; }
  .equipment-float { width: 300px; }
}
@media (max-width: 820px) {
  :root { --edge: 12px; --top: 12px; --toolbar-top: 84px; --case-top: 142px; --panel-top: 240px; --popover-top: 240px; --crumb-top: 240px; }
  body:has(#room-breadcrumb:not([hidden])) { --panel-top: 288px; }
  .brand-button { height: 62px; gap: 12px; padding: 0 14px; }
  .anta-wordmark { font-size: 29px; }
  .brand-divider { height: 32px; }
  .project-name { font-size: 14px; }
  .project-subtitle { font-size: 12px; }
  .top-right { top: 84px; gap: 0; }
  .top-right .standalone { display: none; }
  .room-picker { height: 48px; width: min(230px,calc((100vw - 36px)/2)); padding: 4px 6px 4px 9px; gap: 3px; }
  .room-picker > svg { width: 18px; height: 18px; }
  #room-select { width: 100%; font-size: 14px; }
  .view-toolbar { left: 12px; transform: none; width: min(220px,calc((100vw - 36px)/2)); height: 48px; padding: 3px 4px; }
  .mode-select-field { min-width: 0; width: 100%; padding-left: 5px; gap: 3px; }
  .view-symbol { width: 18px; height: 18px; }
  #view-select { width: 100%; font-size: 14px; padding-left: 5px; padding-right: 25px; background-position: right 7px center; }
  .case-toolbar { left: 12px; right: 12px; max-width: none; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 6px 7px; padding: 6px; }
  .case-switches { grid-column: 1/-1; display: grid; grid-template-columns: 1.4fr 1fr; gap: 5px; }
  .case-toggle { min-width: 0; height: 36px; font-size: 13px; padding: 0 24px 0 6px; overflow: hidden; text-overflow: ellipsis; }
  .case-toggle::after { right: 6px; width: 12px; height: 12px; }
  .case-actions { grid-column: 2; grid-row: 2; border-left: 0; padding-left: 0; }
  .case-toolbar #summary-button { min-width: 138px; padding: 0 7px; font-size: 13px; gap: 6px; }
  .case-toolbar #summary-button strong { font-size: 16px; }
  .case-toolbar .load-basis { grid-column: 1; grid-row: 2; width: 100%; height: 36px; font-size: 13px; padding-left: 8px; padding-right: 23px; background-position: right 6px center; }
  .room-breadcrumb { max-width: calc(100vw - 24px); height: 40px; padding: 0 12px; font-size: 13px; }
  .room-breadcrumb strong, .crumb-back { font-size: 13px; }
  .exhibition-entry { top: var(--crumb-top); height: 40px; padding: 0 11px; }
  .exhibition-nav { left: 12px; right: 12px; bottom: 72px; transform: none; max-width: none; min-height: 58px; padding: 5px; gap: 3px; }
  .exhibition-stops { flex: 1; gap: 3px; }
  .exhibition-stops > button { min-width: 66px; min-height: 45px; padding: 4px 7px; font-size: 12px; }
  .exhibition-step-control { width: 27px; padding: 5px; }
  .exhibition-progress { min-width: 24px; font-size: 10px; }
  body:has(#exhibition-nav:not([hidden])) .legend { bottom: 142px; }
  body:has(#exhibition-nav:not([hidden])) .route-play { left: 112px; bottom: 12px; height: 48px; }
  .popover { width: min(370px,calc(100vw - 24px)); }
  .settings-popover { width: min(316px,calc(100vw - 24px)); }
  .popover-header { height: 52px; }
  .summary-content, .summary-content .metric-grid { gap: 20px 15px; }
  .summary-content strong, .summary-content .metric-value { font-size: 23px; }
  .room-float { width: min(400px,calc(100vw - 24px)); max-width: calc(100vw - 24px); min-width: min(330px,calc(100vw - 24px)); height: 440px; min-height: 310px; max-height: calc(100dvh - var(--panel-top) - 150px); resize: none; }
  .float-header { height: 52px; min-height: 52px; padding-left: 13px; gap: 7px; }
  .float-header h2, .equipment-float .float-header h2 { font-size: 15px; }
  .float-actions { gap: 2px; }
  .enter-button { padding: 0 5px; }
  #room-canvas { min-height: 150px; }
  .room-float-metrics { padding: 12px; gap: 13px 10px; max-height: 160px; }
  .room-float-metrics strong, .room-float-metrics .metric-value { font-size: 21px; }
  .context-panel { width: min(320px,calc(100vw - 24px)); max-height: calc(100dvh - var(--panel-top) - 155px); }
  .equipment-float { width: min(350px,calc(100vw - 24px)); max-height: calc(100dvh - var(--panel-top) - 105px); }
  #equipment-elevation { height: 210px; }
  .equipment-content { padding: 15px 16px 17px; gap: 17px 14px; }
  .legend { left: 12px; bottom: 130px; max-width: calc(100vw - 24px); padding: 10px 12px; font-size: 13px; gap: 7px; }
  .legend-group { gap: 7px 11px; }
  .legend .legend-item { gap: 6px; }
  .legend .legend-line { width: 25px; }
  .legend-reference { padding-left: 0; border-left: 0; }
  body[data-mode=layout] .legend { bottom: 72px; }
  .mode-insight { left: 118px; bottom: 72px; transform: none; max-width: calc(100vw - 130px); min-height: 46px; padding: 9px 11px; gap: 9px; }
  body[data-mode=load] .mode-insight { left: 12px; max-width: calc(100vw - 24px); }
  .insight-title { padding-right: 9px; }
  .insight-metrics { gap: 12px; }
  .zoom-controls { right: 12px; bottom: 12px; height: 48px; padding: 3px 5px; border-radius: 10px; }
  .zoom-controls .icon-button { width: 36px; height: 40px; }
  #zoom-value { min-width: 48px; font-size: 13px; }
  .zoom-controls .control-divider { margin: 0 2px; }
  .route-play { left: 12px; bottom: 72px; height: 46px; padding: 0 13px; font-size: 14px; border-radius: 10px; }
  .bank-popover, body[data-mode=load] .bank-popover { left: 12px; transform: none; bottom: 210px; max-width: calc(100vw - 24px); padding: 8px; border-radius: 10px; }
  .toast { bottom: 275px; font-size: 13px; padding: 10px 14px; white-space: normal; }
}
@media (max-width: 380px) {
  .brand-button { padding: 0 11px; gap: 10px; }
  .anta-wordmark { font-size: 27px; }
  .view-symbol { display: none; }
  .mode-select-field { padding-left: 2px; }
  #view-select { padding-left: 7px; }
  .case-toolbar #summary-button { min-width: 132px; padding: 0 5px; }
}
@media (max-height: 650px) and (min-width: 821px) {
  .room-float { height: 390px; min-height: 300px; max-height: calc(100dvh - var(--panel-top) - 130px); }
  #room-canvas { min-height: 130px; }
  .room-float-metrics { max-height: 140px; }
  .context-panel { max-height: calc(100dvh - var(--panel-top) - 130px); }
  .equipment-float { max-height: calc(100dvh - var(--panel-top) - 80px); }
  #equipment-elevation { height: 210px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { transition: none !important; animation-duration: 2s !important; }
}

/* V19: compact room purpose, source area mix and product functions. */
.room-purpose { display:inline-flex; width:max-content; align-items:center; border-radius:5px; background:#eaf3ee; color:#42725b; padding:5px 9px; font-size:12px; margin-bottom:12px; }
.area-table { width:100%; border-collapse:collapse; font-size:12px; color:#5a7180; }
.area-table td { padding:7px 0; border-bottom:1px solid #e8edf0; }
.area-table td:not(:first-child) { text-align:right; }
.product-features { display:flex; gap:6px; flex-wrap:wrap; margin-top:10px; }
.product-features span { font-size:12px; color:#886071; background:#f5edf1; padding:5px 8px; border-radius:5px; }
.product-list { display:flex; flex-direction:column; gap:9px; }
.product-list strong { color:#3c5a6d; font-size:12px; font-weight:550; }
.product-list small { display:block; margin-top:3px; color:#7c8d98; font-size:11px; line-height:1.6; }

.bank-popover { flex-direction:column; align-items:stretch; }
.bank-wings { display:flex; gap:14px; align-items:center; }
.bank-wing-label { font-size:12px; color:#5a7769; min-width:28px; }
@media(max-width:820px){.bank-wings { flex-wrap:wrap; gap:6px; }}
