/* 길찾기 모듈 */

/* 수단 탭 */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--fill); border-radius: 14px; padding: 4px; margin-bottom: 14px; }
.modes button { border: 0; background: transparent; border-radius: 11px; min-height: 42px; font-weight: 700; font-size: 15px; color: var(--muted); cursor: pointer; }
.modes button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* 출발·경유·도착 (점과 세로줄로 잇는 모양) */
.trip { position: relative; display: grid; gap: 6px; }
.tp { position: relative; display: grid; grid-template-columns: 22px 1fr 44px; gap: 8px; align-items: center; }
.tp .dot { width: 12px; height: 12px; border-radius: 50%; justify-self: center; background: var(--muted); position: relative; z-index: 1; box-shadow: 0 0 0 4px var(--card); }
.tp.start .dot { background: var(--pri); }
.tp.end .dot { background: var(--ink); border-radius: 3px; }
.tp.shape .dot { background: var(--warn); }
.tp:not(:last-child)::after { content: ""; position: absolute; left: 10px; top: 50%; height: calc(100% + 6px); border-left: 2px dashed var(--line); }
.tp .name { text-align: left; border: 0; border-radius: 14px; padding: 8px 14px; background: var(--fill); min-height: 54px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 600; color: var(--ink); }
.tp .name small { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 1px; }
.tp .name.empty { color: var(--muted); font-weight: 500; }
.tp .x { min-width: 44px; min-height: 44px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 17px; border-radius: 12px; }
.tp .x.loc { color: var(--pri); font-size: 22px; }
.tp .x:active { background: var(--fill); }
.trip-actions { display: flex; gap: 2px; margin: 6px 0 4px 22px; }

/* 언제 */
.when { margin-top: 10px; }
.seg { display: flex; gap: 4px; background: var(--fill); border-radius: 14px; padding: 4px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 11px; min-height: 40px; font-size: 14px; font-weight: 600; color: var(--sub); cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg.small button { min-height: 36px; font-size: 13.5px; }
.when-custom { display: grid; gap: 8px; margin-top: 8px; padding: 12px; border-radius: 16px; border: 1.5px solid var(--line); }
.when-custom .quick { display: flex; gap: 6px; flex-wrap: wrap; }

/* 큰 실행 버튼 */
.cta { width: 100%; margin-top: 14px; border: 0; border-radius: 16px; min-height: 58px; background: var(--pri); color: var(--pri-ink); font-size: 17px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px; transition: transform .08s, background .15s; }
.cta:active { transform: scale(.985); background: var(--pri-d); }
.cta small { font-size: 13px; font-weight: 600; opacity: .8; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 지도 */
#map { height: 260px; border-radius: var(--r); margin: 0 0 12px; background: var(--card); box-shadow: var(--shadow); overflow: hidden; }

/* 한 줄 답 */
.answer { display: grid; gap: 2px; padding: 16px; border-radius: 18px; background: var(--pri-soft); margin-bottom: 12px; }
.answer small { font-size: 13px; font-weight: 600; color: var(--pri); }
.answer b { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); }
.answer b .arr { font-size: 16px; font-weight: 700; color: var(--sub); margin-left: 4px; }
.answer span { font-size: 14px; color: var(--sub); }
.errs { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.errs summary { cursor: pointer; font-weight: 600; }

/* 후보 목록 */
.cands { display: grid; gap: 8px; }
.cand { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; border: 1.5px solid var(--line); border-radius: 18px; padding: 14px; background: var(--card); cursor: pointer; text-align: left; width: 100%; color: var(--ink); transition: border-color .15s, background .15s; }
.cand[aria-pressed="true"] { border-color: var(--pri); background: color-mix(in srgb, var(--pri-soft) 55%, var(--card)); }
.cand .k { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--fill); color: var(--sub); }
.cand.best .k, .cand[aria-pressed="true"] .k { background: var(--pri); color: #fff; }
.cand .body { display: grid; gap: 3px; min-width: 0; }
.cand .t { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cand .t b { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.cand .t span { font-size: 13.5px; color: var(--sub); font-weight: 600; }
.cand .m { font-size: 13.5px; color: var(--sub); }
.cand .m.roads { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cand .tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.cand .tot { text-align: right; font-weight: 800; font-size: 15px; white-space: nowrap; }
.cand .tot small { display: block; font-weight: 600; color: var(--muted); font-size: 12px; margin-top: 2px; }
.cand.same { opacity: .7; }
.pv { display: inline-block; font-size: 11.5px; font-weight: 800; padding: 1px 6px; border-radius: 6px; margin-right: 2px; vertical-align: 1px; }
.pv.tmap { background: #ffe9ec; color: #e0213f; } .pv.kakao { background: #fff6cc; color: #8a6d00; } .pv.naver { background: #e3f8ec; color: #03a04a; } .pv.demo { background: var(--fill); color: var(--muted); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pv.tmap { background: #3a1820; color: #ff7a8c; } :root:not([data-theme="light"]) .pv.kakao { background: #33300f; color: #ffd84d; } :root:not([data-theme="light"]) .pv.naver { background: #10301f; color: #3ddc84; } }
.steps { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 2px; }
.step { font-size: 13px; font-weight: 700; padding: 3px 8px; border-radius: 8px; background: var(--fill); }
.step.bus { background: #e6f4ea; color: #1e7d3a; } .step.subway { background: #e8f0fe; color: #2453c6; }
.step small { font-weight: 600; opacity: .75; }
.steps .sep { color: var(--muted); font-size: 12px; }
.cand.transit { cursor: default; }

/* 경로상 찾기 결과 */
.stops { display: grid; gap: 8px; margin-top: 12px; }
.stop { border: 1.5px solid var(--line); border-radius: 18px; padding: 12px 14px; display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; }
.stop.best { border-color: var(--ok); background: color-mix(in srgb, var(--ok-soft) 60%, var(--card)); }
.stop .n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--fill); color: var(--sub); }
.stop.best .n { background: var(--ok); color: #fff; }
.stop .why { font-size: 13px; color: var(--sub); }
.stop .p { text-align: right; font-weight: 800; white-space: nowrap; }
.stop .p small { display: block; font-weight: 600; color: var(--muted); font-size: 12px; }

/* 즐겨찾기 */
.chip.fav { max-width: 100%; text-align: left; background: var(--pri-soft); color: var(--pri); }
.chip.fav .small { color: inherit; opacity: .75; font-size: 12px; }

/* 검색 결과·구간·AI */
.results { display: grid; gap: 6px; margin-top: 10px; }
.results button { text-align: left; border: 0; border-radius: 14px; background: var(--fill); padding: 12px 14px; cursor: pointer; min-height: 52px; font-weight: 600; }
.results small { display: block; color: var(--muted); font-weight: 500; }
.legs { display: grid; gap: 6px; margin-top: 8px; }
.leg { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.leg span { flex: 1; min-width: 140px; }
.ai-text { min-height: 160px; font-size: 13px; font-family: ui-monospace, Menlo, monospace; }
.stack > .btn { flex-direction: column; gap: 0; }
.stack > .btn .small { font-weight: 500; opacity: .8; }
details summary { cursor: pointer; }

/* 지도 표시 */
.mk { background: var(--pri); color: #fff; border-radius: 999px; width: 24px; height: 24px; display: grid; place-items: center; font-size: 12px; font-weight: 800; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.mk.stop { background: var(--ok); } .mk.shape { background: var(--warn); }
