:root {
  --bg: #f4f5f7; --card: #fff; --field: #fff; --text: #17191c; --sub: #5f6670; --line: #e3e6ea;
  --brand: #ff6a00; --brand-d: #e05a00; --brand-bg: #fff2e8; --on-brand: #fff;
  --blue: #1f6feb; --blue-bg: #e8f0fe; --green: #18a058; --green-bg: #e6f6ee; --red: #d93025; --red-bg: #fde8e7;
  --gray: #8a919b; --gray-bg: #eef0f2; --gray-fg: #4b525b; --yellow: #f5a623; --yellow-bg: #fff4d6; --yellow-fg: #a86b00;
  --memo-bg: #fff8e6; --memo-line: #f5d98a; --ink: #222; --ink-fg: #fff; --ink-link: #ffc89e;
  --overlay: rgba(0,0,0,.45); --switch-off: #cfd4da; --th-bg: #fafbfc;
  --top-bg: var(--card); --top-fg: var(--text); --logo: var(--brand);
  --radius: 14px; --radius-sm: 10px; --border-w: 1px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.04);
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --font-display: var(--font); --font-num: var(--font); --display-weight: 800;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-text-size-adjust: 100%; }
a { color: var(--blue); }
h1, h2, h3 { margin: 0; line-height: 1.3; }
.hidden { display: none !important; }
.muted { color: var(--sub); font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }

/* 상단바 */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--top-bg); color: var(--top-fg); border-bottom: var(--border-w) solid var(--line); padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.topbar .logo { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 17px; color: var(--logo); }
.topbar .who { font-size: 13px; color: var(--top-fg); opacity: .7; }
.demo-banner { background: var(--ink); color: var(--ink-fg); text-align: center; font-size: 12px; padding: 5px 10px; }
.demo-banner a { color: var(--ink-link); }

.wrap { max-width: 640px; margin: 0 auto; padding: 14px 16px 90px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.card h2 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 17px; margin-bottom: 10px; }
.section-title { font-size: 14px; font-weight: 700; color: var(--sub); margin: 18px 4px 8px; display: flex; align-items: center; gap: 6px; }
.count { background: var(--brand); color: var(--on-brand); font-family: var(--font-num); border-radius: 99px; font-size: 12px; padding: 0 8px; }

