:root {
  color-scheme: light;
  --sand: #f2ece2;
  --paper: #fffdf7;
  --ink: #292e2a;
  --lagoon: #20564d;
  --muted: #515b52;
  --edge: #d8cfc0;
  --input-edge: #807a6f;
  --warn: #8a3e24;
  --body: system-ui, sans-serif;
  --display: Georgia, serif;
  --small: clamp(.875rem, .82rem + .2vw, 1rem);
  --base: clamp(1rem, .96rem + .2vw, 1.125rem);
  --heading: clamp(1.7rem, 1.4rem + 1vw, 2.25rem);
  --subhead: clamp(1.25rem, 1.1rem + .45vw, 1.5rem);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--sand); color: var(--ink); font: var(--base)/1.5 var(--body); }
.wrap { width: min(100% - 2rem, 45rem); margin: auto; }
header { border-bottom: 1px solid var(--edge); }
.brand { min-height: 3.5rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 1rem; color: var(--lagoon); font-weight: 700; }
.brand span { color: var(--muted); font-size: var(--small); font-weight: 500; }
main { padding: clamp(1.25rem, 4vw, 2.5rem) 0 2rem; }
.skip { position: absolute; top: .5rem; left: .5rem; padding: .75rem; background: var(--paper); color: var(--lagoon); z-index: 1; }
.skip:not(:focus) { clip-path: inset(50%); }
:focus-visible { outline: 2px solid var(--lagoon); outline-offset: 3px; }
h1, h2, h3 { margin: 0; font: var(--subhead)/1.2 var(--display); }
h1 { font-size: var(--heading); }
.intro p { margin: .35rem 0 1.25rem; color: var(--muted); }
.sheet { padding: clamp(1rem, 4vw, 1.5rem); background: var(--paper); border: 1px solid var(--edge); border-radius: .6rem; }
.transfer { margin-bottom: .75rem; }
.featured-idea { margin-bottom: .75rem; background: #e8efe5; border-color: #bdcbbd; overflow-wrap: anywhere; }
.featured-idea p { margin: .35rem 0 0; }
.planner-link { min-height: 44px; display: inline-flex; align-items: center; color: var(--lagoon); font-weight: 750; overflow-wrap: anywhere; }
.transfer .actions { margin-top: .75rem; }
.filename { font-weight: 650; overflow-wrap: anywhere; }
.fields { display: grid; gap: .75rem; margin-top: 1rem; }
.block-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wide { grid-column: 1 / -1; }
label { display: grid; min-width: 0; gap: .25rem; font-size: var(--small); font-weight: 700; }
label span { display: inline; color: var(--muted); font-weight: 400; }
input, select, textarea { min-width: 0; width: 100%; min-height: 44px; padding: .45rem .625rem; border: 1px solid var(--input-edge); border-radius: .35rem; color: var(--ink); background: var(--paper); font: var(--base)/1.4 var(--body); }
textarea { resize: vertical; }
select { text-overflow: ellipsis; }
button { min-height: 44px; max-width: 100%; padding: .5rem .85rem; border: 1px solid var(--lagoon); border-radius: .4rem; background: var(--lagoon); color: var(--paper); font: 700 var(--small)/1.25 var(--body); cursor: pointer; overflow-wrap: anywhere; }
button:hover { background: #18453d; }
button:disabled { opacity: .6; cursor: default; }
button.quiet { background: transparent; color: var(--lagoon); border-color: var(--input-edge); }
button.quiet:hover { background: var(--sand); }
button.danger { background: var(--warn); border-color: var(--warn); }
.work { margin-top: 1.5rem; }
.section-head, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.section-head { justify-content: space-between; }
.hint, .feedback, .problem, .empty { margin: .6rem 0 0; font-size: var(--small); color: var(--muted); }
.week-help { margin: -.45rem 0 0; }
.feedback { color: var(--lagoon); font-weight: 650; }
.problem { color: var(--warn); font-weight: 650; }
.feedback:empty, .problem:empty { margin: 0; }
.work-hint { margin-bottom: .75rem; }
form .actions { margin-top: .85rem; }
.empty { padding: 1rem; border: 1px dashed var(--input-edge); border-radius: .5rem; }
ul { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: .75rem; }
.block { overflow-wrap: anywhere; }
.block .when { margin: .45rem 0 .75rem; }
.extras { margin: 0 0 1rem; }
.extras dt { margin-top: .5rem; color: var(--muted); font-size: var(--small); font-weight: 700; }
.extras dd { margin: 0; white-space: pre-wrap; }
.remove-confirm { margin-top: .75rem; border-top: 1px solid var(--edge); }
dialog { width: min(100% - 2rem, 29rem); max-height: calc(100% - 2rem); border: 1px solid var(--edge); border-radius: .6rem; padding: clamp(1rem, 5vw, 1.5rem); background: var(--paper); color: var(--ink); }
dialog::backdrop { background: #292e2a80; }
.calendar-jump { display: inline-flex; align-items: center; min-height: 44px; color: var(--lagoon); font-weight: 700; margin: -.75rem 0 .75rem; }
.month-calendar { margin-top: .75rem; }
.month-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .65rem; }
.month-name { margin: 1rem 0 .5rem; color: var(--lagoon); }
.month-grid, .month-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-grid { border: 1px solid var(--edge); border-radius: .4rem; }
.month-days { grid-column: 1 / -1; }
.month-weekday { text-align: center; padding: .45rem 0; color: var(--muted); font-size: .8rem; font-weight: 700; }
.month-gap, button.month-day { border: 0; border-radius: 0; box-shadow: inset 0 1px var(--edge), inset -1px 0 var(--edge); }
.month-gap { background: #f7f2ea; }
.month-gap:nth-child(7n), button.month-day:nth-child(7n) { box-shadow: inset 0 1px var(--edge); }
button.month-day { display: grid; align-content: start; gap: .25rem; min-height: 68px; padding: .45rem; text-align: left; background: var(--paper); color: var(--ink); }
button.month-day:hover { background: var(--sand); }
button.month-day[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--lagoon); background: #e7f1eb; }
button.month-day:focus-visible { outline-offset: -3px; }
.month-day-top { display: flex; align-items: center; gap: .25rem; justify-content: space-between; min-width: 0; }
.month-number { line-height: 1.2; }
.month-day[aria-current="date"] .month-number { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.month-markers { display: flex; flex-wrap: wrap; justify-content: end; gap: .12rem; min-width: 0; }
.month-count, .month-target-count { color: var(--lagoon); background: #e2eee7; border-radius: .25rem; padding: .05rem .22rem; font-size: .74rem; min-width: 1rem; text-align: center; font-weight: 750; }
.month-target-count { background: #f5e8d6; color: #69471f; border: 1px dashed currentColor; }
.month-legend { display: flex; flex-wrap: wrap; gap: .25rem .8rem; }
.month-target-item { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .6rem; padding: .25rem .55rem; background: #faf3e6; border: 1px dashed #a17f58; border-radius: .35rem; overflow-wrap: anywhere; }
#month-targets-heading { margin: .75rem 0 0; font-size: var(--small); }
.month-preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--lagoon); font-size: .75rem; font-weight: 600; }
.month-agenda { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--edge); }
.month-agenda ul { margin-top: .5rem; gap: .35rem; }
.month-agenda ul:empty { margin: 0; }
.month-agenda li button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .5rem; text-align: left; }
.month-agenda li small { color: var(--muted); font-weight: 500; display: block; margin-top: .2rem; }
#month-add { margin-top: .7rem; }
.month-screen-reader { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 560px) {
  .month-calendar { margin-inline: -.875rem; padding: .8rem .125rem; }
  .month-header, .month-name, .month-agenda, .month-calendar > .hint { margin-inline: .65rem; }
  button.month-day { min-height: 52px; padding: .35rem .1rem; }
  .month-day-top { flex-direction: column; gap: .15rem; justify-content: flex-start; }
  .month-markers { justify-content: center; }
  .month-markers > span { font-size: .64rem; padding-inline: .1rem; }
  .month-preview { display: none; }
}
@media (max-width: 520px) {
  .block-fields { grid-template-columns: minmax(0, 1fr); }
  .block [data-action="calendar"] { flex-basis: 100%; }
}
