:root {
  --vu-blue: #002664;
  --vu-white: #ffffff;
  --vu-gold: #847248;

  --ink: #0b1220;
  --muted: rgba(11, 18, 32, 0.70);
  --bg: #ffffff;
  --border: rgba(0, 38, 100, 0.18);
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: var(--ink);
  background: var(--bg);
}

.container {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  background: var(--vu-blue);
  color: var(--vu-white);
  padding: 28px 0;
  border-bottom: 6px solid var(--vu-gold);
}

.header-inner {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}

h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.1;
}

.kpi {
  min-width: 260px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 18px;
  padding: 16px 16px 14px;

  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.kpi-label { font-size: 14px; color: rgba(255, 255, 255, 0.88); width: 100%; }
.kpi-value { font-size: 32px; font-weight: 900; margin-top: 6px; width: 100%; }
.kpi-note  { margin-top: 14px; font-size: 14px; color: rgba(255, 255, 255, 0.88); width: 100%; }

.main { padding: 18px 0 34px; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 14px 14px 10px;
}

.card-head h3 {
  margin: 0;
  color: var(--vu-blue);
  font-size: 16px;
}

.muted {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.card-wide { grid-column: 1 / -1; }

.canvas-wrap {
  margin-top: 10px;
  position: relative;
  height: 320px;
}
.canvas-wrap.tall { height: 380px; }

/* Project overview */
.intro {
  margin-top: 16px;
  padding: 18px 18px 16px;
  border-top: 6px solid var(--vu-gold);
}

.intro-header {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.intro-header h2 {
  margin: 0;
  color: var(--vu-blue);
  font-size: 22px;
  letter-spacing: 0.2px;
}

.intro-body {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 18px;
  align-items: start;
}

.intro-copy p {
  margin: 0 0 12px;
  line-height: 1.65;
  font-size: 16px;
  color: var(--ink);

  text-align: justify;
  text-justify: inter-word;
}

.intro-copy p { hyphens: auto; }


/* Legend */
.legend-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: #fff;
}

.legend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.legend-head h3 {
  margin: 0;
  color: var(--vu-blue);
  font-size: 14px;
  letter-spacing: 0.2px;
}

.legend-btn {
  appearance: none;
  border: 1px solid rgba(132, 114, 72, 0.45);
  background: rgba(132, 114, 72, 0.10);
  color: var(--vu-blue);
  font-weight: 700;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}

/* Compact chip grid */
.legend-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 38, 100, 0.03);
}

.legend-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
  flex: 0 0 auto;
}

.legend-label {
  font-size: 13px;
  color: rgba(11, 18, 32, 0.90);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-switch {
  width: 36px;
  height: 22px;
  border-radius: 999px;
  position: relative;
  border: 1px solid rgba(0, 38, 100, 0.25);
  background: rgba(255,255,255,0.85);
  cursor: pointer;
  flex: 0 0 auto;
  padding: 0;
}

.legend-switch[data-on="true"] {
  background: rgba(0, 38, 100, 0.20);
  border-color: rgba(0, 38, 100, 0.35);
}

.legend-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--vu-blue);
  transition: transform 160ms ease;
}

.legend-switch[data-on="true"] .legend-knob {
  transform: translateX(14px);
}

.toast {
  margin-top: 10px;
  font-size: 13px;
  color: var(--vu-blue);
  min-height: 18px;
}

/* Responsive */
@media (max-width: 980px) {
  .header-inner { flex-direction: column; align-items: stretch; }
  .kpi { width: 100%; }
  .grid { grid-template-columns: 1fr; }
  .intro-body { grid-template-columns: 1fr; }
  .legend-body { grid-template-columns: 1fr; }
  h1 { font-size: 32px; }
}

@media (max-width: 640px) {
  .canvas-wrap { height: 280px; }
  .canvas-wrap.tall { height: 320px; }
}

canvas { display: block; }
.canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}