@font-face {
  font-family: 'Kspan Sans Arabic';
  src: url('./assets/fonts/NotoSansArabic-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Kspan Sans Arabic';
  src: url('./assets/fonts/NotoSansArabic-Bold.ttf') format('truetype');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Kspan Mono';
  src: url('./assets/fonts/NotoSansMono-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0b1118;
  --surface: #111a24;
  --surface-raised: #15212d;
  --surface-soft: #182633;
  --line: #263645;
  --line-bright: #34495b;
  --text: #e5edf4;
  --muted: #91a2b2;
  --muted-soft: #66798a;
  --blue: #73b7ec;
  --blue-deep: #3f8dca;
  --blue-wash: rgba(94, 167, 222, .12);
  --warm: #efa36d;
  --warm-wash: rgba(239, 163, 109, .12);
  --green: #82c8aa;
  --green-wash: rgba(130, 200, 170, .1);
  --danger-wash: rgba(239, 163, 109, .08);
  --font: 'Kspan Sans Arabic', 'Noto Sans Arabic', Tahoma, sans-serif;
  --mono: 'Kspan Mono', 'Noto Sans Mono', Consolas, monospace;
  --radius: 14px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }
html { min-width: 360px; min-height: 100%; background: var(--bg); }
body {
  min-width: 360px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  background:
    radial-gradient(ellipse at 75% -15%, rgba(38, 81, 113, .2), transparent 42%),
    var(--bg);
}
button { color: inherit; font: inherit; }
button:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.app-shell { min-height: 100vh; }
.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 0 34px;
  border-bottom: 1px solid rgba(94, 119, 142, .22);
  background: rgba(11, 17, 24, .94);
  position: relative;
  z-index: 3;
}
.brand-lockup { display: flex; align-items: center; gap: 11px; min-width: 230px; }
.brand-mark {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  color: var(--blue);
  border: 1px solid rgba(115, 183, 236, .32);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(74, 146, 198, .18), rgba(74, 146, 198, .04));
}
.brand-mark svg { width: 27px; height: 27px; }
.brand-copy { display: flex; flex-direction: column; gap: 1px; }
.brand-kicker, .sidebar-kicker, .panel-kicker, .eyebrow, .stamp-code {
  font-family: var(--mono);
  letter-spacing: .1em;
}
.brand-kicker { color: #8ea3b4; font-size: 9px; direction: ltr; text-align: right; }
.brand-copy strong { font-size: 14px; font-weight: 600; letter-spacing: -.02em; }
.topbar-center { display: flex; align-items: center; gap: 9px; color: #b5c2cd; font-size: 12px; }
.location-mark { width: 7px; height: 7px; border-radius: 50%; background: var(--warm); box-shadow: 0 0 0 4px rgba(239, 163, 109, .1); }
.topbar-separator { width: 1px; height: 18px; margin: 0 5px; background: var(--line-bright); }
.code-chip { padding: 5px 8px; border: 1px solid var(--line-bright); border-radius: 6px; color: var(--blue); font: 10px var(--mono); direction: ltr; }
.topbar-actions { display: flex; align-items: center; gap: 15px; }
.concept-status { display: flex; align-items: center; gap: 7px; color: #bac8d3; font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warm); box-shadow: 0 0 0 4px rgba(239, 163, 109, .1); }
.icon-button, .tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-bright);
  background: rgba(21, 33, 45, .75);
  color: #b4c3cf;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}
.icon-button:hover, .tool-button:hover { color: var(--text); border-color: #54718a; background: #1b2b39; }
.icon-button:active, .tool-button:active { transform: translateY(1px); }
.icon-button { height: 36px; padding: 0 11px; font-size: 11px; }
.icon-button svg { width: 17px; height: 17px; }

.dashboard-grid {
  width: min(1680px, 100%);
  min-height: calc(100vh - 76px);
  margin: 0 auto;
  padding: 26px 34px 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 314px;
  align-items: start;
  gap: 26px;
  direction: rtl;
}
.main-content { min-width: 0; }
.page-intro { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 4px 0 20px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 7px; color: #90a4b5; font-size: 9px; letter-spacing: .04em; }
.eyebrow-line { width: 21px; height: 1px; background: var(--warm); }
.eyebrow-index { margin-right: 7px; color: var(--muted-soft); font: 9px var(--mono); direction: ltr; }
h1, h2, p { margin-top: 0; }
.page-intro h1 { margin: 0; font-size: clamp(23px, 2.4vw, 32px); line-height: 1.35; font-weight: 600; letter-spacing: -.045em; }
.page-intro h1 span { color: var(--blue); }
.intro-copy { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.intro-stamp {
  min-width: 120px;
  padding: 10px 13px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(25, 40, 53, .72), rgba(16, 26, 36, .8));
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 9px;
}
.stamp-label { color: var(--muted); font-size: 9px; }
.intro-stamp strong { grid-row: span 2; color: var(--warm); font-size: 13px; font-weight: 600; }
.stamp-line { width: 100%; height: 1px; margin-top: 4px; background: var(--line-bright); }
.stamp-code { color: #718698; font-size: 8px; direction: ltr; text-align: left; margin-top: 5px; }

.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.metric-card {
  min-height: 98px;
  padding: 14px 16px 12px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(22, 34, 46, .92), rgba(16, 25, 34, .88));
}
.metric-card::after { content: ''; position: absolute; inset-inline-start: 0; top: 16px; width: 2px; height: 32px; background: #47637b; border-radius: 2px; }
.metric-card-accent::after { background: var(--blue); }
.metric-card-warm::after { background: var(--warm); }
.metric-label { display: block; color: #9aabba; font-size: 10px; }
.metric-value { display: block; margin-top: 5px; color: #eef5fb; font: 500 23px/1.15 var(--mono); direction: ltr; text-align: right; letter-spacing: -.07em; }
.metric-value small { color: #91a2b2; font: 11px var(--font); letter-spacing: 0; }
.metric-caption { display: block; margin-top: 5px; color: #738798; font-size: 9px; }

.engineering-alert {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 17px;
  padding: 11px 13px;
  border: 1px solid rgba(239, 163, 109, .24);
  border-radius: 9px;
  background: linear-gradient(100deg, rgba(88, 56, 39, .19), rgba(35, 31, 29, .28));
}
.alert-icon { flex: 0 0 29px; width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid rgba(239, 163, 109, .3); border-radius: 8px; color: var(--warm); }
.alert-icon svg { width: 17px; height: 17px; }
.engineering-alert > div { min-width: 0; flex: 1; }
.engineering-alert strong { display: block; color: #f2c29f; font-size: 10px; font-weight: 600; }
.engineering-alert p { margin: 3px 0 0; color: #a89486; font-size: 9px; line-height: 1.65; }
.alert-code { color: #ad8164; font: 8px var(--mono); letter-spacing: .08em; direction: ltr; white-space: nowrap; }

.drawing-panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(16, 25, 34, .94); box-shadow: var(--shadow); }
.panel-heading { min-height: 65px; padding: 11px 19px; display: flex; justify-content: space-between; align-items: center; gap: 15px; border-bottom: 1px solid rgba(57, 77, 95, .48); }
.panel-kicker { margin: 0 0 2px; color: #71899a; font-size: 8px; direction: ltr; text-align: right; letter-spacing: .13em; }
.panel-heading h2 { margin: 0; font-size: 15px; font-weight: 600; }
.panel-tools { display: flex; gap: 7px; }
.tool-button { height: 32px; padding: 0 10px; font-size: 9px; white-space: nowrap; }
.tool-button svg { width: 15px; height: 15px; color: var(--blue); }
.tool-button[aria-pressed="false"] { color: #8193a2; background: transparent; }
.tool-button[hidden] { display: none; }
.view-tabs { display: flex; gap: 3px; padding: 0 14px; border-bottom: 1px solid rgba(57, 77, 95, .48); background: rgba(17, 27, 37, .74); overflow-x: auto; scrollbar-width: thin; }
.view-tab {
  min-height: 47px;
  padding: 0 14px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #8193a2;
  font-size: 10px;
  white-space: nowrap;
  cursor: pointer;
  transition: color .17s ease, background .17s ease, border-color .17s ease;
}
.view-tab svg { width: 17px; height: 17px; color: currentColor; }
.view-tab:hover { color: #cad8e3; background: rgba(115, 183, 236, .035); }
.view-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.view-tab:focus-visible { outline-offset: -4px; }
.drawing-stage {
  min-height: 490px;
  height: clamp(490px, 59vw, 660px);
  position: relative;
  overflow: hidden;
  background-color: #0c141d;
  background-image: radial-gradient(rgba(126, 158, 184, .13) .7px, transparent .7px);
  background-size: 18px 18px;
}
.drawing-view { position: absolute; inset: 0; display: none; overflow: auto; scrollbar-color: #314455 transparent; scrollbar-width: thin; }
.drawing-view.active { display: block; animation: reveal-view .24s ease both; }
.drawing-view[hidden] { display: none; }
.drawing-view svg { display: block; width: 100%; height: 100%; min-height: 440px; }
.drawing-view-3d { overflow: hidden; }
#three-root { position: absolute; inset: 0; width: 100%; height: 100%; background: radial-gradient(ellipse at 50% 40%, #152633, #0b121a 76%); }
#three-root canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }
.scene-error { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 28px; color: #e4edf3; text-align: center; }
.scene-error strong { color: var(--warm); font-size: 14px; }
.scene-error span { max-width: 380px; color: var(--muted); font-size: 11px; line-height: 1.8; }

.scene-info-card, .scene-legend, .scene-hint {
  position: absolute;
  z-index: 2;
  border: 1px solid rgba(91, 115, 136, .43);
  background: rgba(13, 21, 30, .84);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
  backdrop-filter: blur(10px);
}
.scene-info-card { top: 17px; right: 17px; width: 194px; padding: 11px 13px; border-radius: 9px; }
.scene-label { display: block; margin-bottom: 7px; color: var(--blue); font-size: 10px; font-weight: 600; }
.scene-info-card div { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-top: 1px solid rgba(57, 77, 95, .3); font-size: 9px; }
.scene-info-card div span { color: #8c9eac; }
.scene-info-card div strong { color: #d4e0e8; font: 9px var(--mono); direction: ltr; }
.scene-legend { right: 17px; bottom: 17px; display: flex; flex-direction: column; gap: 7px; padding: 10px 12px; border-radius: 8px; color: #a6b5c1; font-size: 9px; }
.scene-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.legend-swatch { width: 14px; height: 9px; display: inline-block; border: 1px solid; border-radius: 2px; }
.legend-blue { border-color: #63aee3; background: rgba(99, 174, 227, .4); }
.legend-orange { border-color: #efa36d; background: rgba(239, 163, 109, .45); }
.legend-dash { border-color: #8094a5; background: repeating-linear-gradient(90deg, #8094a5 0 3px, transparent 3px 6px); }
.scene-hint { left: 17px; bottom: 17px; padding: 8px 10px; border-radius: 7px; color: #96a7b5; font-size: 9px; }

.drawing-caption { min-height: 41px; padding: 9px 17px; display: flex; align-items: center; gap: 8px; border-top: 1px solid rgba(57, 77, 95, .48); }
.caption-dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px rgba(115, 183, 236, .11); }
.drawing-caption p { margin: 0; color: #95a7b5; font-size: 9px; line-height: 1.6; }
.caption-meta { margin-inline-start: auto; color: #647889; font-size: 8px; white-space: nowrap; }
.bottom-note { display: flex; align-items: flex-start; gap: 9px; margin: 13px 2px 0; color: #8193a2; }
.bottom-note-mark { flex: 0 0 17px; width: 17px; height: 17px; display: grid; place-items: center; margin-top: 1px; border: 1px solid #425567; border-radius: 50%; color: #9bb0c0; font: italic 11px Georgia, serif; }
.bottom-note p { margin: 0; font-size: 9px; line-height: 1.75; }
.bottom-note strong { color: #b8c7d2; font-weight: 600; }

.sidebar { padding: 0 0 8px; }
.sidebar-section { margin-bottom: 12px; padding: 16px 16px 15px; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(150deg, rgba(20, 31, 42, .96), rgba(15, 24, 33, .96)); }
.sidebar-section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.section-index { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 27px; border: 1px solid rgba(239, 163, 109, .3); border-radius: 7px; background: var(--warm-wash); color: var(--warm); font: 9px var(--mono); }
.section-index-blue { border-color: rgba(115, 183, 236, .29); background: var(--blue-wash); color: var(--blue); }
.section-index-warm { border-color: rgba(239, 163, 109, .3); background: var(--warm-wash); color: var(--warm); }
.sidebar-kicker { margin: 0 0 1px; color: #72899a; font-size: 7px; direction: ltr; text-align: right; letter-spacing: .13em; }
.sidebar-section-head h2 { margin: 0; color: #dbe5ec; font-size: 12px; font-weight: 600; }
.property-list { display: flex; flex-direction: column; }
.property-row { min-height: 30px; display: flex; justify-content: space-between; align-items: center; gap: 8px; border-bottom: 1px solid rgba(52, 73, 91, .42); }
.property-row:last-child { border-bottom: 0; }
.property-row span { color: #899baa; font-size: 9px; }
.property-row strong { color: #d0dce5; font: 500 9px var(--mono); direction: ltr; text-align: left; white-space: nowrap; }
.property-row .value-blue { color: var(--blue); font-family: var(--font); }
.property-row .value-green { color: var(--green); font-family: var(--font); }
.property-row .value-warm { color: var(--warm); }
.canopy-callout { display: flex; gap: 8px; margin-top: 11px; padding: 9px; border: 1px solid rgba(239, 163, 109, .2); border-radius: 8px; background: rgba(239, 163, 109, .055); }
.canopy-icon { width: 18px; height: 18px; flex: 0 0 18px; display: grid; place-items: center; border-radius: 5px; background: rgba(239, 163, 109, .12); color: var(--warm); font: 13px var(--mono); }
.canopy-callout strong { color: #e7b38d; font-size: 9px; font-weight: 600; }
.canopy-callout p { margin: 2px 0 0; color: #9c8d81; font-size: 8px; line-height: 1.65; }
.load-reference { display: flex; align-items: center; gap: 6px; margin: -4px 0 9px; color: #8b9eac; font-size: 8px; }
.load-reference strong { margin-right: auto; color: var(--blue); font: 9px var(--mono); direction: ltr; }
.reference-mark { width: 5px; height: 5px; border-radius: 50%; background: var(--blue); }
.load-card { margin: 7px 0; padding: 9px 10px 8px; border: 1px solid rgba(70, 94, 114, .36); border-radius: 8px; background: rgba(11, 18, 26, .54); }
.load-card-label { display: flex; justify-content: space-between; align-items: center; color: #99a9b6; font-size: 8px; }
.load-card-label i { color: #70899b; font: italic 10px Georgia, serif; }
.load-card > strong { display: block; margin-top: 4px; color: #e3edf4; font: 500 18px var(--mono); direction: ltr; text-align: right; letter-spacing: -.045em; }
.load-card > strong small { color: #99aab8; font: 8px var(--font); letter-spacing: 0; }
.load-card-warm > strong { color: #efb487; font-size: 14px; }
.load-card-green > strong { color: var(--green); }
.range-separator { color: #9c8d81; font: 8px var(--font); }
.load-footnote { display: block; margin-top: 4px; color: #718596; font-size: 7px; }
.loads-caveat { margin: 9px 0 0; padding: 8px 9px; border-right: 2px solid rgba(239, 163, 109, .7); background: rgba(239, 163, 109, .045); color: #a99483; font-size: 8px; line-height: 1.75; }
.sidebar-footer { display: flex; align-items: center; gap: 9px; padding: 6px 5px; color: #718493; font-size: 8px; line-height: 1.6; }
.footer-mark { width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid #334758; border-radius: 7px; color: #8aa0b0; font: 11px var(--mono); }
.sidebar-footer strong { color: #a4b3bf; font-weight: 500; }

.svg-title { fill: #dce8f0; font-family: var(--font); font-size: 18px; font-weight: 600; }
.svg-subtitle { fill: #8194a5; font-family: var(--font); font-size: 11px; }
.svg-label { fill: #a2b2bf; font-family: var(--font); font-size: 11px; }
.svg-label-strong { fill: #dce7ef; font-family: var(--font); font-size: 13px; font-weight: 600; }
.svg-value { fill: #96b9d2; font: 11px var(--mono); }
.svg-value-warm { fill: #eab087; font: 11px var(--mono); }
.svg-dim { fill: #9aaab7; font: 10px var(--mono); }
.svg-guide { stroke: #62798c; stroke-width: 1; fill: none; }
.svg-site { stroke: #93a5b3; stroke-width: 1.5; fill: rgba(29, 43, 56, .25); }
.svg-setback { stroke: #d59a70; stroke-width: 1.3; stroke-dasharray: 6 5; fill: none; }
.svg-building { stroke: #69b1e5; stroke-width: 2; fill: rgba(62, 137, 190, .17); }
.svg-canopy { stroke: #e6a071; stroke-width: 1.2; fill: rgba(226, 143, 86, .17); }
.svg-rib { stroke: #68a7d3; stroke-width: .8; opacity: .34; }
.svg-centerline { stroke: #75b7e4; stroke-width: 1; stroke-dasharray: 8 5; opacity: .6; }
.svg-dimension { stroke: #8496a4; stroke-width: 1; fill: none; }
.svg-dimension-accent { stroke: #7db9e1; stroke-width: 1; fill: none; }
.svg-dimension-warm { stroke: #e6a071; stroke-width: 1; fill: none; }
.svg-dimension-text { fill: #a9bac6; font: 11px var(--mono); }
.svg-annotation { fill: #d5a07c; font-family: var(--font); font-size: 10px; }
.svg-arch-fill { fill: rgba(68, 147, 202, .15); stroke: #73b8e8; stroke-width: 2.2; }
.svg-arch-line { fill: none; stroke: #7dc0ed; stroke-width: 1.1; }
.svg-height-line { stroke: #e7a36f; stroke-width: 1.1; stroke-dasharray: 5 4; fill: none; }
.svg-ground { stroke: #798d9e; stroke-width: 1.3; }
.svg-hatch { stroke: #364957; stroke-width: .9; }
.svg-roof-band { fill: rgba(83, 151, 197, .13); stroke: #579bc9; stroke-width: 1.5; }
.svg-wall-band { fill: rgba(64, 137, 185, .17); stroke: #6caed9; stroke-width: 1.7; }
.svg-canopy-line { stroke: #e6a071; stroke-width: 1.4; fill: rgba(230, 160, 113, .28); }
.hide-dimensions .dimension-layer { opacity: 0; pointer-events: none; transition: opacity .16s ease; }
.dimension-layer { transition: opacity .16s ease; }

@keyframes reveal-view { from { opacity: .65; transform: translateY(2px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

@media (max-width: 1180px) {
  .topbar { padding-inline: 24px; }
  .dashboard-grid { padding-inline: 24px; grid-template-columns: minmax(0, 1fr) 288px; gap: 18px; }
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drawing-stage { height: 570px; }
  .view-tab { padding-inline: 11px; }
}
@media (max-width: 860px) {
  .topbar { height: 68px; padding-inline: 18px; gap: 10px; }
  .brand-lockup { min-width: auto; }
  .topbar-center { margin-inline-start: auto; }
  .dashboard-grid { min-height: calc(100vh - 68px); padding: 22px 18px 30px; grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .sidebar-section { margin-bottom: 0; }
  .load-section { grid-column: 1 / -1; }
  .sidebar-footer { grid-column: 1 / -1; }
  .drawing-stage { height: 550px; }
}
@media (max-width: 600px) {
  html, body { min-width: 320px; }
  .topbar { height: 62px; padding-inline: 13px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-mark svg { width: 24px; height: 24px; }
  .brand-kicker { font-size: 7px; }
  .brand-copy strong { font-size: 12px; }
  .topbar-center { display: none; }
  .topbar-actions { gap: 9px; }
  .concept-status { font-size: 9px; }
  .icon-button { width: 34px; height: 34px; padding: 0; }
  .icon-button span { display: none; }
  .dashboard-grid { padding: 18px 12px 26px; gap: 14px; }
  .page-intro { align-items: flex-start; margin-top: 2px; }
  .page-intro h1 { font-size: 24px; }
  .intro-copy { max-width: 300px; font-size: 10px; line-height: 1.7; }
  .intro-stamp { min-width: 86px; padding: 8px; }
  .stamp-label { font-size: 8px; }
  .stamp-code { font-size: 7px; }
  .eyebrow { font-size: 8px; }
  .metric-strip { gap: 7px; margin-bottom: 10px; }
  .metric-card { min-height: 84px; padding: 10px 11px; }
  .metric-label { font-size: 8px; line-height: 1.5; }
  .metric-value { font-size: 19px; }
  .metric-value small { font-size: 9px; }
  .metric-caption { font-size: 7px; }
  .engineering-alert { align-items: flex-start; gap: 8px; padding: 9px; }
  .alert-icon { width: 25px; height: 25px; flex-basis: 25px; }
  .engineering-alert strong { font-size: 9px; line-height: 1.6; }
  .engineering-alert p { font-size: 8px; }
  .alert-code { display: none; }
  .panel-heading { min-height: 58px; padding-inline: 12px; }
  .panel-heading h2 { font-size: 13px; }
  .panel-kicker { font-size: 7px; }
  .tool-button { height: 30px; padding-inline: 7px; font-size: 8px; }
  .tool-button svg { width: 13px; height: 13px; }
  .view-tabs { padding-inline: 5px; }
  .view-tab { min-height: 45px; padding-inline: 10px; gap: 6px; font-size: 9px; }
  .view-tab svg { width: 15px; height: 15px; }
  .drawing-stage { min-height: 440px; height: 480px; }
  .drawing-view svg { min-height: 440px; width: auto; min-width: 100%; }
  .scene-info-card { top: 10px; right: 10px; width: 160px; padding: 8px 9px; }
  .scene-legend { right: 10px; bottom: 10px; gap: 5px; padding: 8px; font-size: 8px; }
  .scene-hint { left: 10px; bottom: 10px; max-width: 145px; padding: 7px 8px; font-size: 8px; }
  .drawing-caption { align-items: flex-start; padding: 8px 10px; }
  .drawing-caption p { font-size: 8px; }
  .caption-meta { display: none; }
  .bottom-note p { font-size: 8px; }
  .sidebar { grid-template-columns: minmax(0, 1fr); }
  .load-section, .sidebar-footer { grid-column: auto; }
}
@media print {
  :root { color-scheme: light; --bg: #fff; --text: #18222b; }
  body { min-width: 0; background: #fff; color: #18222b; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .topbar { position: static; height: 54px; padding-inline: 10px; background: #101923; }
  .dashboard-grid { display: block; min-height: 0; padding: 14px 10px; }
  .sidebar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
  .sidebar-section { margin: 0; break-inside: avoid; }
  .sidebar-footer, .topbar-actions, .panel-tools { display: none; }
  .drawing-stage { height: 550px; break-inside: avoid; }
  .drawing-panel, .metric-card, .sidebar-section { box-shadow: none; }
  .drawing-view:not(.active) { display: block; position: relative; height: 500px; break-before: page; }
  .drawing-view-3d { display: none !important; }
  .view-tabs { display: none; }
}


/* Fire-protection and ventilation concept views */
.system-diagram { isolation: isolate; text-rendering: geometricPrecision; }
.sys-title { fill: #dce8f0; font: 600 18px var(--font); }
.sys-subtitle { fill: #91a3b1; font: 10px var(--font); }
.sys-label { fill: #c5d2dc; font: 10px var(--font); }
.sys-label-strong { fill: #e5edf4; font: 600 13px var(--font); }
.sys-small-note { fill: #8ea1b0; font: 9px var(--font); }
.sys-value { fill: #e9b28d; font: 10px var(--mono); }
.sys-card-title { fill: #9bc9e6; font: 600 10px var(--font); }
.sys-card-copy { fill: #9aabb8; font: 9px var(--font); }
.sys-site { fill: rgba(29, 43, 56, .27); stroke: #93a5b3; stroke-width: 1.5; }
.sys-water-ring { fill: none; stroke: #72b8e3; stroke-width: 2.3; stroke-dasharray: 8 5; opacity: .9; }
.sys-setback-envelope { fill: none; stroke: #e6a071; stroke-width: 1; stroke-dasharray: 5 5; opacity: .62; }
.sys-proposed-tie { fill: none; stroke: #c2a6e8; stroke-width: 1.6; stroke-dasharray: 4 4; opacity: .9; }
.sys-canopies rect { fill: rgba(230, 160, 113, .1); stroke: #e6a071; stroke-width: .9; stroke-dasharray: 3 3; }
.sys-building { fill: rgba(62, 137, 190, .11); stroke: #6eb8e8; stroke-width: 1.5; }
.sys-hose-box rect { fill: #10212c; stroke: #83c7a8; stroke-width: 1.2; }
.sys-hose-box path { fill: none; stroke: #83c7a8; stroke-width: 1; stroke-linecap: round; }
.sys-monitor circle { fill: #34261f; stroke: #efa36d; stroke-width: 1.4; }
.sys-monitor path { fill: none; stroke: #efa36d; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.sys-monitor-reach { fill: none; stroke: #efa36d; stroke-width: 1.2; stroke-dasharray: 4 5; opacity: .62; marker-end: url(#fire-warm-arrow); }
.sys-top-card rect, .sys-bottom-card rect, .sys-monitor-note rect { fill: rgba(20, 32, 43, .94); stroke: #314758; stroke-width: 1; }
.sys-monitor-note rect { fill: rgba(28, 36, 42, .92); stroke: rgba(239, 163, 109, .45); }
.sys-proposed-label { fill: #eab28a; font: 600 10px var(--font); }
.sys-floor { stroke: #758c9d; stroke-width: 1.3; }
.sys-vent-building { fill: rgba(62, 137, 190, .13); stroke: #6eb8e8; stroke-width: 2; }
.sys-wall { stroke: #6eb8e8; stroke-width: 1.7; }
.sys-centerline { stroke: #7fbde3; stroke-width: 1; stroke-dasharray: 4 6; opacity: .36; }
.vent-frame { fill: rgba(10, 17, 24, .35); stroke: #263b4a; stroke-width: 1; }
.summer-badge { fill: rgba(47, 92, 82, .52); stroke: rgba(131, 199, 168, .58); }
.fire-badge { fill: rgba(111, 59, 47, .58); stroke: rgba(233, 140, 112, .62); }
.mode-badge-text { fill: #e7f0f5; font: 600 10px var(--font); }
.sys-mode-copy { fill: #a8d6bc; font: 10px var(--font); }
.sys-mode-copy-fire { fill: #f0b49c; font: 10px var(--font); }
.sys-intake, .sys-airflow { fill: none; stroke: #83c7a8; stroke-width: 2; stroke-linecap: round; }
.sys-airflow { stroke-dasharray: 7 5; opacity: .9; }
.sys-summer-exhaust { fill: none; stroke: #83c7a8; stroke-width: 2.3; }
.sys-fan { fill: #152932; stroke: #83c7a8; stroke-width: 1.3; }
.sys-equipment { fill: rgba(28, 41, 49, .9); stroke: #efa36d; stroke-width: 1.1; }
.sys-source-extract { fill: none; stroke: #efa36d; stroke-width: 1.7; stroke-dasharray: 6 4; }
.sys-fire-intake { fill: none; stroke: #eab28a; stroke-width: 2; stroke-dasharray: 6 4; }
.sys-fire-exhaust { fill: none; stroke: #e98c70; stroke-width: 2.4; }
.sys-fire-opening { fill: #3a211e; stroke: #e98c70; stroke-width: 1.4; }
.sys-smoke-layer { fill: rgba(233, 140, 112, .17); stroke: rgba(233, 140, 112, .55); stroke-width: 1; }
.sys-fire-note { fill: #eab49d; font: 9px var(--font); }
.sys-note-card rect { fill: rgba(18, 30, 40, .95); stroke: #34495a; stroke-width: 1; }
.sys-note-card-warm rect { fill: rgba(39, 29, 27, .78); stroke: rgba(233, 140, 112, .4); }
.ventilation-diagram .mode-summer, .ventilation-diagram .mode-fire { display: none; }
.ventilation-diagram[data-mode="summer"] .mode-summer,
.ventilation-diagram[data-mode="fire"] .mode-fire { display: inline; }
.safety-note { margin: 9px 0 0; padding: 8px 9px; border-right: 2px solid rgba(239, 163, 109, .65); background: rgba(239, 163, 109, .045); color: #ad9b8b; font-size: 8px; line-height: 1.8; }
.safety-status { display: flex; align-items: center; gap: 7px; margin-top: 9px; padding: 7px 8px; border: 1px solid rgba(239, 163, 109, .22); border-radius: 7px; background: rgba(239, 163, 109, .055); }
.safety-status .status-dot { flex: 0 0 6px; }
.safety-status strong { color: #e7b38d; font-size: 8px; font-weight: 600; }
.reference-list { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 14px; margin: 10px 2px 0; padding: 10px 12px; border: 1px solid rgba(52, 73, 91, .6); border-radius: 8px; background: rgba(16, 25, 34, .65); color: #8193a2; font-size: 8px; line-height: 1.65; }
.reference-list strong { color: #a9bac6; font-weight: 600; }
.reference-list a { color: #83bce0; text-decoration: none; border-bottom: 1px dotted rgba(131, 188, 224, .5); }
.reference-list a:hover { color: #c3e4f6; border-bottom-style: solid; }

@media (max-width: 860px) {
  .safety-section { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .reference-list { align-items: flex-start; flex-direction: column; gap: 5px; padding: 9px; font-size: 8px; }
  .safety-note { font-size: 8px; }
}
@media print {
  .reference-list { break-inside: avoid; }
}
