*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden}body{background:#e8eddf;color:#36492c;font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif}#meadow{position:relative;width:100%;height:100%;overflow:hidden;background:#8dba65;isolation:isolate}canvas{width:100%;height:100%;display:block;touch-action:none;outline:none}nav{position:absolute;bottom:max(20px,env(safe-area-inset-bottom));right:max(24px,env(safe-area-inset-right));display:flex;gap:5px}button{font:inherit;border:0;cursor:pointer;color:inherit;-webkit-tap-highlight-color:transparent}nav button{width:44px;height:44px;display:grid;place-items:center;background:transparent;opacity:.57;border-radius:50%;transition:background .3s,opacity .3s}nav button:hover,nav button[aria-pressed=true],nav button[aria-expanded=true]{background:#eff5df44;opacity:1}button:focus-visible,input:focus-visible{outline:2px solid #f8faeb;outline-offset:3px}nav svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.35;stroke-linecap:round;stroke-linejoin:round}nav .dots{fill:currentColor;stroke:none}#panel{position:absolute;right:25px;bottom:82px;width:270px;padding:22px 24px;background:#f5f6ebee;border:1px solid #ffffff66;border-radius:23px;box-shadow:0 12px 50px #26482418;backdrop-filter:blur(15px);font-size:13px;line-height:1.8}#panel[hidden]{display:none}header{display:flex;align-items:center;justify-content:space-between;margin-bottom:19px}header span{font-size:15px}header button{font-size:22px;background:none;opacity:.5;padding:0 5px}#panel>label{display:block;font-size:11px;letter-spacing:.04em;opacity:.8}input[type=date]{width:100%;margin:6px 0 10px;border:0;border-bottom:1px solid #405d3426;background:transparent;color:#35492e;font:inherit;font-size:17px;padding:9px 0;color-scheme:light}.date-actions{display:flex;justify-content:space-between}.date-actions button{background:#e5eadb;padding:6px 12px;border-radius:12px;font-size:12px}.legend{display:flex;align-items:center;gap:8px;margin-top:22px}.legend i{display:inline-block;width:12px;height:10px;border-radius:50%}.brown{background:#634738}.white{background:#fff;border:1px solid #ddd}.legend i:nth-of-type(2){margin-left:16px}#panel p{font-size:12px;color:#6c7963;margin-bottom:16px}#panel .toggle{display:flex;justify-content:space-between;align-items:center;font-size:12px}input[type=checkbox]{accent-color:#6c8950}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}@media(min-width:850px) and (min-height:750px) and (max-aspect-ratio:1.3){#meadow{width:calc(100% - 48px);height:calc(100% - 48px);margin:24px;border-radius:35px 30px 38px 31px}}@media(max-width:480px){nav{right:15px;bottom:max(18px,env(safe-area-inset-bottom))}#panel{right:17px;bottom:80px}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}
body{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;background:#f0f1e9}.terrain-switch{display:flex;gap:3px;padding:4px;background:#e2e7d9;border-radius:20px;flex-shrink:0}.terrain-switch button{padding:8px 17px;border-radius:17px;background:transparent;color:#69785a;font-size:12px;letter-spacing:.03em}.terrain-switch button[aria-pressed=true]{background:#f8f9f2;color:#3c5734;box-shadow:0 1px 5px #2034140b}#meadow{width:min(calc(100vw - 36px),calc(100dvh - 92px));height:min(calc(100vw - 36px),calc(100dvh - 92px));margin:0;border-radius:4.8% 4.2% 5.1% 4.6% / 4.2% 5% 4.4% 5.1%;box-shadow:0 8px 30px #25321c0a}nav{right:18px;bottom:14px;gap:2px}nav button{width:44px;height:44px}#panel{max-height:calc(100% - 95px);overflow-y:auto;scrollbar-width:thin;right:16px;bottom:69px;width:282px}#panel .toggle{margin:10px 0}details{border-top:1px solid #71826322;margin-top:15px;padding-top:12px}summary{cursor:pointer;font-size:12px}details>label{display:block;margin-top:12px;font-size:11px}details output{display:block;font-size:11px}input[type=range]{width:100%;accent-color:#778f58}select{width:100%;padding:7px;border:1px solid #cbd4bf;background:#f8f9f0;color:inherit;border-radius:8px}details button{background:#e5eadb;border-radius:8px;padding:5px 8px;font-size:11px}.periods{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;margin:8px 0}.colors{display:flex;justify-content:space-between;margin-top:12px;font-size:11px}.colors input{display:block;width:54px;height:28px;border:none;background:none;padding:0}.palette-actions{display:flex;gap:5px;margin-top:12px}#palette-status{margin-top:10px;line-height:1.5;color:#536b45}#hour-label{display:inline}body.night{background:#202d28}body.night .terrain-switch{background:#34483b}body.night .terrain-switch button{color:#a7b7a0}body.night .terrain-switch button[aria-pressed=true]{background:#526a53;color:#e0e9d8}body.night nav{color:#d9e4ce}@media(max-height:500px) and (orientation:landscape){body{gap:8px}.terrain-switch button{padding:5px 16px}#meadow{width:calc(100vw - 32px);height:calc(100dvh - 62px);border-radius:24px 29px 24px 30px}#panel{max-height:calc(100% - 60px);bottom:55px}nav{bottom:5px}}@media(max-width:480px){body{gap:14px}#meadow{width:calc(100vw - 24px);height:calc(100vw - 24px)}#panel{width:min(282px,calc(100% - 28px));max-height:calc(100% - 82px);bottom:65px}nav{right:10px;bottom:8px}.terrain-switch button{font-size:11px}}

.view-controls{position:absolute;bottom:14px;left:12px;display:flex;gap:0}.view-controls button{width:44px;height:44px;border-radius:50%;background:transparent;opacity:.65;font-size:20px}.view-controls button:hover{background:#eff5df66;opacity:1}#scene{cursor:grab}#panel{touch-action:pan-y}html,body{overflow:auto;min-height:100%;}canvas:focus-visible:not([data-pointer-focus]){outline:2px solid #f8faeb;outline-offset:-4px}
#panel{width:316px;padding:20px;line-height:1.5}#panel header{margin-bottom:12px;font-weight:600}#panel header button{min-width:32px;min-height:32px}.sheep-legend{display:flex;gap:28px;margin:0 0 14px;color:#6b765f;font-size:12px}.sheep-legend span{display:flex;align-items:center;gap:5px}.sheep-legend canvas{width:34px;height:34px;touch-action:auto}.setting-section{margin:0;padding:0;border-top:1px solid #71826322}.setting-section summary{list-style:none;display:flex;align-items:center;gap:8px;min-height:50px;font-size:13px}.setting-section summary::-webkit-details-marker{display:none}.setting-section summary span{margin-left:auto;font-size:11px;color:#78836b}.setting-section summary:after{content:'⌄';color:#78836b}.setting-section[open] summary:after{transform:rotate(180deg)}#panel .toggle{min-height:40px;margin:2px 0 10px;font-size:13px}#panel input[role=switch]{appearance:none;width:34px;height:20px;background:#cbd2c2;border-radius:12px;position:relative;flex-shrink:0;cursor:pointer;transition:background .2s}#panel input[role=switch]:before{content:'';position:absolute;left:3px;top:3px;width:14px;height:14px;background:white;border-radius:50%;transition:transform .2s}#panel input[role=switch]:checked{background:#788e62}#panel input[role=switch]:checked:before{transform:translateX(14px)}.slider-label{display:flex;align-items:center;justify-content:space-between;font-size:12px;margin-top:8px}.slider-label input{width:44px;border:0;border-radius:5px;background:transparent;color:inherit;font:inherit;text-align:right;appearance:textfield;padding:6px}.slider-label input::-webkit-inner-spin-button{appearance:none}#panel input[type=range]{height:30px;margin:0 0 10px}#time-value{font-size:18px;margin:4px 0 14px;font-variant-numeric:tabular-nums}.meridiem{display:flex;background:#e7ebde;border-radius:9px;padding:3px;gap:3px}.meridiem button{flex:1;padding:7px;background:transparent;border-radius:7px}.meridiem button[aria-pressed=true]{background:#fbfcf5;box-shadow:0 1px 4px #35442d0d}#panel .light-toggle{border-top:1px solid #71826322;padding-top:12px;margin-top:14px}#clock-feedback{align-self:center;font-size:11px;color:#536548}#panel [hidden]{display:none}#panel :focus-visible{outline:2px solid #7b9166;outline-offset:2px}@media(max-width:480px){#panel{width:calc(100% - 24px);right:12px;max-height:calc(100% - 78px);bottom:64px;padding:16px 20px}}
/* Scoped regular frosted material; intentionally no distortion for readable settings. */
#panel{background:rgba(250,251,246,.88);color:#29332b;border:0;border-radius:22px;backdrop-filter:blur(28px) saturate(115%);-webkit-backdrop-filter:blur(28px) saturate(115%);box-shadow:inset 0 1px 0 #ffffffd9,inset 1px 0 0 #ffffff75,0 8px 26px #17241b1a,0 1px 3px #17241b0f}#panel header button{opacity:1;color:#525e50;width:44px;height:44px;border-radius:50%}#panel .sheep-legend,#panel summary span,#panel summary:after{color:#525e50}#panel .setting-section{border-top:.5px solid #3c433c24}#panel .toggle{min-height:44px}#panel .slider-label input{min-height:44px}#panel input[type=range]{height:44px}#panel .meridiem button{min-height:44px}#panel button:active,#panel summary:active{background:#60725818}#panel input:active{filter:brightness(.96)}#panel .meridiem{background:#e2e7dc}#panel input[role=switch]:checked{background:#62794f}#panel input[type=range]{accent-color:#62794f}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){#panel{background:#f6f8f1}}
@media(prefers-reduced-transparency:reduce){#panel{background:#f6f8f1;backdrop-filter:none;-webkit-backdrop-filter:none}}
@media(prefers-contrast:more){#panel{background:#fff;color:#162018}#panel summary span,#panel .sheep-legend,#panel header button{color:#303c31}#panel .setting-section{border-color:#737d70}}
#clock-status{font-size:12px;color:#525e50;margin:0 0 12px}#clock-feedback{max-width:88px;line-height:1.4}
/* Keep the scrollbar inside the continuous rounded glass shell. */
#panel{padding:0;overflow:hidden;display:flex;flex-direction:column}#panel-scroll{padding:16px 20px 20px;overflow-y:auto;min-height:0;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:transparent transparent;max-height:calc(min(100vw - 36px,100dvh - 92px) - 95px)}#panel-scroll.is-scrolling{scrollbar-color:#67745c70 transparent}#panel-scroll::-webkit-scrollbar{width:5px}#panel-scroll::-webkit-scrollbar-track{background:transparent;margin:18px 0}#panel-scroll::-webkit-scrollbar-thumb{background:transparent;border-radius:6px}#panel-scroll.is-scrolling::-webkit-scrollbar-thumb{background:#67745c70}
#panel .slider-row{display:grid;grid-template-columns:30px minmax(0,1fr) 42px;align-items:center;column-gap:10px;min-height:48px}#panel .slider-row label{font-size:12px;white-space:nowrap}#panel .slider-row input[type=range]{margin:0;width:100%;min-width:0}#panel .slider-row input[type=number]{width:42px;min-width:0;height:44px;border:0;border-radius:7px;background:#ffffff42;color:inherit;font:inherit;text-align:center;font-variant-numeric:tabular-nums;appearance:textfield}#panel .slider-row input[type=number]::-webkit-inner-spin-button{appearance:none}#panel .time-row{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:4px 0 10px}#panel .time-row #time-value{font-size:22px;margin:0;white-space:nowrap}#panel .time-row .meridiem{width:126px;flex-shrink:0;padding:2px;border-radius:11px}#panel .time-row .meridiem button{font-size:12px;min-height:40px;padding:5px 8px}
nav{gap:8px}nav button{opacity:1;color:#344333;background:rgba(250,251,246,.75);backdrop-filter:blur(18px) saturate(115%);-webkit-backdrop-filter:blur(18px) saturate(115%);box-shadow:inset 0 1px 0 #ffffffd9,inset 1px 0 0 #ffffff65,0 3px 12px #17241b12;transition:background .2s,transform .16s}nav button:hover{background:rgba(250,251,246,.88)}nav button[aria-pressed=true],nav button[aria-expanded=true]{background:rgba(250,251,246,.96);box-shadow:inset 0 1px 0 #fff,0 3px 12px #17241b20}nav button:active{transform:scale(.95)}nav button:focus-visible{outline:2px solid #536b45;outline-offset:3px}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){nav button{background:#f6f8f1}}
@media(prefers-reduced-transparency:reduce){nav button{background:#f6f8f1;backdrop-filter:none;-webkit-backdrop-filter:none}}
@media(prefers-contrast:more){nav button{background:#fff;color:#162018;outline:1px solid #536b45}}
@media(max-width:480px){#panel{padding:0}#panel-scroll{padding:14px 18px 18px;max-height:calc(100vw - 106px)}}
@media(max-height:500px) and (orientation:landscape){#panel-scroll{max-height:calc(100dvh - 122px)}}
#panel .time-row .meridiem button{min-height:44px}
/* Neutral glass picker, fixed top anchor; only the content below the header scrolls. */
#panel{top:18px;bottom:auto;width:316px;max-height:calc(100% - 88px);background:rgba(252,252,252,.91);color:#262626}#panel>header{flex-shrink:0;margin:0;padding:12px 16px 4px 20px}#panel-scroll{padding:0 20px 18px;max-height:none;flex:1;min-height:0}#panel .setting-section[open] summary span{visibility:hidden}#panel .setting-section,#panel .light-toggle{border-color:#00000016}#panel .sheep-legend,#panel summary span,#panel summary:after,#panel header button,#panel #clock-status{color:#555}#panel input[role=switch]:checked{background:#555}#panel input[role=switch]{background:#ccc}#panel :focus-visible{outline:2px solid #555;outline-offset:3px}#panel .meridiem{background:#e4e4e4}#panel .meridiem button[aria-pressed=true]{background:#fff}#date-value,#time-value{display:block;font-size:20px;margin:8px 0 18px;font-variant-numeric:tabular-nums}
.date-wheels{display:flex;justify-content:center;gap:28px;padding:4px 0 16px}.wheel-unit{display:flex;align-items:center;gap:9px;font-size:13px}.date-wheel{display:grid;grid-template-rows:32px 56px 32px;align-items:center;justify-items:center;width:56px;touch-action:none;user-select:none;overscroll-behavior:contain}.date-wheel span{font-size:17px;color:#999;cursor:pointer}.date-wheel input{appearance:textfield;width:56px;height:56px;border-radius:50%;border:0;background:#e9e9e9;text-align:center;font:inherit;font-size:22px;color:#222;padding:0;user-select:text}.date-wheel input::-webkit-inner-spin-button,.digital-time input::-webkit-inner-spin-button{appearance:none}.digital-time{display:flex;align-items:center;gap:2px;font-size:25px;font-variant-numeric:tabular-nums}.digital-time input{appearance:textfield;background:transparent;border:0;border-radius:6px;width:42px;height:44px;font:inherit;color:#222;text-align:center;padding:0}.digital-time input:focus{background:#eee}#panel .time-row{gap:8px;margin:8px 0}#panel .time-row .meridiem{width:118px}#time-dial{display:block;width:min(240px,100%);height:auto;margin:8px auto 12px;touch-action:none;user-select:none;overflow:visible}.dial-labels{fill:#555;font-size:14px;text-anchor:middle}.dial-ticks{stroke:#aaa;stroke-width:1.2}.hand-line{stroke:#333;stroke-linecap:round;fill:none}.hour-hand{stroke-width:5}.minute-hand{stroke-width:2}.hand-dot,.dial-center{fill:#333}.hand-hit{fill:transparent;cursor:grab}.selected .hand-dot{fill:#fff;stroke:#222;stroke-width:2}.selected .hand-line{stroke:#111}#time-dial [role=slider]:active .hand-hit{cursor:grabbing}#time-dial [role=slider]:focus-visible{outline:none}#time-dial [role=slider]:focus-visible .hand-dot{stroke:#777;stroke-width:5}nav button{color:#333}nav button:focus-visible{outline-color:#555}
@media(max-width:480px){#panel{top:12px;width:calc(100% - 24px);max-height:calc(100% - 78px)}#panel-scroll{max-height:none;padding:0 18px 16px}}
@media(max-height:500px) and (orientation:landscape){#panel{top:8px;max-height:calc(100% - 64px)}#panel-scroll{max-height:none}}
@media(prefers-reduced-transparency:reduce){#panel{background:#fafafa}}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){#panel{background:#fafafa}}
/* Bottom-anchored quiet glass chrome; the meadow stays the visual focus. */
#panel{top:auto;bottom:68px;right:16px;width:328px;max-height:calc(100% - 84px);background:rgba(249,249,249,.64);backdrop-filter:blur(26px) saturate(105%);-webkit-backdrop-filter:blur(26px) saturate(105%);border-radius:24px;box-shadow:inset 0 1px 0 #ffffffb8,inset 1px 0 0 #ffffff55,0 8px 26px #00000010;color:#292929;color-scheme:light;accent-color:#555}
#panel-scroll{padding-left:20px;padding-right:20px;scrollbar-color:transparent transparent}#panel-scroll.is-scrolling{scrollbar-color:#7778 transparent}#panel-scroll.is-scrolling::-webkit-scrollbar-thumb{background:#7778}
nav button{background:rgba(250,250,250,.32);box-shadow:inset 0 1px 0 #ffffff80,0 2px 8px #00000008;color:#404040}nav button:hover{background:rgba(250,250,250,.48)}nav button[aria-pressed=true],nav button[aria-expanded=true]{background:rgba(250,250,250,.66)}nav button:active{background:rgba(255,255,255,.88);transform:scale(.94)}
#panel input,#panel button{accent-color:#555;-webkit-tap-highlight-color:#00000012}#panel input:focus-visible,#panel button:focus-visible{outline:2px solid #666;outline-offset:2px}#panel button:active{background:#ffffffa8}#panel .meridiem{background:#e1e1e1b3}#panel .meridiem button[aria-pressed=true]{background:#bfbfbf99;color:#222}
#panel .time-row{gap:8px;justify-content:center;margin:12px 0 20px}.digital-time{gap:5px;font-size:44px}.digital-time input{width:82px;height:76px;background:#e9e9e9c9;border-radius:12px;font-size:44px;font-weight:500;caret-color:#333}.digital-time input.selected,.digital-time input:focus{background:#cececebd;color:#202020}#panel .time-row .meridiem{flex-direction:column;gap:0;padding:0;width:48px;overflow:hidden;border-radius:10px}#panel .time-row .meridiem button{min-height:38px;font-size:12px;padding:4px}
#time-dial{width:256px;max-width:100%;margin:0 auto 12px}.dial-face{fill:#e4e4e4;fill-opacity:.8}.dial-labels{fill:#383838;font-size:14px;font-variant-numeric:tabular-nums}.hand-line,.hour-hand,.minute-hand{stroke:#aaa;stroke-width:2;stroke-linecap:round}.hand-dot{fill:#aaa;stroke:none;transition:r 130ms ease,fill 130ms ease}.selected .hand-line{stroke:#444}.selected .hand-dot{r:19px;fill:#444;stroke:none}.dragging .hand-dot{r:23px}.hand-value{fill:#fff;font-size:14px;font-weight:500;opacity:0;pointer-events:none;font-variant-numeric:tabular-nums}.selected .hand-value{opacity:1}.hand-hit{fill:transparent}.dial-center{fill:#444}.time-actions{display:flex;align-items:center;gap:6px;margin:8px 0}.time-actions>span{flex:1}.time-actions button{min-width:44px;min-height:44px;padding:8px;background:transparent;font-size:13px;color:#333;border-radius:12px}#time-input-mode{font-size:24px}.time-actions #time-apply{font-weight:600}#clock-feedback{color:#394435;max-width:180px;font-size:11px}
@media(max-width:480px){#panel{top:auto;bottom:64px;right:12px;width:min(328px,calc(100% - 24px));max-height:calc(100% - 78px)}#panel-scroll{padding-left:16px;padding-right:16px}.digital-time input{width:74px;font-size:40px}}
@media(max-height:500px) and (orientation:landscape){#panel{top:auto;bottom:54px;max-height:calc(100% - 62px)}}
@media(prefers-reduced-motion:reduce){.hand-dot,nav button{transition:none}}
@media(prefers-reduced-transparency:reduce),(prefers-contrast:more){#panel,nav button{background:#f7f7f7;backdrop-filter:none;-webkit-backdrop-filter:none}}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){#panel,nav button{background:#f7f7f7}}

#panel .today-label{font-size:12px;font-weight:400}#panel #date-value{display:inline;font:inherit;margin:0;color:inherit}
#panel #date-value[hidden]{display:none}
/* Compact inline editing; retain full circle and align fields to the panel inset. */
#panel:has(.setting-section[open]) .sheep-legend{display:none}
#panel>header{padding:4px 14px 2px 20px}#panel-scroll{padding-bottom:8px}.setting-section{position:relative}#panel .setting-section summary{min-height:44px}
#panel .setting-section:has(#time-live)[open]>label.toggle:not(.light-toggle){position:absolute;right:24px;top:0;margin:0;min-height:44px;gap:8px;font-size:11px}
#panel .time-row{width:100%;gap:8px;margin:4px 0 8px;justify-content:space-between}.digital-time{flex:1;min-width:0;gap:5px;font-size:30px}.digital-time input{flex:1;width:0;min-width:0;height:48px;font-size:32px;border-radius:10px}#panel .time-row .meridiem{width:66px;height:48px;flex-direction:row;background:transparent;overflow:visible;gap:2px}#panel .time-row .meridiem button{min-width:32px;min-height:44px;padding:0 2px;font-size:11px;border-radius:8px}
#time-dial{width:196px;margin:0 auto 6px}.dial-labels{font-size:16px}.hand-dot{r:17px;fill:#d0d0d0;stroke:#aaa;stroke-width:.8}.hand-value{opacity:1;fill:#555;font-size:17px}.selected .hand-value{fill:#fff}.selected .hand-dot{r:20px}.dragging .hand-dot{r:24px}#panel .light-toggle{min-height:40px;margin:4px 0 0;padding-top:4px;font-size:12px}
.date-wheels{gap:16px;padding:0 0 8px}.wheel-unit{flex:1;justify-content:center;gap:8px}.date-wheel{position:relative;width:76px;height:180px;grid-template-rows:repeat(5,36px);overflow:hidden;mask-image:linear-gradient(transparent,#000 32%,#000 68%,transparent);-webkit-mask-image:linear-gradient(transparent,#000 32%,#000 68%,transparent)}.date-wheel:before{content:'';position:absolute;inset:72px 0;border-radius:9px;background:#88888814;pointer-events:none}.date-wheel>span,.date-wheel>input{transform:translateY(var(--wheel-offset,0px));transition:transform 140ms ease-out}.date-wheel.dragging>span,.date-wheel.dragging>input{transition:none}.date-wheel span{line-height:36px;color:#666;font-size:20px}.date-wheel input{width:76px;height:36px;background:transparent;border-radius:8px;font-size:23px}.date-wheel input:focus{background:#ffffff70}.wheel-unit>span{font-size:13px}.today-label{white-space:nowrap}#panel #date-value{white-space:pre}
@media(prefers-reduced-motion:reduce){.date-wheel>span,.date-wheel>input{transition:none}}
#time-dial .hand-dot{r:15px}#time-dial .selected .hand-dot{r:20px}#time-dial .dragging .hand-dot{r:24px}

/* Quiet clock at rest; reveal the active scale only during manipulation. */
#time-dial .dial-labels{opacity:0;transform:scale(.96);transform-origin:120px 120px;transition:opacity 180ms ease,transform 220ms cubic-bezier(.22,1,.36,1);pointer-events:none}
#time-dial.dial-editing .dial-labels{opacity:1;transform:scale(1)}
#time-dial .dial-marks{stroke:#777;stroke-width:1;stroke-linecap:round;opacity:.55;transition:opacity 180ms ease;pointer-events:none}
#time-dial.dial-editing .dial-marks{opacity:.24}
#time-dial .hand-dot{transition:r 200ms cubic-bezier(.22,1,.36,1),fill 160ms ease}
@media(prefers-reduced-motion:reduce){#time-dial .dial-labels,#time-dial .dial-marks,#time-dial .hand-dot{transition:none;transform:none}}

/* One aligned live-time row, matching the light switch below. */
#panel .time-current-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:48px;margin:0 0 8px}
#panel .time-current-row #time-value{margin:0;font-size:20px;white-space:nowrap;line-height:1.2}
#panel .time-current-row .toggle{display:flex;align-items:center;justify-content:flex-end;gap:10px;margin:0 0 0 auto;min-height:44px;font-size:11px;white-space:nowrap}
#panel input[role=switch]{margin:0}
#panel .setting-section summary{position:relative;padding-right:22px;align-items:center;line-height:1.4}
#panel .setting-section summary:after{content:'';position:absolute;right:3px;top:50%;width:6px;height:6px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:translateY(-65%) rotate(45deg);transition:transform 160ms ease;transform-origin:center}
#panel .setting-section[open] summary:after{transform:translateY(-25%) rotate(225deg)}
@media(prefers-reduced-motion:reduce){#panel .setting-section summary:after{transition:none}}
@media(max-height:500px) and (orientation:landscape){#meadow{width:min(calc(100vw - 32px),calc(100dvh - 62px));height:min(calc(100vw - 32px),calc(100dvh - 62px))}}

/* Neutral surround keeps the meadow silhouette readable at every hour. */
body,body.night{background:var(--surround,#f0f1e9);transition:background-color 180ms linear}

#meadow{box-shadow:0 0 0 1px #ffffff0d,0 8px 24px #14241b14,0 2px 6px #14241b08;background:var(--surround,#f0f1e9)}

/* Four static legend views, balanced within the existing panel width. */
#panel>header{margin-bottom:0;padding-bottom:0}
#panel .sheep-legend{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:24px;position:relative;margin:24px 0;color:#505050}
#panel .legend-group{min-width:0}
#panel .legend-heading{font-size:13px;line-height:20px;font-weight:400;text-align:center;white-space:nowrap;margin-bottom:16px}
#panel .legend-items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-items:center}
#panel .legend-item{display:flex;align-items:center;justify-content:center;gap:4px;min-width:0;font-size:15px;line-height:1;white-space:nowrap}
#panel .legend-item canvas{width:40px;max-width:calc(100% - 19px);height:auto;aspect-ratio:1;flex-shrink:1;touch-action:auto}
#panel .legend-item>span{display:block;flex-shrink:0}
#panel .sheep-legend:after{content:'';position:absolute;left:50%;bottom:7px;width:.5px;height:26px;background:#5554}
@media(max-width:380px){#panel .sheep-legend{column-gap:16px}#panel .legend-items{gap:4px}#panel .legend-heading{font-size:12px}#panel .legend-item{gap:3px;font-size:14px}#panel .legend-item canvas{max-width:calc(100% - 17px)}}

/* Independent shape edition: controls always sit outside the meadow. */
html,body{overflow:hidden}
body{gap:0;padding:20px}
.meadow-layout{--field-size:min(calc(100vw - 108px),calc(100dvh - 40px));position:relative;flex-shrink:0;margin-right:64px}
#meadow{width:var(--field-size);height:var(--field-size);margin:0}
body[data-shape="rectangle"] .meadow-layout{--field-size:min(calc((100vw - 108px)/1.5),calc(100dvh - 40px))}
body[data-shape="rectangle"] #meadow{width:calc(var(--field-size)*1.5);height:var(--field-size)}
.terrain-switch{position:absolute;left:calc(100% + 16px);top:50%;transform:translateY(-50%);display:flex;flex-direction:column;gap:6px;padding:0;background:none!important;border-radius:0}
.terrain-switch button{display:grid;place-items:center;width:44px;height:44px;padding:0;border-radius:14px;color:#69785a;transition:background .2s,color .2s}
.terrain-switch svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.terrain-switch button:hover{background:#dfe5d880}
.terrain-switch button[aria-pressed=true]{background:#ffffffa6;color:#3c5734;box-shadow:0 2px 8px #2034140b}
.terrain-switch button:focus-visible{outline:2px solid #6d895d;outline-offset:3px}
.control-divider{height:1px;margin:6px 10px;background:#69785a30}
.shape-square,body[data-shape="rectangle"] .shape-rectangle{display:none}
body[data-shape="rectangle"] .shape-square{display:block}
@media(max-width:480px){body{padding:12px}.meadow-layout{--field-size:min(calc(100vw - 80px),calc(100dvh - 24px));margin-right:56px}body[data-shape="rectangle"] .meadow-layout{--field-size:min(calc((100vw - 80px)/1.5),calc(100dvh - 24px))}.terrain-switch{left:calc(100% + 8px)}}

#terrain-toggle .terrain-grass{display:block}#terrain-toggle .terrain-hill{display:none}#terrain-toggle[aria-pressed=true] .terrain-grass{display:none}#terrain-toggle[aria-pressed=true] .terrain-hill{display:block}

/* Resize the actual field so sheep stay round throughout the stretch. */
#meadow{transition:width 720ms cubic-bezier(.22,1,.36,1),height 720ms cubic-bezier(.22,1,.36,1)}
@media(prefers-reduced-motion:reduce){#meadow{transition:none}}

/* Reserve the wider footprint: changing shape never shrinks the flock. */
.meadow-layout,body[data-shape="rectangle"] .meadow-layout{--field-size:min(calc((100vw - 108px)/1.5),calc(100dvh - 40px))}
#meadow{border-radius:30px 27px 32px 29px / 27px 31px 28px 32px;transition:width 950ms cubic-bezier(.45,0,.2,1),border-radius 950ms cubic-bezier(.45,0,.2,1)}
body[data-shape="rectangle"] #meadow{border-radius:34px 30px 36px 32px / 28px 32px 29px 33px}
@media(max-width:480px){.meadow-layout,body[data-shape="rectangle"] .meadow-layout{--field-size:min(calc((100vw - 80px)/1.5),calc(100dvh - 24px))}#meadow{border-radius:21px 19px 23px 20px}body[data-shape="rectangle"] #meadow{border-radius:24px 21px 25px 22px}}
@media(prefers-reduced-motion:reduce){#meadow{transition:none}}

/* Icons describe the destination, just like the shape control. */
#terrain-toggle .terrain-grass{display:none}#terrain-toggle .terrain-hill{display:block}
#terrain-toggle[aria-pressed=true] .terrain-grass{display:block}#terrain-toggle[aria-pressed=true] .terrain-hill{display:none}
body.immersive{padding:0}
body.immersive .meadow-layout{position:fixed;inset:0;margin:0;width:100%;height:100%}
body.immersive #meadow{width:100%;height:100%;border-radius:0;box-shadow:none;transition:none}
body.immersive .terrain-switch,body.immersive #settings,body.immersive #panel,body.immersive #clock-feedback{display:none!important}
body.immersive nav{right:max(20px,env(safe-area-inset-right));bottom:max(20px,env(safe-area-inset-bottom))}

/* One layout animator owns geometry while entering or leaving fullscreen. */
body.layout-transition #meadow{transition:none!important;pointer-events:none}
body.layout-transition .terrain-switch,body.layout-transition #settings{visibility:hidden;pointer-events:none}

/* The scene is a viewport, never a scrollable document. */
#meadow{overflow:clip}
#scene{position:absolute;inset:0}

/* Settings shares the external toolbar; the clock remains alone in the field. */
.terrain-switch button[aria-expanded=true]{background:#ffffffa6;color:#3c5734;box-shadow:0 2px 8px #2034140b}

/* Shared circular translucent controls. */
:is(#terrain-toggle,#shape,#fullscreen,#settings,#clock){
 width:44px;height:44px;padding:0;border-radius:50%;
 display:grid;place-items:center;
 background:rgba(250,250,250,.32);color:#404040;opacity:1;
 box-shadow:inset 0 1px 0 #ffffff80,0 2px 8px #00000008;
 transition:background .2s,transform .2s;
}
:is(#terrain-toggle,#shape,#fullscreen,#settings,#clock):hover{background:rgba(250,250,250,.48)}
:is(#terrain-toggle,#shape,#fullscreen,#settings,#clock):active{background:rgba(250,250,250,.48);transform:scale(.94)}
:is(#terrain-toggle,#shape,#fullscreen,#settings,#clock):focus-visible{outline:2px solid #6d895d;outline-offset:3px}
body.night :is(#terrain-toggle,#shape,#fullscreen,#settings,#clock){color:#e0e9d8}
/* Persistent feedback only for the clock and the open settings panel. */
#clock[aria-pressed=true],#settings[aria-expanded=true]{background:rgba(250,250,250,.72);color:#404040}
body.night :is(#clock[aria-pressed=true],#settings[aria-expanded=true]){color:#404040}
.terrain-switch{gap:14px}
.terrain-switch .control-divider{margin:0 10px}
@media(prefers-reduced-transparency:reduce),(prefers-contrast:more){
 :is(#terrain-toggle,#shape,#fullscreen,#settings,#clock){background:#f7f7f7;color:#404040}
}

/* The clock lives in the sidebar except while the field is fullscreen. */
body:not(.immersive) #meadow > nav{display:none}
#terrain-toggle .terrain-grass{stroke-width:1.15}
#clock svg{width:22px;height:22px;stroke-width:1.35}
