/* 바로검침 모바일 — docs/design/Login·Mobile·Review 시안 기준 */
:root {
  --ink: #1B1F1D;
  --ink-2: #3D433F;
  --ink-3: #5B625D;
  --line: #D5DAD4;
  --line-2: #E1E5E0;
  --bg: #F4F5F2;
  --bg-2: #E9ECE8;
  --bg-3: #EEF0ED;
  --pad: #E6E9E4;
  --elec: #8A4B05;
  --water: #1D5FA8;
  --warn: #B42318;
  --warn-bg: #FDECEA;
  --warn-ink: #8C1C13;
  --amber-bg: #FBF1E2;
  --amber-ink: #5C3203;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  -webkit-text-size-adjust: 100%;
}
button { font-family: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
a { color: var(--water); }
:focus-visible { outline: 2px solid var(--water); outline-offset: 1px; }
.mono { font-family: var(--mono); }

/* ---------- 로그인 ---------- */
.auth { max-width: 480px; min-height: 100dvh; margin: 0 auto; padding: 72px 24px 32px; display: flex; flex-direction: column; gap: 28px; }
.brand { display: flex; flex-direction: column; gap: 14px; }
.brand-mark { width: 56px; height: 56px; border-radius: 16px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; }
.brand-org { font-size: 14px; color: var(--ink-3); font-weight: 600; }
.brand-title { margin: 0; font-size: 30px; font-weight: 700; line-height: 1.3; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field input, .pin-input { height: 56px; border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; font: inherit; font-size: 17px; background: #fff; color: var(--ink); }
.pin-input { font-family: var(--mono); font-size: 28px; letter-spacing: 0.5em; text-align: center; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; color: var(--ink-2); }
.check input { width: 22px; height: 22px; accent-color: var(--ink); }
.btn-primary { height: 58px; border: 0; border-radius: 14px; background: var(--ink); color: #fff; font-size: 18px; font-weight: 700; width: 100%; }
.btn-primary:disabled { background: #C9CEC8; color: var(--ink-2); font-size: 17px; }
.btn-link { display: flex; align-items: center; justify-content: center; min-height: 44px; font-size: 15px; }
.note { margin-top: auto; padding: 16px; border-radius: 14px; background: #fff; border: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 6px; }
.note-title { font-size: 14px; font-weight: 700; }
.note-body { font-size: 13px; color: var(--ink-3); line-height: 1.55; }
.form-error { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn-ink); font-size: 14px; font-weight: 600; }
.who { margin: 0; font-size: 16px; color: var(--ink-2); }

/* ---------- 앱 공통 ---------- */
#app { max-width: 480px; margin: 0 auto; height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.loading, .empty { margin: auto; padding: 24px; text-align: center; color: var(--ink-3); font-size: 16px; line-height: 1.6; }
.sync { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 16px; font-size: 13px; background: var(--amber-bg); color: var(--amber-ink); font-weight: 600; }
.sync.ok { background: var(--bg-2); color: var(--ink-3); font-weight: 500; }
.sync.err { background: var(--warn-bg); color: var(--warn-ink); }
.sync button { border: 0; background: transparent; font-size: 13px; font-weight: 700; text-decoration: underline; min-height: 32px; padding: 0 4px; color: inherit; }
.topbar { display: flex; align-items: center; gap: 8px; padding: 10px; background: #fff; border-bottom: 1px solid var(--line-2); flex-shrink: 0; }
.back { height: 44px; padding: 0 10px; border: 0; background: transparent; font-size: 15px; display: flex; align-items: center; gap: 2px; }
.sq { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: center; }
.bottom { padding: 12px 16px 20px; background: #fff; border-top: 1px solid var(--line-2); flex-shrink: 0; }

/* ---------- 층별 목록 ---------- */
.list-head { padding: 20px 20px 14px; background: #fff; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }
.list-head-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.list-head h1 { margin: 0; font-size: 24px; font-weight: 700; }
.period-range { font-size: 13px; color: var(--ink-3); font-family: var(--mono); }
.progress { height: 10px; border-radius: 5px; background: var(--bg-2); overflow: hidden; }
.progress > div { height: 10px; background: var(--ink); }
.counts { display: flex; gap: 14px; font-size: 14px; color: var(--ink-2); flex-wrap: wrap; align-items: center; }
.counts b { font-family: var(--mono); }
.counts .warn { color: var(--warn); }
.counts .link { margin-left: auto; border: 0; background: transparent; font-size: 14px; font-weight: 700; color: var(--water); min-height: 32px; padding: 0; }
.floors { display: flex; gap: 8px; padding: 12px 16px; overflow-x: auto; flex-shrink: 0; }
.chip-floor { flex-shrink: 0; height: 44px; min-width: 56px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 15px; font-weight: 500; }
.chip-floor[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; font-weight: 700; }
.chip-floor span { font-size: 12px; margin-left: 4px; font-family: var(--mono); color: var(--ink-3); }
.chip-floor[aria-pressed="true"] span { color: #fff; }
.units { flex: 1; overflow-y: auto; padding: 0 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.unit-joined { padding: 10px 16px; border-radius: 12px; border: 1px dashed var(--line); font-size: 14px; color: var(--ink-3); }
.unit-joined b { font-family: var(--mono); color: var(--ink-2); }
.unit-card { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 16px; border: 1px solid var(--line-2); border-radius: 14px; background: #fff; text-align: left; }
.unit-id { display: flex; flex-direction: column; gap: 2px; min-width: 76px; }
.unit-id .ho { font-family: var(--mono); font-size: 19px; font-weight: 600; }
.unit-id .kind { font-size: 12px; color: var(--ink-3); }
.unit-vals { flex: 1; display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--ink-2); }
.unit-vals b { font-family: var(--mono); }
.unit-vals .e { color: var(--elec); }
.unit-vals .w { color: var(--water); }
.badge { font-size: 13px; font-weight: 700; border-radius: 8px; padding: 6px 10px; white-space: nowrap; }
.badge.done { background: var(--bg-2); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.skip { background: var(--amber-bg); color: var(--elec); }
.badge.todo { font-weight: 600; color: var(--ink-3); border: 1px solid var(--line); padding: 5px 10px; }

/* ---------- 세대 입력 ---------- */
.entry-title { flex: 1; text-align: center; display: flex; flex-direction: column; }
.entry-title .ho { font-family: var(--mono); font-size: 22px; font-weight: 700; line-height: 1.1; }
.entry-title .sub { font-size: 12px; color: var(--ink-3); }
.entry-body { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; overflow-y: auto; }
.tag-card { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-radius: 14px; background: var(--bg-3); font-size: 14px; color: var(--ink-2); }
.field-card { width: 100%; padding: 12px 16px; border-radius: 16px; border: 1px solid var(--line); background: #fff; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.field-card.active.e { border: 3px solid var(--elec); padding: 10px 14px; }
.field-card.active.w { border: 3px solid var(--water); padding: 10px 14px; }
.fc-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fc-row.end { align-items: flex-end; }
.fc-label { font-size: 15px; font-weight: 700; }
.fc-label.e, .fc-use.e { color: var(--elec); }
.fc-label.w, .fc-use.w { color: var(--water); }
.fc-label small { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.fc-prev { font-size: 13px; color: var(--ink-3); }
.fc-prev b { font-family: var(--mono); color: var(--ink-2); }
.fc-val { font-family: var(--mono); font-size: 34px; font-weight: 600; letter-spacing: 0.02em; line-height: 1.1; }
.fc-val.empty { color: #A9B0AA; }
.fc-usebox { font-size: 13px; color: var(--ink-3); text-align: right; }
.fc-use { font-family: var(--mono); font-size: 18px; font-weight: 700; }
.fc-last { font-size: 12px; color: var(--ink-3); }
.banner { padding: 12px 14px; border-radius: 14px; font-size: 14px; font-weight: 600; display: flex; flex-direction: column; gap: 8px; }
.banner.roll { background: var(--amber-bg); color: var(--amber-ink); }
.banner.spike { background: var(--warn-bg); color: var(--warn-ink); }
.banner.info { background: var(--bg-3); color: var(--ink-2); font-weight: 500; }
.banner-actions { display: flex; gap: 8px; }
.banner-actions button { flex: 1; height: 44px; border-radius: 10px; font-size: 15px; font-weight: 700; }
.btn-amber { border: 0; background: var(--elec); color: #fff; }
.btn-amber-ghost { border: 1px solid #C9A779; background: #fff; color: var(--amber-ink); font-weight: 600 !important; }
.status-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.status-chip { height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-2); font-size: 14px; }
.status-chip[aria-pressed="true"] { border-color: var(--elec); background: var(--elec); color: #fff; font-weight: 600; }
.memo { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-3); }
.memo input { height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: inherit; font-size: 15px; background: #fff; color: var(--ink); }
.pad { padding: 10px 10px calc(16px + env(safe-area-inset-bottom)); background: var(--pad); flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; }
.keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.key { height: 54px; border: 0; border-radius: 10px; background: #fff; font-size: 24px; font-weight: 600; font-family: var(--mono), 'IBM Plex Sans KR', sans-serif; touch-action: manipulation; }
.key.fn { background: var(--line); font-size: 16px; }
.key.fn.del { font-size: 24px; }
.next { height: 56px; border: 0; border-radius: 12px; background: var(--ink); color: #fff; font-size: 18px; font-weight: 700; }
.next:disabled { background: #6E746F; }

/* ---------- 남은 일 정리 ---------- */
.review-title { margin: 0; flex: 1; font-size: 18px; font-weight: 700; text-align: center; padding-right: 64px; }
.review-body { flex: 1; overflow-y: auto; padding: 14px 14px 20px; display: flex; flex-direction: column; gap: 18px; }
.review-body section { display: flex; flex-direction: column; gap: 8px; }
.review-body h2 { margin: 0; font-size: 15px; font-weight: 700; }
.review-body h2.warn { color: var(--warn); }
.review-body h2.skip { color: var(--elec); }
.review-body h2.todo { color: var(--ink-2); }
.rcard { background: #fff; border: 1px solid var(--line-2); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.rcard-head { display: flex; justify-content: space-between; align-items: baseline; }
.rcard-head .ho { font-family: var(--mono); font-size: 19px; font-weight: 600; }
.rcard-head .k { font-size: 13px; font-weight: 600; }
.rcard-head .k.e { color: var(--elec); }
.rcard-head .k.w { color: var(--water); }
.rcard-head .k.muted { color: var(--ink-3); font-weight: 500; }
.rcard-text { font-size: 14px; color: var(--ink-2); }
.rcard-text b { font-family: var(--mono); }
.rcard-actions { display: flex; gap: 8px; }
.rcard-actions.col { flex-direction: column; }
.rcard-actions button { flex: 1; min-height: 44px; border-radius: 10px; font-size: 15px; }
.btn-dark { border: 0; background: var(--ink); color: #fff; font-weight: 600; }
.btn-ghost { border: 1px solid var(--line); background: #fff; }
.rnote { font-size: 12px; color: var(--ink-3); }
.todo-list { background: #fff; border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; }
.todo-row { width: 100%; min-height: 52px; padding: 0 14px; border: 0; border-bottom: 1px solid var(--bg-3); background: #fff; display: flex; justify-content: space-between; align-items: center; }
.todo-row:last-child { border-bottom: 0; }
.todo-row .ho { font-family: var(--mono); font-size: 17px; font-weight: 600; }
.todo-row .what { font-size: 14px; color: var(--ink-3); }
.review-empty { font-size: 14px; color: var(--ink-3); }

/* ---------- 계량기 교체 (docs/design/MeterSwap) ---------- */
.swap { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.swap .back { text-decoration: none; color: var(--ink); }
.swap-title { padding-right: 64px; }
.swap-title .t { font-size: 17px; font-weight: 700; }
.swap-body { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.sfield { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.sfield input { height: 52px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; font-size: 17px; background: #fff; color: var(--ink); font-weight: 400; }
.sfield input.big { text-align: right; font-size: 20px; }
.scard { background: #fff; border: 1px solid var(--line-2); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.scard-title { font-size: 15px; font-weight: 700; }
.kv { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-3); }
.kv b { color: var(--ink-2); }
.photo { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px dashed #A9B0AA; border-radius: 12px; background: #FAFBF9; font-size: 14px; color: var(--ink-2); }
.ssum { background: var(--ink); color: #fff; border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.ssum .kv { color: #fff; } .ssum .kv b { color: #fff; }
.ssum hr { border: 0; height: 1px; background: #4A504C; margin: 2px 0; width: 100%; }
.ssum .total span { font-size: 15px; font-weight: 600; } .ssum .total b { font-size: 24px; }
.swap-link { align-self: flex-start; min-height: 44px; display: inline-flex; align-items: center; font-size: 14px; font-weight: 600; }

/* ---------- 검침 마감 (docs/design/Submit) ---------- */
.big-count { display: flex; align-items: baseline; gap: 8px; }
.big-count .mono { font-size: 34px; font-weight: 700; }
.big-count span:last-child { font-size: 15px; color: var(--ink-3); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; }
.tiles div { background: var(--bg-3); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.tiles b { font-size: 20px; } .tiles span { font-size: 12px; color: var(--ink-3); }
.sumline { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; font-size: 14px; color: var(--ink-2); }
.sumline span:last-child { text-align: right; } .sumline small { font-size: 12px; color: var(--ink-3); }
.sumline .e { color: var(--elec); font-size: 17px; } .sumline .w { color: var(--water); font-size: 17px; }
.ok-banner { background: #E8F3EA; color: #1E5B2E; flex-direction: row; align-items: center; }
.agree { align-items: flex-start; font-size: 14px; line-height: 1.5; }
.agree input { flex-shrink: 0; margin-top: 2px; }
.empty b { color: var(--ink); font-size: 18px; }
