:root {
  --navy: #1d3557;
  --red: #c62828;
  --red-bg: #fff3f3;
  --green: #1f7a3a;
  --green-bg: #f1faf4;
  --orange: #d46b00;
  --orange-bg: #fff7ec;
  --line: #d9dee4;
  --text: #1d2329;
  --muted: #5d6873;
  --bg: #f3f5f8;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  color: var(--text); background: var(--bg); font-size: 16px; line-height: 1.55;
  word-break: keep-all; overflow-wrap: anywhere;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: 680px; margin: 0 auto; padding: 0 14px 96px; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff; }
.topbar .in { max-width: 680px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px 14px; min-height: 54px; }
.topbar .back { appearance: none; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 15px; border-radius: 8px; padding: 6px 10px; text-decoration: none; }
.topbar .ttl { font-weight: 700; font-size: 17px; line-height: 1.3; flex: 1; }
.topbar .ttl small { display: block; font-weight: 400; font-size: 12px; opacity: .8; }

/* rule banner */
.rule { margin: 14px 0; border: 2px solid var(--red); background: var(--red-bg); border-radius: 12px; overflow: hidden; }
.rule .hd { background: var(--red); color: #fff; font-weight: 800; padding: 9px 12px; font-size: 16px; }
.rule .bd { padding: 10px 12px; font-size: 15px; }
.rule img { width: 100%; border-top: 1px solid #f0caca; }

.sec-title { font-size: 14px; font-weight: 700; color: var(--muted); margin: 22px 2px 8px; }

/* vehicle list */
.search { width: 100%; font-size: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.vlist { display: grid; gap: 10px; }
.vcard { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-decoration: none; }
.vcard .th { width: 92px; height: 70px; border-radius: 8px; object-fit: cover; background: #e9edf1; flex: 0 0 auto; }
.vcard .nm { font-weight: 800; font-size: 16.5px; line-height: 1.3; }
.vcard .meta { font-size: 13px; color: var(--muted); }
.chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.chip { font-size: 12px; border-radius: 20px; padding: 1px 8px; background: #eef2f6; color: var(--navy); font-weight: 700; }
.chip.trunk { background: #e8f1ff; color: #174ea6; }
.chip.engine { background: #eef7ea; color: #2e6b1f; }
.chip.cabin { background: #f3ecff; color: #5b2ea6; }
.chip.warn { background: #fff0e0; color: var(--orange); }
.chip.stop { background: #ffe9e9; color: var(--red); }
.links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lcard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-decoration: none; font-weight: 700; }
.lcard span { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }

/* summary */
.sum { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 14px 0; }
.sum h2 { margin: 0 0 8px; font-size: 18px; }
.sum table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.sum th { text-align: left; width: 34%; color: var(--muted); font-weight: 600; padding: 6px 4px; vertical-align: top; border-top: 1px solid #eef1f4; }
.sum td { padding: 6px 4px; border-top: 1px solid #eef1f4; font-weight: 700; }
.set { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.set div { background: var(--navy); color: #fff; border-radius: 8px; padding: 6px 4px; text-align: center; font-size: 12px; line-height: 1.3; }
.set b { display: block; font-size: 15px; }

.alert { border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: 15px; border: 1.5px solid; }
.alert.danger { border-color: var(--red); background: var(--red-bg); }
.alert.warn { border-color: var(--orange); background: var(--orange-bg); }
.alert.info { border-color: #8aa4c8; background: #f3f7fd; }
.alert b.h { display: block; margin-bottom: 2px; }
.alert img { margin-top: 8px; border-radius: 6px; border: 1px solid var(--line); }

/* prep checklist */
.prep { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.prep label { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid #eef1f4; font-size: 15px; }
.prep label:last-child { border-bottom: 0; }
.prep input { width: 22px; height: 22px; flex: 0 0 auto; margin-top: 1px; }

/* steps */
.group { margin: 22px 2px 8px; font-size: 13px; font-weight: 800; color: var(--navy); letter-spacing: .3px; display: flex; align-items: center; gap: 8px; }
.group::after { content: ''; flex: 1; height: 1px; background: #c8d0d9; }
.step { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin: 10px 0; overflow: hidden; scroll-margin-top: 64px; }
.step.done { border-color: var(--green); }
.step .sh { display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 8px; }
.step .no { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.step.done .no { background: var(--green); }
.step.opt .no { background: #6b7785; }
.step .st { font-weight: 800; font-size: 17px; line-height: 1.35; padding-top: 4px; }
.step .st small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.step .ph { display: grid; gap: 6px; padding: 0 12px; }
.step .ph.two { grid-template-columns: 1fr 1fr; }
.step .ph.three { grid-template-columns: 1fr 1fr 1fr; }
.step .ph figure { margin: 0; }
.step .ph img { width: 100%; max-height: 360px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); background: #f6f7f9; cursor: zoom-in; }
.step .ph.stack { grid-template-columns: 1fr !important; }
.step .ph figcaption { font-size: 12px; color: var(--muted); margin-top: 3px; }
.step .bd { padding: 8px 14px 4px; }
.step .bd ul { margin: 0; padding-left: 18px; }
.step .bd li { margin: 4px 0; font-size: 15.5px; }
.step .bd .key { display: inline-block; background: var(--navy); color: #fff; border-radius: 6px; padding: 0 7px; font-weight: 800; }
.step .ft { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 12px 12px; }
.step .credit { font-size: 11px; color: #8a949e; }
.donebtn { flex: 0 0 auto; white-space: nowrap; appearance: none; border: 1.5px solid var(--navy); background: #fff; color: var(--navy); border-radius: 10px; padding: 8px 14px; font-size: 15px; font-weight: 800; }
.step.done .donebtn { background: var(--green); border-color: var(--green); color: #fff; }
.stepwarn { margin: 6px 12px 0; border-left: 4px solid var(--red); background: var(--red-bg); padding: 6px 10px; font-size: 14.5px; border-radius: 4px; }
.stepnote { margin: 6px 12px 0; border-left: 4px solid var(--orange); background: var(--orange-bg); padding: 6px 10px; font-size: 14.5px; border-radius: 4px; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; border-radius: 10px; overflow: hidden; }
.tbl th, .tbl td { border: 1px solid var(--line); padding: 7px 8px; text-align: left; vertical-align: top; }
.tbl th { background: #eef2f6; }
.ok { color: var(--green); font-weight: 800; } .ng { color: var(--red); font-weight: 800; } .mid { color: var(--orange); font-weight: 800; }

/* record form */
.rec { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.rec .f { display: grid; grid-template-columns: 38% 1fr; gap: 6px 8px; align-items: center; }
.rec label { font-size: 14px; color: var(--muted); }
.rec input, .rec select { width: 100%; font-size: 16px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.btnrow { display: flex; gap: 8px; margin-top: 12px; }
.btn { flex: 1; appearance: none; border: 0; border-radius: 10px; padding: 12px; font-size: 16px; font-weight: 800; background: var(--navy); color: #fff; }
.btn.sub { background: #e6ebf1; color: var(--navy); }

/* progress */
.prog { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #fff; border-top: 1px solid var(--line); padding: 8px 14px calc(8px + env(safe-area-inset-bottom)); }
.prog .in { max-width: 680px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.prog .bar { flex: 1; height: 10px; border-radius: 10px; background: #e6ebf1; overflow: hidden; }
.prog .bar i { display: block; height: 100%; background: var(--green); width: 0; transition: width .25s; }
.prog .txt { font-size: 14px; font-weight: 800; min-width: 64px; text-align: right; }
.prog button { appearance: none; border: 0; background: #e6ebf1; border-radius: 8px; padding: 6px 10px; font-size: 13px; font-weight: 700; color: var(--navy); }

/* lightbox */
.lb { position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 50; display: none; align-items: center; justify-content: center; padding: 10px; }
.lb.on { display: flex; }
.lb img { max-width: 100%; max-height: 92vh; border-radius: 6px; background: #fff; }
.lb .x { position: absolute; top: 12px; right: 14px; color: #fff; font-size: 30px; background: none; border: 0; }

.foot { font-size: 12px; color: var(--muted); text-align: center; margin: 26px 0 8px; }
.toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 16px; border-radius: 20px; font-size: 14px; z-index: 60; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.on { opacity: .95; }

/* 충전점검 선택 박스 */
.chgbox { background: #fff; border: 2px dashed #8aa4c8; border-radius: 14px; padding: 12px 14px; margin: 12px 0; }
.chgbox.on { border-style: solid; border-color: var(--navy); background: #f3f7fd; }
.chgbox .ch-h { font-weight: 800; font-size: 17px; margin-bottom: 4px; }
.chgbox .ch-h span { font-size: 12px; font-weight: 700; color: #fff; background: #6b7785; border-radius: 10px; padding: 1px 8px; margin-left: 6px; vertical-align: 2px; }
.chgbox p { margin: 4px 0 6px; font-size: 15px; }
.chgbox ul { margin: 0 0 10px; padding-left: 18px; font-size: 15px; }
.chgbox .btn { width: 100%; }
