:root {
  --brand: #7a7a7a;
  --brand-dark: #5f5e5a;
  --tan: #b5a48d;
  --ink: #1f2933;
  --muted: #7b8794;
  --line: #eceff2;
  --bg: #f8f8f6;
  --card: #fff;
  --ok-bg: #e7f6ef; --ok: #0f6e56;
  --warn-bg: #fdf3e0; --warn: #8a5a0b;
  --err-bg: #fdecec; --err: #a32d2d;
  --info-bg: #e8f1fb; --info: #1b5aa0;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
main { flex: 1; }
a { color: var(--brand-dark); }
h1 { font-size: 1.6rem; font-weight: 500; }
.muted { color: var(--muted); font-size: .9rem; }
.container { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem 3rem; width: 100%; }
.narrow { max-width: 460px; margin: 0 auto; }

/* Nav */
.nav { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.nav-inner { max-width: 1100px; margin: 0 auto; padding: .6rem 1.5rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--brand); }
.brand-bee { width: 38px; height: 38px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: 'Cinzel', Georgia, serif; font-size: .9rem; letter-spacing: .14em; text-transform: uppercase; color: #333; }
.brand-sub { font-family: 'Allura', 'Brush Script MT', cursive; font-size: 1.05rem; color: #9a9a9a; }
.nav-links { display: flex; gap: .15rem; flex: 1; flex-wrap: wrap; }
.nav-links a { padding: .4rem .75rem; border-radius: 8px; font-size: .9rem; color: #6b7280; text-decoration: none; }
.nav-links a:hover { background: #f3f4f6; color: #111; }
.nav-links a.on { background: #f0efec; color: #111; font-weight: 500; }
.nav-user { display: flex; align-items: center; gap: .5rem; }
.nav-user form { display: inline; }
.nav-name { font-size: .88rem; color: var(--muted); text-decoration: none; }
.nav-name:hover { text-decoration: underline; }

/* Flash */
.flash { max-width: 1100px; margin: 1rem auto 0; padding: .7rem 1rem; border-radius: 10px; font-size: .92rem; width: calc(100% - 3rem); }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-err { background: var(--err-bg); color: var(--err); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .5rem 1rem; font-size: .9rem; font-weight: 500; border-radius: 9px; border: 1px solid #d9dde3; background: #fff; color: #374151; cursor: pointer; text-decoration: none; font-family: inherit; }
.btn:hover { background: #f5f6f7; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { background: var(--err-bg); border-color: #f3caca; color: var(--err); }
.btn-danger:hover { background: #fbdcdc; }
.btn-sm { padding: .3rem .7rem; font-size: .82rem; }
.btn-block { width: 100%; }

/* Cards & layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.card + .card { margin-top: 1.25rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.card-title { font-size: 1rem; font-weight: 500; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-2 > .card + .card { margin-top: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-5-3 { display: grid; grid-template-columns: 3fr 2fr; gap: 1.25rem; align-items: start; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stack > * + * { margin-top: 1.25rem; }
.row { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: .92rem; font-weight: 500; }
.row-sub { font-size: .8rem; color: var(--muted); }
.actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.actions form { display: inline; }
.empty { text-align: center; color: var(--muted); font-size: .9rem; padding: 1.5rem 0; }
.tile { display: block; text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; color: var(--ink); }
.tile:hover { border-color: var(--tan); }
.tile b { display: block; font-weight: 500; }
.tile span { font-size: .82rem; color: var(--muted); }

/* Badges / avatars */
.badge { display: inline-flex; padding: .12rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 500; white-space: nowrap; }
.badge-green { background: var(--ok-bg); color: var(--ok); }
.badge-amber { background: var(--warn-bg); color: var(--warn); }
.badge-red { background: var(--err-bg); color: var(--err); }
.badge-blue { background: var(--info-bg); color: var(--info); }
.badge-gray { background: #f0f1f3; color: #5b6470; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 500; flex-shrink: 0; }
.av-0 { background: #e0f3ec; color: #0f6e56; } .av-1 { background: #e4effb; color: #1b5aa0; }
.av-2 { background: #fbe8e4; color: #9a3a1f; } .av-3 { background: #ece9fb; color: #50479f; }
.av-4 { background: #fbf0dc; color: #86560b; }

/* Forms */
label { display: block; font-size: .82rem; color: #6b7280; margin-bottom: .25rem; }
input, select, textarea { width: 100%; padding: .55rem .75rem; border: 1px solid #d9dde3; border-radius: 9px; font-size: .92rem; font-family: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(122,122,122,.25); border-color: var(--brand); }
textarea { resize: vertical; min-height: 90px; }
.field { margin-bottom: .9rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.inline-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.inline-form select, .inline-form input { width: auto; }
.help { font-size: .78rem; color: var(--muted); margin-top: .2rem; }
.notice { padding: .65rem .9rem; border-radius: 9px; font-size: .84rem; margin-bottom: 1rem; }
.notice-info { background: var(--info-bg); color: var(--info); }
.notice-warn { background: var(--warn-bg); color: var(--warn); }
.notice-ok { background: var(--ok-bg); color: var(--ok); }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 1.1rem; background: #f3f4f6; padding: .5rem .8rem; border-radius: 8px; display: inline-block; letter-spacing: .04em; user-select: all; }

/* Auth pages */
.auth { max-width: 420px; margin: 1.5rem auto 0; }
.auth-brand { text-align: center; margin-bottom: 1.5rem; color: var(--brand); }
.auth-brand .bee { width: 64px; height: 64px; }
.auth-brand .n { font-family: 'Cinzel', Georgia, serif; letter-spacing: .15em; text-transform: uppercase; color: #333; }
.auth-brand .s { font-family: 'Allura', cursive; font-size: 1.3rem; color: #9a9a9a; }
.auth-foot { text-align: center; margin-top: 1rem; font-size: .88rem; color: var(--muted); }

/* Hero */
.hero { position: relative; min-height: 520px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: linear-gradient(135deg, #5f5e5a, #8a8780); color: #fff; }
.hero video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(24,22,18,.45), rgba(24,22,18,.7)); }
.hero-inner { position: relative; z-index: 2; text-align: center; padding: 2rem 1.5rem; display: flex; flex-direction: column; align-items: center; }
.hero .bee { width: 84px; height: 84px; color: #fff; margin-bottom: .6rem; opacity: .92; }
.hero h1 { font-family: 'Cinzel', Georgia, serif; font-weight: 400; font-size: clamp(1.7rem, 5vw, 2.6rem); letter-spacing: .17em; text-transform: uppercase; line-height: 1.15; }
.hero .script { font-family: 'Allura', cursive; font-size: clamp(1.6rem, 4vw, 2.2rem); color: rgba(255,255,255,.82); margin: .1rem 0 1rem; }
.hero hr { width: 120px; border: 0; border-top: 1px solid rgba(255,255,255,.35); margin-bottom: 1rem; }
.hero p { opacity: .8; margin-bottom: 1.6rem; max-width: 34rem; }
.hero .actions { justify-content: center; }
.btn-hero { background: #fff; color: #3a3a3a; border-color: #fff; font-family: 'Cinzel', Georgia, serif; letter-spacing: .06em; }
.btn-hero:hover { background: #f0ece6; }
.btn-hero-ghost { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.45); }
.btn-hero-ghost:hover { background: rgba(255,255,255,.25); }
.home-body { max-width: 1100px; margin: 0 auto; padding: 2.25rem 1.5rem 3rem; }

/* Tables / slots */
.slot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.slot:last-child { border-bottom: 0; }
.slot form { display: inline; }
.slot.taken { color: var(--muted); }

/* Calendar */
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.cal-title { font-size: 1.05rem; font-weight: 500; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-h { text-align: center; font-size: .75rem; color: var(--muted); font-weight: 500; padding: .25rem 0; }
.cal-d { min-height: 78px; background: #f6f6f4; border: 1px solid transparent; border-radius: 8px; padding: .3rem; font-size: .75rem; overflow: hidden; }
.cal-d.blank { background: transparent; }
.cal-d.has { background: #f0efec; border-color: #e1ded6; }
.cal-d.today { border-color: var(--brand); box-shadow: 0 0 0 1px rgba(122,122,122,.25); }
.cal-d .n { font-weight: 500; font-size: .8rem; margin-bottom: .15rem; }
.cal-ev { background: var(--brand); color: #fff; border-radius: 4px; padding: 1px 5px; margin-top: 2px; font-size: .66rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Tabs */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; background: #eeeeec; padding: 3px; border-radius: 11px; margin-bottom: 1.5rem; }
.tabs a { padding: .38rem .9rem; border-radius: 8px; font-size: .88rem; color: #6b7280; text-decoration: none; }
.tabs a:hover { color: #111; }
.tabs a.on { background: #fff; color: #111; font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.06); }

/* Ticket thread */
.thread { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }
.msg { padding: .6rem .8rem; border-radius: 10px; background: #f6f6f4; margin-bottom: .6rem; }
.msg.staff { background: var(--info-bg); }
.msg-meta { font-size: .75rem; color: var(--muted); margin-bottom: .15rem; }
.prewrap { white-space: pre-wrap; word-wrap: break-word; }

.footer { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: 1.5rem; color: #a3a3a3; font-size: .8rem; border-top: 1px solid var(--line); background: #fff; }
.footer-bee { width: 22px; height: 22px; color: #bdbdbd; }

@media (max-width: 780px) {
  .grid-2, .grid-3, .grid-5-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .cal-d { min-height: 56px; }
  .cal-ev { font-size: .58rem; }
  .nav-links { order: 3; flex-basis: 100%; }
}
.stack-gap { margin-bottom: 1.5rem; }

/* Clubhouse agreement */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .75rem 1.25rem; }
.kv span { display: block; font-size: .75rem; color: var(--muted); }
.kv b { font-weight: 500; font-size: .92rem; word-break: break-word; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; color: var(--ink); margin: .8rem 0; cursor: pointer; }
.check input { width: auto; margin-top: .25rem; flex-shrink: 0; }
.tight { margin: .5rem 0 0 1.1rem; font-size: .84rem; }
.tight li { margin: .15rem 0; }
.row-top { align-items: flex-start; }
.inline-label { margin: 0; }
.agreement { font-family: Georgia, 'Times New Roman', serif; font-size: .93rem; line-height: 1.55; color: #222; }
.agr-page { border-top: 1px solid var(--line); padding: 1.25rem 0 .5rem; }
.agr-page:first-child { border-top: 0; padding-top: 0; }
.agr-page h2 { font-size: 1.05rem; text-align: center; margin-bottom: .8rem; }
.agr-page h3 { font-size: .95rem; text-align: center; margin: .2rem 0; }
.agr-page h4 { font-size: .85rem; text-align: center; margin-bottom: .8rem; font-weight: 600; }
.agr-list { padding-left: 1.6rem; }
.agr-list li { margin-bottom: .75rem; }
.agr-rules { list-style: decimal; }
.agr-foot { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 1rem; }
.fill { font-weight: 700; border-bottom: 1px solid #555; padding: 0 .25rem; }
.sig { font-family: system-ui, sans-serif; }
.sig h3 { text-align: left; margin-bottom: .6rem; }

@media print {
  .nav, .footer, .flash, .no-print { display: none !important; }
  body { background: #fff; }
  .container { padding: 0; max-width: none; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .agr-page { break-inside: avoid-page; }
  .agr-page + .agr-page { break-before: page; }
}

/* Profiles, photos, celebrations */
.avatar-img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: #eee; }
.photo-lg { width: 112px; height: 112px; border-radius: 14px; object-fit: cover; background: #eee; flex-shrink: 0; }
.avatar-lg { width: 112px; height: 112px; border-radius: 14px; font-size: 2rem; }
.profile-head { display: flex; gap: 1.1rem; align-items: center; }
.fam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.fam-card { border: 1px solid var(--line); border-radius: 12px; padding: .9rem; display: flex; flex-direction: column; gap: .15rem; }
.fam-card .photo-lg, .fam-card .avatar-lg { margin-bottom: .4rem; }
.photo-edit { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.date-row { display: grid; grid-template-columns: 1.3fr .7fr 1fr; gap: .5rem; }
details.edit { margin-top: .6rem; }
details.edit > summary { list-style: none; display: inline-flex; cursor: pointer; }
details.edit > summary::-webkit-details-marker { display: none; }
details.edit[open] > summary { margin-bottom: .8rem; }
details.edit form + form { margin-top: .6rem; }
details.add { margin-top: 1rem; }
.cal-ev.cel { background: var(--tan); color: #3a3126; }
.muted a, .help a { color: inherit; }
@media (max-width: 780px) { .profile-head { flex-direction: column; align-items: flex-start; } .date-row { grid-template-columns: 1fr 1fr; } }
.err-text { color: var(--err); word-break: break-word; }

/* Attachments */
.atts { margin-top: .35rem; display: flex; flex-direction: column; gap: .2rem; }
.att { font-size: .84rem; text-decoration: none; color: var(--brand-dark); word-break: break-word; }
.att:hover { text-decoration: underline; }
.att.locked { color: var(--muted); }
.att-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.att-row form { display: inline; }

/* Polls */
.bar { width: 100%; height: 10px; border: 0; border-radius: 6px; background: #ececea; overflow: hidden; appearance: none; -webkit-appearance: none; display: block; }
.bar::-webkit-progress-bar { background: #ececea; border-radius: 6px; }
.bar::-webkit-progress-value { background: var(--brand); border-radius: 6px; }
.bar::-moz-progress-bar { background: var(--brand); border-radius: 6px; }
.rq { padding: 1rem 0; border-top: 1px solid var(--line); }
.rq:first-of-type { border-top: 0; }
.rq-body { margin-top: .6rem; }
.rq-opt { margin-bottom: .6rem; }
.rq-line { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; margin-bottom: .2rem; }
.quote { border-left: 3px solid var(--tan); margin: .4rem 0; padding: .3rem .8rem; background: #faf9f6; font-size: .9rem; }
.outcome { border-radius: 10px; padding: .9rem 1.1rem; margin-bottom: 1rem; }
.outcome-ok { background: var(--ok-bg); color: var(--ok); }
.outcome-no { background: var(--warn-bg); color: var(--warn); }
.outcome-head { font-weight: 600; }
.ballot-q { padding: 1rem 0; border-top: 1px solid var(--line); }
.ballot-q:first-of-type { border-top: 0; }
.ballot-q legend { font-weight: 500; margin-bottom: .5rem; padding: 0; }
.ballot-q fieldset { border: 0; }
.choice { display: flex; gap: .6rem; align-items: flex-start; padding: .35rem 0; font-size: .95rem; color: var(--ink); cursor: pointer; }
.choice input { width: auto; margin-top: .3rem; flex-shrink: 0; }
.scale { display: flex; gap: .5rem; flex-wrap: wrap; }
.scale .choice { border: 1px solid #d9dde3; border-radius: 9px; padding: .4rem .9rem; }
.req { color: var(--err); }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .85rem; }
.tbl th, .tbl td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 500; font-size: .75rem; }

/* Message board */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.chip { font-size: .8rem; padding: .3rem .8rem; border-radius: 999px; border: 1px solid #d9dde3; color: var(--muted); text-decoration: none; background: #fff; }
.chip:hover { border-color: var(--brand); color: var(--ink); }
.chip-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.post { margin-bottom: .8rem; }
.post-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .9rem; margin-bottom: .5rem; }
.post-body { font-size: .95rem; line-height: 1.55; margin: 0; }
.post-removed { color: var(--muted); font-style: italic; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.inline-form { display: inline-flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.post-body, .row-title { overflow-wrap: anywhere; }

/* Documents */
.crumbs { font-size: .85rem; color: var(--muted); margin: 0 0 1rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumb-sep { padding: 0 .15rem; }
.doc-frame { width: 100%; height: 78vh; min-height: 420px; border: 1px solid var(--line); border-radius: 10px; background: #fff; display: block; }

[hidden] { display: none !important; }

/* Social committee ledger */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem 1rem; align-items: end; margin-bottom: 1rem; }
.filters .field { margin: 0; }
.filter-go { display: flex; gap: .5rem; }
.ledger { min-width: 980px; }
.ledger td { vertical-align: top; }
.ledger .num, .tbl .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ledger tfoot td, .tbl tfoot td { border-top: 2px solid var(--line); border-bottom: 0; }
.ledger tr.cancelled td { opacity: .55; }
.ledger tr.cancelled td:first-child b { text-decoration: line-through; }
.more { margin-top: .35rem; font-size: .8rem; }
.more summary { cursor: pointer; color: var(--muted); }
.more .kv { margin-top: .6rem; max-width: 560px; }
.status-form select { padding: .25rem .4rem; font-size: .8rem; }
ul.plain { margin: 0; padding-left: 1.2rem; font-size: .9rem; line-height: 1.6; }
