:root {
  --bg: #121212;
  --card: #1e1e1e;
  --field: #262626;
  --line: #3a3a3a;
  --text: #f1f1f1;
  --muted: #a3a3a3;
  --accent: #e57373;
  --ok: #66bb6a;
  --warn: #ffb74d;
  --bad: #ef5350;
  --info: #90caf9;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #181818;
  border-bottom: 1px solid var(--line);
}
header .logo { width: 36px; height: 36px; border-radius: 8px; }
header h1 { font-size: 18px; margin: 0; }
#account-button { margin-left: auto; }

main { max-width: 640px; margin: 0 auto; padding: 16px 16px 32px; }
h2 { font-size: 22px; margin: 8px 0 8px; }
h3 { font-size: 17px; margin: 28px 0 6px; }
.form-subhead { font-size: 19px; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
p { margin: 8px 0; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center-text { text-align: center; }
.hint { display: block; color: var(--muted); font-size: 14px; font-weight: normal; }

footer {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

/* ---------- controls ---------- */
button, .button-like {
  font: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #2a2a2a;
  color: var(--text);
  cursor: pointer;
}
button:disabled { opacity: 0.55; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #111; font-weight: 600; }
button.big { width: 100%; font-size: 17px; }
button.danger { border-color: var(--bad); color: var(--bad); }
button.link { background: none; border: none; color: var(--accent); padding: 4px 0; min-height: 0; }
button.small-btn { min-height: 36px; padding: 4px 14px; font-size: 14px; }

input, select, textarea {
  font: inherit;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--text);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.stack { display: grid; gap: 18px; }
.stack > label, .photo-field .label { display: grid; gap: 6px; font-weight: 600; }

fieldset { border: none; margin: 0; padding: 0; display: grid; gap: 6px; }
legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
  cursor: pointer;
  font-weight: normal;
}
.choice input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.choice:has(input:checked) { border-color: var(--accent); }
.choice .emoji { font-size: 20px; line-height: 1.2; }

.error { background: #3a1d1d; color: var(--bad); padding: 10px 12px; border-radius: 10px; margin: 0; }
.note { background: #3a2e1a; color: var(--warn); padding: 10px 12px; border-radius: 10px; margin: 8px 0; }

.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0 12px; }
.row h2 { margin: 0; }

/* ---------- display cards ---------- */
.card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
}
.card .thumb {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  object-fit: cover;
  background: #000;
}
.card .thumb.empty { display: grid; place-items: center; font-size: 34px; }
.card h4 { margin: 0; font-size: 17px; }
.card .meta { color: var(--muted); font-size: 14px; }
.card .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.badge {
  display: inline-block;
  margin: 4px 0 2px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: #333;
}
.badge.ok { background: #1f3a22; color: var(--ok); }
.badge.wait { background: #3a2e1a; color: var(--warn); }
.badge.bad { background: #3a1d1d; color: var(--bad); }
.badge.info { background: #1d2a3a; color: var(--info); }
.empty-state { text-align: center; padding: 24px 12px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); }

/* ---------- photos ---------- */
.photo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 1;
  border: 1px solid var(--line);
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .main-tag {
  position: absolute; top: 6px; left: 6px;
  background: var(--accent); color: #111; font-size: 12px; font-weight: 700;
  padding: 1px 8px; border-radius: 999px;
}
.photo .tools {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  padding: 18px 4px 4px;
}
.photo .tools button {
  min-height: 34px; width: 34px; padding: 0; border-radius: 50%;
  background: rgba(30, 30, 30, 0.85); border-color: #555; font-size: 16px;
}
.photo.busy::after {
  content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55);
}
#add-photos-label { justify-self: start; margin-top: 4px; font-weight: 600; }

/* Follow-up fields that appear after a "Yes" */
.reveal { display: grid; gap: 6px; font-weight: 600; margin-top: 6px; padding-left: 12px; border-left: 3px solid var(--accent); }
.disclaimer { margin: -8px 0 0; font-style: italic; }

.social { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 10px; font-weight: normal; }
.social span { color: var(--muted); }

.agree span { font-size: 14px; line-height: 1.45; }

/* Pause choices */
#pause-dialog {
  background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-radius: 16px;
  width: min(380px, 92vw); padding: 18px;
}
#pause-dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
#wait-dialog {
  background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-radius: 16px;
  width: min(400px, 92vw); padding: 18px;
}
#wait-dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.wait-line { margin-top: 6px; font-size: 14px; }
.wait-toggle { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; font-size: 14px; }
.wait-toggle input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.wait-toggle .hint { display: block; }
.pause-form { display: grid; gap: 10px; }
.pause-form h3 { margin: 0; }

.review-note {
  margin: 6px 0 2px; padding: 8px 10px; border-radius: 10px;
  background: #3a1d1d; color: #f4c7c7; font-size: 14px; white-space: pre-wrap;
}

/* ---------- event submissions (events.html) ---------- */
.card .thumb.contain { object-fit: contain; }
.time-list { display: grid; gap: 10px; }
.time-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.time-row label { display: grid; gap: 4px; font-weight: normal; font-size: 14px; color: var(--muted); }
.time-row .remove-time { min-height: 44px; width: 44px; padding: 0; }
@media (max-width: 480px) { .time-row { grid-template-columns: 1fr auto; } .time-row label:nth-child(2) { grid-column: 1; } .time-row .remove-time { grid-row: 1 / 3; grid-column: 2; } }
#add-time { justify-self: start; font-weight: 600; }
.choice strong { display: block; }
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
