/* ShiftGuard · the rota's journey. Night-time Dublin shopfront: bottle-green dark, crema glow for "working",
   green for kept, tomato for caught, Gráinne's own words in chalk. */
/* Served from the laptop, so the demo looks the same with no internet. */
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: block; src: url("fonts/atkinson-400.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: block; src: url("fonts/atkinson-700.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --night: #08130f;
  --night-2: #0e1f18;
  --surface: rgba(238, 243, 236, 0.045);
  --surface-2: rgba(238, 243, 236, 0.08);
  --line: #23392f;
  --milk: #eef3ec;
  --milk-soft: #9fb3a7;
  --chalk: #f6ecd6;
  --green: #4bd68f;
  --green-glow: rgba(75, 214, 143, 0.45);
  --crema: #f2b441;
  --crema-glow: rgba(242, 180, 65, 0.5);
  --tomato: #ff5f4a;
  --tomato-glow: rgba(255, 95, 74, 0.5);
  --violet: #b9a8ff;
  --sky: #8fd0ff;
  --sans: "Atkinson Hyperlegible", system-ui, sans-serif;
  font-size: clamp(13px, 1.04vw, 22px);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--milk); font: 400 1rem/1.4 var(--sans); overflow: hidden;
  background:
    radial-gradient(60rem 30rem at 50% 58%, rgba(29, 86, 64, 0.35), transparent 70%),
    radial-gradient(40rem 20rem at 12% 20%, rgba(242, 180, 65, 0.06), transparent 70%),
    linear-gradient(180deg, var(--night-2), var(--night));
}
h1, h2, h3, p { margin: 0; }
button {
  font: 700 0.95rem var(--sans); border-radius: 999px; cursor: pointer; padding: 0.6rem 1.3rem;
  border: 2px solid var(--green); background: transparent; color: var(--green);
}
button.primary { background: var(--green); color: var(--night); }
button.ghost { border-color: var(--line); color: var(--milk-soft); }
button:disabled { opacity: 0.35; cursor: default; }
button:focus-visible { outline: 3px solid var(--crema); outline-offset: 3px; }
.hand { font-family: var(--sans); }

.app { height: 100%; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto; padding: 1rem 1.6rem 0.9rem; gap: 0.6rem; }

/* Top */
.top { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 0.7rem; color: var(--green); }
.brand-mark { width: 2.2rem; height: 2.2rem; }
.brand strong { display: block; font-size: 1.25rem; color: var(--milk); line-height: 1.1; }
.brand span { font-size: 0.85rem; color: var(--milk-soft); }
.chapters { display: flex; gap: 1.6rem; list-style: none; margin: 0; padding: 0; counter-reset: ch; }
.chapters li { counter-increment: ch; color: var(--milk-soft); font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; gap: 0.5rem; opacity: 0.55; transition: opacity .4s, color .4s; }
.chapters li::before { content: counter(ch); display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 2px solid currentColor; font-size: 0.8rem; }
.chapters li.active { color: var(--milk); opacity: 1; }
.chapters li.active::before { background: var(--green); border-color: var(--green); color: var(--night); box-shadow: 0 0 14px var(--green-glow); }
.chapters li.done { opacity: 0.85; color: var(--green); }

/* Caption: one big sentence per moment */
.caption { text-align: center; min-height: 5.6rem; display: grid; align-content: center; gap: 0.35rem; }
.caption h1 { font-size: 2.35rem; line-height: 1.12; font-weight: 700; letter-spacing: -0.01em; max-width: 60rem; margin: 0 auto; }
.caption p { font-size: 1.1rem; color: var(--milk-soft); max-width: 62rem; margin: 0 auto; min-height: 1.5em; }
.caption .swap { animation: caption-in .6s cubic-bezier(.2,.7,.2,1); }
@keyframes caption-in { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } }

/* Track */
.track {
  position: relative; display: grid; align-items: center;
  grid-template-columns: 16% 11% minmax(0, 1fr) 11% 15%; gap: 1.2%;
  padding: 0 0.5rem;
}
.rail { position: absolute; left: 4%; right: 4%; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: repeating-linear-gradient(90deg, var(--line) 0 14px, transparent 14px 24px); }
.rail-glow { position: absolute; inset: -6px 0; border-radius: 6px; opacity: 0; background: linear-gradient(90deg, transparent, var(--crema-glow), transparent); background-size: 30% 100%; background-repeat: no-repeat; transition: opacity .4s; }
.track.moving .rail-glow { opacity: 1; animation: rail 1.4s linear infinite; }
@keyframes rail { from { background-position: -30% 0; } to { background-position: 130% 0; } }

