@layer legacy {
/* ── 첫 화면: 전체 화면 지도 ─────────────────────────────────────
   Search bar with the round exit beside it, the space switch leading the filter
   row, a count bar that opens the zone list, and round map buttons. */
.route-notes-search-row { display:flex; align-items:center; gap:8px; min-width:0; }
.route-notes-search-row[hidden] { display:none; }
.route-notes-search-row > .route-notes-searchbar { flex:1; min-width:0; }
.route-notes-search-row > .route-notes-exit {
  flex:0 0 52px; width:52px; height:52px;
  border:1px solid var(--line); border-radius:50%;
  background:var(--route-note-glass); color:var(--text);
  box-shadow:var(--shadow-card);
  backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px);
}
.route-notes-overview-toggle {
  flex:0 0 44px; width:44px; height:44px; min-height:44px; padding:0;
  border:0; border-radius:50%; background:transparent; color:var(--text);
}
.route-notes-overview-toggle .route-notes-icon { width:22px; height:22px; }
.route-notes-overview-toggle > span,
.route-notes-locate > span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.route-notes-tabs-row { display:flex; align-items:center; gap:6px; min-width:0; }
.route-notes-tabs-row[hidden] { display:none; }
.route-notes-tabs-row > .route-notes-tabs { min-width:0; }
.view-routes .route-notes-tabs-row > .route-notes-space-switch {
  flex:0 0 auto; max-width:45%; min-height:54px; padding:0 14px;
  background:var(--route-note-glass); font-weight:700;
  box-shadow:var(--shadow-card);
  backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px);
}
/* The zone count bar: the list is one tap away while the map stays whole. */
.route-notes-list-bar {
  position:absolute; z-index:3;
  left:12px; bottom:calc(12px + env(safe-area-inset-bottom));
  display:inline-flex; align-items:center; gap:6px;
  height:52px; padding:0 18px;
  border:1px solid var(--line); border-radius:26px;
  background:var(--panel); color:var(--text);
  font:700 var(--fs-body) var(--font-ui);
  box-shadow:var(--shadow-card); cursor:pointer;
}
.route-notes-list-bar .route-notes-icon { width:18px; height:18px; }
.route-notes-workspace:has(> .route-notes-list-bar:not([hidden])) .route-notes-fabs { bottom:calc(12px + env(safe-area-inset-bottom)); }
/* 내 위치: a round button with a direction arrow, like a map app. */
.route-notes-fab.route-notes-locate {
  justify-self:end; width:52px; min-width:52px; height:52px; padding:0;
  border-radius:50%; color:var(--gold);
}
.route-notes-locate .route-notes-icon { width:22px; height:22px; fill:currentColor; stroke:currentColor; stroke-linejoin:round; }
/* 거리뷰: the same round 52px button and 22px filled icon as 내 위치, one above it. */
.route-notes-fab.route-notes-street { justify-self:end; width:52px; min-width:52px; height:52px; padding:0; border-radius:50%; }
.route-notes-street .route-notes-icon { width:22px; height:22px; }
.route-notes-fab.route-notes-create-fab { height:52px; padding:0 20px; border-radius:26px; font-size:var(--fs-body); font-weight:700; }
/* A zone row is its code alone. */
.route-notes-zone-copy strong { font:800 var(--fs-body-l)/1.3 var(--font-code, var(--font-ui)); letter-spacing:.01em; }
@media (prefers-reduced-motion:no-preference) {
  .route-notes-list-bar { transition:transform 150ms ease; }
  .route-notes-list-bar:active { transform:scale(.97); }
}
/* Map buttons sit side by side on one line, the same height and shadow: a round
   내 위치 and the 팁 쓰기 / 구역 만들기 pill. */
