@font-face {
  font-family: 'Chosunilbo Myungjo';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_one@1.0/Chosunilbo_myungjo.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root {
  --paper: #FFFFFF;
  --ink: #121212;
  --ink-2: #333333;
  --muted: #5F5F5F;
  --faint: #767676;
  --rule: #E2E2E2;
  --rule-strong: #C4C4C4;
  --hover: #F4F4F4;
  --press: #000000;
  --red: #C42B1C;
  --teal: #0B8A73;
  --blue: #1D6FD8;
  --warning: #9A5B00;
  --selection: #FDD49E;
  --picked: #FFF7EC;
  --bar: #D6D6D6;
  --bar-hover: #A8A8A8;
  --bin: #1B2A4A;
  --no-data: #E6E6E6;
  --excluded: #FAFAFA;
  --hatch-line: #9A9A9A;
  --hatch-back: #F4F4F4;
  --map-outline: #5F5F5F;
  --overlay-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --chip: #FFFFFF;
  --veil: rgba(244, 244, 244, 0.72);
  --chip-hover: #F4F4F4;
  --chip-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  --popover-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  --glass: rgba(255, 255, 255, 0.62);
  --glass-hover: rgba(240, 240, 240, 0.8);
  --glass-edge: rgba(0, 0, 0, 0.08);
  --glass-shine: rgba(255, 255, 255, 0.8);
  --glass-shadow: 0 20px 50px rgba(0, 0, 0, 0.14);
  --glass-shadow-small: 0 6px 16px rgba(0, 0, 0, 0.12);
  --glass-blur: blur(30px) saturate(180%);
  --panel-w: 380px;
  --panel-gap: 16px;
  --serif: 'Source Serif 4', Georgia, serif;
  --sans: 'Libre Franklin', 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --paper: #201F1F;
  --ink: #EDEDED;
  --ink-2: #CFCFCF;
  --muted: #A3A3A3;
  --faint: #8C8C8C;
  --rule: #343333;
  --rule-strong: #4A4A4A;
  --hover: #2B2A2A;
  --press: #FFFFFF;
  --red: #FF6F61;
  --teal: #2FC7A8;
  --blue: #6AA5FF;
  --warning: #F2A65A;
  --selection: #7F2704;
  --picked: #2A1D12;
  --bar: #403F3F;
  --bar-hover: #5C5C5C;
  --bin: #D8E2F2;
  --no-data: #302F2F;
  --excluded: #252424;
  --hatch-line: #5C5C5C;
  --hatch-back: #272626;
  --map-outline: #8C8C8C;
  --overlay-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  --chip: #2E2D2D;
  --veil: rgba(32, 31, 31, 0.72);
  --chip-hover: #3A3939;
  --chip-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  --popover-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  --glass: rgba(32, 31, 31, 0.55);
  --glass-hover: rgba(64, 63, 63, 0.7);
  --glass-edge: rgba(255, 255, 255, 0.2);
  --glass-shine: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  --glass-shadow-small: 0 8px 20px rgba(0, 0, 0, 0.22);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 22px;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--selection); color: var(--ink); }
button, input { font-family: inherit; color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--red); }
h1, h2 { margin: 0; }
[hidden] { display: none !important; }
svg path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

#loading {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--veil);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--ink);
  font-size: 15px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 480ms ease, visibility 0s linear 480ms;
}
.loading #loading { opacity: 1; visibility: visible; pointer-events: auto; transition: none; }
#loading.loading-failed { color: var(--muted); }
.loading-logo { overflow: visible; }
.loading-letter { transform-box: fill-box; animation: letter-jump 1100ms cubic-bezier(0.3, 0, 0.3, 1) infinite; }
.loading-letter:nth-child(2) { animation-delay: 90ms; }
.loading-letter:nth-child(3) { animation-delay: 180ms; }
.loading-letter:nth-child(4) { animation-delay: 270ms; }
.loading-letter:nth-child(5) { animation-delay: 360ms; }
@keyframes letter-jump {
  0%, 50%, 100% { transform: translateY(0); }
  22% { transform: translateY(-5px); }
}
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ---------- top actions and about ---------- */

