:root {
  --bg: #e9f6ff;
  --ink: #274056;
  --muted: #5b7386;
  --line: rgba(255, 255, 255, 0.7);
  --accent: #3aa0d6;
  --accent-deep: #2b7fad;
  --accent-soft: rgba(58, 160, 214, 0.16);
  --you: #274056;
  --them: #3aa0d6;
  --panel: rgba(255, 255, 255, 0.72);
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --radius: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 280ms;
  --font: Nunito, Inter, "Helvetica Neue", Arial, sans-serif;
  --max: 720px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, #7ecff3 0%, #98daf6 40%, #b6e7fb 100%);
  font-size: 16px;
  line-height: 1.45;
}

body.welcome-mode {
  background: linear-gradient(180deg, #1f9ee8 0%, #2aa8ee 32%, #38b4f2 62%, #2ea6ea 100%);
}

body.welcome-mode .site-header,
body.welcome-mode .app-nav {
  display: none;
}

body.map-mode .app-nav,
body.map-mode .site-header {
  position: relative;
  top: 0;
  background: transparent;
}

h1,
h2,
h3 {
  font-family: var(--font);
  color: var(--ink);
  margin: 0 0 0.3em;
  letter-spacing: -0.04em;
  font-weight: 800;
}

p {
  margin: 0 0 0.85em;
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 56px 4px;
  max-width: none;
  margin: 0 auto;
}

.header-reset {
  position: absolute;
  right: 12px;
  top: 14px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #5b7386;
}

.welcome-reset {
  margin-top: 18px;
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  font-weight: 700;
}

.logo {
  background: none;
  border: 0;
  padding: 0;
  font-family: "Bagel Fat One", "Nunito", cursive;
  font-weight: 400;
  letter-spacing: 0.04em;
  font-size: 1.05rem;
  color: #2f7eb8;
  text-align: center;
}

.app-nav {
  position: sticky;
  top: 40px;
  z-index: 19;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px;
  padding: 4px;
  max-width: 440px;
  margin: 0 auto 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px);
}

.nav-link {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 10px 10px;
  font-weight: 700;
  font-size: 0.78rem;
  border-radius: 999px;
  min-height: 44px;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.active {
  color: var(--ink);
  background: #fff;
  border-bottom-color: transparent;
}

.screen {
  width: min(100% - 40px, var(--max));
  margin: 0 auto;
  padding: 12px 0 80px;
  animation: fade-up var(--dur) var(--ease);
}

#screen-welcome {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

.story-sky {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.sun-glow {
  position: absolute;
  top: -6%;
  right: 4%;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 236, 170, 0.9) 0%, rgba(255, 214, 150, 0.28) 42%, transparent 70%);
}

.sun {
  position: absolute;
  top: 6%;
  right: 12%;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #fff7d1, #ffd56a 58%, #ffbf71);
  box-shadow: 0 0 40px rgba(255, 210, 120, 0.7);
}

.sparkle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #fff;
  transform: rotate(45deg);
  border-radius: 1px;
  animation: twinkle 2.8s ease-in-out infinite;
}

.sparkle.s1 { top: 18%; left: 12%; }
.sparkle.s2 { top: 28%; right: 22%; width: 6px; height: 6px; animation-delay: 0.6s; }
.sparkle.s3 { top: 12%; left: 48%; animation-delay: 1.1s; }
.sparkle.s4 { top: 36%; left: 22%; width: 5px; height: 5px; animation-delay: 1.7s; }
.sparkle.s5 { top: 22%; right: 40%; animation-delay: 0.3s; }

@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: rotate(45deg) scale(0.7); }
  50% { opacity: 1; transform: rotate(45deg) scale(1.15); }
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 999px;
  animation: cloud-drift 34s linear infinite;
  box-shadow: 16px 12px 0 rgba(255, 255, 255, 0.32);
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 999px;
}

.cloud::before {
  width: 58%;
  height: 140%;
  top: -70%;
  left: 16%;
}

.cloud::after {
  width: 48%;
  height: 120%;
  top: -50%;
  right: 10%;
}

.cloud.c1 { width: 210px; height: 52px; top: 10%; animation-duration: 38s; }
.cloud.c2 { width: 280px; height: 64px; top: 18%; animation-duration: 26s; animation-delay: -10s; }
.cloud.c3 { width: 170px; height: 44px; top: 58%; opacity: 0.88; animation-duration: 42s; animation-delay: -20s; }
.cloud.c4 { width: 240px; height: 56px; top: 8%; animation-duration: 22s; animation-delay: -14s; }
.cloud.c5 { width: 190px; height: 48px; top: 64%; animation-duration: 30s; animation-delay: -6s; }
.cloud.c6 { width: 300px; height: 70px; top: 14%; opacity: 0.72; animation-duration: 48s; animation-delay: -18s; }
.cloud.c7 { width: 140px; height: 38px; top: 48%; animation-duration: 20s; animation-delay: -4s; }
.cloud.c8 { width: 220px; height: 50px; top: 72%; animation-duration: 36s; animation-delay: -12s; }

.cloud-shadow {
  position: absolute;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  filter: blur(8px);
  animation: cloud-drift 40s linear infinite;
}

.sh1 { width: 260px; top: 20%; animation-delay: -9s; }
.sh2 { width: 200px; top: 34%; animation-delay: -22s; }

@keyframes cloud-drift {
  from { transform: translateX(-40vw); }
  to { transform: translateX(110vw); }
}

.story-copy {
  position: relative;
  z-index: 4;
  width: min(100%, 640px);
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 12px;
}

