/* 소규모노후건축물안전점검 — 현장(폰)·사무실(PC) 겸용. 플랫·각진 모서리·단일 남색 포인트. */
:root {
  --navy: #18364b;
  --blue: #285b7f;
  --text: #24313d;
  --sub: #5b6873;
  --line: #d5dbe1;
  --line2: #e7ebef;
  --bg: #f3f6f8;
  --white: #fff;
  --warn: #b42318;
  --warn-bg: #fdf1f0;
  --ok: #1f6f43;
  --r: 3px;
  --gap: 12px;
  --w: 980px;
  --g-우수: #1f6f43;
  --g-양호: #2e6e8e;
  --g-보통: #6b5d12;
  --g-미흡: #a14a08;
  --g-불량: #b42318;
  --g-해당없음: #5b6873;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 "맑은 고딕", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  word-break: keep-all; overflow-wrap: break-word;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); }
.nw { white-space: nowrap; }
.muted { color: var(--sub); }
.small { font-size: 14px; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid #7fa3bf; outline-offset: 1px; }

/* ---------- 머리 ---------- */
.top { position: sticky; top: 0; z-index: 30; background: var(--navy); color: #fff; }
.top-in { max-width: var(--w); margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px 14px; min-height: 52px; }
.brand { font-weight: 700; font-size: 17px; letter-spacing: -0.2px; color: #fff; text-decoration: none; white-space: nowrap; }
.top .sp { flex: 1; }
.sync { font-size: 13px; color: #dfe7ee; white-space: nowrap; }
.sync.bad { color: #ffd2cc; }
.top-btn { background: transparent; border: 1px solid #5d7d95; color: #fff; border-radius: var(--r); padding: 6px 10px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.top-btn:hover { background: #22465f; }
.menu { position: absolute; right: 14px; top: 50px; background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: var(--r); min-width: 220px; box-shadow: 0 2px 8px rgba(0,0,0,.12); padding: 6px 0; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 10px 16px; background: none; border: 0; color: var(--text); text-decoration: none; font-size: 15px; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--bg); }
.menu .sep { height: 1px; background: var(--line2); margin: 6px 0; }

/* ---------- 본문 틀 ---------- */
.wrap { max-width: var(--w); margin: 0 auto; padding: 14px 14px 90px; }
.crumb { font-size: 14px; color: var(--sub); margin: 2px 0 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumb a { color: var(--sub); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
h1 { font-size: 21px; margin: 0 0 6px; letter-spacing: -0.3px; }
h2 { font-size: 18px; margin: 0; letter-spacing: -0.2px; }
h3 { font-size: 16px; margin: 0; }
.lead { color: var(--sub); margin: 0 0 14px; font-size: 15px; }
.now { background: #fff; border-left: 4px solid var(--blue); padding: 10px 12px; margin: 0 0 14px; font-size: 15px; }

.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); margin: 0 0 var(--gap); }
.panel-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line2); }
.panel-h .sp { flex: 1; }
.panel-b { padding: 12px 14px; }
.panel-b > :last-child { margin-bottom: 0; }
.link-btn { background: none; border: 0; color: var(--blue); padding: 4px 6px; font-size: 14px; cursor: pointer; text-decoration: underline; white-space: nowrap; }

/* ---------- 버튼 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px; border: 1px solid var(--line); background: #fff; border-radius: var(--r); cursor: pointer; font-size: 15px; text-decoration: none; color: var(--text); white-space: nowrap; }
.btn:hover { background: var(--bg); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-p { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-p:hover { background: #22465f; }
.btn-w { width: 100%; }
.btn-sm { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.btn-danger { color: var(--warn); border-color: #e7b4ae; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-desc { font-size: 14px; color: var(--sub); margin: 6px 0 0; }

/* ---------- 입력 ---------- */
.form { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 12px; align-items: start; }
.form > label { padding-top: 10px; font-size: 15px; color: var(--sub); }
.form .full { grid-column: 1 / -1; }
.in, .ta, .sel { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.ta { min-height: 88px; resize: vertical; line-height: 1.5; }
.in:focus, .ta:focus, .sel:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 2px #cfe0ec; }
.hint { font-size: 13.5px; color: var(--sub); margin-top: 4px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline .in { width: auto; flex: 1 1 120px; }
.unit { font-size: 14px; color: var(--sub); white-space: nowrap; }
.nums { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.nums label { display: block; font-size: 13.5px; color: var(--sub); margin-bottom: 3px; }
.chk { display: flex; flex-wrap: wrap; gap: 8px; }
.chk label { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; cursor: pointer; font-size: 15px; }
.chk label.on { border-color: var(--navy); background: #eaf0f5; }
.chk input { width: 18px; height: 18px; margin: 0; }

.datefield { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; min-width: 190px; padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; cursor: pointer; white-space: nowrap; }
.datefield .ph { color: #98a2ab; }

/* ---------- 등급 단추 ---------- */
.grades { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.grades button { min-height: 44px; padding: 4px 2px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; cursor: pointer; font-size: 15px; white-space: nowrap; }
.grades button.on { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 700; }
.grades button:disabled { cursor: default; }
.g { font-weight: 700; white-space: nowrap; }
.g-우수 { color: var(--g-우수); } .g-양호 { color: var(--g-양호); } .g-보통 { color: var(--g-보통); }
.g-미흡 { color: var(--g-미흡); } .g-불량 { color: var(--g-불량); } .g-해당없음 { color: var(--g-해당없음); }

/* ---------- 목록 ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-top: 1px solid var(--line2); }
.list > li:first-child { border-top: 0; }
.row-link { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 14px; color: var(--text); text-decoration: none; }
.row-link:hover { background: #f8fafb; }
/* 직원 목록: 이름·상태 + 단추 줄. 폰에선 단추가 아래 줄, 넓은 화면에선 오른쪽 같은 자리(단추 시작선 일치) */
.urow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 0; }
.urow-h { flex: 1 1 240px; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.urow-h b { font-size: 17px; }
.urow > .btn-row { flex: 0 0 236px; }
.row-no { font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; }
.row-main b { display: block; font-size: 16px; }
.row-main span { font-size: 14px; color: var(--sub); }
.row-side { text-align: right; font-size: 14px; color: var(--sub); white-space: nowrap; font-variant-numeric: tabular-nums; }
.prog { display: block; height: 4px; background: var(--line2); margin-top: 6px; }
.prog i { display: block; height: 4px; background: var(--blue); }

.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th, .tbl td { border: 1px solid var(--line); padding: 7px 8px; vertical-align: middle; }
.tbl th { background: var(--bg); font-weight: 600; text-align: center; color: var(--text); }
.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td.c { text-align: center; }
.tbl .in, .tbl .sel { min-height: 38px; padding: 6px 8px; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- 점검 항목 ---------- */
.item { border-top: 1px solid var(--line2); }
.item:first-child { border-top: 0; }
.item-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.item-row .cam { margin-right: 12px; min-width: 56px; }
.cam-big { min-height: 52px; font-size: 16px; padding: 8px 20px; }
.pick-list { display: grid; gap: 6px; }
.pick-list .pick { justify-content: flex-start; text-align: left; white-space: normal; min-height: 52px; line-height: 1.45; }
.pick-list .pick b { color: var(--blue); margin-right: 4px; }
.sec-cam { border-bottom: 1px solid var(--line2); padding-bottom: 12px; margin-bottom: 12px; }
.sec-photo { border-top: 1px solid var(--line2); margin-top: 14px; padding-top: 4px; }
.inbox-h { font-size: 15px; margin: 12px 0 0; color: var(--warn); }
.item-h { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px 14px; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; }
.item-h:hover { background: #f8fafb; }
.item-no { font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; padding-top: 1px; }
.item-name { font-size: 16px; }
.item-meta { display: block; font-size: 13.5px; color: var(--sub); margin-top: 2px; }
.item-state { text-align: right; font-size: 14px; white-space: nowrap; padding-top: 2px; }
.item-b { padding: 0 14px 16px 64px; }
.sub-h { display: flex; align-items: baseline; gap: 8px; margin: 16px 0 8px; }
.sub-h h4 { margin: 0; font-size: 15px; color: var(--navy); }
.sub-h .sp { flex: 1; }
.crit { background: var(--bg); border: 1px solid var(--line2); padding: 8px 10px; font-size: 14px; }
.crit dt { font-weight: 700; margin-top: 6px; }
.crit dt:first-child { margin-top: 0; }
.crit dd { margin: 2px 0 0 0; }
.crit dd::before { content: "· "; }

.loc { border: 1px solid var(--line); border-radius: var(--r); padding: 10px; margin: 0 0 8px; background: #fff; }
.loc-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.loc-h b { color: var(--blue); font-variant-numeric: tabular-nums; }
.loc-h .sp { flex: 1; }
.loc .in, .loc .ta { margin-bottom: 8px; }
.loc .ta { min-height: 64px; }
.auto-note { font-size: 14px; color: var(--sub); margin: 4px 0 0; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin: 8px 0 0; }
.ph { position: relative; border: 1px solid var(--line); background: #fff; }
.ph img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--line2); cursor: zoom-in; }
.ph .cap { font-size: 12.5px; padding: 3px 5px; color: var(--sub); min-height: 22px; }
.ph .tag { position: absolute; left: 0; top: 0; background: var(--navy); color: #fff; font-size: 12px; padding: 1px 6px; }
.ph .wait { position: absolute; right: 0; top: 0; background: #fff; color: var(--warn); font-size: 12px; padding: 1px 6px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.add-ph { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.file-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.score-tbl th { white-space: nowrap; }
.score-tbl tr.mh th { text-align: left; background: #eaf0f5; font-weight: 700; white-space: normal; }
.score-tbl td.num { white-space: nowrap; }
.warnbox { border: 1px solid #e7b4ae; background: var(--warn-bg); color: var(--warn); padding: 10px 12px; border-radius: var(--r); font-size: 14.5px; margin: 10px 0 0; }
.warnbox ul { margin: 4px 0 0 18px; padding: 0; }
.okbox { border: 1px solid #b8d6c4; background: #f0f7f3; color: var(--ok); padding: 10px 12px; border-radius: var(--r); font-size: 14.5px; margin: 10px 0 0; }

.secnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #fff; border-top: 1px solid var(--line); }
.secnav-in { max-width: var(--w); margin: 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; padding: 8px 14px calc(8px + env(safe-area-inset-bottom)); align-items: center; }
.secnav-in .mid { text-align: center; font-size: 14px; color: var(--sub); white-space: nowrap; }

/* ---------- 겹창(잠금·확대·달력·피드백) ---------- */
.backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(16, 28, 38, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.dlg { background: #fff; border-radius: var(--r); width: min(520px, 100%); max-height: 90vh; overflow: auto; padding: 18px; }
.dlg h2 { margin-bottom: 10px; }
.dlg .btn-row { justify-content: flex-end; margin-top: 14px; }
.busy-steps { list-style: none; margin: 10px 0; padding: 0; font-size: 15px; }
.busy-steps li { padding: 4px 0 4px 26px; position: relative; color: var(--sub); }
.busy-steps li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 10px; height: 10px; border: 2px solid var(--line); }
.busy-steps li.done { color: var(--text); }
.busy-steps li.done::before { background: var(--blue); border-color: var(--blue); }
.busy-steps li.cur { color: var(--navy); font-weight: 700; }
.busy-steps li.cur::before { border-color: var(--navy); }
.busy-meta { font-size: 14px; color: var(--sub); }
.zoom img { max-width: 100%; max-height: 72vh; display: block; margin: 0 auto; }

.dp { background: #fff; border-radius: var(--r); width: min(360px, 100%); padding: 14px; }
.dp-head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; margin-bottom: 8px; }
.dp-head strong { text-align: center; font-size: 18px; }
.dp-nav { height: 40px; border: 1px solid var(--line); background: #fff; border-radius: var(--r); cursor: pointer; font-size: 16px; }
.dp-dow, .dp-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.dp-dow span { text-align: center; font-size: 14px; font-weight: 700; color: var(--sub); padding: 4px 0; }
.dp-grid { gap: 2px; }
.dp-cell { height: 40px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: var(--r); font-size: 15px; font-variant-numeric: tabular-nums; }
.dp-cell:hover { background: var(--bg); }
.dp-cell.empty { cursor: default; }
.sun { color: #c0392b; } .sat { color: #1f5fa8; }
.dp-cell.today { box-shadow: inset 0 0 0 2px #7fa3bf; }
.dp-cell.sel { background: var(--navy); color: #fff; }
.dp-foot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }

.login { max-width: 420px; margin: 8vh auto 0; padding: 0 16px; }
.login .panel-b { padding: 20px; }
.login h1 { font-size: 22px; margin-bottom: 4px; }
.login .in { margin: 6px 0 14px; font-size: 18px; }
.err { color: var(--warn); font-size: 15px; min-height: 22px; margin: 0 0 8px; }

.note-list { margin: 0; padding-left: 18px; }
.note-list li { margin: 4px 0; }
.changelog h3 { margin: 18px 0 6px; font-size: 16px; }
.changelog .kind { font-weight: 700; margin-right: 4px; }
.changelog .k-신규 { color: var(--ok); } .changelog .k-개선 { color: var(--blue); } .changelog .k-수정 { color: var(--warn); }

@media (max-width: 640px) {
  .form { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .form > label { padding-top: 8px; }
  .item-b { padding: 0 12px 14px; }
  .grades { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wrap { padding: 10px 10px 90px; }
  .panel-h, .panel-b { padding-left: 12px; padding-right: 12px; }
  .row-link { padding: 12px; }
  .sync { display: none; }
  .top-patch { display: none; }
  .form > .lab { padding-top: 8px; }
  .brand { font-size: 16px; }
  .sync-m { display: block !important; }
}
.sync-m { display: none; font-size: 13.5px; color: var(--sub); margin: -4px 0 10px; }
.sync-m.bad { color: var(--warn); }
@media print { .top, .secnav { display: none; } }

/* 업로드 줄(화면 맨 위, 늘 보임) */
.upbar { border-top: 1px solid #2c4b61; }
.upbar-in { max-width: var(--w); margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 6px 14px; min-height: 44px; }
.upbar #upText { flex: 1; font-size: 14.5px; line-height: 1.4; }
.upbar.done { background: #eef6f1; color: var(--ok); }
.upbar.todo { background: #fff4e5; color: #8a4b00; }
.upbar.busy { background: #eaf0f5; color: var(--navy); }
.upbar .upbar-err { color: var(--warn); }
.upbar .btn { flex: none; }
.busy-now { font-weight: 700; color: var(--navy); min-height: 22px; margin: 4px 0; }
/* 고정 */
.form > .lab { padding-top: 10px; font-size: 15px; color: var(--sub); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pin { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--sub); border: 1px solid var(--line); border-radius: var(--r); padding: 1px 6px; cursor: pointer; background: #fff; }
.pin.on { color: var(--navy); border-color: var(--navy); background: #eaf0f5; font-weight: 700; }
.pin input { width: 14px; height: 14px; margin: 0; }
.pin-row { margin: 8px 0; }
.pin-row .inline .in { flex: 1 1 160px; }
