:root { color-scheme: light; font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', system-ui, sans-serif; }
* { box-sizing: border-box; }
body { --page: #edf1eb; --light: #f9fcf8; --border: #d7e1d7; --text: #1d352a; --muted: #476052; --accent: #286246; --strong: #1d4935; --soft: #d7e8db; margin: 0; background: var(--page); color: var(--text); }
body[data-phase='rest'] { --page: #ecf0f7; --light: #fbfcff; --border: #d6e0ed; --text: #223653; --muted: #465d77; --accent: #385c8a; --strong: #294668; --soft: #d9e5f3; }
main { width: min(100% - 2rem, 38rem); margin: auto; text-align: center; padding: clamp(1.6rem, 6vh, 4rem) 0 2rem; }
h1, p { margin: 0; }
h1 { font-size: clamp(1.95rem, 6.5vw, 3.25rem); letter-spacing: -.075em; line-height: 1.1; }
header p { margin-top: .62rem; color: var(--muted); }
.clock { margin-top: clamp(1.1rem, 4vh, 2rem); background: var(--light); border: 1px solid var(--border); border-radius: 1.55rem; padding: clamp(.95rem, 4vw, 1.85rem); }
.phases { display: inline-flex; gap: .25rem; padding: .25rem; background: var(--page); border-radius: 3rem; }
.phases span { padding: .45rem .75rem; color: var(--muted); border-radius: 3rem; font-size: .88rem; font-weight: 700; }
.phases [aria-current] { color: var(--strong); background: var(--soft); }
.dial { position: relative; isolation: isolate; display: grid; place-content: center; gap: .35rem; width: min(100%, clamp(13.5rem, 61vw, 18.75rem)); aspect-ratio: 1; margin: clamp(.65rem, 2vh, 1.2rem) auto; border-radius: 50%; background: conic-gradient(var(--accent) var(--progress, 100%), var(--soft) 0%); }
.dial::before { content: ''; position: absolute; z-index: -1; inset: .45rem; background: var(--light); border-radius: 50%; }
#time { font: 760 clamp(3.45rem, 15.2vw, 5.8rem)/.96 system-ui, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -.085em; padding-right: .08em; }
#status { color: var(--muted); font-size: .9rem; }
#ends-at { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.actions { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: .55rem; width: min(100%, 23rem); margin: 0 auto; }
button { min-height: 3.15rem; border: 1px solid var(--border); border-radius: .72rem; background: var(--page); color: var(--text); font: inherit; font-weight: 750; cursor: pointer; }
button:hover { background: var(--soft); }
#toggle { background: var(--accent); border-color: var(--accent); color: white; }
#toggle:hover { background: var(--strong); }
button:focus-visible { outline: 2px solid var(--strong); outline-offset: 3px; }
.settings { width: min(100%, 29rem); margin: .75rem auto 0; border: 1px solid var(--border); border-radius: .8rem; padding: .85rem 1rem; background: var(--light); text-align: left; }
.settings summary { cursor: pointer; font-size: .9rem; font-weight: 750; }
.settings form { margin-top: .8rem; }
.durations { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.durations label { display: grid; gap: .3rem; font-size: .87rem; font-weight: 700; }
.durations input { width: 100%; padding: .53rem; border: 1px solid var(--border); border-radius: .42rem; background: var(--light); color: var(--text); font: inherit; }
.settings button { width: 100%; min-height: 2.5rem; margin-top: .6rem; }
#settings-status { margin-top: .45rem; color: var(--muted); font-size: .84rem; }
@media (prefers-reduced-motion: no-preference) { body { transition: background-color .25s; } }
@media (max-height: 475px) and (min-width: 550px) { main { padding-top: .9rem; } .clock { margin-top: .75rem; } .dial { width: 12.5rem; } #time { font-size: 4.15rem; } }