/* 폼 */
label.f { display: block; font-size: 13px; font-weight: 600; color: var(--sub); margin: 12px 0 5px; }
input, select, textarea { width: 100%; font: inherit; font-size: 16px; padding: 11px 12px; border: var(--border-w) solid var(--line); border-radius: var(--radius-sm); background: var(--field); color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
textarea { min-height: 76px; resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: var(--border-w) solid var(--line); background: var(--field); color: var(--text); border-radius: 99px; padding: 7px 13px; font-size: 14px; cursor: pointer; user-select: none; }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 600; }
.addr-box { border: var(--border-w) solid var(--line); border-radius: 12px; padding: 10px; }
.addr-box .tag { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 6px; padding: 1px 7px; margin-bottom: 6px; }
.tag.from { background: var(--blue-bg); color: var(--blue); }
.tag.to { background: var(--brand-bg); color: var(--brand-d); }
.addr-box input + input { margin-top: 6px; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 700; font-size: 15px; border: var(--border-w) solid var(--line); background: var(--field); color: var(--text); border-radius: var(--radius-sm); padding: 11px 16px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:active { background: var(--brand-d); }
.btn.blue { background: var(--blue); border-color: var(--blue); color: var(--ink-fg); }
.btn.green { background: var(--green); border-color: var(--green); color: var(--ink-fg); }
.btn.danger { background: var(--red); border-color: var(--red); color: var(--ink-fg); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 15px; font-size: 17px; width: 100%; border-radius: var(--radius-sm); }
.btn.block { width: 100%; }

/* 요금 바 */
.fee-bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: var(--border-w) solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); z-index: 15; }
.fee-bar .inner { max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.fee-bar .fee { font-family: var(--font-num); font-size: 20px; font-weight: 800; }
.fee-bar .btn { flex: 0 0 auto; width: auto; min-width: 150px; }
.fee-bar .grow { white-space: nowrap; }

/* 상태 배지 */
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.st-req { background: var(--yellow-bg); color: var(--yellow-fg); }
.st-asg { background: var(--blue-bg); color: var(--blue); }
.st-pick { background: var(--green-bg); color: var(--green); }
.st-done { background: var(--gray-bg); color: var(--gray-fg); }
.st-cancel { background: var(--red-bg); color: var(--red); }

/* 주문 카드 */
.order { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 10px; border-left: 4px solid transparent; }
.order.new { border-left-color: var(--brand); animation: pulse 1.2s ease-in-out 3; }
@keyframes pulse { 50% { background: var(--brand-bg); } }
.order .head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.order .no { font-family: var(--font-num); font-weight: 800; }
.order .cat { font-size: 12px; color: var(--sub); border: var(--border-w) solid var(--line); border-radius: 6px; padding: 1px 6px; }
.order .fee { margin-left: auto; font-family: var(--font-num); font-weight: 800; font-size: 16px; }
.route { position: relative; padding-left: 18px; margin: 6px 0; }
.route::before { content: ""; position: absolute; left: 5px; top: 9px; bottom: 9px; border-left: 2px dashed var(--line); }
.route .pt { position: relative; margin: 3px 0; }
.route .pt::before { content: ""; position: absolute; left: -18px; top: 6px; width: 12px; height: 12px; border-radius: 50%; }
.route .pt.a::before { background: var(--blue); }
.route .pt.b::before { background: var(--brand); }
.route .addr { font-weight: 600; }
.route .det { font-size: 13px; color: var(--sub); }
.desc { background: var(--bg); border-radius: 8px; padding: 8px 10px; font-size: 14px; margin: 8px 0; white-space: pre-wrap; word-break: break-word; }
.meta { font-size: 13px; color: var(--sub); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.actions .btn { flex: 1; }
.tel { font-weight: 700; text-decoration: none; }
.empty { text-align: center; color: var(--gray); padding: 30px 10px; font-size: 14px; }

/* 진행 단계 */
.steps { display: flex; margin: 10px 0 4px; }
.steps .s { flex: 1; text-align: center; font-size: 12px; color: var(--gray); position: relative; padding-top: 18px; }
.steps .s::before { content: ""; position: absolute; top: 4px; left: 50%; transform: translateX(-50%); width: 12px; height: 12px; border-radius: 50%; background: var(--line); z-index: 1; }
.steps .s::after { content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.steps .s:first-child::after { display: none; }
.steps .s.on { color: var(--brand-d); font-weight: 700; }
.steps .s.on::before, .steps .s.on::after { background: var(--brand); }

/* 탭 */
.tabs { display: flex; background: var(--card); border-bottom: var(--border-w) solid var(--line); position: sticky; top: 53px; z-index: 19; overflow-x: auto; }
.tabs button { flex: 1; font: inherit; font-weight: 700; color: var(--sub); background: none; border: 0; border-bottom: 3px solid transparent; padding: 12px 10px; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }

/* 토글 */
.duty { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--card); border-bottom: var(--border-w) solid var(--line); }
.switch { position: relative; width: 52px; height: 30px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--switch-off); border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: var(--field); border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(22px); }

/* 모달 */
.modal-wrap { position: fixed; inset: 0; background: var(--overlay); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { background: var(--card); color: var(--text); border-radius: 16px; width: 100%; max-width: 420px; padding: 18px; max-height: 90vh; overflow: auto; }
.modal h3 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 17px; margin-bottom: 10px; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }
.modal.postcode { padding: 0; height: 80vh; display: flex; flex-direction: column; overflow: hidden; }
.pc-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.pc-body { flex: 1; }

#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--ink-fg); padding: 11px 18px; border-radius: 10px; font-size: 14px; opacity: 0; transition: .25s; z-index: 200; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.err { background: var(--red); }
#toast.ok { background: var(--green); }

/* 로그인 */
.auth { max-width: 400px; margin: 40px auto; padding: 0 16px; }
.auth .logo-big { font-family: var(--font-display); font-size: 26px; font-weight: 900; color: var(--brand); text-align: center; margin-bottom: 4px; }
.demo-hint { background: var(--memo-bg); border: 1px solid var(--memo-line); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-top: 12px; }

/* 관리자 */
body.admin .wrap { max-width: 1280px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; }
.stat .k { font-size: 12px; color: var(--sub); }
.stat .v { font-family: var(--font-num); font-size: 22px; font-weight: 800; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.col h3 { font-size: 14px; margin: 0 4px 8px; display: flex; align-items: center; gap: 6px; }
@media (max-width: 900px) { .board { grid-template-columns: 1fr; } }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--card); }
table.list th, table.list td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.list th { font-size: 12px; color: var(--sub); background: var(--th-bg); white-space: nowrap; }
table.list td.num { text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; border-radius: 12px; box-shadow: var(--shadow); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--gray); margin-right: 5px; }
.dot.on { background: var(--green); }
#map { width: 100%; height: 420px; border-radius: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

