/* 오사카 저장한 곳 — 토큰 (v4: 정보 밀도 상향) */
:root {
  color-scheme: light;
  --ground: #f3f2ef;   /* 지도 바탕과 같은 돌빛 중성색 */
  --surface: #ffffff;
  --raised: #f1f0ec;   /* 비선택 컨트롤, 선택 행 */
  --line: #e8e6e1;
  --control: #d2d0ca;
  --ink: #17191c;
  --ink2: #3d4148;     /* 메모 */
  --muted: #5b5f66;    /* 흰 바탕 6.3:1, raised 5.6:1 */
  --ph: #696c72;       /* 검색 안내 글자 raised 4.8:1 */
  --on-ink: #ffffff;   /* 잉크색으로 채운 버튼 위 글자 */
  --on-ink-soft: rgba(255, 255, 255, .8);
  --badge-bg: #e7ecf3; --badge-ink: #233a5c;
  --accent: #d4202f;   /* 미도스지선 빨강: 활성 탭 표시, ★ 에만 */
  --loc: #1a73e8;
  --r-ctl: 8px;
  --r-sheet: 14px;
  --tabh: 48px;
  --padx: 12px;
  --font: "Pretendard Variable", "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", "Malgun Gothic", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --shadow-float: 0 1px 2px rgba(23, 25, 28, .12), 0 4px 14px rgba(23, 25, 28, .10);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ground: #111214;
    --surface: #1a1b1e;
    --raised: #27292d;
    --line: #2e3035;
    --control: #4b4e55;
    --ink: #ededee;
    --ink2: #cdd0d5;
    --muted: #a5a9b0;  /* surface 7.4:1, raised 6.4:1 */
    --ph: #9a9ea6;
    --on-ink: #17191c;
    --on-ink-soft: rgba(23, 25, 28, .78);
    --badge-bg: #26354b; --badge-ink: #cfdcf0;
    --accent: #ff6b6b;
    --loc: #74aefc;
    --shadow-float: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .35);
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--ground); color: var(--ink);
  font: 400 15px/1.45 var(--font); word-break: keep-all; overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-s { width: 14px; height: 14px; }
.small { font-size: 12.5px; line-height: 1.5; color: var(--muted); margin: 0; }
small { font-size: 12px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- 공통 골격 ---------- */
#app { position: relative; height: 100vh; height: 100dvh; overflow: hidden; }
#mapwrap { background: var(--ground); overflow: hidden; }
#map { position: absolute; inset: 0; }
#panel { background: var(--surface); display: flex; flex-direction: column; min-height: 0; position: relative; }
#phead { flex: none; padding: 0 var(--padx); }
#pscroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
#app[data-tab="saved"] .view-sched, #app[data-tab="sched"] .view-saved { display: none !important; }

/* ---------- 모바일: 전체 화면 지도 + 하단 시트 + 하단 탭 ---------- */
#app[data-layout="mobile"] #brand { display: none; }
#app[data-layout="mobile"] #mapwrap { position: absolute; left: 0; right: 0; top: 0; bottom: calc(var(--tabh) + env(safe-area-inset-bottom)); }
#app[data-layout="mobile"] #panel {
  position: absolute; left: 0; right: 0; bottom: calc(var(--tabh) + env(safe-area-inset-bottom)); z-index: 5;
  height: var(--sh, 62%); border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  box-shadow: 0 -1px 0 rgba(23, 25, 28, .06), 0 -6px 20px rgba(23, 25, 28, .12);
  transition: height .24s var(--ease);
}
#app[data-layout="mobile"] #panel.drag { transition: none; }
#app[data-layout="mobile"] #phead { padding-top: 14px; }
/* 손잡이: 머리 위쪽 여백에 겹쳐 높이를 따로 먹지 않는다 */
#grip { position: absolute; left: 50%; top: 0; transform: translateX(-50%); z-index: 1; width: 96px; height: 16px; display: flex; align-items: center; justify-content: center; touch-action: none; cursor: grab; }
#grip span { width: 36px; height: 4px; border-radius: 2px; background: var(--control); }
#app[data-layout="desktop"] #grip { display: none; }
#app[data-layout="mobile"] #tabs {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; height: calc(var(--tabh) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: flex; background: var(--surface); box-shadow: 0 -1px 0 var(--line);
}
#app[data-layout="mobile"] #tabs button {
  flex: 1; border: 0; background: none; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--muted); position: relative;
}
#app[data-layout="mobile"] #tabs button[aria-current] { color: var(--ink); }
#app[data-layout="mobile"] #tabs button[aria-current]::after { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; border-radius: 0 0 2px 2px; background: var(--accent); }
#app[data-layout="mobile"] #tabs button[aria-current] .ic { color: var(--accent); fill: currentColor; stroke-width: 1.5; }
#app[data-layout="mobile"] .maplibregl-ctrl-bottom-right { display: none; }

