/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary:    #FF6B35;
  --primary-dk: #E55924;
  --green:      #16A34A;
  --green-dk:   #15803D;
  --bg:         #F2F4F7;
  --white:      #FFFFFF;
  --text:       #111827;
  --muted:      #6B7280;
  --border:     #E5E7EB;
  --blue:       #1D4ED8;
  --red:        #B91C1C;
  --positive:   #15803D;
  --H:          52px;   /* header height */
  --NAV:        60px;   /* nav height */
  --safe-b:     env(safe-area-inset-bottom, 0px);
}

html { height: 100%; -webkit-text-size-adjust: 100%; }

body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Header ────────────────────────────────────────── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--H);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.header-title { font-size: 18px; font-weight: 700; letter-spacing: -.3px; }
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-date  { font-size: 12px; opacity: .88; }
.header-user  { font-size: 12px; opacity: .9; font-weight: 600; }
.btn-logout {
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 6px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  cursor: pointer;
}
.btn-logout:active { background: rgba(255,255,255,.35); }

/* ── Main ──────────────────────────────────────────── */
.main {
  position: fixed;
  top: var(--H);
  bottom: calc(var(--NAV) + var(--safe-b));
  left: 0; right: 0;
  overflow: hidden;
}

/* ── Views ─────────────────────────────────────────── */
.view { display: none; height: 100%; flex-direction: column; }
.view.active { display: flex; }

.scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 12px 12px 16px;
}

/* ── Map (네비 전체화면) ─────────────────────────────── */
#viewDelivery {
  position: relative;
  overflow: hidden;
}
.map-container {
  position: fixed;
  top: var(--H);
  bottom: calc(var(--NAV) + var(--safe-b));
  left: 0; right: 0;
  z-index: 150;
  transform-origin: center center;
  overflow: hidden;
  background: #ddd;
}
/* 내비 모드: 회전 시 모서리 잘림 방지를 위해 확장 */
.map-container.navi-mode {
  overflow: visible;
}
.map-box {
  width: 100%;
  height: 100%;
  background: #ddd;
}

