:root {
  --bg: #f5f7f4;
  --panel: #ffffff;
  --ink: #15201c;
  --muted: #65706b;
  --line: #dbe2dd;
  --green: #237a52;
  --green-dark: #145c3c;
  --blue: #2f6ea6;
  --amber: #b2681b;
  --red: #a94036;
  --shadow: 0 18px 42px rgba(20, 34, 28, 0.16);
  font-family: var(--ss-font-sans);
}

@media(max-width:600px){.detail-close,.detail-peek-toggle,.detail-hero-tools button{min-width:44px;min-height:44px}}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(340px, 410px) minmax(0, 1fr);
  height: 100vh;
  min-height: 680px;
  overflow: hidden;
}

.sidebar {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  background: var(--panel);
  border-right: 1px solid var(--line);
  min-height: 0;
  z-index: 10;
}

.app-header {
  padding: 24px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8faf8;
}

.stats span {
  display: block;
  font-size: 24px;
  font-weight: 850;
  line-height: 1;
}

.stats small {
  color: var(--muted);
  font-size: 12px;
}

.controls {
  display: grid;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}

.visit-tools a,
.blog-empty a,
.post-map-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid #cbd8d0;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--green-dark);
  background: #fff;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #cfd8d3;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

.field input,
.field select {
  min-height: 40px;
}

.field textarea {
  min-height: 118px;
  resize: vertical;
  line-height: 1.45;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.check-row input:focus,
button:focus {
  outline: 3px solid rgba(47, 110, 166, 0.24);
  outline-offset: 2px;
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-switch label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid #cbd8d0;
  border-radius: 8px;
  background: #fff;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 850;
}

.mode-switch span {
  pointer-events: none;
}

.mode-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-switch label:has(input:checked) {
  border-color: var(--green);
  background: rgba(35, 122, 82, 0.11);
  color: var(--green-dark);
}

.mode-controls {
  display: grid;
  gap: 12px;
}

.mode-controls[hidden] {
  display: none;
}

.control-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

/* Mountain Atlas — 지도·코스·고도 단면을 한 화면에서 읽는 공통 셸 */
.elevation-dock {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  z-index: 720;
  overflow: hidden;
  border: 1px solid rgba(18, 35, 26, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 36px rgba(18, 35, 26, 0.22);
  backdrop-filter: blur(14px);
}

.elevation-dock[hidden] { display: none; }

.elevation-dock-head {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto 36px;
  align-items: center;
  gap: 16px;
  min-height: 52px;
  padding: 8px 10px 8px 16px;
  border-bottom: 1px solid rgba(18, 35, 26, 0.1);
}

.elevation-dock-head > div { min-width: 0; }
.elevation-dock-head > div span {
  display: block;
  color: #657068;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.elevation-dock-head strong {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: #10261c;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.elevation-dock-head p {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: #46544c;
  font-size: 12px;
  white-space: nowrap;
}
.elevation-dock-head p strong { display: inline; margin: 0; font-size: 15px; }
.elevation-dock-head p em { font-style: normal; font-weight: 800; }
.elevation-dock-head button {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(18, 35, 26, .14);
  border-radius: 10px;
  background: #f4f7f4;
  color: #173d2d;
  font-size: 18px;
  cursor: pointer;
}
.elevation-dock-body { height: 168px; padding: 4px 14px 8px; }
.elevation-dock-body .route-profile { height: 100%; min-height: 0; width: 100%; overflow: visible; }
.elevation-dock-body .route-profile svg { display: block; width: 100%; height: 100%; overflow: visible; }
.elevation-dock.is-collapsed .elevation-dock-body { display: none; }
.elevation-dock.is-collapsed .elevation-dock-head { border-bottom: 0; }
.map-area:has(.elevation-dock:not([hidden]):not(.is-collapsed)) .map-legend { bottom: 242px; }
.map-area:has(.elevation-dock.is-collapsed) .map-legend { bottom: 78px; }
.map-area:has(.elevation-dock:not([hidden]):not(.is-collapsed)) .leaflet-bottom.leaflet-right { bottom: 242px !important; transition: bottom 0.2s ease; }
.map-area:has(.elevation-dock.is-collapsed) .leaflet-bottom.leaflet-right { bottom: 78px !important; transition: bottom 0.2s ease; }

/* 선택된 코스 들머리/정상/종점 핀 뱃지 */
.route-pin-marker {
  overflow: visible !important;
  pointer-events: auto;
}
.route-badge-pin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.38), 0 0 0 2px #ffffff;
  cursor: pointer;
  transition: transform 0.15s ease;
  user-select: none;
}
.route-badge-pin:hover {
  transform: translateY(-2px) scale(1.08);
}
.route-badge-start {
  background: #1976d2;
  color: #ffffff;
}
.route-badge-peak {
  background: #d32f2f;
  color: #ffffff;
}
.route-badge-end {
  background: #2e7d32;
  color: #ffffff;
}
.route-badge-pin .pin-icon {
  font-size: 13px;
  line-height: 1;
}
.route-badge-pin .pin-text {
  font-size: 12px;
  letter-spacing: -0.3px;
}

.map-basemap-control {
  top: 12px;
  right: 12px;
  left: auto;
}
.map-visibility-control {
  top: 12px;
  right: 224px;
  left: auto;
  padding: 4px;
}
.map-visibility-control label { min-height: 32px; padding: 0 8px; }
.mountain-row { min-height: 46px; }
.mountain-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
}
.mountain-main {
  display: grid;
  grid-template-columns: minmax(92px, .7fr) minmax(0, 1.3fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.mountain-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .map-visibility-control { top: 58px; right: 12px; }
  .elevation-dock { right: 10px; bottom: 10px; left: 10px; }
}

@media (max-width: 680px) {
  .map-basemap-control { max-width: 180px; }
  .map-visibility-control label span { font-size: 12px; }
  .elevation-dock-head {
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 8px;
    min-height: 48px;
    padding-left: 12px;
  }
  .elevation-dock-head p { grid-column: 1 / -1; display: none; }
  .elevation-dock-body { height: 122px; padding-inline: 4px; }
  .map-area:has(.elevation-dock:not([hidden]):not(.is-collapsed)) .map-legend { display: none; }
}

.route-safety-notice {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #d9b36b;
  border-radius: 8px;
  background: #fff8e8;
  color: #6b4c12;
  font-weight: 700;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #344039;
  font-size: 14px;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 8px;
}

.button-row button,
.detail-actions button,
.form-actions button,
.visit-card-actions button,
.visit-card-actions a,
.visit-tools button {
  min-height: 38px;
  border: 1px solid #cbd8d0;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.button-row button:first-child,
.detail-actions .primary,
.form-actions .primary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.visit-tools {
  display: grid;
  grid-template-columns: 1fr 94px 1fr;
  gap: 8px;
}

.sync-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.sync-panel .section-title-row {
  margin-bottom: 0;
}

.sync-panel .section-title-row span {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 850;
  text-align: right;
}

.sync-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.sync-actions button {
  min-height: 34px;
  border: 1px solid #cbd8d0;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.sync-actions button:hover {
  border-color: var(--green);
  color: var(--green-dark);
}

.legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.legend span {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
}

.dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(20, 34, 28, 0.25);
  flex: 0 0 auto;
}

.h-low {
  background: var(--blue);
}

.h-mid {
  background: var(--green);
}

.h-high {
  background: var(--amber);
}

.h-top {
  background: var(--red);
}

.mountain-list {
  min-height: 0;
  overflow: auto;
  padding: 10px 12px 18px;
}

.mountain-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border-radius: 8px;
  padding: 8px 10px;
}

.mountain-row:hover,
.mountain-row.is-selected {
  background: #eef5f0;
}

.done-box {
  width: 18px;
  height: 18px;
  margin-top: 7px;
  accent-color: var(--green);
}

.mountain-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
}

.mountain-main {
  min-width: 0;
}

.mountain-name {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 15px;
  font-weight: 850;
}

.mountain-name span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mountain-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.park-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  max-width: 118px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(35, 122, 82, 0.28);
  color: var(--green-dark);
  background: rgba(35, 122, 82, 0.08);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-area {
  position: relative;
  min-width: 0;
  min-height: 0;
}

#map {
  width: 100%;
  height: 100%;
}

.map-basemap-control {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 650;
  display: grid;
  gap: 5px;
  width: min(220px, calc(100% - 28px));
  border: 1px solid rgba(21, 32, 28, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  padding: 10px;
  box-shadow: 0 12px 30px rgba(20, 34, 28, 0.16);
  backdrop-filter: blur(8px);
}

.map-basemap-control span {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 850;
}

.map-basemap-control select {
  width: 100%;
  min-height: 36px;
  border: 1px solid #cfd8d3;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 7px 9px;
  outline: none;
}

.map-basemap-control select:focus {
  outline: 3px solid rgba(47, 110, 166, 0.24);
  outline-offset: 2px;
}

.map-visibility-control {
  position: absolute;
  top: 108px;
  left: 398px;
  z-index: 710;
  display: flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(21, 32, 28, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 3px 12px rgba(18, 35, 26, 0.14);
}

.map-visibility-control label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 9px;
  border-radius: 8px;
  color: var(--jp-ink, var(--ink));
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.map-visibility-control label:has(input:checked) {
  background: #e5f3e9;
  color: var(--green-dark);
}

.map-visibility-control input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--green);
}

.map-visibility-control input:focus-visible {
  outline: 3px solid rgba(47, 110, 166, 0.24);
  outline-offset: 2px;
}

