/* 바른수거 스타일 */
:root {
  --bg: #f3f5f4; --surface: #ffffff; --surface-2: #f7f9f8; --text: #17201c; --muted: #66736d; --line: #dfe5e2;
  --primary: #1f6b4d; --primary-2: #2f7d5b; --primary-soft: #e3f1ea; --on-primary: #fff;
  --ok: #2f7d5b; --ok-soft: #e3f1ea; --warn: #b9741a; --warn-soft: #fbf0df; --danger: #c43d4b; --danger-soft: #fbe5e7; --info: #2f6db0; --info-soft: #e4eef9;
  --radius: 14px; --shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 4px 16px rgba(16, 24, 20, .05);
  --font: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1412; --surface: #171e1b; --surface-2: #1c2521; --text: #e6ece9; --muted: #95a39c; --line: #2a3530;
    --primary: #3fa57a; --primary-2: #4bb487; --primary-soft: #1d3329; --on-primary: #06140e;
    --ok: #4bb487; --ok-soft: #1d3329; --warn: #e0a14a; --warn-soft: #33281a; --danger: #ec6b78; --danger-soft: #3a1e22; --info: #6ea6e6; --info-soft: #1b2a3b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1412; --surface: #171e1b; --surface-2: #1c2521; --text: #e6ece9; --muted: #95a39c; --line: #2a3530;
  --primary: #3fa57a; --primary-2: #4bb487; --primary-soft: #1d3329; --on-primary: #06140e;
  --ok: #4bb487; --ok-soft: #1d3329; --warn: #e0a14a; --warn-soft: #33281a; --danger: #ec6b78; --danger-soft: #3a1e22; --info: #6ea6e6; --info-soft: #1b2a3b; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
#app { min-height: 100%; outline: none; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
h2 { font-size: 16px; } h3 { font-size: 14px; margin: 14px 0 8px; }
p { margin: 6px 0; }
a { color: var(--info); }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
small { font-size: 12px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .center { text-align: center; } .right { text-align: right; } .r { text-align: right; white-space: nowrap; }
.ok-text { color: var(--ok); font-weight: 600; } .warn-text { color: var(--warn); } .danger-text { color: var(--danger); font-weight: 600; }
.pre { white-space: pre-wrap; } .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }

/* 버튼 */
.btn { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 9px 14px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; transition: background .15s, transform .05s; }
.btn:hover { background: var(--surface-2); } .btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); } .btn.primary:hover { background: var(--primary-2); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.light { background: #fff; color: #1f6b4d; border-color: #fff; } .btn.ghost-light { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .5); }
.btn.big { width: 100%; padding: 14px; font-size: 16px; border-radius: 12px; margin: 6px 0; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.icon-btn { border: 0; background: transparent; color: inherit; font-size: 20px; width: 38px; height: 38px; border-radius: 10px; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.link { border: 0; background: none; color: var(--info); font: inherit; font-size: 13px; cursor: pointer; padding: 2px 4px; }

/* 폼 */
.fld { display: flex; flex-direction: column; gap: 5px; margin: 10px 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.fld > span { font-weight: 600; }
input, select, textarea { font: inherit; font-size: 15px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; width: 100%; font-weight: 400; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; }
.chkline { display: flex; align-items: center; gap: 9px; padding: 7px 0; font-weight: 500; color: var(--text); font-size: 14.5px; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .grid2 .fld { margin: 6px 0; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: auto; padding: 7px 10px; font-size: 14px; }
.toolbar label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.toolbar .grow { flex: 1; }
.seg-s { display: inline-flex; gap: 4px; }

/* 배지·칩 */
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; border: 1px solid var(--line); }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; } .badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; } .badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-size: 13px; color: var(--text); cursor: default; font-family: inherit; }
button.chip { cursor: pointer; }
.chip.on { background: var(--ok-soft); border-color: transparent; color: var(--ok); font-weight: 600; }
.chip.sel { cursor: pointer; } .chip.sel input { display: none; } .chip.sel:has(input:checked) { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.chips-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.sdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--muted); }
.sdot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); } .sdot.warn { background: var(--warn); } .sdot.danger { background: var(--danger); } .sdot.muted { background: var(--muted); }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.progress i { display: block; height: 100%; background: var(--primary-2); border-radius: 99px; transition: width .4s; }

