:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #66716a;
  --paper: #f6f1e8;
  --panel: rgba(255, 252, 246, 0.92);
  --line: rgba(23, 33, 27, 0.14);
  --green: #1f7a4d;
  --coral: #e15d3f;
  --gold: #dca63a;
  --water: #80bdd2;
  --shadow: 0 24px 70px rgba(34, 39, 31, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 10%, rgba(220, 166, 58, 0.28), transparent 26%),
    radial-gradient(circle at 92% 4%, rgba(128, 189, 210, 0.38), transparent 30%),
    linear-gradient(135deg, #f7efe0 0%, #eef4ea 52%, #f6f1e8 100%);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 18px;
  min-height: 100vh;
  padding: 18px;
}

.hero-map,
.decision-panel,
.place-strip {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-map {
  position: relative;
  overflow: hidden;
  min-height: 620px;
  border-radius: 28px;
}

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 28px;
}

.eyebrow,
.kicker,
label {
  margin: 0 0 8px;
  color: #486055;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 520px;
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 6vw, 6.8rem);
  line-height: 0.88;
  letter-spacing: 0;
}

.icon-button {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffaf1;
  color: var(--ink);
  font-size: 1.4rem;
}

.map-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.map-texture {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(18deg, transparent 0 48%, rgba(23, 33, 27, 0.05) 49% 51%, transparent 52%),
    linear-gradient(95deg, transparent 0 48%, rgba(23, 33, 27, 0.04) 49% 51%, transparent 52%);
  background-size: 92px 92px, 116px 116px;
  opacity: 0.72;
}

.route-svg {
  position: absolute;
  inset: 8% -4% 0 -2%;
  width: 108%;
  height: 92%;
}

.canal,
.street,
.active-route {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.canal {
  stroke: rgba(74, 151, 179, 0.38);
  stroke-width: 34;
}

.canal-wide {
  stroke-width: 54;
}

.street {
  stroke: rgba(94, 107, 94, 0.25);
  stroke-width: 10;
}

.street-soft {
  stroke-width: 7;
}

.active-route {
  stroke: var(--coral);
  stroke-dasharray: 12 14;
  stroke-width: 9;
  filter: drop-shadow(0 8px 18px rgba(225, 93, 63, 0.26));
}

.you-pin,
.place-pin {
  position: absolute;
  z-index: 4;
  border: 0;
  transform: translate(-50%, -50%);
}

.you-pin {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 12px 26px rgba(25, 62, 43, 0.24);
}

.you-pin span {
  width: 16px;
  height: 16px;
  border: 4px solid white;
  border-radius: 999px;
  background: var(--green);
}

.place-pin {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 185px;
  padding: 8px 12px 8px 9px;
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.92);
  color: var(--ink);
  box-shadow: 0 14px 30px rgba(35, 48, 38, 0.16);
}

.place-pin::before {
  content: "";
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--gold);
}

.place-pin span {
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-pin.active {
  background: var(--ink);
  color: #fffaf1;
  transform: translate(-50%, -50%) scale(1.06);
}

.place-pin.active::before {
  background: var(--coral);
}

.map-controls {
  position: absolute;
  right: 22px;
  bottom: 22px;
  z-index: 6;
  display: flex;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.9);
}

.map-city {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 10px 14px;
  font-weight: 800;
}

.map-city.active {
  background: var(--ink);
  color: #fffaf1;
}

.decision-panel {
  border-radius: 28px;
  padding: 16px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.filters > div {
  min-width: 0;
}

select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffaf1;
  color: var(--ink);
  padding: 0 10px;
  font-weight: 800;
}

.recommendation {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.photo-button {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1.68 / 1;
  border: 0;
  border-radius: 22px;
  background: var(--ink);
  padding: 0;
}

.photo-button img,
.drawer img,
.place-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.52));
}

.photo-chip {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 2;
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.88);
  color: var(--ink);
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 900;
}

.rec-copy h2 {
  margin-bottom: 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.72rem;
  line-height: 1;
}

.rec-copy p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.45;
}

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

.stat {
  min-width: 0;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffaf1;
  color: var(--ink);
  padding: 11px;
  text-align: left;
}

.stat strong,
.stat span {
  display: block;
}