/* ---------- 데스크탑(가로·펼친 폴드): 왼쪽 사이드바 + 오른쪽 전체 높이 지도 ---------- */
#app[data-layout="desktop"] {
  display: grid; grid-template-columns: clamp(340px, 38vw, 420px) 1fr; grid-template-rows: auto auto 1fr;
  grid-template-areas: "brand map" "tabs map" "panel map";
  background: var(--surface);
}
#app[data-layout="desktop"] #brand { grid-area: brand; padding: 12px var(--padx) 2px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
#brand h1 { margin: 0; font-size: 17px; line-height: 1.35; font-weight: 700; letter-spacing: 0; }
#brand p { margin: 0; font-size: 12.5px; color: var(--muted); }
#app[data-layout="desktop"] #tabs { grid-area: tabs; display: flex; gap: 18px; padding: 0 var(--padx); box-shadow: inset 0 -1px 0 var(--line); }
#app[data-layout="desktop"] #tabs button {
  border: 0; background: none; height: 40px; padding: 0 2px; display: flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: var(--muted); box-shadow: inset 0 0 0 transparent;
}
#app[data-layout="desktop"] #tabs button .ic { width: 16px; height: 16px; }
#app[data-layout="desktop"] #tabs button[aria-current] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
#app[data-layout="desktop"] #panel { grid-area: panel; padding-top: 10px; }
#app[data-layout="desktop"] #mapwrap { grid-area: map; position: relative; box-shadow: inset 1px 0 0 var(--line); }

/* ---------- 머리: 검색, 필터 한 줄, 상태 한 줄 ---------- */
.searchrow { display: flex; gap: 6px; align-items: center; }
.search {
  position: relative; flex: 1; min-width: 0; display: flex; align-items: center; height: 40px; padding: 0 2px 0 11px; gap: 7px;
  background: var(--raised); border-radius: 10px; color: var(--muted);
}
.search:focus-within { background: var(--surface); box-shadow: 0 0 0 1.5px var(--ink); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font-size: 16px; color: var(--ink); }
.search input::placeholder { color: var(--ph); font-size: 15px; }
.search input::-webkit-search-cancel-button { display: none; }
.iconbtn { width: 36px; height: 36px; border: 0; background: none; border-radius: 8px; display: grid; place-items: center; color: var(--muted); flex: none; }
.filterbtn { position: relative; width: 40px; height: 40px; border-radius: 10px; background: var(--raised); color: var(--ink); }
.filterbtn[aria-expanded="false"] { background: var(--surface); box-shadow: inset 0 0 0 1px var(--control); }
.filterbtn i { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--raised); }

.scroller {
  display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none;
  margin: 6px calc(-1 * var(--padx)) 0; padding: 0 var(--padx); scroll-padding: 0 var(--padx);
}
.scroller::-webkit-scrollbar { display: none; }
.vsep { flex: none; width: 1px; height: 20px; background: var(--control); margin: 0 3px; }

