:root {
  color-scheme: light;
  --ink: #101115;
  --accent: #fcac14;
  --muted: #5f5c54;
  --surface: #fff;
  --line: #e9e4d8;
  --ground: #f8f7f2;
  --sans: Inter, 'Segoe UI', system-ui, sans-serif;
  --display: Inter, 'Arial Black', 'Segoe UI', system-ui, sans-serif;
  --radius: 19px;
  --shadow: 0 16px 50px #242b1010;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--ground);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; min-height: 100vh; }
body.has-tabs { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
button:disabled { opacity: .58; cursor: wait; }
:focus-visible { outline: 3px solid #935800; outline-offset: 3px; }
main:focus { outline: none; }
.skip { position: fixed; top: 8px; left: 8px; transform: translateY(-160%); background: var(--accent); z-index: 20; padding: 12px; border-radius: 10px; }
.skip:focus { transform: none; }
.icon { flex: 0 0 auto; vertical-align: middle; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.1; }
h1 { font-family: var(--display); font-weight: 880; letter-spacing: -.063em; }
h2 { font-size: clamp(1.26rem, 3vw, 1.62rem); font-weight: 790; letter-spacing: -.045em; }
h3 { font-size: 1.04rem; font-weight: 770; letter-spacing: -.026em; }
p, small { line-height: 1.5; }
.muted { color: var(--muted); }
.loading { margin: 100px auto; text-align: center; color: var(--muted); }

.site-header { background: var(--ink); color: #fff; border-bottom: 1px solid #ffffff1c; }
.header-inner { width: min(100% - 3rem, 1120px); margin-inline: auto; min-height: 68px; display: flex; gap: 18px; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; gap: 10px; align-items: center; color: #fff; text-decoration: none; font-family: var(--display); letter-spacing: -.06em; font-size: 1.27rem; font-weight: 900; line-height: 1; min-width: 0; }
.brand > span:last-child > span { color: var(--accent); }
.brand-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark { color: var(--ink); background: var(--accent); width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px; display: grid; place-items: center; }
.header-actions { display: flex; align-items: center; gap: 17px; flex: 0 0 auto; }
.header-location, .role-caption { font-size: .77rem; color: #c6c8c2; white-space: nowrap; }
.header-link, .header-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid #ffffff36; background: transparent; color: #fff; font-size: .81rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.header-link:hover, .header-button:hover { background: #ffffff17; }
.site-header :focus-visible, .club-landing .landing-hero :focus-visible { outline-color: var(--accent); }

.tabbar { position: fixed; z-index: 4; inset: auto 0 0; background: #fff; border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 35px #242b1008; }
.tabbar > div { display: flex; max-width: 590px; margin: auto; }
.tabbar a { flex: 1; display: flex; flex-direction: column; gap: 5px; min-height: 52px; align-items: center; justify-content: center; border-radius: 11px; padding: 4px 1px; color: #64685e; font-size: .66rem; text-decoration: none; font-weight: 700; text-align: center; }
.tabbar a:hover { background: #f4f5ef; }
.tabbar a[aria-current] { color: #563200; background: #ffedc9; }

.page { width: min(100% - 3rem, 1120px); margin: 0 auto; padding: clamp(26px, 6vw, 62px) 0 45px; display: grid; gap: clamp(20px, 4vw, 31px); }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 17px; }
.page-heading h1, .auth-card h1, .profile-hero h1 { font-size: clamp(2rem, 7vw, 3.72rem); }
.page-heading p, .section-heading p, .auth-card > p { color: var(--muted); margin-top: 7px; }
.section-heading { margin-bottom: 13px; }
.section-heading h2 .icon { margin-right: 4px; }
.section-heading p { font-size: .92rem; }
.card { min-width: 0; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); box-shadow: 0 4px 16px #242b1006; }
.cards-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.home-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: clamp(14px, 3vw, 26px); align-items: start; }
.stack { display: grid; gap: 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 11px; border: 1px solid transparent; padding: 10px 15px; text-decoration: none; font-size: .86rem; font-weight: 780; line-height: 1.2; background: transparent; color: var(--ink); }
.button.primary { background: var(--accent); }
.button.primary:hover { background: #ffb930; }
.button.secondary { border-color: #dbe0ce; background: #fff; }
.button.secondary:hover, .button.plain:hover { background: #f2f5e8; }
.button.plain { color: #644000; }
.back-link { width: fit-content; font-size: .86rem; font-weight: 730; color: #694200; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.tag { display: inline-flex; align-items: center; width: fit-content; background: #f1f3eb; color: #41473b; border: 1px solid #e9ecdf; padding: 5px 9px; border-radius: 99px; font-weight: 730; font-size: .72rem; line-height: 1.12; }
.tag.first { background: #eaf4cf; color: #405000; border-color: #e0edbb; }
.tag.warning { background: #ffecd5; color: #742908; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.empty { display: grid; justify-items: start; align-content: start; gap: 9px; background: #fdfef9; border: 1px dashed #dce2ce; border-radius: var(--radius); padding: 25px; }
.empty p { color: var(--muted); max-width: 43ch; font-size: .9rem; }
.empty .button { margin-top: 5px; }
.empty-icon { display: grid; place-items: center; width: 45px; height: 45px; background: #fff0d1; color: #694200; border-radius: 13px; }
.notice { padding: 13px 15px; display: flex; align-items: flex-start; gap: 10px; background: #fff4df; border: 1px solid #f0e5cb; color: #5b4624; border-radius: 13px; font-size: .86rem; }
.notice .icon { margin-top: 1px; }

.auth-page { max-width: 500px; gap: 18px; }
.auth-card { padding: clamp(21px, 5vw, 37px); border: 1px solid var(--line); border-radius: 25px; background: #fff; box-shadow: var(--shadow); }
.auth-card > .empty-icon { margin-bottom: 18px; }
.auth-card h1 { font-size: clamp(2.1rem, 7vw, 3rem); }
.form-disclaimer { margin: 18px 0 16px; background: #f2f5e9; padding: 9px 11px; font-size: .78rem; font-weight: 670; color: #4d5734; border-radius: 8px; }
.form-stack { display: grid; gap: 14px; align-content: start; }
.form-stack .button { justify-self: start; }
.auth-card .form-stack .button { justify-self: stretch; }
.auth-alternative { color: var(--muted); font-size: .83rem; }
.auth-alternative a { font-weight: 730; color: #405000; text-underline-offset: 3px; }
.demo-access { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.demo-access summary { cursor: pointer; color: var(--muted); font-size: .85rem; font-weight: 700; }
.demo-access > div { margin-top: 12px; display: grid; gap: 8px; }
.success-panel { display: grid; gap: 10px; border-radius: 15px; margin-top: 22px; padding: 18px; background: #f1f6df; }
.success-panel .button { justify-self: start; }
.detail-form { width: min(100%, 690px); padding: clamp(17px, 4vw, 29px); }
.form-row { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: grid; align-content: start; gap: 7px; min-width: 0; color: #282d22; font-size: .85rem; font-weight: 720; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; min-height: 45px; border: 1px solid #d9ded0; border-radius: 10px; padding: 9px 11px; background: #fbfcf8; color: var(--ink); font-size: 1rem; font-weight: 470; }
.field input::placeholder, .field textarea::placeholder { color: #6b7065; }
.field textarea { resize: vertical; }
.field input[type=file] { font-size: .85rem; }
.field input[type=file]::file-selector-button { border: 0; border-radius: 5px; color: #323c10; background: #eaf1d7; padding: 5px 8px; margin-right: 6px; }
.check-field { display: flex; width: fit-content; align-items: start; gap: 9px; font-size: .86rem; color: #383d31; line-height: 1.43; }
.check-field input { margin: 2px 0 0; flex: 0 0 auto; width: 18px; height: 18px; accent-color: #546c11; }
fieldset { display: grid; gap: 12px; min-width: 0; padding: 13px 14px 15px; border: 1px solid var(--line); border-radius: 13px; margin: 0; }
legend { font-size: .86rem; font-weight: 750; padding: 0 5px; }
.current-photo { display: flex; align-items: center; gap: 9px; font-size: .85rem; color: var(--muted); }

.dashboard-hero { display: flex; position: relative; isolation: isolate; align-items: center; color: #fff; min-height: clamp(165px, 24vw, 247px); border-radius: 24px; overflow: hidden; padding: clamp(23px, 6vw, 54px); background: radial-gradient(ellipse at 86% 0%, #64430a, #2d220f 48%, #101115 83%); }
.dashboard-hero .eyebrow { color: var(--accent); letter-spacing: .105em; font-size: .68rem; font-weight: 790; margin-bottom: 11px; }
.dashboard-hero h1 { font-size: clamp(2.5rem, 8vw, 5rem); }
.dashboard-hero h1 + p { color: #d3d8c8; margin-top: 4px; }
.dashboard-motif { z-index: -1; color: #fcac1455; position: absolute; right: clamp(0px, 7vw, 100px); transform: rotate(-13deg); }
.dashboard-motif .icon { width: clamp(110px, 27vw, 200px); height: auto; stroke-width: .75px; }
.event-preview { padding: 20px; display: grid; gap: 13px; justify-items: start; }
.event-preview > p, .event-note { color: var(--muted); font-size: .88rem; }
.event-title { min-width: 0; display: flex; align-items: center; gap: 13px; }
.event-title h3 { overflow-wrap: anywhere; }
.event-title p { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.date-tile { width: 54px; height: 57px; flex: 0 0 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px; background: #fff0d1; color: #694200; line-height: 1; }
.date-tile strong { font-size: 1.43rem; font-weight: 840; letter-spacing: -.05em; }
.date-tile span { margin-top: 5px; font-size: .69rem; font-weight: 750; text-transform: uppercase; }
.avatar { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 50%; background: #e9efd6; color: #465400; font-size: 1rem; font-weight: 800; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.large { width: 52px; height: 52px; flex-basis: 52px; font-size: 1.33rem; }
.avatar.profile-avatar { width: clamp(53px, 14vw, 89px); height: clamp(53px, 14vw, 89px); flex-basis: auto; aspect-ratio: 1; font-size: clamp(1.5rem, 8vw, 2.4rem); }
.quick-children { padding: 5px 14px; }
.quick-children > a:not(.button) { min-height: 60px; display: flex; align-items: center; gap: 9px; text-decoration: none; font-size: .92rem; border-bottom: 1px solid var(--line); }
.quick-children > a:not(.button) .icon { margin-left: auto; color: var(--muted); }
.quick-children > a:not(.button):hover strong { text-decoration: underline; }
.quick-children .button { margin: 4px 0; }
.child-card { padding: 17px; display: grid; gap: 14px; overflow-wrap: anywhere; }
.child-card-top { display: flex; align-items: center; gap: 10px; position: relative; flex-wrap: wrap; }
.child-card-top p { color: var(--muted); font-size: .83rem; margin-top: 3px; }
.child-card-top a { text-decoration: none; }
.child-card-top a:hover { text-decoration: underline; }
.child-card-top .tag { margin-left: auto; }
.child-stats { display: flex; flex-wrap: wrap; gap: 13px; padding: 10px 0; border-block: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.child-stats .icon { color: #506300; margin-right: 3px; }
.child-stats b { color: var(--ink); }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.profile-hero { display: flex; align-items: center; gap: 15px; padding: clamp(17px, 4vw, 30px); flex-wrap: wrap; }
.profile-hero h1 { font-size: clamp(1.9rem, 6vw, 3.15rem); overflow-wrap: anywhere; }
.profile-hero p { color: var(--muted); margin-top: 5px; }
.profile-hero .tags:not(:empty) { margin-top: 8px; }
.profile-hero .button { margin-left: auto; }
.skill-card { padding: 17px; margin-bottom: 10px; }
.skill-card p { color: var(--muted); margin-top: 5px; }

.attendance-event { overflow: hidden; }
.event-header { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 17px 19px 0; }
.event-header .tag { flex: 0 0 auto; }
.event-note { margin: 10px 19px 13px; }
.attendance-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 13px 19px; border-top: 1px solid var(--line); }
.attendance-identity { display: flex; align-items: center; gap: 7px; min-width: 0; flex-wrap: wrap; overflow-wrap: anywhere; }
.attendance-identity strong { font-size: .9rem; }
.attendance-buttons { display: grid; grid-template-columns: repeat(4, auto); gap: 6px; }
.attendance-button, .status-chip { display: inline-flex; align-items: center; justify-content: center; gap: 4px; border-radius: 8px; font-size: .74rem; font-weight: 750; line-height: 1.15; }
.attendance-button { min-height: 42px; padding: 7px 9px; color: #33362e; background: #fbfcf8; border: 1px solid #dfe3d7; }
.attendance-button:hover { background: #f0f4e6; }
.status-chip { min-height: 24px; padding: 4px 8px; background: #f0f1eb; color: #51584c; }
.status-chip.maybe, .attendance-button.maybe[aria-pressed=true] { background: #fff0cd; color: #654703; }
.status-chip.planned, .attendance-button.planned[aria-pressed=true] { background: #e7effd; color: #234d75; }
.status-chip.confirmed, .attendance-button.confirmed[aria-pressed=true] { background: #e4f3c9; color: #355418; }
.status-chip.declined, .attendance-button.declined[aria-pressed=true] { background: #f6e6e2; color: #81372c; }
.attendance-button[aria-pressed=true] { border-color: currentColor; }
.event-no-child { padding: 2px 19px 17px; }
.reminders { padding: 17px; }
.reminder-item { display: grid; gap: 5px; padding: 12px 0; border-top: 1px solid var(--line); }
.reminder-item p, .reminder-item small { color: var(--muted); font-size: .84rem; }

.log-card { padding: 17px; display: grid; gap: 9px; overflow-wrap: anywhere; }
.log-meta { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: .78rem; }
.log-card p { color: var(--muted); font-size: .88rem; }
.log-card p strong { margin-right: 4px; color: var(--ink); }
.award-list { padding: 4px 15px; }
.award-row { display: flex; align-items: start; gap: 10px; padding: 11px 0; overflow-wrap: anywhere; }
.award-row + .award-row { border-top: 1px solid var(--line); }
.award-row strong { font-size: .9rem; }
.award-row p, .award-row small { color: var(--muted); font-size: .8rem; }
.award-icon { display: grid; place-items: center; background: #ffefc7; color: #744e0c; width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px; font-size: .96rem; font-weight: 850; }
.result-card { padding: 15px; }
.result-list { list-style: none; margin: 0; padding: 0; }
.result-list li { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-top: 1px solid var(--line); font-size: .84rem; }
.result-list .tag { margin-left: auto; }

.member-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(115px,1fr)); gap: 9px; }
.member-card { min-width: 0; padding: 15px 7px; display: grid; justify-items: center; text-align: center; gap: 7px; }
.member-card h3 { overflow-wrap: anywhere; }
.member-card > span:last-child { color: var(--muted); font-size: .76rem; }
.member-card > span:last-child .icon { color: #6d5309; }
.gallery-event + .gallery-event { margin-top: 16px; }
.gallery-event h3 { margin-bottom: 10px; }
.photo-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
.photo-card { overflow: hidden; }
.photo-card > img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #edf0e4; }
.photo-body { display: grid; gap: 9px; padding: 13px; overflow-wrap: anywhere; }
.reaction-bar { display: flex; flex-wrap: wrap; gap: 5px; }
.reaction-bar button { color: var(--ink); background: #f5f6f0; border: 1px solid #e7eade; border-radius: 7px; min-height: 38px; padding: 4px 8px; font-size: .8rem; }
.reaction-bar button[aria-pressed=true] { border-color: #7e942d; background: #edf6cc; }

.admin-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.metric { display: grid; align-content: start; gap: 7px; padding: 15px; }
.metric > span { color: var(--muted); font-size: .8rem; font-weight: 690; }
.metric > span .icon { color: #536500; }
.metric > strong, .metric > a { font-weight: 800; font-size: 1.8rem; line-height: 1; text-decoration: none; }
.metric > a:hover { text-decoration: underline; }
.admin-event-overview { padding: 17px; }
.admin-overview-head { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 14px; }
.admin-overview-head .field { width: min(100%, 280px); }
.capacity { display: grid; gap: 6px; margin-block: 14px; }
.capacity > div { display: flex; align-items: center; justify-content: space-between; font-size: .86rem; }
.capacity progress { width: 100%; height: 9px; appearance: none; border: 0; border-radius: 10px; accent-color: #7d9617; background: #e9eddf; }
.capacity progress::-webkit-progress-bar { border-radius: 10px; background: #e9eddf; }
.capacity progress::-webkit-progress-value { border-radius: 10px; background: #7d9617; }
.totals { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 14px; }
.totals > span { display: inline-flex; align-items: center; gap: 5px; font-size: .82rem; }
.admin-team { margin-top: 3px; }
.admin-team.card { padding-inline: 15px; }
.team-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 10px 0; }
.admin-team.card .team-row:first-child { border-top: 0; }
.team-row small { display: block; color: var(--muted); }
.admin-event-row { padding: 13px 15px; display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.competition-links { display: flex; flex-wrap: wrap; gap: 7px; }

.toast { position: fixed; z-index: 7; bottom: calc(16px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: min(90%, 580px); border: 1px solid #343c19; border-radius: 12px; padding: 12px 16px; background: #263115; color: #fff; font-size: .86rem; font-weight: 670; box-shadow: var(--shadow); }
.toast.error { background: #742f23; border-color: #794131; }
.has-tabs .toast { bottom: calc(74px + env(safe-area-inset-bottom)); }

@media (max-width: 690px) {
  .header-inner, .page { width: calc(100% - 30px); }
  .header-inner { min-height: 58px; }
  .header-actions { gap: 7px; }
  .header-location { display: none; }
  .page-heading { align-items: start; flex-direction: column; }
  .home-grid { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .attendance-buttons { width: 100%; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .profile-hero .button { margin-left: 0; }
}
@media (max-width: 470px) {
  .header-button span { display: none; }
  .header-button { width: 40px; padding: 0; }
  .role-caption { max-width: 90px; white-space: normal; text-align: right; }
  .cards-grid:not(.photo-grid) { grid-template-columns: 1fr; }
  .admin-metrics { gap: 6px; }
  .metric { padding: 9px; border-radius: 12px; }
  .metric > span .icon { display: block; margin-bottom: 3px; }
  .metric > span { font-size: .72rem; }
  .metric > strong, .metric > a { font-size: 1.49rem; }
  .photo-body { padding: 9px; }
  .photo-body .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
