/* Symphony integration explorer
   Type: Hanken Grotesk (one family, weight carries hierarchy)
   Colour: Intelance navy as signature, teal for the proposed route, grey for existing routes, purple for a waiting update */

:root {
  --navy: #06275E;
  --navy-deep: #041B42;
  --teal: #155E75;
  --teal-soft: #E3F1F4;
  --cyan: #22B8CF;
  --purple: #8B2CF5;
  --purple-soft: #F2EAFB;
  --red: #9E2B25;
  --grey-route: #8C94A3;
  --ink: #0B1220;
  --text: #1F2937;
  --muted: #4B5563;
  --faint: #7B8494;
  --line: #D9E0EA;
  --line-soft: #E7ECF3;
  --paper: #FFFFFF;
  --canvas: #F4F7FB;
  --tint: #E9EFF8;
  --band: #E6F2FA;

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

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}
h1, h2, h3, h4, p { margin: 0; }
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: 66px; 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: 42px; background: rgba(255,255,255,0.28); }
.brand-title h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; color: #fff; }
.brand-title p { margin-top: 2px; font-size: 14px; color: rgba(255,255,255,0.82); }
.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: 38px; padding: 0 20px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.btn-ghost { color: #fff; border: 1.5px solid rgba(255,255,255,0.65); background: transparent; }
.btn-ghost:hover { background: #fff; color: var(--navy); border-color: #fff; }
.btn-solid { color: #fff; background: var(--navy); border: 1.5px solid var(--navy); }
.btn-solid:hover { background: var(--navy-deep); border-color: var(--navy-deep); }
.btn-solid:disabled { opacity: 0.55; cursor: default; }
.btn.wide { width: 100%; height: 42px; font-size: 15px; }
.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); }

/* ---------- tabs ---------- */
.tabs-strip { border-bottom: 1px solid var(--line); background: var(--paper); }
.tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; border: 0; background: none; padding: 14px 16px 12px; font-size: 15px; font-weight: 500;
  color: var(--muted); cursor: pointer; white-space: nowrap; transition: color 0.15s ease;
}
.tab:first-child { padding-left: 0; }
.tab:hover { color: var(--navy); }
.tab.active { color: var(--navy); font-weight: 700; }
.tab.active::after { content: ''; position: absolute; left: 16px; right: 16px; bottom: -1px; height: 3px; background: var(--navy); border-radius: 2px 2px 0 0; }
.tab:first-child.active::after { left: 0; }

/* ---------- scenario strip ---------- */
.scenario-strip { background: var(--paper); border-bottom: 1px solid var(--line); }
.scenario-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 28px; padding-top: 14px; padding-bottom: 12px; }
.scenario-ref { font-size: 14px; font-weight: 700; color: var(--navy); }
.scenario-ref .dot { color: var(--faint); padding: 0 6px; }
.scenario-title h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); line-height: 1.2; margin-top: 2px; }
.scenario-note { font-size: 12.5px; color: var(--faint); margin-top: 3px; }
.scenario-mid { padding: 0 28px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.scenario-right { display: flex; align-items: center; gap: 18px; }

.segmented { position: relative; display: grid; height: 40px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--tint); }
.segmented.three { grid-template-columns: repeat(3, 96px); }
.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: 96px; height: calc(100% - 6px); background: var(--navy); border-radius: 3px; transition: transform 0.25s cubic-bezier(0.4,0,0.2,1); }
.segmented[data-pos="1"] .seg-thumb { transform: translateX(96px); }
.segmented[data-pos="2"] .seg-thumb { transform: translateX(192px); }

/* ---------- situation strip ---------- */
.situation-strip { background: var(--canvas); border-bottom: 1px solid var(--line); }
.situation-row { display: flex; align-items: center; gap: 28px; min-height: 52px; padding-top: 6px; padding-bottom: 6px; }
.situation-label { font-size: 15px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.situations { display: flex; align-items: center; gap: 28px; flex: 1; flex-wrap: wrap; }
.radio { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14.5px; color: var(--text); }
.radio input { position: absolute; opacity: 0; width: 0; height: 0; }
.radio .rb { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #8C94A3; background: #fff; position: relative; transition: border-color 0.15s ease; flex: none; }
.radio .rb::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--navy); transform: scale(0); transition: transform 0.18s cubic-bezier(0.4,0,0.2,1); }
.radio input:checked + .rb { border-color: var(--navy); border-width: 2px; }
.radio input:checked + .rb::after { transform: scale(1); }
.radio input:focus-visible + .rb { outline: 3px solid rgba(6,39,94,0.35); outline-offset: 2px; }
.radio input:checked ~ span { font-weight: 600; color: var(--ink); }
.situation-state { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); white-space: nowrap; padding-left: 28px; border-left: 1px solid var(--line); min-height: 28px; }
.state-icon { width: 16px; height: 16px; flex: none; display: inline-block; }
.state-icon.pause { background: linear-gradient(to right, var(--ink) 0 38%, transparent 38% 62%, var(--ink) 62%); }
.state-icon.hold { border: 2.5px solid var(--purple); border-radius: 50%; width: 15px; height: 15px; box-sizing: border-box; position: relative; }
.state-icon.hold::after { content: ''; position: absolute; left: 3px; top: 4px; width: 5px; height: 2px; background: var(--purple); }
.state-icon.ok { width: 9px; height: 15px; border-right: 2.5px solid var(--teal); border-bottom: 2.5px solid var(--teal); transform: rotate(45deg) translate(-2px, -3px); }
.state-icon.run { width: 12px; height: 12px; border-radius: 50%; background: var(--teal); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.35; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1); } }

