/* Phase 3 only: natural document flow; earlier sections keep their existing styles. */
#demo.phase-three,#implementation.phase-three,#validation.phase-three,#results.phase-three{position:relative;inset:auto;width:100%;max-width:none;height:auto;min-height:0;aspect-ratio:auto;margin:0;padding:100px 0;overflow:visible;transform:none;background:#fffaf5;color:#2b1b12;border:0;border-radius:0;box-shadow:none;isolation:isolate;scroll-margin-top:84px;}
.phase-three{--p3-line:#dfd3c5;--p3-muted:#68584b;font-size:var(--type-body);line-height:1.8;}
.phase-three *{box-sizing:border-box;min-width:0;}
.phase-three :where(h2,h3,h4,p,figure,dl,dd,ul,ol,blockquote){margin:0;}
.phase-three :where(h2,h3,h4){color:inherit;font-family:inherit;letter-spacing:-.025em;text-wrap:balance;}
.phase-three :where(p,li,dd,a){overflow-wrap:break-word;text-wrap:pretty;}
.phase-three :where(a,button,input,summary):focus-visible{outline:3px solid #277954;outline-offset:4px;}
.phase-three [hidden]{display:none!important;}
.phase-three a{color:#a73803;text-underline-offset:5px;}
.phase-three button,.phase-three input{font:inherit;}
.phase-three button{cursor:pointer;}
.phase-three img{max-width:100%;height:auto;}
.p3-container{width:calc(100% - 96px);max-width:1280px;margin-inline:auto;}
.p3-wide{max-width:1440px;}
.p3-heading{max-width:850px;margin-bottom:56px;}
.p3-kicker,.p3-label{color:#a83b07;font-weight:750;font-size:var(--type-label);letter-spacing:.08em;}
.p3-heading h2{font-size:var(--type-h2);line-height:1.22;margin:18px 0 26px;}
.p3-heading>p:not(.p3-kicker){font-size:var(--type-body-large);max-width:750px;color:var(--p3-muted);margin-top:16px;}
.phase-three h3{font-size:var(--type-h3);line-height:1.35;}
.phase-three h4{font-size:var(--type-component-title);line-height:1.4;}
.phase-three .p3-note{font-size:var(--type-caption);color:var(--p3-muted);line-height:1.8;}
.p3-try{border-block:1px solid var(--p3-line);padding:24px 0;display:flex;justify-content:space-between;align-items:center;gap:24px;}
.p3-try ol{display:flex;list-style:none;padding:8px 0 0;gap:12px;flex-wrap:wrap;font-weight:650;}
.p3-try li:not(:last-child):after{content:'→';margin-left:12px;color:#a83b07;}
.p3-shortcuts{display:flex;flex-wrap:wrap;gap:8px;}
.p3-shortcuts button{border:1px solid #cfb69f;background:transparent;color:#8f3104;padding:10px 14px;border-radius:6px;font-size:var(--type-caption);min-height:44px;transition:background .15s ease;}
.p3-shortcuts button:hover{background:#fff0e2;}
.p3-try+.p3-note{margin:16px 0 30px;max-width:880px;}
#demo.phase-three .demobar{flex-wrap:wrap;gap:12px;}
#demo.phase-three .live{font-size:var(--type-label);color:#286b4b;}
#demo.phase-three .demoframe{min-height:440px;box-shadow:none;background:white;border-radius:16px;}
#demo.phase-three .demoside{flex-wrap:wrap;overflow:visible;}
#demo.phase-three .demoside button{font-size:var(--type-caption);min-height:44px;}
#demo.phase-three .demobrand{font-size:var(--type-label);}
#demo.phase-three .demohead,#demo.phase-three .demobody{min-width:0;}
#demo.phase-three .demohead h3{font-size:var(--type-h3);}
#demo.phase-three .search{font-size:var(--type-caption);min-height:44px;max-width:100%;color:#483324;background:#fff;border:1px solid #bda992;}
#demo.phase-three .search::placeholder{color:#736051;}
#demo.phase-three .btn{font-size:var(--type-caption);min-height:44px;box-shadow:none;}
#demo.phase-three .demostat small{font-size:var(--type-label);color:#68584b;}
#demo.phase-three .demostat b{font-size:24px;}
#demo.phase-three .demotable .drow{grid-template-columns:40px 1fr 1fr 1.2fr 80px;font-size:var(--type-caption);gap:14px;}
#demo.phase-three .drow strong{font-size:var(--type-caption);}
#demo.phase-three .drow span{color:#68584b;}
#demo.phase-three .drow .status{font-size:var(--type-label);color:#286b4b!important;white-space:normal;max-width:100%;}
#demo.phase-three .empty{font-size:var(--type-body);padding:60px 24px;color:#68584b;}
#demo.phase-three .prototype-note{font-size:var(--type-caption);line-height:1.8;color:#68584b;margin-top:16px;}
.p3-simulation{padding-left:18px;border-left:3px solid #427453;margin-top:22px;max-width:830px;}
.p3-simulation>b{font-size:var(--type-label);color:#286b4b;letter-spacing:.08em;}
.p3-simulation p{font-size:var(--type-caption);color:var(--p3-muted);}
#demo.phase-three #video{position:relative;width:100%;max-width:none;height:auto;min-height:0;margin:90px 0 40px;padding:0;background:none;aspect-ratio:auto;display:grid;grid-template-columns:.7fr 1.3fr;gap:48px;align-items:center;scroll-margin-top:100px;}
.p3-film h3{margin:14px 0 20px;}
.p3-film p:not(.p3-label){color:var(--p3-muted);max-width:480px;}
.p3-film .scenario-story-player{--scenario-orange:#c94606;width:100%;min-width:0;box-shadow:none;}
.p3-film .scenario-story-scene{height:380px;min-height:0;}
.p3-film .scenario-story-media{height:100%;object-fit:contain;background:#1d150f;}
.p3-film .scenario-story-scene-copy b{font-size:clamp(24px,2.5vw,38px);}
.p3-film .scenario-story-play{min-width:48px;min-height:48px;}
.p3-film .scenario-story-progress{min-height:32px;}
#demo.phase-three #posters{display:block;position:relative;width:100%;max-width:none;min-height:0;height:auto;margin:0;padding:20px 0;background:none;border-block:1px solid var(--p3-line);box-shadow:none;aspect-ratio:auto;}
.phase-three details summary{cursor:pointer;padding:8px 0;font-weight:650;min-height:44px;}
.p3-onboarding summary span{font-size:var(--type-label);letter-spacing:.06em;color:var(--p3-muted);margin-left:20px;}
.p3-onboarding ol{display:grid;grid-template-columns:repeat(4,1fr);gap:28px;padding:24px 0;list-style:none;}
.p3-onboarding li{display:grid;gap:6px;}.p3-onboarding li span{font-size:var(--type-caption);color:var(--p3-muted);}
#implementation.phase-three{background:#f3ede3;}
.p3-workflow{list-style:none;padding:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:28px;}
.p3-workflow li{border-top:2px solid #c94606;padding-top:20px;position:relative;}
.p3-workflow li:not(:last-child):after{content:'→';position:absolute;right:-23px;top:24px;color:#a83b07;}
.p3-workflow span{font-size:var(--type-label);letter-spacing:.035em;font-weight:750;color:#8f3104;}
.p3-workflow h3{font-size:var(--type-component-title);margin:12px 0 18px;}
.p3-workflow p{font-size:var(--type-caption);color:var(--p3-muted);}
.p3-coding{margin-top:100px;padding-top:60px;border-top:1px solid var(--p3-line);display:grid;grid-template-columns:1fr 1fr;gap:80px;}
.p3-coding h3{margin:16px 0 24px;}.p3-coding>div>p:not(.p3-label){color:var(--p3-muted);}
.p3-prompts{border-left:2px solid #c94606;padding-left:24px;margin-top:32px;}
.p3-prompts>span{display:block;font-size:var(--type-label);color:var(--p3-muted);margin-bottom:12px;}
.p3-prompts blockquote{font-size:var(--type-body);line-height:2.1;}
.p3-code-steps{counter-reset:coding;list-style:none;padding:0;}
.p3-code-steps li{counter-increment:coding;display:grid;grid-template-columns:32px 1fr;column-gap:16px;border-bottom:1px solid var(--p3-line);padding:18px 0;}
.p3-code-steps li:before{content:counter(coding,decimal-leading-zero);grid-row:span 2;font-size:var(--type-caption);color:#a83b07;}
.p3-code-steps b{font-size:18px;}.p3-code-steps span{font-size:var(--type-caption);color:var(--p3-muted);margin-top:4px;}
.p3-evidence{display:grid;grid-template-columns:.8fr 1.2fr;gap:80px;margin-top:100px;}
.p3-evidence h3{margin:16px 0 24px;}.p3-evidence p{color:var(--p3-muted);}
.p3-evidence dl>div{display:grid;grid-template-columns:130px 1fr;gap:24px;padding:20px 0;border-top:1px solid var(--p3-line);}
.p3-evidence dt{font-size:var(--type-caption);font-weight:750;}.p3-evidence dd{font-size:var(--type-body);color:var(--p3-muted);}
.p3-files{margin-top:40px;border-block:1px solid var(--p3-line);padding:12px 0;}
.p3-files p,.p3-files a{font-size:var(--type-caption);}.p3-files pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:var(--type-label);line-height:2;padding:24px;background:#fffaf5;color:#68584b;}
.p3-validation-note{font-size:var(--type-caption);color:var(--p3-muted);padding-bottom:28px;}
.p3-qa-case{display:grid;grid-template-columns:1fr 1fr;gap:80px;padding:48px 0 60px;border-top:1px solid var(--p3-line);}
.p3-qa-case h3{margin:16px 0 24px;}
.p3-qa-case dt{font-size:var(--type-caption);font-weight:750;margin-top:18px;}.p3-qa-case dd{font-size:var(--type-body);color:var(--p3-muted);margin-top:6px;}
.p3-comparison{align-self:start;background:#f3ede3;}
.p3-compare-tabs{display:flex;border-bottom:1px solid #cdbca9;}
.p3-compare-tabs button{padding:16px 24px;border:0;border-bottom:3px solid transparent;background:transparent;color:#68584b;font-weight:650;min-height:52px;}
.p3-compare-tabs button[aria-selected=true]{border-bottom-color:#c94606;color:#8f3104;}
.p3-comparison [role=tabpanel]{padding:32px;min-height:295px;}
.p3-comparison [data-qa-panel=after]{background:#edf3e8;}
.p3-comparison [role=tabpanel]>span{font-size:var(--type-label);color:var(--p3-muted);}
.p3-comparison h4{margin:14px 0 20px;}.p3-comparison p{font-size:var(--type-body);color:var(--p3-muted);}
.p3-comparison code{display:block;font-size:var(--type-caption);line-height:1.8;margin:18px 0;color:#68584b;overflow-wrap:anywhere;}
.p3-comparison a{display:inline-block;font-size:var(--type-caption);margin-top:28px;}
.p3-responsive{margin-top:38px;background:#f0f4ea;padding:40px;display:grid;grid-template-columns:1fr 1fr;gap:80px;}
.p3-responsive h3{margin:14px 0 24px;}.p3-responsive p:not(.p3-label){color:var(--p3-muted);font-size:var(--type-body);}
.p3-responsive ul{list-style:none;padding:0;}.p3-responsive li{display:flex;align-items:center;gap:24px;padding:13px 0;border-bottom:1px solid #c5d1bf;}
.p3-responsive b{font-size:26px;min-width:72px;color:#286b4b;font-variant-numeric:tabular-nums;}.p3-responsive span{font-size:var(--type-caption);color:#45533d;}
#results.phase-three{padding-top:80px;background:#f6eee2;}
.p3-reflection-row{display:grid;grid-template-columns:220px 1fr;gap:60px;border-top:1px solid var(--p3-line);padding:40px 0;}
.p3-reflection-row>div>p{margin-top:22px;color:var(--p3-muted);max-width:720px;}
.p3-learning blockquote{font-size:clamp(26px,2.6vw,38px);line-height:1.65;max-width:850px;font-weight:650;}
.p3-learning dl{display:grid;grid-template-columns:repeat(2,1fr);gap:28px;margin-top:36px;}
.p3-learning dt{color:#8f3104;font-size:var(--type-caption);font-weight:750;}.p3-learning dd{font-size:var(--type-caption);color:var(--p3-muted);margin-top:5px;}
.p3-next-steps{counter-reset:next;list-style:none;padding:0;}
.p3-next-steps li{counter-increment:next;display:grid;grid-template-columns:28px 1fr;column-gap:18px;padding:0 0 24px;}
.p3-next-steps li:before{content:counter(next,decimal-leading-zero);grid-row:span 2;color:#a83b07;font-size:var(--type-caption);}
.p3-next-steps b{font-size:20px;}.p3-next-steps span{font-size:var(--type-body);color:var(--p3-muted);margin-top:8px;}
/* Keep the original modal and handlers; make its existing content fit small screens. */
#modal .modalbox{max-width:100%;max-height:calc(100svh - 48px);overflow:auto;}
#modal .close{min-width:44px;min-height:44px;}
#modal .dashhead strong{font-size:var(--type-body);}#modal .dashhead small,#modal .metric small{font-size:var(--type-label);}#modal .metric b{font-size:20px;}#modal .bubble{font-size:var(--type-caption);line-height:1.7;}#modal .bubble span,#modal .source,#modal .reply{font-size:var(--type-label);line-height:1.6;}
#demo.phase-three .demostat b[style]{color:#286b4b!important;}
.p3-film .scenario-story-cover-art>img{transform:none;}
@media(max-width:800px){.p3-film .scenario-story-cover-art:before{left:auto;right:0;top:0;bottom:0;width:50%;height:100%;}.p3-film .scenario-story-cover-art:after{display:none;}.p3-film .scenario-story-cover-art>img{right:0;bottom:0;top:auto;width:44%;height:88%;object-fit:contain;}.p3-film .scenario-story-scene-copy{top:24px;bottom:auto;left:20px;right:auto;width:55%;}.p3-film .scenario-story-play{left:20px;right:auto;bottom:22px;background:#c94606;}.p3-film .scenario-story-player.playing .scenario-story-play{left:20px;bottom:22px;}}
@media(max-width:1100px){.p3-workflow{grid-template-columns:repeat(3,minmax(0,1fr));row-gap:36px;}.p3-workflow li:after{display:none;}.p3-coding,.p3-evidence,.p3-qa-case,.p3-responsive{gap:40px;}.p3-reflection-row{grid-template-columns:160px 1fr;gap:40px;}.p3-try{align-items:start;flex-direction:column;}#demo.phase-three #video{grid-template-columns:1fr 1.4fr;gap:32px;}.p3-film .scenario-story-scene{height:330px;}.p3-film .scenario-story-scene-copy{max-width:65%;}}
@media(max-width:800px){#demo.phase-three,#implementation.phase-three,#validation.phase-three,#results.phase-three{padding-block:72px;}.p3-container{width:calc(100% - 56px);}.p3-heading{margin-bottom:40px;}.p3-coding,.p3-evidence,.p3-qa-case,.p3-responsive{grid-template-columns:1fr;}.p3-coding,.p3-evidence{margin-top:64px;}.p3-workflow{grid-template-columns:repeat(2,minmax(0,1fr));gap:32px;}.p3-reflection-row{grid-template-columns:1fr;gap:24px;}.p3-onboarding ol{grid-template-columns:repeat(2,1fr);}#demo.phase-three #video{grid-template-columns:1fr;margin-top:64px;}.p3-film .scenario-story-scene{height:370px;}.p3-film .scenario-story-player.playing .scenario-story-play{opacity:.9;}.p3-comparison [role=tabpanel]{min-height:0;}#demo.phase-three .demohead{flex-wrap:wrap;}#demo.phase-three .demohead h3{width:100%;}}
@media(max-width:500px){#demo.phase-three,#implementation.phase-three,#validation.phase-three,#results.phase-three{padding-block:56px;scroll-margin-top:120px;}.p3-container{width:calc(100% - 40px);}.p3-heading h2{font-size:var(--type-h2);}.p3-heading>p:not(.p3-kicker){font-size:var(--type-body);}.p3-try ol{font-size:var(--type-caption);gap:8px;}.p3-try li:not(:last-child):after{margin-left:8px;}.p3-shortcuts{gap:6px;}.p3-shortcuts button{font-size:var(--type-caption);padding:10px;}.p3-onboarding summary span{display:block;margin-left:0;}.p3-onboarding ol,.p3-workflow{grid-template-columns:1fr;}.p3-workflow li{padding-bottom:14px;}.p3-workflow p{line-height:1.8;}.p3-evidence dl>div{grid-template-columns:1fr;gap:6px;}.p3-coding{padding-top:40px;}.p3-comparison [role=tabpanel]{padding:24px;}.p3-qa-case{padding:36px 0;gap:28px;}.p3-responsive{padding:24px;}.p3-responsive li{gap:16px;}.p3-learning dl{gap:22px 18px;}.p3-learning blockquote{font-size:26px;}.p3-files pre{padding:16px;font-size:var(--type-label);}#demo.phase-three .demobrand{width:100%;margin-bottom:8px;}#demo.phase-three .demoside{padding:14px;gap:4px;}#demo.phase-three .demoside button{flex:1 1 42%;text-align:center;padding:8px;font-size:var(--type-caption);}#demo.phase-three .demomain{padding:16px;overflow:visible;}#demo.phase-three .demohead{display:grid;grid-template-columns:1fr;}#demo.phase-three .search{width:100%;}#demo.phase-three .demostats{grid-template-columns:1fr;gap:8px;}#demo.phase-three .demostat{display:flex;align-items:center;justify-content:space-between;padding:12px;}#demo.phase-three .demostat b{font-size:22px;margin:0;}#demo.phase-three .demotable .drow{grid-template-columns:34px 1fr;gap:4px 12px;padding:14px 0;}#demo.phase-three .drow .avatar{grid-row:span 4;}#demo.phase-three .drow>:nth-child(n+3){grid-column:2;}#demo.phase-three .demoframe{min-height:0;}#demo.phase-three .live{width:100%;font-size:var(--type-label);}#demo.phase-three .demobar .btn{font-size:var(--type-caption);}#demo.phase-three #video{scroll-margin-top:124px;}.p3-film .scenario-story-scene{height:300px;}.p3-film .scenario-story-scene-copy{left:20px;top:22px;max-width:66%;}.p3-film .scenario-story-scene-copy small{font-size:9px;}.p3-film .scenario-story-scene-copy b{font-size:26px;}.p3-film .scenario-story-scene-copy span{font-size:var(--type-label);}.p3-film .scenario-story-cover-art>img{width:42%;right:0;}.p3-film .scenario-story-play{width:50px;height:50px;}.p3-film .scenario-story-controls{padding-inline:12px;gap:10px;}#modal{padding:16px;}#modal .modalbox{width:100%;padding:16px;max-height:calc(100svh - 32px);}#modal .modalbox h3{font-size:var(--type-h3);}#modal .dashhead{flex-wrap:wrap;gap:8px;}#modal .modalcontent{min-height:0;}#modal .dashboard{grid-template-columns:30px minmax(0,1fr);}#modal .side{padding-inline:0;}#modal .metrics{grid-template-columns:1fr;}.toast{max-width:calc(100vw - 40px);width:max-content;}}
@media(prefers-reduced-motion:reduce){.phase-three *{scroll-behavior:auto!important;transition:none!important;animation:none!important;}}

/* Preserve the original modal content while allowing large text to grow. */
#modal .workspace{height:auto;min-height:250px;overflow:visible;}
#modal .prototype-disclosure{font-size:var(--type-caption);line-height:1.6;color:#68584b;margin:12px 0 0;}

/* Project ending: compact outbound navigation, separate from the case study. */
.case-polished #case-study>#results{height:auto;min-height:0;margin-bottom:0;padding-bottom:clamp(32px,4vw,48px);}
.case-polished #results .p3-reflection-row:last-child{padding-bottom:0;margin-bottom:0;}
#results .p3-next-steps li:last-child{padding-bottom:0;margin-bottom:0;}
#next-project.phase-three{height:auto;min-height:260px;padding-block:52px;background:#0f1c31;color:#f5f7fb;display:flex;align-items:center;}
#next-project .p3-kicker{margin:0 0 16px;color:#a6c3fa;}
#next-project .p3-next-row{display:flex;align-items:center;justify-content:space-between;gap:32px;}
#next-project .p3-next-row>div{min-width:0;}
#next-project h2{font-size:clamp(32px,3vw,40px);line-height:1.3;font-weight:650;letter-spacing:-.02em;margin:0;}
#next-project .p3-next-type{font-size:var(--type-caption);line-height:1.7;color:#bac9e0;margin:12px 0 0;}
#next-project .p3-next-link{display:inline-flex;align-items:center;justify-content:center;gap:14px;min-height:44px;padding:8px 0;flex-shrink:0;color:#f5f7fb;font-size:var(--type-body);line-height:1.5;text-decoration:none;border-bottom:1px solid #8298b7;white-space:nowrap;}
#next-project .p3-next-link span{font-size:24px;line-height:1;transition:transform .18s ease;}
@media(hover:hover){#next-project .p3-next-link:hover span{transform:translateX(4px);}}
@media(max-width:800px){#next-project .p3-next-row{align-items:flex-start;flex-direction:column;gap:20px;}#next-project.phase-three{padding-block:36px;}#next-project .p3-kicker{margin-bottom:14px;}}
