/* ==========================================================================
   THE AGENTIC REDESIGN · design system
   Official HSO palette with the WCAG 2.2-checked text variants from the
   HSO AI Value Navigator.
      #00395F navy   #4A4A4A grey   #FFFFFF white  #627583 pale sky
      #00B294 teal   #079FC3 cyan   #F58974 salmon #F2B949 amber
   Brand-exact accents are used where they carry no text; darkened variants
   along their own hue carry text.
   ========================================================================== */
:root {
  --bg: #F4F7F9;
  --surface: #FFFFFF;
  --band: #EEF2F5;
  --band-2: #E7EDF2;
  --navy: #00395F;
  --navy-2: #002941;
  --navy-3: #0B4A74;

  --ink: #00395F;          /* 12.0:1 on white */
  --ink-2: #4A4A4A;        /*  8.9:1 */
  --muted: #5E707E;        /*  5.1:1 */
  --on-dark: #FFFFFF;
  --on-dark-2: #C7D6E1;

  --hairline: #D5DEE5;
  --border: #B8C6D1;
  --border-strong: #627583;

  --teal: #00B294;
  --teal-ui: #00A88C;
  --teal-ink: #00796A;
  --teal-deep: #00584A;
  --teal-soft: #E0F5F1;
  --teal-on-navy: #00BD9D;

  --cyan: #079FC3;
  --link: #057590;
  --link-hover: #045F74;
  --cyan-soft: #E2F3F8;

  --salmon: #F58974;
  --salmon-ui: #E8663F;
  --salmon-ink: #A83A1C;
  --salmon-soft: #FDECE8;

  --amber: #F2B949;
  --amber-ui: #B57D0A;
  --amber-ink: #7D5600;
  --amber-soft: #FDF3DF;

  --sky: #627583;

  /* One colour language: teal / amber / salmon mean good / caution / risk and nothing else. */
  --good: var(--teal-ink);
  --warn: var(--amber-ink);
  --bad: var(--salmon-ink);

  /* Score pillars have their own palette, the same on every surface (lobby, results, debrief, control room, screen). */
  --pillar-financial: #00395F;
  --pillar-customer: #079FC3;
  --pillar-people: #627583;
  --pillar-trust: #3E77A3;
  --pillar-agentic: #00B294;
  --pillar-financial-on-dark: #9CC3DD;
  --pillar-customer-on-dark: #5CCBE6;
  --pillar-people-on-dark: #B7C6D1;
  --pillar-trust-on-dark: #7FA7C4;
  --pillar-agentic-on-dark: #7FE8D2;

  /* Small text on navy: #00BD9D (--teal-on-navy) is for icons, bars and large numerals only. */
  --teal-on-navy-text: #7FE8D2;   /* 8.2:1 on navy */
  --muted-on-tint: #4F5F6B;       /* ≥ 5.6:1 on every soft tint and --band-2 */

  --focus: #00395F;

  /* Type scale and weights: use these instead of literal sizes. 12px is the floor for text. */
  --fs-xs: 12px;
  --fs-sm: 13.5px;
  --fs-md: 15px;
  --fs-base: 16px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: 28px;
  --fs-3xl: 36px;
  --fs-4xl: 48px;
  --fw-regular: 400;
  --fw-medium: 600;
  --fw-strong: 650;   /* labels, values */
  --fw-bold: 700;
  --fw-heavy: 800;    /* H1/H2 and hero numbers only */

  --radius-lg: 22px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --radius-pill: 999px;
  --shadow: 0 10px 30px rgba(0, 41, 65, .12);
  --shadow-sm: 0 3px 12px rgba(0, 41, 65, .08);
  --shadow-xs: 0 1px 3px rgba(0, 41, 65, .08);
  --maxw: 1240px;
  --gutter: 16px;
  --tap: 44px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); margin: 0 0 .4em; line-height: 1.15; letter-spacing: -.015em; }
