:root {
  --bg: #fffaf2;
  --surface: #ffffff;
  --ink: #2d2a32;
  --muted: #6b6573;
  --line: #eadfce;
  --accent: #e8743b;
  --accent-ink: #ffffff;
  --sun: #f6c445;
  --sky: #7cc4e4;
  --leaf: #8fcb8a;
  --ok-bg: #e7f6e5;
  --ok-ink: #24622a;
  --err-bg: #fde8e4;
  --err-ink: #9a2d17;
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1b22;
    --surface: #27242d;
    --ink: #f3eee8;
    --muted: #b3acbb;
    --line: #3a3642;
    --accent: #f08a55;
    --accent-ink: #1d1b22;
    --ok-bg: #1f3a22;
    --ok-ink: #a9e3a4;
    --err-bg: #452019;
    --err-ink: #ffb9a8;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 "Commissioner", system-ui, sans-serif;
}
h1, h2, h3, .brand { font-family: "Comfortaa", "Commissioner", sans-serif; }
a { color: var(--accent); }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  max-width: 1100px; margin: 0 auto; padding: 18px 20px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; line-height: 1.15; }
.brand small { display: block; font-family: "Commissioner", sans-serif; font-weight: 500; font-size: .8rem; color: var(--muted); }
.sun { font-size: 2rem; }
nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
nav a:hover { color: var(--accent); }
nav .pill { background: var(--accent); color: var(--accent-ink); padding: 6px 14px; border-radius: 999px; }
nav .pill:hover { color: var(--accent-ink); filter: brightness(1.05); }

main { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

.hero {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center;
  padding: 40px 0 56px;
}
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 600; color: var(--accent); margin: 0 0 8px; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.1; margin: 0 0 16px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.lead strong { color: var(--ink); }

.hero-art { position: relative; aspect-ratio: 1; max-width: 420px; justify-self: center; width: 100%; }
.blob { position: absolute; border-radius: 50%; opacity: .9; }
.b1 { width: 58%; height: 58%; left: 4%; top: 6%; background: var(--sun); }
.b2 { width: 48%; height: 48%; right: 2%; top: 30%; background: var(--sky); }
.b3 { width: 44%; height: 44%; left: 22%; bottom: 0; background: var(--leaf); }
.num { position: absolute; font: 700 clamp(2.4rem, 6vw, 3.6rem) "Comfortaa", sans-serif; color: #2d2a32; }
.n16 { left: 20%; top: 22%; }
.n21 { right: 14%; top: 44%; }
.n37 { left: 36%; bottom: 12%; }

.button {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  background: var(--accent); color: var(--accent-ink);
  font: 600 1rem "Commissioner", sans-serif; padding: 13px 24px; border-radius: 999px;
  transition: transform .15s, filter .15s;
}
.button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.button:disabled { opacity: .6; cursor: wait; transform: none; }
.button.ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }

.band { padding: 48px 0; border-top: 1px solid var(--line); }
.band h2 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); margin: 0 0 12px; }
.band > p { max-width: 42em; color: var(--muted); }

