/* ==========================================================================
   EYES ON ENERGY — high-contrast job-site theme
   White · black · grays · yellow, with phase highlight colours.
   Designed to be read outdoors, in a hurry, in gloves.
   ========================================================================== */
:root {
  --ink: #0a0a0a;
  --ink-2: #3a3a3a;          /* secondary text — 11:1 on white */
  --bg: #f2f2ef;
  --card: #ffffff;
  --gray-1: #f4f4f1;
  --gray-2: #e4e4e0;
  --line: #cfcfca;
  --yellow: #ffc72c;
  --yellow-soft: #fff1a8;
  --green: #15803d;
  --blue: #1d4ed8;
  --purple: #6d28d9;
  --red: #c81e1e;

  --c-before: var(--green);
  --c-during: var(--blue);
  --c-debrief: var(--purple);

  --r: 14px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --topbar-h: 60px;
  --dock-h: 72px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --gutter: max(16px, env(safe-area-inset-left));
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 18px; line-height: 1.45; font-weight: 500;
  -webkit-font-smoothing: antialiased; overflow-x: hidden; overscroll-behavior-y: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; }
svg { display: block; }
button, a, .tile, .dock, .track, .wheel-stage, .chip {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
}
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
mark { background: var(--yellow); color: var(--ink); padding: 0 .12em; border-radius: 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
h1, h2, h3 { letter-spacing: -0.02em; }

/* ==========================================================================
   Top bar + tab bar
   ========================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: calc(var(--topbar-h) + var(--safe-t)); padding: var(--safe-t) var(--gutter) 0;
  display: grid; grid-template-columns: 48px 1fr 48px; align-items: center;
  background: var(--ink); color: #fff;
}
.icon-btn { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.icon-btn svg { width: 26px; height: 26px; }
.icon-btn:active { background: rgba(255,255,255,.15); }
.back-btn { visibility: hidden; }
.back-btn.show { visibility: visible; }
.brand { display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 0; min-height: 48px; text-decoration: none; }
.brand-mark svg { width: 34px; height: 34px; }
.brand-title { font-weight: 800; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dock {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px max(4px, env(safe-area-inset-right)) calc(6px + var(--safe-b)) max(4px, env(safe-area-inset-left));
  background: var(--ink);
}
.dock a {
  position: relative; z-index: 1; min-height: 58px; padding-top: 6px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: #cfcfcf; text-decoration: none; font-size: 12.5px; font-weight: 800;
}
.dock a svg { width: 26px; height: 26px; }
.dock a.active { color: var(--yellow); }
.dock a.active svg { color: var(--ink); }
.dock-pill {
  position: absolute; z-index: 0; top: 9px; left: 0; width: 64px; height: 34px; border-radius: 17px;
  background: var(--yellow); transition: transform .45s var(--spring), opacity .2s;
}

/* ==========================================================================
   App + shared pieces
   ========================================================================== */
.app {
  max-width: 720px; margin: 0 auto;
  padding: 20px var(--gutter) calc(var(--dock-h) + 28px + var(--safe-b));
  outline: none;
}
.view { animation: viewIn .35s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }

.page-h { font-size: clamp(34px, 9vw, 46px); font-weight: 900; line-height: 1.02; margin: 4px 0 18px; }
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--r); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 60px; padding: 0 24px; border-radius: 14px; border: 3px solid var(--ink);
  font-size: 19px; font-weight: 800; text-decoration: none; transition: transform .15s;
}
.btn svg { width: 22px; height: 22px; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--yellow); color: var(--ink); }
.btn-ghost { background: #fff; color: var(--ink); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ==========================================================================
   Home
   ========================================================================== */
.home-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; margin: 4px 0 20px; }
.client-logo {
  display: block; width: clamp(112px, 36vw, 210px); height: auto;
  padding: 8px 10px; background: #fff; border: 2px solid var(--line); border-radius: 12px;
}
.home-hero h1 { margin: 0; min-width: 0; font-size: clamp(20px, 5.6vw, 30px); font-weight: 900; line-height: 1.15; }

/* Home: six equal boxes, 3 rows × 2, filling the screen between headline and tab bar */
.view-home { display: flex; flex-direction: column; min-height: calc(100dvh - var(--topbar-h) - var(--safe-t) - var(--dock-h) - var(--safe-b) - 50px); }
.home-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(128px, 1fr); gap: 10px; }
.home-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  padding: 12px 10px; border-radius: 18px; background: #fff; border: 3px solid var(--ink); color: var(--ink); text-decoration: none;
  transition: transform .15s;
}
.home-tile:active { transform: scale(.97); }
.ht-icon { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; background: var(--yellow); border: 2px solid var(--ink); }
.ht-icon svg { width: 30px; height: 30px; }
.home-tile b { font-size: clamp(16px, 4.6vw, 21px); font-weight: 900; line-height: 1.12; }
.home-tile small { font-size: clamp(14px, 3.7vw, 16px); font-weight: 600; color: var(--ink-2); line-height: 1.25; }

