:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --ink: #1b2a2f;
  --muted: #637276;
  --panel: #fffdfa;
  --line: #d8d0c2;
  --accent: #0e6d64;
  --accent-2: #b84a2f;
  --road: #8f948f;
  --route: #d23b25;
  --water: #9cc9d2;
  --desert: #e6d3ad;
  --highland: #c2b493;
  --shadow: 0 18px 45px rgba(38, 35, 28, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: block;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

@supports (height: 100dvh) {
  .app-shell {
    height: 100dvh;
    min-height: 100dvh;
  }
}

.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;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  max-height: 100vh;
  min-height: 0;
  padding: 22px;
  overflow: auto;
  background: #ebe3d3;
  border-right: 1px solid var(--line);
}

.brand-block {
  padding: 4px 2px 8px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 2.6rem, 2.6rem);
  line-height: 1;
}

h2 {
  margin: 0;
  font-size: 1rem;
}

.lede {
  margin-bottom: 0;
  color: #405053;
  line-height: 1.45;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.status-pill {
  flex: 0 0 auto;
  padding: 4px 9px;
  color: white;
  background: var(--accent);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
}

.subtle {
  color: var(--muted);
  font-size: 0.82rem;
}

label {
  color: #334548;
  font-size: 0.84rem;
  font-weight: 750;
}

input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cfc7b7;
  border-radius: 6px;
  outline: none;
}

select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cfc7b7;
  border-radius: 6px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 109, 100, 0.16);
}

.app-links {
  margin-top: 12px;
}

.app-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  color: white;
  background: var(--accent);
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.search-row,
.button-row {
  display: flex;
  gap: 8px;
}

.icon-button,
.tool-button {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  color: var(--ink);
  background: #f4efe5;
  border: 1px solid #cfc7b7;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 850;
}

.test-location-control {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #fbf7ef;
  border: 1px solid #e1d8c9;
  border-radius: 6px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #354548;
  font-size: 0.86rem;
  font-weight: 800;
}

.toggle-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

#reset-view {
  flex-basis: 58px;
  width: 58px;
}

.primary-button,
.secondary-button,
.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 800;
  white-space: nowrap;
}

.primary-button {
  flex: 1;
  color: white;
  background: var(--accent);
}

.secondary-button,
.file-button {
  color: var(--ink);
  background: #f4efe5;
  border-color: #cfc7b7;
}

.route-summary,
.selected-info {
  min-height: 58px;
  padding: 11px 12px;
  color: #36474b;
  background: #f7f1e7;
  border: 1px solid #e1d8c9;
  border-radius: 6px;
  line-height: 1.4;
}

.directions-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  margin: 0;
  padding-left: 0;
  list-style: none;
  overflow: auto;
}

.directions-list li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
  padding: 8px 8px 8px 2px;
  color: #36474b;
  line-height: 1.35;
}

.direction-step-number {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: white;
  background: var(--accent);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 850;
}

.direction-step-copy {
  min-width: 0;
}

.directions-list strong {
  display: block;
  color: var(--ink);
  font-size: 0.9rem;
}

.directions-list span {
  color: var(--muted);
  font-size: 0.78rem;
}

.poi-results {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.poi-filter-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.filter-button {
  height: 34px;
  color: #354548;
  background: #f5efe4;
  border: 1px solid #d8cdbc;
  border-radius: 6px;
  font-weight: 750;
}

.filter-button.active {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
}

.poi-status {
  min-height: 32px;
  padding: 8px 10px;
  color: #405053;
  background: #f7f1e7;
  border: 1px solid #e1d8c9;
  border-radius: 6px;
  font-size: 0.82rem;
  line-height: 1.35;
}

.poi-popup {
  display: grid;
  gap: 5px;
  min-width: 190px;
  color: var(--ink);
}

.poi-popup span {
  color: var(--muted);
  font-size: 0.82rem;
}

.popup-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 4px;
}

.popup-actions [data-poi-directions] {
  grid-column: 1 / -1;
}

.popup-actions button {
  min-height: 30px;
  color: white;
  background: var(--accent);
  border: 0;
  border-radius: 5px;
  font-weight: 750;
}

.poi-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 16px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #252f32;
}

.poi-item + .poi-item {
  border-top: 1px solid #ececec;
}

.poi-item:hover {
  background: #f5f7f6;
}