.story-title {
  font-family: "Bagel Fat One", "Nunito", cursive;
  font-weight: 400;
  font-size: clamp(3.2rem, 12vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  margin: 0 auto;
  color: #fff;
  text-align: center;
  text-shadow:
    0 3px 0 rgba(18, 86, 140, 0.18),
    0 10px 0 rgba(18, 86, 140, 0.08),
    0 14px 28px rgba(12, 62, 110, 0.22);
}

.story-sub {
  margin: 10px auto;
  font-size: clamp(1.25rem, 4vw, 1.9rem);
  font-weight: 700;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 10px rgba(16, 70, 120, 0.2);
}

.story-copy .cover-copy {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.98rem;
  margin: 0 auto 22px;
  max-width: 28ch;
  text-align: center;
}

.story-copy .primary-button {
  min-width: 200px;
  min-height: 48px;
  margin: 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #1f7fbe;
  box-shadow: 0 10px 24px rgba(16, 70, 120, 0.22);
}

.shoe-trail {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.shoe {
  position: absolute;
  width: 16px;
  height: 28px;
  fill: #fff;
  opacity: 0;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 2px 2px rgba(18, 80, 130, 0.16));
  animation: shoe-step 9.2s ease-in-out infinite;
}

.shoe.p1  { left: 92%; top: 94%; transform: translate(-50%, -50%) rotate(158deg); animation-delay: 0s; }
.shoe.p2  { left: 85%; top: 90%; transform: translate(-50%, -50%) rotate(152deg) scaleX(-1); animation-delay: 0.4s; }
.shoe.p3  { left: 76%; top: 87%; transform: translate(-50%, -50%) rotate(146deg); animation-delay: 0.8s; }
.shoe.p4  { left: 66%; top: 85%; transform: translate(-50%, -50%) rotate(150deg) scaleX(-1); animation-delay: 1.2s; }
.shoe.p5  { left: 56%; top: 83%; transform: translate(-50%, -50%) rotate(158deg); animation-delay: 1.6s; }
.shoe.p6  { left: 48%; top: 80%; transform: translate(-50%, -50%) rotate(166deg) scaleX(-1); animation-delay: 2s; }
.shoe.p7  { left: 44%; top: 76%; transform: translate(-50%, -50%) rotate(174deg); animation-delay: 2.4s; }
.shoe.p8  { left: 46%; top: 72%; transform: translate(-50%, -50%) rotate(190deg) scaleX(-1); animation-delay: 2.8s; }
.shoe.p9  { left: 52%; top: 69%; transform: translate(-50%, -50%) rotate(196deg); animation-delay: 3.2s; }
.shoe.p10 { left: 58%; top: 67%; transform: translate(-50%, -50%) rotate(188deg) scaleX(-1); animation-delay: 3.6s; }
.shoe.p11 { left: 56%; top: 65%; transform: translate(-50%, -50%) rotate(172deg); animation-delay: 4s; }
.shoe.p12 { left: 54%; top: 64%; transform: translate(-50%, -50%) rotate(168deg) scaleX(-1); animation-delay: 4.4s; }
.shoe.p13 { left: 52%; top: 63%; transform: translate(-50%, -50%) rotate(170deg); animation-delay: 4.8s; }
.shoe.p14 { left: 50%; top: 62%; transform: translate(-50%, -50%) rotate(174deg) scaleX(-1); animation-delay: 5.2s; }

@keyframes shoe-step {
  0%, 2% { opacity: 0; }
  7%, 58% { opacity: 0.96; }
  72%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .shoe,
  .sparkle {
    animation: none;
  }

  .shoe {
    opacity: 0.85;
  }
}

.cover {
  text-align: center;
  padding: 40px 28px 48px;
  position: relative;
  z-index: 1;
  width: min(100% - 32px, 520px);
}

.glass-panel,
.glass-chip,
.marker-card,
.map-dock {
  background: var(--panel);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 18px 40px rgba(80, 140, 180, 0.12);
  border-radius: 28px;
}

.cover.glass-panel {
  background: rgba(230, 247, 255, 0.78);
  border: 1px solid rgba(180, 240, 255, 0.85);
  box-shadow: 0 0 40px rgba(90, 210, 255, 0.28), 0 24px 50px rgba(8, 40, 90, 0.18);
}

.cover h1 {
  font-size: clamp(3.4rem, 12vw, 7.2rem);
  line-height: 0.86;
  margin: 0 0 20px;
}

.mark {
  letter-spacing: 0.28em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 18px;
}

.cover-copy {
  color: var(--muted);
  font-size: 1.15rem;
  margin-bottom: 32px;
}

.converge {
  width: min(320px, 80vw);
  height: auto;
  margin-bottom: 28px;
}

.converge-line {
  stroke: var(--line);
  stroke-width: 1.5;
}

.converge-a,
.converge-b,
.converge-mid,
.dot-you,
.dot-them,
.dot-mid {
  fill: var(--ink);
}

.converge-b,
.dot-them {
  fill: var(--accent);
}

.converge-mid,
.dot-mid {
  fill: var(--bg);
  stroke: var(--accent);
  stroke-width: 2;
}

.converge-a {
  animation: drift-a 3.6s var(--ease) infinite alternate;
}

.converge-b {
  animation: drift-b 3.6s var(--ease) infinite alternate;
}

@keyframes drift-a {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(28px);
  }
}

@keyframes drift-b {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-28px);
  }
}

.plan-converge {
  width: 100%;
  max-width: 420px;
  margin: 8px 0 28px;
}

