:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --panel: #ffffff;
  --panel-soft: #f8f9fb;
  --line: #dde2e8;
  --line-strong: #c8ced7;
  --text: #1e2229;
  --muted: #68717d;
  --soft: #9299a3;
  --accent: #6949cf;
  --accent-dark: #5135ad;
  --accent-soft: #f0ecff;
  --teal: #147c6c;
  --amber: #9a6400;
  --amber-soft: #fff6dc;
  --danger: #b83c3c;
  --danger-soft: #fff0f0;
  --shadow-sm: 0 5px 16px rgba(29, 34, 43, 0.08);
  --shadow-lg: 0 18px 46px rgba(29, 34, 43, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(105, 73, 207, 0.22);
  outline-offset: 2px;
}

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

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

.app-shell {
  height: 100vh;
  min-height: 720px;
  display: flex;
  flex-direction: column;
  padding: 0 18px 18px;
}

.topbar {
  width: min(1560px, 100%);
  min-height: 66px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--accent);
  color: white;
  font-size: 14px;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  line-height: 1.1;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.topbar-context {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

#cityFilter {
  width: 150px;
  min-width: 0;
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--text);
  font: inherit;
}

#featuredRoutes[hidden] {
  display: none;
}

.language-switch {
  justify-self: end;
  display: flex;
  gap: 5px;
}

.lang {
  min-width: 38px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.lang.active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.data-status {
  width: min(1560px, 100%);
  margin: 0 auto 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.data-status.loading {
  border-color: #b6a7e8;
  color: var(--accent-dark);
}

.data-status.warning {
  border-color: #e4c36f;
  background: var(--amber-soft);
  color: #765000;
}

.workspace {
  width: min(1560px, 100%);
  min-height: 0;
  flex: 1;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px minmax(520px, 1fr) minmax(360px, 400px);
  gap: 10px;
}

.planner-panel,
.map-stage,
.spot-drawer {
  min-height: 0;
  border: 1px solid var(--line);
  background: var(--panel);
}

.planner-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 16px;
  border-radius: 8px;
  overflow-y: auto;
}

.planner-heading h1 {
  margin-bottom: 6px;
  font-size: 21px;
  line-height: 1.22;
  letter-spacing: 0;
}

.planner-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.search-field {
  position: relative;
}

.search-field > span {
  position: absolute;
  z-index: 1;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--soft);
}

input,
select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--text);
  outline: none;
}

input {
  padding: 0 12px;
}

select {
  padding: 0 10px;
}

.sidebar-search input {
  padding-left: 32px;
  font-size: 12px;
}

.filter-section {
  min-width: 0;
}

.control-block label,
.filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: #4e5662;
  font-size: 12px;
  font-weight: 900;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.member-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.member-chip {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: #545d69;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.member-chip.active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.featured-routes {
  display: grid;
  gap: 5px;
}

