:root {
  color-scheme: light;
  --bg: #f5f6f8; --surface: #ffffff; --ink: #20232c; --muted: #717785;
  --line: #e9ebf0; --track: #edf0f6; --soft: #f5f6fa;
  --accent: #435cf5; --accent-soft: #edf0ff; --accent-ink: #354bcc;
  --break: #15805a; --break-soft: #e8f5ef;
  --shadow: 0 4px 24px rgb(24 31 59 / 2%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121419; --surface: #1b1e25; --ink: #f2f3f7; --muted: #a0a6b4;
    --line: #2d313b; --track: #2b303d; --soft: #252932;
    --accent: #a4b0ff; --accent-soft: #292f4d; --accent-ink: #b8c2ff;
    --break: #85d6b0; --break-soft: #223d34; --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121419; --surface: #1b1e25; --ink: #f2f3f7; --muted: #a0a6b4;
  --line: #2d313b; --track: #2b303d; --soft: #252932;
  --accent: #a4b0ff; --accent-soft: #292f4d; --accent-ink: #b8c2ff;
  --break: #85d6b0; --break-soft: #223d34; --shadow: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); min-width: 280px; min-height: 100vh; min-height: var(--tg-viewport-stable-height, 100dvh); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
.app-shell { max-width: 1200px; margin: 0 auto; padding: calc(36px + max(env(safe-area-inset-top, 0px), var(--app-safe-top, 0px))) calc(44px + max(env(safe-area-inset-right, 0px), var(--app-safe-right, 0px))) calc(22px + max(env(safe-area-inset-bottom, 0px), var(--app-safe-bottom, 0px))) calc(44px + max(env(safe-area-inset-left, 0px), var(--app-safe-left, 0px))); }
.topbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-size: 1.4rem; font-weight: 680; letter-spacing: -.06em; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 13px; background: var(--ink); color: var(--surface); }
.brand-mark svg { width: 21px; height: 21px; }
.brand-dot { color: var(--accent); }
.year-label { font-size: .8125rem; color: var(--muted); border: 1px solid var(--line); padding: 7px 11px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.day-heading { margin: 48px 0 26px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.eyebrow { margin: 0 0 10px; font-size: .75rem; color: var(--muted); letter-spacing: .12em; font-weight: 650; }
h1 { font-size: clamp(1.8rem, 3.2vw, 2.35rem); letter-spacing: -.045em; font-weight: 600; line-height: 1.15; margin: 0; }
.live-clock { display: grid; gap: 5px; text-align: right; flex-shrink: 0; }
.live-clock time { font-size: 1.0625rem; font-weight: 550; font-variant-numeric: tabular-nums; }
.live-clock span { font-size: .8125rem; color: var(--muted); }
.workspace { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 24px; align-items: stretch; }
.timer-card, .schedule-card { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); min-width: 0; }
.timer-card { display: flex; flex-direction: column; padding: 25px 28px 0; }
.timer-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.status-pill { display: inline-flex; align-items: center; padding: 7px 12px; border-radius: 20px; color: var(--accent-ink); background: var(--accent-soft); font-size: .875rem; font-weight: 550; line-height: 1.25; }
.period-time { font-size: .875rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dial { display: grid; position: relative; place-items: center; width: min(100%, 426px); aspect-ratio: 1; margin: auto; flex-shrink: 0; }
.dial-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); }
.dial-ring circle { fill: none; stroke-width: 3; }
.ring-track { stroke: var(--track); }
.ring-progress { stroke: var(--accent); stroke-dasharray: 100; stroke-dashoffset: 100; stroke-linecap: round; transition: stroke-dashoffset .65s linear; }
.dial-face { position: relative; width: 100%; text-align: center; padding: 28px 12px; }
.remaining-label { margin: 0 auto 14px; color: var(--muted); max-width: 78%; line-height: 1.5; font-size: 1rem; text-wrap: balance; }
.countdown { font-size: clamp(3.5rem, 7.7vw, 6.15rem); font-weight: 460; line-height: 1.06; letter-spacing: -.07em; font-variant-numeric: tabular-nums; white-space: nowrap; margin-left: -.065em; }
.countdown.long { font-size: clamp(2.65rem, 5.8vw, 4.5rem); letter-spacing: -.055em; }
.unit-label { color: var(--muted); font-size: .75rem; letter-spacing: .08em; margin: 14px 0 0; }
.dial-caption { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: .8125rem; color: var(--muted); margin: 31px 0 0; }
.small-rule { width: 17px; height: 1px; background: var(--line); }
.next-event { display: flex; gap: 12px; align-items: center; border-top: 1px solid var(--line); padding: 22px 0 25px; margin-top: 10px; }
.next-event-icon { flex-shrink: 0; width: 38px; height: 38px; display: grid; place-items: center; background: var(--soft); border-radius: 12px; color: var(--muted); }
.next-event-icon svg { width: 20px; height: 20px; }
.next-event-copy { display: grid; gap: 4px; min-width: 0; }
.next-event-copy > span { color: var(--muted); font-size: .8125rem; }
.next-event-copy strong { font-size: 1rem; font-weight: 550; line-height: 1.4; }
.next-event > time { margin-left: auto; font-size: .9375rem; font-weight: 550; font-variant-numeric: tabular-nums; white-space: nowrap; }
.schedule-card { padding: 26px 22px 18px; }
.schedule-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
h2 { font-size: 1.2rem; letter-spacing: -.025em; font-weight: 600; margin: 0; }
.schedule-heading > span { font-size: .8125rem; color: var(--muted); }
.schedule-tabs { display: grid; grid-template-columns: 1.1fr 1fr; padding: 4px; border-radius: 12px; background: var(--soft); margin: 22px 0 17px; gap: 4px; }
.schedule-tabs button { min-height: 40px; border: 0; background: transparent; color: var(--muted); font-size: .875rem; font-weight: 550; border-radius: 9px; cursor: pointer; padding: 8px 6px; transition: background .15s, color .15s; }
.schedule-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgb(0 0 0 / 5%); }
.schedule-tabs button:hover { color: var(--ink); }
.schedule-note { font-size: .875rem; line-height: 1.5; color: var(--muted); background: var(--soft); padding: 10px 12px; border-radius: 10px; margin: 0 0 12px; }
table { width: 100%; border-collapse: separate; border-spacing: 0 3px; table-layout: fixed; font-variant-numeric: tabular-nums; }
th { padding: 0 3px 9px; color: var(--muted); font-size: .75rem; font-weight: 450; text-align: left; }
th:first-child { width: 16%; padding-left: 8px; }
th:nth-child(2) { width: 62%; text-align: center; }
th:last-child { width: 22%; text-align: right; padding-right: 8px; }
abbr { text-decoration: none; }
td { padding: 9px 3px; height: 39px; font-size: .9375rem; line-height: 1.4; border-top: 1px solid transparent; border-bottom: 1px solid transparent; }
td:first-child { padding-left: 8px; border-radius: 9px 0 0 9px; color: var(--muted); font-size: .8125rem; }
td:nth-child(2) { text-align: center; font-weight: 520; letter-spacing: -.025em; }
td time { white-space: nowrap; }
td:last-child { text-align: right; border-radius: 0 9px 9px 0; padding-right: 8px; font-size: .8125rem; color: var(--muted); white-space: nowrap; }
.time-separator { display: inline-block; color: var(--muted); padding: 0 4px; font-weight: 400; }
tr.is-complete td { color: var(--muted); }
tr.is-current td { background: var(--accent-soft); color: var(--accent-ink); }
tr.is-current td:first-child { font-weight: 700; }
tr.is-break td { background: var(--break-soft); color: var(--break); }
tr.is-next td { border-top-color: var(--line); border-bottom-color: var(--line); }
tr.is-next td:first-child { border-left: 1px solid var(--line); }
tr.is-next td:last-child { border-right: 1px solid var(--line); }
.schedule-foot { display: flex; align-items: flex-start; gap: 8px; font-size: .75rem; color: var(--muted); line-height: 1.45; border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.legend-line { width: 14px; height: 3px; border-radius: 2px; background: var(--accent); margin-top: 7px; flex-shrink: 0; }
.day-progress { max-width: calc((100% - 24px) * .59184); margin-top: 25px; }
.day-progress-label { display: flex; justify-content: space-between; gap: 12px; font-size: .8125rem; color: var(--muted); }
.day-progress-track { display: flex; gap: 5px; margin-top: 12px; }
.day-progress-track span { height: 4px; flex: 1; border-radius: 4px; background: var(--line); }
.day-progress-track span.complete { background: var(--accent); }
.day-progress-track span.current { background: var(--accent); opacity: .35; }
footer { display: flex; justify-content: space-between; gap: 14px; font-size: .75rem; color: var(--muted); padding-top: 31px; line-height: 1.5; }
.timer-card[data-phase="break"] .status-pill { color: var(--break); background: var(--break-soft); }
.timer-card[data-phase="break"] .ring-progress { stroke: var(--break); }
.timer-card[data-phase="done"] .status-pill, .timer-card[data-phase="weekend"] .status-pill, .timer-card[data-phase="before"] .status-pill { color: var(--muted); background: var(--soft); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.error-message { background: var(--accent-soft); color: var(--ink); padding: 20px; line-height: 1.6; border-radius: 16px; }
@media (min-width: 1200px) { .dial { margin-top: 26px; margin-bottom: 20px; } }
@media (max-width: 960px) {
  .app-shell { padding-left: max(24px, env(safe-area-inset-left, 0px), var(--app-safe-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px), var(--app-safe-right, 0px)); }
  .workspace { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; }
  .timer-card { padding-left: 20px; padding-right: 20px; }
  .schedule-card { padding-left: 17px; padding-right: 17px; }
  .day-progress { max-width: calc((100% - 18px) * .5238); }
  .remaining-label { font-size: .9375rem; }
  .dial-caption { margin-top: 22px; }
}
@media (max-width: 740px) {
  .app-shell { max-width: 580px; padding-top: calc(22px + max(env(safe-area-inset-top, 0px), var(--app-safe-top, 0px))); padding-left: calc(18px + max(env(safe-area-inset-left, 0px), var(--app-safe-left, 0px))); padding-right: calc(18px + max(env(safe-area-inset-right, 0px), var(--app-safe-right, 0px))); }
  .brand { font-size: 1.3rem; gap: 9px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 11px; }
  .year-label { font-size: .75rem; padding: 6px 8px; }
  .day-heading { margin: 32px 0 20px; gap: 12px; flex-wrap: wrap; }
  .eyebrow { font-size: .75rem; letter-spacing: .105em; margin-bottom: 8px; }
  h1 { font-size: 1.85rem; }
  .live-clock time { font-size: .9375rem; }
  .live-clock span { font-size: .75rem; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .timer-card, .schedule-card { border-radius: 23px; }
  .timer-card { padding: 18px 18px 0; }
  .timer-card-top { gap: 8px; }
  .status-pill { padding: 6px 10px; }
  .period-time { font-size: .875rem; }
  .dial { max-width: 385px; margin-top: 12px; margin-bottom: 8px; }
  .countdown { font-size: clamp(3.65rem, 18vw, 6.15rem); }
  .countdown.long { font-size: clamp(2.5rem, 12.6vw, 4.5rem); }
  .remaining-label { font-size: .9375rem; margin-bottom: 10px; }
  .unit-label { margin-top: 10px; font-size: .75rem; letter-spacing: .04em; }
  .dial-caption { margin-top: 24px; font-size: .75rem; }
  .next-event { padding: 16px 0 18px; margin-top: 0; gap: 10px; }
  .next-event-copy strong { font-size: .9375rem; }
  .schedule-card { padding: 22px 20px 18px; }
  .schedule-tabs { margin-top: 19px; }
  td { height: 44px; }
  .day-progress { max-width: 100%; margin-top: 23px; }
  footer { padding-top: 24px; flex-wrap: wrap; }
}
@media (max-width: 360px) {
  .app-shell { padding-left: max(12px, env(safe-area-inset-left, 0px), var(--app-safe-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px), var(--app-safe-right, 0px)); }
  .day-heading { flex-wrap: wrap; }
  .live-clock { text-align: left; }
  .timer-card, .schedule-card { padding-left: 13px; padding-right: 13px; }
  .timer-card-top { flex-wrap: wrap; }
  .remaining-label { font-size: .875rem; }
  .dial-caption { margin-top: 16px; }
  .countdown { font-size: min(3.8rem, 19vw); }
  .countdown.long { font-size: min(2.55rem, 13.2vw); }
  .time-separator { padding: 0 2px; }
  .next-event-icon { display: none; }
  .day-progress-label { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@supports (font-size: 1cqi) {
  .dial { container-type: inline-size; }
  .countdown { font-size: min(24cqi, 6.15rem); }
  .countdown.long { font-size: min(18cqi, 4.5rem); }
}
