.project-scene {
  --scene-paper:#fff; --scene-soft:#e4eceb; --scene-edge:#304d54; --scene-metal:#70898b;
  --scene-board:#284e47; --scene-accent:#168b83; --scene-blue:#438fb2; --scene-window:#dbeef4;
  --scene-red:#dc4c48; --scene-yellow:#ecd250; --scene-green:#3dbf83; --scene-inactive:#7d9291;
  --scene-orange:#e67b36; --scene-ruler:#f3d47e; --scene-desk:#cca778; --scene-house:#f3e9d8;
  --scene-roof:#b86050; --scene-soap:#a9dad5; --scene-skin:#deb89d;
  background:var(--color-paper-raised); color:var(--color-ink); border:1px solid var(--color-rule);
  border-radius:var(--radius-panel,8px); overflow:hidden; min-width:0;
}
.project-intro { margin:24px 0!important; padding:0!important; justify-content:center; text-align:center; }
.project-intro>div { width:100%; }
html[data-theme] .page-intro.project-intro p { max-width:none; text-align:center; }
.project-intro h1 { font-size:clamp(26px,3vw,32px)!important; }
.mobile-bottom-nav .mobile-tab { font-size:11px!important; }
#project-mode-note { margin:0 0 16px; padding:12px 0; font-size:13px; }
#project-content .project-value { font-size:40px; margin:12px 0; }
#project-content .project-trend:empty { display:none; }
#project-content .project-metric p { margin:8px 0; }
#project-content .project-metric .project-trend { height:58px; margin:10px 0; }
@media(min-width:1100px) {
  #project-content { grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); align-items:start; }
  #project-content>.project-scene { grid-row:span 2; }
  #project-content>.project-lcd-pair,#project-content>.project-outputs,#project-content>.simulation-note { grid-column:1 / -1; }
  #project-content .project-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #project-content .project-metric { padding:16px; }
  #project-content .project-metric .project-value small { font-size:14px; }
}
.scene-caption { display:flex; gap:12px; flex-wrap:wrap; justify-content:space-between; padding:16px 20px; border-bottom:1px solid var(--color-rule); }
.scene-caption span { color:var(--color-ink-muted); font-size:13px; }
.soap-status { padding:12px 20px; border-bottom:1px solid var(--color-rule); overflow-wrap:anywhere; }
.soap-status strong { font-size:20px; }
.soap-status p { margin:4px 0; font-size:13px; }
.project-scene svg { display:block; width:100%; height:auto; max-height:330px; background:#f0f5f3; }
.project-scene .classroom-board-title { fill:var(--scene-paper); }
.project-scene text { fill:var(--scene-edge); font-family:"Segoe UI",sans-serif; font-weight:600; }
.project-scene .scene-title { font-size:22px; }
.project-scene .scene-number { font-size:30px; }
.project-scene .scene-label { font-size:17px; }
.project-scene .scene-wheel { fill:var(--scene-edge); stroke:var(--scene-metal); stroke-width:7px; }
.project-scene .scene-sensor circle { fill:var(--scene-metal); stroke:var(--scene-soft); stroke-width:3px; }
.scene-road { stroke:var(--scene-metal); stroke-width:5px; fill:none; }
.scene-floor { stroke:var(--scene-metal); stroke-width:3px; }
.classroom-wall { fill:var(--scene-house); stroke:var(--scene-edge); stroke-width:3px; transition:fill .6s; }
.scene-weather_station[data-state="cold"] .classroom-wall { fill:#d4eef7; }
.scene-weather_station[data-state="hot"] .classroom-wall { fill:#f7dac6; }
.scene-snow,.scene-flames,.house-drops,.house-puddle,.soap-drops { opacity:0; }
.scene-weather_station[data-state="cold"] .scene-snow,.scene-weather_station[data-state="hot"] .scene-flames,
.scene-water_leak[data-state="wet"] .house-drops,.scene-water_leak[data-state="wet"] .house-puddle,
.scene-handwash_timer[data-state="detected"] .soap-drops { opacity:1; }
.scene-hand { transform:translateY(30px); opacity:.45; transition:transform .4s,opacity .4s; }
.scene-handwash_timer[data-state="detected"] .scene-hand { transform:translateY(0); opacity:1; }
.scene-car,.ruler-marker { transition:transform .5s ease-out; }
.bin-lid { transform-origin:231px 120px; transition:transform .6s ease-in-out; }
.gate-arm { transform-origin:163px 155px; transition:transform .65s ease-in-out; }
.sonar-wave { opacity:.35; }
.project-scene[data-live="true"] .sonar-wave { animation:sonar-scan 1.8s ease-out infinite; }
.project-scene .wave-1 { animation-delay:.4s!important; }.project-scene .wave-2 { animation-delay:.8s!important; }
.scene-weather_station[data-live="true"][data-state="cold"] .weather-snow { animation:snow-drift 3s ease-in-out infinite alternate; }
.scene-weather_station[data-live="true"][data-state="hot"] .weather-flame { animation:warm-glimmer 2s ease-in-out infinite alternate; }
.scene-water_leak[data-live="true"][data-state="wet"] .rain-drop,.scene-handwash_timer[data-live="true"][data-state="detected"] .soap-drop { animation:drop-fall 1.5s ease-in infinite; }
.project-scene .drop-1 { animation-delay:.5s!important; }.project-scene .drop-2 { animation-delay:1s!important; }.project-scene .drop-3 { animation-delay:.75s!important; }
.scene-disclaimer { margin:0; padding:0 20px 16px; color:var(--color-ink-muted); font-size:13px; }
.project-scene[data-live="false"] * { animation:none!important; transition:none!important; }
.project-scene[data-state="unknown"] .ultrasonic-waves { opacity:.15; }
.water-fill { transition:y .6s,height .6s; }.water-surface { transition:d .6s; }
.water-number { paint-order:stroke; stroke:var(--scene-paper); stroke-width:4px; stroke-linejoin:round; }
.project-lcd-pair { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr)); gap:16px; }
.lcd-feedback { min-width:0; padding:18px; background:var(--color-paper-raised); border:1px solid var(--color-rule); border-radius:var(--radius-panel,8px); }
.lcd-feedback h3 { margin:0 0 12px; font-size:14px; color:var(--color-ink-muted); line-height:1.5; }
.lcd-feedback-screen { display:grid; background:#d5ecc6; color:#183322; border:8px solid #526b61; border-radius:4px; width:max-content; max-width:100%; padding:10px; font:clamp(14px,2.5vw,20px)/1.5 Consolas,monospace; }
.lcd-feedback-screen span { white-space:pre; }
.handwash-progress { height:14px; background:var(--color-paper-soft); border:1px solid var(--color-rule); overflow:hidden; }
.handwash-progress span { display:block; width:100%; height:100%; background:var(--color-accent); transform-origin:left; transition:transform .3s linear; }
.source-page { padding:24px; min-width:0; color:var(--color-ink); background:var(--color-paper-raised); }
.source-page>label { display:grid; gap:8px; font-weight:600; }
.source-page select { min-height:44px; max-width:100%; padding:8px; color:var(--color-ink); background:var(--color-paper); border:1px solid var(--color-rule-strong); border-radius:4px; }
.source-actions { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin:20px 0; }
.source-actions button { min-height:44px; }
.source-page details { border-top:1px solid var(--color-rule); padding:12px 0; }
.source-page summary { min-height:44px; padding:10px 0; cursor:pointer; font-weight:600; }
.source-page li,.source-page p,.source-page dd { line-height:1.65; }
.source-page ol { padding-left:24px; }.source-wiring dt { margin-top:12px; font-weight:600; }.source-wiring dd { margin-left:0; }
.source-code-label { margin-top:20px; }
#source-code { margin-top:12px; width:100%; min-height:440px; max-width:100%; resize:vertical; padding:16px; font:13px/1.7 Consolas,monospace; color:var(--color-ink); background:var(--color-paper-soft); border:1px solid var(--color-rule-strong); border-radius:6px; white-space:pre; overflow:auto; }
.traffic-timing { padding:20px; margin-bottom:20px; }
.timing-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-bottom:16px; }
.timing-fields label { display:grid; gap:8px; }.timing-fields input { width:100%; min-height:44px; padding:8px; background:var(--color-paper); color:var(--color-ink); border:1px solid var(--color-rule-strong); border-radius:4px; }
@keyframes sonar-scan { from { opacity:.7; translate:0 0; } to { opacity:0; translate:-25px 0; } }
@keyframes drop-fall { 0% { translate:0 0; opacity:0; } 20% { opacity:.85; } 85% { opacity:.8; } 100% { translate:0 110px; opacity:0; } }
@keyframes snow-drift { from { translate:0 0; opacity:.6; } to { translate:5px 15px; opacity:1; } }
@keyframes warm-glimmer { from { opacity:.7; translate:0 2px; } to { opacity:1; translate:0 -4px; } }
@media (max-width:600px) { .source-page { padding:16px; }.source-page h1 { font-size:24px; }.scene-caption { padding:12px; }.scene-caption strong { font-size:14px; }.scene-caption span { font-size:12px; }.timing-fields { grid-template-columns:1fr; } }
@media (prefers-reduced-motion:reduce) { .project-scene *, .handwash-progress span { animation:none!important; transition:none!important; } }

.soap-eyes { transform-box:fill-box; transform-origin:center; }
.soap-closed-eyes { opacity:0; }
.scene-handwash_timer[data-live="true"]:not([data-state="detected"]) .soap-eyes { animation:soap-blink 5s ease-in-out infinite; }
.scene-handwash_timer[data-state="detected"] .soap-eyes { opacity:0; }
.scene-handwash_timer[data-state="detected"] .soap-closed-eyes { opacity:1; }
@keyframes soap-blink { 0%,43%,47%,100% { transform:scaleY(1); } 45% { transform:scaleY(.06); } }
@media(prefers-reduced-motion:reduce) { .scene-handwash_timer .soap-eyes { animation:none!important; } }

.soap-pump { transform:translateY(0); transition:transform .3s ease-out; }
.scene-handwash_timer[data-state="detected"] .soap-pump { transform:translateY(12px); }