h1 { font-size: clamp(26px, 4.2vw, 44px); font-weight: 800; letter-spacing: -.025em; }
h2 { font-size: clamp(21px, 2.8vw, 30px); font-weight: 800; }
h3 { font-size: 18px; font-weight: 750; }
h4 { font-size: 15px; font-weight: 750; }
p { margin: 0 0 .8em; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(0, 178, 148, .24); color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.on-dark :focus-visible, .topbar :focus-visible { outline-color: #fff; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
#app { min-height: 100vh; display: flex; flex-direction: column; }
.page { width: 100%; max-width: var(--maxw); margin-inline: auto; padding: 18px var(--gutter) 64px; flex: 1; }
.page-narrow { max-width: 760px; }
.page-wide { max-width: 1480px; }
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }
.stack-lg > * + * { margin-top: 28px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.row-top { align-items: flex-start; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-side { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-side { grid-template-columns: minmax(0, 1fr) 360px; }
  .grid-side-l { grid-template-columns: 320px minmax(0, 1fr); }
}
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.tiny { font-size: 12px; }
.strong { font-weight: 750; color: var(--ink); }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); }
.tabular { font-variant-numeric: tabular-nums; }
.good { color: var(--good); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.hr { height: 1px; background: var(--hairline); border: 0; margin: 18px 0; }

/* ---------- eyebrow / section headers ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 750;
  letter-spacing: .1em; text-transform: uppercase; color: var(--teal-deep);
  background: var(--teal-soft); padding: 6px 12px; border-radius: 999px;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal-ink); animation: pulse 2s infinite; }
.eyebrow-navy { color: #fff; background: rgba(255, 255, 255, .12); }
.eyebrow-amber { color: var(--amber-ink); background: var(--amber-soft); }
.eyebrow-salmon { color: var(--salmon-ink); background: var(--salmon-soft); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-title h2, .section-title h3 { margin: 0; }
.lede { font-size: clamp(16px, 1.6vw, 18.5px); color: var(--ink-2); max-width: 64ch; }
.kicker { font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-xs); min-width: 0;
}
.card-lg { padding: 24px; }
.card-flat { box-shadow: none; }
.card-band { background: var(--band); border-color: transparent; box-shadow: none; }
.card-navy {
  background: linear-gradient(135deg, var(--navy) 0%, #0B4A74 100%); color: var(--on-dark-2);
  border: 0; box-shadow: var(--shadow);
}
.card-navy h1, .card-navy h2, .card-navy h3, .card-navy h4, .card-navy .strong { color: #fff; }
.card-navy a { color: #9FE5D8; }
.card-accent { border-top: 4px solid var(--teal); }
.card-hover { transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--teal-ui); }
.card-selected { border: 2px solid var(--teal-ink); box-shadow: 0 0 0 4px var(--teal-soft); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-head h3, .card-head h4 { margin: 0; }
.card-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hairline); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--border-strong);
  background: #fff; color: var(--ink); font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none;
  transition: background .2s, color .2s, border-color .2s, transform .12s, box-shadow .2s; white-space: nowrap;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover { border-color: var(--teal-ink); color: var(--teal-deep); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--teal-ink); border-color: var(--teal-ink); color: #fff; }
.btn-primary:hover { background: var(--teal-deep); border-color: var(--teal-deep); color: #fff; }
.btn-navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.btn-danger { color: var(--salmon-ink); border-color: var(--salmon-ui); }
.btn-danger:hover { background: var(--salmon-soft); color: var(--salmon-ink); border-color: var(--salmon-ink); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--band); border-color: transparent; }
.btn-on-dark { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .35); color: #fff; }
.btn-on-dark:hover { background: rgba(255, 255, 255, .2); color: #fff; border-color: #fff; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn-lg { min-height: 54px; padding: 0 26px; font-size: 17px; }
.btn-block { width: 100%; }
.btn .arr { transition: transform .2s; }
.btn:hover .arr { transform: translateX(3px); }
.btn-icon { width: var(--tap); padding: 0; }
.btn-group { display: inline-flex; border: 1.5px solid var(--border-strong); border-radius: 999px; overflow: hidden; background: #fff; }
.btn-group > button { border: 0; background: none; min-height: 40px; padding: 0 14px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.btn-group > button + button { border-left: 1px solid var(--hairline); }
.btn-group > button.is-active { background: var(--teal-ink); color: #fff; }
.link-btn { background: none; border: 0; padding: 0; color: var(--link); font-weight: 650; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- pills / badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; background: var(--band); color: var(--ink-2); white-space: nowrap; line-height: 1.5;
}
.pill-teal { background: var(--teal-soft); color: var(--teal-deep); }
.pill-cyan { background: var(--cyan-soft); color: var(--link-hover); }
.pill-amber { background: var(--amber-soft); color: var(--amber-ink); }
.pill-salmon { background: var(--salmon-soft); color: var(--salmon-ink); }
.pill-navy { background: var(--navy); color: #fff; }
.pill-outline { background: transparent; border: 1px solid var(--border); }
.pill .sw { width: 9px; height: 9px; border-radius: 50%; }
.ready-pill { font-size: 12px; }
.ready-go { background: var(--teal-soft); color: var(--teal-deep); }
.ready-mid { background: var(--amber-soft); color: var(--amber-ink); }
.ready-base { background: var(--salmon-soft); color: var(--salmon-ink); }
.ready-go::before, .ready-mid::before, .ready-base::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.count-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--salmon-ui); color: #fff; font-size: 12px; font-weight: 800; }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); } .kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.kpi .kpi-label { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.kpi .kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi .kpi-delta { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .kpi-sub { font-size: 12px; color: var(--muted); }
.kpi-navy { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); }
.kpi-navy .kpi-label { color: var(--on-dark-2); }
.kpi-navy .kpi-value { color: #fff; }
.delta-up { color: var(--good); }
.delta-down { color: var(--bad); }
.delta-flat { color: var(--muted); }
.card-navy .delta-up, .kpi-navy .delta-up { color: #6FE3CF; }
.card-navy .delta-down, .kpi-navy .delta-down { color: #FFB3A3; }

/* ---------- meters ---------- */
.meter { height: 8px; background: var(--band-2); border-radius: 99px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--teal-ui); border-radius: 99px; transition: width .6s var(--ease); }
.meter-amber > i { background: var(--amber-ui); }
.meter-salmon > i { background: var(--salmon-ui); }
.meter-navy > i { background: var(--navy); }
.meter-over > i { background: var(--salmon-ui); }
.levels { display: inline-flex; gap: 3px; vertical-align: middle; }
.levels > i { width: 16px; height: 8px; border-radius: 3px; background: var(--band-2); }
.levels > i.on { background: var(--teal-ui); }
.levels > i.next { background: repeating-linear-gradient(135deg, var(--teal-ui) 0 3px, var(--teal-soft) 3px 6px); }
.levels-lg > i { width: 26px; height: 10px; }

/* ---------- avatars / team ---------- */
.avatar {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--band-2); color: var(--ink); font-weight: 800; font-size: 13px; position: relative; flex: none;
}
.avatar.is-online::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--teal); border: 2px solid #fff; }
.avatar.is-ready { box-shadow: 0 0 0 2px var(--teal-ink); }
.role-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
/* Roles are neutral (navy tones), so a COO or CIO chip never reads as a warning. */
.role-ceo, .role-cfo, .role-coo, .role-cio { color: var(--ink); }
.role-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.role-dot.role-ceo { background: #00395F; } .role-dot.role-cfo { background: #3E77A3; }
.role-dot.role-coo { background: #627583; } .role-dot.role-cio { background: #9DB0BE; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: var(--tap); padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--teal-ink); box-shadow: 0 0 0 4px var(--teal-soft); }
.input-lg { min-height: 54px; font-size: 18px; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--teal-ink); }
.range { width: 100%; accent-color: var(--teal-ink); }
.form-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.error-text { color: var(--salmon-ink); font-weight: 650; font-size: 14px; }

/* option cards (radio-like) */
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%;
  background: #fff; border: 1.5px solid var(--border); border-radius: 14px; padding: 14px 16px; cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s; color: var(--ink-2);
}
.opt:hover { border-color: var(--teal-ink); }
.opt .opt-mark { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--muted); }
.opt.is-selected { border-color: var(--teal-ink); background: var(--teal-soft); color: var(--ink); }
.opt.is-selected .opt-mark { border-color: var(--teal-ink); background: var(--teal-ink); color: #fff; }
.opt[disabled] { cursor: default; background: var(--band); border-style: dashed; box-shadow: none; color: var(--ink-2); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hairline); overflow-x: auto; scrollbar-width: none; margin-bottom: 18px; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; min-height: var(--tap);
  font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--teal-deep); border-bottom-color: var(--teal-ink); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--radius-sm); background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 750; background: var(--band); }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.table tr:last-child > :is(td, th) { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- top bar ---------- */
.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 40; box-shadow: 0 2px 12px rgba(0, 41, 65, .25); }
.topbar-inner { max-width: var(--maxw); margin: 0 auto; padding: 8px var(--gutter); display: flex; align-items: center; gap: 14px; min-height: 60px; }
.topbar-wide .topbar-inner { max-width: 1480px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; min-width: 0; }
.brand img { height: 26px; width: auto; filter: brightness(0) invert(1); }
.brand .wordmark { font-weight: 900; font-size: 20px; letter-spacing: .06em; color: #fff; background: rgba(255,255,255,.1); padding: 2px 9px; border-radius: 4px; }
.brand .brand-sub { font-size: 13px; font-weight: 650; color: var(--on-dark-2); border-left: 1px solid rgba(255, 255, 255, .25); padding-left: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.topbar .btn-ghost { color: #fff; }
.topbar .btn-ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.company-chip { display: inline-flex; align-items: center; gap: 8px; font-weight: var(--fw-bold); color: #fff; background: rgba(255, 255, 255, .1); padding: 5px 12px; border-radius: 999px; font-size: var(--fs-sm); max-width: min(460px, 38vw); min-width: 0; }
.company-chip .sw { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.company-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The team name tells the tables apart: it keeps its room, the fictional company's name gives way. */
.company-chip .company-chip-team { flex: 0 0 auto; max-width: 240px; }
.company-chip .company-chip-co { flex: 0 1 auto; min-width: 48px; font-weight: var(--fw-strong); color: var(--on-dark-2); }
.timer-chip { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; font-weight: var(--fw-bold); color: #fff; background: rgba(0, 178, 148, .22); padding: 5px 12px; border-radius: 999px; }
.timer-chip.is-low { background: rgba(245, 137, 116, .35); animation: pulse 1.4s infinite; }
@media (max-width: 719px) { .brand .brand-sub, .hide-sm { display: none !important; } .topbar-inner { gap: 8px; } }

/* ---------- phase rail ---------- */
.rail { background: var(--navy-2); }
.rail-inner { max-width: var(--maxw); margin: 0 auto; padding: 8px var(--gutter) 10px; display: flex; gap: 6px; }
.rail-step { flex: 1; min-width: 0; }
.rail-step .bar { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.rail-step .bar i { display: block; height: 100%; width: 0; background: var(--teal); border-radius: 3px; transition: width .6s var(--ease); }
.rail-step.is-done .bar i, .rail-step.is-current .bar i { width: 100%; }
.rail-step.is-current .bar i { background: linear-gradient(90deg, var(--teal), var(--cyan)); }
.rail-step .lbl { font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; color: rgba(199, 214, 225, .78); margin-top: 6px; font-weight: var(--fw-bold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-step.is-current .lbl { color: #fff; }
.rail-step.is-done .lbl { color: var(--on-dark-2); }

/* ---------- broadcast / banners ---------- */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 14px; background: var(--cyan-soft); color: var(--ink); border: 1px solid #BFE3EE; }
.banner-amber { background: var(--amber-soft); border-color: #F4DDA6; }
.banner-salmon { background: var(--salmon-soft); border-color: #F7C8BD; }
.banner-teal { background: var(--teal-soft); border-color: #A9E3D7; }
.banner-navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.banner .banner-icon { flex: none; font-size: 18px; line-height: 1.3; }
.broadcast { animation: slideDown .5s var(--ease); }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 460px); pointer-events: none; }
.toast { pointer-events: auto; background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 600; animation: toastIn .35s var(--ease); }
.toast-error { background: var(--salmon-ink); }
.toast-good { background: var(--teal-deep); }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 25, 42, .55); z-index: 90; display: grid; place-items: center; padding: 16px; animation: fadeIn .2s; }
.modal { background: #fff; border-radius: 20px; box-shadow: 0 30px 80px rgba(0, 25, 42, .35); width: min(100%, 860px); max-height: calc(100vh - 32px); overflow: auto; animation: modalIn .35s var(--ease); }
.modal-sm { width: min(100%, 460px); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 0; position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-body { padding: 16px 22px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 22px 20px; flex-wrap: wrap; }

/* ---------- empty / loading ---------- */
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty h3 { color: var(--ink); }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--band-2); border-top-color: var(--teal-ink); animation: spin .9s linear infinite; margin: 40px auto; }
.skeleton { background: linear-gradient(90deg, var(--band) 25%, var(--band-2) 50%, var(--band) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 10px; min-height: 18px; }

/* ---------- process flow (legacy vs agentic) ---------- */
.flow { display: flex; flex-direction: column; gap: 8px; counter-reset: step; }
.flow-step { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--band); position: relative; }
.flow-step .flow-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; background: #fff; }
.flow-step .flow-who { font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.flow-step .flow-text { font-size: 14px; color: var(--ink); line-height: 1.35; }
.flow-step .flow-time { font-size: 12.5px; font-weight: 750; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.flow-legacy .flow-step { background: #F6F2EE; }
.flow-legacy .flow-step[data-actor="email"] .flow-icon, .flow-legacy .flow-step[data-actor="paper"] .flow-icon { background: var(--salmon-soft); }
.flow-legacy .flow-step[data-actor="spreadsheet"] .flow-icon, .flow-legacy .flow-step[data-actor="phone"] .flow-icon { background: var(--amber-soft); }
.flow-agentic .flow-step { background: var(--teal-soft); }
.flow-agentic .flow-step[data-actor="agent"] { background: linear-gradient(90deg, #D5F2EC, #E2F3F8); }
.flow-agentic .flow-step[data-actor="agent"] .flow-icon { background: var(--teal-ink); color: #fff; }
.flow-agentic .flow-step[data-actor="hitl"] { background: var(--amber-soft); }
.flow-agentic .flow-step[data-actor="hitl"] .flow-icon { background: var(--amber); }
.flow-step + .flow-step::before { content: ""; position: absolute; left: 28px; top: -9px; width: 2px; height: 10px; background: var(--border); }
.flow-compare { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .flow-compare { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* ---------- layer stack (architecture) ---------- */
.stack-arch { display: flex; flex-direction: column; gap: 6px; }
.stack-layer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--band); border-left: 5px solid var(--border); }
.stack-layer[data-level="1"] { border-left-color: var(--cyan); background: #EEF7FA; }
.stack-layer[data-level="2"] { border-left-color: var(--teal-ui); background: #E8F7F3; }
.stack-layer[data-level="3"] { border-left-color: var(--teal-deep); background: #D9F2EC; }
.stack-layer .layer-name { font-weight: 750; color: var(--ink); font-size: 14.5px; }
.stack-layer .layer-state { font-size: 12.5px; color: var(--muted); }
.stack-layer.is-people { margin-top: 6px; border-style: dashed; }

/* ---------- field note (real-world proof) ---------- */
.fieldnote { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; background: linear-gradient(120deg, var(--navy), #0B4A74); color: var(--on-dark-2); }
.fieldnote .fn-tag { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--teal-on-navy); }
.fieldnote .fn-text { color: #fff; font-weight: 600; }
.fieldnote .fn-src { font-size: 12px; color: var(--on-dark-2); margin-top: 4px; }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font); }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.chart-legend .key { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .key i { width: 14px; height: 3px; border-radius: 2px; background: currentColor; display: inline-block; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .login-wrap { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.login-hero { background: linear-gradient(150deg, var(--navy) 0%, #0B4A74 60%, #0E5E86 100%); color: var(--on-dark-2); padding: 32px 24px; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.login-hero h1 { color: #fff; max-width: 14ch; }
.login-hero .accent { color: var(--teal-on-navy); }
.login-hero .lede { color: var(--on-dark-2); }
/* The artwork has its own row above the text and shrinks to the room left there, so it never covers the text. */
.login-hero-art { flex: 1 1 auto; min-height: 0; position: relative; margin: 12px -24px 0 0; pointer-events: none; }
.login-hero-art svg.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; opacity: .9; }
.login-hero-text { position: relative; z-index: 1; padding-block: 20px 24px; }
@media (max-width: 959px) { .login-hero-art { display: none; } .login-hero-text { margin-top: auto; padding-top: 48px; } }
.login-demo { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.login-demo-row { display: flex; flex-wrap: wrap; gap: 8px; }
.login-demo-row .input { flex: 1 1 200px; min-width: 0; min-height: 44px; padding-block: 8px; }
.login-demo-row .btn { flex: 1 0 auto; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: var(--bg); }
.login-card { width: min(100%, 420px); }

/* ---------- print ---------- */
@media print {
  body { background: #fff; }
  .topbar, .rail, .no-print, .toasts { display: none !important; }
  .page { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ---------- motion ---------- */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.98); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.reveal { animation: rise .6s var(--ease) both; }
.reveal-2 { animation: rise .6s .08s var(--ease) both; }
.reveal-3 { animation: rise .6s .16s var(--ease) both; }
.reveal-4 { animation: rise .6s .24s var(--ease) both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- player shell ---------- */
.player-main { flex: 1 0 auto; }
.player-readybar { margin-top: auto; }
.stack-programs { display: grid; gap: 6px 14px; margin-top: 8px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .stack-programs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stack-program { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; gap: 8px; align-items: center; font-size: 13px; }
.stack-program .sp-name { font-weight: 650; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stack-program .sp-val { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 48px; text-align: right; }
.stack-program.is-next .sp-name::after { content: " ●"; color: var(--amber-ui); }
/* Data-heavy player screens use more of a large monitor (top bar and rail follow). */
@media (min-width: 1600px) {
  #app:has(.player-main[data-view="build"], .player-main[data-view="results"], .player-main[data-view="debrief"]) { --maxw: 1480px; }
}

/* Ready bar (self-paced): the ready toggle is the quiet button next to Continue. */
.shell-ready-toggle { border-color: var(--border); color: var(--ink-2); }
.shell-ready-toggle.is-on { background: var(--teal-soft); border-color: #A9E3D7; color: var(--teal-deep); }
/* Facilitator nudges (budget, capacity, a discovery point, a revealed insight). */
.shell-nudges { align-items: center; }
.shell-nudges .banner-icon { color: var(--teal-deep); }
.shell-nudges-k { font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .08em; text-transform: uppercase; color: var(--teal-deep); }
.shell-nudge { font-weight: var(--fw-strong); }
/* Dialogs with more than one sentence (components.dialog). */
.ar-dialog .ar-dialog-body > * + * { margin-top: 10px; }
.ar-dialog .ar-dialog-body h3 { margin-bottom: 4px; font-size: var(--fs-lg); line-height: 1.3; }
.ar-dialog .ar-dialog-body p { margin-bottom: 0; }
.ar-dialog-k { font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ar-dialog-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); color: var(--ink); }
.ar-dialog-list li { position: relative; padding-left: 16px; line-height: 1.4; }
.ar-dialog-list li::before { content: ""; position: absolute; left: 2px; top: .5em; width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); }
.ar-dialog-list.is-warn li::before { background: var(--amber-ui); }
.ar-dialog-list.is-bad li::before { background: var(--salmon-ui); }
.ar-dialog-callout { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; font-size: var(--fs-sm); font-weight: var(--fw-medium); line-height: 1.45; }
.ar-dialog-callout svg { flex: none; margin-top: 1px; }
.ar-dialog-callout.is-warn { background: var(--amber-soft); color: var(--amber-ink); }
.ar-dialog-callout.is-bad { background: var(--salmon-soft); color: var(--salmon-ink); }

/* Headings focused after a phase change (app.applyGame) need no focus ring. */
.player-main [tabindex="-1"]:focus { outline: none; }

/* Unavailable and read-only options: never fade text with opacity (it drops below 4.5:1). Show the state with the
   surface and keep the reason line; the chosen option of a read-only choice stays in full colour. */
.unavailable { background: var(--band) !important; border: 1.5px dashed var(--border) !important; box-shadow: none !important; color: var(--ink-2); }
.unavailable :is(h3, h4, strong, b, .title) { color: var(--ink-2); }
.readonly-choice { background: var(--surface); border-color: var(--hairline) !important; box-shadow: none !important; color: var(--ink-2); cursor: default; }
.readonly-choice.is-chosen { background: var(--teal-soft); border-color: var(--teal-ui) !important; color: var(--teal-deep); }
.pillar-financial { --pillar: var(--pillar-financial); } .pillar-customer { --pillar: var(--pillar-customer); }
.pillar-people { --pillar: var(--pillar-people); } .pillar-trust { --pillar: var(--pillar-trust); } .pillar-agentic { --pillar: var(--pillar-agentic); }