.theme-link {
  width: 100%;
  min-height: 37px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #4b535e;
  text-align: left;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.theme-link:hover,
.theme-link.active {
  border-color: #ded6f7;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.theme-mark {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: #e8eaf0;
  color: #59616d;
  font-size: 10px;
  font-weight: 900;
}

.theme-link.active .theme-mark {
  background: var(--accent);
  color: white;
}

.route-box {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

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

.section-title h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.route-box .section-title {
  justify-content: flex-start;
}

.route-count-badge {
  color: var(--muted);
  font-size: 11px;
}

.route-count-badge strong {
  color: var(--accent);
}

.ghost-button {
  margin-left: auto;
  padding: 5px 7px;
  border: 0;
  background: transparent;
  color: var(--soft);
  cursor: pointer;
  font-size: 11px;
}

.route-list {
  min-height: 54px;
  max-height: 160px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  overflow-y: auto;
}

.route-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border-bottom: 1px solid #edf0f3;
}

.route-list li > span {
  width: 20px;
  height: 20px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 900;
}

.route-list button {
  min-width: 0;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-size: 11px;
}

.empty-route {
  color: var(--soft);
  font-size: 11px;
  line-height: 1.5;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  text-decoration: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.primary-button {
  width: 100%;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
}

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

.primary-button.disabled {
  pointer-events: none;
  opacity: 0.42;
}

.secondary-button {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: white;
  color: #414954;
}

.map-stage {
  position: relative;
  z-index: 0;
  isolation: isolate;
  border-radius: 8px;
  overflow: hidden;
}

.map-toolbar {
  position: absolute;
  z-index: 900;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.map-result-count,
.tool-button {
  min-height: 38px;
  border: 1px solid rgba(202, 208, 216, 0.9);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  pointer-events: auto;
}

.map-result-count {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 8px 11px;
  color: var(--muted);
  font-size: 11px;
}

.map-result-count strong {
  color: var(--text);
  font-size: 15px;
}

.tool-button {
  padding: 0 12px;
  color: #4d5662;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.map-canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #dbe4e8;
}

.leaflet-tile-pane {
  filter: saturate(0.72) contrast(1.02) brightness(1.035);
}

.leaflet-control-attribution {
  font-size: 9px;
}

.leaflet-control-zoom {
  border: 0 !important;
  box-shadow: var(--shadow-sm) !important;
}

.leaflet-control-zoom a {
  color: #343a43 !important;
}

.map-marker-wrap {
  background: transparent;
  border: 0;
  overflow: visible !important;
}

.pin {
  position: relative;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 3px solid white;
  border-radius: 50% 50% 50% 5px;
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 10px rgba(31, 25, 54, 0.28);
  transform: rotate(-45deg);
  cursor: pointer;
}

.pin span {
  transform: rotate(45deg);
  font-size: 10px;
  font-weight: 900;
}

.pin.selected {
  width: 40px;
  height: 40px;
  border-width: 4px;
  background: var(--accent-dark);
  box-shadow: 0 8px 20px rgba(55, 38, 113, 0.34);
}

.pin.in-route {
  background: var(--teal);
}

.pin.approximate {
  border-style: dashed;
}

.pin-label {
  position: absolute;
  left: 48px;
  top: 4px;
  max-width: 164px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  box-shadow: var(--shadow-sm);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.spot-drawer {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
}

.panel-view {
  min-height: 0;
  height: 100%;
}

.panel-view[hidden],
.no-photo[hidden] {
  display: none;
}

.list-view {
  display: flex;
  flex-direction: column;
  padding: 16px 12px 12px;
}

.panel-kicker {
  margin-bottom: 3px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.count-badge {
  min-width: 30px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #edf0f4;
  color: #525b67;
  font-size: 11px;
  font-weight: 900;
}

.spot-list {
  min-height: 0;
  display: grid;
  gap: 8px;
  overflow-y: auto;
  padding-right: 3px;
}

.spot-card {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  min-height: 154px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.spot-card:hover {
  border-color: #b7a9e5;
  box-shadow: 0 5px 14px rgba(45, 37, 77, 0.09);
  transform: translateY(-1px);
}

.spot-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(105, 73, 207, 0.09);
}

.spot-card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.thumb,
.detail-visual {
  position: relative;
  overflow: hidden;
  color: white;
}

.thumb {
  min-height: 132px;
  border-radius: 6px;
}

.thumb::after,
.detail-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 45%),
    linear-gradient(0deg, rgba(18, 23, 31, 0.7), transparent 55%);
}

.thumb img,
.detail-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb.has-photo::after,
.detail-visual.has-photo::after {
  background:
    linear-gradient(180deg, rgba(10, 14, 20, 0.08), transparent 42%),
    linear-gradient(0deg, rgba(12, 16, 22, 0.72), transparent 58%);
}

.visual-category,
.visual-area {
  position: absolute;
  z-index: 1;
}

.visual-category {
  top: 10px;
  left: 10px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.visual-area {
  left: 10px;
  right: 10px;
  bottom: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
}

.tone-food { background: linear-gradient(145deg, #934f35, #d2904e 64%, #f2c66d); }
.tone-city { background: linear-gradient(145deg, #38536d, #658ca5 62%, #bfd4df); }
.tone-street { background: linear-gradient(145deg, #5f6865, #8a9a91 62%, #d1d9cb); }
.tone-park { background: linear-gradient(145deg, #38705c, #67a184 62%, #c8dba6); }
.tone-night { background: linear-gradient(145deg, #37314e, #665782 62%, #d1a45f); }
.tone-museum { background: linear-gradient(145deg, #5c5b61, #969196 62%, #e0d8cc); }
.tone-tower { background: linear-gradient(145deg, #36516a, #b96655 62%, #f1c184); }

.spot-meta,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.spot-meta {
  margin-bottom: 7px;
}

.spot-meta span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.spot-meta span + span::before {
  content: "·";
  margin-right: 5px;
  color: var(--soft);
}

.spot-card h3 {
  margin-bottom: 6px;
  font-size: 15px;
  line-height: 1.3;
}

.spot-card p {
  display: -webkit-box;
  margin-bottom: 8px;
  color: var(--muted);
  overflow: hidden;
  font-size: 12px;
  line-height: 1.52;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-footer {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.compact-tags {
  min-width: 0;
}

.tag-row span {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #626b77;
  font-size: 9px;
  font-weight: 800;
}

.tag-row .confidence {
  border-color: #e4c879;
  background: var(--amber-soft);
  color: #785000;
}

.card-action {
  flex: 0 0 auto;
  padding: 5px 2px;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.card-action.added {
  color: var(--teal);
}

.empty-card {
  min-height: 180px;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--muted);
  text-align: center;
}

.empty-card strong {
  color: var(--text);
}

.empty-card p {
  margin: 0;
  font-size: 12px;
}

.detail-panel {
  overflow-y: auto;
  background: white;
}

.detail-topbar {
  position: sticky;
  z-index: 3;
  top: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.back-button {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: #4e5763;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.detail-visual {
  height: 218px;
}

.detail-visual-area {
  position: absolute;
  z-index: 1;
  left: 18px;
  bottom: 16px;
  font-size: 20px;
  font-weight: 900;
}

.detail-content {
  padding: 18px;
}

.detail-content h2 {
  margin-bottom: 10px;
  font-size: 25px;
  line-height: 1.2;
}

.member-tags {
  margin-bottom: 22px;
}

.detail-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.detail-section h3 {
  margin-bottom: 9px;
  color: #3f4650;
  font-size: 13px;
}

.detail-section p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.why-section {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.why-section p {
  color: #3a414b;
  font-size: 15px;
  line-height: 1.72;
}

.address {
  color: #343b45 !important;
  font-weight: 800;
}

.media-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}

.instagram-section {
  position: relative;
  margin: 18px -4px 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.instagram-section .instagram-media {
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 auto !important;
  border: 1px solid var(--line) !important;
  border-radius: 7px !important;
  box-shadow: none !important;
}

.instagram-section iframe {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
}

.more-media-link {
  display: inline-block;
  margin: 9px 4px 0;
  color: var(--accent);
  text-decoration: none;
  font-size: 11px;
  font-weight: 900;
}

.spot-cluster-wrap {
  border: 0;
  background: transparent;
}

.spot-cluster {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  gap: 0;
  border: 3px solid rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 5px 18px rgba(57, 38, 120, 0.3);
  color: white;
  cursor: pointer;
  line-height: 1;
}

.spot-cluster strong {
  font-size: 14px;
}

.spot-cluster span {
  margin-top: 2px;
  font-size: 7px;
  font-weight: 900;
  text-transform: uppercase;
}

.marker-cluster-spider-leg {
  stroke: rgba(105, 73, 207, 0.65);
  stroke-width: 2;
}

.source-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #424a55;
  font-size: 13px;
  font-weight: 900;
}

.source-check {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e9f5f2;
  color: var(--teal);
}

.location-warning {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid #e9b2b2;
  border-radius: 6px;
  background: var(--danger-soft);
  color: var(--danger) !important;
  font-size: 12px !important;
  font-weight: 800;
}

.source-count {
  margin: 8px 0 0 !important;
  color: var(--soft) !important;
  font-size: 11px !important;
}

.detail-actions {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.drawer-handle,
.mobile-nav {
  display: none;
}

@media (max-width: 1260px) {
  .workspace {
    grid-template-columns: 220px minmax(450px, 1fr) 360px;
  }

  .planner-heading p {
    display: none;
  }

  .member-chip {
    padding-inline: 7px;
  }
}

@media (max-width: 980px) {
  body {
    overflow: hidden;
  }

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

  .topbar {
    position: fixed;
    z-index: 1100;
    top: 0;
    left: 0;
    right: 0;
    min-height: 54px;
    grid-template-columns: minmax(0, 1fr) minmax(88px, 120px) auto;
    gap: 6px;
    padding: 7px 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .brand small,
  .topbar .brand-mark {
    display: none;
  }

  .topbar .brand strong {
    font-size: 12px;
  }

  #cityFilter {
    width: 100%;
    font-size: 12px;
  }

  .language-switch {
    gap: 3px;
  }

  .lang {
    min-width: 31px;
    height: 30px;
    font-size: 10px;
  }

  .data-status {
    position: fixed;
    z-index: 1300;
    top: 60px;
    left: 12px;
    right: 12px;
    width: auto;
    margin: 0;
    box-shadow: var(--shadow-sm);
  }

  .workspace {
    position: fixed;
    inset: 54px 0 58px;
    width: auto;
    display: block;
  }

  .planner-panel {
    position: fixed;
    z-index: 1050;
    top: 62px;
    left: 10px;
    right: 10px;
    height: auto;
    min-height: 0;
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: visible;
    pointer-events: none;
  }

  .planner-heading,
  .filter-section,
  .route-box {
    display: none;
  }

  .sidebar-search {
    pointer-events: auto;
  }

  .sidebar-search input {
    height: 42px;
    border-color: rgba(202, 208, 216, 0.94);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
  }

  .map-stage {
    position: absolute;
    inset: 0;
    border: 0;
    border-radius: 0;
  }

  .map-toolbar {
    top: 58px;
    left: 10px;
    right: 10px;
  }

  .map-result-count {
    min-height: 34px;
    padding: 6px 9px;
  }

  .tool-button {
    min-height: 34px;
    padding: 0 9px;
  }

  .leaflet-bottom {
    bottom: 32vh;
  }

  .spot-drawer {
    position: fixed;
    z-index: 1200;
    left: 0;
    right: 0;
    bottom: 58px;
    height: 34vh;
    min-height: 230px;
    max-height: calc(100vh - 112px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -12px 34px rgba(31, 36, 45, 0.15);
    transform: translateY(calc(100% - 78px));
    transition: transform 220ms ease, height 220ms ease;
  }

  body[data-mobile-view="spots"] .spot-drawer {
    height: 56vh;
    transform: translateY(0);
  }

  body[data-mobile-view="route"] .spot-drawer {
    display: none;
  }

  .drawer-handle {
    width: 42px;
    height: 4px;
    display: block;
    flex: 0 0 auto;
    margin: 8px auto 2px;
    border-radius: 99px;
    background: #c8cdd4;
  }

  .list-view {
    padding: 8px 10px 12px;
  }

  .list-view .section-title {
    margin-bottom: 8px;
  }

  .panel-kicker {
    display: none;
  }

  .spot-list {
    gap: 7px;
    padding-bottom: 12px;
  }

  .spot-card {
    grid-template-columns: 84px minmax(0, 1fr);
    min-height: 128px;
    padding: 8px;
    background: white;
  }

  .thumb {
    min-height: 110px;
  }

  .spot-card h3 {
    font-size: 14px;
  }

  .spot-card p {
    font-size: 11px;
    -webkit-line-clamp: 2;
  }

  .detail-panel {
    padding-bottom: 18px;
  }

  .detail-topbar {
    padding: 9px 12px;
  }

  .detail-visual {
    height: 170px;
  }

  .detail-content {
    padding: 15px;
  }

  .detail-content h2 {
    font-size: 22px;
  }

  body[data-mobile-view="route"] .planner-panel {
    z-index: 1250;
    top: 54px;
    bottom: 58px;
    left: 0;
    right: 0;
    display: block;
    padding: 18px 16px;
    border-radius: 0;
    background: white;
    overflow-y: auto;
    pointer-events: auto;
  }

  body[data-mobile-view="route"] .sidebar-search,
  body[data-mobile-view="route"] .map-stage {
    display: none;
  }

  body[data-mobile-view="route"] .route-box {
    display: block;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  body[data-mobile-view="route"] .route-list {
    max-height: none;
    min-height: 180px;
  }

  .mobile-nav {
    position: fixed;
    z-index: 1400;
    left: 0;
    right: 0;
    bottom: 0;
    height: 58px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .mobile-nav-button {
    position: relative;
    display: grid;
    place-content: center;
    gap: 2px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
  }

  .mobile-nav-button.active {
    color: var(--accent);
  }

  .nav-icon {
    font-size: 17px;
    line-height: 1;
  }

  .mobile-route-count {
    position: absolute;
    top: 6px;
    left: calc(50% + 10px);
    min-width: 16px;
    height: 16px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--accent);
    color: white;
    font-size: 9px;
  }
}

@media (max-width: 390px) {
  .brand strong {
    font-size: 13px;
  }

  .lang {
    min-width: 29px;
  }

  .tool-button {
    max-width: 104px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .spot-card {
    grid-template-columns: 76px minmax(0, 1fr);
  }
}

.source-links {
  padding-inline-start: 24px;
  overflow-wrap: anywhere;
}

.detail-topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.methodology-link {
  align-self: start;
  color: var(--accent);
  font-size: 13px;
}

.editorial-page {
  overflow: auto;
  background: white;
}

.editorial-page header,
.editorial-page main {
  width: min(100% - 32px, 720px);
  margin: 0 auto;
}

.editorial-page header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.editorial-page main {
  padding: 24px 0 48px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.editorial-page h2 {
  margin-top: 24px;
  font-size: 18px;
}

.editorial-page dt { font-weight: 800; }
.editorial-page dd { margin: 0 0 12px; }

@media (max-width: 980px) {
  .topbar { padding-block: 4px; }

  #cityFilter,
  .lang,
  .member-chip,
  .tool-button,
  .card-action,
  .back-button,
  .detail-topbar a {
    min-height: 44px;
  }

  .member-chips { gap: 8px; }
  .card-action { padding-inline: 9px; }
  .mobile-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .drawer-handle, .methodology-link { display: none; }
  .leaflet-bottom { bottom: 0; }
  .spot-drawer { display: none; }

  body[data-mobile-view="spots"] .spot-drawer {
    position: absolute;
    inset: 0;
    display: flex;
    height: auto;
    min-height: 0;
    max-height: none;
    border-radius: 0;
  }

  body[data-mobile-view="spots"] .planner-panel,
  body[data-mobile-view="filters"] .map-stage {
    visibility: hidden;
  }

  body[data-mobile-view="filters"] .planner-panel {
    position: absolute;
    inset: 0;
    display: grid;
    align-content: start;
    gap: 18px;
    padding: 18px;
    background: white;
    overflow-y: auto;
    pointer-events: auto;
  }

  body[data-mobile-view="filters"] .filter-section:not([hidden]),
  body[data-mobile-view="filters"] .methodology-link {
    display: block;
  }
}