.station { position: relative; z-index: 2; text-align: center; display: grid; justify-items: center; gap: 0.2rem; }
.station h2 { font-size: 1.1rem; margin-top: 0.3rem; }
.station .role { font-size: 0.85rem; color: var(--milk-soft); line-height: 1.25; }
.avatar {
  width: 5.4rem; height: 5.4rem; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: var(--night-2); border: 3px solid var(--line); transition: box-shadow .5s, border-color .5s, transform .5s;
}
.owner-avatar { font: 700 2.5rem var(--sans); color: var(--chalk); border-color: var(--green); box-shadow: 0 0 0 6px rgba(75, 214, 143, 0.08); }
.agent-avatar { color: var(--crema); border-color: rgba(242, 180, 65, 0.5); }
.agent-avatar svg { width: 3.3rem; }
.agent-avatar .eye { fill: var(--night); }
.judge-avatar { color: var(--violet); border-color: rgba(185, 168, 255, 0.45); }
.judge-avatar svg { width: 3.6rem; }
.station.working .avatar { transform: scale(1.06); }
.agent.working .avatar { border-color: var(--crema); box-shadow: 0 0 0 8px rgba(242, 180, 65, 0.12), 0 0 40px var(--crema-glow); animation: breathe 1.4s ease-in-out infinite; }
.agent.working .eye { animation: blinkeye 2.4s infinite; transform-origin: center; transform-box: fill-box; }
.owner.working .avatar { box-shadow: 0 0 0 8px rgba(75, 214, 143, 0.15), 0 0 40px var(--green-glow); animation: breathe 1.6s ease-in-out infinite; }
.judge.working .avatar { border-color: var(--violet); box-shadow: 0 0 0 8px rgba(185, 168, 255, 0.14), 0 0 40px rgba(185, 168, 255, 0.45); }
.judge.working .beam { animation: weigh 1.1s ease-in-out infinite; transform-origin: 32px 18px; }
.judge.fine .avatar { border-color: var(--green); box-shadow: 0 0 30px var(--green-glow); }
.judge.notfine .avatar { border-color: var(--tomato); box-shadow: 0 0 30px var(--tomato-glow); }
.judge.dormant { opacity: 0.35; }
@keyframes breathe { 50% { box-shadow: 0 0 0 14px rgba(242, 180, 65, 0.04), 0 0 60px var(--crema-glow); } }
@keyframes weigh { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(9deg); } }
@keyframes blinkeye { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }

/* Gráinne's notebook: her rules in her hand */
.notebook {
  position: absolute; top: calc(100% + 0.5rem); left: 0; z-index: 3; list-style: none; margin: 0; padding: 0.5rem 0.7rem; transition: opacity .8s, max-height .8s; max-height: 14rem; overflow: hidden; text-align: left; width: max-content; max-width: 18rem;
  background: rgba(246, 236, 214, 0.06); border: 1px dashed rgba(246, 236, 214, 0.25); border-radius: 0.6rem;
}
.notebook li { font: 400 0.92rem/1.3 var(--sans); padding: 0.1rem 0; color: var(--chalk); opacity: 0.9; transition: opacity .5s; position: relative; }
.notebook li.gone { opacity: 0.3; }
.notebook li.gone::after { content: " ✓"; font-family: var(--sans); font-size: 0.8rem; color: var(--green); }
.notebook li.lit { color: var(--crema); text-shadow: 0 0 12px var(--crema-glow); }

