:root {
  color-scheme: light;
  --page: #f3f6f4;
  --surface: #fff;
  --ink: #17241f;
  --muted: #506359;
  --line: #dce5df;
  --subtle: #edf2ef;
  --accent: #17634b;
  --reset: #339774;
  --banked: #7663b1;
  --announcement: #a66622;
  --hero: #123b2d;
  --hero-text: #effaf3;
  --hero-muted: #b5d6c4;
  --hero-accent: #bce78f;
  --focus: #008567;
  --radius: 20px;
  --mono: 'Cascadia Code', 'SFMono-Regular', Consolas, monospace;
  font-family: 'Aptos', 'Segoe UI', 'Microsoft YaHei UI', 'PingFang SC', sans-serif;
  font-synthesis: none;
  background: var(--page);
  color: var(--ink);
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --page: #111915;
  --surface: #19241e;
  --ink: #e9f2ed;
  --muted: #adbfB4;
  --line: #33433a;
  --subtle: #24322a;
  --accent: #92dbb8;
  --reset: #61c197;
  --banked: #a792ec;
  --announcement: #dfac73;
  --hero: #153c2f;
  --focus: #9eedca;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
a { color: inherit; }
button { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
h1, h2, p { margin: 0; }
.shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 68px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.wordmark { display: inline-flex; width: fit-content; align-items: center; gap: 11px; text-decoration: none; font: 700 1.17rem var(--mono); letter-spacing: -.065em; }
.mark { width: 25px; height: 25px; position: relative; border-radius: 8px; background: #226c50; }
.mark::before, .mark::after { content: ''; position: absolute; border: 1.5px solid #d0f1a8; border-radius: 3px; transform: rotate(-35deg); }
.mark::before { width: 13px; height: 6px; top: 7px; left: 6px; }
.mark::after { width: 13px; height: 6px; top: 13px; left: 6px; }
.navigation { display: flex; align-items: center; gap: 28px; }
.navigation a { text-decoration: none; color: var(--muted); font-size: .92rem; white-space: nowrap; }
.navigation a:hover, .controls a:hover { color: var(--accent); }
.controls { display: flex; justify-content: end; gap: 12px; align-items: center; }
.controls a, .controls button { display: grid; place-items: center; width: 38px; height: 36px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; text-decoration: none; font-size: .85rem; cursor: pointer; }
.theme-icon { width: 14px; height: 14px; border: 1.5px solid var(--muted); border-radius: 50%; box-shadow: inset -4px -2px 0 var(--surface); background: linear-gradient(135deg, var(--muted) 48%, transparent 49%); }
[data-theme='dark'] .theme-icon { background: var(--hero-accent); border-color: var(--hero-accent); box-shadow: none; }
.page-intro { padding: 52px 0 26px; display: flex; justify-content: space-between; align-items: end; gap: 20px; }
h1 { font-size: clamp(1.95rem, 4vw, 3.15rem); line-height: 1.13; letter-spacing: -.041em; font-weight: 750; }
.page-intro p, .section-heading p { color: var(--muted); margin-top: 10px; line-height: 1.55; }
.time-zone { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); background: var(--subtle); border-radius: 10px; white-space: nowrap; }
.time-zone button { font-size: .84rem; padding: 7px 12px; background: transparent; border: 1px solid transparent; border-radius: 7px; color: var(--muted); cursor: pointer; }
.time-zone button[aria-pressed='true'] { background: var(--surface); border-color: var(--line); color: var(--ink); box-shadow: 0 1px 2px #0000000a; }
.overview-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; }
.today-card, .latest-card { min-width: 0; min-height: 258px; padding: 25px 29px; border-radius: var(--radius); }
.today-card { display: flex; flex-direction: column; justify-content: space-between; position: relative; isolation: isolate; overflow: hidden; border: 1px solid #26634d; color: var(--hero-text); background: linear-gradient(122deg, var(--hero), #194f3b); }
.today-card::before { content: ''; position: absolute; z-index: -1; width: 315px; aspect-ratio: 1; right: -92px; bottom: -175px; border-radius: 50%; border: 1px solid #d2f7d72d; box-shadow: 0 0 0 24px #d2f7d710, 0 0 0 51px #d2f7d70c, 0 0 0 82px #d2f7d709; }
.check-state { font-size: .87rem; width: fit-content; display: flex; align-items: center; gap: 8px; padding: 5px 9px; background: #ffffff12; border: 1px solid #ffffff20; border-radius: 999px; }
.check-state > span:first-child { width: 7px; height: 7px; border-radius: 50%; background: #d6d1ac; }
.check-state[data-state='ok'] > span:first-child { background: var(--hero-accent); }
.check-state[data-state='failed'] > span:first-child { background: #ffc393; }
.today-copy { margin-block: 21px 18px; }
.hero-label { color: var(--hero-muted); font-size: .92rem; margin-bottom: 6px; }
.today-copy h2 { font-size: clamp(1.6rem, 3.6vw, 2.75rem); letter-spacing: -.04em; line-height: 1.2; }
.today-copy p { color: var(--hero-muted); margin-top: 9px; line-height: 1.55; }
.last-check { font-size: .87rem; color: var(--hero-muted); line-height: 1.5; }
.latest-card { background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: flex-start; }
.latest-head { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.latest-head h2 { font-size: 1rem; font-weight: 650; }
.date-badge { font: .82rem var(--mono); color: var(--muted); }
.elapsed { margin-top: 13px; font: 700 clamp(1.9rem, 3.8vw, 2.9rem)/1.13 var(--mono); letter-spacing: -.08em; color: var(--accent); }
.latest-scope { color: var(--ink); font-size: .94rem; margin-top: 7px; font-weight: 650; }
.latest-summary { color: var(--muted); line-height: 1.55; margin-top: 6px; }
.post-link { display: inline-block; font-weight: 650; text-underline-offset: .24em; color: var(--accent); font-size: .9rem; white-space: nowrap; }
.latest-card .post-link { margin-top: auto; padding-top: 13px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.stats div { padding: 15px 22px; min-width: 0; }
.stats div + div { border-left: 1px solid var(--line); }
.stats span { display: block; color: var(--muted); font-size: .87rem; margin-bottom: 6px; }
.stats strong { display: block; font: 650 clamp(.95rem, 2.1vw, 1.23rem)/1.35 var(--mono); letter-spacing: -.055em; overflow-wrap: anywhere; }
.alert-panel { margin-top: 16px; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; display: grid; grid-template-columns: .75fr 1.5fr; gap: 12px 20px; }
.alert-intro h2 { font-size: 1.15rem; }
.alert-intro p, .alert-feedback { color: var(--muted); font-size: .85rem; line-height: 1.5; margin-top: 5px; }
.alert-options { display: grid; grid-template-columns: .8fr 1.2fr; align-items: start; gap: 14px; }
.alert-option h3, .alert-option label { display: block; margin: 0 0 7px; font-size: .92rem; font-weight: 650; }
.alert-email-input { display: flex; gap: 6px; }
.alert-email-input input { min-width: 0; width: 100%; max-width: 252px; padding: 8px 10px; font: inherit; font-size: .94rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.alert-email-input input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.alert-email-input .quiet-button { white-space: nowrap; }
.alert-confirmation { margin-top: 8px; font-size: .85rem; }
.alert-confirmation summary { color: var(--accent); cursor: pointer; }
.alert-confirmation form { margin-top: 8px; }
.archive-section { margin-top: 43px; scroll-margin-top: 24px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 14px 20px; margin-bottom: 15px; }
.section-heading h2 { font-size: clamp(1.35rem, 2.35vw, 1.85rem); letter-spacing: -.035em; }
.section-heading p { margin-top: 5px; }
.legend { padding: 0; margin: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 13px; color: var(--muted); font-size: .82rem; }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; border: 1px solid transparent; background: var(--subtle); }
.legend .empty { border-color: var(--line); }
.legend .reset, .day.reset { background: var(--reset); }
.legend .banked, .day.banked { background: var(--banked); }
.legend .announcement, .day.announcement { background: var(--announcement); }
.calendar-panel { border: 1px solid var(--line); border-radius: 15px; background: var(--surface); padding: 19px 24px 20px; }
.calendar-toolbar { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 7px 13px; margin-bottom: 14px; }
.calendar-toolbar > span { color: var(--muted); font: .84rem var(--mono); }
.calendar-nav { display: flex; gap: 6px; }
.calendar { display: grid; grid-template-columns: 35px repeat(12, minmax(0, 1fr)); grid-template-rows: 19px repeat(7, clamp(13px, 2.1vw, 21px)); gap: 5px; margin: 0 auto; font-size: .74rem; color: var(--muted); }
.month { white-space: nowrap; }
.weekday { align-self: center; }
.day { display: block; width: 100%; min-width: 0; height: 100%; border-radius: 4px; border: 1px solid var(--line); background: var(--subtle); padding: 0; }
button.day { cursor: pointer; border-color: transparent; }
button.day:hover, button.day[aria-pressed='true'] { outline: 2px solid var(--focus); outline-offset: 2px; }
.day[data-today='true'] { border-color: var(--accent); }
.day[data-future='true'] { opacity: .5; }
.timeline { border: 1px solid var(--line); border-radius: 15px; background: var(--surface); overflow: hidden; }
.event-row { display: grid; grid-template-columns: 156px 1fr auto; gap: 8px 22px; align-items: center; padding: 17px 22px; }
.event-row + .event-row { border-top: 1px solid var(--line); }
.event-row:target, .event-row.notification-target { background: var(--subtle); }
.event-when { align-self: start; padding-top: 3px; min-width: 0; }
.event-when strong { display: block; font: 650 .91rem var(--mono); }
.event-when span, .event-meta { display: block; margin-top: 5px; color: var(--muted); font-size: .86rem; }
.event-copy { min-width: 0; }
.event-copy p { margin-top: 5px; line-height: 1.5; overflow-wrap: anywhere; }
.kind { display: inline-flex; padding: 3px 7px; font-size: .81rem; border-radius: 5px; font-weight: 650; background: var(--subtle); color: var(--accent); }
.kind.banked { color: var(--banked); }
.kind.announcement { color: var(--announcement); }
.empty-list { padding: 24px; color: var(--muted); }
.quiet-button { cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--accent); border-radius: 8px; padding: 8px 11px; border: 1px solid var(--line); background: var(--surface); }
.quiet-button:hover { background: var(--subtle); }
.quiet-button:disabled { color: var(--muted); opacity: .55; cursor: default; }
.more-button { margin-top: 12px; }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 9px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem; margin-top: 46px; padding: 18px 0 30px; }
.footer a { text-underline-offset: 3px; }

@media (max-width: 760px) {
  .shell { width: calc(100% - 36px); }
  .header-inner { min-height: 57px; gap: 13px; }
  .navigation { gap: 14px; }
  .page-intro { padding-top: 36px; }
  .overview-grid { gap: 11px; }
  .today-card, .latest-card { padding: 20px; }
  .event-row { grid-template-columns: 118px 1fr auto; gap: 8px 12px; padding: 15px; }
  .alert-panel { grid-template-columns: 1fr; }
}

@media (max-width: 570px) {
  .shell { width: calc(100% - 28px); }
  .header-inner { grid-template-columns: 1fr auto; }
  .navigation { display: none; }
  .page-intro { align-items: start; flex-direction: column; padding: 29px 0 17px; gap: 12px; }
  .overview-grid { grid-template-columns: 1fr; }
  .today-card, .latest-card { min-height: 0; }
  .latest-card .post-link { margin-top: 5px; }
  .stats div { padding: 10px 9px; }
  .stats span { font-size: .81rem; }
  .archive-section { margin-top: 31px; }
  .section-heading { flex-wrap: wrap; }
  .calendar-panel { padding: 12px 10px; }
  .calendar { grid-template-columns: 24px repeat(12, minmax(0, 1fr)); gap: 4px 3px; }
  .event-row { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .event-copy { grid-area: 2 / 1 / auto / span 2; }
  .event-when { padding: 0; }
  .event-when strong, .event-when span { display: inline; }
  .event-when span { margin-left: 5px; }
  .event-row .post-link { grid-row: 1; grid-column: 2; font-size: .81rem; }
}

@media (max-width: 380px) {
  .alert-panel { padding: 15px; }
  .alert-options { grid-template-columns: 1fr; }
}