.view-routes .route-notes-workspace .route-notes-fabs { display:flex; align-items:center; justify-content:flex-end; gap:10px; }
.route-notes-fabs > .route-notes-fab { flex:none; height:52px; min-height:52px; border:1px solid var(--line); box-shadow:var(--shadow-float); }
.route-notes-fabs > .route-notes-fab.primary { padding:0 20px; border-color:transparent; border-radius:26px; font-size:var(--fs-body); font-weight:700; box-shadow:0 4px 14px color-mix(in srgb,var(--gold) 35%,transparent); }
.route-notes-fabs > .route-notes-fab:is(.route-notes-locate, .route-notes-street) { width:52px; min-width:52px; padding:0; border-radius:50%; background:var(--panel); }
/* Beside the zone count bar there is no room for a row: 내 위치 stacks above 구역 만들기. */
.view-routes .route-notes-workspace:has(> .route-notes-list-bar:not([hidden])) .route-notes-fabs { flex-direction:column; align-items:flex-end; }
/* Tip photos: up to three squares in the form, a small strip on the tip card. */
.route-notes-tip-photos-field { display:grid; gap:0; }
.route-notes-tip-photos-field .route-notes-form-label em { margin-left:6px; color:var(--muted); font-size:var(--fs-body); font-style:normal; font-weight:500; }
.route-notes-photo-grid { display:flex; flex-wrap:wrap; gap:8px; }
.route-notes-photo-tile { position:relative; width:88px; height:88px; margin:0; overflow:hidden; border:1px solid var(--line); border-radius:var(--r-md); background:var(--panel2); }
.route-notes-photo-tile img { width:100%; height:100%; object-fit:cover; display:block; }
.route-notes-workspace .route-notes-photo-tile .route-notes-photo-remove { position:absolute; top:4px; right:4px; width:28px; height:28px; min-height:28px; border:0; border-radius:50%; background:var(--scrim); color:var(--on-color); }
.route-notes-photo-remove .route-notes-icon { width:14px; height:14px; }
.route-notes-workspace .route-notes-photo-add { display:grid; place-items:center; align-content:center; gap:2px; width:88px; height:88px; min-height:88px; padding:0; border:1.5px dashed var(--line-strong); border-radius:var(--r-md); background:var(--panel); color:var(--muted); font-size:var(--fs-label); font-weight:600; }
.route-notes-tip-photos-field .route-notes-form-hint { margin:8px 0 0; color:var(--muted); font-size:var(--fs-label); }
.route-notes-tip-photos { display:flex; gap:6px; margin-top:4px; }
.route-notes-tip-photos[hidden] { display:none; }
.route-notes-tip-photo { width:72px; height:72px; overflow:hidden; border-radius:var(--r-md); border:1px solid var(--line); background:var(--panel2); }
.route-notes-tip-photo img { width:100%; height:100%; object-fit:cover; display:block; }

/* ── 구역노트 시안(2026-10): 지도는 화면 끝까지, 위·아래 조작은 지도 위에 떠 있는 유리 ──
   하단 메뉴는 구역노트에서도 보인다(지도 찍기·구역 편집 중에는 숨김). 지도 칸은 메뉴를 피해 앉고
   지도 그림만 메뉴 밑까지 깔린다. 목록·구역 시트는 메뉴 8px 위에 뜬 유리 판. */
[data-route-notes-fullscreen="true"] { --rn-under-b:0px; --rn-under-l:0px; }
html body:has([data-route-notes-fullscreen="true"]):not(:has(.route-notes-workspace:is([data-placing="true"], [data-editing="true"]))):not(:has(.route-note-zone-editor, .route-sketch)) .bottom-nav {
  display:flex !important;
  z-index:31;
}
/* 메뉴는 모든 폭에서 아래 캡슐(2026-11-05): 지도 칸은 그 위에서 끝나고, 왼쪽 사이드바 여백은 없다. */
html body:has([data-route-notes-fullscreen="true"]):not(:has(.route-notes-workspace:is([data-placing="true"], [data-editing="true"]))):not(:has(.route-note-zone-editor, .route-sketch)) [data-route-notes-fullscreen="true"] { --rn-under-b:calc(var(--nav-h) + var(--safe-b)); }
html .app[data-view="routes"] .bottom-nav { width:auto; }
[data-route-notes-fullscreen="true"] { bottom:var(--rn-under-b); left:var(--rn-under-l); width:auto; height:auto; overflow:visible; }
[data-route-notes-fullscreen="true"] .route-notes-workspace { height:calc(var(--route-note-viewport-h, 100dvh) - var(--rn-under-b)); overflow:visible; }
[data-route-notes-fullscreen="true"] .route-notes-workspace .route-notes-overview-map {
  inset:0 0 calc(-1 * var(--rn-under-b)) calc(-1 * var(--rn-under-l));
  width:auto;
  height:auto;
}

