/* ---------------------------------------------------------------------------
   One block kit, ten biomes.

   Every colour comes from the biome the trip picked for itself — the palette is
   injected as custom properties at load, so nothing here hardcodes a hue. The
   geometry never changes: 3px outline, 16px corner, 4px hard shadow. Adding a
   holiday type costs a palette, not a redesign.
   --------------------------------------------------------------------------- */
:root {
  /* fallback biome (city) — replaced by the trip's own palette on load */
  --ground: #2b1c2e;
  --block: #33203a;
  --line: #1a0f1d;
  --ink: #fbf1f4;
  --dim: #c09cae;
  --accent: #ff9d3d;
  --accent2: #7bd6c0;
  --hero-a: #592f52;
  --hero-b: #8a4062;

  --yes: var(--accent2);
  --maybe: #ffd166;
  --no: var(--dim);
  --radius: 16px;
  --shadow: 4px 4px 0 var(--line);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ground); color: var(--ink);
  font: 16px/1.45 "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overscroll-behavior-y: none;
  transition: background-color .5s ease, color .5s ease;
}
#app { max-width: 560px; margin: 0 auto; padding: 0 16px calc(92px + env(safe-area-inset-bottom)); }

h1, h2, h3 { margin: 0; font-family: "Baloo 2", "Rubik", sans-serif; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: 30px; }
h2 { font-size: 20px; }
p { margin: 0 0 12px; }
.muted { color: var(--dim); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fat { font-family: "Baloo 2", "Rubik", sans-serif; font-weight: 800; }

header.top {
  position: sticky; top: 0; z-index: 5; background: var(--ground);
  padding: 16px 0 12px; margin-bottom: 14px;
}
header.top .code { font-size: 13px; color: var(--dim); }

/* ---------- the block ---------- */
.card {
  background: var(--block); border: 3px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; margin-bottom: 12px;
}
.card.tight { padding: 12px; }
.card.win { border-color: var(--accent2); }

button, .btn {
  font: inherit; font-family: "Baloo 2", "Rubik", sans-serif; font-weight: 700;
  border: 3px solid var(--line); background: var(--block); color: var(--ink);
  border-radius: 12px; padding: 10px 14px; cursor: pointer;
  box-shadow: 3px 3px 0 var(--line);
  transition: transform .06s ease, box-shadow .06s ease;
}
button:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--line); }
.btn-primary { background: var(--accent); border-color: var(--line); color: var(--line); }
.btn-full { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 14px; border-radius: 10px; box-shadow: 2px 2px 0 var(--line); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--dim); }
.btn-ghost:active { transform: none; }
.btn-on { background: var(--accent2); color: var(--line); }

input, select, textarea {
  font: inherit; width: 100%; background: var(--ground); color: var(--ink);
  border: 3px solid var(--line); border-radius: 12px; padding: 11px 12px;
}
input:focus, select:focus, textarea:focus { outline: 3px solid var(--accent); outline-offset: -1px; }
label.field { display: block; margin-bottom: 10px; }
label.field span { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 5px; font-weight: 500; }

nav.tabs {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 10;
  width: 100%; max-width: 560px;
  display: flex; background: var(--block); border-top: 3px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
nav.tabs button {
  flex: 1; border: 0; background: none; border-radius: 0; padding: 11px 2px 14px;
  font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--dim); display: grid; gap: 4px; justify-items: center; box-shadow: none;
}
nav.tabs button:active { transform: none; }
nav.tabs button .ic { display: block; width: 22px; height: 22px; }
nav.tabs button .ic svg { width: 22px; height: 22px; display: block; }
nav.tabs button[aria-current="true"] { color: var(--accent); }

.avatar {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: var(--line); flex: none;
  border: 2px solid var(--line); font-family: "Baloo 2", sans-serif;
}
.pill {
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  border: 2px solid var(--line); background: var(--ground);
}
.pill.yes { background: var(--accent2); color: var(--line); }
.pill.maybe { background: var(--maybe); color: var(--line); }
.pill.no { color: var(--dim); }

.bar { height: 8px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 8px 0 6px; }
.bar > i { display: block; height: 100%; background: var(--accent2); }

.stack-avatars { display: flex; }
.stack-avatars .avatar { width: 26px; height: 26px; font-size: 10px; margin-left: -7px; }
.stack-avatars .avatar:first-child { margin-left: 0; }

.day-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em;
  color: var(--dim); margin: 20px 0 8px; }
.item { display: flex; gap: 10px; align-items: flex-start; }
.item .kind { font-size: 18px; width: 24px; text-align: center; flex: none; }
.time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; color: var(--accent); }

