:root {
  --navy: #071628;
  --navy-2: #0c2340;
  --navy-3: #143056;
  --blue: #1a4f9c;
  --blue-2: #2b6bc4;
  --sky: #6eb4e0;
  --sky-2: #c7e4f6;
  --cream: #f6f1e6;
  --paper: #fffdf8;
  --gold: #c9a44a;
  --gold-2: #ead7a0;
  --ink: #142033;
  --muted: #5b6b7c;
  --line: #d9d1c3;
  --good: #2f7d4a;
  --warn: #b45309;
  --bad: #9b2c2c;
  --shadow: 0 10px 30px rgba(7, 22, 40, 0.12);
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--cream); color: var(--ink); }
body {
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

h1, h2, h3, .serif { font-family: Fraunces, Georgia, serif; letter-spacing: -0.02em; }

.app-shell { min-height: 100dvh; display: flex; flex-direction: column; }

/* Marketing */
.mkt { background: var(--navy); color: var(--cream); min-height: 100dvh; }
.mkt-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 22px; max-width: 1100px; margin: 0 auto;
}
@media (max-width: 640px) {
  .mkt-nav { flex-wrap: wrap; }
  .mkt-nav .row { width: 100%; }
  .mkt-nav .btn { flex: 1; }
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.04em; }
.mark {
  width: 36px; height: 36px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--sky), var(--blue) 55%, var(--navy-2));
  border: 2px solid var(--gold);
  display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 700;
}
.mkt-hero { max-width: 1100px; margin: 0 auto; padding: 28px 22px 70px; }
.kicker {
  display: inline-block; color: var(--gold-2); font-size: 12px; letter-spacing: 0.16em;
  text-transform: uppercase; font-weight: 600;
}
.mkt-hero h1 {
  font-size: clamp(40px, 8vw, 84px); line-height: 0.95; margin: 12px 0 16px; color: #fff;
}
.mkt-hero p.lede { font-size: 19px; max-width: 560px; color: #d7e6f4; }
.stars { color: var(--gold); margin: 18px 0 28px; font-size: 13px; letter-spacing: 0.18em; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  border: 0; border-radius: 999px; padding: 12px 18px; font-weight: 650;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-ghost { background: transparent; color: var(--cream); border: 1px solid rgba(255,255,255,.28); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-paper { background: var(--paper); color: var(--navy); border: 1px solid var(--line); }
.btn-wide { width: 100%; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  padding: 4px 10px; font-size: 12px; font-weight: 650; background: var(--sky-2); color: var(--navy);
}
.pill-gold { background: #efe3bf; color: #6b4e0e; }
.pill-navy { background: var(--navy-3); color: var(--sky-2); }
.pill-warn { background: #fde7c7; color: #8a4b08; }
.pill-good { background: #d8f0e0; color: #1d5a32; }

.grid-4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 36px; }
.stat-card {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px; padding: 16px;
}
.stat-card b { display: block; font-family: Fraunces, serif; font-size: 28px; color: #fff; }
.stat-card span { color: #b9c9d8; font-size: 13px; }

/* Auth / forms */
.auth { max-width: 460px; margin: 0 auto; padding: 28px 18px 80px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; font-weight: 650; margin-bottom: 5px; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: #fff;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 12px; font-size: 13px;
}
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Member chrome */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
}
.topbar .sub { font-size: 11px; color: var(--sky); letter-spacing: .12em; text-transform: uppercase; }
.page { flex: 1; padding: 14px 14px calc(92px + var(--safe-b)); max-width: 760px; margin: 0 auto; width: 100%; }
.page.wide { max-width: 1080px; }

.tabrow { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; }
.tab {
  border: 0; background: #efe8d8; color: var(--navy); border-radius: 999px; padding: 8px 12px;
  white-space: nowrap; font-weight: 650; font-size: 13px;
}
.tab.on { background: var(--navy); color: #fff; }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 0 rgba(255,255,255,.6) inset;
}
.card h3 { margin: 0 0 6px; font-size: 18px; }
.meta { color: var(--muted); font-size: 13px; }
.who { display: flex; gap: 10px; align-items: center; }
.av {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy-2); color: var(--gold-2); font-weight: 700; flex: none;
}
.av.sm { width: 32px; height: 32px; font-size: 12px; }
.av.lg { width: 64px; height: 64px; font-size: 22px; }
.actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.act {
  border: 0; background: #efe8d8; border-radius: 999px; padding: 6px 10px; font-size: 13px; font-weight: 650;
}
.act.on { background: #d8f0e0; color: #1d5a32; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: #fff; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr 1fr 64px 1fr 1fr;
  padding: 6px 6px calc(8px + var(--safe-b));
}
.nav a, .nav button {
  background: none; border: 0; color: var(--muted); display: flex; flex-direction: column;
  align-items: center; gap: 2px; font-size: 11px; font-weight: 650; padding: 6px 0;
}
.nav a.on, .nav button.on { color: var(--navy); }
.nav .plus {
  width: 54px; height: 54px; border-radius: 50%; background: var(--gold); color: var(--navy);
  margin-top: -22px; font-size: 28px; line-height: 1; border: 3px solid var(--cream);
  display: grid; place-items: center; justify-self: center;
}

.sheet {
  position: fixed; inset: 0; background: rgba(7,22,40,.5); z-index: 40;
  display: flex; align-items: flex-end;
}
.sheet-card {
  background: var(--paper); width: 100%; border-radius: 22px 22px 0 0;
  padding: 16px 16px calc(20px + var(--safe-b));
}
.sheet-card h2 { margin: 4px 0 12px; }

.event-hero {
  background: linear-gradient(160deg, var(--navy-2), var(--blue));
  color: #fff; border-radius: 18px; padding: 16px; margin-bottom: 12px;
}
.mapfake {
  height: 160px; border-radius: 16px; margin-bottom: 12px;
  background:
    linear-gradient(180deg, rgba(7,22,40,.08), rgba(7,22,40,.28)),
    repeating-linear-gradient(90deg, #cfe4c4 0 28px, #d7e8cc 28px 56px);
  position: relative; overflow: hidden; border: 1px solid var(--line);
}
.pin {
  position: absolute; width: 14px; height: 14px; background: var(--gold); border: 2px solid #fff;
  border-radius: 50%; box-shadow: 0 0 0 6px rgba(201,164,74,.25);
}

.msg { display: flex; gap: 8px; margin: 8px 0; }
.msg.me { flex-direction: row-reverse; }
.bubble {
  max-width: 78%; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 8px 11px;
}
.msg.me .bubble { background: var(--navy); color: #fff; border-color: var(--navy); }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.table tr { cursor: pointer; }
.table tr:hover { background: #f3eee3; }

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 999px; z-index: 50;
  font-size: 14px; white-space: nowrap;
}

.admin-note {
  background: #1a2433; color: #d7e6f4; border-radius: 12px; padding: 10px 12px; font-size: 13px;
}

.split { display: grid; gap: 12px; }
@media (min-width: 860px) {
  .split-2 { grid-template-columns: 1.2fr .8fr; }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .hide-desk { display: none; }
}

.demo-flag {
  background: #efe3bf; color: #5c430c; font-size: 12px; text-align: center; padding: 6px 10px;
}
.list-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line);
}
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }
.num { font-family: Fraunces, serif; font-size: 22px; }
.hr { height: 1px; background: var(--line); margin: 12px 0; }
