@font-face {
  font-family: Geist;
  src: url("../fonts/geist-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Geist;
  src: url("../fonts/geist-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Geist;
  src: url("../fonts/geist-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("../fonts/inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("../fonts/inter-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("../fonts/inter-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #090b0e;
  --card: #12171e;
  --card-2: #1a212b;
  --line: rgba(255, 255, 255, 0.07);
  --text: #f4f1ea;
  --muted: #a3acb6;
  --faint: #7d8792;
  --accent: #d08a4c;
  --gold: #e6b450;
  --ink: #1c130c;
  --danger: #e08a7a;
  --ok: #8fbf98;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --radius: 18px;
  --sans: Inter, "Segoe UI", sans-serif;
  --display: Geist, Inter, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { color-scheme: dark; }
body {
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(208, 138, 76, 0.18), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(230, 180, 80, 0.08), transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 650; letter-spacing: -0.03em; margin: 0; }
p { margin: 0; }

.shell { min-height: 100vh; }
.content {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 20px 16px calc(128px + env(safe-area-inset-bottom, 0px));
}
html { scroll-padding-bottom: calc(128px + env(safe-area-inset-bottom, 0px)); }
.sidebar { display: none; }
.mobile-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.mobile-bar img { width: 42px; height: 42px; border-radius: 14px; }
.mobile-bar strong { font-family: var(--display); font-size: 18px; letter-spacing: -0.03em; }

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
}
.skip:focus { left: 8px; background: var(--gold); color: var(--ink); padding: 8px 12px; z-index: 5; }

.banner {
  background: rgba(230, 180, 80, 0.12);
  border: 1px solid rgba(230, 180, 80, 0.38);
  color: #f6e7c4;
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0 0 14px;
}
.banner a { color: var(--gold); }

.page-head { margin: 4px 0 16px; }
.eyebrow {
  font-family: var(--display);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.page-head h1 { font-size: 34px; line-height: 1.05; margin-top: 4px; }
.lede { color: var(--muted); margin-top: 6px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.card + .card, .stack > * + * { margin-top: 12px; }
.stack > * + * { margin-top: 12px; }

.hero {
  padding: 18px 18px 16px;
  background:
    linear-gradient(180deg, rgba(230, 180, 80, 0.08), transparent 42%),
    var(--card);
  border-left: 3px solid var(--gold);
}
.hero h2 { font-size: 28px; margin: 6px 0; }
.clock {
  font-family: var(--display);
  font-size: 42px;
  color: var(--gold);
  letter-spacing: -0.04em;
  line-height: 1;
}
.clock span { font-size: 16px; margin-left: 6px; letter-spacing: 0.08em; }
.meta { color: var(--muted); margin-top: 8px; }

.btn, button.btn, a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: var(--ink);
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(208, 138, 76, 0.5);
}
.btn.ghost { background: transparent; color: var(--muted); border: 0; padding-inline: 8px; }
.btn.full { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

button.google, .btn.google {
  background: #f4f1ea;
  color: #1c130c;
  width: 100%;
}
.gmark {
  width: 18px;
  height: 18px;
  display: inline-block;
}

label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"],
input[type="datetime-local"], input[type="date"], input[type="number"], textarea, select {
  width: 100%;
  background: #0c1015;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 12px;
  outline: none;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
.row-2 { display: grid; gap: 10px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 15px; margin: 8px 0; }
.check input { width: auto; accent-color: var(--accent); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; }
.chip {
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 8px 12px;
  background: transparent;
  text-decoration: none;
  font-family: var(--display);
  font-size: 14px;
}
.chip.active, .chip:hover { color: var(--accent); border-color: rgba(208, 138, 76, 0.7); text-decoration: none; background: rgba(208, 138, 76, 0.08); }

.day { margin: 18px 0 8px; color: var(--text); font-family: var(--display); font-size: 18px; }
.event {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.event:first-of-type { border-top: 0; }
.event time { color: var(--gold); font-family: var(--display); font-weight: 700; }
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(208, 138, 76, 0.12);
  font-family: var(--display);
  font-weight: 700;
}
.pill.gold { color: var(--gold); background: rgba(230, 180, 80, 0.12); }
.pill.quiet { color: var(--muted); background: rgba(255, 255, 255, 0.04); }

.grid { display: grid; gap: 12px; }
.group-card h2 { font-size: 22px; }
.count { font-family: var(--display); color: var(--gold); font-size: 28px; letter-spacing: -0.04em; }
.count span { color: var(--muted); font-size: 13px; letter-spacing: 0; margin-left: 4px; font-family: var(--sans); font-weight: 500; }

.person, .sermon, .prayer, .announce { padding: 14px; }
.person { display: grid; grid-template-columns: 48px 1fr; gap: 12px; }
.avatar, .avatar-lg {
  width: 48px; height: 48px; border-radius: 16px;
  background: #241910; color: var(--gold);
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700;
  overflow: hidden;
}
.avatar img, .avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.who { font-family: var(--display); font-size: 17px; }
.sub { color: var(--muted); font-size: 14px; }
.private { color: var(--gold); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }

.cover { border-radius: 14px; margin: -16px -16px 12px; max-height: 220px; width: calc(100% + 32px); object-fit: cover; }
.sermon h2 { font-size: 22px; margin: 4px 0; }
.notes { color: #d5dbe2; margin-top: 8px; white-space: pre-wrap; }

.search { display: flex; gap: 8px; margin-bottom: 12px; }
.search input { flex: 1; }

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(9, 11, 14, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 6px 6px calc(10px + env(safe-area-inset-bottom, 0px));
  min-height: calc(64px + env(safe-area-inset-bottom, 0px));
  z-index: 20;
}
.tabbar a {
  color: var(--faint);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 600;
  min-height: 48px;
  justify-content: center;
}
.tabbar a.active { color: var(--accent); }
.tabbar svg { width: 22px; height: 22px; }

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px 40px;
}
.auth-card { width: min(440px, 100%); }
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.brand img { width: 52px; height: 52px; border-radius: 16px; }
.brand h1 { font-size: 32px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--faint); margin: 14px 0; font-size: 13px; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.fine { color: var(--faint); font-size: 13px; margin-top: 14px; text-align: center; }
.hidden { display: none; }
.password-field { position: relative; }
.password-field input { padding-right: 72px; }
.password-field button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  color: var(--accent);
  border: 0;
  font-family: var(--display);
  font-weight: 700;
  min-height: 36px;
  cursor: pointer;
}

.list-link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}
.list-link:first-child { border-top: 0; }
.list-link strong { font-family: var(--display); font-weight: 650; display: block; }
.list-link:hover { text-decoration: none; color: var(--accent); }

details.composer { margin-top: 14px; }
details.composer summary {
  cursor: pointer;
  color: var(--accent);
  font-family: var(--display);
  font-weight: 700;
  list-style: none;
}
details.composer summary::-webkit-details-marker { display: none; }

.empty { color: var(--muted); padding: 8px 0 4px; }

.admin-grid { display: grid; gap: 12px; }
.member-edit { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.audit-row { padding: 10px 0; border-top: 1px solid var(--line); }
.audit-row time { color: var(--gold); font-size: 13px; font-family: var(--display); }

.confirm-count {
  font-family: var(--display);
  font-size: 72px;
  color: var(--gold);
  letter-spacing: -0.05em;
  line-height: 0.9;
}
.color-row { display: flex; gap: 10px; align-items: center; }
input[type="color"] { width: 56px; height: 44px; padding: 4px; background: #0c1015; border-radius: 12px; border: 1px solid var(--line); }

.seg { display: flex; gap: 8px; }
.seg label {
  margin: 0;
  flex: 1;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 8px;
  color: var(--muted);
}
.seg input { position: absolute; opacity: 0; }
.seg input:checked + span { color: var(--accent); }
.seg label:has(input:checked) { border-color: var(--accent); color: var(--accent); background: rgba(208, 138, 76, 0.08); }

@media (min-width: 720px) {
  .row-2 { grid-template-columns: 1fr 1fr; }
  .grid.groups { grid-template-columns: 1fr 1fr; }
  .grid.people, .grid.sermons { grid-template-columns: 1fr 1fr; }
  .home-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 12px; align-items: start; }
  .home-grid .wide { grid-column: 1 / -1; }
}

.hp { position: absolute; left: -10000px; height: 0; overflow: hidden; }
.label-code { font-family: var(--display); font-size: 72px; letter-spacing: 0.12em; color: var(--gold); }
@media print {
  .sidebar, .tabbar, .mobile-bar, .no-print { display: none !important; }
  body { background: white; color: black; }
  .label-code { color: black; }
}

@media (min-width: 960px) {
  body:not(.auth) .shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
  body:not(.auth) .sidebar {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 16px;
    border-right: 1px solid var(--line);
    background: rgba(9, 11, 14, 0.72);
  }
  body:not(.auth) .tabbar { display: none; }
  body:not(.auth) .content { padding: 28px 32px 64px; }
  .mobile-bar { display: none; }
  .side-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 22px; }
  .side-nav a {
    color: var(--muted);
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 12px;
    font-family: var(--display);
    font-weight: 600;
  }
  .side-nav a.active, .side-nav a:hover {
    color: var(--accent);
    background: rgba(208, 138, 76, 0.12);
    text-decoration: none;
  }
  .grid.groups { grid-template-columns: 1fr 1fr 1fr; }
  .admin-grid { grid-template-columns: 1.1fr 0.9fr; align-items: start; }
  .admin-grid .span { grid-column: 1 / -1; }
}
