:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #52616f;
  --line: #d8dee6;
  --panel: #ffffff;
  --panel-soft: #f6f8fa;
  --rail: #002b5c;
  --rail-soft: #003d7c;
  --blue-soft: #eaf2f8;
  --nus-blue: #003d7c;
  --nus-orange: #ef7c00;
  --teal: #287c6f;
  --red: #b43b34;
  --amber: #ef7c00;
  --shadow: 0 14px 34px rgba(23, 32, 42, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--panel-soft);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 82px 460px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 100vh;
  padding: 22px 12px 18px;
  background: var(--rail);
  color: rgba(255, 255, 255, 0.72);
}

.rail-nav {
  display: grid;
  align-content: start;
  gap: 10px;
}

.rail-nav button,
.rail-guide,
.rail-settings {
  display: grid;
  place-items: center;
  gap: 6px;
  width: 58px;
  min-height: 62px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-size: 10px;
  font-weight: 720;
}

.rail-guide {
  text-decoration: none;
}

.rail-guide:hover,
.rail-guide:focus-visible {
  border-left-color: var(--nus-orange);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  outline: none;
}

.rail-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.rail-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.rail-nav button.active {
  background: var(--nus-blue);
  color: #fff;
}

.rail-nav button.active .rail-icon {
  background: rgba(255, 255, 255, 0.18);
}

.rail-spacer {
  min-height: 0;
}

.map-stage {
  position: relative;
  grid-column: 3;
  grid-row: 1;
  min-width: 0;
  min-height: 100vh;
  overflow: hidden;
  background: #e7edf1;
}

.map {
  position: absolute;
  inset: 0;
}

.control-panel {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100vh;
  overflow: auto;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
}

.panel-header {
  display: grid;
  gap: 12px;
  padding-bottom: 3px;
}

.panel-brand {
  display: flex;
  align-items: center;
  min-height: 48px;
}

.panel-brand img {
  display: block;
  width: 100%;
  max-width: 350px;
  height: auto;
  object-fit: contain;
}

.panel-title-block {
  display: grid;
  gap: 6px;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.tab-panel.active {
  display: flex;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-header h3 {
  margin-bottom: 0;
}

.section-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.eyebrow {
  margin: 0;
  color: var(--nus-blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 26px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 25px;
  line-height: 1.15;
}

h3 {
  margin-bottom: 10px;
  font-size: 15px;
  line-height: 1.25;
}

.panel-note {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.panel-section {
  padding: 0;
}

.live-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.live-summary > div {
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.summary-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.live-summary strong {
  display: block;
  margin-top: 7px;
  font-size: 19px;
  line-height: 1.1;
}

.region-list,
.ai-list,
.external-data-grid {
  display: grid;
  gap: 8px;
}

.region-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.region-card > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 3px solid color-mix(in srgb, var(--region-color) 65%, white);
  border-radius: 999px;
  background: color-mix(in srgb, var(--region-color) 14%, white);
  color: var(--nus-blue);
  font-weight: 750;
}

.region-card strong,
.ai-item strong,
.external-data-grid strong {
  display: block;
  font-size: 13px;
  line-height: 1.25;
}

.region-card small,
.region-card em,
.external-data-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.3;
}

.region-card em {
  white-space: nowrap;
}

.ai-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--nus-blue);
  border-radius: 8px;
  background: #fff;
}

.ai-item.warning {
  border-left-color: var(--amber);
}

.ai-item.normal {
  border-left-color: var(--teal);
}

.ai-item.info {
  border-left-color: #5b6f82;
}

.ai-item p,
.ai-item small {
  display: block;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.ai-item span {
  align-self: start;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.ai-health-monitor {
  display: grid;
  gap: 12px;
}

.ai-health-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.ai-health-kpi,
.ai-chart-card,
.ai-llm-summary,
.ai-agent-window,
.ai-health-loading {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.ai-health-kpi,
.ai-health-loading {
  min-height: 74px;
  padding: 11px;
}

.ai-health-kpi span,
.ai-health-kpi small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.ai-health-kpi strong {
  display: block;
  margin-top: 5px;
  font-size: 17px;
  line-height: 1.15;
}

.ai-health-loading {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.ai-health-grid {
  display: grid;
  gap: 10px;
}

.ai-chart-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  overflow: hidden;
}

.ai-chart-card .section-header h3 {
  margin-bottom: 0;
  font-size: 14px;
}

.ai-cluster-chart,
.ai-regime-timeline {
  min-height: 190px;
}

.ai-live-dashboard,
.ai-evidence-bars {
  display: grid;
  gap: 8px;
}

.ai-live-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 142px;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.ai-live-row.is-live {
  border-color: rgba(0, 61, 124, 0.22);
  background: linear-gradient(90deg, #fff 0%, #f4f8fc 100%);
}

.ai-live-name {
  min-width: 0;
}

.ai-live-name strong,
.ai-live-name span,
.ai-live-value strong,
.ai-live-value span {
  display: block;
}

.ai-live-name strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
}

.ai-live-name span,
.ai-live-value span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-live-track {
  position: relative;
  min-height: 28px;
  overflow: hidden;
  border-radius: 7px;
  background: #eef1f4;
}

.ai-live-track i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--bar-width);
  min-width: 8px;
  border-radius: inherit;
  background: var(--bar-color);
  opacity: 0.92;
}

.ai-live-row.is-pending .ai-live-track i {
  opacity: 0.58;
}

.ai-live-track span {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.ai-live-row.is-live .ai-live-track span {
  color: #fff;
  text-shadow: 0 1px 2px rgba(23, 32, 42, 0.28);
}

.ai-live-value {
  min-width: 0;
  text-align: right;
}

.ai-live-value strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-evidence-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.ai-evidence-summary strong {
  color: var(--ink);
  font-size: 13px;
}

.ai-evidence-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-align: right;
}

.ai-evidence-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.ai-evidence-row.is-current {
  border-color: rgba(0, 61, 124, 0.32);
  box-shadow: 0 0 0 2px rgba(0, 61, 124, 0.06);
}

.ai-evidence-label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.ai-evidence-label i {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--cluster-color);
}

.ai-evidence-label span {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-evidence-track {
  position: relative;
  height: 24px;
  overflow: hidden;
  border-radius: 7px;
  background: #eef1f4;
}

.ai-evidence-track b {
  display: block;
  width: var(--bar-width);
  min-width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--bar-color);
  opacity: 0.9;
}

.ai-evidence-row strong {
  color: var(--ink);
  font-size: 12px;
  text-align: right;
}

.ai-cluster-svg,
.ai-timeline-svg {
  display: block;
  width: 100%;
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.ai-timeline-svg {
  min-height: 124px;
}

.ai-grid-line {
  stroke: #dce2e8;
  stroke-width: 1;
}

.ai-axis-line {
  stroke: #cfd8e2;
  stroke-width: 1.2;
}

.ai-baseline-line {
  stroke: #17202a;
  stroke-width: 1.6;
  stroke-dasharray: 5 5;
  opacity: 0.55;
}

.ai-axis-label,
.ai-axis-title {
  fill: var(--muted);
  font-size: 10px;
}

.ai-axis-title {
  font-weight: 750;
}

.ai-cluster-point {
  opacity: 0.78;
  stroke: #fff;
  stroke-width: 1;
}

.ai-cluster-point.current {
  opacity: 1;
  stroke: #17202a;
  stroke-width: 2;
}

.ai-timeline-bar {
  opacity: 0.86;
}

.ai-cluster-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.ai-cluster-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ai-cluster-legend i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--cluster-color);
}

