:root {
  --pine: #1e4d3a;
  --pine-dark: #143528;
  --cream: #faf7f0;
  --card: #ffffff;
  --ink: #2a2a26;
  --muted: #6b6b60;
  --accent: #b23a48;
  --gold: #c9a227;
  --line: #e4ded0;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(30, 50, 40, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
}

h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; line-height: 1.25; }

a { color: var(--pine); }

.site-header {
  background: var(--pine);
  color: #fff;
  padding: 0 16px;
}
.site-header .inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 0;
}
.brand {
  font-family: Georgia, serif;
  font-size: 1.25rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.3px;
}
.brand span { color: var(--gold); }
nav.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav.main-nav a {
  color: #e8efe9;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.95rem;
}
nav.main-nav a:hover { background: rgba(255, 255, 255, 0.12); }
nav.main-nav a.active { background: rgba(255, 255, 255, 0.18); color: #fff; }

main { max-width: 960px; margin: 0 auto; padding: 32px 16px 64px; }

.hero {
  background: linear-gradient(160deg, var(--pine) 0%, var(--pine-dark) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 48px 32px;
  margin-bottom: 36px;
}
.hero h1 { margin: 0 0 10px; font-size: clamp(1.8rem, 4.5vw, 2.6rem); }
.hero p { margin: 0 0 22px; font-size: 1.1rem; color: #dce8df; max-width: 42rem; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border: none;
  font: inherit;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: transparent; border: 1.5px solid rgba(255,255,255,0.6); }
.btn.quiet { background: var(--pine); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.event-list { list-style: none; padding: 0; margin: 0; }
.event-list li {
  display: flex;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}
.event-list li:last-child { border-bottom: none; }
.date-chip {
  flex: 0 0 auto;
  background: var(--pine);
  color: #fff;
  border-radius: 10px;
  text-align: center;
  padding: 6px 10px;
  min-width: 58px;
}
.date-chip .mon { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: var(--gold); }
.date-chip .day { display: block; font-size: 1.3rem; font-weight: 700; line-height: 1.1; }
.event-title { font-weight: 650; }
.event-meta { color: var(--muted); font-size: 0.92rem; }

/* Calendar grid */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head h2 { margin: 0; }
.cal-nav button {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 14px; cursor: pointer; font-size: 1rem;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-grid .dow { text-align: center; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); padding: 4px 0; }
.cal-cell {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 84px;
  padding: 6px;
  font-size: 0.8rem;
}
.cal-cell.empty { background: transparent; border-color: transparent; }
.cal-cell .num { font-weight: 600; color: var(--muted); }
.cal-cell.today { outline: 2px solid var(--gold); }
.cal-event {
  background: #e7f0ea;
  color: var(--pine-dark);
  border-radius: 6px;
  padding: 2px 6px;
  margin-top: 4px;
  font-size: 0.72rem;
  line-height: 1.3;
  overflow-wrap: break-word;
}

/* Forms */
label { display: block; font-weight: 600; margin: 16px 0 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}
textarea { min-height: 120px; resize: vertical; }
.hint { color: var(--muted); font-size: 0.88rem; margin-top: 4px; }
.notice { border-radius: 10px; padding: 14px 18px; margin: 16px 0; }
.notice.ok { background: #e7f0ea; color: var(--pine-dark); }
.notice.err { background: #f7e3e6; color: #7c2330; }
.notice.info { background: #fdf3d7; color: #6b5310; }

/* Voting gallery */
.house-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.house-card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}
.house-card:hover { transform: translateY(-2px); }
.house-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(178, 58, 72, 0.18); }
.house-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: #e8e4da; }
.house-card .addr { padding: 10px 12px; font-weight: 600; font-size: 0.95rem; }
.house-card .pick { padding: 0 12px 10px; color: var(--accent); font-size: 0.85rem; visibility: hidden; }
.house-card.selected .pick { visibility: visible; }

table.admin { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
table.admin th, table.admin td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.admin th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  padding: 24px 16px 40px;
  font-size: 0.88rem;
}
.site-footer a { color: var(--muted); }

@media (max-width: 600px) {
  .hero { padding: 32px 20px; }
  .cal-cell { min-height: 58px; }
  .cal-event { display: none; }
  .cal-cell.has-event { background: #e7f0ea; border-color: var(--pine); }
}