/* 유리 재질: 하단 메뉴와 같은 토큰. 조작(버튼·검색·알약)은 유리, 내용(시트·팁 카드·서랍·추천 목록)은 불투명한 흰 면(2026-10-19). */
.view-routes {
  --rn-glass:var(--nav-glass);
  --rn-glass-border:var(--nav-glass-border);
  --rn-glass-shadow:var(--nav-glass-shadow);
  --rn-glass-filter:var(--nav-glass-filter);
  --rn-sheet-glass:var(--panel);
}
.view-routes .route-notes-searchbar,
.view-routes .route-notes-tabs-row > .route-notes-space-switch,
.view-routes .route-notes-tabs-row > .jobs-settings-shortcut,
.view-routes .route-notes-workspace .route-notes-tabs,
.view-routes .route-notes-selected-bar,
.view-routes .route-notes-list-bar,
.view-routes .route-notes-fabs > .route-notes-fab:not(.primary),
.view-routes .route-notes-workspace .route-notes-sheet,
.view-routes .route-notes-suggest {
  border:1px solid var(--rn-glass-border);
  background:var(--rn-glass);
  box-shadow:var(--rn-glass-shadow);
  -webkit-backdrop-filter:var(--rn-glass-filter);
  backdrop-filter:var(--rn-glass-filter);
}
.view-routes .route-notes-workspace .route-notes-sheet,
.view-routes .route-notes-suggest { border-color:transparent; background:var(--rn-sheet-glass); -webkit-backdrop-filter:none; backdrop-filter:none; }
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) {
  .view-routes { --rn-glass:var(--nav-glass-solid); --rn-sheet-glass:var(--nav-glass-solid); }
}
@media (prefers-reduced-transparency:reduce) {
  .view-routes { --rn-glass:var(--nav-glass-solid); --rn-sheet-glass:var(--nav-glass-solid); }
}

/* 위쪽: 검색 캡슐(목록 버튼은 안쪽 렌즈) + 공간 칩 · 내 구역|전체 */
.view-routes .route-notes-topbar { top:max(16px, calc(env(safe-area-inset-top) + 8px)); }
.view-routes .route-notes-workspace[data-selected="false"][data-panel="false"] .route-notes-topbar { margin-top:max(16px, calc(env(safe-area-inset-top) + 8px)); }
.view-routes .route-notes-searchbar { height:52px; padding:0 6px 0 16px; border-radius:var(--r-full); }
.view-routes .route-notes-searchbar:focus-within { box-shadow:var(--rn-glass-shadow), 0 0 0 3px color-mix(in srgb, var(--gold) 30%, transparent) !important; }
.view-routes .route-notes-overview-toggle {
  flex:0 0 40px; width:40px; height:40px; min-height:40px;
  background:var(--nav-lens); box-shadow:var(--nav-lens-rim); color:var(--text);
}
.view-routes .route-notes-overview-toggle .route-notes-icon { width:20px; height:20px; }
.view-routes .route-notes-tabs-row { gap:8px; }
.view-routes .route-notes-tabs-row > .route-notes-space-switch { min-height:44px; padding:0 14px; border-radius:22px; font-weight:700; }
.view-routes .route-notes-workspace .route-notes-tabs { gap:2px; padding:4px; border-radius:22px; }
.view-routes .route-notes-workspace .route-notes-tabs .route-notes-button {
  min-height:36px; height:36px; padding:0 14px; border:0; border-radius:var(--r-lg);
  background:transparent; color:var(--muted); font-weight:600;
}
.view-routes .route-notes-workspace .route-notes-tabs .route-notes-button.active {
  background:var(--nav-lens); box-shadow:var(--nav-lens-rim); color:var(--text); font-weight:700;
}
.view-routes .route-notes-tabs-row > .jobs-settings-shortcut {
  width:44px; height:44px; min-width:44px; margin-left:auto; padding:0; border-radius:50%; color:var(--text);
}
.view-routes .route-notes-tabs-row > .jobs-settings-shortcut svg { width:20px; height:20px; }
.view-routes .route-notes-selected-bar { border-radius:var(--r-full); }

