:root {
  color-scheme: light;
  --ink: #243047;
  --muted: #6f7890;
  --line: #e8edf7;
  --bg: #f7fbff;
  --card: rgba(255, 255, 255, 0.92);
  --blue: #7db7ff;
  --pink: #ff9fbe;
  --green: #7ed6b2;
  --yellow: #ffd66b;
  --danger: #ff6f7d;
  --shadow: 0 18px 45px rgba(83, 112, 153, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 214, 107, 0.36), transparent 32rem),
    radial-gradient(circle at top right, rgba(125, 183, 255, 0.28), transparent 30rem),
    linear-gradient(180deg, #fff8fb 0%, var(--bg) 48%, #f8fff9 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 18px 14px 32px;
}

.hero {
  padding: 26px 18px 18px;
}

.eyebrow,
.catch,
.section-title p,
.member-card p,
.meta,
.reason,
.vote-status p {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.9rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 9vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.catch {
  margin: 12px 0 0;
  font-size: 1.05rem;
  line-height: 1.7;
}

.step-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px;
  margin: 0 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 28px rgba(118, 138, 164, 0.12);
  backdrop-filter: blur(16px);
}

.tab {
  min-height: 44px;
  border-radius: 18px;
  color: var(--muted);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 800;
}

.tab.active {
  color: #163355;
  background: #e8f3ff;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.section-block,
.destination-card,
.vote-card,
.result-card {
  border: 1px solid rgba(232, 237, 247, 0.9);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.section-block {
  padding: 18px;
  margin-bottom: 14px;
}

.section-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.section-title span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 16px;
  background: #fff0b8;
  font-size: 1.35rem;
}

h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

.section-title p {
  margin: 5px 0 0;
  line-height: 1.6;
}

.member-list,
.destination-list,
.result-summary {
  display: grid;
  gap: 12px;
}

.member-switcher {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.member-switcher button {
  min-height: 48px;
  border-radius: 16px;
  color: #59657c;
  background: #eef5ff;
  font-weight: 900;
}

.member-switcher button.active {
  color: #12304f;
  background: #ffeeb1;
  box-shadow: inset 0 0 0 2px rgba(255, 198, 62, 0.35);
}

.setup-handoff {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 18px;
  color: #526179;
  background: #fff9dd;
  font-weight: 800;
  line-height: 1.6;
}

.member-card {
  display: none;
  padding: 14px;
  border-radius: 22px;
  background: #fafdff;
  border: 1px solid var(--line);
}

.member-card.active {
  display: block;
}

.member-card h3 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.member-card-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.member-card-header .pill {
  flex: 0 0 auto;
}

.member-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.member-nav-button {
  min-height: 52px;
  border-radius: 18px;
  color: #354763;
  background: #eef5ff;
  font-weight: 900;
}

.member-nav-button.next {
  color: #163c2d;
  background: #dcf8ed;
}

.form-grid,
.member-fields {
  display: grid;
  gap: 12px;
}

.member-fields {
  grid-template-columns: 1fr 1fr;
}

label {
  display: grid;
  gap: 7px;
  color: #4b5870;
  font-size: 0.9rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid #dfe7f4;
  border-radius: 16px;
  color: var(--ink);
  background: #fff;
  padding: 12px 14px;
  outline: none;
}

textarea {
  min-height: 76px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(125, 183, 255, 0.2);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.chip-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #dfe7f4;
  border-radius: 16px;
  background: #fff;
}

.chip-check input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--pink);
}

.primary-action,
.ghost-action,
.vote-button {
  width: 100%;
  min-height: 56px;
  border-radius: 19px;
  font-weight: 900;
}

.primary-action {
  margin-top: 8px;
  color: #12304f;
  background: linear-gradient(135deg, #ffe38a, #aeeed3 52%, #a9d5ff);
  box-shadow: 0 14px 28px rgba(97, 144, 181, 0.2);
}

.ghost-action {
  color: #4a5a72;
  background: #eef5ff;
}

.destination-card,
.result-card {
  padding: 16px;
}

.destination-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.tag-row,
.score-row,
.match-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef5ff;
  color: #3d587a;
  font-size: 0.78rem;
  font-weight: 800;
}

.tag.good {
  background: #eafaf1;
  color: #277654;
}

.tag.warn {
  background: #fff2d1;
  color: #836018;
}

.tag.danger {
  background: #ffe9ec;
  color: #aa3543;
}

.score-block {
  margin-top: 14px;
}

.score-line {
  display: grid;
  grid-template-columns: 84px 1fr 46px;
  gap: 8px;
  align-items: center;
  margin-top: 9px;
  font-size: 0.86rem;
  font-weight: 800;
}

.score-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf7;
}

.score-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), var(--yellow), var(--green));
}

.vote-status {
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.vote-card {
  min-height: 560px;
  padding: 20px;
}

.vote-card.empty {
  min-height: 260px;
  display: grid;
  place-items: center;
  text-align: center;
}

.vote-member {
  margin-top: 18px;
  padding: 14px;
  border-radius: 22px;
  background: #fafdff;
  border: 1px solid var(--line);
}

.vote-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.vote-button.no {
  color: #8f2634;
  background: #ffe8ed;
}

.vote-button.yes {
  color: #176145;
  background: #dcf8ed;
}

.result-card.match {
  border-color: rgba(126, 214, 178, 0.8);
}

.result-card.hold {
  border-color: rgba(255, 214, 107, 0.9);
}

.empty-note {
  padding: 18px;
  border-radius: 22px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.hidden {
  display: none !important;
}

.room-chip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  font-weight: 800;
  font-size: 0.9rem;
  color: #35476b;
}

.sync-dot {
  font-size: 0.8rem;
  color: var(--muted);
}

.chip-button {
  margin-left: auto;
  min-height: 34px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #eef5ff;
  color: #4a5a72;
  font-size: 0.8rem;
  font-weight: 800;
}

.count-label {
  margin: 0 0 8px;
  color: #4b5870;
  font-size: 0.9rem;
  font-weight: 800;
}

.count-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.count-picker button {
  min-height: 48px;
  border-radius: 16px;
  color: #59657c;
  background: #eef5ff;
  font-weight: 900;
}

.count-picker button.active {
  color: #12304f;
  background: #ffeeb1;
  box-shadow: inset 0 0 0 2px rgba(255, 198, 62, 0.35);
}

.join-divider {
  margin: 18px 0 10px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.join-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
  align-items: center;
}

.join-row input {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.lobby-note {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.9rem;
}

.vote-others {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 50;
  max-width: min(92vw, 480px);
  padding: 14px 18px;
  border-radius: 18px;
  background: #243047;
  color: #fff;
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.5;
  box-shadow: 0 16px 36px rgba(36, 48, 71, 0.35);
}

@media (min-width: 680px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 430px) {
  .app-shell {
    padding-inline: 10px;
  }

  .member-fields,
  .checkbox-grid,
  .vote-status,
  .member-actions {
    grid-template-columns: 1fr;
  }

  .tab {
    font-size: 0.74rem;
  }

  .score-line {
    grid-template-columns: 72px 1fr 42px;
  }
}
