/* Clancy Global · 5D BIM simulation. White and blue, as the brand direction asks. */

:root {
  --ink: #0b1f3a;
  --ink-2: #2d4160;
  --muted: #62738b;
  --line: rgba(11, 31, 58, 0.09);
  --line-2: rgba(11, 31, 58, 0.16);
  --blue: #1d5bd8;
  --blue-2: #4a84f2;
  --blue-soft: #e6eefc;
  --bg: #f4f8fd;
  --card: rgba(255, 255, 255, 0.86);
  --amber: #e8920c;
  --sans: "Geist", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --bar: 60px;
  --gutter: clamp(12px, 1.5vw, 22px);
  --shadow: 0 1px 2px rgba(11, 31, 58, 0.05), 0 14px 34px -12px rgba(11, 31, 58, 0.22);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; font-feature-settings: "ss01"; }
h1, h2, h3, p, dl, dd, ol { margin: 0; }
ol { padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.fd-skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 500; text-decoration: none; }
.fd-skip:focus { top: 12px; }
em { font-style: normal; color: var(--blue); }

/* ---------- buttons ---------- */
.fd-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border-radius: 10px; border: 1px solid transparent;
  background: var(--blue); color: #fff; font: 500 14px/1 var(--sans); text-decoration: none; letter-spacing: -0.005em;
  transition: background-color 160ms var(--ease), transform 120ms var(--ease); }
.fd-btn:active { transform: scale(0.97); }
.fd-btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
@media (hover: hover) and (pointer: fine) {
  .fd-btn:hover { background: #164bb6; }
  .fd-btn--ghost:hover { background: rgba(11, 31, 58, 0.04); }
}

/* ---------- top bar ---------- */
.fd-top { position: fixed; inset: 0 0 auto; z-index: 30; height: var(--bar); display: flex; align-items: center; gap: 14px; padding: 0 var(--gutter);
  background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); border-bottom: 1px solid var(--line); }
/* clear of a phone's notch in landscape (viewport-fit=cover) */
.fd-top { padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
.fd-brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font: 500 17px/1 var(--sans); letter-spacing: -0.02em; color: var(--ink); white-space: nowrap; }
.fd-brand b { font-weight: 600; }
.fd-brand svg { width: 28px; height: 28px; flex: none; }
.fd-brand svg rect { fill: var(--blue); }
.fd-brand svg path { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; }
.fd-top-title { display: inline-flex; align-items: center; gap: 14px; color: var(--muted); font: 500 13px/1 var(--sans); white-space: nowrap; }
.fd-top-sep { width: 1px; height: 18px; background: var(--line-2); }
.fd-top-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.fd-views { display: flex; padding: 3px; border-radius: 11px; background: rgba(11, 31, 58, 0.055); }
.fd-views button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: 500 13px/1 var(--sans); cursor: pointer;
  transition: background-color 160ms var(--ease), color 160ms var(--ease); }