.plan-converge line {
  stroke: var(--line);
  stroke-width: 1.5;
}

.step-kicker {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.page-title {
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  line-height: 0.95;
  margin-bottom: 12px;
}

.bubble-title {
  font-family: "Bagel Fat One", "Nunito", cursive;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: #fff;
  text-align: center;
  text-shadow:
    0 3px 0 rgba(18, 86, 140, 0.14),
    0 10px 22px rgba(12, 62, 110, 0.16);
}

#screen-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: calc(100dvh - 120px);
  justify-content: center;
  padding-top: 12px;
}

#screen-profile .lede {
  margin-left: auto;
  margin-right: auto;
}

.profile-form {
  width: min(100%, 320px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar-pick {
  position: relative;
  margin: 4px auto 22px;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}

.avatar-pick input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

#screen-profile .avatar-preview {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  color: #5aa3d0;
  border: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 24px rgba(80, 150, 190, 0.18);
}

.avatar-plus {
  font-size: 2.6rem;
  font-weight: 400;
  line-height: 1;
  color: #6eb4dc;
}

#screen-profile .name-field {
  width: 100%;
  text-align: center;
}

#screen-profile .name-field input {
  text-align: center;
}

#screen-profile .primary-button {
  min-width: 180px;
  margin: 8px auto 0;
  background: #fff;
  color: #1f7fbe;
  box-shadow: 0 10px 24px rgba(16, 70, 120, 0.14);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bloom-veil {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  overflow: hidden;
  transition: opacity 0.45s ease;
}

.bloom-veil.is-on {
  pointer-events: auto;
}

.bloom-veil.is-fade {
  opacity: 0;
}

.bloom-veil .bloom-wash {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 90px;
  height: 64px;
  margin: 0;
  background: #6ec8f4;
  border-radius: 58% 42% 50% 50% / 48% 52% 42% 58%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.2);
  filter: blur(8px);
}

.bloom-veil.is-on .bloom-wash {
  animation: cloud-wash 1.65s cubic-bezier(0.12, 0.7, 0.18, 1) forwards;
}

@keyframes cloud-wash {
  0% {
    opacity: 0.85;
    transform: translate(-50%, -50%) scale(0.25);
    border-radius: 58% 42% 50% 50% / 48% 52% 42% 58%;
  }
  40% {
    opacity: 1;
    border-radius: 46% 54% 48% 52% / 52% 44% 56% 48%;
  }
  100% {
    opacity: 1;
    width: 160vmax;
    height: 160vmax;
    transform: translate(-50%, -50%) scale(1);
    border-radius: 0;
    filter: blur(0);
    background: #7ad4f8;
  }
}

.bloom-veil .puff {
  position: absolute;
  opacity: 0;
  background: radial-gradient(circle at 38% 40%, #9ee6ff 0%, #7ad4f8 28%, #5fc8f2 62%, #4ab8ea 100%);
  border-radius: 62% 38% 55% 45% / 48% 52% 44% 56%;
  filter: blur(2px);
  will-change: transform, opacity, filter;
}

.bloom-veil .puff.b { border-radius: 40% 60% 42% 58% / 55% 40% 60% 45%; }
.bloom-veil .puff.c { border-radius: 58% 42% 38% 62% / 40% 58% 42% 58%; }
.bloom-veil .puff.d { border-radius: 45% 55% 60% 40% / 62% 38% 50% 50%; }
.bloom-veil .puff.e { border-radius: 50% 50% 40% 60% / 35% 65% 48% 52%; }
.bloom-veil .puff.f { border-radius: 36% 64% 48% 52% / 58% 42% 56% 44%; }
.bloom-veil .puff.g { border-radius: 70% 30% 52% 48% / 42% 58% 38% 62%; }

.bloom-veil.is-on .puff {
  animation: cloud-bloom 1.75s cubic-bezier(0.12, 0.72, 0.18, 1) forwards;
}

.bloom-veil.is-on .puff.b { animation-name: cloud-bloom-b; animation-delay: 0.06s; }
.bloom-veil.is-on .puff.c { animation-name: cloud-bloom-c; animation-delay: 0.12s; }
.bloom-veil.is-on .puff.d { animation-name: cloud-bloom-d; animation-delay: 0.09s; }
.bloom-veil.is-on .puff.e { animation-name: cloud-bloom-e; animation-delay: 0.16s; }
.bloom-veil.is-on .puff.f { animation-name: cloud-bloom-f; animation-delay: 0.04s; }
.bloom-veil.is-on .puff.g { animation-name: cloud-bloom-g; animation-delay: 0.2s; }

@keyframes cloud-bloom {
  0% {
    transform: translate(-50%, -50%) scale(0.22);
    opacity: 0.95;
    filter: blur(1px);
  }
  28% {
    opacity: 1;
    filter: blur(8px);
  }
  100% {
    transform: translate(-50%, -50%) scale(16);
    opacity: 1;
    filter: blur(18px);
  }
}

@keyframes cloud-bloom-b {
  0% { transform: translate(-50%, -50%) scale(0.18); opacity: 0.95; filter: blur(1px); }
  100% { transform: translate(-68%, -62%) scale(14); opacity: 1; filter: blur(20px); }
}

@keyframes cloud-bloom-c {
  0% { transform: translate(-50%, -50%) scale(0.16); opacity: 0.95; filter: blur(1px); }
  100% { transform: translate(-32%, -40%) scale(15); opacity: 1; filter: blur(18px); }
}

@keyframes cloud-bloom-d {
  0% { transform: translate(-50%, -50%) scale(0.2); opacity: 0.95; filter: blur(1px); }
  100% { transform: translate(-42%, -28%) scale(16); opacity: 1; filter: blur(22px); }
}

@keyframes cloud-bloom-e {
  0% { transform: translate(-50%, -50%) scale(0.14); opacity: 0.95; filter: blur(1px); }
  100% { transform: translate(-58%, -72%) scale(13); opacity: 1; filter: blur(16px); }
}

@keyframes cloud-bloom-f {
  0% { transform: translate(-50%, -50%) scale(0.2); opacity: 0.95; filter: blur(1px); }
  100% { transform: translate(-78%, -48%) scale(14); opacity: 1; filter: blur(19px); }
}

@keyframes cloud-bloom-g {
  0% { transform: translate(-50%, -50%) scale(0.18); opacity: 0.95; filter: blur(1px); }
  100% { transform: translate(-24%, -56%) scale(15); opacity: 1; filter: blur(21px); }
}

@media (prefers-reduced-motion: reduce) {
  .bloom-veil.is-on .puff {
    animation: none;
    opacity: 0;
  }
}

.lede {
  color: var(--muted);
  max-width: 36ch;
  margin-bottom: 28px;
}

.primary-button,
.ghost-button,
.text-button {
  border-radius: var(--radius);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.primary-button:hover,
.ghost-button:hover,
.text-button:hover {
  transform: translateY(-1px);
}

.primary-button:focus-visible,
.ghost-button:focus-visible,
.text-button:focus-visible,
.nav-link:focus-visible,
input:focus-visible,
select:focus-visible,
.tab:focus-visible,
.choices label:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-deep);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 14px 24px;
  font-weight: 700;
  min-height: 48px;
}

