/* ==========================================================================
   Selected work — animated workbench (observe → diagnose → fix)
   ========================================================================== */

.work-section {
  --ok: #3f6f48; --ok-bg: #e6efe0;
  --bad: #a3553f; --bad-bg: #f7e8e2;
  --warn: #8c600d; --warn-bg: #f6eed9;
  --soft: #f3f2ee; --line: #e0e3dd; --muted: #626962; --deep: #183c2b;
}

/* ---------- Card and shell ---------- */
.deck-card[data-card="work"] { overflow: hidden; }
.deck-enabled .work-section { height: 100%; padding: 104px 0 17px; }
.deck-enabled .work-section > .wrap { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.deck-enabled .work-section h2 { font-family: var(--sans); font-size: 16px; font-weight: 500; letter-spacing: .06em; margin: 0 0 10px; line-height: 1.2; }

.example-lab { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.work-icon { width: 22px; height: 22px; flex: none; display: block; }

.lab-tablist { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: relative; border-bottom: 1px solid #c9cdd1; flex: none; margin-bottom: 12px; }
.lab-tablist button { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; font: inherit; font-size: 11px; border: 0; color: #727272; padding: 10px 12px 13px; background: transparent; cursor: pointer; min-height: 52px; white-space: nowrap; transition: color .2s; }
.lab-tablist button:hover { color: #222; }
.lab-tablist button[aria-selected="true"] { color: var(--deep); font-weight: 500; }
.lab-tab-indicator { position: absolute; bottom: -1px; left: 0; height: 2px; background: #111; transition: transform .3s cubic-bezier(.2,.7,.2,1), width .3s; pointer-events: none; }

.lab-reading { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #aaa transparent; border-radius: 7px; background: #fffffff2; border: 1px solid #d3d7d3; outline-offset: 3px; }
.lab-body { display: grid; grid-template-columns: minmax(200px, .72fr) minmax(0, 2.3fr); min-height: 100%; }

.lab-navigation { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid #ced0d0; margin-top: 8px; padding-top: 5px; flex: none; }
.lab-navigation button { border: 0; background: transparent; color: #222; font: inherit; font-size: 11px; cursor: pointer; min-height: 35px; display: flex; align-items: center; gap: 8px; padding: 0 2px; }
.lab-navigation button:disabled { opacity: .25; cursor: default; }
.lab-progress { font-family: monospace; font-size: 10px; color: #6c726c; white-space: nowrap; }

/* ---------- Brief (problem / what I did / outcome) ---------- */
.lab-brief { grid-column: 1; grid-row: 1; padding: 20px 20px 18px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; font-size: 11.5px; line-height: 1.6; color: #3f4540; background: #fbfaf6; }
.brief-kicker { font-size: 8px; letter-spacing: .1em; text-transform: uppercase; color: var(--ok); font-weight: 500; }
.lab-brief h3 { font: 500 17px/1.25 var(--sans); letter-spacing: -.02em; color: #1d2a22; margin: 0 0 4px; }
.brief-row strong { font-weight: 500; color: #1d2a22; }
.brief-demo { margin-top: auto; padding-top: 10px; font-size: 7.5px; letter-spacing: .09em; color: #858a83; }

/* ---------- Stage and phase rail ---------- */
.lab-stagewrap { grid-column: 2; grid-row: 1; min-width: 0; padding: 14px 22px 20px; display: flex; flex-direction: column; gap: 14px; }

.lab-rail { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 3; margin: -14px -22px 0; padding: 12px 22px 10px; background: linear-gradient(#fffffff7 80%, #fffffff7 80%, #ffffff00); }
.rail-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; flex: 1; }
.rail-step { font: inherit; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: #8b908a; display: flex; flex-direction: column; gap: 7px; min-height: 34px; justify-content: center; border-radius: 3px; }
.rail-step:hover { color: #3f4540; }
.rs-track { display: block; height: 2px; background: #e3e5e1; border-radius: 2px; overflow: hidden; }
.rs-track i { display: block; height: 100%; background: var(--deep); transform: scaleX(0); transform-origin: left; }
.rs-name { display: flex; gap: 7px; font-size: 9px; letter-spacing: .09em; text-transform: uppercase; }
.rs-num { font-family: monospace; opacity: .7; }
.rail-step.is-past { color: #4e5a51; }
.rail-step[aria-current="step"] { color: var(--deep); font-weight: 500; }
.rail-play { width: 34px; height: 34px; flex: none; border-radius: 50%; border: 1px solid #c9cfc8; background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--deep); padding: 0; transition: background .2s, border-color .2s; }
.rail-play:hover { background: var(--ok-bg); border-color: #9db79a; }
.rail-play .work-icon { width: 14px; height: 14px; }

.lab-canvas { position: relative; font-size: 13px; line-height: 1.55; flex: 1; }

/* ---------- Shared pieces ---------- */
.cap { font-size: 8px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.swap { display: inline-grid; }
.swap > * { grid-area: 1 / 1; transition: opacity .35s; }
.swap > .b { opacity: 0; }
.ph-2 .swap > .a { opacity: 0; }
.ph-2 .swap > .b { opacity: 1; }
.lvl-pass { color: var(--ok); } .lvl-revise { color: var(--warn); } .lvl-fail { color: var(--bad); }

.compact-source { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: #4f5952; }
.compact-source .work-icon { width: 19px; height: 19px; }

.take { display: flex; align-items: flex-start; gap: 10px; font-size: 12px; line-height: 1.55; color: #3f5a43; border-top: 1px solid var(--line); padding-top: 11px; opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .4s; }
.take .work-icon { width: 17px; height: 17px; color: var(--ok); margin-top: 1px; }
.ph-2 .take { opacity: 1; transform: none; transition-delay: calc(var(--take-delay, 1200ms)); }

@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } }

/* ==========================================================================
   1. Translation — live edit
   ========================================================================== */
.tr { display: flex; flex-direction: column; gap: 14px; min-height: 100%; }
.tr-src { font-size: 17px; color: #1d2a22; flex-basis: 100%; }
.tr-box { background: var(--soft); border-radius: 6px; padding: 14px 20px 16px; border-left: 3px solid transparent; transition: background .6s, border-color .6s; }
.ph-2 .tr-box { background: var(--ok-bg); border-left-color: var(--ok); transition-delay: .5s; }
.tr-line { font-size: clamp(22px, 2.4vw, 32px); line-height: 1.3; letter-spacing: -.02em; margin-top: 6px; color: #2b2f2c; }

.tw { display: inline-block; vertical-align: top; white-space: nowrap; max-width: 14em; overflow: hidden; margin-right: .26em; padding-bottom: .08em;
  background: linear-gradient(var(--bad), var(--bad)) left 96% / 0 2px no-repeat;
  animation: fade-up .35s calc(var(--i) * 70ms) both;
  transition: max-width .45s cubic-bezier(.4,0,.2,1), opacity .3s, margin .45s, color .3s, background-size .4s; }
.ph-1 .tw-del { color: var(--bad); background-size: 100% 2px; transition-delay: calc(var(--k) * 140ms); }
.ph-2 .tw-del { max-width: 0; opacity: 0; margin-right: 0; transition-delay: calc(var(--k) * 90ms); }
.tw-add { max-width: 0; opacity: 0; margin-right: 0; color: var(--ok); font-weight: 500; animation: none; }
.ph-2 .tw-add { max-width: 14em; opacity: 1; margin-right: .26em; transition-delay: calc(var(--k) * 90ms + 380ms); }
.ph-2 .tw-same { color: #254a30; transition-delay: .5s; }

.tr-tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; min-height: 27px; }
.tr-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; padding: 4px 11px 4px 8px; border-radius: 999px; background: var(--bad-bg); color: var(--bad); opacity: 0; transform: translateY(6px) scale(.96);
  transition: opacity .3s, transform .3s, background .4s, color .4s; transition-delay: calc(var(--i) * 160ms + 250ms); }
.tr-tag .work-icon { width: 13px; height: 13px; }
.tr-tag .i-ok { display: none; }
.ph-1 .tr-tag { opacity: 1; transform: none; }
.ph-2 .tr-tag { background: var(--ok-bg); color: var(--ok); transition-delay: calc(var(--i) * 120ms + 800ms); }
.ph-2 .tr-tag .i-ok { display: block; } .ph-2 .tr-tag .i-bad { display: none; }
.tr-tag--ok { background: var(--ok-bg); color: var(--ok); }

.tr-dots { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }
.tr-dots .cap { margin-right: 4px; }
.tr-dot { width: 26px; height: 26px; border-radius: 50%; border: 1px solid #c5ccc4; background: #fff; cursor: pointer; display: grid; place-items: center; font: 9px/1 monospace; color: #6d736c; padding: 0; transition: background .3s, border-color .3s, color .3s, box-shadow .3s; }
.tr-dot:hover { border-color: var(--deep); }
.tr-dot.is-kept { border-style: dashed; }
.tr-dot.is-done { background: var(--ok-bg); border-color: #9db79a; color: var(--ok); }
.tr-dot.is-current { border-color: var(--deep); box-shadow: 0 0 0 3px #183c2b1f; color: var(--deep); }
.ph-2 .tr-dot.is-current { background: var(--ok-bg); transition-delay: 1s; }

/* ==========================================================================
   2. AI replies — grading in motion
   ========================================================================== */
.ai { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px 26px; position: relative; }
.ai-scene, .ai > .take { grid-column: 1 / -1; }
.ai-left, .ai-right { min-width: 0; display: flex; flex-direction: column; gap: 6px; }

.ai-cust { font-size: 12.5px; background: var(--soft); border-radius: 10px 10px 10px 2px; padding: 9px 13px; color: #2f3530; animation: fade-up .4s .1s both; }
.ai-replycap { margin-top: 8px; }
.ai-replies { display: grid; }
.ai-replies > * { grid-area: 1 / 1; }
.ai-draft, .ai-rev { border-left: 2px solid var(--line); padding: 2px 0 2px 14px; font-size: 15px; line-height: 1.65; transition: opacity .45s, transform .45s, visibility 0s; }
.ai-rev { opacity: 0; visibility: hidden; transform: translateX(16px); border-left-color: var(--ok); }
.ph-2 .ai-draft { opacity: 0; visibility: hidden; transform: translateX(-16px); transition: opacity .45s, transform .45s, visibility 0s .45s; }
.ph-2 .ai-rev { opacity: 1; visibility: visible; transform: none; transition-delay: .35s; }
.ai-s { animation: fade-up .4s calc(var(--i) * 380ms + 450ms) both; }

.ai-flag { border-radius: 3px; transition: background .4s, box-shadow .4s, color .4s; transition-delay: calc(var(--k) * 260ms); }
.ai-flag .work-icon { display: inline-block; width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; color: var(--bad); }
.ph-1 .ai-flag.g-revise { background: var(--warn-bg); box-shadow: 0 0 0 2px var(--warn-bg); }
.ph-1 .ai-flag.g-fail { background: var(--bad-bg); box-shadow: 0 0 0 2px var(--bad-bg); }
.ai-badge { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; font: 500 8px/1 var(--sans); vertical-align: super; margin-left: 3px; color: #fff; transform: scale(0); transition: transform .3s cubic-bezier(.3,1.6,.5,1); transition-delay: calc(var(--k) * 260ms + 150ms); }
.g-revise .ai-badge { background: var(--warn); } .g-fail .ai-badge { background: var(--bad); } .g-pass .ai-badge { background: var(--ok); }
.ph-1 .ai-badge { transform: scale(1); }

.ai-grid { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.ai-crit { display: grid; grid-template-columns: 18px 1fr auto; gap: 3px 9px; align-items: center; font-size: 11.5px; padding: 6px 9px; border-radius: 6px; transition: background .4s; }
.ph-1:not(.ph-2) .ai-crit.is-flagged { background: #f8f7f2; }
.ai-num { width: 18px; height: 18px; border-radius: 50%; border: 1px solid #c9cec8; display: grid; place-items: center; font-size: 9px; color: #4f5952; }
.ai-name { font-weight: 500; }
.ai-lvl { font-size: 9px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; opacity: 0; transition: opacity .3s calc(var(--i) * 140ms + 300ms); }
.ph-1 .ai-lvl { opacity: 1; }
.ai-bar { grid-column: 2 / 4; height: 5px; background: #eceeea; border-radius: 3px; overflow: hidden; }
.ai-bar i { display: block; height: 100%; width: 0; border-radius: 3px; transition: width .7s cubic-bezier(.2,.7,.2,1), background .4s; transition-delay: calc(var(--i) * 140ms); }
.ph-1 .ai-bar i.g-pass { width: 100%; background: var(--ok); }
.ph-1 .ai-bar i.g-revise { width: 55%; background: var(--warn); }
.ph-1 .ai-bar i.g-fail { width: 22%; background: var(--bad); }
.ph-2 .ai-bar i { width: 100%; background: var(--ok); transition-delay: calc(var(--i) * 140ms + 600ms); }
.ai-why { grid-column: 2 / 4; font-size: 10.5px; line-height: 1.45; color: var(--muted); opacity: 0; transition: opacity .3s calc(var(--i) * 140ms + 400ms); }
.ph-1 .ai-why { opacity: 1; }

.ai-overall { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 9px 0; border-top: 1px solid var(--line); margin-top: 4px; }
.ai-stamp { border: 2px solid currentColor; font: 600 10px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; padding: 6px 10px; border-radius: 4px; opacity: 0; transform: rotate(-5deg) scale(1.7);
  transition: opacity .25s, transform .4s cubic-bezier(.3,1.5,.5,1), color .3s; transition-delay: 1.5s; }
.ai-stamp > .a { color: var(--bad); } .ai-stamp > .b { color: var(--ok); }
.ph-1 .ai-stamp { opacity: 1; transform: rotate(-5deg) scale(1); color: var(--bad); }
.ph-2 .ai-stamp { color: var(--ok); transition-delay: 1.4s; }

.ai-links { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; transition: opacity .3s; }
.ai-links path { fill: none; stroke-width: 1.2; opacity: .55; stroke-dasharray: var(--len); stroke-dashoffset: var(--len); transition: stroke-dashoffset .7s ease; transition-delay: calc(var(--k) * 260ms + 250ms); }
.ai-links path.g-revise { stroke: var(--warn); } .ai-links path.g-fail { stroke: var(--bad); }
.ph-1 .ai-links path { stroke-dashoffset: 0; }
.ph-2 .ai-links { opacity: 0; }

/* ==========================================================================
   3. Teaching — reading friction
   ========================================================================== */
.tc { display: flex; flex-direction: column; gap: 12px; }
.tc-level { margin-left: auto; }
.tc .k1 { --kc: #a3553f; } .tc .k2 { --kc: #8c600d; } .tc .k3 { --kc: #46607f; } .tc .k4 { --kc: #7a4a86; }

.tc-counters { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; }
.tc-count { display: flex; align-items: center; gap: 7px; font-size: 11px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); transition: border-color .3s, color .3s, background .3s, opacity .3s; }
.tc-count b { font: 500 13px/1 var(--sans); color: var(--kc); min-width: 1ch; text-align: center; }
.tc-count.is-focus { border-color: var(--kc); color: #1d2a22; background: #fff; }
.tc-count.is-clear { opacity: .6; }
.tc-count.is-clear b { color: var(--ok); }
.tc-swatch { font-size: 10px; color: transparent; text-decoration: underline 2px var(--kc); text-underline-offset: 2px; line-height: 1; }
.k2 .tc-swatch { text-decoration-style: wavy; } .k3 .tc-swatch { text-decoration-style: dotted; } .k4 .tc-swatch { text-decoration-style: dashed; }

.tc-passage { font-size: 14.5px; line-height: 1.9; color: #2b302c; max-width: 72ch; }
.seg-old { text-decoration: underline 1.5px; text-decoration-color: color-mix(in srgb, var(--kc) 45%, transparent); text-underline-offset: 4px; border-radius: 3px; transition: background .35s, color .35s, opacity .3s, text-decoration-color .3s; }
.k2 > .seg-old { text-decoration-style: wavy; } .k3 > .seg-old { text-decoration-style: dotted; } .k4 > .seg-old { text-decoration-style: dashed; }
.lab-canvas.ph-1[data-k="1"] .k1 > .seg-old,
.lab-canvas.ph-1[data-k="2"] .k2 > .seg-old,
.lab-canvas.ph-1[data-k="3"] .k3 > .seg-old,
.lab-canvas.ph-1[data-k="4"] .k4 > .seg-old { background: color-mix(in srgb, var(--kc) 13%, transparent); color: var(--kc); text-decoration-color: var(--kc); box-shadow: 0 0 0 2px color-mix(in srgb, var(--kc) 13%, transparent); animation: seg-pulse 1.6s ease-in-out infinite; }
.seg.is-leaving > .seg-old { opacity: .3; text-decoration: line-through 1.5px var(--kc); animation: none; }
.seg-new { display: none; }
.seg.is-done > .seg-old { display: none; }
.seg.is-done > .seg-new { display: inline; }
.seg.just > .seg-new { animation: seg-new 1.6s ease both; border-radius: 3px; }
@keyframes seg-pulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--kc) 8%, transparent); } }
@keyframes seg-new { 0% { opacity: 0; background: #cfe3c6; } 20% { opacity: 1; background: #cfe3c6; } 100% { background: transparent; } }
.tc-passage mark { background: none; color: inherit; transition: background .5s; }
.glossed .tc-passage mark { background: var(--ok-bg); text-decoration: underline dotted 1.5px var(--ok); text-underline-offset: 4px; border-radius: 2px; }

.tc-rhythm { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.tc-rhythm .cap { align-self: center; }
.tc-bars { display: flex; align-items: flex-end; gap: 3px; height: 34px; border-bottom: 1px solid var(--line); }
.tc-bar { display: block; width: 11px; height: calc(var(--h) * 1%); background: #c3cbc1; border-radius: 2px 2px 0 0; transition: height .55s cubic-bezier(.2,.7,.2,1), background .4s; }
.lab-canvas[data-k="3"] .tc-bar { background: #46607f; }
.tc-avg { align-self: center; }
.tc-avg b { font-size: 15px; color: #1d2a22; font-weight: 500; }

.tc-tray, .tc-glosses { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 7px; padding: 8px 11px; border-radius: 6px; font-size: 11px; }
.tc-tray { border: 1px dashed #d8cba6; background: #fcfaf3; min-height: 38px; }
.tc-tray .cap, .tc-glosses .cap { margin-right: 6px; }
.tc-chip { padding: 2px 9px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); font-style: italic; opacity: 0; transform: translateY(-12px) scale(.85); transition: opacity .35s, transform .5s cubic-bezier(.3,1.4,.5,1); }
.tc-chip.is-in { opacity: 1; transform: none; }
.tc-glosses { background: var(--ok-bg); display: none; }
.glossed .tc-glosses { display: flex; animation: fade-up .45s both; }
.tc-gloss { background: #fff; border-radius: 999px; padding: 2px 10px; }
.tc-gloss b { font-weight: 500; color: #254a30; }
.tc-gloss span { color: var(--muted); }

/* ==========================================================================
   4. Agentic AI — animated trace
   ========================================================================== */
.agent { display: flex; flex-direction: column; gap: 12px; }
.agent-case-heading { display: flex; align-items: center; gap: 13px; }
.agent-case-icon { padding: 9px; border: 1px solid #d1d9d1; border-radius: 10px; background: #edf2e9; }
.agent-case-icon .work-icon { width: 26px; height: 26px; color: #365d3e; }
.agent-case-heading h3 { font: 500 19px/1.3 var(--sans); letter-spacing: -.025em; }
.agent-case-heading p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.demo-label { margin-left: auto; font-size: 7px; letter-spacing: .08em; color: #828780; white-space: nowrap; }

.flow-row { display: grid; grid-template-columns: 78px 1fr; gap: 14px; align-items: center; }
.flow-row.expected { opacity: .18; transition: opacity .5s; }
.ph-2 .flow-row.expected { opacity: 1; }
.agent-flow { position: relative; display: flex; align-items: stretch; gap: 10px; padding-top: 14px; }
.flow-step { position: relative; display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; padding: 13px 12px; border: 1px solid #d6dad4; border-radius: 7px; background: #f5f6f2; font-size: 11px; color: #4b524c;
  animation: fade-up .35s calc(var(--i) * 110ms) both; transition: background .35s, border-color .35s, color .35s, opacity .35s; }
.flow-step > .work-icon { width: 19px; height: 19px; color: #687463; }
.flow-step b { position: absolute; right: 7px; top: 4px; font-size: 6px; letter-spacing: .08em; font-weight: 500; opacity: 0; transform: scale(.6); transition: opacity .3s, transform .3s cubic-bezier(.3,1.6,.5,1); }
.flow-arrow { align-self: center; font-size: 16px; color: #9da696; }
.flow-dot { position: absolute; left: 0; top: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--deep); box-shadow: 0 0 0 4px #183c2b24; opacity: 0; z-index: 2; pointer-events: none; }

.observed .flow-step.is-reached { border-color: #9fb59b; background: #fff; }
.observed .flow-step.is-skip { border-style: dashed; opacity: .55; }
.observed .flow-step.is-bad { border-color: #c4917f; background: var(--bad-bg); color: var(--bad); }
.observed .flow-step.is-bad > .work-icon { color: var(--bad); }
.ph-1 .observed .flow-step[data-role="miss"] { opacity: 1; border: 1px dashed var(--bad); background: var(--bad-bg); color: var(--bad); animation: miss-pulse 1.4s ease-in-out 2; }
.ph-1 .observed .flow-step[data-role="miss"] b { opacity: 1; transform: none; color: var(--bad); }
.ph-1 .observed .flow-step.is-bad { animation: shake .45s .4s 1; }
.expected .flow-step.is-lit { border-color: #9fb59b; background: #fff; }
.expected .flow-step.is-lit[data-role="fixed"] { border-color: #86a27d; background: #e7efdf; color: #345335; }
.expected .flow-step.is-lit[data-role="fixed"] b { opacity: 1; transform: none; color: var(--ok); }
.expected .flow-step.is-lit:last-of-type { color: var(--ok); }

.trigger-note { display: flex; align-items: center; gap: 9px; font-size: 11.5px; color: #4f5651; opacity: 0; transform: translateX(-8px); transition: opacity .4s .3s, transform .4s .3s; }
.trigger-note > .work-icon { width: 17px; height: 17px; color: var(--bad); }
.ph-1 .trigger-note { opacity: 1; transform: none; }
.ph-1:not(.ph-2) .trigger-note > .work-icon { animation: bolt .5s .6s 2; }

@keyframes miss-pulse { 50% { box-shadow: 0 0 0 4px #a3553f1f; } }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@keyframes bolt { 50% { transform: scale(1.25) rotate(-8deg); } }

/* ==========================================================================
   Reduced motion: every phase is shown in its final state, no movement.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .lab-tab-indicator { transition: none; }
  .lab-canvas, .lab-canvas * { transition: none !important; animation: none !important; }
  .flow-dot { display: none; }
}
.lab-canvas.no-motion .tw, .lab-canvas.no-motion .ai-s, .lab-canvas.no-motion .ai-cust, .lab-canvas.no-motion .flow-step { animation: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (min-width: 1400px) and (min-height: 800px) {
  .deck-enabled .work-section { padding-top: 120px; padding-bottom: 28px; }
  .lab-stagewrap { padding: 20px 30px 26px; gap: 18px; }
  .lab-rail { margin: -20px -30px 0; padding: 16px 30px 12px; }
  .lab-brief { padding: 26px 26px 22px; font-size: 12.5px; }
  .lab-brief h3 { font-size: 20px; }
  .tr-line { font-size: 38px; }
  .ai-draft, .ai-rev { font-size: 17px; }
  .tc-passage { font-size: 16px; }
  .flow-step { padding: 18px 16px; font-size: 13px; }
  .agent-case-heading h3 { font-size: 23px; }
  .take { font-size: 13.5px; }
}

/* Brief moves under the stage */
@media (max-width: 1023px) {
  .lab-body { grid-template-columns: 1fr; }
  .lab-stagewrap { grid-column: 1; grid-row: 1; }
  .lab-brief { grid-column: 1; grid-row: 2; border-right: 0; border-top: 1px solid var(--line); }
  .brief-demo { margin-top: 4px; }
}

@media (max-width: 760px) {
  .ai { grid-template-columns: 1fr; }
  .lab-tablist button { font-size: 10px; padding-inline: 5px; gap: 6px; }
  .flow-row { grid-template-columns: 1fr; gap: 4px; }
  .agent-flow { gap: 6px; }
  .flow-step { padding: 12px 8px; font-size: 10px; gap: 6px; }
  .flow-arrow { font-size: 12px; }
  .tc-level { margin-left: 0; flex-basis: 100%; }
}

@media (max-width: 600px) {
  .deck-enabled .work-section { padding-top: 88px; padding-bottom: 13px; }
  .deck-enabled .work-section h2 { font-size: 13px; margin-bottom: 8px; }
  .lab-tablist { margin-bottom: 10px; }
  .lab-tablist button { flex-direction: column; gap: 7px; font-size: 9px; padding: 8px 3px 12px; min-height: 62px; }
  .lab-stagewrap { padding: 12px 14px 16px; gap: 12px; }
  .lab-rail { margin: -12px -14px 0; padding: 10px 14px 8px; }
  .lab-brief { padding: 16px 14px; }
  .rs-name { font-size: 8px; gap: 4px; }
  .tr-line { font-size: 22px; }
  .tr-src { font-size: 15px; }
  .ai-draft, .ai-rev { font-size: 14px; }
  .tc-passage { font-size: 13.5px; line-height: 1.8; }
  .flow-step { flex-direction: column; text-align: center; gap: 5px; padding: 14px 4px 8px; font-size: 9px; line-height: 1.35; }
  .flow-step b { left: 3px; right: 3px; font-size: 5px; text-align: center; }
  .agent-case-heading h3 { font-size: 16px; }
  .demo-label { display: none; }
  .lab-navigation button { font-size: 10px; min-height: 40px; }
}

@media (max-width: 360px) {
  .lab-tablist button { font-size: 8.5px; }
  .deck-enabled .work-section .wrap { padding-inline: 14px; }
}

@media (max-height: 500px) and (min-width: 601px) {
  .deck-enabled .work-section { padding-top: 63px; padding-bottom: 8px; }
  .deck-enabled .work-section h2 { display: none; }
  .lab-tablist button { min-height: 36px; padding-block: 6px; font-size: 10px; }
  .lab-tablist .work-icon { width: 18px; height: 18px; }
}

@media print {
  .deck-card[data-card="work"] { overflow: visible; }
  .deck-enabled .work-section { height: auto; }
  .lab-reading { overflow: visible; }
  .lab-navigation, .lab-tablist, .lab-rail { display: none; }
}
