/* 올레길 따라걷기 UI (trails-walk.js) */

.trail-walk {
  position: absolute;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 30;
  width: min(92%, 420px);
  pointer-events: none;
}

.trail-walk > * {
  pointer-events: auto;
}

/* 런처 버튼 */
.trail-walk--idle {
  width: auto;
}

.trail-walk__launch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #0d9488, #0f766e);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.4);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.trail-walk__launch:active {
  transform: scale(0.97);
}

.trail-walk__launch-icon {
  font-size: 12px;
}

.trail-walk__unsupported {
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.82);
  color: #f9fafb;
  font-size: 13px;
  text-align: center;
}

/* 진행/요약 패널 */
.trail-walk__panel {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 18px;
  padding: 16px 18px 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(6px);
}

/* 접기/펼치기 헤더 */
.trail-walk__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 4px 2px;
  border: none;
  background: transparent;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.trail-walk__toggle:active {
  cursor: grabbing;
}

.trail-walk__toggle-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.trail-walk__grip {
  flex-shrink: 0;
  width: 14px;
  height: 12px;
  background-image: radial-gradient(#cbd5e1 40%, transparent 42%);
  background-size: 5px 5px;
  background-position: 0 0;
  opacity: 0.9;
}

.trail-walk__toggle-label {
  font-size: 13px;
  font-weight: 700;
  color: #0f766e;
}

.trail-walk__toggle-pct {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.trail-walk__toggle-sub {
  font-size: 12px;
  color: #64748b;
}

.trail-walk__chevron {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-right: 2px solid #94a3b8;
  border-bottom: 2px solid #94a3b8;
  transform: rotate(-135deg); /* 펼침: 위쪽 화살표 */
  transition: transform 0.2s ease;
  margin-right: 2px;
}

.trail-walk__panel.is-collapsed .trail-walk__chevron {
  transform: rotate(45deg); /* 접힘: 아래쪽 화살표 */
}

.trail-walk__body {
  overflow: hidden;
  max-height: 520px;
  opacity: 1;
  transition: max-height 0.25s ease, opacity 0.2s ease, margin-top 0.2s ease;
  margin-top: 10px;
}

.trail-walk__panel.is-collapsed .trail-walk__body {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

.trail-walk__progress {
  text-align: center;
  margin-bottom: 12px;
}

.trail-walk__pct {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  color: #0f766e;
}

.trail-walk__pct span {
  font-size: 18px;
  font-weight: 700;
  margin-left: 2px;
}

.trail-walk__bar {
  margin: 10px 0 6px;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.trail-walk__bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #2dd4bf, #0d9488);
  transition: width 0.4s ease;
}

.trail-walk__status {
  font-size: 12.5px;
  color: #64748b;
}

.trail-walk__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.trail-walk__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 12px;
  background: #f1f5f9;
}

.trail-walk__stat-v {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.trail-walk__stat-l {
  font-size: 11px;
  color: #64748b;
}

.trail-walk__actions {
  display: flex;
  gap: 10px;
}

.trail-walk__btn {
  flex: 1;
  padding: 12px 0;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.12s ease;
}

.trail-walk__btn:active {
  transform: scale(0.98);
}

.trail-walk__btn--ghost {
  background: #e2e8f0;
  color: #334155;
}

.trail-walk__btn--stop {
  background: #ef4444;
  color: #fff;
}

.trail-walk__btn--save {
  background: #0d9488;
  color: #fff;
}

.trail-walk__btn--save:disabled {
  opacity: 0.7;
  cursor: wait;
}

.trail-walk--done .trail-walk__actions {
  flex-direction: column;
}

.trail-walk--done .trail-walk__btn--ghost {
  width: 100%;
}

.trail-walk__hint {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: #64748b;
  text-align: center;
}

.trail-walk__gap {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fef3c7;
  color: #92400e;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.trail-walk__gap--done {
  margin: 0 0 12px;
}

.trail-walk__panel--done {
  text-align: center;
}

.trail-walk__done-head {
  font-size: 18px;
  font-weight: 800;
  color: #0f766e;
  margin-bottom: 12px;
}

.trail-walk__save-note {
  font-size: 12.5px;
  color: #475569;
  margin-bottom: 12px;
  min-height: 16px;
}
