:root {
  --bg: #f3f6f1;
  --card: #ffffff;
  --text: #1c2a22;
  --muted: #5d6b63;
  --line: #dde5df;
  --brand: #1f6b43;
  --brand-text: #ffffff;
  --ball: #d4e83a;
  --yes: #1f8a4c;
  --yes-soft: #e3f4e9;
  --no: #b3413b;
  --no-soft: #f9e6e4;
  --wait: #a36a00;
  --wait-soft: #fbf0d9;
  --shadow: 0 1px 3px rgba(20, 40, 30, 0.08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111814;
    --card: #1a231e;
    --text: #e6ede8;
    --muted: #9aa8a0;
    --line: #2c3831;
    --brand: #3a9a66;
    --yes: #4cc47f;
    --yes-soft: #1c3527;
    --no: #e27b74;
    --no-soft: #3a2220;
    --wait: #e0a83a;
    --wait-soft: #3a2e14;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--brand); }

header.top {
  background: var(--brand);
  color: var(--brand-text);
  padding: 14px 16px;
}
header.top .inner { max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
header.top a { color: inherit; text-decoration: none; font-weight: 700; font-size: 19px; }
.ball {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ball);
  box-shadow: inset 3px 0 0 -1px #fff8, inset -3px 0 0 -1px #fff8;
  flex: none;
}
header.top .spacer { flex: 1; }
header.top .small { font-size: 14px; font-weight: 500; opacity: 0.9; }

main { max-width: 640px; margin: 0 auto; padding: 16px 16px 48px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
h1 { font-size: 24px; margin: 0 0 4px; line-height: 1.2; }
h2 { font-size: 19px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.event-when { font-size: 18px; margin: 6px 0 2px; }
.event-where { color: var(--muted); margin: 0 0 14px; }
.note { background: var(--wait-soft); color: var(--text); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.owner-notice {
  background: var(--wait-soft); color: var(--text);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 16px;
  font-size: 15px; overflow-wrap: anywhere;
}
.cancel-banner { background: var(--no-soft); color: var(--no); border-radius: 10px; padding: 12px; font-weight: 600; margin: 10px 0; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
button, .button {
  font: inherit; font-weight: 600;
  border: 1px solid var(--line);
  background: var(--card); color: var(--text);
  border-radius: 12px;
  padding: 12px 16px;
  min-height: 48px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
button:disabled { opacity: 0.55; cursor: default; }
.primary { background: var(--brand); color: var(--brand-text); border-color: var(--brand); }
.choice-yes.on { background: var(--yes); border-color: var(--yes); color: #fff; }
.choice-no.on { background: var(--no); border-color: var(--no); color: #fff; }
.link-btn { background: none; border: none; color: var(--brand); padding: 6px 0; min-height: 0; font-weight: 600; }
.danger { color: var(--no); }
.full { width: 100%; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.status { border-radius: 10px; padding: 10px 12px; margin: 12px 0 0; font-weight: 600; }
.status.going { background: var(--yes-soft); color: var(--yes); }
.status.waitlist { background: var(--wait-soft); color: var(--wait); }
.status.no { background: var(--no-soft); color: var(--no); }

.count-line { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 15px; margin: 0 0 4px; }
.count-line b { color: var(--text); }

ul.people { list-style: none; padding: 0; margin: 0; }
ul.people li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
}
ul.people li:last-child { border-bottom: none; }
.num { width: 24px; color: var(--muted); font-size: 14px; text-align: right; flex: none; }
.pname { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.badge {
  font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 9px;
  background: var(--bg); color: var(--muted); border: 1px solid var(--line); white-space: nowrap;
}
.badge.Beginner { background: #e8f1fb; color: #2a5d8f; border-color: #cfe0f3; }
.badge.Intermediate { background: var(--wait-soft); color: var(--wait); border-color: transparent; }
.badge.Advanced { background: var(--no-soft); color: var(--no); border-color: transparent; }
@media (prefers-color-scheme: dark) {
  .badge.Beginner { background: #1a2a3a; color: #8bb8e6; border-color: transparent; }
}
.empty { color: var(--muted); font-style: italic; padding: 6px 0; }

label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 15px; }
label .opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=number], select, textarea {
  font: inherit; width: 100%;
  padding: 11px 12px; min-height: 48px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text);
}
textarea { min-height: 80px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; margin: 14px 0; }
.check input { width: 22px; height: 22px; flex: none; }
.form-actions { margin-top: 18px; }

.error { background: var(--no-soft); color: var(--no); border-radius: 10px; padding: 10px 12px; margin: 12px 0 0; }
.ok { background: var(--yes-soft); color: var(--yes); border-radius: 10px; padding: 10px 12px; margin: 12px 0 0; }
.hidden { display: none !important; }

details > summary { cursor: pointer; font-weight: 600; padding: 4px 0; list-style-position: inside; }

.copybox { display: flex; gap: 8px; margin-top: 8px; }
.copybox input { flex: 1; min-width: 0; font-size: 14px; }

/* organizer page */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 2px; }
.tabs button { flex: none; min-height: 40px; padding: 8px 14px; border-radius: 999px; font-size: 15px; }
.tabs button.on { background: var(--brand); color: var(--brand-text); border-color: var(--brand); }
.member { border-bottom: 1px solid var(--line); padding: 12px 0; }
.member:last-child { border-bottom: none; }
.member .top-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.member .details { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; margin-top: 2px; }
.member .row { margin-top: 8px; }
.member .row button { min-height: 38px; padding: 6px 12px; font-size: 14px; }
.week { border-bottom: 1px solid var(--line); padding: 12px 0; }
.week:last-child { border-bottom: none; }
.week .top-line { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.tag { font-size: 12px; font-weight: 700; border-radius: 6px; padding: 2px 8px; }
.tag.cancelled { background: var(--no-soft); color: var(--no); }
.tag.changed { background: var(--wait-soft); color: var(--wait); }
select.mini { min-height: 38px; padding: 6px 8px; width: auto; font-size: 14px; }
