:root {
  --bg: #f5f6f8; --card: #fff; --ink: #14181f; --muted: #6a7280; --line: #e3e6eb;
  --brand: #1b5cff; --brand-ink: #fff; --ok: #12a05c; --warn: #d97706; --bad: #d64545;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1217; --card: #181c24; --ink: #eef0f4; --muted: #9aa3b2; --line: #2a303b; --brand: #5b8cff; --brand-ink: #0b1020; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; }
.wrap { max-width: 560px; margin: 0 auto; padding: 16px; }
.wrap.wide { max-width: 1100px; }
h1 { font-size: 20px; margin: 0; } h2 { font-size: 15px; margin: 0 0 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; } .between { justify-content: space-between; } .wrapx { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
button, .btn { font: inherit; border: 0; border-radius: 10px; padding: 10px 14px; background: var(--brand); color: var(--brand-ink); font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; }
button.ghost, .btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.bad { background: var(--bad); color: #fff; }
button, .btn { white-space: nowrap; }
button.sm, .btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 8px 0 4px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--line); }
.pill.dispatching { background: #fde9c8; color: #8a5200; } .pill.assigned, .pill.enroute { background: #d8e6ff; color: #1744b3; }
.pill.arrived { background: #d4f3e2; color: #0b6b3c; } .pill.completed { background: var(--line); color: var(--muted); } .pill.cancelled { background: #fbdcdc; color: #9b2222; }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 4px 12px; font-size: 14px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.chat { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.msg { padding: 8px 12px; border-radius: 14px; max-width: 85%; font-size: 14px; word-break: break-word; background: var(--line); }
.msg.me { align-self: flex-end; background: var(--brand); color: var(--brand-ink); }
.warn { color: var(--warn); font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #111; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 9999; max-width: 90%; }
/* iOS Safari: 날짜 입력칸이 고유 너비로 화면 밖으로 나가지 않게 */
input[type="datetime-local"], input[type="date"], input[type="time"] { -webkit-appearance: none; appearance: none; display: block; min-height: 44px; }
/* 언어별 글꼴: 일본어·중국어 한자가 한국어 글꼴(한국식 자형)로 나오지 않게 <html lang> 기준으로 바꾼다 (시스템 글꼴만 — 외부 글꼴 없음) */
html:lang(ja) body, body [lang|="ja"] { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", "Noto Sans CJK JP", sans-serif; }
html:lang(zh) body, body [lang|="zh"] { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", sans-serif; }
html:lang(ko) body, body [lang|="ko"] { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", sans-serif; }
/* 키보드로 이동할 때 보이는 초점 표시 (고객 화면 공통) */
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
