.appbar {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.tabs { display: flex; gap: 8px; }
.tabs a {
  text-decoration: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
}
.tabs a[aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }
#who { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.who-faces { display: flex; align-items: center; }
.who-faces .who-face {
  display: inline-flex; margin-left: -8px; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--paper);
}
.who-faces .who-face:first-child { margin-left: 0; }
.who-faces .who-face.mine { box-shadow: 0 0 0 2px var(--ink); }
.who-empty, .who-name { color: var(--muted); font-size: 13px; }
.chip.ghost { background: transparent; }
.face { display: block; border-radius: 50%; }

.vote {
  display: flex; align-items: center; gap: 10px;
  margin: 12px 0 4px; min-height: 32px;
}
.heart {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 4px 10px; cursor: pointer; font: inherit; font-size: 13px;
}
.heart svg { fill: none; stroke: currentColor; stroke-width: 1.8; }
.heart.on { background: #fff1e7; border-color: #ea580c; color: #c2410c; }
.heart.on svg { fill: #ea580c; stroke: #ea580c; }
.heart:disabled { opacity: .55; cursor: not-allowed; }
.faces { display: flex; align-items: center; flex-wrap: wrap; }
.faces span { display: inline-flex; margin-left: -6px; }
.faces span:first-child { margin-left: 0; }
.faces .none { margin: 0; color: var(--muted); font-size: 13px; }

.gate {
  display: none; position: fixed; inset: 0; z-index: 5000;
  background: rgba(42, 36, 28, .42);
  align-items: center; justify-content: center;
  padding: 24px; overflow: auto;
}
.gate.open { display: flex; }
.gate-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-height: min(92vh, 720px);
  overflow: auto;
  margin: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 20px 20px;
  box-shadow: 0 20px 50px rgba(42, 36, 28, .2);
}
.gate-card h2 { margin: 0 0 6px; font-size: 24px; }
.gate-card p { color: var(--muted); margin: 0 0 14px; }
.gate-card label { display: block; margin: 10px 0; font-size: 13px; color: var(--muted); }
.gate-card input {
  display: block; width: 100%; margin-top: 6px;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; font: inherit; color: var(--ink); background: #fff;
}
.picks, .claims { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.pick, .claim {
  border: 2px solid transparent; background: #fff; border-radius: 16px;
  padding: 6px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 64px;
  -webkit-tap-highlight-color: transparent;
}
.pick.on, .claim.on, .claim:hover { border-color: var(--ink); }
.claim span { font-size: 11px; color: var(--ink); line-height: 1.2; }
.picks.dim { opacity: .38; pointer-events: none; }
.reclaim-hint { color: var(--ink) !important; font-size: 13px; margin: 0 0 8px !important; }
.claim-wrap b { font-size: 13px; }
.claim-tip { display: block; font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
.enter {
  width: 100%; border: 0; background: var(--ink); color: #fff;
  border-radius: 12px; padding: 10px 14px; font: inherit; cursor: pointer;
}
.gate-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 28px/1 "Segoe UI", sans-serif;
  cursor: pointer;
  border-radius: 50%;
}
.gate-x:hover { background: #f3ece3; color: var(--ink); }
.gate-cancel {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  cursor: pointer;
}
.gate-err { color: #b42318; font-size: 13px; }

.days {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin: 8px 0 28px;
}
.day {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px;
  min-height: 280px;
}
.day h2 { font-size: 18px; margin: 0 0 4px; }
.day h2 span { display: block; font-size: 13px; font-weight: 450; color: var(--muted); }
.slot {
  border: 1px dashed var(--line); border-radius: 12px;
  min-height: 64px; margin-top: 10px; padding: 10px;
  color: var(--muted); font-size: 13px;
}
.pool { margin-bottom: 40px; }
.pool h2 { font-size: 18px; margin: 0 0 8px; }
.pool-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pool-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 10px 6px 6px; font-size: 14px;
}
.pool-item .faces { pointer-events: none; }
.empty-pool { color: var(--muted); }

html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
body.gated { overflow: hidden; }
.tabs a, .chip, .heart, .enter, .pick, .claim, .gate-x, .gate-cancel {
  touch-action: manipulation;
}

@media (max-width: 720px) {
  .appbar, header, main, footer {
    width: calc(100% - 20px);
  }
  .appbar {
    padding-top: max(10px, env(safe-area-inset-top));
    gap: 8px;
  }
  .tabs { width: 100%; }
  .tabs a {
    flex: 1;
    text-align: center;
    padding: 10px 12px;
    min-height: 40px;
  }
  #who { width: 100%; }
  .chip, .heart {
    min-height: 40px;
    padding: 8px 12px;
  }
  .gate {
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
    align-items: flex-start;
  }
  .gate-card {
    width: 100%;
    max-height: min(94vh, 94dvh);
    padding: 18px 14px 16px;
    border-radius: 16px;
    margin: 8px auto 20px;
  }
  .gate-card h2 { font-size: 22px; }
  .gate-card input {
    font-size: 16px;
    padding: 12px;
    min-height: 44px;
  }
  .picks, .claims { gap: 8px; }
  .pick, .claim {
    min-width: calc(25% - 8px);
    padding: 8px 4px;
  }
  .enter, .gate-cancel {
    min-height: 48px;
    padding: 12px 14px;
    font-size: 16px;
  }
  .gate-x {
    width: 44px;
    height: 44px;
  }
  .days { grid-template-columns: 1fr; }
  .pool-item { max-width: 100%; }
}

@media (max-width: 420px) {
  .pick, .claim { min-width: calc(33.33% - 8px); }
}