.poi-item-icon {
  position: relative;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 2px solid #6b7376;
  border-radius: 50%;
  overflow: visible;
  color: inherit;
  white-space: normal;
}

.poi-item-icon::before {
  width: 7px;
  height: 7px;
  border-left: 2px solid #6b7376;
  border-bottom: 2px solid #6b7376;
  content: "";
  transform: rotate(-45deg) translate(1px, -1px);
}

.poi-item-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.poi-item strong {
  overflow: hidden;
  font-size: 0.98rem;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poi-item-text span {
  color: var(--muted);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-suggestions {
  display: grid;
  gap: 6px;
  max-height: 210px;
  overflow: auto;
  padding: 6px;
  background: #fffdfa;
  border: 1px solid #e1d8c9;
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(27, 42, 47, 0.12);
}

.route-suggestions[hidden] {
  display: none;
}

.route-suggestion-item {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 9px;
  color: var(--ink);
  text-align: left;
  background: #f9f5ec;
  border: 1px solid #e4dac9;
  border-radius: 6px;
}

.route-suggestion-item strong {
  font-size: 0.88rem;
}

.route-suggestion-item span,
.route-suggestion-status {
  color: var(--muted);
  font-size: 0.78rem;
}

.route-suggestion-status {
  padding: 8px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.promo-label {
  display: inline-flex;
  width: max-content;
  padding: 3px 6px;
  color: #6b3f00;
  background: #ffe2a3;
  border: 1px solid #e8bd63;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 800;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px;
  background: #ede5d7;
  border: 1px solid #d8cdbc;
  border-radius: 8px;
}

.segmented button {
  height: 36px;
  color: #354548;
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-weight: 750;
}

.segmented button.active {
  color: white;
  background: var(--accent);
}

#import-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.map-area {
  display: block;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(156, 201, 210, 0.7) 0, rgba(156, 201, 210, 0.3) 18%, rgba(235, 226, 203, 0) 44%),
    #efe9db;
}

.map-frame {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.map-frame::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  content: "";
  opacity: 0;
  transition: opacity 160ms ease;
}

.map-frame[data-map-style="light"]::after {
  opacity: 0.12;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(236, 239, 236, 0.18));
}

.map-frame[data-map-style="dark"]::after {
  opacity: 0.18;
  background: linear-gradient(180deg, rgba(20, 28, 33, 0.18), rgba(5, 8, 10, 0.28));
}

.map-frame[data-map-style="satellite"]::after {
  opacity: 0.16;
  background:
    linear-gradient(180deg, rgba(8, 12, 14, 0.12), rgba(8, 12, 14, 0.24)),
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.08));
}

.map-search-overlay {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 4;
  display: grid;
  gap: 0;
  width: min(480px, calc(100% - 86px));
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.map-search-overlay.route-active,
.map-search-overlay.route-found {
  gap: 7px;
  padding: 8px;
  background: rgba(255, 253, 250, 0.94);
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(27, 42, 47, 0.16);
  backdrop-filter: blur(10px);
}

.map-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.map-search-overlay input,
.route-input-row input {
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(165, 165, 165, 0.86);
  background: rgba(255, 255, 255, 0.98);
  background-clip: padding-box;
  box-shadow: 0 4px 14px rgba(27, 42, 47, 0.08);
}

.map-search-overlay #poi-search {
  box-shadow: none;
}

.category-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  color: #243437;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(165, 165, 165, 0.86);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(27, 42, 47, 0.14);
  font-weight: 800;
}

.category-button-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-clear-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin-right: -6px;
  color: #3c4c4f;
  background: rgba(226, 229, 224, 0.9);
  border: 1px solid rgba(180, 186, 178, 0.9);
  border-radius: 999px;
  font-size: 0.9rem;
  line-height: 1;
  font-weight: 900;
}

.category-clear-icon:hover {
  color: #173f36;
  background: #e7f2ea;
}

.category-menu {
  width: min(420px, 100%);
  margin-top: 10px;
}

.map-brand-control {
  position: absolute;
  left: 12px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(280px, calc(100vw - 180px));
  min-height: 34px;
  padding: 6px 11px;
  color: #243437;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(201, 201, 201, 0.82);
  border-radius: 999px;
  box-shadow: 0 10px 26px rgba(27, 42, 47, 0.12);
  font-size: 0.78rem;
  text-decoration: none;
  backdrop-filter: blur(10px);
}

