:root {
  --navy: #071d36;
  --navy-2: #0b2b4e;
  --blue: #087dd2;
  --blue-bright: #21a9ef;
  --ice: #eef7fc;
  --white: #ffffff;
  --ink: #102a43;
  --muted: #60758a;
  --line: #d9e6ef;
  --success: #13875b;
  --danger: #b72f45;
  --warning: #b56a09;
  --shadow: 0 24px 70px rgba(7, 29, 54, 0.14);
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--white);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--white); color: var(--ink); }
body.dialog-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.skip-link { position: fixed; z-index: 200; left: 1rem; top: -4rem; padding: .75rem 1rem; background: white; color: var(--navy); }
.skip-link:focus { top: 1rem; }

.site-header { height: 84px; padding: 0 clamp(1rem, 4vw, 4.5rem); display: flex; align-items: center; gap: 2rem; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; margin-right: auto; }
.brand img { width: 54px; height: 54px; object-fit: contain; border-radius: 50%; }
.brand span { display: grid; line-height: 1.05; }
.brand strong { letter-spacing: .08em; color: var(--navy); }
.brand small { margin-top: .3rem; color: var(--muted); font-size: .75rem; }
nav { display: flex; align-items: center; gap: 2rem; }
nav a { color: var(--ink); font-size: .92rem; font-weight: 650; text-decoration: none; }
nav a:hover { color: var(--blue); }
.header-actions { display: flex; gap: .6rem; }

