/* NAVITONG web route planner (docs/WEB_MAP.md). Map-first: a panel on the left (desktop) or
   at the top with results at the bottom (phone). */
:root{--ink:#14211b;--muted:#5f6b66;--line:#dfe6e2;--card:#ffffff;--bg:#f4f7f5;--mint:#0f9d58;--blue:#1a73e8;--shadow:0 2px 12px rgba(0,0,0,.14)}
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:var(--bg);color:var(--ink);
  font:15px/1.45 -apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo","Hiragino Sans","PingFang TC","Noto Sans KR","Noto Sans JP","Noto Sans TC",sans-serif}
#map{position:fixed;inset:0}
.panel{position:fixed;z-index:3;left:12px;top:12px;width:380px;max-height:calc(100% - 24px);display:flex;flex-direction:column;gap:8px;pointer-events:none}
.panel>*{pointer-events:auto}
.box{background:var(--card);border-radius:14px;box-shadow:var(--shadow);padding:10px}
.brand{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 2px 8px}
.brand a.logo{font-weight:800;color:var(--ink);text-decoration:none;letter-spacing:.2px}
.brand nav{display:flex;gap:6px;font-size:13px}
.brand nav a{color:var(--muted);text-decoration:none}
.brand nav a.on{color:var(--ink);font-weight:700}
.fields{position:relative;display:grid;grid-template-columns:1fr 34px;gap:6px;align-items:center}
.field{display:flex;align-items:center;gap:8px;background:var(--bg);border-radius:10px;padding:0 10px;grid-column:1}
.field .dot{width:10px;height:10px;border-radius:50%;flex:none}
.dot-from{background:#fff;border:3px solid var(--blue)}
.dot-to{background:#e53935}
.field input{flex:1;min-width:0;border:0;background:transparent;font:inherit;padding:10px 0;outline:none;color:var(--ink)}
#swap{grid-column:2;grid-row:1/3;border:0;background:var(--bg);border-radius:10px;height:100%;font-size:18px;cursor:pointer;color:var(--muted)}
.modes{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-top:8px}
.mode{border:1px solid var(--line);background:#fff;border-radius:10px;padding:7px 2px;font:inherit;font-size:13px;cursor:pointer;color:var(--muted)}
.mode b{display:block;font-size:18px;line-height:1.2}
.mode.on{border-color:var(--ink);color:var(--ink);font-weight:700;background:#eef6f1}
#sugg{position:absolute;left:0;right:0;top:100%;margin-top:6px;background:#fff;border-radius:12px;box-shadow:var(--shadow);max-height:50vh;overflow:auto;z-index:5}
.sugg-item{display:block;width:100%;text-align:left;border:0;border-bottom:1px solid var(--line);background:#fff;padding:9px 12px;font:inherit;cursor:pointer}
.sugg-item:hover{background:var(--bg)}
.sugg-name{display:block;font-weight:600}
.sugg-sub{display:block;font-size:12.5px;color:var(--muted)}
.sugg-empty{padding:12px;color:var(--muted)}
#result{overflow:auto}
.card{display:grid;grid-template-columns:auto 1fr auto;gap:2px 10px;align-items:baseline;width:100%;text-align:left;border:1px solid var(--line);
  background:#fff;border-radius:12px;padding:10px 12px;margin-bottom:6px;font:inherit;cursor:pointer}
.card.on{border-color:var(--ink);box-shadow:inset 0 0 0 1px var(--ink)}
.card-time{font-size:19px;font-weight:800}
.card-dist{color:var(--muted)}
.card-tag{font-size:12px;color:var(--muted)}
.traffic-basis{font-size:12px;color:var(--muted);margin:4px 2px}
.tcard .chips{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:4px}
.chip{font-size:12px;padding:1px 7px;border-radius:999px;background:#e8710a;color:#fff}
.actions{display:flex;gap:6px;margin:8px 0}
.btn.cancel{flex:none}
.btn{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:10px;padding:10px 14px;font:inherit;font-weight:700;cursor:pointer;text-decoration:none;flex:1}
.btn.primary{background:var(--ink);color:#fff}
.btn.secondary{background:var(--bg);color:var(--ink)}
.btn.disabled{background:#c9d2cd;color:#33413a;cursor:default;font-weight:600;font-size:13px}
.steps summary{cursor:pointer;color:var(--muted);padding:4px 0}
.steps ol,.legs{margin:6px 0;padding-left:20px}
.steps li,.legs li{margin:4px 0}
.step-dist{color:var(--muted);font-size:12.5px;margin-left:6px}
.note,.credit{font-size:12.5px;color:var(--muted);margin:6px 0}
.busy{color:var(--muted);padding:6px 2px}
.error{color:#b3261e;padding:6px 2px}
.foot{font-size:12px;color:var(--muted);margin-top:8px}
.foot a{color:var(--muted)}
.pin{width:18px;height:18px;border-radius:50%;box-shadow:0 1px 4px rgba(0,0,0,.4);cursor:grab}
.pin-from{background:#fff;border:5px solid var(--blue)}
.pin-to{background:#e53935;border:3px solid #fff}
.pick{display:flex;gap:6px}
.pick .btn{padding:8px 10px;font-size:13px}
.maplibregl-popup-content{border-radius:12px;padding:8px 26px 8px 8px}
.maplibregl-popup-close-button{font-size:18px;width:24px;height:24px;line-height:22px;right:2px;top:2px;color:#5f6368;border-radius:12px}
.summary{display:flex;width:100%;align-items:center;gap:8px;border:0;background:var(--bg);border-radius:10px;padding:9px 10px;
  font:inherit;font-weight:600;text-align:left;cursor:pointer;margin-bottom:8px}
.sum-text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sum-edit{flex:none;font-size:13px;color:var(--muted);font-weight:500}
.handle{display:none}
.summary[hidden]{display:none}
@media (min-width:760px){.summary{display:none}}
@media (max-width:759px){
  .panel{left:8px;right:8px;top:8px;width:auto;max-height:none}
  .box{padding:8px}
  .brand{margin:0 2px 6px}
  .brand nav{display:none}
  .field input{padding:8px 0}
  .modes{margin-top:6px;gap:4px}
  .mode{display:flex;align-items:center;justify-content:center;gap:4px;padding:6px 2px;font-size:12.5px}
  .mode b{display:inline;font-size:15px}
  .foot{font-size:11.5px;margin-top:6px}
  /* A route on screen: the panel folds to one line (tap to edit) and the brand and notes step aside. */
  body.routed:not(.editing) .fields, body.routed:not(.editing) .foot,
  body.routed:not(.editing) .brand{display:none}
  body.routed.editing .summary .sum-edit{visibility:hidden}
  #result{position:fixed;left:0;right:0;bottom:0;max-height:34vh;border-radius:16px 16px 0 0;padding:6px 12px 12px;z-index:4;
    padding-bottom:calc(12px + env(safe-area-inset-bottom))}
  #result.open{max-height:72vh}
  .handle{display:block;width:100%;border:0;background:transparent;color:var(--muted);font:inherit;font-size:13px;padding:4px 0 8px;cursor:pointer}
  .handle::before{content:"";display:block;width:36px;height:4px;border-radius:2px;background:#cfd8d3;margin:0 auto 6px}
  /* Folded sheet: the chosen route and its buttons only. */
  #result:not(.open) .card:not(.on), #result:not(.open) .steps, #result:not(.open) .note, #result:not(.open) .legs,
  #result:not(.open) .credit{display:none}
  .card{padding:8px 12px}
  .actions{margin:6px 0 0}
  .btn{padding:9px 10px;font-size:14px}
}

/* 내 위치 and web guidance (2026-11-11). */
.field .here{flex:none;border:0;background:transparent;color:var(--blue);font-size:18px;padding:4px;cursor:pointer}
.btn.wide{display:flex;width:100%;margin-top:6px}
.guide{display:none}
body.guiding .panel{display:none}
body.guiding .guide{display:block}
.g-top{position:fixed;z-index:6;left:8px;right:8px;top:8px;background:#0f3d2e;color:#fff;border-radius:14px;padding:12px 14px;box-shadow:var(--shadow);
  display:flex;gap:12px;align-items:center}
.g-dist{font-size:26px;font-weight:800;white-space:nowrap}
.g-text{font-size:16px;font-weight:600;line-height:1.3}
.g-bottom{position:fixed;z-index:6;left:8px;right:8px;bottom:calc(10px + env(safe-area-inset-bottom));background:#fff;border-radius:14px;padding:10px 12px;
  box-shadow:var(--shadow);display:flex;gap:8px;align-items:center}
.g-left{flex:1;font-weight:700}
.g-btn{border:0;background:var(--bg);border-radius:10px;width:42px;height:42px;font-size:18px;cursor:pointer}
.g-stop{flex:none}
.g-note{position:fixed;z-index:6;left:12px;right:12px;bottom:calc(76px + env(safe-area-inset-bottom));margin:0;font-size:12px;color:#33413a;
  background:rgba(255,255,255,.9);border-radius:8px;padding:4px 8px}
.me-btn{font-size:18px;line-height:1;color:var(--blue)}
.here-dot{width:18px;height:18px;border-radius:50%;background:var(--blue);border:3px solid #fff;box-shadow:0 0 0 6px rgba(26,115,232,.2)}
.consent{position:fixed;inset:0;z-index:10;background:rgba(0,0,0,.45);display:flex;align-items:center;justify-content:center;padding:16px}
.consent[hidden]{display:none}
.consent-box{background:#fff;border-radius:16px;padding:18px;max-width:420px;width:100%;box-shadow:var(--shadow)}
.consent-box h2{margin:0 0 8px;font-size:18px}
.consent-box p{margin:6px 0;font-size:14px}
.age{display:flex;gap:8px;align-items:center;font-weight:700;margin:10px 0 4px}
.age input{width:20px;height:20px}
.consent-note{color:#b3261e;min-height:1em}

/* 경유지, 집·회사, 최근 (2026-11-11). */
.vias{grid-column:1;display:flex;flex-direction:column;gap:6px}
.vias:empty{display:none}
.dot-via{width:16px;height:16px;border-radius:50%;background:#f6a609;color:#fff;font-size:10px;font-weight:800;display:flex;align-items:center;justify-content:center}
.add-via{grid-column:1;justify-self:start;border:0;background:transparent;color:var(--blue);font:inherit;font-size:13px;padding:2px 4px;cursor:pointer}
.pin-via{width:20px;height:20px;border-radius:50%;background:#f6a609;border:2px solid #fff;color:#fff;font-size:11px;font-weight:800;display:flex;align-items:center;justify-content:center;box-shadow:0 1px 4px rgba(0,0,0,.4)}
.pick{flex-wrap:wrap}
.pick-save{display:flex;gap:10px;width:100%;margin-top:4px}
.link{border:0;background:transparent;color:var(--muted);font:inherit;font-size:12.5px;padding:2px;cursor:pointer}
@media (max-width:759px){ body.routed:not(.editing) .vias, body.routed:not(.editing) .add-via{display:none} }

/* Route options (2026-11-11). */
.opt-toggle{border:0;background:transparent;color:var(--muted);font:inherit;font-size:13px;padding:6px 2px 0;cursor:pointer}
.options{display:flex;flex-direction:column;gap:4px;padding:6px 2px 2px;font-size:13.5px}
.options[hidden]{display:none}
.opt{display:flex;align-items:center;gap:6px}
.opt input{width:18px;height:18px}
.opt-select{font:inherit;padding:3px 6px;border-radius:8px;border:1px solid var(--line)}
.opt-none{color:var(--muted)}
@media (max-width:759px){ body.routed:not(.editing) .opt-toggle, body.routed:not(.editing) .options{display:none} }

/* Entrances and fuel (2026-11-11). */
.fuel-title{font-weight:700;margin:2px 0 6px}
.card.fuel .card-time{font-size:17px}
.fuel-pin{background:#fff;border:2px solid #e8710a;color:#14211b;border-radius:10px;padding:1px 6px;font-size:12px;font-weight:700;box-shadow:0 1px 3px rgba(0,0,0,.3)}
.fuel-pin.cheapest{background:#e8710a;color:#fff}
.note.gate{color:#0f3d2e}

/* Speed limit, night (2026-11-11). */
.g-side{position:fixed;z-index:6;left:12px;top:110px;display:flex;flex-direction:column;align-items:center;gap:4px}
.g-limit{width:52px;height:52px;border-radius:50%;background:#fff;border:6px solid #e53935;color:#111;font-size:20px;font-weight:800;
  display:flex;align-items:center;justify-content:center;box-shadow:var(--shadow)}
.g-limit[hidden]{display:none}
.g-limit.over{background:#e53935;color:#fff;animation:blink 1s infinite}
@keyframes blink{50%{opacity:.55}}
.g-speed{font-weight:800;background:rgba(255,255,255,.92);border-radius:8px;padding:1px 6px;font-size:13px}
.g-speed:empty{display:none}
body.night .g-bottom, body.night .box{background:#1f2428;color:#e8ecea}
body.night .field, body.night .btn.secondary, body.night .g-btn, body.night .summary{background:#2a3036;color:#e8ecea}
body.night .field input{color:#e8ecea}
body.night .mode{background:#1f2428;color:#b8c2bd;border-color:#384047}
body.night .mode.on{background:#2c3a33;color:#fff;border-color:#9fd3b6}
body.night .card{background:#242a2f;color:#e8ecea;border-color:#384047}
body.night .btn.primary{background:#2ee59d;color:#0b1f17}

.card-tag.live{color:#c62828;font-weight:700}
/* Tokyo lines not running normally (map.js lineStatus): an orange line on the card, a box over the legs. */
.tcard .card-warn{grid-column:1/-1;font-size:13px;font-weight:700;color:#c25e00}
.status-box{border:1px solid #d66e00;border-radius:10px;padding:8px 12px;margin:8px 0;font-size:14px}
.status-box strong{color:#c25e00}
.status-box p{margin:4px 0}
.status-box small{color:var(--muted)}
body.night .tcard .card-warn, body.night .status-box strong{color:#ffab5e}
body.night .status-box{border-color:#ffab5e}

.toast{position:fixed;z-index:20;left:50%;bottom:120px;transform:translateX(-50%);background:#14211b;color:#fff;border-radius:10px;padding:8px 14px;font-size:14px}

.g-cam{background:#fff8e1;border:2px solid #f6a609;border-radius:10px;padding:2px 8px;font-weight:800;font-size:13px;white-space:nowrap}
.g-cam[hidden]{display:none}
.cam-pin{font-size:16px;filter:drop-shadow(0 1px 2px rgba(0,0,0,.4))}
/* Transit choices above the results (apps' TransitScreen): mode tabs with counts, sort, time. */
.tctl{margin:0 0 8px}
.ttabs{display:flex;gap:4px;overflow-x:auto;padding-bottom:2px}
.ttab{flex:none;border:1px solid var(--line);background:#fff;border-radius:999px;padding:5px 11px;font:inherit;font-size:13px;color:var(--muted);cursor:pointer;white-space:nowrap}
.ttab.on{border-color:var(--ink);color:var(--ink);font-weight:700}
.trow{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.opt-time{font:inherit;padding:3px 6px;border-radius:8px;border:1px solid var(--line)}
.card-badge{grid-column:1/-1;font-size:12px;font-weight:700;color:var(--mint)}
/* 지도 화면 (auto / always light / always dark), as in the apps' settings. */
.theme-ctl{position:relative}
.theme-btn{font-size:17px;line-height:29px}
.theme-menu{position:absolute;right:36px;bottom:0;background:#fff;border-radius:10px;box-shadow:var(--shadow);padding:4px;display:flex;flex-direction:column;min-width:200px;z-index:5}
.theme-menu[hidden]{display:none}
.maplibregl-ctrl-group .theme-opt{width:auto;height:auto;text-align:left;padding:8px 10px;font:inherit;font-size:13px;border:0;border-radius:8px;background:transparent;color:var(--ink);white-space:normal}
.maplibregl-ctrl-group .theme-opt.on{background:var(--bg);font-weight:700}
body.night .theme-menu{background:#1f2428}
body.night .maplibregl-ctrl-group .theme-opt{color:#e8ecea}
body.night .maplibregl-ctrl-group .theme-opt.on{background:#2a3036}
body.night .ttab{background:#1f2428;color:#b8c2bd;border-color:#384047}
body.night .ttab.on{color:#fff;border-color:#9fd3b6}
body.night .opt-select, body.night .opt-time{background:#2a3036;color:#e8ecea;border-color:#384047}
/* 항상 어둡게 also outside guidance: the planner panel follows the map. */
body.night .brand a.logo, body.night .brand nav a.on{color:#e8ecea}
body.night .brand nav a, body.night .opt-toggle, body.night .handle, body.night .steps summary{color:#b8c2bd}
body.night .box a{color:#9fd3b6}
body.night #swap{background:#2a3036;color:#b8c2bd}
body.night .sugg-item{background:#1f2428;color:#e8ecea;border-color:#384047}
body.night .sugg-item:hover{background:#2a3036}
body.night .note, body.night .credit, body.night .card-dist, body.night .card-tag, body.night .sugg-sub{color:#a9b3ae}
.opt-group{display:flex;flex-wrap:wrap;align-items:center;gap:2px 10px;padding-bottom:4px;margin-bottom:4px;border-bottom:1px solid var(--line)}
.opt-group-label{font-size:13px;color:var(--muted);flex-basis:100%}
.opt-toggle.on{color:var(--ink);font-weight:700}
body.night .opt-toggle.on{color:#fff}
.fuel-head{display:flex;align-items:center;justify-content:space-between;gap:8px;position:sticky;top:0;background:inherit;z-index:1}
.fuel-close{flex:none;border:1px solid var(--line);background:#fff;border-radius:999px;width:32px;height:32px;font:inherit;font-size:15px;cursor:pointer;color:var(--ink)}
body.night .fuel-close{background:#2a3036;color:#e8ecea;border-color:#384047}
/* Phone: 경로 옵션 and 주변 주유소 at the top of the result sheet (the top panel folds once routed). */
.sheet-tools{display:none}
@media (max-width:759px){ .sheet-tools{display:block;margin:0 0 8px} }
.sheet-row{display:flex;gap:6px;flex-wrap:wrap}
.sheet-btn{border:1px solid var(--line);background:#fff;border-radius:999px;padding:6px 12px;font:inherit;font-size:13px;color:var(--ink);cursor:pointer}
.sheet-btn.on{border-color:var(--ink);font-weight:700}
.sheet-options{display:flex;flex-direction:column;gap:4px;padding:8px 2px 2px;font-size:13.5px}
.sheet-options[hidden]{display:none}
body.night .sheet-btn{background:#1f2428;color:#e8ecea;border-color:#384047}
body.night .sheet-btn.on{border-color:#9fd3b6}
/* 날씨 자세히 (Boss 2026-11-18): a pill's click opens the place's weather. */
.wx-pop .maplibregl-popup-content{padding:12px 14px 10px 14px;min-width:240px}
.wx-detail{font-size:13px;color:var(--ink);line-height:1.35}
.wx-title{font-weight:700;font-size:15px;margin:0 18px 6px 0}
.wx-note{color:var(--muted);padding:6px 0}
.wx-now{display:flex;align-items:center;gap:12px;margin-bottom:8px}
.wx-big{font-size:28px;font-weight:700;white-space:nowrap}
.wx-facts{color:var(--muted);font-size:12px}
.wx-head{font-weight:700;font-size:12px;color:var(--muted);margin:8px 0 4px;border-top:1px solid var(--line);padding-top:8px}
.wx-hours{display:flex;justify-content:space-between;gap:2px}
.wx-hour{flex:1 1 0;min-width:0;text-align:center}
.wx-small{font-size:11px;color:var(--muted)}
.wx-emoji{font-size:16px}
.wx-temp{font-weight:600}
.wx-rain{font-size:10px;color:var(--blue);white-space:nowrap}
.wx-days{display:grid;grid-template-columns:auto auto 1fr auto;column-gap:10px;row-gap:3px;align-items:center}
.wx-day{display:contents}
.wx-dname{white-space:nowrap}
.wx-days .wx-rain{text-align:left}
.wx-range{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.wx-sun{margin-top:8px}
.wx-credit{display:block;margin-top:8px;font-size:10px;color:var(--muted);text-decoration:none}
.wx-credit:hover{text-decoration:underline}
.wx-sheet{position:fixed;left:0;right:0;bottom:0;z-index:8;background:var(--card);border-radius:16px 16px 0 0;box-shadow:0 -2px 16px rgba(0,0,0,.18);max-height:62vh;overflow-y:auto;padding:14px 16px calc(14px + env(safe-area-inset-bottom))}
.wx-sheet-close{position:absolute;right:8px;top:6px;width:32px;height:32px;border:0;background:none;font-size:22px;color:#5f6368;cursor:pointer;border-radius:16px}
