/* A warm, quiet page: cream paper, fir green, a rust accent; Fraunces for
   titles, Inter for the rest. */
:root {
  --paper: #f7f2ea;
  --card: #fffdf9;
  --ink: #26302c;
  --ink-soft: #5d665f;
  --line: #e6dccd;
  --fir: #2f4a3a;
  --accent: #c8643b;
  --accent-soft: #f5e1d3;
  --gold: #e0a43a;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(60, 40, 20, 0.06), 0 6px 20px rgba(60, 40, 20, 0.06);
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--serif); font-weight: 650; letter-spacing: -0.01em; margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--fir); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.kicker { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }

/* ── buttons and fields ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px;
  border-radius: 999px; border: 1px solid transparent; cursor: pointer; font-weight: 600; font-size: 14px; text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.1s; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--fir); color: #fff; }
.btn-primary:hover { background: #24392d; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-soft); }
.btn-small { height: 32px; padding: 0 12px; font-size: 13px; }
.link { background: none; border: none; padding: 0; color: var(--ink-soft); text-decoration: underline; cursor: pointer; }
input, textarea, select { width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--fir); box-shadow: 0 0 0 3px rgba(47, 74, 58, 0.12); }
textarea { resize: vertical; }

/* ── sign-in ── */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; }
.login-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.login-card { position: relative; width: min(380px, 100%); padding: 32px 28px; border-radius: 22px; background: rgba(255, 253, 249, 0.94);
  box-shadow: 0 20px 60px rgba(20, 20, 30, 0.35); text-align: center; display: grid; gap: 12px; backdrop-filter: blur(6px); }
