:root {
  color-scheme: light;
  font-family: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
  color: #142c29;
  background: #f4f8f5;
  --green: #176f58;
  --green-dark: #115241;
  --blue: #2669a8;
  --paper: #fff;
  --soft: #e5f2e9;
  --stroke: #dce7df;
  --muted: #4f6a62;
  --radius: 1rem;
  --nav-clearance: 6rem;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; padding-bottom: var(--nav-clearance); }
html { scroll-behavior: smooth; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
a { color: var(--green-dark); }
button:disabled { opacity: .62; cursor: wait; }
a, button, input, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: .18rem solid var(--blue); outline-offset: .2rem; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.14; letter-spacing: -.026em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.12rem); }
h3 { font-size: 1.12rem; }
.symbols, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.icon { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.shell { width: min(100% - 3rem, 73.5rem); margin-inline: auto; }
.section { margin-top: 2.45rem; scroll-margin-top: 6rem; }
.subtle, .map-note { color: var(--muted); }

.masthead { position: sticky; top: 0; z-index: 800; background: #f4f8f5; border-bottom: 1px solid var(--stroke); }
.masthead-inner { min-height: 4.6rem; display: flex; align-items: center; gap: 2.4rem; }
.brand { display: inline-flex; gap: .7rem; align-items: center; flex: 0 0 auto; color: var(--blue); text-decoration: none; font-size: 1.18rem; font-weight: 800; letter-spacing: .065em; }
.brand b { color: var(--green); }
.top-links { display: flex; gap: 1.65rem; }
.top-links a { color: var(--muted); text-decoration: none; font-weight: 650; }
.top-links a:hover, .top-links a[aria-current] { color: var(--green); text-decoration: underline; text-underline-offset: .25rem; }
.header-actions { margin-left: auto; display: flex; gap: .55rem; }
.button, .icon-button {
  display: inline-flex;
  gap: .45rem;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  border: 1px solid transparent;
  border-radius: .72rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.button { padding: .52rem .92rem; font-size: .94rem; }
.button-primary { background: var(--green); color: #fff; }
.button-primary:hover { background: var(--green-dark); }
.button-light { background: var(--paper); border-color: var(--stroke); color: var(--green-dark); }
.button-light:hover { background: var(--soft); }
.button-white { background: #fff; color: #165b48; }
.button-white:hover { background: #def7e9; }
.tool-button { padding-inline: .78rem; }
.icon-button { background: var(--paper); border-color: var(--stroke); padding: 0; width: 2.75rem; }
.icon-button:hover { background: var(--soft); }

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(21.5rem, 31vw, 25rem);
  margin-top: 1.25rem;
  border-radius: 1.5rem;
  background: #234c55;
  color: #fff;
}
.hero-image, .hero::after { position: absolute; inset: 0; height: 100%; width: 100%; }
.hero-image { z-index: -2; object-fit: cover; object-position: center 54%; }
.hero::after {
  z-index: -1;
  content: "";
  background: linear-gradient(89deg, #091f29e8 0%, #0a283ac7 27%, #18364244 60%, #14293010 100%);
}
.hero-content { padding: 2.4rem clamp(1.4rem, 5vw, 4.3rem); }
.hero h1 { max-width: 14ch; font-size: clamp(3.2rem, 5.7vw, 5.3rem); line-height: .99; letter-spacing: -.055em; }
.hero p { max-width: 24rem; margin: 1.1rem 0 1.45rem; font-size: clamp(1rem, 1.8vw, 1.16rem); line-height: 1.5; }
.hero-place {
  position: absolute;
  display: flex;
  gap: .45rem;
  align-items: center;
  right: 1.2rem;
  bottom: 1.2rem;
  font-size: .88rem;
  padding: .46rem .66rem;
  background: #102c3ae8;
  border-radius: .58rem;
}
.hero-place .icon { width: 1.05rem; height: 1.05rem; }

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: .85rem; margin-bottom: .95rem; }
.filters, .map-legend, .prompt-buttons { display: flex; align-items: center; flex-wrap: wrap; gap: .48rem; }
.filters { margin-bottom: .9rem; }
.filters button, .map-legend button, .prompt-buttons button {
  display: inline-flex;
  align-items: center;
  gap: .36rem;
  background: var(--paper);
  min-height: 2.72rem;
  padding: .4rem .75rem;
  border: 1px solid var(--stroke);
  border-radius: 2rem;
  font-weight: 650;
  font-size: .9rem;
}
.filters button:hover, .map-legend button:hover, .prompt-buttons button:hover { border-color: #6f9c8a; }
.filters button[aria-pressed="true"] { background: var(--green); color: #fff; border-color: var(--green); }
.filters .icon { width: 1.05rem; height: 1.05rem; }
.route-layout { display: grid; grid-template-columns: minmax(0, 1.88fr) minmax(17.3rem, 1fr); gap: 1rem; align-items: stretch; }
.map-panel, .route-card, .route-detail, .hotel-card, .profile-card, .saved-card {
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--paper);
}
.map-panel { overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
#map { width: 100%; min-height: 19.5rem; flex: 1; background: #e6efe7; isolation: isolate; }
.leaflet-container .leaflet-tile-pane { filter: saturate(.82); }
.leaflet-container .leaflet-control-attribution { font-size: 11px; }
.marker-home { background: transparent; border: 0; }
.marker-home > span {
  display: grid;
  place-items: center;
  color: #fff;
  width: 2rem;
  height: 2rem;
  padding: .2rem;
  border-radius: 50%;
  background: var(--route-color);
  border: .16rem solid #fff;
  box-shadow: 0 .14rem .38rem #1e3a2952;
}
.marker-home .icon { width: 1.1rem; height: 1.1rem; }
.map-legend { padding: .68rem .78rem .42rem; }
.map-legend button { font-size: .84rem; min-height: 2.42rem; }
.map-legend button[aria-pressed="true"] { background: #edf6f0; border-color: #7aa992; }
.dot { width: .61rem; height: .61rem; border-radius: 50%; background: var(--route-color); }
.map-note { font-size: .86rem; padding-top: .62rem; }
.map-panel .map-note { padding: 0 .8rem .7rem; }
.route-cards { display: grid; align-content: start; gap: .65rem; min-width: 0; }
.route-card { display: grid; grid-template-columns: minmax(0, 1fr) 2.75rem; gap: .3rem; min-width: 0; padding: .52rem; align-items: center; }
.route-card.is-active { border-color: #93bbaa; }
.route-select { display: grid; grid-template-columns: 5.8rem minmax(0, 1fr); gap: .65rem; align-items: center; text-align: left; background: none; border: none; padding: 0; min-width: 0; border-radius: .65rem; }
.route-select:hover .route-name { color: var(--green); text-decoration: underline; text-underline-offset: .18rem; }
.route-select img { width: 100%; height: 5.3rem; object-fit: cover; border-radius: .6rem; background: var(--soft); }
.route-name { display: block; font-weight: 800; font-size: 1.09rem; line-height: 1.16; }
.route-tag { display: block; margin-top: .27rem; color: var(--route-color); font-weight: 700; font-size: .83rem; }
.route-meta { display: inline-flex; gap: .31rem; flex-wrap: wrap; align-items: center; margin-top: .34rem; color: var(--muted); font-size: .86rem; }
.route-meta .icon { width: .98rem; height: .98rem; }
.favorite-button { color: var(--green-dark); border: 0; background: transparent; }
.favorite-button[aria-pressed="true"] { color: #a63f55; }
.favorite-button[aria-pressed="true"] .icon { fill: currentColor; }
.route-detail { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .95rem 1rem; margin-top: .85rem; }
.route-detail p { margin-top: .37rem; line-height: 1.45; }
.weather-status { color: var(--muted); font-size: .9rem; }

.hotel-filters { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: .9rem; }
.hotel-filters label, .profile-card label { display: grid; gap: .35rem; font-weight: 650; }
.hotel-filters label:first-child { flex: 1 1 15rem; max-width: 28rem; }
.hotel-filters label:nth-child(2) { flex: 0 1 16rem; }
input, select {
  width: 100%;
  min-height: 2.76rem;
  border: 1px solid #cbdcd1;
  border-radius: .68rem;
  background: var(--paper);
  padding: .55rem .7rem;
  color: #142c29;
  font-weight: 450;
}
select {
  appearance: none;
  padding-right: 2.1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23176f58' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right .66rem center;
  background-size: 1rem;
  background-repeat: no-repeat;
}
.hotel-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.hotel-card { padding: 1rem; display: grid; gap: .6rem; align-content: start; }
.hotel-card h3 { display: flex; gap: .5rem; align-items: center; }
.hotel-card h3 .icon, .hotel-time .icon { color: var(--green); }
.hotel-address { color: var(--muted); line-height: 1.45; }
.hotel-time { display: flex; gap: .6rem 1rem; flex-wrap: wrap; font-size: .87rem; }
.hotel-time span { display: inline-flex; align-items: center; gap: .32rem; }
.hotel-card a { font-size: .9rem; font-weight: 650; justify-self: start; text-underline-offset: .15rem; }
.hotel-card .icon { width: 1.05rem; height: 1.05rem; }
.empty { color: var(--muted); line-height: 1.5; }

.qr-strip { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--soft); border-radius: var(--radius); padding: 1.15rem 1.35rem; }
.qr-strip p { margin: .48rem 0 .75rem; }
.qr-strip img { width: clamp(6.25rem, 20vw, 9.35rem); height: auto; border-radius: .45rem; background: #fff; }
.qr-strip h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); }
.footer { padding: 1.4rem 0; display: flex; justify-content: space-between; align-items: start; gap: 1rem; flex-wrap: wrap; font-size: .88rem; color: var(--muted); }
.footer summary { cursor: pointer; color: var(--green-dark); text-decoration: underline; text-underline-offset: .16rem; }
.footer ul { padding-left: 1.2rem; max-width: 33rem; line-height: 1.6; }

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  position: fixed;
  z-index: 850;
  inset: auto auto 1rem 50%;
  transform: translateX(-50%);
  width: min(30rem, calc(100% - 2rem));
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 1rem;
  padding: .32rem;
  box-shadow: 0 .45rem 1.6rem #12392719;
}
.bottom-nav a { display: grid; place-items: center; min-height: 3.14rem; align-content: center; gap: .18rem; border-radius: .72rem; font-size: .82rem; font-weight: 700; color: var(--muted); text-decoration: none; }
.bottom-nav a:hover { color: var(--green); background: #f1f7f3; }
.bottom-nav a[aria-current] { color: var(--green-dark); background: var(--soft); }
.bottom-nav .icon { height: 1.25rem; width: 1.25rem; }
.library { max-width: 56rem; margin-inline: auto; }
.library h1 { font-size: clamp(1.8rem, 4vw, 2.65rem); margin-bottom: 1rem; }
.saved-list { display: grid; gap: .7rem; }
.saved-card { display: flex; justify-content: space-between; align-items: center; gap: .7rem; padding: .85rem; }
.saved-card p { margin-top: .28rem; color: var(--muted); }
.saved-actions { display: flex; gap: .45rem; flex-wrap: wrap; }
.profile-card { max-width: 31rem; display: grid; gap: .7rem; padding: .9rem; }
.profile-card .button { justify-self: start; }
.profile-card p:empty { display: none; }
.profile-summary { margin: 1rem 0; color: var(--muted); }

.dialog {
  border: 1px solid var(--stroke);
  border-radius: 1.18rem;
  padding: 0;
  max-height: 92dvh;
  color: inherit;
  background: var(--paper);
  width: min(42rem, calc(100% - 1.1rem));
}
.dialog::backdrop { background: #122b33a0; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .72rem 1rem; border-bottom: 1px solid var(--stroke); }
.dialog-header h2 { display: flex; gap: .55rem; align-items: center; font-size: 1.3rem; }
.dialog-header h2 .icon { color: var(--green); }
.ar-stage { aspect-ratio: 5 / 3; min-height: 15.4rem; position: relative; overflow: hidden; background: #173e34; }
.ar-stage img, .ar-stage video, .ar-track, .ar-labels { position: absolute; inset: 0; width: 100%; height: 100%; }
.ar-stage img { object-fit: cover; object-position: 72% 50%; }
.ar-stage video { object-fit: cover; }
.ar-labels { z-index: 2; }
.ar-track { z-index: 1; }
.ar-track-label, .ar-label, .ar-scale {
  color: #fff;
  background: #102e33ed;
  border-radius: .45rem;
  padding: .42rem .56rem;
  font-size: .82rem;
}
.ar-track-label { position: absolute; left: .6rem; bottom: .7rem; z-index: 3; }
.ar-label { position: absolute; transform: translate(-50%, -95%); max-width: 39%; width: max-content; }
.ar-label::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: .65rem; background: #baff7b; }
.ar-label strong, .ar-label span { display: block; }
.ar-label span { color: #c9ffc9; margin-top: .15rem; }
.ar-scale { position: absolute; top: .8rem; right: .55rem; width: 4.6rem; z-index: 3; }
.ar-scale strong { display: block; margin-bottom: .45rem; font-size: .79rem; }
.scale-ticks { min-height: 7.5rem; border-left: 1px solid #b8e2db; display: flex; flex-direction: column; justify-content: space-between; }
.scale-ticks span { position: relative; padding-left: .52rem; font-size: .74rem; white-space: nowrap; }
.scale-ticks span::before { content: ""; position: absolute; top: 47%; left: 0; width: .32rem; height: 1px; background: #b8e2db; }
.ar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; padding: .8rem 1rem; }
.ar-actions p { flex: 1 1 100%; font-size: .88rem; line-height: 1.45; }
.assistant-dialog { width: min(34rem, calc(100% - 1.1rem)); }
.chat-log { display: grid; align-content: start; height: clamp(13rem, 39dvh, 22rem); overflow: auto; padding: .8rem 1rem; gap: .55rem; background: #f3f8f4; overscroll-behavior: contain; }
.message { max-width: 92%; padding: .66rem .82rem; border-radius: .82rem; background: #fff; overflow-wrap: anywhere; line-height: 1.45; white-space: pre-line; }
.message.ask { background: #d8eee1; justify-self: end; }
.message a { display: block; margin-top: .4rem; font-weight: 700; text-underline-offset: .18rem; }
.prompt-buttons { padding: .65rem 1rem 0; }
.prompt-buttons button { min-height: 2.65rem; font-size: .82rem; padding-inline: .66rem; }
.chat-form { display: flex; padding: .75rem 1rem; gap: .5rem; }
.chat-form input { min-width: 0; }

@media (max-width: 54rem) {
  .shell { width: calc(100% - 2rem); }
  .hero { min-height: 23rem; }
  .hero-content { padding: 1.75rem 1.9rem; }
  .route-layout { grid-template-columns: minmax(0, 1fr); }
  .route-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .route-card { position: relative; grid-template-columns: minmax(0, 1fr); }
  .route-select { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .route-select img { height: 6.6rem; }
  .route-card .favorite-button { position: absolute; right: .69rem; top: .69rem; background: #fff; }
}

@media (max-width: 38rem) {
  .shell { width: calc(100% - 1.3rem); }
  .masthead-inner { min-height: 4rem; gap: .55rem; }
  .brand { gap: .36rem; font-size: 1rem; letter-spacing: .035em; }
  .brand img { width: 2.35rem; height: auto; }
  .top-links { margin-left: auto; }
  .top-links a:first-child { display: none; }
  .top-links a { min-height: 2.75rem; display: grid; place-items: center; font-size: .86rem; }
  .header-actions { margin-left: 0; gap: .32rem; }
  .tool-button { padding-inline: .48rem; font-size: .85rem; }
  .tool-button .icon { width: 1rem; height: 1rem; }
  .assistant-label { display: none; }
  .hero { margin-top: .75rem; min-height: 22rem; border-radius: 1rem; }
  .hero-content { padding: 1.5rem 1.05rem 2.75rem; }
  .hero h1 { font-size: clamp(2.9rem, 11vw, 4.1rem); }
  .hero-place { bottom: .7rem; right: .7rem; }
  .hero::after { background: linear-gradient(89deg, #091f29e8, #0a283aaa 58%, #132a3c50); }
  .section { margin-top: 1.65rem; scroll-margin-top: 4.9rem; }
  #map { min-height: 17rem; }
  .filters { gap: .36rem; }
  .filters button { font-size: .83rem; padding-inline: .55rem; }
  .route-cards { grid-template-columns: minmax(0, 1fr); }
  .route-card { position: static; grid-template-columns: minmax(0, 1fr) 2.75rem; }
  .route-card .favorite-button { position: static; }
  .route-select { grid-template-columns: 5.5rem minmax(0, 1fr); }
  .route-select img { height: 4.8rem; }
  .route-detail, .saved-card { flex-direction: column; align-items: flex-start; }
  .hotel-list { grid-template-columns: minmax(0, 1fr); }
  .hotel-filters label:first-child, .hotel-filters label:nth-child(2) { max-width: none; flex: 1 0 100%; }
  .qr-strip { padding: .82rem .9rem; }
  .qr-strip p { font-size: .91rem; }
  .bottom-nav { inset: auto 0 0; transform: none; width: 100%; padding-bottom: max(.3rem, env(safe-area-inset-bottom)); border-radius: .85rem .85rem 0 0; }
  .bottom-nav a { font-size: .76rem; }
}

@media (max-width: 22rem) {
  .brand { font-size: .88rem; }
  .brand img { width: 2.1rem; }
  .header-actions { gap: .22rem; }
  .tool-button { gap: .2rem; padding-inline: .38rem; }
  .qr-strip { align-items: start; }
  .qr-strip img { width: 5.7rem; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