.top-actions {
  position: fixed;
  top: 18px;
  right: 24px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 4px;
}
html:lang(ko) {
  --sans: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', sans-serif;
  --serif: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', sans-serif;
}
html:lang(ko) body { word-break: keep-all; }
html:lang(ko) .headline { font-family: 'Chosunilbo Myungjo', 'Pretendard Variable', Pretendard, serif; font-weight: 400; font-synthesis: none; letter-spacing: -0.02em; }
html:lang(ko) .row-a, html:lang(ko) .row-b { white-space: nowrap; }
.lang-toggle {
  position: relative;
  width: 36px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: hidden;
  cursor: pointer;
}
.lang-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateX(-100%);
}
.lang-face.is-on { opacity: 1; transform: none; }
.lang-face.enter { animation: lang-enter 280ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.lang-face.leave { animation: lang-leave 280ms cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes lang-enter { from { opacity: 0; transform: translateX(-100%); } to { opacity: 1; transform: none; } }
@keyframes lang-leave { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(100%); } }
.lang-toggle:hover .lang-face.is-on { color: var(--red); }
.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.wordmark-button { width: auto; padding: 0 8px; border-radius: 4px; }
.wordmark-button svg { transition: opacity 160ms ease; }
.wordmark-button:hover svg, .wordmark-button[aria-expanded='true'] svg { opacity: 0.6; }
.theme-button svg circle { fill: none; stroke: currentColor; stroke-width: 1.6; }
.theme-button .theme-moon path { fill: currentColor; }
.theme-button .theme-moon, :root[data-theme='dark'] .theme-button .theme-sun { display: none; }
:root[data-theme='dark'] .theme-button .theme-moon { display: block; }
@media (prefers-reduced-motion: reduce) {
  .wordmark-button svg, .about-sources summary::before, #about-close svg { transition: none; }
  .food-label-text.pop, .loading-letter, .lang-face.enter, .lang-face.leave { animation: none; }
}

.about {
  position: fixed;
  top: 70px;
  right: 24px;
  z-index: 41;
  width: 560px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 94px);
  max-height: calc(100dvh - 94px);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  box-shadow: var(--popover-shadow);
  animation: about-in 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
#about-close { border: 0; background: transparent; }
#about-close:hover { background: transparent; }
#about-close svg { transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1); }
#about-close:hover svg, #about-close:focus-visible svg { transform: scale(1.3); }
.about::before {
  content: '';
  position: absolute;
  top: -20px;
  right: 0;
  width: 136px;
  height: 20px;
}
@keyframes about-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.about-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 12px 0 24px; }
.about-brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--ink); }
.about-lockup { display: flex; align-items: flex-end; gap: 10px; min-width: 0; }
.about-lockup svg { flex: none; display: block; }
.about-lockup .about-slogan { flex: 0 1 auto; max-width: 100%; height: auto; margin-bottom: -1px; }
.about-body h2 { margin: 12px 0 0; font-family: var(--serif); font-size: 22px; line-height: 28px; font-weight: 700; color: var(--ink); }
.about-body { overflow-y: auto; padding: 4px 24px 18px; font-size: 14px; line-height: 21px; color: var(--ink-2); }
.about-body em, .about-body strong { color: var(--ink); font-style: normal; font-weight: 600; }
.about-sources { margin-top: 14px; border-top: 1px solid var(--rule); }
.about-sources summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  list-style: none;
  cursor: pointer;
}
.about-sources summary::-webkit-details-marker { display: none; }
.about-sources summary::before {
  content: '';
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 160ms ease;
}
.about-sources[open] summary::before { transform: rotate(45deg); }
.about-sources summary:hover { color: var(--ink); }
.about-sources .credits { margin: 6px 0 0; }
.credits { font-size: 12px; line-height: 18px; color: var(--muted); }
.about-team { margin-top: 12px; font-size: 12px; line-height: 17px; color: var(--ink-2); }
.about-school { margin: 0; color: var(--ink); font-weight: 600; }
.about-people { margin: 8px 0 0; padding: 0; list-style: none; }
.about-people strong { color: var(--ink); font-weight: 600; }
.about-people strong::after { content: ' · '; color: var(--faint); font-weight: 400; }
.about-people a { color: var(--muted); overflow-wrap: anywhere; text-decoration: none; }
.about-people a:hover { color: var(--red); text-decoration: underline; }