.fd-views button[aria-checked="true"] { background: #fff; color: var(--blue); box-shadow: 0 1px 2px rgba(11, 31, 58, 0.12); }
.fd-play { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 14px 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; color: var(--ink);
  font: 500 13px/1 var(--sans); cursor: pointer; transition: transform 120ms var(--ease); }
.fd-play:active, .fd-views button:active { transform: scale(0.97); }
.fd-play svg { width: 14px; height: 14px; fill: var(--blue); }
.fd-play .fd-i-pause, .fd-play[aria-pressed="true"] .fd-i-play { display: none; }
.fd-play[aria-pressed="true"] .fd-i-pause { display: block; }
.fd-cta { display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: 10px; background: var(--ink); color: #fff; font: 500 13px/1 var(--sans); text-decoration: none; transition: transform 120ms var(--ease); }
.fd-cta:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .fd-views button:hover { color: var(--ink); }
  .fd-views button[aria-checked="true"]:hover { color: var(--blue); }
  .fd-play:hover { border-color: rgba(11, 31, 58, 0.3); }
}

/* ---------- simulation ---------- */
.fd-sim { position: relative; height: 1000vh; }
html:not(.js) .fd-sim, .fd-sim[data-state="fallback"] { height: auto; }
.fd-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: linear-gradient(#cfe0f5, #eef3f8); }
/* fill the large viewport, so no band shows under the stage when a phone's toolbar hides; --tb (the toolbar's
   height, 0 on desktop) keeps what sits at the bottom of the stage above the toolbar while it shows */
@supports (height: 100lvh) { .fd-stage { height: 100lvh; --tb: calc(100lvh - 100svh); } }
html:not(.js) .fd-stage, .fd-sim[data-state="fallback"] .fd-stage { position: relative; height: auto; min-height: 70vh; }
.fd-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 900ms ease; }
.fd-sim[data-state="ready"] .fd-canvas { opacity: 1; }

.fd-loader { position: absolute; inset: 0 0 var(--tb, 0px); display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); font: 500 13px var(--sans); transition: opacity 400ms ease, visibility 400ms; }
.fd-loader span { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(29, 91, 216, 0.18); border-top-color: var(--blue); animation: fd-spin 0.9s linear infinite; }
@keyframes fd-spin { to { transform: rotate(1turn); } }
.fd-sim:not([data-state="loading"]) .fd-loader { opacity: 0; visibility: hidden; }
.fd-fallback { position: absolute; inset: var(--bar) 0 0; display: grid; place-content: center; padding: 24px; text-align: center; color: var(--ink-2); }

/* intro */
.fd-intro { position: absolute; left: clamp(20px, 5vw, 72px); top: 50%; transform: translateY(-50%); max-width: 620px; z-index: 5; transition: opacity 420ms var(--ease), transform 420ms var(--ease); }
.fd-intro::before { content: ""; position: absolute; inset: -40vh -30vw -40vh -20vw; z-index: -1; background: radial-gradient(closest-side, rgba(244, 248, 253, 0.85), rgba(244, 248, 253, 0)); pointer-events: none; }
.fd-eyebrow { font: 500 12px/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); }
.fd-intro h1 { margin: 16px 0 18px; font: 600 clamp(40px, 5.6vw, 82px)/0.98 var(--sans); letter-spacing: -0.045em; }
.fd-lede { max-width: 30em; font-size: clamp(15px, 1.15vw, 17px); color: var(--ink-2); }
.fd-cue { display: inline-flex; align-items: center; gap: 10px; margin-top: 26px; font: 500 12px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.fd-cue span { width: 18px; height: 28px; border: 1.5px solid currentColor; border-radius: 10px; position: relative; }
.fd-cue span::after { content: ""; position: absolute; left: 50%; top: 6px; width: 2px; height: 6px; margin-left: -1px; border-radius: 2px; background: currentColor; }
@media (prefers-reduced-motion: no-preference) { .fd-cue span::after { animation: fd-cue 1.8s var(--ease) infinite; } }
@keyframes fd-cue { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(9px); opacity: 0; } 100% { opacity: 0; } }
.fd-sim:not([data-stage="intro"]) .fd-intro { opacity: 0; transform: translateY(calc(-50% - 16px)); pointer-events: none; }

/* cards */
.fd-card { position: absolute; top: calc(var(--bar) + 14px); z-index: 4; padding: 16px 18px 16px; border-radius: 16px; background: var(--card);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line); max-height: calc(100svh - var(--bar) - 200px); overflow: hidden;
  transition: opacity 300ms var(--ease), transform 300ms var(--ease); }
.fd-card--prog { left: var(--gutter); width: 286px; }
.fd-card--cost { right: var(--gutter); width: 304px; }
.fd-sim:not([data-stage="build"]) .fd-card, .fd-sim:not([data-stage="build"]) .fd-gantt, .fd-sim:not([data-stage="build"]) .fd-mobile {
  opacity: 0; transform: translateY(8px); pointer-events: none; }
