:root {
  color-scheme: light;
  --paper: #f7f7f3;
  --white: #fff;
  --ink: #202522;
  --muted: #727a74;
  --line: #dfe3dd;
  --green: #245c47;
  --green-dark: #173c30;
  --green-pale: #e8eee8;
  --gold: #e0cf62;
  --page-gutter: 24px;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); line-height: 1.65; }
main { flex: 1; }
a { color: inherit; text-decoration: none; transition: color .16s ease, background .16s ease; }
a:hover, .text-button:hover { color: var(--green); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button { flex-shrink: 0; max-width: 100%; }
input, select, textarea, fieldset { min-width: 0; max-width: 100%; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.skip-link { position: fixed; left: 12px; top: 8px; z-index: 100; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); background: white; color: var(--green); }
.skip-link:focus { width: auto; height: auto; padding: 10px 16px; clip-path: none; }
.container { width: min(1040px, calc(100% - 48px)); margin-inline: auto; }
.narrow { max-width: 660px; margin-inline: auto; }

.topbar { position: sticky; top: 0; z-index: 10; background: rgba(247,247,243,.96); border-bottom: 1px solid var(--line); }
.nav { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { flex: none; font-size: 1.16rem; font-weight: 850; letter-spacing: .12em; }
.brand span { color: var(--green); }
nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 30px); color: #48504a; font-size: .87rem; }
nav form { margin: 0; }
.nav-link { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; }
.topbar nav a, .nav-link { display: flex; align-items: center; min-height: 44px; }
.nav-toggle { display: none; width: 44px; height: 44px; padding: 11px; border: 1px solid var(--line); border-radius: 3px; background: transparent; color: var(--green); }
.nav-toggle span { display: block; width: 20px; height: 2px; background: currentColor; }
.nav-toggle[aria-expanded="true"] { position: relative; }
.nav-toggle[aria-expanded="true"] span { position: absolute; top: 20px; left: 11px; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { visibility: hidden; }
.nav-toggle[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }

.hero { width: min(1190px, calc(100% - 48px)); min-height: 480px; margin: 0 auto; padding: 64px 0 56px; display: grid; grid-template-columns: 1fr .88fr; align-items: center; gap: clamp(32px, 7vw, 100px); }
.hero-copy { padding-left: clamp(0px, 5vw, 70px); }
.eyebrow { margin: 0 0 14px; color: var(--green); font-size: .68rem; font-weight: 750; letter-spacing: .14em; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0 0 16px; font-size: clamp(2rem, 5.3vw, 4rem); line-height: 1.22; letter-spacing: -.045em; font-weight: 700; }
h2 { margin: 0 0 12px; font-size: 1.35rem; letter-spacing: -.025em; }
.hero-lead { margin: 0; color: var(--muted); font-size: 1rem; }
.cta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 22px; margin-top: 30px; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border: 1px solid var(--green); border-radius: 3px; background: var(--green); color: white; font-weight: 650; }
.button:hover { background: var(--green-dark); color: white; }
.button.small { min-height: 44px; padding: 6px 12px; font-size: .86rem; white-space: nowrap; }
.button.secondary { background: transparent; color: var(--green); }
.button.secondary:hover { background: var(--green-pale); }
.text-link { color: var(--green); font-size: .9rem; font-weight: 650; }
.hero-art { min-height: 310px; position: relative; display: grid; place-items: center; overflow: hidden; background: #e9ede5; }
.court { position: absolute; width: 76%; aspect-ratio: 1.28; transform: rotate(-8deg); border: 1px solid rgba(255,255,255,.78); }
.court-back { background: var(--green); }
.court::before { content: ""; position: absolute; inset: 10%; border: 1px solid rgba(255,255,255,.8); }
.court::after { content: ""; position: absolute; top: 10%; bottom: 10%; left: 50%; border-left: 1px solid rgba(255,255,255,.8); }
.court span { position: absolute; top: 50%; left: 10%; right: 10%; border-top: 1px solid rgba(255,255,255,.8); }
.court i { position: absolute; top: 10%; bottom: 10%; left: 28%; right: 28%; border: 1px solid rgba(255,255,255,.72); }
.court b { display: none; }
.ball { width: 47px; aspect-ratio: 1; position: absolute; z-index: 2; top: 18%; right: 16%; border-radius: 50%; background: var(--gold); }
.ball::after { content: ""; position: absolute; inset: 5px 11px; border-inline: 1.5px solid rgba(255,255,255,.9); border-radius: 50%; transform: rotate(23deg); }

.section { padding: 46px 0 76px; }
.home-schedule { padding-top: 12px; }
.section-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.section-heading > div { min-width: 0; }
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.section-heading h1, .section-heading h2 { margin: 0; }
.section-heading h2 { font-size: 1.25rem; }
.page-hero { padding-top: 64px; padding-bottom: 10px; }
.page-hero.compact { padding-top: 48px; }
.page-hero h1 { margin: 0 0 8px; }
.page-hero > p:last-child, .page-intro { max-width: 560px; margin: 0; color: var(--muted); }
.about-statement { margin: 10px 0 28px; font-size: 1.15rem; line-height: 1.9; }
.schedule-list, .bag-list, .notification-list, .attendee-list, .bag-retire-list { margin: 20px 0 0; padding: 0; list-style: none; }
.schedule-list { display: grid; }
.schedule-card { min-width: 0; display: grid; grid-template-columns: 130px minmax(130px, 1fr) auto auto; align-items: center; gap: 18px; padding: 18px 8px; border-top: 1px solid var(--line); }
.schedule-card:last-child { border-bottom: 1px solid var(--line); }
.schedule-date { color: var(--green-dark); font-variant-numeric: tabular-nums; font-weight: 650; }
.schedule-main { display: grid; gap: 2px; }
.schedule-main span, .attendance-count { color: var(--muted); font-size: .88rem; }
.badge { display: inline-flex; width: max-content; align-items: center; padding: 3px 9px; border-radius: 2px; background: #eceee9; color: #525a54; font-size: .76rem; font-weight: 650; white-space: nowrap; }
.badge-green { background: var(--green-pale); color: var(--green); }
.badge-red { background: #f5e7e4; color: #9a4139; }
.badge-amber { background: #f6f0d8; color: #785d1b; }
.badge[class*="status-"] { color: var(--status-color); background: color-mix(in srgb, var(--status-color) 10%, white); }
.badge-member, .member-count { background: #e3eee8; color: #245c47; }
.badge-guest, .guest-count { background: #f0e8f5; color: #70458a; }
.empty-state { padding: 25px 8px; color: var(--muted); border-block: 1px solid var(--line); }

.calendar-wrap { max-width: 100%; }
.calendar-toolbar { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-bottom: 14px; }
.calendar-toolbar h2 { margin: 0; text-align: center; font-size: 1.2rem; }
.calendar-toolbar > a, .calendar-nav-right a { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 9px; border: 1px solid var(--line); background: var(--white); color: var(--green); font-size: 1.2rem; }
.calendar-nav-right { display: flex; align-items: center; gap: 6px; }
.calendar-nav-right a:first-child { font-size: .78rem; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 14px; color: var(--muted); font-size: .78rem; }
.calendar-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.calendar-legend > span::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.status-scheduled { --status-color: #347757; }
.status-tbd, .status-possible { --status-color: #9a762b; }
.status-cancelled { --status-color: #a54e46; }
.status-ended { --status-color: #858c87; }
.calendar-legend .status-scheduled { color: #347757; }
.calendar-legend .status-tbd { color: #9a762b; }
.calendar-legend .status-cancelled { color: #a54e46; }
.calendar-legend .status-ended { color: #858c87; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--white); }
.calendar-weekday { padding: 8px 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f0f2ed; color: var(--muted); text-align: center; font-size: .78rem; }
.calendar-day { min-width: 0; min-height: 112px; padding: 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.calendar-day > time { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.calendar-day-events { display: grid; gap: 5px; margin-top: 4px; }
.calendar-event { min-width: 0; min-height: 44px; display: grid; align-content: center; gap: 1px; padding: 4px 5px; border-left: 3px solid var(--status-color); background: color-mix(in srgb, var(--status-color) 9%, white); color: var(--ink); font-size: .7rem; line-height: 1.35; }
.calendar-event strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event span { color: var(--muted); font-variant-numeric: tabular-nums; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.footer-row { min-height: 68px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.footer-row span:last-child { display: flex; gap: 18px; }
.fine-print { margin-top: 20px; color: var(--muted); font-size: .8rem; }
.auth-panel { max-width: 470px; margin: 70px auto 90px; padding: 34px; border: 1px solid var(--line); background: var(--white); }
.auth-panel h1 { font-size: 2rem; }
.auth-panel > p:not(.eyebrow) { color: var(--muted); }
.g_id_signin { display: flex; justify-content: center; max-width: 100%; margin: 22px auto; }
.notice { padding: 10px 12px; }
.notice-error { background: #fbe9e7; color: #8e302b; }
.notice-success { margin: 12px 0 20px; border-left: 3px solid #468366; background: #e8f1eb; color: #245c47; }
.panel { padding: 24px; border: 1px solid var(--line); background: var(--white); }
.stacked-form { display: grid; gap: 14px; }
.stacked-form label, .attendance-row label, .bag-recipient { display: grid; gap: 5px; margin: 0; color: #48504a; font-size: .86rem; font-weight: 600; }
input, select, textarea { width: 100%; min-width: 0; max-width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid #cdd4cc; border-radius: 3px; background: white; color: var(--ink); }
.stacked-form > *, .stacked-form label { min-width: 0; }
input[type="date"], input[type="time"], input[type="datetime-local"] { display: block; box-sizing: border-box; }
input::-webkit-date-and-time-value { min-width: 0; text-align: left; }
textarea { resize: vertical; }
input:focus, select:focus { outline: 3px solid rgba(36,92,71,.15); border-color: var(--green); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.attendance-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.attendance-event { display: grid; gap: 2px; }
.attendance-event-link { width: fit-content; color: var(--ink); font-weight: 650; text-decoration: none; }
.attendance-event-link:hover { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.court-attendance-counts { display: block; white-space: nowrap; font-variant-numeric: tabular-nums; }
.attendance-event > span, .attendance-event small { color: var(--muted); font-size: .82rem; }
.attendance-event small { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.attendance-event small > span, .attendance-legend > span { padding: 1px 6px; border-radius: 2px; font-size: .72rem; }
.attendance-event small a { color: var(--green); text-decoration: underline; text-underline-offset: 2px; }
.attendance-choices { display: flex; gap: 5px; position: relative; padding-bottom: 20px; }
.attendance-save-status { position: absolute; bottom: 0; left: 0; white-space: nowrap; font-size: .75rem; color: var(--green); }
.attendance-save-status.is-error { white-space: normal; color: #8e302b; }
.attendance-choice { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: var(--white); color: var(--ink); font-size: 1.12rem; }
.attendance-choice:hover, .attendance-choice:focus-visible { border-color: var(--green); outline: 2px solid rgba(36,92,71,.18); }
.attendance-choice.is-selected { border-color: var(--green); background: var(--green); color: white; }
.attendance-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0 0 8px; color: var(--muted); font-size: .78rem; }
.attendee-group { margin: 26px 0; }
.attendee-group h2 { display: flex; align-items: baseline; gap: 9px; margin: 0; font-size: 1.12rem; }
.attendee-group h2 span { color: var(--muted); font-size: .84rem; font-weight: 500; }
.event-detail-heading { display: grid; gap: 4px; margin: 26px 0 20px; }
.event-detail-heading h1, .event-detail-heading p { margin: 0; line-height: 1.3; }
.event-attendance { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 20px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.event-attendance h2 { margin: 0; font-size: 1rem; }
.event-detail-date, .event-detail-location { font-size: 1.5rem; font-weight: 650; }
.event-detail-time { margin-top: 4px !important; font-size: 1.3rem; font-weight: 700; }
.attendee-key { display: flex; gap: 8px; margin: 20px 0; font-size: .74rem; }
.attendee-name { display: inline-flex; width: max-content; max-width: 100%; padding: 3px 9px; border: 1px solid transparent; border-radius: 4px; box-shadow: none; font-weight: 600; }
.attendee-name.member-name { border-color: #b9d2c3; background: #e8f1eb; color: #245c47; }
.attendee-name.guest-name { border-color: #d7c5e3; background: #f3edf7; color: #70458a; }
.attendee-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.attendee-list li { display: block; padding: 0; border: 0; }
.attendee-group .empty-state { padding: 6px 0; border: 0; font-size: .86rem; }
.venue-options .venue-other-field { display: grid; flex: 1 1 200px; min-width: 180px; gap: 4px; color: #48504a; font-size: .82rem; }
.venue-options .venue-other-field[hidden] { display: none; }
.dashboard-links { display: flex; flex-wrap: wrap; gap: 0; margin: 20px 0 42px; border-block: 1px solid var(--line); }
.dashboard-links a { padding: 12px 17px 12px 0; margin-right: 18px; color: var(--green); font-size: .9rem; font-weight: 600; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin: 24px 0; border-block: 1px solid var(--line); }
.stat-card { display: grid; gap: 2px; padding: 14px 18px; border-right: 1px solid var(--line); color: var(--muted); }
.stat-card:first-child { padding-left: 0; }
.stat-card:last-child { border: 0; }
.stat-card strong { color: var(--ink); font-size: 1.6rem; font-weight: 650; }
.table-wrap { min-width: 0; max-width: 100%; overflow-x: auto; margin: 20px 0; border: 1px solid var(--line); background: white; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table-wrap table { min-width: 640px; }
.table-wrap table.compact-table { min-width: 0; }
th, td { min-width: 90px; padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table-wrap td:first-child { min-width: 120px; }
th { background: #f0f2ed; color: #555f57; font-weight: 650; white-space: nowrap; }
td small { display: block; margin-top: 3px; color: var(--muted); }
td form { display: flex; align-items: center; gap: 7px; }
.user-actions { min-width: 270px; }
.admin-role-actions { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.admin-role-actions form { display: inline-flex; margin: 0; }
.admin-role-toggle { display: inline-grid; width: 44px; height: 44px; place-items: center; padding: 7px; border: 1px solid transparent; border-radius: 50%; background: transparent; color: #9aa19b; transition: color .16s ease, background .16s ease, border-color .16s ease; }
.admin-role-toggle svg { display: block; width: 22px; height: 22px; fill: currentColor; }
.admin-role-toggle:hover:not(:disabled) { border-color: var(--line); background: #f1f3ef; }
.admin-role-toggle.is-active { color: #fff; background: var(--green); }
.admin-role-toggle.is-active:hover:not(:disabled) { background: var(--green-dark); }
.admin-role-toggle.is-blocked { color: #fff; background: #a33c36; }
.admin-role-toggle.is-blocked:hover:not(:disabled) { background: #812b27; }
.admin-role-toggle.is-disabled { opacity: .55; cursor: not-allowed; }
.admin-role-toggle:focus-visible { outline: 3px solid #c49a32; outline-offset: 2px; }
.admin-icon-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 16px 0 8px; color: var(--muted); font-size: .78rem; }
.admin-icon-legend span { display: inline-flex; align-items: center; gap: 5px; }
.admin-icon-legend i { width: 9px; height: 9px; border-radius: 50%; background: #9aa19b; }
.admin-icon-legend .legend-on { background: var(--green); }
.admin-icon-legend .legend-blocked { background: #a33c36; }
.role-warning { margin: 12px 0 20px; padding: 10px 14px; border-left: 3px solid #ae8340; background: #f4f0e5; color: #5e5137; font-size: .88rem; }
.danger-action { border-color: #8b3d35; background: #8b3d35; }
.danger-action:hover { background: #702e27; }
td select { min-width: 95px; width: auto; }
.admin-form { margin: 20px 0 26px; }
.admin-form h2 { font-size: 1.15rem; }
.legal-copy > section { margin-bottom: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.legal-copy h2 { margin-bottom: 10px; font-size: 1.08rem; }
.legal-copy p { margin: 8px 0; color: #444d47; line-height: 1.9; }
.legal-copy ul { display: grid; gap: 7px; margin: 10px 0; padding-left: 1.3rem; color: #444d47; }
.legal-links a { color: var(--green); text-decoration: underline; text-underline-offset: 2px; }
.notification-list, .attendee-list { display: grid; gap: 0; }
.notification-item, .attendee-list li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 6px; border-bottom: 1px solid var(--line); }
.attendee-group .attendee-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.attendee-group .attendee-list li { display: block; padding: 0; border: 0; }
.notification-item p { margin: 4px 0; color: var(--muted); }
.notification-item small { color: var(--muted); }
.notification-unread { border-left: 3px solid var(--green); padding-left: 12px; }
.attendee-list .badge { margin-left: auto; }

.bag-list { border-top: 1px solid var(--line); }
.bag-row { display: grid; grid-template-columns: minmax(160px, .8fr) minmax(160px, 1fr) minmax(180px, 1.2fr); align-items: center; gap: 18px; padding: 17px 8px; border-bottom: 1px solid var(--line); }
.bag-name { display: flex; align-items: center; gap: 10px; }
.bag-icon { color: var(--green); font-size: .62rem; }
.bag-status { display: grid; gap: 2px; }
.bag-status span { color: var(--muted); font-size: .78rem; }
.bag-action { display: flex; justify-content: flex-end; align-items: end; gap: 9px; }
.bag-recipient { min-width: 130px; font-size: .76rem; }
.bag-admin { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 14px 24px; margin-top: 36px; }
.bag-admin h2 { margin: 0; font-size: 1.1rem; }
.bag-admin p { margin: 4px 0 0; color: var(--muted); font-size: .85rem; }
.bag-add-form { display: flex; gap: 8px; }
.bag-add-form input { width: min(220px, 48vw); }
.bag-retire-list { grid-column: 1 / -1; margin: 0; border-top: 1px solid var(--line); }
.bag-retire-list li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.bag-history { margin-top: 34px; }
.bag-history h2 { font-size: 1.1rem; }
.bag-history ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.bag-history li { display: grid; grid-template-columns: 140px 1fr auto; align-items: center; gap: 14px; padding: 11px 4px; border-bottom: 1px solid var(--line); font-size: .83rem; }
.bag-history time, .bag-history small { color: var(--muted); font-size: .77rem; }
.text-button { min-height: 44px; padding: 8px 0; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .82rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.profile-name-form { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin: 18px 0 34px; padding: 14px 0; border-block: 1px solid var(--line); }
.profile-name-form label { display: grid; gap: 4px; width: min(100%, 360px); margin: 0; color: var(--muted); font-size: .8rem; }
.profile-editor { margin: 10px 0 26px; color: var(--green); font-size: .88rem; }
.profile-editor summary { width: max-content; padding: 5px 0; border-bottom: 1px solid currentColor; cursor: pointer; font-weight: 650; }
.profile-editor form { display: flex; align-items: end; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.profile-editor label { display: grid; width: min(100%, 360px); gap: 4px; margin: 0; color: var(--muted); font-size: .8rem; }
.profile-editor .university-other-field[hidden] { display: none; }
.upcoming-preview { margin-bottom: 34px; }
.member-tablist { display: flex; overflow-x: auto; gap: 4px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.member-tab { flex: 0 0 auto; padding: 12px 15px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font: inherit; font-size: .88rem; cursor: pointer; }
.member-tab[aria-selected="true"] { border-color: var(--green); color: var(--green-dark); font-weight: 700; }
.member-tab:focus-visible { outline: 2px solid var(--green); outline-offset: -3px; }
.member-tabpanel { padding: 24px 4px; }
.member-tabpanel[hidden] { display: none; }
.member-tabpanel h2 { margin-bottom: 18px; }
.member-tabpanel h3 { margin: 32px 0 10px; font-size: 1rem; }
.court-booking-row { cursor: pointer; transition: background-color .14s ease; }
.court-booking-row:hover, .court-booking-row:focus-within { background: #f1f5f1; }
.court-booking-row:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.court-booking-row a { color: inherit; text-decoration: none; }
.court-booking-row a:hover { color: var(--green-dark); text-decoration: underline; text-underline-offset: 3px; }
.court-reservation-form { max-width: 680px; margin: 22px 0; padding: 24px; border: 1px solid var(--line); background: var(--white); }
.tab-hint { color: var(--muted); font-size: .84rem; }
.venue-options { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); }
.venue-options legend { padding: 0 6px; color: #48504a; font-size: .86rem; font-weight: 600; }
.venue-options label { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; margin: 0; font-weight: 500; }
.venue-options input[type="radio"] { width: 17px; min-height: 17px; margin: 0; accent-color: var(--green); }
.venue-options input[data-location-other] { flex: 1 1 170px; min-width: 150px; }
.lottery-result-list { display: grid; gap: 0; margin: 14px 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.lottery-result-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.lottery-result-row > div:first-child { display: grid; gap: 3px; }
.lottery-result-row > div:first-child span { color: var(--muted); font-size: .84rem; }
.lottery-result-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 6px; }
.lottery-result-actions form { margin: 0; }
.lottery-result-actions .button { padding-inline: 10px; }
.accounting-court-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.accounting-court-row, .accounting-reimbursement-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(280px, 1.4fr); align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.accounting-court-row > div:first-child { display: grid; gap: 3px; }
.accounting-court-row > div:first-child span, .accounting-court-row > p { color: var(--muted); font-size: .83rem; }
.accounting-court-row > p { margin: 0; text-align: right; }
.accounting-court-history-value, .accounting-history-value { display: grid; gap: 8px; min-width: 0; }
.accounting-court-history-amount, .reimbursement-history-amount { display: flex; align-items: center; gap: 5px; }
.accounting-court-history-amount[hidden] { display: none; }
.court-payment-edit-toggle { display: inline-grid; width: 44px; height: 44px; place-items: center; padding: 10px; border: 0; border-radius: 50%; background: transparent; color: var(--green); }
.court-payment-edit-toggle svg { display: block; width: 18px; height: 18px; fill: currentColor; }
.court-payment-edit-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.accounting-reimbursement-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.accounting-reimbursement-row > div:first-child { display: grid; gap: 3px; min-width: 0; }
.accounting-reimbursement-row > div:first-child > span:not(.badge) { color: var(--muted); font-size: .85rem; }
.accounting-reimbursement-row .badge { justify-self: start; }
.accounting-reimbursement-row.is-editing { align-items: start; }
.advance-registration { margin-top: 18px; }
.advance-registration-choices { display: flex; flex-wrap: wrap; gap: 10px; }
.advance-registration-choices button[aria-expanded="true"] { background: var(--green); color: white; }
.advance-registration-panel { margin-top: 16px; padding: 20px; }
.advance-history { margin-top: 42px; }
.advance-history > h3 { margin-bottom: 18px; }
.advance-history-group + .advance-history-group { margin-top: 28px; }
.advance-history-group h4 { margin: 0 0 10px; font-size: .95rem; }
.accounting-history-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.court-payment-form { display: flex; width: 100%; align-items: end; flex-wrap: wrap; gap: 10px; margin: 0; }
.court-payment-form[hidden] { display: none; }
.court-payment-form label, .accounting-period label, .accounting-dues-form label { display: grid; gap: 4px; margin: 0; color: var(--muted); font-size: .78rem; }
.court-payment-form input, .accounting-period input, .accounting-dues-form input, .accounting-dues-form select { width: auto; min-width: 145px; }
.court-payment-form label { flex: 1 1 150px; min-width: 0; max-width: 260px; }
.court-payment-form input { width: 100%; min-width: 0; }
.court-payment-form input, .court-payment-form button { height: 44px; min-height: 44px; line-height: 1.4; }
.accounting-period, .accounting-dues-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.court-payment-form p { margin: 0; color: var(--muted); font-size: .8rem; }
.court-payment-form input[readonly] { background: #f0f2ed; color: var(--muted); }
.accounting-period { margin: 16px 0 24px; }
.accounting-totals { margin: 18px 0 32px; }
.accounting-report > h2 { margin: 34px 0 10px; font-size: 1.08rem; }
.accounting-report .panel { margin: 24px 0; }
.accounting-report .panel h2 { margin: 0 0 14px; font-size: 1rem; }
.accounting-report table small { display: block; color: var(--muted); }
.accounting-report td:nth-child(2) { min-width: 180px; }
.accounting-report .compact-table td { min-width: 0; }
.accounting-report table input { width: 170px; }
.accounting-report td form { margin: 0; }
.print-only { display: none; }
@media print {
  body { background: #fff; color: #111; font-size: 10pt; }
  .topbar, .site-footer, .skip-link, .no-print, .accounting-report td form { display: none !important; }
  .print-only { display: inline; }
  .container { width: 100%; max-width: none; }
  .section { padding: 0; }
  .accounting-report > h2 { break-after: avoid; }
  .table-wrap { overflow: visible; }
  .table-wrap table { min-width: 0; font-size: 9pt; }
  .table-wrap th, .table-wrap td, .accounting-report td:nth-child(2) { min-width: 0; padding: 6px 5px; overflow-wrap: anywhere; }
  .stats-grid { break-inside: avoid; }
}

@media (max-width: 760px) {
  :root { --page-gutter: 16px; }
  .container, .hero { width: min(100% - 32px, 1040px); }
  .nav { position: relative; min-height: 64px; gap: 12px; flex-wrap: wrap; }
  .nav nav { flex-wrap: wrap; gap: 8px 14px; }
  .js .nav { flex-wrap: nowrap; }
  .js .nav-toggle { display: flex; flex-direction: column; justify-content: space-between; }
  .js #site-navigation { position: absolute; top: 100%; left: calc(-1 * var(--page-gutter)); right: calc(-1 * var(--page-gutter)); padding: 12px 20px; flex-direction: column; align-items: stretch; gap: 0; max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px); overflow-y: auto; border-bottom: 1px solid var(--line); background: var(--paper); font-size: .95rem; }
  .js #site-navigation:not(.is-open) { display: none; }
  .topbar nav a, .nav-link { width: 100%; min-height: 44px; }
  .hero { min-height: 0; padding: 48px 0 30px; grid-template-columns: 1fr; gap: 32px; }
  .hero-copy { padding: 0; }
  .hero-art { min-height: clamp(190px, 55vw, 300px); }
  .section { padding: 34px 0 54px; }
  .home-schedule { padding-top: 12px; }
  .schedule-card { grid-template-columns: minmax(95px, .55fr) 1fr auto; gap: 6px 12px; padding: 14px 4px; }
  .schedule-main { grid-column: 2 / -1; grid-row: 1; }
  .schedule-date { grid-column: 1; grid-row: 1; align-self: start; }
  .schedule-card .badge { grid-column: 1 / -1; grid-row: 2; max-width: 100%; width: fit-content; white-space: normal; overflow-wrap: anywhere; }
  .attendance-count { grid-column: 2; grid-row: 2; }
  .schedule-card .text-link, .schedule-card form { grid-column: 2 / -1; }
  .page-hero { padding-top: 42px; }
  .section-heading { align-items: flex-start; }
  .profile-name-form { align-items: stretch; }
  .profile-name-form label { width: 100%; }
  .member-tab { padding: 11px 12px; }
  .lottery-result-row { align-items: flex-start; flex-direction: column; }
  .lottery-result-actions { justify-content: flex-start; }
  .bag-row { grid-template-columns: 1fr auto; gap: 10px 14px; padding: 15px 4px; }
  .bag-name { grid-column: 1; }
  .bag-status { grid-column: 1; }
  .bag-action { grid-column: 2; grid-row: 1 / span 2; }
  .bag-recipient { min-width: 110px; }
  .bag-history li { grid-template-columns: 1fr auto; gap: 3px 10px; }
  .bag-history time { grid-column: 1 / -1; }
  .bag-history small { grid-column: 2; grid-row: 2; }
  .accounting-court-row { grid-template-columns: 1fr; }
  .accounting-court-row > p { text-align: left; }
  .accounting-reimbursement-row { grid-template-columns: 1fr; }
  .profile-editor label { min-width: 0; }
  .notification-item > div { min-width: 0; overflow-wrap: anywhere; }
  .bag-row > div { min-width: 0; overflow-wrap: anywhere; }
  .accounting-court-row > div { min-width: 0; overflow-wrap: anywhere; }
  .bag-row > .badge { grid-column: 2; grid-row: 1 / span 2; }
  .accounting-dues-form label { flex: 1 1 140px; }
  .table-wrap { margin-inline: 0; }
  .footer-row { flex-wrap: wrap; padding-block: 12px; gap: 4px 16px; }
  .footer-row span:last-child { flex-wrap: wrap; gap: 2px 16px; }
  .footer-row a { display: inline-flex; align-items: center; min-height: 44px; }
  input, select, textarea { font-size: 16px; }
}
@media (max-width: 480px) {
  :root { --page-gutter: 14px; }
  .container, .hero { width: calc(100% - 28px); }
  .nav { align-items: center; }
  .brand { font-size: 1rem; }
  .button { min-height: 44px; }
  .hero h1 { font-size: clamp(2rem, 11vw, 3rem); }
  .section-heading { align-items: center; }
  .section-heading h1 { font-size: 1.8rem; }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-card { padding: 10px 8px; font-size: .8rem; }
  .stat-card:first-child { padding-left: 0; }
  .stat-card strong { font-size: 1.4rem; }
  .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .attendance-row { grid-template-columns: 1fr; gap: 10px; }
  .attendance-choices { justify-content: flex-start; }
  .calendar-day { min-height: 80px; padding: 4px 2px; }
  .calendar-event { padding: 3px; font-size: .62rem; }
  .auth-panel { margin: 42px auto 64px; padding: 22px; }
  .footer-row { min-height: 62px; font-size: .72rem; }
  .bag-admin { grid-template-columns: 1fr; padding: 17px; }
  .bag-retire-list { grid-column: 1; }
  .bag-add-form input { width: 1%; flex: 1; }
  .court-reservation-form { padding: 16px; }
  .advance-registration-panel { padding: 16px; }
  .accounting-totals { grid-template-columns: 1fr; }
  .accounting-totals .stat-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .accounting-totals .stat-card strong { font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

.form-actions { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }

.push-settings { padding: 1rem 0; border-bottom: 1px solid var(--line, #dce3dc); margin-bottom: 1.5rem; }
.recipient-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: .5rem; max-height: 20rem; overflow: auto; padding: .75rem; }
.recipient-list label, .switch-label { display: flex; align-items: center; gap: .6rem; min-height: 44px; }
.recipient-list input, .switch-label input { width: 22px; height: 22px; flex: 0 0 22px; margin: 0; }

.text-button { min-width: 44px; }

[hidden] { display: none !important; }
.stacked-form .switch-label { display: flex; align-items: center; gap: .6rem; }

.notification-rule-list { margin-block: 1.5rem; border-top: 1px solid var(--line); }
.notification-rule-card { padding: 12px 4px; border-bottom: 1px solid var(--line); min-width: 0; }
.rule-overview { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.rule-heading { min-width: 0; }
.rule-heading h3 { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.rule-overview-controls { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.rule-actions, .preview-heading { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.rule-summary { margin: 4px 0 0; color: var(--muted); font-size: .83rem; overflow-wrap: anywhere; }
[data-rule-action-status]:empty { display: none; }
.notification-new > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; text-decoration: underline; text-underline-offset: .25em; color: var(--green); }
.notification-editor { padding-block: 1rem; }
.notification-schedule { padding: 1rem; border: 1px solid var(--line); min-width: 0; }
.schedule-mode-options { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin-bottom: 1rem; }
.stacked-form .schedule-mode-options label { display: flex; align-items: center; gap: .5rem; min-height: 44px; margin: 0; }
.schedule-mode-options input { width: 22px; height: 22px; margin: 0; flex: 0 0 22px; }
.notification-time-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: minmax(84px, auto); gap: .75rem; align-items: start; padding: 0; margin: 0; border: 0; min-width: 0; }
.notification-time-fields > label { min-width: 0; }
[data-relative-unit] { grid-column: 2; grid-row: 1; }
[data-relative-offset] { grid-column: 1; grid-row: 1; }
[data-relative-clock], [data-absolute-clock] { grid-column: 3; grid-row: 1; }
[data-absolute-date] { grid-column: 1 / 3; grid-row: 1; }
.template-help > summary, .notification-deliveries > summary { min-height: 44px; cursor: pointer; padding-block: .4rem; }
.template-tokens { display: flex; flex-wrap: wrap; gap: .5rem; margin-block: .5rem; }
.notification-preview { padding: 1rem; border-left: 3px solid var(--green); background: var(--paper); overflow-wrap: anywhere; }
.notification-preview h4 { margin: 0 0 .5rem; }
.preview-heading > label { min-width: 0; max-width: 100%; }
.notification-preview p, .notification-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.form-error { color: #a4362e; overflow-wrap: anywhere; }
.form-status { min-height: 1.5em; }
.rule-actions { justify-content: flex-start; margin-top: 1rem; }
.rule-actions form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; min-width: 0; margin: 0; }
.rule-actions select { min-width: 0; max-width: 100%; }
@media (max-width: 560px) {
  .notification-time-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(84px, auto)); }
  [data-relative-clock], [data-absolute-clock] { grid-column: 1 / -1; grid-row: 2; }
  [data-absolute-date] { grid-column: 1 / -1; }
}
.recipient-list { border: 1px solid var(--line); }