.btn { min-height: 44px; border: 1px solid transparent; padding: .7rem 1.15rem; display: inline-flex; align-items: center; justify-content: center; font-weight: 750; cursor: pointer; text-decoration: none; transition: transform .2s, box-shadow .2s, background .2s; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(33,169,239,.42); outline-offset: 2px; }
.btn-primary { background: var(--blue); color: white; box-shadow: 0 10px 24px rgba(8,125,210,.25); }
.btn-primary:hover { background: #066fb9; }
.btn-ghost { border-color: var(--line); background: white; color: var(--navy); }
.btn-light { background: white; color: var(--navy); }
.btn-large { min-height: 52px; padding: .85rem 1.45rem; }
.btn-block { width: 100%; }

.hero { min-height: calc(100vh - 84px); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); background: linear-gradient(135deg, var(--navy) 0 50%, #0b3158 50% 100%); color: white; overflow: hidden; }
.hero-copy { padding: clamp(4rem, 9vw, 8rem) clamp(1.5rem, 7vw, 7rem); align-self: center; }
.eyebrow { margin: 0 0 1rem; color: var(--blue-bright); text-transform: uppercase; letter-spacing: .16em; font-size: .78rem; font-weight: 850; }
.hero h1 { margin: 0; max-width: 790px; font-size: clamp(3rem, 5.8vw, 6.2rem); line-height: .96; letter-spacing: -.055em; }
.hero h1 em { color: #7bcaf4; font-family: Georgia, serif; font-weight: 400; }
.hero-lead { max-width: 640px; margin: 1.7rem 0 0; color: #c9dae8; font-size: clamp(1.05rem, 1.45vw, 1.3rem); line-height: 1.65; }
.hero-actions { margin-top: 2rem; display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.text-link { color: white; font-weight: 700; text-decoration: none; }
.text-link span { margin-left: .45rem; transition: margin .2s; }
.text-link:hover span { margin-left: .75rem; }
.hero-facts { display: flex; gap: clamp(1.4rem, 4vw, 4rem); margin: 4rem 0 0; }
.hero-facts div { display: grid; border-left: 1px solid rgba(255,255,255,.22); padding-left: 1rem; }
.hero-facts dt { font-size: 1.25rem; font-weight: 850; }
.hero-facts dd { margin: .35rem 0 0; color: #9fb6c9; font-size: .8rem; }
.hero-visual { position: relative; min-height: 560px; margin: clamp(1.2rem, 3vw, 2.5rem) clamp(1.2rem, 3vw, 2.5rem) clamp(1.2rem, 3vw, 2.5rem) 0; overflow: hidden; box-shadow: var(--shadow); }
.hero-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(7,29,54,.65)); pointer-events: none; }
.hero-visual > img { width: 100%; height: 100%; object-fit: cover; }
.availability-card { position: absolute; z-index: 2; left: 1.4rem; right: 1.4rem; bottom: 1.4rem; padding: 1rem; display: flex; align-items: center; gap: .85rem; background: rgba(255,255,255,.94); color: var(--ink); backdrop-filter: blur(12px); }
.availability-card div { display: grid; gap: .2rem; }
.availability-card small { color: var(--muted); }
.status-dot { width: 12px; height: 12px; background: #1cb978; border-radius: 50%; box-shadow: 0 0 0 6px rgba(28,185,120,.15); }

.trust-strip { padding: 1.8rem clamp(1.5rem, 7vw, 7rem); display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); background: white; }
.trust-strip p { margin: 0; padding: .4rem 2rem; display: grid; gap: .35rem; border-left: 1px solid var(--line); }
.trust-strip p:first-child { border-left: 0; padding-left: 0; }
.trust-strip strong { color: var(--navy); }
.trust-strip span { color: var(--muted); font-size: .86rem; }
.section { padding: clamp(5rem, 9vw, 8rem) clamp(1.5rem, 7vw, 7rem); }
.section-heading { max-width: 780px; margin-bottom: 3rem; }
.section-heading.centered { margin-inline: auto; text-align: center; }
.section h2 { margin: 0; color: var(--navy); font-size: clamp(2.3rem, 4.5vw, 4.6rem); line-height: 1.06; letter-spacing: -.04em; }
.about { background: var(--ice); }
.about-grid { display: grid; grid-template-columns: minmax(0,.92fr) minmax(0,1.08fr); gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.about-photo { min-height: 520px; overflow: hidden; box-shadow: var(--shadow); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.large-copy { margin: 0 0 2.2rem; color: var(--navy); font-size: clamp(1.25rem, 2vw, 1.7rem); line-height: 1.5; }
.check-list { padding: 0; margin: 0; list-style: none; }
.check-list li { display: grid; grid-template-columns: 50px 1fr; gap: 1rem; padding: 1.2rem 0; border-top: 1px solid #cadde9; }
.check-list li > span { color: var(--blue); font-weight: 850; }
.check-list strong { color: var(--navy); }
.check-list p { margin: .35rem 0 0; color: var(--muted); line-height: 1.55; }
.steps { background: white; }
.steps-grid { display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps-grid article { min-height: 250px; padding: 2.2rem; border-left: 1px solid var(--line); }
.steps-grid article:first-child { border-left: 0; }
.steps-grid article > span { color: var(--blue); font-weight: 850; }
.steps-grid h3 { margin: 3.5rem 0 .8rem; color: var(--navy); font-size: 1.45rem; }
.steps-grid p { margin: 0; color: var(--muted); line-height: 1.6; }
.portal-cta { display: flex; align-items: center; justify-content: space-between; gap: 2rem; background: var(--blue); color: white; }
.portal-cta h2 { color: white; max-width: 820px; }
.portal-cta p:not(.eyebrow) { color: #d9f0fd; font-size: 1.1rem; }
.portal-cta .eyebrow { color: white; opacity: .74; }

footer { padding: 3rem clamp(1.5rem, 7vw, 7rem) 1.5rem; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; background: var(--navy); color: white; }
.footer-brand { display: flex; gap: 1rem; align-items: center; }
.footer-brand img { width: 70px; height: 70px; object-fit: cover; border-radius: 50%; }
.footer-brand div, footer > div:not(.footer-brand) { display: grid; align-content: start; gap: .5rem; }
.footer-brand span, footer > div > span { color: #8fa9bd; font-size: .85rem; }
footer a { color: white; text-decoration: none; }
.copyright { grid-column: 1 / -1; margin: 1.5rem 0 0; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.13); color: #8fa9bd; font-size: .82rem; }

.auth-dialog { width: min(460px, calc(100% - 2rem)); border: 0; padding: 2rem; box-shadow: 0 30px 100px rgba(7,29,54,.3); }
.auth-dialog::backdrop { background: rgba(4,20,38,.72); backdrop-filter: blur(4px); }
.dialog-close { position: absolute; top: .75rem; right: 1rem; border: 0; background: transparent; color: var(--muted); font-size: 2rem; cursor: pointer; }
.dialog-brand { display: flex; align-items: center; gap: .7rem; color: var(--navy); font-weight: 850; letter-spacing: .08em; }
.dialog-brand img { width: 44px; height: 44px; object-fit: contain; border-radius: 50%; }
.auth-dialog h2 { margin: 1.5rem 0 .45rem; color: var(--navy); font-size: 2rem; }
.auth-dialog > p { margin: 0 0 1.5rem; color: var(--muted); }
.auth-dialog form { display: grid; gap: 1rem; }
.auth-dialog label { display: grid; gap: .45rem; font-size: .88rem; font-weight: 750; color: var(--navy); }
.auth-dialog input, .auth-dialog select { min-height: 48px; width: 100%; border: 1px solid #c8d8e4; padding: .75rem; background: white; color: var(--ink); }
#register-fields { display: grid; gap: 1rem; }
#register-fields[hidden] { display: none; }
.form-error { min-height: 1.25rem; margin: 0; color: var(--danger); font-size: .86rem; }
.auth-switch { width: 100%; margin-top: 1rem; border: 0; background: transparent; color: var(--blue); font-weight: 700; cursor: pointer; }

body.authenticated > .site-header,
body.authenticated > #main,
body.authenticated > footer { display: none; }
.portal-app { min-height: 100vh; background: #f4f8fb; }
.portal-app:not([hidden]) { display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.app-sidebar { min-height: 100vh; padding: 1.5rem 1.2rem; display: flex; flex-direction: column; background: var(--navy); color: white; position: sticky; top: 0; height: 100vh; z-index: 40; }
.app-brand { display: flex; align-items: center; gap: .8rem; color: white; text-decoration: none; padding: 0 .45rem 1.7rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.app-brand img { width: 52px; height: 52px; object-fit: contain; border-radius: 50%; background: white; }
.app-brand span { display: grid; gap: .25rem; }
.app-brand strong { letter-spacing: .08em; }
.app-brand small { color: #8fa9bd; }
.app-nav { display: grid; gap: .35rem; margin-top: 1.5rem; }
.app-nav button { width: 100%; min-height: 46px; padding: .7rem .85rem; display: flex; align-items: center; gap: .8rem; border: 0; background: transparent; color: #bed0df; text-align: left; cursor: pointer; font-weight: 650; }
.app-nav button:hover, .app-nav button.active { background: rgba(33,169,239,.14); color: white; }
.nav-symbol { width: 26px; color: #5ec3f6; font-weight: 850; text-align: center; }
.sidebar-user { margin-top: auto; padding: 1rem .35rem .2rem; display: grid; grid-template-columns: 42px 1fr auto; gap: .65rem; align-items: center; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-user > div:nth-child(2) { min-width: 0; display: grid; gap: .18rem; }
.sidebar-user strong, .sidebar-user small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user small { color: #8fa9bd; font-size: .72rem; }
.sidebar-user button { width: 34px; height: 34px; border: 0; background: rgba(255,255,255,.08); color: white; cursor: pointer; }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--blue); font-size: .78rem; font-weight: 850; }
.app-column { min-width: 0; }
.app-topbar { min-height: 104px; padding: 1.2rem clamp(1.2rem, 4vw, 3.5rem); display: flex; align-items: center; gap: 1rem; background: white; border-bottom: 1px solid var(--line); }
.app-topbar > div { margin-right: auto; }
.app-topbar p { margin: 0 0 .28rem; color: var(--blue); text-transform: uppercase; letter-spacing: .14em; font-size: .7rem; font-weight: 850; }
.app-topbar h1 { margin: 0; color: var(--navy); font-size: clamp(1.65rem, 3vw, 2.25rem); line-height: 1.1; }
.support-link { display: grid; gap: .15rem; text-align: right; text-decoration: none; }
.support-link span { color: var(--muted); font-size: .78rem; }
.support-link strong { color: var(--navy); }
.mobile-menu { display: none; border: 1px solid var(--line); background: white; color: var(--navy); width: 42px; height: 42px; }
.portal-content { padding: clamp(1.2rem, 4vw, 3.5rem); }
.content-intro { margin-bottom: 1.5rem; display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.content-intro h2 { margin: 0; color: var(--navy); font-size: clamp(1.6rem, 3vw, 2.45rem); letter-spacing: -.035em; }
.content-intro p { margin: .45rem 0 0; color: var(--muted); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.stat-card, .panel-card { background: white; border: 1px solid var(--line); box-shadow: 0 12px 36px rgba(7,29,54,.055); }
.stat-card { min-height: 145px; padding: 1.25rem; display: flex; flex-direction: column; }
.stat-card small { color: var(--muted); font-weight: 700; }
.stat-card strong { margin-top: auto; color: var(--navy); font-size: 1.85rem; line-height: 1.05; }
.stat-card span { margin-top: .35rem; color: var(--muted); font-size: .76rem; }
.stat-card.accent { background: var(--blue); border-color: var(--blue); }
.stat-card.accent small, .stat-card.accent strong, .stat-card.accent span { color: white; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 1.2rem; }
.panel-card { padding: 1.35rem; min-width: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-heading h3 { margin: 0; color: var(--navy); font-size: 1.15rem; }
.panel-heading p { margin: .25rem 0 0; color: var(--muted); font-size: .84rem; }
.badge { display: inline-flex; align-items: center; min-height: 27px; padding: .25rem .55rem; background: var(--ice); color: var(--blue); font-size: .72rem; font-weight: 800; white-space: nowrap; }
.badge.success { background: #e9f7f1; color: var(--success); }
.badge.warning { background: #fff3df; color: var(--warning); }
.badge.danger { background: #fdecef; color: var(--danger); }
.list { display: grid; }
.list-row { min-width: 0; padding: .9rem 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.list-row .primary { display: grid; gap: .28rem; min-width: 0; }
.list-row .primary strong { color: var(--navy); }
.list-row .primary span { color: var(--muted); font-size: .82rem; }
.list-actions { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
.btn-small { min-height: 36px; padding: .45rem .7rem; font-size: .78rem; }
.btn-danger { border-color: #f2cbd2; background: white; color: var(--danger); }
.btn-success { background: var(--success); color: white; }
.btn-warning { background: #fff3df; color: var(--warning); }
.empty-state { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }
.empty-state strong { display: block; margin-bottom: .4rem; color: var(--navy); }
.progress-track { height: 9px; margin-top: 1.1rem; overflow: hidden; border-radius: 8px; background: #dbeaf3; }
.progress-track span { display: block; height: 100%; background: var(--blue); border-radius: inherit; }
.filters { margin-bottom: 1rem; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.filters input, .filters select, .form-grid input, .form-grid select, .form-grid textarea, .table-select { min-height: 43px; border: 1px solid #cbdbe6; background: white; color: var(--ink); padding: .65rem .75rem; }
.filters input { min-width: min(320px, 100%); }
.slot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.slot-card { padding: 1.15rem; display: grid; gap: .9rem; background: white; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(7,29,54,.05); }
.slot-date { color: var(--blue); font-size: .78rem; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.slot-time { color: var(--navy); font-size: 1.7rem; font-weight: 850; }
.slot-meta { display: grid; gap: .35rem; color: var(--muted); font-size: .84rem; }
.package-current, .package-request { margin-bottom: 1rem; }
.membership-requests { margin-bottom: 1rem; }
.package-current .panel-heading, .package-request .panel-heading { margin-bottom: 0; }
.package-request > form { margin-top: 1rem; }
.package-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.packages-with-summary { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.2rem; align-items: start; }
.packages-with-summary .package-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.family-total-card { position: sticky; top: 1rem; }
.family-total-card h3 { margin: 0; color: var(--navy); font-size: 1.2rem; }
.family-total-card > p { margin: .3rem 0 1rem; color: var(--muted); font-size: .82rem; }
.family-price-list { display: grid; border-top: 1px solid var(--line); }
.family-price-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .8rem; align-items: center; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.family-price-row > div:first-child { min-width: 0; display: grid; gap: .22rem; }
.family-price-row strong { color: var(--navy); }
.family-price-row small { color: var(--muted); line-height: 1.35; }
.family-row-price { display: grid; justify-items: end; gap: .2rem; white-space: nowrap; }
.family-row-price span, .discount-note { color: var(--success); font-size: .75rem; font-weight: 800; }
.family-total-footer { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 1rem 0 .7rem; color: var(--navy); font-weight: 850; }
.family-total-footer strong { color: var(--blue); font-size: 1.3rem; }
.family-discount-rule, .family-total-empty { display: block; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.family-total-empty { padding: 1rem 0; border-top: 1px solid var(--line); }
.family-qr-card { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 2rem; align-items: center; }
.family-qr-code { padding: 1rem; background: #fff; border: 1px solid var(--line); }
.family-qr-svg { display: block; width: 100%; height: auto; }
.family-qr-details { min-width: 0; }
.family-qr-details > small { color: var(--blue); font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.family-qr-details h3 { margin: .35rem 0; color: var(--navy); font-size: 2rem; }
.family-qr-details > p { color: var(--muted); }
.family-qr-members { display: grid; gap: .45rem; margin: 1.2rem 0; padding: 1rem; background: var(--ice); }
.family-qr-members strong { margin-bottom: .2rem; color: var(--navy); }
.family-qr-members span { color: var(--ink); }
.qr-slot-picker { margin-bottom: 1.2rem; }
.qr-slot-picker .inline-form select { min-width: min(520px, 100%); }
.attendance-family-grid { display: grid; gap: .8rem; }
.attendance-person-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: 1rem; border: 1px solid var(--line); background: var(--soft); }
.attendance-person-card small { color: var(--blue); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.attendance-person-card h4 { margin: .2rem 0; color: var(--navy); font-size: 1.1rem; }
.attendance-person-card p { margin: 0; color: var(--muted); font-size: .8rem; }
.attendance-person-action { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .55rem; }
.attendance-choice { cursor: pointer; }
.attendance-choice input { position: absolute; opacity: 0; pointer-events: none; }
.attendance-choice span { display: inline-flex; min-height: 40px; align-items: center; padding: .55rem .8rem; border: 2px solid var(--line); background: #fff; color: var(--navy); font-weight: 800; }
.attendance-choice.present input:checked + span { border-color: var(--success); background: #e9f7f1; color: var(--success); }
.attendance-choice.absent input:checked + span { border-color: var(--danger); background: #fdecef; color: var(--danger); }
.attendance-choice input:focus + span { outline: 3px solid rgba(33,169,239,.25); outline-offset: 2px; }
.qr-attendance-submit { margin-top: 1rem; justify-content: flex-end; }
.package-choice-card { min-height: 250px; padding: 1.35rem; display: flex; flex-direction: column; gap: .7rem; background: white; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(7,29,54,.05); }
.package-choice-card small { color: var(--blue); font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.package-choice-card h3 { margin: 0; color: var(--navy); font-size: 1.35rem; }
.package-choice-card strong { color: var(--navy); font-size: 1.1rem; }
.package-choice-card > span { color: var(--muted); }
.package-choice-card form { margin-top: auto; }
.package-choice-card .btn { width: 100%; }
.profile-children { margin-top: 1.25rem; }
.family-memberships { margin-bottom: 1.2rem; }
.child-profile { padding: .25rem 0 1rem; border-top: 1px solid var(--line); }
.child-profile:first-child { border-top: 0; }
.child-profile > form { margin-top: .75rem; }
.membership-line { display: block; padding: .35rem 0; }
.membership-line small { display: block; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th { padding: .75rem; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; text-align: left; border-bottom: 1px solid var(--line); }
.data-table td { padding: .85rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table strong { color: var(--navy); }
.subtle { display: block; margin-top: .2rem; color: var(--muted); font-size: .75rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.form-grid label { display: grid; gap: .42rem; color: var(--navy); font-size: .84rem; font-weight: 750; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid textarea { min-height: 90px; resize: vertical; }
.weekday-fieldset { border: 1px solid var(--line); padding: 1rem; margin: 0; }
.weekday-fieldset legend { padding: 0 .4rem; color: var(--navy); font-size: .84rem; font-weight: 800; }
.weekday-options { display: flex; flex-wrap: wrap; gap: .65rem; margin-bottom: .65rem; }
.form-grid .weekday-option { display: flex; grid-template-columns: none; flex-direction: row; align-items: center; gap: .4rem; padding: .55rem .7rem; border: 1px solid var(--line); background: var(--soft); cursor: pointer; }
.form-grid .weekday-option input { width: auto; min-height: 0; margin: 0; padding: 0; accent-color: var(--blue); }
.settings-card { max-width: 720px; }
.action-dialog { width: min(620px, calc(100% - 2rem)); border: 0; padding: 2rem; box-shadow: 0 30px 100px rgba(7,29,54,.3); }
.action-dialog::backdrop { background: rgba(4,20,38,.72); backdrop-filter: blur(4px); }
.action-dialog h2 { margin: 0; color: var(--navy); font-size: 1.75rem; }
.action-dialog > p { color: var(--muted); }
.action-dialog form { margin-top: 1.5rem; }
.toast { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 200; max-width: min(420px, calc(100% - 2.4rem)); padding: .9rem 1rem; background: var(--navy); color: white; box-shadow: var(--shadow); transform: translateY(140%); opacity: 0; transition: .25s; }
.toast.visible { transform: translateY(0); opacity: 1; }
.toast.error { background: var(--danger); }
.loading { min-height: 45vh; display: grid; place-items: center; color: var(--muted); }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slot-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .package-choice-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .packages-with-summary { grid-template-columns: minmax(0, 1fr) 280px; }
  .packages-with-summary .package-choice-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  nav { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding-bottom: 3rem; }
  .hero-visual { min-height: 430px; margin: 0 1.5rem 1.5rem; }
  .trust-strip { grid-template-columns: 1fr; }
  .trust-strip p, .trust-strip p:first-child { padding: 1rem 0; border-left: 0; border-top: 1px solid var(--line); }
  .trust-strip p:first-child { border-top: 0; }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { min-height: 420px; }
  .portal-app:not([hidden]) { grid-template-columns: 1fr; }
  .app-sidebar { position: fixed; left: 0; width: 270px; transform: translateX(-100%); transition: transform .22s; box-shadow: var(--shadow); }
  .portal-app.menu-open .app-sidebar { transform: translateX(0); }
  .mobile-menu { display: inline-grid; place-items: center; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .packages-with-summary { grid-template-columns: 1fr; }
  .packages-with-summary .package-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .family-total-card { position: static; grid-row: 1; }
  .family-qr-card { grid-template-columns: minmax(220px, 320px) minmax(0, 1fr); }
}

@media (max-width: 680px) {
  .site-header { height: 72px; gap: .5rem; padding-inline: .8rem; }
  .brand img { width: 46px; height: 46px; }
  .brand span { display: none; }
  .header-actions { margin-left: auto; }
  .header-actions .btn { padding-inline: .8rem; }
  .hero { min-height: auto; }
  .hero-copy { padding: 3.5rem 1.2rem 2.8rem; }
  .hero-facts { margin-top: 2.6rem; gap: 1rem; justify-content: space-between; }
  .hero-facts div { padding-left: .7rem; }
  .hero-visual { min-height: 340px; margin: 0; }
  .availability-card { left: .8rem; right: .8rem; bottom: .8rem; }
  .trust-strip, .section { padding-inline: 1.2rem; }
  .about-photo { min-height: 300px; }
  .steps-grid { grid-template-columns: 1fr; }
  .steps-grid article { min-height: 190px; border-left: 0; border-top: 1px solid var(--line); }
  .steps-grid article:first-child { border-top: 0; }
  .steps-grid h3 { margin-top: 2rem; }
  .portal-cta { align-items: flex-start; flex-direction: column; }
  footer { grid-template-columns: 1fr; }
  .copyright { grid-column: auto; }
  .support-link { display: none; }
  .app-topbar { min-height: 86px; }
  .portal-content { padding: 1rem; }
  .stats-grid, .slot-grid { grid-template-columns: 1fr; }
  .package-choice-grid { grid-template-columns: 1fr; }
  .packages-with-summary .package-choice-grid { grid-template-columns: 1fr; }
  .family-qr-card { grid-template-columns: 1fr; }
  .family-qr-code { width: min(100%, 340px); margin-inline: auto; }
  .attendance-person-card { grid-template-columns: 1fr; align-items: start; }
  .attendance-person-action { justify-content: flex-start; }
  .stat-card { min-height: 125px; }
  .content-intro { align-items: flex-start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
}

/* Classic PHP pages */
.site-header .brand img, .portal-brand img, .auth-card img { object-fit: cover; }
.portal-app.classic { display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.app-nav a { width: 100%; min-height: 46px; padding: .7rem .85rem; display: flex; align-items: center; gap: .8rem; color: #bed0df; text-decoration: none; font-weight: 650; }
.app-nav a:hover, .app-nav a.active { background: rgba(33,169,239,.14); color: white; }
.logout-form { margin-top: 1rem; }
.app-sidebar .logout-form button { width: 100%; background: rgba(255,255,255,.08); color: white; border-color: rgba(255,255,255,.3); }
.app-sidebar .logout-form button:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.5); }
.auth-card .auth-logout { margin-top: 12px; }
.auth-card .auth-logout button { color: var(--navy); border-color: var(--line); }
.auth-page { min-height: 100vh; padding: 2rem 1rem; display: grid; place-items: center; background: linear-gradient(145deg, #eef8ff, #fff); }
.auth-card { width: min(480px, 100%); padding: 2rem; background: white; border: 1px solid var(--line); box-shadow: var(--shadow); }
.auth-card > a > img, .auth-card > img { width: 76px; height: 76px; border-radius: 50%; }
.auth-card h1 { margin: 1rem 0 .35rem; color: var(--navy); }
.auth-card > p { color: var(--muted); }
.auth-card form { display: grid; gap: 1rem; margin-top: 1.5rem; }
.auth-card label, .stack-form label { display: grid; gap: .42rem; color: var(--navy); font-weight: 750; font-size: .9rem; }
.auth-card input, .stack-form input, .stack-form select, .stack-form textarea { width: 100%; min-height: 46px; border: 1px solid #cbdbe6; background: white; color: var(--ink); padding: .7rem .8rem; }
.auth-card .switch-link { display: block; margin-top: 1.2rem; color: var(--blue); text-align: center; }
.auth-card .consent-check { display: flex; grid-template-columns: none; flex-direction: row; align-items: flex-start; gap: .65rem; line-height: 1.5; }
.auth-card .consent-check input { width: 20px; min-width: 20px; height: 20px; min-height: 20px; margin-top: .1rem; padding: 0; accent-color: var(--blue); }
.auth-card .consent-check a { color: var(--blue); }
.statute-summary { margin: 1rem 0 1.25rem; padding: 1rem; background: var(--ice); color: var(--ink); line-height: 1.6; }
.notice { margin: 1rem 0; padding: .85rem 1rem; border-left: 4px solid var(--blue); background: #edf8ff; color: var(--navy); }
.notice.error { border-color: #d84d4d; background: #fff0f0; color: #8f2525; }
.notice.success { border-color: #17875b; background: #edf9f4; color: #116342; }
.stack-form { display: grid; gap: 1rem; }
.form-actions, .inline-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.inline-form { display: inline-flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.inline-form input, .inline-form select { min-height: 38px; border: 1px solid #cbdbe6; padding: .45rem .55rem; }
.two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.details-card { border-top: 1px solid var(--line); padding: 1rem 0; }
.details-card summary { cursor: pointer; color: var(--blue); font-weight: 750; }
.details-card[open] summary { margin-bottom: 1rem; }
.muted { color: var(--muted); }
.empty-state { grid-column: 1 / -1; }
.simple-page .auth-card { text-align: center; }
.portal-footer { padding: 1rem clamp(1rem, 4vw, 3rem); color: var(--muted); font-size: .82rem; }
.money { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--navy); }
.package-price-list { display: grid; gap: .45rem; margin: .8rem 0 1rem; padding: .8rem; background: var(--ice); color: var(--muted); }
.package-price-list span { display: flex; justify-content: space-between; gap: 1rem; }
.package-price-list strong { color: var(--navy); }
.package-admin-row { padding: .2rem 0; border-bottom: 1px solid var(--line); }
.package-admin-row:last-child { border-bottom: 0; }
.month-filter { display: flex; flex-wrap: wrap; gap: .7rem; align-items: end; }
.month-filter label { display: grid; gap: .35rem; color: var(--navy); font-weight: 750; font-size: .85rem; }
.month-filter input { min-height: 44px; border: 1px solid #cbdbe6; padding: .55rem .7rem; }
.finance-currency { margin-bottom: 1.3rem; }
.finance-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-card.negative { border-color: #e6b3b3; background: #fff4f4; }
.stat-card.negative strong { color: #b62929; }
.finance-columns { align-items: start; }
.finance-entry .list-actions { flex-wrap: nowrap; }
.expense-money { color: #b62929; }
.finance-overview { margin-bottom: 1.25rem; }
.finance-overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.finance-overview-grid > div { display: grid; gap: .35rem; padding: 1rem; background: var(--ice); }
.finance-overview-grid strong { color: var(--blue); }
.finance-overview-grid span { color: var(--muted); }
.finance-overview-grid b { color: var(--navy); }
@media (max-width: 900px) {
  .portal-app.classic { display: block; }
  .portal-app.classic .app-sidebar { position: relative; width: 100%; height: auto; min-height: 0; transform: none; }
  .portal-app.classic .app-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-app.classic .sidebar-user { display: none; }
}
@media (max-width: 680px) {
  .two-columns { grid-template-columns: 1fr; }
  .finance-stats, .finance-overview-grid { grid-template-columns: 1fr; }
  .month-filter { width: 100%; }
  .month-filter label, .month-filter input, .month-filter .btn { width: 100%; }
  .finance-entry { align-items: flex-start; }
  .finance-entry .list-actions { align-items: flex-end; flex-direction: column; }
  .portal-app.classic .app-nav { grid-template-columns: 1fr; }
  .auth-card { padding: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media print {
  .app-sidebar, .app-topbar, .portal-footer, .qr-page-actions { display: none !important; }
  .portal-app.classic { display: block; background: #fff; }
  .portal-content { padding: 0; }
  .family-qr-card { width: 170mm; min-height: 110mm; margin: 0 auto; border: 1px solid #ccd8e1; box-shadow: none; grid-template-columns: 70mm 1fr; }
  .family-qr-details .notice, .family-qr-details > .muted { display: none; }
}
