:root{--bg: #0f1b2d;--bg-2: #16263d;--surface: #1c2f4a;--surface-2: #243a59;--text: #f2f5fa;--muted: #94a6c0;--sun: #ffb627;--sun-deep: #ff8f1f;--ok: #4ade80;--danger: #f87171;--grid: #60a5fa;--series-grid: #3987e5;--series-house: #d95926;--series-battery: #199e70;--series-solar: #c98500;--series-car: #d55181;--radius: 18px;--nav-h: 68px;--safe-b: env(safe-area-inset-bottom, 0px);color-scheme:dark}*{box-sizing:border-box}html,body,#root{margin:0;min-height:100%}body{font-family:Outfit,system-ui,-apple-system,Segoe UI,sans-serif;background:radial-gradient(120% 70% at 50% 0%,#20385a 0%,var(--bg) 60%) fixed,var(--bg);color:var(--text);-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}button,input,select{font:inherit;color:inherit}.app{min-height:100dvh}.starry-sky{position:fixed;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:-1;pointer-events:none;opacity:0;transition:opacity 2s ease}.starry-sky.visible{opacity:1}.sky-star{fill:#e8eeff}.sky-star.twinkling{animation:sky-twinkle 6s ease-in-out infinite}@keyframes sky-twinkle{50%{opacity:.08}}.content{position:relative;z-index:1;width:100%;max-width:1100px;margin:0 auto;padding:16px 16px calc(var(--nav-h) + var(--safe-b) + 24px)}.page-header{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:12px;margin:8px 0 20px}.page-header h1{white-space:nowrap;margin:0;font-size:1.6rem;font-weight:600;letter-spacing:-.01em}.muted{color:var(--muted);font-size:.9rem}.center{text-align:center}.warning{background:#ffb6271a;border:1px solid rgba(255,182,39,.35);color:#fde68a;padding:10px 14px;border-radius:12px;font-size:.9rem}.error{background:#f871711f;border:1px solid rgba(248,113,113,.4);color:#fecaca;padding:10px 14px;border-radius:12px;font-size:.9rem}.bottom-nav{position:fixed;inset:auto 0 0 0;z-index:10;display:flex;justify-content:center;gap:4px;height:calc(var(--nav-h) + var(--safe-b));padding:6px 12px var(--safe-b);background:#0f1b2de0;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-top:1px solid rgba(255,255,255,.07)}.nav-item{flex:1;max-width:180px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border-radius:14px;color:var(--muted);text-decoration:none;font-size:.78rem;font-weight:600;transition:color .2s,background .2s}.nav-item:hover{color:var(--text)}.nav-item.active{color:var(--sun);background:#ffb6271a}.control{max-width:640px;margin:0 auto;display:flex;flex-direction:column;gap:14px}.control .page-header{margin-bottom:6px}.led-panel{position:relative;overflow:hidden;padding:16px 18px;border-radius:14px;background:#07090c;border:1px solid #1f2a38;box-shadow:inset 0 0 0 4px #0d1117,inset 0 2px 18px #000000e6;font-family:VT323,ui-monospace,monospace;color:#ffb000;text-shadow:0 0 6px rgba(255,176,0,.65);letter-spacing:.05em}.led-panel:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;background:radial-gradient(circle,transparent .9px,rgba(7,9,12,.5) 1.4px) 0 0 / 3px 3px}.led-headline{margin:0 0 10px;font-size:1.7rem;line-height:1.1}.led-lines{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}.led-line{display:flex;align-items:flex-start;gap:10px;font-size:1.25rem;line-height:1.2}.led{position:relative;z-index:1;flex:none;width:12px;height:12px;margin-top:.3em;border-radius:50%;background:#262c35;box-shadow:inset 0 1px 2px #000c}.led.green{background:#4ade80;box-shadow:0 0 8px #4ade80,inset 0 -1px 2px #0000004d}.led.amber{background:#fbbf24;box-shadow:0 0 8px #fbbf24,inset 0 -1px 2px #0000004d}.setting{display:flex;flex-direction:column;gap:12px}.setting h2{margin:0;font-size:1.05rem;font-weight:600}.setting .note{margin:0;font-size:.82rem}.options{display:flex;gap:8px}.option{flex:1 1 0;min-height:48px;padding:0 6px;border-radius:12px;border:1px solid rgba(255,255,255,.12);background:var(--surface-2);font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap;cursor:pointer;transition:background .15s,color .15s}.option:hover{filter:brightness(1.12)}.option.selected{background:var(--sun);color:#3b2300;border-color:transparent}.option:focus-visible{outline:2px solid var(--sun);outline-offset:2px}.option{position:relative}.option-mark{position:absolute;left:50%;bottom:-9px;transform:translate(-50%);padding:0 6px;border-radius:6px;background:var(--grid);color:#0b1b33;font-size:.62rem;font-weight:700;line-height:14px;text-transform:uppercase;letter-spacing:.04em}.charger-setting{margin:2px 0 0;font-size:.88rem}.mode-toggle{display:flex;padding:4px;gap:4px;border-radius:14px;background:var(--surface);border:1px solid rgba(255,255,255,.05)}.mode-option{flex:1 1 0;min-height:48px;border:0;border-radius:10px;background:transparent;color:var(--muted);font-weight:600;font-size:1rem;cursor:pointer;transition:background .2s,color .2s}.mode-option:hover{color:var(--text)}.mode-option.selected{background:var(--sun);color:#3b2300}.mode-option:focus-visible{outline:2px solid var(--sun);outline-offset:2px}.charge-button{min-height:56px;border-radius:14px;border:0;font-size:1.1rem;font-weight:700;cursor:pointer;transition:background .2s,filter .2s}.charge-button:hover{filter:brightness(1.1)}.charge-button:focus-visible{outline:2px solid var(--text);outline-offset:3px}.charge-button.start{background:var(--grid);color:#0b1b33}.charge-button.stop{background:var(--danger);color:#3a0a0a}.charge-button:disabled{background:var(--surface-2);color:var(--muted);cursor:default}.charge-button[aria-busy=true]{opacity:.75}.saved{opacity:0;transition:opacity .3s;color:var(--ok)}.saved.visible{opacity:1}.overgrowth{opacity:0;transition:opacity 1.2s ease}.overgrowth.visible{opacity:1}.pylon{opacity:0;transition:opacity 1.2s ease}.pylon.shown{opacity:1}.pylon-broken{stroke:#7d7266}.pylon-cable{stroke-width:1.4;stroke-dasharray:3 2}.rust{fill:#8a5a32;stroke:none;opacity:.8}.bird-away{transition:transform 1.8s ease-in,opacity .6s ease-in 1.2s;transform:translate(var(--away-x),var(--away-y));opacity:0}.birds.home .bird-away{transition:transform 1.8s ease-out,opacity .4s ease-out;transform:translate(0);opacity:1}.take-off{opacity:1;transition:opacity .3s}.birds.home .take-off{opacity:0}.vine{fill:none;stroke:#4a7c3f;stroke-width:1.6;stroke-linecap:round}.leaf{fill:#6aa84f}.grass{fill:none;stroke:#5f9e4f;stroke-width:1.4;stroke-linecap:round}.nest{fill:#7a5230}.twigs{stroke:#a8794a;stroke-width:1;stroke-linecap:round}.nesting-bird{fill:#c9a87c}.beak{fill:#f59e0b}.bird-eye{fill:#1b1b1b}.bird-wings{fill:none;stroke:#d5dde8;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;transform-box:fill-box;transform-origin:center;animation:wing-flap .45s ease-in-out infinite alternate}.bird-fly{animation:bird-loop 9s ease-in-out infinite}@keyframes wing-flap{to{transform:scaleY(.35)}}@keyframes bird-loop{0%,to{transform:translate(0)}25%{transform:translate(8px,-5px)}50%{transform:translate(14px,2px)}75%{transform:translate(5px,6px)}}@media(prefers-reduced-motion:reduce){.bird-fly,.bird-wings{animation:none}.overgrowth,.pylon,.bird-away,.birds.home .bird-away,.take-off{transition:none}}.not-approved{max-width:560px;margin:0 auto}.approval{display:flex;flex-direction:column;gap:10px;text-align:center;padding:28px 22px}.approval h1{margin:0 0 8px;font-size:1.4rem}.approval p{margin:0}.device-code{font-family:VT323,ui-monospace,monospace;font-size:3rem;letter-spacing:.12em;color:var(--sun);text-shadow:0 0 10px rgba(255,176,0,.45)}.history{display:flex;flex-direction:column;gap:14px}.chart-title{margin:0 0 8px;font-size:1.05rem;font-weight:600}.history-chart{position:relative;width:100%}.history-chart svg{display:block;touch-action:pan-y}.legend{list-style:none;margin:0 0 6px;padding:0;display:flex;flex-wrap:wrap;gap:6px 14px;font-size:.85rem;color:var(--muted)}.legend li{display:flex;align-items:center;gap:6px}.swatch{display:inline-block;width:14px;height:3px;border-radius:2px}.grid-line{stroke:#ffffff12;stroke-width:1}.axis-zero{stroke:#ffffff59;stroke-width:1}.axis-label{fill:var(--muted);font-size:11px;font-variant-numeric:tabular-nums}.end-label{fill:var(--text);font-size:11px}.series-line{fill:none;stroke-width:2;stroke-linejoin:round;stroke-linecap:round}.crosshair{stroke:#fff6;stroke-width:1}.hover-dot{stroke:var(--surface);stroke-width:2}.hit-area{fill:transparent;cursor:crosshair}.chart-tooltip{position:absolute;top:40px;min-width:170px;padding:8px 10px;border-radius:10px;background:#0f1b2df2;border:1px solid rgba(255,255,255,.12);font-size:.82rem;pointer-events:none;display:flex;flex-direction:column;gap:3px}.tooltip-row{display:flex;align-items:center;gap:6px}.tooltip-value{margin-left:auto;font-variant-numeric:tabular-nums;font-weight:600}.history .note{margin:8px 0 0;font-size:.82rem}.history-table summary{cursor:pointer;font-weight:600}.table-scroll{overflow-x:auto;margin-top:10px}.history-table table{width:100%;border-collapse:collapse;font-size:.82rem;font-variant-numeric:tabular-nums}.history-table th,.history-table td{padding:4px 8px;text-align:right;white-space:nowrap;border-bottom:1px solid rgba(255,255,255,.06)}.history-table th:first-child,.history-table td:first-child{text-align:left}.history-table th{color:var(--muted);font-weight:600}.flow-stage{width:min(100%,460px);margin:0 auto}.energy-flow{display:block;width:100%;height:auto;overflow:visible}.flow-track{stroke:#ffffff14;stroke-width:4;stroke-linecap:round}.flow{stroke-dasharray:0 14;stroke-linecap:round;animation:flow var(--dur, 1s) linear infinite}@keyframes flow{to{stroke-dashoffset:-14}}.node{transition:opacity .3s}.node.dim{opacity:.45}.node-body{fill:var(--surface);stroke:var(--muted);stroke-width:2.5;stroke-linejoin:round}.node-body.battery-charging{stroke:var(--grid);transition:stroke .4s}.node-body.battery-discharging{stroke:var(--sun);transition:stroke .4s}.node-fill.battery-top-charging{fill:var(--grid);transition:fill .4s}.node-fill.battery-top-discharging{fill:var(--sun);transition:fill .4s}.battery-wrinkles{fill:none;stroke:var(--muted);stroke-width:1.5;stroke-linecap:round}.node-line{fill:none;stroke:var(--muted);stroke-width:4;stroke-linecap:round;stroke-linejoin:round}.node-line.dashed{stroke-width:2.5;stroke-dasharray:3 4}.node-fill{fill:var(--surface-2)}.meter-glass{fill:#0c1726;stroke:#ffffff1f;stroke-width:1}.drum{fill:#05080d}.drum.decimal{fill:#7f1d1d}.drum-digit{fill:#f2f5fa;font:600 10.5px ui-monospace,SFMono-Regular,Menlo,monospace;text-anchor:middle}.drum-strip{transition:transform .8s ease-in-out}.drum-comma{fill:#f2f5fa}.meter-caption{fill:var(--muted);font-size:5.5px;letter-spacing:.04em}.meter-slot{fill:#05080d}.meter-disc{fill:#8b95a3}.meter-mark{fill:#e11d48;animation:meter-disc linear infinite}.meter-mark.still{animation:none}@keyframes meter-disc{0%{transform:translate(-24px)}to{transform:translate(24px)}}.wheel{fill:var(--bg);stroke:var(--muted);stroke-width:2.5}.charger-screen{fill:var(--surface-2);transition:fill .3s}.charger-bolt{fill:var(--muted);transition:fill .3s}.node.lit .charger-screen,.node.lit .charger-bolt{fill:var(--grid)}.node.lit .node-body,.node.lit .wheel{stroke:var(--grid)}.node.lit .charger-bolt{transform-box:fill-box;transform-origin:center;animation:bolt-pulse 1.4s ease-in-out infinite}@keyframes bolt-pulse{0%,to{opacity:1;transform:scale(1);filter:drop-shadow(0 0 4px var(--grid))}50%{opacity:.45;transform:scale(.88);filter:drop-shadow(0 0 0 transparent)}}.node-name{fill:var(--muted);font-size:12px}.node-value{fill:var(--text);font-size:14px;font-weight:600;font-variant-numeric:tabular-nums}.node-value.small{font-size:12px}.node-value.outlined{paint-order:stroke;stroke:var(--bg);stroke-width:3px}.sun,.moon{overflow:visible;animation:fade-in .8s ease}.moon-face{filter:drop-shadow(0 0 14px rgba(199,215,255,.45))}.moon-dark{fill:#8a93a8;opacity:.16}.star{fill:#e8eeff;animation:twinkle 3s ease-in-out infinite}.sun-core{transition:r 1s ease;filter:drop-shadow(0 0 18px rgba(255,182,39,.55))}.sun-glow{transition:r 1s ease;animation:pulse 4s ease-in-out infinite;transform-origin:center}.sun-rays{transform-origin:150px 150px;animation:spin 60s linear infinite}.ray{stroke:#ffffff1a;stroke-width:7;stroke-linecap:round;transition:stroke .6s}.ray.lit{stroke:var(--sun)}.sun.night .sun-core{filter:grayscale(.85) brightness(.55)}.sun.night .sun-rays,.sun.night .sun-glow{animation:none}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.75}}@keyframes twinkle{50%{opacity:.25}}@keyframes fade-in{0%{opacity:0}}@media(prefers-reduced-motion:reduce){.sun-rays,.sun-glow,.flow,.star,.sun,.moon,.sky-star.twinkling,.stat.pond:before,.stat.pond:after,.node.lit .charger-bolt,.meter-mark{animation:none}.drum-strip,.starry-sky{transition:none}}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:20px auto 12px;max-width:560px}.stat{background:var(--surface);border-radius:var(--radius);padding:14px;display:flex;flex-direction:column;gap:4px}.stat .label{color:var(--muted);font-size:.78rem;text-transform:uppercase;letter-spacing:.06em}.stat-value{font-size:1.35rem;font-weight:600}.stat-value small{font-size:.8rem;color:var(--muted);font-weight:400}.stat.pond{position:relative;overflow:hidden;isolation:isolate;background:radial-gradient(120% 60% at 30% 0%,rgba(165,243,252,.18),transparent 60%),linear-gradient(180deg,#0f5363,#0b3f50 55%,#082f3d);border:1px solid rgba(103,232,249,.18)}.stat.pond:before,.stat.pond:after{content:"";position:absolute;left:0;right:0;bottom:0;z-index:-1;background-repeat:repeat-x;animation:pond-drift 14s linear infinite}.stat.pond:before{height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='24' viewBox='0 0 120 24'%3E%3Cpath d='M0 12 Q15 4 30 12 T60 12 T90 12 T120 12 V24 H0 Z' fill='%2367e8f9' fill-opacity='0.16'/%3E%3C/svg%3E");background-size:120px 24px}.stat.pond:after{height:20px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='20' viewBox='0 0 90 20'%3E%3Cpath d='M0 10 Q11 3 22.5 10 T45 10 T67.5 10 T90 10 V20 H0 Z' fill='%2322d3ee' fill-opacity='0.14'/%3E%3C/svg%3E");background-size:90px 20px;animation-duration:9s;animation-direction:reverse}@keyframes pond-drift{to{background-position-x:120px}}.stat.pond .label,.stat.pond .stat-value small{color:#a5f3fc}.stat.pond{font:inherit;color:inherit;text-align:left;width:100%;cursor:pointer;transition:box-shadow .6s ease,border-color .6s ease}.stat.pond:focus-visible{outline:2px solid #67e8f9;outline-offset:2px}.stat.pond:active{transform:scale(.98)}.stat.pond.lit{border-color:#fde68a8c;box-shadow:0 0 18px #fde68a59,0 0 42px #67e8f92e;background:radial-gradient(70% 80% at 50% 90%,rgba(254,240,138,.42),transparent 70%),radial-gradient(120% 60% at 30% 0%,rgba(165,243,252,.22),transparent 60%),linear-gradient(180deg,#11697a,#0d5263 55%,#0a3c4b)}.pond-light-state{font-size:.72rem;color:#a5f3fc;opacity:.85}.stat.pond.lit .pond-light-state{color:#fde68a;opacity:1}.pond-value{margin-top:auto;text-align:right;white-space:nowrap;text-shadow:0 1px 6px rgba(0,0,0,.35)}.bar{height:6px;background:var(--surface-2);border-radius:3px;overflow:hidden;margin-top:4px}.bar>div{height:100%;background:linear-gradient(90deg,var(--sun-deep),var(--sun));transition:width 1s ease}.ev{max-width:560px;margin:0 auto 12px;width:100%;display:flex;flex-direction:column;gap:10px;transition:border-color .2s,opacity .2s}.ev-head{display:flex;align-items:center;gap:14px}.ev-range{font-size:1.6rem;font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap}.ev-range small{font-size:.9rem;color:var(--muted);font-weight:400;margin-left:4px}.ev-bar{height:10px;border-radius:5px;margin-top:0}.ev-bar>div{background:linear-gradient(90deg,#22c55e,var(--ok))}.ev-energy{font-size:.85rem}.ev.charging,.ev.charging_away{border-color:#60a5fa73}.ev.charging .device-icon,.ev.charging_away .device-icon{background:#60a5fa29;color:var(--grid)}.ev.charging .ev-bar>div,.ev.charging_away .ev-bar>div{background:linear-gradient(90deg,#3b82f6,var(--grid));animation:pulse 2s ease-in-out infinite}.ev.disconnected{opacity:.6}@media(prefers-reduced-motion:reduce){.ev.charging .ev-bar>div,.ev.charging_away .ev-bar>div{animation:none}}.card{background:var(--surface);border-radius:var(--radius);padding:16px;border:1px solid rgba(255,255,255,.05)}.device-icon{flex:none;width:46px;height:46px;display:grid;place-items:center;border-radius:14px;background:var(--surface-2);color:var(--muted);transition:background .2s,color .2s}.device-text{flex:1;display:flex;flex-direction:column;gap:2px;min-width:0}@media(min-width:640px){.content{padding-left:28px;padding-right:28px}.page-header h1{font-size:2rem}.stats{gap:14px}.stat-value{font-size:1.6rem}}@media(min-width:1024px){.content{padding-top:32px}.home{display:grid;grid-template-columns:1.2fr 1fr;grid-template-areas:"header header" "flow side" "note note";align-items:center;column-gap:40px}.home .page-header{grid-area:header}.home .error,.home .warning{grid-column:1 / -1}.home .flow-stage{grid-area:flow;width:min(100%,70vh,520px)}.home .home-side{grid-area:side;display:flex;flex-direction:column;gap:12px}.home .stats{grid-template-columns:1fr;margin:0;max-width:none}.home>.muted.center{grid-area:note}.home .ev{max-width:none;margin:0}:root{--nav-h: 72px}.led-headline{font-size:2.1rem}.led-line{font-size:1.55rem}.nav-item{flex-direction:row;gap:8px;font-size:.95rem}}@media(max-height:480px)and (orientation:landscape){.flow-stage{width:min(90vh,360px)}.stats{margin-top:10px}}.kitchen-sink{display:flex;flex-direction:column;gap:28px}.ks-section h2{margin:0 0 12px;font-size:1.2rem;font-weight:600}.ks-examples{display:grid;gap:16px;align-items:start}.ks-examples.small{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}.ks-examples.medium{grid-template-columns:repeat(auto-fill,minmax(320px,1fr))}.ks-examples.large{grid-template-columns:repeat(auto-fill,minmax(340px,1fr))}.ks-example{margin:0;display:flex;flex-direction:column;gap:8px}.ks-stage{padding:12px;border-radius:var(--radius);border:1px dashed rgba(255,255,255,.12)}.ks-stage>.sun,.ks-stage>.moon{display:block;width:100%;height:auto}.ks-stage .ev,.ks-stage .not-approved{margin:0}.ks-icon{display:grid;place-items:center;height:48px;color:var(--text)}