@media (max-width: 1180px) {
  .map-visibility-control {
    top: 106px;
    right: 22px;
    left: auto;
  }
}

@media (max-width: 900px) {
  .map-visibility-control {
    top: 116px;
    right: 12px;
  }
}

@media (min-width: 521px) and (max-width: 900px) {
  .map-visibility-control {
    top: 88px;
  }
}

.detail-panel {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 600;
  width: min(430px, calc(100% - 36px));
  max-height: min(690px, calc(100% - 36px));
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(21, 32, 28, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.detail-panel:empty {
  display: none;
}

.detail-panel h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

.detail-subtitle {
  margin: 5px 0 12px;
  color: var(--green-dark);
  font-weight: 800;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.detail-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #f8faf8;
}

.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-grid strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
}

.detail-block {
  margin: 14px 0 0;
}

.detail-block h3 {
  margin: 0 0 5px;
  font-size: 13px;
}

.detail-block p {
  display: -webkit-box;
  margin: 0;
  color: #38443f;
  font-size: 13px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.seoraksan-course-reference {
  overflow: hidden;
  border: 1px solid #d5e1d8;
  border-radius: 12px;
  background: #f8fbf9;
}

.seoraksan-course-reference > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  color: #17382a;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.seoraksan-course-reference > summary small {
  flex: 0 0 auto;
  color: #5c6a61;
  font-size: 12px;
  font-weight: 750;
}

.seoraksan-course-reference-body {
  padding: 0 13px 13px;
  border-top: 1px solid #e2eae4;
}

.seoraksan-course-reference-body .control-note {
  display: block;
  margin-top: 9px;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.seoraksan-course-reference-list {
  display: grid;
  gap: 7px;
  margin: 11px 0 0;
  padding: 0;
  list-style: none;
}

.seoraksan-course-reference-list li {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid #e0e8e2;
  border-radius: 9px;
  background: #ffffff;
}

.seoraksan-course-reference-list a {
  color: #1f6f4a;
  font-size: 13px;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.seoraksan-course-facts,
.seoraksan-course-section,
.seoraksan-course-reference-list small {
  color: #526057;
  font-size: 12px;
  line-height: 1.45;
}

.seoraksan-current-access-reference {
  overflow: hidden;
  border: 1px solid #d5e1d8;
  border-radius: 12px;
  background: #f8fbf9;
}

.seoraksan-current-access-reference > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  color: #17382a;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.seoraksan-current-access-reference > summary small {
  flex: 0 0 auto;
  color: #5c6a61;
  font-size: 12px;
  font-weight: 750;
}

.seoraksan-current-access-reference-body {
  padding: 0 13px 13px;
  border-top: 1px solid #e2eae4;
}

.seoraksan-current-access-reference-body .control-note {
  display: block;
  margin-top: 9px;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.seoraksan-current-access-reference-body h4 {
  margin: 13px 0 0;
  color: #2f3d36;
  font-size: 12px;
}

.seoraksan-current-access-axis-list {
  display: grid;
  gap: 6px;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
}

.seoraksan-current-access-axis-list li {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid #e0e8e2;
  border-radius: 9px;
  background: #ffffff;
}

.seoraksan-current-access-axis-list strong {
  color: #2f3d36;
  font-size: 12px;
}

.seoraksan-current-access-axis-list small {
  color: #67736c;
  font-size: 12px;
  line-height: 1.4;
}

.detail-block .seoraksan-current-access-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  margin-top: 11px;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.seoraksan-current-access-links a {
  color: #1f6f4a;
  font-size: 12px;
  font-weight: 800;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.seoraksan-course-section {
  color: #2f3d36;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.section-title-row h3 {
  margin: 0;
  font-size: 15px;
}

.section-title-row a {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 850;
}

.journal-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.route-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.route-panel .section-title-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.route-list {
  display: grid;
  gap: 8px;
}

.route-list button {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 44px;
  border: 1px solid #d9e2dd;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  text-align: left;
}

.route-list button.is-selected {
  border-color: var(--green);
  background: rgba(35, 122, 82, 0.09);
}

.route-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.route-list span {
  color: var(--muted);
  font-size: 12px;
}

.visit-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.visit-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.visit-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid #edf1ee;
}

.visit-card:first-child {
  border-top: 0;
}

.visit-card time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.visit-card h4 {
  margin: 2px 0 3px;
  font-size: 14px;
}

.visit-meta-line,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 4px 0 6px;
}

.visit-meta-line span,
.tag-list span {
  border: 1px solid #dfe8e2;
  border-radius: 999px;
  background: #f6faf7;
  color: #345044;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 800;
}

.visit-card p {
  display: -webkit-box;
  margin: 0;
  color: #39453f;
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.visit-card-actions {
  display: grid;
  gap: 6px;
}

.visit-card-actions button,
.visit-card-actions a {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.visit-form {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 86px;
  gap: 8px;
}

.gpx-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 8px;
  align-items: center;
  border: 1px solid #dfe8e2;
  border-radius: 8px;
  background: #f8fbf9;
  padding: 8px;
}

.gpx-preview p {
  margin: 0;
  color: #345044;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.gpx-preview button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 92px 40px;
  gap: 8px;
  margin-top: 16px;
}

.detail-actions .icon-button {
  padding: 0;
}

.leaflet-popup-content {
  min-width: 210px;
}

.popup-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 850;
}

.popup-meta {
  margin: 0;
  color: #4d5b54;
  font-size: 12px;
}

.empty-state {
  padding: 26px 10px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

@media (max-width: 520px) {
.app-header,
.controls,
.legend {
    padding-left: 16px;
    padding-right: 16px;
  }

  h1 {
    font-size: 22px;
  }

  .control-grid,
.mode-switch,
.legend,
.button-row {
    grid-template-columns: 1fr;
  }

  .stats span {
    font-size: 19px;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .visit-tools,
.sync-actions,
.form-row,
.gpx-preview,
.form-actions {
    grid-template-columns: 1fr;
  }
}

.blog-page {
  min-height: 100%;
  background: var(--bg);
}

.blog-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 5vw, 56px) 22px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.blog-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 22px auto 48px;
}

.blog-dashboard {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.blog-dashboard div,
.blog-controls {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.blog-dashboard div {
  padding: 16px;
}

.blog-dashboard span {
  display: block;
  font-size: 26px;
  font-weight: 850;
}

.blog-dashboard small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.blog-controls {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(150px, 0.6fr) minmax(150px, 0.7fr) minmax(280px, 360px);
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.blog-sync-panel {
  margin-top: 12px;
}

.blog-post,
.blog-empty,
.blog-detail {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.blog-post img,
.blog-detail img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #dfe7e1;
}

.blog-post-body,
.blog-empty {
  padding: 18px;
}

.post-kicker {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 850;
}

.blog-post h2,
.blog-empty h2 {
  margin: 8px 0 12px;
  font-size: 22px;
  letter-spacing: 0;
}

.post-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 0 0 14px;
}

.post-meta div {
  min-width: 0;
  border: 1px solid #edf1ee;
  border-radius: 8px;
  padding: 8px;
}

.post-meta dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.post-meta dd {
  margin: 2px 0 0;
  font-size: 13px;
}

.blog-post section {
  margin-top: 12px;
}

.blog-post h3 {
  margin: 0 0 5px;
  font-size: 13px;
}

.blog-post p,
.blog-empty p {
  margin: 0;
  color: #39453f;
  line-height: 1.6;
}

.post-map-link {
  width: fit-content;
  margin-top: 16px;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.post-actions button,
.detail-close {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 850;
  cursor: pointer;
}

.post-actions .post-map-link {
  margin-top: 0;
}

.blog-detail {
  position: relative;
  margin-top: 18px;
}

.blog-detail[hidden] {
  display: none;
}

.blog-detail article {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
}

.blog-detail img {
  height: 100%;
  min-height: 360px;
}

.detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  padding: 0;
  font-size: 22px;
}

.blog-empty {
  grid-column: 1 / -1;
  text-align: center;
}

.blog-redirect {
  display: grid;
  align-content: center;
  justify-items: start;
  min-height: 100vh;
  padding: 40px clamp(22px, 8vw, 96px);
  background: var(--panel);
}

.blog-redirect h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 44px);
}

.blog-redirect p:not(.eyebrow) {
  margin: 0 0 20px;
  color: var(--muted);
}

.blog-redirect a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--green);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--green);
  color: #fff;
  font-weight: 850;
  text-decoration: none;
}

@media (max-width: 1060px) {
.blog-dashboard {
    grid-template-columns: repeat(3, 1fr);
  }

  .blog-controls {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
.blog-hero,
.blog-controls {
    grid-template-columns: 1fr;
  }

  .blog-hero {
    display: grid;
    align-items: start;
  }

  .blog-dashboard {
    grid-template-columns: 1fr;
  }

  .blog-detail article {
    grid-template-columns: 1fr;
  }

  .blog-detail img {
    min-height: 0;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Immersive map redesign */
body {
  overflow: hidden;
  background: #0d1714;
}

.app-shell {
  position: relative;
  display: block;
  height: 100dvh;
  min-height: 680px;
  overflow: hidden;
}

.map-area {
  position: absolute;
  inset: 0;
  z-index: 0;
  min-width: 0;
  min-height: 0;
}

#map {
  width: 100%;
  height: 100dvh;
  min-height: 100%;
  background: #90d3ed;
}

.sidebar {
  position: absolute;
  top: 20px;
  left: 22px;
  bottom: 20px;
  z-index: 640;
  display: grid;
  grid-template-rows: auto auto minmax(0, 2fr) auto minmax(52px, 0.3fr);
  width: min(360px, calc(100vw - 44px));
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(61, 82, 91, 0.86), rgba(34, 52, 58, 0.82)),
    rgba(24, 39, 45, 0.82);
  box-shadow: 0 22px 58px rgba(8, 16, 13, 0.35);
  color: #f7fbf8;
  backdrop-filter: blur(18px) saturate(1.12);
}

.app-header {
  padding: 20px 22px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.eyebrow {
  color: #a7dfbf;
}

.sidebar h1 {
  color: #ffffff;
  font-size: 25px;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.26);
}

.visit-tools a {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.12);
  color: #eef8f1;
}