.memo { background: var(--memo-bg) !important; }
.closed { background: var(--red-bg) !important; }
.stat { border: var(--border-w) solid transparent; }
body.driver { --logo: var(--blue); }
body.admin { --logo: var(--top-fg); }
.auth .logo-big { color: var(--logo); }

/* 디자인 전환 버튼 */
.theme-tg { gap: 4px; }
.theme-tg svg { flex: 0 0 auto; }
.topbar .theme-tg { margin-left: 0; }
.auth { position: relative; }
.auth-tg { position: absolute; right: 16px; top: -28px; }

/* 정보 칸: 거리 / 희망 / 결제 / 물건값 */
.info { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 8px 0 4px; }
.info > div { background: var(--field); border: var(--border-w) solid var(--line); border-radius: var(--radius-sm); padding: 6px 8px; min-width: 0; }
.info span { display: block; font-size: 11px; color: var(--sub); line-height: 1.3; }
.info b { display: block; font-size: 14px; line-height: 1.35; word-break: keep-all; overflow-wrap: anywhere; }
.info .cash b { color: var(--green); }
.info .bank b { color: var(--blue); }
.info .cost b { color: var(--red); }
.info .none b { color: var(--gray); font-weight: 600; }
.info small { display: block; font-size: 11px; font-weight: 600; color: var(--sub); }
@media (max-width: 340px) { .info { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 경로 지도 */
.rmap { position: relative; height: 210px; border-radius: var(--radius-sm); overflow: hidden; border: var(--border-w) solid var(--line); background: var(--field); margin: 8px 0; }
.rmap svg { display: block; width: 100%; height: 100%; }
.rmap .note { position: absolute; left: 8px; bottom: 6px; font-size: 11px; color: var(--sub); background: var(--card); border-radius: 6px; padding: 1px 6px; opacity: .92; }
.rmap .nomap { display: grid; place-items: center; height: 100%; color: var(--sub); font-size: 13px; text-align: center; padding: 10px; }
.kpin { padding: 3px 9px; border-radius: 12px; font-size: 12px; font-weight: 800; white-space: nowrap; color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.topbar .logo { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar > * { flex-shrink: 0; }
.topbar > .logo { flex-shrink: 1; }
@media (max-width: 400px) { .topbar .theme-tg span { display: none; } .topbar .theme-tg { padding: 6px 8px; } .topbar .who { display: none; } }

/* 경유지 */
.route .pt.w::before { background: #7a5af8; width: 10px; height: 10px; left: -17px; top: 7px; }
.wtag { display: inline-block; font-size: 11px; font-weight: 800; color: #fff; background: #7a5af8; border-radius: 5px; padding: 0 5px; margin-right: 5px; vertical-align: 1px; }
.addr-box .tag.via { background: #efeaff; color: #5b3fd6; }
.stop-head { display: flex; align-items: center; justify-content: space-between; }
.stop-head .btn { padding: 2px 8px; }
#addStop { margin-top: 8px; border-style: dashed; }

/* 길안내 */
.nav-box { display: grid; gap: 6px; margin-top: 10px; }
.nav-main { background: var(--brand-bg); border-color: var(--brand); color: var(--text); width: 100%; }
.nav-parts { display: flex; flex-wrap: wrap; gap: 6px; }
.nav-parts .btn { flex: 1 1 auto; }
.nav-pref { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sub); margin: 0 4px 10px; }
.nav-apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.nav-app { display: grid; justify-items: center; gap: 6px; padding: 14px 6px; border: var(--border-w) solid var(--line); border-radius: var(--radius-sm); background: var(--field); color: var(--text); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.nav-app i { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-style: normal; font-size: 18px; font-weight: 900; }
.nav-app:focus-visible, .nav-app:hover { outline: 2px solid var(--brand); outline-offset: -1px; }

/* 개인정보 가림 안내 */
.privacy { margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--sub); background: var(--gray-bg); border-radius: 8px; padding: 6px 9px; }
.privacy.soft { background: transparent; padding: 2px 0 0; font-weight: 600; }

/* 새 주문 팝업 */
.duty.sub { padding-top: 8px; padding-bottom: 10px; }
.duty.sub .switch { transform: scale(.85); }
.order-pop { align-items: flex-end; }
.order-pop .modal { max-width: 480px; border-radius: 20px 20px 16px 16px; animation: popin .25s ease-out; }
@keyframes popin { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .order-pop .modal { animation: none; } .pop-timer i { animation: none !important; } }
.pop-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.pop-head b { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 18px; color: var(--brand-d); }
.pop-timer { flex: 1; height: 6px; background: var(--gray-bg); border-radius: 99px; overflow: hidden; }
.pop-timer i { display: block; height: 100%; background: var(--brand); transform-origin: left; animation: popbar linear forwards; }
@keyframes popbar { to { transform: scaleX(0); } }
.pop-left { font-size: 13px; color: var(--sub); font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }
.pop-fee { font-family: var(--font-num); font-size: 28px; font-weight: 800; margin: 2px 0 6px; }
.order-pop .modal-actions .btn { padding: 15px; font-size: 17px; }
.order-pop .pop-accept { flex: 2; }

/* ≡ 메뉴 (기사 앱) */
.menu-btn { padding: 6px 8px; margin-left: -6px; color: var(--top-fg); }
.drawer-back { position: fixed; inset: 0; background: var(--overlay); z-index: 60; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(420px, 100%); background: var(--bg); color: var(--text); z-index: 61;
  overflow-y: auto; transform: translateX(-100%); transition: transform .22s ease-out; box-shadow: 0 0 30px rgba(0,0,0,.2);
  padding-bottom: env(safe-area-inset-bottom, 0px); }
.drawer.open { transform: none; }
@media (prefers-reduced-motion: reduce) { .drawer { transition: none; } }
.dhead { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: var(--top-bg); color: var(--top-fg); border-bottom: var(--border-w) solid var(--line); }
.dhead b { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 18px; }
.dhead .btn { font-size: 20px; line-height: 1; padding: 4px 10px; color: var(--top-fg); }
.dbody { padding: 14px 16px 30px; }
.profile-card { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-weight: 800; font-size: 19px; flex: 0 0 auto; }
.today-box { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.today-box > div { background: var(--card); border-radius: var(--radius-sm); padding: 10px; box-shadow: var(--shadow); min-width: 0; }
.today-box span { display: block; font-size: 12px; color: var(--sub); }
.today-box b { font-family: var(--font-num); font-size: 17px; }
.dmenu { display: grid; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.dmenu button { display: flex; align-items: center; justify-content: space-between; font: inherit; font-size: 16px; font-weight: 700; color: var(--text);
  background: none; border: 0; border-bottom: var(--border-w) solid var(--line); padding: 16px; cursor: pointer; text-align: left; }
.dmenu button:last-child { border-bottom: 0; }
.dmenu button i { font-style: normal; color: var(--sub); font-size: 22px; }
.dmenu button:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.set-group { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 14px; border-bottom: var(--border-w) solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row.col { flex-direction: column; align-items: stretch; gap: 8px; }
.set-row .muted { margin-top: 2px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { flex: 1 1 auto; font: inherit; font-weight: 700; font-size: 14px; padding: 9px 10px; border-radius: var(--radius-sm); border: var(--border-w) solid var(--line); background: var(--field); color: var(--text); cursor: pointer; }
.seg button.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.stat .v.bad { color: var(--red); font-size: 17px; }
.drawer .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.daily { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px 12px; }
.drow { display: grid; grid-template-columns: 44px 1fr 40px auto; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; font-variant-numeric: tabular-nums; }
.drow:last-child { border-bottom: 0; }
.drow .dd { color: var(--sub); }
.drow .bar { height: 8px; background: var(--gray-bg); border-radius: 99px; overflow: hidden; }
.drow .bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.drow .dn { color: var(--sub); text-align: right; }

/* 전화 · 메시지 */
.btn.call, .btn.chat { gap: 5px; position: relative; }
.btn.call { color: var(--green); border-color: var(--green); background: var(--green-bg); }
.btn.chat { color: var(--blue); border-color: var(--blue); background: var(--blue-bg); }
.unread { position: absolute; top: -7px; right: -7px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; line-height: 19px; text-align: center; }
.contact-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.contact-row .btn { flex: 1 1 auto; }
.menu-dot { position: absolute; top: 2px; right: 2px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.menu-btn { position: relative; }
.dmenu button .unread { position: static; margin-left: auto; margin-right: 8px; }

/* 메시지 창 */
.chat-wrap { position: fixed; inset: 0; z-index: 120; background: var(--overlay); display: flex; justify-content: center; }
.chatbox { background: var(--bg); color: var(--text); width: 100%; max-width: 560px; height: 100%; display: flex; flex-direction: column; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); background: var(--top-bg); color: var(--top-fg); border-bottom: var(--border-w) solid var(--line); }
.chat-head .btn.ghost { font-size: 22px; line-height: 1; padding: 4px 10px; color: var(--top-fg); }
.chat-head b { font-size: 16px; }
.chat-list { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.chat-day { align-self: center; font-size: 12px; color: var(--sub); background: var(--gray-bg); border-radius: 99px; padding: 2px 10px; margin: 6px 0; }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 82%; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg .who { font-size: 12px; color: var(--sub); margin: 0 4px 2px; }
.bubble { background: var(--card); border: var(--border-w) solid var(--line); border-radius: 16px 16px 16px 4px; padding: 8px 12px; white-space: pre-wrap; word-break: break-word; font-size: 15px; }
.msg.me .bubble { background: var(--brand); color: var(--on-brand); border-color: var(--brand); border-radius: 16px 16px 4px 16px; }
.msg .at { font-size: 11px; color: var(--sub); margin: 2px 4px 0; }
.chat-input { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--card); border-top: var(--border-w) solid var(--line); }
.chat-input textarea { flex: 1; min-height: 44px; max-height: 120px; resize: none; padding: 10px 12px; }
.chat-closed { padding: 14px; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); text-align: center; color: var(--sub); font-size: 14px; background: var(--card); border-top: var(--border-w) solid var(--line); }
.msg-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; align-items: start; }
@media (max-width: 900px) { .msg-layout { grid-template-columns: 1fr; } }
.thread { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; color: var(--text); background: none; border: 0; border-bottom: 1px solid var(--line); padding: 11px 4px; cursor: pointer; }
.thread:hover, .thread:focus-visible { background: var(--field); outline: none; }
.thread .grow { display: grid; min-width: 0; }
.thread .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread .tt { font-size: 11px; font-weight: 800; color: var(--blue); background: var(--blue-bg); border-radius: 6px; padding: 2px 6px; white-space: nowrap; }
.thread .tm { display: grid; justify-items: end; gap: 3px; font-size: 12px; color: var(--sub); white-space: nowrap; }
.thread .tm .unread, .thread .tm em { position: static; font-style: normal; }
.thread .tm em { font-size: 11px; color: var(--gray); }
.drv-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.drv-row:last-child { border-bottom: 0; }

/* 성인 확인 품목 · 서명 */
.badge.st-age { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); }
.age-box { margin-top: 10px; border: var(--border-w) dashed var(--line); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; color: var(--sub); }
.age-box p { margin: 6px 0 0; line-height: 1.5; }
.age-box.on { border: 1.5px solid var(--red); background: var(--red-bg); color: var(--text); }
.age-box .id-check { margin-top: 10px; font-size: 15px; background: var(--card); border-radius: 8px; padding: 10px; }
.age-box .id-check input { width: 22px !important; height: 22px; }
.modal.complete { max-width: 480px; }
.sig-head { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.sig-head .btn { margin-left: auto; }
.sig-pad { position: relative; height: 190px; margin-top: 6px; border: 2px dashed var(--line); border-radius: var(--radius-sm); background: #fff; touch-action: none; overflow: hidden; }
.sig-canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.sig-hint { position: absolute; inset: 0; display: grid; place-items: center; color: #9aa1a9; font-size: 14px; pointer-events: none; }
.proof-img { width: 100%; max-width: 600px; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-top: 8px; }
.badge.st-door { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue); }
.chip.disabled { opacity: .4; text-decoration: line-through; cursor: not-allowed; }

/* 계약 · 면허 · 정산 */
.auth.wide { max-width: 640px; }
.steps-mini { display: flex; gap: 6px; margin-bottom: 10px; }
.steps-mini b { flex: 1; text-align: center; font-size: 12px; padding: 6px 4px; border-radius: 99px; background: var(--gray-bg); color: var(--sub); }
.steps-mini b.on { background: var(--brand); color: var(--on-brand); }
.contract-box { white-space: pre-wrap; word-break: keep-all; font-size: 13.5px; line-height: 1.7; max-height: 46vh; overflow-y: auto; background: var(--field); border: var(--border-w) solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.contract-box.view { max-height: 40vh; }
.agree-list { display: grid; gap: 8px; margin-top: 12px; font-size: 14px; }
.agree-list .agree-all { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.agree-list input { width: 20px !important; height: 20px; flex: 0 0 auto; }
.ctable { margin-top: 10px; font-size: 13px; }
.ctable th { width: 110px; }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }
.docs-box { margin-top: 12px; border: var(--border-w) solid var(--line); border-radius: var(--radius-sm); padding: 12px; background: var(--field); }
.docs-box .declare { margin-top: 12px; font-size: 13px; align-items: flex-start; background: var(--red-bg); border-radius: 8px; padding: 10px; }
.docs-box .declare input, .age-box input[name=declare] { width: 20px !important; height: 20px; flex: 0 0 auto; margin-top: 2px; }
.docs-alert { padding: 10px 16px; font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.docs-alert.bad { background: var(--red-bg); color: var(--red); }
.docs-alert.warn { background: var(--yellow-bg); color: var(--yellow-fg); }
.settle-sum { grid-column: 1 / -1; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; font-size: 15px; border-left: 4px solid var(--brand); }
.settle-sum.done { border-left-color: var(--gray); }
.settle-sum .muted { font-size: 12px; margin-top: 4px; }
.settle-line { margin-top: 8px; font-size: 13px; background: var(--field); border-radius: 8px; padding: 8px 10px; line-height: 1.6; }

/* 주소 후보 목록 · 위치 확정 */
.ac-list { margin-top: 6px; border: var(--border-w) solid var(--line); border-radius: 12px; background: var(--card); overflow: hidden; max-height: 320px; overflow-y: auto; }
.ac-head { font-size: 12px; font-weight: 700; color: var(--sub); padding: 8px 12px 4px; }
.ac-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 10px 12px; color: var(--text); font: inherit; cursor: pointer; }
.ac-head + .ac-item { border-top: 0; }
.ac-item:hover, .ac-item:focus-visible { background: var(--brand-bg); outline: none; }
.ac-item b { font-size: 15px; }
.ac-item span { display: block; font-size: 13px; color: var(--sub); margin-top: 2px; }
.ac-cat { margin-left: 6px; font-size: 11px; color: var(--sub); }
.ac-empty { padding: 12px; font-size: 13px; color: var(--sub); }
.addr-ok { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; padding: 7px 10px; border-radius: 10px; background: var(--green-bg); font-size: 13px; }
.addr-ok .ok-mark { color: var(--green); font-weight: 800; }
.addr-ok .ok-addr { flex: 1 1 160px; min-width: 0; color: var(--text); }
.addr-ok .btn { margin-left: auto; }
input.need-pick { border-color: var(--red) !important; box-shadow: 0 0 0 3px var(--red-bg); }
.pickmap { max-width: 520px; }
.pm-map { position: relative; height: 320px; border-radius: 12px; overflow: hidden; border: var(--border-w) solid var(--line); }
.pm-el { position: absolute; inset: 0; }
.pm-pin { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -26px 0 0 -13px; pointer-events: none; z-index: 2;
  background: var(--red); border: 3px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.pm-addr { margin-top: 8px; font-size: 14px; }
.rmap-lg { height: 340px; }
.ac-head span { font-weight: 400; }
.ac-dist { float: right; font-style: normal; font-size: 12px; font-weight: 700; color: var(--brand-d); margin-left: 8px; }

/* 적립금 */
.wal-chip { margin-left: auto; margin-right: 6px; font-family: var(--font-num); font-size: 14px; color: var(--brand-d); }
.wal-chip.neg, #walBal.neg, .wal-tx .neg { color: var(--red); }
.wal-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.wal-card > span { display: block; font-size: 13px; color: var(--sub); }
.wal-card > b { display: block; font-family: var(--font-num); font-size: 30px; margin: 2px 0; }
.wal-help { background: var(--card); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
.wal-help summary { cursor: pointer; font-weight: 700; }
.wal-help p { margin: 6px 0 0; }
.wal-req, .wal-tx { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 12px; padding: 10px 12px; margin-bottom: 6px; }
.wal-req .wst { font-size: 12px; font-weight: 700; color: var(--yellow-fg); }
.wal-req.approved .wst { color: var(--green); } .wal-req.rejected .wst, .wal-req.canceled .wst { color: var(--sub); }
.wal-tx .amt { text-align: right; white-space: nowrap; }
.wal-tx .pos { color: var(--green); }
.small { font-size: 12px; }
.badge.st-cost { background: var(--yellow-bg); color: var(--yellow-fg); }
#foodNote.strong { color: var(--yellow-fg); font-weight: 700; }
.drv-job { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 8px; }
.drv-job .head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.drv-job .head .fee { margin-left: auto; font-weight: 800; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); cursor: pointer; text-decoration: underline; }
.lock-box { background: var(--blue-bg); border: 1px solid var(--blue); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
.lock-box b { color: var(--blue); }
.lock-box p { margin: 6px 0 0; line-height: 1.55; }

/* 심부름 방향 */
.dir-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dir-btns .dir { text-align: left; border: 2px solid var(--line); background: var(--field); color: var(--text); border-radius: 12px; padding: 7px 10px; font: inherit; cursor: pointer; min-width: 0; }
.dir-btns .dir b { display: block; font-size: 14px; }
.dir-btns .dir span { display: block; font-size: 11px; line-height: 1.3; color: var(--sub); }
.dir-btns .dir.on { border-color: var(--brand); background: var(--brand-bg); }
/* 운송 유의사항 */
.cargo-q { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 8px; }
.cargo-q.yes { border-color: var(--green); }
.cargo-q.no { border-color: var(--red); background: var(--red-bg); }
.cargo-q .q { font-size: 14px; font-weight: 700; line-height: 1.5; }
.cargo-q .yn { display: flex; gap: 6px; margin-top: 8px; }
.cargo-q .yn .chip { flex: 1; text-align: center; }
.cargo-q .yn .chip.on.no { background: var(--red); border-color: var(--red); color: #fff; }
.cargo-no { margin-top: 8px; color: var(--red); font-size: 13px; font-weight: 700; }
.cust-foot { text-align: center; font-size: 12px; color: var(--sub); padding: 16px 8px 8px; line-height: 1.8; }
.cust-foot a { color: var(--sub); }
.terms-doc .pre { white-space: pre-wrap; font-size: 14px; line-height: 1.7; }
.terms-doc ol, .terms-doc ul { padding-left: 20px; line-height: 1.7; }
.proof-photo { display: block; width: 100%; max-height: 60vh; object-fit: contain; border-radius: 12px; background: #000; margin-top: 8px; }
.photo-btn { margin-top: 8px; cursor: pointer; }

/* 기사앱: 상단 운행 on/off */
.topbar .duty-tg { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.topbar .duty-tg b { font-weight: 800; }
.topbar .duty-tg { order: 99; margin-left: 8px; }
.topbar > .logo { margin-right: auto; }
.switch.sm { width: 44px; height: 26px; }
.switch.sm span::before { width: 20px; height: 20px; }
.switch.sm input:checked + span::before { transform: translateX(18px); }
.duty-hint { padding: 8px 16px; font-size: 13px; background: var(--card); border-bottom: var(--border-w) solid var(--line); color: var(--sub); }
.duty-hint.on { display: none; }
.topbar .duty-tg.on b { color: var(--green); }

/* 관리자: 별도 설정 화면 (오른쪽에서 열림) */
.set-drawer { left: auto; right: 0; width: min(760px, 100%); transform: translateX(100%); }
.set-drawer.open { transform: none; }
.set-drawer #tab-settings { padding-top: 6px; }
.set-drawer #tab-settings .card { display: none; }
.set-drawer #tab-settings .card.on { display: block; }
.set-drawer .set-save { position: sticky; bottom: 0; padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--bg); }
.set-drawer .set-save .btn { width: 100%; }

/* 관리자: 우측 맨 위 회사 적립금 */
.co-chip { order: 99; flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: 14px; font-variant-numeric: tabular-nums;
  padding: 6px 12px; border-radius: 99px; border: var(--border-w) solid var(--line); background: var(--card); color: var(--text); cursor: pointer; white-space: nowrap; }
.co-chip b { font-weight: 800; }
.co-chip.hidden { display: none; }
.tabs .tab-act { position: sticky; right: 6px; box-shadow: -10px 0 10px var(--card); flex: 0 0 auto; color: var(--on-brand); background: var(--brand); border-radius: var(--radius-sm); margin: 6px 8px; padding: 6px 14px; border-bottom: 0; }
/* 관리자 관제: 요약 숫자 한 줄 */
.stats.mini { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.stats.mini .stat { padding: 6px 8px; border-radius: 10px; text-align: center; min-width: 0; }
.stats.mini .stat .k { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats.mini .stat .v { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 400px) { .stats.mini { gap: 4px; } .stats.mini .stat { padding: 5px 3px; } .stats.mini .stat .k { font-size: 10px; } .stats.mini .stat .v { font-size: 13px; } }

/* 적립금 정산 항목별 */
.wal-tx.split { align-items: flex-start; }
.tx-parts { margin-top: 6px; display: grid; gap: 2px; font-size: 13px; max-width: 260px; }
.tx-parts > div { display: flex; justify-content: space-between; gap: 12px; }
.tx-parts span { color: var(--sub); }
.tx-parts .neg { color: var(--red); } .tx-parts .pos { color: var(--green); }

/* 관리자 관제: 지도 + 기사 목록 */
.ctl { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
.ctl #map { height: calc(100vh - 190px); min-height: 360px; }
.ctl #mapWrap { margin: 0; }
@media (max-width: 900px) { .ctl { grid-template-columns: 1fr; } .ctl #map { height: 55vh; } }
.ctl-drv { display: flex; align-items: center; gap: 8px; width: 100%; font: inherit; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 10px 4px; cursor: pointer; color: var(--text); }
.ctl-drv:last-child { border-bottom: 0; }
.ctl-drv .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: 0 0 auto; }
.ctl-drv.on .dot { background: var(--green); }
.ctl-drv .muted { margin-left: auto; }
.ctl-drv i { font-style: normal; color: var(--sub); }
.board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .board { grid-template-columns: 1fr; } }
.ctl:has(#mapWrap.hidden) { grid-template-columns: 1fr; }

/* 주문 칸 열고 닫기 */
.board .col-h { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 6px; }
.board .col-h::after { content: "▾"; margin-left: auto; color: var(--sub); font-size: 14px; transition: transform .15s; }
.board .col.shut .col-h::after { transform: rotate(-90deg); }
.board .col.shut > :not(.col-h) { display: none; }

/* 기사 적립금: 최소 적립금 ? 버튼 · 내역 접기/스크롤 */
.q-help { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: var(--border-w) solid var(--line); background: var(--field); color: var(--sub);
  font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; padding: 0; margin-left: 2px; vertical-align: middle; }
.wal-txbox > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
.wal-txbox > summary::-webkit-details-marker { display: none; }
.wal-txbox > summary::after { content: "▾"; margin-left: auto; color: var(--sub); transition: transform .15s; }
.wal-txbox:not([open]) > summary::after { transform: rotate(-90deg); }
.wal-txlist { max-height: 55vh; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }

.cust-foot #bizInfo div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mine-range { margin-bottom: 8px; }
.mine-custom { gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.mine-custom input { width: auto; flex: 1 1 130px; }
.chat-wrap ~ .modal-wrap { z-index: 130; }   /* 대화방 위에 뜨는 확인창 */