.primary-button:hover {
  background: var(--accent);
}

.ghost-button {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  padding: 8px 0;
  color: var(--ink);
  font-weight: 600;
}

.text-button {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 8px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

input[type="text"],
input[type="file"],
select {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(39, 64, 86, 0.18);
  background: transparent;
  padding: 10px 0;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  font-size: 1rem;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.bare-form {
  max-width: 420px;
}

.photo-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.avatar-preview,
.pin-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-weight: 700;
}

.avatar-preview img,
.pin-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.code-display {
  font-size: clamp(2.4rem, 8vw, 4rem);
  font-weight: 800;
  letter-spacing: 0.18em;
  margin: 8px 0 4px;
}

.hint,
.location-status,
.note,
.demo-banner {
  color: var(--muted);
  font-size: 0.9rem;
}

.form-error {
  color: #b42318;
  font-weight: 600;
}

#screen-join {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: calc(100dvh - 120px);
  justify-content: center;
}

.join-form {
  width: min(100%, 320px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.join-form .name-field {
  width: 100%;
  text-align: center;
}

.join-form .name-field input {
  text-align: center;
}

.join-form .primary-button {
  min-width: 180px;
  margin: 12px auto 0;
  background: #fff;
  color: #1f7fbe;
  box-shadow: 0 10px 24px rgba(16, 70, 120, 0.14);
}

body.plan-mode {
  background: #fff;
}

#screen-plan {
  background: #fff;
  max-width: 960px;
  text-align: center;
}

.plan-title,
.go-title {
  color: #1a9de0;
  text-shadow:
    0 3px 0 rgba(18, 86, 140, 0.08),
    0 10px 20px rgba(26, 160, 224, 0.16);
}

.chat-card-title {
  font-family: "Bagel Fat One", "Nunito", cursive;
  font-size: 1.7rem;
  line-height: 1;
  margin: 0 0 6px;
  text-align: left;
}

.outing-line {
  margin: 0 0 6px;
  font-weight: 800;
  font-size: 0.95rem;
  color: #1a9de0;
}

.chat-screen .outing-line {
  text-align: center;
  font-size: 1.05rem;
}

#screen-plan .lede {
  margin-left: auto;
  margin-right: auto;
}

.sheet-label {
  display: block;
  font-weight: 800;
  font-size: 0.84rem;
  letter-spacing: 0.01em;
  text-transform: none;
  text-align: left;
  line-height: 1.25;
  margin: 0;
}

.sheet-label.lab-from::before { content: "📍 "; }
.sheet-label.lab-time::before { content: "🕒 "; }
.sheet-label.lab-look::before { content: "🔎 "; }
.sheet-label.lab-place::before { content: "💭 "; }
.sheet-label.lab-quiet::before { content: "🤫 "; }

.sheet-row {
  display: grid;
  grid-template-columns: 7.8rem minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
  text-align: left;
  padding: 11px 0;
  border-bottom: 1px dashed rgba(20, 30, 40, 0.12);
  margin: 0 auto;
  max-width: 36rem;
}

.sheet-row:last-child {
  border-bottom: 0;
}

.sheet-answer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
  color: #161616;
}

.from-line {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.from-line .suggest-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.loc-pin {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #15608c;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.loc-pin svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  display: block;
}

.file-name-input,
.sheet-field input,
.friend-card select,
.plan-shared input[type="text"] {
  font-size: 0.74rem;
  font-weight: 500;
  text-align: left;
  color: #161616;
}

.file-stack {
  position: relative;
  width: min(100%, 840px);
  min-height: 0;
  margin: 8px auto 28px;
  overflow: visible;
  padding: 0 64px 8px;
  z-index: 1;
}

.toolbar {
  display: none;
}

.friends-roster-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 2px 20px;
}

.friends-roster {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 0;
  padding: 0;
}