.tl { position: relative; padding-left: 24px; }
.tl::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 3px;
  background: var(--line); border-radius: 2px; }
.tl .dot { position: absolute; left: 0; width: 16px; height: 16px; border-radius: 5px;
  border: 3px solid var(--line); }

.money { font-variant-numeric: tabular-nums; font-weight: 800; font-family: "Baloo 2", sans-serif; }
.pos { color: var(--accent2); } .neg { color: var(--accent); }

dialog {
  border: 0; border-top: 3px solid var(--line); border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  width: 100%; max-width: 560px; background: var(--block); color: var(--ink);
  margin: auto auto 0; position: fixed; inset: auto 0 0 0;
}
dialog::backdrop { background: color-mix(in srgb, var(--line) 70%, transparent); }
.sheet-title { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 20px; margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.empty { text-align: center; color: var(--dim); padding: 26px 10px; }
.empty .big { font-size: 32px; display: block; margin-bottom: 6px; }
.loading::after { content: "…"; display: block; text-align: center; padding: 60px; color: var(--dim); }
.fab-row { padding-top: 14px; }

/* ---------- the trip tab ---------- */
.ask { padding: 14px 2px 12px; }
.ask h3 { font-size: 28px; margin: 0 0 4px; }

.deadline {
  display: block; width: 100%; text-align: left;
  background: var(--accent); border-color: var(--line); color: var(--line);
}
.deadline.due { background: var(--block); color: var(--dim); }

.hero {
  position: relative; overflow: hidden; text-align: center;
  padding: 26px 16px 88px; margin-bottom: 12px;
  background: linear-gradient(180deg, var(--hero-a), var(--hero-b));
  border: 3px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.hero-where { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 46px;
  letter-spacing: -0.02em; line-height: 1; }
.hero-when {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 12px;
  background: var(--line); border-radius: 999px; padding: 7px 14px;
  font-size: 13px; font-weight: 700; color: var(--accent2);
}
.hero-art { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 96px; opacity: .95; }

.chase { display: flex; width: 100%; text-align: left; align-items: center; }
.chase strong { color: var(--accent); }

.load { border-color: var(--accent); }
.load strong { display: block; margin-bottom: 3px; }

.seg {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 14px;
  background: var(--block); border: 3px solid var(--line); border-radius: 14px;
}
.seg button {
  flex: 1; border: 0; background: none; border-radius: 9px; padding: 9px 6px;
  font-size: 14px; color: var(--dim); box-shadow: none;
}
.seg button:active { transform: none; }
.seg button[aria-current="true"] { background: var(--accent); color: var(--line); }
.seg.seg-sm { margin: 0; padding: 3px; }
.seg.seg-sm button { padding: 5px 10px; font-size: 12px; flex: none; }

.seats { margin-top: 10px; padding-top: 10px; border-top: 3px dashed var(--line); }
.who {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--ground); border: 2px solid var(--line); border-radius: 999px; padding: 2px 9px 2px 2px;
}
.who .avatar { width: 22px; height: 22px; font-size: 10px; }
button[disabled] { opacity: .45; }

.commit { display: block; width: 100%; text-align: left; }
.commit.ask-commit { color: var(--dim); }
.commit.short { border-color: var(--accent); }
.commit.met { border-color: var(--accent2); }
.commit.off { border-color: var(--dim); }
.commit.off strong { display: block; margin-bottom: 3px; }
.commit .small { color: var(--dim); }

.card.objected { border-color: var(--maybe); }
.objection {
  margin-top: 8px; padding: 8px 10px; border-radius: 10px;
  background: var(--ground); border: 2px solid var(--line);
  font-size: 13px; color: var(--maybe);
}

.pledge { border-color: var(--accent2); }
.notfussed { background: var(--ground); }
.notfussed select { max-width: 100%; }

/* the hero art sits behind the content, never under a face */
.hero > *:not(.hero-art):not(.mayzee-stage) { position: relative; z-index: 1; }

/* the biome badge — says why the app looks like this, so it never seems random */
.biome-tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--dim);
  background: var(--block); border: 2px solid var(--line); border-radius: 999px;
  padding: 5px 11px; box-shadow: none;
}

[hidden] { display: none !important; }

/* ---------- Mayzee ---------- */
.mayzee { display: block; }
.mayzee-stage {
  position: absolute; right: 12px; bottom: 6px; z-index: 2;
  animation: bob 3.2s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { .mayzee-stage { animation: none; } }