.stats {
  gap: 8px;
  margin-top: 16px;
}

.stats div {
  min-height: 64px;
  border-color: rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.stats span {
  color: #ffffff;
  font-size: 24px;
}

.stats small {
  color: rgba(242, 248, 244, 0.82);
  font-weight: 800;
}

.controls {
  gap: 13px;
  min-height: 0;
  overflow: auto;
  padding: 16px 22px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  scrollbar-color: rgba(255, 255, 255, 0.36) transparent;
}

.sidebar .field span,
.sidebar .control-note,
.sidebar .sync-panel .section-title-row span {
  color: rgba(241, 248, 243, 0.78);
}

.sidebar .field input,
.sidebar .field select,
.sidebar .field textarea {
  border-color: rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sidebar .field input::placeholder,
.sidebar .field textarea::placeholder {
  color: rgba(244, 248, 246, 0.68);
}

.sidebar .field select option {
  color: #15201c;
  background: #ffffff;
}

#searchInput {
  padding-left: 40px;
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='7' stroke='%2365706b' stroke-width='2'/%3E%3Cpath d='M20 20l-3.5-3.5' stroke='%2365706b' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 13px 50%;
  background-size: 18px 18px;
}

.mode-switch label,
.sync-panel {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
}

.mode-switch label {
  color: rgba(241, 248, 243, 0.9);
}

.mode-switch label:has(input:checked) {
  border-color: rgba(157, 222, 185, 0.72);
  background: #247c3c;
  color: #ffffff;
}

.check-row {
  color: rgba(248, 252, 249, 0.92);
  font-weight: 750;
}

.check-row input {
  width: 19px;
  height: 19px;
  border-radius: 5px;
  accent-color: #2f8e46;
}

.button-row {
  grid-template-columns: 1fr 76px;
}

.button-row button,
.detail-actions button,
.form-actions button,
.visit-card-actions button,
.visit-card-actions a,
.visit-tools button {
  border-color: rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.button-row button:first-child,
.detail-actions .primary,
.form-actions .primary {
  border-color: #2f8e46;
  background: linear-gradient(180deg, #2f8e46, #24783c);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.sync-actions button {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sync-actions button:hover {
  border-color: rgba(157, 222, 185, 0.72);
  color: #ffffff;
}

.legend {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(241, 248, 243, 0.84);
}

.mountain-list {
  min-height: 0;
  overflow: auto;
  scrollbar-color: rgba(255, 255, 255, 0.36) transparent;
}

.mountain-row {
  border: 1px solid transparent;
}

.mountain-row:hover,
.mountain-row.is-selected {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.11);
}

.mountain-name {
  color: #ffffff;
}

.mountain-meta {
  color: rgba(241, 248, 243, 0.7);
}

.park-chip {
  border-color: rgba(157, 222, 185, 0.45);
  background: rgba(35, 122, 82, 0.44);
  color: #e4f8ea;
}

.map-basemap-control {
  top: 20px;
  right: auto;
  left: 398px;
  z-index: 700;
  width: 214px;
  border-color: rgba(21, 32, 28, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px rgba(20, 34, 28, 0.18);
  backdrop-filter: blur(14px);
}

.detail-panel {
  top: 20px;
  right: 22px;
  bottom: auto;
  z-index: 660;
  width: min(390px, calc(100vw - 44px));
  max-height: calc(100dvh - 40px);
  overflow: auto;
  padding: 0;
  border: 1px solid rgba(21, 32, 28, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 62px rgba(8, 18, 12, 0.28);
  backdrop-filter: blur(14px);
}

.detail-hero {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 16px;
  background: linear-gradient(135deg, #2e853f, #176638);
  color: #ffffff;
}

.detail-hero h2 {
  margin: 0;
  color: #ffffff;
}

.detail-hero .detail-subtitle {
  margin: 5px 0 0;
  color: rgba(244, 252, 247, 0.92);
}

.detail-panel .detail-close {
  position: static;
  flex: 0 0 auto;
  width: 34px;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.detail-body {
  padding: 18px 20px 20px;
}

.detail-grid {
  gap: 10px;
  margin: 0 0 14px;
}

.detail-grid div {
  border-color: #e1e7e3;
  background: #f8faf8;
}

.detail-grid span {
  color: #66736c;
}

.detail-block h3,
.section-title-row h3 {
  color: #14211c;
}

.detail-block p {
  color: #2f3d36;
}

.journal-panel,
.route-panel {
  border-top-color: #e5ebe7;
}

.visit-form,
.route-list button,
.gpx-preview,
.visit-card-actions button,
.visit-card-actions a {
  border-color: #dfe8e2;
  background: #ffffff;
  color: #15201c;
}

.detail-actions {
  grid-template-columns: 1fr 104px;
}

.detail-panel .detail-actions button:not(.primary),
.detail-panel .form-actions button:not(.primary) {
  border-color: #d7e0da;
  background: #ffffff;
  color: #15201c;
  box-shadow: none;
}

.mountain-pin-shell {
  border: 0;
  background: transparent;
}

.mountain-pin {
  position: relative;
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border: 1.5px solid #ffffff;
  border-radius: 50% 50% 50% 5px;
  background: #237a52;
  box-shadow: 0 5px 12px rgba(5, 20, 13, 0.28);
  transform: rotate(-45deg);
  transform-origin: 50% 50%;
}

.mountain-pin-peak {
  width: 7px;
  height: 6px;
  background: #ffffff;
  clip-path: polygon(50% 8%, 91% 80%, 69% 80%, 60% 62%, 51% 80%, 14% 80%);
  transform: rotate(45deg);
}

.mountain-pin.is-small {
  width: 10px;
  height: 10px;
}

.mountain-pin.is-small .mountain-pin-peak {
  width: 5px;
  height: 4px;
}

.mountain-pin.is-selected {
  width: 18px;
  height: 18px;
  border-width: 2px;
  box-shadow:
    0 0 0 3px rgba(47, 142, 70, 0.24),
    0 7px 18px rgba(5, 20, 13, 0.34);
}

.pin-h-low {
  background: #2f6ea6;
}

.pin-h-mid {
  background: #237a52;
}

.pin-h-high {
  background: #b2681b;
}

.pin-h-top {
  background: #a94036;
}

.mobile-topbar {
  display: none;
}

.sheet-grip {
  display: none;
}

.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: rgba(28, 48, 55, 0.92);
  color: #ffffff;
  padding: 0 16px;
  font-weight: 850;
  box-shadow: 0 16px 36px rgba(8, 16, 13, 0.3);
  backdrop-filter: blur(14px);
}

@media (max-width: 1180px) {
.map-basemap-control {
    top: 20px;
    right: 22px;
    left: auto;
  }

  .detail-panel {
    top: 106px;
  }
}

@media (max-width: 900px) {
.app-shell {
    height: 100dvh;
    min-height: 100dvh;
  }

  /* 상단 고정 검색바: 검색이 첫 진입점 */
  .mobile-topbar {
    position: fixed;
    top: calc(var(--ss-bar-h) + env(safe-area-inset-top));
    left: 0;
    right: 0;
    z-index: 960;
    display: flex;
    gap: 8px;
    padding: 10px 12px;
  }

  .mobile-topbar input {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    border: 1px solid rgba(21, 32, 28, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.97);
    color: var(--ink);
    padding: 0 14px;
    font-size: 16px;
    outline: none;
    box-shadow: 0 10px 28px rgba(8, 16, 13, 0.22);
  }

  .sidebar-toggle {
    display: inline-flex;
    flex: 0 0 auto;
  }

  body.sidebar-open .sidebar-toggle {
    background: #24783c;
  }

  /* 줌 버튼은 핀치로 대체 */
  .leaflet-control-zoom {
    display: none;
  }

  /* 배경지도 선택: 검색바 아래 컴팩트 pill */
  .map-basemap-control {
    top: 64px;
    right: 12px;
    left: auto;
    z-index: 940;
    width: 148px;
    padding: 6px;
    border-radius: 12px;
  }

  .map-basemap-control span {
    display: none;
  }

  .map-basemap-control select {
    min-height: 40px;
    border: 0;
    font-size: 13px;
  }

  /* 목록·필터 = 하단 시트 (기본 접힘,
손잡이만 노출) */
  .sidebar {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: 88dvh;
    border-radius: 16px 16px 0 0;
    grid-template-rows: auto auto minmax(0, 1.4fr) auto minmax(0, 1fr);
    transform: translateY(calc(100% - 58px - env(safe-area-inset-bottom)));
    transition: transform 200ms ease;
  }

  .sheet-grip {
    display: grid;
    justify-items: center;
    gap: 4px;
    border: 0;
    background: transparent;
    color: var(--green-dark);
    padding: 9px 0 10px;
    font-size: 14px;
    font-weight: 850;
    touch-action: none;
  }

  .sheet-grip i {
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: rgba(21, 32, 28, 0.24);
  }

  .sheet-grip b {
    color: var(--green);
  }

  body.sidebar-open .sidebar {
    transform: translateY(0);
  }

  /* 첫 화면 기본: 시트 반열림 — 지도 위에 산 목록이 바로 보인다 (헤더·필터는 전체 열기에서) */
  body.sheet-half:not(.sidebar-open):not(.has-detail) .sidebar {
    transform: translateY(50%);
  }

  body.sheet-half:not(.sidebar-open):not(.has-detail) .app-header,
body.sheet-half:not(.sidebar-open):not(.has-detail) .controls {
    display: none;
  }

  .app-header {
    padding-top: 4px;
  }

  .app-header .eyebrow {
    display: none;
  }

  .sidebar h1 {
    font-size: 19px;
  }

  /* 상세 = 드래그 가능한 하단 시트 (반높이 ↔ 전체) */
  .detail-panel {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: 66dvh;
    max-height: none;
    border-radius: 16px 16px 0 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transition: height 220ms ease;
  }

  .detail-panel:empty {
    display: none;
  }

  body.detail-full .detail-panel {
    height: calc(100dvh - 62px - env(safe-area-inset-top));
  }

  /* 접힘(피크): 머리글만 남기고 지도·등산로를 최대로 보여준다 */
  body.detail-peek .detail-panel {
    height: 96px;
    overflow: hidden;
  }

  .detail-hero {
    touch-action: none;
    padding-top: 24px;
  }

  .detail-hero::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
  }

  .route-tabs button {
    min-height: 38px;
    padding: 6px 14px;
  }

  body.sidebar-open .detail-panel {
    display: none;
  }

  /* 상세가 열리면 목록 시트 손잡이는 숨긴다 — 필터 버튼·닫기로 복귀 */
  body.has-detail:not(.sidebar-open) .sidebar {
    transform: translateY(110%);
  }
}

@media (max-width: 520px) {
.stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stats div {
    min-height: 56px;
    padding: 8px;
  }

  .stats span {
    font-size: 20px;
  }

  .control-grid,
.mode-switch,
.legend,
.button-row,
.visit-tools,
.sync-actions,
.form-row,
.gpx-preview,
.form-actions {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Public app typography scale */
:root {
  --font-label: 12px;
  --font-control: 14px;
  --font-body: 14px;
  --font-list: 14px;
  --font-section: 13px;
  --font-card-value: 15px;
  --font-stat: 21px;
  --font-panel-title: 22px;
  --font-app-title: 23px;
}

body,
button,
input,
select,
textarea {
  font-size: var(--font-body);
}

.sidebar h1 {
  font-size: var(--font-app-title);
  line-height: 1.22;
  font-weight: 850;
}

.eyebrow,
.field span,
.map-basemap-control span,
.control-note,
.legend,
.mountain-meta,
.detail-grid span,
.route-list span,
.visit-card time,
.visit-card p,
.popup-meta {
  font-size: var(--font-label);
  line-height: 1.4;
}

.visit-tools a,
.visit-tools button,
.mode-switch label,
.button-row button,
.detail-actions button,
.form-actions button,
.visit-card-actions button,
.visit-card-actions a,
.map-basemap-control select,
.field input,
.field select,
.field textarea,
.check-row {
  font-size: var(--font-control);
}

.stats span {
  font-size: var(--font-stat);
  line-height: 1.05;
}

.stats small {
  font-size: var(--font-label);
  line-height: 1.35;
}

.mountain-name {
  font-size: var(--font-list);
  line-height: 1.35;
}

.park-chip,
.visit-meta-line span,
.tag-list span {
  font-size: var(--font-label);
}

.detail-hero h2,
.detail-panel h2 {
  font-size: var(--font-panel-title);
  line-height: 1.2;
  font-weight: 850;
}

.detail-subtitle {
  font-size: var(--font-section);
  line-height: 1.4;
}

.detail-grid strong {
  font-size: var(--font-card-value);
  line-height: 1.35;
}

.detail-block h3,
.section-title-row h3,
.route-list strong,
.visit-card h4 {
  font-size: var(--font-section);
  line-height: 1.4;
}

.detail-block p,
.visit-empty,
.gpx-preview p {
  font-size: var(--font-section);
  line-height: 1.55;
}

.detail-panel .detail-close {
  font-size: 20px;
}

@media (max-width: 900px) {
:root {
    --font-app-title: 21px;
    --font-panel-title: 20px;
    --font-stat: 20px;
  }
}

@media (max-width: 520px) {
:root {
    --font-control: 13px;
    --font-body: 13px;
    --font-list: 13px;
    --font-stat: 18px;
  }
}

/* 고도 프로파일 (100대 명산 상세) */
.route-profile svg {
  display: block;
  border: 1px solid rgba(31, 33, 36, 0.1);
  border-radius: 8px;
  background: #fbfcfd;
}

.profile-stats {
  margin: 6px 0 0;
  font-size: 12px;
  color: #5c6166;
}

.profile-legend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.profile-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.list-divider {
  margin: 12px 2px 6px;
  color: #5c6a61;
  font-size: 12px;
  font-weight: 850;
  text-transform: none;
}

.course-cards {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.course-card {
  display: grid;
  gap: 3px;
  position: relative;
  padding: 11px 12px;
  border: 1.5px solid rgba(31, 33, 36, 0.14);
  border-radius: 12px;
  background: #ffffff;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.course-card.active {
  border-color: var(--green-dark, #1f6f4a);
  background: #f2f9f4;
  box-shadow: 0 0 0 1px var(--green-dark, #1f6f4a);
}

.course-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.course-card-head b {
  font-weight: 850;
}

.course-official {
  padding: 1px 7px;
  border-radius: 999px;
  background: #eef3ff;
  color: #2f56a6;
  font-size: 12px;
  font-weight: 800;
}

.course-card-stats {
  color: #3c4740;
  font-size: 13px;
  font-weight: 700;
}

.course-stay {
  color: #a3372a;
  font-weight: 850;
  white-space: nowrap;
}

.course-card-summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #4a5850;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
}

.course-card-poi {
  color: #5c6a61;
  font-size: 12px;
}

/* 공단 코스 안내문 — 코스를 고른 뒤 펼쳐 보는 공식 설명 */
.course-guide {
  margin-top: 12px;
  border: 1px solid #dde5e0;
  border-radius: 12px;
  background: #fbfcfb;
}

.course-guide > summary {
  padding: 10px 14px;
  color: #1f6f4a;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.course-guide > *:not(summary) {
  margin: 0 14px 12px;
}

.course-guide-summary {
  color: #2b342e;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.55;
}

.course-guide-features,
.course-guide-cautions ol {
  padding-left: 18px;
  color: #44514a;
  font-size: 13px;
  line-height: 1.6;
}

.course-guide-section {
  padding: 9px 0;
  border-top: 1px solid #e8eeea;
}

.course-guide-section b {
  font-size: 13px;
  font-weight: 800;
}

.course-guide-section span {
  margin-left: 6px;
  color: #5c6a61;
  font-size: 12px;
  font-weight: 700;
}

.course-guide-section p {
  margin: 4px 0 0;
  color: #44514a;
  font-size: 13px;
  line-height: 1.6;
}

.course-guide-highlights span {
  display: inline-block;
  margin: 3px 4px 0 0;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eef3ef;
  color: #35473c;
  font-size: 12px;
  font-weight: 700;
}

.course-guide-cautions b,
.course-guide-highlights b {
  display: block;
  margin-bottom: 4px;
  font-size: 12.5px;
  font-weight: 800;
}

.course-card-map {
  position: absolute;
  right: 12px;
  bottom: 11px;
  color: var(--green-dark, #1f6f4a);
  font-size: 12px;
  font-weight: 800;
}

.course-card-cmp {
  padding: 9px 12px;
  text-align: center;
  color: #40514a;
  font-size: 13px;
  font-weight: 750;
}

/* 산행 계획 짜기 */
.plan-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}

.plan-chip {
  background: #eef0f3;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #3b4652;
}

.plan-chip.current {
  background: #6741d9;
  color: #ffffff;
}

.plan-arrow {
  color: #9aa4ad;
  font-size: 12px;
}

.plan-total {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: #46337e;
}

.plan-hint {
  width: 100%;
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 750;
  color: #6b7680;
}

.plan-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.plan-option {
  border: 1px solid #d6dbe0;
  border-radius: 9px;
  background: #ffffff;
  padding: 7px 11px;
  font-size: 12.5px;
  color: #2c3338;
  cursor: pointer;
  text-align: left;
}

.plan-option b {
  font-weight: 800;
}

.plan-option:hover {
  border-color: #6741d9;
}

.plan-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.plan-actions button {
  border: 1px solid #d6dbe0;
  border-radius: 9px;
  background: #f6f7f8;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 750;
  color: #3b4652;
  cursor: pointer;
}

.plan-actions [data-plan-map] {
  color: var(--green-dark, #1f6f4a);
}

.wp-label-plan {
  background: #6741d9;
  border-color: #6741d9;
  color: #ffffff;
}

.route-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}

.route-tabs button {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid rgba(31, 33, 36, 0.18);
  border-radius: 999px;
  background: #fff;
  color: #3c4043;
  cursor: pointer;
}

.route-tabs button.active {
  background: #33523c;
  border-color: #33523c;
  color: #fff;
}

/* 음영기복을 배경지도에 곱해 능선·계곡을 입체로 살린다.
   원본 음영이 옅어 대비를 올려야 산줄기가 또렷하게 읽힌다. */
.map-shading {
  mix-blend-mode: multiply;
  filter: grayscale(1) contrast(1.7) brightness(0.97);
}

.wp-label {
  padding: 2px 7px;
  border: 1px solid rgba(31, 33, 36, 0.28);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: #1f2124;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
  white-space: nowrap;
}

.wp-label::before {
  display: none;
}

.wp-label-start {
  background: #1f6f4a;
  border-color: #1f6f4a;
  color: #ffffff;
}

.wp-label-peak {
  background: #a94036;
  border-color: #a94036;
  color: #ffffff;
}

.route-tabs .tab-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border-radius: 999px;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(31, 33, 36, 0.25);
  vertical-align: -1px;
}

[data-segment-table] {
  overflow-x: auto;
}

.segment-table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-size: 12px;
  color: #3c4043;
}

.segment-table th,
.segment-table td {
  padding: 5px 8px;
  text-align: right;
  border-bottom: 1px solid rgba(31, 33, 36, 0.08);
  white-space: nowrap;
}

.segment-table th:first-child,
.segment-table td:first-child {
  text-align: left;
}

.segment-table thead th {
  font-weight: 600;
  color: #767b81;
  border-bottom: 1px solid rgba(31, 33, 36, 0.18);
}

.segment-table tfoot td {
  font-weight: 700;
  border-bottom: none;
}

.segment-table .seg-name {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.segment-table .seg-grade {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: -1px;
}

.scenic-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.scenic-list li {
  font-size: 13px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.scenic-list small {
  color: #767b81;
}
.scenic-badge {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: #006b55;
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}
.vis-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 64px;
}
.vis-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}
.vis-bar i {
  width: 100%;
  background: #006b55;
  border-radius: 3px 3px 0 0;
  opacity: 0.85;
}
.vis-bar span {
  font-size: 12px;
  color: #767b81;
}
.vis-note {
  font-size: 12px;
  color: #4d5257;
  margin: 6px 0 0;
}

.eco-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.eco-list li strong {
  display: block;
  font-size: 13px;
}
.eco-list li small {
  color: #006b55;
  font-size: 12px;
}
.eco-list li p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #4d5257;
}

/* Japan 100 Mountains layout parity */
:root {
  --jp-forest: var(--ss-brand);
  --jp-canvas: var(--ss-canvas);
  --jp-panel: var(--ss-panel);
  --jp-line: var(--ss-border);
  --jp-line-strong: var(--ss-border-strong);
  --jp-rust: var(--ss-rust);
  --jp-ink: var(--ss-ink);
  --jp-muted: var(--ss-muted);
}

body {
  background: var(--jp-canvas);
  color: var(--jp-ink);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  height: 100dvh;
  min-height: 680px;
  background: var(--jp-canvas);
}

.main-workspace {
  display: grid;
  grid-template-columns: minmax(400px, 452px) minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  position: relative;
  inset: auto;
  z-index: 10;
  display: grid;
  grid-template-rows: auto minmax(0, auto) minmax(180px, 1fr);
  width: auto;
  min-height: 0;
  overflow: hidden;
  border: 0;
  border-right: 1px solid var(--jp-line);
  border-radius: 0;
  background: var(--jp-panel);
  box-shadow: none;
  color: var(--jp-ink);
  backdrop-filter: none;
}

.discovery-summary {
  padding: 12px 14px 0;
}

.discovery-summary .eyebrow {
  margin: 0 0 8px;
  color: #5c665c;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.sidebar .stats {
  gap: 6px;
  margin: 0;
}

.sidebar .stats div {
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--jp-line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

.sidebar .stats span {
  color: var(--jp-forest);
  font-size: 18px;
}

.sidebar .stats small {
  color: var(--jp-muted);
  font-size: 12px;
}

.sidebar .controls {
  display: grid;
  gap: 10px;
  min-height: 0;
  max-height: 46vh;
  overflow-y: auto;
  padding: 10px 14px 12px;
  border-bottom: 1px solid var(--jp-line);
  scrollbar-color: #cfc8b2 transparent;
}

.sidebar .field span,
.sidebar .control-note,
.sidebar .sync-panel .section-title-row span {
  color: #5c665c;
}

.sidebar .field input,
.sidebar .field select,
.sidebar .field textarea {
  border-color: var(--jp-line-strong);
  border-radius: 8px;
  background-color: #ffffff;
  color: var(--jp-ink);
  box-shadow: none;
}

.sidebar .field input::placeholder,
.sidebar .field textarea::placeholder {
  color: #a29a85;
}

.sidebar .field select option {
  color: var(--jp-ink);
  background: #ffffff;
}

.sidebar .mode-switch label,
.sidebar .sync-panel {
  border-color: var(--jp-line);
  background: #ffffff;
}

.sidebar .mode-switch label {
  color: #5c665c;
}

.sidebar .mode-switch label:has(input:checked) {
  border-color: var(--jp-forest);
  background: var(--jp-forest);
  color: #ffffff;
}

.sidebar .check-row {
  color: #2a3229;
}

.sidebar .check-row input {
  accent-color: var(--jp-forest);
}

.sidebar .button-row button {
  border-color: var(--jp-line-strong);
  background: #ffffff;
  color: #2a3229;
  box-shadow: none;
}

.sidebar .button-row button:first-child {
  border-color: var(--jp-forest);
  background: var(--jp-forest);
  color: #ffffff;
}

.mountain-list {
  min-height: 0;
  overflow-y: auto;
  background: var(--jp-panel);
  scrollbar-color: #cfc8b2 transparent;
}

.mountain-row {
  border: 0;
  border-bottom: 1px solid #e7e1cf;
  border-radius: 0;
}

.mountain-row:hover,
.mountain-row.is-selected {
  border-color: #e7e1cf;
  background: #ffffff;
}

.mountain-name {
  color: var(--jp-ink);
}

.mountain-meta {
  color: var(--jp-muted);
}

.park-chip {
  border-color: #c9d2c8;
  background: #e8eee7;
  color: var(--jp-forest);
}

.map-area {
  position: relative;
  inset: auto;
  z-index: 0;
  min-width: 0;
  min-height: 0;
  background: #e9e4d4;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 100%;
  background: #e9e4d4;
}

/* 위치·크기는 폭별 규칙이 정한다 — 여기서 고정하면 모바일에서 검색바 뒤로 숨는다 */
.map-basemap-control {
  border-color: var(--jp-line-strong);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 8px rgba(23, 45, 33, 0.12);
  backdrop-filter: none;
}

.map-basemap-control span {
  color: #5c665c;
}

.map-legend {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 650;
  display: flex;
  grid-template-columns: none;
  flex-wrap: wrap;
  gap: 7px 12px;
  max-width: min(720px, calc(100% - 84px));
  padding: 8px 11px;
  border: 1px solid var(--jp-line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #5c665c;
  box-shadow: 0 2px 8px rgba(23, 45, 33, 0.1);
}

.mountain-legend {
  display: inline-block;
  width: 12px;
  height: 12px;
  clip-path: polygon(50% 4%, 100% 100%, 0 100%);
  border-radius: 0;
  box-shadow: none;
}

.mountain-pin-shell {
  border: 0;
  background: transparent;
}

.mountain-triangle {
  display: block;
  overflow: visible;
  filter: drop-shadow(0 1px 2px rgba(23, 45, 33, 0.48));
  transition: transform 160ms ease;
}

.mountain-triangle.is-selected {
  transform: translateY(-2px) scale(1.08);
  filter: drop-shadow(0 3px 4px rgba(23, 45, 33, 0.5));
}

.detail-panel {
  top: 12px;
  right: 12px;
  width: min(390px, calc(100vw - 44px));
  border-color: var(--jp-line-strong);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(23, 45, 33, 0.18);
}

@media (max-width: 900px) {
.app-shell {
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 100dvh;
  }

  .main-workspace {
    position: relative;
    display: block;
    min-height: 0;
  }

  .map-area {
    position: absolute;
    inset: 0;
  }

  .mobile-topbar {
    top: calc(var(--ss-bar-h) + env(safe-area-inset-top));
  }

  .sidebar {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 820;
    display: grid;
    grid-template-rows: auto auto minmax(0, auto) minmax(160px, 1fr);
    width: 100%;
    height: min(74dvh, 660px);
    border: 1px solid var(--jp-line);
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
    background: var(--jp-panel);
    color: var(--jp-ink);
    transform: translateY(110%);
  }

  body.sheet-half:not(.sidebar-open):not(.has-detail) .sidebar {
    transform: translateY(50%);
  }

  body.sidebar-open .sidebar {
    transform: translateY(0);
  }

  .sidebar .controls {
    max-height: 32vh;
  }

  .map-legend {
    bottom: 10px;
    max-width: calc(100% - 76px);
    font-size: 12px;
  }

  .detail-panel {
    top: auto;
    right: 0;
    width: 100%;
  }
}

@media (max-width: 520px) {
.map-legend {
    display: none;
  }
}

/* ── 코스 서랍 · 지명 안내선 · PC 화면 폭 조절 ──────────────────────────────
   코스는 눌러서 펴고 접는 서랍이고 여러 개를 동시에 펴서 비교한다.
   지명은 지점 위가 아니라 빈자리에 놓고 안내선으로 잇는다. */

:root {
  --list-w: 452px;
  --detail-w: 452px;
}

.course-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
}

.course-block-head h3 {
  margin: 0;
}

/* 보기 방식 3단: 한눈에 · 코스별 · 내 코스 잇기 */
.course-modes {
  display: flex;
  flex: 0 0 auto;
  gap: 0;
  border: 1px solid #cdd8cf;
  border-radius: 999px;
  overflow: hidden;
  background: #ffffff;
}

.course-modes button {
  min-height: 32px;
  padding: 6px 12px;
  border: 0;
  border-left: 1px solid #e2eae4;
  background: transparent;
  color: #46595b;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.course-modes button:first-child {
  border-left: 0;
}

.course-modes button:hover {
  background: #eef6f0;
}

.course-modes button[aria-pressed="true"] {
  background: #1f6f4a;
  color: #ffffff;
}

.course-overview-sum {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #46595b;
}

.course-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.course-table th,
.course-table td {
  padding: 8px 6px;
  border-bottom: 1px solid #e8eee9;
  text-align: right;
  white-space: nowrap;
}

.course-table thead th {
  font-size: 12px;
  font-weight: 700;
  color: #6b7b7d;
  border-bottom: 1px solid #cdd8cf;
}

.course-table th:first-child {
  text-align: left;
  white-space: normal;
  font-weight: 800;
}

.course-table tbody tr {
  cursor: pointer;
}

.course-table tbody tr:hover,
.course-table tbody tr:focus-visible {
  background: #eef6f0;
  outline: none;
}

.course-overview[hidden],
.course-cards[hidden],
.course-chain[hidden],
.route-profile[hidden] {
  display: none;
}

.course-card {
  display: block;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.course-card > summary {
  display: grid;
  gap: 3px;
  position: relative;
  padding: 11px 34px 11px 12px;
  list-style: none;
  cursor: pointer;
}

.course-card > summary::-webkit-details-marker {
  display: none;
}

.course-card > summary::after {
  content: "⌄";
  position: absolute;
  top: 8px;
  right: 12px;
  color: #6b776e;
  font-size: 16px;
  transition: transform 140ms ease;
}

.course-card[open] {
  border-color: var(--green-dark, #1f6f4a);
  box-shadow: 0 0 0 1px var(--green-dark, #1f6f4a);
}

.course-card[open] > summary {
  background: #f2f9f4;
}

.course-card[open] > summary::after {
  transform: rotate(180deg);
}

.course-card-head {
  flex-wrap: wrap;
}

.course-key {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.course-card-body {
  padding: 10px 12px 12px;
  border-top: 1px solid #e6ece7;
}

.course-card-actions {
  margin: 10px 0 0;
}

.course-card-actions button {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid #cdd8cf;
  border-radius: 8px;
  background: #ffffff;
  color: #1f6f4a;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.plan-chip i,
.plan-option i {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border-radius: 3px;
  vertical-align: middle;
}

/* 지명 안내선 — 지점에서 이름표까지 가는 선을 긋고,
이름표는 코스 선을 피해 놓는다 */
.wp-callout {
  position: relative;
  width: 0;
  height: 0;
  border: 0;
  background: none;
}

.wp-callout i {
  position: absolute;
  left: 0;
  top: -0.5px;
  height: 1px;
  background: rgba(28, 38, 32, 0.62);
  transform-origin: 0 50%;
}

.wp-callout b {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 2px 7px;
  border: 1px solid rgba(28, 38, 32, 0.22);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.95);
  color: #1c2620;
  font-size: 12px;
  font-weight: 800;
  line-height: 15px;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(23, 45, 33, 0.22);
}

.wp-callout-start b {
  border-color: #1f6f4a;
  background: #1f6f4a;
  color: #ffffff;
}

.wp-callout-peak b {
  border-color: #a94036;
  background: #a94036;
  color: #ffffff;
}

.detail-hero-tools {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.detail-panel .detail-peek-toggle {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.detail-planner-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: #ffffff;
  color: #1f6f4a;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

body.detail-peek .detail-panel .detail-peek-toggle {
  transform: rotate(180deg);
}

/* 접기 = 제목줄만 남긴다. 고른 산과 지도 위 코스는 그대로 유지된다. */
body.detail-peek .detail-panel .detail-body,
body.detail-peek .detail-panel .detail-subtitle {
  display: none;
}

.workspace-toggle,
.detail-resizer {
  display: none;
}

body.is-resizing {
  cursor: col-resize;
  user-select: none;
}

@media (min-width: 1181px) {
.main-workspace {
    grid-template-columns: var(--list-w) minmax(0, 1fr) var(--detail-w);
  }

  body:not(.has-detail) .main-workspace,
  body.detail-collapsed .main-workspace {
    grid-template-columns: var(--list-w) minmax(0, 1fr) 0;
  }

  body.sidebar-collapsed .main-workspace {
    grid-template-columns: 0 minmax(0, 1fr) var(--detail-w);
  }

  body.sidebar-collapsed:not(.has-detail) .main-workspace,
  body.sidebar-collapsed.detail-collapsed .main-workspace {
    grid-template-columns: 0 minmax(0, 1fr) 0;
  }

.detail-panel {
    position: relative;
    inset: auto;
    z-index: 10;
    display: block;
    width: auto;
    min-width: 0;
    height: 100%;
    max-height: none;
    overflow: auto;
    border: 0;
    border-left: 1px solid var(--jp-line);
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
  }

  .detail-panel:empty {
    display: block;
  }

  body:not(.has-detail) .detail-panel,
  body.detail-collapsed .detail-panel {
    visibility: hidden;
    pointer-events: none;
  }

  /* 배경지도 선택은 지도 왼쪽 위로 — 오른쪽 상세 패널이 산 이름을 가리고 있었다 */
  .map-basemap-control {
    top: 56px;
    left: 14px;
    right: auto;
    width: 190px;
  }

  body.detail-peek .detail-panel {
    width: auto;
  }

  body.sidebar-collapsed .sidebar {
    visibility: hidden;
  }

  .workspace-toggle {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 660;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 32px;
    padding: 6px 12px;
    border: 1px solid var(--jp-line-strong, #d5cdb6);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: #2a3229;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(23, 45, 33, 0.14);
  }

  .detail-toggle {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 660;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 32px;
    padding: 6px 12px;
    border: 1px solid var(--jp-line-strong, #d5cdb6);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: #2a3229;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(23, 45, 33, 0.14);
  }

  body:not(.has-detail) .detail-toggle {
    display: none;
  }

  body.has-detail:not(.detail-peek) .detail-resizer {
    position: absolute;
    top: 104px;
    right: -5px;
    z-index: 661;
    display: block;
    width: 10px;
    height: 58px;
    padding: 0;
    border: 1px solid rgba(21, 32, 28, 0.16);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.92);
    cursor: col-resize;
    box-shadow: 0 2px 8px rgba(23, 45, 33, 0.16);
  }

  body.detail-collapsed .detail-resizer {
    display: none;
  }

  .detail-resizer::before {
    content: "";
    display: block;
    width: 2px;
    height: 22px;
    margin: 16px auto;
    border-left: 1px solid #9aa79e;
    border-right: 1px solid #9aa79e;
  }
}

@media (max-width: 900px) {
  .workspace-toggle,
  .detail-toggle,
  .detail-resizer {
    display: none !important;
  }
}

/* 일본 100명산과 같은 태블릿 동작: 하단 시트가 아니라 좌·우 오버레이 패널이다. */
@media (min-width: 521px) and (max-width: 1180px) {
  .mobile-topbar,
  .sidebar-toggle,
  .sheet-grip {
    display: none;
  }

  .main-workspace {
    position: relative;
    display: block;
  }

  .map-area {
    position: absolute;
    inset: 0;
    z-index: auto;
    height: 100%;
  }

  .sidebar,
  .detail-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 820;
    width: min(88vw, 360px);
    height: auto;
    max-height: none;
    border-radius: 0;
    background: var(--jp-panel);
    box-shadow: 0 3px 20px rgba(18, 35, 26, 0.2);
    transition: transform 240ms ease, opacity 180ms ease;
  }

  .sidebar {
    right: auto;
    left: 0;
    display: grid;
    grid-template-rows: auto minmax(0, auto) minmax(180px, 1fr);
    border: 0;
    border-right: 1px solid var(--jp-line);
    transform: translateX(0);
  }

  .detail-panel {
    right: 0;
    left: auto;
    display: block;
    overflow: auto;
    border: 0;
    border-left: 1px solid var(--jp-line);
    transform: translateX(0);
  }

  .detail-panel:empty {
    display: block;
  }

  body.sidebar-open .detail-panel {
    display: block;
  }

  body.sidebar-collapsed .sidebar {
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-105%);
  }

  body:not(.has-detail) .detail-panel,
  body.detail-collapsed .detail-panel {
    visibility: hidden;
    pointer-events: none;
    transform: translateX(105%);
  }

  body.has-detail:not(.sidebar-open) .sidebar {
    transform: translateX(0);
  }

  body.has-detail.sidebar-collapsed:not(.sidebar-open) .sidebar {
    transform: translateX(-105%);
  }

  .workspace-toggle,
  .detail-toggle {
    position: absolute;
    top: 50%;
    z-index: 840;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 58px;
    min-height: 58px;
    padding: 0;
    border: 1px solid var(--jp-line-strong);
    background: #ffffff;
    color: var(--jp-ink);
    font-size: 0;
    cursor: pointer;
    transform: translateY(-50%);
    transition: left 240ms ease, right 240ms ease, background 160ms ease;
    box-shadow: 0 3px 12px rgba(18, 35, 26, 0.18);
  }

  .workspace-toggle {
    left: calc(min(88vw, 360px) - 44px);
    border-left: 0;
    border-radius: 0 10px 10px 0;
  }

  .detail-toggle {
    right: calc(min(88vw, 360px) - 44px);
    border-right: 0;
    border-radius: 10px 0 0 10px;
  }

  .workspace-toggle span,
  .detail-toggle span {
    font-size: 20px;
  }

  body.sidebar-collapsed .workspace-toggle {
    left: 0;
  }

  body.detail-collapsed .detail-toggle {
    right: 0;
  }

  body:not(.has-detail) .detail-toggle {
    display: none !important;
  }

  .detail-resizer {
    display: none !important;
  }

  .detail-hero::before {
    display: none;
  }

  .map-basemap-control {
    top: 12px;
    right: 12px;
    left: auto;
  }
}

/* Mountain Atlas final cascade */
.map-basemap-control { top: 12px; right: 12px; left: auto; }
.map-visibility-control { top: 12px; right: 224px; left: auto; padding: 4px; }
.map-visibility-control label { min-height: 32px; padding: 0 8px; }
.mountain-row { min-height: 46px; }
.mountain-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
}
.mountain-main {
  display: grid;
  grid-template-columns: minmax(92px, .7fr) minmax(0, 1.3fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.mountain-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media(max-width:1180px) {
  .map-visibility-control { top: 58px; right: 12px; }
}

@media (min-width: 521px) and (max-width: 1180px) {
  body.has-detail:not(.detail-collapsed) .elevation-dock {
    right: calc(min(88vw, 360px) + 10px);
  }
  body.has-detail:not(.detail-collapsed) .map-basemap-control {
    right: calc(min(88vw, 360px) + 12px);
  }
  body.has-detail:not(.detail-collapsed) .map-visibility-control {
    right: calc(min(88vw, 360px) + 226px);
  }
}

@media (min-width: 521px) and (max-width: 780px) {
  body.has-detail:not(.detail-collapsed) .map-visibility-control {
    top: 100px;
    right: calc(min(88vw, 360px) + 12px);
  }
}

@media (max-width: 520px) {
  body.has-detail:not(.detail-peek) .detail-panel {
    height: 52dvh;
  }
  /* 모바일에서 상세 바텀시트가 열려 있을 때는 고도 도크가 지도를 침범하지 않도록 하여 지도 48% 가시영역 확보 */
  body.has-detail:not(.detail-peek) .elevation-dock {
    display: none !important;
  }
  /* 상세 패널을 peek(접기) 상태로 내렸을 때만 고도 단면을 지도 하단에 띄움 */
  body.detail-peek .elevation-dock {
    bottom: 96px;
    right: 8px;
    left: 8px;
    min-height: 140px;
    border-radius: 12px;
  }
  body.detail-peek .elevation-dock-body {
    height: 120px !important;
    padding: 2px 6px 4px !important;
  }
  /* 모바일 지도 컨트롤: 검색바(64px) 바로 아래 한 줄 — [표시 칩][배경지도]
     지도 영역은 이미 상단바 아래에서 시작하므로 상단바 높이를 더하지 않는다.
     (예전에는 --ss-bar-h를 이중으로 더해 컨트롤이 지도 한가운데 코스 위에 떠 있었다) */
  .map-basemap-control {
    top: 70px !important;
    right: 10px !important;
    width: 140px !important;
    max-width: 140px !important;
    height: 44px;
    padding: 2px 4px !important;
  }
  .map-basemap-control select {
    min-height: 38px !important;
  }
  .map-visibility-control {
    top: 70px !important;
    right: 156px !important;
    height: 44px;
    align-items: center;
    padding: 3px 4px !important;
  }
  .map-visibility-control label {
    min-height: 36px;
  }
  /* 모바일은 상단 검색바가 있으므로 시트 안의 검색창은 숨긴다 */
  #filterSidebar .finder-label,
  #filterSidebar #searchInput {
    display: none;
  }
}

/* 공원 뱃지 디자인 */
.park-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.3;
}
.park-badge.park-national {
  background: #e8f5ec;
  color: #1b6338;
  border: 1px solid #c2e2cc;
}
.park-badge.park-provincial {
  background: #f0f7ff;
  color: #1d5b96;
  border: 1px solid #bcd8f5;
}
.park-badge.park-normal {
  background: #f4f5f4;
  color: #4b5853;
  border: 1px solid #dcdfdc;
}

/* 대표 추천 코스 리스트 디자인 */
.representative-course-block {
  margin-top: 14px;
}
.course-step-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.course-step-item {
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.course-step-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 800;
  color: var(--green-dark);
  background: #e5efe9;
  padding: 2px 8px;
  border-radius: 4px;
}
.course-step-body {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
}
.course-step-body .flow-arrow {
  color: var(--green);
  font-weight: 800;
  margin: 0 3px;
}

/* 산 이야기 및 안내 블록 */
.mountain-story-block {
  margin-top: 16px;
}
.mountain-story-block .story-desc {
  font-size: 14px;
  line-height: 1.65;
  color: #273832;
  margin: 0 0 10px;
}
.mountain-story-block .story-highlight {
  background: #f0f6f3;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #173d2b;
}
.mountain-story-block .story-highlight p {
  margin: 0;
}

/* 대중교통 및 숙식 블록 */
.guide-block {
  margin-top: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}
.guide-block h3 {
  margin: 0 0 8px;
  font-size: 14.5px;
  font-weight: 750;
  color: #1e332a;
}
.guide-block p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: #3f4e47;
}

/* 후보 권역 버튼 다듬기 */
.route-candidates .route-list button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: #fafbf9;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.route-candidates .route-list button:hover {
  background: #f0f5f2;
  border-color: var(--green);
}
.route-candidates .route-list button.is-selected {
  background: #e8f5ec;
  border-color: var(--green);
}

/* ── 찾기 · 이번 주 · 걷기길 상세 (2026-09 여행지 한 장)
   dials: VARIANCE 3 · MOTION 2 · DENSITY 4 — 기존 셸 토큰만 쓴다. */
.sidebar .controls.finder {
  gap: 8px;
  padding: 14px 14px 12px;
}

.finder-label {
  color: var(--jp-ink);
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.01em;
}

#searchInput {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--jp-forest);
  border-radius: 10px;
  background: var(--ss-surface);
  color: var(--jp-ink);
  font-size: 16px;
  outline: none;
}

#searchInput:focus-visible {
  box-shadow: 0 0 0 3px rgba(23, 56, 42, 0.16);
}

.filter-fold > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  color: #5c665c;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.filter-fold > summary::-webkit-details-marker { display: none; }
.filter-fold > summary::after { content: "⌄"; font-size: 12px; transition: transform 160ms ease; }
.filter-fold[open] > summary::after { transform: rotate(180deg); }

.filter-body {
  display: grid;
  gap: 10px;
  padding-top: 6px;
}

.filter-body .map-visibility-control,
.filter-body .map-legend {
  position: static;
  z-index: auto;
  max-width: none;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

.filter-body .map-legend { font-size: 12px; }

/* 이번 주 걷기 좋은 곳 */
.week-picks { padding: 14px; }

.week-picks h2 {
  margin: 0 0 10px;
  color: var(--jp-ink);
  font-size: 15px;
  font-weight: 850;
}

.place-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.place-card {
  display: grid;
  align-content: start;
  gap: 3px;
  min-height: 112px;
  padding: 12px;
  border: 1px solid var(--jp-line);
  border-radius: 10px;
  background: var(--ss-surface);
  color: var(--jp-ink);
  text-align: left;
  transition: border-color 160ms ease, transform 160ms ease;
}

.place-card:hover { border-color: var(--jp-forest); }
.place-card:active { transform: translateY(1px); }

.place-card-img {
  display: block;
  margin: -12px -12px 6px;
  aspect-ratio: 800 / 520;
  overflow: hidden;
  border-radius: 9px 9px 0 0;
  background: var(--jp-canvas);
}

.place-card-img img,
.result-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.place-card-kind {
  color: var(--jp-rust);
  font-size: 12px;
  font-weight: 800;
}

.place-card strong { font-size: 15px; font-weight: 850; line-height: 1.3; }
.place-card-line { color: #2a3229; font-size: 12px; line-height: 1.4; }
.place-card-meta { color: var(--jp-muted); font-size: 12px; line-height: 1.4; }

/* 검색 결과 */
.result-group { padding: 6px 0 4px; }

.result-group h3 {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
  padding: 10px 14px 6px;
  color: var(--jp-ink);
  font-size: 13px;
  font-weight: 850;
}

.result-group h3 span {
  color: var(--jp-muted);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 8px 14px;
  border: 0;
  border-bottom: 1px solid #e7e1cf;
  background: transparent;
  color: var(--jp-ink);
  text-align: left;
}

.result-row:hover { background: var(--ss-surface); }
.result-row.is-selected { background: var(--ss-surface); box-shadow: inset 0 0 0 1px var(--jp-forest); }

.result-thumb {
  flex: 0 0 64px;
  height: 42px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--jp-canvas);
}

.result-main {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.result-main b { font-size: 14px; font-weight: 800; line-height: 1.35; }

.result-main small {
  overflow: hidden;
  color: var(--jp-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-main .result-near { color: var(--jp-forest); font-weight: 700; }

.result-badge {
  flex: 0 0 auto;
  padding: 2px 7px;
  border: 1px solid var(--jp-line);
  border-radius: 999px;
  color: #5c665c;
  font-size: 12px;
  font-weight: 700;
}

.result-more {
  width: 100%;
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--jp-forest);
  font-size: 13px;
  font-weight: 800;
}

/* 결과 없음 */
.mountain-list .empty-state { padding: 28px 18px; text-align: left; }
.empty-state strong { display: block; margin-bottom: 4px; color: var(--jp-ink); font-size: 15px; }
.empty-state p { margin: 0; font-size: 13px; line-height: 1.5; }
.empty-state .suggest-title { margin-top: 14px; color: var(--jp-ink); font-weight: 800; }

.suggest-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.suggest-row button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--jp-line-strong);
  border-radius: 999px;
  background: var(--ss-surface);
  color: var(--jp-ink);
  font-size: 13px;
  font-weight: 700;
}

/* 배경지도 지도/위성 */
.basemap-toggle {
  position: absolute;
  top: 56px;
  left: 14px;
  z-index: 660;
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--jp-line-strong);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 8px rgba(23, 45, 33, 0.14);
}

.basemap-toggle button {
  min-width: 44px;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #5c665c;
  font-size: 12px;
  font-weight: 800;
}

.basemap-toggle button[aria-pressed="true"] { background: var(--jp-forest); color: #ffffff; }

@media (max-width: 1180px) {
  .basemap-toggle { top: 12px; right: 12px; left: auto; }
}

@media (min-width: 521px) and (max-width: 1180px) {
  body.has-detail:not(.detail-collapsed) .basemap-toggle { right: calc(min(88vw, 360px) + 12px); }
}

@media (max-width: 520px) {
  .basemap-toggle { top: calc(var(--ss-bar-h) + 64px); right: 10px; }
  .basemap-toggle button { min-width: 38px; min-height: 28px; padding: 0 8px; }
  .place-cards { grid-template-columns: minmax(0, 1fr); }
  .place-card { min-height: 0; }
}

/* 걷기길 출발·도착 핀 */
.place-pin-shell { border: 0; background: transparent; }

.place-pin {
  display: inline-block;
  transform: translate(-50%, -100%);
  padding: 3px 8px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: var(--jp-forest);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(23, 45, 33, 0.35);
}

.place-pin-end { background: var(--jp-rust); }

/* 검색 결과 점 — 목록에 마우스를 올린 곳은 키우고 맨 위로 */
.leaflet-marker-icon.result-pin { min-height: 0; border: 0; background: transparent; } /* 공용 셸의 누름 높이 44px가 점을 세로로 늘이지 않게 */

.result-pin i {
  display: block;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--jp-forest);
  box-shadow: 0 1px 4px rgba(23, 45, 33, 0.45);
  transition: transform 120ms ease;
}

.leaflet-marker-icon.is-hot { z-index: 1000 !important; filter: drop-shadow(0 0 4px rgba(199, 67, 29, 0.95)); }
.result-pin.is-hot i { transform: scale(1.5); background: var(--jp-rust); }

/* 상세 */
.detail-facts {
  margin: 4px 0 0;
  color: var(--jp-muted);
  font-size: 13px;
  font-weight: 700;
}

.sheet-figure { margin: 0 0 12px; }

.sheet-figure button {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--jp-line);
  border-radius: 10px;
  background: var(--jp-canvas);
  aspect-ratio: 1600 / 1040;
}

.sheet-figure img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sheet-figure-loc img { height: auto; border: 1px solid var(--jp-line); border-radius: 10px; }
.sheet-figure figcaption { margin-top: 4px; color: var(--jp-muted); font-size: 12px; }

.detail-block .sheet-lede { color: #2a3229; }

.route-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  line-height: 1.5;
}

.route-steps li + li::before { content: "→"; margin: 0 6px; color: var(--jp-forest); font-weight: 800; }

.trailhead-list { display: grid; gap: 8px; margin: 0; }
.trailhead-list div { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 8px; }
.trailhead-list dt { color: var(--jp-rust); font-size: 12px; font-weight: 800; line-height: 1.6; }
.trailhead-list dd { display: grid; margin: 0; font-size: 14px; font-weight: 750; }
.trailhead-list small { color: var(--jp-muted); font-size: 12px; font-weight: 500; }

.trailhead-names { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }

.trailhead-names li {
  padding: 4px 10px;
  border: 1px solid var(--jp-line);
  border-radius: 999px;
  background: var(--ss-surface);
  font-size: 13px;
  font-weight: 700;
}

.access-links,
.nearby-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }

.access-links li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  border-bottom: 1px solid #ece6d6;
  font-size: 13px;
}

.access-links a { flex: 0 0 auto; color: var(--jp-forest); font-weight: 800; text-decoration: none; }

.nearby-list button {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid #ece6d6;
  background: transparent;
  color: var(--jp-ink);
  text-align: left;
  font-size: 13px;
}

.nearby-list small { flex: 0 0 auto; color: var(--jp-muted); font-size: 12px; }

.sheet-bullets { margin: 6px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.55; }
.sheet-contact { color: var(--jp-muted); }

.representative-course-block > summary,
.mountain-story-block > summary {
  min-height: 36px;
  color: var(--jp-ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 36px;
  cursor: pointer;
}

.sheet-source {
  margin: 16px 0 4px;
  color: var(--jp-muted);
  font-size: 12px;
  line-height: 1.5;
}

.sheet-source a { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  .place-card,
  .filter-fold > summary::after { transition: none; }
}

/* 사이드바 = 찾기 + 목록(남는 높이 전부). 모바일은 손잡이 한 줄이 더 있다. */
.sidebar { grid-template-rows: auto minmax(0, 1fr); }
@media (max-width: 520px) {
  .sidebar { grid-template-rows: auto auto minmax(0, 1fr); }
}

.place-card,
.result-main,
.empty-state { word-break: keep-all; }

.detail-hero .detail-facts { color: rgba(244, 252, 247, 0.9); }

/* 산 상세: 코스 요약을 먼저 읽고 필요할 때 도구를 펼친다. */
.has-detail .detail-hero { background: #fafaf8; color: var(--jp-ink); border-bottom: 1px solid var(--jp-border, #e3e6df); }
.has-detail .detail-hero h2 { color: var(--jp-ink); font-size: 23px; }
.has-detail .detail-hero .detail-facts { color: var(--jp-muted); }
.has-detail .detail-hero-tools button { color: var(--jp-ink); background: transparent; border-color: #d7ddd7; }
.course-summary-list { display: grid; gap: 22px; padding: 4px 0 20px; }
.course-summary h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0 0 6px; font-size: 15px; line-height: 1.7; }
.course-summary h3 button { padding: 0; border: 0; background: none; color: var(--jp-ink); font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.course-summary h3 button:hover { text-decoration: underline; }
.course-summary h3 span { color: var(--jp-muted); font-size: 13px; font-weight: 400; }
.course-summary p { margin: 0; color: var(--jp-muted); font-size: 14px; line-height: 1.9; overflow-wrap: anywhere; }
.course-summary p span { padding: 0 3px; color: #9aa59e; }
.course-tools, .mountain-more { border-top: 1px solid #e0e5df; }
.course-tools > summary, .mountain-more > summary { padding: 14px 0; font-size: 13px; color: var(--jp-muted); cursor: pointer; }
.course-tools[open] > summary, .mountain-more[open] > summary { color: var(--jp-ink); }
.course-summary button:focus-visible, .course-tools > summary:focus-visible, .mountain-more > summary:focus-visible { outline: 2px solid var(--jp-forest); outline-offset: 4px; }

@media (max-width: 520px) {
  /* 시트 손잡이가 같은 제목을 이미 보여 준다 */
  .week-picks h2 { display: none; }
}
.official-maps-link { display: block; margin: 10px 0; color: #216344; font-size: 13px; }

/* 종주 배지 — 화이트리스트에 적힌 코스에만 붙는다 */
.course-traverse {
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--jp-ink);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* 이어 만든 코스 표시 — 공식 코스와 구분한다 */
.course-built {
  margin-left: 4px;
  padding: 2px 7px;
  border: 1px dashed var(--jp-line);
  border-radius: 4px;
  color: #5c665c;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* 전체 산 상세의 종주 카드 */
.traverse-card {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--jp-line);
  border-radius: 10px;
}

.traverse-card b {
  font-size: 14px;
  font-weight: 750;
}

.traverse-stats,
.traverse-path {
  color: #5c665c;
  font-size: 12.5px;
  line-height: 1.5;
}

.traverse-stats i {
  font-style: normal;
  font-weight: 700;
}

/* 코스표·도크 제목의 색 점 = 지도 선 색 */
.course-table .course-key,
#elevationDockTitle .course-key {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 3px;
  vertical-align: 1px;
}

/* 코스표에서 단면에 올라 있는 코스 */
.course-table tbody tr.is-docked {
  background: #e7f0eb;
  box-shadow: inset 0 0 0 1px var(--jp-forest);
}
/* Mobile route controls and segment rows. */
@media (max-width: 600px) {
  .basemap-toggle button, .detail-actions button, .profile-tabs button,
  [data-profile-mode], [data-route-map] { min-width:44px; min-height:44px; }
  .segment-table { width:100%; min-width:0; table-layout:fixed; font-size:12px; }
  .segment-table th, .segment-table td { padding:8px 3px; white-space:normal; overflow-wrap:anywhere; }
  .segment-table th:first-child, .segment-table td:first-child { width:30%; }
}