.stat strong {
  overflow-wrap: anywhere;
  font-size: 1rem;
}

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

.warning {
  border-left: 4px solid var(--coral);
  border-radius: 0 14px 14px 0;
  background: rgba(225, 93, 63, 0.11);
  padding: 11px 14px;
  color: #653126;
  font-weight: 750;
}

.score-card {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 16px;
  align-items: center;
  border-radius: 20px;
  background: var(--ink);
  color: #fffaf1;
  padding: 12px 14px;
}

.score-card p {
  margin-bottom: 4px;
  color: rgba(255, 250, 241, 0.68);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.score-card strong {
  font-size: 2rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 44px 1fr 34px;
  gap: 8px;
  align-items: center;
  color: rgba(255, 250, 241, 0.75);
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

.bar-row + .bar-row {
  margin-top: 8px;
}

.bar-row i {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.bar-row b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
}

.actions {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 9px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  border-radius: 16px;
  padding: 0 16px;
  font-weight: 900;
  text-decoration: none;
}

.primary-action {
  border: 0;
  background: var(--green);
  color: white;
}

.secondary-action {
  border: 1px solid var(--line);
  background: #fffaf1;
  color: var(--ink);
}

.place-strip {
  margin: 0 18px 18px;
  border-radius: 28px;
  padding: 22px;
}

.strip-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.strip-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.4rem, 3vw, 2.5rem);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.place-card {
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fffaf1;
  padding: 0;
  color: var(--ink);
  text-align: left;
}

.place-card img {
  display: block;
  aspect-ratio: 1.65 / 1;
}

.card-copy {
  display: block;
  padding: 13px;
}

.card-copy strong,
.card-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-copy strong {
  font-size: 0.98rem;
}

.card-copy span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.place-card.active {
  outline: 3px solid rgba(225, 93, 63, 0.55);
}

.drawer[hidden] {
  display: none !important;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: end center;
  background: rgba(23, 33, 27, 0.38);
  padding: 18px;
}

.drawer-panel {
  position: relative;
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 20px;
  width: min(820px, 100%);
  border-radius: 28px;
  background: #fffaf1;
  padding: 16px;
  box-shadow: var(--shadow);
}

.drawer-panel img {
  aspect-ratio: 1.15 / 1;
  border-radius: 20px;
}

.drawer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 1.6rem;
}

.drawer-panel h2 {
  margin-bottom: 10px;
  padding-right: 42px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
}

.drawer-panel p {
  color: var(--muted);
  line-height: 1.55;
}

.drawer-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.drawer-facts span {
  border-radius: 999px;
  background: #eef2e8;
  padding: 8px 11px;
  font-size: 0.78rem;
  font-weight: 850;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .hero-map {
    min-height: 560px;
  }

  .decision-panel {
    max-width: none;
  }
}

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

  .hero-map,
  .decision-panel,
  .place-strip {
    border-radius: 22px;
  }

  .hero-map {
    min-height: 430px;
  }

  .topbar {
    padding: 20px;
  }

  h1 {
    max-width: 300px;
    font-size: 3rem;
  }

  .map-controls {
    right: 12px;
    bottom: 12px;
    left: 12px;
    justify-content: center;
    border-radius: 18px;
  }

  .map-city {
    flex: 1;
    padding: 10px 8px;
  }

  .place-pin {
    max-width: 44px;
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
  }

  .place-pin span {
    position: absolute;
    overflow: visible;
    width: max-content;
    max-width: 150px;
    transform: translateY(31px);
    border-radius: 999px;
    background: rgba(255, 252, 246, 0.9);
    color: var(--ink);
    padding: 5px 8px;
    font-size: 0.68rem;
    white-space: nowrap;
  }

  .filters,
  .stats-grid,
  .actions,
  .score-card,
  .drawer-panel {
    grid-template-columns: 1fr;
  }

  .photo-button {
    aspect-ratio: 1.28 / 1;
  }

  .actions {
    grid-template-columns: 1fr 1fr;
  }

  .primary-action {
    grid-column: 1 / -1;
  }

  .cards {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
  }

  .place-card {
    flex: 0 0 78%;
    scroll-snap-align: start;
  }

  .place-strip {
    margin: 0 10px 10px;
    padding: 16px;
  }

  .strip-heading {
    display: block;
  }
}
