:root {
  color-scheme: light;
  --paper: #f5f4ef;
  --surface: #ffffff;
  --ink: #20352f;
  --muted: #56645b;
  --accent: #183e38;
  --accent-light: #e8efe5;
  --border: #d8dfd5;
  --warning: #78511b;
  --warning-bg: #fff4de;
  --danger: #8c302d;
  --danger-bg: #fff0ec;
  --radius: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  background: var(--paper);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, textarea, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
input:disabled, textarea:disabled, select:disabled { color: var(--muted); background: #f0f1ec; opacity: 1; }
:focus-visible { outline: 3px solid #867321; outline-offset: 4px; }
main:focus, [data-screen]:focus { outline: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 5.3vw, 2.8rem); line-height: 1.15; letter-spacing: -.045em; font-weight: 680; }
h2 { font-size: 1.23rem; line-height: 1.3; letter-spacing: -.025em; }
h3 { font-size: 1.03rem; line-height: 1.4; }
p + p { margin-top: .6rem; }
ul, ol { padding-left: 1.4rem; }
li + li { margin-top: .55rem; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
label { display: block; font-size: .91rem; font-weight: 620; margin: 1.15rem 0 .4rem; }
input:not([type="checkbox"]), select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid #9daea0;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: .72rem .85rem;
}
input[type="datetime-local"], input[type="time"] { appearance: none; -webkit-appearance: none; }
textarea { display: block; resize: vertical; line-height: 1.55; }
input[type="checkbox"] { width: 22px; height: 22px; flex: 0 0 22px; accent-color: var(--accent); margin: .15rem 0 0; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
summary { min-height: 48px; padding: .7rem 0; font-weight: 620; cursor: pointer; }

.page-shell { width: min(1120px, 100%); margin: auto; padding: 0 24px; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 26px 0 18px; }
.brand { display: flex; align-items: center; gap: .7rem; font-size: 1.25rem; font-weight: 720; letter-spacing: -.03em; text-decoration: none; min-height: 48px; }
.brand-caption { display: block; font-size: .72rem; font-weight: 500; letter-spacing: .01em; color: var(--muted); }
.brand-mark { width: 40px; height: 40px; border-radius: 13px; background: var(--accent); position: relative; flex-shrink: 0; }
.brand-mark::after { content: ""; position: absolute; width: 16px; height: 9px; border-bottom: 3px solid #dce9cf; border-left: 3px solid #dce9cf; transform: rotate(-45deg); left: 11px; top: 12px; }
.header-actions { display: flex; gap: .25rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 46px; padding: .6rem 1rem; border-radius: 11px; border: 1px solid transparent; font-weight: 620; font-size: .9rem; line-height: 1.35; text-align: center; text-decoration: none; }
.button.primary { background: var(--accent); color: #fff; }
.button.secondary { background: #f3f6f0; color: var(--accent); border-color: #bac9b9; }
.button.subtle { background: transparent; color: var(--accent); }
.button.primary:hover:not(:disabled) { background: #28574b; }
.button.secondary:hover:not(:disabled), .button.subtle:hover:not(:disabled) { background: #e6ede0; }
.full-width { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.button-column { display: grid; gap: .6rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.4rem; }
.skip-link { position: fixed; left: 12px; top: -100px; z-index: 20; background: white; padding: 12px; border-radius: 10px; }
.skip-link:focus { top: 12px; }
.view-nav { display: flex; gap: .5rem; border-bottom: 1px solid var(--border); margin: 1rem 0 0; }
.view-nav a { min-height: 52px; padding: .8rem 1.5rem; text-align: center; text-decoration: none; font-size: .94rem; font-weight: 650; border-bottom: 3px solid transparent; color: var(--muted); }
.view-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.view-heading { padding: 34px 0 26px; }
.view-heading h1 { margin: .4rem 0 .7rem; }
.eyebrow { color: var(--muted); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 720; }
.card .eyebrow { margin-bottom: .55rem; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.fine-print { color: var(--muted); font-size: .78rem; line-height: 1.6; margin-top: 1.2rem; }
.optional { color: var(--muted); font-weight: 400; }
.field-help { font-size: .79rem; line-height: 1.5; color: var(--muted); margin: .45rem 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 25px; min-width: 0; }
.card > h2 + p { margin-top: .6rem; }
.plan-card { background: #e9eedf; border-color: #d7dfc9; }
.saved-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: .9rem; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.13fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.stack { display: grid; gap: 22px; min-width: 0; }
.stack.compact { gap: 12px; }
.section-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .4rem 1rem; margin: 8px 0 14px; }
.occurrence { padding: 20px; }
.occurrence-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.occurrence .button-row { margin-top: 14px; }
.occurrence .timing { margin-top: .65rem; }
.occurrence .correction-note { margin-top: .6rem; }
.badge { display: inline-block; border-radius: 7px; background: #f0efe7; color: #615b3f; padding: .25rem .6rem; font-size: .74rem; font-weight: 650; flex-shrink: 0; }
.badge.done, .badge.accepted { color: #254c39; background: #e1eddf; }
.badge.skipped { color: #5b5365; background: #eee8f1; }
.badge.failed { color: var(--danger); background: var(--danger-bg); }
.badge.uncertain { color: var(--warning); background: var(--warning-bg); }
.history-item { border-top: 1px solid var(--border); padding-top: 16px; }
.history-item:first-child { margin-top: 1rem; }
.history-item .button-row { margin-top: .5rem; }
.history-item .button { font-size: .8rem; }
.history-item h3 { overflow-wrap: anywhere; }
.notice { background: var(--accent-light); color: var(--accent); border: 1px solid #cbd8c6; border-radius: 13px; padding: 14px 17px; margin: .8rem 0; font-size: .9rem; overflow-wrap: anywhere; }
.notice.warning { background: var(--warning-bg); color: var(--warning); border-color: #ead5ac; }
.notice.error { background: var(--danger-bg); color: var(--danger); border-color: #e5c2b7; }
.compact-notice { font-size: .83rem; }
.timezone-notice { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; }
.timezone-notice p { font-size: .85rem; margin-top: .25rem; }
.status-line { min-height: 1.4rem; color: var(--muted); font-size: .79rem; overflow-wrap: anywhere; }
.form-status { color: var(--muted); font-size: .8rem; margin-top: .7rem; min-height: 1.2rem; }
.form-status.error { color: var(--danger); }
.check-row { display: flex; align-items: start; gap: .75rem; min-height: 48px; margin: 0; padding: 12px 0; }
.check-row small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; margin-top: .2rem; }
.pause-row { margin-top: .9rem; padding: 14px; background: var(--accent-light); border-radius: 12px; }
.schedule-inputs { margin: 1.4rem 0 .8rem; }
.schedule-row { padding: 12px 0; border-top: 1px solid var(--border); }
.schedule-row .time-pair { gap: 12px; }
.schedule-row label:not(.check-row) { margin-top: .35rem; }
.time-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.quiet-section { padding-top: .4rem; border-top: 1px solid var(--border); }
.quiet-section .time-pair label { margin-top: .35rem; }
.connection-status { margin: 1.2rem 0; }
.connection-status > div { padding: 12px 0; border-top: 1px solid var(--border); }
.connection-status dt { font-size: .76rem; color: var(--muted); font-weight: 600; }
.connection-status dd { margin: .3rem 0 0; font-size: .87rem; line-height: 1.5; overflow-wrap: anywhere; }
.installation-help { margin-top: 1.2rem; border-top: 1px solid var(--border); }
.installation-help li { font-size: .83rem; }
.timing-list { list-style: none; padding: 0; margin: .8rem 0 0; }
.timing-list li { padding: .7rem 0; border-top: 1px solid var(--border); }
.timing-list strong { display: block; font-size: .86rem; }
.timing-list span { color: var(--muted); font-size: .82rem; }
.delivery-entry { border-top: 1px solid var(--border); padding-top: .9rem; }
.delivery-entry:first-child { margin-top: .8rem; }
.delivery-entry p { margin-top: .4rem; font-size: .8rem; color: var(--muted); }
.sign-in { max-width: 440px; margin: 50px auto 90px; padding: 34px; }
.sign-in h1 { margin: .6rem 0 1rem; }
.sign-in .primary { margin-top: 1.2rem; }
.site-footer { text-align: center; color: var(--muted); font-size: .73rem; padding: 40px 0 28px; }
dialog { width: min(460px, calc(100% - 32px)); border: 1px solid var(--border); border-radius: 22px; padding: 24px; color: var(--ink); background: var(--surface); max-height: calc(100dvh - 48px); overflow: auto; box-shadow: 0 24px 80px #102a3030; }
dialog::backdrop { background: #0c211c88; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: .5rem; }
#snooze-form .button { margin-top: .85rem; }
#snooze-dialog > .button-row { margin-top: 1.3rem; }
.notification-target { border-color: #4d795c; box-shadow: 0 0 0 3px #d3e4cb; }

@media (max-width: 760px) {
  .page-shell { padding: 0 17px; }
  .site-header { padding-top: max(17px, env(safe-area-inset-top)); gap: .3rem; }
  .header-actions .button { padding: .6rem .65rem; font-size: .8rem; }
  .brand-caption { font-size: .66rem; }
  .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
  .brand-mark::after { left: 9px; top: 10px; }
  .view-nav { position: fixed; z-index: 5; bottom: 0; left: 0; right: 0; margin: 0; padding: 5px max(12px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); background: #fafbf7; border-top: 1px solid var(--border); border-bottom: 0; box-shadow: 0 -5px 24px #20352f06; }
  .view-nav a { flex: 1; padding: .8rem .2rem; min-height: 50px; font-size: .88rem; border: 0; border-radius: 11px; }
  .view-nav a[aria-current="page"] { background: #e6eddc; }
  .view-heading { padding: 26px 0 22px; }
  .content-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .card { padding: 21px; border-radius: 17px; }
  .occurrence { padding: 18px; }
  .timezone-notice { display: block; }
  .timezone-notice .button-row { margin-top: .7rem; }
  .section-heading .small { font-size: .77rem; }
  .site-footer { padding-bottom: calc(95px + env(safe-area-inset-bottom)); }
  .sign-in { margin: 30px auto; padding: 25px; }
  .sign-in ~ .site-footer { padding-bottom: 24px; }
}

@media (prefers-reduced-motion: no-preference) {
  .button, .view-nav a { transition: background-color .12s ease; }
}

@media (forced-colors: active) {
  .button, .badge, .view-nav a[aria-current="page"] { border: 1px solid ButtonText; }
}