.map-language-control {
  position: absolute;
  right: 12px;
  bottom: calc(48px + env(safe-area-inset-bottom, 0px));
  z-index: 8;
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(201, 201, 201, 0.82);
  border-radius: 999px;
  box-shadow: 0 10px 26px rgba(27, 42, 47, 0.12);
  backdrop-filter: blur(10px);
}

.map-language-control button {
  min-height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  color: #4c5c60;
  background: transparent;
  font-size: 0.74rem;
  font-weight: 850;
}

.map-language-control button.is-active {
  color: #ffffff;
  background: #0e6d64;
}

.maplibregl-ctrl-bottom-left {
  bottom: calc(58px + env(safe-area-inset-bottom, 0px));
}

.map-brand-control span {
  color: #0e6d64;
  font-weight: 800;
}

.category-menu[hidden] {
  display: none;
}

.category-menu-panel {
  padding: 14px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(210, 210, 210, 0.9);
  border-radius: 20px;
  box-shadow: 0 16px 34px rgba(27, 42, 47, 0.18);
}

.category-menu-topline {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  color: #263437;
}

.category-tile-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}

.subcategory-grid {
  gap: 8px;
}

.category-tile-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: max-content;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(210, 210, 210, 0.95);
  border-radius: 10px;
  background: #fff;
  color: #27373a;
  text-align: center;
  font-size: 0.84rem;
  font-weight: 760;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(27, 42, 47, 0.08);
}

.category-tile-button:hover,
.category-tile-button.active {
  border-color: rgba(35, 107, 78, 0.48);
  background: #f4faf6;
  color: #174d38;
}

.category-back-button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(210, 210, 210, 0.95);
  border-radius: 999px;
  background: #f7f8f7;
  color: #354548;
  font-size: 0.78rem;
  font-weight: 800;
}

.map-search-overlay .poi-status {
  display: none;
}

.map-search-overlay .poi-results {
  width: calc(100% - 138px);
  max-height: 320px;
  overflow: auto;
  margin-top: 8px;
  gap: 0;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(210, 210, 210, 0.92);
  border-radius: 18px;
  box-shadow: 0 16px 34px rgba(27, 42, 47, 0.18);
}

.map-search-overlay .poi-results:empty {
  display: none;
}

.overlay-meta {
  display: none;
}

.route-start-block,
.route-destination-block,
.route-action-row,
.directions-panel {
  display: none;
}

.map-search-overlay.route-active .route-start-block,
.map-search-overlay.route-active .route-destination-block,
.map-search-overlay.route-active .route-action-row {
  display: grid;
}

.map-search-overlay.route-active #main-search-row {
  display: none;
}

.map-search-overlay.route-found .directions-panel {
  display: block;
}

.route-input-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
}

.route-cancel-button {
  color: #4c5c60;
  font-weight: 900;
}

.route-dot {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  color: white;
  font-size: 0.72rem;
  font-weight: 900;
}

.start-dot {
  background: var(--accent);
}

.end-dot {
  background: var(--route);
}

.selected-place-actions {
  display: block;
}

.selected-place-actions[hidden] {
  display: none;
}

.selected-place-card {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #e1d8c9;
  border-radius: 8px;
  background: #fffdfa;
  color: #27373a;
}

.selected-place-card strong {
  padding-right: 28px;
  font-size: 0.95rem;
}

.selected-place-card span {
  color: #637071;
  font-size: 0.82rem;
}

.selected-place-card .card-close {
  position: absolute;
  right: 16px;
  width: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #526165;
  font-weight: 900;
}

.selected-place-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
}

.selected-place-card-actions button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #d8d0c2;
  border-radius: 7px;
  background: #fff;
  color: #27373a;
  font-weight: 800;
}

