/* =====================================================================
   styles.css · v.2 (2026-10-22)
   v.2 qa S3: 안내 화면 아래 이준호 줄(.guard-foot)
   v.1 처음 작성 (시안 v4 기준: 바탕 #F6F5F2, 흰 카드, 강조색 #0F5F5B)
   - 390px 휴대폰 기준, 가로 스크롤 없음, 버튼·입력칸 높이 44px 이상
   - 글꼴은 내려받지 않고 휴대폰에 있는 한글 글꼴 사용
     (안드로이드 기본 Noto Sans CJK KR = Noto Sans KR 과 같은 모양, 아이폰 Apple SD Gothic Neo)
   ===================================================================== */

:root {
  --bg: #F6F5F2;
  --card: #FFFFFF;
  --line: #E4E2DC;
  --line2: #D6D3CC;
  --soft: #F1EFEA;
  --ink: #1B1F24;
  --ink2: #3F444B;
  --muted: #5B6068;
  --accent: #0F5F5B;
  --accent-soft: #EEF4F3;
  --accent-soft2: #DFF0EE;
  --hot: #9A3412;
  --hot-bg: #FDEBDD;
  --t: #1F4E8C;
  --t-bg: #E3ECF8;
  --w: #7A3E12;
  --w-bg: #F6E9DC;
  --off: #8A8E95;
  --danger: #B42318;
  --r: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Noto Sans KR', 'Noto Sans CJK KR', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden; /* 화면 안의 main 만 스크롤 */
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }

