:root {
  --bg: #fbf6ef;
  --card: #ffffff;
  --ink: #2e2a26;
  --muted: #8a8278;
  --line: #ece3d6;
  --brand: #b5651d;
  --brand-dark: #8f4e14;
  --yes: #3a9d5d;
  --maybe: #d99a1c;
  --no: #cf5b4e;
  --shadow: 0 2px 10px rgba(80,60,30,.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
#app { max-width: 680px; margin: 0 auto; padding: 16px 14px 60px; }

h1, h2, h3 { margin: 0 0 .4em; font-weight: 700; }
h1 { font-size: 1.6rem; color: var(--brand-dark); }
h2 { font-size: 1.15rem; }
p { margin: 0 0 .6em; }
.muted { color: var(--muted); font-size: .88rem; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; margin: 0 0 14px; box-shadow: var(--shadow);
}
.center { text-align: center; }

button, .btn {
  font: inherit; cursor: pointer; border: none; border-radius: 10px;
  padding: 10px 16px; background: var(--brand); color: #fff; font-weight: 600;
  transition: transform .05s ease, background .15s ease;
}
button:active { transform: translateY(1px); }
button.secondary { background: #efe7da; color: var(--ink); }
button.ghost { background: transparent; color: var(--muted); padding: 4px 8px; font-weight: 500; }
button.tiny { padding: 5px 9px; font-size: .8rem; border-radius: 8px; }
button:disabled { opacity: .5; cursor: default; }

input, textarea, select {
  font: inherit; width: 100%; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink); margin: 0 0 10px;
}
textarea { resize: vertical; min-height: 70px; }
label.fld { display: block; font-size: .85rem; color: var(--muted); margin: 0 0 4px; }

.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.grow { flex: 1; }

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.tag { display:inline-block; background:#efe7da; color:var(--brand-dark); border-radius: 999px; padding: 2px 10px; font-size:.78rem; font-weight:600; }

/* tabs */
.tabs { display: flex; gap: 6px; margin: 6px 0 16px; position: sticky; top: 0;
  background: var(--bg); padding: 8px 0; z-index: 5; }
.tabs button { flex: 1; background: #efe7da; color: var(--ink); border-radius: 10px; padding: 9px 4px; font-size: .92rem; }
.tabs button.active { background: var(--brand); color: #fff; }

/* date poll */
.date { border:1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.date.best { border-color: var(--yes); box-shadow: 0 0 0 2px rgba(58,157,93,.15); }
.date.locked { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(181,101,29,.18); background:#fffaf3; }
.date .when { font-weight: 700; font-size: 1.02rem; }
.bars { display:flex; gap:10px; font-size:.82rem; margin:6px 0; }
.bars span { font-weight:600; }
.vote-row { display:flex; gap:6px; margin-top:8px; }
.vote-row button { flex:1; padding:9px 4px; background:#f3ece1; color:var(--ink); }
.vote-row button.yes.on { background: var(--yes); color:#fff; }
.vote-row button.maybe.on { background: var(--maybe); color:#fff; }
.vote-row button.no.on { background: var(--no); color:#fff; }
.voters { font-size:.8rem; color:var(--muted); margin-top:6px; }

/* messages */
.msg { border-bottom:1px solid var(--line); padding:10px 0; }
.msg:last-child { border-bottom:none; }
.msg .who { font-weight:700; font-size:.92rem; }
.msg .body { white-space: pre-wrap; word-break: break-word; }
.msg .meta { color:var(--muted); font-size:.76rem; }

.member-row { display:flex; justify-content:space-between; align-items:center; padding:8px 0; border-bottom:1px solid var(--line); }
.member-row:last-child { border-bottom:none; }

.err { color: var(--no); font-size:.86rem; margin: 0 0 8px; min-height: 1em; }
.ok-flash { color: var(--yes); font-size:.86rem; }
.pill-choice { font-weight:700; }
.pill-choice.yes{color:var(--yes)} .pill-choice.maybe{color:var(--maybe)} .pill-choice.no{color:var(--no)}
.namegrid { display:grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap:8px; margin-bottom:10px; }
.namegrid button { background:#f3ece1; color:var(--ink); }
.namegrid button.sel { background: var(--brand); color:#fff; }
.hint { font-size:.8rem; color:var(--muted); }
hr.soft { border:none; border-top:1px solid var(--line); margin:14px 0; }

/* calendar */
.cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:4px; }
.cal-grid.head { margin-bottom:4px; }
.cal-dow { text-align:center; font-size:.72rem; color:var(--muted); font-weight:600; padding:2px 0; }
.cal-cell { min-height:64px; border:1px solid var(--line); border-radius:8px; padding:3px; background:#fff;
  font-size:.7rem; overflow:hidden; cursor:pointer; }
.cal-cell.empty { border:none; background:transparent; cursor:default; }
.cal-cell .dnum { font-weight:700; font-size:.82rem; color:var(--ink); margin-bottom:2px; }
.cal-cell.today { border-color:var(--brand); box-shadow:inset 0 0 0 1px var(--brand); }
.cal-cell.today .dnum { color:var(--brand-dark); }
.cal-cell.lunch { background:#fff3e3; border-color:var(--brand); }
.cal-cell.sel { box-shadow:0 0 0 2px var(--brand); }
.cal-cell .dot { background:#efe7da; color:var(--brand-dark); border-radius:4px; padding:1px 4px;
  margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cal-cell .dot.more { background:transparent; color:var(--muted); padding:0 2px; }

/* photos */
img.hero { width:auto; max-width:100%; max-height:340px; object-fit:contain; border-radius:16px;
  margin:0 auto 14px; display:block; box-shadow:var(--shadow); image-orientation:from-image; }
img.photo { width:100%; max-height:340px; object-fit:cover; border-radius:10px; margin-top:8px; display:block; image-orientation:from-image; }
img.photo.sm { max-height:200px; }
.comments { margin-top:10px; }
.comment { border-top:1px solid var(--line); padding:8px 0; }
.comment .who { font-weight:700; font-size:.86rem; }
.comment .body { font-size:.92rem; }

/* push banner */
.banner { background:#fff3e3; border:1px solid #f0d9b8; border-radius:12px; padding:10px 12px;
  margin-bottom:10px; font-size:.9rem; color:var(--brand-dark); }
.banner.mini { background:transparent; border:none; padding:4px 2px; color:var(--muted); font-size:.8rem; }
.banner.mini a { color:var(--brand); }
.banner button { background:var(--brand); }
