:root {
  --ink: #111111;
  --muted: #60646c;
  --line: #d9dde3;
  --paper: #ffffff;
  --wash: #f4f8fb;
  --mint: #d8ffe8;
  --mint-strong: #1f9d62;
  --coral: #ff5a5f;
  --sun: #ffd166;
  --aqua: #4cc9f0;
  --night: #181818;
  --shadow: 0 16px 40px rgba(17, 17, 17, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--wash);
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.intro {
  display: block;
  padding: 26px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.intro-copy {
  display: flex;
  min-height: 250px;
  flex-direction: column;
  justify-content: center;
  max-width: 850px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--mint-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(3.1rem, 13vw, 8.5rem);
  line-height: 0.86;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.35rem, 5vw, 2.15rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.lede {
  max-width: 680px;
  margin: 20px 0 0;
  color: #2c2f34;
  font-size: clamp(1rem, 2.8vw, 1.35rem);
  line-height: 1.45;
}

.planner {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(0, 1fr);
  gap: 22px;
  padding: 22px;
  align-items: start;
}

.question-panel {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
}

.result-panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.question-panel {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 22px;
  padding: 20px;
}

.panel-header {
  display: flex;
  gap: 14px;
  align-items: start;
  justify-content: space-between;
}

.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;
}

.step-meter {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.step-chip {
  display: grid;
  gap: 4px;
  justify-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 6px;
  color: var(--muted);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.step-chip-number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.86rem;
  border: 0;
}

.step-chip small {
  font-size: 0.74rem;
  font-weight: 900;
}

.step-chip.is-active,
.step-chip.is-complete {
  border-color: var(--ink);
}

.step-chip.is-active {
  transform: translateY(-1px);
}

.step-chip.is-active .step-chip-number,
.step-chip.is-complete .step-chip-number {
  color: var(--ink);
}

.step-chip.is-complete .step-chip-number {
  font-size: 1rem;
}

.form-step {
  display: grid;
  gap: 16px;
  align-content: start;
  min-height: 430px;
}

.step-count {
  margin: 0;
  color: var(--mint-strong);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.step-copy {
  margin: -6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.field input,
.field select {
  min-height: 48px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #ffffff;
}

.field input:focus,
.field select:focus,
.segmented label:has(input:focus-visible),
.chips label:has(input:focus-visible),
.toggle-row:has(input:focus-visible) {
  outline: 3px solid rgba(76, 201, 240, 0.45);
  outline-offset: 2px;
}

.choice-set {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-set legend {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.helper-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.start-location-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.start-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.start-tools .secondary-action {
  min-height: 48px;
  white-space: nowrap;
}

.start-suggestions {
  display: grid;
  gap: 8px;
}

.start-suggestion {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 8px 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.start-suggestion strong {
  font-size: 0.94rem;
}

.start-suggestion span {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.start-suggestion.is-selected {
  background: transparent;
}

.start-status {
  margin: 0;
  padding: 0;
  color: #173323;
  font-size: 0.88rem;
  font-weight: 800;
}

.start-status.is-caution {
  color: #3a1919;
}

.segmented,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented label,
.chips label,
.toggle-row {
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  user-select: none;
}

.segmented label,
.chips label {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  padding: 0 12px;
  color: #343840;
  font-size: 0.92rem;
  font-weight: 800;
}

.segmented input,
.chips input {
  position: absolute;
  opacity: 0;
}

.segmented label:has(input:checked),
.chips label:has(input:checked) {
  border-color: var(--ink);
  color: var(--ink);
  background: rgba(255, 209, 102, 0.2);
}

.toggle-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  color: #343840;
  font-size: 0.92rem;
  font-weight: 700;
}

.toggle-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--mint-strong);
}

.ghost-action,
.primary-action,
.secondary-action {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
}

.primary-action {
  color: #ffffff;
  background: var(--ink);
}

.primary-action:hover,
.primary-action:focus-visible {
  background: #2a2a2a;
}

.ghost-action {
  padding: 0 16px;
  color: var(--ink);
  background: transparent;
  border: 0;
}

.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  color: var(--ink);
  text-decoration: none;
  background: transparent;
  border: 1px solid var(--line);
}

.progress-action {
  color: var(--ink);
  background: var(--sun);
  border-color: var(--ink);
}

.progress-action:hover,
.progress-action:focus-visible {
  background: #ffde7f;
}

.ghost-action:disabled,
.primary-action:disabled,
.secondary-action:disabled {
  opacity: 0.45;
  cursor: default;
}

button.secondary-action {
  appearance: none;
}

button.ghost-action {
  appearance: none;
}

.result-panel {
  min-height: 0;
  overflow: hidden;
}

.empty-state {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
}

.empty-state .emoji-panel {
  display: inline-block;
  margin-right: 14px;
  font-size: 1.18em;
  line-height: 1;
  white-space: nowrap;
  vertical-align: -0.08em;
}

.loading-state {
  display: grid;
  gap: 12px;
  min-height: 220px;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.loading-state h2 {
  margin: 0;
}

.loading-pun {
  max-width: 30rem;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.loading-spinner {
  position: relative;
  width: 90px;
  height: 54px;
}

.loading-spinner span {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.loading-spinner span:first-child {
  transform: translate(-150%, -50%);
  animation: beer-spin-left 1.2s linear infinite;
}

.loading-spinner span:last-child {
  transform: translate(50%, -50%);
  animation: beer-spin-right 1.2s linear infinite;
}

@keyframes beer-spin-left {
  0% {
    transform: translate(-150%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-150%, -50%) rotate(360deg);
  }
}

@keyframes beer-spin-right {
  0% {
    transform: translate(50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(50%, -50%) rotate(-360deg);
  }
}

.results {
  display: grid;
  gap: 18px;
  padding: 0;
}

.route-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
  gap: 18px;
  align-items: stretch;
  padding: 18px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--night);
}

.route-hero p {
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
}

.route-hero .eyebrow {
  color: var(--sun);
}

.route-emoji {
  display: grid;
  min-height: 220px;
  place-items: center;
  font-size: clamp(3.5rem, 10vw, 6.5rem);
  line-height: 1;
}

.route-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.stat {
  min-height: 84px;
  padding: 12px;
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
}

.stat b {
  display: block;
  font-size: 1.25rem;
}

.stat span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 900;
}

.venue-list {
  display: grid;
  gap: 12px;
}

.venue-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.time-badge {
  display: flex;
  min-height: 54px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  color: var(--ink);
  font-weight: 950;
  text-align: center;
}

.time-badge span {
  display: block;
  font-size: 0.82rem;
  line-height: 1;
  font-weight: 950;
}

.time-badge .venue-emoji {
  margin-bottom: 7px;
  font-size: 1.7rem;
  line-height: 1;
}

.venue-main {
  min-width: 0;
}

.venue-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: start;
  justify-content: space-between;
}

.venue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.text-action {
  border: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.text-action-danger {
  color: var(--coral);
}

.venue-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.challenge-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: transparent;
}

.challenge-card > span {
  font-size: 1.4rem;
  line-height: 1;
}

.challenge-card strong {
  display: block;
  font-size: 0.9rem;
}

.challenge-card p {
  margin-top: 4px;
  color: #343840;
  font-size: 0.9rem;
}

.venue-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.meta {
  border-radius: 999px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  color: #343840;
  font-size: 0.78rem;
  font-weight: 800;
}

.warning {
  margin-top: 10px;
  border-left: 4px solid var(--coral);
  padding: 8px 10px;
  color: #3a1919;
  background: #fff0f0;
  font-size: 0.88rem;
  line-height: 1.4;
}

.leg {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin: -2px 0;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.leg-line {
  width: 2px;
  height: 28px;
  justify-self: center;
  background: var(--line);
}

.share-box,
.source-strip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.share-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
}

.excluded-box {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff0f0;
  color: #3a1919;
  font-size: 0.9rem;
  font-weight: 800;
}

.share-box p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.extra-stack {
  display: grid;
  gap: 12px;
}

.advanced-panel {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.advanced-panel[open] {
  display: grid;
  gap: 12px;
}

.advanced-panel summary {
  cursor: pointer;
  font-weight: 900;
}

.advanced-panel summary::-webkit-details-marker {
  display: none;
}

.advanced-panel summary::after {
  content: "+";
  float: right;
}

.advanced-panel[open] summary::after {
  content: "-";
}

.step-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.step-actions > .ghost-action {
  justify-self: start;
}

.step-actions-right {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  width: max-content;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.share-url {
  grid-column: 1 / -1;
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  background: #fbfcfe;
}

.source-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin: 0 22px 28px;
  padding: 16px;
}

.source-strip p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.source-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.source-dialog::backdrop {
  background: rgba(17, 17, 17, 0.42);
}

.source-dialog-panel {
  display: grid;
  gap: 16px;
  max-height: inherit;
  padding: 18px;
}

.source-dialog-header {
  display: flex;
  gap: 14px;
  align-items: start;
  justify-content: space-between;
}

.source-dialog-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-links-popup {
  align-content: start;
  max-height: min(430px, 54vh);
  overflow: auto;
  padding-right: 4px;
}

.source-links-popup a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fbfcfe;
  text-decoration-thickness: 1px;
}

.source-links a,
.venue-link {
  color: var(--ink);
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.venue-link {
  font-size: 0.86rem;
}

@media (max-width: 980px) {
  .intro,
  .planner,
  .empty-state,
  .route-hero {
    grid-template-columns: 1fr;
  }

  .question-panel {
    position: static;
  }
  .route-emoji {
    max-height: 300px;
  }
}

@media (max-width: 680px) {
  .intro,
  .planner {
    padding: 14px;
  }

  .intro {
    gap: 14px;
  }

  .intro-copy {
    min-height: 210px;
  }

  .question-grid,
  .start-location-row,
  .route-stats,
  .share-box {
    grid-template-columns: 1fr;
  }

  .step-meter {
    grid-template-columns: repeat(5, minmax(54px, 1fr));
    overflow-x: auto;
  }

  .step-chip {
    min-width: 54px;
  }

  .step-chip small {
    display: none;
  }

  .start-tools {
    justify-content: stretch;
  }

  .start-tools .secondary-action {
    flex: 1 1 150px;
  }

  .share-actions {
    justify-content: stretch;
  }

  .share-actions .secondary-action {
    flex: 1 1 130px;
  }

  .question-panel {
    padding: 14px;
  }

  .form-step {
    min-height: 360px;
  }

  .step-actions {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .step-actions-right {
    justify-content: flex-end;
  }

  .result-panel,
  .empty-state {
    min-height: 0;
  }

  .venue-card {
    grid-template-columns: 48px minmax(0, 1fr);
    padding: 10px;
  }

  .time-badge {
    min-height: 48px;
  }

  .leg {
    grid-template-columns: 48px minmax(0, 1fr);
    padding: 0 10px;
  }

  .source-strip {
    margin: 0 14px 18px;
  }
}