.chips { display: flex; gap: 6px; flex: none; }
.chip {
  flex: none; height: 32px; padding: 0 10px 0 5px; border: 0; border-radius: 16px; background: none;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--control);
}
.chip.plain { padding-left: 11px; }
.chip.scope { background: var(--raised); box-shadow: none; }
.chip .ic-s { margin-right: -1px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.chip[aria-pressed="true"] small { color: var(--on-ink-soft); }
.cdot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; }
.cdot .ic { width: 13px; height: 13px; stroke-width: 2.1; }

.day {
  flex: none; height: 32px; padding: 0 11px; border: 0; border-radius: 16px; background: none;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 13px; font-weight: 650;
  box-shadow: inset 0 0 0 1px var(--control);
}
.day small { font-weight: 500; }
.day[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.day[aria-pressed="true"] small { color: var(--on-ink-soft); }
.switch { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 32px; height: 20px; border-radius: 10px; background: var(--control); position: relative; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s var(--ease); }
.switch input:checked + .track { background: var(--ink); }
.switch input:checked + .track::after { transform: translateX(12px); background: var(--surface); }
.switch input:focus-visible + .track { outline: 2px solid var(--ink); outline-offset: 2px; }

.statusrow {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; margin: 4px calc(-1 * var(--padx)) 0;
  padding: 0 var(--padx) 2px; box-shadow: 0 1px 0 var(--line);
}
.status { margin: 0; flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.4; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status b { font-weight: 700; color: var(--ink); }
.selectwrap { position: relative; flex: none; display: inline-flex; align-items: center; }
.selectwrap select {
  -webkit-appearance: none; appearance: none; height: 28px; padding: 0 24px 0 10px; border: 0; border-radius: 14px;
  background: var(--raised); color: var(--ink); font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.selectwrap .ic { position: absolute; right: 7px; width: 12px; height: 12px; pointer-events: none; color: var(--muted); stroke-width: 2.2; }

/* ---------- 목록(카드): 접힘 한 장 ≈ 74px ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.row { position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 52px; right: 0; height: 1px; background: var(--line); }
.row.sel { background: var(--raised); }
.row.sel::before, .row.sel + .row::before { display: none; }
.row-main {
  display: grid; grid-template-columns: 30px 1fr; gap: 10px; width: 100%; padding: 9px var(--padx) 9px; border: 0; background: none; text-align: left;
}
.dot { width: 30px; height: 30px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; margin-top: 1px; }
.dot .ic { width: 16px; height: 16px; stroke-width: 2; }
.dot b { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.row-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.l1 { display: flex; align-items: center; gap: 6px; min-width: 0; padding-right: 78px; }
.name { min-width: 0; font-size: 15.5px; line-height: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta, .note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { font-size: 13px; line-height: 17.5px; color: var(--muted); }
.meta b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.meta .sep { margin: 0 4px; }
.note { font-size: 12.5px; line-height: 17.5px; color: var(--ink2); }
.row.sel .name { white-space: normal; }
.row.sel .meta { white-space: normal; }
.row.sel .note { white-space: normal; margin-top: 3px; line-height: 1.5; }
.badge { flex: none; display: inline-flex; align-items: center; height: 19px; padding: 0 6px; border-radius: 5px; background: var(--badge-bg); color: var(--badge-ink); font-size: 12px; font-weight: 650; }
.badge-soft { background: var(--raised); color: var(--muted); font-weight: 550; }
.row.sel .badge-soft { background: var(--surface); }
/* 같은 줄 오른쪽 아이콘 버튼: 보이는 원은 작게, 누르는 영역은 40×44 */
.acts { position: absolute; top: -3px; right: 2px; display: flex; }
.actbtn { width: 40px; height: 44px; border: 0; background: none; padding: 0; display: grid; place-items: center; color: var(--muted); text-decoration: none; border-radius: 10px; }
.actbtn .ic { width: 19px; height: 19px; }
.starbtn[aria-pressed="true"] { color: var(--accent); }
.starbtn[aria-pressed="true"] .ic { fill: currentColor; }
.more { padding: 0 var(--padx) 12px 52px; display: grid; gap: 10px; }
.detail { margin: 0; padding: 8px 0 0; display: grid; gap: 4px; font-size: 12.5px; line-height: 1.5; box-shadow: inset 0 1px 0 var(--line); }
.detail div { display: grid; grid-template-columns: 60px 1fr; gap: 8px; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; }
.gmaps {
  display: flex; align-items: center; justify-content: center; gap: 6px; height: 44px; border-radius: var(--r-ctl);
  font-size: 14px; font-weight: 650; text-decoration: none; background: var(--ink); color: var(--on-ink);
}
.gmaps .ic { width: 17px; height: 17px; }
.dayhead { display: flex; align-items: baseline; gap: 8px; padding: 12px var(--padx) 6px; box-shadow: inset 0 -1px 0 var(--line); min-width: 0; }
.dayhead h2 { flex: none; margin: 0; font-size: 14.5px; line-height: 1.35; font-weight: 700; }
.dayhead h2 span { font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 3px; }
.dayhead p { margin: 0; min-width: 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dayhead + .row::before { display: none; }
.empty { padding: 24px var(--padx); color: var(--muted); font-size: 14px; }
.empty p { margin: 0 0 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 0; border-radius: var(--r-ctl);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--control); font-size: 14px; font-weight: 600;
}
.pfoot { padding: 16px var(--padx) 24px; display: grid; gap: 8px; box-shadow: inset 0 1px 0 var(--line); background: var(--ground); }
.exportrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }

/* ---------- 지도 위 요소 ---------- */
.mapctl { position: absolute; top: 10px; right: 10px; z-index: 3; display: grid; gap: 8px; }
.roundbtn {
  width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--surface); color: var(--ink);
  display: grid; place-items: center; box-shadow: var(--shadow-float);
}
.roundbtn.on { color: var(--loc); }
.floatbtn {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 3; height: 36px; padding: 0 14px; border: 0;
  border-radius: 18px; background: var(--ink); color: var(--on-ink); font-size: 13px; font-weight: 650; box-shadow: var(--shadow-float); white-space: nowrap;
}
.mapfail {
  position: absolute; left: 10px; right: 60px; top: 10px; z-index: 2; padding: 10px 12px; border-radius: 10px;
  background: var(--surface); box-shadow: var(--shadow-float); display: grid; gap: 2px; font-size: 13px; color: var(--muted);
}
.mapfail strong { color: var(--ink); font-size: 14px; }
.mapfail[hidden] { display: none; }
#app.nomap #mapwrap { background: repeating-linear-gradient(0deg, transparent 0 39px, var(--line) 39px 40px), repeating-linear-gradient(90deg, transparent 0 39px, var(--line) 39px 40px), var(--ground); }

/* 핀: 지도는 두 테마 모두 밝은 색이라 핀 색은 고정 */
.pin { width: 30px; height: 30px; padding: 0; border: 0; background: none; display: grid; place-items: center; cursor: pointer; }
.pin > span {
  width: 26px; height: 26px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center;
  box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(23, 25, 28, .35); transition: transform .14s var(--ease);
}
.pin .ic { width: 15px; height: 15px; stroke-width: 2.1; }
.pin b { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pin.approx > span { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px rgba(23, 25, 28, .22), 0 1px 4px rgba(23, 25, 28, .3); }
.pin.sel > span { transform: scale(1.42); box-shadow: 0 0 0 2px #fff, 0 0 0 4px #17191c, 0 3px 10px rgba(23, 25, 28, .35); }
.pin:focus-visible { outline: none; }
.pin:focus-visible > span { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1a73e8; }
/* 묶음(클러스터) 버블: 개수만, 누르면 확대 */
.clu { padding: 0; border: 0; background: none; display: grid; place-items: center; cursor: pointer; width: 44px; height: 44px; }
.clu > span {
  min-width: var(--d, 32px); height: var(--d, 32px); padding: 0 6px; border-radius: 999px; background: #17191c; color: #fff;
  display: grid; place-items: center; font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2.5px #fff, 0 0 0 5px rgba(23, 25, 28, .18), 0 2px 6px rgba(23, 25, 28, .35);
}
.clu:focus-visible { outline: none; }
.clu:focus-visible > span { box-shadow: 0 0 0 2.5px #fff, 0 0 0 5px #1a73e8; }
.refdot { display: block; width: 16px; height: 16px; border-radius: 50%; }
.refdot.gps { background: #1a73e8; box-shadow: 0 0 0 3px #fff, 0 0 0 10px rgba(26, 115, 232, .18); }
.refdot.default, .refdot.map { width: 14px; height: 14px; background: #fff; box-shadow: 0 0 0 3.5px #17191c inset, 0 1px 4px rgba(0, 0, 0, .3); }
.reflabel {
  position: absolute; left: 50%; top: 18px; transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 600;
  padding: 1px 6px; border-radius: 5px; background: #17191c; color: #fff;
}
.maplibregl-ctrl-group { border-radius: 10px !important; box-shadow: var(--shadow-float) !important; }
.maplibregl-ctrl-group button { width: 36px !important; height: 36px !important; }
.maplibregl-ctrl-attrib { font-size: 11px; }

#app[data-layout="desktop"] .row-main { padding-top: 7px; padding-bottom: 8px; }
#app[data-layout="desktop"] .acts { top: -4px; }

/* 짧은 세로 화면(폴드 겉화면 + 주소창): 머리를 더 줄인다 */
@media (max-height: 640px) {
  #app[data-layout="mobile"] #phead { padding-top: 12px; }
  #grip { height: 13px; }
  #app[data-layout="mobile"] .search, #app[data-layout="mobile"] .filterbtn { height: 36px; }
  #app[data-layout="mobile"] .filterbtn { width: 38px; }
  #app[data-layout="mobile"] .scroller { margin-top: 4px; }
  #app[data-layout="mobile"] .chip, #app[data-layout="mobile"] .day { height: 30px; }
  #app[data-layout="mobile"] .statusrow { min-height: 26px; margin-top: 2px; padding-bottom: 1px; }
  #app[data-layout="mobile"] .row-main { padding-top: 7px; padding-bottom: 8px; }
  #app[data-layout="mobile"] .acts { top: -4px; }
  #app[data-layout="mobile"] .mapctl { top: 8px; right: 8px; gap: 6px; }
  #app[data-layout="mobile"] .floatbtn { top: 8px; }
}

/* 가로로 눕힌 겉화면처럼 낮은 화면: 사이드바 전체를 한 번에 스크롤 */
@media (max-height: 560px) {
  #app[data-layout="desktop"] { grid-template-rows: auto 1fr; grid-template-areas: "tabs map" "panel map"; }
  #app[data-layout="desktop"] #brand { display: none; }
  #app[data-layout="desktop"] #panel { overflow-y: auto; padding-top: 8px; }
  #app[data-layout="desktop"] #pscroll { flex: none; overflow: visible; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
}

/* v5: 펼친 카드 접기 */
.more{display:flex;flex-wrap:wrap;gap:8px}
.more .detail{flex:1 0 100%}
.more .gmaps{flex:1 1 0;min-width:0}
.more .collapse{flex:0 0 auto;min-height:44px;padding:0 16px;border-radius:12px;border:1px solid var(--line,#444);background:transparent;color:inherit;font:inherit;font-weight:600;cursor:pointer}
.more .small{flex:1 0 100%}

/* v5: 목록 숨기기 -> 지도만 크게 */
#app[data-list="off"][data-layout="mobile"] #panel { height: 0 !important; overflow: hidden; box-shadow: none; }
#app[data-list="off"][data-layout="mobile"] #panel > * { visibility: hidden; }
#app[data-list="off"][data-layout="desktop"] { grid-template-columns: 0 1fr; }
#app[data-list="off"][data-layout="desktop"] #panel, #app[data-list="off"][data-layout="desktop"] #brand, #app[data-list="off"][data-layout="desktop"] #tabs { visibility: hidden; overflow: hidden; }
#btn-list[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }

/* v5: 이름 말풍선 */
.namebubble .maplibregl-popup-content{padding:0;border-radius:12px;background:var(--surface);color:var(--ink);box-shadow:var(--shadow-float)}
.namebubble .maplibregl-popup-tip{border-top-color:var(--surface)}
.bubble-btn{display:block;min-height:44px;padding:6px 14px;border:0;background:none;color:inherit;font:inherit;text-align:left;cursor:pointer}
.bubble-btn .bn{display:block;font-size:14.5px;font-weight:650;line-height:1.3;max-width:230px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bubble-btn .bs{display:block;font-size:12px;color:var(--muted);line-height:1.3}

/* 치이카와 매장 강조: 핀(분홍+금테+약간 크게), 목록(왼쪽 띠+배지), 칩 */
.pin.chii { width: 38px; height: 38px; }
.pin.chii > span { width: 32px; height: 32px; background: #ff4f9a; box-shadow: 0 0 0 3px #ffd23f, 0 0 0 5px #fff, 0 2px 6px rgba(23, 25, 28, .4); }
.pin.chii.sel > span { transform: scale(1.3); box-shadow: 0 0 0 3px #ffd23f, 0 0 0 5px #17191c, 0 3px 10px rgba(23, 25, 28, .4); }
.row.chii { box-shadow: inset 4px 0 0 #ff4f9a; }
.row.chii .dot { background: #ff4f9a; box-shadow: 0 0 0 2px #ffd23f; }
.chiibadge { display: inline-block; flex: none; white-space: nowrap; margin-left: 6px; padding: 1px 6px; border-radius: 8px; background: #ffd23f; color: #5a1a38; font-size: 11px; font-weight: 700; line-height: 1.5; vertical-align: 1px; }
.chip.chiichip[aria-pressed="true"] { background: #ff4f9a; border-color: #ff4f9a; color: #fff; }
.chip.chiichip:not([aria-pressed="true"]) { border-color: #ff4f9a; color: #c4256f; }

/* 구글 지도용 말풍선(어댑터) */
.gmpop { z-index: 9; pointer-events: auto; }
.gmpop-c { background: var(--surface); color: var(--ink); border-radius: 12px; box-shadow: var(--shadow-float); max-width: 260px; }
.gmpop-tip { position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; background: var(--surface); transform: translateX(-50%) rotate(45deg); box-shadow: 2px 2px 3px rgba(0,0,0,.12); z-index: -1; }

/* 사슴 경로(테마 경로 카드, 진행 방향 화살표) */
.deerarrow svg { width: 11px; height: 11px; display: block; }
.deerarrow path { fill: #0f7a64; stroke: #fff; stroke-width: 1.6; stroke-linejoin: round; paint-order: stroke; }
.routecard { list-style: none; margin: 8px var(--padx); padding: 10px 12px; border-radius: var(--r-ctl); background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); }
.routecard .rc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.routecard .rc-head b { font-size: 14px; }
.routecard .rc-head span:not(.track) { flex: 1 1 auto; min-width: 0; font-size: 12.5px; color: var(--muted); }
.routecard ol { list-style: none; margin: 6px 0 4px; padding: 0; font-size: 13px; }
.routecard li { padding: 1px 0; }
.routecard li.leg { padding-left: 14px; font-size: 12px; color: var(--muted); }
.routecard li.leg small { font-size: inherit; }
.routecard p { margin: 4px 0 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
@media (prefers-color-scheme: dark) { .deerarrow path { fill: #4fd1b0; stroke: #111214; } }

/* 일정 경로선 범례·구간 요약 */
.routeinfo { list-style: none; padding: 6px var(--padx) 2px; font-size: 12px; color: var(--muted); }
.routeinfo .lg { display: inline-flex; align-items: center; gap: 5px; margin-right: 12px; color: var(--ink2); font-weight: 600; }
.routeinfo .lg i { display: inline-block; width: 18px; height: 0; border-top: 3px solid; }
.routeinfo i.lw { border-top: 3px dashed #2f7f6f; }
.routeinfo i.lr { border-top-color: #1a5fd0; }
.routeinfo i.lb { border-top-color: #e07b00; }
.routeinfo p { margin: 3px 0 0; font-size: 11.5px; line-height: 1.4; }

.routeinfo .tl { display: block; margin-top: 4px; font-size: 12px; line-height: 1.45; color: var(--ink2); }
.routeinfo .tl a { margin-left: 4px; color: var(--loc); font-weight: 600; text-decoration: underline; white-space: nowrap; }

/* 이동 행: 일정 목록의 장소 사이마다 '이동 수단·시간 → 다음 장소 + 구글맵에서 경로 찾기' */
.legrow { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin: 0; padding: 4px var(--padx) 4px 28px; font-size: 12px; color: var(--ink2); background: var(--raised); box-shadow: inset 3px 0 0 #2f7f6f; }
.legrow.rail { box-shadow: inset 3px 0 0 #1a5fd0; }
.legrow.bus { box-shadow: inset 3px 0 0 #e07b00; }
.legrow i { display: none; }
.legrow .lt { flex: 1 1 180px; min-width: 0; }
.legrow a { flex: none; color: var(--loc); font-weight: 600; text-decoration: underline; white-space: nowrap; }

/* 일정 편집 */
.editbtn { flex: none; min-height: 32px; padding: 0 12px; margin-left: 6px; border-radius: 16px; border: 1px solid var(--control); background: var(--raised); color: var(--ink); font: 600 12.5px var(--font); cursor: pointer; }
.editbtn[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.edittool { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 8px var(--padx); padding: 10px 12px; border-radius: var(--r-ctl); background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); font-size: 12.5px; }
.edittool b { font-size: 14px; }
.edittool span { color: var(--muted); flex: 1 1 auto; }
.edittool button, .dlg button { min-height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--control); background: var(--surface); color: var(--ink); font: 600 12.5px var(--font); cursor: pointer; }
.edittool button[disabled] { opacity: .45; cursor: default; }
.edittool p { flex: 1 1 100%; margin: 2px 0 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.row.editing { cursor: grab; }
.row.dragging { opacity: .5; }
.row.dragover { box-shadow: inset 0 3px 0 var(--accent); }
.editbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; padding: 4px var(--padx) 8px 52px; }
.editbar button { width: 38px; height: 34px; border-radius: 8px; border: 1px solid var(--control); background: var(--surface); color: var(--ink); font-size: 14px; cursor: pointer; }
.editbar select { min-height: 34px; border-radius: 8px; border: 1px solid var(--control); background: var(--surface); color: var(--ink); font: 600 12.5px var(--font); padding: 0 6px; }
.editbar .chg { font-size: 11.5px; font-weight: 700; color: var(--accent); }
.legrow.est { box-shadow: inset 3px 0 0 #7a7f87; }
.routeinfo i.le { border-top: 3px dotted #7a7f87; }
.dlg { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .5); padding: 16px; }
.dlg[hidden] { display: none; }
.dlgbox { width: min(560px, 100%); background: var(--surface); color: var(--ink); border-radius: var(--r-sheet); padding: 14px; box-shadow: var(--shadow-float); }
.dlgbox p { margin: 0 0 8px; font-size: 13px; }
.dlgbox textarea { width: 100%; height: 220px; box-sizing: border-box; border-radius: 8px; border: 1px solid var(--control); background: var(--raised); color: var(--ink); font: 12px/1.5 var(--font); padding: 8px; resize: vertical; }
.dlgbtn { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.dlgmsg { font-size: 12.5px; color: var(--muted); }

.tohub { font-size: 12px; color: var(--muted); text-decoration: none; margin-left: 8px; white-space: nowrap; }

ruby{ruby-position:over}rt{font-size:.55em;color:var(--muted,#666);font-weight:400;letter-spacing:0}