/* ---------- routes ---------- */
.routes { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding-top: 22px; }
.routes[data-view="today"] .proposed, .routes[data-view="proposed"] .current { display: none; }
.routes[data-view="today"], .routes[data-view="proposed"] { grid-template-columns: minmax(0, 640px); justify-content: center; }
.route-panel h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); }
.route-sub { font-size: 15px; color: var(--muted); margin-top: 2px; }
.diagram { margin-top: 14px; }
.diagram svg { display: block; width: 100%; height: auto; overflow: visible; }
.route-caption { font-size: 15px; font-weight: 600; color: var(--ink); margin-top: 8px; }
.route-fine { font-size: 12.5px; color: var(--faint); margin-top: 4px; }
.route-fine.strong { font-size: 14px; color: var(--muted); }

.legend { display: flex; justify-content: center; gap: 36px; padding: 18px 0 22px; flex-wrap: wrap; }
.lg { display: inline-flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--faint); }

/* SVG boxes */
.node rect { fill: #fff; stroke: #5B6B86; stroke-width: 1.5; transition: fill 0.35s ease, stroke 0.35s ease, opacity 0.35s ease; }
.node text { fill: var(--ink); font-family: var(--font); transition: fill 0.35s ease, opacity 0.35s ease; }
.node .t { font-size: 14px; font-weight: 700; }
.node .s { font-size: 11.5px; font-weight: 400; fill: var(--muted); }
.node.hub rect { fill: var(--navy); stroke: var(--navy); }
.node.hub text, .node.hub .s { fill: #fff; }
.node.hub .s { fill: rgba(255,255,255,0.85); }
.node.layer rect { fill: var(--teal); stroke: var(--teal); }
.node.layer text { fill: #fff; }
.node.layer .s { fill: rgba(255,255,255,0.88); }
.node.entry rect { stroke: var(--navy); }
.node.dest rect { stroke: #6E7C93; }
.node.dest .t { font-size: 13.5px; }
.node.dest .st { font-size: 12.5px; font-weight: 600; fill: var(--faint); }
.node.dest.ok rect { stroke: var(--teal); }
.node.dest.ok .st { fill: var(--teal); }
.node.dest.wait rect { stroke: var(--purple); }
.node.dest.wait .st { fill: var(--purple); }
.node.dest.none .st { fill: var(--faint); }
.node.dest.unknown rect { stroke-dasharray: 4 3; }
.node.dest.unknown .st { fill: var(--faint); font-style: italic; }
.node.hold rect { stroke: var(--purple); stroke-width: 2.5; fill: var(--purple-soft); }
.node.hold text { fill: var(--ink); }
.node.hold .s { fill: var(--purple); font-weight: 600; }
.node.dim { opacity: 0.4; }
.node.lit rect { filter: drop-shadow(0 4px 10px rgba(6,39,94,0.22)); }
.node.hub.lit rect, .node.layer.lit rect { filter: drop-shadow(0 6px 14px rgba(6,39,94,0.32)); }
.side-label { font-family: var(--font); font-size: 11px; fill: var(--faint); }
.side-label.teal { fill: var(--teal); font-weight: 600; }

.route { fill: none; stroke: var(--grey-route); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.route.teal { stroke: var(--teal); }
.route.purple { stroke: var(--purple); stroke-dasharray: 6 5; }
.route.animate { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); transition: stroke-dashoffset 0.55s ease-in-out; }
.route.animate.purple { stroke-dasharray: 6 5; stroke-dashoffset: 0; opacity: 0; transition: opacity 0.4s ease; }
.route.animate.on { stroke-dashoffset: 0; opacity: 1; }
.arrow { fill: var(--grey-route); transition: opacity 0.3s ease 0.3s; }
.arrow.teal { fill: var(--teal); }
.arrow.purple { fill: var(--purple); }
.arrow.animate { opacity: 0; }
.arrow.animate.on { opacity: 1; }
.pulse { fill: var(--cyan); opacity: 0; }
.pulse.on { animation: travel 0.6s linear forwards; }
@keyframes travel { 0% { opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- stays band ---------- */
.stays-band { background: var(--band); }
.stays-row { display: flex; align-items: center; gap: 22px; min-height: 60px; padding-top: 10px; padding-bottom: 10px; }
.stays-label { font-size: 17px; font-weight: 800; color: var(--navy); white-space: nowrap; }
.stays-rule { width: 1px; height: 30px; background: rgba(6,39,94,0.25); flex: none; }
.stays-row p { font-size: 14.5px; color: var(--text); }

/* ---------- record and resolve ---------- */
.record-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 44px; padding-top: 26px; padding-bottom: 30px; }
.record h2, .resolve h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); }
.record-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.record-table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.record-table th { text-align: left; font-size: 13px; font-weight: 700; color: var(--ink); padding: 8px 10px 8px 0; border-bottom: 1.5px solid var(--ink); }
.record-table td { font-size: 14px; padding: 11px 10px 11px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--text); transition: opacity 0.3s ease; }
.record-table td:first-child { font-weight: 600; color: var(--ink); width: 30%; }
.record-table td:nth-child(2) { width: 24%; }
.record-table .pending td { opacity: 0.35; }
.res-ok { color: var(--teal); font-weight: 700; }
.res-wait { color: var(--purple); font-weight: 700; }
.res-hold { color: var(--purple); font-weight: 700; }
.res-muted { color: var(--faint); }

.resolve { border-left: 1px solid var(--line); padding-left: 40px; }
.res-state { font-size: 18px; font-weight: 800; margin-top: 12px; color: var(--purple); }
.res-state.ok { color: var(--teal); }
.res-state.hold { color: var(--purple); }
.res-lines { margin-top: 10px; display: grid; gap: 4px; }
.res-lines p { font-size: 14.5px; color: var(--text); line-height: 1.45; }
#btnResolve { margin-top: 18px; }
#btnResolve[hidden] { display: none; }
.res-fine { font-size: 12.5px; color: var(--faint); margin-top: 8px; }
.res-fine + .res-fine { margin-top: 2px; }

/* ---------- values ---------- */
.value-strip { border-top: 1px solid var(--line); background: var(--canvas); }
.values { display: grid; grid-template-columns: repeat(3, 1fr); padding-top: 26px; padding-bottom: 26px; }
.value { padding: 0 36px; }
.value:first-child { padding-left: 0; }
.value + .value { border-left: 1px solid var(--line); }
.value h3 { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; color: var(--navy); }
.value p { font-size: 14.5px; color: var(--text); margin-top: 6px; max-width: 320px; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); background: var(--paper); }
.foot-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; min-height: 48px; padding-top: 10px; padding-bottom: 10px; font-size: 12px; color: var(--faint); }
.foot-mid { text-align: center; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; 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; background: #fff; border-radius: 6px; width: min(720px, 100%); max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,0.3); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 20px; font-weight: 800; color: var(--ink); }
.modal-close { border: 0; background: none; font-size: 28px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.modal-body { padding: 8px 24px 22px; overflow-y: auto; }
.modal-body h3 { font-size: 14px; font-weight: 700; color: var(--navy); margin-top: 16px; text-transform: none; }
.modal-body ul { margin: 6px 0 0; padding-left: 18px; }
.modal-body li { font-size: 14px; color: var(--text); margin-top: 5px; line-height: 1.5; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .scenario-row { grid-template-columns: minmax(0, 1fr) auto; }
  .scenario-right { grid-column: 1 / -1; justify-content: flex-start; }
  .record-grid { grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; }
  .resolve { padding-left: 28px; }
}
@media (max-width: 980px) {
  .brand-title p, .mast-tag { display: none; }
  .routes { grid-template-columns: 1fr; gap: 34px; }
  .situation-row { flex-wrap: wrap; }
  .situation-state { border-left: 0; padding-left: 0; width: 100%; }
  .record-grid { grid-template-columns: 1fr; gap: 26px; }
  .resolve { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 22px; }
  .values { grid-template-columns: 1fr; gap: 18px; }
  .value { padding: 0; }
  .value + .value { border-left: 0; border-top: 1px solid var(--line); padding-top: 18px; }
  .foot-inner { flex-direction: column; text-align: center; gap: 6px; }
}
@media (max-width: 640px) {
  :root { --gutter: 18px; }
  .mast-inner { flex-wrap: wrap; gap: 8px 14px; padding-top: 12px; padding-bottom: 12px; }
  .brand { gap: 14px; flex: 1 1 100%; }
  .brand-rule { display: none; }
  .brand-title h1 { font-size: 17px; }
  .mast-right { width: 100%; }
  .btn-ghost { height: 32px; padding: 0 12px; font-size: 13px; }
  .scenario-row { grid-template-columns: 1fr; gap: 14px; }
  .scenario-mid { padding: 0; border: 0; }
  .segmented.three { grid-template-columns: repeat(3, 1fr); width: 100%; }
  .seg-thumb { width: calc((100% - 6px) / 3); }
  .segmented[data-pos="1"] .seg-thumb { transform: translateX(100%); }
  .segmented[data-pos="2"] .seg-thumb { transform: translateX(200%); }
  .scenario-title h2 { font-size: 19px; }
  .situations { gap: 14px 20px; }
  .route-panel h2, .record h2, .resolve h2 { font-size: 21px; }
  .stays-row { flex-wrap: wrap; }
  .stays-rule { display: none; }
  .record-table th:nth-child(3), .record-table td:nth-child(3) { display: none; }
  .record-table td:first-child { width: 55%; }
}
@media (prefers-reduced-motion: reduce) {
  .route.animate, .arrow.animate, .seg-thumb, .node rect, .node text { transition: none; }
  .pulse.on, .state-icon.run { animation: none; }
}