/* 지도 위 버튼: 둥근 유리 내 위치, 강조색 알약 */
.view-routes .route-notes-fabs > .route-notes-fab.route-notes-locate { color:var(--gold); }
/* 거리뷰 on: blue like the street layer it shows, over the glass background. */
.view-routes .route-notes-fabs > .route-notes-fab.route-notes-street[aria-pressed="true"] { border-color:transparent; background:var(--blue); color:#fff; }
/* 내 위치 on (2026-11-04): the same blue as 거리뷰, so a second tap visibly turns it off. */
.view-routes .route-notes-fabs > .route-notes-fab.route-notes-locate[aria-pressed="true"] { border-color:transparent; background:var(--blue); color:#fff; }
.view-routes .route-notes-fabs > .route-notes-fab.primary { box-shadow:0 6px 18px color-mix(in srgb, var(--gold) 32%, transparent), inset 0 1px 0 var(--map-glass-rim); }
.view-routes .route-notes-list-bar { left:12px; bottom:12px; border-radius:26px; }
.view-routes .route-notes-workspace:has(> .route-notes-list-bar:not([hidden])) .route-notes-fabs { bottom:12px; }

/* 시트: 아래에 붙은 판이 아니라 메뉴 위에 뜬 둥근 유리. 메뉴가 없을 때는 화면 아래에서 8px. */
.view-routes .route-notes-workspace .route-notes-sheet,
.view-routes .route-notes-workspace[data-selected="false"][data-panel="false"] .route-notes-sheet,
.view-routes .route-notes-workspace:not([data-panel="false"]) .route-notes-sheet {
  left:8px;
  right:8px;
  bottom:max(0px, calc(8px + var(--safe-b) - var(--rn-under-b)));
  border-radius:var(--r-sheet);
  overflow:hidden;
}
.view-routes .route-notes-workspace .route-notes-sheet-head { border-bottom:0; }
.view-routes .route-notes-workspace .route-notes-sheet-body .route-notes-form-actions { background:transparent; }
.view-routes .route-notes-workspace[data-selected="false"][data-panel="false"] .route-notes-sheet-body { padding:24px 14px 14px; }
.view-routes .route-notes-list-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:0 4px 8px; }
.view-routes .route-notes-list-head-copy { display:grid; gap:2px; min-width:0; }
.view-routes .route-notes-list-head-copy strong { color:var(--text); font-size:var(--fs-title-l); font-weight:700; letter-spacing:-.02em; }
.view-routes .route-notes-list-head-copy small { overflow:hidden; color:var(--muted); font-size:var(--fs-label); font-weight:500; text-overflow:ellipsis; white-space:nowrap; }
.view-routes .route-notes-list-head .route-notes-create-zone {
  flex:0 0 auto; width:auto; min-height:40px; height:40px; margin:0; padding:0 14px;
  border:0; border-radius:20px; background:var(--gold); color:var(--gold-ink); font-weight:700;
  box-shadow:inset 0 1px 0 var(--map-glass-rim);
}
.view-routes .route-notes-list-head .route-notes-create-zone .route-notes-icon { width:16px; height:16px; stroke-width:2.4; }
.view-routes .route-notes-workspace .route-notes-list { gap:2px; }
.view-routes .route-notes-workspace .route-notes-zone-row { border:0; border-radius:var(--r-lg); background:transparent; box-shadow:none; }
.view-routes .route-notes-workspace .route-notes-zone-main { min-height:56px; border-radius:var(--r-lg); background:transparent; }
.view-routes .route-notes-workspace .route-notes-zone-main:active { background:color-mix(in srgb, var(--muted) 12%, transparent); }

/* 네이버 로고·저작권·축척은 메뉴 밑에 숨지 않게 지도 칸 안쪽 가장자리에 둔다 */
[data-route-notes-fullscreen="true"] .route-notes-overview-map > [style*="z-index: 100"][style*="bottom: 0px"] { bottom:var(--rn-under-b) !important; }
/* 카드 줄이 떠 있으면 네이버 저작권·로고·축척이 카드에 가려졌다. 약관상 보여야 하므로 카드 줄 바로 위로 올린다(2026-10-17). */
[data-route-notes-fullscreen="true"] .route-notes-workspace[data-rail="true"] .route-notes-overview-map > [style*="z-index: 100"][style*="bottom: 0px"] { bottom:calc(var(--rn-under-b) + var(--route-note-rail-h, 0px) + 4px) !important; }
/* 태블릿·PC는 카드가 오른쪽 서랍이라 아래가 비어 있다: 저작권·로고는 맨 아래로, 오른쪽 로고·축척은 서랍 왼쪽으로. */
[data-route-notes-fullscreen="true"] .route-notes-overview-map > [style*="z-index: 100"][style*="left: 0px"] { left:var(--rn-under-l) !important; }/* 구역 목록 시트는 줄 수만큼만(최대 화면 절반) */
.view-routes .route-notes-workspace[data-selected="false"][data-panel="false"] .route-notes-sheet { height:auto; max-height:var(--route-note-sheet-size, 50%); }/* 지도에서 구역·팁을 누르면 뜨는 카드도 시트와 같은 흰 면. 아래에 붙은 카드는 시트처럼 메뉴 위에 뜬다. */
.view-routes .route-notes-workspace .route-notes-map-popup {
  border:1px solid transparent;
  background:var(--rn-sheet-glass);
  box-shadow:var(--rn-glass-shadow);
  -webkit-backdrop-filter:none;
  backdrop-filter:none;
}
/* Phone layout on every screen since 2026-10-23 (was max-width:599px). */
.view-routes .route-notes-workspace .route-notes-map-popup[data-docked="true"] {
  right:8px;
  bottom:max(0px, calc(8px + var(--safe-b) - var(--rn-under-b)));
  left:8px !important;
  border-radius:var(--r-sheet);
  padding-bottom:0;
}
.view-routes .route-notes-workspace .route-notes-map-popup[data-docked="true"]::before { background:color-mix(in srgb, var(--muted) 38%, transparent); height:5px; border-radius:var(--r-xs); }
/* 다크 메뉴가 밝은 지도 위에 뜨면 연기 유리가 회색으로 바래므로, 구역노트에서는 판을 더 짙게, 글씨를 더 밝게 */
html[data-theme="dark"] .app[data-view="routes"] > .bottom-nav,
body[data-theme="dark"] .app[data-view="routes"] > .bottom-nav {
  --nav-glass:linear-gradient(180deg, rgba(255,255,255,.06) 0%, rgba(255,255,255,.02) 40%), rgba(18,18,20,.84);
}
html[data-theme="dark"] .app[data-view="routes"] > .bottom-nav .nav-tab:not(.active),
body[data-theme="dark"] .app[data-view="routes"] > .bottom-nav .nav-tab:not(.active) { color:var(--map-nav-muted); }
}
/* 깜빡임 없는 지도(2026-10-20): on Android phones a backdrop blur over the moving map makes the map layer under it
   (tiles, zone lines, names) blink while it pans. On a touch screen the controls over the map are solid instead
   of blurred glass, and so is the bottom menu while 구역노트 is open. */