.fd-kicker { display: flex; align-items: center; gap: 8px; font: 500 11px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.fd-kicker b { padding: 4px 6px; border-radius: 5px; background: var(--blue); color: #fff; font-weight: 500; letter-spacing: 0.04em; }
.fd-month { display: flex; align-items: baseline; gap: 8px; margin-top: 12px; }
.fd-month-n { font: 500 44px/1 var(--mono); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.fd-month-of { color: var(--muted); font-size: 13px; }
.fd-date { margin-top: 2px; font: 500 13px var(--mono); color: var(--blue); }
.fd-phase { margin-top: 12px; font: 600 16px/1.25 var(--sans); letter-spacing: -0.015em; }
.fd-activity { margin-top: 3px; min-height: 2.8em; font-size: 13px; line-height: 1.4; color: var(--muted); }
.fd-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; font-size: 12px; color: var(--muted); }
.fd-row b { font: 500 13px var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.fd-meter { position: relative; height: 6px; margin-top: 6px; border-radius: 6px; background: rgba(11, 31, 58, 0.07); overflow: hidden; }
.fd-meter i { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--blue-2)); transform: scaleX(var(--p, 0)); transform-origin: left; }
.fd-phases { display: grid; gap: 2px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.fd-phases li { display: grid; grid-template-columns: 10px 1fr 64px 34px; align-items: center; gap: 9px; height: 22px; font-size: 12.5px; color: var(--muted); transition: color 200ms ease; }
.fd-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--c); opacity: 0.35; transition: opacity 200ms ease; }
.fd-phases li.is-live, .fd-phases li.is-done { color: var(--ink); }
.fd-phases li.is-live .fd-dot, .fd-phases li.is-done .fd-dot, .fd-sim[data-view="1"] .fd-dot { opacity: 1; }
.fd-phases li.is-live .fd-pname { font-weight: 600; }
.fd-pmeter { position: relative; height: 4px; border-radius: 4px; background: rgba(11, 31, 58, 0.07); overflow: hidden; }
.fd-pmeter i { position: absolute; inset: 0; background: var(--c); transform: scaleX(var(--p, 0)); transform-origin: left; }
.fd-ppct { text-align: right; font: 500 11px var(--mono); font-variant-numeric: tabular-nums; }

