@layer legacy {
/* ── 지도 중심 구역노트 개편 ───────────────────────────────── */
.route-notes-selected-bar {
  /* The zone name shrinks so the 3–5 visible icon buttons always stay on one row. */
  display:flex;
  box-sizing:border-box;
  width:100%;
  min-width:0;
  align-items:center;
  min-height:46px;
  padding:4px;
  border:1px solid var(--line);
  border-radius:var(--r-full);
  background:var(--route-note-glass);
  box-shadow:var(--shadow-card);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
}
.route-notes-zone-change {
  display:flex;
  flex:1 1 0;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:2px;
  overflow:hidden;
  min-width:0;
  min-height:40px;
  padding:0 12px;
  border:0;
  border-radius:var(--r-full);
  background:transparent;
  color:var(--text);
  text-align:left;
  cursor:pointer;
}
.route-notes-zone-code {
  display:block;
  max-width:100%;
  overflow:hidden;
  font-family:var(--font-code);
  font-size:var(--fs-body-l);
  font-weight:700;
  letter-spacing:.01em;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.route-notes-zone-name {
  display:block;
  max-width:100%;
  overflow:hidden;
  color:var(--muted);
  font-size:var(--fs-caption);
  text-overflow:ellipsis;
  white-space:nowrap;
}
.route-notes-selected-bar .route-notes-icon-button { flex:0 0 40px; width:40px; height:40px; border-radius:var(--r-full); }
.route-notes-workspace[data-selected="true"] .route-notes-searchbar { height:46px; border-radius:var(--r-full); }
.route-notes-fabs { align-items:end; justify-items:end; }
.route-notes-write { width:auto; min-width:106px; padding-inline:16px; border-radius:var(--r-full); font-weight:700; }
.route-notes-status-line {
  position:absolute;
  z-index:2;
  right:0;
  bottom:0;
  left:0;
  min-height:38px;
  margin:0;
  padding:10px 16px max(8px,env(safe-area-inset-bottom));
  background:linear-gradient(0deg,color-mix(in srgb,var(--panel) 96%,transparent) 54%,transparent);
  color:var(--muted);
  font-size:var(--fs-caption);
  font-weight:600;
  text-align:center;
  pointer-events:none;
}
.route-notes-crosshair {
  position:absolute;
  z-index:3;
  top:50%;
  left:50%;
  width:38px;
  height:38px;
  border:2px solid var(--gold);
  border-radius:50%;
  background:color-mix(in srgb,var(--panel) 26%,transparent);
  box-shadow:0 0 0 5px color-mix(in srgb,var(--panel) 62%,transparent);
  transform:translate(-50%,-50%);
  pointer-events:none;
}
.route-notes-crosshair::before,.route-notes-crosshair::after {
  content:"";
  position:absolute;
  top:50%;
  left:50%;
  background:var(--gold);
  transform:translate(-50%,-50%);
}
.route-notes-crosshair::before { width:54px; height:2px; }
.route-notes-crosshair::after { width:2px; height:54px; }
.route-notes-crosshair span { position:absolute; z-index:1; inset:14px; border-radius:50%; background:var(--gold); }
/* A map selection opens one anchored popup. Only editing, management and a
   failed map retain the sheet; there is no persistent all-tips/peek panel. */
.route-notes-map-popup {
  position:absolute;
  z-index:4;
  box-sizing:border-box;
  width:min(340px,calc(100% - 24px));
  min-width:0;
  max-height:min(var(--route-note-popup-max-h,360px),calc(100% - 24px));
  overflow:auto;
  overscroll-behavior:contain;
  scroll-padding-block:12px;
  border:1px solid var(--line);
  border-radius:var(--r-xl);
  background:var(--panel);
  color:var(--text);
  box-shadow:var(--shadow-raise);
  overflow-wrap:anywhere;
  -webkit-overflow-scrolling:touch;
}
.route-notes-map-popup:focus-visible {
  outline:3px solid color-mix(in srgb,var(--gold) 36%,transparent);
  outline-offset:2px;
}
.route-notes-map-popup[hidden],.route-notes-sheet[hidden] { display:none !important; }
/* Sheet motion: it rises from the bottom edge when a form or list opens and sinks
   back when browsing returns to the map. Floating cards (desktop panel, placement
   card) lift a short distance instead. hidden still removes taps and focus at once. */
.route-notes-workspace { --route-sheet-in:340ms; --route-sheet-out:220ms; --route-sheet-move:280ms; --route-sheet-from:translateY(calc(100% + 16px)); }
.route-notes-sheet[hidden] {
  transform:var(--route-sheet-from);
  pointer-events:none;
  transition-duration:var(--route-sheet-move),var(--route-sheet-out),var(--route-sheet-out),var(--route-sheet-out);
  transition-timing-function:var(--motion-ease-out),var(--motion-ease-in),var(--motion-ease-in),linear;
}
@starting-style { .route-notes-sheet:not([hidden]) { transform:var(--route-sheet-from); } }
.route-notes-workspace[data-placing="true"] { --route-sheet-from:translateY(24px); }
.route-notes-workspace[data-placing="true"] .route-notes-sheet[hidden] { opacity:0; }
@starting-style { .route-notes-workspace[data-placing="true"] .route-notes-sheet:not([hidden]) { opacity:0; } }
@media (prefers-reduced-motion:reduce) {
  .route-notes-sheet,.route-notes-sheet[hidden] { transition:none; }
}
.view-routes .route-notes-workspace[data-selected="true"][data-panel="false"]:has(> .route-notes-sheet[hidden]) .route-notes-fabs {
  right:max(16px,env(safe-area-inset-right));
  bottom:calc(16px + env(safe-area-inset-bottom));
}
.route-notes-pin-popup {
  position:relative;
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:10px;
  min-width:0;
  padding:14px;
}
.route-notes-pin-popup-copy { min-width:0; }
.route-notes-pin-popup-close { position:absolute; top:4px; right:4px; width:44px; height:44px; }
.route-notes-fallback-write { margin-bottom:12px; }
.route-notes-tip-conflict { display:grid; gap:10px; padding:14px; border-radius:var(--r-md); background:var(--panel2); overflow-wrap:anywhere; }
.route-notes-tip-conflict p { margin:0; font-size:var(--fs-label); line-height:1.5; }
.route-notes-tip-conflict small { color:var(--muted); font-size:var(--fs-caption); }
.route-notes-pin-popup-meta { display:flex; flex:1 1 140px; flex-wrap:wrap; align-items:center; gap:4px 8px; min-width:0; margin:0; color:var(--muted); font-size:var(--fs-label); font-weight:500; line-height:1.5; overflow-wrap:anywhere; }
.route-notes-pin-popup-meta em { min-width:0; color:var(--muted); font-style:normal; }
.route-notes-pin-popup h3 { margin:0; padding-right:32px; font-size:var(--fs-title-l); font-weight:700; letter-spacing:-.022em; line-height:1.45; overflow-wrap:anywhere; white-space:normal; }
.route-notes-pin-popup-body { margin:8px 0 0; color:var(--text); font-size:var(--fs-title-m); font-weight:500; line-height:1.6; overflow-wrap:anywhere; white-space:pre-wrap; }
.route-notes-pin-popup-photo { width:72px; height:72px; border-radius:var(--r-md); object-fit:cover; }
.route-notes-pin-popup-footer { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:4px 8px; min-width:0; }
/* 기록 · 수정: two even buttons across the card wherever the tip opens. */
.route-notes-pin-popup-actions { display:flex; flex:1 1 100%; width:100%; gap:8px; margin:0; }
.route-notes-pin-popup-actions .route-notes-button { flex:1 1 0; min-width:0; min-height:var(--btn-h); padding:0 12px; border:0; border-radius:var(--r-full); background:var(--panel2); color:var(--text); font-size:var(--fs-body); font-weight:700; line-height:1.2; white-space:nowrap; }
.route-notes-pin-popup-actions .route-notes-button.primary { background:var(--gold); color:var(--gold-ink); }
.route-notes-pin-popup-actions .route-notes-button:active { background:var(--panel2); }
.route-notes-common-popup { display:grid; gap:8px; min-width:0; padding:10px 14px; }
.route-notes-common-popup-head { display:flex; align-items:center; justify-content:space-between; gap:10px; min-width:0; }
.route-notes-common-popup-head > :first-child { display:flex; flex-wrap:wrap; align-items:center; gap:6px; min-width:0; }
.route-notes-common-popup-head h3 { margin:0; color:var(--muted); font-size:var(--fs-label); font-weight:500; line-height:1.4; overflow-wrap:anywhere; }
.route-notes-common-popup-head small { color:var(--muted); font-size:var(--fs-label); }
.route-notes-common-popup-head .route-notes-pin-popup-close { position:static; flex:0 0 44px; }
.route-notes-common-tips { display:grid; gap:12px; min-width:0; }
.route-notes-common-tip { display:grid; gap:8px; min-width:0; }
.route-notes-common-tip + .route-notes-common-tip { padding-top:12px; border-top:1px solid var(--line); }
.route-notes-common-tip-kind { color:var(--muted); font-size:var(--fs-label); font-weight:500; line-height:1.5; overflow-wrap:anywhere; }
.route-notes-common-tip h4 { min-width:0; margin:0; font-size:var(--fs-title-m); font-weight:700; line-height:1.45; overflow-wrap:anywhere; }
.route-notes-common-tip p { margin:0; color:var(--text); font-size:var(--fs-title-m); font-weight:500; line-height:1.6; overflow-wrap:anywhere; white-space:pre-wrap; }
.route-notes-common-tip .route-notes-button { justify-self:end; min-height:36px; margin-top:2px; }
/* 공통 팁 카드(2026-10-20 시안): 사진은 크게 맨 위, 본문은 줄바꿈을 지킨 상자 */
.route-notes-common-tip .route-notes-tip-photos { gap:8px; margin-top:0; overflow-x:auto; }
.route-notes-common-tip .route-notes-tip-photo { flex:none; width:auto; height:120px; aspect-ratio:4/3; }
.route-notes-common-tip p.route-notes-common-tip-body { padding:10px 12px; border:1px solid var(--warn-border); border-radius:var(--r-md);
  background:linear-gradient(var(--warn-bg), var(--warn-bg)), var(--panel); font-size:var(--fs-body-l); line-height:1.55; }
.route-notes-common-popup-head h3 { color:var(--warn); font-weight:700; }
.route-notes-common-tip .route-notes-common-tip-open { min-width:0; width:100%; justify-content:flex-start; padding:0; border:0; background:transparent; text-align:left; white-space:normal; overflow-wrap:anywhere; font-size:var(--fs-title-m); font-weight:700; line-height:1.45; }
.route-notes-common-popup .route-notes-common-add { justify-self:end; min-height:32px; padding:4px 0; border:0; background:transparent; color:var(--muted); font-size:var(--fs-label); font-weight:500; }
.route-notes-common-add .route-notes-icon { width:14px; height:14px; }
.route-notes-popup-choices { display:grid; gap:8px; min-width:0; margin:0; padding:14px; list-style:none; }
.route-notes-popup-choices button {
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  box-sizing:border-box;
  width:100%;
  min-width:0;
  min-height:44px;
  padding:10px 12px;
  border:0;
  border-radius:var(--r-md);
  background:var(--panel2);
  color:var(--text);
  font:600 var(--fs-label)/1.5 var(--font-ui);
  text-align:left;
  overflow-wrap:anywhere;
  white-space:normal;
  cursor:pointer;
}
.route-notes-popup-choices button .route-notes-icon { flex:0 0 24px; }
.route-notes-popup-choices button > span { min-width:0; }
.route-notes-popup-choices button:hover,.route-notes-popup-choices button:active { background:var(--panel3); }
.route-notes-popup-choices button:focus-visible { outline:3px solid color-mix(in srgb,var(--gold) 36%,transparent); outline-offset:2px; }
.route-notes-common-popup .route-notes-popup-choices { padding:0; }
.route-notes-map-popup .route-notes-empty { margin:0; padding:12px 0; }
.route-notes-workspace[data-placing="true"] .route-notes-sheet {
  right:12px;
  bottom:calc(12px + env(safe-area-inset-bottom));
  left:12px;
  height:auto;
  border:1px solid var(--line);
  border-radius:var(--r-xl);
}
.route-notes-workspace[data-placing="true"] .route-notes-sheet-head { padding:12px 14px 8px; border:0; }
.route-notes-workspace[data-placing="true"] .route-notes-sheet-heading { grid-column:1/-1; }
.route-notes-workspace[data-placing="true"] .route-notes-sheet-back { display:none; }
.route-notes-workspace[data-placing="true"] .route-notes-sheet-body { padding:4px 14px 14px; }
.route-notes-location-menu { grid-template-columns:1fr auto; align-items:center; }
.route-notes-location-menu .route-notes-placement-help { grid-column:1/-1; margin:0; color:var(--muted); font-size:var(--fs-label); }
.route-notes-location-menu .route-notes-button.primary { order:2; }
.route-notes-workspace[data-editing="true"] .route-notes-sheet { max-height:calc(100% - 10px); }
.route-notes-tip-optional { border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.route-notes-tip-optional summary { min-height:48px; align-content:center; color:var(--text-sub); font-size:var(--fs-label); font-weight:700; cursor:pointer; }
.route-notes-tip-optional > :not(summary) { margin-block:10px; }
.route-notes-share-toggle,.route-note-zone-privacy { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:4px 12px; min-height:52px; }
.route-notes-share-toggle strong,.route-note-zone-privacy strong { color:var(--text); font-size:var(--fs-label); font-weight:600; }
.route-notes-share-toggle small,.route-note-zone-privacy small { grid-column:1/-1; color:var(--muted); font-size:var(--fs-caption); font-weight:500; line-height:1.5; }
.route-notes-share-toggle input[role="switch"],.route-note-zone-privacy input[role="switch"] {
  appearance:none; position:relative; flex-shrink:0; width:42px; height:24px; margin:0; padding:0;
  border:1px solid var(--line-strong); border-radius:var(--r-full); background:var(--panel3); cursor:pointer;
  transition:background-color 150ms ease,border-color 150ms ease;
}
.route-notes-share-toggle input[role="switch"]::after,.route-note-zone-privacy input[role="switch"]::after {
  content:""; position:absolute; top:2px; left:2px; width:18px; height:18px; border-radius:50%; background:var(--muted); transition:transform 150ms ease;
}
.route-notes-share-toggle input[role="switch"]:checked,.route-note-zone-privacy input[role="switch"]:checked { border-color:var(--gold); background:var(--gold); }
.route-notes-share-toggle input[role="switch"]:checked::after,.route-note-zone-privacy input[role="switch"]:checked::after { background:var(--gold-ink); transform:translateX(18px); }
.route-notes-share-toggle input[role="switch"]:disabled,.route-note-zone-privacy input[role="switch"]:disabled { opacity:.65; cursor:not-allowed; }
.route-notes-share-toggle input[role="switch"]:focus-visible,.route-note-zone-privacy input[role="switch"]:focus-visible { outline:3px solid color-mix(in srgb,var(--gold) 40%,transparent); outline-offset:3px; }
@media (prefers-reduced-motion:reduce) {
  .route-notes-share-toggle input[role="switch"],.route-note-zone-privacy input[role="switch"],
  .route-notes-share-toggle input[role="switch"]::after,.route-note-zone-privacy input[role="switch"]::after { transition:none; }
}
body:has(.route-notes-workspace:is([data-placing="true"], [data-editing="true"])) .bottom-nav { display:none !important; }


}

@layer legacy {
/* 그 자리의 건물·동 이름(2026-10-19): 제목 아래 한 줄, 흐린 글자. 알기 전에는 자리를 차지하지 않는다. */
.route-notes-building-line { display:block; margin:2px 0 0; color:var(--muted); font-size:var(--fs-body); font-weight:500; line-height:1.45; overflow-wrap:anywhere; }
.route-notes-building-line[hidden] { display:none; }
.route-notes-place-title { display:grid; justify-items:start; gap:4px; min-width:0; }
}

@layer legacy {
/* 팁 쓰기의 그 자리 건물(2026-10-19): "새솔빌라 · 3층 · 승강기 없을 수 있어요". 알기 전에는 자리를 차지하지 않는다. */
.route-notes-tip-building { display:block; margin:0; color:var(--muted); font-size:var(--fs-body); font-weight:500; line-height:1.45; overflow-wrap:anywhere; }
.route-notes-tip-building[hidden] { display:none; }
}