@media (pointer:coarse) {
  .view-routes { --rn-glass:var(--nav-glass-solid); --rn-glass-filter:none; --route-note-glass:var(--panel); }
  .view-routes *,
  .view-routes *::before,
  .view-routes *::after { -webkit-backdrop-filter:none !important; backdrop-filter:none !important; }
  body:has([data-route-notes-fullscreen="true"]) .bottom-nav { -webkit-backdrop-filter:none; backdrop-filter:none; background:var(--nav-glass-solid); }
}
/* 사진 크게 보기(2026-10-20): 앱 안의 전체 화면 보기, 좌우로 넘김 */
button.route-notes-tip-photo { padding:0; cursor:zoom-in; }
.route-notes-photo-viewer { width:100vw; height:100dvh; max-width:none; max-height:none; margin:0; padding:0; border:0; background:rgb(0 0 0 / .92); }
.route-notes-photo-viewer::backdrop { background:rgb(0 0 0 / .6); }
.route-notes-photo-viewer[open] { display:grid; place-items:center; }
.route-notes-photo-viewer { touch-action:none; }
.route-notes-photo-viewer-img { max-width:100%; max-height:100dvh; object-fit:contain; transform-origin:center; user-select:none; -webkit-user-drag:none; }
.route-notes-photo-viewer .route-notes-icon-button { position:absolute; width:52px; height:52px; border-radius:26px; background:rgb(0 0 0 / .5); color:#fff; }
.route-notes-photo-viewer-close { top:max(12px, env(safe-area-inset-top)); right:12px; }
.route-notes-photo-viewer-step { top:50%; transform:translateY(-50%); }
.route-notes-photo-viewer-step[data-dir="prev"] { left:8px; }
.route-notes-photo-viewer-step[data-dir="next"] { right:8px; }
.route-notes-photo-viewer-step[hidden] { display:none; }
.route-notes-photo-viewer-count { position:absolute; bottom:max(16px, env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); padding:2px 10px; border-radius:12px; background:rgb(0 0 0 / .5); color:#fff; font-size:var(--fs-label); font-weight:600; }
.route-notes-photo-viewer-count:empty { display:none; }
/* 형제물류 구역노트(2026-10-21, html[data-app]): 하단 메뉴에는 구역노트와 내 정보만 */
html[data-app] .bottom-nav .nav-tab:not([data-view="routes"]):not([data-view="settings"]) { display:none; }
/* 형제물류 구역노트: 내 정보에는 계정만(근무·기록·자료 메뉴 숨김), 로고 로딩 화면 없이 바로 */
html[data-app] .settings-list:is([aria-labelledby="settingsWorkTitle"], [aria-labelledby="settingsRecordTitle"], [aria-labelledby="settingsDataTitle"], [aria-labelledby="settingsHelpTitle"]) { display:none; }
html[data-app] #startupSplash:not([data-error]) { display:none; }
/* 형제물류 로그인 화면의 APK 받기(2026-10-21): 브라우저로 열었을 때만. 설치한 앱(TWA·홈 화면)에서는 숨긴다. 파일은 오라클 서버 /downloads 에 따로 둔다. */
.auth-apk { display:none; }
@media (display-mode: browser) {
  html[data-app] .auth-apk { display:flex; align-items:center; justify-content:center; min-height:44px; margin-top:4px; color:var(--gold); font-size:var(--fs-body); font-weight:600; text-decoration:none; }
}
/* 형제물류 구역노트(2026-10-21): 구역을 열면 아래 팁 카드 줄은 숨기고 공통 팁은 팝업으로 본다. 'OOO · 팁 N개' 알약이 다시 여는 버튼. */
html[data-app] .route-notes-workspace[data-selected="true"] :is(.route-notes-rail-track, .route-notes-rail-step, .route-notes-rail-toggle) { display:none; }
html[data-app] .route-notes-workspace[data-selected="true"] .route-notes-rail-title { cursor:pointer; }
.route-notes-common-tip-meta { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:0; }
.route-notes-common-tip-meta .route-notes-common-tip-more { min-height:44px; padding:0 4px; border:0; background:transparent; color:var(--gold); font-size:var(--fs-label); font-weight:600; }
/* 팀 초대 코드(2026-10-21): 다섯 글자를 크게, 받아 적기 쉽게. */
.route-notes-team-code-line { display:flex; align-items:baseline; gap:10px; margin:0; padding:14px 14px 4px; }
.route-notes-team-code > .route-notes-form-hint { margin:0; padding:0 14px 12px; }
.route-notes-team-code-line > span { color:var(--muted); font-size:var(--fs-label); font-weight:600; }
.route-notes-team-code-value { font:700 28px/1.2 var(--font-code, inherit); letter-spacing:.12em; color:var(--text); }
.route-notes-team-code-line > small { margin-left:auto; color:var(--muted); font-size:var(--fs-label); }
/* 내 정보의 APK 받기는 형제물류 구역노트에서만(2026-10-21). */
html:not([data-app]) .settings-app-download { display:none; }
.settings-app-download a.settings-row { color:inherit; text-decoration:none; }
