:root {
  color-scheme: dark;
  font: 14px/1.45 "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --text: #f7faf7;
  --muted: #d2ddd6;
  --mint: #c2efd4;
  --active-ink: #133a2d;
  --rim: rgba(238, 251, 244, .25);
  --inset: rgba(255, 255, 255, .09);
  --shadow: 0 4px 18px #0c1b173e, inset 0 1px 0 #ffffff0d;
  --left: max(18px, env(safe-area-inset-left));
  --right: max(18px, env(safe-area-inset-right));
  --top: max(18px, env(safe-area-inset-top));
  --bottom: max(10px, env(safe-area-inset-bottom));
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
/* 화면 전체 확대(두 번 탭·핀치)와 당겨서 새로고침을 막는다. 지도 확대는 캔버스가 직접 처리한다. */
html, body { touch-action: manipulation; overscroll-behavior: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { color: var(--text); background: #263a36; }
#viewport { position: relative; width: 100%; height: 100%; height: 100dvh; isolation: isolate; overflow: hidden; }
canvas { display: block; width: 100%; height: 100%; outline: 0; touch-action: none; cursor: grab; }
canvas:active { cursor: grabbing; }
button, select { font: inherit; color: inherit; cursor: pointer; }
button { border: 0; background: transparent; }
select { appearance: none; border: 0; background: transparent; }
select option { background: #273b35; color: var(--text); }
button:disabled, select:disabled, input:disabled { opacity: .55; cursor: wait; }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid #d9ffe8; outline-offset: 2px; }
a { color: inherit; }
h1, h2, p { margin: 0; }
.glass, .pin {
  background: #253831ef;
  border: 1px solid var(--rim);
  box-shadow: var(--shadow);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .pin {
    background: linear-gradient(145deg, #30443bb8, #13261eac);
    -webkit-backdrop-filter: blur(17px) saturate(128%);
    backdrop-filter: blur(17px) saturate(128%);
  }
  .pin { -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); }
  #info.glass, dialog.glass { background: linear-gradient(145deg, #30453bd6, #16291fce); }
}
[data-hud] { position: absolute; z-index: 3; }
.places {
  top: var(--top); left: var(--left); width: clamp(230px, 29vw, 334px);
  padding: 7px 11px; display: flex; align-items: center; gap: 10px; border-radius: 16px;
}
.city-mark {
  display: flex; justify-content: center; align-items: flex-end; gap: 2px;
  height: 32px; width: 32px; flex: 0 0 auto; padding: 7px 4px;
  border: 1px solid #d1e9d84d; background: #b9ecce1a; border-radius: 9px;
}
.city-mark i { width: 3px; height: 9px; border-radius: 1px; background: var(--mint); }
.city-mark i:nth-child(2) { height: 17px; }
.city-mark i:nth-child(3) { height: 12px; }
.place-field { min-width: 0; flex: 1; }
.place-field h1 { font-size: 10px; letter-spacing: .035em; color: var(--muted); font-weight: 600; }
.place-field select { width: 100%; text-overflow: ellipsis; font-weight: 720; font-size: 15px; padding: 1px 21px 1px 0; }
.place-field, .resolution { position: relative; }
.place-field::after, .resolution::after {
  content: ""; position: absolute; right: 3px; top: 50%; width: 5px; height: 5px;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.conditions, .lighting { top: var(--top); padding: 4px; border-radius: 16px; }
.conditions { right: calc(var(--right) + 198px); width: 199px; }
.lighting { right: var(--right); width: 190px; }
.conditions .segment button, .lighting .segment button { flex: 1; }
.segment, .mode-dock { display: flex; align-items: center; gap: 2px; }
.segment button, .mode-dock button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  white-space: nowrap; padding: 0 14px; height: 35px; font-size: 13px; font-weight: 650; border-radius: 11px;
}
.segment button[aria-pressed=true], .mode-dock button[aria-pressed=true] { background: var(--mint); color: var(--active-ink); }
button:hover:not(:disabled):not([aria-pressed=true]) { background-color: #f2fff01b; }
.time-field { display: flex; align-items: center; gap: 9px; padding: 2px 7px 0; }
#clock, #month-label { font: 600 12px/1.4 ui-monospace, monospace; color: var(--text); font-variant-numeric: tabular-nums; }
.time-field input {
  appearance: none; -webkit-appearance: none; flex: 1; min-width: 0; margin: 0; height: 28px;
  border-radius: 8px; cursor: pointer; touch-action: pan-y;
  background: linear-gradient(to right, #697694, #f0b28c 25%, #dae9d2 50%, #edab79 75%, #697694)
    center / calc(100% - 12px) 4px no-repeat;
}
.time-field input::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #effff5; border: 2px solid #436052; }
.time-field input::-moz-range-thumb { box-sizing: border-box; width: 14px; height: 14px; border-radius: 50%; background: #effff5; border: 2px solid #436052; }
.tools { right: var(--right); bottom: calc(var(--bottom) + 48px); border-radius: 14px; overflow: hidden; display: grid; }
.tools button { display: grid; place-items: center; height: 38px; width: 40px; padding: 0; font: 22px/1 system-ui; }
.tools button + button { border-top: 1px solid var(--inset); }
#hud-toggle .eye-closed, #hud-toggle[aria-pressed=true] .eye-open { display: none; }
#hud-toggle[aria-pressed=true] .eye-closed { display: block; }
/* 화면 정보 숨기기: 지도, OSM 출처 표기와 되돌리기 버튼만 남긴다. */
:root[data-hud-off] :is([data-hud]:not(.tools, .map-meta), #info, #pins) { display: none !important; }
:root[data-hud-off] .tools > :not(#hud-toggle) { display: none !important; }
.fit-icon { width: 15px; height: 15px; background:
  linear-gradient(currentColor,currentColor) left top/6px 2px, linear-gradient(currentColor,currentColor) left top/2px 6px,
  linear-gradient(currentColor,currentColor) right top/6px 2px, linear-gradient(currentColor,currentColor) right top/2px 6px,
  linear-gradient(currentColor,currentColor) left bottom/6px 2px, linear-gradient(currentColor,currentColor) left bottom/2px 6px,
  linear-gradient(currentColor,currentColor) right bottom/6px 2px, linear-gradient(currentColor,currentColor) right bottom/2px 6px;
  background-repeat: no-repeat;
}
.mode-dock {
  left: 50%; bottom: calc(var(--bottom) + 11px); transform: translateX(-50%);
  padding: 4px; border-radius: 22px;
}
.mode-dock button { min-width: 80px; height: 38px; font-size: 14px; border-radius: 17px; }
.orbit-symbol { display: inline-block; width: 16px; height: 11px; border: 1.5px solid; border-radius: 50%; transform: rotate(-28deg); position: relative; }
.orbit-symbol::after { content: ""; position: absolute; inset: 2px 4.5px; border-radius: 50%; background: currentColor; }
.foot-symbol { height: 17px; width: 14px; position: relative; display: inline-block; }
.foot-symbol::before, .foot-symbol::after {
  content: ""; position: absolute; width: 4px; height: 7px; left: 2px; top: 6px; border-radius: 65% 55% 45% 40%;
  background: currentColor; box-shadow: 0 3px 0 -1px currentColor; transform: rotate(-14deg);
}
.foot-symbol::after { left: 8px; top: 1px; transform: rotate(16deg); }
#walk-hint, #walk-status {
  left: 50%; bottom: calc(var(--bottom) + 68px); transform: translateX(-50%); width: max-content;
  max-width: calc(100% - 24px); padding: 6px 12px; border-radius: 14px; font-size: 12px; text-align: center;
}
#walk-status { z-index: 5; }
.touch-hint { display: none; }
kbd { font: 600 10px/1.4 ui-monospace, monospace; border: 1px solid var(--rim); border-radius: 4px; padding: 1px 3px; }
#info {
  left: var(--left); bottom: calc(var(--bottom) + 43px); width: min(345px, calc(100% - 105px));
  padding: 16px 18px; border-radius: 17px;
}
#eyebrow { color: var(--mint); font-size: 11px; font-weight: 620; padding-right: 24px; }
#name { font-size: 21px; letter-spacing: -.045em; margin: 4px 20px 5px 0; }
#description { font-size: 13px; color: #eef4f0; line-height: 1.5; }
#source-note { display: block; color: var(--muted); font-size: 11px; margin: 7px 0 11px; }
#detail-view, #retry {
  padding: 5px 12px; border-radius: 8px; color: var(--mint); background: var(--inset);
  border: 1px solid #c8edd24f; font-weight: 650; font-size: 12px;
}
#fallback { position: absolute; inset: 0; z-index: 8; display: grid; place-items: end center; padding: var(--top) var(--right) var(--bottom) var(--left); background: #1d2c27; }
#fallback > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fallback-card { position: relative; width: min(440px, 100%); margin-bottom: 8px; padding: 18px 20px; border-radius: 18px; display: grid; gap: 9px; }
.fallback-card h2 { font-size: 17px; letter-spacing: -.02em; }
.fallback-card p { color: var(--muted); font-size: 13px; line-height: 1.55; }
.fallback-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.fallback-actions a, .fallback-actions button { padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; text-decoration: none; color: var(--active-ink); background: var(--mint); }
.fallback-actions button { color: var(--mint); background: var(--inset); border: 1px solid #c8edd24f; }
#fallback-url { width: 100%; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--rim); background: #0f1d1866; color: var(--muted); font: 12px/1.4 ui-monospace, monospace; }
.close { font: 22px/1 system-ui; width: 34px; height: 34px; border-radius: 50%; }
#dismiss-info { position: absolute; right: 6px; top: 6px; }
.map-meta, .resolution {
  bottom: var(--bottom); border-radius: 9px; display: flex; align-items: center; gap: 8px;
  padding: 3px 8px; font-size: 10px; color: #e2eae5; white-space: nowrap;
}
.map-meta { left: var(--left); }
.map-meta a { text-decoration: none; }
.map-meta button { font-size: inherit; padding: 0 0 0 8px; border-left: 1px solid var(--rim); }
.map-meta a:hover, .map-meta button:hover { text-decoration: underline; }
.resolution { position: absolute; right: var(--right); gap: 6px; }
.resolution select { font-size: inherit; padding: 2px 11px 2px 0; }
.resolution::after { right: 8px; width: 4px; height: 4px; }
#pins { position: absolute; inset: 0; pointer-events: none; }
.pin {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); pointer-events: auto;
  white-space: nowrap; font-size: 11px; font-weight: 650; color: #f6fff8; border-radius: 7px; padding: 3px 7px;
}
.pin.active { color: var(--active-ink); background: var(--mint); border-color: #dffdeb; }
.pin::after {
  content: ""; position: absolute; top: 100%; left: calc(50% + var(--stem-x, 0px));
  height: var(--stem, 6px); border-left: 1px solid #f5ffefb8; filter: drop-shadow(0 1px 1px #26352d);
}
.pin.below::after { top: auto; bottom: 100%; }
#walk-pad {
  display: none; left: calc(var(--left) + 4px); bottom: calc(var(--bottom) + 76px);
  width: 98px; height: 98px; border-radius: 50%; touch-action: none; user-select: none; -webkit-user-select: none;
}
.thumb { position: absolute; width: 38%; height: 38%; top: 31%; left: 31%; border-radius: 50%; background: #dbf4e6bd; border: 1px solid #effff5bf; box-shadow: 0 3px 9px #162b2238; pointer-events: none; }
.pad-arrows { position: absolute; inset: 0; pointer-events: none; }
.pad-arrows i { position: absolute; left: calc(50% - 3px); top: 10%; width: 6px; height: 6px; border: solid #deeee2bb; border-width: 1.5px 0 0 1.5px; transform: rotate(45deg); }
.pad-arrows i:nth-child(2) { left: auto; top: calc(50% - 3px); right: 10%; transform: rotate(135deg); }
.pad-arrows i:nth-child(3) { top: auto; bottom: 10%; transform: rotate(225deg); }
.pad-arrows i:nth-child(4) { left: 10%; top: calc(50% - 3px); transform: rotate(-45deg); }
#load { position: absolute; z-index: 5; top: 50%; left: 50%; transform: translate(-50%,-50%); width: max-content; max-width: min(340px,90%); display: grid; justify-items: center; text-align: center; gap: 8px; padding: 20px 26px; border-radius: 18px; }
#load strong { font-size: 19px; } #load p { color: var(--muted); }
progress { width: 130px; height: 4px; accent-color: var(--mint); }
dialog.glass { max-width: min(510px,calc(100% - 30px)); max-height: min(760px,80dvh); padding: 18px 21px; border-radius: 20px; color: var(--text); overflow: auto; }
dialog::backdrop { background: #0b181a66; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
dialog h2 { font-size: 22px; } dialog li, dialog p { line-height: 1.65; } dialog ul { padding-left: 18px; } dialog li + li { margin-top: 8px; }
dialog a { color: var(--mint); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }
@media (any-pointer: coarse) {
  #walk-pad:not([hidden]) { display: block; }
  .tools button { width: 43px; height: 43px; }
}
@media (pointer: coarse) {
  .touch-hint { display: inline; } .keyboard-hint { display: none; }
}
@media (max-width: 700px) {
  :root { --left: max(9px,env(safe-area-inset-left)); --right: max(9px,env(safe-area-inset-right)); --top: max(10px,env(safe-area-inset-top)); --bottom: max(7px,env(safe-area-inset-bottom)); }
  .places { width: min(222px, calc(100% - 131px)); padding: 6px 8px; gap: 7px; border-radius: 13px; }
  .city-mark { width: 25px; height: 30px; padding: 6px 2px; }
  .place-field select { font-size: 13px; padding-right: 11px; } .place-field h1 { font-size: 9px; }
  .conditions { left: var(--left); right: auto; top: calc(var(--top) + 52px); width: min(192px, calc(50% - 13px)); border-radius: 13px; }
  .lighting { top: calc(var(--top) + 52px); width: min(180px, calc(50% - 13px)); border-radius: 13px; }
  .segment button { height: 35px; padding: 0 7px; font-size: 12px; }
  .mode-dock { bottom: calc(var(--bottom) + 34px); }
  .mode-dock button { min-width: 70px; height: 38px; }
  #walk-hint, #walk-status { bottom: auto; top: calc(var(--top) + 133px); }
  #info { bottom: calc(var(--bottom) + 92px); width: min(330px, calc(100% - 70px)); padding: 12px 14px; }
  #name { font-size: 18px; } #description { font-size: 12px; }
  .tools { bottom: calc(var(--bottom) + 35px); }
  .pin { font-size: 10px; padding: 2px 5px; }
}
@media (max-height: 470px) {
  /* 가로 휴대폰: 이동 버튼과 보기 버튼을 두 열로 나눈다. */
  .tools { grid-auto-flow: column; grid-template-rows: repeat(4, auto); }
  .tools button:nth-child(4n+1) { border-top: 0; }
  .tools button:nth-child(n+5) { border-left: 1px solid var(--inset); }
  #info { top: calc(var(--top) + 59px); bottom: auto; width: min(345px, calc(100% - 211px)); max-height: calc(100dvh - var(--top) - 102px); overflow: auto; }
  #walk-pad { width: 80px; height: 80px; bottom: calc(var(--bottom) + 36px); }
  #walk-hint { display: none; }
}
@media (max-width: 700px) {
  #walk-pad { bottom: calc(var(--bottom) + 92px); }
}
@media (prefers-reduced-transparency: reduce) {
  .glass, .pin, #info.glass, dialog.glass { background: #253831; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .pin.active { background: var(--mint); }
  dialog::backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

#project-month { background-image: linear-gradient(to right, #73978d, #cce2cc); }
/* 재생 중인 목표 버튼 아래쪽에 진행 막대를 채운다. */
#epoch[data-playing] .segment button[aria-pressed=true] {
  background: linear-gradient(var(--active-ink), var(--active-ink)) 10px calc(100% - 5px) / calc(var(--play, 0) * (100% - 20px)) 2px no-repeat,
    var(--mint);
}
#month-label { white-space: nowrap; }
#site-schedule { border-top: 1px solid var(--rim); padding-top: 7px; margin-top: 8px; font-size: 12px; line-height: 1.5; }
#site-schedule summary, #schedule-directory summary { color: var(--mint); cursor: pointer; font-weight: 650; }
#schedule-basis { margin: 6px 0; }
#schedule-links a, #schedule-list a { color: var(--mint); margin-right: .7em; }
#schedule-directory { margin: 12px 0; }
#schedule-list li { margin-bottom: 10px; }
#schedule-list li p { margin: 3px 0; }
#info { overflow-y: auto; max-height: min(56vh, 510px); }
#schedule-directory a, #site-schedule a { text-underline-offset: .17em; }
