:root {
  --bg: #16110d;
  --card: #221a14;
  --line: #3a2d22;
  --ink: #f6efe8;
  --ink-2: #c9bcae;
  --ink-3: #8d7f72;
  --orange: #f08a24;
  --orange-ink: #1b1006;
  --in: #4cc38a;
  --maybe: #e7b949;
  --out: #e0675d;
  --radius: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0 auto;
  max-width: 560px;
  min-height: 100dvh;
  padding: max(14px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.top h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.chip { padding: 3px 10px; border-radius: 999px; background: var(--orange); color: var(--orange-ink); font-size: 13px; font-weight: 700; }

.quiet { color: var(--ink-3); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0 0 12px; }
.card h2 { margin: 0 0 10px; font-size: 17px; }

label { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
input {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
input:focus { outline: 2px solid var(--orange); outline-offset: 1px; }
/* iPhones draw date and time boxes at their own width unless told not to */
input[type="date"], input[type="time"] { display: block; min-width: 0; -webkit-appearance: none; appearance: none; }
input::-webkit-date-and-time-value { text-align: left; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row > label { min-width: 0; }

details.card > summary { display: flex; align-items: center; justify-content: space-between; min-height: 28px; list-style: none; font-size: 17px; font-weight: 700; cursor: pointer; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "+"; color: var(--orange); font-size: 24px; line-height: 1; }
details.card[open] > summary { margin-bottom: 12px; }
details.card[open] > summary::after { content: "–"; }
.stack { display: grid; gap: 10px; }

.primary {
  min-height: 46px;
  padding: 10px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--orange);
  color: var(--orange-ink);
  font-weight: 700;
}
.primary:disabled { opacity: .6; cursor: default; }
.link { padding: 6px 2px; border: 0; background: none; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }

/* a session */
.when { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0; font-size: 18px; font-weight: 700; }
.when .time { font-weight: 500; color: var(--ink-2); font-size: 16px; }
.soon { padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--orange) 22%, transparent); color: var(--orange); font-size: 12px; font-weight: 700; }
.place { margin: 4px 0 0; color: var(--ink-2); }
.note { margin: 4px 0 0; color: var(--ink-3); font-size: 14px; white-space: pre-wrap; }
.count { margin: 10px 0 8px; font-size: 14px; color: var(--ink-2); }
.count b { color: var(--in); font-size: 16px; }

.answer { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.answer button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  font-weight: 600;
}
.answer button[aria-pressed="true"].in { background: var(--in); border-color: var(--in); color: #08160f; }
.answer button[aria-pressed="true"].maybe { background: var(--maybe); border-color: var(--maybe); color: #1d1503; }
.answer button[aria-pressed="true"].out { background: var(--out); border-color: var(--out); color: #1e0705; }

.who { display: grid; gap: 4px; margin: 10px 0 0; font-size: 14px; }
.who p { margin: 0; color: var(--ink-2); }
.who span { font-weight: 700; }
.who .in span { color: var(--in); }
.who .maybe span { color: var(--maybe); }
.who .out span { color: var(--out); }

.admin-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.admin-row .link { color: var(--out); }

.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 18px; font-size: 14px; color: var(--ink-3); }
.foot #me { margin-right: auto; }

.toast {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: #f6efe8;
  color: #16110d;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.toast.show { opacity: 1; }