.fd-label-sm { margin-top: 12px; font-size: 12px; color: var(--muted); }
.fd-spent { font: 500 30px/1.1 var(--mono); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.fd-budget { margin-top: 6px; font-size: 12px; color: var(--muted); }
.fd-budget span { font-family: var(--mono); color: var(--ink); }
.fd-curve { display: block; width: 100%; height: auto; margin-top: 10px; overflow: visible; }
.fd-c-grid { stroke: var(--line); stroke-width: 1; }
.fd-c-budget { stroke: rgba(11, 31, 58, 0.28); stroke-width: 1; stroke-dasharray: 3 3; }
.fd-c-axis { font: 500 9px var(--mono); fill: var(--muted); }
.fd-c-planned { fill: none; stroke: rgba(11, 31, 58, 0.35); stroke-width: 1.4; stroke-dasharray: 4 3; }
.fd-c-area { fill: rgba(29, 91, 216, 0.1); stroke: none; }
.fd-c-actual { fill: none; stroke: var(--blue); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.fd-c-now { stroke: rgba(29, 91, 216, 0.35); stroke-width: 1; }
.fd-c-dot { fill: #fff; stroke: var(--blue); stroke-width: 2; }
.fd-curve-key { display: flex; gap: 14px; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.fd-curve-key span { display: inline-flex; align-items: center; gap: 6px; }
.fd-curve-key span::before { content: ""; width: 16px; height: 0; border-top: 2px solid var(--blue); }
.fd-curve-key .is-planned::before { border-top: 1.5px dashed rgba(11, 31, 58, 0.45); }
.fd-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.fd-kpis dt { font-size: 11.5px; color: var(--muted); }
.fd-kpis dd { margin-top: 2px; font: 500 16px var(--mono); font-variant-numeric: tabular-nums; }
.fd-kpis dd.is-warn { color: var(--amber); }
.fd-heat { display: none; align-items: center; gap: 8px; margin-top: 12px; font-size: 11px; color: var(--muted); }
.fd-heat i { flex: 1; height: 6px; border-radius: 6px; background: linear-gradient(90deg, #1c4bd0, #4fbad6, #f9c43c, #e5392b); }
.fd-sim[data-view="2"] .fd-heat { display: flex; }

/* gantt */
.fd-gantt { position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(var(--gutter) + env(safe-area-inset-bottom) + var(--tb, 0px)); z-index: 4; display: grid; grid-template-columns: 88px 1fr; grid-template-rows: auto auto; column-gap: 12px;
  padding: 12px 16px 8px; border-radius: 16px; background: var(--card); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.7); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); transition: opacity 300ms var(--ease), transform 300ms var(--ease); }
.fd-g-names { display: grid; grid-auto-rows: 13px; row-gap: 3px; font-size: 11px; line-height: 13px; color: var(--muted); }
.fd-g-names span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* pan-y: a vertical swipe that starts on the strip still scrolls the page (hud.js scrubs on a sideways drag or a tap) */
.fd-g-tracks { position: relative; display: grid; grid-auto-rows: 13px; row-gap: 3px; cursor: ew-resize; touch-action: pan-y; border-radius: 4px; }
.fd-g-row { position: relative; border-radius: 4px; background: repeating-linear-gradient(90deg, rgba(11, 31, 58, 0.045) 0 1px, transparent 1px 10%); }
.fd-g-bar { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; background: color-mix(in srgb, var(--c) 22%, transparent); overflow: hidden; }
.fd-g-bar i { position: absolute; inset: 0; background: var(--c); transform: scaleX(var(--p, 0)); transform-origin: left; }
.fd-g-head { position: absolute; top: -6px; bottom: -4px; left: calc(var(--t, 0) * 100%); width: 2px; margin-left: -1px; border-radius: 2px; background: var(--blue); pointer-events: none; }
.fd-g-head::before { content: ""; position: absolute; top: -3px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px #fff; }
.fd-g-tracks.is-dragging .fd-g-head::before { transform: scale(1.2); }
.fd-g-ticks { grid-column: 2; position: relative; height: 18px; margin-top: 4px; font: 500 9.5px/18px var(--mono); color: var(--muted); }
.fd-g-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.fd-g-ticks span:first-child { transform: none; }
.fd-g-ticks span:last-child { transform: translateX(-100%); }

/* labels */
.fd-labels { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.fd-label { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 11px 0 6px; margin: -14px 0 0 -6px;
  border-radius: 999px; background: rgba(255, 255, 255, 0.94); box-shadow: 0 1px 2px rgba(11, 31, 58, 0.1), 0 8px 20px -8px rgba(11, 31, 58, 0.3);
  font-size: 12.5px; white-space: nowrap; opacity: 0; transition: opacity 200ms var(--ease); will-change: transform; max-width: calc(100vw - 16px); }
.fd-label.is-on { opacity: 1; }
.fd-label-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
/* sim.js narrows the label to the free part of the screen; a long name then ends in "…", the cost stays */
.fd-label-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.fd-label-cost { flex: none; font: 500 12px var(--mono); color: var(--blue); }

/* phone strip */
.fd-mobile { display: none; }

/* handover */
.fd-finale { position: absolute; left: clamp(20px, 5vw, 72px); bottom: clamp(24px, 7vh, 72px); z-index: 5; width: min(520px, calc(100vw - 40px)); padding: 26px 28px 24px; border-radius: 20px;
  background: rgba(255, 255, 255, 0.86); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
  opacity: 0; transform: translateY(14px); pointer-events: none; transition: opacity 420ms var(--ease), transform 420ms var(--ease); }
.fd-sim[data-stage="handover"] .fd-finale { opacity: 1; transform: none; pointer-events: auto; }
.fd-finale h2 { margin: 10px 0 18px; font: 600 clamp(28px, 2.8vw, 40px)/1.05 var(--sans); letter-spacing: -0.035em; }
.fd-finale dl { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 24px; margin-bottom: 22px; }
.fd-finale dt { font-size: 12px; color: var(--muted); }
.fd-finale dd { margin-top: 2px; font: 500 20px var(--mono); white-space: nowrap; }
.fd-note { margin-top: 14px; font-size: 12px; color: var(--muted); }

/* ---------- after ---------- */
.fd-after { position: relative; z-index: 2; padding: clamp(72px, 10vw, 140px) 0; background: #fff; }
.fd-wrap { width: min(1180px, 100% - 2 * max(clamp(16px, 4vw, 40px), env(safe-area-inset-left), env(safe-area-inset-right))); margin-inline: auto; }
.fd-after h2 { max-width: 20em; margin: 16px 0 clamp(36px, 5vw, 64px); font: 600 clamp(30px, 3.6vw, 52px)/1.04 var(--sans); letter-spacing: -0.04em; }
.fd-dims { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 28px); }
.fd-dims article { padding: 24px; border-radius: 16px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.fd-dim { display: inline-block; padding: 5px 8px; border-radius: 6px; background: var(--blue); color: #fff; font: 500 12px/1 var(--mono); }
.fd-dims h3 { margin: 18px 0 8px; font: 600 19px/1.25 var(--sans); letter-spacing: -0.02em; }
.fd-dims p:not(.fd-dim) { color: var(--ink-2); font-size: 15px; }
.fd-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin-top: clamp(36px, 5vw, 64px); padding: 26px 28px; border-radius: 18px; background: var(--ink); color: #fff; }
.fd-band p { font: 500 clamp(17px, 1.6vw, 21px)/1.3 var(--sans); letter-spacing: -0.015em; max-width: 26em; }
.fd-band-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.fd-band .fd-btn--ghost { color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.fd-foot { padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.fd-foot .fd-wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }

/* ---------- smaller screens ---------- */
@media (max-height: 760px) and (min-width: 901px) {
  .fd-phases li { height: 19px; }
  .fd-activity { min-height: 0; }
  .fd-month-n { font-size: 36px; }
  .fd-curve { max-height: 110px; }
}
@media (max-width: 1180px) {
  .fd-top-title { display: none; }
}
/* iPad landscape and small windows: narrower cards leave the model more room */
@media (min-width: 901px) and (max-width: 1180px) {
  .fd-card--prog { width: 252px; }
  .fd-card--cost { width: 272px; }
  .fd-phases li { grid-template-columns: 10px 1fr 48px 34px; gap: 8px; }
}
@media (max-width: 900px) {
  :root { --bar: 56px; }
  .fd-card, .fd-gantt { display: none; }
  .fd-cta { display: none; }
  .fd-long { display: none; }
  .fd-mobile { position: absolute; left: max(10px, env(safe-area-inset-left)); right: max(10px, env(safe-area-inset-right)); bottom: calc(10px + env(safe-area-inset-bottom) + var(--tb, 0px));
    z-index: 4; display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px;
    padding: 14px 14px 12px; border-radius: 14px; background: var(--card); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
    transition: opacity 300ms var(--ease), transform 300ms var(--ease); }
  .fd-mobile span { display: block; font-size: 11px; color: var(--muted); }
  .fd-mobile b { display: block; margin-top: 2px; font: 500 13px/1.25 var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fd-mobile-bar { position: absolute; left: 14px; right: 14px; top: 6px; height: 3px; border-radius: 3px; background: rgba(11, 31, 58, 0.08); overflow: hidden; }
  .fd-mobile-bar i { position: absolute; inset: 0; background: var(--blue); transform: scaleX(var(--p, 0)); transform-origin: left; }
  /* the colour key of the 4D and 5D views (on larger screens it is in the cards) */
  .fd-mobile .fd-m-key { display: none; grid-column: 1 / -1; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding-top: 8px; border-top: 1px solid var(--line); }
  .fd-sim[data-view="1"] .fd-m-key, .fd-sim[data-view="2"] .fd-m-key { display: flex; }
  .fd-mobile .fd-m-ph { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); }
  .fd-mobile .fd-m-heat { display: none; flex: 1; align-items: center; gap: 8px; }
  .fd-mobile .fd-m-heat span { display: inline; }
  .fd-mobile .fd-m-heat i { flex: 1; height: 6px; border-radius: 6px; background: linear-gradient(90deg, #1c4bd0, #4fbad6, #f9c43c, #e5392b); }
  .fd-sim[data-view="2"] .fd-mobile .fd-m-ph { display: none; }
  .fd-sim[data-view="2"] .fd-mobile .fd-m-heat { display: flex; }
  .fd-intro { top: auto; bottom: calc(36px + env(safe-area-inset-bottom) + var(--tb, 0px)); transform: none;
    left: max(clamp(20px, 5vw, 72px), env(safe-area-inset-left)); right: max(20px, env(safe-area-inset-right)); }
  .fd-sim:not([data-stage="intro"]) .fd-intro { transform: translateY(-12px); }
  .fd-intro h1 { font-size: clamp(36px, 10vw, 54px); }
  .fd-finale { left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); width: auto; bottom: calc(12px + env(safe-area-inset-bottom) + var(--tb, 0px)); padding: 22px 20px; }
  .fd-finale dl { gap: 16px; }
  .fd-finale dd { font-size: 16px; }
  .fd-dims { grid-template-columns: 1fr; }
}
/* portrait tablets: the Gantt scrubber comes back, with the strip above it (the Gantt is 169 px tall) */
@media (min-width: 700px) and (max-width: 900px) and (min-height: 900px) {
  .fd-gantt { display: grid; }
  .fd-mobile { left: var(--gutter); right: var(--gutter); bottom: calc(var(--gutter) + 180px + env(safe-area-inset-bottom) + var(--tb, 0px)); }
}
/* phones in landscape: the opening text and the handover card take the left part of the short screen, the model
   stands to their right (sim.js) */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  :root { --bar: 52px; }
  .fd-intro { top: calc(var(--bar) + 10px); bottom: calc(12px + env(safe-area-inset-bottom) + var(--tb, 0px)); right: auto; max-width: min(440px, 54vw);
    display: flex; flex-direction: column; justify-content: safe center; }
  .fd-intro h1 { margin: 8px 0 10px; font-size: clamp(28px, 9vh, 40px); font-size: clamp(28px, 9svh, 40px); }
  .fd-lede { font-size: 14px; line-height: 1.45; }
  .fd-cue { margin-top: 12px; }
  .fd-finale { right: auto; width: min(420px, 56vw); bottom: calc(10px + env(safe-area-inset-bottom) + var(--tb, 0px)); padding: 14px 18px;
    max-height: calc(100% - var(--bar) - 20px - env(safe-area-inset-bottom) - var(--tb, 0px)); overflow-y: auto; }
  .fd-finale h2 { margin: 6px 0 10px; font-size: 22px; }
  .fd-finale dl { margin-bottom: 12px; }
  .fd-note { margin-top: 8px; }
}
@media (max-width: 560px) {
  .fd-brand span { display: none; }
  .fd-views button { padding: 0 10px; font-size: 12.5px; }
  .fd-play { position: relative; padding: 0 10px; }
  /* icon only, but "Play" / "Pause" stays the button's name for screen readers */
  .fd-play span { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .fd-mobile { grid-template-columns: 1fr 1fr; }
  .fd-mobile > div:nth-child(2) { grid-column: 1 / -1; }
}
@media (max-width: 380px) {
  .fd-finale { padding: 18px 16px; }
  .fd-finale h2 { font-size: 24px; }
  .fd-finale dl { grid-template-columns: auto auto; gap: 10px 20px; }
}
/* touch screens: controls at least 44 px tall (the view buttons 40 px, in a 46 px group) */
@media (pointer: coarse) {
  .fd-views button { min-height: 40px; }
  .fd-play, .fd-cta { min-height: 44px; }
  .fd-play { min-width: 44px; justify-content: center; }
  .fd-brand { min-height: 44px; min-width: 44px; }
}
/* tablets: the cards' and the Gantt's smallest text a size up */
@media (pointer: coarse) and (min-width: 700px) {
  .fd-kicker, .fd-ppct, .fd-g-names, .fd-kpis dt, .fd-curve-key { font-size: 12px; }
  .fd-g-ticks { font-size: 11px; }
  .fd-c-axis { font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .fd-card, .fd-gantt, .fd-intro, .fd-finale, .fd-label { transition: none; }
}
