/* TagoHub 웹 — 폰 앱과 같은 색·모양 (app/src/main/java/com/eunho/tagohub/ui/theme/Theme.kt)
   디자인 1(맑은 파랑) + 5(말랑 파스텔) + 9(유리 지도): 파란 강조 하나, 크게 둥근 모서리, 지도 위에 뜬 반투명 패널 */
:root {
  --primary: #2563eb; --on-primary: #fff; --pcont: #e6eefe;
  --bg: #eef3fa; --surface: #fff; --text: #0f172a; --sv: #eef2f8; --muted: #5b6577; --line: #e3e9f2;
  --header: #0f2747; --soon: #d7262e;
  --glass: rgba(255,255,255,.82); --shadow: 0 10px 30px rgba(37,99,235,.14);
  --r-card: 24px; --r-sheet: 30px; --r-search: 28px;
  /* 바로가기 칸마다 다른 파스텔: 파랑 · 민트 · 보라 · 살구 */
  --p1: #e6eeff; --p2: #ddf6ef; --p3: #ece6ff; --p4: #ffede2;
  --p1i: #2563eb; --p2i: #119c80; --p3i: #7c5cff; --p4i: #e07a3f;
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}
[data-theme="dark"] {
  --primary: #6ea0ff; --on-primary: #0b1220; --pcont: #1a2a4a;
  --bg: #0b1220; --surface: #141c2e; --text: #eaf0ff; --sv: #1c2640; --muted: #9aa6bf; --line: #243049;
  --header: #111b2b; --soon: #ff6b81;
  --glass: rgba(20,28,46,.82); --shadow: 0 10px 30px rgba(0,0,0,.35);
  --p1: rgba(110,160,255,.18); --p2: rgba(47,196,163,.18); --p3: rgba(167,139,250,.20); --p4: rgba(255,170,120,.18);
  --p1i: #6ea0ff; --p2i: #2fc4a3; --p3i: #a78bfa; --p4i: #ffaa78;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
a { color: inherit; text-decoration: none; }
input { font: inherit; color: var(--text); }
small { display: block; color: var(--muted); font-size: 13px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.blue { color: var(--primary); }
.ic { flex: none; }

/* ── 틀: 좁으면 한 화면 + 아래 탭, 넓으면 왼쪽 목록 + 오른쪽 지도 ── */
#app { height: 100%; display: flex; }
#left { display: flex; flex-direction: column; width: 100%; height: 100%; background: var(--bg); }
#panel { flex: 1; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; }
#side { display: none; position: relative; flex: 1; border-left: 1px solid var(--line); }
@media (min-width: 860px) {
  #app { position: relative; }
  #side { display: block; position: absolute; inset: 0; border-left: 0; }
  #left { width: 430px; flex: none; position: relative; z-index: 700; margin: 16px; height: calc(100% - 32px);
    border-radius: var(--r-card); overflow: hidden; background: var(--glass); box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
  .map-slot { display: none !important; }
  #side .side-card { left: 470px; }
  #side .leaflet-left { left: 462px; }
}
#splash { margin: auto; text-align: center; color: var(--muted); }
#splash b { display: block; font-size: 22px; color: var(--text); margin-bottom: 6px; }

#nav { display: flex; height: 64px; background: var(--surface); border-top: 1px solid var(--line); flex: none; padding-bottom: env(safe-area-inset-bottom); }
.nav-b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 700; color: var(--muted); }
.nav-b .pill { width: 54px; height: 30px; border-radius: 15px; display: flex; align-items: center; justify-content: center; }
.nav-b.on { color: var(--primary); }
.nav-b.on .pill { background: var(--pcont); }

#alight { display: flex; align-items: center; gap: 12px; background: #1b7f4b; color: #fff; padding: 8px 16px; flex: none; }
#alight[hidden] { display: none; }
#alight small { color: rgba(255,255,255,.85); }
#alight button { font-weight: 700; }

/* 머리띠 */
.bar { display: flex; align-items: center; gap: 10px; background: var(--header); color: #fff; padding: 12px 16px; flex: none; position: sticky; top: 0; z-index: 5; }
.bar-back { display: flex; margin-left: -6px; padding: 2px; }
.bar-title { flex: 1; min-width: 0; }
.bar-title b { display: block; font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-title small { color: rgba(255,255,255,.75); font-size: 13px; }
.bar-star { font-size: 24px; line-height: 1; padding: 0 6px; }
.bar-star.on { color: #ffc83d; }
.bar-act { background: rgba(255,255,255,.15); border-radius: 10px; padding: 6px 12px; font-weight: 700; font-size: 14px; white-space: nowrap; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 16px; background: var(--surface); flex: none; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 16px; border-radius: 99px; background: var(--sv); color: var(--muted); font-size: 14px; }
.chip.on { background: var(--primary); color: var(--on-primary); font-weight: 700; }

.searchbox { background: var(--surface); padding: 10px 16px 12px; flex: none; }
.searchbox input, .bigsearch input { width: 100%; border: 1px solid var(--line); border-radius: var(--r-search); padding: 12px 14px; background: var(--surface); outline: none; }
.searchbox input:focus { border-color: var(--primary); }

.note { margin: 0; padding: 14px 16px; color: var(--muted); }
.shead { display: flex; align-items: center; justify-content: space-between; padding: 6px 16px; background: var(--sv); color: var(--muted); font-size: 14px; }
.shead button { color: var(--primary); font-weight: 600; }

.list { background: var(--surface); }
.row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.row:hover { background: color-mix(in srgb, var(--sv) 45%, var(--surface)); }
.row b { font-size: 16px; font-weight: 600; display: block; }
.row.col { flex-direction: column; align-items: stretch; gap: 4px; }
.row.col p { margin: 4px 0 0; }
.row .plain { text-align: left; }
.row .cat { font-size: 12px; white-space: nowrap; }
.row .right { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.row .w3 { width: 44px; flex: none; }
.stopmark { width: 18px; height: 18px; border-radius: 50%; border: 4px solid var(--primary); background: var(--surface); flex: none; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 28px; padding: 0 8px; border-radius: 8px; color: #fff; font-weight: 800; font-size: 14px; white-space: nowrap; flex: none; }
.badge.big { font-size: 20px; height: 32px; border-radius: 10px; padding: 0 12px; }
.route .grow small { margin-top: 4px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eta { font-size: 22px; font-weight: 900; }
.eta.soon, .eta-s.soon { color: var(--soon); }
.eta-s { font-size: 13px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.mini { font-size: 13px; color: var(--primary); padding: 4px 6px; white-space: nowrap; }
.mini.on { color: var(--soon); }
.link { color: var(--primary); font-weight: 700; font-size: 14px; }
.link.pad { display: block; padding: 8px 16px; background: var(--surface); width: 100%; }
.btn { background: var(--primary); color: var(--on-primary); border-radius: 18px; padding: 8px 12px; font-weight: 600; white-space: nowrap; }
.outline { border: 1px solid var(--line); border-radius: 16px; padding: 10px 18px; font-weight: 800; color: var(--primary); background: var(--surface); }
.seg { display: flex; gap: 8px; padding: 12px 16px; background: var(--surface); }
.seg button { flex: 1; padding: 12px; border-radius: 16px; background: var(--sv); color: var(--muted); text-align: center; }
.seg button.on { background: var(--primary); color: var(--on-primary); font-weight: 700; }

/* 지도 */
.map { width: 100%; height: 100%; background: var(--sv); }
.map-slot { height: 42vh; min-height: 220px; flex: none; position: relative; }
.map-slot.full { flex: 1; height: auto; }
.map-slot.home-map { height: 46vh; margin-top: -24px; z-index: 0; }
.homecard { position: relative; z-index: 1; }
.home-map .leaflet-top, .home-map .locbtn { top: 34px; }
#side .map { position: absolute; inset: 0; }
.mdot-wrap { position: relative; cursor: pointer; }
.mdot { border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 1px 2px rgba(0,0,0,.35); box-sizing: content-box; transform: translate(-50%, -50%); position: absolute; }
/* 노선 선 위 진행 방향 화살표 (bus.js lineArrows) */
.mline-arrow { position: absolute; width: 12px; height: 12px; line-height: 0; transform: translate(-50%, -50%); pointer-events: none; }
.mdot-label { position: absolute; top: -9px; white-space: nowrap; font: 600 11px var(--font); color: #fff; border-radius: 6px; padding: 1px 5px; }
/* 고른 정류장 이름: 앱처럼 아이콘 바로 위 가운데 */
.mdot-label.up { top: auto; left: 0; transform: translateX(-50%); font-size: 12px; padding: 3px 8px; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.side-card { position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 500; display: none; align-items: center; gap: 12px; background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-radius: var(--r-card); padding: 14px 18px; box-shadow: var(--shadow); max-width: 520px; }
.side-card div { flex: 1; }
.map-slot .side-card { left: 8px; right: 8px; bottom: 8px; }

/* 노선 화면 */
.status { background: var(--surface); padding: 10px 16px; border-bottom: 1px solid var(--line); }
.turn { padding: 4px 16px; background: var(--sv); color: var(--muted); font-size: 13px; }
.rstop { display: flex; align-items: center; gap: 8px; padding: 6px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.dotbtn { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; flex: none; }
.rdot { width: 10px; height: 10px; border-radius: 50%; background: color-mix(in srgb, var(--c) 35%, transparent); }
.rdot.bus { width: 16px; height: 16px; background: var(--c); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--c); }
.rname { padding: 6px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rname.here { color: var(--soon); font-weight: 700; }
.plate { color: #fff; font-size: 12px; font-weight: 700; border-radius: 8px; padding: 2px 8px; white-space: nowrap; }

/* 홈 */
.homecard { background: var(--surface); border-radius: 0 0 var(--r-sheet) var(--r-sheet); box-shadow: 0 4px 12px rgba(0,0,0,.08); padding: 14px 16px; flex: none; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand b { display: block; font-size: 19px; font-weight: 900; }
.brand small { font-size: 12px; }
.bigsearch { display: flex; align-items: center; gap: 8px; margin-top: 12px; background: var(--sv); border-radius: var(--r-search); padding: 0 12px; color: var(--muted); }
.bigsearch input { border: 0; background: transparent; padding: 14px 0; }
.tiles { display: flex; gap: 10px; padding: 18px 16px 0; }
.tile { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.tile-ic { width: 100%; height: 56px; border-radius: 18px; background: var(--p1); color: var(--p1i); display: flex; align-items: center; justify-content: center; }
.tile:nth-child(2) .tile-ic { background: var(--p2); color: var(--p2i); }
.tile:nth-child(3) .tile-ic { background: var(--p3); color: var(--p3i); }
.tile:nth-child(4) .tile-ic { background: var(--p4); color: var(--p4i); }
.sec { padding: 18px 16px 0; }
.sec:last-child { padding-bottom: 18px; }
.sec h3 { margin: 0 0 8px; font-size: 16px; font-weight: 800; }
.sec h3.flex { display: flex; align-items: center; }
.sec p { margin: 4px 0; font-size: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.crow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 14px; border-top: 1px solid var(--line); }
.crow:first-child { border-top: 0; }
.crow b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pills { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.pillbtn { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 7px 14px; font-size: 13px; font-weight: 700; color: var(--muted); }

/* 길찾기 */
.pboxes { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--surface); }
.pbox { flex: 1; min-width: 0; background: var(--sv); border-radius: 16px; padding: 8px 12px; }
.pbox.on { background: var(--pcont); }
.pbox b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swap { font-size: 22px; color: var(--primary); padding: 0 4px; }
.dur { display: inline; font-size: 22px; font-weight: 800; }
.inl { display: inline; }
.bar8 { display: flex; gap: 2px; height: 8px; margin: 6px 0; }
.bar8 i { border-radius: 4px; display: block; }
.sum { padding: 10px 16px; font-weight: 700; font-size: 17px; border-bottom: 1px solid var(--line); }
.step { display: flex; gap: 10px; align-items: flex-start; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.stype { min-width: 52px; text-align: center; color: #fff; font-weight: 700; font-size: 13px; border-radius: 6px; padding: 3px 6px; }

/* 표 (시간표 등) */
.tbl { width: 100%; border-collapse: collapse; background: var(--surface); }
.tbl td, .tbl th { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.tbl th { color: var(--muted); font-weight: 500; font-size: 13px; background: var(--sv); }

/* 시간표·칸 고르기 */
.searchtop { background: var(--surface); padding-bottom: 6px; border-bottom: 1px solid var(--line); flex: none; }
.toolrow { display: flex; align-items: center; gap: 8px; padding: 6px 16px; background: var(--surface); justify-content: space-between; }
.segs { display: flex; gap: 6px; padding: 6px 16px; background: var(--surface); }
.toolrow .segs { padding: 0; }
.segs button { padding: 5px 12px; border-radius: 8px; color: var(--muted); font-size: 14px; }
.segs button.on { background: var(--pcont); color: var(--primary); font-weight: 700; }
.links { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.trip { font-size: 20px; font-weight: 800; }
.sm { font-size: 15px; font-weight: 600; }
.red { color: var(--soon) !important; }
small.blue { color: var(--primary); }
.row.gone { opacity: .55; }
.clock { width: 64px; flex: none; font-size: 17px; }
.eta-m { font-size: 17px; font-weight: 900; }
.eta-m.soon { color: var(--soon); }
.shead.live { background: var(--pcont); color: var(--primary); font-weight: 700; }
.flexrow { display: flex; align-items: center; gap: 8px; }
.cbars { display: flex; align-items: flex-end; gap: 1px; height: 56px; margin-top: 8px; }
.cbars i { flex: 1; display: block; }
.cticks { display: flex; justify-content: space-between; }
.mapimg { flex: 1; position: relative; overflow: hidden; background: #fff; touch-action: none; cursor: grab; min-height: 300px; }
.mapimg img { position: absolute; left: 0; top: 0; transform-origin: 0 0; user-select: none; }
.mapimg .hint { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.75); color: #fff; font-size: 13px; padding: 4px 10px; border-radius: 8px; }
.lamp { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.row.picked { background: var(--pcont); }
textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; outline: none; resize: vertical; margin-bottom: 8px; }
textarea:focus { border-color: var(--primary); }
.btn[disabled] { opacity: .6; }

/* 내 위치 */
.locbtn { position: absolute; right: 10px; top: 10px; z-index: 600; width: 44px; height: 44px; border-radius: 14px; background: var(--glass); color: var(--muted);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; }
.locbtn.on { color: var(--primary); }
/* 서울 실시간 교통 켜기 (내 위치 버튼 아래) */
.trafficbtn { top: 62px; }
.home-map .trafficbtn { top: 86px; }
.locbtn.wait svg { animation: s 1s linear infinite; }
@keyframes s { to { transform: rotate(360deg); } }
.me-dot { width: 16px; height: 16px; border-radius: 50%; background: #2563eb; border: 3px solid #fff; box-shadow: 0 0 0 0 rgba(37,99,235,.5); transform: translate(-50%, -50%); position: absolute; animation: mepulse 2s infinite; }
@keyframes mepulse { 0% { box-shadow: 0 0 0 0 rgba(37,99,235,.45); } 70% { box-shadow: 0 0 0 14px rgba(37,99,235,0); } 100% { box-shadow: 0 0 0 0 rgba(37,99,235,0); } }

/* 정류장 시간표: 시간대 줄 안의 시각·노선 */
.ttimes { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 4px; }
.tt { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }

/* ── 홈 실시간 도착 카드 ── */
.livesec { padding: 14px 16px 0; }
.livecard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.live-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 10px; }
.live-head b { font-size: 15px; font-weight: 800; }
.live-head .link { flex: none; font-size: 13px; }
.live-at { font-size: 12px; color: var(--muted); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex: none; animation: livedot 1.8s ease-in-out infinite; }
@keyframes livedot { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.live-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 8px 14px; border-top: 1px solid var(--line); }
.live-row .grow { min-width: 0; }
.live-row b { font-size: 15px; font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-row small { margin-top: 2px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-eta { font-size: 16px; font-weight: 900; white-space: nowrap; font-variant-numeric: tabular-nums; }
.live-eta.soon { color: var(--soon); }
.live-more { display: block; width: 100%; padding: 11px 14px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--primary); text-align: center; }
.live-note { margin: 0; padding: 2px 14px 12px; font-size: 13px; line-height: 1.55; color: var(--muted); }
.live-skel { padding: 4px 14px 14px; }
.live-skel i { display: block; height: 14px; margin-top: 10px; border-radius: 7px; background: var(--sv); }
.live-skel i:first-child { width: 92%; }
.live-skel i:last-child { width: 64%; }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
/* 아이디 로그인·회원가입 화면 (js/account.js) */
.authform { background: var(--surface); padding: 22px 20px 28px; display: flex; flex-direction: column; gap: 12px; }
.authform h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.authsub, .authhint { margin: 0; color: var(--muted); font-size: 13px; }
.authsub { margin-bottom: 8px; }
.authfield { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.authfield input { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; background: var(--surface); outline: none; font-size: 15px; }
.authfield input:focus { border-color: var(--primary); }
.authsegs { padding: 0; background: none; }
.btn.authbtn { width: 100%; padding: 14px; border-radius: 14px; font-size: 16px; text-align: center; margin-top: 6px; }
.authlinks { display: flex; justify-content: space-evenly; gap: 8px; flex-wrap: wrap; }
.authlinks .link, .authlink { padding: 8px; font-size: 14px; text-align: center; }
.authresult { margin: 0; font-size: 15px; }
.authinfo { margin: 0; color: var(--primary); font-size: 13px; }
.autherr { margin: 0; color: var(--soon); font-size: 13px; }
@media (min-width: 860px) { .authform { max-width: 460px; margin: 0 auto; width: 100%; } }
