*{box-sizing:border-box}
body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;margin:0;background:#f6f7fb;color:#1a1a1a}
header{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;background:#111;color:#fff}
header h1{font-size:18px;margin:0}
header h1 a{color:#fff;text-decoration:none}
header h1 a:hover,header h1 a:focus,header h1 a:active,header h1 a:visited{color:#fff;text-decoration:none}
nav a{color:#fff;text-decoration:none}
main{max-width:1100px;margin:24px auto;padding:0 16px}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:16px}
.card{background:#fff;border-radius:14px;box-shadow:0 4px 12px rgba(0,0,0,.06);padding:16px;margin-bottom:6px}
h2{margin:8px 0 16px}
h3{margin:6px 0 10px}
.list{width:100%;border-collapse:collapse}
.list th,.list td{padding:8px;border-bottom:1px solid #e8e8ef;vertical-align:top}
.flash{background:#e8f6ee;color:#0f5d2f;padding:10px;border-radius:8px}
.error{background:#ffe8e8;color:#7a0000;padding:10px;border-radius:8px}
.badge{display:inline-block;padding:3px 8px;border-radius:999px;font-size:12px}
.badge.success{background:#e6fbf0;color:#0b7042}
button,.button{display:inline-block;background:#111;color:#fff;border:0;border-radius:10px;padding:8px 12px;cursor:pointer;text-decoration:none}
button.primary,.button.primary{background:#2563eb}
button.danger{background:#b91c1c}
button:disabled{opacity:.6;cursor:not-allowed}
.inline{display:inline}
.stack label{display:block;margin:8px 0}
.stack .actions{display:flex;gap:8px;align-items:center;margin-top:8px}
details summary{cursor:pointer;color:#2563eb}
.auth{display:grid;place-items:center;height:100vh;background:#0f172a;color:#000;}
.auth .card{width:360px}
.auth .card .logo{display:block;max-width:120px;height:auto;margin:0 auto 16px auto}
.auth .card .subtitle{text-align:center;color:#666;font-size:14px;margin:8px 0 24px 0;font-weight:500}
input,select,textarea{width:100%;padding:8px;border:1px solid #d9d9e3;border-radius:8px;background:#fff}
.modal{position:fixed;inset:0;background:rgba(0,0,0,.45);display:flex;align-items:center;justify-content:center;padding:16px}
.modal.hidden{display:none}

/* Avatar dropdown */
.nav-avatar-wrap{position:relative}
.avatar-menu{position:absolute;right:0;top:calc(100% + 6px);background:#fff;color:#111;border:1px solid #e8e8ef;border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.18);min-width:160px;padding:6px;z-index:1000}
.avatar-menu a{display:block;padding:8px 10px;border-radius:8px;color:#111;text-decoration:none}
.avatar-menu a:hover,.avatar-menu a:focus{background:#f5f5f7}

/* My Family subcards */
.family-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px}
.person-card{background:#fff;border:1px solid #e8e8ef;border-radius:12px;padding:12px;box-shadow:0 1px 4px rgba(0,0,0,.06)}
.person-card:hover{box-shadow:0 2px 8px rgba(0,0,0,.08)}
.person-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}
.person-header-left{display:flex;align-items:center;gap:10px}
.person-name{font-weight:600}
.avatar{width:56px;height:56px;border-radius:50%;object-fit:cover;background:#f2f3f7;border:1px solid #e8e8ef}
.avatar.avatar-initials{display:flex;align-items:center;justify-content:center;font-weight:700;color:#555}
.badge.child{background:#e6fbf0;color:#0b7042}
.badge.parent{background:#e6f0ff;color:#1e40af}
.person-meta{font-size:12px;color:#555;display:grid;gap:2px;margin-top:6px}
.person-actions{margin-top:8px;display:flex;justify-content:flex-end}
.modal-content{background:#fff;max-width:520px;width:100%;border-radius:16px;padding:16px;position:relative}
.modal .close{position:absolute;right:8px;top:8px;background:#eee;color:#333;border-radius:50%;width:32px;height:32px;line-height:28px;font-size:20px;border:0; padding-top: 3px; padding-left: 10px;}
.small{font-size:12px;color:#555}
.welcome-banner{font-size:48px;font-weight:700;text-align:center;margin:12px 0 16px}
input[type=checkbox],input[type=radio]{width:auto;height:auto;padding:0;border:0;vertical-align:middle}
.summary-lines p{margin:2px 0}
.announcement{background:#fff7e6;border:1px solid #ffd699;color:#7a4a00;padding:10px;border-radius:8px}
.description{padding-bottom:10px}

/* RSVP status styles */
.rsvp-status{padding:8px 12px;border-radius:10px}
.rsvp-status.rsvp-yes{background:#e8f6ee;color:#0f5d2f}
.rsvp-status.rsvp-maybe,.rsvp-status.rsvp-no{background:#f5f5f7;color:#444}
.rsvp-status .button{margin-left:8px}

/* Volunteers */
.volunteers .role{padding:6px 8px;border:1px solid #e8e8ef;border-radius:8px;background:#fff}
.volunteers .role + .role{margin-top:8px}
.volunteers .remaining{color:#555}
.volunteers .filled{color:#777}
.volunteers .role ul{margin:6px 0 0 16px;padding:0}
.volunteers .role li{margin:2px 0}

/* Event hero image: float right on desktop, stack on mobile (approx 40% width on web) */
.event-hero{float:right;margin:0 0 8px 16px;border-radius:8px;height:auto;width:40%;min-width:240px;max-width:380px}
@media (max-width:640px){
  .event-hero{float:none;display:block;margin:0 auto 8px auto;width:100%;max-width:100%}
}

/* Event thumbnail in events list: small image that doesn't widen the card */
.event-thumb{float:right;margin:0 0 8px 12px;border-radius:8px;height:auto;width:160px;max-width:40%}
@media (max-width:640px){
  .event-thumb{float:none;display:block;margin:0 auto 8px auto;width:100%;max-width:100%}
}

/* Public event page enhancements */
.bottom-banner{position:fixed;left:0;right:0;bottom:0;background:#111;color:#fff;padding:18px 20px calc(18px + env(safe-area-inset-bottom));min-height:72px;font-size:18px;display:flex;align-items:center;justify-content:center;gap:12px;box-shadow:0 -4px 12px rgba(0,0,0,.2);z-index:1000}
.bottom-banner .prompt{flex:0 0 auto;text-align:center;font-weight:600;margin-right:10px}
.bottom-banner .actions{display:flex;gap:10px;align-items:center}
.event-hero-top{display:block;width:100%;height:auto;max-height:360px;object-fit:cover;border-radius:8px;margin:0 0 12px 0}

/* Top nav layout: split left/right groups; admin bar styling */
header nav{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
header nav .nav-left,header nav .nav-right{display:flex;align-items:center;gap:12px}
header nav .nav-right{margin-left:auto}
/* Top-right nav avatar */
.nav-avatar{width:28px;height:28px;border-radius:50%;object-fit:cover;border:1px solid #e8e8ef;vertical-align:middle}
.nav-avatar-initials{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background:#f2f3f7;color:#555;font-weight:700;font-size:12px;border:1px solid #e8e8ef;vertical-align:middle}
.nav-avatar-link{display:inline-flex;align-items:center;justify-content:center}
.admin-bar{background:#222;color:#fff;padding:6px 16px;display:flex;align-items:center;gap:12px;justify-content:flex-end;flex-wrap:wrap}
.admin-bar a{color:#fff;text-decoration:none}
.hidden{display:none}

/* Email token authentication status */
.email-auth-status{color:#ccc;font-size:12px;font-style:italic}

/* Events list view */
.events-list{width:100%;border-collapse:collapse}
.events-list th{text-align:left;padding:12px 8px;border-bottom:2px solid #e8e8ef;font-weight:600;color:#555;font-size:12px;text-transform:uppercase}
.events-list td{padding:12px 8px;border-bottom:1px solid #f0f0f0;vertical-align:top}
.events-list tr:last-child td{border-bottom:none}
.events-list tr:hover{background:#f9f9fb}
.events-list td:first-child{font-weight:500}
.events-list a{text-decoration:none;color:#2563eb}
.events-list a:hover{text-decoration:underline}
@media (max-width:768px){
  .events-list th:nth-child(3),.events-list td:nth-child(3){display:none}
}