.selected-place-card-actions button:first-child {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.selected-poi-card {
  overflow: hidden;
  gap: 0;
  padding: 0;
  border: 1px solid rgba(138, 92, 46, 0.18);
  border-radius: 16px;
  background: #fffdf8;
  box-shadow: 0 18px 44px rgba(39, 55, 58, 0.18);
}

.selected-poi-card .card-close {
  top: 12px;
  right: 12px;
  z-index: 3;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 18px rgba(39, 55, 58, 0.18);
}

.selected-poi-media {
  position: relative;
  height: 158px;
  max-height: 158px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(12, 119, 103, 0.86), rgba(180, 91, 30, 0.74)),
    radial-gradient(circle at 78% 20%, rgba(255, 255, 255, 0.42), transparent 24%),
    linear-gradient(0deg, #e9dfcf, #fbf7ed);
}

.selected-poi-media img,
.selected-poi-placeholder {
  display: block;
  width: 100%;
  height: 158px;
  object-fit: cover;
  object-position: center;
}

.selected-poi-placeholder {
  background:
    linear-gradient(180deg, rgba(18, 86, 84, 0.08), rgba(113, 64, 26, 0.16)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0 10px, rgba(255, 255, 255, 0.04) 10px 20px);
}

.selected-poi-category {
  position: absolute;
  top: 12px;
  left: 12px;
  max-width: calc(100% - 72px);
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 248, 236, 0.92);
  color: #9c541d;
  font-size: 0.68rem;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selected-poi-body {
  display: grid;
  gap: 8px;
  padding: 14px 16px 12px;
}

.selected-poi-title {
  padding-right: 0;
  color: #27373a;
  font-size: 1.05rem;
  line-height: 1.18;
}

.selected-poi-secondary,
.selected-poi-location {
  color: #6a7473;
  font-size: 0.8rem;
  line-height: 1.3;
}

.selected-poi-location::before {
  content: "◇";
  margin-right: 5px;
  color: #ad5b20;
  font-size: 0.7rem;
}

.selected-poi-location {
  display: inline-flex;
  align-items: flex-start;
  gap: 5px;
}

.selected-poi-location::before {
  content: none;
  display: none;
}

.selected-poi-location-icon {
  display: inline-flex;
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  margin-top: 1px;
  color: #ad5b20;
}

.selected-poi-location-icon svg {
  display: block;
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.selected-poi-facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 2px;
}

.selected-poi-facts.has-best-time {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.selected-poi-fact {
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 10px;
  border-radius: 10px;
  background: #f8f4ee;
}

.selected-poi-fact em,
.selected-poi-description em {
  color: #7b7166;
  font-size: 0.65rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.selected-poi-fact b {
  color: #ad5b20;
  font-size: 0.78rem;
  line-height: 1.25;
}

.selected-poi-description {
  display: grid;
  gap: 5px;
  margin-top: 2px;
}

.selected-poi-description p {
  margin: 0;
  color: #5d6868;
  font-size: 0.82rem;
  line-height: 1.45;
}

.selected-poi-card .selected-place-card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 0 16px 16px;
  margin-top: 0;
}

.selected-poi-card .selected-place-card-actions button {
  min-height: 42px;
  border-radius: 10px;
}

.selected-poi-card .selected-place-card-actions .share-action-button {
  width: 44px;
  justify-content: center;
  padding: 0;
}

.selected-poi-card .selected-place-card-actions .share-action-button span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.share-action-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.share-action-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.share-copy-hint {
  align-self: center;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 850;
}

.route-action-row {
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.route-profile-row {
  display: none;
  grid-template-columns: repeat(3, minmax(0, auto));
  justify-content: start;
  gap: 6px;
}

.map-search-overlay.route-active .route-profile-row,
.map-search-overlay.route-found .route-profile-row {
  display: grid;
}

.route-profile-pill {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #d7cebf;
  border-radius: 999px;
  color: #394b48;
  background: #fffefa;
  font-weight: 850;
}

.route-profile-pill.active {
  color: white;
  border-color: var(--accent);
  background: var(--accent);
}

.route-profile-pill:disabled {
  color: #8b928c;
  background: #f0eee8;
}

.route-warning {
  display: none;
  padding: 8px 10px;
  color: #6a4c18;
  background: #fff4d6;
  border: 1px solid #ead39a;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.35;
  box-shadow: 0 8px 18px rgba(106, 76, 24, 0.08);
}

.route-warning:not([hidden]) {
  display: block;
}

.route-options {
  display: none;
  gap: 7px;
}

.map-search-overlay.route-found .route-options:not([hidden]) {
  display: grid;
}

.route-options-title {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.route-option-list {
  display: grid;
  gap: 6px;
}

.route-option-card {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 46px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fffefa;
  border: 1px solid #e1d8c9;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(27, 42, 47, 0.08);
  text-align: left;
}

.route-option-card.selected {
  border-color: var(--route);
  box-shadow: 0 0 0 2px rgba(210, 59, 37, 0.16), 0 10px 22px rgba(27, 42, 47, 0.11);
}

.route-option-card strong {
  font-size: 0.84rem;
}

.route-option-card span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.route-profile-note {
  padding: 7px 9px;
  color: #5f625c;
  background: #f4efe5;
  border: 1px solid #e1d8c9;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 800;
}

.route-summary {
  display: none;
  min-height: auto;
}

.map-search-overlay.has-destination .route-summary,
.map-search-overlay.route-active .route-summary,
.map-search-overlay.route-found .route-summary {
  display: block;
}

.route-summary-header strong {
  display: block;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.25;
}

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

.route-summary-grid div {
  padding: 8px;
  border: 1px solid #e3dacb;
  border-radius: 6px;
  background: #fffdf8;
}

.route-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.route-summary-grid strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 0.95rem;
}

.route-loading,
.route-error-message {
  color: var(--ink);
  font-weight: 850;
}

.route-debug-detail {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.directions-panel {
  padding: 0;
  background: #fffdfa;
  border: 1px solid #e1d8c9;
  border-radius: 8px;
  overflow: hidden;
}

.directions-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 10px;
  cursor: pointer;
  font-weight: 850;
}

.directions-panel .directions-list {
  max-height: 220px;
  padding: 0 12px 10px 28px;
}

.compact-hidden {
  display: none;
}

#map {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.maplibregl-canvas {
  outline: none;
}

.maplibregl-popup-content {
  padding: 10px 12px;
  color: var(--ink);
  border-radius: 6px;
  box-shadow: 0 14px 35px rgba(27, 42, 47, 0.22);
}

.maplibregl-ctrl-group {
  border-radius: 6px;
}

.maplibregl-ctrl-home,
.maplibregl-ctrl-north {
  display: grid;
  place-items: center;
}

.maplibregl-ctrl-style,
.maplibregl-ctrl-home,
.maplibregl-ctrl-north,
.maplibregl-ctrl-building {
  display: grid;
  place-items: center;
}

.maplibregl-ctrl-style svg,
.maplibregl-ctrl-home svg,
.maplibregl-ctrl-north svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-style-control {
  overflow: hidden;
}

.map-style-control .maplibregl-ctrl-style {
  color: #27373a;
}

.map-style-control .maplibregl-ctrl-style:hover,
.map-style-control .maplibregl-ctrl-style.active {
  background: #e7efe3;
  color: var(--accent);
}

.map-style-control .maplibregl-ctrl-style.active svg {
  stroke: var(--accent);
}

.category-menu-group {
  display: grid;
  gap: 4px;
  padding-top: 5px;
  border-top: 1px solid rgba(216, 208, 194, 0.72);
}

.category-menu-heading {
  padding: 3px 8px 1px;
  color: #60706b;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.maplibregl-ctrl-building {
  min-width: 29px;
  color: #27373a;
  font-size: 0.68rem;
  font-weight: 900;
}

.maplibregl-ctrl-building.active {
  color: #fff;
  background: var(--accent);
}

.maplibregl-ctrl-north.active {
  color: #765700;
  background: #fff3bf;
}

.map-attribution {
  position: absolute;
  right: 10px;
  bottom: 8px;
  z-index: 3;
  max-width: calc(100% - 20px);
  padding: 3px 7px;
  color: rgba(27, 42, 47, 0.86);
  background: rgba(255, 253, 250, 0.76);
  border: 1px solid rgba(216, 208, 194, 0.65);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(27, 42, 47, 0.08);
  font-size: 0.68rem;
  line-height: 1.25;
  pointer-events: none;
}

.map-selection-card {
  position: absolute;
  left: 50%;
  bottom: 42px;
  z-index: 4;
  display: grid;
  width: min(520px, calc(100% - 28px));
  gap: 10px;
  padding: 13px;
  color: var(--ink);
  background: rgba(255, 253, 250, 0.96);
  border: 1px solid rgba(216, 208, 194, 0.94);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(27, 42, 47, 0.2);
  transform: translateX(-50%);
}

.map-selection-card[hidden] {
  display: none;
}

.map-selection-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.map-selection-card strong {
  display: block;
  font-size: 0.96rem;
}

.map-selection-card span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.map-selection-card .card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.map-selection-card button {
  min-height: 32px;
  padding: 0 10px;
  color: var(--ink);
  background: #f4efe5;
  border: 1px solid #cfc7b7;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 800;
}

.map-selection-card [data-card-action="directions"] {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
}

.map-selection-card .card-close {
  min-width: 32px;
  padding: 0;
  font-size: 1rem;
}

.map-tooltip {
  position: absolute;
  z-index: 3;
  max-width: 260px;
  padding: 8px 10px;
  color: white;
  background: rgba(27, 42, 47, 0.92);
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(27, 42, 47, 0.25);
  font-size: 0.82rem;
  pointer-events: none;
}

.site-nav {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom, 0px));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100vw - 24px);
  padding: 8px 10px;
  overflow: visible;
  background: rgba(255, 253, 250, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  box-shadow: 0 18px 42px rgba(27, 42, 47, 0.18);
  transform: translateX(-50%);
  backdrop-filter: blur(20px);
}