/* ==========================================================================
   WTFP Checklist — swipeable poster carousel
   ========================================================================== */
.view-checklist { --pc: var(--c-before); }
.view-checklist[data-current="during"] { --pc: var(--c-during); }
.view-checklist[data-current="debrief"] { --pc: var(--c-debrief); }

.phase-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.phase-btn {
  min-height: 56px; border-radius: 14px; border: 3px solid var(--line); background: #fff;
  font-size: 19px; font-weight: 900; color: var(--ink);
  transition: background .25s, border-color .25s, color .25s, transform .15s;
}
.phase-btn:active { transform: scale(.96); }
.phase-btn.active { color: #fff; }
.phase-btn[data-phase="before"].active { background: var(--c-before); border-color: var(--c-before); }
.phase-btn[data-phase="during"].active { background: var(--c-during); border-color: var(--c-during); }
.phase-btn[data-phase="debrief"].active { background: var(--c-debrief); border-color: var(--c-debrief); }

.track { overflow: hidden; margin: 0 calc(-1 * var(--gutter)); outline: none; cursor: grab; touch-action: pan-y; }
.track.dragging { cursor: grabbing; }
.rail { display: flex; align-items: stretch; transition: transform .42s var(--ease); will-change: transform; }
.slide { flex: 0 0 100%; min-width: 0; padding: 0 var(--gutter); }
.hint-mouse { display: none; }
@media (hover: hover) and (pointer: fine) { .hint-touch { display: none; } .hint-mouse { display: inline; } }
.slide[data-p="before"] { --sc: var(--c-before); }
.slide[data-p="during"] { --sc: var(--c-during); }
.slide[data-p="debrief"] { --sc: var(--c-debrief); }

.poster {
  display: flex; flex-direction: column; height: 100%;
  /* fill the screen between the phase buttons and the arrows */
  min-height: max(300px, calc(100dvh - var(--topbar-h) - var(--safe-t) - var(--dock-h) - var(--safe-b) - 300px));
  padding: 20px 20px 24px; background: #fff; border: 4px solid var(--sc); border-radius: 22px;
}
.poster-tag {
  align-self: flex-start; display: inline-flex; gap: 12px; align-items: center;
  padding: 6px 12px; border-radius: 8px; background: var(--sc); color: #fff;
  font-size: 14px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase;
}
.poster-tag span { opacity: .9; font-variant-numeric: tabular-nums; }
.poster h2 { margin: 16px 0 0; font-size: clamp(30px, 8.6vw, 46px); font-weight: 900; line-height: 1.04; }
.poster h2.huge { font-size: clamp(60px, 21vw, 132px); line-height: .9; letter-spacing: -.03em; }
.poster-sub { margin: 10px 0 0; font-size: 20px; font-weight: 600; color: var(--ink-2); line-height: 1.35; }
.poster-art { margin-top: 20px; }
.poster-foot { margin: 12px 0 0; font-size: 20px; font-weight: 800; }

.slide.on .poster-art > * { animation: artIn .45s var(--ease) both; }
@keyframes artIn { from { opacity: 0; transform: translateY(14px); } }

/* Poster art */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li { display: flex; align-items: center; gap: 14px; font-size: 21px; font-weight: 800; padding: 12px 14px; border-radius: 14px; background: var(--gray-1); border: 2px solid var(--gray-2); }
.steps li span { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--yellow); font-weight: 900; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 14px; background: var(--gray-1); border: 2px solid var(--gray-2); }
.tc-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--yellow); border: 2px solid var(--ink); }
.tc-ic svg { width: 26px; height: 26px; }
.tile-card b { font-size: 21px; font-weight: 900; }
.tile-card span:last-child:not(.tc-ic) { font-size: 16px; font-weight: 600; color: var(--ink-2); line-height: 1.3; }
.tiles.d4 .tc-ic { background: var(--red); color: #fff; border-color: var(--red); }

.energy-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.energy-grid > div { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 12px 6px 8px; border-radius: 12px; background: var(--yellow-soft); border: 2px solid var(--ink); font-size: 17px; font-weight: 800; }
.energy-grid span { flex: none; width: 28px; height: 28px; }
.energy-grid span svg { width: 28px; height: 28px; }

.wtfp-art { display: grid; place-items: center; }
.wtfp-art svg { width: min(52vw, 200px); height: auto; aspect-ratio: 1; }

.rows { display: grid; gap: 10px; }
.row-card { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; background: var(--gray-1); border: 2px solid var(--gray-2); }
.rc-ic { flex: none; width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; background: var(--ink); color: var(--yellow); }
.rc-ic svg { width: 28px; height: 28px; }
.row-card b { display: block; font-size: 21px; font-weight: 900; }
.row-card div > span { display: block; font-size: 16px; font-weight: 600; color: var(--ink-2); line-height: 1.3; }
.orb { flex: none; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; font-weight: 900; border: 3px solid var(--ink); }
.fear-1 .orb { background: #22c55e; color: var(--ink); }
.fear-2 .orb { background: #facc15; color: var(--ink); }
.fear-3 .orb { background: #ef4444; color: var(--ink); }

.yesno { display: grid; gap: 12px; }
.yn { display: flex; align-items: center; gap: 16px; padding: 14px; border-radius: 16px; font-size: 20px; font-weight: 800; line-height: 1.25; border: 3px solid; }
.yn.yes { background: #ecfdf3; border-color: var(--green); }
.yn.no { background: #fef2f2; border-color: var(--red); }
.yn .shape { flex: none; width: 82px; height: 82px; display: grid; place-items: center; color: #fff; font-size: 22px; font-weight: 900; }
.yn.yes .shape { border-radius: 50%; background: var(--green); }
.yn.no .shape { background: var(--red); clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }

.chip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.chip-grid > div { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 6px; border-radius: 14px; background: var(--gray-1); border: 2px solid var(--gray-2); }
.chip-grid svg { width: 34px; height: 34px; }
.chip-grid b { font-size: 17px; font-weight: 900; }

.big-icon { width: min(48vw, 180px); aspect-ratio: 1; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; border: 4px solid var(--ink); }
.big-icon svg { width: 52%; height: 52%; }
.big-icon.good { background: #22c55e; }
.big-icon.bad { background: #ef4444; }
.big-icon.warn { background: var(--yellow); }

/* Carousel controls */
.car-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.nav-btn { flex: none; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--yellow); transition: transform .15s, opacity .2s; }
.nav-btn svg { width: 30px; height: 30px; }
.nav-btn:active { transform: scale(.92); }
.nav-btn:disabled { opacity: .2; }
.dots { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pbar { width: 100%; max-width: 240px; height: 10px; border-radius: 5px; background: #d4d4cf; overflow: hidden; }
.pbar i { display: block; height: 100%; width: 0; border-radius: 5px; background: var(--pc); transition: width .35s var(--ease), background .3s; }
.pcount { font-size: 16px; font-weight: 900; font-variant-numeric: tabular-nums; }
.swipe-hint { text-align: center; margin: 10px 0 0; font-size: 15px; font-weight: 700; color: var(--ink-2); }

/* ==========================================================================
   Energy Wheel
   ========================================================================== */
.wheel-head { text-align: center; }
.wheel-head h1 { margin: 0; font-size: clamp(34px, 9vw, 46px); font-weight: 900; line-height: 1; }
.wheel-head p { margin: 8px 0 0; font-size: 20px; font-weight: 700; color: var(--ink-2); }
.wheel-stage {
  position: relative; width: min(92vw, 520px, max(260px, calc(100dvh - 300px))); aspect-ratio: 1;
  margin: 26px auto 0;
}
.wheel-rot { position: absolute; inset: 0; will-change: transform; cursor: pointer; border-radius: 50%; }
.wheel-rot svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 14px 24px rgba(0,0,0,.25)); }
.seg-label { font-family: var(--font); font-weight: 900; font-size: 15px; fill: var(--ink); letter-spacing: .02em; }
.wheel-seg { transition: opacity .3s; }
.wheel-seg.win path { fill: var(--yellow); }
.bulb { fill: var(--yellow); }
.wheel-stage.spinning .bulb { animation: chase .24s steps(1) infinite; }
.wheel-stage.spinning .bulb.odd { animation-delay: -.12s; }
@keyframes chase { 50% { fill: #5a4a10; } }
.wheel-hub {
  position: absolute; left: 50%; top: 50%; z-index: 3; width: 34%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--ink); border: 5px solid #fff; box-shadow: 0 0 0 3px var(--ink);
  display: grid; place-items: center; color: var(--yellow); font-size: clamp(22px, 6.5vw, 34px); font-weight: 900; letter-spacing: .04em;
  transition: transform .15s;
}
.wheel-hub:active { transform: translate(-50%, -50%) scale(.94); }
.wheel-stage.spinning .wheel-hub span { animation: pulse .5s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.pointer { position: absolute; left: 50%; top: -4%; z-index: 4; width: 10%; transform: translateX(-50%); transform-origin: 50% 20%; filter: drop-shadow(0 3px 4px rgba(0,0,0,.35)); transition: transform .3s var(--spring); }
.wheel-stage.spinning .pointer { transition: none; }

/* Video modal — fills the phone screen: title on top, video in the middle, buttons at the bottom */
.video-modal {
  position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center;
  padding: calc(12px + var(--safe-t)) var(--gutter) calc(12px + var(--safe-b));
  background: #000; opacity: 0; transition: opacity .25s;
}
.video-modal.open { opacity: 1; }
.video-modal[hidden] { display: none; }
.vm-inner {
  flex: 1; min-height: 0; width: min(100%, 520px); display: flex; flex-direction: column;
  transform: scale(.97); transition: transform .3s var(--ease);
}
.video-modal.open .vm-inner { transform: none; }
.vm-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #fff; margin-bottom: 12px; }
.vm-head > div { min-width: 0; }
.vm-head small { display: block; color: var(--yellow); font-size: 14px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.vm-head h3 { margin: 2px 0 0; font-size: clamp(21px, 5.6vw, 30px); font-weight: 900; line-height: 1.1; }
.vm-close { flex: none; width: 52px; height: 52px; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; }
.vm-close svg { width: 26px; height: 26px; }
.vm-frame { position: relative; flex: 1; min-height: 0; border-radius: 14px; overflow: hidden; background: #111; }
.vm-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #111; display: block; }
.vm-sound {
  position: absolute; left: 50%; bottom: 72px; transform: translateX(-50%); z-index: 2; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 22px; border-radius: 999px;
  background: var(--yellow); color: var(--ink); border: 3px solid var(--ink); font-size: 19px; font-weight: 900;
}
.vm-sound[hidden] { display: none; }
.vm-sound svg { width: 24px; height: 24px; }
.vm-actions { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.vm-actions .btn { min-height: 58px; padding: 0 10px; white-space: nowrap; }
.vm-actions .btn-primary { border-color: var(--yellow); }
.vm-actions .btn-ghost { border-color: #fff; }

/* ==========================================================================
   Mindsets
   ========================================================================== */
.seg-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.seg-toggle button { min-height: 58px; border-radius: 14px; border: 3px solid var(--line); background: #fff; font-size: 18px; font-weight: 900; }
.view-mindsets[data-mode="blockers"] [data-mode="blockers"].active { background: var(--red); border-color: var(--red); color: #fff; }
.view-mindsets[data-mode="boosters"] [data-mode="boosters"].active { background: var(--green); border-color: var(--green); color: #fff; }

.brain { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; perspective: 1200px; }
.tile { position: relative; aspect-ratio: 1.35; transform-style: preserve-3d; transition: transform .6s var(--ease); border-radius: 16px; }
.tile .face {
  position: absolute; inset: 0; border-radius: 16px; display: grid; place-items: center; padding: 8px; text-align: center;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  color: #fff; font-size: clamp(16px, 5vw, 26px); font-weight: 900; line-height: 1.1; text-transform: uppercase; overflow-wrap: anywhere;
}
.tile .front { background: var(--red); }
.tile .back { background: var(--green); transform: rotateY(180deg); }
.brain.safe .tile { transform: rotateY(180deg); }
.tile.picked .face { box-shadow: inset 0 0 0 5px var(--ink), inset 0 0 0 9px #fff; }
.pilot { grid-column: 1 / -1; padding: 22px 12px; border-radius: 18px; background: var(--ink); text-align: center; }
.pilot .word { color: #ffe600; font-size: clamp(64px, 19vw, 108px); font-weight: 900; line-height: .9; letter-spacing: -.02em; }
.pilot .sub { color: #fff; margin-top: 8px; font-size: clamp(20px, 5.5vw, 26px); font-weight: 900; letter-spacing: .06em; }
.brain-tip { margin-top: 14px; padding: 16px 18px; border-radius: 16px; background: #fff; border: 3px solid var(--ink); display: grid; gap: 6px; min-height: 100px; }
.brain-tip b { font-size: 22px; font-weight: 900; }
.brain-tip span { font-size: 18px; font-weight: 600; color: var(--ink-2); }
.brain-tip .tip-do { color: var(--ink); font-weight: 800; }

/* ==========================================================================
   Games
   ========================================================================== */
.games { display: grid; gap: 14px; }
.game-card { overflow: hidden; border: 3px solid var(--ink); border-radius: 18px; }
.game-thumb { position: relative; display: block; width: 100%; background: #111; }
.game-thumb img { display: block; width: 100%; height: auto; aspect-ratio: 640 / 460; object-fit: cover; }
.game-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
  background: var(--yellow); color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 6px 18px rgba(0,0,0,.4);
}
.game-play svg { width: 34px; height: 34px; margin-left: 4px; }
.game-body { padding: 16px; }
.game-body h3 { margin: 0; font-size: 26px; font-weight: 900; line-height: 1.05; }
.game-body h3 small { display: block; margin-top: 2px; font-size: 17px; font-weight: 800; color: var(--ink-2); letter-spacing: .02em; text-transform: uppercase; }
.game-body p { margin: 10px 0 0; font-size: 17px; font-weight: 600; color: var(--ink-2); }
.game-body .game-meta { font-size: 15px; font-weight: 800; color: var(--ink); }
.game-body .btn { margin-top: 14px; }
@media (min-width: 700px) { .games { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); } }

/* Full-screen game player */
html.game-open, html.game-open body { overflow: hidden; }
.game-modal { position: fixed; inset: 0; z-index: 85; display: flex; flex-direction: column; background: #000; }
.gm-bar {
  flex: none; display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 8px;
  height: calc(52px + var(--safe-t)); padding: var(--safe-t) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
  background: var(--ink); color: #fff;
}
.gm-bar b { text-align: center; font-size: 18px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-close, .gm-ext { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: var(--yellow); text-decoration: none; }
.gm-ext { background: transparent; color: #fff; justify-self: end; }
.gm-close svg { width: 24px; height: 24px; }
.gm-ext svg { width: 22px; height: 22px; }
.game-modal iframe { flex: 1; width: 100%; border: 0; display: block; background: #000; }

/* ==========================================================================
   Toolbox Talks
   ========================================================================== */
.talks { display: grid; gap: 12px; }
.talk > button { width: 100%; min-height: 84px; padding: 14px 16px; display: grid; grid-template-columns: 52px 1fr 28px; gap: 14px; align-items: center; text-align: left; }
.t-ic { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; background: var(--yellow); border: 2px solid var(--ink); }
.t-ic svg { width: 28px; height: 28px; }
.t-text b { display: block; font-size: 21px; font-weight: 900; line-height: 1.15; }
.t-text small { display: block; font-size: 16px; color: var(--ink-2); font-weight: 600; margin-top: 2px; }
.talk .chev { width: 28px; height: 28px; transition: transform .3s var(--ease); }
.talk.open { border-color: var(--ink); }
.talk.open .chev { transform: rotate(180deg); }
.t-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); }
.talk.open .t-body { grid-template-rows: 1fr; }
.t-body > div { overflow: hidden; }
.talk ol { margin: 0; padding: 0 18px 18px 40px; display: grid; gap: 10px; font-size: 19px; font-weight: 600; }
.talk ol li::marker { font-weight: 900; }

/* ==========================================================================
   SEAL — sign in + sessions
   ========================================================================== */

.mode-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.mode-toggle button { min-height: 56px; border-radius: 14px; border: 3px solid var(--line); background: #fff; font-size: 18px; font-weight: 900; }
.mode-toggle button.active { background: var(--ink); border-color: var(--ink); color: var(--yellow); }
.filters { display: flex; gap: 8px; margin: 16px calc(-1 * var(--gutter)) 14px; padding: 0 var(--gutter) 4px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 48px; padding: 0 18px; border-radius: 999px; border: 2px solid var(--ink); background: #fff; font-size: 17px; font-weight: 800; }
.chip.on { background: var(--ink); color: #fff; }
.sess-grid { display: grid; gap: 12px; }
.sess { padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.sess.hidden { display: none; }
.sess .prog { font-size: 14px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.sess h3 { margin: 0; font-size: 26px; font-weight: 900; }
.sess .desc { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 17px; color: var(--ink); font-weight: 800; }
.sess .desc svg { flex: none; width: 18px; height: 18px; }
.status { align-self: flex-start; margin-top: 4px; padding: 5px 12px; border-radius: 999px; font-size: 15px; font-weight: 900; border: 2px solid; }
.status.ok { background: #dcfce7; color: #14532d; border-color: #14532d; }
.status.muted { background: var(--gray-2); color: var(--ink); border-color: var(--ink-2); }
.status.warn { background: #fef3c7; color: #78350f; border-color: #78350f; }
.status.bad { background: #fee2e2; color: #7f1d1d; border-color: #7f1d1d; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mini { display: inline-flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 16px; border-radius: 12px; border: 2px solid var(--ink); background: #fff; font-size: 17px; font-weight: 800; }
.mini svg { width: 20px; height: 20px; }
.mini.go { background: var(--yellow); flex: 1; justify-content: center; }
.mini[disabled] { background: var(--gray-2); border-color: var(--line); color: #6b6b66; }

/* ==========================================================================
   Toasts, splash
   ========================================================================== */

.toasts { position: fixed; z-index: 90; left: 50%; top: calc(var(--topbar-h) + var(--safe-t) + 12px); transform: translateX(-50%); width: calc(100% - 24px); max-width: 420px; display: grid; gap: 8px; pointer-events: none; }
.toast { padding: 14px 18px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 17px; font-weight: 700; border-left: 6px solid var(--yellow); animation: toastIn .3s var(--ease); }
.toast.out { animation: toastOut .3s ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px); } }

.splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--ink); color: #fff; text-align: center; transition: opacity .45s; }
.splash.out { opacity: 0; pointer-events: none; }
.splash svg { width: 120px; height: 120px; margin: 0 auto 18px; animation: pop .6s var(--spring) both; }
.splash-t { font-size: 46px; font-weight: 900; line-height: 1; }
.splash-s { margin-top: 12px; font-size: 15px; font-weight: 900; letter-spacing: .3em; color: var(--yellow); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

/* ==========================================================================
   Larger screens
   ========================================================================== */
@media (min-width: 700px) {
  .dock {
    left: 50%; right: auto; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%);
    width: 480px; padding: 6px; border-radius: 22px; box-shadow: 0 12px 30px rgba(0,0,0,.3);
  }
  .tiles .tile-card, .row-card { padding: 16px 18px; }
  .sess-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 700px) {
  /* Desktop/tablet checklist: arrows sit beside the poster so they're always in view */
  .app:has(.view-checklist) { max-width: 900px; }
  .view-checklist { display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; column-gap: 14px; }
  .view-checklist .track { grid-column: 2; grid-row: 1; margin: 0; }
  .view-checklist .phase-bar { grid-column: 2; grid-row: 3; }
  .view-checklist .slide { padding: 0 2px; }
  .view-checklist .car-nav { display: contents; }
  .view-checklist .nav-btn[data-step="-1"] { grid-column: 1; grid-row: 1; align-self: center; }
  .view-checklist .nav-btn[data-step="1"] { grid-column: 3; grid-row: 1; align-self: center; }
  .view-checklist .dots { grid-column: 2; grid-row: 2; margin-top: 14px; }
  .view-checklist .swipe-hint { grid-column: 2; grid-row: 4; }
  .view-checklist .poster { min-height: min(560px, calc(100dvh - var(--topbar-h) - 230px)); }
}
@media (min-width: 1000px) {
  .view-sessions { max-width: 1000px; }
  .app:has(.view-sessions) { max-width: 1040px; }
  .sess-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (hover: hover) {
  .home-tile:hover, .mini:hover, .chip:hover { background-color: var(--yellow-soft); }
  .nav-btn:hover { transform: scale(1.06); }
}

/* Small phones */
@media (max-width: 360px) {
  body { font-size: 17px; }
  .home-hero { gap: 10px; }
  .client-logo { padding: 6px; }
  .dock a { font-size: 11px; }
  .dock-pill { width: 54px; }
  .poster { padding: 16px 14px 20px; }
  .poster-sub { font-size: 18px; }
  .tile-card b, .row-card b { font-size: 19px; }
  .yn .shape { width: 68px; height: 68px; font-size: 19px; }
  .chip-grid b { font-size: 15px; }
  .phase-btn { font-size: 17px; }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --topbar-h: 52px; --dock-h: 56px; }
  .dock a { min-height: 44px; flex-direction: row; justify-content: center; gap: 8px; padding: 0; }
  .dock-pill { top: 11px; width: 42px; height: 32px; }
  .poster { min-height: 0; }
  .wheel-head p { display: none; }
  .wheel-stage { width: max(220px, calc(100dvh - 190px)); margin-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Phones: the checklist fits one screen — phase buttons, poster, arrows — nothing below the fold */
@media (max-width: 699px) {
  .app:has(.view-checklist) { padding-top: 12px; padding-bottom: calc(var(--dock-h) + var(--safe-b) + 10px); }
  .view-checklist {
    display: flex; flex-direction: column;
    height: calc(100dvh - var(--topbar-h) - var(--safe-t) - var(--dock-h) - var(--safe-b) - 22px);
    min-height: 380px;
  }
  .view-checklist .phase-bar { flex: none; margin-top: 10px; }
  .view-checklist .phase-btn { min-height: 52px; }
  .view-checklist .track { flex: 1; min-height: 0; }
  .view-checklist .rail { height: 100%; }
  .view-checklist .slide { height: 100%; }
  .view-checklist .poster { min-height: 0; height: 100%; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .view-checklist .car-nav { flex: none; margin-top: 10px; }
  .view-checklist .nav-btn { width: 56px; height: 56px; }
  .view-checklist .swipe-hint { display: none; }
}
@media (max-width: 699px) and (max-height: 600px) {
  .view-checklist .poster h2 { font-size: clamp(26px, 8vw, 34px); }
  .view-checklist .poster-sub { font-size: 17px; }
}


/* ==========================================================================
   Phone fit — every main screen fits the phone like a native app
   ========================================================================== */
/* "Scroll for more" cue when a poster is taller than its card (smallest phones) */
.slide { position: relative; }
.slide.more::after {
  content: "Scroll for more ▾"; position: absolute; left: calc(var(--gutter) + 4px); right: calc(var(--gutter) + 4px); bottom: 4px;
  height: 64px; padding-bottom: 10px; display: flex; align-items: flex-end; justify-content: center;
  border-radius: 0 0 18px 18px; pointer-events: none;
  background: linear-gradient(rgba(255,255,255,0), #fff 65%); font-size: 14px; font-weight: 900; color: var(--ink);
}

@media (max-width: 699px) {
  /* Wheel: as large as the screen allows, centred between the bars */
  .view-wheel {
    min-height: calc(100dvh - var(--topbar-h) - var(--safe-t) - var(--dock-h) - var(--safe-b) - 50px);
    display: flex; flex-direction: column; justify-content: center;
  }
  .view-wheel .wheel-stage { width: min(92vw, 560px, calc(100dvh - var(--topbar-h) - var(--safe-t) - var(--dock-h) - var(--safe-b) - 190px)); min-width: 240px; margin: 28px auto 8px; }
}

/* Shorter phones (iPhone SE/8, Galaxy S8/S9, most Androids ≤ 800px tall): compact posters */
@media (max-width: 699px) and (max-height: 820px) {
  .view-checklist .phase-btn { min-height: 48px; font-size: 18px; }
  .view-checklist .phase-bar { margin-top: 8px; }
  .view-checklist .poster { padding: 14px 16px 16px; border-width: 3px; border-radius: 18px; }
  .poster-tag { font-size: 14px; padding: 4px 10px; letter-spacing: .04em; }
  .poster h2 { margin-top: 10px; font-size: clamp(24px, 7.2vw, 30px); }
  .poster h2.huge { font-size: clamp(60px, 21vw, 96px); }
  .poster-sub { margin-top: 6px; font-size: 16px; }
  .poster-art { margin-top: 12px; }
  .poster-foot { margin-top: 8px; font-size: 17px; }
  .steps { gap: 6px; }
  .steps li { padding: 8px 12px; font-size: 18px; }
  .steps li span { width: 32px; height: 32px; }
  .tiles { gap: 8px; }
  .tile-card { padding: 10px; gap: 4px; }
  .tc-ic { width: 36px; height: 36px; border-radius: 10px; }
  .tc-ic svg { width: 20px; height: 20px; }
  .tile-card b { font-size: 18px; }
  .tile-card span:last-child:not(.tc-ic) { font-size: 14px; }
  .energy-grid { gap: 6px; }
  .energy-grid > div { min-height: 40px; padding: 4px 10px 4px 6px; font-size: 15px; gap: 6px; }
  .energy-grid span, .energy-grid span svg { width: 22px; height: 22px; }
  .rows { gap: 8px; }
  .row-card { padding: 10px; gap: 12px; }
  .rc-ic { width: 40px; height: 40px; border-radius: 10px; }
  .rc-ic svg { width: 22px; height: 22px; }
  .orb { width: 42px; height: 42px; font-size: 20px; }
  .row-card b { font-size: 18px; }
  .row-card div > span { font-size: 14px; }
  .yesno { gap: 8px; }
  .yn { padding: 10px; gap: 12px; font-size: 17px; }
  .yn .shape { width: 64px; height: 64px; font-size: 18px; }
  .chip-grid { gap: 8px; }
  .chip-grid > div { padding: 10px 4px; gap: 6px; }
  .chip-grid svg { width: 28px; height: 28px; }
  .chip-grid b { font-size: 15px; }
  .big-icon { width: min(38vw, 140px); }
  .wtfp-art svg { width: min(38vw, 150px); }
  .view-checklist .nav-btn { width: 52px; height: 52px; }
  .view-checklist .car-nav { margin-top: 8px; }

  /* Mindsets: tiles, pilot card and tip all on one screen */
  .seg-toggle { margin-top: 10px; }
  .seg-toggle button { min-height: 50px; font-size: 16px; }
  .brain { gap: 8px; }
  .pilot { padding: 12px; border-radius: 16px; }
  .pilot .word { font-size: clamp(50px, 15vw, 76px); }
  .pilot .sub { margin-top: 4px; font-size: 18px; }
  .brain-tip { margin-top: 10px; padding: 12px 14px; min-height: 0; gap: 4px; }
  .brain-tip b { font-size: 19px; }
  .brain-tip span { font-size: 16px; }

  .wheel-head h1 { font-size: 32px; }
  .wheel-head p { font-size: 17px; }
}

/* Very small phones (≤ 360px wide) */
@media (max-width: 360px) {
  .vm-actions .btn { font-size: 17px; gap: 6px; }
  .vm-actions .btn svg { width: 19px; height: 19px; }
  .mode-toggle button { font-size: 16px; }
  #offline { font-size: 17px; padding: 0 12px; }
}

/* The spinning wheel is a rotating square — keep its corners from widening the page on phones */
.view-wheel { overflow: hidden; }
html, body { overflow-x: hidden; }

/* SPIN label scales with the wheel, not the screen width (fixes landscape) */
.wheel-hub { font-size: clamp(18px, 6.5vmin, 34px); }

/* Landscape phones: slim edge-to-edge tab bar so nothing is covered */
@media (max-height: 500px) and (orientation: landscape) {
  .dock {
    left: 0; right: 0; bottom: 0; width: auto; transform: none; border-radius: 0; box-shadow: none;
    padding: 2px max(8px, env(safe-area-inset-right)) calc(2px + var(--safe-b)) max(8px, env(safe-area-inset-left));
  }
  .dock a { min-height: 46px; }
  .dock-pill { top: 8px; width: 46px; height: 32px; border-radius: 16px; }
  .app { padding-bottom: calc(50px + 20px + var(--safe-b)); }
}

/* Shortest phones (iPhone SE 1st gen / 320px, iPhone SE 2/3): Mindsets tip stays on screen */
@media (max-width: 699px) and (max-height: 700px) {
  .pilot { padding: 10px; }
  .pilot .word { font-size: clamp(44px, 13vw, 60px); }
  .pilot .sub { font-size: 16px; }
  .seg-toggle button { min-height: 46px; font-size: 15px; }
}

/* Mindset tiles with emojis — compact squares so the whole screen fits */
.tile { aspect-ratio: auto; height: var(--tile-h, 118px); }
.tile .face { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: clamp(15px, 4.4vw, 20px); }
.tile .face img { width: var(--emoji, 58px); height: var(--emoji, 58px); border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.9); object-fit: cover; }
.tile .face b { font-weight: 900; line-height: 1.05; }
@media (max-width: 699px) and (max-height: 820px) { .view-mindsets { --tile-h: 100px; --emoji: 48px; } }
@media (max-width: 699px) and (max-height: 700px) { .view-mindsets { --tile-h: 86px; --emoji: 40px; } .tile .face { gap: 4px; font-size: 15px; } }
@media (max-width: 699px) and (max-height: 600px) {
  .view-mindsets { --tile-h: 72px; --emoji: 30px; }
  .tile .face { gap: 3px; font-size: 14px; overflow-wrap: normal; }
  .pilot { padding: 6px 10px; }
  .pilot .word { font-size: 40px; }
  .pilot .sub { margin-top: 2px; font-size: 14px; }
  .brain-tip { padding: 8px 12px; gap: 2px; }
  .brain-tip b { font-size: 16px; }
  .brain-tip span { font-size: 14px; }
  .seg-toggle { margin-top: 8px; }
  .seg-toggle button { min-height: 44px; font-size: 14px; }
}

/* Home on short phones: smaller boxes so all six stay on screen */
@media (max-width: 699px) and (max-height: 760px) {
  .home-hero { margin-bottom: 12px; }
  .home-grid { grid-auto-rows: minmax(112px, 1fr); gap: 8px; }
  .home-tile { gap: 4px; padding: 8px; }
  .ht-icon { width: 44px; height: 44px; border-radius: 12px; }
  .ht-icon svg { width: 26px; height: 26px; }
}
@media (max-width: 699px) and (max-height: 600px) {
  .home-hero h1 { font-size: 19px; }
  .client-logo { width: 104px; }
  .home-grid { grid-auto-rows: minmax(100px, 1fr); }
  .home-tile small { display: none; }
}
@media (max-width: 699px) and (max-height: 700px) {
  .home-tile small { display: none; }
  .home-grid { grid-auto-rows: minmax(100px, 1fr); }
}

/* WTFP? slide: the line that spells out the acronym */
.poster-lead { margin: 10px 0 0; font-size: clamp(22px, 6.4vw, 32px); font-weight: 900; line-height: 1.1; color: var(--ink); }
@media (max-width: 699px) and (max-height: 820px) { .poster-lead { margin-top: 6px; font-size: clamp(20px, 5.8vw, 24px); } }
@media (max-width: 699px) and (max-height: 700px) {
  .poster h2.huge { font-size: clamp(50px, 16vw, 64px); }
  .poster-lead { font-size: 18px; }
  .wtfp-art svg { width: min(26vw, 100px); }
}
@media (max-width: 699px) and (max-height: 600px) {
  .poster h2.huge { margin-top: 6px; font-size: 46px; }
  .wtfp-art svg { width: 62px; }
}

/* WTFP? slide: explanation line under the skull */
.poster-sub-below { margin-top: 14px; text-align: center; }
@media (max-width: 699px) and (max-height: 600px) {
  .poster-sub-below { margin-top: 8px; font-size: 15px; line-height: 1.3; }
  .wtfp-art svg { width: 54px; }
}
