/* SMPMC 인사카드 조회 — 휴대폰 전용.
   바탕은 흰색, 구분은 색이 아니라 선으로 한다. 붉은색은 브랜드 레드 한 값만 쓴다.
   입력칸 글자는 16px — 그보다 작으면 아이폰이 칸을 누를 때 화면을 확대한다. */
:root {
  --brand: #a5122a;
  --brand-weak: #fbf2f4;
  --brand-line: #e6c6cc;
  --ink: #17191d;
  --ink-2: #474d57;
  --ink-3: #767d88;
  --ink-4: #a3a3a8;
  --line: #e2e5ea;
  --line-2: #cbd0d8;
  --info: #1a4fbf;
  --sans: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Pretendard Variable', Pretendard, monospace;
  --pad: 16px;
  --top-h: 52px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: #fff; color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.55; letter-spacing: -.013em;
  -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
b { font-weight: 700; }
i { font-style: normal; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); }
.boot { padding: 80px var(--pad); text-align: center; color: var(--ink-3); }

/* 휴대폰 화면이 기준이다. 넓은 화면에서는 가운데 한 줄로만 놓는다 */
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; }

.logo { font-size: 19px; letter-spacing: -.015em; color: var(--brand); white-space: nowrap; }
.logo .l-h { font-weight: 800; }
.logo .l-l { font-weight: 400; }