.site-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  color: #b8844d;
  background: transparent;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav-link:hover,
.site-nav-link:focus-visible {
  background: rgba(184, 132, 77, 0.12);
  outline: 0;
}

.site-nav-link.is-active {
  color: white;
  background: linear-gradient(135deg, #b8844d, #8b6f47);
  box-shadow: 0 8px 20px rgba(184, 132, 77, 0.26);
}

.site-nav-menu {
  position: relative;
}

.site-nav-menu::before {
  content: "";
  position: absolute;
  right: -10px;
  bottom: 100%;
  left: -10px;
  height: 16px;
}

.site-nav-trigger {
  cursor: pointer;
}

.site-nav-dropdown {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  display: grid;
  gap: 5px;
  min-width: 190px;
  padding: 8px;
  background: rgba(255, 253, 250, 0.98);
  border: 1px solid rgba(184, 132, 77, 0.18);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(27, 42, 47, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 160ms ease, transform 160ms ease;
  backdrop-filter: blur(18px);
}

.site-nav-menu:hover .site-nav-dropdown,
.site-nav-menu:focus-within .site-nav-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.site-nav-dropdown a,
.site-nav-option {
  min-height: 36px;
  padding: 9px 11px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
  text-decoration: none;
  text-align: left;
}

.site-nav-dropdown a:hover,
.site-nav-dropdown a:focus-visible,
.site-nav-option:hover,
.site-nav-option:focus-visible,
.site-nav-option.is-active {
  color: white;
  background: var(--accent);
  outline: 0;
}

html[dir="rtl"] .site-nav-option {
  text-align: right;
}

@media (max-width: 900px) {
  .app-shell {
    height: 100vh;
    overflow: hidden;
  }

  #map {
    min-height: 100vh;
  }

  @supports (height: 100dvh) {
    .app-shell {
      height: 100dvh;
      min-height: 100dvh;
    }

    #map {
      min-height: 100dvh;
    }
  }
}