.login-card h1 { font-size: 30px; line-height: 1.15; }
.login-lead { margin: 0 0 6px; color: var(--ink-soft); }
.login-card .btn { height: 46px; }
.login-error { margin: 0; min-height: 1.4em; color: #b23b2a; font-size: 14px; }

/* ── hero and navigation ── */
.hero { position: relative; height: min(62vh, 520px); min-height: 340px; overflow: hidden; color: #fff; }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20, 26, 32, 0.65), rgba(20, 26, 32, 0) 55%); }
.hero-text { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; max-width: 1040px; margin: 0 auto; padding: 0 24px 36px; }
.hero .kicker { color: #ffd9b8; }
.hero h1 { font-size: clamp(36px, 6vw, 64px); line-height: 1.05; text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3); }
.hero-dates { margin: 10px 0 0; font-size: 17px; opacity: 0.92; }
.who-btn { position: absolute; z-index: 2; top: 16px; right: 16px; height: 38px; padding: 0 14px 0 6px; display: flex; align-items: center; gap: 8px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(20, 26, 32, 0.35); color: #fff; cursor: pointer;
  backdrop-filter: blur(8px); font-size: 14px; font-weight: 500; }
.who-btn .avatar { width: 28px; height: 28px; font-size: 12px; }

.nav { position: sticky; top: 0; z-index: 10; display: flex; gap: 4px; justify-content: center; overflow-x: auto; padding: 10px 16px;
  background: rgba(247, 242, 234, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.nav a { flex-shrink: 0; padding: 6px 12px; border-radius: 999px; color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 500; }
.nav a:hover { background: var(--accent-soft); color: var(--ink); }

/* ── sections ── */
.main { max-width: 1040px; margin: 0 auto; padding: 8px 24px 40px; }
.section { padding: 44px 0 8px; }
.section h2 { font-size: 30px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-lead { margin: 6px 0 20px; color: var(--ink-soft); max-width: 640px; }
.count { font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--accent); vertical-align: middle; margin-left: 6px; }
.sub { font-size: 20px; margin: 28px 0 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* infos */
.info-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-top: 18px; }
.info { padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 6px; }
.info-label { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.info-value { font-size: 17px; font-weight: 500; white-space: pre-line; word-break: break-word; flex: 1; }
.info-value.empty { color: var(--ink-soft); font-weight: 400; font-style: italic; }
.info-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 6px; }
.btn { white-space: nowrap; }
.info-wide { grid-column: 1 / -1; }

/* people */
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 999px; background: var(--card);
  border: 1px solid var(--line); cursor: pointer; box-shadow: var(--shadow); transition: opacity 0.2s; user-select: none; }
.person.away { opacity: 0.45; }
.person.away .person-name { text-decoration: line-through; }
.person-name { font-weight: 600; }
.person-remove { border: none; background: none; color: var(--ink-soft); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 0 0 4px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 14px; flex-shrink: 0; }
.avatars { display: flex; }
.avatars .avatar { width: 24px; height: 24px; font-size: 10px; border: 2px solid var(--card); margin-left: -6px; }
.avatars .avatar:first-child { margin-left: 0; }

/* meals */
.meals { display: grid; gap: 18px; }
.meal { padding: 20px; }
.meal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.meal-head h3 { font-size: 22px; }
.meal-hint { margin: 2px 0 14px; color: var(--ink-soft); font-size: 14px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-decided { background: var(--fir); color: #fff; }
.badge-lead { background: var(--accent-soft); color: var(--accent); }
.proposals { display: grid; gap: 10px; }
.proposal { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; transition: border-color 0.2s, background 0.2s; }
.proposal.retained { border-color: rgba(200, 100, 59, 0.5); background: #fffaf5; }
.proposal.decided { border-color: var(--fir); background: #f3f7f3; }
.proposal-emoji { font-size: 28px; text-align: center; }
.proposal-name { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.proposal-desc { margin: 2px 0 0; color: var(--ink-soft); font-size: 14px; }
.proposal-meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.proposal-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.vote { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-weight: 600; font-size: 14px; }
.vote:hover { border-color: var(--accent); }
.vote.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.mini { border: none; background: none; padding: 0; color: var(--ink-soft); font-size: 13px; cursor: pointer; text-decoration: underline; }
.mini:hover { color: var(--ink); }
.add-proposal { margin-top: 12px; }

/* shopping list */
.shop { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.aisle { padding: 16px 18px; }
.aisle h3 { font-size: 17px; margin-bottom: 8px; }
.checklist { list-style: none; margin: 0; padding: 0; }
.aisle .checklist li { border: none; padding: 7px 0; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; flex: 1; min-width: 0; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--fir); flex-shrink: 0; }
.check-text { min-width: 0; }
.check-qty { color: var(--accent); font-weight: 600; white-space: nowrap; }
.check-for { display: block; font-size: 12px; color: var(--ink-soft); }
.done .check-label { text-decoration: line-through; color: var(--ink-soft); }
#extra, #bring { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 16px; }
#extra li, #bring li { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
#extra li:last-child, #bring li:last-child { border-bottom: none; }
.bring-who { width: auto; min-width: 140px; padding: 6px 10px; font-size: 14px; border-radius: 999px; }
.bring-who.taken { border-color: var(--fir); color: var(--fir); font-weight: 600; }
.remove { border: none; background: none; color: #b9ad9c; cursor: pointer; font-size: 20px; line-height: 1; padding: 4px; }
.remove:hover { color: #b23b2a; }
.inline-form { display: flex; gap: 8px; margin-top: 12px; }
.inline-form .qty { max-width: 140px; }
.empty-note { color: var(--ink-soft); font-style: italic; margin: 0; }

/* ideas */
.ideas { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.idea { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.idea img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.idea h3 { font-size: 18px; margin: 14px 16px 4px; }
.idea p { margin: 0 16px 16px; color: var(--ink-soft); font-size: 14px; }

.footer { max-width: 1040px; margin: 0 auto; padding: 24px 24px 40px; display: flex; justify-content: space-between; gap: 12px;
  color: var(--ink-soft); font-size: 13px; border-top: 1px solid var(--line); }

/* dialogs and toast */
.dialog { border: none; border-radius: 20px; padding: 24px; width: min(440px, calc(100% - 32px)); background: var(--card); color: var(--ink);
  box-shadow: 0 24px 70px rgba(20, 20, 30, 0.3); }
.dialog::backdrop { background: rgba(30, 30, 40, 0.45); backdrop-filter: blur(2px); }
.dialog form { display: grid; gap: 12px; }
.dialog h2 { font-size: 24px; }
.dialog p { margin: 0; color: var(--ink-soft); }
.dialog-sub { font-size: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.who-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 6px; }
.who-list button { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; border: 1px solid var(--line); background: #fff;
  cursor: pointer; font-weight: 600; text-align: left; }
.who-list button:hover, .who-list button.on { border-color: var(--fir); background: #f3f7f3; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; padding: 10px 18px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 14px; box-shadow: var(--shadow); }

@media (max-width: 640px) {
  .main { padding: 0 16px 32px; }
  .hero-text { padding: 0 16px 28px; }
  .section { padding-top: 36px; }
  .section h2 { font-size: 26px; }
  .nav { justify-content: flex-start; }
  .proposal { grid-template-columns: 34px 1fr; }
  .proposal-emoji { font-size: 24px; }
  .proposal-side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .inline-form { flex-wrap: wrap; }
  .inline-form .qty { max-width: none; flex: 1; }
  #bring li { flex-wrap: wrap; }
  .bring-who { margin-left: 30px; }
  .footer { flex-direction: column; padding: 20px 16px 32px; }
}

/* avatar colours (app.js: colorOf) */
.c0 { background: #2f4a3a; } .c1 { background: #c8643b; } .c2 { background: #4f6d8a; } .c3 { background: #8a5a7a; }
.c4 { background: #b08a2e; } .c5 { background: #5e7d4f; } .c6 { background: #7a5643; } .c7 { background: #3f6f72; }
.c-none { background: #999; }

/* the QA deployment says so (app.js: data.build) */
.env-qa .nav::before { content: 'QA'; flex-shrink: 0; align-self: center; margin-right: 8px; padding: 2px 8px; border-radius: 6px;
  background: var(--gold); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; }
.env-qa .build { color: var(--accent); font-weight: 600; }