/* ---------- 틀 ---------- */
#app {
  height: 100dvh;
  height: 100vh;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding-top: var(--safe-t);
}
@supports (height: 100dvh) { #app { height: 100dvh; } }
.boot { margin: auto; color: var(--muted); font-weight: 700; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.top {
  padding: 16px 16px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
.top h1 { margin: 0; font-size: 22px; font-weight: 700; }
.top-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.office { font-size: 13px; min-height: 1em; }
.scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px 20px;
}
.stack { display: flex; flex-direction: column; gap: 10px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.actionbar { padding: 8px 16px; background: var(--bg); flex-shrink: 0; }

/* 하단 이준호 */
.junho {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--card);
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.junho-l { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 44px; padding: 0 16px; border-radius: 22px;
  text-decoration: none; font-weight: 500; white-space: nowrap;
}
.pill-btn.fill { background: var(--accent); color: #fff; }
.pill-btn.line { border: 1px solid var(--accent); color: var(--accent); background: #fff; }

/* 아래 탭 */
.tabs {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--card); border-top: 1px solid var(--line);
  padding: 4px 0 calc(6px + var(--safe-b));
  flex-shrink: 0;
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 52px; padding: 6px 0; border: 0; background: none;
  color: var(--muted); font-size: 12px; cursor: pointer;
}
.tab.on { color: var(--accent); font-weight: 700; }

.top-banner:empty { display: none; }
.install {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; background: var(--accent-soft); color: var(--ink2); font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.install.bad { background: var(--hot-bg); color: #7C2D12; }

/* ---------- 글자 ---------- */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.small-t { font-size: 13px; }
.b { font-weight: 700; }
.b5 { font-weight: 500; }
.n { font-weight: 400; }
.h2 { font-size: 20px; font-weight: 700; }
.big-t { font-size: 16px; }
.center { text-align: center; }
.pad { padding: 16px; }
.accent { color: var(--accent); }
.warn-text { color: var(--hot); }
.err { color: var(--danger); font-size: 14px; }
.err:empty { display: none; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grow { flex: 1; min-width: 0; }
.col { display: flex; flex-direction: column; }
.minw0 { min-width: 0; }
.sec { font-size: 13px; font-weight: 700; color: var(--ink2); margin-top: 4px; }
.memo { white-space: pre-wrap; word-break: break-word; font-size: 14px; color: var(--ink2); line-height: 1.6; }
.ico { display: inline-flex; flex-shrink: 0; }
.ico.accent { color: var(--accent); }

/* ---------- 칸·버튼 ---------- */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid2.full { width: 100%; }
.field-s { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.field-s select, .sel {
  height: 44px; border-radius: 12px; border: 1px solid var(--line2); background: #fff;
  font-size: 15px; color: var(--ink); padding: 0 8px; width: 100%; min-width: 0;
}
.searchbox {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px;
  border-radius: 12px; background: var(--soft); color: var(--muted);
}
.searchbox input { border: 0; background: transparent; font-size: 15px; flex: 1; min-width: 0; outline: none; color: var(--ink); height: 44px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 44px; min-height: 44px; padding: 0 14px; border-radius: 22px;
  border: 1px solid var(--line2); background: #fff; font-size: 14px; cursor: pointer;
}
.chip.sm { font-size: 13px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid transparent;
  font-size: 15px; font-weight: 500; cursor: pointer; text-decoration: none; text-align: center;
}
.btn.big { min-height: 52px; font-size: 17px; font-weight: 700; border-radius: 14px; width: 100%; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:disabled { background: #CFCCC5; color: var(--ink2); cursor: not-allowed; }
.btn.line { background: #fff; border-color: var(--line2); color: var(--ink); }
.btn.line:disabled { color: var(--off); background: var(--soft); }
.btn.soft { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-line { background: transparent; border-color: var(--line2); color: var(--danger); margin-top: 8px; }
.btn-s {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 10px;
  border-radius: 10px; border: 1px solid var(--line2); background: #fff; color: var(--ink2);
  font-size: 13px; cursor: pointer; white-space: nowrap;
}
.btn-s.strong { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.btn-s:disabled { opacity: .5; }
.head-btns { display: flex; gap: 6px; }
.icon-btn { min-width: 44px; min-height: 44px; border: 0; background: none; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; }
.icon-btn:disabled { opacity: .3; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; border: 0; background: none; color: var(--ink2); font-size: 14px; padding: 0; cursor: pointer; align-self: flex-start; }
.link { color: var(--accent); font-weight: 700; white-space: nowrap; }

.inp {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line2);
  background: #fff; font-size: 16px; /* 16px 미만이면 아이폰이 확대함 */
}
.inp.area { padding: 12px 14px; min-height: 84px; resize: vertical; line-height: 1.5; }
.inp.area.tall { min-height: 160px; }
.inp.date { width: 148px; min-height: 44px; padding: 0 8px; font-size: 15px; flex-shrink: 0; }
.inp:disabled { background: var(--soft); color: var(--off); border-color: var(--line); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.choice {
  min-height: 48px; border-radius: 12px; border: 1px solid var(--line2); background: #fff;
  font-size: 15px; cursor: pointer;
}
.grid3.small .choice { min-height: 44px; font-size: 13px; border-radius: 10px; }
.choice.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }
.chk { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); flex-shrink: 0; }
.consent { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.5; cursor: pointer; min-height: 44px; padding-top: 4px; }
.pick { display: flex; align-items: center; gap: 10px; min-height: 48px; cursor: pointer; }
.pick.card { align-items: flex-start; }

/* ---------- 카드 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.card.small-card { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.card.strong-border, .card.lead { border: 2px solid var(--accent); }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.card-title.nomargin { margin: 0; }
.notice {
  display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--ink2);
  line-height: 1.55; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft);
}
.notice .ico { color: var(--accent); margin-top: 2px; }
.banner {
  display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 1.5;
  padding: 10px 12px; border-radius: 12px; text-align: left; width: 100%;
}
.banner.warn { background: var(--hot-bg); color: #7C2D12; border: 0; }
.banner.ok { background: var(--accent-soft2); color: var(--accent); }
.banner.as-btn { cursor: pointer; min-height: 44px; }
.row-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* 실거래 줄 */
.trade {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.trade-l { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.trade-r { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; max-width: 55%; }
.name { font-size: 16px; font-weight: 700; }
.price { font-size: 16px; font-weight: 700; white-space: nowrap; }
.kind { font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 6px; flex-shrink: 0; }
.k-t { color: var(--t); background: var(--t-bg); }
.k-j { color: var(--accent); background: var(--accent-soft2); }
.k-w { color: var(--w); background: var(--w-bg); }
.k-o { color: var(--ink2); background: var(--soft); }
.badge { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.badge.high { color: var(--hot); background: var(--hot-bg); }
.badge.first { color: var(--muted); background: var(--soft); font-weight: 500; }
.suggest { display: flex; flex-direction: column; gap: 4px; }
.suggest:empty { display: none; }
.suggest-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: left; cursor: pointer; }
.suggest-item .name { font-size: 14px; }
.sentinel { height: 1px; }

/* 고객 목록 */
.cust {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; text-align: left; cursor: pointer; min-height: 60px;
}
.cust-l { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.tag { font-size: 12px; color: var(--ink2); background: var(--soft); padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.tag.on { color: #fff; background: var(--accent); font-weight: 700; }
.hscroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.soon {
  flex-shrink: 0; width: 150px; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; text-align: left; cursor: pointer;
}
.dday { font-size: 12px; font-weight: 700; color: var(--muted); min-width: 40px; text-align: right; }
.soon .dday { text-align: left; }
.dday.hot { color: var(--hot); }
.dday.past { color: var(--off); font-weight: 400; }

/* 고객 상세 */
.h-name { font-size: 22px; font-weight: 700; }
.tel { font-size: 16px; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.step { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; }
.step.empty { color: var(--muted); }
.dot {
  width: 24px; height: 24px; border-radius: 12px; flex-shrink: 0; display: inline-flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 700; background: var(--accent); color: #fff;
}
.dot.past, .step.empty .dot { background: #EFEDE8; color: var(--off); }
.kv { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 6px 10px; font-size: 14px; background: var(--bg); border-radius: 10px; padding: 12px; word-break: break-word; }
.kv.plain { background: none; padding: 0; grid-template-columns: 72px minmax(0, 1fr); }
.step-edit { display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.step-edit.off .dot { background: #EFEDE8; color: var(--off); }
.step-edit.off .b5 { color: var(--off); }
.form .card .field { font-weight: 400; }

/* 접수 현황 */
.tile { background: var(--soft); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile-v { font-size: 20px; font-weight: 700; }
.pill { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 8px; white-space: nowrap; flex-shrink: 0; }
.pill.s0 { background: var(--soft); color: var(--ink2); }
.pill.s1 { background: var(--t-bg); color: var(--t); }
.pill.s2 { background: var(--accent-soft2); color: var(--accent); }
.pill.s3 { background: var(--ink); color: #fff; }
.pill.stop { background: var(--line); color: var(--muted); }
.dchip { font-size: 12px; color: var(--ink2); background: var(--soft); padding: 3px 8px; border-radius: 6px; }
.dchip.hot { color: var(--hot); background: var(--hot-bg); font-weight: 700; }
.chips.wrap { flex-wrap: wrap; }
.bar4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.bar4 .seg { height: 6px; border-radius: 3px; background: var(--line); }
.bar4 .seg.on { background: var(--accent); }
.junho-memo { font-size: 14px; line-height: 1.5; background: var(--bg); border-radius: 10px; padding: 10px 12px; white-space: pre-wrap; word-break: break-word; }
.lead-card.tap { cursor: pointer; }

/* 보냄 */
.done { padding-top: 32px; }
.big-check { width: 64px; height: 64px; border-radius: 32px; background: var(--accent-soft2); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; margin: 0 auto; }

/* 캘린더 화면 */
.num-step { display: flex; gap: 8px; font-size: 14px; color: var(--ink2); }
.ok-dot { width: 28px; height: 28px; border-radius: 14px; background: var(--accent-soft2); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.cal-prev { display: flex; gap: 8px; }
.cal-prev .bar { width: 4px; border-radius: 2px; background: var(--accent); flex-shrink: 0; }

/* 백업·가져오기 */
.tbl-wrap { border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.tbl { border-collapse: collapse; font-size: 12px; min-width: 100%; }
.tbl th { background: var(--soft); font-weight: 700; text-align: left; padding: 6px 8px; white-space: nowrap; }
.tbl td { padding: 6px 8px; white-space: nowrap; }
.map-col { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.map-col .sel { width: 140px; flex-shrink: 0; }
.map-col.off { opacity: .6; }

/* 안내 화면 (카톡·링크 없음·아이폰 설치) */
.guard { margin: auto; padding: 24px 20px; display: flex; flex-direction: column; gap: 14px; text-align: center; width: 100%; max-width: 420px; overflow-y: auto; }
.guard-icon { width: 64px; height: 64px; border-radius: 32px; background: var(--accent-soft2); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; margin: 0 auto; }
.steps-ol { text-align: left; margin: 0; padding-left: 22px; line-height: 1.8; color: var(--ink2); }

/* 알림 띠·창 */
#toast {
  /* 위쪽에 띄움 (아래 [고객 추가]·전화 버튼을 가리지 않게) */
  position: fixed; left: 50%; top: calc(12px + var(--safe-t)); transform: translateX(-50%) translateY(-20px);
  max-width: calc(100% - 32px); width: max-content; background: var(--ink); color: #fff; padding: 12px 16px;
  border-radius: 12px; font-size: 14px; line-height: 1.5; opacity: 0; pointer-events: none; transition: .2s; z-index: 50;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.modal { position: fixed; inset: 0; background: rgba(27, 31, 36, .45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 40; }
.modal-box { background: #fff; border-radius: 16px; padding: 18px; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 10px; }
.modal-title { font-size: 17px; font-weight: 700; }
.modal-body { font-size: 14px; color: var(--ink2); line-height: 1.55; }
.modal-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.modal-btns.stack { grid-template-columns: 1fr; }
.sheet-wrap { align-items: flex-end; padding: 0; }
.sheet { background: var(--bg); width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 8px 16px calc(20px + var(--safe-b)); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: -8px; background: var(--bg); padding: 4px 0; z-index: 1; }
.sheet .pick { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.stack.tight { gap: 8px; }
/* v.2 안내 화면 아래 이준호 줄 (화면 맨 아래 고정) */
.guard-foot { flex-shrink: 0; padding-bottom: var(--safe-b); background: var(--card); }
