@layer legacy {
/* A single tip opens as a card docked to the bottom of the map (the map keeps its
   pin in view). Lists and choices keep floating beside the place they came from. */
.route-notes-map-popup[data-docked="true"] {
  top:auto !important;
  right:0;
  bottom:0;
  left:0 !important;
  width:auto !important;
  max-width:none !important;
  max-height:min(62%,480px) !important;
  border:0;
  border-radius:var(--r-lg) var(--r-lg) 0 0;
  box-shadow:var(--shadow-dock);
  padding-bottom:env(safe-area-inset-bottom,0px);
}
.route-notes-map-popup[data-docked="true"]::before {
  content:"";
  display:block;
  width:36px;
  height:4px;
  margin:8px auto 0;
  border-radius:2px;
  background:var(--line-strong);
}
.view-routes .route-notes-workspace:has(> .route-notes-map-popup[data-docked="true"]:not([hidden])) .route-notes-fabs { bottom:calc(var(--route-note-docked-h,0px) + 12px) !important; }
.route-notes-map-popup[data-docked="true"] .route-notes-pin-popup { gap:12px; padding:10px 20px 18px; }
.route-notes-map-popup[data-docked="true"] .route-notes-pin-popup-close { top:6px; right:10px; }
.route-notes-pin-popup-kind {
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-bottom:8px;
  padding:4px 10px 4px 8px;
  border-radius:var(--r-full);
  background:color-mix(in srgb,var(--route-note-kind,var(--kind-default)) 12%,var(--on-color));
  color:var(--route-note-kind,var(--kind-default));
  font-size:var(--fs-label);
  font-weight:700;
}
.route-notes-pin-popup-kind .route-notes-icon { width:15px; height:15px; stroke-width:2; }
.route-notes-map-popup[data-docked="true"] .route-notes-pin-popup h3 { font-size:var(--fs-title-l); }
.route-notes-map-popup[data-docked="true"] .route-notes-pin-popup-footer { display:grid; gap:12px; }
.route-notes-map-popup[data-docked="true"] .route-notes-pin-popup-actions { display:flex; width:100%; gap:8px; margin:0; }
.route-notes-map-popup[data-docked="true"] .route-notes-pin-popup-actions .route-notes-button {
  flex:1 1 0;
  min-height:var(--btn-h);
  border:0;
  border-radius:var(--r-full);
  background:var(--panel2);
  color:var(--text);
  font-size:var(--fs-title);
  font-weight:700;
}
.route-notes-map-popup[data-docked="true"] .route-notes-pin-popup-actions .route-notes-button.primary { background:var(--gold); color:var(--gold-ink); }
/* 팁 쓰기: kind tiles, one large line, an optional note, then 위치 · 공용 팁 · 팀에 공개
   as quiet rows, and a save bar that stays at the bottom. Labels 14px, fields 16–17px,
   20px between sections, 62px rows. */
.view-routes .route-notes-form { display:grid; gap:20px; }
.route-notes-form .route-notes-marker-field legend { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.view-routes .route-notes-form .route-notes-form-label,
.view-routes .route-notes-form .route-notes-field > span { margin:0 0 8px; color:var(--text); font-size:var(--fs-body-l); font-weight:700; }
.view-routes .route-notes-form .route-notes-field { display:grid; gap:0; }
.view-routes .route-notes-form .route-notes-marker-field { display:grid; gap:0; margin:0; padding:0; border:0; }
.view-routes .route-notes-form .route-notes-marker-grid,
.view-routes .route-notes-form .route-notes-marker-more-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:0; padding:0; }
.view-routes .route-notes-form .route-notes-marker-more-grid { margin-top:8px; }
.view-routes .route-notes-form .route-notes-marker-grid .route-notes-button,
.view-routes .route-notes-form .route-notes-marker-more-grid .route-notes-button {
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px;
  min-width:0; min-height:74px; padding:10px 2px 8px;
  border:1.5px solid transparent; border-radius:var(--r-md);
  background:var(--panel2); color:var(--muted);
  font-size:var(--fs-label); font-weight:600; line-height:1.25; text-align:center;
}
.view-routes .route-notes-form .route-notes-marker-grid .route-notes-button .route-notes-icon,
.view-routes .route-notes-form .route-notes-marker-more-grid .route-notes-button .route-notes-icon {
  box-sizing:border-box; width:34px; height:34px; padding:8px; border-radius:50%;
  background:var(--panel); color:var(--route-note-kind,var(--kind-default));
}
.view-routes .route-notes-form .route-notes-marker-grid .route-notes-button[aria-pressed="true"],
.view-routes .route-notes-form .route-notes-marker-more-grid .route-notes-button[aria-pressed="true"] {
  border-color:var(--route-note-kind,var(--kind-default)); background:color-mix(in srgb,var(--route-note-kind,var(--kind-default)) 10%,var(--panel)); color:var(--text);
}
.view-routes .route-notes-form .route-notes-button[aria-pressed="true"] .route-notes-icon { background:var(--route-note-kind,var(--kind-default)); color:var(--on-color); }
.view-routes .route-notes-form .route-notes-marker-more { justify-self:start; width:auto; min-height:36px; margin-top:6px; padding:4px 2px; border:0; background:none; color:var(--muted); font-size:var(--fs-body); text-decoration:underline; text-underline-offset:3px; }
.view-routes .route-notes-form #routeNoteTipTitle {
  min-height:52px; padding:0 14px; border:1.5px solid var(--line); border-radius:var(--r-md);
  background:var(--panel); font-size:var(--fs-title-m); font-weight:600;
}
.view-routes .route-notes-form #routeNoteTipMemo { min-height:76px; padding:12px 14px; border:1.5px solid var(--line); border-radius:var(--r-md); background:var(--panel); font-size:var(--fs-title-m); }
.view-routes .route-notes-form #routeNoteTipTitle:focus,
.view-routes .route-notes-form #routeNoteTipMemo:focus { border-color:var(--gold); }
.route-notes-title-count { display:block; margin-top:6px; color:var(--muted); font-size:var(--fs-label); text-align:right; }
.view-routes .route-notes-form .route-notes-tip-description { display:grid; gap:6px; }
.view-routes .route-notes-form .route-notes-tip-description .route-notes-field > span::after { content:"선택"; margin-left:6px; color:var(--muted); font-size:var(--fs-body); font-weight:500; }
.view-routes .route-notes-form .route-notes-tip-description .route-notes-form-hint { margin:0; color:var(--muted); font-size:var(--fs-label); line-height:1.5; }
/* 위치 · 공용 팁으로 · 팀에 공개 */
.route-notes-form-rows { display:grid; border-top:1px solid var(--line); }
.view-routes .route-notes-form .route-notes-tip-location,
.view-routes .route-notes-form .route-notes-form-row {
  position:relative; display:flex; flex-wrap:wrap; align-items:center; gap:0 12px;
  min-height:62px; margin:0; padding:8px 0; border:0; border-bottom:1px solid var(--line); border-radius:0; background:none;
}
.route-notes-row-icon { display:grid; place-items:center; flex:none; width:34px; height:34px; border-radius:var(--r-md); background:var(--panel2); color:var(--muted); }
.route-notes-row-icon .route-notes-icon { width:18px; height:18px; }
.route-notes-row-copy { flex:1; min-width:0; display:grid; gap:2px; }
.route-notes-row-copy strong { color:var(--text); font-size:var(--fs-title); font-weight:700; }
.view-routes .route-notes-form .route-notes-row-copy p,
.route-notes-row-copy small { margin:0; color:var(--muted); font-size:var(--fs-body); font-weight:500; line-height:1.4; white-space:normal; }
.view-routes .route-notes-form .route-notes-tip-location > .route-notes-row-action {
  flex:none; min-height:36px; padding:0 12px; border:1px solid var(--line); border-radius:var(--r-lg);
  background:var(--panel); color:var(--text); font-size:var(--fs-body); font-weight:700;
}
.view-routes .route-notes-form .route-notes-tip-location > .route-notes-form-hint { flex:1 1 100%; margin:4px 0 0 46px; }
/* 공용 팁으로: the whole row toggles; aria-pressed draws the switch. */
.view-routes .route-notes-form .route-notes-common-row .route-notes-row-copy { padding-right:58px; }
.view-routes .route-notes-form .route-notes-location-common {
  position:static; justify-content:flex-start; min-height:0; padding:0; border:0; background:none;
  color:var(--text); font-size:var(--fs-title); font-weight:700; text-align:left;
}
.view-routes .route-notes-form .route-notes-location-common::before { content:""; position:absolute; inset:0; }
.view-routes .route-notes-form .route-notes-location-common::after {
  content:""; position:absolute; top:50%; right:0; width:46px; height:28px; border-radius:var(--r-md); transform:translateY(-50%);
  background:radial-gradient(circle at 14px 50%,var(--on-color) 10px,transparent 11px),var(--map-track);
  transition:background 160ms ease;
}
.view-routes .route-notes-form .route-notes-location-common[aria-pressed="true"]::after { background:radial-gradient(circle at 32px 50%,var(--on-color) 10px,transparent 11px),var(--gold); }
.view-routes .route-notes-form .route-notes-location-common:disabled::after { opacity:.55; }
.view-routes .route-notes-form .route-notes-share-toggle {
  display:grid; grid-template-columns:34px minmax(0,1fr) auto; grid-template-areas:"icon title switch" "icon note switch";
  align-items:center; gap:2px 12px;
}
.view-routes .route-notes-form .route-notes-share-toggle > .route-notes-row-icon { grid-area:icon; }
.view-routes .route-notes-form .route-notes-share-toggle > strong { grid-area:title; align-self:end; font-size:var(--fs-title); font-weight:700; }
.view-routes .route-notes-form .route-notes-share-toggle > small { grid-area:note; grid-column:auto; align-self:start; font-size:var(--fs-body); }
.view-routes .route-notes-form .route-notes-share-toggle > input { grid-area:switch; }
/* Save bar */
.view-routes .route-notes-form .route-notes-form-actions {
  position:sticky; bottom:0; z-index:1; display:flex; gap:8px; margin:0 -2px; padding:10px 2px calc(10px + env(safe-area-inset-bottom));
  border-top:1px solid var(--line); background:var(--panel);
}
.view-routes .route-notes-form .route-notes-form-actions .route-notes-button { min-width:0; min-height:var(--btn-h); border:0; border-radius:var(--r-full); font-size:var(--btn-fs); font-weight:700; }
.view-routes .route-notes-form .route-notes-form-actions .route-notes-button.secondary { flex:0 0 104px; background:var(--panel2); color:var(--text); }
.view-routes .route-notes-form .route-notes-form-actions .route-notes-button.primary { flex:1; }
/* The docked tip card rises from the bottom edge; its map buttons ride above it. */
@media (prefers-reduced-motion:no-preference) {
  .route-notes-map-popup[data-docked="true"] { transition:transform var(--spring-quick-ms) var(--spring-quick), display var(--spring-quick-ms) allow-discrete; }
  @starting-style { .route-notes-map-popup[data-docked="true"]:not([hidden]) { transform:translateY(100%); } }
  .route-notes-form .route-notes-marker-grid .route-notes-button { transition:background-color 160ms ease, color 160ms ease, transform 150ms ease; }
  .route-notes-form .route-notes-marker-grid .route-notes-button:active { transform:scale(.96); }
  .route-notes-map-popup[data-docked="true"] .route-notes-pin-popup-actions .route-notes-button { transition:filter 150ms ease; }
  .route-notes-map-popup[data-docked="true"] .route-notes-pin-popup-actions .route-notes-button:active { filter:brightness(.92); }
}
/* The spot card: a tap on a zone shows that code's tips at once. */
.route-notes-place-card { grid-template-columns:minmax(0,1fr); gap:10px; padding:6px 20px 18px; }
.route-notes-place-head { display:flex; align-items:center; gap:8px; }
.route-notes-place-title { flex:1; min-width:0; display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; }
.route-notes-place-code { margin:0; padding:4px 10px; border-radius:var(--r-sm); background:var(--gold); color:var(--gold-ink); font:800 var(--fs-title)/1.25 var(--font-code, inherit); }
.route-notes-place-title small { color:var(--muted); font-size:var(--fs-label); }
/* 건물 기본 정보(2026-11-11): 짧아도 건물 이름 옆에 붙지 않고 늘 제 줄을 쓴다. 왼쪽 끝은 구역 코드와 맞춘다. */
.route-notes-place-title .route-notes-building-facts { flex-basis:100%; }
.route-notes-place-add { flex:none; min-height:40px; padding:6px 12px; border-radius:var(--r-full); }
.route-notes-place-counts { display:flex; flex-wrap:wrap; gap:6px; margin:0; }
.route-notes-place-count { padding:6px 12px; border-radius:var(--r-full); background:var(--panel2); color:var(--muted); font-size:var(--fs-label); font-weight:700; }
.route-notes-place-count[data-active="true"] { background:color-mix(in srgb,var(--gold) 14%,var(--panel)); color:var(--gold); }
.route-notes-place-tip { display:grid; gap:4px; padding:12px 14px; border-radius:var(--r-md); background:var(--panel2); }
.route-notes-place-kind { display:flex; align-items:center; gap:6px; margin:0; color:var(--route-note-kind,var(--kind-default)); font-size:var(--fs-label); font-weight:800; }
.route-notes-place-kind .route-notes-icon { width:15px; height:15px; }
.route-notes-place-kind small { margin-left:auto; color:var(--muted); font-weight:600; }
.route-notes-place-tip h4 { margin:2px 0 0; }
.route-notes-place-tip-open { min-height:32px; padding:0; border:0; background:none; color:var(--text); font:700 var(--fs-body)/1.35 var(--font-ui, inherit); text-align:left; }
.route-notes-place-memo { display:grid; gap:6px; color:var(--text); font-size:var(--fs-body); line-height:1.5; }
.route-notes-place-memo p { margin:0; overflow-wrap:anywhere; }
.route-notes-place-tip[data-short="true"] .route-notes-place-memo { max-height:5.2em; overflow:hidden; mask-image:linear-gradient(#000 60%,transparent); }
/* A delivery order written as a sequence reads as numbered stops. */
.route-notes-place-order { display:flex; flex-wrap:wrap; gap:6px; margin:0; padding:0; list-style:none; counter-reset:stop; }
.route-notes-place-order li { counter-increment:stop; display:inline-flex; align-items:center; gap:6px; padding:4px 10px 4px 6px; border-radius:var(--r-sm); background:var(--panel); font-size:var(--fs-label); font-weight:600; }
.route-notes-place-order li::before { content:counter(stop); display:grid; place-items:center; width:19px; height:19px; border-radius:50%; background:var(--kind-market); color:var(--on-color); font-size:var(--fs-caption); font-weight:800; }
.route-notes-place-section { margin:6px 0 0; font-size:var(--fs-body); }
.route-notes-place-rows { display:grid; }
.route-notes-place-row { justify-content:flex-start; gap:10px; min-height:48px; padding:6px 0; border:0; border-bottom:1px solid var(--line); border-radius:0; background:none; text-align:left; }
.route-notes-place-row .route-notes-icon { color:var(--route-note-kind,var(--kind-default)); }
.route-notes-place-more { justify-self:center; min-height:40px; border:0; background:none; color:var(--muted); }
.route-notes-place-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:4px; }
.route-notes-place-actions .route-notes-button { min-height:48px; }
.route-notes-map-popup[data-docked="true"][data-expanded="true"] { max-height:min(78%,640px) !important; overflow:auto; overscroll-behavior:contain; }
/* 공통 팁(2026-10-21): 아래에 붙는 넓은 카드, 사진은 크게 보고 넘겨 본다 */
.route-notes-map-popup[data-docked="true"]:has(> .route-notes-common-popup) { max-height:min(78%,640px) !important; }
.route-notes-map-popup[data-docked="true"] .route-notes-common-popup { gap:12px; padding:14px 20px 20px; }
.route-notes-map-popup[data-docked="true"] .route-notes-common-tip .route-notes-tip-photo { height:180px; }
.route-notes-map-popup[data-docked="true"] .route-notes-common-tip .route-notes-tip-photos { scrollbar-width:none; }
.route-notes-map-popup[data-docked="true"] .route-notes-common-tip .route-notes-tip-photos::-webkit-scrollbar { display:none; }
}
/* 빈 제목 안내(2026-10-21 UX 점검 M13)와 한국어 줄바꿈(L1): 시트 글은 낱말 중간에서 끊지 않는다. */
.route-notes-field input[aria-invalid="true"] { border-color:var(--danger, #d92d20); }
.route-notes-field-error { color:var(--danger, #d92d20); font-size:var(--fs-label); font-weight:500; }
.route-notes-sheet-body { word-break:keep-all; overflow-wrap:anywhere; }