/* ---------- story ---------- */

.story {
  flex: none;
  max-width: 1120px;
  padding: 26px 200px 0 40px;
}
.headline {
  font-family: var(--serif);
  font-size: 40px;
  line-height: 46px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.headline .nowrap { white-space: nowrap; }
.dek { margin: 10px 0 0; max-width: 72ch; font-size: 18px; line-height: 27px; color: var(--ink-2); text-wrap: pretty; }

/* ---------- view tabs ---------- */

.views {
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 14px 40px 0;
  border-bottom: 1px solid var(--rule);
}
.preset-tabs { flex: 1; display: flex; gap: 28px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.preset-tabs::-webkit-scrollbar { display: none; }
.preset-tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  margin-bottom: -1px;
  padding: 0;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.preset-tab:hover { color: var(--ink); }
.tab-icon { flex: none; }
.preset-tab[aria-selected='true'] { color: var(--ink); border-bottom-color: var(--ink); }
.custom-view .preset-tab[aria-selected='true'] { border-bottom-color: var(--rule-strong); }
.configuration-button {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  margin-right: -11px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.configuration-button svg circle { fill: none; stroke: currentColor; stroke-width: 1.6; }
.configuration-button:hover, .configuration-button[aria-expanded='true'] { color: var(--red); }

/* ---------- stage ---------- */

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: 12px;
}
.maparea { position: absolute; inset: 0; overflow: hidden; }
#map { position: absolute; inset: 0; }

.side {
  position: absolute;
  z-index: 5;
  top: var(--panel-gap);
  right: var(--panel-gap);
  bottom: var(--panel-gap);
  width: var(--panel-w);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px 18px;
  border: 1px solid var(--glass-edge);
  border-radius: 22px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-shine);
  scrollbar-width: thin;
  scrollbar-color: var(--rule-strong) transparent;
}
.side-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--ink); }
.side-title { font-size: 14px; line-height: 20px; font-weight: 700; }
.side-value { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover { background: var(--press); }
.btn-primary svg path { fill: currentColor; stroke: none; }
.btn-block { width: 100%; }
.btn-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  background: var(--paper);
  font-size: 18px;
  cursor: pointer;
}
.btn-icon:hover { background: var(--hover); }

/* ---------- control ---------- */

.knob-note { margin: 10px 0 0; font-size: 14px; line-height: 21px; color: var(--ink-2); }

