/* Symphony programme simulation
   Type: Hanken Grotesk (one family, weight carries hierarchy)
   Colour: Intelance navy as signature, teal for integration work, cyan for definition work, purple for warnings */

:root {
  --navy: #06275E;
  --navy-deep: #041B42;
  --teal: #155E75;
  --cyan: #22B8CF;
  --purple: #8B2CF5;
  --red: #9E2B25;
  --ink: #0B1220;
  --text: #1F2937;
  --muted: #4B5563;
  --line: #D9E0EA;
  --line-soft: #E7ECF3;
  --paper: #FFFFFF;
  --canvas: #F4F7FB;
  --window: #E1F4F9;
  --tint: #E9EFF8;
  --tint-warn: #F2EAFB;
  --tint-alert: #F8ECEA;

  --font: 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --wrap: 1560px;
  --gutter: 32px;
  --radius: 4px;
  --side: 300px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}
h1, h2, h3, h4, p { margin: 0; }
b { font-weight: 700; color: var(--ink); }
img { display: block; }
button { font: inherit; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- masthead ---------- */
.masthead { background: var(--navy); color: #fff; }
.mast-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  min-height: 64px; padding-top: 10px; padding-bottom: 10px;
}
.brand { display: flex; align-items: center; gap: 24px; min-width: 0; }
.brand-logo { height: 28px; width: auto; }
.brand-rule { width: 1px; height: 40px; background: rgba(255,255,255,0.28); }
.brand-title h1 { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; color: #fff; }
.brand-title p { margin-top: 2px; font-size: 13.5px; color: rgba(255,255,255,0.8); }
.mast-right { display: flex; align-items: center; gap: 22px; }
.mast-tag { font-size: 13px; color: rgba(255,255,255,0.85); white-space: nowrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 18px; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn-ghost { color: #fff; border: 1.5px solid rgba(255,255,255,0.6); background: transparent; }
.btn-ghost:hover { background: #fff; color: var(--navy); border-color: #fff; }
.btn-outline { color: var(--navy); border: 1.5px solid var(--navy); background: #fff; }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-outline.on { background: var(--navy); color: #fff; }
.link-btn { border: 0; background: none; padding: 0; color: var(--navy); font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--teal); }

/* ---------- controls strip ---------- */
.controls-strip { background: var(--paper); border-bottom: 1px solid var(--line); }
.controls-row {
  display: grid; grid-template-columns: 300px minmax(0, 1fr) 320px; align-items: start;
  padding-top: 12px; padding-bottom: 12px;
}
.control { padding: 0 32px; }
.control:first-child { padding-left: 0; }
.control + .control { border-left: 1px solid var(--line); }
.control-start { padding-right: 0; }
.control-label { font-size: 13px; font-weight: 700; color: var(--ink); }
.control-note { font-size: 12.5px; line-height: 1.4; color: var(--muted); margin-top: 6px; }

.segmented {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  margin-top: 8px; height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--tint);
}
.seg-btn {
  position: relative; z-index: 1; border: 0; background: transparent; font-size: 14px; font-weight: 600;
  color: var(--navy); cursor: pointer; border-radius: 3px; transition: color 0.2s ease;
}
.seg-btn.active { color: #fff; }
.seg-thumb {
  position: absolute; top: 3px; left: 3px; width: calc(50% - 3px); height: calc(100% - 6px);
  background: var(--navy); border-radius: 3px; transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
}
.segmented.on12 .seg-thumb { transform: translateX(100%); }

.slip-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: start; margin-top: 4px; }
.slip-track { position: relative; padding-bottom: 14px; }
.slip-unit { font-size: 13px; color: var(--muted); padding-top: 8px; }
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; height: 28px; margin: 0; padding: 0; background: transparent; outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--cyan) 0%, var(--cyan) var(--fill, 0%), var(--line) var(--fill, 0%), var(--line) 100%);
}
input[type="range"]::-moz-range-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--cyan) 0%, var(--cyan) var(--fill, 0%), var(--line) var(--fill, 0%), var(--line) 100%);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: var(--cyan); border: 2px solid #fff;
  box-shadow: 0 0 0 1.5px var(--cyan);
}
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--cyan); border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--cyan); }
input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--navy); outline-offset: 2px; }
.slip-ticks { position: absolute; left: 9px; right: 9px; bottom: 0; display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.slip-ticks span { width: 0; display: flex; justify-content: center; }

.start-row { display: flex; align-items: center; gap: 18px; margin-top: 2px; }
.start-date { font-size: 18px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.start-date.late { color: var(--purple); }
.start-rule { width: 1px; height: 26px; background: var(--line); }

/* ---------- KPI row ---------- */
.figures { background: var(--paper); border-bottom: 1px solid var(--line); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { padding: 12px 28px 14px; }
.kpi:first-child { padding-left: 0; }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.kpi-value { margin-top: 4px; font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -0.01em; color: var(--navy); white-space: nowrap; transition: color 0.3s ease; }
.kpi-note { margin-top: 5px; font-size: 12.5px; color: var(--muted); }
.kpi.warn .kpi-value { color: var(--purple); }
.kpi.alert .kpi-value { color: var(--red); }

/* ---------- panels ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 18px 22px 0; }
.panel-head > div:first-child { flex: 1 1 auto; min-width: 0; }
.panel-head .legend { flex: 0 0 auto; }
.tl-panel { display: flex; flex-direction: column; min-width: 0; }
.panel-head h2, .side-panel h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; color: var(--navy); line-height: 1.25; }
.panel-head h3 { font-size: 16px; font-weight: 700; color: var(--navy); }
.panel-sub { margin-top: 3px; font-size: 13px; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 18px; padding-top: 4px; }
.lg { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text); white-space: nowrap; }
.sw { width: 18px; height: 10px; flex: none; border-radius: 1px; }
.sw-dark { background: var(--navy); }
.sw-outline { border: 1px solid rgba(6,39,94,0.6); background: #fff; }
.sw-teal { background: var(--teal); }
.sw-cyan { background: var(--cyan); }
.sw-window { background: var(--window); }
.sw-dash { height: 0; border-top: 2px dashed var(--navy); }
.sw-over { background: transparent; border: 2px solid var(--purple); height: 12px; }

.main-section { padding: 14px 0 0; }
.main-grid { display: grid; grid-template-columns: minmax(0, 1fr) var(--side); gap: 14px; align-items: stretch; }
.swipe-hint { display: none; padding: 10px 22px 0; font-size: 13px; color: var(--muted); }
.timeline-wrap { flex: 1 1 auto; min-height: 350px; padding: 8px 14px 10px 10px; overflow: hidden; }
#timeline, #weekChart { display: block; font-family: var(--font); }

/* ---------- side panel ---------- */
.side-panel { padding: 18px 20px 20px; display: flex; flex-direction: column; }
.load-chart { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.load-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-rows: auto auto; column-gap: 14px; row-gap: 5px; align-items: baseline; }
.load-name { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.load-days { font-size: 13px; color: var(--text); }
.load-pct { font-size: 13px; font-weight: 700; color: var(--ink); min-width: 34px; text-align: right; }
.load-track { grid-column: 1 / -1; height: 8px; background: var(--tint); border-radius: 2px; overflow: hidden; }
.load-bar { height: 100%; width: 0; background: var(--navy); border-radius: 2px; transition: width 0.45s cubic-bezier(0.4,0,0.2,1); }
.load-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.side-note { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.side-block { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.side-block h3, .callout h3 { font-size: 14px; font-weight: 700; color: var(--navy); }
.side-block p { margin-top: 4px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.callout { margin-top: auto; padding: 12px 14px; background: var(--window); border-radius: var(--radius); }
.callout p { margin-top: 3px; font-size: 13px; color: var(--text); }
.side-panel .callout { margin-top: 16px; }

/* ---------- capacity section ---------- */
.capacity-section { padding: 22px 0 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.section-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; color: var(--navy); }
.section-tag { font-size: 13px; color: var(--muted); white-space: nowrap; }
.banner { margin-top: 12px; padding: 10px 20px; background: var(--window); border-radius: var(--radius); font-size: 13.5px; color: var(--ink); }

.person-row { display: flex; align-items: center; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.person-label { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.select-wrap { position: relative; }
.select-wrap::after {
  content: ''; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; margin-top: -5px;
  border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transform: rotate(45deg); pointer-events: none;
}
select {
  -webkit-appearance: none; appearance: none; height: 36px; min-width: 220px; padding: 0 40px 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
}
select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
.scenario-line { font-size: 13.5px; color: var(--text); margin-left: 8px; }
.person-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.hint { font-size: 12.5px; color: var(--muted); }

.cap-grid { margin-top: 12px; display: grid; grid-template-columns: minmax(0, 1fr) var(--side); }
.cap-chart { min-width: 0; }
.week-wrap { padding: 6px 18px 12px 8px; }
.cap-side { border-left: 1px solid var(--line); padding: 18px 20px 20px; display: flex; flex-direction: column; }
.cap-side h3 { font-size: 16px; font-weight: 700; color: var(--navy); }
.big-row { display: flex; align-items: baseline; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.big-row + .big-row { margin-top: 6px; }
.big { font-size: 28px; font-weight: 800; color: var(--ink); line-height: 1.1; white-space: nowrap; letter-spacing: -0.01em; }
.big.over { color: var(--purple); }
.big-note { font-size: 12.5px; color: var(--muted); flex: 1 1 120px; }
.adjust { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.adjust h4 { font-size: 14px; font-weight: 700; color: var(--navy); }
.adjust p { margin-top: 5px; font-size: 13px; color: var(--text); line-height: 1.45; }
.adjust .btn { margin-top: 12px; }
.cap-foot { margin-top: auto; padding-top: 14px; font-size: 12.5px; color: var(--muted); }

.defs-strip { margin-top: 18px; background: var(--tint); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.defs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 12px; padding-bottom: 12px; }
.def { padding: 0 24px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.def:first-child { padding-left: 0; }
.def + .def { border-left: 1px solid var(--line); }
.def b { font-size: 13px; }
.def span { color: var(--muted); }
.defs-note { padding-top: 8px; padding-bottom: 10px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line-soft); }

/* ---------- footer ---------- */
.foot { background: var(--canvas); }
.foot-inner { display: flex; justify-content: space-between; gap: 24px; padding-top: 12px; padding-bottom: 14px; font-size: 12.5px; color: var(--muted); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal-back { position: absolute; inset: 0; background: rgba(11,18,32,0.55); }
.modal-box { position: relative; width: min(720px, 100%); max-height: 90vh; overflow: auto; background: #fff; border-radius: 6px; box-shadow: 0 20px 60px rgba(4,27,66,0.35); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; background: var(--navy); color: #fff; position: sticky; top: 0; }
.modal-head h2 { font-size: 18px; font-weight: 700; color: #fff; }
.modal-close { border: 0; background: transparent; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.modal-body { padding: 8px 24px 24px; }
.modal-body h3 { margin-top: 18px; font-size: 14px; font-weight: 700; color: var(--navy); }
.modal-body ul { margin: 8px 0 0; padding-left: 20px; }
.modal-body li { font-size: 14px; line-height: 1.5; margin-top: 5px; color: var(--text); }

/* ---------- tooltip ---------- */
.tooltip {
  position: fixed; z-index: 70; max-width: 320px; padding: 12px 14px; background: var(--ink); color: #fff;
  font-size: 13px; line-height: 1.45; border-radius: var(--radius); pointer-events: none;
}
.tooltip b { display: block; color: #fff; margin-bottom: 4px; font-size: 13.5px; }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .controls-row { grid-template-columns: 260px minmax(0, 1fr) 280px; }
  .control { padding: 0 20px; }
  .kpi { padding: 12px 20px 14px; }
}
@media (max-width: 1080px) {
  .main-grid, .cap-grid { grid-template-columns: 1fr; }
  .side-panel .callout { margin-top: 16px; }
  .cap-side { border-left: 0; border-top: 1px solid var(--line); }
  .controls-row { grid-template-columns: 1fr 1fr; row-gap: 14px; }
  .control-start { grid-column: 1 / -1; border-left: 0; padding-left: 0; }
  .panel-head { flex-direction: column; gap: 10px; }
  .legend { justify-content: flex-start; }
}
@media (max-width: 900px) {
  :root { --gutter: 22px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
  .kpi:nth-child(4) { border-top: 1px solid var(--line); }
  .swipe-hint { display: block; }
  .timeline-wrap, .week-wrap { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
  .defs { grid-template-columns: 1fr; gap: 10px; }
  .def { padding: 0; }
  .def + .def { border-left: 0; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .mast-inner { flex-direction: column; align-items: flex-start; gap: 14px; min-height: 0; padding-top: 16px; padding-bottom: 16px; }
  .brand { gap: 14px; }
  .brand-rule { display: none; }
  .brand-logo { height: 24px; }
  .brand-title h1 { font-size: 19px; }
  .mast-right { width: 100%; justify-content: space-between; }
  .controls-row { grid-template-columns: 1fr; }
  .control { padding: 0; }
  .control + .control { border-left: 0; }
  .kpis { grid-template-columns: 1fr; }
  .kpi { padding: 10px 0; }
  .kpi + .kpi { border-left: 0; border-top: 1px solid var(--line); }
  .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .person-right { margin-left: 0; width: 100%; justify-content: space-between; }
  .scenario-line { margin-left: 0; width: 100%; }
  .timeline-wrap { min-height: 400px; }
  .foot-inner { flex-direction: column; gap: 6px; }
}
