:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #23332c;
  background: #f6f5ef;
  --line: #e4e6dc;
  --green: #245641;
  --muted: #59665d;
}
* { box-sizing: border-box; }
body { margin: 0; }
header, main { max-width: 1050px; margin: auto; padding-inline: clamp(16px, 4vw, 40px); }
header { display: flex; justify-content: space-between; align-items: center; padding-top: max(20px, env(safe-area-inset-top)); padding-bottom: 24px; }
.brand { font-weight: 750; letter-spacing: -.025em; font-size: 19px; }
button, input, textarea { font: inherit; }
button { min-height: 44px; cursor: pointer; border: 1px solid var(--line); background: white; color: inherit; border-radius: 12px; padding: 8px 14px; }
button:hover { border-color: var(--green); }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid #347855; outline-offset: 2px; }
main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; padding-bottom: 32px; align-items: start; }
.calendar, .agenda { background: white; border: 1px solid var(--line); border-radius: 22px; padding: clamp(14px, 3vw, 25px); }
.month-bar, .agenda-top, .dialog-top, .actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
h1, h2 { margin: 0; font-family: Georgia, serif; font-weight: 500; line-height: 1.1; }
h1 { font-size: clamp(25px, 4vw, 40px); }
h2 { font-size: 27px; }
.month-bar nav { display: flex; gap: 5px; }
.month-bar button, #close { width: 44px; padding: 0; font-size: 25px; }
.week, #days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.week { text-align: center; margin: 22px 0 7px; color: var(--muted); font-size: 13px; }
.day { border-color: transparent; padding: 0; height: clamp(47px, 7vw, 69px); display: grid; grid-template-rows: 1fr 10px 6px; justify-items: center; align-items: center; }
.day.outside { color: #657369; }
.day.today { border-color: #9eb4a3; }
.day[aria-pressed=true], .primary { color: white; background: var(--green); border-color: var(--green); }
.dots { display: flex; gap: 3px; }
.dot { width: 6px; height: 6px; border-radius: 100%; background: var(--event-color); }
.day[aria-pressed=true] .dot { outline: 1px solid white; }
#day-label { color: var(--muted); font-size: 14px; margin: 0 0 4px; }
.primary { font-weight: 650; white-space: nowrap; }
.primary:hover { background: #194533; }
#events { margin-top: 20px; }
.empty { color: var(--muted); margin: 0; padding: 22px 0; border-top: 1px solid var(--line); }
.event { display: grid; width: 100%; text-align: left; gap: 4px; margin: 8px 0; border-inline-start: 4px solid var(--event-color); overflow-wrap: anywhere; }
.event small, .event span { color: var(--muted); }
dialog { width: min(440px, calc(100% - 24px)); max-height: 90dvh; border: 1px solid var(--line); border-radius: 20px; padding: 22px; color: inherit; }
dialog::backdrop { background: #182b2280; }
form { display: grid; gap: 14px; }
label { display: grid; gap: 5px; font-size: 14px; color: var(--muted); min-width: 0; }
input, textarea { padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; color: #23332c; min-height: 44px; width: 100%; min-width: 0; font-size: 16px; }
.fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.actions { justify-content: flex-end; }
.danger, #error { color: #a12828; }
#error { margin: 0; }
#error:empty { display: none; }
@media (max-width: 700px) { main { grid-template-columns: minmax(0, 1fr); gap: 12px; } }
