@layer legacy {
/* ── 1단계 C2 구역 메뉴(2026-10-13 시안): 회색 바탕 시트, 흰 묶음 줄, 따로 떨어진 빨간 구역 삭제 ── */
.view-routes .route-notes-scrim {
  position:absolute; z-index:4; inset:0 0 calc(-1 * var(--rn-under-b, 0px)) calc(-1 * var(--rn-under-l, 0px));
  background:color-mix(in srgb, var(--scrim) 56%, transparent);
}
@media (prefers-reduced-motion:no-preference) {
  .view-routes .route-notes-scrim { transition:opacity var(--motion-fade-ms) var(--motion-ease-out), display var(--motion-fade-ms) allow-discrete; }
  @starting-style { .view-routes .route-notes-scrim:not([hidden]) { opacity:0; } }
  /* Fades out with the sheet instead of staying dark until display flips. */
  .view-routes .route-notes-scrim[hidden] { opacity:0; }
}
.view-routes .route-notes-workspace[data-panel="menu"] .route-notes-sheet {
  border:0; border-radius:26px; background:var(--bg); box-shadow:var(--shadow-modal);
  -webkit-backdrop-filter:none; backdrop-filter:none;
}
.view-routes .route-notes-workspace[data-panel="menu"] .route-notes-sheet-head { align-items:center; gap:10px; padding:28px 16px 0; }
.view-routes .route-notes-sheet-dot { flex:none; width:14px; height:14px; }
.view-routes .route-notes-workspace[data-panel="menu"] .route-notes-sheet-title { font:700 17px/1.3 var(--font-code); letter-spacing:.01em; }
.view-routes .route-notes-workspace[data-panel="menu"] .route-notes-sheet-subtitle { color:var(--muted); font-size:var(--fs-label); font-weight:500; }
.view-routes .route-notes-workspace[data-panel="menu"] .route-notes-sheet-body { padding:14px 16px calc(28px + env(safe-area-inset-bottom)); }
.view-routes .route-notes-workspace .route-notes-zone-actions-menu { display:grid; gap:14px; margin:0; }
.view-routes .route-notes-workspace .route-notes-zone-actions-menu > .route-notes-zone-action-group {
  display:grid; gap:6px; margin:0; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; overflow:visible;
}
.route-notes-menu-group { display:grid; overflow:hidden; border-radius:14px; background:var(--panel); }
.route-notes-menu-note { margin:0 6px; color:var(--muted); font-size:var(--fs-label); font-weight:500; line-height:1.5; }
.view-routes .route-notes-workspace .route-notes-menu-row {
  display:flex; align-items:center; gap:12px; width:100%; min-height:52px; margin:0; padding:0 16px;
  border:0; border-radius:0; background:transparent; color:var(--text); box-shadow:none;
  font:500 15px/1.3 var(--font-ui); text-align:left; cursor:pointer;
}
.view-routes .route-notes-workspace .route-notes-menu-row + .route-notes-menu-row { box-shadow:inset 0 1px 0 var(--line); }
.view-routes .route-notes-workspace .route-notes-menu-row:active { background:var(--btn-fill); }
.view-routes .route-notes-workspace .route-notes-menu-row:focus-visible { outline:3px solid color-mix(in srgb, var(--gold) 36%, transparent); outline-offset:-3px; }
.route-notes-menu-icon {
  display:grid; flex:none; place-items:center; width:30px; height:30px; border-radius:10px;
  background:var(--btn-fill); color:var(--text);
}
.route-notes-menu-icon :is(.route-notes-icon, svg) { width:18px; height:18px; stroke-width:1.9; }
.route-notes-menu-label { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.route-notes-menu-value { flex:none; max-width:45%; overflow:hidden; color:var(--muted); font-size:13px; font-weight:500; text-overflow:ellipsis; white-space:nowrap; }
.route-notes-menu-value:empty { display:none; }
.route-notes-menu-chevron { display:grid; flex:none; place-items:center; color:var(--map-dot); }
.route-notes-menu-chevron .route-notes-icon { width:14px; height:14px; stroke-width:2.4; }
.view-routes .route-notes-workspace .route-notes-menu-row.danger { color:var(--red); font-weight:600; }
.view-routes .route-notes-workspace .route-notes-menu-row.danger .route-notes-menu-icon { background:var(--red-bg); color:var(--red); }

/* ── 1단계 C3 삭제 확인: 가운데 대화창, [취소 | 삭제] ── */
.view-routes .route-notes-dialog-layer {
  position:absolute; z-index:8; inset:0 0 calc(-1 * var(--rn-under-b, 0px)) calc(-1 * var(--rn-under-l, 0px));
  display:grid; place-items:center; padding:0 24px;
}
.route-notes-dialog-scrim { position:absolute; inset:0; background:color-mix(in srgb, var(--scrim) 84%, transparent); }
.route-notes-dialog {
  position:relative; display:grid; gap:8px; box-sizing:border-box; width:100%; max-width:340px; padding:22px 16px 16px;
  border-radius:22px; background:var(--panel); color:var(--text); box-shadow:var(--shadow-modal); text-align:center;
}
.route-notes-dialog h3 { margin:0; font:700 17px/1.4 var(--font-ui); letter-spacing:-.02em; overflow-wrap:anywhere; }
.route-notes-dialog p { margin:0 0 10px; color:var(--muted); font-size:13px; font-weight:500; line-height:1.55; }
.route-notes-dialog-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.route-notes-dialog-actions .route-notes-button { width:100%; height:var(--btn-h); min-height:var(--btn-h); margin:0; }
/* 위험한 결정: 빨간 면 흰 글자. 크기는 보조 버튼과 같은 44px 알약 */
.view-routes .route-notes-dialog-actions .route-notes-dialog-delete {
  min-height:var(--btn-h); padding:0 18px; border:0; border-radius:var(--r-full); background:var(--red); color:var(--on-color); font-weight:700; box-shadow:none;
}

/* ── 1단계 D5 내 노트 ▾: 오른쪽 위 팝오버 ── */
.view-routes .route-notes-space-popover {
  position:absolute; z-index:6; top:calc(max(16px, calc(env(safe-area-inset-top) + 8px)) + 48px); right:12px;
  width:min(258px, calc(100% - 24px));
}
.route-notes-space-popover-card {
  display:grid; gap:4px; max-height:calc(var(--route-note-viewport-h, 100dvh) - 160px); overflow:auto; overscroll-behavior:contain;
  padding:14px; border-radius:18px; background:var(--panel); color:var(--text); box-shadow:0 16px 40px rgba(16,24,40,.22);
}
.route-notes-popover-label { margin:0 2px 2px; color:var(--muted); font-size:var(--fs-label); font-weight:600; }
.view-routes .route-notes-workspace .route-notes-space-popover .route-notes-space-options,
.view-routes .route-notes-workspace .route-notes-space-popover .route-notes-space-actions {
  display:grid; gap:0; margin:0; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; overflow:visible;
}
.view-routes .route-notes-workspace .route-notes-space-popover .route-notes-space-actions { margin-top:6px; padding-top:6px; box-shadow:inset 0 1px 0 var(--line); }
.route-notes-space-option {
  display:flex; align-items:center; gap:10px; width:100%; min-height:48px; margin:0; padding:4px 6px;
  border:0; border-radius:var(--r-sm); background:transparent; color:var(--text); text-align:left; cursor:pointer; font-family:var(--font-ui);
}
.route-notes-space-option:active { background:var(--btn-fill); }
.route-notes-space-option:focus-visible { outline:3px solid color-mix(in srgb, var(--gold) 36%, transparent); outline-offset:0; }
.route-notes-space-option-copy { display:grid; flex:1 1 auto; gap:2px; min-width:0; }
.route-notes-space-option-copy strong { overflow:hidden; font-size:var(--fs-body-l); font-weight:600; text-overflow:ellipsis; white-space:nowrap; }
.route-notes-space-option-copy small { overflow:hidden; color:var(--muted); font-size:var(--fs-caption); font-weight:500; text-overflow:ellipsis; white-space:nowrap; }
.route-notes-space-option > .route-notes-icon { flex:none; width:18px; height:18px; color:var(--gold); stroke-width:2.6; }
.view-routes .route-notes-workspace .route-notes-space-popover .route-notes-space-actions .route-notes-button {
  min-height:44px; padding:0 6px; gap:10px; border-radius:var(--r-sm); font-size:var(--fs-body-l); font-weight:500;
}
.view-routes .route-notes-workspace .route-notes-space-popover .route-notes-space-actions .route-notes-button + .route-notes-button { box-shadow:none; }
.view-routes .route-notes-workspace .route-notes-space-popover .route-notes-space-actions .route-notes-button > .route-notes-icon { flex-basis:24px; width:24px; height:24px; padding:3px; }

}