/* The gates: her rules, standing on the track */
.gates { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.9rem; height: 100%; align-items: center; }
.gate { position: relative; display: grid; justify-items: center; gap: 0.5rem; }
.arch {
  position: relative; width: 100%; max-width: 8.4rem; height: 12.5rem; border-radius: 4.2rem 4.2rem 0.6rem 0.6rem;
  border: 3px solid rgba(238, 243, 236, 0.1); background: linear-gradient(180deg, rgba(238,243,236,0.03), transparent);
  transition: border-color .5s, box-shadow .5s, background .5s; overflow: hidden;
}
.gate .label { font-size: 0.9rem; font-weight: 700; text-align: center; line-height: 1.2; min-height: 3.6em; color: var(--milk-soft); }
.gate .label.hand { font: 400 0.95rem/1.2 var(--sans); color: var(--chalk); opacity: 0.4; }
.gate .verdict { position: absolute; top: 34%; left: 50%; transform: translate(-50%, -50%) scale(0.4); font-size: 2.6rem; font-weight: 700; opacity: 0; transition: opacity .3s, transform .4s cubic-bezier(.2,1.6,.4,1); }
.gate .count { position: absolute; top: 0.7rem; right: 0.7rem; min-width: 1.5rem; height: 1.5rem; padding: 0 0.35rem; border-radius: 999px; background: var(--tomato); color: var(--night); font-size: 0.8rem; font-weight: 700; display: none; place-items: center; }
.gate.dormant { opacity: 0.45; }
.gate.armed .arch { border-color: rgba(75, 214, 143, 0.55); box-shadow: 0 0 22px rgba(75, 214, 143, 0.18), inset 0 0 26px rgba(75, 214, 143, 0.08); }
.gate.armed .label { color: var(--milk); }
.gate.powering .arch { animation: power 1.1s ease-out; }
@keyframes power { 0% { box-shadow: 0 0 0 rgba(75,214,143,0); } 40% { box-shadow: 0 0 60px var(--green-glow), inset 0 0 50px var(--green-glow); border-color: var(--green); } }
.gate.scanning .arch { border-color: var(--crema); box-shadow: 0 0 36px var(--crema-glow); }
.gate.scanning .arch::after {
  content: ""; position: absolute; left: 6%; right: 6%; height: 3px; top: 10%; border-radius: 2px;
  background: var(--crema); box-shadow: 0 0 16px 4px var(--crema-glow); animation: scan .7s ease-in-out infinite alternate;
}
@keyframes scan { to { top: 88%; } }
.gate.pass .arch { border-color: var(--green); box-shadow: 0 0 40px var(--green-glow), inset 0 0 40px rgba(75, 214, 143, 0.18); background: rgba(75, 214, 143, 0.06); }
.gate.pass .verdict { color: var(--green); opacity: 1; transform: translate(-50%, -50%) scale(1); text-shadow: 0 0 20px var(--green-glow); }
.gate.pass .verdict::before { content: "✓"; }
.gate.fail .arch { border-color: var(--tomato); box-shadow: 0 0 50px var(--tomato-glow), inset 0 0 40px rgba(255, 95, 74, 0.22); background: rgba(255, 95, 74, 0.07); animation: shake .45s; }
.gate.fail .verdict { color: var(--tomato); opacity: 1; transform: translate(-50%, -50%) scale(1); text-shadow: 0 0 20px var(--tomato-glow); }
.gate.fail .verdict::before { content: "✗"; }
.gate.fail .count { display: grid; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* Approve: Gráinne's desk */
.desk {
  width: 7.5rem; height: 5.4rem; border-radius: 0.8rem; position: relative;
  border: 3px solid var(--line); background: var(--surface); display: grid; place-items: center;
}
.stamp {
  font: 700 1.05rem var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--green);
  border: 3px solid var(--green); border-radius: 0.4rem; padding: 0.2rem 0.5rem; transform: rotate(-8deg) scale(2.6); opacity: 0;
}
.stamp.down { animation: stamp .55s cubic-bezier(.3,1.7,.5,1) forwards; }
@keyframes stamp { 0% { opacity: 0; transform: rotate(-8deg) scale(2.6); } 60% { opacity: 1; transform: rotate(-8deg) scale(0.92); } 100% { opacity: 1; transform: rotate(-8deg) scale(1); box-shadow: 0 0 30px var(--green-glow); } }
.approve.done .desk { border-color: var(--green); box-shadow: 0 0 50px var(--green-glow); }
.approve-btn:disabled { visibility: hidden; }
.approve-btn { margin-top: 0.4rem; font-size: 1.15rem; padding: 0.7rem 1.8rem; }
.approve-btn.ready { background: var(--green); color: var(--night); animation: ready 1.4s ease-in-out infinite; }
@keyframes ready { 50% { box-shadow: 0 0 0 10px rgba(75, 214, 143, 0.15), 0 0 40px var(--green-glow); } }