@media (max-width: 560px) {
  .site-nav {
    right: 10px;
    left: 10px;
    justify-content: flex-start;
    overflow-x: auto;
    transform: none;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav-link {
    min-height: 36px;
    padding: 8px 11px;
    font-size: 0.78rem;
  }

  .map-search-overlay {
    top: 10px;
    left: 10px;
    width: calc(100% - 64px);
  }

  .map-search-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .map-search-overlay .subtle {
    display: none;
  }

  .category-button {
    width: auto;
    padding: 0 12px;
  }

  .map-search-overlay .poi-results {
    width: 100%;
  }

  .map-search-overlay.route-active .route-profile-row,
  .map-search-overlay.route-found .route-profile-row {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .route-profile-row::-webkit-scrollbar {
    display: none;
  }

  .route-profile-pill {
    flex: 0 0 auto;
  }

  .route-option-list {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .route-option-list::-webkit-scrollbar {
    display: none;
  }

  .route-option-card {
    min-width: 190px;
  }

  .route-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .directions-panel .directions-list {
    max-height: 34dvh;
  }

  .map-selection-card {
    bottom: max(96px, calc(env(safe-area-inset-bottom, 0px) + 74px));
    width: min(420px, calc(100% - 24px));
    max-height: min(42dvh, 260px);
    overflow: auto;
  }
}