.ai-llm-summary {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: linear-gradient(180deg, #fff 0%, var(--panel-soft) 100%);
}

.ai-llm-summary h3 {
  margin-bottom: 4px;
  font-size: 17px;
}

.ai-llm-summary p,
.ai-llm-summary li {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.ai-llm-summary ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.ai-llm-summary strong {
  color: var(--ink);
}

.ai-agent-window {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.ai-agent-window .section-header h3 {
  margin-bottom: 0;
}

.ai-agent-messages {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.ai-agent-message {
  max-width: 92%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.ai-agent-message.agent {
  justify-self: start;
}

.ai-agent-message.user {
  justify-self: end;
  border-color: rgba(0, 61, 124, 0.22);
  background: var(--blue-soft);
}

.ai-agent-message span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.ai-agent-message p {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
}

.ai-agent-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.ai-agent-suggestions button {
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--nus-blue);
  font-size: 11px;
  font-weight: 750;
}

.ai-agent-suggestions button:hover {
  border-color: var(--nus-blue);
  background: var(--blue-soft);
}

.ai-agent-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.ai-agent-input input {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.ai-agent-input button {
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: var(--nus-blue);
  color: #fff;
  font-weight: 800;
}

.external-data-card {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  text-align: left;
}

.external-data-card.active {
  border-color: var(--nus-blue);
  background: #eef5fb;
  box-shadow: 0 0 0 2px rgba(0, 61, 124, 0.08);
}

.external-viz-panel {
  margin-top: 10px;
}

.external-context-panel {
  position: absolute;
  top: 68px;
  left: 16px;
  z-index: 4;
  display: grid;
  gap: 12px;
  width: min(440px, calc(100% - 32px));
  max-height: calc(100vh - 188px);
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(23, 32, 42, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow);
}

.floating-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.floating-panel-header h2 {
  margin-top: 2px;
  font-size: 19px;
  line-height: 1.2;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.icon-button:hover {
  border-color: var(--nus-blue);
  color: var(--nus-blue);
}

.external-viz-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(23, 32, 42, 0.06);
}

.external-context-panel .external-viz-panel {
  margin-top: 0;
}

.external-context-panel .external-viz-card {
  padding: 0;
  border: 0;
  box-shadow: none;
}

.external-viz-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.external-viz-card header h3 {
  margin-bottom: 0;
}

.external-source {
  display: grid;
  justify-items: end;
  gap: 3px;
  max-width: 120px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-align: right;
}

.external-source a {
  color: var(--nus-blue);
  font-weight: 750;
  text-decoration: none;
}

.external-source small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.external-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.external-kpi {
  min-height: 74px;
  padding: 9px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.external-kpi span,
.external-kpi small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.external-kpi strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
  line-height: 1.15;
}

.chart-card {
  display: grid;
  gap: 8px;
}

.line-chart {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.chart-grid line {
  stroke: #dce2e8;
  stroke-width: 1;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.bar-chart {
  display: grid;
  gap: 7px;
}

.bar-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.bar-row > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-row div {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f6;
}

.bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.bar-row strong {
  color: var(--ink);
  font-size: 11px;
  text-align: right;
}

.external-subtitle {
  margin: 0;
  font-size: 13px;
}

.external-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.segmented button {
  min-height: 38px;
  padding: 8px 6px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.active {
  background: var(--nus-blue);
  color: #fff;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  color: var(--ink);
  font-size: 14px;
}

.toggle-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--nus-blue);
}

.search-input {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.search-input:focus {
  border-color: var(--nus-blue);
  box-shadow: 0 0 0 3px rgba(0, 61, 124, 0.15);
}

.building-list {
  display: grid;
  gap: 8px;
  max-height: 184px;
  margin-top: 10px;
  overflow: auto;
}

.building-list-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.building-list-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: 999px;
  background: var(--nus-blue);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.building-list-text {
  min-width: 0;
}

.building-list-item strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.building-list-item small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.building-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(23, 32, 42, 0.06);
}

.building-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.status-pill {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e8eef5;
  color: var(--nus-blue);
  font-size: 12px;
  font-weight: 700;
}

.status-pill.live {
  background: #e7f1f8;
  color: var(--nus-blue);
}

.status-pill.warning {
  background: #fdeceb;
  color: var(--red);
}

.status-pill.good {
  background: #e8f4ef;
  color: var(--teal);
}

.block-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.block-chip-list span {
  padding: 4px 7px;
  border-radius: 999px;
  background: #edf2f6;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
}

.metric-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.metric-list div {
  padding: 10px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.metric-list dt {
  color: var(--muted);
  font-size: 12px;
}

.metric-list dd {
  margin: 5px 0 0;
  font-size: 17px;
  font-weight: 700;
}

.insight-text {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.full-button {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: var(--nus-orange);
  color: #fff;
  font-weight: 700;
}

.full-button:disabled {
  cursor: default;
  background: #c7ced6;
}

.text-button {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--nus-blue);
  font-size: 12px;
  font-weight: 750;
}

.text-button:hover {
  border-color: var(--nus-blue);
  background: var(--blue-soft);
}

.realtime-trends {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.realtime-trends .section-header {
  margin-bottom: 0;
}

.trend-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.trend-summary-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.trend-summary-card span,
.trend-summary-card small,
.trend-note {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.trend-summary-card strong {
  display: block;
  margin-top: 5px;
  font-size: 16px;
  line-height: 1.15;
}

.trend-note {
  margin: 0;
}

.point-list {
  display: grid;
  gap: 8px;
  max-height: 230px;
  overflow: auto;
}

.realtime-drawer {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.realtime-drawer summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  list-style: none;
}

.realtime-drawer summary::-webkit-details-marker {
  display: none;
}

.realtime-drawer summary::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 750;
}

.realtime-drawer[open] summary::after {
  content: "-";
}

.realtime-drawer summary em {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
}

.realtime-drawer .point-list {
  padding: 0 12px 12px;
}

.point-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.point-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.25;
}

.point-item span,
.empty-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.point-view {
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--nus-blue);
  font-size: 11px;
  font-weight: 750;
}

.point-view:hover {
  border-color: var(--nus-blue);
  background: var(--blue-soft);
}

.trend-modal-backdrop {
  position: absolute;
  inset: 68px 18px 20px;
  z-index: 20;
  display: block;
  padding: 0;
  border-radius: 10px;
  background: rgba(8, 16, 27, 0.28);
  backdrop-filter: blur(1px);
}

.trend-modal {
  display: grid;
  grid-template-rows: auto auto auto auto auto auto minmax(0, 1fr) auto;
  gap: 14px;
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: 20px;
  border: 1px solid rgba(216, 222, 230, 0.92);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.trend-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.trend-modal-header h2 {
  font-size: 23px;
}

.trend-modal-header p {
  margin-bottom: 0;
}

.trend-place-row {
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
  align-items: end;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(246, 248, 250, 0.82);
}

.trend-place-row label,
.trend-place-row label span {
  display: block;
}

.trend-place-row label span {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.trend-place-row select {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.trend-place-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.trend-live-meters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.trend-live-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, var(--panel-soft) 100%);
}

.trend-live-card span,
.trend-live-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.trend-live-card strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
  line-height: 1.15;
}

.trend-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
}

.trend-tabs button {
  min-height: 48px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.trend-tabs button strong,
.trend-tabs button span {
  display: block;
}

.trend-tabs button strong {
  font-size: 13px;
  line-height: 1.2;
}

.trend-tabs button span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.trend-tabs button.active {
  border-color: var(--nus-blue);
  background: var(--blue-soft);
  box-shadow: 0 0 0 2px rgba(0, 61, 124, 0.08);
}

.trend-status,
.trend-narrative {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.trend-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.trend-kpi {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.trend-kpi span,
.trend-kpi small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.trend-kpi strong {
  display: block;
  margin-top: 6px;
  font-size: 17px;
  line-height: 1.15;
}

.trend-chart-panel {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.trend-chart-frame {
  position: relative;
  height: 100%;
  min-height: 340px;
}

.trend-chart-svg {
  width: 100%;
  height: 100%;
  min-height: 340px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.trend-chart-svg .axis,
.trend-chart-svg .grid-line {
  stroke: #dce2e8;
  stroke-width: 1;
}

.trend-chart-svg .chart-label {
  fill: var(--muted);
  font-size: 11px;
}

.trend-chart-svg .chart-line {
  fill: none;
  stroke-width: 2.5;
}

.trend-chart-svg .chart-area {
  opacity: 0.14;
}

.trend-chart-svg .chart-bar {
  opacity: 0.86;
}

.trend-chart-svg .chart-hover-zone,
.trend-chart-svg .chart-hover-bar {
  fill: transparent;
  cursor: crosshair;
}

.trend-chart-svg .chart-point {
  fill: #fff;
  stroke-width: 2;
  opacity: 0;
  pointer-events: none;
}

.trend-chart-svg .chart-hit:hover .chart-point,
.trend-chart-svg .chart-hit:focus .chart-point {
  opacity: 1;
}

.trend-chart-svg .chart-hit:hover .chart-hover-bar {
  fill: rgba(0, 61, 124, 0.08);
}

.chart-tooltip {
  position: absolute;
  z-index: 2;
  max-width: min(280px, calc(100% - 20px));
  padding: 8px 10px;
  border: 1px solid rgba(23, 32, 42, 0.16);
  border-radius: 8px;
  background: rgba(23, 32, 42, 0.94);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(8, 16, 27, 0.18);
}

.brick-modal-backdrop {
  position: absolute;
  inset: 68px 18px 20px;
  z-index: 20;
  display: block;
  padding: 0;
  border-radius: 10px;
  background: rgba(8, 16, 27, 0.28);
  backdrop-filter: blur(1px);
}

.brick-modal {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 14px;
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: 20px;
  border: 1px solid rgba(216, 222, 230, 0.92);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.brick-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.brick-modal-header h2 {
  font-size: 23px;
}

.brick-modal-header p {
  margin-bottom: 0;
}

.brick-place-row {
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
  align-items: end;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(246, 248, 250, 0.82);
}

.brick-place-row label,
.brick-place-row label span {
  display: block;
}

.brick-place-row label span {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.brick-place-row select {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.brick-place-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.brick-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.brick-summary-card,
.brick-inspector {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, var(--panel-soft) 100%);
}

.brick-summary-card {
  padding: 11px;
}

.brick-summary-card span,
.brick-summary-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.brick-summary-card strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
  line-height: 1.15;
}

.brick-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 12px;
  min-height: 0;
}

.brick-workspace > div {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  min-width: 0;
  min-height: 0;
}

.brick-graph {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(31, 95, 191, 0.05), transparent 22%),
    #fbfcfd;
}

.brick-network-svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 560px;
}

.brick-network-bg {
  fill: #fbfcfd;
}

.brick-network-lane-label {
  color: var(--muted);
  fill: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.brick-network-edge path {
  fill: none;
  stroke: #aebbc5;
  stroke-width: 1.8;
  stroke-linecap: round;
  opacity: 0.78;
  marker-end: url("#brickArrow");
}

.brick-network-edge text {
  fill: var(--nus-blue);
  font-size: 11px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 4px;
}

.brick-network-edge.active path {
  stroke: var(--nus-blue);
  stroke-width: 3;
  opacity: 0.96;
}

.brick-network-svg marker path {
  fill: #aebbc5;
}

.brick-network-node {
  cursor: pointer;
  outline: none;
}

.brick-node-halo {
  fill: transparent;
  stroke: transparent;
  stroke-width: 2;
}

.brick-node-core {
  fill: #fff;
  stroke: #8394a1;
  stroke-width: 2;
  filter: drop-shadow(0 6px 12px rgba(23, 32, 42, 0.14));
}

.brick-network-node:hover .brick-node-halo,
.brick-network-node.active .brick-node-halo,
.brick-network-node:focus .brick-node-halo {
  fill: rgba(0, 61, 124, 0.08);
  stroke: rgba(0, 61, 124, 0.24);
}

.brick-network-node.active .brick-node-core,
.brick-network-node:focus .brick-node-core {
  stroke: var(--nus-blue);
  stroke-width: 3;
}

.brick-network-node.place .brick-node-core {
  fill: var(--nus-blue);
  stroke: #002b5c;
}

.brick-network-node.system .brick-node-core {
  fill: #eaf2f8;
  stroke: var(--nus-blue);
}

.brick-network-node.equipment .brick-node-core {
  fill: #fff0dc;
  stroke: var(--nus-orange);
}

.brick-network-node.point .brick-node-core {
  fill: #dcefee;
  stroke: #287c6f;
}

.brick-network-node.candidate .brick-node-core,
.brick-network-node.partial-live .brick-node-core,
.brick-network-node.breakdown .brick-node-core {
  stroke-dasharray: 4 3;
}

.brick-network-node.planned .brick-node-core,
.brick-network-node.reference-only .brick-node-core {
  fill: #eef2f6;
  stroke: #7b8d99;
  stroke-dasharray: 3 3;
}

.brick-node-title {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 850;
  pointer-events: none;
}

.brick-network-node.place .brick-node-title {
  fill: #fff;
}

.brick-node-subtitle,
.brick-node-count {
  fill: var(--muted);
  font-size: 10.5px;
  font-weight: 750;
  pointer-events: none;
}

.brick-network-node.place .brick-node-subtitle,
.brick-network-node.place .brick-node-count {
  fill: rgba(255, 255, 255, 0.78);
}

.brick-network-node.point .brick-node-subtitle,
.brick-network-node.equipment .brick-node-subtitle {
  fill: var(--ink);
  font-weight: 850;
}

.brick-status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: #596775;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
}

.brick-status.live,
.brick-status.live-mapped {
  background: #dcefee;
  color: #17665e;
}

.brick-status.candidate,
.brick-status.partial-live,
.brick-status.breakdown {
  background: #fff0d8;
  color: #93600d;
}

.brick-status.planned,
.brick-status.reference-only {
  background: #eef2f6;
  color: #596775;
}

.brick-relations {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.brick-relations span {
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
}

.brick-relations strong {
  color: var(--ink);
}

.brick-inspector {
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.brick-inspector-header h3 {
  margin: 10px 0 4px;
  font-size: 18px;
  line-height: 1.2;
}

.brick-inspector-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.brick-detail-list {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.brick-detail-list div,
.brick-inspector-section {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.brick-detail-list dt,
.brick-inspector-section h4 {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.brick-detail-list dd {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

.brick-inspector-section {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.brick-inspector-section p {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(92px, 0.6fr);
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.brick-inspector-section p strong {
  color: var(--ink);
}

@media (max-width: 1380px) {
  .brick-modal {
    overflow: auto;
  }

  .brick-workspace {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .brick-workspace > div {
    grid-template-rows: auto auto;
  }

  .brick-graph {
    min-height: 560px;
  }

  .brick-network-svg {
    min-height: 560px;
  }

  .brick-inspector {
    max-height: none;
  }
}

.map-toolbar {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;
  display: flex;
  gap: 8px;
}

.map-toolbar button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(23, 32, 42, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(23, 32, 42, 0.12);
}

.map-toolbar button.active {
  border-color: var(--nus-blue);
  background: var(--nus-blue);
  color: #fff;
}

.map-status {
  position: absolute;
  top: 16px;
  right: 58px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(23, 32, 42, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(23, 32, 42, 0.12);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #98a5b3;
}

.status-dot.live {
  background: var(--teal);
}

.status-dot.error {
  background: var(--red);
}

.legend {
  position: absolute;
  right: 16px;
  bottom: 24px;
  z-index: 3;
  width: min(280px, calc(100% - 32px));
  padding: 12px;
  border: 1px solid rgba(23, 32, 42, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.legend-title {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}

.legend-scale {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
}

.legend-scale span:nth-child(1) {
  background: #dcefee;
}

.legend-scale span:nth-child(2) {
  background: #72b7b2;
}

.legend-scale span:nth-child(3) {
  background: var(--nus-orange);
}

.legend-scale span:nth-child(4) {
  background: #b43b34;
}

.legend-items {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.legend-items span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.legend-items i {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 3px;
}

.legend-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.token-panel {
  position: absolute;
  inset: auto auto 32px 32px;
  z-index: 4;
  width: min(480px, calc(100% - 64px));
  padding: 22px;
  border: 1px solid rgba(23, 32, 42, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.token-panel.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.token-panel p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.token-form {
  display: grid;
  gap: 8px;
}

.token-form label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.token-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.token-row input {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.token-row button {
  min-height: 42px;
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--nus-blue);
  color: #fff;
  font-weight: 700;
}

.token-error {
  margin: 2px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(180, 59, 52, 0.24);
  border-radius: 8px;
  background: rgba(180, 59, 52, 0.08);
  color: #8f2923 !important;
  font-size: 13px !important;
}

.mapboxgl-popup-content {
  min-width: 360px;
  max-width: 460px;
  border-radius: 8px;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.popup-card {
  display: grid;
  gap: 10px;
}

.popup-card-header span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--nus-blue);
  color: #fff;
  font-size: 12px;
  font-weight: 750;
}

.popup-card-header h4 {
  margin: 7px 0 4px;
  font-size: 18px;
  line-height: 1.2;
}

.popup-card-header p,
.popup-inline,
.popup-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.popup-inline {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 8px;
}

.popup-inline strong {
  color: var(--ink);
}

.popup-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.popup-metrics div {
  padding: 9px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.popup-metrics span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.popup-metrics strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.popup-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 58vh;
  }

  .rail {
    grid-row: 1;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto;
    align-items: center;
    min-height: auto;
    padding: 10px 12px;
  }

  .rail-nav {
    display: flex;
    gap: 8px;
    overflow: auto;
  }

  .rail-spacer {
    display: none;
  }

  .rail-settings {
    margin-left: 8px;
  }

  .map-stage {
    grid-column: 1;
    grid-row: 3;
    min-height: 58vh;
  }

  .control-panel {
    grid-column: 1;
    grid-row: 2;
    height: auto;
    max-height: none;
    border-right: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .map-status {
    right: 16px;
    top: 62px;
  }

  .external-context-panel {
    top: 108px;
    right: 16px;
    left: 16px;
    width: auto;
    max-height: calc(58vh - 132px);
  }

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

  .brick-inspector {
    max-height: 240px;
  }
}

@media (max-width: 620px) {
  .rail-nav button,
  .rail-settings {
    width: 50px;
    min-height: 50px;
    font-size: 9px;
  }

  .control-panel {
    padding: 16px;
  }

  .live-summary,
  .metric-list,
  .external-kpis,
  .trend-summary,
  .trend-place-row,
  .trend-live-meters,
  .trend-kpis,
  .trend-tabs,
  .brick-place-row,
  .brick-summary,
  .ai-agent-input,
  .ai-health-kpis,
  .ai-live-row,
  .ai-evidence-row {
    grid-template-columns: 1fr;
  }

  .ai-live-value,
  .ai-evidence-summary span,
  .ai-evidence-row strong {
    text-align: left;
  }

  .ai-evidence-summary {
    display: grid;
  }

  .trend-modal-backdrop,
  .brick-modal-backdrop {
    inset: 62px 10px 12px;
  }

  .trend-modal,
  .brick-modal {
    padding: 14px;
    overflow: auto;
  }

  .brick-graph {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .trend-chart-frame,
  .trend-chart-svg {
    min-height: 300px;
  }

  .segmented {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .token-panel {
    inset: auto 16px 16px;
    width: auto;
  }

  .token-row {
    grid-template-columns: 1fr;
  }
}

/* Engineering dashboard shell */
:root {
  --workspace-bg: #eef2f5;
  --workspace-line: #d5dde5;
  --workspace-muted: #5b6b7c;
  --workspace-blue: #003d7c;
  --workspace-navy: #002b5c;
  --workspace-teal: #148678;
  --workspace-amber: #ef7c00;
}

.app-shell {
  grid-template-columns: 84px 380px minmax(0, 1fr);
  height: 100vh;
  min-height: 680px;
  overflow: hidden;
}

.rail {
  z-index: 20;
  grid-row: 1;
  grid-template-columns: 1fr;
  grid-template-rows: 64px minmax(0, 1fr) auto;
  min-height: 680px;
  padding: 12px 9px 10px;
  background: var(--workspace-navy);
}

.rail-product {
  display: grid;
  place-items: center;
  gap: 3px;
  width: 58px;
  height: 56px;
  margin: 0 auto;
  border: 0;
  border-radius: 6px;
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.rail-product-icon {
  display: grid;
  place-items: center;
  color: var(--nus-orange);
}

.rail-product-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.rail-nav {
  gap: 6px;
  padding-top: 8px;
}

.rail-nav button,
.rail-guide {
  width: 66px;
  min-height: 66px;
  border-radius: 6px;
  font-size: 9px;
}

.rail-nav button.active {
  background: var(--nus-blue);
}

.rail-icon {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: transparent;
}

.rail-nav button.active .rail-icon {
  background: transparent;
}

.control-panel {
  grid-column: 2;
  grid-row: 1;
  z-index: 12;
  gap: 0;
  height: 100vh;
  padding: 0 20px 22px;
  border-right: 1px solid var(--workspace-line);
  background: #fff;
}

.panel-header {
  gap: 12px;
  margin: 0 -20px 18px;
  padding: 20px 20px 17px;
  border-bottom: 1px solid var(--workspace-line);
}

.panel-brand {
  min-height: 51px;
}

.panel-brand img {
  width: auto;
  max-width: 320px;
  max-height: 58px;
}

.panel-title-block {
  gap: 3px;
}

.panel-title-block h2 {
  font-size: 21px;
}

.panel-intro {
  display: grid;
  gap: 5px;
  padding-bottom: 16px;
}

.panel-intro h2 {
  font-size: 19px;
}

.panel-intro p,
.field-control,
.panel-notice {
  margin: 0;
  color: var(--workspace-muted);
  font-size: 12px;
  line-height: 1.4;
}

.tab-panel,
.tab-panel.active {
  gap: 16px;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: #405166;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.field-control {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--workspace-line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.compact-controls {
  padding-bottom: 2px;
}

.live-summary {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--workspace-line);
  border-radius: 6px;
}

.live-summary > div {
  min-height: 72px;
  padding: 10px;
  border: 0;
  border-radius: 0;
  background: #f6f8fa;
}

.live-summary > div:nth-child(odd) {
  border-right: 1px solid var(--workspace-line);
}

.live-summary > div:nth-child(-n + 2) {
  border-bottom: 1px solid var(--workspace-line);
}

.live-summary strong {
  margin-top: 5px;
  font-size: 17px;
}

.live-summary small {
  color: var(--workspace-muted);
  font-size: 9px;
}

.region-list {
  gap: 6px;
}

.region-card {
  min-height: 51px;
  grid-template-columns: 35px minmax(0, 1fr) auto;
  padding: 7px 8px;
  border-radius: 6px;
}

.region-card > span {
  width: 30px;
  height: 30px;
  border-width: 2px;
  font-size: 12px;
}

.building-list {
  max-height: 250px;
}

.building-list-item,
.building-card,
.realtime-trends,
.realtime-drawer {
  border-radius: 6px;
}

.market-value-panel {
  display: grid;
  gap: 3px;
  padding: 14px 0;
  border-top: 1px solid var(--workspace-line);
  border-bottom: 1px solid var(--workspace-line);
}

.market-value-panel span,
.market-value-panel em {
  color: var(--workspace-muted);
  font-size: 10px;
  font-style: normal;
}

.market-value-panel strong {
  font-size: 25px;
}

.market-value-panel strong small {
  font-size: 12px;
}

.engineering-segmented,
.local-segmented {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.local-segmented button,
.engineering-segmented button {
  min-height: 36px;
  border-radius: 0;
  font-size: 10px;
}

.local-segmented button.active,
.engineering-segmented button.active {
  background: var(--workspace-blue);
  color: #fff;
}

.panel-notice {
  padding: 10px 10px 10px 30px;
  border-left: 3px solid var(--workspace-amber);
  background: #fff7e9;
  color: #73511a;
  font-size: 10px;
}

.source-status-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 8px;
  border: 1px solid var(--workspace-line);
  border-radius: 6px;
  background: #fff;
}

.source-status-row strong,
.source-status-row small {
  display: block;
}

.source-status-row strong {
  font-size: 11px;
}

.source-status-row small {
  margin-top: 2px;
  color: var(--workspace-muted);
  font-size: 9px;
}

.source-stack {
  display: grid;
  gap: 6px;
}

.source-stack h3 {
  margin-bottom: 2px;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8edf2;
  color: #52616f;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.tag.good {
  background: #dff2ef;
  color: #14766b;
}

.tag.partial {
  background: #fff0d4;
  color: #9a6200;
}

.tag.info {
  background: #e3effa;
  color: var(--nus-blue);
}

.map-stage {
  grid-column: 3;
  grid-row: 1;
  min-height: 680px;
  background: var(--workspace-bg);
}

.workspace-view {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
}

.workspace-view.active {
  display: block;
}

.overview-workspace {
  pointer-events: none;
}

.overview-workspace > * {
  pointer-events: auto;
}

.analysis-workspace {
  overflow: auto;
  background: var(--workspace-bg);
}

.workspace-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 61px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--workspace-line);
  background: rgba(255, 255, 255, 0.98);
}

.workspace-topbar h1 {
  margin: 0;
  font-size: 18px;
}

.workspace-topbar p {
  margin: 3px 0 0;
  color: var(--workspace-muted);
  font-size: 10px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-chip,
.toolbar-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--workspace-line);
  border-radius: 6px;
  background: #fff;
  color: #405166;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.toolbar-button:hover {
  border-color: var(--workspace-blue);
  color: var(--workspace-blue);
}

.status-dot.live {
  background: var(--workspace-teal);
}

.status-dot.partial {
  background: var(--workspace-amber);
}

.overview-map-modes {
  position: absolute;
  top: 76px;
  left: 18px;
  z-index: 6;
  width: 390px;
  padding: 5px;
  border: 1px solid var(--workspace-line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 25px rgba(29, 45, 61, 0.12);
}

.overview-map-modes.engineering-segmented {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.performance-drawer {
  position: absolute;
  top: 61px;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 300px;
  border-left: 1px solid var(--workspace-line);
  background: rgba(255, 255, 255, 0.98);
}

.performance-drawer > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px;
  border-bottom: 1px solid var(--workspace-line);
}

.performance-drawer h2,
.dashboard-card h2 {
  margin: 0;
  font-size: 13px;
}

.performance-drawer p,
.dashboard-card header p {
  margin: 3px 0 0;
  color: var(--workspace-muted);
  font-size: 9px;
}

.performance-list {
  overflow: auto;
}

.performance-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 59px;
  padding: 9px 14px;
  border: 0;
  border-bottom: 1px solid var(--workspace-line);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.performance-row:hover {
  background: #edf5fc;
}

.performance-row > strong {
  font-size: 12px;
  white-space: nowrap;
}

.performance-meter {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.performance-meter::before {
  content: "";
  grid-area: 1 / 1;
  height: 6px;
  border-radius: 999px;
  background: #e7ecf0;
}

.performance-meter i {
  z-index: 1;
  grid-area: 1 / 1;
  height: 6px;
  border-radius: 999px;
  background: var(--workspace-teal);
}

.performance-meter small {
  overflow: hidden;
  color: var(--workspace-muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.performance-drawer footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--workspace-line);
}

.performance-drawer footer div {
  display: grid;
  gap: 3px;
  padding: 11px 13px;
}

.performance-drawer footer div + div {
  border-left: 1px solid var(--workspace-line);
}

.performance-drawer footer span {
  color: var(--workspace-muted);
  font-size: 8px;
}

.performance-drawer footer strong {
  font-size: 10px;
}

.overview-workspace ~ .mapboxgl-control-container .mapboxgl-ctrl-top-right,
.mapboxgl-ctrl-top-right {
  top: 16px;
  right: 16px;
}

.mapboxgl-ctrl-bottom-right {
  right: 16px;
}

.map-toolbar,
.map-status {
  display: none;
}

.legend {
  display: none;
  left: 16px;
  right: auto;
  bottom: 14px;
  z-index: 7;
  min-width: 200px;
  border-radius: 6px;
}

.control-panel:has(#tab-overview.active) .panel-header {
  margin-bottom: 2px;
  padding-bottom: 10px;
  border-bottom: 0;
}

.control-panel:has(#tab-overview.active) .panel-brand img {
  width: 100%;
  max-width: 440px;
  max-height: none;
}

.overview-branding {
  display: grid;
  gap: 24px;
  padding: 8px 2px 2px;
}

.overview-brand-title {
  display: grid;
  gap: 10px;
  margin: 0;
}

.overview-title-highlight {
  color: var(--nus-orange);
  font-size: clamp(24px, 2.8vw, 40px);
  font-weight: 700;
  line-height: 1.05;
}

.overview-title-main {
  color: var(--nus-blue);
  font-size: clamp(20px, 2.1vw, 30px);
  font-weight: 600;
  line-height: 1.12;
}

.overview-project-summary {
  min-height: 120px;
  margin-top: 22px;
  padding: 0 2px;
  border: 0;
  background: transparent;
}

.overview-project-summary h2 {
  margin: 0;
  color: var(--workspace-muted);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.map-stage:not([data-active-workspace="overview"]) .legend,
.map-stage:not([data-active-workspace="overview"]) .mapboxgl-control-container {
  display: none;
}

.workspace-content {
  display: grid;
  gap: 14px;
  padding: 16px 18px 28px;
}

.building-analysis-content {
  grid-template-rows: 80px minmax(220px, 1.25fr) minmax(180px, 1fr) auto;
  min-height: calc(100vh - 61px);
}

.building-analysis-content > .wide-chart,
.building-analysis-content > .two-chart-grid {
  min-height: 0;
}

.building-analysis-content .chart-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.building-analysis-content .engineering-chart {
  height: 100%;
  min-height: 150px;
}

.building-analysis-content .two-chart-grid > .chart-card {
  height: 100%;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--workspace-line);
  border-radius: 6px;
  background: #fff;
}

.summary-strip > div {
  display: grid;
  gap: 4px;
  min-height: 78px;
  padding: 14px;
}

.summary-strip > div + div {
  border-left: 1px solid var(--workspace-line);
}

.summary-strip span,
.summary-strip small {
  color: var(--workspace-muted);
  font-size: 9px;
}

.summary-strip strong {
  font-size: 18px;
}

.dashboard-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--workspace-line);
  border-radius: 6px;
  background: #fff;
}

.dashboard-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px 8px;
}

.chart-legend {
  display: flex;
  gap: 12px;
  color: var(--workspace-muted);
  font-size: 8px;
}

.chart-legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 2px;
  margin-right: 5px;
  vertical-align: middle;
  background: var(--series);
}

.engineering-chart {
  display: block;
  width: 100%;
  height: 220px;
  padding: 0 16px 8px;
}

.engineering-chart.compact {
  height: 170px;
}

.chart-gridlines line {
  stroke: #dce3e9;
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
}

.chart-line.blue { stroke: var(--nus-blue); }
.chart-line.teal { stroke: #148678; }
.chart-line.amber { stroke: var(--nus-orange); }
.chart-line.red { stroke: #c4473a; }

.chart-area {
  opacity: 0.12;
}

.chart-area.blue { fill: var(--nus-blue); }
.chart-area.amber { fill: var(--nus-orange); }

.chart-axis text {
  fill: #66778a;
  font-size: 9px;
}

.two-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.engineering-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.engineering-table th,
.engineering-table td {
  height: 39px;
  padding: 8px 12px;
  border-top: 1px solid #e2e7ec;
  text-align: left;
  white-space: nowrap;
}

.engineering-table th {
  background: #f6f8fa;
  color: #607084;
  font-size: 8px;
  text-transform: uppercase;
}

.market-analysis-content {
  grid-template-rows: minmax(420px, 1fr) auto;
  min-height: calc(100vh - 61px);
}

.market-primary-card {
  min-height: 420px;
}

.market-chart-interactive {
  position: relative;
}

.market-chart {
  height: 390px;
}

.average-line {
  stroke: #7d8995;
  stroke-dasharray: 5 5;
}

.market-crosshair {
  position: absolute;
  top: 35px;
  bottom: 30px;
  left: 67%;
  width: 1px;
  background: #778493;
}

.market-tooltip {
  position: absolute;
  top: 43%;
  left: 60%;
  display: grid;
  gap: 2px;
  padding: 9px 11px;
  border-radius: 4px;
  background: #17202a;
  color: #fff;
  font-size: 9px;
  box-shadow: 0 8px 18px rgba(23, 32, 42, 0.22);
}

.market-tooltip strong { font-size: 12px; }
.market-tooltip small { color: rgba(255, 255, 255, 0.74); }

.market-lower-grid {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 14px;
}

.market-heatmap {
  display: grid;
  gap: 4px;
  padding: 3px 14px 16px;
}

.market-heatmap > span {
  display: none;
}

.market-heatmap > div {
  display: grid;
  grid-template-columns: repeat(14, minmax(8px, 1fr));
  gap: 3px;
}

.market-heatmap i {
  display: block;
  aspect-ratio: 1.5;
  border-radius: 2px;
  background: #dfe7ed;
}

.market-heatmap i[data-level="2"] { background: #efd6a9; }
.market-heatmap i[data-level="3"] { background: #e9b85e; }
.market-heatmap i[data-level="4"] { background: var(--nus-orange); }

.rolling-price-table th:nth-child(n + 2),
.rolling-price-table td:nth-child(n + 2) {
  text-align: right;
}

.average-meter {
  display: grid;
  grid-template-columns: 1fr 48px;
  align-items: center;
  gap: 8px;
}

.average-meter > span {
  position: relative;
  height: 7px;
  background: #e6eaee;
}

.average-meter > span::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--value);
  background: #73b7c9;
}

.sparkline {
  width: 84px;
  height: 22px;
  overflow: visible;
}

.sparkline polyline {
  fill: none;
  stroke: #167f96;
  stroke-width: 1.8;
}

.sparkline circle { fill: #167f96; }
.change-up { color: #c62828; font-weight: 800; }
.change-down { color: #16843d; font-weight: 800; }

.weather-analysis-content {
  grid-template-rows: auto auto minmax(360px, 1fr) minmax(260px, auto);
  align-content: start;
  min-height: calc(100vh - 61px);
}

.weather-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 66px;
  padding: 9px 12px;
  border: 1px solid #cfd8e0;
  background: #fff;
}

.weather-station-identity {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 2px 10px;
}

.weather-station-identity span,
.weather-station-identity small {
  color: #66778a;
  font-size: 9px;
}

.weather-station-identity strong {
  font-size: 12px;
}

.weather-station-identity small {
  grid-column: 2;
}

.weather-period-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(88px, 1fr));
  border: 1px solid #b9c5d0;
}

.weather-period-control button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-left: 1px solid #cfd8e0;
  border-radius: 0;
  background: #fff;
  color: #46586b;
  font-size: 10px;
  font-weight: 700;
}

.weather-period-control button:first-child {
  border-left: 0;
}

.weather-period-control button:hover {
  background: #f2f6f9;
}

.weather-period-control button.active {
  background: var(--nus-blue);
  color: #fff;
}

.weather-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #cfd8e0;
  background: #fff;
}

.weather-kpi-strip > div {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 90px;
  padding: 12px 15px;
  box-shadow: inset 3px 0 #b33c30;
}

.weather-kpi-strip > div + div {
  border-left: 1px solid #dbe2e8;
}

.weather-kpi-strip .humidity { box-shadow: inset 3px 0 #1769aa; }
.weather-kpi-strip .heat { box-shadow: inset 3px 0 var(--nus-orange); }
.weather-kpi-strip .wind { box-shadow: inset 3px 0 #247c70; }

.weather-kpi-strip span,
.weather-kpi-strip small {
  color: #66778a;
  font-size: 9px;
}

.weather-kpi-strip strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.weather-primary {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 360px;
}

.weather-chart-legend {
  align-items: center;
  font-size: 9px;
}

.weather-chart-frame {
  position: relative;
  min-height: 300px;
  padding: 4px 10px 8px;
}

.weather-chart-frame > svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 300px;
}

.weather-chart-grid line,
.weather-heat-grid line {
  stroke: #dce3e9;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.weather-chart-grid text,
.weather-heat-grid text,
.weather-chart-axis text,
.weather-axis-unit {
  fill: #66778a;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.weather-axis-unit {
  font-size: 8px;
  font-weight: 700;
}

.weather-axis-unit.right {
  text-anchor: end;
}

.weather-series,
.weather-heat-series {
  fill: none;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.weather-series.temperature { stroke: #b33c30; }
.weather-series.humidity { stroke: #1769aa; }

.weather-hover-line {
  stroke: #596a7b;
  stroke-width: 1;
  stroke-dasharray: 3 3;
  vector-effect: non-scaling-stroke;
}

.weather-hover-dot {
  fill: #fff;
  stroke-width: 2.5;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}

.weather-hover-dot.temperature { stroke: #b33c30; }
.weather-hover-dot.humidity { stroke: #1769aa; }

.weather-chart-hit {
  fill: transparent;
  cursor: crosshair;
  outline: none;
}

.weather-chart-hit:focus {
  fill: rgba(23, 105, 170, 0.035);
}

.weather-chart-tooltip {
  position: absolute;
  z-index: 4;
  top: 18px;
  display: grid;
  width: 220px;
  padding: 9px 10px;
  border: 1px solid #172536;
  border-radius: 3px;
  background: #172536;
  box-shadow: 0 8px 22px rgba(14, 29, 44, 0.2);
  color: #fff;
  pointer-events: none;
  transform: translateX(-50%);
}

.weather-chart-tooltip.align-right {
  transform: translateX(-82%);
}

.weather-chart-tooltip header {
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  color: #d9e2ea;
  font-size: 9px;
  font-weight: 700;
}

.weather-chart-tooltip > div {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 24px;
  font-size: 10px;
}

.weather-chart-tooltip span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.weather-chart-tooltip i {
  width: 9px;
  height: 2px;
}

.weather-chart-tooltip i.temperature { background: #e15b4e; }
.weather-chart-tooltip i.humidity { background: #54a4e5; }

.weather-chart-tooltip strong {
  font-variant-numeric: tabular-nums;
}

.weather-chart-tooltip small {
  margin-top: 4px;
  color: #aebdca;
  font-size: 8px;
}

.weather-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(430px, 1.08fr);
  gap: 14px;
}

.weather-heat-card,
.weather-forecast-card {
  min-height: 260px;
}

.weather-heat-chart {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  min-height: 170px;
  padding: 10px 12px 2px;
}

.weather-heat-summary {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 0 12px 14px 0;
  border-right: 1px solid #e1e7ec;
}

.weather-heat-summary > div {
  display: grid;
  gap: 3px;
}

.weather-heat-summary span {
  color: #66778a;
  font-size: 8px;
}

.weather-heat-summary strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.weather-heat-plot svg {
  display: block;
  width: 100%;
  height: 170px;
}

.weather-heat-plot {
  position: relative;
  cursor: crosshair;
}

.weather-risk-bands rect.low { fill: #e4f2ed; }
.weather-risk-bands rect.moderate { fill: #fff0d1; }
.weather-risk-bands rect.high { fill: #f9deda; }
.weather-risk-bands rect { opacity: 0.55; }

.weather-heat-series {
  stroke: #a75b00;
  stroke-width: 1.8;
}

.weather-heat-current {
  fill: #fff;
  stroke: #a75b00;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.weather-heat-hover-line {
  stroke: #596a7b;
  stroke-width: 1;
  stroke-dasharray: 3 3;
  vector-effect: non-scaling-stroke;
}

.weather-heat-hover-dot {
  fill: #fff;
  stroke: #a75b00;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.weather-heat-tooltip {
  position: absolute;
  z-index: 3;
  top: 10px;
  display: grid;
  gap: 2px;
  width: 140px;
  padding: 7px 9px;
  border-radius: 3px;
  background: #172536;
  color: #fff;
  pointer-events: none;
  transform: translateX(-50%);
}

.weather-heat-tooltip span,
.weather-heat-tooltip small {
  color: #c7d3de;
  font-size: 8px;
}

.weather-heat-tooltip strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.weather-threshold-key {
  display: flex;
  gap: 14px;
  padding: 7px 12px 10px;
  border-top: 1px solid #e1e7ec;
  color: #66778a;
  font-size: 8px;
}

.weather-threshold-key span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.weather-threshold-key i {
  width: 8px;
  height: 8px;
}

.weather-threshold-key i.low { background: #b5d8ca; }
.weather-threshold-key i.moderate { background: #edc56e; }
.weather-threshold-key i.high { background: #de8b82; }

.weather-forecast-list {
  display: grid;
}

.weather-forecast-row {
  display: grid;
  grid-template-columns: 84px minmax(140px, 1fr) minmax(150px, 0.8fr);
  align-items: center;
  gap: 13px;
  min-height: 49px;
  padding: 8px 13px;
  border-top: 1px solid #e2e7ec;
}

.weather-forecast-row:first-child {
  border-top: 0;
}

.weather-forecast-row time {
  color: #43566a;
  font-size: 9px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.weather-forecast-row > div {
  display: grid;
  gap: 2px;
}

.weather-forecast-row strong {
  font-size: 10px;
}

.weather-forecast-row span,
.weather-forecast-row dt {
  color: #66778a;
  font-size: 8px;
}

.weather-forecast-row dl {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 0;
}

.weather-forecast-row dl > div {
  display: grid;
  gap: 2px;
}

.weather-forecast-row dd {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
}

.weather-loading,
.weather-empty {
  display: grid;
  place-content: center;
  gap: 4px;
  min-height: 150px;
  color: #66778a;
  font-size: 10px;
  text-align: center;
}

.weather-empty strong {
  color: #28394a;
  font-size: 12px;
}

.tag.high {
  background: #f9deda;
  color: #9d2c25;
}

.coverage-key {
  display: flex;
  gap: 7px;
}

.matrix {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 4px;
  background: #e8edf2;
  color: #93a0ad;
  font-weight: 800;
}

.matrix.complete {
  background: #dff2ef;
  color: #14766b;
}

.matrix.partial {
  background: #fff0d4;
  color: #9a6200;
}

.coverage-table td:nth-child(2),
.coverage-table td:nth-child(3),
.coverage-table td:nth-child(4),
.coverage-table th:nth-child(2),
.coverage-table th:nth-child(3),
.coverage-table th:nth-child(4) {
  text-align: center;
}

.token-panel,
.trend-modal-backdrop,
.brick-modal-backdrop {
  z-index: 40;
}

@media (max-width: 1260px) {
  .app-shell {
    grid-template-columns: 76px 340px minmax(0, 1fr);
  }

  .rail-nav button {
    width: 58px;
  }

  .control-panel {
    padding-right: 16px;
    padding-left: 16px;
  }

  .panel-header {
    margin-right: -16px;
    margin-left: -16px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .performance-drawer {
    width: 270px;
  }

  .mapboxgl-ctrl-top-right,
  .mapboxgl-ctrl-bottom-right {
    right: 16px;
  }

  .workspace-content {
    padding: 12px;
  }

  .engineering-table {
    font-size: 9px;
  }

  .engineering-table th,
  .engineering-table td {
    padding-right: 8px;
    padding-left: 8px;
  }

  .weather-lower-grid {
    grid-template-columns: 1fr;
  }

  .weather-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .weather-kpi-strip > div:nth-child(3),
  .weather-kpi-strip > div:nth-child(4) {
    border-top: 1px solid #dbe2e8;
  }

  .weather-kpi-strip > div:nth-child(3) {
    border-left: 0;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 70px 320px minmax(660px, 1fr);
    overflow: auto;
  }

  .control-panel,
  .map-stage {
    grid-row: 1;
  }

  .rail {
    grid-row: 1;
    grid-template-columns: 1fr;
    grid-template-rows: 64px minmax(0, 1fr) auto;
    min-height: 680px;
  }

  .rail-nav {
    display: grid;
  }

  .weather-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .weather-period-control {
    width: 100%;
  }
}

/* Industrial analysis workspace refresh */
.app-shell {
  grid-template-columns: 78px 500px minmax(0, 1fr);
}

.rail {
  padding-right: 10px;
  padding-left: 10px;
}

.rail-nav button,
.rail-guide,
.rail-settings,
.rail-icon,
.dashboard-card,
.summary-strip,
.source-chip,
.toolbar-button,
.search-input,
.field-control,
.live-summary,
.building-card,
.realtime-trends,
.realtime-drawer,
.tag,
.status-pill {
  border-radius: 3px;
}

.rail-nav button,
.rail-guide {
  width: 58px;
  border-left: 3px solid transparent;
}

.rail-nav button.active {
  border-left-color: var(--nus-orange);
  background: var(--nus-blue);
}

.control-panel {
  padding-right: 22px;
  padding-left: 22px;
}

.panel-header {
  margin-right: -22px;
  margin-left: -22px;
  padding-right: 22px;
  padding-left: 22px;
}

.panel-section h3,
.section-header h3 {
  letter-spacing: 0;
}

.search-input {
  min-height: 38px;
  background: #fbfcfd;
}

.building-list {
  gap: 0;
  max-height: 276px;
  border: 1px solid var(--workspace-line);
  border-bottom: 0;
}

.building-list-item {
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 9px;
  min-height: 52px;
  padding: 7px 9px;
  border: 0;
  border-bottom: 1px solid var(--workspace-line);
  border-left: 3px solid transparent;
  border-radius: 0;
  background: #fff;
}

.building-list-item:hover {
  background: #f3f7fa;
}

.building-list-item.selected {
  border-left-color: var(--nus-orange);
  background: #edf5fb;
}

.building-list-item.unavailable {
  background: #fafbfc;
  color: #697888;
}

.building-select-indicator,
.building-list-item span.building-select-indicator {
  width: 16px;
  min-height: 16px;
  border: 1px solid #aab7c3;
  border-radius: 2px;
  background: #fff;
  color: #fff;
  font-size: 10px;
}

.building-list-item.selected .building-select-indicator {
  border-color: var(--nus-blue);
  background: var(--nus-blue);
}

.building-list-item strong {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
}

.building-list-item strong b {
  min-width: 42px;
  color: var(--nus-blue);
  font-size: 11px;
}

.building-list-item small {
  font-size: 9px;
}

.building-list-item > em {
  color: #637386;
  font-size: 8px;
  font-style: normal;
  font-weight: 750;
  text-transform: uppercase;
}

.analysis-controls {
  display: grid;
  gap: 7px;
  padding: 12px 0;
  border-top: 1px solid var(--workspace-line);
  border-bottom: 1px solid var(--workspace-line);
}

.analysis-controls .field-label:not(:first-child) {
  margin-top: 5px;
}

.building-period-control {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.building-metric-control,
.market-range-control {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.building-snapshot {
  padding: 12px;
  box-shadow: none;
}

.building-snapshot .building-card-header h3 {
  margin-top: 2px;
  font-size: 16px;
}

.engineering-metric-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 12px 0 0;
  border-top: 1px solid var(--workspace-line);
  border-left: 1px solid var(--workspace-line);
}

.engineering-metric-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 42px;
  padding: 7px 8px;
  border-right: 1px solid var(--workspace-line);
  border-bottom: 1px solid var(--workspace-line);
  border-radius: 0;
  background: #f8fafb;
}

.engineering-metric-list dt {
  color: #5a6979;
  font-size: 9px;
}

.engineering-metric-list dd {
  margin: 0;
  font-size: 11px;
  font-weight: 750;
  text-align: right;
}

.building-snapshot .insight-text {
  margin-bottom: 0;
  color: #586879;
  font-size: 10px;
  line-height: 1.45;
}

.workspace-content {
  gap: 12px;
  padding: 14px 16px 22px;
}

.building-analysis-content {
  grid-template-rows: auto auto auto;
  align-content: start;
}

.building-performance-grid {
  display: grid;
  grid-template-columns: minmax(0, 3.25fr) minmax(250px, 1fr);
  gap: 12px;
  min-height: 0;
}

.building-primary-chart {
  display: grid;
  grid-template-rows: auto auto auto;
  min-width: 0;
}

.building-chart-header {
  align-items: flex-start;
  gap: 18px;
}

.building-chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px 14px;
  max-width: 58%;
}

.building-chart-legend span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  color: #172536;
}

.building-chart-legend span::before {
  width: 9px;
  height: 2px;
  margin-right: 2px;
}

.building-chart-legend b {
  font-size: 10px;
}

.building-chart-legend small {
  color: #657589;
  font-size: 8px;
  line-height: 1.15;
}

.building-chart-legend .unavailable {
  opacity: 0.68;
}

.building-chart-legend .unavailable::before {
  background: repeating-linear-gradient(90deg, #8996a3 0 3px, transparent 3px 5px);
}

.building-chart-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 0;
  margin: 0 14px;
  overflow: hidden;
  border: 1px solid #d6dee6;
  background: #f8fafc;
}

.building-chart-kpis > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  min-height: 64px;
  padding: 9px 11px;
  align-content: center;
}

.building-chart-kpis > div + div {
  border-left: 1px solid #d6dee6;
}

.building-chart-kpis span,
.building-chart-kpis small {
  overflow: hidden;
  color: #68788a;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.building-chart-kpis strong {
  color: #172536;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.generated-chart {
  min-height: 0;
  padding: 8px 14px 13px;
}

.building-chart-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1120 / 390;
  min-height: 300px;
  overflow: visible;
}

.building-chart-frame svg {
  display: block;
  width: 100%;
  height: 100%;
}

.generated-grid line {
  stroke: #dde4ea;
  stroke-width: 1;
}

.generated-grid text,
.generated-axis text {
  fill: #637386;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.generated-unit {
  fill: #68788a;
  font-size: 9px;
  font-weight: 700;
}

.generated-series polyline {
  fill: none;
  stroke: var(--series);
  stroke-width: 2.35;
  vector-effect: non-scaling-stroke;
}

.generated-series circle {
  fill: #fff;
  stroke: var(--series);
  stroke-width: 1.65;
  vector-effect: non-scaling-stroke;
}

.generated-bars .generated-bar {
  fill: var(--series);
  opacity: 0.9;
  vector-effect: non-scaling-stroke;
}

.building-hover-line {
  stroke: #5f7284;
  stroke-width: 1;
  stroke-dasharray: 3 3;
  vector-effect: non-scaling-stroke;
}

.building-hover-dot {
  fill: #fff;
  stroke: var(--series);
  stroke-width: 2.5;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}

.building-chart-hit {
  fill: transparent;
  cursor: crosshair;
  outline: none;
}

.building-chart-hit:focus {
  fill: rgba(23, 105, 170, 0.035);
}

.building-chart-tooltip {
  position: absolute;
  z-index: 4;
  top: 24px;
  width: 230px;
  padding: 10px 11px;
  border: 1px solid #172536;
  border-radius: 3px;
  background: #172536;
  box-shadow: 0 8px 22px rgba(14, 29, 44, 0.2);
  color: #fff;
  pointer-events: none;
  transform: translateX(-50%);
}

.building-chart-tooltip.align-right {
  transform: translateX(-82%);
}

.building-chart-tooltip header {
  margin-bottom: 7px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  color: #d9e2ea;
  font-size: 9px;
  font-weight: 700;
}

.building-chart-tooltip > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 26px;
  font-size: 10px;
}

.building-chart-tooltip span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.building-chart-tooltip i {
  width: 8px;
  height: 2px;
  background: var(--series);
}

.building-chart-tooltip strong {
  display: grid;
  justify-items: end;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.building-chart-tooltip small {
  color: #aebdca;
  font-size: 7px;
  font-weight: 500;
}

.building-chart-empty {
  display: grid;
  place-content: center;
  min-height: 340px;
  border: 1px dashed #c9d3dc;
  background: #fafbfc;
  text-align: center;
}

.building-chart-empty strong {
  font-size: 15px;
}

.building-chart-empty p {
  max-width: 440px;
  margin: 6px 0 0;
  color: #647488;
  font-size: 10px;
}

.portfolio-ranking-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.portfolio-ranking {
  display: grid;
  align-content: start;
  padding: 5px 14px 14px;
}

.portfolio-rank-row {
  display: grid;
  grid-template-columns: 20px minmax(58px, 0.7fr) minmax(46px, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 72px;
  border-bottom: 1px solid #e4e9ed;
}

.portfolio-rank-row > span {
  color: #8895a1;
  font-size: 9px;
}

.portfolio-rank-label {
  display: grid;
  gap: 2px;
}

.portfolio-rank-label strong {
  font-size: 11px;
}

.portfolio-rank-label small {
  color: #758497;
  font-size: 8px;
}

.portfolio-rank-row > em {
  color: #34475a;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.portfolio-bar {
  height: 8px;
  background: #e7ebef;
}

.portfolio-bar i {
  display: block;
  height: 100%;
  background: var(--series);
}

.portfolio-rank-row.unavailable {
  opacity: 0.66;
}

.portfolio-rank-row.unavailable .portfolio-bar {
  background: repeating-linear-gradient(135deg, #e5eaee 0 4px, #f5f7f9 4px 8px);
}

.table-scroll {
  overflow: auto;
}

.building-comparison-table {
  min-width: 1000px;
}

.building-comparison-table th,
.building-comparison-table td {
  height: 37px;
}

.dashboard-card,
.summary-strip {
  border-color: #cfd8e0;
  box-shadow: none;
}

.dashboard-card > header {
  min-height: 54px;
  padding: 12px 13px 8px;
  border-bottom: 1px solid #e3e8ec;
}

.tag,
.status-pill {
  padding: 4px 7px;
  font-size: 9px;
}

.summary-strip {
  border-radius: 3px;
}

.summary-strip > div {
  min-height: 74px;
  padding: 12px 13px;
}

.summary-strip strong {
  font-size: 17px;
}

.engineering-table th {
  letter-spacing: 0.02em;
}

.market-analysis-content {
  grid-template-rows: 86px auto auto;
  align-content: start;
  min-height: calc(100vh - 61px);
}

.market-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #cfd8e0;
  background: #fff;
}

.market-kpi-strip > div {
  display: grid;
  gap: 2px;
  align-content: center;
  min-height: 84px;
  padding: 11px 14px;
  border-left: 3px solid var(--nus-blue);
}

.market-kpi-strip > div + div {
  border-top: 0;
  border-left: 1px solid #dbe2e8;
}

.market-kpi-strip > div:nth-child(2) { box-shadow: inset 3px 0 var(--nus-orange); }
.market-kpi-strip > div:nth-child(3) { box-shadow: inset 3px 0 #1769aa; }
.market-kpi-strip > div:nth-child(4) { box-shadow: inset 3px 0 #7aa6d1; }

.market-kpi-strip span,
.market-kpi-strip small {
  color: #607084;
  font-size: 9px;
}

.market-kpi-strip strong {
  font-size: 23px;
}

.market-data-card {
  min-height: 0;
}

.market-card-toolbar {
  align-items: center;
}

.market-view-toggle {
  display: grid;
  grid-template-columns: repeat(2, 72px);
}

.market-view-toggle button {
  min-height: 32px;
  border: 1px solid #b9c5d0;
  border-radius: 0;
  background: #fff;
  color: #46586b;
  font-size: 10px;
  font-weight: 700;
}

.market-view-toggle button + button {
  border-left: 0;
}

.market-view-toggle button.active {
  background: var(--nus-blue);
  color: #fff;
}

.market-view-panel.hidden {
  display: none;
}

.market-series-header {
  display: flex;
  justify-content: space-between;
  padding: 9px 14px 0;
  color: #647488;
  font-size: 9px;
}

.market-chart {
  height: 315px;
  padding: 0 12px 6px;
}

.market-y-axis text {
  fill: #68798b;
  font-size: 9px;
}

.market-generated-grid text {
  fill: #68798b;
  font-size: 9px;
}

[hidden] {
  display: none !important;
}

.market-crosshair {
  top: 28px;
  bottom: 31px;
}

.market-tooltip {
  top: 38%;
  border-radius: 2px;
}

.market-table-scroll {
  max-height: 380px;
}

.market-period-table {
  min-width: 1180px;
  font-variant-numeric: tabular-nums;
}

.market-period-table th,
.market-period-table td {
  height: 34px;
  padding: 6px 9px;
  text-align: right;
}

.market-period-table th:first-child,
.market-period-table th:nth-child(2),
.market-period-table td:first-child,
.market-period-table td:nth-child(2) {
  text-align: left;
}

.market-row-current {
  background: #d9e9f5;
}

.market-row-future {
  background: #edf4fa;
  color: #526779;
}

.market-state-key {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  padding: 9px 14px;
  border-top: 1px solid #dce3e9;
  color: #5e6e80;
  font-size: 9px;
}

.market-state-key span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.market-state-key i {
  width: 16px;
  height: 8px;
  border: 1px solid #c9d3dc;
  background: #fff;
}

.market-state-key i.current { background: #d9e9f5; }
.market-state-key i.future { background: #edf4fa; }

.market-performance-card .engineering-table th,
.market-performance-card .engineering-table td {
  height: 34px;
}

.market-snapshot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid #cfd8e0;
  border-left: 1px solid #cfd8e0;
}

.market-snapshot > div {
  display: grid;
  min-height: 70px;
  padding: 9px 10px;
  border-right: 1px solid #cfd8e0;
  border-bottom: 1px solid #cfd8e0;
  background: #f8fafb;
}

.market-snapshot span,
.market-snapshot small {
  color: #617185;
  font-size: 9px;
}

.market-snapshot strong {
  align-self: end;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.market-session dl {
  margin: 0;
  border-top: 1px solid #dbe2e8;
}

.market-session dl > div {
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 8px 2px;
  border-bottom: 1px solid #dbe2e8;
  font-size: 10px;
}

.market-session dt { color: #66778a; }
.market-session dd { margin: 0; font-weight: 700; }

@media (max-width: 1500px) {
  .app-shell {
    grid-template-columns: 76px 430px minmax(0, 1fr);
  }

  .building-performance-grid {
    grid-template-columns: minmax(0, 1.8fr) minmax(230px, 0.8fr);
  }
}

@media (max-width: 1700px) {
  .building-performance-grid {
    grid-template-columns: minmax(0, 1fr) 230px;
  }

  .building-chart-legend small {
    display: none;
  }

  .building-chart-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .building-chart-kpis > div:nth-child(3) {
    border-top: 1px solid #d6dee6;
    border-left: 0;
  }

  .building-chart-kpis > div:nth-child(4) {
    border-top: 1px solid #d6dee6;
  }
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 70px 390px minmax(720px, 1fr);
  }
}

/* Keep related platforms at the bottom of the navigation rail. */
.rail {
  grid-template-rows: 64px minmax(0, 1fr) auto;
}

.rail-related {
  display: grid;
  gap: 6px;
  padding: 8px 0 12px;
}

/* Match Urban DT navigation typography and its responsive sizes. */
.rail-product,
.rail-related .rail-guide {
  font-size: 12px;
}

.rail-nav button,
.rail-guide {
  font-weight: 700;
  text-align: center;
}

.rail-nav button,
.rail-nav .rail-guide {
  font-size: 11px;
  line-height: 1.15;
}

@media (max-width: 1200px) {
  .rail-product,
  .rail-related .rail-guide {
    font-size: 11px;
  }

  .rail-nav button,
  .rail-nav .rail-guide {
    font-size: 10px;
  }
}

@media (max-width: 860px) {
  .rail-nav button,
  .rail-nav .rail-guide {
    font-size: 11px;
  }
}

.building-select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(0, 61, 124, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.building-select:focus-visible {
  outline: 2px solid var(--nus-blue);
  outline-offset: 2px;
}

.building-analysis-content .building-performance-grid {
  grid-template-columns: minmax(0, 1fr);
}
