:root {
  --accent: #1f4e8c;
  --gold: #f2b632;
  --ink: #1b2430;
  --muted: #5d6b7a;
  --line: #dde3ea;
  --bg: #f6f7f9;
  --card: #ffffff;
  --ok: #1e7a46;
  --warn: #9a6400;
  --bad: #b3261e;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 2px 8px rgba(16, 24, 40, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h2 { font-size: 1.3rem; margin-top: 1.2em; }
img { max-width: 100%; height: auto; }
code { background: #eef1f5; padding: .1em .35em; border-radius: 4px; font-size: .9em; }
code.big { font-size: 1.25rem; padding: .3em .6em; letter-spacing: .04em; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 480px; }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 10; }

/* header */
.announcement { background: var(--gold); color: #3a2a00; text-align: center; padding: 8px 16px; font-weight: 600; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand strong { display: block; font-size: 1.05rem; }
.brand small { display: block; color: var(--muted); font-size: .8rem; }
.site-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.site-nav a, .site-nav .linklike { padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--ink); font-weight: 500; }
.site-nav a:hover, .site-nav .linklike:hover { background: var(--bg); }
.site-nav .btn { color: #fff; }
.site-nav .nav-admin { color: var(--accent); font-weight: 700; }
.nav-sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.menu-toggle { display: none; }
@media (max-width: 860px) {
  .menu-toggle { display: inline-block; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 8px 12px; font: inherit; }
  .site-nav { display: none; position: absolute; top: 68px; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; padding: 8px 16px 16px; border-bottom: 1px solid var(--line); }
  .site-nav.open { display: flex; }
  .nav-sep { width: auto; height: 1px; margin: 6px 0; }
}

/* buttons and forms */
.btn { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 10px 18px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn-small { padding: 7px 12px; font-size: .9rem; }
.btn-light { background: #fff; color: var(--accent); }
.btn-ghost { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.7); }
.btn-ghost-dark { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-danger { background: var(--bad); }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
.linklike.danger, a.danger { color: var(--bad); }
.site-nav .linklike { text-decoration: none; }
form.inline { display: inline; }
.form label { display: block; font-weight: 600; margin-bottom: 14px; }
.form input:not([type=checkbox]):not([type=radio]), .form textarea, .form select, .search input {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; font-weight: 400;
  border: 1px solid #c7d0da; border-radius: 8px; background: #fff; color: var(--ink);
}
.form input[type=color] { width: 72px; height: 42px; padding: 4px; }
.form input:focus, .form textarea:focus, .form select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form small { display: block; font-weight: 400; margin-top: 4px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.row3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .row2, .row3 { grid-template-columns: 1fr; } }
.checks { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 14px; }
.checks label { font-weight: 500; margin: 0; display: flex; align-items: center; gap: 6px; }
.checks .inline-num input { width: 80px; display: inline-block; margin: 0 0 0 6px; }
.prefix-input { display: flex; align-items: stretch; margin-top: 6px; }
.prefix-input span { background: #eef1f5; border: 1px solid #c7d0da; border-right: 0; border-radius: 8px 0 0 8px; padding: 10px; font-weight: 400; color: var(--muted); }
.prefix-input input { margin-top: 0 !important; border-radius: 0 8px 8px 0 !important; }
.actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.segmented { border: 0; padding: 0; margin: 0 0 14px; }
.segmented legend { font-weight: 600; margin-bottom: 6px; }
.segmented label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; margin: 0 14px 6px 0; }
.search { display: flex; gap: 8px; margin-bottom: 16px; max-width: 480px; }
.search input { margin: 0; }

/* flashes */
.flashes { margin-top: 16px; }
.flash { padding: 12px 14px; border-radius: 8px; margin-bottom: 8px; background: #e8f0fb; border: 1px solid #c9daf3; }
.flash-success { background: #e7f5ec; border-color: #bfe3cc; }
.flash-error { background: #fdecea; border-color: #f5c4bf; }

/* hero and sections */
.hero { background: linear-gradient(135deg, var(--accent), #0e2a4f); color: #fff; padding: 56px 0; }
.hero-inner { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); }
.hero .lead { font-size: 1.15rem; opacity: .92; max-width: 40em; }
.hero-card { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); border-radius: var(--radius); padding: 20px; }
.hero-card h2 { margin-top: 0; color: var(--gold); }
@media (max-width: 760px) { .hero-inner { grid-template-columns: 1fr; } }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700; color: var(--gold); margin: 0 0 8px; }
.eyebrow a { color: inherit; text-decoration: none; }
.page-head { background: #fff; border-bottom: 1px solid var(--line); padding: 32px 0 20px; }
.page-head .eyebrow { color: var(--accent); }
.lead { font-size: 1.1rem; color: var(--muted); }
.section { padding-top: 28px; padding-bottom: 28px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.empty { color: var(--muted); padding: 16px 0; }
.note { margin-top: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card > h1:first-child, .card > h2:first-child { margin-top: 0; }
.form.card h2 { font-size: 1.05rem; border-top: 1px solid var(--line); padding-top: 16px; }
.form.card h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.4em; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.tile { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--gold); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.tile:hover { border-top-color: var(--accent); }
.tile p { margin: 0; color: var(--muted); }

/* events */
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.event-card { display: flex; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.event-card:hover { border-color: var(--accent); }
.event-card h3 { font-size: 1.05rem; margin: 0 0 2px; }
.event-card p { margin: 0 0 6px; font-size: .92rem; }
.datebox { flex: 0 0 58px; height: 62px; border-radius: 8px; background: var(--accent); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.datebox .mon { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); font-weight: 700; }
.datebox .day { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eef1f5; color: var(--muted); }
.badge-accent { background: #e8f0fb; color: var(--accent); }
.badge-yes { background: #e7f5ec; color: var(--ok); }
.badge-maybe { background: #fdf3dd; color: var(--warn); }
.badge-no { background: #fdecea; color: var(--bad); }
.event-layout { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; }
@media (max-width: 860px) { .event-layout { grid-template-columns: 1fr; } }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 20px; }
.facts dt { font-weight: 700; color: var(--muted); }
.facts dd { margin: 0; }
.rsvp-card { position: sticky; top: 88px; }
.rsvp-card h2 { margin-top: 0; }
.current { background: var(--bg); padding: 8px 10px; border-radius: 6px; }
.leader-links { border-top: 1px solid var(--line); padding-top: 12px; margin-bottom: 0; font-size: .92rem; }

/* tables */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #fafbfc; }
tr:last-child td { border-bottom: 0; }
tr.dim td { opacity: .55; }

/* admin */
.admin-layout { display: grid; grid-template-columns: 210px 1fr; gap: 28px; padding-top: 24px; padding-bottom: 40px; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 88px; align-self: start; }
.admin-nav a { padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 500; }
.admin-nav a:hover { background: #eaeef3; }
.admin-nav a.on { background: var(--accent); color: #fff; }
.admin-label { text-transform: uppercase; font-size: .75rem; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 0 0 6px 12px; }
.admin-main { min-width: 0; }
.admin-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.admin-head h1 { font-size: 1.7rem; margin-bottom: 4px; }
.admin-head p { margin: 0; }
@media (max-width: 760px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { position: static; flex-direction: row; overflow-x: auto; }
  .admin-nav a { white-space: nowrap; }
  .admin-label { display: none; }
}
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--muted); font-size: .9rem; box-shadow: var(--shadow); }
.stat span { display: block; font-size: 1.8rem; font-weight: 700; color: var(--ink); }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs a { padding: 6px 14px; border-radius: 999px; text-decoration: none; background: #eaeef3; color: var(--ink); font-weight: 500; }
.tabs a.on { background: var(--accent); color: #fff; }
.danger-zone { display: flex; gap: 10px; justify-content: flex-end; }
details.card summary { cursor: pointer; font-weight: 600; }
.log li { font-size: .92rem; }

/* footer */
.site-footer { background: #0e2a4f; color: #d7e0ea; margin-top: 40px; padding: 26px 0; }
.site-footer a { color: #fff; }
.site-footer .muted { color: #9fb1c4; }
.footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* sign-up and scouts */
.narrow-wide { max-width: 720px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.kids { margin-bottom: 16px; }
.kid-row { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 0 12px; align-items: end; border-bottom: 1px dashed var(--line); margin-bottom: 10px; }
.kid-row .kid-remove { display: flex; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; }
@media (max-width: 640px) { .kid-row { grid-template-columns: 1fr; } }
.kid-checks { border: 0; padding: 0; margin: 0 0 14px; }
.kid-checks legend { font-weight: 600; margin-bottom: 6px; }
.kid-checks label { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 0 0 6px; }
.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 12px 0 20px; }
.hero .lead { color: #fff; opacity: .92; }
.nowrap-inline { white-space: nowrap; }
.guardians { margin-bottom: 16px; }
.guardian-row { border-bottom: 1px dashed var(--line); margin-bottom: 12px; padding-bottom: 4px; }

.note { background: #eef4fb; border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 6px; margin: 0 0 16px; }

.brand img { width: 56px; height: 56px; flex: none; }
.hero-side { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.hero-logo { width: 200px; height: 200px; filter: drop-shadow(0 8px 18px rgba(0,0,0,.3)); }
.hero-side .hero-card { width: 100%; box-sizing: border-box; }
@media (max-width: 760px) { .hero-logo { width: 150px; height: 150px; order: -1; } .hero-inner > .hero-side { order: -1; } }

/* Monthly calendar */
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cal-title { margin: 0; text-align: center; flex: 1; }
.cal-sub { text-align: center; margin: 6px 0 16px; font-size: .9rem; }
.cal { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { background: #0e2a4f; color: #fff; font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; padding: 8px; text-align: center; }
.cal-day { min-height: 112px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); padding: 4px 5px 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-row .cal-day:first-child { border-left: 0; }
.cal-day.out { background: #f6f7f9; }
.cal-day.out .cal-num { color: #a0a8b4; }
.cal-day.past .chip { opacity: .65; }
.cal-num { font-size: .8rem; font-weight: 600; color: var(--muted); align-self: flex-end; width: 24px; height: 24px; line-height: 24px; text-align: center; border-radius: 50%; }
.cal-day.today { background: #fff9e8; }
.cal-day.today .cal-num { background: var(--gold); color: #0e2a4f; }
.chip { display: block; font-size: .74rem; line-height: 1.25; padding: 3px 6px; border-radius: 6px; background: #e3ecf8; color: #12355f; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid var(--accent); }
a.chip:hover { background: #cfdef2; }
.chip-weekly { background: #fff1d1; color: #5c4206; border-left-color: var(--gold); }
a.chip-weekly:hover { background: #ffe6ad; }
.chip-allday { background: var(--accent); color: #fff; border-left-color: #0e2a4f; }
a.chip-allday:hover { background: #173f73; }
.chip-planned { background: transparent; border: 1px dashed #d9b34a; border-left: 3px solid #e6c56b; color: #7a6320; }
.chip-going { font-weight: 700; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 14px; font-size: .85rem; color: var(--muted); }
.cal-legend .chip { display: inline-block; }
.cal-list { display: none; }
@media (max-width: 760px) {
  .cal { display: none; }
  .cal-list { display: block; }
  .cal-list-day { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .cal-list-day.today .cal-list-date span { background: var(--gold); }
  .cal-list-date { width: 48px; flex: none; text-align: center; }
  .cal-list-date b { display: block; font-size: .75rem; text-transform: uppercase; color: var(--muted); }
  .cal-list-date span { display: inline-block; font-size: 1.3rem; font-weight: 700; width: 38px; height: 38px; line-height: 38px; border-radius: 50%; }
  .cal-list-items { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
  .cal-list-items .chip { font-size: .9rem; padding: 8px 10px; white-space: normal; }
  .cal-list-items .chip small { display: block; opacity: .8; font-size: .78rem; }
}

/* Join form, notifications, roster */
.join-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 860px) { .join-layout { grid-template-columns: 1fr; } }
.kid-row3 { grid-template-columns: 2fr 0.7fr 1.3fr !important; }
@media (max-width: 640px) { .kid-row3 { grid-template-columns: 1fr 1fr !important; } .kid-row3 label:first-child { grid-column: 1 / -1; } }
.center { text-align: center; }
.actions.center { justify-content: center; }
.notif-badge { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: #d93025; color: #fff; font-size: .75rem; font-weight: 700; text-align: center; margin-left: 6px; line-height: 1.4; }
.notif-list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.notif-list li + li { border-top: 1px solid var(--line); }
.notif-list a { display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; padding: 12px 14px; color: inherit; text-decoration: none; align-items: center; }
.notif-list a:hover { background: #f4f7fb; }
.notif-list li.unread a { background: #fff8e6; font-weight: 600; }
.notif-list li.unread .notif-kind::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #d93025; margin-right: 6px; vertical-align: 1px; }
.notif-kind { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.notif-time { font-size: .85rem; font-weight: 400; }
@media (max-width: 640px) { .notif-list a { grid-template-columns: 1fr; gap: 2px; } }
.badge-new { background: #d93025; color: #fff; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin: 12px 0; }
.filters label { margin: 0; }
.facts { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; margin: 0; }
.facts dt { font-weight: 600; color: var(--muted); }
.facts dd { margin: 0; }
.pre { white-space: pre-wrap; }
tr[hidden] { display: none; }
@media print { .admin-nav, .site-header, .site-footer, .announcement, .no-print, .admin-head .btn, .tabs { display: none !important; } }
.filters label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .85rem; }
.filters select, .filters input[type=search] { font: inherit; font-weight: 400; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-width: 200px; }
.filters input[type=search] { min-width: 260px; }

/* Calendar sync */
.add-cal { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 20px; }
.add-cal-label { font-weight: 600; font-size: .9rem; color: var(--muted); margin-right: 4px; }
.sub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 20px 0 28px; }
@media (max-width: 900px) { .sub-grid { grid-template-columns: 1fr; } }
.sub-grid .card h2 { margin-top: 0; }
.steps { padding-left: 20px; margin: 10px 0; }
.steps li { margin: 4px 0; }
.copy-field { width: 100%; box-sizing: border-box; font: inherit; font-size: .85rem; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #f6f7f9; }