.roster-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.roster-remove {
  position: absolute;
  top: -2px;
  right: 4px;
  z-index: 3;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #3aa0d6;
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(40, 110, 170, 0.35);
}

.roster-add {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  margin-top: 4px;
  border: 2px dashed #7eb8e0;
  border-radius: 50%;
  background: #fff;
  color: #3aa0d6;
  font-size: 1.8rem;
  font-weight: 500;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: none;
}

.roster-add:disabled {
  opacity: 0.35;
}

.roster-btn {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 84px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px;
}

.roster-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  font-weight: 800;
  overflow: hidden;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.roster-btn.active {
  color: var(--ink);
}

.roster-btn.active .roster-avatar {
  box-shadow: 0 0 0 3px var(--accent);
}

.roster-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.roster-name {
  font-size: 0.75rem;
  font-weight: 800;
  max-width: 76px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-card {
  display: none;
  padding: 18px 22px 22px;
  border-radius: 26px 26px 18px 18px;
  text-align: center;
  box-shadow: 0 16px 34px rgba(20, 70, 110, 0.1);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.file-stack .friend-card {
  display: block;
  width: calc(100% - 56px);
  left: 28px;
}

.file-stack .friend-card:nth-child(1) { z-index: 3; }
.file-stack .friend-card:nth-child(2) { z-index: 2; }
.file-stack .friend-card:nth-child(3) { z-index: 1; }

.file-stack .friend-card.active {
  position: relative;
  left: 0;
  z-index: 8;
  height: auto;
  overflow: visible;
  width: 100%;
  margin: 0 auto;
  transform: translate(0, 0) rotate(0deg);
  box-shadow: 0 20px 40px rgba(16, 60, 100, 0.1);
}

.file-stack .friend-card:not(.active) {
  position: absolute;
  top: 8px;
  bottom: 8px;
  height: auto;
  overflow: hidden;
  cursor: pointer;
}

.file-stack .friend-card:not(.active) > * {
  visibility: hidden;
}

.file-stack .friend-card:nth-child(1):not(.active) { transform: translate(28px, 10px) rotate(-1.2deg); }
.file-stack .friend-card:nth-child(2):not(.active) { transform: translate(52px, 18px) rotate(1.5deg); }
.file-stack .friend-card:nth-child(3):not(.active) { transform: translate(76px, 28px) rotate(-1deg); }

.friend-card.sheet-sky {
  background: #eaf7fd;
  color: #161616;
}

.friend-card.sheet-mid {
  background: #dceffb;
  color: #161616;
}

.friend-card.sheet-deep {
  background: #cce4f6;
  color: #161616;
}

.friend-card.sheet-sky .sheet-label { color: #1f6fa8; }
.friend-card.sheet-sky .lab-from { color: #1a679c; }
.friend-card.sheet-sky .lab-time { color: #155a8a; }
.friend-card.sheet-sky .lab-look { color: #0f4f7c; }
.friend-card.sheet-sky .lab-place { color: #0b446e; }
.friend-card.sheet-sky .lab-quiet { color: #07385c; }

.friend-card.sheet-mid .sheet-label { color: #15608c; }
.friend-card.sheet-mid .lab-from { color: #125a84; }
.friend-card.sheet-mid .lab-time { color: #0f5278; }
.friend-card.sheet-mid .lab-look { color: #0c486c; }
.friend-card.sheet-mid .lab-place { color: #093e5e; }
.friend-card.sheet-mid .lab-quiet { color: #06324c; }

.friend-card.sheet-deep .sheet-label { color: #0b4a78; }
.friend-card.sheet-deep .lab-from { color: #0a446e; }
.friend-card.sheet-deep .lab-time { color: #083c64; }
.friend-card.sheet-deep .lab-look { color: #06345a; }
.friend-card.sheet-deep .lab-place { color: #052c4e; }
.friend-card.sheet-deep .lab-quiet { color: #042440; }

.file-tab {
  display: block;
  text-align: center;
  margin: 0 0 10px;
}

.file-name-input {
  width: 100%;
  text-align: center;
  font-size: 1.12rem;
  font-weight: 800;
  color: #161616;
  border: 0;
  background: transparent;
  padding: 4px 0 8px;
}

.friend-card::before {
  display: none;
}

.friend-card-header {
  display: none;
}

.friend-card .sheet-remove:not(.hidden) {
  display: block;
  width: 100%;
  margin: 10px 0 0;
  text-align: center;
  color: #3aa0d6;
  font-weight: 800;
}

.friend-card-header h3 {
  display: none;
}

.friend-card .location-status:not(.error-text) {
  display: none;
}

.friend-card select,
.friend-card .choices label,
.friend-card #quietness-value,
.friend-card .check {
  font-size: 0.72rem;
  font-weight: 600;
  color: #161616;
  text-transform: none;
  letter-spacing: 0;
}

.friend-card .tab {
  padding: 4px 2px;
  font-size: 0.72rem;
}

.friend-card .tab.selected {
  color: #161616;
}

.friend-card .ghost-button,
.friend-card .text-button {
  color: #161616;
  border-bottom-color: rgba(22, 22, 22, 0.35);
}

.friend-card input,
.friend-card select {
  color: #161616;
  border-bottom-color: rgba(22, 22, 22, 0.22);
}

.friend-card .plan-shared {
  margin-top: 2px;
}

.plan-shared fieldset {
  margin: 0;
}

.friend-card fieldset.sheet-row > legend {
  float: none;
  width: auto;
  padding: 0;
}

.time-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.en-date {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 100%;
  min-width: 0;
}

.en-date select {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.74rem;
  font-weight: 600;
  color: #161616;
  border: 0;
  border-bottom: 1px solid rgba(22, 22, 22, 0.22);
  background: transparent;
  min-height: 32px;
}

.en-date [name="friend-date-month"] {
  flex: 1.4 1 7rem;
}

.en-date [name="friend-date-day"],
.en-date [name="friend-date-year"] {
  flex: 0.7 1 3.6rem;
}

.time-range select {
  flex: 1 1 0;
  min-width: 0;
}

.range-to {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: #161616;
}

.looking-row .choices,
.friend-card .choices {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  justify-content: flex-start;
}

.place-chip {
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  color: #161616 !important;
  padding: 2px 0 !important;
}

.chip-ico {
  font-size: 0.9rem;
  line-height: 1;
}

#meetup-form > .primary-button {
  position: relative;
  z-index: 30;
  min-width: 200px;
  margin: 28px auto 28px;
  display: flex;
}

@media (max-width: 520px) {
  .sheet-row {
    grid-template-columns: 7.4rem minmax(0, 1fr);
  }

  .file-stack {
    padding: 0 24px 8px;
  }
}

.location-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.field-block {
  margin: 28px 0;
}

.field-label,
fieldset legend.field-label {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 28px 0;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tab {
  background: none;
  border: 0;
  padding: 10px 4px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--muted);
  transition: color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.tab.selected {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.choices label {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 0;
}

.choices input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.choices label:has(input:checked) {
  color: var(--ink);
}

.friend-card .peek-hint {
  display: none;
}

.friend-card .tabs {
  margin-bottom: 0;
  gap: 4px 8px;
  flex-wrap: nowrap;
}

.looking-row .choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
}

.desired-box {
  padding: 11px 0;
  border-top: 0;
}

.friend-card.sheet-blue .choices label:has(input:checked),
.friend-card.sheet-deep .choices label:has(input:checked) {
  color: #161616;
}

.friend-card.sheet-blue .desired-box,
.friend-card.sheet-deep .desired-box {
  border-top: 0;
}

.desired-box h3 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  margin-bottom: 12px;
}

.range-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.friend-card .range-row {
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#quietness-value {
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.friend-card.sheet-blue .choices label:has(input:checked),
.friend-card.sheet-deep .choices label:has(input:checked) {
  color: inherit;
}

.friend-card.sheet-blue .desired-box,
.friend-card.sheet-deep .desired-box {
  border-top-color: rgba(255, 255, 255, 0.28);
}

.check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 1rem;
  color: var(--ink);
}

.friend-card .check {
  font-size: 0.72rem;
  color: #161616;
  margin: 0;
}

.suggest-wrap {
  position: relative;
}

.suggest-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  position: absolute;
  left: 0;
  right: 0;
  background: var(--bg);
  z-index: 8;
  border-bottom: 1px solid var(--line);
  max-height: 240px;
  overflow: auto;
}

.suggest-list button {
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 10px 0;
  color: var(--ink);
}

.suggest-list button:hover {
  color: var(--accent);
}

body.map-mode {
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

#screen-map,
.map-screen {
  width: 100%;
  max-width: none;
  padding: 0;
  background: #fff;
  height: calc(100dvh - 88px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.map-stage {
  position: relative;
  flex: 1 1 88%;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}

.map-screen.is-open .map-stage {
  flex: 1 1 50%;
}

#leaflet-map,
.leaflet-container {
  height: 100%;
  width: 100%;
  min-height: 280px;
  background: #e8f2ea;
}

.leaflet-control-zoom {
  margin-top: 52px !important;
}

.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.72) !important;
  font-size: 10px;
}

.map-meet-time {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  font-weight: 800;
  font-size: 0.92rem;
  box-shadow: 0 8px 20px rgba(20, 60, 90, 0.12);
}

.spot-rail {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 700;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.spot-chip {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #3aa0d6;
  background: #fff;
  color: #1f6fa8;
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 8px 18px rgba(20, 70, 110, 0.16);
}

.spot-chip.selected {
  background: #3aa0d6;
  color: #fff;
}

.spot-chip.kept {
  box-shadow: 0 0 0 3px #7ad48a;
}

.place-drawer {
  flex: 0 0 50%;
  max-height: 50%;
  background: #fff;
  border-top: 1px solid rgba(20, 70, 110, 0.08);
  overflow: auto;
  padding: 8px 18px 16px;
  z-index: 8;
}

.place-drawer .venue-sheet h3 {
  font-size: 1.35rem;
  margin: 4px 0;
}

.place-drawer .maps-meta,
.place-drawer .comment {
  font-size: 0.86rem;
}

.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.drawer-actions .primary-button,
.drawer-actions .ghost-button {
  min-width: 0;
  flex: 1 1 160px;
}

.keep-hint {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: #4a6a80;
}

.drawer-actions .primary-button[disabled] {
  opacity: 0.45;
}

.cal-screen,
.chat-screen,
.go-screen {
  width: min(100%, 840px);
  margin: 0 auto;
  padding: 8px 24px 40px;
  text-align: center;
}

.go-cal,
.go-chat-card {
  display: block;
  width: min(100%, 420px);
  margin: 0 auto 16px;
  padding: 16px 12px 18px;
  border: 0;
  border-radius: 26px;
  background: #eaf7fd;
  box-shadow: 0 16px 34px rgba(20, 70, 110, 0.1);
  text-align: left;
  cursor: default;
  overflow: hidden;
}

.go-chat-card {
  cursor: pointer;
  background: #dceffb;
  color: inherit;
}

.go-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.go-row-head .lede.tight,
.go-chat-name {
  margin: 0;
  font-weight: 800;
  color: #161616;
}

.go-chat-peek {
  margin: 8px 0 0;
  font-size: 0.86rem;
  color: #4a6a80;
}

.go-cal .cal-card {
  margin: 8px 0 0;
  max-width: none;
  box-shadow: none;
  padding: 0;
  background: transparent;
}

.go-cal.is-open {
  background: #cce4f6;
}

.back-go {
  margin: 0 auto 8px;
  display: inline-block;
}

.cal-card {
  background: #eaf7fd;
  border-radius: 26px;
  padding: 18px 16px 22px;
  box-shadow: 0 16px 34px rgba(20, 70, 110, 0.1);
  max-width: 420px;
  margin: 12px auto 20px;
}

.cal-week,
.cal-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
}

.cal-week {
  margin-bottom: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #1f6fa8;
}

.cal-week span {
  display: block;
  min-width: 0;
  text-align: center;
  line-height: 1.2;
  font-size: 0.62rem;
  letter-spacing: 0;
}

.cal-day {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: #161616;
  font-weight: 700;
  font-size: clamp(0.68rem, 2.6vw, 0.85rem);
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.cal-day.has-meetup {
  background: #3aa0d6;
  color: #fff;
  box-shadow: none;
}

.cal-empty {
  min-height: 0;
  aspect-ratio: 1;
}

.cal-day .go-dot {
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  transform: translateX(-50%);
}

.cal-detail {
  max-width: 420px;
  margin: 0 auto;
}

.cal-sub {
  font-size: 1.6rem;
}

.cal-places {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  text-align: left;
}

.cal-places li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(20, 30, 40, 0.12);
}

.live-wrap {
  max-width: 640px;
  margin: 0 auto 16px;
  text-align: left;
}

#live-map {
  height: 220px;
  border-radius: 22px;
  overflow: hidden;
  background: #e8f2ea;
}

.chat-thread {
  max-width: 640px;
  margin: 0 auto 12px;
  min-height: 220px;
  max-height: 42vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 4px 16px;
  text-align: left;
}

.bubble {
  align-self: flex-start;
  max-width: 86%;
  background: #eaf7fd;
  border-radius: 18px 18px 18px 6px;
  padding: 10px 14px;
  color: #161616;
}

.bubble.mine {
  align-self: flex-end;
  background: #cce4f6;
  border-radius: 18px 18px 6px 18px;
}

.bubble.plan-bubble {
  background: #fff;
  border: 1px solid rgba(58, 160, 214, 0.35);
  max-width: 100%;
}

.bubble-who {
  font-size: 0.72rem;
  font-weight: 800;
  color: #1f6fa8;
  margin: 0 0 4px;
}

.chat-compose {
  max-width: 640px;
  margin: 0 auto 32px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-compose input {
  flex: 1 1 auto;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid rgba(22, 22, 22, 0.22);
  background: transparent;
}

.chat-compose .primary-button {
  flex: 0 0 auto;
  min-width: 0;
  padding: 10px 18px;
}

.map-float {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 500;
  pointer-events: none;
  padding: 12px 14px;
  border-radius: 18px;
  max-width: calc(100% - 24px);
}

.map-toggle {
  pointer-events: auto;
  margin-top: 8px;
  min-height: 44px;
}

.glass-chip {
  pointer-events: none;
}

.marker-card {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 520;
  width: min(260px, calc(100% - 24px));
  padding: 14px 16px;
  border-radius: 18px;
  pointer-events: auto;
}

.marker-card h3 {
  font-size: 1.15rem;
  margin: 0 0 4px;
}

.marker-card p {
  margin: 0 0 6px;
  font-size: 0.9rem;
}

.chip-kicker,
.demo-note {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--accent-deep);
}

.demo-note {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
}

.map-float-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  margin: 4px 0 0;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--ink);
}

.legend-dot.spot {
  background: #ef7d6a;
}

.map-dock {
  width: 100%;
  margin: -18px 0 0;
  padding: 10px 18px 28px;
  border-radius: 24px 24px 0 0;
  position: relative;
  z-index: 6;
  max-height: 52vh;
  overflow: auto;
}

.sheet-handle {
  width: 48px;
  height: 5px;
  border-radius: 99px;
  background: rgba(39, 64, 86, 0.18);
  margin: 6px auto 12px;
}

.section-title {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 28px 0 12px;
}

.results-grid {
  display: grid;
  gap: 0;
}

.result-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 6px 16px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}

.result-card:hover,
.result-card.selected {
  background: linear-gradient(90deg, var(--accent-soft), transparent 60%);
}

.result-index {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.result-times {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.result-card h3 {
  grid-column: 1 / -1;
  font-size: 1.7rem;
  margin: 0;
}

.result-place,
.result-meta {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

.balance {
  grid-column: 1 / -1;
  margin-top: 10px;
}

.balance-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.bar {
  height: 3px;
  background: var(--line);
  position: relative;
}

.bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: left;
  animation: grow 400ms var(--ease);
}

@keyframes grow {
  from {
    transform: scaleX(0);
  }
}

.delta {
  font-weight: 700;
  font-size: 0.85rem;
}

.result-why {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  margin: 4px 0 0;
}

.view-place {
  grid-column: 1 / -1;
  justify-self: end;
  margin-top: 8px;
}

.result-details {
  grid-column: 1 / -1;
  padding-top: 12px;
}

.place-photo {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
}

.comments ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.maps-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.stars {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  color: #c9d3db;
}

.star {
  display: inline-block;
  position: relative;
  color: #c9d3db;
  line-height: 1;
  font-size: 1.05em;
}

.star::after {
  content: "★";
  position: absolute;
  left: 0;
  top: 0;
  width: var(--fill, 0%);
  overflow: hidden;
  color: #f4b400;
  white-space: nowrap;
}

.rating-number {
  font-weight: 700;
  color: var(--ink);
}

.travel-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.travel-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.travel-list .from {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.8rem;
}

.venue-sheet {
  padding: 8px 0 4px;
}

.share-card {
  margin: 36px 0 16px;
  padding: 28px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.share-card .mark {
  margin-bottom: 12px;
}

.share-card p {
  margin-bottom: 8px;
}

.midpoint-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 80;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
}

.midpoint-overlay .converge.big {
  width: min(420px, 86vw);
}

.converge-line.draw {
  stroke-dasharray: 280;
  stroke-dashoffset: 280;
  animation: draw-line 700ms var(--ease) forwards;
}

@keyframes draw-line {
  to {
    stroke-dashoffset: 0;
  }
}

.converge-a.move {
  animation: meet-a 900ms var(--ease) forwards;
}

.converge-b.move {
  animation: meet-b 900ms var(--ease) forwards;
}

@keyframes meet-a {
  to {
    transform: translateX(92px);
  }
}

@keyframes meet-b {
  to {
    transform: translateX(-92px);
  }
}

.converge-mid.pulse {
  animation: pulse 900ms var(--ease) 400ms both;
}

@keyframes pulse {
  0% {
    r: 3;
    opacity: 0;
  }
  100% {
    r: 7;
    opacity: 1;
  }
}

.mid-label {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-top: 8px;
}

.leaflet-marker-icon.leaflet-div-icon,
.hh-pin {
  background: transparent;
  border: 0;
}

.map-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--font);
}

.pin-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.12);
}

.map-pin.spot .spot-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #3aa0d6;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 4px 0 #2b7fad;
}

.map-pin.spot.selected .spot-num {
  transform: scale(1.12);
  background: #1f6fa8;
}

.map-pin.spot.kept .spot-num {
  box-shadow: 0 0 0 3px #7ad48a;
}

.pin-name,
.pin-time {
  background: rgba(255, 255, 255, 0.92);
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
  border-radius: 999px;
}

.place-drawer .place-photo {
  width: 100%;
  max-height: 96px;
  object-fit: cover;
  border-radius: 12px;
  margin: 8px 0;
}

.pin-avatar {
  width: 36px;
  height: 36px;
  font-size: 0.7rem;
  box-shadow: 0 0 0 2px #fff;
}

.reset-demo {
  display: block;
  margin-top: 8px;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (min-width: 960px) {
  .map-screen {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 92px);
    overflow: hidden;
  }

  .map-stage {
    height: auto;
    min-height: 0;
  }

  .map-dock {
    display: none;
  }

  .map-toggle {
    display: none;
  }

  .story-title {
    font-size: 5.4rem;
  }

  .shoe {
    width: 18px;
    height: 30px;
  }

  .screen:not(#screen-welcome):not(#screen-map) {
    width: min(100% - 48px, 720px);
  }

  .go-screen,
  .chat-screen {
    width: min(100% - 48px, 720px);
  }
}

@media (max-width: 700px) {
  #screen-welcome {
    padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
    justify-content: center;
  }

  .story-copy {
    width: 100%;
  }

  .story-copy .primary-button {
    width: min(100%, 260px);
  }

  .shoe {
    width: 14px;
    height: 24px;
  }

  .map-stage {
    min-height: 0;
  }

  .map-stage.is-tall {
    min-height: 0;
  }

  .result-card h3 {
    font-size: 1.35rem;
  }

  .leaflet-control-zoom a {
    width: 44px !important;
    height: 44px !important;
    line-height: 44px !important;
  }

  .site-header {
    padding: 12px 72px 4px 16px;
  }

  .header-reset {
    right: max(8px, env(safe-area-inset-right));
    top: 10px;
    font-size: 0.62rem;
  }

  .app-nav {
    width: calc(100% - 16px);
    max-width: none;
    margin-left: auto;
    margin-right: auto;
    gap: 0;
  }

  .nav-link {
    flex: 1 1 0;
    padding: 8px 4px;
    font-size: 0.7rem;
    min-height: 40px;
  }

  .screen {
    width: min(100% - 20px, var(--max));
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }

  .file-stack {
    width: 100%;
    padding: 0 4px 8px;
  }

  .friends-roster-wrap {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    padding-bottom: 12px;
  }

  .friends-roster {
    justify-content: flex-start;
    gap: 12px;
  }

  .sheet-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .friend-card input,
  .friend-card select,
  .join-form input,
  .profile-form input,
  .chat-compose input,
  .en-date select {
    font-size: 16px;
  }

  .map-meet-time {
    font-size: 0.78rem;
    max-width: calc(100% - 96px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .spot-rail {
    left: 8px;
  }

  .spot-chip {
    width: 40px;
    height: 40px;
  }

  .place-drawer {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .chat-compose {
    flex-wrap: wrap;
    margin-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .go-screen,
  .chat-screen {
    padding-left: 12px;
    padding-right: 12px;
  }

  .go-cal,
  .go-chat-card {
    width: 100%;
    padding: 14px 8px 16px;
  }

  .cal-week,
  .cal-days {
    gap: 3px;
  }

  #live-map {
    height: 180px;
  }
}

body.map-mode #screen-map {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}

input,
select,
textarea,
button {
  max-width: 100%;
}