/* The rota card that travels */
.card {
  position: absolute; z-index: 5; left: 0; top: 50%; width: 8.2rem; padding: 0.45rem 0.55rem 0.5rem;
  border-radius: 0.6rem; background: var(--milk); color: var(--night); box-shadow: 0 12px 30px rgba(0,0,0,0.45), 0 0 0 0 transparent;
  opacity: 0; transform: translate(0, -50%); transition: box-shadow .4s, background .4s;
  will-change: transform;
}
.card.shown { opacity: 1; }
.card-head { display: flex; justify-content: space-between; font-size: 0.72rem; font-weight: 700; color: #1f4436; }
.card-head b { color: var(--night); }
.card-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-top: 0.35rem; height: 2.6rem; }
.card-grid span { border-radius: 3px; background: #cfdcd3; position: relative; }
.card-grid span::after { content: attr(data-d); position: absolute; bottom: -0.95rem; left: 0; right: 0; text-align: center; font-size: 0.55rem; color: #557466; font-weight: 700; }
.card-grid span.changed { background: var(--crema); box-shadow: 0 0 8px var(--crema-glow); }
.card { padding-bottom: 1.05rem; }
.card-mark { position: absolute; inset: 1.35rem 0.3rem 0.3rem; border-radius: 0.4rem; pointer-events: none; display: grid; place-items: center; font-weight: 700; font-size: 0.95rem; letter-spacing: 0.06em; text-transform: uppercase; }
.card.red { box-shadow: 0 0 0 3px var(--tomato), 0 0 40px var(--tomato-glow); }
.card.red .card-mark { color: var(--tomato); background: rgba(255, 245, 243, 0.82); }
.card.green { box-shadow: 0 0 0 3px var(--green), 0 0 40px var(--green-glow); }
.card.green .card-mark { color: #12804a; background: rgba(240, 252, 245, 0.85); }
.card.stamped .card-mark { font-size: 1.05rem; animation: stamp-card .6s cubic-bezier(.3,1.7,.5,1); }
.card.stamped { animation: thump .6s ease-out; }
@keyframes stamp-card { 0% { transform: scale(2.4) rotate(-12deg); opacity: 0; } 60% { transform: scale(0.92) rotate(-6deg); opacity: 1; } 100% { transform: rotate(-6deg); } }
@keyframes thump { 40% { box-shadow: 0 0 0 3px var(--green), 0 0 90px 20px var(--green-glow); } }
.card.thinking { animation: float 1.6s ease-in-out infinite; }
@keyframes float { 50% { margin-top: -6px; } }

/* Detail: what this moment is about, big and plain */
.detail { min-height: 12.5rem; max-height: 15rem; display: grid; align-items: start; justify-items: center; overflow: hidden; }
.detail > * { animation: detail-in .5s cubic-bezier(.2,.7,.2,1); }
@keyframes detail-in { from { opacity: 0; transform: translateY(14px); } }
.chat { width: min(100%, 64rem); display: grid; gap: 0.55rem; }
.bubble { max-width: 80%; padding: 0.55rem 0.95rem; border-radius: 1rem; background: var(--surface-2); animation: detail-in .4s ease-out; }
.bubble .who { display: block; font-size: 0.75rem; font-weight: 700; color: var(--milk-soft); margin-bottom: 0.1rem; }
.bubble.owner { justify-self: start; border-bottom-left-radius: 0.3rem; background: rgba(246, 236, 214, 0.08); }
.bubble.owner .text { font: 400 1.3rem/1.4 var(--sans); color: var(--chalk); }
.bubble.interviewer { justify-self: end; border-bottom-right-radius: 0.3rem; background: rgba(75, 214, 143, 0.1); }
.bubble.interviewer .who { color: var(--green); }
.bubble .text { font-size: 1.1rem; }
.caret::after { content: "▍"; color: var(--crema); animation: caret .8s steps(1) infinite; margin-left: 1px; }
@keyframes caret { 50% { opacity: 0; } }

.pair { width: min(100%, 72rem); display: grid; grid-template-columns: 1fr auto 1fr; gap: 1.6rem; align-items: center; }
.pair .words { font: 400 1.35rem/1.4 var(--sans); color: var(--chalk); }
.pair .arrow { font-size: 2rem; color: var(--green); }
.pair .exact { font-size: 1.05rem; color: var(--milk); }
.pair .exact .tag { margin-bottom: 0.4rem; }
.tag { display: inline-block; font: 700 0.72rem/1 var(--sans); padding: 0.28rem 0.55rem; border-radius: 999px; white-space: nowrap; vertical-align: middle; }
.tag.code { background: rgba(75, 214, 143, 0.15); color: var(--green); }
.tag.ai { background: rgba(185, 168, 255, 0.15); color: var(--violet); }

.weeks { width: min(100%, 76rem); list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.55rem; }
.week { padding: 0.5rem 0.7rem; border-radius: 0.7rem; background: var(--surface); font-size: 0.85rem; line-height: 1.25; border: 1px solid var(--line); animation: detail-in .35s ease-out both; }
.week .res { display: block; margin-top: 0.3rem; font-weight: 700; font-size: 0.82rem; }
.week.pass .res { color: var(--green); }
.week.caught .res { color: var(--tomato); }
.week.wrong { border-color: var(--tomato); }

.ask { width: min(100%, 62rem); display: grid; gap: 0.7rem; justify-items: center; }
.ask textarea, .ask .note {
  width: 100%; font: 400 1.4rem/1.4 var(--sans); color: var(--chalk); background: rgba(246, 236, 214, 0.07);
  border: 1px dashed rgba(246, 236, 214, 0.3); border-radius: 0.8rem; padding: 0.6rem 1rem; resize: none; text-align: center;
}
.ask textarea:focus-visible { outline: 3px solid var(--crema); }
.noted { font-weight: 700; color: var(--green); background: rgba(75, 214, 143, 0.1); border-radius: 999px; padding: 0.4rem 1rem; }

.suggest { width: min(100%, 76rem); display: grid; grid-template-columns: 1.1fr 1fr; gap: 1.6rem; align-items: start; }
.suggest .say { font-size: 1.15rem; color: var(--milk); }
.suggest .say::before { content: "The assistant: "; color: var(--crema); font-weight: 700; }
.suggest ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.25rem; font-size: 0.95rem; color: var(--milk-soft); }
.suggest li::before { content: "↳ "; color: var(--crema); }

.caught { width: min(100%, 70rem); list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.caught li { font-size: 1.25rem; font-weight: 700; color: var(--tomato); display: flex; gap: 0.7rem; align-items: baseline; animation: detail-in .4s ease-out both; }
.caught li small { font-size: 0.8rem; color: var(--milk-soft); font-weight: 700; min-width: 9rem; text-align: right; }
.caught li.kept { color: var(--green); }

.verdict-line { font-size: 1.35rem; max-width: 68rem; text-align: center; color: var(--milk); }
.verdict-line b { color: var(--violet); }
.final { display: grid; gap: 0.6rem; justify-items: center; text-align: center; }
.final .big { font-size: 1.6rem; font-weight: 700; color: var(--green); }
.final .meter { color: var(--milk-soft); font-size: 0.95rem; }

/* Controls */
.controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.controls .go { justify-self: end; display: flex; align-items: center; gap: 1rem; }
.controls > :first-child { justify-self: start; }
.hint { color: var(--milk-soft); font-size: 0.95rem; visibility: hidden; }
.hint.show { visibility: visible; animation: hint 1.8s ease-in-out infinite; }
.hint kbd { font: 700 0.85rem var(--sans); border: 1px solid var(--milk-soft); border-radius: 0.35rem; padding: 0.05rem 0.4rem; }
@keyframes hint { 50% { opacity: 0.4; } }

/* Title card */
.title-card { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: radial-gradient(50rem 30rem at 50% 50%, #123527, var(--night) 75%); transition: opacity .7s; }
.title-card.gone { opacity: 0; pointer-events: none; }
.title-inner { text-align: center; display: grid; gap: 1.2rem; justify-items: center; max-width: 70rem; padding: 2rem; }
.kicker { color: var(--green); font-weight: 700; }
.title-inner h1 { font-size: 3rem; line-height: 1.15; }
.title-inner h1 .hand { color: var(--chalk); }
.title-sub { font-size: 1.4rem; line-height: 1.4; color: var(--milk-soft); max-width: 46rem; }
.title-actions { display: flex; gap: 1rem; margin-top: 0.6rem; }
.title-actions button { font-size: 1.15rem; padding: 0.8rem 2.2rem; }
.title-note { font-size: 0.85rem; color: var(--milk-soft); }

/* Flying rule (her handwriting travelling to its gate) */
.flyer { position: fixed; z-index: 30; font: 700 1rem/1 var(--sans); color: var(--crema); text-shadow: 0 0 14px var(--crema-glow); pointer-events: none; white-space: nowrap; }

/* Technical detail */
dialog { width: min(92vw, 72rem); max-height: 88vh; border: 1px solid var(--line); border-radius: 1.2rem; padding: 0; color: var(--milk); background: #0d1b15; }
dialog::backdrop { background: rgba(3, 8, 6, 0.7); }
dialog > header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.4rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #0d1b15; }
#inspectBody { padding: 1rem 1.4rem 1.4rem; display: grid; gap: 1.1rem; font-size: 0.9rem; }
#inspectBody h3 { font-size: 1rem; margin-bottom: 0.35rem; color: var(--green); }
#inspectBody pre { background: rgba(255,255,255,0.04); border-radius: 0.6rem; padding: 0.8rem; overflow: auto; font-size: 0.8rem; line-height: 1.4; margin: 0; max-height: 22rem; white-space: pre-wrap; }
#inspectBody table { border-collapse: collapse; width: 100%; }
#inspectBody th, #inspectBody td { text-align: left; padding: 0.3rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
#inspectBody .num { text-align: right; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* After chapter 1 the notebook steps back: her rules now live on the track as gates. */
body:not([data-chapter="1"]) .notebook { opacity: 0; max-height: 0; padding: 0; border-width: 0; }
body[data-chapter="1"] .detail { padding-left: 19%; }

/* Recap: the week she approved, and what happened, in plain words */
.recap {
  position: fixed; inset: 10.4rem 1.6rem 4.4rem; z-index: 15; overflow: auto; border-radius: 1.4rem; padding: 1.4rem 1.8rem;
  background: rgba(10, 22, 17, 0.94); border: 1px solid rgba(75, 214, 143, 0.35); box-shadow: 0 0 80px rgba(75, 214, 143, 0.15), 0 30px 80px rgba(0,0,0,0.6);
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 2rem; backdrop-filter: blur(6px);
  animation: recap-in .8s cubic-bezier(.2,.8,.2,1);
}
@keyframes recap-in { from { opacity: 0; transform: translateY(40px) scale(0.98); } }
.recap h2 { font-size: 1.25rem; margin-bottom: 0.7rem; color: var(--green); }
.roster { width: 100%; border-collapse: separate; border-spacing: 0.25rem; table-layout: fixed; }
.roster th { font-size: 0.85rem; color: var(--milk-soft); font-weight: 700; text-align: center; padding-bottom: 0.2rem; }
.roster th.who, .roster td.who { text-align: left; width: 8.5rem; }
.roster th.hrs, .roster td.hrs { width: 4.2rem; text-align: right; }
.roster td.who { font-weight: 700; font-size: 1rem; white-space: nowrap; }
.roster td.who small { display: block; font-weight: 400; font-size: 0.75rem; color: var(--milk-soft); }
.roster td.hrs { font-weight: 700; font-variant-numeric: tabular-nums; }
.roster td.hrs.full { color: var(--crema); }
.roster td.shift { border-radius: 0.5rem; padding: 0.3rem 0.35rem; text-align: center; height: 3rem; vertical-align: middle; line-height: 1.1; }
.roster td.shift b { display: block; font-size: 0.85rem; }
.roster td.shift span { font-size: 0.68rem; color: var(--milk-soft); }
.roster td.open { background: rgba(75, 214, 143, 0.12); }
.roster td.close { background: rgba(185, 168, 255, 0.13); }
.roster td.mid { background: rgba(242, 180, 65, 0.12); }
.roster td.new { box-shadow: inset 0 0 0 2px var(--crema), 0 0 14px var(--crema-glow); }
.roster td.off { background: repeating-linear-gradient(135deg, rgba(255,95,74,0.08) 0 6px, transparent 6px 12px); color: var(--tomato); font-size: 0.75rem; font-weight: 700; }
.roster td.empty { background: rgba(238, 243, 236, 0.025); }
.legend { display: flex; gap: 1.2rem; margin-top: 0.7rem; font-size: 0.8rem; color: var(--milk-soft); flex-wrap: wrap; }
.legend i { display: inline-block; width: 0.9rem; height: 0.9rem; border-radius: 0.25rem; vertical-align: -0.12rem; margin-right: 0.35rem; }
.story { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; counter-reset: st; align-content: start; }
.story li { counter-increment: st; display: grid; grid-template-columns: 2rem 1fr; gap: 0.6rem; font-size: 1rem; line-height: 1.35; animation: detail-in .5s ease-out both; }
.story li::before { content: counter(st); display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 2px solid var(--line); font-weight: 700; font-size: 0.85rem; color: var(--milk-soft); }
.story li.back::before { border-color: var(--tomato); color: var(--tomato); }
.story li.ok::before { border-color: var(--green); color: var(--green); }
.story li .quote { font: 400 1.1rem/1.4 var(--sans); color: var(--chalk); }
.story li b { color: var(--milk); }
.story li .why { display: block; color: var(--tomato); font-size: 0.92rem; margin-top: 0.15rem; }
.story li.ok .why { color: var(--green); }

/* For builders: one lesson under the caption at the moment it's shown */
.lesson {
  justify-self: center; margin-top: 0.45rem; display: flex; align-items: baseline; gap: 0.7rem; max-width: 64rem;
  padding: 0.45rem 1.1rem; border-radius: 0.8rem; border: 1px solid rgba(143, 208, 255, 0.45); background: rgba(143, 208, 255, 0.07);
  font-size: 1.05rem; color: var(--milk); text-align: left;
}
.lesson b { color: var(--sky); white-space: nowrap; }
.lesson[hidden] { display: none; }
.lesson.swap { animation: caption-in .6s .25s cubic-bezier(.2,.7,.2,1) both; }

/* Built with: the tech doing the work right now */
.stack { display: grid; justify-items: center; gap: 0.3rem; min-width: 0; }
.chips { display: flex; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.chips li {
  font-size: 0.85rem; font-weight: 700; padding: 0.22rem 0.75rem; border-radius: 999px; color: var(--milk-soft);
  border: 1px solid var(--line); opacity: 0.55; transition: opacity .4s, color .4s, border-color .4s, box-shadow .4s;
}
.chips li.on { opacity: 1; color: var(--crema); border-color: var(--crema); box-shadow: 0 0 16px var(--crema-glow); }
.doing { font-size: 0.9rem; color: var(--milk-soft); min-height: 1.3em; text-align: center; max-width: 52rem; }

/* Takeaways: what another builder can use, and where each piece of tech did its job */
.recap.takeaways { align-content: center; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); border-color: rgba(143, 208, 255, 0.4); box-shadow: 0 0 80px rgba(143, 208, 255, 0.12), 0 30px 80px rgba(0,0,0,0.6); }
.takeaways h2 { color: var(--sky); }
.takeaways ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 1rem; counter-reset: tk; }
.takeaways ol li { counter-increment: tk; display: grid; grid-template-columns: 2.2rem 1fr; gap: 0.7rem; font-size: 1.35rem; line-height: 1.35; animation: detail-in .5s ease-out both; }
.takeaways ol li::before { content: counter(tk); display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; border: 2px solid var(--sky); color: var(--sky); font-weight: 700; font-size: 0.95rem; }
.takeaways ol li:nth-child(2) { animation-delay: .15s; } .takeaways ol li:nth-child(3) { animation-delay: .3s; } .takeaways ol li:nth-child(4) { animation-delay: .45s; }
.takeaways dl { margin: 0; }
.takeaways dt { font-weight: 700; color: var(--crema); font-size: 1.15rem; }
.takeaways dd { margin: 0.2rem 0 1.1rem; color: var(--milk); font-size: 1.1rem; line-height: 1.4; }
.takeaways .pattern { grid-column: 1 / -1; text-align: center; font-size: 1.15rem; color: var(--milk-soft); border-top: 1px solid var(--line); padding-top: 0.9rem; }
.caught li.more { color: var(--milk-soft); font-size: 1rem; }

/* Act two: the website chat. The card is a draft reply; the end of the track is the customer. */
.card.reply .card-grid { grid-template-columns: 1fr; grid-auto-rows: 0.45rem; align-content: center; gap: 0.4rem; }
.card.reply .card-grid span { background: #b9cbbf; }
.card.reply .card-grid span:nth-child(2) { width: 85%; }
.card.reply .card-grid span:nth-child(3) { width: 55%; }
body[data-act="chat"] .approve-btn { display: none; }
.convo { width: min(100%, 72rem); display: grid; gap: 0.45rem; }
.convo .bubble { max-width: 76%; padding: 0.45rem 0.9rem; }
.bubble.customer { justify-self: start; border-bottom-left-radius: 0.3rem; background: rgba(238, 243, 236, 0.08); }
.bubble.customer .text { font-size: 1.15rem; line-height: 1.35; }
.bubble.bot { justify-self: end; border-bottom-right-radius: 0.3rem; background: rgba(242, 180, 65, 0.1); border: 1px dashed rgba(242, 180, 65, 0.5); }
.bubble.bot .who { color: var(--crema); }
.bubble.bot.sent { background: rgba(75, 214, 143, 0.12); border: 1px solid rgba(75, 214, 143, 0.5); }
.bubble.bot.sent .who { color: var(--green); }
.bubble.bot.stopped { border-color: var(--tomato); background: rgba(255, 95, 74, 0.08); }
.bubble.bot.stopped .who { color: var(--tomato); }
.bubble.bot.stopped .text { text-decoration: line-through; text-decoration-color: rgba(255, 95, 74, 0.6); color: var(--milk-soft); }
.bubble.bot .text { font-size: 1.05rem; line-height: 1.35; }
.promises { width: min(100%, 64rem); list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; justify-items: center; text-align: center; }
.promises li { font-size: 1.3rem; font-weight: 700; color: var(--crema); animation: detail-in .4s ease-out both; }
.promises li.none { color: var(--green); }
.stories { width: min(100%, 70rem); list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.stories li { font-size: 1.15rem; color: var(--chalk); display: flex; gap: 0.8rem; align-items: baseline; animation: detail-in .45s ease-out both; }
.stories li small { min-width: 13rem; text-align: right; font-size: 0.85rem; font-weight: 700; color: var(--green); }

/* Title card: pick which demo to play */
.pick { display: flex; gap: 0.8rem; margin-top: 0.4rem; }
.pick button { display: grid; gap: 0.2rem; text-align: left; padding: 0.75rem 1.2rem; border-radius: 0.9rem; border: 2px solid var(--line); color: var(--milk); background: var(--surface); min-width: 13rem; }
.pick button b { font-size: 1.1rem; }
.pick button span { font-size: 0.85rem; font-weight: 400; color: var(--milk-soft); }
.pick button[aria-checked="true"] { border-color: var(--green); background: rgba(75, 214, 143, 0.1); box-shadow: 0 0 24px rgba(75, 214, 143, 0.2); }
.pick button[aria-checked="true"] b { color: var(--green); }
/* Only the chapters of the demo being played */
body[data-show="chat"] .chapters li:not([data-chapter="5"]) { display: none; }
body[data-show="rota"] .chapters li[data-chapter="5"] { display: none; }

/* The chat act on its own shows her notebook while her rules are set up, like chapter 1. */
body.rules-phase .notebook { opacity: 1; max-height: 14rem; padding: 0.5rem 0.7rem; border-width: 1px; }
body.rules-phase .detail { padding-left: 19%; }

.evidence-btn { display: inline-block; margin-top: 0.9rem; font-weight: 700; font-size: 0.95rem; color: var(--sky); border: 2px solid rgba(143, 208, 255, 0.5); border-radius: 999px; padding: 0.45rem 1.1rem; text-decoration: none; }
.evidence-btn:hover, .evidence-btn:focus-visible { background: rgba(143, 208, 255, 0.1); outline: none; }

/* The notes start empty and fill in as she tells each story. */
.notebook::before { content: "Interview notes"; display: block; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--milk-soft); margin-bottom: 0.2rem; }
.notebook li.unwritten { display: none; }
.notebook:not(:has(li:not(.unwritten))) { display: none; }
.notebook li.written { animation: note-in .6s ease-out backwards; }
@keyframes note-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 0.9; transform: none; } }
@media (prefers-reduced-motion: reduce) { .notebook li.written { animation: none; } }

/* Back to the title card when the demo ends. */
.restart-btn { grid-column: 1 / -1; justify-self: center; margin-top: 0; cursor: pointer; background: none; font-family: inherit; }

/* Her other rules: the saved interview opening, then the rule it produced. */
.story-rule { display: flex; gap: 0.7rem; align-items: baseline; flex-wrap: wrap; margin: 0.3rem 0 0; font-size: 1.35rem; color: var(--green); animation: detail-in .4s ease-out both; }
.story-rule .arrow { color: var(--milk-soft); }
.story-rule small { font-size: 0.9rem; color: var(--milk-soft); font-weight: 700; }

/* The rule the AI judge weighs, under its name, like a gate's label. */
.judge-rule { position: absolute; top: 100%; left: 50%; translate: -50% 0; width: max-content; margin: 0.25rem 0 0; font-size: 0.9rem; font-weight: 700; line-height: 1.2; color: var(--violet, #a99bff); max-width: 11rem; animation: detail-in .4s ease-out both; }

.convo .disclosure { font-size: 0.8em; opacity: 0.75; text-align: center; margin-bottom: 0.6em; }

#startLive{display:none}