.walk-chart { display: block; width: 100%; height: 84px; margin-top: 12px; }
.walk-chart .area { fill: #FDBB84; fill-opacity: 0.35; }
.walk-chart .curve { fill: none; stroke: var(--red); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.walk-chart .grid { stroke: var(--rule); stroke-width: 1; }
.walk-chart .base { stroke: var(--rule-strong); stroke-width: 1; }
.walk-chart .mark-line { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 2; }
.walk-chart .mark { fill: var(--paper); stroke: var(--ink); stroke-width: 2; }

.steps { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); margin-top: 6px; border: 1px solid var(--rule-strong); border-radius: 4px; overflow: hidden; }
.step {
  height: 44px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--rule);
  background: var(--paper);
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.step:first-child { border-left: 0; }
.step:hover { background: var(--hover); }
.step[aria-pressed='true'] { background: var(--ink); color: var(--paper); }
.scale-labels { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; line-height: 16px; color: var(--faint); }

.hours { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 2px; height: 84px; margin-top: 12px; align-items: end; }
.hour { display: flex; align-items: flex-end; height: 84px; min-width: 0; padding: 0; border: 0; background: transparent; cursor: pointer; }
.hour span { display: block; width: 100%; background: var(--bar); }
.hour:hover span { background: var(--bar-hover); }
.hour[aria-pressed='true'] span { background: var(--red); }
.hour-axis { display: flex; justify-content: space-between; margin-top: 4px; font-size: 12px; line-height: 14px; color: var(--faint); font-variant-numeric: tabular-nums; }
.play-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.play-note { flex: 1; min-width: 0; font-size: 12.5px; line-height: 17px; color: var(--muted); }

.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--rule-strong); border-radius: 4px; overflow: hidden; }
.segment {
  height: 44px;
  padding: 0 8px;
  border: 0;
  border-left: 1px solid var(--rule);
  background: var(--paper);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.segment:first-child { border-left: 0; }
.segment:hover { background: var(--hover); }
.segment[aria-checked='true'] { background: var(--ink); color: var(--paper); }
.segment:disabled { color: var(--faint); background: var(--paper); cursor: default; }
#knob-body > .segmented { margin-top: 12px; }

/* ---------- legend ---------- */

.legend-split { display: flex; margin-top: 12px; font-size: 12px; line-height: 16px; }
.legend-split .within { flex: 5; color: var(--ink-2); }
.legend-split .beyond { flex: 4; padding-left: 6px; color: var(--red); font-weight: 600; }
.legend-ramp { position: relative; display: flex; gap: 2px; margin-top: 4px; }
.legend-ramp .stop { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.legend-ramp .swatch { display: block; height: 12px; }
.legend-ramp .label { font-size: 11px; line-height: 14px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.legend-ramp .label-t { color: var(--ink); font-weight: 700; }
.legend-ramp .mark { position: absolute; top: -6px; width: 2px; height: 24px; margin-left: -1px; background: var(--ink); }
.legend-shape { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.legend-shape-label { font-size: 13px; font-weight: 600; white-space: nowrap; }
.legend-shape .segmented { flex: none; width: 210px; }
.segmented-small .segment { height: 36px; font-size: 13px; }
.legend-extras { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12.5px; line-height: 17px; color: var(--ink-2); }
.legend-extras .extra { display: flex; align-items: center; gap: 6px; }
.legend-extras .sw { flex: none; width: 14px; height: 10px; }
.sw-hatch { border: 1px solid var(--hatch-line); background: repeating-linear-gradient(-45deg, var(--hatch-line) 0 1.5px, var(--hatch-back) 1.5px 5px); }
.sw-empty { border: 1px solid var(--rule-strong); background: var(--excluded); }
.sw-height { border: 1px solid var(--rule-strong); background: linear-gradient(to top, #fc8d59 0 45%, transparent 45%); }
.sw-bump { border: 1px solid var(--rule-strong); background: radial-gradient(ellipse 50% 95% at 50% 100%, #fc8d59 0 68%, transparent 72%); }
.sw-dark { background: #7f0000; }
.sw-bin { width: 8px !important; height: 8px !important; margin: 0 3px; border-radius: 4px; background: var(--bin); box-shadow: 0 0 0 1.5px var(--paper), 0 0 0 2.5px var(--rule-strong); }
.sw-zone { border: 2px solid var(--teal); }
.sw-river { border: 2px solid var(--blue); }

/* ---------- list ---------- */

.list { display: flex; flex-direction: column; }
.list-head, .row-grid {
  display: grid;
  grid-template-columns: var(--cols, 22px minmax(0, 1fr) 72px 52px 56px);
  column-gap: 10px;
  align-items: center;
}
.list-head { align-items: end; padding: 0 0 8px; border-bottom: 1px solid var(--ink); font-size: 12px; line-height: 16px; color: var(--muted); }
.list-title { font-size: 14px; line-height: 20px; font-weight: 700; color: var(--ink); }
.num { text-align: right; }
.row {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.row:hover { background: var(--hover); }
.row[aria-pressed='true'] { background: var(--picked); }
.row .row-grid { min-height: 40px; }
.row-rank { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.row-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.row[aria-pressed='true'] .row-name span:last-child { font-weight: 700; }
.row-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--dot, var(--ink)); background: var(--dot, var(--ink)); }
.row-dot.hollow { background: transparent; }
#list-rows[data-preset='tourists'] { --dot: var(--teal); }
#list-rows[data-preset='river'] { --dot: var(--blue); }
.row-bar { display: block; height: 8px; background: var(--rule); }
.row-bar span { display: block; height: 100%; background: var(--red); }
.row-a { text-align: right; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.row-b { text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.row-detail { display: block; padding: 0 0 12px 32px; font-size: 13px; line-height: 19px; color: var(--ink-2); }
.row-warning { color: var(--warning); }
.list-note { margin: 10px 0 0; font-size: 12.5px; line-height: 18px; color: var(--muted); }
.recipe { margin: 0; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 12.5px; line-height: 18px; color: var(--muted); }

/* ---------- customize ---------- */

.custom {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}
.custom-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 0 0 12px; border-bottom: 1px solid var(--ink); }
.custom-title { font-size: 17px; line-height: 24px; font-weight: 700; }
.custom-base { font-size: 13px; color: var(--muted); }
.custom-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 0; display: flex; flex-direction: column; gap: 22px; }
.custom-footer { padding: 12px 0 0; border-top: 1px solid var(--rule); }
.field { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field legend { padding: 0 0 8px; font-size: 14px; font-weight: 700; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.dot-teal { background: var(--teal); }
.dot-blue { background: var(--blue); }
.dot-ink { background: var(--ink); }
.segmented-sub { margin: 0 0 6px 30px; }
.segmented-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.range-row { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.range-row input { flex: 1; min-width: 0; accent-color: var(--ink); height: 28px; }
.range-row output { flex: none; min-width: 108px; text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---------- map overlays ---------- */

.dong-card, .zoom-controls {
  position: absolute;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-edge);
  border-radius: 16px;
  box-shadow: var(--glass-shadow-small), inset 0 1px 0 var(--glass-shine);
}
.food-label { pointer-events: none; }
.food-label-text {
  position: relative;
  display: block;
  margin-bottom: 9px;
  padding: 6px 12px;
  border-radius: 16px;
  background: var(--ink);
  box-shadow: var(--chip-shadow);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  white-space: nowrap;
  transform-origin: 50% 100%;
}
.food-label-text::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: var(--ink);
  transform: translateX(-50%) rotate(45deg);
}
.food-label-text.pop { animation: food-pop 900ms cubic-bezier(0.2, 0.9, 0.3, 1) both; }
@keyframes food-pop {
  0% { opacity: 0; transform: scale(0.3); }
  55% { opacity: 1; transform: scale(1.3); }
  100% { opacity: 1; transform: scale(1); }
}
.area-chips {
  position: absolute;
  top: 10px;
  left: 10px;
  right: calc(var(--panel-w) + 2 * var(--panel-gap) - 2px);
  display: flex;
  gap: 6px;
  padding: 2px 24px 6px 2px;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}
.area-chips::-webkit-scrollbar { display: none; }
.area-chips[hidden] { display: none; }
.area-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px 0 9px;
  border: 1px solid var(--glass-edge);
  border-radius: 16px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow-small), inset 0 1px 0 var(--glass-shine);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.area-chip svg { flex: none; }
.area-chip svg path { stroke-width: 1.5; }
.area-chip:hover { background: var(--glass-hover); }
.area-chip[aria-pressed='true'] { border-color: var(--ink); background: var(--ink); color: var(--paper); }

.zoom-controls { right: calc(var(--panel-w) + 2 * var(--panel-gap)); bottom: 32px; display: flex; flex-direction: column; overflow: hidden; }
.btn-map { width: 44px; height: 44px; padding: 0; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.btn-map + .btn-map { border-top: 1px solid var(--rule); }
.btn-map:hover { background: var(--glass-hover); }
.btn-map .needle { fill: var(--red); stroke: var(--red); }

.dong-card { top: 12px; right: calc(var(--panel-w) + 2 * var(--panel-gap)); width: 312px; max-width: calc(100% - 24px); padding: 12px 14px 14px; }
.dong-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dong-card-head .btn-icon { width: 36px; height: 36px; border: 0; }
.dong-name { font-size: 15px; font-weight: 700; }
.dong-card .segmented { margin-top: 8px; }
#dong-hist svg { display: block; margin-top: 8px; }
#dong-hist .area-near { fill: #fdbb84; fill-opacity: 0.85; }
#dong-hist .area-far { fill: #d7301f; fill-opacity: 0.9; }
#dong-hist .curve { fill: none; stroke: var(--ink); stroke-width: 1.2; }
#dong-hist .bar-near { fill: #fdbb84; }
#dong-hist .bar-far { fill: #d7301f; }
#dong-hist .threshold-line { stroke: var(--ink); stroke-dasharray: 2 2; }
#dong-hist .axis text { fill: var(--muted); font-family: var(--sans); font-size: 10px; }
#dong-hist .axis path, #dong-hist .axis line { fill: none; stroke: var(--rule-strong); shape-rendering: crispEdges; }
.dong-note { margin-top: 2px; font-size: 12px; line-height: 16px; color: var(--muted); }
.dong-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; margin: 10px 0 0; }
.dong-stats dt { font-size: 12px; line-height: 16px; color: var(--muted); }
.dong-stats dd { margin: 2px 0 0; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

.maplibregl-ctrl-attrib { font-family: var(--sans); font-size: 11px; }
.maparea .maplibregl-ctrl-bottom-right { right: calc(var(--panel-w) + var(--panel-gap)); }
:root[data-theme='dark'] .maplibregl-ctrl.maplibregl-ctrl-attrib { background: rgba(18, 18, 18, 0.72); color: var(--muted); }
:root[data-theme='dark'] .maplibregl-ctrl-attrib a { color: var(--ink-2); }
:root[data-theme='dark'] .maplibregl-ctrl-attrib-button { filter: invert(1); }

/* ---------- small screens ---------- */

@media (max-width: 1100px) {
  :root { --panel-w: 340px; }
}

@media (max-width: 760px) {
  .app { height: auto; min-height: 100vh; overflow: visible; }
  .top-actions { position: absolute; top: 12px; right: 12px; }
  .about { top: 64px; right: 12px; max-width: calc(100vw - 24px); max-height: calc(100vh - 76px); max-height: calc(100dvh - 76px); }
  .about-head { padding: 12px 8px 0 18px; }
  .about-body { padding: 0 18px 12px; font-size: 13px; line-height: 18px; }
  .about-body h2 { margin-top: 10px; font-size: 20px; line-height: 25px; }
  .about-body p { margin: 8px 0 0; }
  .credits { font-size: 11px; line-height: 16px; }
  .about-team { margin-top: 10px; font-size: 11px; line-height: 15px; }
  .about-lockup { flex-direction: column; align-items: flex-start; gap: 6px; }
  .story { padding: 64px 16px 0; }
  .wordmark-button svg { width: 60px; height: 21px; }
  .headline { font-size: 28px; line-height: 34px; }
  .dek { font-size: 16px; line-height: 24px; }
  .views { margin: 12px 0 0; padding: 0 16px; }
  .preset-tabs { gap: 22px; }
  :root { --panel-w: 0px; --panel-gap: 6px; }
  .stage { display: flex; flex-direction: column; gap: 20px; margin-top: 0; padding: 12px 0 24px; }
  .maparea { position: relative; inset: auto; flex: none; height: 58vh; min-height: 360px; }
  .side { position: static; width: auto; overflow: visible; padding: 0 16px; border: 0; border-radius: 0; background: none;
    -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; gap: 24px; }
  .custom { position: fixed; inset: 0; z-index: 45; padding: 16px; }
  .dong-card { top: auto; bottom: 12px; left: 12px; right: 12px; width: auto; }
  .area-chip { height: 36px; border-radius: 18px; font-size: 14px; }
}
