/* =====================================================================
   ServiceX – styles
   Colours are tokens at the top: change them here to restyle the game.
   The four pillar colours follow Olympic bumper plates.
   ===================================================================== */
:root {
  --chalk: #F1F3F2;
  --panel: #FFFFFF;
  --rubber: #24292E;
  --rubber-2: #343B42;
  --steel: #7D8891;
  --line: #D9DEE1;
  --ink: #24292E;
  --ink-soft: #55606A;

  --red: #D7263D;      /* Financial */
  --blue: #1D6FB0;     /* Customer + primary action */
  --yellow: #F2B705;   /* Employee */
  --green: #2E9E5B;    /* Service & Innovation */

  --blue-wash: #E6F0F8;
  --red-wash: #FBE8EA;
  --green-wash: #E6F4EC;
  --yellow-wash: #FDF4D8;

  --radius: 10px;
  --font-head: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Barlow", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--chalk); color: var(--ink);
  font-family: var(--font-body); font-size: 16px; line-height: 1.5;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.1; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: 2.6rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }
p { margin: 0 0 .8em; max-width: 72ch; }
b, strong { font-weight: 600; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.ico { flex: none; vertical-align: middle; }
.muted { color: var(--ink-soft); }
.small { font-size: .875rem; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- top bar ---------- */
.topbar { background: var(--rubber); color: #fff; position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1160px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 24px; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand-name { font-family: var(--font-head); font-size: 1.55rem; font-weight: 700; letter-spacing: .02em; }
.brand-mark { display: flex; align-items: center; gap: 2px; height: 26px; position: relative; padding: 0 3px; }
.brand-mark::before { content: ""; position: absolute; left: -4px; right: -4px; top: 12px; height: 2px; background: #B9C1C7; }
.brand-mark i { position: relative; display: block; width: 6px; border-radius: 2px; }
.brand-mark i:nth-child(1) { height: 26px; background: var(--red); }
.brand-mark i:nth-child(2) { height: 22px; background: var(--blue); }
.brand-mark i:nth-child(3) { height: 18px; background: var(--yellow); }
.brand-mark i:nth-child(4) { height: 14px; background: var(--green); }
.nav { display: flex; gap: 2px; flex-wrap: wrap; margin-left: auto; }
.nav button {
  background: none; border: 0; color: #C9D0D5; font: 500 .95rem var(--font-body); padding: 8px 12px; border-radius: 6px; cursor: pointer;
}
.nav button:hover { color: #fff; background: var(--rubber-2); }
.nav button[aria-current="page"] { color: #fff; background: var(--blue); }
.nav button:disabled { opacity: .35; cursor: not-allowed; background: none; }
.statusbar { background: var(--rubber-2); color: #DCE1E5; font-size: .875rem; }
.statusbar:empty { display: none; }
.statusbar .inner { max-width: 1160px; margin: 0 auto; padding: 6px 20px; display: flex; gap: 22px; flex-wrap: wrap; }
.statusbar b { color: #fff; }

/* ---------- page ---------- */
.page { max-width: 1160px; margin: 0 auto; padding: 28px 20px 48px; outline: none; }
.foot { text-align: center; color: var(--steel); font-size: .8rem; padding: 0 20px 28px; }
.foot p { margin: 0 auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 20px; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.page-head { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head .lead { margin: 4px 0 0; color: var(--ink-soft); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--blue); background: var(--blue); color: #fff;
  font: 600 1rem var(--font-body); padding: 10px 20px; border-radius: 999px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: #175C93; border-color: #175C93; }
.btn.ghost { background: transparent; color: var(--blue); }
.btn.ghost:hover { background: var(--blue-wash); }
.btn.big { font-size: 1.1rem; padding: 13px 28px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- welcome ---------- */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 32px; align-items: center; padding: 18px 0 30px; }
.hero h1 { font-size: 3.6rem; font-weight: 700; line-height: .98; margin-bottom: 14px; }
.hero .tag { font-family: var(--font-head); font-size: 1.45rem; color: var(--ink-soft); margin-bottom: 18px; font-weight: 500; }
.chain { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: c; }
.chain li { display: flex; align-items: center; gap: 12px; font-family: var(--font-head); font-size: 1.3rem; font-weight: 600; }
.chain li span.plate { width: 14px; border-radius: 3px; flex: none; }
.chain li:not(:last-child)::after { content: ""; }
.chain-wrap { background: var(--rubber); color: #fff; border-radius: 14px; padding: 26px 28px; }
.chain-wrap p { color: #C9D0D5; font-size: .95rem; margin-top: 14px; }
.levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

/* choice cards (level, location, positioning) */
.choice {
  position: relative; text-align: left; background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 18px; cursor: pointer; font: inherit; color: inherit; display: flex; flex-direction: column; gap: 6px;
}
.choice:hover:not(:disabled) { border-color: var(--steel); }
.choice[aria-pressed="true"] { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); background: #FAFCFE; }
.choice[aria-pressed="true"]::after {
  content: "✓"; position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--blue); color: #fff; font-size: .85rem; display: grid; place-items: center;
}
.choice:disabled { cursor: not-allowed; opacity: .55; }
.choice h3 { margin: 4px 0 2px; }
.choice .ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--chalk); color: var(--rubber); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: .9rem; margin: 6px 0; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; font-weight: 600; }
.pill { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--chalk); color: var(--ink-soft); }
.pill.lock { background: var(--rubber); color: #fff; align-self: flex-start; }

.team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
label.field { display: grid; gap: 4px; font-size: .9rem; }
label.field span { color: var(--ink-soft); }
input[type="text"], input[type="email"], input[type="number"], input[type="date"], input[type="tel"], textarea, select {
  font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); width: 100%;
}
textarea { min-height: 70px; resize: vertical; }

/* ---------- news ---------- */
.year-tabs { display: flex; gap: 6px; }
.year-tabs button { font: 600 .95rem var(--font-body); padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.year-tabs button[aria-current="true"] { background: var(--rubber); color: #fff; border-color: var(--rubber); }
.news-head { display: flex; gap: 18px; align-items: center; }
.headline { font-family: var(--font-head); font-size: 2rem; font-weight: 600; line-height: 1.1; margin: 0; }
.pestle .card { border-top: 4px solid var(--steel); }
.pestle .card h3 { display: flex; align-items: center; gap: 8px; }
.pestle .card h4 { margin: 10px 0 2px; font-family: var(--font-body); font-size: 1rem; font-weight: 600; }
.pestle .card p { font-size: .95rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.trend-list { margin: 0; padding-left: 20px; }
.trend-list li { margin-bottom: 6px; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--ink-soft); font-size: .85rem; }
td.r, th.r { text-align: right; }
.table-wrap { overflow-x: auto; }
.comp-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

/* ---------- decisions ---------- */
.dec-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.dec-tabs { display: grid; gap: 4px; position: sticky; top: 110px; }
.dec-tabs button {
  display: flex; align-items: center; gap: 10px; text-align: left; font: 500 1rem var(--font-body); padding: 10px 12px;
  border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: var(--ink);
}
.dec-tabs button:hover { background: #E5E9EB; }
.dec-tabs button[aria-current="true"] { background: var(--rubber); color: #fff; }
.dec-tabs .p-label { font-size: .78rem; color: var(--steel); display: block; }
.dec-tabs button[aria-current="true"] .p-label { color: #AEB7BE; }
.help { background: var(--blue-wash); border-radius: 8px; padding: 12px 14px; font-size: .93rem; margin-bottom: 18px; }
.help p { margin: 0; }
.ctl { padding: 14px 0; border-bottom: 1px solid var(--line); }
.ctl:last-child { border-bottom: 0; }
.ctl-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ctl-label { font-weight: 600; }
.ctl-value { margin-left: auto; font-family: var(--font-head); font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.ctl-ref { font-size: .85rem; color: var(--ink-soft); margin-top: 2px; }
input[type="range"] { width: 100%; accent-color: var(--blue); margin: 8px 0 0; height: 28px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.seg label {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px;
  cursor: pointer; font-size: .92rem; background: #fff;
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--rubber); border-color: var(--rubber); color: #fff; }
.seg label:has(input:focus-visible) { outline: 3px solid var(--yellow); outline-offset: 2px; }
.seg .cost { font-size: .78rem; opacity: .75; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-top: 6px; }
.toggle input { width: 20px; height: 20px; accent-color: var(--blue); }
.side { position: sticky; top: 110px; display: grid; gap: 14px; }
.side .card h3 { font-size: 1.15rem; }
.side dl { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; margin: 0; font-size: .9rem; }
.side dt { color: var(--ink-soft); }
.side dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.side .total { border-top: 1px solid var(--line); padding-top: 6px; font-weight: 600; color: var(--ink); }
.review-table td:first-child { color: var(--ink-soft); width: 45%; }

/* ---------- dashboard ---------- */
.score-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; }
.sbps-num { font-family: var(--font-head); font-size: 4.5rem; font-weight: 700; line-height: 1; }
.sbps-num small { font-size: 1.4rem; color: var(--steel); font-weight: 500; }
.barbell { width: 100%; height: auto; display: block; margin: 8px 0 4px; }
.barbell .plate { transform-box: fill-box; transform-origin: center; }
.loaded .barbell .plate { animation: slideOn .7s cubic-bezier(.2,.8,.2,1) both; }
.loaded .barbell .plate:nth-of-type(2) { animation-delay: .08s; }
.loaded .barbell .plate:nth-of-type(3) { animation-delay: .16s; }
.loaded .barbell .plate:nth-of-type(4) { animation-delay: .24s; }
@keyframes slideOn { from { transform: translateX(-160px); opacity: 0; } to { transform: none; opacity: 1; } }
.pillar-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; font-size: .92rem; }
.pillar-legend div { display: flex; align-items: center; gap: 8px; }
.pillar-legend i { flex: none; width: 12px; height: 12px; border-radius: 3px; }
.pillar-legend b { margin-left: auto; font-variant-numeric: tabular-nums; }
.stars { display: inline-flex; gap: 2px; color: var(--yellow); }
.stars .off { color: #D5DADD; }
.sat-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sat-row:last-child { border-bottom: 0; }
.chart-card h3 { font-size: 1.1rem; margin-bottom: 2px; }
.chart-card .sub { font-size: .82rem; color: var(--ink-soft); margin: 0 0 6px; }
.chart { width: 100%; height: auto; display: block; }
.chart text { font: 11px var(--font-body); fill: var(--ink-soft); }
.feedback { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.feedback li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; font-size: .95rem; }
.feedback li.bad { background: var(--red-wash); }
.feedback li.bad .ico { color: var(--red); }
.feedback li.good { background: var(--green-wash); }
.feedback li.good .ico { color: var(--green); }
.feedback li.info { background: var(--blue-wash); }
.feedback li.info .ico { color: var(--blue); }
.kpi-table td.group { font-family: var(--font-head); font-size: 1.05rem; font-weight: 600; color: var(--ink); background: var(--chalk); padding-top: 10px; }
.kpi-table td.group i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 8px; }
.kpi-table tr.total td { font-weight: 600; border-top: 2px solid var(--ink); }
.next-bar { display: flex; justify-content: flex-end; gap: 12px; margin: 10px 0 0; }

/* ---------- final ---------- */
.awards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.award { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; gap: 10px; align-items: center; background: #fff; }
.award.won { border-color: var(--yellow); background: var(--yellow-wash); }
.award:not(.won) { color: var(--steel); }
.award .ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--chalk); }
.award.won .ic { background: var(--yellow); color: var(--rubber); }
.debrief ol { padding-left: 20px; }
.debrief li { margin-bottom: 14px; }
.debrief li p { margin-bottom: 6px; font-weight: 500; }
.quote { font-family: var(--font-head); font-size: 1.5rem; font-weight: 500; line-height: 1.25; }
.empty { text-align: center; padding: 40px 20px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--rubber); color: #fff; padding: 10px 18px; border-radius: 999px; z-index: 50; font-size: .95rem; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .dec-layout { grid-template-columns: 1fr; }
  .dec-tabs { position: static; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .side { position: static; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .hero, .score-hero, .g2, .g3, .levels, .team-grid, .grid.seg-cards { grid-template-columns: minmax(0, 1fr); }
  .g4 { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: 2.7rem; }
  h1 { font-size: 2.1rem; }
  .topbar-inner { flex-wrap: wrap; padding: 8px 16px; gap: 6px; }
  .nav { margin-left: 0; }
  .page { padding: 20px 16px 40px; }
  .panel { padding: 18px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .loaded .barbell .plate { animation: none; }
}
@media print {
  .topbar, .foot, .next-bar, .btn { display: none !important; }
  body { background: #fff; }
  .panel, .card { break-inside: avoid; }
}

/* =====================================================================
   Emoji illustrations & Level 2/3 components
   ===================================================================== */
.emo {
  display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--chalk);
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: 24px; line-height: 1; vertical-align: middle;
}
.emo-sm { width: 30px; height: 30px; border-radius: 9px; font-size: 17px; margin-right: 4px; }
.emo-md { width: 40px; height: 40px; border-radius: 12px; font-size: 22px; }
.emo-lg { width: 56px; height: 56px; border-radius: 16px; font-size: 32px; }
.emo-xl { width: 72px; height: 72px; border-radius: 20px; font-size: 42px; }
.panel h2 .emo, .card h3 .emo { margin-right: 6px; }
.hero-emo { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.hero-emo span {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: 34px; width: 58px; height: 58px; display: grid; place-items: center;
  border-radius: 50%; background: #fff; border: 1px solid var(--line);
}
.hero-emo span:nth-child(1) { background: var(--red-wash); } .hero-emo span:nth-child(2) { background: var(--blue-wash); }
.hero-emo span:nth-child(3) { background: var(--yellow-wash); } .hero-emo span:nth-child(4) { background: var(--green-wash); }
.chain-emo { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: 1.2rem; }
.level-card { align-items: flex-start; }
.resume { align-items: center; }
label.choice { cursor: pointer; }
.choice.picked { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); background: #FAFCFE; }
.choice.picked::after {
  content: "✓"; position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--blue); color: #fff; font-size: .85rem; display: grid; place-items: center;
}
.choice:has(input.sr:focus-visible) { outline: 3px solid var(--yellow); outline-offset: 2px; }
.choice ul { padding-left: 18px; margin: 6px 0 0; }
.sr { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips .pill { font-size: .85rem; padding: 4px 10px; background: #fff; border: 1px solid var(--line); color: var(--ink); }
.mixbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin-top: 8px; }
.mixbar i { display: block; height: 100%; }
.seg-intro { display: flex; flex-direction: column; gap: 6px; }
.seg-intro ul { margin: 0; padding-left: 18px; }
.meter { display: inline-block; width: 100%; max-width: 140px; height: 8px; border-radius: 4px; background: #E3E7EA; overflow: hidden; vertical-align: middle; }
.meter i { display: block; height: 100%; border-radius: 4px; }
.sq-cell { display: inline-flex; align-items: center; gap: 10px; min-width: 150px; justify-content: flex-end; }
.sq-cell .meter { width: 100px; }
.tab-emo { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: 1.25rem; width: 26px; text-align: center; }
.fb-emo { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: 1.1rem; }
.group-row { font-family: var(--font-head); font-size: 1.1rem; font-weight: 600; color: var(--ink) !important; background: var(--chalk); }

/* toggle cards */
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 10px 0 6px; }
.tcard { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 2px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; }
.tcard:hover { border-color: var(--steel); }
.tcard.on { border-color: var(--green); background: #F7FCF9; }
.tcard input { position: absolute; top: 14px; right: 14px; width: 20px; height: 20px; accent-color: var(--green); }
.tcard-body { display: grid; gap: 3px; padding-right: 22px; }
.tcard .cost { font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.warn-text { color: #A0601A; font-weight: 600; }

/* customer journey */
.journey { list-style: none; padding: 0; margin: 6px 0 16px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; position: relative; }
.journey li { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 12px 8px; border-radius: var(--radius); background: var(--chalk); font-size: .92rem; position: relative; }
.journey li:not(:last-child)::after { content: "›"; position: absolute; right: -9px; top: 28px; font-size: 1.4rem; color: var(--steel); }
.journey li .meter { max-width: 100px; }
.journey li.pain { background: var(--red-wash); outline: 2px solid var(--red); }
.pain-pill { background: var(--red) !important; color: #fff !important; }

/* automate vs humanise */
.dilemma { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--chalk); margin-bottom: 8px; flex-wrap: wrap; }
.dbar { flex: 1; min-width: 120px; height: 12px; border-radius: 6px; background: var(--yellow); overflow: hidden; }
.dbar i { display: block; height: 100%; background: var(--blue); }

/* failure alert, recovery */
.alert { display: flex; gap: 16px; align-items: flex-start; padding: 18px 20px; border-radius: var(--radius); background: #FFF6E5; border: 2px solid var(--yellow); margin-bottom: 18px; }
.alert h3 { margin: 0 0 6px; }
.alert p { margin: 0 0 6px; }
.resp-grid .choice { gap: 4px; }
.rec-stats > div { display: grid; gap: 2px; background: var(--chalk); border-radius: 8px; padding: 10px 12px; }
.rec-stats b { font-size: 1.05rem; }
.pos { color: var(--green); } .neg { color: var(--red); }
.paradox { margin: 14px 0 0; padding: 10px 14px; background: var(--yellow-wash); border-radius: 8px; }

/* level 3 */
.board { display: flex; gap: 18px; align-items: center; background: var(--rubber); color: #fff; border-color: var(--rubber); }
.board .emo { background: var(--rubber-2); }
.board .muted { color: #AEB7BE; }
.strat-hero { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.checks { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px; font-size: .95rem; }
.checks li.no { color: var(--ink-soft); }
.market-card { display: flex; flex-direction: column; gap: 6px; }
.market-card h3 { margin: 4px 0 0; }
.stack { display: flex; height: 18px; border-radius: 9px; overflow: hidden; background: #E3E7EA; margin: 8px 0; }
.stack i { display: block; height: 100%; }
.stack-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .9rem; }
.stack-legend span { display: inline-flex; align-items: center; gap: 6px; }
.stack-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.award .emo { background: var(--chalk); }
.award.won .emo { background: var(--yellow); }
details summary { cursor: pointer; }

@media (max-width: 760px) {
  .journey { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journey li::after { display: none; }
  .hero-emo span { width: 46px; height: 46px; font-size: 26px; }
  .alert { flex-direction: column; }
  .board { flex-direction: column; align-items: flex-start; }
}
.grid.seg-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.resp-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.resp .facts { grid-template-columns: 1fr; gap: 0; }
.resp .facts dd { margin-bottom: 6px; }

/* =====================================================================
   Accounts, team play, chat, briefings, Predict & Review
   ===================================================================== */
/* login page */
.auth-body { background: #fff; }
.auth-page { min-height: 100dvh; display: flex; flex-direction: column; }
.auth-head { display: flex; align-items: center; justify-content: space-between; padding: 28px 6vw; }
.brand.dark { color: var(--rubber); }
.brand.dark .brand-name { font-size: 2rem; }
.auth-help { color: var(--ink); text-decoration: none; font-size: 1.05rem; }
.auth-help:hover { text-decoration: underline; }
.auth-main { flex: 1; display: flex; justify-content: center; padding: 48px 16px 72px; }
.auth-box { width: 100%; max-width: 520px; display: grid; gap: 18px; align-content: start; }
.auth-box h1 { font-family: var(--font-body); font-weight: 400; font-size: 2.8rem; margin: 0 0 12px; }
.auth-box > p.muted { margin: -14px 0 4px; }
.auth-box label.field { gap: 8px; font-size: 1.05rem; }
.auth-box label.field > span:first-child { color: var(--ink); }
.auth-box input { padding: 14px; font-size: 1rem; border: 1px solid #8A9399; border-radius: 0; }
.auth-box .btn.big { border-radius: 0; padding: 16px 28px; margin-top: 8px; }
.auth-forgot { text-align: right; margin: -8px 0 0; max-width: none; }
.auth-forgot a { color: var(--blue); text-decoration: none; }
.auth-forgot a:hover { text-decoration: underline; }
.btn.wide { width: 100%; justify-content: center; }
.auth-switch { color: var(--ink-soft); margin: 4px 0 0; text-align: center; }
.auth-switch a { font-weight: 600; }
.pw-wrap { display: flex; gap: 6px; }
.pw-wrap input { flex: 1; }
.pw-wrap button { border: 1px solid #8A9399; background: #fff; padding: 0 14px; cursor: pointer; font: inherit; }
.form-error { background: var(--red-wash); color: #8E1B2A; border-radius: 8px; padding: 10px 14px; font-size: .95rem; }
.auth-box select { padding: 14px; font-size: 1rem; border: 1px solid #8A9399; border-radius: 0; background: #fff; }
.inst-hint:empty { display: none; }
.auth-access { display: grid; gap: 4px; margin-top: 18px; padding: 16px 18px; border: 1px solid var(--line); background: var(--chalk); font-size: .95rem; }
.auth-access span { color: var(--ink-soft); }
.auth-access a { color: var(--blue); font-weight: 600; text-decoration: none; margin-top: 4px; }
.auth-access a:hover { text-decoration: underline; }
.auth-box textarea { padding: 12px 14px; font: inherit; border: 1px solid #8A9399; border-radius: 0; }
.auth-foot { background: var(--rubber); color: #DCE1E5; text-align: center; padding: 26px 16px; }
.auth-foot p { margin: 4px auto; max-width: none; }
.auth-tagline { font-family: var(--font-head); font-size: 1.35rem; font-weight: 600; letter-spacing: .03em; color: #fff; text-transform: uppercase; }
.auth-tagline span { color: var(--yellow); }
@media (max-width: 600px) { .auth-head { padding: 20px 16px; } .auth-main { padding-top: 24px; } .auth-box h1 { font-size: 2.2rem; } }

/* top bar user menu */
.usermenu { display: flex; align-items: center; gap: 10px; color: #C9D0D5; font-size: .9rem; }
.usermenu:empty { display: none; }
.usermenu button { background: none; border: 1px solid #4A535B; color: #fff; border-radius: 999px; padding: 4px 12px; cursor: pointer; font: inherit; }
.usermenu button:hover { background: var(--rubber-2); }
.navlink { color: #C9D0D5; text-decoration: none; padding: 8px 12px; border-radius: 6px; }
.navlink:hover { color: #fff; background: var(--rubber-2); }
.dots { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; }
.dots i { font-style: normal; font-size: .85rem; width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 50%; background: #3B434A; opacity: .45; }
.dots i.on { opacity: 1; box-shadow: 0 0 0 2px var(--green); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #B9C1C7; vertical-align: 1px; }
.dot.on { background: var(--green); }

/* mode & team panel */
.mode-grid .mode-card { display: flex; flex-direction: column; gap: 8px; }
.mode-card h3 { margin: 4px 0 0; }
.role-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.role-card { flex-direction: column; gap: 4px; padding: 12px; }
.role-card .emo { margin-bottom: 4px; }
.role-badge { display: inline-block; font-size: .8rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--rc, #7D8891) 16%, #fff); color: var(--ink); border: 1px solid color-mix(in srgb, var(--rc, #7D8891) 45%, #fff); white-space: nowrap; }
.team-table td { vertical-align: middle; }
.field.inline { display: inline-grid; min-width: 260px; }
.btn.danger { color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: var(--red-wash); }
details.switch summary { cursor: pointer; display: inline-block; margin-top: 12px; font-weight: 600; color: var(--blue); }
details.switch[open] summary { margin-bottom: 10px; }
.waiting { color: var(--ink-soft); background: var(--chalk); padding: 10px 14px; border-radius: 999px; font-size: .95rem; }
.ok-text { color: var(--green); font-weight: 600; }

/* chat */
.chat-btn { position: fixed; right: 20px; bottom: 20px; z-index: 40; background: var(--blue); color: #fff; border: 0; border-radius: 999px; padding: 12px 20px; font: 600 1rem var(--font-body); cursor: pointer; box-shadow: 0 6px 18px rgba(29, 111, 176, .35); }
.chat-btn .badge { margin-left: 8px; background: var(--red); border-radius: 999px; padding: 1px 8px; font-size: .8rem; }
.chat-panel { position: fixed; right: 20px; bottom: 76px; z-index: 41; width: min(380px, calc(100vw - 32px)); height: min(520px, calc(100dvh - 140px)); background: #fff; border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; box-shadow: 0 16px 40px rgba(36, 41, 46, .2); overflow: hidden; }
.chat-panel[hidden] { display: none; }
.chat-panel > header { background: var(--rubber); color: #fff; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; font-weight: 600; }
.chat-panel > header button { background: none; border: 0; color: #fff; font-size: 1.1rem; cursor: pointer; }
.chat-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--chalk); }
.msg { max-width: 85%; }
.msg .meta { font-size: .75rem; color: var(--ink-soft); margin-bottom: 2px; }
.msg .meta span { opacity: .7; }
.msg .bubble { background: #fff; border: 1px solid var(--line); border-radius: 12px 12px 12px 4px; padding: 8px 11px; font-size: .95rem; white-space: pre-wrap; word-wrap: break-word; }
.msg.mine { align-self: flex-end; }
.msg.mine .meta { text-align: right; }
.msg.mine .bubble { background: var(--blue); color: #fff; border-color: var(--blue); border-radius: 12px 12px 4px 12px; }
.msg.sys { align-self: center; max-width: 95%; font-size: .8rem; color: var(--ink-soft); background: #E6EAEC; border-radius: 999px; padding: 4px 12px; text-align: center; }
.chat-panel > footer { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-panel > footer input { flex: 1; }
.chat-panel > footer .btn { padding: 8px 16px; }

/* decisions: locks, ownership */
.ctl.locked { opacity: .78; }
.ctl.locked input[type="range"] { accent-color: #9AA4AB; }
.lock-note { font-size: .82rem; color: var(--ink-soft); background: var(--chalk); border-radius: 6px; padding: 5px 9px; margin-top: 6px; }
.tcard.locked { cursor: not-allowed; }
.seg label:has(input:disabled) { cursor: not-allowed; }
.dec-tabs button.mine { box-shadow: inset 3px 0 0 var(--yellow); }
.dec-tabs .mine-dot { margin-left: auto; color: var(--yellow); }
.flash { animation: flash 1.2s ease; }
@keyframes flash { 0% { background: var(--yellow-wash); } 100% { background: transparent; } }

/* briefing */
.brief { border-top: 6px solid var(--rc); }
.brief-items { display: grid; grid-template-columns: minmax(160px, 260px) 1fr; gap: 10px 18px; margin: 18px 0; }
.brief-items dt { color: var(--ink-soft); font-size: .92rem; }
.brief-items dd { margin: 0; display: grid; gap: 2px; }
.quotes { display: grid; gap: 8px; margin: 10px 0 16px; }
.quotes blockquote { margin: 0; padding: 10px 14px; background: var(--chalk); border-left: 4px solid var(--rc); border-radius: 0 8px 8px 0; font-style: italic; }
.brief-warn { background: var(--yellow-wash); border-radius: 10px; padding: 12px 14px; }
.recs { display: grid; gap: 10px; }
.rec { background: var(--chalk); border-radius: 10px; padding: 10px 14px; }
.rec p { margin: 6px 0 0; }
#recText { min-height: 80px; }

/* review: forecast, reasons, readiness */
.forecast { border: 2px dashed var(--blue); margin-bottom: 14px; }
.forecast .grid { margin: 10px 0; }
.forecast .field input { font-size: 1.05rem; }
.why-list { display: grid; gap: 10px; }
.why-row { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(200px, 1.4fr) minmax(160px, 1fr); gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.why-row .small.muted:last-child { grid-column: 1 / -1; }
#tab-body > .card + .card { margin-top: 14px; }
.ready-grid { display: grid; gap: 8px; }
.ready { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ready .small { margin-left: auto; }

/* dashboard: forecast, why, checkpoint, warnings */
tr.actual td { background: var(--chalk); }
.chain-delta { list-style: none; padding: 0; margin: 12px 0 18px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.chain-delta li { background: var(--chalk); border-radius: 10px; padding: 10px; display: grid; gap: 2px; text-align: center; position: relative; }
.chain-delta li:not(:last-child)::after { content: "›"; position: absolute; right: -8px; top: 34%; color: var(--steel); font-size: 1.3rem; }
.cd-e { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: 1.4rem; }
.driver .dbar-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 48px; gap: 8px; align-items: center; font-size: .86rem; margin: 3px 0; }
.dtrack { position: relative; height: 10px; background: var(--chalk); border-radius: 5px; }
.dtrack::before { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: #9AA4AB; }
.dtrack i { position: absolute; top: 0; bottom: 0; border-radius: 5px; }
.dtrack i.pos { background: var(--green); }
.dtrack i.neg { background: var(--red); }
.dv { text-align: right; }
.cp { padding: 10px 0; border-bottom: 1px solid var(--line); }
.cp:last-child { border-bottom: 0; }
.cp-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cp-opt { text-align: left; font: inherit; padding: 10px 12px; border: 2px solid var(--line); background: #fff; border-radius: 10px; cursor: pointer; }
.cp-opt:hover:not(:disabled) { border-color: var(--blue); }
.cp-opt:disabled { cursor: default; color: var(--ink-soft); }
.cp-opt.right { border-color: var(--green); background: var(--green-wash); color: var(--ink); }
.cp-opt.wrong { border-color: var(--red); background: var(--red-wash); color: var(--ink); }
.cp-why { background: var(--blue-wash); border-radius: 8px; padding: 8px 12px; margin: 10px 0 0; }
.warn-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.warn-card { border: 2px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.warn-card.came { border-color: var(--red); background: var(--red-wash); }
.warn-card.not { border-color: var(--green); background: var(--green-wash); }
.warn-card .verdict { font-weight: 600; margin-top: auto; }
.why-dot { font-size: .8rem; }
.reasons li { margin-bottom: 4px; }

@media (max-width: 1000px) { .warn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .chain-delta { grid-template-columns: repeat(3, minmax(0, 1fr)); } .chain-delta li::after { display: none; } }
@media (max-width: 760px) {
  .role-cards, .cp-opts, .warn-grid, .brief-items { grid-template-columns: minmax(0, 1fr); }
  .why-row { grid-template-columns: minmax(0, 1fr); }
  .chain-delta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .usermenu .um-name { display: none; }
  .chat-btn { right: 12px; bottom: 12px; }
  .chat-panel { right: 8px; bottom: 64px; }
}
/* layout fixes for the busier top bar and review panel */
.topbar-inner { gap: 14px; }
.nav button { padding: 7px 9px; font-size: .92rem; }
.usermenu { white-space: nowrap; flex: none; }
.btn { white-space: nowrap; }
.forecast .grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.forecast .field input { width: 100%; }
.why-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
.why-row input[type="text"] { grid-column: 2; }
.why-row select { width: 100%; }
.next-bar { flex-wrap: wrap; align-items: center; }
@media (max-width: 1180px) { .usermenu .um-name { display: none; } }

/* decisions: save & reset bar */
.dec-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 16px; padding: 10px 12px; background: var(--chalk); border-radius: 10px; }
.dec-bar .btn { padding: 7px 14px; font-size: .92rem; }
.dec-bar #saveState { min-width: 0; }

/* instructor: institutions & subscriptions */
.inst-form { border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin: 12px 0 18px; }
.inst-form h3 { margin-top: 0; }
.inst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 12px; }
.inst-grid input { width: 100%; }
#instFilterWrap { min-width: 220px; }

/* class bar: paused years and deadline countdown from the instructor */
.classbar { background: #FFF6D6; border-bottom: 1px solid #F0D98A; color: #5C4600; font-size: .92rem; }
.classbar .inner { max-width: 1160px; margin: 0 auto; padding: 8px 20px; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.classbar .cb-lock { font-weight: 600; }
.classbar .soon b, .classbar .over { color: #A3122A; }
/* surprise events, class market, reflections, what-if */
.alert.breaking { border-left: 6px solid var(--red); margin-bottom: 18px; }
.breaking-pill { background: var(--red); color: #fff; margin-bottom: 6px; }
tr.me td { background: var(--blue-wash); }
.reflection textarea { width: 100%; }
.refl-other { border-top: 1px solid var(--line); padding: 10px 0 2px; }
.refl-other p { margin: 4px 0; }
.whatif { border: 2px dashed var(--blue); }
.whatif dd { font-variant-numeric: tabular-nums; }

/* instructor: class controls */
.ctrl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.ctrl-grid .card h3 { margin-top: 0; }
.ctrl-grid .toggle { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; }
.ctrl-grid input[type="datetime-local"] { font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; width: 100%; }
.ev-log { padding-left: 18px; margin: 0; }

/* first-time guided tour */
.tour { position: fixed; inset: 0; z-index: 100; background: rgba(20, 24, 28, .45); }
.tour-card { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 32px)); background: #fff; border-radius: 14px; padding: 20px 22px; box-shadow: 0 18px 50px rgba(0,0,0,.3); }
.tour-card.near { transform: translateX(-50%); }
.tour-card h3 { margin: 6px 0 8px; }
.tour-hl { position: relative; z-index: 101; box-shadow: 0 0 0 4px var(--yellow), 0 0 0 9999px rgba(20, 24, 28, .0); border-radius: 8px; background-color: inherit; }
@media (max-width: 600px) { .tour-card, .tour-card.near { top: auto !important; bottom: 16px; transform: translateX(-50%); } }

/* phones: one swipeable row for the menu and the decision tabs, tighter status bars */
@media (max-width: 600px) {
  .nav { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav::-webkit-scrollbar, .dec-tabs::-webkit-scrollbar { display: none; }
  .nav button { white-space: nowrap; flex: none; }
  .usermenu { gap: 6px; }
  .usermenu button { padding: 3px 10px; font-size: .85rem; }
  .statusbar .inner { gap: 2px 14px; padding: 6px 16px; font-size: .8rem; }
  .classbar .inner { padding: 6px 16px; font-size: .85rem; }
  .dec-tabs { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: none; }
  .dec-tabs button { flex: none; white-space: nowrap; padding: 8px 12px; }
  .dec-tabs .p-label { display: none; }
  .dec-bar { margin-top: 0; }
  .dec-bar .btn { flex: 1 1 auto; justify-content: center; }
  .page { padding-left: 16px; padding-right: 16px; }
  .chat-btn { padding: 10px 14px; font-size: .9rem; }
}
