@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import "./src/styles/tokens.css";
@import "./src/styles/oneline.css?v=one-line-datablock-contrast-v1";
@import "./src/styles/base.css";
@import "./src/styles/navigation.css";
@import "./src/styles/auth.css";
@import "./src/styles/layout.css";
@import "./src/styles/forms.css?v=dark-palette-icons";
@import "./src/styles/modals.css";
@import "./src/styles/tables.css";
@import "./src/styles/messages.css";
@import "./src/styles/ductbank.css";
@import "./src/styles/tray-fill.css";
@import "./src/styles/homepage.css";
@import "./src/styles/components.css";
@import "./src/styles/dissimilar-metals.css";
@import "./src/styles/isometric.css";
@import "./src/styles/spoolsheets.css";
@import "./src/styles/docs.css";
@import "./src/styles/context-menu.css";
@import "./src/styles/panel-schedule.css";
@import "./src/styles/routing.css";
@import "./src/styles/print.css";
@import "./src/styles/copilot.css";
@import "./src/styles/dashboard.css";
@import "./src/styles/workflow-core.css";
@import "./src/styles/scenarioComparison.css";
@import "./src/styles/groundgrid.css";

.lighting-layout-panel {
  margin: 1.25rem 0;
  padding: 1rem;
  border: 1px solid color-mix(in srgb,var(--border-color,#d1d5db) 82%,#ffffff);
  border-radius: 8px;
  background: color-mix(in srgb,var(--card-bg,var(--color-surface-strong,#ffffff)) 88%,var(--secondary-color,#f8fafc));
}
.lighting-layout-header {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}
.lighting-layout-header h2 {
  margin: 0;
  font-size: 1rem;
}
.lighting-layout-summary {
  margin: 0;
  color: var(--color-text-muted,#64748b);
  font-size: .86rem;
}
.lighting-layout-preview {
  width: 100%;
  min-height: 270px;
  border: 1px solid var(--border-color,#d1d5db);
  border-radius: 8px;
  background:
    linear-gradient(180deg,rgba(255,255,255,.86),rgba(241,245,249,.86)),
    repeating-linear-gradient(0deg,rgba(100,116,139,.08) 0 1px,transparent 1px 24px),
    repeating-linear-gradient(90deg,rgba(100,116,139,.08) 0 1px,transparent 1px 24px);
  overflow: hidden;
}
.lighting-layout-svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 270px;
}
.lighting-layout-title {
  font-size: 15px;
  font-weight: 700;
  fill: var(--text-color,#0f172a);
}
.lighting-layout-subtitle,
.lighting-layout-elevation-label,
.lighting-layout-dimension-label,
.lighting-layout-path-label {
  font-size: 11px;
  fill: var(--color-text-muted,#64748b);
}
.lighting-layout-path-label,
.lighting-layout-dimension-label {
  text-anchor: middle;
  font-weight: 700;
}
.lighting-layout-dimension-label--vertical {
  writing-mode: vertical-rl;
  text-anchor: middle;
}
.lighting-layout-room {
  fill: rgba(248,250,252,.94);
  stroke: #334155;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.lighting-layout-grid {
  stroke: rgba(100,116,139,.30);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
}
.lighting-layout-egress-path {
  fill: rgba(16,185,129,.14);
  stroke: rgba(5,150,105,.55);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.lighting-layout-path-center {
  stroke: #059669;
  stroke-width: 2.5;
  fill: none;
  vector-effect: non-scaling-stroke;
}
.lighting-layout-fixture-glow {
  fill: rgba(250,204,21,.28);
}
.lighting-layout-fixture-core,
.lighting-layout-elevation-fixture {
  fill: #fbbf24;
  stroke: #92400e;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.lighting-layout-fixture--error .lighting-layout-fixture-core {
  fill: #ef4444;
  stroke: #7f1d1d;
}
.lighting-layout-fixture-label {
  font-size: 8px;
  font-weight: 800;
  fill: #3f2f00;
  text-anchor: middle;
  pointer-events: none;
}
.lighting-layout-dimension,
.lighting-layout-height-axis {
  stroke: #475569;
  stroke-width: 1.4;
  fill: none;
  vector-effect: non-scaling-stroke;
}
.lighting-layout-arrow {
  fill: #475569;
}
.lighting-layout-floor {
  stroke: #334155;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.lighting-layout-ceiling {
  stroke: #64748b;
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
  vector-effect: non-scaling-stroke;
}
.lighting-layout-workplane {
  stroke: #059669;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.lighting-layout-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(140px,1fr));
  gap: .5rem;
  margin-top: .75rem;
}
.lighting-layout-stat {
  min-height: 3rem;
  padding: .55rem .65rem;
  border: 1px solid var(--border-color,#d1d5db);
  border-radius: 6px;
  background: var(--color-surface-strong,#ffffff);
  color: var(--text-color,#0f172a);
  font-size: .84rem;
}
.lighting-layout-stat strong {
  display: block;
  margin-bottom: .2rem;
  font-size: .72rem;
  color: var(--color-text-muted,#64748b);
  text-transform: uppercase;
  letter-spacing: 0;
}
.lighting-layout-stat--pass {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}
.lighting-layout-stat--fail {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
}
body.dark-mode .lighting-layout-panel {
  background: color-mix(in srgb,var(--card-bg,var(--color-surface-strong,#1e293b)) 88%,transparent);
}
body.dark-mode .lighting-layout-preview {
  background:
    linear-gradient(180deg,rgba(15,23,42,.94),rgba(30,41,59,.92)),
    repeating-linear-gradient(0deg,rgba(148,163,184,.10) 0 1px,transparent 1px 24px),
    repeating-linear-gradient(90deg,rgba(148,163,184,.10) 0 1px,transparent 1px 24px);
}
body.dark-mode .lighting-layout-room {
  fill: rgba(15,23,42,.72);
  stroke: #cbd5e1;
}
body.dark-mode .lighting-layout-floor,
body.dark-mode .lighting-layout-dimension,
body.dark-mode .lighting-layout-height-axis {
  stroke: #cbd5e1;
}
body.dark-mode .lighting-layout-arrow {
  fill: #cbd5e1;
}
body.dark-mode .lighting-layout-stat {
  background: #1e293b;
}
body.dark-mode .lighting-layout-stat--pass {
  background: #14532d;
  color: #bbf7d0;
}
body.dark-mode .lighting-layout-stat--fail {
  background: #450a0a;
  color: #fecaca;
}
body.theme-high-contrast .lighting-layout-panel,
body.theme-high-contrast .lighting-layout-preview,
body.theme-high-contrast .lighting-layout-stat {
  border-color: #000;
  background: #fff;
  color: #000;
}
body.theme-high-contrast .lighting-layout-room,
body.theme-high-contrast .lighting-layout-floor,
body.theme-high-contrast .lighting-layout-dimension,
body.theme-high-contrast .lighting-layout-height-axis,
body.theme-high-contrast .lighting-layout-ceiling {
  stroke: #000;
}
body.theme-high-contrast .lighting-layout-title,
body.theme-high-contrast .lighting-layout-subtitle,
body.theme-high-contrast .lighting-layout-elevation-label,
body.theme-high-contrast .lighting-layout-dimension-label,
body.theme-high-contrast .lighting-layout-path-label {
  fill: #000;
}
@media (max-width: 700px) {
  .lighting-layout-panel {
    padding: .75rem;
  }
  .lighting-layout-preview,
  .lighting-layout-svg {
    min-height: 230px;
  }
}

.equipment-arrangement-layout {
  --equipment-canvas-bg:#eef4fb;
  --equipment-room-fill:#f8fbff;
  --equipment-room-text:#1f2b3a;
  --equipment-wall-stroke:rgba(66,78,98,.95);
  --equipment-doorway-stroke:#0ea36e;
  --equipment-doorway-swing:rgba(14,163,110,.72);
  --equipment-interior-wall-fill:rgba(56,63,74,.85);
  display:grid;
  grid-template-columns:minmax(280px,380px) 1fr;
  gap:1rem;
}
.equipment-arrangement-sidebar { display:flex; flex-direction:column; gap:.75rem; max-height:78vh; overflow:auto; padding-right:.4rem; }
.equipment-arrangement-sidebar .grid-2 { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.5rem; }
.equipment-arrangement-sidebar label { display:flex; flex-direction:column; gap:.25rem; font-size:.86rem; }
.equipment-arrangement-canvas-wrap { display:flex; flex-direction:column; gap:.5rem; }
.equipment-canvas-toolbar { display:flex; gap:.35rem; align-items:end; flex-wrap:wrap; }
.equipment-arrangement-switcher { display:flex; gap:.35rem; align-items:end; flex-wrap:wrap; flex:1 1 100%; padding:.25rem 0 .2rem; border-bottom:1px solid color-mix(in srgb,var(--border-color,#7d8790) 70%,transparent); }
.equipment-arrangement-switcher label { display:flex; flex-direction:column; gap:.2rem; font-size:.78rem; min-width:150px; }
.equipment-arrangement-switcher select { min-width:170px; }
.equipment-arrangement-switcher input { min-width:160px; max-width:220px; }
.equipment-arrangement-switcher .small-text { align-self:center; white-space:nowrap; }
.equipment-canvas-toolbar #auto-layout-status { max-width:32rem; }
.equipment-toolbar-group { display:flex; gap:.3rem; align-items:end; flex-wrap:wrap; flex:0 1 auto; padding:.1rem .35rem; border-left:1px solid color-mix(in srgb,var(--border-color,#7d8790) 55%,transparent); }
.equipment-toolbar-group label { display:flex; flex-direction:column; gap:.2rem; font-size:.78rem; min-width:112px; }
.equipment-toolbar-group input,
.equipment-toolbar-group select { min-width:128px; max-width:190px; }
.equipment-icon-btn,
.equipment-toolbar-group label.equipment-icon-toggle,
.equipment-icon-toggle { position:relative; display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; box-sizing:border-box; width:36px; min-width:36px; max-width:36px; height:36px; min-height:36px; padding:0; margin:.125rem; border-radius:8px; gap:0; line-height:0; text-align:center; vertical-align:middle; }
.equipment-icon-btn .control-icon,
.equipment-icon-toggle .control-icon { display:block; flex:0 0 auto; width:18px; height:18px; margin:0; object-fit:contain; object-position:center; }
.equipment-toolbar-symbol { display:flex; align-items:center; justify-content:center; width:18px; height:18px; font-size:1.35rem; line-height:1; font-weight:700; }
.equipment-icon-toggle { background:var(--button-bg,#2563eb); color:var(--button-text,#fff); border:1px solid color-mix(in srgb,var(--button-bg,#2563eb) 70%,#fff); cursor:pointer; }
.equipment-icon-toggle input { position:absolute; inset:0; opacity:0; cursor:pointer; }
.equipment-icon-toggle:focus-within { outline:2px solid var(--focus-color,#38bdf8); outline-offset:2px; }
.equipment-icon-toggle:not(:has(input:checked)) { background:var(--card-bg,#334155); color:var(--text-color,#e5e7eb); }
.equipment-icon-toggle:not(:has(input:checked)) .control-icon { opacity:.7; }
.equipment-icon-btn[data-tooltip]::after,
.equipment-icon-toggle[data-tooltip]::after { content:attr(data-tooltip); position:absolute; left:50%; bottom:calc(100% + .45rem); z-index:30; transform:translateX(-50%) translateY(2px); padding:.25rem .45rem; border-radius:4px; background:rgba(17,24,39,.96); color:#fff; font-size:.72rem; font-weight:600; line-height:1.2; white-space:nowrap; opacity:0; pointer-events:none; transition:opacity .12s ease,transform .12s ease; box-shadow:0 4px 12px rgba(0,0,0,.24); }
.equipment-icon-btn[data-tooltip]::before,
.equipment-icon-toggle[data-tooltip]::before { content:''; position:absolute; left:50%; bottom:calc(100% + .18rem); z-index:31; transform:translateX(-50%) translateY(2px); border:5px solid transparent; border-top-color:rgba(17,24,39,.96); opacity:0; pointer-events:none; transition:opacity .12s ease,transform .12s ease; }
.equipment-icon-btn:hover::after,
.equipment-icon-btn:focus-visible::after,
.equipment-icon-toggle:hover::after,
.equipment-icon-toggle:focus-within::after,
.equipment-icon-btn:hover::before,
.equipment-icon-btn:focus-visible::before,
.equipment-icon-toggle:hover::before,
.equipment-icon-toggle:focus-within::before { opacity:1; transform:translateX(-50%) translateY(0); }
.equipment-icon-btn:disabled::after,
.equipment-icon-btn:disabled::before { display:none; }
#equipment-arrangement-canvas { width:100%; min-height:70vh; border:1px solid var(--border-color,#7d8790); border-radius:10px; background:var(--equipment-canvas-bg,#eef4fb); user-select:none; }
.equipment-elevation-panel { display:flex; flex-direction:column; gap:.5rem; margin-top:.5rem; }
.equipment-elevation-toolbar { display:flex; align-items:end; gap:.5rem; flex-wrap:wrap; }
.equipment-elevation-toolbar h2 { margin:0; font-size:1rem; line-height:1.2; color:var(--heading-color,var(--text-color,#1f2b3a)); }
.equipment-elevation-toolbar label { display:flex; flex-direction:column; gap:.2rem; font-size:.78rem; min-width:120px; }
.equipment-elevation-toolbar #elevation-status { max-width:30rem; }
#equipment-elevation-canvas { width:100%; min-height:260px; border:1px solid var(--border-color,#7d8790); border-radius:8px; background:var(--equipment-canvas-bg,#eef4fb); }
.equipment-room-fill,.equipment-room-outer { fill:var(--equipment-room-fill,#f8fbff); stroke:none; }
.equipment-room-wall { stroke:var(--equipment-wall-stroke,rgba(66,78,98,.95)); stroke-width:2; fill:none; stroke-linecap:square; }
.equipment-wall-label,.equipment-room-text { fill:var(--equipment-room-text,#1f2b3a); /* font-size set dynamically by JS */ }
.equipment-doorway-panel { stroke:var(--equipment-doorway-stroke,#0ea36e); stroke-width:3; fill:none; stroke-linecap:round; }
.equipment-doorway-swing { stroke:var(--equipment-doorway-swing,rgba(14,163,110,.72)); stroke-width:2; fill:none; stroke-dasharray:3 2; stroke-linecap:round; }
.equipment-doorway-label { fill:#0ea36e; font-weight:700; letter-spacing:.04em; }
.swatch-doorway { background:#0ea36e; }
.equipment-interior-wall { fill:var(--equipment-interior-wall-fill,rgba(56,63,74,.85)); }
.equipment-clearance { fill:rgba(255,213,110,.8); stroke:rgba(200,142,32,.95); stroke-dasharray:4 4; }
.equipment-clearance-danger { fill:rgba(245,91,91,.35); stroke:rgba(213,32,32,.95); }
.equipment-block { fill:rgba(38,122,207,.82); stroke:rgba(14,67,122,.95); stroke-width:1.5; cursor:move; }
.equipment-block.selected { stroke:#fde047; stroke-width:2.5; }
.equipment-block-danger { fill:rgba(218,50,50,.85); stroke:rgba(125,15,15,.95); }
.equipment-block-label,.equipment-block-meta { fill:#fff; pointer-events:none; /* font-size set dynamically by JS */ }
.equipment-lineup-outline { fill:none; stroke:#2563eb; stroke-width:2; stroke-dasharray:8 5; pointer-events:none; }
.equipment-lineup-label { fill:#1d4ed8; font-weight:700; pointer-events:none; }
.equipment-dimension-line,.equipment-dimension-tick { stroke:#111827; stroke-width:1.2; fill:none; pointer-events:none; }
.equipment-dimension-label { fill:#111827; font-size:11px; font-weight:700; pointer-events:none; }
.equipment-checkbox-label { display:flex !important; flex-direction:row !important; align-items:center; gap:.4rem; }
.equipment-mini-list { display:flex; flex-direction:column; gap:.4rem; font-size:.82rem; }
.equipment-mini-list-row { display:flex; justify-content:space-between; gap:.5rem; align-items:center; }
.equipment-legend { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:.3rem; font-size:.83rem; }
.equipment-legend li { display:inline-flex; align-items:center; gap:.4rem; }
.swatch { display:inline-block; width:14px; height:14px; border-radius:3px; }
.swatch-equipment { background:rgba(38,122,207,.85); }
.swatch-clearance { background:rgba(255,213,110,.85); }
.swatch-violation { background:rgba(218,50,50,.85); }
.equipment-summary { margin-top:.4rem; font-size:.88rem; font-weight:600; }
.equipment-clearance-details { font-size:.82rem; color:var(--text-color,#1f2b3a); }
.equipment-clearance-details ul { margin:.4rem 0 0; padding-left:1.1rem; }
.equipment-clearance-details li { margin:.25rem 0; }
.equipment-gap-line { stroke:#f97316; stroke-width:1.5; stroke-dasharray:4 3; fill:none; pointer-events:none; }
.equipment-gap-label { font-size:10px; fill:#f97316; font-weight:700; pointer-events:none; }
.equipment-gap-label-bg { fill:rgba(255,255,255,.9); stroke:#f97316; stroke-width:1; pointer-events:none; }
.equipment-elevation-bg { fill:var(--equipment-room-fill,#f8fbff); }
.equipment-elevation-grid { stroke:rgba(119,135,156,.35); stroke-width:1; }
.equipment-elevation-ground { stroke:var(--equipment-wall-stroke,rgba(66,78,98,.95)); stroke-width:2; }
.equipment-elevation-axis-label { fill:var(--muted-color,#4b5563); font-size:12px; }
.equipment-elevation-title { fill:var(--equipment-room-text,#1f2b3a); font-size:14px; font-weight:700; }
.equipment-elevation-block { fill:rgba(38,122,207,.82); stroke:rgba(14,67,122,.95); stroke-width:1.5; }
.equipment-elevation-block-danger { fill:rgba(218,50,50,.85); stroke:rgba(125,15,15,.95); }
.equipment-elevation-label,.equipment-elevation-meta { fill:#fff; font-size:12px; font-weight:700; pointer-events:none; }
.equipment-elevation-meta { font-weight:500; }
.equipment-elevation-door { fill:rgba(14,163,110,.12); stroke:var(--equipment-doorway-stroke,#0ea36e); stroke-width:2; stroke-dasharray:5 3; }
.equipment-elevation-door-egress { fill:rgba(14,163,110,.22); }
.equipment-elevation-door-label { fill:#0b7d55; font-size:11px; font-weight:700; }
body.theme-high-contrast .equipment-arrangement-layout {
  --equipment-canvas-bg:#ffffff;
  --equipment-room-fill:#ffffff;
  --equipment-room-text:#000000;
  --equipment-wall-stroke:#000000;
  --equipment-doorway-stroke:#000000;
  --equipment-doorway-swing:#000000;
  --equipment-interior-wall-fill:#000000;
}
@media (max-width:1100px){ .equipment-arrangement-layout{grid-template-columns:1fr;} .equipment-arrangement-sidebar{max-height:none;} #equipment-arrangement-canvas{min-height:56vh;} }

.mcc-lineup-layout {
  display:grid;
  grid-template-columns:minmax(300px,390px) 1fr;
  gap:1rem;
  align-items:start;
}
.mcc-lineup-sidebar {
  display:flex;
  flex-direction:column;
  gap:.75rem;
  max-height:78vh;
  overflow:auto;
  padding-right:.4rem;
}
.mcc-file-protocol-warning {
  position:sticky;
  top:0;
  z-index:50;
  padding:.75rem 1rem;
  background:#fef3c7;
  color:#78350f;
  border-bottom:1px solid #f59e0b;
  font-weight:700;
}
.mcc-file-protocol-warning a {
  color:#1d4ed8;
  text-decoration:underline;
}
.mcc-lineup-sidebar h2,
.mcc-lineup-preview-header h2 {
  margin:0;
  font-size:1rem;
  line-height:1.2;
  color:var(--heading-color,var(--text-color,#1f2b3a));
}
.mcc-lineup-toolbar,
.mcc-lineup-actions,
.mcc-lineup-preview-header {
  display:flex;
  gap:.5rem;
  align-items:end;
  flex-wrap:wrap;
}
.mcc-profile-panel {
  display:flex;
  gap:.5rem;
  align-items:end;
  flex-wrap:wrap;
  padding:.55rem;
  border:1px solid color-mix(in srgb,var(--border-color,#7d8790) 70%,transparent);
  border-radius:8px;
  background:color-mix(in srgb,var(--card-bg,var(--color-surface-strong,#ffffff)) 88%,transparent);
}
.mcc-profile-panel label {
  display:flex;
  flex-direction:column;
  gap:.25rem;
  flex:1 1 180px;
  font-size:.82rem;
}
.mcc-lineup-toolbar label {
  display:flex;
  flex-direction:column;
  gap:.25rem;
  flex:1 1 180px;
  font-size:.82rem;
}
.mcc-lineup-actions--wide {
  align-items:center;
}
.mcc-field-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.55rem;
}
.mcc-spec-details {
  border:1px solid color-mix(in srgb,var(--border-color,#7d8790) 70%,transparent);
  border-radius:8px;
  padding:.55rem;
  background:color-mix(in srgb,var(--card-bg,var(--color-surface-strong,#ffffff)) 88%,var(--secondary-color,#f8f9fa));
  color:var(--text-color,#212529);
}
.mcc-spec-details summary {
  cursor:pointer;
  font-size:1rem;
  font-weight:700;
  color:var(--accent-color,#0891b2);
  line-height:1.2;
}
.mcc-spec-details[open] summary {
  margin-bottom:.6rem;
}
body.dark-mode .mcc-profile-panel,
body.dark-mode .mcc-spec-details {
  background:color-mix(in srgb,var(--card-bg,var(--color-surface-strong,#1e293b)) 88%,transparent);
  color:var(--text-color,#f8f9fa);
}
body.theme-high-contrast .mcc-profile-panel,
body.theme-high-contrast .mcc-spec-details {
  background:#ffffff;
  color:#000000;
}
.mcc-field-grid--spec {
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.mcc-field-grid label,
.mcc-section-editor label {
  display:flex;
  flex-direction:column;
  gap:.25rem;
  font-size:.82rem;
}
.mcc-field-grid label.mcc-spec-checkbox {
  flex-direction:row;
  align-items:center;
  gap:.45rem;
  grid-column:1 / -1;
}
.mcc-spec-checkbox-group {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.45rem .65rem;
  grid-column:1 / -1;
  margin:0;
  padding:.55rem;
  border:1px solid color-mix(in srgb,var(--border-color,#7d8790) 70%,transparent);
  border-radius:8px;
}
.mcc-spec-checkbox-group legend {
  padding:0 .25rem;
  font-size:.82rem;
  font-weight:700;
  color:var(--heading-color,var(--text-color,#1f2b3a));
}
.mcc-spec-checkbox-group label {
  flex-direction:row;
  align-items:center;
  gap:.4rem;
  min-width:0;
}
.mcc-spec-checkbox-group input {
  width:auto;
  flex:0 0 auto;
}
.mcc-spec-checkbox input {
  width:auto;
}
.mcc-spec-other-disabled {
  opacity:.58;
}
.mcc-spec-notes {
  grid-column:1 / -1;
}
.mcc-spec-notes textarea {
  width:100%;
  min-height:4.5rem;
  box-sizing:border-box;
  resize:vertical;
}
.mcc-lineup-workspace {
  display:flex;
  flex-direction:column;
  gap:.75rem;
  min-width:0;
}
.mcc-svg-preview {
  width:100%;
  min-height:180px;
  overflow:auto;
  border:1px solid var(--border-color,#7d8790);
  border-radius:8px;
  background:#f8fbff;
}
#mcc-elevation-preview {
  min-height:clamp(260px,42vh,440px);
}
.mcc-svg-preview svg {
  display:block;
  width:auto;
  max-width:100%;
  min-width:620px;
  height:auto;
  margin:0 auto;
}
#mcc-oneline-preview,
#equipment-mcc-oneline-preview {
  overflow-x:auto;
  overflow-y:hidden;
}
#mcc-oneline-preview svg,
#equipment-mcc-oneline-preview svg {
  max-width:none;
}
.mcc-section-list {
  display:flex;
  flex-direction:column;
  gap:.75rem;
}
.mcc-section-editor {
  border:1px solid var(--border-color,#7d8790);
  border-radius:8px;
  background:color-mix(in srgb,var(--card-bg,#ffffff) 94%,#eef4fb);
  padding:.75rem;
}
.mcc-section-editor label {
  color:#111827;
  font-weight:700;
}
.mcc-section-editor__header {
  display:grid;
  grid-template-columns:minmax(160px,1fr) minmax(110px,150px) auto;
  gap:.6rem;
  align-items:end;
  margin-bottom:.65rem;
}
.mcc-section-editor__actions {
  display:flex;
  gap:.35rem;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.mcc-bucket-table {
  width:100%;
  min-width:1750px;
  border-collapse:collapse;
  table-layout:fixed;
}
.mcc-bucket-table th,
.mcc-bucket-table td {
  border:1px solid var(--border-color,#d6dee8);
  padding:.35rem;
  vertical-align:middle;
  font-size:.8rem;
}
.mcc-bucket-table th {
  background:#1f2937;
  color:#f8fafc;
  font-weight:700;
  text-align:left;
  border-color:#334155;
}
.mcc-table-header-with-help {
  display:inline-flex;
  align-items:center;
  gap:.35rem;
}
.mcc-starter-chart-help {
  position:relative;
  display:inline-flex;
  align-items:center;
}
.mcc-info-button {
  width:18px;
  height:18px;
  min-width:18px;
  border:1px solid rgba(248,250,252,.75);
  border-radius:999px;
  background:#0ea5e9;
  color:#ffffff;
  font-size:.72rem;
  font-weight:800;
  line-height:1;
  padding:0;
  cursor:help;
}
.mcc-info-button:focus-visible {
  outline:2px solid #fbbf24;
  outline-offset:2px;
}
.mcc-starter-chart-tooltip {
  display:none;
  position:fixed;
  top:5.5rem;
  left:50%;
  z-index:2500;
  transform:translateX(-50%);
  width:min(900px,92vw);
  max-height:calc(100vh - 7rem);
  overflow:auto;
  padding:.85rem;
  border:1px solid var(--border-color,#cbd5e1);
  border-radius:8px;
  background:var(--card-bg,#ffffff);
  color:var(--text-color,#111827);
  box-shadow:0 18px 44px rgba(15,23,42,.28);
}
.mcc-starter-chart-tooltip.is-visible {
  display:block;
}
.mcc-starter-chart-tooltip strong {
  display:block;
  margin-bottom:.15rem;
  font-size:.95rem;
}
.mcc-starter-chart-caption {
  display:block;
  margin-bottom:.6rem;
  color:var(--text-muted,#64748b);
  font-size:.78rem;
}
.mcc-starter-chart-tooltip table {
  width:100%;
  border-collapse:collapse;
  table-layout:auto;
  background:var(--card-bg,#ffffff);
}
.mcc-starter-chart-tooltip th,
.mcc-starter-chart-tooltip td {
  border:1px solid var(--border-color,#cbd5e1);
  padding:.28rem .35rem;
  text-align:center;
  font-size:.74rem;
  line-height:1.15;
  white-space:nowrap;
}
.mcc-starter-chart-tooltip th {
  background:#e2e8f0;
  color:#0f172a;
  font-weight:800;
}
.mcc-starter-chart-tooltip td:first-child {
  font-weight:800;
}
.mcc-bucket-table tr.mcc-bucket-row-selected td {
  background:#fff7ed;
  box-shadow:inset 0 2px 0 #f59e0b,inset 0 -2px 0 #f59e0b;
}
.mcc-bucket-table tr.mcc-bucket-row-dragging td {
  opacity:.6;
}
.mcc-bucket-table tr.mcc-bucket-row-drop-target td {
  box-shadow:inset 0 3px 0 #2563eb;
}
.mcc-bucket-table tr.mcc-bucket-row-moving td {
  background:#eff6ff;
  box-shadow:inset 0 0 0 2px #2563eb;
}
.mcc-bucket-table tr.mcc-bucket-row-selected td:first-child {
  box-shadow:inset 4px 0 0 #f59e0b,inset 0 2px 0 #f59e0b,inset 0 -2px 0 #f59e0b;
}
.mcc-bucket-table tr.mcc-bucket-row-selected td:last-child {
  box-shadow:inset -4px 0 0 #f59e0b,inset 0 2px 0 #f59e0b,inset 0 -2px 0 #f59e0b;
}
.mcc-bucket-table input,
.mcc-bucket-table select {
  width:100%;
  min-width:0;
  box-sizing:border-box;
  font-size:.8rem;
}
.mcc-bucket-table input[type="checkbox"] {
  width:auto;
  min-width:0;
}
.mcc-bucket-check-cell {
  text-align:center;
}
.mcc-bucket-drag-handle {
  cursor:grab;
  touch-action:none;
  user-select:none;
}
.mcc-bucket-drag-handle:active {
  cursor:grabbing;
}
.mcc-bucket-table th:nth-child(1) {
  width:160px;
}
.mcc-bucket-table th:nth-child(2) {
  width:240px;
}
.mcc-bucket-table th:nth-child(3) {
  width:140px;
}
.mcc-bucket-table th:nth-child(4) {
  width:76px;
}
.mcc-bucket-table th:nth-child(5) {
  width:76px;
}
.mcc-bucket-table th:nth-child(6) {
  width:80px;
}
.mcc-bucket-table th:nth-child(7) {
  width:110px;
}
.mcc-bucket-table th:nth-child(8) {
  width:132px;
}
.mcc-bucket-table th:nth-child(9) {
  width:180px;
}
.mcc-bucket-table th:nth-child(10) {
  width:90px;
}
.mcc-bucket-table th:nth-child(11) {
  width:90px;
}
.mcc-bucket-table th:nth-child(12) {
  width:180px;
}
.mcc-bucket-table th:last-child {
  width:168px;
}
.mcc-bucket-actions {
  display:flex;
  gap:.3rem;
  flex-wrap:nowrap;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.mcc-bucket-actions .mcc-bucket-icon-btn {
  box-sizing:border-box;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 32px;
  width:32px;
  min-width:32px;
  max-width:32px;
  height:32px;
  min-height:32px;
  max-height:32px;
  padding:0;
  margin:0;
  border-radius:8px;
  gap:0;
  font-size:.75rem;
  line-height:1;
  overflow:hidden;
}
.mcc-bucket-actions .mcc-bucket-icon-btn .control-icon {
  width:1rem;
  height:1rem;
  flex:0 0 1rem;
  margin:0;
  filter:brightness(0) invert(1);
}
.mcc-bucket-actions .mcc-bucket-icon-btn .sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}
.mcc-validation-list {
  margin:0;
  padding-left:1.1rem;
  font-size:.84rem;
}
.mcc-validation-list li {
  margin:.25rem 0;
}
.mcc-validation-ok {
  color:#047857;
}
.mcc-validation-warning {
  color:#a16207;
}
.mcc-validation-error {
  color:#b91c1c;
  font-weight:700;
}
.equipment-mcc-preview-panel {
  display:flex;
  flex-direction:column;
  gap:.5rem;
  margin-top:.5rem;
}
.equipment-mcc-preview-toolbar {
  display:flex;
  align-items:baseline;
  gap:.6rem;
  flex-wrap:wrap;
}
.equipment-mcc-preview-toolbar h2 {
  margin:0;
  font-size:1rem;
}
.equipment-mcc-preview-grid {
  display:grid;
  grid-template-columns:1fr;
  gap:.5rem;
}
.equipment-mcc-preview-grid .mcc-svg-preview {
  min-height:180px;
}
@media (min-width:1200px) {
  .equipment-mcc-preview-grid {
    grid-template-columns:1fr 1fr;
  }
}
@media (max-width:1100px) {
  .mcc-lineup-layout {
    grid-template-columns:1fr;
  }
  .mcc-lineup-sidebar {
    max-height:none;
  }
}
@media (max-width:720px) {
  .mcc-field-grid,
  .mcc-section-editor__header {
    grid-template-columns:1fr;
  }
  .mcc-section-editor__actions {
    justify-content:flex-start;
  }
}

.equipment-detail-card { display:flex; flex-direction:column; padding:.75rem 1rem; gap:0; }
.equipment-detail-row { display:grid; grid-template-columns:140px 1fr; gap:.5rem; align-items:baseline; padding:.4rem 0; border-bottom:1px solid var(--border-color,#e5e9f0); }
.equipment-detail-row:last-child { border-bottom:none; }
.equipment-detail-label { font-size:.8rem; font-weight:600; color:var(--muted-color,#6b7280); text-transform:uppercase; letter-spacing:.04em; }
.equipment-detail-value { font-size:.92rem; color:var(--text-color,#1f2b3a); word-break:break-word; }
.equipment-detail-divider { border:none; border-top:2px solid var(--border-color,#e5e9f0); margin:.25rem 0; }
.equipment-detail-status { font-weight:700; padding:.15rem .5rem; border-radius:4px; font-size:.82rem; }
.equipment-detail-status--ok { background:rgba(16,185,129,.12); color:#065f46; }
.equipment-detail-status--violation { background:rgba(220,38,38,.1); color:#991b1b; }

.cp-geometry-illustration {
  margin: .5rem 0 1rem;
  padding: .75rem;
  border: 1px solid var(--border-color, #7d8790);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 92%, transparent);
}
.cp-geometry-illustration svg {
  width: 100%;
  height: auto;
  color: var(--text-color, #1f2b3a);
}
.cp-geometry-pipe {
  fill: color-mix(in srgb, var(--accent-color, #2a6fd6) 38%, #ffffff);
  stroke: color-mix(in srgb, var(--accent-color, #2a6fd6) 80%, #1f2b3a);
  stroke-width: 2;
}
.cp-geometry-dimension {
  stroke: currentColor;
  stroke-width: 2;
}
.cp-geometry-guide {
  stroke: currentColor;
  stroke-width: 1.2;
  opacity: .75;
}
.cp-geometry-label {
  font-size: 16px;
  font-weight: 600;
}
.cp-geometry-note {
  font-size: 14px;
}

.cp-layout-panel {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.cathodicprotection-page .main-content,
.cathodicprotection-page .card,
.cathodicprotection-page .result-group,
.cathodicprotection-page .field-hint {
  line-height: 1.45;
}
.cp-collapsible-card details {
  display: grid;
  gap: .45rem;
}
.cp-collapsible-card summary {
  cursor: pointer;
  list-style: none;
}
.cp-collapsible-card summary::-webkit-details-marker {
  display: none;
}
.cp-collapsible-card summary h2 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}
.cp-collapsible-card summary h2::before {
  content: '▾';
  font-size: .9em;
  transform-origin: center;
}
.cp-collapsible-card details:not([open]) summary h2::before {
  content: '▸';
}
.cp-timeline-panel {
  border: 1px solid var(--border-color, #7d8790);
  border-radius: 10px;
  padding: .45rem .65rem;
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 94%, #f5f9ff 6%);
}
.cp-timeline-panel summary {
  cursor: pointer;
  font-weight: 600;
}
.cp-timeline-list {
  list-style: none;
  margin: .85rem 0 0;
  padding: 0;
  display: grid;
  gap: .6rem;
}
.cp-timeline-step {
  border: 1px solid var(--border-color, #7d8790);
  border-radius: 10px;
  padding: .55rem .65rem;
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 96%, transparent);
}
.cp-timeline-step.is-active {
  border-color: color-mix(in srgb, var(--accent-color, #2a6fd6) 68%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-color, #2a6fd6) 20%, transparent);
}
.cp-timeline-step__header {
  width: 100%;
  border: none;
  background: none;
  color: inherit;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.cp-timeline-step__title {
  font-weight: 600;
}
.cp-timeline-step__index {
  font-size: .78rem;
  opacity: .85;
}
.cp-timeline-step__content {
  margin-top: .45rem;
  display: grid;
  gap: .35rem;
}
.cp-timeline-step__snapshot {
  width: 124px;
  border: 1px solid var(--border-color, #7d8790);
  border-radius: 8px;
  padding: .2rem;
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 94%, #e7f0ff 6%);
}
.cp-timeline-step__snapshot svg {
  width: 100%;
  height: auto;
  display: block;
}
.cp-timeline-step__why,
.cp-timeline-step__checkpoints {
  font-size: .86rem;
}
.cp-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.cp-mode-switch__label {
  font-size: .88rem;
  font-weight: 600;
}
.cp-mode-switch__button.is-active {
  border-color: color-mix(in srgb, var(--accent-color, #2a6fd6) 68%, transparent);
  background: color-mix(in srgb, var(--accent-color, #2a6fd6) 20%, transparent);
}
.cp-layout-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
}
.cp-layout-workspace {
  display: grid;
  gap: .75rem;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  align-items: start;
}
.cp-layout-sidebar {
  display: grid;
  gap: .75rem;
}
.cp-layout-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .88rem;
}
.cp-layout-toolbar--filters {
  border: 1px solid var(--border-color, #7d8790);
  border-radius: 10px;
  padding: .4rem .55rem;
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 94%, #eef4ff 6%);
}
.cp-toolbar-label {
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .01em;
}
.cp-layout-canvas {
  border: 1px solid var(--border-color, #7d8790);
  border-radius: 10px;
  height: 420px;
  min-height: 420px;
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 94%, #b9d7ff 6%);
  overflow: hidden;
  touch-action: none;
}
.cp-layout-canvas svg {
  width: 100%;
  height: 100%;
  display: block;
}
.cp-measurement-panel {
  border: 1px solid var(--border-color, #7d8790);
  border-radius: 10px;
  padding: .75rem;
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 94%, #f3f6ff 6%);
  max-height: 420px;
  overflow: auto;
}
.cp-properties-panel {
  border: 1px solid var(--border-color, #7d8790);
  border-radius: 10px;
  padding: .75rem;
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 95%, #eef7ff 5%);
}
.cp-properties-panel h3,
.cp-properties-panel h4 {
  margin-top: 0;
}
.cp-properties-form {
  display: grid;
  gap: .45rem;
}
.cp-properties-form label {
  display: grid;
  gap: .2rem;
  font-size: .84rem;
}
.cp-properties-form input {
  width: 100%;
}
.cp-measurement-panel h3 {
  margin-top: 0;
}
.cp-measurement-state-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.cp-measurement-state {
  border: 1px solid var(--border-color, #7d8790);
  border-radius: 8px;
  padding: .5rem .6rem;
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 96%, transparent);
}
.cp-measurement-state.is-active {
  border-color: color-mix(in srgb, var(--accent-color, #2a6fd6) 70%, transparent);
  background: color-mix(in srgb, var(--accent-color, #2a6fd6) 14%, transparent);
}
.cp-measurement-state button {
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  padding: 0;
  cursor: pointer;
}
.cp-layout-legend {
  position: sticky;
  top: .5rem;
  border: 1px solid var(--border-color, #7d8790);
  border-radius: 10px;
  padding: .55rem .75rem;
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 96%, #f6fbff 4%);
}
.cp-layout-legend ul {
  list-style: none;
  margin: .45rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: .35rem .6rem;
}
.cp-layout-legend li {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .84rem;
}
.cp-legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.cp-legend-dot--anode { background: #2e78d8; border-color: #1d4f9a; }
.cp-legend-dot--test { background: #16a34a; border-color: #166534; border-radius: 3px; }
.cp-legend-dot--reference { background: #f59e0b; border-color: #b45309; }
.cp-legend-dot--lead { background: #7c3aed; border-color: #4c1d95; }
.cp-legend-dot--target { background: #ef4444; border-color: #991b1b; }
.cp-layout-background {
  fill: color-mix(in srgb, var(--panel-bg, #f8fafc) 96%, #9eb8d4 4%);
}
.cp-layout-grid-minor {
  stroke: color-mix(in srgb, var(--text-color, #1f2b3a) 14%, transparent);
  stroke-width: 1;
}
.cp-layout-grid-major {
  stroke: color-mix(in srgb, var(--text-color, #1f2b3a) 30%, transparent);
  stroke-width: 1.2;
}
.cp-layout-grid-label {
  fill: color-mix(in srgb, var(--text-color, #1f2b3a) 75%, #ffffff);
  font-size: 11px;
  font-weight: 600;
}
.cp-layout-structure-line {
  stroke: color-mix(in srgb, var(--text-color, #1f2b3a) 75%, #0f172a);
  stroke-width: 7;
  stroke-linecap: round;
}
.cp-layout-structure-line.is-hovered {
  stroke: color-mix(in srgb, #ef4444 78%, #7f1d1d);
  stroke-width: 10;
}
.cp-layout-segment-label {
  fill: var(--text-color, #1f2b3a);
  font-size: 14px;
  font-weight: 600;
}
.cp-layout-anode-node {
  fill: color-mix(in srgb, #2e78d8 70%, #ffffff);
  stroke: color-mix(in srgb, #2e78d8 85%, #0f172a);
  stroke-width: 2;
  cursor: grab;
}
.cp-layout-anode-label {
  fill: color-mix(in srgb, var(--text-color, #1f2b3a) 88%, #ffffff);
  font-size: 13px;
}
.cp-layout-wire {
  stroke: color-mix(in srgb, #6b7280 70%, #111827);
  stroke-width: 2;
  stroke-dasharray: 4 3;
}
.cp-layout-test-node {
  fill: color-mix(in srgb, #16a34a 72%, #ffffff);
  stroke: color-mix(in srgb, #166534 90%, #0f172a);
  stroke-width: 1.8;
  cursor: grab;
}
.cp-layout-test-label {
  fill: var(--text-color, #1f2b3a);
  font-size: 12px;
}
.cp-layout-reference-node {
  fill: color-mix(in srgb, #f59e0b 68%, #ffffff);
  stroke: color-mix(in srgb, #b45309 90%, #0f172a);
  stroke-width: 2;
  cursor: grab;
}
.cp-layout-reference-label {
  fill: var(--text-color, #1f2b3a);
  font-size: 13px;
  font-weight: 600;
}
.cp-layout-dimension {
  stroke: color-mix(in srgb, #64748b 80%, #020617);
  stroke-width: 1.8;
  stroke-dasharray: 6 5;
}
.cp-layout-dimension-label {
  fill: var(--text-color, #1f2b3a);
  font-size: 12px;
}
.cp-layout-test-lead {
  stroke: color-mix(in srgb, #7c3aed 84%, #2e1065);
  stroke-width: 2.5;
  stroke-dasharray: 6 4;
}
.cp-layout-target-ring {
  fill: none;
  stroke: color-mix(in srgb, #ef4444 78%, #450a0a);
  stroke-width: 2;
  stroke-dasharray: 4 4;
}
.cp-layout-focus-label {
  fill: color-mix(in srgb, var(--text-color, #1f2b3a) 85%, #ffffff);
  font-size: 12px;
  font-weight: 600;
}
.cp-layout-heat-zone {
  stroke-linecap: round;
  opacity: .78;
}
.cp-layout-heat-zone.is-filtered {
  opacity: .14;
}
.cp-layout-heat-zone.is-selected {
  stroke-width: 28;
  opacity: .95;
}
.cp-layout-heat-contour {
  fill: none;
  stroke: color-mix(in srgb, var(--text-color, #1f2b3a) 76%, #020617);
  stroke-linecap: round;
}
.cp-layout-heat-contour--medium {
  stroke-width: 2.4;
  stroke-dasharray: 7 6;
}
.cp-layout-heat-contour--high {
  stroke-width: 3;
  stroke-dasharray: 2 5;
}
.cp-layout-hotspot {
  cursor: pointer;
}
.cp-layout-hotspot-marker {
  fill: #ffffff;
  stroke: color-mix(in srgb, #1f2937 80%, #ffffff);
  stroke-width: 1.6;
}
.cp-layout-hotspot.is-selected .cp-layout-hotspot-marker {
  fill: color-mix(in srgb, #e6f4ff 65%, #ffffff);
  stroke-width: 2.2;
}
.cp-layout-hotspot-text {
  fill: #111827;
  font-size: 11px;
  font-weight: 700;
}
.cp-heatmap-legend,
.cp-hotspot-inspector {
  border: 1px solid var(--border-color, #7d8790);
  border-radius: 10px;
  padding: .55rem .75rem;
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 95%, #f0f7ff 5%);
}
.cp-heatmap-legend h3,
.cp-hotspot-inspector h3 {
  margin: 0 0 .35rem;
  font-size: .98rem;
}
.cp-heatmap-scale {
  height: 18px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border-color, #7d8790) 85%, #111827);
  background: linear-gradient(90deg, #0072b2 0%, #56b4e9 45%, #e69f00 72%, #d55e00 100%);
}
.cp-heatmap-contours {
  list-style: none;
  margin: .5rem 0 .25rem;
  padding: 0;
  display: grid;
  gap: .3rem;
}
.cp-heatmap-contours li {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .84rem;
}
.cp-heatmap-contour {
  width: 30px;
  border-top: 3px solid #1f2937;
}
.cp-heatmap-contour--medium {
  border-top-style: dashed;
}
.cp-heatmap-contour--high {
  border-top-style: dotted;
}
.cp-hotspot-inspector ul {
  margin: .35rem 0 0;
  padding-left: 1rem;
}
.cp-profile-header {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}
.cp-profile-toggle-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
}
.cp-profile-toggle {
  display: inline-flex;
  gap: .25rem;
  align-items: center;
  font-size: .86rem;
}
.cp-profile-grid {
  display: grid;
  gap: .65rem;
}
.cp-profile-chart {
  border: 1px solid var(--border-color, #7d8790);
  border-radius: 10px;
  padding: .6rem;
}
.cp-profile-chart h4 {
  margin: 0 0 .35rem;
  font-size: .95rem;
}
.cp-profile-chart svg {
  width: 100%;
  height: auto;
  display: block;
}
.cp-plot-frame {
  fill: color-mix(in srgb, var(--panel-bg, #f8fafc) 94%, #dbeafe 6%);
  stroke: color-mix(in srgb, var(--border-color, #7d8790) 75%, transparent);
}
.cp-band-pass { fill: color-mix(in srgb, #22c55e 16%, transparent); }
.cp-band-fail { fill: color-mix(in srgb, #ef4444 14%, transparent); }
.cp-threshold-line {
  stroke: color-mix(in srgb, #f59e0b 78%, #78350f);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
}
.cp-profile-line {
  fill: none;
  stroke-width: 2.2;
}
.cp-profile-line--base { stroke: #1d4ed8; }
.cp-profile-line--conservative { stroke: #b45309; }
.cp-profile-line--optimized { stroke: #059669; }
.cp-profile-point {
  stroke-width: 1.4;
}
.cp-profile-point--pass {
  fill: color-mix(in srgb, #22c55e 78%, #ffffff);
  stroke: color-mix(in srgb, #15803d 85%, #052e16);
}
.cp-profile-point--fail {
  fill: color-mix(in srgb, #ef4444 82%, #ffffff);
  stroke: color-mix(in srgb, #b91c1c 88%, #450a0a);
}
.cp-crosshair {
  stroke: color-mix(in srgb, #7c3aed 82%, #2e1065);
  stroke-width: 1.8;
  stroke-dasharray: 4 4;
}
.cp-axis-label {
  fill: var(--text-color, #1f2b3a);
  font-size: 12px;
}
@media (max-width: 1080px) {
  .cp-layout-workspace {
    grid-template-columns: 1fr;
  }
  .cp-layout-sidebar {
    grid-template-columns: 1fr;
  }
  .cp-measurement-panel {
    max-height: none;
  }
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border-radius: 999px;
  padding: .2rem .65rem;
  font-size: .85rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.result-badge--pass {
  background: color-mix(in srgb, #22c55e 20%, transparent);
  border-color: color-mix(in srgb, #22c55e 45%, transparent);
}
.result-badge--fail {
  background: color-mix(in srgb, #ef4444 18%, transparent);
  border-color: color-mix(in srgb, #ef4444 45%, transparent);
}
.result-badge--not-run {
  background: color-mix(in srgb, #64748b 20%, transparent);
  border-color: color-mix(in srgb, #64748b 45%, transparent);
}
.cp-compare-group {
  border: 1px solid var(--border-color, #7d8790);
  border-radius: 10px;
  padding: .75rem;
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 96%, #f5f8ff 4%);
}
.cp-compare-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .6rem;
}
.cp-compare-panel {
  display: grid;
  gap: .75rem;
}
.cp-delta-card-grid {
  display: grid;
  gap: .55rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.cp-delta-card {
  border: 1px solid var(--border-color, #7d8790);
  border-radius: 10px;
  padding: .55rem .65rem;
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 94%, #dbeafe 6%);
}
.cp-delta-card h4 {
  margin: 0 0 .15rem;
  font-size: .85rem;
}
.cp-delta-card p {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.cp-delta-card small {
  display: block;
  margin-top: .2rem;
}
.cp-compare-canvas-toolbar {
  display: flex;
  gap: .5rem;
}
.cp-compare-canvas-grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.cp-compare-canvas {
  border: 1px solid var(--border-color, #7d8790);
  border-radius: 10px;
  min-height: 260px;
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 95%, #dbeafe 5%);
  overflow: hidden;
}
.cp-compare-canvas svg {
  width: 100%;
  height: 100%;
  display: block;
}
.cp-compare-diff-segment {
  stroke: color-mix(in srgb, #ef4444 82%, #7f1d1d);
}
.cp-compare-diff-node {
  stroke: color-mix(in srgb, #ef4444 85%, #7f1d1d);
  stroke-width: 3;
}

.heattracesizing-page .heattrace-shell {
  display: grid;
  grid-template-columns: minmax(290px, 360px) minmax(0, 1fr);
  grid-template-areas: "sidebar workspace";
  gap: 1rem;
  align-items: start;
}
.heattracesizing-page .heattrace-sidebar {
  grid-area: sidebar;
  display: grid;
  gap: .75rem;
  max-height: calc(100vh - 170px);
  overflow: auto;
  padding-right: .35rem;
  position: sticky;
  top: .75rem;
}
.heattracesizing-page .heattrace-section {
  border: 1px solid var(--border-color, #7d8790);
  border-radius: 10px;
  padding: .6rem .75rem;
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 95%, transparent);
}
.heattracesizing-page .heattrace-section > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-color, #1f2b3a);
  margin-bottom: .4rem;
}
.heattracesizing-page .heattrace-section fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}
.heattracesizing-page .heattrace-content {
  grid-area: workspace;
  min-width: 0;
  display: grid;
  gap: .75rem;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.heattracesizing-page .heattrace-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  border-bottom: 1px solid var(--border-color, #7d8790);
  padding-bottom: .5rem;
}
.heattracesizing-page .heattrace-tab[role="tab"] {
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 94%, transparent);
  color: var(--text-muted, #64748b);
  border: 1px solid var(--border-color, #7d8790);
  border-radius: 999px;
  padding: .45rem .8rem;
  font-weight: 600;
  margin: 0;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.heattracesizing-page .heattrace-tab[role="tab"]:hover {
  color: var(--text-color, #1f2b3a);
  border-color: color-mix(in srgb, var(--accent-color, #2a6fd6) 40%, var(--border-color, #7d8790));
}
.heattracesizing-page .heattrace-tab[role="tab"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color, #2a6fd6) 26%, transparent);
}
.heattracesizing-page .heattrace-tab[aria-selected="true"] {
  color: var(--text-color, #1f2b3a);
  background: color-mix(in srgb, var(--accent-color, #2a6fd6) 24%, var(--panel-bg, #f8fafc));
  border-color: color-mix(in srgb, var(--accent-color, #2a6fd6) 55%, var(--border-color, #7d8790));
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--accent-color, #2a6fd6) 75%, transparent);
}
.heattracesizing-page .heattrace-panel {
  padding-bottom: 5rem;
}
.heattracesizing-page .heattrace-overview-card {
  margin-top: .9rem;
}
.heattracesizing-page .heattrace-sensitivity-card {
  margin-top: .9rem;
}
.heattracesizing-page .heattrace-sensitivity-controls {
  display: grid;
  gap: .65rem;
  margin-top: .6rem;
}
.heattracesizing-page .heattrace-sensitivity-row label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: .92rem;
  margin-bottom: .3rem;
}
.heattracesizing-page .heattrace-sensitivity-value {
  font-weight: 600;
  color: var(--text-muted, #64748b);
}
.heattracesizing-page .heattrace-sensitivity-slider {
  width: 100%;
}
.heattracesizing-page .heattrace-sensitivity-actions {
  margin-top: .65rem;
  display: flex;
  justify-content: flex-end;
}
.heattracesizing-page .heattrace-sensitivity-summary {
  margin-top: .85rem;
}
.heattracesizing-page .heattrace-sensitivity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .6rem;
}
.heattracesizing-page .heattrace-sensitivity-result {
  border: 1px solid var(--border-color, #7d8790);
  border-radius: 10px;
  padding: .65rem .75rem;
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 94%, #dbeafe 6%);
}
.heattracesizing-page .heattrace-sensitivity-result--decrease {
  border-left: 4px solid #16a34a;
}
.heattracesizing-page .heattrace-sensitivity-result--increase {
  border-left: 4px solid #dc2626;
}
.heattracesizing-page .heattrace-sensitivity-result--neutral {
  border-left: 4px solid #3b82f6;
}
.heattracesizing-page .heattrace-sensitivity-result--warning {
  border-left: 4px solid #f59e0b;
}
.heattracesizing-page .heattrace-insights {
  margin-top: .85rem;
}
.heattracesizing-page .heattrace-insights-list {
  list-style: none;
  margin: .5rem 0 0;
  padding: 0;
  display: grid;
  gap: .55rem;
}
.heattracesizing-page .heattrace-insight-item {
  border: 1px solid var(--border-color, #7d8790);
  border-radius: 10px;
  padding: .65rem .75rem;
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: center;
}
.heattracesizing-page .heattrace-insight-item p {
  margin: .2rem 0 0;
  font-size: .9rem;
}
.heattracesizing-page .heattrace-overview-visual-wrap {
  border: 1px solid var(--border-color, #7d8790);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 92%, #dbeafe 8%);
  overflow: hidden;
}
.heattracesizing-page .heattrace-overview-visual {
  width: 100%;
  min-height: 280px;
  display: block;
}
.heattracesizing-page .heattrace-overview-legend {
  list-style: none;
  margin: .75rem 0 0;
  padding: 0;
  display: grid;
  gap: .45rem;
}
.heattracesizing-page .heattrace-overview-legend li {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .95rem;
}
.heattracesizing-page .heattrace-overview-legend .legend-marker {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display: inline-block;
  flex: 0 0 auto;
}
.heattracesizing-page .heattrace-overview-legend .legend-pipe {
  background: #2563eb;
}
.heattracesizing-page .heattrace-overview-legend .legend-insulation {
  background: #64748b;
}
.heattracesizing-page .heattrace-overview-legend .legend-cable {
  background: #f97316;
}
.heattracesizing-page .heattrace-overview-legend .legend-ambient {
  background: #14b8a6;
}
.heattracesizing-page .heattrace-overview-hint {
  margin-top: .8rem;
  padding: .65rem .75rem;
  border-left: 4px solid var(--accent-color, #2a6fd6);
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 86%, #dbeafe 14%);
  border-radius: 8px;
}
.heattracesizing-page .heattrace-overview-hint p {
  margin: .25rem 0 0;
}
.heattracesizing-page .heattrace-chart-wrap {
  margin-top: .85rem;
  border: 1px solid var(--border-color, #7d8790);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 96%, #dbeafe 4%);
  overflow: hidden;
}
.heattracesizing-page .heattrace-chart-svg {
  width: 100%;
  min-height: 280px;
  display: block;
}
.heattracesizing-page .heattrace-chart-legend {
  margin: .75rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: .45rem;
}
.heattracesizing-page .heattrace-chart-legend li {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .92rem;
}
.heattracesizing-page .heattrace-chart-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex: 0 0 auto;
}
.heattracesizing-page .heattrace-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: .65rem;
}
.heattracesizing-page .heattrace-kpi-card {
  border: 1px solid var(--border-color, #7d8790);
  border-radius: 10px;
  padding: .7rem .8rem;
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 95%, #dbeafe 5%);
  display: grid;
  gap: .35rem;
}
.heattracesizing-page .heattrace-overview-card,
.heattracesizing-page .heattrace-sensitivity-card,
.heattracesizing-page .heattrace-chart-wrap,
.heattracesizing-page .heattrace-warning-card,
.heattracesizing-page .heattrace-insight-item,
.heattracesizing-page .heattrace-kpi-card {
  box-shadow: 0 1px 2px color-mix(in srgb, var(--text-color, #1f2b3a) 9%, transparent);
}
.heattracesizing-page .heattrace-kpi-card--alert {
  border-color: color-mix(in srgb, #dc2626 45%, var(--border-color, #7d8790));
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 82%, #fee2e2 18%);
}
.heattracesizing-page .heattrace-kpi-card--success {
  border-color: color-mix(in srgb, #16a34a 48%, var(--border-color, #7d8790));
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 86%, #dcfce7 14%);
}
.heattracesizing-page .heattrace-kpi-card--warning {
  border-color: color-mix(in srgb, #f59e0b 48%, var(--border-color, #7d8790));
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 86%, #fef3c7 14%);
}
.heattracesizing-page .heattrace-kpi-card--error {
  border-color: color-mix(in srgb, #dc2626 56%, var(--border-color, #7d8790));
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 82%, #fee2e2 18%);
}
.heattracesizing-page .heattrace-kpi-label {
  margin: 0;
  font-size: .84rem;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: .02em;
}
.heattracesizing-page .heattrace-kpi-value {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-color, #1f2b3a);
}
.heattracesizing-page .heattrace-kpi-context {
  margin: 0;
  font-size: .88rem;
}
.heattracesizing-page .heattrace-warning-grid {
  display: grid;
  gap: .6rem;
}
.heattracesizing-page .heattrace-warning-card {
  border-radius: 10px;
  padding: .65rem .75rem;
  border: 1px solid var(--border-color, #7d8790);
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 94%, #f1f5f9 6%);
}
.heattracesizing-page .heattrace-warning-card--warning {
  border-left: 4px solid #f59e0b;
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 82%, #fef3c7 18%);
}
.heattracesizing-page .heattrace-warning-card--error {
  border-left: 4px solid #dc2626;
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 80%, #fee2e2 20%);
}
.heattracesizing-page .heattrace-warning-card--info {
  border-left: 4px solid #3b82f6;
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 86%, #dbeafe 14%);
}
.heattracesizing-page .heattrace-warning-card--success {
  border-left: 4px solid #16a34a;
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 86%, #dcfce7 14%);
}
.heattracesizing-page .heattrace-warning-severity {
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text-muted, #64748b);
  margin-bottom: .2rem;
}
.heattracesizing-page .heattrace-warning-message {
  margin: 0;
}
.heattracesizing-page .heattrace-action-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: .65rem;
  padding: .65rem;
  border: 1px solid var(--border-color, #7d8790);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 92%, #dbeafe 8%);
}
.heattracesizing-page .heattrace-action-bar .primary-btn {
  width: auto;
  min-width: 180px;
  margin: 0;
}
.heattracesizing-page #heattrace-save-action {
  min-width: 140px;
}
@media (max-width: 980px) {
  .heattracesizing-page .heattrace-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "sidebar"
      "workspace";
  }
  .heattracesizing-page .heattrace-sidebar {
    max-height: none;
    overflow: visible;
    padding-right: 0;
    position: static;
  }
}
@media (max-width: 720px) {
  .heattracesizing-page .heattrace-tabs {
    gap: .35rem;
    border-bottom: 0;
    padding-bottom: 0;
  }
  .heattracesizing-page .heattrace-tab[role="tab"] {
    flex: 1 1 calc(50% - .35rem);
    justify-content: center;
  }
  .heattracesizing-page .heattrace-kpi-grid {
    grid-template-columns: 1fr;
  }
}
body.dark-mode .heattracesizing-page .heattrace-tab[role="tab"] {
  background: color-mix(in srgb, var(--panel-bg, #111827) 85%, #020617 15%);
  color: color-mix(in srgb, var(--text-color, #e5e7eb) 80%, #94a3b8 20%);
}
body.dark-mode .heattracesizing-page .heattrace-tab[aria-selected="true"] {
  color: var(--text-color, #e5e7eb);
}
body.dark-mode .heattracesizing-page .heattrace-overview-card,
body.dark-mode .heattracesizing-page .heattrace-sensitivity-card,
body.dark-mode .heattracesizing-page .heattrace-chart-wrap,
body.dark-mode .heattracesizing-page .heattrace-warning-card,
body.dark-mode .heattracesizing-page .heattrace-insight-item,
body.dark-mode .heattracesizing-page .heattrace-kpi-card {
  box-shadow: 0 1px 2px rgba(2, 6, 23, .42);
}
body.compact-mode .heattracesizing-page .heattrace-shell {
  gap: .7rem;
}
body.compact-mode .heattracesizing-page .heattrace-section,
body.compact-mode .heattracesizing-page .heattrace-kpi-card,
body.compact-mode .heattracesizing-page .heattrace-warning-card,
body.compact-mode .heattracesizing-page .heattrace-insight-item {
  padding: .55rem .65rem;
}
body.compact-mode .heattracesizing-page .heattrace-tab[role="tab"] {
  padding: .35rem .65rem;
  font-size: .88rem;
}
@media print {
  .heattracesizing-page .heattrace-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "sidebar"
      "workspace";
    gap: .6rem;
  }
  .heattracesizing-page .heattrace-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .heattracesizing-page .heattrace-action-bar {
    position: static;
  }
}

/* Heat Trace dashboard refresh */
body.heattracesizing-page {
  --ht-bg: #f6f8fc;
  --ht-card: #ffffff;
  --ht-line: #e4e9f2;
  --ht-line-strong: #d5ddea;
  --ht-blue: #1268f3;
  --ht-blue-soft: #eaf2ff;
  --ht-text: #111827;
  --ht-muted: #667085;
  --ht-green: #208a55;
  --ht-green-bg: #f0fbf5;
  --ht-amber: #b7791f;
  --ht-amber-bg: #fff8e7;
  background:
    radial-gradient(circle at 26% -10%, rgba(18, 104, 243, .09), transparent 30rem),
    linear-gradient(180deg, #fbfcff 0%, var(--ht-bg) 52%, #f2f5fa 100%);
  color: var(--ht-text);
}
.heattracesizing-page .container {
  max-width: none;
  padding: 0 1.35rem 1rem;
}
.heattracesizing-page .main-content {
  padding-top: .9rem;
}
.heattracesizing-page .heattrace-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 .9rem;
}
.heattracesizing-page .heattrace-title-lockup {
  display: flex;
  align-items: center;
  gap: .85rem;
}
.heattracesizing-page .heattrace-title-lockup h1 {
  margin: 0;
  color: var(--ht-text);
  font-size: clamp(1.55rem, 1.7vw, 2.1rem);
  line-height: 1.1;
  letter-spacing: -.035em;
}
.heattracesizing-page .heattrace-title-lockup p {
  margin: .25rem 0 0;
  color: var(--ht-muted);
  font-size: .98rem;
}
.heattracesizing-page .heattrace-title-icon {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--ht-line);
  box-shadow: 0 8px 22px rgba(17, 24, 39, .06);
  position: relative;
}
.heattracesizing-page .heattrace-title-icon::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 10px;
  bottom: 13px;
  height: 11px;
  border: 4px solid var(--ht-blue);
  border-left-width: 5px;
  border-radius: 8px 14px 14px 8px;
}
.heattracesizing-page .heattrace-title-icon span {
  position: absolute;
  top: 10px;
  width: 6px;
  height: 24px;
  border-left: 3px solid var(--ht-blue);
  border-radius: 999px;
}
.heattracesizing-page .heattrace-title-icon span:nth-child(1) { left: 14px; transform: skewX(-18deg); }
.heattracesizing-page .heattrace-title-icon span:nth-child(2) { left: 24px; transform: skewX(-8deg); }
.heattracesizing-page .heattrace-title-icon span:nth-child(3) { left: 34px; transform: skewX(10deg); }
.heattracesizing-page .heattrace-header-actions {
  display: flex;
  gap: .45rem;
  align-items: center;
}
.heattracesizing-page .heattrace-share-action,
.heattracesizing-page .heattrace-more-action {
  border-color: var(--ht-line);
  background: #fff;
  color: var(--ht-blue);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
}
.heattracesizing-page .heattrace-more-action {
  width: 42px;
  min-width: 42px;
  padding-inline: 0;
  color: var(--ht-muted);
  letter-spacing: .12em;
}
.heattracesizing-page .heattrace-shell {
  grid-template-columns: minmax(320px, 392px) minmax(0, 1fr);
  gap: 0;
  border: 1px solid var(--ht-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 18px 55px rgba(31, 41, 55, .08);
  overflow: hidden;
}
.heattracesizing-page .heattrace-sidebar {
  max-height: calc(100vh - 145px);
  padding: 0;
  gap: 0;
  background: #f7f9fd;
  border-right: 1px solid var(--ht-line);
  scrollbar-width: thin;
}
.heattracesizing-page .heattrace-sidebar-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
  border-bottom: 1px solid var(--ht-line);
  position: sticky;
  top: 0;
  z-index: 3;
}
.heattracesizing-page .heattrace-sidebar-tabs button {
  margin: 0;
  padding: 1rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #6b7280;
  font-weight: 700;
}
.heattracesizing-page .heattrace-sidebar-tabs button.active {
  color: var(--ht-blue);
  box-shadow: inset 0 -3px 0 var(--ht-blue);
}
.heattracesizing-page .heattrace-input-sections[hidden],
.heattracesizing-page .heattrace-assumptions-section[hidden] {
  display: none;
}
.heattracesizing-page .heattrace-section {
  border: 0;
  border-bottom: 1px solid var(--ht-line);
  border-radius: 0;
  padding: .92rem .95rem 1rem;
  background: transparent;
}
.heattracesizing-page .heattrace-assumptions-section:not([open]) {
  display: none;
}
.heattracesizing-page .heattrace-section > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 .7rem;
  color: var(--ht-text);
  font-size: .96rem;
  list-style: none;
}
.heattracesizing-page .heattrace-section > summary::-webkit-details-marker {
  display: none;
}
.heattracesizing-page .heattrace-section > summary::after {
  content: "^";
  color: #111827;
  font-size: .9rem;
}
.heattracesizing-page .heattrace-section:not([open]) > summary::after {
  content: "v";
}
.heattracesizing-page .heattrace-section fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: .85rem;
  row-gap: .75rem;
}
.heattracesizing-page .heattrace-section .field-row {
  margin: 0;
}
.heattracesizing-page .heattrace-section .heattrace-full-field,
.heattracesizing-page .heattrace-section .heattrace-buried-field {
  grid-column: 1 / -1;
}
.heattracesizing-page .heattrace-buried-field[hidden] {
  display: none;
}
.heattracesizing-page .heattrace-section label {
  color: #344054;
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: .35rem;
}
.heattracesizing-page .heattrace-section input,
.heattracesizing-page .heattrace-section select {
  height: 38px;
  border: 1px solid var(--ht-line-strong);
  border-radius: 6px;
  background: #fff;
  color: #344054;
  box-shadow: 0 1px 0 rgba(17, 24, 39, .02);
}
.heattracesizing-page .heattrace-section .field-hint {
  display: none;
}
.heattracesizing-page .heattrace-content {
  gap: 0;
  background: #fff;
  min-height: calc(100vh - 145px);
}
.heattracesizing-page .heattrace-workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 58px;
  padding: 0 1.1rem;
  border-bottom: 1px solid var(--ht-line);
  background: #fff;
}
.heattracesizing-page .heattrace-tabs {
  border: 0;
  padding: 0;
  gap: 1.3rem;
}
.heattracesizing-page .heattrace-tab[role="tab"] {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #667085;
  padding: 1.15rem .35rem 1.05rem;
  box-shadow: none;
}
.heattracesizing-page .heattrace-tab[aria-selected="true"] {
  color: var(--ht-blue);
  background: transparent;
  box-shadow: inset 0 -3px 0 var(--ht-blue);
}
.heattracesizing-page .heattrace-warning-toggle {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: #667085;
  font-size: .9rem;
  white-space: nowrap;
}
.heattracesizing-page .heattrace-warning-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.heattracesizing-page .heattrace-switch {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #c6cfdd;
  position: relative;
  transition: background .18s ease;
}
.heattracesizing-page .heattrace-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(17, 24, 39, .22);
  transition: transform .18s ease;
}
.heattracesizing-page .heattrace-warning-toggle input:checked + .heattrace-switch {
  background: var(--ht-blue);
}
.heattracesizing-page .heattrace-warning-toggle input:checked + .heattrace-switch::after {
  transform: translateX(18px);
}
.heattracesizing-page .heattrace-panel {
  padding: .95rem 1rem 5rem;
}
.heattracesizing-page .heattrace-overview-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.22fr) minmax(430px, 1fr) minmax(250px, .74fr);
  grid-template-areas:
    "overview results results"
    "routing routing sensitivity"
    "temperature breakdown sensitivity";
  gap: .9rem;
}
.heattracesizing-page .heattrace-dashboard-card {
  border: 1px solid var(--ht-line);
  border-radius: 9px;
  background: var(--ht-card);
  box-shadow: none;
  padding: 1rem;
  min-width: 0;
}
.heattracesizing-page .heattrace-overview-card { grid-area: overview; }
.heattracesizing-page .heattrace-results-card { grid-area: results; }
.heattracesizing-page .heattrace-routing-card { grid-area: routing; }
.heattracesizing-page .heattrace-temperature-card { grid-area: temperature; }
.heattracesizing-page .heattrace-breakdown-card { grid-area: breakdown; }
.heattracesizing-page .heattrace-sensitivity-card { grid-area: sensitivity; }
.heattracesizing-page .heattrace-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .85rem;
}
.heattracesizing-page .heattrace-card-heading h2,
.heattracesizing-page .heattrace-dashboard-card h2 {
  margin: 0;
  color: var(--ht-text);
  font-size: 1rem;
  letter-spacing: -.015em;
}
.heattracesizing-page .heattrace-card-heading p {
  margin: .18rem 0 0;
  color: var(--ht-blue);
  font-size: .72rem;
}
.heattracesizing-page .heattrace-card-heading--stacked {
  align-items: center;
}
.heattracesizing-page .heattrace-help-link {
  border: 0;
  background: transparent;
  color: var(--ht-blue);
  font-weight: 700;
  font-size: .75rem;
  padding: 0;
}
.heattracesizing-page .heattrace-small-action {
  padding: .38rem .55rem;
  min-width: auto;
  font-size: .72rem;
}
.heattracesizing-page .heattrace-overview-visual-wrap,
.heattracesizing-page .heattrace-chart-wrap {
  border: 0;
  border-radius: 0;
  background: transparent;
  margin: 0;
}
.heattracesizing-page .heattrace-overview-visual-wrap {
  position: relative;
}
.heattracesizing-page .heattrace-overview-visual {
  height: clamp(290px, 25vw, 360px);
  min-height: 290px;
  object-fit: contain;
  border: 1px solid #d8e3f3;
  border-radius: 12px;
  background: #f8fbff;
}
.heattracesizing-page .heattrace-routing-visual-wrap {
  border: 1px solid #d8e3f3;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff 0%, #f1f7ff 100%);
  overflow: hidden;
}
.heattracesizing-page .heattrace-routing-visual {
  display: block;
  width: 100%;
  min-height: 360px;
}
.heattracesizing-page .heattrace-image-callouts {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.heattracesizing-page .heattrace-image-callout {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  max-width: 150px;
  color: #0f172a;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1.1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .88);
}
.heattracesizing-page .heattrace-image-callout strong {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--ht-blue);
  box-shadow: 0 8px 18px rgba(18, 104, 243, .28);
  color: #fff;
  flex: 0 0 auto;
  font-size: .78rem;
}
.heattracesizing-page .heattrace-image-callout em {
  border: 1px solid rgba(18, 104, 243, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 7px 18px rgba(15, 23, 42, .08);
  font-style: normal;
  padding: .24rem .45rem;
}
.heattracesizing-page .heattrace-image-callout--pipe {
  left: 10%;
  top: 47%;
}
.heattracesizing-page .heattrace-image-callout--insulation {
  left: 48%;
  top: 34%;
}
.heattracesizing-page .heattrace-image-callout--cable {
  left: 54%;
  top: 68%;
}
.heattracesizing-page .heattrace-image-callout--ambient {
  right: 7%;
  top: 50%;
}
.heattracesizing-page .heattrace-chart-svg {
  min-height: 245px;
}
.heattracesizing-page .heattrace-overview-legend {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem 1rem;
  margin: .55rem 0 0;
}
.heattracesizing-page .heattrace-pipe-anatomy {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem;
  margin: .75rem 0 .55rem;
}
.heattracesizing-page .heattrace-pipe-anatomy span {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-height: 38px;
  border: 1px solid #d7e5f8;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f7faff);
  color: #475467;
  font-size: .78rem;
  font-weight: 700;
  padding: .45rem .55rem;
}
.heattracesizing-page .heattrace-pipe-anatomy strong {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ht-blue);
  color: #fff;
  font-size: .7rem;
  flex: 0 0 auto;
}
.heattracesizing-page .heattrace-overview-legend li {
  color: #475467;
  font-size: .82rem;
}
.heattracesizing-page .legend-number {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ht-blue);
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  flex: 0 0 auto;
}
.heattracesizing-page .legend-component-symbol {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 2px solid var(--component-color, #f59e0b);
  border-radius: 6px;
  background: var(--component-fill, #fef3c7);
  color: var(--component-color, #f59e0b);
  font-size: .68rem;
  font-weight: 900;
  flex: 0 0 auto;
}
.heattracesizing-page .heattrace-overview-hint {
  margin-top: .75rem;
  padding: .62rem .75rem;
  border: 1px solid #cfe0fb;
  border-left: 0;
  background: #f4f8ff;
  color: #61738b;
  font-size: .8rem;
}
.heattracesizing-page .heattrace-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .8rem;
}
.heattracesizing-page .heattrace-kpi-card {
  padding: .95rem .85rem;
  border: 1px solid var(--ht-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  gap: .42rem;
}
.heattracesizing-page .heattrace-kpi-label {
  color: #111827;
  text-transform: none;
  letter-spacing: 0;
  font-size: .78rem;
  font-weight: 800;
}
.heattracesizing-page .heattrace-kpi-value {
  color: var(--ht-blue);
  font-size: clamp(1.35rem, 2.1vw, 2rem);
  line-height: 1.05;
}
.heattracesizing-page .heattrace-kpi-context {
  color: #667085;
  font-size: .78rem;
  min-height: 2.2em;
}
.heattracesizing-page .heattrace-kpi-card a {
  color: var(--ht-blue);
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
  margin-top: .45rem;
}
.heattracesizing-page .heattrace-kpi-card a::after {
  content: " ->";
}
.heattracesizing-page .heattrace-kpi-card--alert {
  border-color: #f7c56b;
  background: #fffaf0;
}
.heattracesizing-page .heattrace-status-banner {
  display: flex;
  gap: .8rem;
  align-items: center;
  margin-top: 1.35rem;
  border-radius: 8px;
  padding: .95rem 1rem;
  border: 1px solid #93d3af;
  background: var(--ht-green-bg);
  color: #2a6a45;
}
.heattracesizing-page .heattrace-status-banner p {
  margin: .18rem 0 0;
  color: #5c7567;
  font-size: .84rem;
}
.heattracesizing-page .heattrace-status-banner--warning {
  background: var(--ht-amber-bg);
  border-color: #f2ce7d;
  color: #8a5a0a;
}
.heattracesizing-page .heattrace-status-banner--error {
  background: #fff1f2;
  border-color: #f4a3ad;
  color: #b42318;
}
.heattracesizing-page .heattrace-status-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-weight: 800;
  flex: 0 0 auto;
}
.heattracesizing-page .heattrace-inline-legend,
.heattracesizing-page .heattrace-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.3rem;
  margin: 0 0 .55rem;
}
.heattracesizing-page .heattrace-chart-legend li {
  color: #667085;
  font-size: .75rem;
}
.heattracesizing-page .heattrace-chart-swatch {
  width: 9px;
  height: 9px;
}
.heattracesizing-page .heattrace-donut-layout {
  display: grid;
  grid-template-columns: minmax(200px, 1.1fr) minmax(170px, .9fr);
  align-items: center;
  gap: .7rem;
}
.heattracesizing-page .heattrace-card-note {
  border-top: 1px solid var(--ht-line);
  color: #8a98aa;
  font-size: .78rem;
  margin: .7rem 0 0;
  padding-top: .62rem;
}
.heattracesizing-page .heattrace-sensitivity-controls {
  gap: .56rem;
  margin-top: .1rem;
}
.heattracesizing-page .heattrace-sensitivity-row label {
  color: #475467;
  font-size: .75rem;
}
.heattracesizing-page .heattrace-sensitivity-control-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  gap: .45rem;
  align-items: center;
}
.heattracesizing-page .heattrace-sensitivity-slider {
  accent-color: var(--ht-blue);
}
.heattracesizing-page .heattrace-sensitivity-number {
  height: 28px;
  border: 1px solid var(--ht-line-strong);
  border-radius: 6px;
  color: #344054;
  font-size: .78rem;
  font-weight: 700;
  padding: 0 .35rem;
  text-align: right;
}
.heattracesizing-page .heattrace-sensitivity-grid {
  display: none;
}
.heattracesizing-page .heattrace-insights,
.heattracesizing-page .heattrace-side-warnings {
  margin-top: .75rem;
  border: 1px solid #cfe0fb;
  border-radius: 7px;
  background: #f4f8ff;
  padding: .75rem;
}
.heattracesizing-page .heattrace-side-warnings {
  border-color: #f2ce7d;
  background: #fff8e7;
}
.heattracesizing-page .heattrace-insights h3,
.heattracesizing-page .heattrace-side-warnings h3 {
  margin: 0 0 .4rem;
  color: var(--ht-blue);
  font-size: .8rem;
}
.heattracesizing-page .heattrace-side-warnings h3 {
  color: var(--ht-amber);
}
.heattracesizing-page .heattrace-insight-item,
.heattracesizing-page .heattrace-warning-card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
}
.heattracesizing-page .heattrace-insight-item {
  display: grid;
  gap: .45rem;
  color: #475467;
}
.heattracesizing-page .heattrace-insight-item .btn {
  justify-self: start;
  min-width: auto;
  padding: .25rem .45rem;
  font-size: .72rem;
}
.heattracesizing-page .heattrace-warning-grid {
  gap: .55rem;
}
.heattracesizing-page .heattrace-warning-severity {
  color: inherit;
}
.heattracesizing-page .heattrace-warning-message {
  color: #6d4e08;
  font-size: .78rem;
}
.heattracesizing-page .heattrace-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .7rem;
  margin-top: .9rem;
}
.heattracesizing-page .heattrace-detail-item {
  border: 1px solid var(--ht-line);
  border-radius: 8px;
  background: #fff;
  padding: .85rem;
}
.heattracesizing-page .heattrace-detail-item span {
  display: block;
  color: #667085;
  font-size: .78rem;
}
.heattracesizing-page .heattrace-detail-item strong {
  display: block;
  margin-top: .25rem;
  color: var(--ht-text);
}
.heattracesizing-page .heattrace-explainer {
  color: #475467;
  max-width: 78ch;
}
.heattracesizing-page .heattrace-circuit-list-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
}
.heattracesizing-page .heattrace-component-allowance-rows {
  grid-column: 1 / -1;
  display: grid;
  gap: .65rem;
}
.heattracesizing-page .heattrace-component-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(80px, .6fr) minmax(120px, .85fr) minmax(120px, 1fr) auto;
  gap: .55rem;
  align-items: end;
  border: 1px solid var(--ht-line);
  border-radius: 10px;
  padding: .65rem;
  background: #fff;
}
.heattracesizing-page .heattrace-component-row .field-row {
  margin: 0;
}
.heattracesizing-page .heattrace-component-row label {
  font-size: .74rem;
}
.heattracesizing-page .heattrace-component-remove {
  min-width: auto;
  padding: .48rem .65rem;
}
.heattracesizing-page .heattrace-component-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .6rem;
}
.heattracesizing-page .heattrace-circuit-case-list {
  grid-column: 1 / -1;
  display: grid;
  gap: .55rem;
}
.heattracesizing-page .heattrace-section .heattrace-circuit-empty {
  display: block;
  margin: 0;
}
.heattracesizing-page .heattrace-circuit-case-total,
.heattracesizing-page .heattrace-circuit-case-item {
  border: 1px solid var(--ht-line);
  border-radius: 8px;
  background: #fff;
  padding: .55rem .65rem;
}
.heattracesizing-page .heattrace-circuit-case-total {
  color: #475467;
  display: grid;
  gap: .15rem;
}
.heattracesizing-page .heattrace-circuit-case-total small {
  color: #667085;
  font-size: .75rem;
}
.heattracesizing-page .heattrace-circuit-case-total strong {
  color: var(--ht-text);
}
.heattracesizing-page .heattrace-circuit-case-table-wrap {
  overflow-x: auto;
}
.heattracesizing-page .heattrace-circuit-case-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
.heattracesizing-page .heattrace-circuit-case-table th,
.heattracesizing-page .heattrace-circuit-case-table td {
  border-bottom: 1px solid var(--ht-line);
  padding: .5rem;
  text-align: left;
  vertical-align: top;
}
.heattracesizing-page .heattrace-circuit-case-table th {
  color: #475467;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.heattracesizing-page .heattrace-circuit-case-row.is-editing {
  background: #eff6ff;
  box-shadow: inset 3px 0 0 var(--ht-blue);
}
.heattracesizing-page .heattrace-circuit-case-table td span {
  display: block;
  color: #667085;
  font-size: .78rem;
}
.heattracesizing-page .heattrace-branch-status {
  display: inline-flex;
  border-radius: 999px;
  padding: .2rem .45rem;
  background: #e8f5ee;
  color: #167447;
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
}
.heattracesizing-page .heattrace-branch-status--warning {
  background: #fff6df;
  color: #936500;
}
.heattracesizing-page .heattrace-branch-status--overLimit,
.heattracesizing-page .heattrace-branch-status--invalid {
  background: #ffe8e8;
  color: #b42318;
}
.heattracesizing-page .heattrace-circuit-case-items {
  display: grid;
  gap: .5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.heattracesizing-page .heattrace-circuit-case-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .5rem;
  align-items: center;
}
.heattracesizing-page .heattrace-circuit-case-item.is-editing {
  border-color: var(--ht-blue);
  background: #eff6ff;
  box-shadow: inset 3px 0 0 var(--ht-blue);
}
.heattracesizing-page .heattrace-circuit-case-item strong,
.heattracesizing-page .heattrace-circuit-case-item span {
  display: block;
}
.heattracesizing-page .heattrace-circuit-case-item span {
  color: #667085;
  font-size: .78rem;
}
.heattracesizing-page .heattrace-circuit-case-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .35rem;
}
.heattracesizing-page .heattrace-circuit-case-actions .btn {
  min-width: auto;
  padding: .32rem .5rem;
  font-size: .75rem;
}
.heattracesizing-page .heattrace-circuit-update-active {
  border-color: var(--ht-blue);
  background: var(--ht-blue);
  color: #fff;
}
.heattracesizing-page .heattrace-report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .85rem 0;
}
.heattracesizing-page .heattrace-report-preview {
  border: 1px solid var(--ht-line);
  border-radius: 12px;
  background: #fff;
  padding: 1rem;
}
.heattracesizing-page .heattrace-report-document .report-section {
  border-top: 1px solid var(--ht-line);
  padding: 1rem 0;
}
.heattracesizing-page .heattrace-report-document .report-dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .4rem .9rem;
}
.heattracesizing-page .heattrace-report-document .report-dl dt {
  color: #667085;
  font-weight: 700;
}
.heattracesizing-page .heattrace-report-document .report-dl dd {
  margin: 0;
  color: var(--ht-text);
  font-weight: 800;
}
.heattracesizing-page .heattrace-report-document .report-table {
  width: 100%;
  border-collapse: collapse;
}
.heattracesizing-page .heattrace-report-document .report-table th,
.heattracesizing-page .heattrace-report-document .report-table td {
  border-bottom: 1px solid var(--ht-line);
  padding: .45rem;
  text-align: left;
  vertical-align: top;
}
.heattracesizing-page .heattrace-report-document .report-scroll {
  overflow-x: auto;
}
.heattracesizing-page .heattrace-report-document .report-note,
.heattracesizing-page .heattrace-report-document .report-meta,
.heattracesizing-page .heattrace-report-document .report-empty {
  color: #667085;
}
.heattracesizing-page .heattrace-action-bar {
  border: 1px solid var(--ht-line);
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
  justify-content: space-between;
  align-items: center;
  padding: .7rem 1rem;
  z-index: 4;
}
.heattracesizing-page .heattrace-footer-meta,
.heattracesizing-page .heattrace-footer-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.heattracesizing-page .heattrace-footer-meta {
  color: #667085;
  font-size: .78rem;
}
.heattracesizing-page .heattrace-footer-meta strong {
  color: #344054;
}
.heattracesizing-page .heattrace-footer-actions {
  gap: .55rem;
}
.heattracesizing-page .heattrace-action-bar .primary-btn {
  min-width: 230px;
  background: var(--ht-blue);
  border-radius: 6px;
}
.heattracesizing-page #heattrace-save-action {
  min-width: 230px;
  border-color: var(--ht-line);
  background: #fff;
  color: var(--ht-blue);
  font-weight: 700;
}
.heattracesizing-page .heattrace-warnings-only .heattrace-overview-card,
.heattracesizing-page .heattrace-warnings-only .heattrace-routing-card,
.heattracesizing-page .heattrace-warnings-only .heattrace-temperature-card,
.heattracesizing-page .heattrace-warnings-only .heattrace-breakdown-card,
.heattracesizing-page .heattrace-warnings-only .heattrace-insights {
  display: none;
}
.heattracesizing-page .heattrace-warnings-only .heattrace-overview-grid {
  grid-template-columns: minmax(0, 1fr) minmax(280px, .42fr);
  grid-template-areas: "results sensitivity";
}
body.dark-mode.heattracesizing-page {
  --ht-bg: #0f172a;
  --ht-card: #111827;
  --ht-line: #263449;
  --ht-line-strong: #344258;
  --ht-text: #f8fafc;
  --ht-muted: #a7b0c0;
  background: #0f172a;
}
body.dark-mode.heattracesizing-page .heattrace-shell,
body.dark-mode.heattracesizing-page .heattrace-content,
body.dark-mode.heattracesizing-page .heattrace-workspace-toolbar,
body.dark-mode.heattracesizing-page .heattrace-sidebar-tabs,
body.dark-mode.heattracesizing-page .heattrace-dashboard-card,
body.dark-mode.heattracesizing-page .heattrace-kpi-card,
body.dark-mode.heattracesizing-page .heattrace-action-bar {
  background: #111827;
}
body.dark-mode.heattracesizing-page .heattrace-sidebar {
  background: #0b1220;
}
body.dark-mode.heattracesizing-page .heattrace-section input,
body.dark-mode.heattracesizing-page .heattrace-section select,
body.dark-mode.heattracesizing-page .heattrace-sensitivity-number {
  background: #0f172a;
  color: #f8fafc;
}
body.dark-mode.heattracesizing-page .heattrace-circuit-case-total,
body.dark-mode.heattracesizing-page .heattrace-circuit-case-item,
body.dark-mode.heattracesizing-page .heattrace-component-row,
body.dark-mode.heattracesizing-page .heattrace-detail-item,
body.dark-mode.heattracesizing-page .heattrace-report-preview {
  background: #0f172a;
}
body.dark-mode.heattracesizing-page .heattrace-circuit-case-row.is-editing {
  background: #172554;
}
body.dark-mode.heattracesizing-page .heattrace-circuit-case-item.is-editing {
  background: #172554;
}
body.dark-mode.heattracesizing-page .heattrace-image-callout {
  color: #f8fafc;
  text-shadow: 0 1px 0 rgba(15, 23, 42, .8);
}
body.dark-mode.heattracesizing-page .heattrace-image-callout em {
  background: rgba(15, 23, 42, .86);
  color: #f8fafc;
}
@media (max-width: 1280px) {
  .heattracesizing-page .heattrace-overview-grid {
    grid-template-columns: minmax(0, 1fr) minmax(280px, .55fr);
    grid-template-areas:
      "overview results"
      "routing sensitivity"
      "temperature sensitivity"
      "breakdown sensitivity";
  }
  .heattracesizing-page .heattrace-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 980px) {
  .heattracesizing-page .container {
    padding: 0 .75rem .8rem;
  }
  .heattracesizing-page .heattrace-shell {
    grid-template-columns: 1fr;
  }
  .heattracesizing-page .heattrace-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--ht-line);
    max-height: none;
  }
  .heattracesizing-page .heattrace-overview-grid,
  .heattracesizing-page .heattrace-warnings-only .heattrace-overview-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "overview"
      "results"
      "routing"
      "temperature"
      "breakdown"
      "sensitivity";
  }
}
@media (max-width: 720px) {
  .heattracesizing-page .heattrace-image-callout em {
    display: none;
  }
  .heattracesizing-page .heattrace-circuit-case-item {
    grid-template-columns: 1fr;
  }
  .heattracesizing-page .heattrace-circuit-case-actions {
    justify-content: flex-start;
  }
  .heattracesizing-page .heattrace-component-row,
  .heattracesizing-page .heattrace-component-actions {
    grid-template-columns: 1fr;
  }
  .heattracesizing-page .heattrace-hero,
  .heattracesizing-page .heattrace-workspace-toolbar,
  .heattracesizing-page .heattrace-action-bar,
  .heattracesizing-page .heattrace-footer-meta,
  .heattracesizing-page .heattrace-footer-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .heattracesizing-page .heattrace-tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .heattracesizing-page .heattrace-tab[role="tab"] {
    flex: 0 0 auto;
  }
  .heattracesizing-page .heattrace-section fieldset,
  .heattracesizing-page .heattrace-kpi-grid,
  .heattracesizing-page .heattrace-donut-layout {
    grid-template-columns: 1fr;
  }
  .heattracesizing-page .heattrace-action-bar .primary-btn,
  .heattracesizing-page #heattrace-save-action {
    width: 100%;
    min-width: 0;
  }
}

/* ============================================================
   Study Basis Panel (Calculation Basis collapsible drawer)
   ============================================================ */

.study-basis-panel {
  border: 1px solid var(--border, #d1d5db);
  border-radius: 6px;
  background: var(--surface-2, #f9fafb);
}

.study-basis-panel__summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  list-style: none;
  font-size: 0.875rem;
  user-select: none;
}

.study-basis-panel__summary::-webkit-details-marker { display: none; }

.study-basis-panel__title {
  font-weight: 600;
  color: var(--text, #111827);
}

.study-basis-panel__standard {
  color: var(--text-muted, #6b7280);
  font-size: 0.8rem;
}

.study-basis-panel__body {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border, #d1d5db);
}

.study-basis__section { margin-bottom: 0.75rem; }
.study-basis__section h4 {
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0 0 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #6b7280);
}

.study-basis__list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.85rem;
  line-height: 1.55;
}

.study-basis__list--code {
  list-style: none;
  padding-left: 0;
}
.study-basis__list--code li { font-family: var(--font-mono, monospace); }
.study-basis__list--code code {
  background: var(--surface-1, #f3f4f6);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.83em;
}

.study-basis__list--warn li::marker { content: "⚠ "; color: #d97706; }

.study-basis__benchmark-link {
  font-size: 0.82rem;
  margin-top: 0.5rem;
}

/* Dark-mode overrides */
body.dark-mode .study-basis-panel {
  border-color: #374151;
  background: #1f2937;
}
body.dark-mode .study-basis-panel__body { border-top-color: #374151; }
body.dark-mode .study-basis__list--code code { background: #111827; }

/* ============================================================
   Validation & Standards page
   ============================================================ */

.kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.kpi-card {
  flex: 1 1 120px;
  background: var(--surface-2, #f9fafb);
  border: 1px solid var(--border, #d1d5db);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  text-align: center;
}

.kpi-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary, #2563eb);
  line-height: 1.2;
}

.kpi-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted, #6b7280);
  margin-top: 0.2rem;
}

.validation-item {
  border: 1px solid var(--border, #d1d5db);
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.validation-item__summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  list-style: none;
  font-size: 0.9rem;
  user-select: none;
}
.validation-item__summary::-webkit-details-marker { display: none; }

.validation-item__name {
  flex: 1;
  font-weight: 600;
  color: var(--text, #111827);
}

.validation-item__link {
  font-size: 0.78rem;
  white-space: nowrap;
}

.validation-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.35rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 999px;
  background: var(--surface-2, #f8fafc);
  color: var(--text-muted, #6b7280);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.validation-status-badge--scope-defined,
.validation-status-badge--supported {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}

.validation-status-badge--partial {
  border-color: #fde68a;
  background: #fef3c7;
  color: #92400e;
}

.validation-status-badge--screening {
  border-color: #bfdbfe;
  background: #dbeafe;
  color: #1d4ed8;
}

.validation-status-badge--not-supported {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
}

.validation-item__body {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border, #d1d5db);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Dark-mode overrides */
body.dark-mode .kpi-card,
body.dark-mode .validation-item {
  border-color: #374151;
  background: #1f2937;
}
body.dark-mode .kpi-value { color: #60a5fa; }
body.dark-mode .validation-item__name { color: #f9fafb; }
body.dark-mode .validation-item__body { border-top-color: #374151; }
body.dark-mode .validation-status-badge--scope-defined,
body.dark-mode .validation-status-badge--supported { background: #052e16; border-color: #15803d; color: #bbf7d0; }
body.dark-mode .validation-status-badge--partial { background: #451a03; border-color: #b45309; color: #fde68a; }
body.dark-mode .validation-status-badge--screening { background: #172554; border-color: #2563eb; color: #bfdbfe; }
body.dark-mode .validation-status-badge--not-supported { background: #450a0a; border-color: #b91c1c; color: #fecaca; }

/* ============================================================
   Hazardous Area Classification visual layout
   ============================================================ */

.hazarea-page .haz-map-panel {
  border: 1px solid var(--border, #d1d5db);
  background: var(--surface-2, #f8fafc);
}

.haz-map-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.haz-map-panel__header h2 {
  margin: 0 0 0.25rem;
}

.haz-map-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(5.5rem, 1fr));
  gap: 0.5rem;
  min-width: min(100%, 28rem);
}

.haz-map-chip {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 3.4rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 6px;
  background: var(--card-bg, #ffffff);
  color: var(--text, #111827);
  font-size: 0.76rem;
  line-height: 1.2;
}

.haz-map-chip strong {
  display: block;
  font-size: 1.18rem;
  line-height: 1.1;
}

.haz-map-chip--fail {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.haz-map-chip--warn {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.haz-layout-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(9rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.haz-map-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem);
  gap: 1rem;
  align-items: stretch;
}

.haz-map-viewport {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #243247;
  border-radius: 10px;
  background: #0b1120;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.haz-map-view-controls {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin: 0;
  padding: 0.35rem;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.86);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.32);
  backdrop-filter: blur(12px);
}

.haz-map-view-controls__group {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.haz-map-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.92);
  color: #e5edf7;
  font-size: 1rem;
  line-height: 1;
}

.haz-map-view-btn:hover,
.haz-map-view-btn:focus-visible {
  background: #2563eb;
  color: #ffffff;
}

.haz-map-view-readout {
  min-width: 6.2rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 6px;
  background: rgba(2, 6, 23, 0.72);
  color: #dbeafe;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.haz-layout-controls label,
.haz-map-input-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  font-size: 0.84rem;
  color: var(--text-muted, #4b5563);
}

.haz-layout-controls input,
.haz-map-input-grid input,
.haz-map-input-grid select {
  min-height: 2.35rem;
}

.haz-map-canvas {
  width: 100%;
  min-height: 380px;
  border: 0;
  border-radius: 0;
  background: #0b1120;
  cursor: grab;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.haz-map-canvas--dragging {
  cursor: grabbing;
}

.haz-map-svg {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 380px;
}

.haz-map-bg {
  fill: #0b1120;
}

.haz-map-facility {
  fill: rgba(255, 255, 255, 0.72);
  stroke: #334155;
  stroke-width: 2.5;
}

.haz-map-floor {
  fill: rgba(15, 23, 42, 0.86);
  stroke: #cbd5e1;
  stroke-width: 2.5;
}

.haz-map-grid-line,
.haz-map-iso-grid {
  stroke: rgba(148, 163, 184, 0.28);
  stroke-width: 1;
}

.haz-map-iso-grid {
  stroke-dasharray: 3 5;
}

.haz-map-axes line {
  stroke: #e5edf7;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.haz-map-axes text {
  fill: #f8fafc;
  font-size: 13px;
  font-weight: 700;
}

.haz-map-axis-label,
.haz-map-axis-title,
.haz-map-view-title {
  fill: #cbd5e1;
  font-size: 12px;
}

.haz-map-view-title {
  font-size: 13px;
  font-weight: 700;
}

.haz-zone-footprint {
  fill-opacity: 0.62;
  stroke-width: 2.5;
}

.haz-volume-footprint {
  fill-opacity: 0.18;
  stroke-width: 2;
  stroke-dasharray: 7 5;
}

.haz-volume-shell {
  fill-opacity: 0.34;
  stroke-width: 2.5;
  filter: drop-shadow(0 12px 20px rgba(2, 6, 23, 0.28));
}

.haz-volume-latitude {
  fill: none;
  stroke-width: 1.8;
  stroke-dasharray: 5 5;
  opacity: 0.9;
}

.haz-volume-centerline {
  stroke: rgba(226, 232, 240, 0.86);
  stroke-width: 1.8;
  stroke-dasharray: 5 5;
}

.haz-volume-label-leader {
  stroke: rgba(226, 232, 240, 0.78);
  stroke-width: 1.4;
  stroke-dasharray: 3 4;
}

.haz-volume-group,
.haz-equip-marker {
  cursor: pointer;
  outline: none;
}

.haz-volume-group.is-selected .haz-volume-shell,
.haz-volume-group.is-selected .haz-volume-face,
.haz-volume-group.is-selected .haz-volume-face--top,
.haz-volume-group:focus-visible .haz-volume-shell,
.haz-volume-group:focus-visible .haz-volume-face,
.haz-volume-group:focus-visible .haz-volume-face--top {
  stroke-width: 4;
  filter: drop-shadow(0 0 16px rgba(96, 165, 250, 0.46));
}

.haz-volume-group.is-selected .haz-volume-label,
.haz-volume-group:focus-visible .haz-volume-label,
.haz-equip-marker.is-selected .haz-equip-label,
.haz-equip-marker:focus-visible .haz-equip-label {
  fill: #ffffff;
  stroke: #0f172a;
}

.haz-volume-face {
  fill-opacity: 0.35;
  stroke-width: 2;
}

.haz-volume-face--top {
  fill-opacity: 0.5;
}

.haz-volume-face--side {
  fill-opacity: 0.26;
}

.haz-zone-label,
.haz-equip-label,
.haz-elevation-label,
.haz-volume-label,
.haz-map-empty {
  fill: #f8fafc;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 700;
  paint-order: stroke;
  stroke: #0b1120;
  stroke-width: 3px;
  stroke-linejoin: round;
}

.haz-equip-label {
  font-size: 12px;
  font-weight: 700;
}

.haz-volume-label {
  font-size: 12px;
  font-weight: 800;
}

.haz-elevation-label {
  font-size: 11px;
  font-weight: 700;
}

.haz-elevation-facility {
  fill: rgba(255, 255, 255, 0.72);
  stroke: #334155;
  stroke-width: 2.5;
}

.haz-elevation-bar {
  fill-opacity: 0.66;
  stroke-width: 2.5;
}

.haz-elevation-equipment line {
  stroke-width: 3;
  stroke-linecap: round;
}

.haz-elevation-equipment circle {
  stroke: #ffffff;
  stroke-width: 2;
}

.haz-equip-marker circle,
.haz-equip-marker polygon,
.haz-equip-marker rect {
  stroke: #ffffff;
  stroke-width: 2.5;
}

.haz-equip-hit-target {
  fill: transparent;
  stroke: transparent;
  pointer-events: all;
}

.haz-equip-marker.is-selected circle,
.haz-equip-marker.is-selected polygon,
.haz-equip-marker.is-selected rect,
.haz-equip-marker:focus-visible circle,
.haz-equip-marker:focus-visible polygon,
.haz-equip-marker:focus-visible rect {
  stroke: #60a5fa;
  stroke-width: 4;
  filter: drop-shadow(0 0 12px rgba(96, 165, 250, 0.7));
}

.haz-equip-marker.is-selected .haz-equip-hit-target,
.haz-equip-marker:focus-visible .haz-equip-hit-target {
  stroke: transparent;
  filter: none;
}

.haz-equip-leader {
  stroke: rgba(203, 213, 225, 0.72);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}

.haz-map-legend {
  margin-top: 0;
  padding: 0.65rem 0.8rem;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
  background: #0b1120;
  color: #e5edf7;
}

.haz-map-legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
  align-items: center;
}

.haz-map-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 1.6rem;
  font-size: 0.82rem;
  color: #e5edf7;
}

.haz-map-legend-swatch,
.haz-map-legend-marker {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid transparent;
  flex: 0 0 auto;
}

.haz-map-legend-swatch {
  border-radius: 3px;
}

.haz-map-legend-marker--circle {
  border-radius: 999px;
}

.haz-map-legend-marker--diamond {
  transform: rotate(45deg);
}

.haz-map-legend-marker--triangle {
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.haz-map-warning-list {
  margin-top: 0.65rem;
  color: #fdba74;
}

.haz-map-mini-axis rect {
  fill: rgba(2, 6, 23, 0.58);
  stroke: rgba(148, 163, 184, 0.36);
}

.haz-map-mini-axis line {
  stroke-width: 2.5;
  stroke-linecap: round;
}

.haz-map-mini-axis__x {
  stroke: #60a5fa;
}

.haz-map-mini-axis__y {
  stroke: #34d399;
}

.haz-map-mini-axis__z {
  stroke: #fbbf24;
}

.haz-map-mini-axis circle {
  fill: #e5edf7;
}

.haz-map-mini-axis text {
  fill: #f8fafc;
  font-size: 11px;
  font-weight: 800;
  paint-order: stroke;
  stroke: #020617;
  stroke-width: 3px;
}

.haz-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.haz-row-title-block {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  min-width: 0;
}

.haz-row-status-pill,
.haz-status-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.35rem;
  padding: 0.16rem 0.48rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.haz-row-status-pill--severe,
.haz-row-status-pill--fail {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.haz-row-status-pill--elevated,
.haz-row-status-pill--warn {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.haz-row-status-pill--moderate {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.haz-row-status-pill--pass {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.haz-row-header .btn {
  min-width: 2.2rem;
  padding-inline: 0.55rem;
}

.area-row,
.equip-row {
  position: relative;
  border-left: 4px solid var(--haz-row-accent, #64748b);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.haz-linked-row--selected {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--haz-row-accent, #2563eb) 52%, transparent);
}

.haz-result-row > td:first-child {
  border-left: 4px solid var(--haz-row-accent, #64748b);
}

.haz-map-inspector {
  min-width: 0;
  padding: 0.95rem;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 10px;
  background: var(--card-bg, #ffffff);
  color: var(--text, #111827);
}

.haz-inspector-header {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border, #d1d5db);
}

.haz-inspector-kicker {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--text-muted, #64748b);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.haz-inspector-header h3 {
  margin: 0 0 0.22rem;
  font-size: 1.02rem;
  line-height: 1.25;
}

.haz-inspector-status-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin: 0.8rem 0;
}

.haz-inspector-facts {
  display: grid;
  gap: 0.5rem;
}

.haz-inspector-fact {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border, #d1d5db) 70%, transparent);
  font-size: 0.8rem;
}

.haz-inspector-fact span {
  color: var(--text-muted, #64748b);
}

.haz-inspector-fact strong {
  text-align: right;
  font-weight: 700;
}

.haz-inspector-section {
  margin-top: 0.95rem;
}

.haz-inspector-section h4 {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
}

.haz-inspector-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.haz-inspector-link {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0.18rem 0.52rem;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.haz-inspector-link:hover,
.haz-inspector-link:focus-visible {
  border-color: #2563eb;
  background: #dbeafe;
}

.haz-inspector-muted,
.haz-inspector-empty,
.haz-inspector-empty-state p {
  color: var(--text-muted, #64748b);
  font-size: 0.82rem;
}

.haz-inspector-empty-state h3 {
  margin-top: 0;
}

.haz-inspector-issues {
  margin: 0;
  color: #92400e;
}

.haz-map-row-block {
  margin-top: 0.8rem;
  padding: 0.75rem;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-2, #f8fafc) 76%, #ffffff 24%);
}

.haz-map-row-heading {
  margin-bottom: 0.55rem;
  color: var(--text, #111827);
  font-size: 0.82rem;
  font-weight: 700;
}

.haz-map-input-grid {
  align-items: end;
}

.haz-map-input-grid label {
  min-width: 8rem;
}

body.dark-mode .hazarea-page .haz-map-panel,
body.dark-mode .haz-map-row-block {
  border-color: #334155;
  background: #111827;
}

body.dark-mode .haz-map-chip {
  border-color: #334155;
  background: #1f2937;
  color: #e5e7eb;
}

body.dark-mode .haz-map-view-readout {
  border-color: #334155;
  background: rgba(2, 6, 23, 0.78);
  color: #cbd5e1;
}

body.dark-mode .haz-map-chip--fail {
  border-color: #7f1d1d;
  background: #450a0a;
  color: #fecaca;
}

body.dark-mode .haz-map-chip--warn {
  border-color: #7c2d12;
  background: #431407;
  color: #fed7aa;
}

body.dark-mode .haz-map-canvas,
body.dark-mode .haz-map-bg {
  background: #0f172a;
  fill: #0f172a;
}

body.dark-mode .haz-map-facility {
  fill: rgba(15, 23, 42, 0.74);
  stroke: #cbd5e1;
}

body.dark-mode .haz-map-floor {
  fill: #111827;
  stroke: #cbd5e1;
}

body.dark-mode .haz-map-grid-line,
body.dark-mode .haz-map-iso-grid {
  stroke: #334155;
}

body.dark-mode .haz-map-axes line,
body.dark-mode .haz-volume-centerline,
body.dark-mode .haz-equip-leader {
  stroke: #cbd5e1;
}

body.dark-mode .haz-map-axes text {
  fill: #e5e7eb;
}

body.dark-mode .haz-map-axis-label,
body.dark-mode .haz-map-axis-title,
body.dark-mode .haz-map-view-title {
  fill: #cbd5e1;
}

body.dark-mode .haz-zone-label,
body.dark-mode .haz-equip-label,
body.dark-mode .haz-elevation-label,
body.dark-mode .haz-volume-label,
body.dark-mode .haz-map-empty {
  fill: #f8fafc;
  stroke: #020617;
}

body.dark-mode .haz-elevation-facility {
  fill: rgba(15, 23, 42, 0.74);
  stroke: #cbd5e1;
}

body.dark-mode .haz-map-legend-item,
body.dark-mode .haz-map-row-heading {
  color: #e5e7eb;
}

body.dark-mode .haz-map-warning-list {
  color: #fdba74;
}

body.dark-mode .haz-map-inspector {
  border-color: #334155;
  background: #111827;
  color: #e5e7eb;
}

body.dark-mode .haz-inspector-header,
body.dark-mode .haz-inspector-fact {
  border-color: #334155;
}

body.dark-mode .haz-row-status-pill,
body.dark-mode .haz-status-info {
  border-color: #334155;
  background: #1f2937;
  color: #cbd5e1;
}

body.dark-mode .haz-row-status-pill--severe,
body.dark-mode .haz-row-status-pill--fail {
  border-color: #7f1d1d;
  background: #450a0a;
  color: #fecaca;
}

body.dark-mode .haz-row-status-pill--elevated,
body.dark-mode .haz-row-status-pill--warn,
body.dark-mode .haz-row-status-pill--moderate {
  border-color: #7c2d12;
  background: #431407;
  color: #fed7aa;
}

body.dark-mode .haz-row-status-pill--pass {
  border-color: #14532d;
  background: #052e16;
  color: #bbf7d0;
}

body.dark-mode .haz-inspector-link {
  border-color: #1d4ed8;
  background: #172554;
  color: #bfdbfe;
}

body.dark-mode .haz-inspector-muted,
body.dark-mode .haz-inspector-empty,
body.dark-mode .haz-inspector-empty-state p,
body.dark-mode .haz-inspector-fact span,
body.dark-mode .haz-inspector-kicker {
  color: #94a3b8;
}

body.theme-high-contrast .haz-map-panel,
body.theme-high-contrast .haz-map-canvas,
body.theme-high-contrast .haz-map-chip,
body.theme-high-contrast .haz-map-view-readout,
body.theme-high-contrast .haz-map-row-block,
body.theme-high-contrast .haz-map-inspector {
  border-color: #000000;
  background: #ffffff;
  color: #000000;
}

body.theme-high-contrast .haz-map-viewport,
body.theme-high-contrast .haz-map-legend,
body.theme-high-contrast .haz-map-view-controls {
  border-color: #000000;
  background: #ffffff;
  color: #000000;
}

body.theme-high-contrast .haz-map-bg,
body.theme-high-contrast .haz-map-facility,
body.theme-high-contrast .haz-map-floor {
  fill: #ffffff;
}

body.theme-high-contrast .haz-map-grid-line,
body.theme-high-contrast .haz-map-iso-grid,
body.theme-high-contrast .haz-map-facility,
body.theme-high-contrast .haz-elevation-facility,
body.theme-high-contrast .haz-zone-footprint,
body.theme-high-contrast .haz-volume-footprint,
body.theme-high-contrast .haz-volume-shell,
body.theme-high-contrast .haz-volume-face {
  stroke: #000000;
}

body.theme-high-contrast .haz-zone-label,
body.theme-high-contrast .haz-equip-label,
body.theme-high-contrast .haz-elevation-label,
body.theme-high-contrast .haz-volume-label,
body.theme-high-contrast .haz-map-empty,
body.theme-high-contrast .haz-map-axis-label,
body.theme-high-contrast .haz-map-axis-title,
body.theme-high-contrast .haz-map-view-title {
  fill: #000000;
  stroke: #ffffff;
}

body.theme-high-contrast .haz-map-axes line,
body.theme-high-contrast .haz-volume-centerline,
body.theme-high-contrast .haz-equip-leader {
  stroke: #000000;
}

body.theme-high-contrast .haz-map-axes text {
  fill: #000000;
}

body.theme-high-contrast .haz-map-legend-item,
body.theme-high-contrast .haz-map-view-btn,
body.theme-high-contrast .haz-map-view-readout {
  color: #000000;
}

body.theme-high-contrast .haz-map-view-btn,
body.theme-high-contrast .haz-inspector-link,
body.theme-high-contrast .haz-row-status-pill {
  border-color: #000000;
  background: #ffffff;
  color: #000000;
}

@media (max-width: 760px) {
  .haz-map-panel__header {
    flex-direction: column;
  }

  .haz-map-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .haz-layout-controls {
    grid-template-columns: 1fr;
  }

  .haz-map-workspace {
    grid-template-columns: 1fr;
  }

  .haz-map-view-controls {
    left: 0.55rem;
    right: 0.55rem;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .haz-map-view-readout {
    width: auto;
  }

  .haz-map-canvas {
    min-height: 320px;
  }

  .haz-map-svg {
    width: 100%;
    min-width: 0;
  }

  .haz-map-inspector {
    order: 2;
  }
}

.battery-layout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: .75rem 1rem;
  align-items: start;
}

.battery-layout-check {
  align-self: center;
}

.battery-layout-check label {
  display: flex;
  align-items: center;
  gap: .45rem;
}

.battery-rack-layout {
  display: grid;
  gap: 1rem;
}

.battery-rack-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: .6rem;
}

.battery-rack-summary-grid div {
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 8px;
  padding: .6rem .7rem;
  background: color-mix(in srgb, var(--card-bg, #ffffff) 94%, #e8f1fb 6%);
}

.battery-rack-summary-grid span {
  display: block;
  font-size: .78rem;
  color: var(--text-muted, #64748b);
}

.battery-rack-summary-grid strong {
  display: block;
  margin-top: .2rem;
  font-size: 1.05rem;
}

.battery-rack-view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  align-items: start;
}

.battery-rack-view {
  margin: 0;
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 8px;
  padding: .75rem;
  background: color-mix(in srgb, var(--card-bg, #ffffff) 96%, #f1f5f9 4%);
}

.battery-rack-view figcaption {
  margin-bottom: .5rem;
  font-weight: 700;
}

.battery-rack-svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 260px;
}

.battery-layout-room {
  fill: color-mix(in srgb, var(--card-bg, #ffffff) 94%, #f8fafc 6%);
  stroke: var(--border-color, #94a3b8);
  stroke-width: 2;
}

.battery-layout-aisle {
  fill: color-mix(in srgb, #94a3b8 15%, transparent);
  stroke: color-mix(in srgb, #64748b 45%, transparent);
  stroke-width: 1.2;
  stroke-dasharray: 6 5;
}

.battery-rack-plan-rack rect,
.battery-rack-elevation-frame {
  fill: color-mix(in srgb, #f8fafc 88%, #dbeafe 12%);
  stroke: color-mix(in srgb, #334155 80%, var(--border-color, #94a3b8));
  stroke-width: 2;
}

.battery-rack-plan-rack text,
.battery-rack-title,
.battery-rack-small-label,
.battery-dc-bus-label,
.battery-polarity-label,
.battery-string-jumper text {
  fill: var(--text-color, #0f172a);
  font-size: 12px;
  font-weight: 700;
  paint-order: stroke;
  stroke: var(--card-bg, #ffffff);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.battery-rack-small-label {
  font-size: 10px;
  font-weight: 600;
}

.battery-bus-line {
  stroke-width: 4;
  stroke-linecap: round;
}

.battery-bus-line--positive {
  stroke: #dc2626;
}

.battery-bus-line--negative {
  stroke: #2563eb;
}

.battery-string-route {
  fill: none;
  stroke-width: 1.8;
  stroke-dasharray: 5 4;
  opacity: .88;
}

.battery-dc-bus-box {
  fill: color-mix(in srgb, #111827 86%, #334155);
  stroke: #f8fafc;
  stroke-width: 1.5;
}

.battery-dc-bus-label {
  fill: #ffffff;
  stroke: #111827;
  font-size: 10px;
}

.battery-module-slot {
  stroke: color-mix(in srgb, #1f2937 50%, transparent);
  stroke-width: .8;
}

.battery-module-slot.is-used {
  opacity: .88;
}

.battery-module-slot.is-empty {
  fill: transparent;
  stroke: color-mix(in srgb, #94a3b8 58%, transparent);
  stroke-dasharray: 3 3;
}

.battery-string-jumper line {
  stroke-width: 2.2;
  stroke-linecap: round;
}

.battery-connection-table {
  min-width: 760px;
}

.battery-layout-warnings {
  margin-top: 0;
}

body.dark-mode .battery-rack-summary-grid div,
body.dark-mode .battery-rack-view {
  background: #111827;
  border-color: #374151;
}

body.dark-mode .battery-layout-room,
body.dark-mode .battery-rack-plan-rack rect,
body.dark-mode .battery-rack-elevation-frame {
  fill: #0f172a;
  stroke: #64748b;
}

body.dark-mode .battery-rack-plan-rack text,
body.dark-mode .battery-rack-title,
body.dark-mode .battery-rack-small-label,
body.dark-mode .battery-polarity-label,
body.dark-mode .battery-string-jumper text {
  fill: #f8fafc;
  stroke: #0f172a;
}

body.theme-high-contrast .battery-rack-view,
body.theme-high-contrast .battery-rack-summary-grid div {
  background: #000;
  border-color: currentColor;
}

body.theme-high-contrast .battery-layout-room,
body.theme-high-contrast .battery-rack-plan-rack rect,
body.theme-high-contrast .battery-rack-elevation-frame,
body.theme-high-contrast .battery-module-slot {
  fill: #000;
  stroke: currentColor;
}

body.theme-high-contrast .battery-bus-line,
body.theme-high-contrast .battery-string-route,
body.theme-high-contrast .battery-string-jumper line {
  stroke: currentColor !important;
}

@media (max-width: 760px) {
  .battery-rack-view-grid {
    grid-template-columns: 1fr;
  }

  .battery-rack-svg {
    min-height: 220px;
  }
}

.demand-review-list {
  display: grid;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
  padding: 0;
  list-style: none;
}

.demand-review-note {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border-color, #d7dde8);
  border-left: 4px solid var(--accent-color, #2a6fd6);
  border-radius: 6px;
  background: color-mix(in srgb, var(--panel-bg, #f8fafc) 92%, #dbeafe 8%);
}

.demand-review-note-warning {
  border-left-color: var(--warning-color, #b7791f);
}

.demand-review-note small {
  color: var(--muted-text, #64748b);
  line-height: 1.45;
}