/* 표 */
.tbl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 700; color: var(--muted); background: var(--surface-2); padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 12.5px; position: sticky; top: 0; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl .row-danger td { background: var(--danger-soft); }
.tbl .dim td { opacity: .55; }
.thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; vertical-align: middle; }

/* 모달 */
.modal-wrap { position: fixed; inset: 0; background: rgba(10, 16, 13, .45); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: calc(16px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left)); animation: fade .15s; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal.wide { max-width: 980px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 8px 18px; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 4px 18px 12px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px 16px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 440px); }
.toast { background: #1d2723; color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14px; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); transition: opacity .3s, transform .3s; text-align: center; }
.toast.danger { background: #b23443; } .toast.warn { background: #9a5f12; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* 지도 */
.map-off { display: grid; place-items: center; min-height: 120px; height: 100%; color: var(--muted); background: var(--surface-2); border-radius: 10px; font-size: 13px; text-align: center; padding: 12px; }
.pin-wrap { background: none; border: 0; }
.pin { width: 30px; height: 30px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 800; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.mini-map { height: 180px; border-radius: 10px; margin: 10px 0; overflow: hidden; position: relative; z-index: 0; isolation: isolate; } /* 지도가 위 머리말·창 위로 올라오지 않게 */
.mid-map { height: 340px; border-radius: 10px; overflow: hidden; }

/* ========== 로그인 ========== */
.login-root { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); background: radial-gradient(1200px 600px at 10% -10%, var(--primary-soft), transparent), var(--bg); }
.login { width: 100%; max-width: 400px; }
.login-brand { text-align: center; margin-bottom: 18px; }
.login-brand h1 { font-size: 28px; margin-top: 10px; letter-spacing: -.5px; }
.login-brand p { color: var(--muted); margin: 2px 0 0; }
.logo { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--primary); color: #fff; font-weight: 900; font-size: 19px; }
.logo.big { width: 64px; height: 64px; border-radius: 18px; font-size: 32px; }
img.logo { display: inline-block; object-fit: cover; background: none; flex: none; }
.logo-full { display: block; width: 112px; height: 112px; margin: 0 auto 6px; border-radius: 26px; box-shadow: 0 6px 20px rgba(31, 107, 77, .25); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; box-shadow: var(--shadow); }
.err { color: var(--danger); min-height: 1em; margin: 4px 0; font-size: 14px; }
.demo { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 6px; } .demo small { color: var(--muted); display: block; margin-bottom: 8px; }
.conn { display: flex; align-items: center; margin-top: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; gap: 2px; }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; }
.install-hint { margin-top: 14px; background: var(--info-soft); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.install-hint span { color: var(--text); } .install-hint .btn { align-self: flex-start; margin-top: 4px; }
.qr-panel { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; } .qr-panel .qrimg { width: 150px; background: #fff; border-radius: 10px; padding: 8px; border: 1px solid var(--line); } .qr-panel .qrimg svg { width: 100%; height: auto; display: block; }

/* ========== 모바일(현장앱) ========== */
.m-root { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.m-head { position: sticky; top: 0; z-index: 50; display: flex; justify-content: space-between; align-items: center; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); }
.m-title { font-weight: 900; font-size: 18px; color: var(--primary); letter-spacing: -.3px; }
.m-sub { font-size: 12px; color: var(--muted); }
.sync { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; white-space: nowrap; }
.m-main { padding: 4px 16px 16px; }
.m-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 560px; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 60; }
.m-nav button { border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; padding: 8px 0 9px; display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: pointer; position: relative; }
.m-nav button .ni { font-size: 20px; line-height: 1.2; filter: grayscale(1); opacity: .7; }
.m-nav button.on { color: var(--primary); font-weight: 700; } .m-nav button.on .ni { filter: none; opacity: 1; }
.m-nav .dot { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--danger); color: #fff; font-style: normal; font-size: 10.5px; font-weight: 700; border-radius: 99px; padding: 0 5px; min-width: 16px; line-height: 16px; }
.m-nav .dot:empty { display: none; }
.m-back { display: flex; align-items: center; gap: 4px; margin: 0 0 10px -8px; } .m-back h1 { font-size: 19px; } .m-back .icon-btn { font-size: 28px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card.imp { border-color: var(--warn); }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.hero { background: linear-gradient(135deg, #1f6b4d, #2f8a62); color: #fff; border-radius: 18px; padding: 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.hero-date { opacity: .85; font-size: 13px; } .hero-name { font-size: 20px; font-weight: 800; margin: 2px 0; letter-spacing: -.3px; } .hero-meta { opacity: .85; font-size: 13px; margin-bottom: 10px; }
.tasks { list-style: none; margin: 10px 0 0; padding: 0; }
.tasks li { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.tasks li:last-child { border-bottom: 0; }
.tasks .chk { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 13px; color: #fff; font-weight: 900; }
.tasks li.done .chk { background: var(--ok); border-color: var(--ok); }
.tasks li.done b { color: var(--muted); font-weight: 600; }
.tasks li.none .chk { border-style: dashed; color: var(--muted); } .tasks li.none b { color: var(--muted); font-weight: 600; } /* 해당 없음(배정 민원 없음) */
.tasks li.wait .chk { border-style: dashed; } .tasks li.wait small { color: var(--muted); } /* 앞 단계(운행 시작) 후 가능 */
.tl { flex: 1; display: flex; flex-direction: column; min-width: 0; } .tl small { color: var(--muted); }
.chev { color: var(--muted); font-size: 20px; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.quick button { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px 4px; font: inherit; font-size: 12px; font-weight: 600; color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; box-shadow: var(--shadow); line-height: 1.25; }
.quick button span { font-size: 24px; }
.notice { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; cursor: pointer; } .notice:last-child { border: 0; } .notice small { color: var(--muted); } .notice.imp b::before { content: '📌 '; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 8px 0; font-size: 14px; } .kv span { color: var(--muted); } .kv b { font-weight: 600; }
.kv.cols { grid-template-columns: auto 1fr auto 1fr; }
.clock { font-size: 52px; font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.card.center .kv { max-width: 260px; margin: 10px auto; text-align: left; }
.risk { margin: 6px 0; padding-left: 20px; } .risk li { padding: 3px 0; } .risk.sm { font-size: 13px; }
.note { background: var(--warn-soft); border-radius: 10px; padding: 8px 11px; font-size: 14px; }
.sign { width: 100%; height: 150px; border: 1.5px dashed var(--line); border-radius: 12px; background: #fff; }
.checks .ci { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); gap: 10px; font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; flex: none; }
.seg label { cursor: pointer; } .seg input { display: none; } .seg b { display: block; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg input:checked + b { background: var(--ok); color: #fff; } .seg .bad input:checked + b { background: var(--danger); }
.card.live { border-color: var(--info); }
.gps { font-size: 12.5px; color: var(--muted); margin-top: 6px; display: flex; align-items: center; }
.wlist { list-style: none; padding: 0; margin: 0 0 8px; } .wlist li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); } .wlist li > div { flex: 1; display: flex; flex-direction: column; } .wlist small { color: var(--muted); }
.ph-box { border: 1.5px dashed var(--line); border-radius: 12px; padding: 18px 12px; text-align: center; color: var(--muted); font-size: 13px; font-weight: 400; }
.ph-box .thumb { width: 100%; height: auto; max-height: 220px; object-fit: contain; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; background: var(--surface-2); padding: 4px; border-radius: 12px; border: 1px solid var(--line); }
.tabs button { flex: 1; border: 0; background: none; font: inherit; font-size: 14px; padding: 8px; border-radius: 9px; color: var(--muted); font-weight: 600; cursor: pointer; }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.card.cp { cursor: pointer; } .addr { font-weight: 600; margin: 4px 0; }
.row2 { display: flex; gap: 8px; } .row2 .btn { flex: 1; }
.menu { padding: 4px 12px; } .menu button { width: 100%; display: flex; align-items: center; gap: 12px; border: 0; background: none; font: inherit; color: var(--text); padding: 13px 2px; border-bottom: 1px solid var(--line); cursor: pointer; text-align: left; } .menu button:last-child { border: 0; }
.mi { font-size: 22px; width: 32px; text-align: center; }
.li { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); gap: 10px; } .li:last-child { border: 0; } .li > div { display: flex; flex-direction: column; min-width: 0; } .li small { color: var(--muted); }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; } .stats3 div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; } .stats3 b { display: block; font-size: 20px; } .stats3 small { color: var(--muted); }
.m-root .tbl { font-size: 13.5px; } .m-root .card .tbl th { position: static; }

/* ========== PC 관리자 ========== */
.a-root { display: flex; min-height: 100vh; }
.a-side { width: 228px; flex: none; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px 14px; } .brand b { display: block; font-size: 16px; } .brand small { color: var(--muted); }
.a-side nav { flex: 1; overflow-y: auto; padding: 4px 10px; }
.a-side nav button { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--text); padding: 9px 10px; border-radius: 10px; cursor: pointer; text-align: left; }
.a-side nav button:hover { background: var(--surface-2); }
.a-side nav button.on { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.a-side .ni { width: 20px; text-align: center; color: var(--muted); } .a-side nav button.on .ni { color: var(--primary); }
.cnt { margin-left: auto; font-style: normal; background: var(--danger); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 18px; } .cnt:empty { display: none; }
.side-foot { padding: 12px 16px; color: var(--muted); border-top: 1px solid var(--line); }
.a-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.a-top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) calc(22px + env(safe-area-inset-right)) 12px calc(22px + env(safe-area-inset-left)); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.a-top h1 { font-size: 20px; flex: 1; letter-spacing: -.3px; }
.top-r { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.top-r .sel { width: auto; padding: 6px 10px; font-size: 14px; }
.org { font-weight: 700; } .who small { color: var(--muted); }
.menu-btn { display: none; }
.a-main { padding: 20px 22px 40px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; }
.kpi[data-v] { cursor: pointer; } .kpi[data-v]:hover { border-color: var(--primary); }
.kpi small { color: var(--muted); font-weight: 600; } .kpi b { font-size: 26px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; } .kpi b small { font-size: 14px; font-weight: 500; } .kpi span { font-size: 12.5px; color: var(--muted); }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line); }
.kpi.ok::before { background: var(--ok); } .kpi.warn::before { background: var(--warn); } .kpi.danger::before { background: var(--danger); } .kpi.info::before { background: var(--info); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.panel.dim { opacity: .75; } .panel.imp { border-color: var(--warn); }
.panel-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.panel .tbl-wrap { border: 0; margin: 0; border-radius: 0; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; } .grid-1-1 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } .grid-1-1-1 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.chart-box { position: relative; height: 280px; } .chart-box.sm { height: 220px; }
.alerts { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; }
.alerts li { padding: 9px 10px 9px 12px; border-left: 4px solid var(--line); background: var(--surface-2); border-radius: 8px; margin-bottom: 6px; cursor: pointer; display: flex; flex-direction: column; }
.alerts li small { color: var(--muted); } .alerts li.danger { border-color: var(--danger); } .alerts li.warn { border-color: var(--warn); } .alerts li.info { border-color: var(--info); } .alerts li.ok { border-color: var(--ok); }
.feed { list-style: none; margin: 0; padding: 0; font-size: 13.5px; } .feed li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; } .feed time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.signs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 8px; }
.sg { border: 1px solid var(--line); border-radius: 10px; padding: 6px; text-align: center; font-size: 12.5px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sg img { height: 34px; max-width: 100%; background: #fff; border-radius: 4px; } .sg i { color: var(--ok); font-style: normal; font-size: 12px; } .sg.no { background: var(--danger-soft); } .sg.no i { color: var(--danger); } .sg small { color: var(--muted); }
.map-layout { display: grid; grid-template-columns: 300px 1fr; gap: 14px; height: calc(100vh - 110px); min-height: 480px; }
.map-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.map-side .toolbar { margin: 0; }
.bigmap { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); min-height: 400px; }
.vrow { display: flex; gap: 10px; align-items: center; padding: 9px 6px; border-radius: 10px; cursor: pointer; } .vrow:hover { background: var(--surface-2); } .vrow > div { display: flex; flex-direction: column; min-width: 0; } .vrow small { color: var(--muted); }
.vdot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.timeline { list-style: none; padding: 0; margin: 10px 0; display: flex; gap: 4px; } .timeline li { flex: 1; border-top: 4px solid var(--line); padding-top: 6px; font-size: 12.5px; display: flex; flex-direction: column; } .timeline li.on { border-color: var(--ok); } .timeline small { color: var(--muted); }
.photos { display: flex; gap: 10px; } .photos figure { margin: 0; text-align: center; font-size: 12px; color: var(--muted); } .photos .thumb { width: 120px; height: 90px; }
.stars { display: flex; gap: 2px; } .star { border: 0; background: none; font-size: 26px; color: var(--line); cursor: pointer; padding: 0 2px; } .star.on { color: #e5a11c; }
.esg-row { display: grid; grid-template-columns: 160px repeat(3, 1fr); gap: 18px; align-items: center; }
.esg-total { text-align: center; border-right: 1px solid var(--line); } .esg-total b { font-size: 48px; color: var(--primary); display: block; line-height: 1; } .esg-total small { color: var(--muted); }
.esg-item { display: flex; flex-direction: column; gap: 6px; } .esg-h { display: flex; align-items: baseline; gap: 6px; } .esg-h b { color: var(--primary); font-size: 18px; } .esg-h span { margin-left: auto; font-weight: 800; font-size: 20px; } .esg-item small { color: var(--muted); }
.big-url { font-size: 20px; font-weight: 800; color: var(--primary); word-break: break-all; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.form .fld { margin: 8px 0; }
.set-tabs { flex-wrap: wrap; } .set-tabs button { flex: 1 1 auto; white-space: nowrap; }
.ed-list { list-style: none; margin: 0 0 10px; padding: 0; }
.ed-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.ed-list li:last-child { border-bottom: 0; } .ed-list li.dim { opacity: .55; }
.ed-list li.ed-group { font-weight: 800; color: var(--primary); background: var(--primary-soft); border-radius: 8px; padding: 5px 10px; margin-top: 6px; border: 0; }
@supports not (background: color-mix(in srgb, red 50%, transparent)) { .m-head, .a-top { background: var(--bg); } } /* 구형 iOS */
.nav-backdrop { display: none; }
@media (max-width: 820px) {
  .a-root.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 95; background: rgba(10, 16, 13, .4); animation: fade .15s; }
  .a-side { width: min(270px, 82vw); overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .menu-btn { width: 44px; height: 44px; font-size: 24px; flex: none; }
}
/* 현장앱: 창이 떠 있어도 아래 메뉴(홈·운행·민원·전체)는 보이고 누를 수 있게 → 누르면 창이 닫히고 이동 */
body[data-role="worker"] .modal-wrap { bottom: calc(60px + env(safe-area-inset-bottom)); padding-bottom: 12px; align-items: flex-end; }
body[data-role="worker"] .modal { max-height: 100%; border-radius: 16px; }
body[data-role="worker"] .m-nav { z-index: 1001; }
.time-reset { display: flex; gap: 6px; } .time-reset input { flex: 1; }
.zone-area { display: block; font-weight: 800; color: var(--primary); margin: 8px 0 4px; }
.ed-name { min-width: 0; flex: 1; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ed-btns { display: inline-flex; gap: 4px; flex: none; align-items: center; }
.ed-add { display: flex; gap: 8px; align-items: center; margin-top: 8px; } .ed-add input:not([type=color]) { flex: 1; }
.ed-add input[type=color] { width: 46px; height: 42px; padding: 3px; flex: none; }
.icon-btn.sm { width: 30px; height: 30px; font-size: 15px; border: 1px solid var(--line); }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 5px; vertical-align: middle; flex: none; }

@media (max-width: 1100px) { .grid-2-1, .grid-1-1-1 { grid-template-columns: 1fr 1fr; } .grid-2-1 > :first-child { grid-column: 1 / -1; } .esg-row { grid-template-columns: 1fr 1fr; } .esg-total { border: 0; } }
@media (max-width: 820px) {
  .a-side { position: fixed; left: 0; top: 0; z-index: 100; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0, 0, 0, .2); }
  .a-root.nav-open .a-side { transform: none; }
  .menu-btn { display: inline-block; }
  .a-top { padding: calc(10px + env(safe-area-inset-top)) 16px 10px; flex-wrap: wrap; background: var(--bg); } .a-top h1 { font-size: 18px; } .who { display: none; }
  .a-main { padding: 14px 16px 40px; }
  .grid-2-1, .grid-1-1, .grid-1-1-1, .esg-row { grid-template-columns: 1fr; }
  .map-layout { grid-template-columns: 1fr; height: auto; } .bigmap { height: 60vh; } .map-side { max-height: 260px; }
  .kv.cols { grid-template-columns: auto 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); } .kpi b { font-size: 22px; }
}
@media print { .a-side, .a-top, .m-nav, .toolbar { display: none !important; } }

/* =====================================================================
   휴대폰 가독성·조작 편의 (현장앱 중심) — 글자 크기 단계: html[data-fs] → --fz
   ===================================================================== */
:root { --fz: 1; --nav-h: 72px; }
html[data-fs="l"] { --fz: 1.15; --nav-h: 80px; }
html[data-fs="xl"] { --fz: 1.3; --nav-h: 90px; }
.m-root code { font-size: calc(14px * var(--fz)); word-break: break-all; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button, a, label, select, input, textarea, [data-go], [data-act] { touch-action: manipulation; } /* 두 번 탭 확대·지연 방지 */
body[data-role="worker"] { --muted: #56625c; overscroll-behavior-y: contain; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body[data-role="worker"] { --muted: #a9b6af; } }

/* 기본 글자 */
.m-root { font-size: calc(16px * var(--fz)); line-height: 1.55; }
.m-root small, .m-root .small, .m-root .muted.small { font-size: calc(13.5px * var(--fz)); }
.m-root h2 { font-size: calc(18px * var(--fz)); }
.m-root h3 { font-size: calc(16px * var(--fz)); }

/* 상단 머리말 */
.m-title { font-size: calc(19px * var(--fz)); }
.m-sub { font-size: calc(13px * var(--fz)); color: var(--muted); }
.sync { font-size: calc(13px * var(--fz)); }
.m-back { margin: 2px 0 12px -10px; }
.m-back .icon-btn { width: 48px; height: 48px; font-size: 32px; }
.m-back h1 { font-size: calc(22px * var(--fz)); }

/* 아래 메뉴: 더 크게·진하게, 선택된 메뉴 표시줄 */
.m-nav button { min-height: calc(var(--nav-h) - 8px); padding: 9px 0 11px; font-size: calc(13.5px * var(--fz)); font-weight: 600; color: var(--muted); }
.m-nav button .ni { font-size: calc(25px * var(--fz)); filter: grayscale(.4); opacity: .75; }
.m-nav button.on { color: var(--primary); font-weight: 800; }
.m-nav button.on::before { content: ''; position: absolute; top: 0; left: 26%; right: 26%; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); }
.m-nav button:active { background: var(--surface-2); }
.m-nav .dot { font-size: 12px; min-width: 19px; line-height: 19px; top: 5px; }
.m-root { padding-bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); }

/* 카드·홈 */
.m-root .card { padding: 16px 18px; border-radius: 16px; }
.hero { padding: 20px 18px; }
.hero-date { font-size: calc(14px * var(--fz)); }
.hero-name { font-size: calc(23px * var(--fz)); }
.hero-meta { font-size: calc(14px * var(--fz)); }
.tasks li { padding: 14px 4px; min-height: 60px; gap: 14px; }
.tasks li:active { background: var(--surface-2); }
.tasks .chk { width: 30px; height: 30px; font-size: 15px; }
.tasks b { font-size: calc(16.5px * var(--fz)); }
.tasks small { font-size: calc(13.5px * var(--fz)); }
.chev { font-size: 26px; }
.quick { gap: 10px; }
.quick button { padding: 16px 4px 14px; font-size: calc(13.5px * var(--fz)); border-radius: 16px; min-height: 92px; }
.quick button span { font-size: calc(30px * var(--fz)); }
.quick button:active, .menu button:active, .card.cp:active { transform: scale(.98); background: var(--surface-2); }
.notice { padding: 12px 0; } .notice b { font-size: calc(15.5px * var(--fz)); }
.menu button { padding: 16px 4px; min-height: 64px; }
.menu .tl b { font-size: calc(16.5px * var(--fz)); }
.mi { font-size: calc(26px * var(--fz)); width: 38px; }
.li { padding: 12px 0; } .li b { font-size: calc(15.5px * var(--fz)); }
.m-root .kv { font-size: calc(15px * var(--fz)); gap: 8px 16px; }
.addr { font-size: calc(16px * var(--fz)); }
.clock { font-size: calc(56px * var(--fz)); }

/* 버튼·선택 */
.btn { min-height: 44px; }
.btn.sm { min-height: 36px; }
.btn.big { min-height: 56px; font-size: calc(17.5px * var(--fz)); border-radius: 14px; font-weight: 800; }
.m-root .btn:active, .modal .btn:active { filter: brightness(.94); }
.chip.sel { padding: 10px 15px; font-size: calc(15px * var(--fz)); min-height: 44px; }
.chips { gap: 8px; }
.chkline { padding: 11px 0; font-size: calc(15.5px * var(--fz)); gap: 12px; }
.chkline input[type=checkbox], .chkline input[type=radio] { width: 24px; height: 24px; flex: none; }
.checks .ci { padding: 11px 0; font-size: calc(15px * var(--fz)); }
.seg b { padding: 11px 16px; font-size: calc(15px * var(--fz)); min-width: 64px; text-align: center; }
.fuel-seg { display: flex; } .fuel-seg label { flex: 1; } .fuel-seg b { padding: 13px 10px; }
.sign { height: 180px; }
.zone-area { font-size: calc(14.5px * var(--fz)); }

/* 입력칸: 아이폰은 16px 미만이면 화면이 확대되므로 16px 이상 */
@media (max-width: 820px) {
  input, select, textarea { font-size: max(16px, calc(16px * var(--fz))); }
  input:not([type=checkbox]):not([type=radio]):not([type=color]), select { min-height: 48px; }
  .fld { font-size: calc(14px * var(--fz)); gap: 6px; margin: 12px 0; }
}

/* 표(근무기록 등) */
.m-root .tbl { font-size: calc(14.5px * var(--fz)); } .m-root .tbl td, .m-root .tbl th { padding: 10px 8px; }

/* 팝업: 현장앱은 아래쪽 시트 형태, 버튼 크게 */
body[data-role="worker"] .modal-wrap { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding: calc(10px + env(safe-area-inset-top)) 10px 10px; }
body[data-role="worker"] .modal { max-width: 560px; border-radius: 20px; font-size: calc(16px * var(--fz)); }
body[data-role="worker"] .modal-head { padding: 14px 10px 6px 18px; }
body[data-role="worker"] .modal-head h3 { font-size: calc(19px * var(--fz)); }
body[data-role="worker"] .modal-head .icon-btn { width: 46px; height: 46px; font-size: 22px; }
body[data-role="worker"] .modal-body { padding: 4px 18px 14px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
body[data-role="worker"] .modal-foot { padding: 12px 14px 14px; gap: 10px; }
body[data-role="worker"] .modal-foot .btn { flex: 1; min-height: 52px; font-size: calc(16.5px * var(--fz)); font-weight: 800; border-radius: 13px; }
body[data-role="worker"] .modal p { font-size: calc(16px * var(--fz)); }

/* 알림 메시지: 아래 메뉴 위, 크게 */
#toasts { bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); }
body[data-role="worker"] .toast { font-size: calc(15.5px * var(--fz)); padding: 13px 18px; border-radius: 14px; }
body:not([data-role="worker"]) #toasts { bottom: calc(28px + env(safe-area-inset-bottom)); }

/* 로그인 화면도 글자 크기 단계 적용 */
.login-root { font-size: calc(15px * var(--fz)); }
.login-root .fld { font-size: calc(14px * var(--fz)); }
.login-root .btn.big { font-size: calc(17px * var(--fz)); }
.login-root .auto-login { font-size: calc(15px * var(--fz)); }
.login-foot { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
/* 글자 크기 선택 */
.fs-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.fs-pick button { border: 1.5px solid var(--line); background: var(--surface); color: var(--text); border-radius: 12px; padding: 10px 4px; font: inherit; font-weight: 700; cursor: pointer; min-height: 56px; }
.fs-pick button.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

/* 관리자 화면을 휴대폰으로 볼 때 */
@media (max-width: 820px) {
  .a-side nav button { min-height: 48px; font-size: 15.5px; padding: 11px 12px; }
  .a-top { gap: 8px; } .a-top h1 { font-size: 19px; }
  .top-r { gap: 6px; } .top-r .org { display: none; } .top-r .btn.sm { min-height: 40px; }
  .a-main .tbl { font-size: 14px; } .a-main .tbl td, .a-main .tbl th { padding: 10px 9px; }
  .a-main .tbl td:first-child, .a-main .tbl th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
  .a-main .tbl th:first-child { background: var(--surface-2); z-index: 2; }
  .toolbar { gap: 8px; } .toolbar > * { flex: 1 1 auto; } .toolbar .grow { display: none; }
  .toolbar input, .toolbar select { min-height: 44px; font-size: 16px; }
  .panel { padding: 14px; } .kpi b { font-size: 24px; } .kpi small, .kpi span { font-size: 13px; }
  .alerts li { padding: 11px 12px 11px 14px; } .alerts li b { font-size: 15px; } .alerts li small { font-size: 13px; }
  .modal-foot .btn { min-height: 48px; flex: 1; }
  .modal-head .icon-btn { width: 44px; height: 44px; }
  .link { min-height: 40px; padding: 8px 8px; font-size: 14.5px; }
}