:root {
  --paper: #faf3e5;
  --panel: #fffaf0;
  --ink: #283f3b;
  --muted: #52645c;
  --line: #bfc7ab;
  --accent: #944639;
  --sun: #f3d79b;
  --sea: #b8dce2;
  --green: #d9e5c4;
  --touch: 2.75rem;
  color: var(--ink);
  background: var(--paper);
  font: 1rem/1.5 var(--site-font);
}
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, p { margin: 0; }
button, a { touch-action: manipulation; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
a { color: inherit; text-underline-offset: .2em; }
[hidden] { display: none !important; }
:focus-visible { outline: .16rem solid var(--accent); outline-offset: .15rem; }

.top, .layout { width: min(100% - 2rem, 86rem); margin-inline: auto; }
.top { min-height: 4rem; display: flex; gap: .75rem; align-items: center; justify-content: space-between; }
.top h1 { font-size: clamp(1.15rem, 2.4vw, 1.75rem); font-weight: 760; line-height: 1.25; letter-spacing: -.02em; text-align: center; }
.top a { display: inline-flex; min-height: var(--touch); align-items: center; font-size: .86rem; font-weight: 760; white-space: nowrap; }
.home { text-decoration: none; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem); gap: 1rem; padding-bottom: 1.5rem; align-items: start; }
.map-panel { min-width: 0; }
.areas, .filters { display: flex; flex-wrap: wrap; gap: .35rem; }
.areas { margin-bottom: .5rem; }
.areas button, .filters button {
  min-height: var(--touch);
  padding: .25rem .7rem;
  border: 1px solid var(--line);
  border-radius: 2rem;
  background: var(--panel);
  font-size: .875rem;
  font-weight: 730;
  white-space: nowrap;
}
.areas button[aria-pressed=true], .filters button[aria-pressed=true] {
  background: var(--ink);
  color: var(--panel);
  border-color: var(--ink);
}