/* ── 머리줄 ─────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 10; height: var(--top-h);
  display: flex; align-items: center; gap: 10px; padding: 0 var(--pad);
  background: #fff; border-bottom: 1px solid var(--line-2);
}
.top-title { font-size: 16px; font-weight: 700; flex: 1; white-space: nowrap; }
.top-title.center { text-align: center; }
.top .link { border: 0; background: none; padding: 10px 0 10px 10px; font-size: 14px; color: var(--ink-3); }
.top .back { border: 0; background: none; padding: 10px 10px 10px 0; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 2px; min-width: 64px; }
.top .pos { min-width: 64px; text-align: right; font-size: 13.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chev { font-size: 22px; line-height: 1; font-weight: 400; margin-top: -3px; }

.page { padding: 14px var(--pad) calc(28px + env(safe-area-inset-bottom)); }

/* ── 처음 설정 · 로그인 ─────────────────────────────────── */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px var(--pad) 48px; }
.auth { display: flex; flex-direction: column; gap: 14px; }
.auth-head { margin-bottom: 10px; }
.auth-head .logo { font-size: 22px; }
.auth-head h1 { margin: 6px 0 0; font-size: 26px; font-weight: 800; letter-spacing: -.035em; }
.auth-head .sub { margin: 2px 0 0; font-size: 14px; color: var(--ink-3); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
input, select {
  width: 100%; min-height: 48px; padding: 10px 12px; font-size: 16px;
  border: 1px solid var(--line-2); border-radius: 3px; background: #fff; appearance: none; -webkit-appearance: none;
}
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-weak); }
.btn { min-height: 50px; padding: 0 18px; border: 1px solid var(--line-2); border-radius: 3px; background: #fff; font-size: 16px; font-weight: 600; }
.btn.primary { border-color: var(--brand); background: var(--brand); color: #fff; font-weight: 700; margin-top: 4px; }
.btn:disabled { opacity: .55; }
.msg { margin: 0; min-height: 21px; font-size: 14px; color: var(--brand); font-weight: 600; }
/* 다른 문으로 가는 단추(로그인 ↔ 처음 설정) — 주 단추 아래에 글자로만 */
.swap { min-height: 44px; border: 0; background: none; padding: 0; font-size: 14.5px; font-weight: 600; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; }

/* ── 목록 ───────────────────────────────────────────────── */
.sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line-2); border-radius: 3px; margin-bottom: 12px; }
.sum > div { padding: 10px 10px 9px; min-width: 0; }
.sum > div + div { border-left: 1px solid var(--line); }
.sum small { display: block; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.sum b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.03em; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sum b i { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-left: 2px; letter-spacing: 0; }
.sum span { display: block; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }

.search { margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.chip { min-height: 36px; padding: 0 13px; border: 1px solid var(--line-2); border-radius: 18px; background: #fff; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.chip.on { border-color: var(--brand); background: var(--brand); color: #fff; font-weight: 700; }
.chip i { margin-left: 5px; font-size: 12px; font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chip.on i { color: #fff; opacity: .85; }
/* 아랫줄(팀 · 부서)은 윗줄에서 고른 것의 안쪽이다 — 선 하나로 가른다 */
.chips.sub { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.chips.sub .chip { min-height: 34px; padding: 0 11px; font-size: 13.5px; }
/* 경로 줄 — 「전체 › 본부 › 팀」. 화살표는 칩 사이에 끼는 글자다 */
.chips.path { align-items: center; }
.chips.path .sep { color: var(--ink-4); font-size: 16px; line-height: 1; margin: 0 -1px; }
.tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0 2px; }
.tools .count { font-size: 13px; color: var(--ink-3); }
.sort {
  width: auto; min-height: 38px; padding: 6px 30px 6px 10px; font-size: 14px; border-color: var(--line);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.500l5 5 5-5' fill='none' stroke='%23767d88' stroke-width='1.600'/%3E%3C/svg%3E") no-repeat right 10px center / 10px 7px;
}

.group { margin: 18px 0 0; padding: 0 0 7px; font-size: 14px; font-weight: 700; border-bottom: 2px solid var(--ink-2); display: flex; align-items: baseline; justify-content: space-between; }
.group { gap: 10px; }
.group .gname { white-space: nowrap; }
.group .gup { font-size: 12.5px; font-weight: 500; color: var(--ink-3); text-align: right; min-width: 0; }
.row {
  width: 100%; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: start;
  padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: #fff; text-align: left;
}
.row:active { background: var(--brand-weak); }
.photo { background: #fff; border: 1px solid var(--line-2); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .no-photo { color: var(--ink-4); font-weight: 700; }
.photo.thumb { width: 48px; height: 64px; border-radius: 2px; }
.photo.thumb .no-photo { font-size: 18px; }
.who { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.who .name { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; }
.who .name b { font-size: 16.5px; }
.who .grade { font-size: 14px; color: var(--ink-2); }
.who .duty { font-size: 11.5px; font-weight: 700; color: var(--brand); border: 1px solid var(--brand-line); border-radius: 2px; padding: 0 5px; line-height: 1.6; align-self: center; }
.who .meta { font-size: 13px; color: var(--ink-3); }
.career { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.career .seg { display: inline-block; max-width: 100%; }
.career .seg.GROUP { color: var(--info); }
.career .seg.OWN { font-weight: 700; color: var(--ink); }
.career .arrow { color: var(--ink-4); margin: 0 4px; }
.pay { text-align: right; white-space: nowrap; padding-top: 1px; }
.pay b { display: block; font-size: 16.500px; font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.pay i { font-size: 11.5px; color: var(--ink-3); }
.empty { padding: 44px 0; text-align: center; color: var(--ink-3); }
.foot { margin-top: 22px; font-size: 12px; color: var(--ink-3); line-height: 1.6; }
.foot span { display: block; }

/* ── 인사카드 ───────────────────────────────────────────── */
.sheet { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
.card { border: 1px solid var(--ink-2); background: #fff; }
.card-title { position: relative; padding: 13px 12px 11px; text-align: center; border-bottom: 2px solid var(--ink); }
.card-title b { font-size: 18px; font-weight: 800; letter-spacing: .08em; }
.card-title small { position: absolute; right: 10px; bottom: 8px; font-size: 11px; color: var(--ink-3); }
.card-top { display: grid; grid-template-columns: 102px minmax(0, 1fr); gap: 0; border-bottom: 1px solid var(--ink-2); }
/* 사진과 표 사이의 세로선은 표 쪽에 긋는다 — 사진 쪽에 그으면 표가 사진보다 길 때 선이 중간에서 끊긴다 */
.photo.face { width: 102px; height: 136px; border: 0; align-self: start; margin: 0; }
.card-top .kv { border-left: 1px solid var(--line-2); }
.photo.face .no-photo { font-size: 34px; }

.kv { margin: 0; display: grid; grid-template-columns: 82px minmax(0, 1fr); }
.kv dt, .kv dd { margin: 0; padding: 8px 10px; border-bottom: 1px solid var(--line); min-width: 0; }
.kv dt { font-size: 13px; font-weight: 600; color: var(--ink-3); border-right: 1px solid var(--line); white-space: nowrap; }
.kv dd { font-size: 15px; font-variant-numeric: tabular-nums; }
.kv dt:nth-last-of-type(1), .kv dd:nth-last-of-type(1) { border-bottom: 0; }
/* 급여 항목 이름은 길 수 있다(전환기본조정급 …) — 잘리지 않게 칸 안에서 꺾는다 */
.kv dt.sub { padding-left: 16px; font-weight: 500; font-size: 12.5px; white-space: normal; line-height: 1.35; }
.kv dd.sub { font-size: 13.5px; color: var(--ink-2); }
.card-top .kv { grid-template-columns: 52px minmax(0, 1fr); }
.card-top .kv dt, .card-top .kv dd { padding: 6px 9px; }
.kv .big { font-size: 19px; letter-spacing: -.02em; }
.kv .annual { font-size: 19px; font-family: var(--mono); color: var(--brand); letter-spacing: -.02em; }

.card section h3 {
  margin: 0; padding: 8px 10px; font-size: 13.500px; font-weight: 800; letter-spacing: .02em;
  border-top: 1px solid var(--ink-2); border-bottom: 1px solid var(--ink-2);
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.card section:first-of-type h3 { border-top: 0; }
.card-top + section h3 { border-top: 0; }
.card section h3 small { font-size: 11.5px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; text-align: right; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: grid; grid-template-columns: 86px minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.rows .when { padding: 8px 6px 8px 10px; font-size: 12.5px; color: var(--ink-3); border-right: 1px solid var(--line); font-variant-numeric: tabular-nums; line-height: 1.45; white-space: nowrap; }
.rows .what { padding: 8px 10px; min-width: 0; }
.rows .what b { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.45; }
.rows .what small { display: block; font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.none { margin: 0; padding: 10px; font-size: 13.5px; color: var(--ink-3); }
/* 가족의 나이 · 표창/징계 갈래 표시 */
.rows .what b .age { margin-left: 6px; font-size: 13px; font-weight: 400; color: var(--ink-3); }
.tag { display: inline-block; margin-right: 6px; padding: 0 5px; font-size: 11.5px; font-weight: 700; line-height: 1.6; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 2px; vertical-align: 1px; }
.tag.warn { color: var(--brand); border-color: var(--brand-line); }
/* 전화번호 — 누르면 걸린다는 것만 밑줄로 알린다. 색은 본문 그대로 */
.tel { color: inherit; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
/* 고과 — 표 머리는 가운데. 등급이 한 글자라 값도 가운데. 첫 칸 너비는 위아래 구역의 날짜 칸(86px)과 맞춘다 */
.grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.grid th, .grid td { padding: 7px 6px; text-align: center; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.grid th:first-child { width: 86px; }
.grid th + th, .grid th + td, .grid td + td { border-left: 1px solid var(--line); }
.grid thead th { font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.grid tbody th { font-size: 12.5px; font-weight: 400; color: var(--ink-3); }
.grid td { font-size: 14.5px; font-weight: 700; }
.grid td.nil { font-weight: 400; color: var(--ink-4); }
.grid tbody tr:last-child th, .grid tbody tr:last-child td { border-bottom: 0; }
.more { width: 100%; min-height: 44px; border: 0; border-top: 1px solid var(--line); background: #fff; font-size: 14px; font-weight: 600; color: var(--brand); }

.pager {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; max-width: 560px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; background: #fff; border-top: 1px solid var(--line-2);
  padding-bottom: env(safe-area-inset-bottom);
}
.pager button { min-height: 54px; border: 0; background: #fff; font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; }
.pager button + button { border-left: 1px solid var(--line); }
.pager button:disabled { color: var(--ink-4); }