.cards { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.cards li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.cards span { font-size: 1.8rem; }
.cards h3 { margin: 8px 0 4px; font-size: 1.1rem; }
.cards p { margin: 0; color: var(--muted); font-size: .95rem; }

.schools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }
.school { border-radius: var(--radius); padding: 26px 20px; text-align: center; font-weight: 600; color: #2d2a32; }
.school span { display: block; font: 700 3rem/1 "Comfortaa", sans-serif; margin-bottom: 6px; }
.school sup { font-size: .45em; }
.s16 { background: var(--sun); }
.s21 { background: var(--sky); }
.s37 { background: var(--leaf); }

.signup { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.ticks { padding: 0; list-style: none; }
.ticks li { padding-left: 30px; position: relative; margin: 6px 0; }
.ticks li::before { content: "✓"; position: absolute; left: 4px; color: var(--accent); font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

.card-form {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; display: grid; gap: 16px; box-shadow: 0 10px 30px -18px rgba(0,0,0,.25);
}
.card-form label { display: grid; gap: 6px; font-weight: 500; }
.opt { color: var(--muted); font-weight: 400; font-size: .9rem; }
input[type=email], input[name=name], .inline-form input {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 14px; width: 100%;
}
input:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
legend { font-weight: 500; margin-bottom: 6px; }
.card-form label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--accent); flex: none; }
.consent { font-size: .93rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }

.notice { border-radius: 12px; padding: 12px 14px; font-weight: 500; }
.notice.ok { background: var(--ok-bg); color: var(--ok-ink); }
.notice.err { background: var(--err-bg); color: var(--err-ink); }

.narrow { max-width: 640px; }
.center { text-align: center; margin: 0 auto; }
details summary { cursor: pointer; font-weight: 500; color: var(--muted); }
.inline-form { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.inline-form input { flex: 1 1 220px; }

footer { max-width: 1100px; margin: 40px auto 0; padding: 28px 20px 40px; border-top: 1px solid var(--line); text-align: center; }
footer p { margin: 4px 0; }

@media (max-width: 800px) {
  .hero, .signup { grid-template-columns: 1fr; }
  .hero { padding-top: 16px; }
  .hero-art { max-width: 280px; order: -1; }
  .schools { grid-template-columns: 1fr; }
  nav { gap: 12px; font-size: .95rem; }
}

/* ---------- shared bits for the app pages ---------- */
:root { --k-playdate: #f6c445; --k-puppets: #f29bb4; --k-activity: #8fcb8a; --k-workshop: #b8a3e8; --k-outing: #7cc4e4; --k-party: #f4a261; --k-meeting: #c9b79c; --k-other: #cfc8d6; --info-bg: #e6f1fb; --info-ink: #1d4f7a; --danger: #c2412d; }
@media (prefers-color-scheme: dark) { :root { --info-bg: #1b3247; --info-ink: #a9d1f5; --danger: #f07a63; } }
.k-playdate { --k: var(--k-playdate); } .k-puppets { --k: var(--k-puppets); } .k-activity { --k: var(--k-activity); }
.k-workshop { --k: var(--k-workshop); } .k-outing { --k: var(--k-outing); } .k-party { --k: var(--k-party); }
.k-meeting { --k: var(--k-meeting); } .k-other { --k: var(--k-other); }

.notice.info { background: var(--info-bg); color: var(--info-ink); }
.small-btn { padding: 8px 16px; font-size: .92rem; }
.button.danger { background: var(--danger); color: #fff; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
nav .link-btn { color: var(--ink); text-decoration: none; font-weight: 500; }
.badge { display: inline-block; background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: .75rem; padding: 1px 8px; vertical-align: middle; font-family: "Commissioner", sans-serif; }
.badge:empty { display: none; }
.narrow-main { max-width: 680px; }
.narrow-main h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin: 20px 0 12px; }
.center-text { text-align: center; justify-items: center; }
.lead-sm { font-size: 1.05rem; }
.crumb { margin: 8px 0 18px; }
.crumb a { text-decoration: none; font-weight: 500; }
select, textarea, input[type=tel], input[type=number], input[type=datetime-local], input[type=text], .card-form input:not([type=checkbox]):not([type=file]) {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 14px; width: 100%;
}
textarea { resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-weight: 600; color: var(--muted); font-size: .85rem; }
.table tr.muted td { color: var(--muted); }

/* ---------- calendar ---------- */
.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal-head h2 { margin: 0; }
.calendar { margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.cal-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-bar h3 { margin: 0; font-size: 1.3rem; }
.cal-nav { width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.cal-nav:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.cal-nav:disabled { opacity: .3; cursor: default; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-week span { text-align: center; font-size: .8rem; font-weight: 600; color: var(--muted); padding: 4px 0; }
.cal-day { min-height: 92px; border-radius: 10px; background: var(--bg); padding: 5px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.out { opacity: .4; }
.cal-day.past .cal-num { color: var(--muted); }
.cal-num { font-size: .82rem; font-weight: 600; }
.cal-day.today .cal-num { background: var(--accent); color: var(--accent-ink); border-radius: 999px; width: 24px; height: 24px; display: grid; place-items: center; }
.cal-chip { display: block; font-size: .76rem; line-height: 1.25; text-decoration: none; color: #2d2a32; background: var(--k); border-radius: 6px; padding: 3px 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip:hover { filter: brightness(1.05); }
.cal-dots { display: none; gap: 3px; flex-wrap: wrap; }
.cal-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--k); }
.cal-list { display: grid; gap: 12px; margin-top: 18px; }
.ev-card { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; text-decoration: none; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.ev-card:hover { border-color: var(--accent); }
.ev-card.past { opacity: .6; }
.ev-card img, .ev-ph { width: 96px; height: 96px; border-radius: 10px; object-fit: cover; }
.ev-ph { display: block; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.5) 0 18%, transparent 19%), var(--k); }
.ev-ph.big { width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: var(--radius); }
.ev-body { display: grid; gap: 2px; min-width: 0; }
.ev-body strong { font-size: 1.05rem; }
.ev-kind { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; color: var(--accent); }
.calendar .ev-card { background: var(--surface); }

/* ---------- event page ---------- */
.event { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 32px; align-items: start; }
.event-media img { width: 100%; border-radius: var(--radius); display: block; }
.event h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 14px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 18px; }
.facts dt { color: var(--muted); font-weight: 500; }
.facts dd { margin: 0; font-weight: 500; }
.desc { white-space: pre-wrap; }
.img-preview img { max-width: 100%; max-height: 260px; border-radius: 12px; display: block; margin-bottom: 8px; }

/* ---------- sign in ---------- */
.dev-login { display: flex; gap: 8px; margin-top: 16px; }
.dev-login input { flex: 1; font: inherit; padding: 8px 12px; border-radius: 10px; border: 1.5px dashed var(--line); background: var(--bg); color: var(--ink); }

/* ---------- admin ---------- */
.user-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.user-card { display: grid; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.user-card .row-actions { margin-top: 8px; }

@media (max-width: 800px) {
  .event { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr; }
  .calendar { padding: 12px; }
  .cal-day { min-height: 46px; align-items: center; padding: 4px 2px; }
  .cal-chip { display: none; }
  .cal-dots { display: flex; justify-content: center; }
  .ev-card { grid-template-columns: 72px 1fr; }
  .ev-card img, .ev-ph { width: 72px; height: 72px; }
}

/* Label text and its "(optional)" note stay on one line; the field goes below. */
.card-form label:not(.check) { display: block; }
.card-form label:not(.check) > :is(input, select, textarea) { display: block; margin-top: 6px; }

/* ---------- date + time fields and the clock picker ---------- */
.three { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 14px; }
.time-field { display: flex; gap: 6px; margin-top: 6px; }
.time-field input { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; }
.clock-btn {
  flex: none; width: 46px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg);
  color: var(--accent); cursor: pointer; display: grid; place-items: center;
}
.clock-btn:hover { border-color: var(--accent); }

.tp-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(20, 16, 24, .45); display: grid; place-items: center; padding: 16px; }
.tp { background: var(--surface); color: var(--ink); border-radius: 22px; padding: 18px 18px 14px; width: min(320px, 100%); box-shadow: 0 20px 60px -20px rgba(0,0,0,.5); display: grid; justify-items: center; gap: 4px; }
.tp-head { display: flex; align-items: center; gap: 4px; font: 700 2.6rem/1 "Comfortaa", sans-serif; }
.tp-part { font: inherit; color: var(--muted); background: var(--bg); border: 0; border-radius: 12px; padding: 6px 10px; cursor: pointer; font-variant-numeric: tabular-nums; }
.tp-part.on { color: var(--accent-ink); background: var(--accent); }
.tp-hint { margin: 2px 0 6px; color: var(--muted); font-size: .9rem; }
.tp-dial { width: 100%; max-width: 260px; height: auto; touch-action: none; cursor: pointer; user-select: none; }
.tp-face { fill: var(--bg); }
.tp-hand { stroke: var(--accent); stroke-width: 2; }
.tp-pin, .tp-sel { fill: var(--accent); }
.tp-num { fill: var(--ink); font: 500 15px "Commissioner", sans-serif; pointer-events: none; }
.tp-num.small { font-size: 12px; fill: var(--muted); }
.tp-num.on { fill: var(--accent-ink); font-weight: 700; }
.tp-actions { display: flex; gap: 10px; justify-self: end; margin-top: 8px; }

@media (max-width: 800px) {
  .three { grid-template-columns: 1fr 1fr; }
  .three > :first-child { grid-column: 1 / -1; }
}

/* Quick date buttons under the date field */
.quick-dates { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  font: 500 .85rem "Commissioner", sans-serif; color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 999px; padding: 5px 10px; cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.three { align-items: start; }
@media (min-width: 801px) {
  .three { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr); }
}

/* A card whose title link makes the whole card clickable */
.cards .card-link { position: relative; transition: border-color .15s, transform .15s; }
.cards .card-link:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-link h3 a { color: inherit; text-decoration: none; }
.card-link h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card-link h3 a:focus-visible { outline: none; }
.cards .card-link:has(a:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.card-link .arrow { font-size: 1rem; color: var(--accent); }
.cards .card-link .arrow { font-size: 1rem; }

/* ---------- clickable days and pending events ---------- */
.cal-hint { margin-top: -6px; }
.cal-day { position: relative; }
.cal-day { cursor: pointer; }
#guest h2, #guest-sent h2 { font-size: 1.35rem; margin: 0; }
.cal-day:hover { outline: 1.5px solid var(--line); outline-offset: -1.5px; }
.cal-day.selected, .cal-day:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-day.selected { background: var(--surface); }
.cal-daypanel {
  margin-top: 10px; border: 1.5px solid var(--accent); border-radius: 12px; background: var(--bg);
  padding: 10px 12px; display: grid; gap: 8px;
}
.cal-daypanel[hidden] { display: none; }
.cal-dp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-dp-head strong { font-size: 1rem; }
.cal-dp-close {
  width: 32px; height: 32px; flex: none; border-radius: 50%; border: 0; background: transparent; color: var(--muted);
  font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.cal-dp-close:hover { color: var(--ink); background: var(--surface); }
.cal-dp-ev {
  display: flex; gap: 8px; align-items: baseline; text-decoration: none; color: #2d2a32; background: var(--k);
  border-radius: 8px; padding: 8px 10px; font-size: .92rem; min-width: 0;
}
.cal-dp-ev span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-dp-ev.pending { background: transparent; color: var(--ink); border: 1.5px dashed var(--k); }
.cal-daypanel p { margin: 0; }
.cal-dp-add { justify-self: start; }
.cal-chip.pending { background: transparent; color: var(--ink); border: 1.5px dashed var(--k); }
.cal-dots i.pending { background: transparent; box-shadow: inset 0 0 0 1.5px var(--k); }
.ev-card.pending { border-style: dashed; }
.pending-badge {
  justify-self: start; font-size: .75rem; font-weight: 600; color: var(--info-ink); background: var(--info-bg);
  border-radius: 999px; padding: 2px 10px;
}
.pending-box { margin-bottom: 18px; }
.user-card .pending-badge { margin-top: 4px; }
.invite-banner { margin: 8px 0 18px; }
.invite-banner a { color: inherit; font-weight: 700; }
.qr-thumb { width: 64px; height: 64px; background: #fff; border-radius: 6px; padding: 3px; display: block; }
#invite-form { margin: 14px 0 6px; }

/* ---------- events + parents' messages side by side ---------- */
.events-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 20px; }
.events-layout .calendar { margin-top: 0; }
.posts-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; }
.posts-panel h3 { margin: 0; font-size: 1.2rem; }
.post-form { display: grid; gap: 8px; }
.post-form textarea, .post textarea {
  font: inherit; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 10px 12px; width: 100%; resize: vertical;
}
.post-form-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.posts { display: grid; gap: 10px; max-height: 820px; overflow-y: auto; }
.post { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: grid; gap: 6px; font-size: .95rem; }
.post.pending { border-style: dashed; }
.post header { display: flex; flex-wrap: wrap; gap: 0 6px; align-items: baseline; font-size: .88rem; }
.post header time { margin-left: auto; font-size: .8rem; }
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.post-actions { display: flex; gap: 12px; font-size: .85rem; }
#posts-more { justify-self: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 900px) {
  .events-layout { grid-template-columns: 1fr; }
  .posts { max-height: none; }
}

/* ---------- events list as its own panel ----------
   Desktop: calendar on the left; on the right the month's events, then the
   parents' messages. Phones: events first, then the calendar, then messages. */
.events-layout {
  grid-template-areas: "cal events" "cal posts";
  grid-template-rows: auto 1fr;
}
.events-layout > #calendar { grid-area: cal; }
.events-layout > .events-panel { grid-area: events; }
.events-layout > #minimata { grid-area: posts; align-self: start; }
.events-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; }
.events-panel h3 { margin: 0; font-size: 1.2rem; }
.events-panel .cal-list { margin-top: 0; gap: 10px; max-height: 520px; overflow-y: auto; }
.events-panel .ev-card { grid-template-columns: 64px 1fr; gap: 10px; padding: 8px; }
.events-panel .ev-card img, .events-panel .ev-ph { width: 64px; height: 64px; }
.events-panel .ev-body strong { font-size: 1rem; }
.events-panel .cal-list > p { margin: 0; }
@media (max-width: 900px) {
  .events-layout { grid-template-areas: "events" "cal" "posts"; grid-template-rows: auto; }
  .events-panel .cal-list { max-height: none; }
}

/* ---------- languages ---------- */
body { font-family: "Commissioner", "Noto Sans Arabic", system-ui, sans-serif; }
h1, h2, h3, .brand { font-family: "Comfortaa", "Commissioner", "Noto Sans Arabic", sans-serif; }
:lang(ar) h1, :lang(ar) h2, :lang(ar) h3, :lang(ar) .brand { font-family: "Noto Sans Arabic", "Commissioner", sans-serif; }
.lang-select, .lang-pref {
  font: 500 .9rem "Commissioner", "Noto Sans Arabic", sans-serif; color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 999px; padding: 5px 10px; cursor: pointer;
}
.lang-pref { font-size: 1rem; padding: 9px 14px; border-radius: 12px; }

/* Right-to-left (Arabic): mirror what points somewhere, keep times/phones/emails left-to-right. */
.post header time { margin-left: 0; margin-inline-start: auto; }
.ticks li { padding-left: 0; padding-inline-start: 30px; }
.ticks li::before { left: auto; inset-inline-start: 4px; }
[dir="rtl"] .cal-nav, [dir="rtl"] .arrow { display: inline-block; transform: scaleX(-1); }
.tp-head, .time-field input, input[type=tel], input[type=email], input[type=date] { direction: ltr; }
[dir="rtl"] .time-field input, [dir="rtl"] input[type=tel], [dir="rtl"] input[type=email] { text-align: right; }

/* ---------- calendar export ---------- */
.add-cal { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin: 0 0 16px; }
.add-cal .chip, .subscribe .chip { text-decoration: none; display: inline-block; }
.subscribe { border-top: 1px solid var(--line); padding-top: 10px; }
.subscribe summary { cursor: pointer; font-weight: 600; }
.subscribe .row-actions { margin-top: 8px; gap: 6px; }
.subscribe p { margin: 8px 0 0; }

/* Anti-spam field: hidden without pushing it off-screen (which broke right-to-left pages). */
.hp { position: absolute; left: auto; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }
.card-form input.hp, input.hp { width: 1px !important; height: 1px !important; padding: 0 !important; border: 0 !important; margin: 0 !important; inset-inline-start: 0; }

/* ---------- language choice with flags ---------- */
.flag { width: 24px; height: 18px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.15); flex: none; }
.lang-choice {
  display: inline-flex; align-items: center; gap: 10px; font: 600 1rem "Commissioner", "Noto Sans Arabic", sans-serif;
  color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 14px; cursor: pointer;
}
.lang-choice:hover { border-color: var(--accent); }
.lang-choice.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* Header menu */
.lang-menu { position: relative; }
.lang-menu summary {
  list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 999px; padding: 5px 10px; font: 600 .85rem "Commissioner", sans-serif;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::after { content: "▾"; font-size: .75rem; color: var(--muted); }
.lang-menu[open] summary, .lang-menu summary:hover { border-color: var(--accent); }
.lang-list {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 40; display: grid; gap: 6px; min-width: 180px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px; box-shadow: 0 12px 30px -12px rgba(0,0,0,.4);
}
.lang-list .lang-choice { width: 100%; font-size: .95rem; padding: 8px 10px; }

/* First visit */
.lang-welcome {
  position: relative; max-width: 1100px; margin: 0 auto 8px; padding: 18px 20px 20px; text-align: center;
  background: var(--surface); border: 2px solid var(--accent); border-radius: var(--radius);
  width: calc(100% - 40px);
}
.lang-welcome-title { margin: 0 0 14px; font: 700 1.15rem "Comfortaa", "Commissioner", "Noto Sans Arabic", sans-serif; }
.lang-welcome-choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.lang-welcome .lang-choice { font-size: 1.1rem; padding: 12px 18px; }
.lang-welcome .flag { width: 32px; height: 24px; }
.lang-close { position: absolute; top: 6px; inset-inline-end: 10px; border: 0; background: none; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.lang-pref { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 600px) {
  .lang-welcome { width: calc(100% - 32px); padding: 16px 12px; }
  .lang-welcome-choices { display: grid; grid-template-columns: 1fr 1fr; }
  .lang-welcome .lang-choice { justify-content: center; font-size: 1rem; padding: 12px 8px; }
}

/* Privacy page */
.privacy h2 { font-size: 1.25rem; margin: 28px 0 8px; }
.privacy ul { padding-inline-start: 22px; }
.privacy li { margin: 6px 0; }
footer .privacy-link { color: var(--muted); }

/* Admin: edit a parent's details */
.edit-dlg { border: 0; padding: 0; background: transparent; width: min(480px, calc(100% - 32px)); }
.edit-dlg::backdrop { background: rgba(20, 16, 24, .5); }
.edit-dlg .card-form h3 { margin: 0; }
.row-links { white-space: nowrap; }
.row-links .link-btn + .link-btn { margin-inline-start: 10px; }

/* ---------- photos in parents' messages ---------- */
.post-main { display: grid; gap: 8px; }
.post-photos { display: grid; gap: 4px; grid-template-columns: 1fr 1fr; border-radius: 10px; overflow: hidden; }
.post-photos.n1 { grid-template-columns: 1fr; }
.post-photos.n3 > :first-child { grid-row: span 2; }
.post-photo { display: block; padding: 0; border: 0; background: var(--line); cursor: zoom-in; aspect-ratio: 4 / 3; overflow: hidden; }
.post-photos.n1 .post-photo { aspect-ratio: auto; max-height: 360px; }
.post-photos.n3 > :first-child { aspect-ratio: auto; }
.post-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-photos.n1 .post-photo img { max-height: 360px; object-fit: contain; background: var(--bg); }
.photo-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pick-thumbs { display: contents; }
.pick-thumb { position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--line); }
.pick-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick-thumb.loading img { opacity: .45; }
.pick-thumb.loading::after {
  content: ""; position: absolute; inset: 50% auto auto 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px;
  border: 2.5px solid var(--accent); border-right-color: transparent; border-radius: 50%; animation: pick-spin .8s linear infinite;
}
@keyframes pick-spin { to { transform: rotate(360deg); } }
.pick-remove {
  position: absolute; top: 3px; inset-inline-end: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0;
  background: rgb(0 0 0 / .65); color: #fff; font-size: 15px; line-height: 22px; padding: 0; cursor: pointer;
}
.photo-add { cursor: pointer; font-size: .9rem; display: inline-flex; gap: 4px; align-items: center; }
.photo-add:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.photo-viewer { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.photo-viewer::backdrop { background: rgb(0 0 0 / .88); }
.photo-viewer[open] { display: grid; place-items: center; }
.photo-viewer img { max-width: calc(100vw - 32px); max-height: calc(100vh - 96px); object-fit: contain; border-radius: 6px; }
.pv-btn {
  position: fixed; border: 0; border-radius: 50%; width: 44px; height: 44px; background: rgb(255 255 255 / .16);
  color: #fff; font-size: 28px; line-height: 44px; padding: 0; cursor: pointer;
}
.pv-btn:hover { background: rgb(255 255 255 / .28); }
.pv-close { top: 14px; inset-inline-end: 14px; }
.pv-prev { top: 50%; margin-top: -22px; inset-inline-start: 12px; }
.pv-next { top: 50%; margin-top: -22px; inset-inline-end: 12px; }
.pv-count { position: fixed; bottom: 18px; left: 0; right: 0; text-align: center; color: #fff; font-size: .9rem; }

/* Admin: sections that open on click (QR invitations) */
.admin-fold > summary { list-style: none; display: flex; align-items: center; gap: 10px; color: var(--ink); }
.admin-fold > summary::-webkit-details-marker { display: none; }
.admin-fold > summary h2 { margin: 0; }
.admin-fold > summary::before { content: "▸"; color: var(--accent); font-size: 1.1rem; transition: transform .15s; }
.admin-fold[open] > summary::before { transform: rotate(90deg); }
[dir="rtl"] .admin-fold:not([open]) > summary::before { transform: scaleX(-1); }
.admin-fold[open] > summary { margin-bottom: 12px; }
.cal-day.past:not(.has) { cursor: default; }
.cal-day.past:not(.has):hover { outline: none; }

/* ---------- forms on small screens ---------- */
/* One column that never grows past the card (iOS date inputs are wide by default). */
.card-form { grid-template-columns: minmax(0, 1fr); }
.card-form :is(input, select, textarea) { max-width: 100%; min-width: 0; }
input[type=date] { -webkit-appearance: none; appearance: none; min-height: 48px; text-align: start; }
input[type=date]::-webkit-date-and-time-value { text-align: start; }
@media (max-width: 800px) {
  .three { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  /* Start and end time line up even when a label wraps ("(προαιρ.)"). */
  .three > label { display: flex !important; flex-direction: column; height: 100%; }
  .three > label > .time-field { margin-top: auto; padding-top: 6px; }
}
@media (max-width: 480px) {
  main { padding: 0 14px; }
  .card-form { padding: 18px 16px; gap: 14px; }
  .narrow-main h1 { margin: 14px 0 10px; }
}

/* Newsletter form: the registration fields, as one block of the form's grid. */
.join-fields { display: grid; gap: inherit; min-width: 0; }
.join-fields[hidden] { display: none; }

/* Under the hero button: a quiet reassurance. */
.cta-note { margin: 10px 0 0; font-size: .9rem; color: var(--muted, inherit); opacity: .85; }

/* The note under the child's age (a temporary guide until the academy's classes are known). */
.field-note { display: block; margin-top: 6px; font-size: .82rem; font-weight: 400; color: var(--muted); line-height: 1.4; }
.club-text { margin-top: 18px; color: var(--muted); }

/* Hero: a pair of football shoes, the second one a little behind and higher. */
.shoes { display: inline-flex; align-items: flex-end; }
.shoes > span { display: inline-block; margin-left: -.72em; transform: translateY(-.3em); }

/* Share (QR code) button at the top right of the header, and its dialog */
.share-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; cursor: pointer;
  background: none; color: var(--muted); border: 1.5px solid var(--line); border-radius: 999px;
}
.share-btn:hover, .share-btn:focus-visible { color: var(--accent); border-color: var(--accent); }
.top > .share-btn { margin-inline-start: auto; }
.share-dialog { border: 0; border-radius: 18px; padding: 24px 22px 20px; max-width: min(360px, calc(100vw - 32px)); text-align: center; background: var(--surface); color: var(--ink); box-shadow: 0 20px 50px -20px rgba(0,0,0,.5); }
.share-dialog::backdrop { background: rgb(0 0 0 / .5); }
.share-dialog h2 { margin: 0 0 12px; font-size: 1.25rem; }
.share-dialog img { display: block; width: 240px; max-width: 100%; height: auto; margin: 0 auto; background: #fff; padding: 8px; border-radius: 10px; }
.share-dialog p { margin: 12px 0 0; }
.share-url { font-weight: 600; word-break: break-all; }
.share-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.share-close { position: absolute; top: 8px; inset-inline-end: 10px; background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); }
@media (max-width: 700px) {
  .top { position: relative; padding-inline-end: 64px; }
  .top .share-btn { position: absolute; top: 22px; inset-inline-end: 20px; }
}
@media print { .share-btn { display: none; } }