.map-frame {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  height: max(29rem, min(72svh, 50rem));
  border: 1px solid var(--line);
  border-radius: .9rem;
  background: var(--sea);
}
.map-stage, canvas, .markers { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-stage { cursor: grab; touch-action: none; overflow: hidden; }
.map-stage:active { cursor: grabbing; }
.map-stage:focus-visible { outline-offset: -.25rem; }
canvas, .markers { pointer-events: none; }
.marker {
  position: absolute;
  display: grid;
  justify-items: center;
  place-content: start center;
  min-width: var(--touch);
  min-height: var(--touch);
  width: max-content;
  max-width: 10rem;
  padding: 0;
  border: 0;
  background: none;
  translate: -50% -73%;
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
}
.marker.group { translate: -50% -75%; }
.marker .art, .list-art {
  width: 3.3rem;
  height: 3.3rem;
  display: block;
  background-image: url('crayon-landmarks.webp');
  background-size: 300% 200%;
  filter: drop-shadow(0 .1rem .06rem #30241140);
}
.art[data-art=eat], .list-art[data-art=eat] { background-position: 0 0; }
.art[data-art=cafe], .list-art[data-art=cafe] { background-position: 50% 0; }
.art[data-art=shop], .list-art[data-art=shop] { background-position: 100% 0; }
.art[data-art=wheel], .list-art[data-art=wheel] { background-position: 0 100%; }
.art[data-art=light], .list-art[data-art=light] { background-position: 50% 100%; }
.art[data-art=market], .list-art[data-art=market] { background-position: 100% 100%; }
.group .art { width: 4.1rem; height: 4.1rem; }
.marker-label {
  display: block;
  position: relative;
  max-width: 100%;
  padding: .04rem .4rem .12rem;
  border: 1px solid #80674440;
  border-radius: .27rem;
  background: #fff5d9;
  font-size: .87rem;
  line-height: 1.22;
  font-weight: 840;
  word-break: keep-all;
  text-shadow: 0 1px #fff9;
  box-shadow: 0 .1rem 0 #946d4933;
}
.group .marker-label {
  background: var(--sun);
  border-color: #7959458c;
  border-radius: .55rem .32rem .46rem .28rem;
  font-size: .96rem;
}
.group[data-district=north] .marker-label { background: #f7c8a8; }
.group[data-district=abai] .marker-label { background: #d7e3ba; }
.group[data-district=beach] .marker-label { background: #c2deeb; }
.marker.selected { z-index: 2; }
.marker.selected .marker-label { background: var(--accent); border-color: var(--accent); color: white; text-shadow: none; }
.marker.dot { width: var(--touch); height: var(--touch); translate: -50% -50%; place-content: center; }
.marker.dot .art { display: none; }
.marker.dot .marker-label {
  width: .8rem; height: .8rem; font-size: 0; border-radius: 50%; border: .13rem solid white;
  background: var(--accent); box-shadow: 0 0 0 1px #493628a0; padding: 0;
}
.marker:hover .marker-label { outline: 1px solid var(--accent); }
.map-tools { position: absolute; z-index: 3; top: .6rem; right: .6rem; display: grid; gap: .45rem; }
.map-tools button, .orient-tools button {
  border: 1px solid var(--line);
  background: var(--panel);
  min-width: var(--touch);
  min-height: var(--touch);
  border-radius: .65rem;
  box-shadow: 0 .1rem .35rem #2b40392b;
  font-weight: 760;
}
.map-tools button { font-size: 1.45rem; line-height: 1; padding: 0; }
.map-tools .compass { display: grid; justify-items: center; gap: .1rem; line-height: 1; }
#needle { display: block; color: var(--accent); font-size: 1.1rem; }
.compass small { font-size: .66rem; }
.zoom-tools { display: grid; gap: .18rem; }
.orient-tools { position: absolute; z-index: 3; right: .6rem; bottom: 2.15rem; display: flex; gap: .4rem; }
.orient-tools button { font-size: .88rem; padding: .2rem .6rem; white-space: nowrap; }
.orient-tools button[aria-pressed=true] { background: #dbe9cd; border-color: #687b5f; }
.orient-tools span { font-size: 1.05rem; line-height: 1; }
.map-message {
  position: absolute; pointer-events: none; inset: auto .6rem .52rem; z-index: 3; width: fit-content;
  padding: .15rem .5rem; max-width: calc(100% - 1.2rem);
  color: var(--ink); background: #fff9ebf2; border-radius: .3rem; font-size: .78rem; font-weight: 680;
}
.scale { position: absolute; pointer-events: none; bottom: 2.35rem; left: .7rem; min-width: 2rem; text-align: center; border: solid var(--ink); border-width: 0 1px 2px; font-size: .73rem; font-weight: 750; background: #fff9ebd9; }
.credits { display: flex; flex-wrap: wrap; gap: 0 .75rem; justify-content: space-between; margin-top: .25rem; font-size: .75rem; color: var(--muted); }

.places-panel { min-width: 0; border: 1px solid var(--line); border-radius: .9rem; background: var(--panel); padding: .9rem; }
.list-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .25rem .5rem; margin-bottom: .45rem; }
.list-header h2 { font-size: 1.2rem; letter-spacing: -.025em; }
.list-header button { min-height: var(--touch); border: 0; background: transparent; font-size: .8rem; font-weight: 750; text-decoration: underline; padding: 0; }
.filters { margin-bottom: .55rem; }
.filters button { padding-inline: .47rem; }
#place-list { max-height: min(48svh, 34rem); overflow: auto; padding: .12rem .2rem .12rem .12rem; }
.list-place { width: 100%; min-height: var(--touch); display: flex; align-items: center; gap: .6rem; text-align: left; background: transparent; border: 0; border-bottom: 1px solid #ddd9bd; padding: .18rem .24rem; border-radius: .2rem; font-size: .91rem; font-weight: 750; }
.list-place:last-child { border-bottom: 0; }
.list-place:hover, .list-place[aria-pressed=true] { background: #efe6ca; }
.list-art { width: 2rem; height: 2rem; flex: 0 0 2rem; }
.list-place small { margin-left: auto; font-size: .74rem; color: var(--muted); }
.list-links { display: flex; flex-wrap: wrap; gap: 0 .7rem; font-size: .84rem; font-weight: 670; }
.list-links a { display: inline-flex; align-items: center; min-height: var(--touch); }
.detail { position: relative; background: #f7e7bd; border: 1px solid #d9c596; padding: .75rem .7rem .7rem; margin-bottom: .75rem; border-radius: .7rem; }
.detail h2 { font-size: 1.22rem; padding-right: 2rem; line-height: 1.22; }
.detail-kind, .detail-address { color: var(--muted); font-size: .8rem; }
.detail-kind { font-weight: 750; margin-bottom: .15rem; }
.detail #detail-desc { margin-top: .38rem; font-size: .9rem; }
.detail-address { margin-top: .22rem; }
.detail .close { position: absolute; right: .12rem; top: .12rem; width: var(--touch); height: var(--touch); font-size: 1.35rem; border: 0; background: transparent; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 0 .55rem; align-items: center; margin-top: .35rem; }
.detail-actions button, .detail-actions a { min-height: var(--touch); display: inline-flex; align-items: center; font-size: .82rem; font-weight: 750; }
.detail-actions button { border: 1px solid var(--ink); border-radius: .35rem; padding-inline: .5rem; background: var(--ink); color: var(--panel); }
.route-info:not(:empty) { margin-top: .38rem; font-size: .84rem; }
.map-frame[data-dragging=true] { cursor: grabbing; }

@media (max-width: 53rem) {
  .layout { display: block; }
  .places-panel { margin-top: .55rem; }
  .map-frame { height: max(24rem, min(62svh, 40rem)); }
}
@media (max-width: 33rem) {
  .top, .layout { width: calc(100% - 1.1rem); }
  .top { min-height: 3.5rem; gap: .3rem; }
  .top a { font-size: .78rem; }
  .areas { justify-content: space-between; gap: .2rem; }
  .areas button { padding-inline: .43rem; font-size: .79rem; }
  .places-panel { padding: .6rem; }
  .map-frame { border-radius: .7rem; }
  .group .art { width: 3.5rem; height: 3.5rem; }
  .group .marker-label { font-size: .87rem; }
}