/* ── 상단 경로 입력 시트 ──────────────────────────────── */
.bottom-sheet {
  position: relative;
  background: var(--white);
  border-radius: 0 0 16px 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  z-index: 20;
  display: flex;
  flex-direction: column;
  max-height: 100%;
  transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  flex-shrink: 0;
}
.bottom-sheet.collapsed {
  max-height: 40px;
}
.sheet-handle-wrap {
  display: flex;
  justify-content: center;
  padding: 10px 0 8px;
  cursor: pointer;
  flex-shrink: 0;
}
.sheet-handle-bar {
  width: 40px;
  height: 4px;
  background: #D1D5DB;
  border-radius: 2px;
}
.sheet-content {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 12px 20px;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.25) transparent;
}
.sheet-content::-webkit-scrollbar { width: 4px; }
.sheet-content::-webkit-scrollbar-thumb { background: rgba(0,0,0,.25); border-radius: 2px; }
.sheet-content::-webkit-scrollbar-track { background: transparent; }
.map-controls {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 10;
  display: flex;
  gap: 6px;
  align-items: center;
  pointer-events: none;
}
.map-search-wrap {
  flex: 1;
  display: flex;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
  overflow: hidden;
  pointer-events: auto;
}
.map-search-input {
  flex: 1;
  border: none;
  padding: 9px 12px;
  font-size: 13px;
  outline: none;
  color: var(--text);
  min-width: 0;
}
.map-search-input::placeholder { color: #9CA3AF; }
.btn-map-search {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-map-search:active { background: var(--primary-dk); }
.btn-map-loc {
  width: 38px;
  height: 38px;
  background: #fff;
  border: none;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
  pointer-events: auto;
}
.btn-map-loc svg { width: 18px; height: 18px; }
.btn-map-loc:active { background: #F9FAFB; }
.btn-map-loc.locating { opacity: .5; pointer-events: none; }
.btn-map-close {
  width: 38px; height: 38px;
  background: #fff; border: 1px solid var(--border);
  border-radius: 50%; font-size: 16px; color: var(--muted);
  cursor: pointer; pointer-events: auto;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.btn-map-close:active { background: #F3F4F6; }
.btn-cctv-toggle {
  width: 38px; height: 38px; flex-shrink: 0;
  background: #fff; border: 1px solid var(--border);
  border-radius: 6px; font-size: 18px;
  cursor: pointer; pointer-events: auto;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
  display: flex; align-items: center; justify-content: center;
}
.btn-cctv-toggle.active { background: #FEF3C7; border-color: #FCD34D; }
.btn-cctv-toggle:active { background: #F9FAFB; }
.cctv-marker {
  font-size: 18px; cursor: pointer; line-height: 1;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.4));
  user-select: none;
}
.cctv-popup {
  position: absolute; bottom: 10px; left: 10px; right: 10px;
  background: #000; border-radius: 10px; overflow: hidden; z-index: 20;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
}
.cctv-popup-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: rgba(255,255,255,.12);
}
.cctv-popup-name { font-size: 13px; font-weight: 600; color: #fff; }
.cctv-popup-close {
  background: none; border: none; color: rgba(255,255,255,.7);
  font-size: 16px; cursor: pointer; padding: 2px 6px; line-height: 1;
}
#cctvVideo { width: 100%; max-height: 220px; display: block; }
.cctv-error {
  display: none; align-items: center; justify-content: center;
  height: 120px; color: rgba(255,255,255,.6); font-size: 13px;
}
.btn-map-toggle {
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 6px; color: #fff;
  font-size: 15px; padding: 4px 7px;
  cursor: pointer; line-height: 1;
}
.btn-map-toggle:active { background: rgba(255,255,255,.35); }

/* ── Bottom Nav ────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--NAV) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 50;
  box-shadow: 0 -2px 8px rgba(0,0,0,.07);
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
  transition: color .15s;
}
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn.active { color: var(--primary); }

/* ── Cards ─────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.card-title { font-size: 14px; font-weight: 600; }
.card-header-btns { display: flex; gap: 10px; }

/* ── 픽업-배송 그룹 ─────────────────────────────── */
.group-divider {
  display: flex; align-items: center; gap: 8px;
  margin: 8px 0 4px;
}
.group-divider::before {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.group-label {
  font-size: 11px; font-weight: 700; color: var(--muted);
  white-space: nowrap; letter-spacing: .3px;
}
.group-delete-btn {
  font-size: 11px; color: #DC2626; background: none; border: none;
  cursor: pointer; padding: 2px 4px;
}
.btn-add-delivery {
  display: block; width: 100%;
  text-align: left; padding: 6px 8px 6px 32px;
  font-size: 12px; color: var(--primary);
  background: none; border: 1px dashed var(--border);
  border-radius: 6px; cursor: pointer; margin: 4px 0 8px;
}
.btn-add-delivery:active { background: #FFF7F3; }

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 0;
}

/* ── Address List ──────────────────────────────────── */
.addr-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
  transition: opacity .15s;
}
.addr-item.dragging { opacity: 0.35; }
.addr-item.drag-over {
  outline: 2px solid var(--primary);
  border-radius: 12px;
}
.drag-handle {
  cursor: grab;
  color: #CBD5E1;
  font-size: 18px;
  padding: 0 2px;
  flex-shrink: 0;
  user-select: none;
  touch-action: none;
  line-height: 1;
}
.drag-handle:active { cursor: grabbing; color: var(--muted); }
.addr-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-type-toggle {
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  min-height: 32px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}
.btn-type-toggle.type-pickup {
  background: #DBEAFE;
  color: #1D4ED8;
}
.btn-type-toggle.type-delivery {
  background: #DCFCE7;
  color: #15803D;
}
/* 그룹 내 픽업/배송 고정 라벨 */
.addr-label {
  font-size: 11px; font-weight: 600; white-space: nowrap;
  padding: 3px 8px; border-radius: 4px; flex-shrink: 0;
}
.type-pickup-label  { background: #DBEAFE; color: #1D4ED8; }
.type-delivery-label { background: #DCFCE7; color: #15803D; }

.departure-time-input {
  font-size: 12px; font-weight: 600;
  color: var(--primary); border: none; background: transparent;
  padding: 2px 0; width: 72px; flex-shrink: 0;
  cursor: pointer;
}

.addr-box {
  flex: 1;
  display: flex;
  align-items: center;
  background: #F9FAFB;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  min-width: 0;
}
.addr-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: #F9FAFB;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  min-width: 0;
}
.addr-input-wrap:focus-within { border-color: var(--primary); }
.addr-input {
  flex: 1;
  border: none;
  background: none;
  padding: 12px 10px;
  font-size: 15px;
  outline: none;
  color: var(--text);
  min-width: 0;
}
.addr-input::placeholder { color: #9CA3AF; }
.addr-suggestions {
  margin-left: 80px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  margin-top: 2px;
  z-index: 10;
}
.addr-suggestions:empty { display: none; }
.suggest-history-header {
  padding: 6px 12px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: #F9FAFB;
  border-bottom: 1px solid #F3F4F6;
}
.suggest-hist-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.suggest-hist-time {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.addr-suggest-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #F3F4F6;
}
.addr-suggest-item:last-child { border-bottom: none; }
.addr-suggest-item:active { background: #F9FAFB; }
.suggest-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 3px;
}
.suggest-addrs { display: flex; flex-direction: column; gap: 1px; }
.suggest-road {
  font-size: 11px;
  color: var(--muted);
  display: block;
}
.suggest-jibun {
  font-size: 10px;
  color: #9CA3AF;
  display: block;
}
.addr-text {
  flex: 1;
  padding: 12px 10px;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}
.addr-text.ph { color: #9CA3AF; }
.btn-loc {
  padding: 12px 10px;
  min-height: 44px;
  background: none;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}
.btn-fee-toggle {
  width: 36px;
  height: 36px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  color: var(--primary);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}
.btn-fee-toggle:active { background: #FFF0EB; }
.btn-rm {
  width: 38px;
  height: 38px;
  background: none;
  border: none;
  color: #CBD5E1;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  line-height: 1;
}
.btn-rm:active { background: #F3F4F6; color: var(--red); }
.addr-spacer { width: 30px; flex-shrink: 0; }

/* 주소별 금액 입력 행 */
.addr-fee-row {
  display: none;
  align-items: center;
  gap: 6px;
  padding-left: 48px; /* label(40px) + gap(8px) */
}
.addr-item.fee-open .addr-fee-row { display: flex; }
.addr-fee-label {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}
.addr-fee-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 15px;
  font-weight: 700;
  text-align: right;
  background: #F9FAFB;
  outline: none;
  color: var(--text);
  min-width: 0;
}
.addr-fee-input:focus { border-color: var(--primary); }
.addr-fee-unit {
  font-size: 13px;
  color: var(--muted);
  flex-shrink: 0;
}

/* ── Fee ───────────────────────────────────────────── */
.fee-row {
  display: flex;
  align-items: center;
  background: #F9FAFB;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  margin-bottom: 8px;
}
.fee-input {
  flex: 1;
  border: none;
  background: none;
  padding: 11px 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
  outline: none;
  min-width: 0;
}
.fee-unit {
  font-size: 16px;
  color: var(--muted);
  margin-left: 4px;
  flex-shrink: 0;
}
.text-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  background: #F9FAFB;
  outline: none;
  color: var(--text);
}

/* ── Buttons ───────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin: 6px 0;
  transition: background .15s;
}
.btn-primary:active { background: var(--primary-dk); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-green { background: var(--green); }
.btn-green:active { background: var(--green-dk); }
.route-action-bar {
  position: sticky;
  bottom: -14px; /* route-result padding 보정 */
  background: #fff;
  padding: 8px 0 4px;
  z-index: 1;
}
.route-btns { display: flex; gap: 8px; }
.route-btns .btn-primary { flex: 1; margin: 0; }
.route-btns-sub { display: flex; gap: 8px; margin-top: 4px; }
.route-btns-sub .btn-primary,
.route-btns-sub .btn-outline { flex: 1; margin: 0; font-size: 13px; padding: 9px 12px; }
.route-fee-sum { text-align: right; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.route-fee-sum strong { color: var(--primary); font-size: 15px; }
.btn-outline {
  flex: 1;
  padding: 12px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

/* ── 픽업 후보 ──────────────────────────────────────── */
.optimize-btn-row { display: flex; gap: 8px; }
.optimize-btn-row .btn-primary { flex: 1; }
.btn-pickup-cand { padding: 0 14px; flex-shrink: 0; font-size: 13px; }

.pickup-recommend {
  margin-top: 8px; background: #FFFBEB;
  border: 1px solid #FDE68A; border-radius: 10px; padding: 10px 12px;
}
.pickup-rec-title { font-size: 12px; font-weight: 700; color: #92400E; margin-bottom: 8px; }
.pickup-rec-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0; border-top: 1px solid #FEF3C7;
}
.pickup-rec-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pickup-rec-name { font-size: 13px; font-weight: 600; color: #1C1917; }
.pickup-rec-addr { font-size: 11px; color: #78716C; }
.pickup-rec-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pickup-rec-mins { font-size: 11px; color: #D97706; font-weight: 600; }
.pickup-rec-add {
  font-size: 11px; padding: 3px 8px; border-radius: 5px;
  background: #F59E0B; color: #fff; border: none; cursor: pointer; font-weight: 600;
}

.pickup-cand-drawer {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.45); align-items: flex-end;
}
.pickup-cand-inner {
  width: 100%; background: var(--white);
  border-radius: 16px 16px 0 0; max-height: 75vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.pickup-cand-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.pickup-cand-title { font-size: 15px; font-weight: 700; }
.pickup-cand-close { background: none; border: none; font-size: 18px; cursor: pointer; padding: 4px; }
.pickup-cand-add { padding: 12px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.pickup-cand-input {
  width: 100%; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; font-size: 14px; outline: none;
}
.pickup-cand-list { overflow-y: auto; flex: 1; padding: 8px 0; }
.pickup-cand-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
}
.pickup-cand-item-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pickup-cand-item-name { font-size: 13px; font-weight: 600; }
.pickup-cand-item-addr { font-size: 11px; color: var(--muted); }
.pickup-cand-del {
  font-size: 11px; padding: 3px 8px; background: #FEF2F2; color: #DC2626;
  border: 1px solid #FECACA; border-radius: 5px; cursor: pointer; flex-shrink: 0;
}
.pickup-cand-empty { padding: 20px 16px; text-align: center; color: var(--muted); font-size: 13px; }

/* ── Route Result ──────────────────────────────────── */
.route-result {
  background: var(--white);
  border-radius: 12px;
  padding: 14px;
  margin: 6px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.route-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  margin-bottom: 10px;
}
.distance-val { font-size: 18px; color: var(--primary); font-weight: 700; }
.route-order { margin-bottom: 12px; }
.route-step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
  border-bottom: 1px solid #F3F4F6;
  font-size: 13px;
}
.route-step:last-child { border-bottom: none; }
.step-num {
  font-weight: 700;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  background: var(--primary);
}
.step-num.type-start    { background: #F97316; }
.step-num.type-pickup   { background: #2563EB; }
.step-num.type-delivery { background: #16A34A; }
.step-addr {
  flex: 1;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.step-eta {
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  flex-shrink: 0;
  background: #F0FDF4;
  padding: 2px 7px;
  border-radius: 20px;
}
.step-mins {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
  min-width: 34px;
  text-align: right;
}

/* ── Depart Row ─────────────────────────────────── */
.depart-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.depart-label {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}
.depart-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 14px;
  font-weight: 600;
  background: #F9FAFB;
  outline: none;
  color: var(--text);
  -webkit-appearance: none;
}
.depart-input:focus { border-color: var(--primary); }

/* ── Summary Card ──────────────────────────────────── */
.summary-card {
  background: var(--white);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.sum-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 14px;
}
.sum-divider { border-top: 1px solid var(--border); margin: 6px 0; }
.amount { font-weight: 600; }
.blue { color: var(--blue); }
.red  { color: var(--red); }
.bold { font-weight: 700; font-size: 16px; }
.muted { color: var(--muted); }

/* ── List Header ───────────────────────────────────── */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px 8px;
}

/* ── Record Items ──────────────────────────────────── */
/* ── 저장경로 리스트 ─────────────────────────────────── */
.saved-route-item {
  background: var(--white);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.saved-route-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.saved-route-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.saved-route-dist {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}
.saved-route-steps { margin-bottom: 10px; }
.saved-step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
  border-bottom: 1px solid #F3F4F6;
  font-size: 13px;
}
.saved-step:last-child { border-bottom: none; }
.saved-step-num {
  min-width: 32px; height: 20px; padding: 0 5px;
  background: var(--primary); color: #fff;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.saved-step-num.type-start    { background: #F97316; }
.saved-step-num.type-pickup   { background: #2563EB; }
.saved-step-num.type-delivery { background: #16A34A; }
.saved-step-addr {
  flex: 1; color: var(--text); font-weight: 500;
  min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.saved-eta { font-size: 12px; font-weight: 700; color: var(--primary); flex-shrink: 0; }
.saved-mins { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.saved-fee-input {
  width: 72px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: #F9FAFB;
  text-align: right;
  flex-shrink: 0;
}
.saved-fee-sum {
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  padding-right: 2px;
}
.saved-fee-sum strong { color: #2563EB; font-size: 13px; }
.saved-route-btns {
  display: flex;
  gap: 8px;
}
.saved-route-btns .btn-primary,
.saved-route-btns .btn-outline {
  flex: 1;
  padding: 8px 0;
  font-size: 13px;
}

.record-item {
  background: var(--white);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
  display: flex;
  align-items: center;
  gap: 10px;
}
.record-info { flex: 1; min-width: 0; }
.record-time { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.record-desc {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.record-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.record-amt { font-size: 15px; font-weight: 700; flex-shrink: 0; }
.record-amt.blue { color: var(--blue); }
.record-amt.red  { color: var(--red); }
.btn-del {
  background: none;
  border: none;
  color: #D1D5DB;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  line-height: 1;
}
.btn-del:active { color: var(--red); }

/* ── Empty State ───────────────────────────────────── */
.empty {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
  background: var(--white);
  border-radius: 10px;
  margin-bottom: 6px;
}

/* ── Monthly ───────────────────────────────────────── */
/* ── 정산 날짜 네비 ────────────────────────────────── */
.date-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--white);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.date-arrow {
  background: none;
  border: none;
  font-size: 26px;
  color: var(--primary);
  cursor: pointer;
  padding: 2px 8px;
  line-height: 1;
}
.date-picker {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  background: var(--white);
  max-width: 160px;
}

/* ── 작업시간 카드 ──────────────────────────────────── */
.worktime-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.worktime-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}
.worktime-sep {
  font-size: 13px;
  color: var(--muted);
  flex-shrink: 0;
}
.worktime-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: #F9FAFB;
  min-width: 0;
}

.month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--white);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.month-arrow {
  background: none;
  border: none;
  font-size: 26px;
  color: var(--primary);
  cursor: pointer;
  padding: 2px 10px;
  line-height: 1;
}
.month-label { font-size: 17px; font-weight: 700; min-width: 120px; text-align: center; }

.daily-item {
  background: var(--white);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
  display: flex;
  align-items: center;
  gap: 10px;
}
.daily-date { font-size: 14px; font-weight: 600; width: 52px; flex-shrink: 0; }
.daily-info { flex: 1; }
.daily-sub  { font-size: 12px; color: var(--muted); }
.daily-net  { font-size: 15px; font-weight: 700; flex-shrink: 0; }
.daily-net.blue { color: var(--blue); }
.daily-net.red  { color: var(--red); }

/* ── Admin Panel ───────────────────────────────────── */
.admin-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 250;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.admin-wrap {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 14px calc(24px + var(--safe-b));
}
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-top: 8px;
}
.admin-title { font-size: 20px; font-weight: 800; color: var(--text); }
.admin-section { margin-bottom: 20px; }
.admin-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.badge-count {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
}
.admin-empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 18px;
  background: var(--white);
  border-radius: 10px;
}
.admin-user-row {
  background: var(--white);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.admin-user-info { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.admin-username { font-size: 14px; font-weight: 600; }
.admin-date { font-size: 11px; color: var(--muted); }
.admin-actions { display: flex; gap: 6px; }
.btn-approve {
  padding: 6px 12px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.btn-approve:active { background: var(--green-dk); }
.btn-reject {
  padding: 6px 12px;
  background: none;
  color: var(--red);
  border: 1px solid #FECACA;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.btn-reject:active { background: #FEF2F2; }

/* ── Login Modal ───────────────────────────────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-box {
  background: var(--white);
  border-radius: 16px;
  padding: 28px 20px 24px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.login-logo {
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 20px;
  letter-spacing: -.5px;
}
.login-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 18px;
}
.login-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.login-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.login-error {
  color: var(--red);
  font-size: 12px;
  margin: -6px 0 10px;
  padding: 6px 10px;
  background: #FEF2F2;
  border-radius: 6px;
}

/* ── Modal ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
}
.modal {
  background: var(--white);
  border-radius: 16px 16px 0 0;
  padding: 20px 16px calc(20px + var(--safe-b));
  width: 100%;
}
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.form-field {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #F9FAFB;
  color: var(--text);
  outline: none;
  margin-bottom: 10px;
  -webkit-appearance: none;
  appearance: none;
}
.modal-btns { display: flex; gap: 10px; margin-top: 4px; }
.modal-btns .btn-primary,
.modal-btns .btn-outline { flex: 1; margin: 0; }

/* ── 웹 내비 HUD ─────────────────────────────────── */
#webNaviHUD {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 20;
  background: #1E293B;
  color: #fff;
  padding: 12px 16px 10px;
  padding-top: calc(12px + var(--safe-t));
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.navi-hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.navi-hud-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.navi-stop-badge {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #3B82F6;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}
.navi-stop-badge.type-pickup  { background: #1D4ED8; }
.navi-stop-badge.type-delivery { background: #15803D; }
.navi-stop-badge.type-done    { background: #64748B; }
.navi-stop-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.navi-stop-type {
  font-size: 11px;
  color: #94A3B8;
  font-weight: 500;
}
.navi-stop-addr {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.navi-dist-wrap { flex-shrink: 0; text-align: right; }
.navi-dist {
  font-size: 18px;
  font-weight: 800;
  color: #60A5FA;
}
.navi-hud-btns {
  display: flex;
  gap: 8px;
}
.navi-hud-btns .btn-primary,
.navi-hud-btns .btn-outline {
  flex: 1; margin: 0;
  padding: 9px 0;
  font-size: 14px;
}
.navi-hud-btns .btn-outline {
  border-color: #475569;
  color: #94A3B8;
}
.navi-my-loc {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #2563EB;
  border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(37,99,235,.25);
}
/* 내비 화살표 마커 (진행방향 위를 향함) */
.navi-arrow {
  width: 0; height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-bottom: 28px solid #2563EB;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.5));
  transform-origin: center 75%;
}
/* 북쪽 표시기 */
#naviNorth {
  font-size: 11px;
  font-weight: 800;
  color: #F87171;
  letter-spacing: -1px;
  line-height: 1;
  display: inline-block;
  transform-origin: center center;
}
/* 과속카메라 경보 배너 */
#naviCamAlert {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #DC2626;
  color: #fff;
  border-radius: 12px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  z-index: 30;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  white-space: nowrap;
}
#naviCamAlert .cam-speed {
  background: rgba(255,255,255,0.25);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 13px;
}
#naviCamAlert .cam-dist {
  font-size: 13px;
  opacity: 0.9;
}

/* ── AI 분석 버튼 ────────────────────────────────────── */
.btn-ai {
  color: #7C3AED;
  border-color: #7C3AED;
  font-weight: 700;
}

/* ── AI 분석 모달 ────────────────────────────────────── */
.ai-modal-overlay { align-items: center; padding: 0 12px; }
.ai-modal {
  border-radius: 16px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  padding: 20px 16px 16px;
}
.ai-content {
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}
.ai-section { margin-bottom: 16px; }
.ai-section:last-child { margin-bottom: 0; }
.ai-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #7C3AED;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.ai-score-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ai-score-badge {
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 20px;
}
.ai-score-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.ai-text { font-size: 14px; color: var(--text); line-height: 1.6; margin: 0; }
.ai-list {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
}
.ai-location-card {
  background: #F5F3FF;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ai-location-name { font-size: 14px; font-weight: 700; color: #5B21B6; }
.ai-location-reason { font-size: 13px; color: var(--muted); }
.ai-loading { text-align: center; padding: 32px 0; font-size: 14px; color: var(--muted); }
.ai-error { padding: 16px; color: #DC2626; font-size: 14px; white-space: pre-wrap; }
.ai-raw { font-size: 12px; white-space: pre-wrap; word-break: break-all; }

.navi-done-msg {
  text-align: center;
  padding: 12px;
  font-size: 16px;
  font-weight: 700;
  color: #4ADE80;
}

/* ── 운행 모드 HUD (시트 내부 패널) ─────────────────── */

/* 드라이브 모드 시 시트: 주소 입력/최적화 버튼 숨기기 */
.bottom-sheet.drive-active .card,
.bottom-sheet.drive-active #btnOptimize { display: none; }
.bottom-sheet.drive-active { max-height: 62%; }

#driveHUD {
  background: #0F172A;
  color: #fff;
  padding: 12px 14px 14px;
  margin: -12px -12px 12px; /* 시트 패딩 상쇄해 edge-to-edge */
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.drive-time-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.drive-remaining-label {
  font-size: 12px;
  color: #64748B;
}
.drive-remaining-time {
  font-size: 26px;
  font-weight: 800;
  color: #38BDF8;
  line-height: 1;
  flex: 1;
}
.drive-next-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.drive-next-badge {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: #16A34A;
}
.drive-next-badge.type-pickup   { background: #2563EB; }
.drive-next-badge.type-delivery { background: #16A34A; }
.drive-next-addr {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drive-next-dist {
  flex-shrink: 0;
  font-size: 13px;
  color: #94A3B8;
}
.drive-progress {
  font-size: 12px;
  color: #64748B;
  flex-shrink: 0;
}
.drive-bottom-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}
.drive-btn-arrive {
  padding: 8px 16px;
  border: none;
  border-radius: 10px;
  background: #2563EB;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.drive-btn-stop {
  padding: 8px 14px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: transparent;
  color: #64748B;
  font-size: 13px;
  cursor: pointer;
}
.drive-btn-recommend {
  padding: 8px 12px;
  border: 1px solid #7C3AED;
  border-radius: 10px;
  background: rgba(124,58,237,.15);
  color: #A78BFA;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── 경유지 추천 모달 ─────────────────────────────── */
.rec-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: flex-end;
  z-index: 200;
}
.rec-modal {
  background: #1E293B;
  width: 100%;
  border-radius: 20px 20px 0 0;
  padding: 16px 16px 40px;
  max-height: 75vh;
  display: flex;
  flex-direction: column;
  color: #fff;
}
.rec-modal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.rec-modal-title { font-size: 16px; font-weight: 700; }
.rec-modal-sub   { flex: 1; font-size: 12px; color: #64748B; }
.rec-modal-header .modal-close {
  background: none; border: none;
  color: #64748B; font-size: 22px; cursor: pointer; padding: 0 4px;
}
.rec-modal-content {
  overflow-y: auto; flex: 1;
  display: flex; flex-direction: column; gap: 10px;
}
.rec-spot-card {
  background: #0F172A;
  border-radius: 12px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.rec-spot-header {
  display: flex; align-items: center; justify-content: space-between;
}
.rec-spot-area  { font-size: 15px; font-weight: 700; color: #F1F5F9; }
.rec-spot-time  {
  font-size: 13px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
}
.rec-time-ok   { background: #14532D; color: #4ADE80; }
.rec-time-warn { background: #7C2D12; color: #FB923C; }
.rec-spot-reason {
  font-size: 13px; color: #94A3B8; line-height: 1.5;
}
.rec-spot-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid #1E293B;
}
.rec-spot-insert {
  font-size: 12px; color: #475569;
}
.rec-spot-map-btn {
  font-size: 12px;
  color: #7C3AED;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border: 1px solid #7C3AED;
  border-radius: 6px;
}
.rec-map-badge {
  flex-shrink: 0;
  width: 20px; height: 20px;
  background: #7C3AED;
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}

/* 추천 경유지 지도 핀 */
.rec-map-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.rec-map-pin-star {
  width: 28px; height: 28px;
  background: #7C3AED;
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(124,58,237,.5);
}
.rec-map-pin-time {
  background: #7C3AED;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}

/* 현재위치 점 마커 */
.drive-pos-dot {
  width: 18px; height: 18px;
  background: #3B82F6;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(59,130,246,.35);
}

/* 완료된 경유지 표시 */
.route-step.step-done {
  opacity: .35;
  text-decoration: line-through;
  text-decoration-color: #94A3B8;
}

/* ── 퀵추천 뷰 ──────────────────────────────────── */
.quick-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.quick-loc-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.quick-loc-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.quick-loc-addr {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quick-refresh-btn {
  flex: 0 0 auto;
  padding: 8px 14px;
  font-size: 13px;
}
.quick-dest-bar {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}
.quick-dest-input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  background: #fff;
  outline: none;
}
.quick-dest-input:focus { border-color: var(--primary); }
.quick-dest-btn {
  flex: 0 0 auto;
  padding: 9px 16px;
  font-size: 13px;
  border-radius: 8px;
  margin: 0;
}
.quick-content {
  padding: 12px 16px 80px;
}
.quick-summary {
  background: #FEF3C7;
  border-left: 3px solid #F59E0B;
  padding: 10px 12px;
  font-size: 13px;
  color: #78350F;
  border-radius: 4px;
  margin-bottom: 14px;
  line-height: 1.5;
}
.quick-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 14px 0 8px;
}
.quick-bad-title { color: #DC2626; }
.quick-item {
  background: var(--white);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-left: 3px solid transparent;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.quick-good { border-left-color: #16A34A; }
.quick-bad  { border-left-color: #DC2626; }
.quick-item-area {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.quick-item-reason {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.quick-tips-list {
  margin: 0;
  padding-left: 18px;
}
.quick-tip {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 4px;
}
/* 퀵추천 저장 히스토리 */
.quick-save-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 11px;
  background: #7C3AED;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.quick-save-btn:active { background: #6D28D9; }
.quick-history-section { margin-top: 20px; }
.quick-history-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}
.quick-history-item {
  background: var(--white);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  cursor: pointer;
}
.quick-history-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.quick-history-time { font-size: 11px; color: var(--muted); }
.quick-history-loc  { font-size: 12px; font-weight: 600; color: var(--text); flex: 1; margin-right: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-history-summary { font-size: 12px; color: var(--muted); line-height: 1.4; }
.quick-history-del {
  background: none; border: none;
  color: var(--muted); font-size: 16px;
  padding: 0 4px; cursor: pointer; flex-shrink: 0;
}

/* ── 교통 View ─────────────────────────────────── */
.traffic-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.traffic-header-title { font-size: 15px; font-weight: 700; color: var(--text); }
.traffic-refresh-btn  { font-size: 12px; padding: 4px 10px; }
.traffic-content      { padding: 12px 14px; }
.traffic-meta         { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.traffic-summary {
  background: #EFF6FF;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #1E40AF;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.5;
}
.traffic-group-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin: 12px 0 6px; }
.traffic-routes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.traffic-route-card {
  border-radius: 10px;
  padding: 10px 12px;
}
.traffic-route-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}
.traffic-route-name    { font-size: 14px; font-weight: 700; color: var(--text); }
.traffic-route-status  { font-size: 13px; font-weight: 700; }
.traffic-route-section { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.traffic-route-detail  { font-size: 12px; color: var(--text); }
.traffic-route-top-right { display: flex; align-items: center; gap: 6px; }
.btn-cctv-road {
  font-size: 10px; font-weight: 600; padding: 2px 6px;
  background: #EFF6FF; color: #2563EB; border: 1px solid #BFDBFE;
  border-radius: 4px; cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.btn-cctv-road:active { background: #DBEAFE; }

/* 교통탭 독립 CCTV 모달 */
.traffic-cctv-modal {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.55);
  display: flex; align-items: flex-end;
}
.traffic-cctv-modal-inner {
  width: 100%; background: #111;
  border-radius: 16px 16px 0 0;
  max-height: 80vh; display: flex; flex-direction: column;
  overflow: hidden;
}
.traffic-cctv-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: rgba(255,255,255,.07); flex-shrink: 0;
}
.traffic-cctv-title { font-size: 14px; font-weight: 700; color: #fff; }
.traffic-cctv-close {
  background: none; border: none; color: #fff;
  font-size: 18px; cursor: pointer; padding: 4px 8px;
}
.traffic-cctv-body { display: flex; flex-direction: column; overflow: hidden; }
.traffic-cctv-loading {
  padding: 32px; text-align: center; color: rgba(255,255,255,.5); font-size: 13px;
}
.traffic-cctv-err {
  padding: 32px; text-align: center; color: rgba(255,255,255,.5); font-size: 13px;
}
#trafficCctvVideo { width: 100%; max-height: 240px; display: block; }
.traffic-cctv-list {
  overflow-y: auto; max-height: 180px; padding: 8px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.traffic-cctv-item {
  padding: 8px 10px; font-size: 12px; color: rgba(255,255,255,.75);
  cursor: pointer; border-radius: 6px; margin-bottom: 2px;
}
.traffic-cctv-item:hover, .traffic-cctv-item.active { background: rgba(255,255,255,.12); color: #fff; }
.traffic-tips {
  background: var(--white);
  border-radius: 10px;
  padding: 10px 14px 10px 28px;
  margin: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.traffic-tip { font-size: 12px; color: var(--text); line-height: 1.6; }
.traffic-error { font-size: 13px; color: #DC2626; padding: 16px 0; text-align: center; }

/* ── 내설정 ──────────────────────────────────────── */
.btn-settings {
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  padding: 4px 8px;
  cursor: pointer;
  line-height: 1;
}
.btn-settings:active { background: rgba(255,255,255,.35); }

.settings-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  display: flex; align-items: flex-end;
}
.settings-panel {
  width: 100%; background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 0 0 env(safe-area-inset-bottom,16px);
  max-height: 60vh; overflow-y: auto;
}
.settings-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.settings-title { font-size: 16px; font-weight: 700; }
.btn-settings-close {
  background: none; border: none;
  font-size: 18px; cursor: pointer; color: var(--muted);
  padding: 4px 8px;
}
.settings-body { padding: 16px 20px; }
.settings-section-label {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 10px;
}
.vehicle-options { display: flex; gap: 8px; margin-bottom: 10px; }
.vehicle-btn {
  flex: 1; padding: 10px 8px; border-radius: 8px;
  border: 2px solid var(--border); background: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer;
  color: var(--text); transition: border-color .15s, background .15s;
}
.vehicle-btn.active {
  border-color: var(--primary); background: #EFF6FF; color: var(--primary);
}
.vehicle-desc {
  font-size: 12px; color: var(--muted); line-height: 1.6;
  min-height: 18px;
}
.vehicle-inputs { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.vehicle-input-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vehicle-input-label { font-size: 13px; color: var(--text); flex: 1; }
.vehicle-input {
  width: 90px; padding: 7px 10px; font-size: 14px; text-align: right;
  border: 1px solid var(--border); border-radius: 6px; outline: none; -webkit-appearance: none;
}
.vehicle-input:focus { border-color: var(--primary); }

/* 비용 표시 */
.route-cost-summary {
  font-size: 13px; color: var(--muted);
  margin-bottom: 8px; line-height: 1.8;
}
.route-cost-summary .cost-row { display: flex; justify-content: space-between; }
.route-cost-summary .cost-total {
  font-weight: 700; color: var(--text);
  border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px;
}
.route-cost-summary .cost-net {
  font-weight: 700; margin-top: 2px;
  border-top: 1px dashed var(--border); padding-top: 4px;
}
.route-cost-summary .cost-net.net-pos { color: #16A34A; }
.route-cost-summary .cost-net.net-neg { color: #DC2626; }
.toll-gate-list {
  display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 6px;
}
.toll-gate-chip {
  font-size: 11px; color: #92400E;
  background: #FEF3C7; border: 1px solid #FDE68A;
  border-radius: 4px; padding: 2px 6px; white-space: nowrap;
}

/* ── 시간대별 수익 히트맵 ──────────────────────────── */
.heatmap-wrap { overflow-x: auto; margin-bottom: 6px; }
.heatmap-slots {
  display: grid; grid-template-columns: 36px repeat(6, 1fr);
  gap: 2px; margin-bottom: 2px; padding-left: 36px;
}
.heatmap-slots span { font-size: 9px; color: var(--muted); text-align: center; line-height: 1.2; }
.heatmap-row {
  display: grid; grid-template-columns: 36px repeat(6, 1fr); gap: 2px; margin-bottom: 2px;
}
.heatmap-dow {
  font-size: 11px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
.heatmap-cell {
  height: 22px; border-radius: 3px; cursor: default;
}
.heatmap-cell.lv0 { background: #F3F4F6; }
.heatmap-cell.lv1 { background: #BBF7D0; }
.heatmap-cell.lv2 { background: #4ADE80; }
.heatmap-cell.lv3 { background: #16A34A; }
.heatmap-cell.lv4 { background: #14532D; }
.heatmap-legend {
  display: flex; align-items: center; gap: 3px;
  font-size: 10px; color: var(--muted); margin-top: 4px;
}
.heatmap-legend div {
  width: 14px; height: 14px; border-radius: 2px;
}
.heatmap-legend .lv0 { background: #F3F4F6; }
.heatmap-legend .lv1 { background: #BBF7D0; }
.heatmap-legend .lv2 { background: #4ADE80; }
.heatmap-legend .lv3 { background: #16A34A; }
.heatmap-legend .lv4 { background: #14532D; }

/* ── 모바일 (480px 이하) ─────────────────────────── */
@media (max-width: 480px) {
  .addr-input  { font-size: 16px; }
  .addr-text   { font-size: 16px; }
  .btn-rm      { width: 44px; height: 44px; }
  .btn-fee-toggle { width: 40px; height: 40px; }
  .route-step  { padding: 8px 0; font-size: 14px; }
  .btn-primary { padding: 14px; font-size: 16px; }
  .route-btns-sub .btn-primary,
  .route-btns-sub .btn-outline { padding: 11px 12px; font-size: 14px; }
}
