:root {
  color-scheme: light;
  --paper: #f7f7f0;
  --surface: #fffefa;
  --ink: #142d26;
  --muted: #51645c;
  --line: #dbe3d7;
  --green: #183e32;
  --accent: #dcf2bd;
  --soft: #e9f1e4;
  --warn: #754515;
  --danger: #8d3835;
  --radius: 22px;
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid #366c51; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
a { color: var(--green); }
.shell { max-width: 670px; margin: auto; min-height: 100vh; padding-bottom: 104px; }
.masthead, main { padding-inline: clamp(16px, 5vw, 32px); }
.masthead { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { font-size: 1.5rem; font-weight: 750; letter-spacing: -.065em; display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: var(--green); border-radius: 12px; position: relative; }
.brand-mark::before, .brand-mark::after { content: ""; width: 17px; height: 7px; border-radius: 5px; background: var(--accent); position: absolute; transform: rotate(-42deg); }
.brand-mark::after { transform: rotate(48deg); }
.role, .badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; font-size: .76rem; font-weight: 650; border-radius: 999px; }
.role { background: var(--soft); color: var(--green); }
.today-header, .page-header { display: flex; align-items: end; justify-content: space-between; gap: 8px; margin: 9px 0 16px; }
.kicker { color: var(--muted); font-size: .84rem; }
h1 { font-size: clamp(2.15rem, 10vw, 3.2rem); line-height: 1.00; letter-spacing: -.078em; font-weight: 760; }
.today-header h1 { margin-top: 5px; }
h2 { font-size: 1.38rem; letter-spacing: -.045em; line-height: 1.17; }
h3 { font-size: 1.04rem; line-height: 1.25; overflow-wrap: anywhere; }
.pager { position: relative; display: flex; gap: 6px; }
.icon-button { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; min-height: 48px; min-width: 48px; font-size: 1.4rem; line-height: 1; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(3px, 1.3vw, 8px); margin: 8px 0 18px; }
.day { min-width: 0; min-height: 60px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 6px 0; display: grid; place-content: center; gap: 1px; text-align: center; }
.day span { font-size: .72rem; text-transform: capitalize; color: var(--muted); }
.day strong { font-size: 1.03rem; font-variant-numeric: tabular-nums; }
.day[aria-pressed=true] { background: var(--green); border-color: var(--green); color: white; }
.day[aria-pressed=true] span { color: var(--accent); }
.progress-card { background: radial-gradient(ellipse at 100% 2%, #37654c, transparent 64%), var(--green); border-radius: var(--radius); padding: 18px 19px; display: flex; align-items: center; justify-content: space-between; gap: 13px; color: white; }
.progress-card p { color: #d5e6d9; font-size: .83rem; }
.progress-card h2 { font-size: 1.68rem; margin-block: 3px; }
.progress-ring { --turn: 0%; min-width: 64px; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; isolation: isolate; position: relative; background: conic-gradient(var(--accent) var(--turn), #ffffff38 0); color: white; font-size: .89rem; font-weight: 750; }
.progress-ring::before { content: ""; position: absolute; inset: 5px; background: #2d5845; border-radius: 50%; z-index: -1; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 24px 0 11px; }
.section-title span { color: var(--muted); font-size: .82rem; text-align: end; }
.cards { display: grid; gap: 9px; }
.card { padding: 13px 14px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); min-width: 0; }
.event { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: start; }
.slot { display: grid; place-items: center; min-height: 49px; border-radius: 13px; background: var(--soft); font-weight: 720; font-variant-numeric: tabular-nums; font-size: .96rem; }
.event-body, .event-content { min-width: 0; }
.event-body p, .card .course-data { color: var(--muted); font-size: .88rem; margin-top: 4px; overflow-wrap: anywhere; }
.event-body .badge { margin-top: 7px; background: #edf0e9; color: var(--muted); }
.badge[data-state="confirmed"], .badge[data-state="reported"] { background: #e6f1d9; color: #345226; }
.badge[data-state="missing"], .badge[data-state="pending"] { background: #f7ecd3; color: var(--warn); }
.badge[data-state="rejected"] { background: #f6e8e4; color: var(--danger); }
.card .button { margin-top: 8px; }
.course-top { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.course-top p { color: var(--muted); font-size: .81rem; }
.course-top h3 { margin-top: 3px; }
.empty { padding: 22px 18px; border: 1px dashed #a9b8aa; border-radius: var(--radius); margin: 10px 0; }
.empty p, .form-intro, .hint, .subtext { color: var(--muted); margin-top: 7px; }
.empty h1 { font-size: 1.85rem; letter-spacing: -.055em; }
.notice, .demo { margin-bottom: 12px; border-radius: 13px; padding: 9px 12px; background: var(--soft); font-size: .86rem; }
.notice[data-error=true], .form-error { color: #732522; background: #f6e8e4; }
.demo { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.demo select { width: auto; color: var(--green); }
.button { display: inline-flex; justify-content: center; align-items: center; text-align: center; gap: 4px; min-height: 48px; border: 1px solid transparent; border-radius: 13px; padding: 8px 14px; font-size: .86rem; font-weight: 670; }
.button.primary { color: white; background: var(--green); }
.button.secondary { color: var(--green); background: var(--soft); }
.button.danger { color: white; background: var(--danger); }
.button.text { background: transparent; color: var(--green); padding-inline: 5px; }
.full { width: 100%; }
.button + .button { margin-inline-start: 5px; }
.stack { display: grid; gap: 8px; margin-top: 12px; }
.stack .button { margin: 0; }
#nav { position: fixed; bottom: 0; left: 50%; translate: -50% 0; width: min(100%, 670px); padding: 7px 14px max(9px, env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; z-index: 1; }
#nav button { background: transparent; min-height: 53px; border: 0; border-radius: 12px; font-size: .76rem; font-weight: 650; color: var(--muted); display: grid; place-content: center; justify-items: center; gap: 5px; }
#nav button[aria-current] { background: var(--soft); color: var(--green); }
.nav-icon { position: relative; display: block; width: 17px; height: 16px; border: 1.6px solid currentColor; border-radius: 4px; }
.calendar-icon::after, .list-icon::after, .family-icon::after { content: ""; position: absolute; }
.calendar-icon::after { inset: 3px 0 auto; border-top: 1.6px solid; }
.list-icon::after { inset: 3px 3px auto; height: 5px; border-block: 1.5px solid; }
.family-icon { border: 0; }
.family-icon::before { content: ""; position: absolute; top: 0; left: 5px; width: 7px; height: 7px; border: 1.5px solid; border-radius: 50%; }
.family-icon::after { inset: auto 1px 0; height: 8px; border: 1.5px solid; border-radius: 7px 7px 3px 3px; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); width: min(calc(100% - 28px), 510px); max-height: min(88vh, 760px); padding: 19px; scroll-padding-block: 18px; }
dialog::backdrop { background: #172b2477; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-heading .close { min-height: 48px; }
.form-fields { display: grid; margin-top: 13px; }
.form-fields label, legend, #join-form label { display: block; margin: 10px 0 4px; font-size: .84rem; font-weight: 650; }
.form-fields .hint { font-size: .79rem; margin: 0 0 5px; }
input, select { display: block; width: 100%; min-width: 0; min-height: 48px; font-size: max(1rem, 1em); background: #fff; color: var(--ink); border: 1px solid #899b90; border-radius: 11px; padding: 7px 9px; }
input:user-invalid, select:user-invalid { border-color: var(--danger); }
.form-cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 8px; }
fieldset { min-inline-size: 0; border: 0; padding: 0; margin: 10px 0 0; }
legend { margin: 0; padding: 0; }
.time-row { display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 7px; margin-bottom: 5px; }
.time-row:only-child { grid-template-columns: minmax(0, 1fr); }
.form-error { padding: 10px; border-radius: 9px; margin-top: 10px; font-size: .86rem; }
form .full { margin-top: 14px; }
.confirm-buttons { margin-top: 12px; display: flex; justify-content: end; }
#confirm-description { color: var(--muted); margin-top: 7px; }
.invite-link { display: block; overflow-wrap: anywhere; margin: 8px 0; }
.invite-code { display: block; letter-spacing: .04em; overflow-wrap: anywhere; }
.visually-hidden { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
@media (max-width: 350px) { .event { grid-template-columns: 49px minmax(0, 1fr); gap: 8px; } .day { min-height: 54px; } }
