/* The Manager's Monday. All styling.
   Sharp, calm, high contrast. One accent per meaning: navy = Champion, orange = Learner, red = Resister,
   plum = Self-Automator.
   Every size is in rem. Documents scale with width; the two exercise pages (html.fit) follow
   whichever of width or height is tighter, so they fit one screen. */

:root {
  --bg: #F4F6F9;  --surface: #FFFFFF;  --hairline: #DCE2EC;  --panel: #F2F2F2;
  --text: #0E1526; --muted: #47566B;   --dim: #5F6E84;
  --navy: #0B2545;
  --orange: #E8830C; --orange-text: #A85C00;
  --red: #B23A2E;  --red-tint: #FBECEA;
  --plum: #6E3A7E;
  --ok: #0C8F6E;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 6px; --hair: 0.75px solid var(--hairline);
  --bar: #B9C2D0;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Scales ---------- */
html { font-size: clamp(15px, 0.9vw, 22px); }
html.fit { font-size: clamp(8px, min(0.94vw, 1.67vh), 32px); }
@media (max-width: 899px) {
  html.fit { font-size: 15px; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 1rem; line-height: 1.45;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: var(--navy); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 0.15rem solid var(--navy); outline-offset: 0.15rem; border-radius: 0.2rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.eyebrow {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--dim);
}
.muted { color: var(--muted); }
.fine { font-size: 0.8rem; color: var(--dim); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 2.6rem; padding: 0.6rem 1.4rem; border: 0; border-radius: var(--radius);
  background: var(--navy); color: #fff; font-weight: 700; font-size: 0.9rem; letter-spacing: 0.1em;
  text-decoration: none; cursor: pointer; transition: background-color 200ms ease-out, opacity 200ms ease-out;
}
.btn:hover { background: #163A66; }
.btn:focus-visible { outline-offset: 0.2rem; }
.btn[disabled] { background: var(--hairline); color: var(--dim); cursor: not-allowed; }
.link {
  background: none; border: 0; padding: 0.2rem 0; cursor: pointer;
  color: var(--muted); font-size: 0.85rem; text-decoration: underline; text-underline-offset: 0.2em;
}
.link:hover { color: var(--text); }

/* ---------- Nav ---------- */
.nav {
  display: flex; align-items: center; gap: 2rem; flex-wrap: wrap;
  padding: 0.9rem 2rem; background: var(--surface); border-bottom: var(--hair);
}
.nav-brand { font-weight: 700; font-size: 0.9rem; color: var(--navy); letter-spacing: 0.01em; }
.nav-brand span { color: var(--dim); font-weight: 500; }
.nav-steps { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.nav-steps a {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.2rem 0;
  color: var(--muted); text-decoration: none; font-size: 0.85rem;
}
.nav-steps a:hover { color: var(--text); }
.nav-num {
  display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 50%;
  border: var(--hair); border-color: var(--dim); font-size: 0.75rem; font-weight: 700;
}
.nav-steps a[aria-current="step"] { color: var(--navy); font-weight: 700; }
.nav-steps a[aria-current="step"] .nav-num { background: var(--navy); border-color: var(--navy); color: #fff; }
.nav-guide { margin-left: auto; font-size: 0.8rem; color: var(--dim); }
.nav-guide[aria-current="page"] { color: var(--navy); font-weight: 700; }

/* ---------- Documents (index, facilitate) ---------- */
.doc { max-width: 44rem; margin: 0 auto; padding: 3rem 1.5rem 4rem; }
.doc h1 { font-size: 2.6rem; line-height: 1.1; color: var(--navy); letter-spacing: -0.01em; margin-top: 0.5rem; }
.doc .standfirst { font-size: 1.3rem; line-height: 1.4; color: var(--muted); margin-top: 1rem; }
.doc section { margin-top: 2.2rem; padding-top: 1.6rem; border-top: var(--hair); }
.doc h2 { font-size: 1.25rem; line-height: 1.3; color: var(--navy); margin: 0.4rem 0 0.7rem; }
.doc p + p { margin-top: 0.5rem; }
.doc .lede { font-size: 1.1rem; color: var(--muted); margin-top: 0.9rem; }
.steps-list { counter-reset: s; display: grid; gap: 0.6rem; }
.steps-list li { counter-increment: s; display: grid; grid-template-columns: 2rem 1fr; align-items: baseline; }
.step-sub { display: block; font-weight: 400; color: var(--text); margin-top: 0.1rem; }
.steps-list li::before {
  content: counter(s); display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem;
  border-radius: 50%; background: var(--navy); color: #fff; font-size: 0.8rem; font-weight: 700;
}
.doc .after { margin-top: 0.8rem; color: var(--muted); }
.begin { margin-top: 2.4rem; display: flex; align-items: center; gap: 1.6rem; flex-wrap: wrap; }
.disclaimer { margin-top: 2.4rem; }

.quote {
  background: var(--surface); border: var(--hair); border-radius: var(--radius);
  padding: 1.2rem 1.4rem; font-size: 1.05rem; line-height: 1.55;
}
.timeline { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.2rem; }
.timeline dt { font-weight: 700; color: var(--navy); }
.timeline dd { margin: 0; }
.tip { margin-top: 1rem; background: var(--panel); border-radius: var(--radius); padding: 0.9rem 1.1rem; }
.tip strong { display: block; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.numbered { list-style: decimal; padding-left: 1.4rem; display: grid; gap: 0.5rem; }
.bulleted { list-style: disc; padding-left: 1.2rem; display: grid; gap: 0.6rem; }

/* ---------- Exercise pages (one screen) ---------- */
.fit body { min-height: 100vh; display: flex; flex-direction: column; }
.stage {
  flex: 1; display: flex; flex-direction: column; gap: 0.85rem;
  width: 100%; max-width: 118rem; margin: 0 auto; padding: 1rem 2rem 1rem;
}
.task h1 { font-size: 1.75rem; line-height: 1.15; color: var(--navy); margin-top: 0.25rem; letter-spacing: -0.01em; }
.split { flex: 1; display: grid; gap: 1.2rem; min-height: 0; }
.split-60 { grid-template-columns: minmax(0, 61fr) minmax(0, 39fr); }
.split-55 { grid-template-columns: minmax(0, 54fr) minmax(0, 46fr); }
.card {
  background: var(--surface); border: var(--hair); border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
}
.panel { display: flex; flex-direction: column; gap: 0.9rem; }
.panel-foot { margin-top: auto; display: flex; flex-direction: column; gap: 0.7rem; }
.actions { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.panel h2 { font-size: 1.1rem; color: var(--text); }
.panel h2.eyebrow { font-size: 0.72rem; color: var(--dim); }

/* Tags carry their word as well as their color */
.tag {
  display: inline-flex; align-items: center; padding: 0.2rem 0.6rem; border-radius: 0.3rem;
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap;
}
.tag-champion { background: var(--navy); color: #fff; }
.tag-learner { background: var(--orange); color: var(--text); }
.tag-resister { background: var(--red); color: #fff; }
.tag-self_automator { background: var(--plum); color: #fff; }
.word-champion { color: var(--navy); }
.word-learner { color: var(--orange-text); }
.word-resister { color: var(--red); }
.word-self_automator { color: var(--plum); }

/* ---------- Exercise 1: dashboard ---------- */
.dash { padding: 0.8rem 1.1rem 0.4rem; }
.dash-title { margin-bottom: 0.3rem; }
.dash table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.dash thead th {
  text-align: left; vertical-align: bottom; font-size: 0.78rem; line-height: 1.25; font-weight: 700; color: var(--text);
  padding: 0.4rem 0.6rem 0.5rem; border-bottom: var(--hair);
}
.dash thead th small { display: block; font-weight: 500; color: var(--dim); font-size: 0.72rem; }
.dash td, .dash tbody th { padding: 0.4rem 0.5rem; vertical-align: top; border-bottom: var(--hair); text-align: left; font-weight: 400; }
.dash tr.last > *, .dash tr.reveal-row td { border-bottom: 0; }
.dash tr.has-reveal > * { border-bottom: 0; padding-bottom: 0.15rem; }
.dash tr.reveal-row td { padding: 0 0.5rem 0.4rem; border-bottom: var(--hair); }
.dash tr.reveal-row.last td { border-bottom: 0; }
.col-nurse { width: 27%; }
.col-metric { width: 8.6%; }
.col-call { width: 30%; }
.nurse-name { font-weight: 700; font-size: 1.05rem; }
.floor { font-size: 0.74rem; color: var(--muted); line-height: 1.28; margin-top: 0.15rem; }
.metric-val { font-size: 1.35rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.bar { position: relative; height: 0.4rem; margin-top: 0.35rem; background: var(--panel); border-radius: 0.2rem; }
.bar-fill { position: absolute; inset: 0 auto 0 0; background: var(--bar); border-radius: 0.2rem; }
.bar-tick { position: absolute; top: -0.25rem; bottom: -0.25rem; width: 0.14rem; margin-left: -0.07rem; background: var(--text); }

.pills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.3rem; max-width: min(22rem, 100%); }
.pill {
  padding: 0.35rem 0.6rem; border: 0.75px solid var(--dim); border-radius: 1rem; background: var(--surface);
  font-size: 0.82rem; font-weight: 600; cursor: pointer; line-height: 1.2; color: var(--text);
  white-space: nowrap; text-align: center;
  transition: background-color 200ms ease-out, color 200ms ease-out, border-color 200ms ease-out;
}
.pill:hover { border-color: var(--text); }
.pill[aria-pressed="true"].pill-champion { background: var(--navy); border-color: var(--navy); color: #fff; }
.pill[aria-pressed="true"].pill-learner { background: var(--orange); border-color: var(--orange); color: var(--text); }
.pill[aria-pressed="true"].pill-resister { background: var(--red); border-color: var(--red); color: #fff; }
.pill[aria-pressed="true"].pill-self_automator { background: var(--plum); border-color: var(--plum); color: #fff; }

.result { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; }
.mark { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.88rem; color: var(--muted); }
.glyph { font-weight: 800; font-size: 0.95rem; line-height: 1; }
.glyph-ok { color: var(--ok); }
.glyph-no { color: var(--text); }
.reveal-line { font-size: 0.8rem; line-height: 1.35; color: var(--text); max-width: 60rem; }
.reveal-line.is-wrong { color: var(--text); }
.reveal-line .who { font-weight: 700; }

.defs { display: grid; gap: 1.1rem; }
.def { display: grid; gap: 0.2rem; }
.def-name { font-weight: 700; font-size: 1.15rem; }
.def p { font-size: 1.02rem; line-height: 1.4; color: var(--text); }
.counter { font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.counter .met, .counter .unmet { white-space: nowrap; }
.counter .sep { color: var(--dim); font-weight: 400; margin: 0 0.35rem; }
.counter .met { color: var(--text); }
.counter .unmet { color: var(--muted); font-weight: 500; }
.rule { font-size: 0.85rem; color: var(--dim); }
.score { font-size: 1.15rem; font-weight: 700; color: var(--navy); }
.fw-head h2:focus { outline: 0; }

/* Framework 1 grid */
.fw-head h2 { font-size: 1.1rem; line-height: 1.25; color: var(--navy); margin-top: 0.2rem; }
.split-55 .fw-head h2 { font-size: 1.35rem; }
.quote { margin: 0; }
.fw { display: grid; grid-template-columns: 1.4rem 1.6rem 1fr; grid-template-rows: 1fr auto auto; gap: 0; flex: 1; min-height: 20rem; }
/* Rotated as a plain horizontal block. writing-mode left a stray dot in Safari. */
.fw-ylabel { grid-row: 1; grid-column: 1; position: relative; overflow: visible; }
.fw-ylabel-in {
  position: absolute; left: 50%; top: 50%; width: 20rem; transform: translate(-50%, -50%) rotate(-90deg);
  display: flex; justify-content: center; align-items: baseline; gap: 0.3em;
  font-size: 0.78rem; line-height: 1.2; white-space: nowrap; color: var(--text);
  border: 0; outline: 0; list-style: none;
}
.fw-ylabel-main { font-weight: 700; }
.fw-ylabel-sub { font-weight: 500; font-size: smaller; color: var(--dim); }
.fw-yticks {
  grid-row: 1; grid-column: 2; display: flex; flex-direction: column; justify-content: space-between;
  font-size: 0.68rem; color: var(--dim); padding: 0.2rem 0.3rem 0.2rem 0; text-align: right;
}
.fw-plot {
  grid-row: 1; grid-column: 3; position: relative; display: grid;
  grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 0.35rem;
}
.zone {
  position: relative; border: var(--hair); border-color: #C9D1DD; border-radius: 0.2rem; background: var(--surface);
  padding: 0.4rem 0.5rem; display: flex; flex-direction: column; justify-content: flex-end; gap: 0.15rem;
}
.zone-resister, .zone-self_automator { background: var(--red-tint); border-color: #EDCBC6; justify-content: flex-start; }
.zone-learner .zone-text { max-width: 72%; }
.zone-name { font-weight: 800; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }
.zone-def { font-size: 0.7rem; line-height: 1.25; color: var(--text); }
.zone-input {
  width: 100%; margin-top: 0.3rem; resize: none; font: inherit; font-size: 0.7rem; line-height: 1.25;
  color: var(--text); padding: 0.25rem 0.35rem; border: 0.75px solid var(--hairline); border-radius: 0.2rem;
  background: rgba(255, 255, 255, 0.85);
}
.zone-resister .zone-input, .zone-self_automator .zone-input { background: rgba(255, 255, 255, 0.7); }
.zone-input::placeholder { color: var(--dim); }
.zone-input:focus-visible { outline-offset: 0.05rem; }
.discuss { font-size: 0.9rem; line-height: 1.35; font-weight: 600; color: var(--navy); }
.fw-xticks {
  grid-row: 2; grid-column: 3; display: flex; justify-content: space-between;
  font-size: 0.68rem; color: var(--dim); padding: 0.2rem 0.2rem 0;
}
.fw-xlabel { grid-row: 3; grid-column: 3; text-align: center; font-size: 0.78rem; font-weight: 700; }
.fw-xlabel small { font-weight: 500; color: var(--dim); }
.dots { position: absolute; inset: 0; pointer-events: none; }
.dot {
  position: absolute; width: 1.9rem; height: 1.9rem; margin: -0.95rem 0 0 -0.95rem; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 0.85rem; color: #fff;
  border: 0.14rem solid var(--surface);
}
.dot-champion { background: var(--navy); }
.dot-learner { background: var(--orange); color: var(--text); }
.dot-resister { background: var(--red); }
.dot-self_automator { background: var(--plum); }

.diff { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 0.65rem 0.9rem; }
.diff h3 { font-size: 0.85rem; margin-bottom: 0.35rem; }
.diff dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 0.8rem; }
.diff dt { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #AFC0D8; padding-top: 0.1rem; }
.diff dd { margin: 0; font-size: 0.76rem; line-height: 1.3; }
.diff dd.key { font-weight: 700; }

/* ---------- Exercise 2: champions ---------- */
.nurses { display: grid; gap: 0.8rem; align-content: start; }
.ncard { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.8rem 1.2rem; }
.ncard-body { display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); gap: 1.2rem; align-items: stretch; }
.ncard-act { display: grid; gap: 0.45rem; align-content: start; }
.ncard-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.ncard h2 { font-size: 1.35rem; }
.stats { font-size: 0.9rem; color: var(--dim); font-variant-numeric: tabular-nums; }
.ncard ul { list-style: disc; padding-left: 1.2rem; display: grid; gap: 0.1rem; font-size: 0.93rem; line-height: 1.35; }
.choice { display: flex; flex-wrap: wrap; gap: 0.2rem 0.5rem; align-items: center; }
.choice-label { font-size: 0.85rem; color: var(--dim); width: 100%; }
.opt {
  padding: 0.4rem 0.9rem; border: 0.75px solid var(--dim); border-radius: var(--radius);
  background: var(--surface); font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: background-color 200ms ease-out, color 200ms ease-out;
}
.opt:hover { border-color: var(--text); }
.opt[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.opt[disabled] { cursor: default; }
.ncard .result { flex-direction: row; flex-wrap: nowrap; align-items: baseline; gap: 0.6rem; padding-top: 0.5rem; border-top: var(--hair); }
.ncard .result .reveal-line { font-size: 0.86rem; }
.result-body { display: grid; gap: 0.2rem; }
.your-reason { font-size: 0.84rem; overflow-wrap: anywhere; }
.reason-check { font-size: 0.82rem; color: var(--muted); }
.reason { display: grid; grid-template-rows: auto 1fr; gap: 0.25rem; }
.reason label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.reason textarea {
  width: 100%; resize: none; font: inherit; font-size: 0.95rem; line-height: 1.35; color: var(--text);
  padding: 0.4rem 0.6rem; border: 0.75px solid var(--dim); border-radius: var(--radius); background: var(--surface);
}
.reason textarea::placeholder { color: var(--dim); }
.reason textarea:disabled { background: var(--panel); color: var(--muted); }

.roles { display: grid; gap: 1rem; align-content: start; }
.role h3 { font-size: 1.6rem; color: var(--navy); line-height: 1.2; }
.role .formal { font-size: 0.9rem; color: var(--dim); font-weight: 600; letter-spacing: 0.04em; margin-top: 0.1rem; }
.role { padding: 1.3rem 1.5rem; }
.role p { margin-top: 0.7rem; font-size: 1.1rem; }

.fw2 { width: 100%; border-collapse: collapse; table-layout: fixed; }
.fw2 th, .fw2 td { text-align: left; vertical-align: top; padding: 0.35rem 0.5rem; border-bottom: var(--hair); }
.fw2 thead th { vertical-align: bottom; }
.fw2 thead th .plain { display: block; font-size: 1.2rem; color: var(--navy); }
.fw2 thead th .formal { display: block; font-size: 0.82rem; color: var(--dim); font-weight: 600; }
.fw2 tbody th { font-size: 0.9rem; color: var(--muted); }
.fw2 thead td { width: 21%; }
.fw2 td { font-size: 0.92rem; line-height: 1.35; }
.fw2 tr:last-child th, .fw2 tr:last-child td { border-bottom: 0; }
.end { font-weight: 600; color: var(--navy); font-size: 0.95rem; line-height: 1.4; }

.who { font-weight: 700; }

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(0.4rem); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: none; } }
.enter { animation: rise 300ms ease-out both; animation-delay: calc(var(--i, 0) * 150ms); }
.dot.enter { animation-name: pop; animation-duration: 350ms; animation-delay: calc(300ms + var(--i, 0) * 150ms); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Narrow screens: stack and scroll ---------- */
@media (max-width: 899px) {
  .nav { padding: 0.8rem 1rem; gap: 0.8rem 1.4rem; }
  .nav-guide { margin-left: 0; }
  .nav-steps { gap: 0.4rem 1rem; }
  .nav-steps a { font-size: 0.82rem; }
  .choice-label { width: 100%; }
  .ncard-body { grid-template-columns: minmax(0, 1fr); }
  .reason textarea { field-sizing: content; min-height: calc(4lh + 0.8rem); }
  .stage { padding: 1rem; }
  .split-60, .split-55 { grid-template-columns: minmax(0, 1fr); }
  .dash { padding: 0.8rem; overflow: visible; }
  .dash table, .dash thead, .dash tbody, .dash tr, .dash td, .dash tbody th { display: block; width: auto; }
  .dash thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .dash tr.nurse-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem 1rem; padding: 0.9rem 0; border-bottom: var(--hair); }
  .dash tr.nurse-row.has-reveal { border-bottom: 0; }
  .dash tr.nurse-row > * { padding: 0; border: 0; }
  .dash tr.nurse-row .cell-nurse, .dash tr.nurse-row .cell-call { grid-column: 1 / -1; }
  .dash td.cell-metric::before { content: attr(data-label); display: block; font-size: 0.72rem; color: var(--dim); font-weight: 600; }
  .dash tr.reveal-row td { padding: 0 0 0.9rem; }
  .counter .met, .counter .unmet { white-space: normal; }
  .fw { min-height: 44rem; }
  .doc { padding: 2rem 1rem 3rem; }
  .doc h1 { font-size: 2.1rem; }
}
