/* ERP인테리어 — 핸드폰 세로(390px) 기준 설계 */
:root {
  /* 겹침 단계. 위로 갈수록 위에 뜬다. 새 층은 여기에 이름을 붙여 넣는다.
     윗줄 < 현장 탭 줄 < 아래 탭바 < 알림 < 사진 크게 보기 < 넘어가는 줄(3px, 손가락 안 막음) */
  --z-lift: 1;          /* 줄 전체 링크(.row-go) 위로 올리는 안쪽 링크 · 단추 */
  --z-top: 15;
  --z-tabs: 20;
  --z-nav: 30;
  --z-toast: 50;
  --z-over: 200;
  --z-go: 2000;
  /* 색 토큰은 static/tokens.css 한 곳 (base.html 이 이 파일보다 먼저 읽는다) — 여기는 크기 · 간격 · 겹침 · 높이감만 */
  /* ══════ 모서리 단계 ══════
     --r-full 은 50% 가 아니라 999px — 50% 는 네모가 아닌 것에 쓰면 타원이 된다. */
  --r-1: 4px;       /* 아주 작은 이름표 */
  --r-2: 8px;       /* 작은 단추 · 작은 그림 */
  --r-3: 12px;      /* 입력칸 · 큰 단추 · 전환 버튼 · 강조 띠 */
  --r-4: 16px;      /* 카드 · 알림 · 시트 */
  --r-full: 999px;  /* 끝까지 둥글게 — 알약 · 동그라미 */

  /* ══════ 여백 단계 ══════
     4의 배수. 2px 하나만 예외. 여백에 날숫자를 쓰면 검사가 막는다.
     새 값이 필요해 보이면 십중팔구 단계를 잘못 고른 것이다. */
  --sp-hair: 2px;   /* 머리카락 — 아주 작은 틈 */
  --sp-1: 4px;      /* 붙어 있는 것들 사이 */
  --sp-2: 8px;      /* 한 덩어리 안 */
  --sp-3: 12px;     /* 줄과 줄 사이 */
  --sp-4: 16px;     /* 화면 좌우 · 단추 안쪽 */
  --sp-5: 24px;     /* 큰 틈 */
  --sp-section: 24px; /* 덩어리와 덩어리 사이 (섹션 제목 위) — PC 는 desktop.css 가 넓힌다 */
  --sp-card: 20px;  /* 카드 안쪽 — 글자가 작아진 만큼 둘레를 넉넉히 */
  --sp-row: 14px;   /* 카드 안 목록 한 줄의 위아래 */
  /* ── 글자를 담는 고정 칸 ── 글자 크기(크게)를 바꾸면 이 칸도 같이 넓어져야 한다.
     그래서 숫자를 규칙에 적지 않고 여기 이름으로 둔다 (아래 data-size="large" 가 다시 정한다). */
  --sched-tm: 44px;    /* 일정 줄의 시간 칸 폭 ('종일' · '15:30'이 들어간다) — 현장 이름을 이만큼 들여 맞춘다 */
  --cal-h: 66px;       /* 달력 한 칸 높이 (날짜 + 일정 점) */
  --badge: 18px;       /* 빨간 숫자 동그라미 */
  --chip-h: 40px;      /* 거르기 칩 · 전환 막대의 보이는 높이 (짚는 자리는 --tap) */
  --field-h: 48px;     /* 입력 칸 · 찾기 칸 · 단추 높이 */
  --btn-sm: 40px;      /* 작은 단추(.small-btn)의 보이는 높이 — 짚는 자리는 --tap (::after) */
  --sp-6: 32px;     /* 크게 띄울 때 */
  --sp-7: 48px;     /* 화면 위아래 끝 */
  /* 짚는 자리의 최소 크기 — qa/design.py 의 MIN_TAP 과 같은 값 (검사가 본다) */
  --tap: 48px;

  /* ══════ 글자 크기 — 여섯 단계 ══════
     날숫자를 쓰면 검사가 막는다. 한 역할은 어느 화면에서나 한 크기다. '글자 크게'는 단계마다 +2 (아래 data-size).
     섹션 제목(18) > 본문 · 줄 제목 · 단추(16) > 보조(14) > 작은 보조(12) — 같은 크기 안의 위계는 굵기 · 색이 세운다. */
  --t-mini: 12px;   /* 작은 보조 — 칩 · 이름표 · 아래 탭 · 알림 숫자 · 달력 칸 */
  --t-sub: 14px;    /* 보조 — 표 · 목록 둘째 줄 · 칸 이름 · 링크 */
  --t-body: 16px;   /* 본문 · 값 · 줄 제목 · 탭 · 단추 · 입력 칸 (입력 칸이 16 미만이면 아이폰이 누를 때 화면을 확대한다) */
  --t-head: 18px;   /* 섹션 제목 · 강조 금액 */
  --t-lg: 24px;     /* 화면의 큰 숫자 · 로그인 이름 */
  --t-hero: 30px;   /* 홈 매출 합계 · 빈 화면 그림 · 폴더 표시 */
  /* 줄 높이 — 높이를 가운데 맞추는 일은 flex 가 하고, 여기는 진짜 줄 높이만 */
  --lh-none: 1;     /* 글리프 한 자 (‹ › 같은 것) — 글자 상자를 딱 붙인다 */
  --lh-tight: 1.3;  /* 제목 · 큰 글자 */
  --lh-sub: 1.45;   /* 보조 글자 */
  --lh-body: 1.5;   /* 본문 */
  /* 굵기 — 두 가지. 강조(섹션 제목 · 단추 · 칸 이름 · 칩 · 고른 것 · 오류 · 숫자)는 600, 나머지(줄 제목 · 링크 포함)는 400 */
  --w-body: 400;    /* 본문 · 보조 · 줄 제목 · 링크 */
  --w-bold: 600;    /* 섹션 제목 · 단추 · 칸 이름 · 칩 · 강조하는 숫자 */
  /* 윗줄 높이 — .topbar 안 여백과 짝 (check_bars) */
  --topbar-h: 65px;
  /* 아이폰 홈 인디케이터 자리. env() 는 여기 한 곳에서만 — 검사가 이 이름을 34px 로 덮어써 본다 (check_safe) */
  --sab: env(safe-area-inset-bottom, 0px);
  /* 아랫줄 탭바가 차지하는 자리(실제 높이 62.5 + 여유). 본문 아래 여백과
     알림이 뜨는 높이가 같은 값을 봐야 한다 — 따로 적으면 한쪽만 고치게 된다. */
  --tabbar-space: 76px;

  /* ── 높이감 — 카드는 테두리 대신 둘레(--ring) + 옅은 그림자. 진한 그림자는 본문이 밑으로 지나가는 것에만 ── */
  --elev-1: 0 1px 3px var(--shadow-1);      /* 살짝 떠 있는 것 */
  --elev-2: 0 2px 8px var(--shadow-2);      /* 붙박이 줄 — 밑으로 글이 지나간다 */
  --elev-2-up: 0 -2px 8px var(--shadow-2);  /* 위와 같고, 화면 아래에 붙은 것 */
  --elev-3: 0 8px 24px var(--shadow-3);     /* 화면 위에 떠 있는 것 (알림) */
  --elev-card: 0 0 0 1px var(--ring), 0 1px 2px var(--shadow-1);  /* 카드 · 알림 묶음의 높이감 */
}


* { box-sizing: border-box; margin: 0; padding: 0; }
/* 브라우저의 '굵게'는 700 이다 — 우리 굵기 단계(--w-bold)로 맞춘다 */
h1, h2, h3, b, strong, th { font-weight: var(--w-bold); }
/* 앱을 켤 때 검은 화면이 번쩍이지 않게 html 에도 바탕색을 칠한다.
   color-scheme 은 스크롤 여백·입력칸 같은 기본 부품 색까지 맞춰 준다. */
html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  color-scheme: light;
}
body {
  /* Noto Sans KR 은 base.html 이 구글에서 받는다. 둘째 이름은 안드로이드·리눅스에 깔린 같은 글꼴,
     그 뒤는 못 받았을 때의 폰 기본 글꼴이다 */
  font-family: "Noto Sans KR", "Noto Sans CJK KR", -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--bg); color: var(--on-bg);
  font-size: var(--t-body); line-height: var(--lh-body);
  /* 한글은 낱말 단위로 줄을 넘기고('준 / 공' ✗), 띄어쓰기 없는 긴 이름(영문 파일 이름)만 칸 안에서 꺾는다.
     표 · 금액은 아래에서 되돌린다 (숫자가 꺾이지 않게) */
  word-break: keep-all; overflow-wrap: anywhere;
  /* 아랫줄 탭 바 자리 + 홈 인디케이터 자리 — 맨 아래 줄이 탭바에 가려지지 않게 */
  padding-bottom: calc(var(--tabbar-space) + var(--sab));
}
table, .won, input { overflow-wrap: normal; }
a { color: inherit; text-decoration: none; }

/* ---------- 상단 바 ---------- */
.topbar {
  position: sticky; top: 0; z-index: var(--z-top);
  background: var(--surface); border-bottom: 1px solid var(--line);
  
  box-shadow: var(--elev-2);
  display: flex; align-items: center; gap: var(--sp-2);
  /* 높이 = 짚는 자리 48 + 위아래 8 + 선 1 = --topbar-h. .ptabs 가 그 자리에 붙으므로 같아야 한다 (check_bars) */
  padding: var(--sp-2) var(--sp-4); min-height: var(--topbar-h);
}
.topbar .title { font-size: var(--t-body); font-weight: var(--w-bold); flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 뿌리 화면(로고가 나오는 화면) 제목은 폰에서 자리만 둔다 — 글자는 눈에만 안 보이고 화면 읽기 도구는 읽는다
   (visibility:hidden 이면 h1 이 읽기 도구에서도 빠진다) · PC 는 desktop.css 가 보인다 */
.topbar .title.root { color: transparent; user-select: none; }
.topbar .icon-btn {
  width: var(--tap); height: var(--tap); border-radius: var(--r-full);
  position: relative; flex-shrink: 0;
}
.topbar .icon-btn:active { background: var(--bg); }
/* 빨간 숫자 — 알림 · 결재 칸 · 할 일 탭이 같은 모양 */
.badge, .tab-badge, .tab-n.todo {
  min-width: var(--badge); height: var(--badge); padding: 0 var(--sp-1); border-radius: var(--r-full);
  background: var(--danger); color: var(--on-danger); font-size: var(--t-mini); font-weight: var(--w-bold);
  display: inline-flex; align-items: center; justify-content: center;
}
.badge { position: absolute; top: 4px; right: 2px; }

/* 뒤로 — chevron-left 아이콘, 짚는 자리 48. 왼쪽 여백만큼 밖으로 당겨 그림은 윗줄 가장자리에 맞춘다 */
.back-link { color: var(--main); flex-shrink: 0; width: var(--tap); height: var(--tap);
  margin-left: calc(var(--sp-3) * -1); border-radius: var(--r-full); display: grid; place-items: center; }

/* 왼쪽 위 로고 — 뒤로 갈 데가 없는 화면에만. 가로로 긴 글자 로고라 높이(28)로 맞추고 짚는 자리는 여백으로 */
.home-logo { display: flex; align-items: center; flex-shrink: 0; min-height: var(--tap);
  padding: var(--sp-2) var(--sp-1); margin-left: calc(var(--sp-1) * -1); }
.home-logo img { height: 28px; width: auto; display: block; }
/* 로고 그림은 밝은 화면의 주 색으로 그려져 있다 — 어두운 화면에서는 밝혀 읽히게 (서명 화면 sign.css 와 같은 값) */
:root[data-theme="dark"] .home-logo img, :root[data-theme="dark"] .nav-logo img { filter: brightness(1.7); }
.home-logo:active { opacity: .6; }

/* ---------- 하단 탭 바 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: var(--z-nav);
  background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: var(--elev-2-up);
  /* 인디케이터 자리만큼 띄운다 (--sab 하나로 — 본문 여백 · 알림 · 여기가 같이 움직인다) */
  display: flex; padding-bottom: var(--sab);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: var(--sp-2) var(--sp-hair) var(--sp-3); font-size: var(--t-mini); color: var(--on-bg-muted); gap: var(--sp-1);
  /* 아래 .tab-badge 를 이 칸 기준으로 얹는다 */
  position: relative;
}
.tabbar a.on { color: var(--main); font-weight: var(--w-bold); }
/* [결재] 칸의 '내 차례' 숫자 — 아이콘 오른쪽 위. 칸 가운데가 기준이라 칸 수가 바뀌어도 따라간다. */
.tabbar .tab-badge { position: absolute; top: 3px; left: 50%; margin-left: var(--sp-1); }

/* ---------- 공통 요소 ---------- */
.wrap { max-width: 860px; margin: 0 auto; padding: var(--sp-4) var(--sp-4) var(--sp-5); }
.card {
  background: var(--surface); border: 0; box-shadow: var(--elev-card);
  border-radius: var(--r-4); padding: var(--sp-card); margin-bottom: var(--sp-3);
}
/* 섹션에 빈 줄 하나뿐이면 카드를 그리지 않는다 — 섹션 제목 아래 보조 글 한 줄 */
.card:has(> .empty:only-child) { background: none; box-shadow: none; padding: 0; }
.card h2 { font-size: var(--t-body); margin-bottom: var(--sp-3); }
:is(.wrap, .area, .col-main, .col-side, .money-layout > *) > .sec-head { margin: var(--sp-section) var(--sp-hair) var(--sp-2); }
/* 화면 첫 내용은 위 막대에서 .wrap 위 여백만큼 아래 (qa/fit19 ①). 위 여백이 있는 첫 덩어리는 섹션 제목뿐이다(나머지는 * 초기화로 0) —
   여백 없는 감싸개(.area · .layout-2col · .more-nav · .money-layout) 안도 같다. 새 부품에 위 여백을 주면 fit19 ① 이 잡는다 */
.wrap > .sec-head:first-child, .wrap > :is(.area, .layout-2col, .more-nav):first-child > :first-child,
.wrap > .layout-2col:first-child > .col-main > :first-child, .wrap > .money-layout:first-child > .money-side > :first-child { margin-top: 0; }
.muted, .tab-n { color: var(--on-bg-muted); font-size: var(--t-sub); font-weight: var(--w-body); }
.small { font-size: var(--t-sub); }
.empty { color: var(--on-bg-muted); padding: var(--sp-2) 0; font-size: var(--t-sub); }
.empty.big { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3);
  padding: var(--sp-7) var(--sp-4); text-align: center; font-size: var(--t-body); }
.empty.big > .icon { color: var(--on-bg-faint); }

/* 단추 높이는 두 가지 — 큰 단추 --field-h(48) · 작은 단추 --btn-sm(40). 높이는 안 여백이 아니라 높이 값으로 정한다
   (테두리 · 글자 줄 높이가 달라도 같은 높이). 글꼴은 본문을 물려받는다 (button 의 브라우저 기본 글꼴을 쓰지 않는다) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; position: relative;
  min-height: var(--field-h); padding: 0 var(--sp-4); width: 100%;
  background: var(--main); color: var(--on-main); border: 0; cursor: pointer;
  font: inherit; font-size: var(--t-body); font-weight: var(--w-bold); line-height: var(--lh-tight);
  border-radius: var(--r-3);
}
.btn:active, .fab:active, .fchip.on:active { background: var(--main-press); }

.btn.small-btn { width: auto; min-width: var(--tap); min-height: var(--btn-sm); padding: 0 var(--sp-3); font-size: var(--t-sub); }
.btn.gray { background: var(--surface-alt); color: var(--on-bg); }
.btn.line { background: var(--surface); color: var(--main); border: 1.5px solid var(--main); }
.btn.danger { background: var(--surface); color: var(--danger); border: 1.5px solid var(--danger-line); }
/* 글자 단추 — 주 단추 바로 아래의 두 번째 할 일 (결의서 [수정] · 폼 [취소]). 면 · 선 없이 주 색 글자, 높이는 그대로 48 */
.btn.text { background: none; color: var(--main); }
.btn.text:active { background: var(--press); }

/* ---------- 폼 ---------- */
/* hidden 속성은 늘 이긴다 — label.field 의 display:block 이 hidden 을 덮지 않게 (app.js data-show-if) */
[hidden] { display: none !important; }
label.field, div.field, .file-field { display: block; margin-bottom: var(--sp-4); }  /* div: 라디오 묶음 */
label.field .name, div.field > .name, fieldset.field > legend.name, .file-field .name { display: block; font-size: var(--t-sub); font-weight: var(--w-bold);
  margin-bottom: var(--sp-2); color: var(--on-bg); }
/* 새 입력 종류를 쓸 때는 반드시 여기에 더한다 (빠뜨리면 그 칸만 모양이 달라진다) */
input[type=text], input[type=number], input[type=date], input[type=time], input[type=month],
input[type=password], input[type=tel], input[type=search], input[type=email],
select, textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--r-3);
  padding: var(--sp-3) var(--sp-4); font-size: var(--t-body); background: var(--surface); font-family: inherit;
  min-height: var(--tap);
  color: var(--on-bg); appearance: none; -webkit-appearance: none;
}
/* 이 사람에게 잠긴 칸 (현장 기본 정보의 계약일 · 담당 지정 — 담당 소장) — 보이기만 한다 */
label.field.is-locked input, label.field.is-locked select { background-color: var(--surface-sunken); color: var(--on-bg-muted); }
select { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' stroke='%23948b7d' stroke-width='2' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center; }
/* 고르기 칸 (ui.pick) — 찾기 칸과 고르기 칸이 한 덩어리로 보이게 맞붙인다 */
input.pick-find { border-bottom: 0; border-radius: var(--r-3) var(--r-3) 0 0; }
.pick-find + select { border-top-left-radius: 0; border-top-right-radius: 0; }
/* 복사 아이콘 단추 (ui.copy) — 짚는 자리 48. 누르면 ✓ 로 바뀐다 (app.js 가 done 을 붙인 뒤 뗀다) */
.copy { display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); flex: none;
  border: 0; border-radius: var(--r-full); background: none; color: var(--on-bg-muted); cursor: pointer; }
.copy > .icon + .icon, .copy.done > .icon:first-child { display: none; }
.copy.done > .icon + .icon { display: block; }
.copy.done { color: var(--ok); }
textarea { min-height: 90px; resize: vertical; }
textarea.tall { min-height: 150px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--main); }
/* 접는 칸 머리(summary)는 어디에 있든 짚는 자리 48 */
summary { min-height: var(--tap); display: flex; align-items: center;
  gap: var(--sp-2); cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::marker { content: ""; }
/* display:flex 로 바꾸면 브라우저가 그려 주던 ▸ 가 사라진다 — 펼치는 표시는 부품마다 따로 단다
   (ui.aux 는 chevron-down 아이콘 · 폴더 머리는 ▾ · ⓘ · ⋯ 는 아이콘 자체) */

/* 보조 줄 접기 ui.aux — 보조색 한 줄 + 오른쪽 끝 아이콘(열리면 뒤집힌다). danger 는 빨간 글자만, 테두리 · 면 없음 */
* + .aux { margin-top: var(--sp-2); }
.aux > summary { padding: 0 var(--sp-hair); font-size: var(--t-sub); color: var(--on-bg-muted); }
.aux > summary > .icon { margin-left: auto; transition: transform .15s; }
.aux[open] > summary > .icon { transform: rotate(180deg); }
.aux.danger > summary { color: var(--danger); }
.aux > .card { margin-top: var(--sp-2); }
/* 누르면 바로 차오르는 줄 (app.js) — 서버가 멀어 표시가 없으면 또 누른다. 윗줄보다 위 */
.go-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--main); z-index: var(--z-go);
  transition: width 1.1s cubic-bezier(.1, .8, .2, 1);
  pointer-events: none;      /* 이 줄이 손가락을 가로채면 안 된다 */
}

/* 파일 칸 (ui.file) — 브라우저 기본 칸은 영어(Choose Files)라서 감추고 한국어 단추를 그린다.
   고른 개수 · 칩 · 끌어올 때 모양(.drop)은 files.js 가 단다 */
.fpick { position: relative; display: flex; align-items: center; gap: var(--sp-3);
  min-height: var(--tap); padding: var(--sp-2); border: 1.5px dashed var(--line);
  border-radius: var(--r-3); background: var(--surface-sunken); cursor: pointer; }
.fpick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.fpick-btn { flex: none; display: flex; align-items: center; min-height: calc(var(--tap) - var(--sp-4));
  padding: 0 var(--sp-3); border-radius: var(--r-2); background: var(--surface);
  border: 1px solid var(--line); font-size: var(--t-sub); font-weight: var(--w-bold); color: var(--main); }
.fpick-names { min-width: 0; font-size: var(--t-sub); color: var(--on-bg-muted);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fpick.has { border-style: solid; border-color: var(--brand); }
.fpick.has .fpick-names { color: var(--on-bg); }
.fpick:focus-within, .fsearch:focus-within { border-color: var(--main); }
.file-chips { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.file-chips:not(:empty) { margin-top: var(--sp-2); }
.file-chip { display: inline-flex; align-items: center; max-width: 100%; padding-left: var(--sp-3); border-radius: var(--r-full);
  background: var(--surface-sunken); font-size: var(--t-sub); }
.file-chip > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.file-chip > button { flex: none; width: 44px; height: 36px; border: 0; background: none; color: var(--on-bg-muted); cursor: pointer; }
.file-hint { display: block; margin-top: var(--sp-1); font-size: var(--t-mini); color: var(--on-bg-muted); }
@media (hover: none) { .file-hint { display: none; } }
.drop .fpick, [data-file-drop].drop { border: 1.5px solid var(--main); background: var(--main-soft); }
.drop .fpick-names { font-size: 0; }
.drop .fpick-names::after, [data-file-drop].drop::before { content: attr(data-drop); font-size: var(--t-sub); font-weight: var(--w-bold); color: var(--on-main-soft); }

/* ---------- 목록 = 카드 하나 + 줄 사이 선 (_rows.html) ----------
   줄은 언제나 카드 안에 있다 — 줄마다 상자를 두르지 않는다 (qa/design.py row_outside_card) */
.card.list { padding: 0; overflow: clip; }
.item-row { display: block; position: relative; padding: var(--sp-row) var(--sp-card); }
.card.list > .item-row + .item-row { border-top: 1px solid var(--line); }
a.item-row:active, .item-row.has-go:active { background: var(--press); }
/* 줄 전체를 누르면 가는데 안에 다른 링크(현장 · 전화 · 복사)가 있는 줄 — 이름 링크를 줄 크기로 펴고, 안의 것은 위로.
   .row-go 를 담는 줄(.item-row · .todo-line)은 position: relative */
.item-row .row-go { color: inherit; }
.row-go::after { content: ""; position: absolute; inset: 0; }
.item-row.has-go a:not(.row-go), .item-row.has-go :is(button, label) { position: relative; z-index: var(--z-lift); }
.amt-row.has-go > .row-go { display: grid; align-content: center; min-height: var(--tap); }   /* 줄 끝 단추가 있는 금액 줄 (R.money_line action) */
/* 다른 덩어리와 섞인 카드(홈 미수금 · 급여 · 현장 정보)의 줄 — 카드 안쪽 여백에 맞추고, 첫 줄 · 끝 줄은 거기 붙는다 */
.card:not(.list) > .item-row { padding-inline: 0; }
.card:not(.list) > .item-row + .item-row { border-top: 1px solid var(--line); }
.card:not(.list) > :is(.item-row, .sched-item):first-child { padding-top: 0; }
.card:not(.list) > :is(.item-row, .sched-item):last-child { padding-bottom: 0; }
/* 오른쪽에 금액 하나 — 급여 · 미수금 · 경영 현황 내역 · 수금 지출 줄 · 폼의 실지급액 */
.amt-row { display: flex; align-items: baseline; gap: var(--sp-3); }
.amt-row > .grow { min-width: 0; }
.item-row.total { font-weight: var(--w-bold); }
/* 목록 끝 설명 한 줄 */
.list-foot { padding: var(--sp-3) var(--sp-card); border-top: 1px solid var(--line);
  color: var(--on-bg-muted); font-size: var(--t-sub); }
.card:not(.list) > .list-foot { padding-inline: 0; padding-bottom: 0; margin-top: var(--sp-3); }
/* 둘째 줄의 칸들은 가운뎃점으로 잇는다 — 템플릿에 ' · ' 를 적지 않는다 */
.row-sub > [data-col] + [data-col]::before { content: "\00b7"; margin: 0 var(--sp-1); color: var(--on-bg-muted); }
/* 목록 카드의 첫 줄 — 이름이 먼저, 상태 칩은 오른쪽 끝 (프로젝트 · AS · 결재 목록이 같다) */
.row-head { display: flex; align-items: flex-start; gap: var(--sp-2); }
.row-head > .row-title { flex: 1; min-width: 0; }
.row-head > .chip, .row-head > .ap-note, .row-head > [data-col="status"] { flex: none; }
.ap-note { margin-right: var(--sp-1); }
/* 지금 내 차례인 결의서 줄 — 왼쪽 띠 (칩 '내 차례'와 같은 색) */
a.item-row.mine { box-shadow: inset 3px 0 var(--danger); }
.row-sub.with-acts { display: flex; justify-content: space-between; }
/* 줄 제목. 목록 줄 안이든 밖이든 같은 모양이다 */
.row-title, .sched-item strong { font-weight: var(--w-body); font-size: var(--t-body); }
/* 일정 제목은 목록 · 홈에서 두 줄까지 (긴 제목이 화면을 밀어내지 않게) — 전부는 일정 상세에서 */
.sched-item strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.item-row .row-sub { color: var(--on-bg-muted); font-size: var(--t-sub); font-weight: var(--w-body); margin-top: var(--sp-1); }
.item-row .grow > .row-sub:first-child { margin-top: 0; }
.item-row .row-sub > .amt { color: var(--on-bg); }
/* 칩 — 중립 하나(분류 · 종류 · 역할) + 상태 넷(진행 중 · 끝남 · 대기 · 막힘). 색을 고르는 곳은 _rows.stage_chip ·
   _rows.as_chip · ui.ap_chip · core/leave.STATUS_CHIP 넷뿐이다 (qa/design.py chip_palette) */
.chip {
  display: inline-block; font-size: var(--t-mini); font-weight: var(--w-bold); line-height: var(--lh-sub);
  padding: var(--sp-hair) var(--sp-2); border-radius: var(--r-full); vertical-align: middle;
  background: var(--surface-alt); color: var(--on-bg-muted); white-space: nowrap;
}
.chip.on { background: var(--main-soft); color: var(--on-main-soft); }
.chip.ok { background: var(--ok-soft); color: var(--on-ok-soft); }
.chip.wait { background: var(--warn-soft); color: var(--on-warn-soft); }
.chip.risk { background: var(--danger-soft); color: var(--on-danger-soft); }
/* 분류 칩은 둘째 줄 맨 앞 — 뒤에 가운뎃점을 붙이지 않는다 */
.row-sub > .chip + [data-col]::before { content: none; }
.row-sub > .chip { margin-right: var(--sp-1); }

/* ══════ 화면 부품 — templates/_ui.html 과 짝 ══════
   목록 화면 위쪽은 탭 · 거르기 칩 · 찾기 칸 · 결과 줄 · 전환 막대로만 만든다. */
.tabs, .fbar, .sec-head { display: flex; align-items: center; margin-bottom: var(--sp-3); }
.fbar, .sec-head { gap: var(--sp-2); }
.fbar.two-row { flex-wrap: wrap; }
.fbar.two-row .fsearch { flex: 1 0 100%; }
.fbar.split, .sec-head, .fresult, .sec-more { justify-content: space-between; }

/* 탭 — 무엇을 볼지(범위). 글자는 줄 제목 크기, 고른 칸은 3px 밑줄. 칸이 넘치면 옆으로 민다 (줄이지 않는다) */
.tabs { border-bottom: 1px solid var(--line); margin-inline: calc(var(--sp-4) * -1); padding: 0 var(--sp-4);
  overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: 1 0 auto; min-width: var(--tap); min-height: var(--tap); gap: var(--sp-1); padding: 0 var(--sp-2);
  font-size: var(--t-body); color: var(--on-bg-muted);
  border-bottom: 3px solid transparent; }
.tabs a.on { color: var(--on-bg); font-weight: var(--w-bold); border-bottom-color: var(--main); }

/* 칩 · 전환 막대 = --chip-h 알약, 찾기 칸 = --field-h. 짚는 자리는 모두 48 */
.fchip, .fsearch, .switch { position: relative; display: flex; align-items: center; white-space: nowrap;
  height: var(--chip-h); border-radius: var(--r-full); font-size: var(--t-sub); }
.fchip, .fsearch { gap: var(--sp-1); padding: 0 var(--sp-3); border: 1px solid var(--line); background: var(--surface); }
.fchip { flex: none; max-width: 70%; font-weight: var(--w-bold); }
.fchip > span { overflow: hidden; text-overflow: ellipsis; }
/* 고른 칩 — 주 색 면 + '이름: 값' + ✕ (그 거르기만 푸는 링크, 고르는 칸보다 위에 떠서 따로 눌린다) */
.fchip.on { background: var(--main); border-color: transparent; color: var(--on-main); }
.fchip-x { position: relative; z-index: var(--z-lift); display: grid; place-items: center; flex: none;
  width: var(--tap); height: var(--tap); margin: 0 calc(var(--sp-3) * -1) 0 calc(var(--sp-2) * -1); border-radius: var(--r-full); }
/* 칩을 덮는 투명한 고르는 칸 — 위아래로 넘쳐 짚는 자리가 48.
   글자 크기는 본문(16) 그대로 — 그보다 작으면 아이폰이 화면을 확대한다. */
.fchip select { position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  height: var(--tap); min-height: 0; padding: 0; opacity: 0; cursor: pointer; }
.fsearch { flex: 1; min-width: 0; gap: var(--sp-2); height: var(--field-h); color: var(--on-bg-muted); }
.fsearch input[type=search] { position: relative; min-width: 0; min-height: 0; padding: 0; border: 0; background: transparent; }
/* 짚는 자리 넓히기 — 보이는 모양은 그대로, 누르는 자리만 위아래로 --tap(48px). 태그 · 은행 · 항목 종류 칩 · 홈 경고 링크 · 숫자 아래 링크(stat-go) */
.tap-wide { position: relative; }
.tap-wide::after, .btn.small-btn::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: var(--tap); transform: translateY(-50%); }
.fchip > svg, .fsearch > svg, .sec-head > a, .fresult a, .chev { flex: none; }
.fresult { display: flex; align-items: center; margin: calc(var(--sp-2) * -1) 0 var(--sp-1);
  font-size: var(--t-sub); color: var(--on-bg-muted); }

/* 전환 막대 — 눌린 칸만 흰 알약. 칸은 48 로 짚히고, 알약은 안의 span 이 그린다 (32) */
.switch { flex: none; padding: 0 var(--sp-hair); background: var(--surface-alt); }
.switch.full { margin-bottom: var(--sp-3); }
.switch a, .switch button { flex: 1; min-width: var(--tap); min-height: var(--tap); padding: 0; border: 0; background: none;
  font: inherit; color: var(--on-bg-muted); cursor: pointer; }
.switch span { flex: 1; height: calc(var(--tap) - var(--sp-4)); padding: 0 var(--sp-3); border-radius: var(--r-full); }
.switch .on, .hist-chg .new { color: var(--on-bg); font-weight: var(--w-bold); }
.switch .on span { background: var(--surface); box-shadow: var(--elev-1); }

/* 값 고르기 (ui.choice) — 고른 칸 = 켜짐 색. 주 색 면은 주 단추만 */
.choice { display: flex; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); overflow: hidden; }
.choice label { position: relative; flex: 1; }
.choice input, .toggle > input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice span { display: flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 0 var(--sp-2);
  color: var(--on-bg-muted); text-align: center; }
.choice label + label span { border-left: 1px solid var(--line); }
.choice input:checked + span { background: var(--main-soft); color: var(--on-main-soft); font-weight: var(--w-bold); box-shadow: inset 0 0 0 1.5px var(--brand); }
.choice input:focus-visible + span { outline: 2px solid var(--main); outline-offset: -2px; }
.choice.bad, .fpick.bad { border-color: var(--danger); background: var(--danger-field); }

/* 달 옮기기 ‹ 2026년 5월 › */
.fmonth { display: flex; align-items: center; font-weight: var(--w-bold); }
.fmonth a, .fmonth i { width: var(--tap); height: var(--tap); margin: 0 calc(var(--sp-2) * -1); }
.fmonth a { color: var(--main); border-radius: var(--r-full); }
.fmonth a:first-child { margin-left: calc(var(--sp-3) * -1); }

/* 가운데 맞춘 칸들 */
.tabs a, .switch a, .switch button, .switch span, .fmonth a, .sec-head > a,
.topbar .icon-btn, .hint-card > summary .ico, .folder-mark {
  display: flex; align-items: center; justify-content: center; white-space: nowrap; }

/* 새로 만들기 — 오른쪽 아래, 탭바 위에 떠 있다. 주 색 면은 이것 · 주 단추 · 고른 거르기 칩뿐.
   목록 끝 줄이 가려지지 않게 .fab-space 가 그만큼 자리를 비우고, 내리는 동안(html.fab-mini)은 [+] 만 */
.fab { position: fixed; right: var(--sp-4); bottom: calc(var(--tabbar-space) + var(--sab) + var(--sp-2));
  z-index: var(--z-nav); display: flex; align-items: center; justify-content: center; gap: var(--sp-1);
  min-width: var(--tap); min-height: var(--tap); padding: 0 var(--sp-5);
  border-radius: var(--r-full); background: var(--main); color: var(--on-main);
  font-size: var(--t-body); font-weight: var(--w-bold); box-shadow: var(--elev-3); }
html.fab-mini .fab { padding: 0; }
html.fab-mini .fab > span { display: none; }
.fab-space { height: calc(var(--tap) + var(--sp-6)); }
.danger-zone { margin-top: var(--sp-5); }

/* 작은 링크 — 제목 줄 오른쪽 · 결과 줄 [초기화] · 목록 줄 [내려받기] [고치기].
   단추로 칠하지 않는다 (줄마다 단추가 붙으면 화면이 단추로 덮인다). 짚는 자리는 48 */
.sec-head > a, .fresult a, .row-links :is(a, button) { display: flex; align-items: center;
  min-width: var(--tap); min-height: var(--tap); font-size: var(--t-sub); font-weight: var(--w-bold); color: var(--main); }
.sec-head > a { padding: 0 var(--sp-2); margin: calc(var(--sp-3) * -1) calc(var(--sp-2) * -1); }
.fresult a { justify-content: flex-end; white-space: nowrap; padding-left: var(--sp-2); }
.row-links { display: flex; gap: var(--sp-4); margin-bottom: calc(var(--sp-3) * -1); }
.row-links > form { display: contents; } .row-links button { padding: 0; border: 0; background: none; cursor: pointer; }
.pick { display: inline-flex; align-items: center; gap: var(--sp-1); min-height: var(--tap); min-width: var(--tap); }
.pick input { width: 24px; height: 24px; margin: 0; }
.pick-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-3); }   /* 목록 위 '전체 선택' 줄 (사진첩 · [지급 대기]) */

/* 제목 줄 — 제목 + 오른쪽 단추. 카드 밖(.wrap 바로 아래)이면 섹션 제목, 카드 안이면 그 카드의 이름 */
.sec-head h2 { margin: 0; min-width: 0; font-size: var(--t-body); }
:is(.wrap, .area, .col-main, .col-side, .money-layout > *) > .sec-head h2 { font-size: var(--t-head); }
/* 섹션 오른쪽 [＋ 등록] · [수정] — 면 · 테두리 없는 주 색 글자 (짚는 자리 48 은 a 가 갖는다).
   [전체보기] 는 옆길이라 보조색 — 주 색은 일을 하는 단추에만 */
.act-add > span, .act-edit > span { display: inline-flex; align-items: center; gap: var(--sp-1); color: var(--main); }
/* [수정] 은 테두리 있는 작은 단추 — 보이는 높이 32, 짚는 자리는 a 의 48 */
.act-edit > span { height: calc(var(--tap) - var(--sp-4)); padding: 0 var(--sp-3);
  border: 1.5px solid var(--main); border-radius: var(--r-full); }
.sec-head > .act-go { color: var(--on-bg-muted); }
.act-go > span::after, .plink::after { content: " ›"; }
.sec-more { display: flex; align-items: center; min-height: var(--tap);
  margin: var(--sp-2) 0 calc(var(--sp-3) * -1); border-top: 1px solid var(--line);
  font-size: var(--t-sub); color: var(--on-bg-muted); }
.sched-item + .sec-more { border-top: 0; }
/* 섹션 밖 화면 맨 위에 혼자 둔 링크 줄 (알림 → [알림 설정]) */
:is(.wrap, .area) > .sec-more { margin: 0 0 var(--sp-2); border-top: 0; }   /* 일정 줄은 제 밑줄이 있다 — 두 줄이 겹치지 않게 */
.chev { padding-left: var(--sp-2); font-size: var(--t-head); line-height: var(--lh-none);
  font-weight: var(--w-bold); color: var(--on-bg-muted); }

/* 진행 막대 */

/* ---------- 현장 안 — 위 막대 바로 아래 붙은 탭 (ui.tabs('ptabs')). 탭 위 머리(단계 · 고객 · 기간)는 project.css ---------- */
.tabs.ptabs { position: sticky; top: var(--topbar-h); z-index: var(--z-tabs); margin: 0;
  background: var(--surface); box-shadow: var(--elev-2); }   /* 윗줄보다 위 — 윗줄의 그림자가 이 줄 뒤로 들어간다 */

/* 가로로 든 폰 (높이 500 이하) — 붙박이 줄 셋(위 막대 · 현장 탭 · 아래 탭)이 글 자리를 다 먹지 않게.
   위 막대 · 현장 탭은 본문과 같이 올라가고, 아래 탭은 아이콘만 (이름은 화면 읽어 주기에 남긴다) */
@media (orientation: landscape) and (max-height: 500px) {
  :root { --tabbar-space: 48px; }
  .topbar, .tabs.ptabs { position: static; }
  .tabbar a { padding-block: var(--sp-2); }
  .tabbar .tab-lb { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

/* ---------- 사진 ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
@media (min-width: 640px) { .photo-grid { grid-template-columns: repeat(5, 1fr); } }
.photo-grid .ph { position: relative; aspect-ratio: 1; border-radius: var(--r-3);
  overflow: hidden; background: var(--surface-alt); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 공정 태그(목공·타일 등)는 **왼쪽 위**에 둔다.
   왼쪽 아래는 삭제·고치기 동그라미가 쓰고 있어서, 아래에 두면 글자가 가려진다.
   (오른쪽 위는 선택용 네모가 쓴다) */
.photo-grid .ph .tag { position: absolute; left: 4px; top: 6px; max-width: 62%;
  background: var(--scrim); color: var(--on-scrim); font-size: var(--t-mini);
  padding: var(--sp-hair) var(--sp-2); border-radius: var(--r-full);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* 선택용 네모 — 보이는 네모 28px, 짚는 자리는 감싼 칸 48px */
.ph-pick { position: absolute; top: 0; right: 0; width: var(--tap); height: var(--tap); display: grid; place-items: center; }
input[type=checkbox], input[type=radio] { accent-color: var(--main); }   /* 브라우저 기본 파랑 대신 */
.ph-pick input { width: 28px; height: 28px; margin: 0; }
.log-photos { display: flex; gap: var(--sp-2); overflow-x: auto; margin-top: var(--sp-2); }
.log-photos img { width: 84px; height: 84px; object-fit: cover;
  border-radius: var(--r-2); flex-shrink: 0; }

/* ---------- 금액 ---------- */
/* 숫자 묶음 ui.stat — 바탕 상자 없이 두 칸씩, 금액이 반 칸에 안 들어가면 한 줄 다 (min-content).
   계산 결과는 wide, 옅은 강조 면(hi)은 최종 금액 하나에만 */
.stat-grid { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-4); }
.stat { flex: 1 1 calc(50% - var(--sp-4)); min-width: min-content; display: flex; flex-direction: column; gap: var(--sp-hair); }
.stat.wide { flex-basis: 100%; }
.stat-lb, .stat-sub { font-size: var(--t-mini); color: var(--on-bg-muted); }
.stat-val { font-size: var(--t-body); font-weight: var(--w-bold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat.wide .stat-val { font-size: var(--t-head); }
.stat.hi { background: var(--main-soft); border-radius: var(--r-3); padding: var(--sp-2) var(--sp-3); }
.stat.hi .stat-val, .big-num { font-size: var(--t-lg); font-weight: var(--w-bold); }   /* 최종 금액 — 화면의 큰 숫자 하나 */
.stat .late { color: var(--danger); }
.stat-go { color: var(--main); }
.stat-go > span::after { content: " \203a"; }

/* 사진첩 · 서류함 폴더 머리 — 늘 보이는 제목 줄이라 보조 줄(aux)이 아니라 따로 둔다 */
details.folder { margin-bottom: var(--sp-4); }
details.folder > summary { align-items: baseline; padding: var(--sp-2) var(--sp-4); border-radius: var(--r-3);
  border: 1.5px solid var(--line); background: var(--surface-sunken); font-size: var(--t-body); font-weight: var(--w-bold); }
details.folder > summary .muted { margin-left: auto; }
details.folder > summary::after { content: "▾"; margin-left: var(--sp-2); color: var(--on-bg-muted); }
details.folder[open] > summary::after { content: "▴"; }

.hist-body { margin-top: var(--sp-3); }
.hist-row { border-left: 3px solid var(--line); padding: var(--sp-2) 0 var(--sp-2) var(--sp-3); margin-bottom: var(--sp-2); }
.hist-chg { font-size: var(--t-sub); margin-top: var(--sp-hair); }
.hist-chg .old { color: var(--on-bg-muted); text-decoration: line-through; }
.hist-why { font-size: var(--t-sub); color: var(--main); margin-top: var(--sp-1); }

/* 홈 맨 위 누적 매출 — 합계 숫자 하나만 크고 굵게, 공급가액 · 부가세 · 준공은 그 아래 한 줄 */
.card.revenue { background: linear-gradient(135deg, var(--main), var(--main-grad)); border: 0; color: var(--on-main);
  padding-block: var(--sp-4); }
.card.revenue .sum { margin: var(--sp-1) 0; font-size: var(--t-hero); font-weight: var(--w-bold); line-height: var(--lh-tight); }
.card.revenue .parts { display: flex; flex-wrap: wrap; column-gap: var(--sp-3); font-size: var(--t-mini); }
.card.revenue .lb, .card.revenue .parts, .card.revenue .sub { opacity: .85; }
.card.revenue .lb, .card.revenue .sub { font-size: var(--t-mini); }
/* 매출에서 빠진 현장 알림 — 옆에 붙지만 색이 달라 눈에 걸린다 */
.card.revenue .warn { display: inline-block; font-size: var(--t-mini); padding: var(--sp-hair) var(--sp-2);
  border-radius: var(--r-full); background: var(--scrim-faint); margin: var(--sp-1) var(--sp-2) 0 0; }

/* 고를 것이 많을 때는 옆으로 미는 대신 줄바꿈해서 다 보여준다.
   항목 관리처럼 종류가 8개면, 옆으로 밀어야 보이는 것은 있는 줄도 모른다. */
/* 사진 크게 보기 (갤러리) — static/app.js 의 2번 덩어리와 짝 */
.gal { position: fixed; inset: 0; z-index: var(--z-over); display: none;
  align-items: center; justify-content: center; background: var(--scrim-strong); }
.gal.on { display: flex; }
.gal img { max-width: 100%; max-height: 82vh; object-fit: contain; }
.gal button { position: absolute; border: 0; background: var(--scrim-light);
  color: var(--on-scrim); border-radius: var(--r-full); cursor: pointer; }
.gal .gal-x { top: 14px; right: 14px; width: 42px; height: 42px;
  font-size: var(--t-body); font-weight: var(--w-bold); }
/* 좌우 버튼은 엄지가 닿는 자리에 크게 — 장갑 낀 손으로도 눌러야 한다 */
/* 가운데 맞추기는 translateY(-50%) — 높이를 몰라도 늘 가운데다.
   크게 보기는 눌러야 뜨는 덧창이라 사진 비교에 안 잡힌다. */
.gal .gal-p, .gal .gal-n { top: 50%; transform: translateY(-50%); width: 52px; height: 52px;
  font-size: var(--t-hero); font-weight: var(--w-bold);
  display: grid; place-items: center; }
.gal .gal-p { left: 8px; }
.gal .gal-n { right: 8px; }
/* 사진 설명도 인디케이터 위로 올린다 — 사진은 화면 끝까지 덮으므로 */
.gal .gal-cap { position: absolute; bottom: calc(18px + var(--sab));
  left: 0; right: 0; text-align: center;
  color: var(--on-scrim); font-size: var(--t-sub); letter-spacing: .02em; }

/* 서류함·게시판·자료실에 올린 사진의 작은 미리보기.
   눌러야 사진인지 알 수 있으면 불편하다. 먼저 보여주고 고르게 한다. */
.file-thumb { display: block; max-width: 100%; max-height: 220px; width: auto;
  border-radius: var(--r-2); margin: var(--sp-2) 0; border: 1px solid var(--line); }
/* 파일 한 줄 (ui.file_row) — 종류 아이콘 · 이름/둘째 줄 · 오른쪽 [수정] · 다운로드 아이콘 */
.file-row { display: flex; align-items: center; gap: var(--sp-3); }
.file-row > .grow { flex: 1; min-width: 0; }
.file-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-2);
  background: var(--surface-sunken); color: var(--on-bg-muted); }
.file-row .row-links { margin: 0; gap: var(--sp-1); }
.file-dl { justify-content: center; color: var(--on-bg-muted); }
/* 목록(자료실 · 삭제된 자료)에서는 작은 네모 */
.file-mini { width: 56px; height: 56px; object-fit: cover; border-radius: var(--r-2);
  border: 1px solid var(--line); display: block; }
/* 작은 사진을 감싼 링크를 띄운다 (사진을 띄우면 링크 높이가 0 이 된다) */
a:has(> .file-mini) { float: left; margin: 0 var(--sp-3) var(--sp-2) 0; }
/* 자료실 묶음 한 줄 — 사진을 띄우지(float) 않고 나란히. a.album-row 로 적어 위 a:has(> .file-mini) 를 덮는다 */

a.album-row { display: flex; float: none; align-items: center; gap: var(--sp-3);
  color: inherit; text-decoration: none; }
.album-row > .file-mini { float: none; margin: 0; flex: 0 0 auto; }
.album-row .album-txt { flex: 1; min-width: 0; }
.file-row > .file-mini { width: 72px; height: 72px; }      /* 삭제된 자료 — 무엇인지 사진으로 알아보게 크게 */
.folder-mark { background: var(--main-soft); color: var(--main); }
/* :has() 를 모르는 옛 브라우저 대비 — 이때는 사진이 그냥 위에 놓인다 (겹치지 않음) */
@supports not selector(a:has(> img)) {
  .file-mini { float: left; margin: 0 var(--sp-3) var(--sp-2) 0; }
}

/* 사진 위 숨기기 · 수정 — 왼쪽 아래 (오른쪽 위는 선택 네모 자리) */

.ph .ph-hide, .ph .ph-edit { position: absolute; left: 5px; bottom: 5px; width: var(--tap); height: var(--tap);
  border: 0; border-radius: var(--r-full); background: var(--scrim-btn); color: var(--on-scrim);
  font-size: var(--t-sub); padding: 0; cursor: pointer; display: grid; place-items: center; }
/* 사진 태그 고치기 — 숨기기 옆에 */

.sched-item { display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-row) 0; border-bottom: 1px solid var(--line); }
.sched-item:last-child { border-bottom: 0; }
/* [일정] 화면의 줄 (ui.sched_row) — 누르는 곳이 둘이라 여백을 줄이 아니라 각 링크가 갖는다.
   현장 이름은 시간 칸(--sched-tm)과 틈만큼 들여 제목과 왼쪽을 맞춘다 */
.split { padding: 0; }
.sched-main { display: flex; gap: var(--sp-3); padding: var(--sp-row) 0; min-height: var(--tap); }
.sched-main:not(:last-child) { padding-bottom: 0; }
/* 현장 이름을 제목 아래에 맞춘다 — 윗줄(.sched-main)과 같은 짜임(시간 칸 + 간격)이라 값을 따로 계산하지 않는다 */
.sched-at { display: flex; gap: var(--sp-3); }
.sched-at::before { content: ""; min-width: var(--sched-tm); }
.sched-at .plink { margin: 0; padding: var(--sp-3) 0 var(--sp-row); min-height: var(--tap); }
.card > .split:first-child .sched-main { padding-top: 0; }
/* 여러 날 일정의 기간 줄 (ui.sched_span — 한 줄 차지는 d-block) — 제목 바로 아래, 주 색 */
.sched-span { font-size: var(--t-sub); color: var(--main); }
/* 누르는 줄은 글자가 한 줄뿐이어도 짚는 자리를 채운다 */
a.sched-item { min-height: var(--tap); }
/* 일정 분류 색 — 화면은 몇 번 칸인지만 말하고, 색은 여기서 고른다 */
.sched-c0 { background: var(--sched-0); }
.sched-c1 { background: var(--sched-1); }
.sched-c2 { background: var(--sched-2); }
.sched-c3 { background: var(--sched-3); }
.sched-c4 { background: var(--sched-4); }
.sched-c5 { background: var(--sched-5); }
.sched-item .bar { width: 4px; border-radius: var(--r-full); align-self: stretch;
  flex-shrink: 0; min-height: 36px; }
.sched-item .tm { font-size: var(--t-sub); color: var(--on-bg-muted); min-width: var(--sched-tm);
  padding-top: var(--sp-hair); }
/* 알림을 눌러 들어왔을 때 그 일정을 짚어 준다.
   줄을 밀지 않게 안쪽 여백으로만 칠한다 — 테두리를 두르면 아래 줄이 흔들린다. */
.sched-item.hi { background: var(--main-soft); border-radius: var(--r-3);
  padding-left: var(--sp-2); padding-right: var(--sp-2);
  margin: 0 calc(var(--sp-2) * -1); }

/* ── 키-값 줄 ui.kv — 이름 왼쪽(보조 · 고정 폭이라 값이 한 줄로 맞는다) · 값 · 오른쪽 할 일 칸(복사 · 전화).
   wide(메모 · 주소처럼 긴 글)는 이름 위 · 값 아래 두 줄. PC 는 두 칸 격자 (desktop.css) ── */
.kv-row { display: grid; grid-template-columns: 6.5em minmax(0, 1fr) auto; align-items: center; column-gap: var(--sp-2);
  padding: var(--sp-3) 0; }
.kv-list > .kv-row + .kv-row { border-top: 1px solid var(--line); }
.kv-k { font-size: var(--t-sub); color: var(--on-bg-muted); }
.kv-act { grid-column: 3; display: flex; align-items: center; gap: var(--sp-1); margin-right: calc(var(--sp-2) * -1); }
.kv-row.wide { grid-template-columns: minmax(0, 1fr) auto; }
.kv-row.wide .kv-act { grid-column: 2; grid-row: 1 / span 2; }
/* 단추 둘 나란히 = 같은 폭. 둘이 한 줄에 안 들어가면 위아래로 (각자 한 줄 다 — 그래도 같은 폭). 폼 단추가 섞여도 같다 */
.act-pair { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.act-pair .btn, .act-pair > form { flex: 1 1 9rem; gap: var(--sp-2); }
.act-pair > form { display: flex; }
/* 빈 목록 = 등록 칸 (ui.list_sec) — 점선 테두리 · 주 색 글자. 제목 옆 건수 .cnt */
.add-empty { display: flex; align-items: center; justify-content: center; gap: var(--sp-1); min-height: 52px; margin-bottom: var(--sp-3);
  border: 1.5px dashed var(--line-soft); border-radius: var(--r-4); color: var(--main); font-size: var(--t-sub); font-weight: var(--w-bold); }
.add-empty:active { background: var(--press); }
.sec-head h2 .cnt { margin-left: var(--sp-2); color: var(--on-bg-muted); font-size: var(--t-sub); font-weight: var(--w-body); }
/* 목록에서 하나 고르기 — 동그라미 20 · 줄 높이 --tap (진행 단계 · 항목 관리 단계 구분). 짧은 값 둘 · 셋은 ui.choice */
.radio-opt { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--tap); padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--line); cursor: pointer; }
.radio-opt input { width: 20px; height: 20px; margin: 0; flex: none; }
.radio-opt:has(input:checked) { font-weight: var(--w-bold); }
.radio-opt:has(input:disabled) { color: var(--on-bg-muted); cursor: default; }
/* 현장 안 탭 위 — 단계 줄과 같은 바탕에 붙인다 (ui.quick_acts) */
.act-pair.proj-acts { margin: 0; padding: var(--sp-2) var(--sp-4) var(--sp-3); background: var(--surface); }

/* ---------- 알림 토스트 ---------- */
/* 알림은 탭바보다 위에 뜬다 — 인디케이터가 있는 폰에서도 저장했다는 말이 보여야 한다. */
.flash-area { position: fixed; left: 0; right: 0; z-index: var(--z-toast);
  bottom: calc(var(--tabbar-space) + 8px + var(--sab));
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  pointer-events: none; padding: 0 var(--sp-5); }
.flash {
  background: var(--inverse); color: var(--on-inverse); font-size: var(--t-sub); font-weight: var(--w-bold);
  padding: var(--sp-3) var(--sp-5); border-radius: var(--r-full); max-width: 100%;
  /* 글자 위에 바로 얹히면 목록의 한 줄처럼 보인다. 떠 있는 것으로 보여야 한다. */
  box-shadow: var(--elev-3);
  animation: fadeout 3.2s forwards;
}
@keyframes fadeout { 0% {opacity:0; transform:translateY(8px);} 8% {opacity:1; transform:none;}
  80% {opacity:1;} 100% {opacity:0;} }

/* ── 되풀이되는 띄우기 — 이 덩어리를 옮기지 않는다 (.inline-actions 와 무게가 같아 순서가 이기는 쪽을 정한다) ── */
/* PC(desktop.css)에서만 보이는 부품 — 왼쪽 메뉴 · 표 머리줄 · 홈 요약 카드. 폰 화면은 이것이 없는 것과 같다 */
.sidenav, .dl-head, .kpi { display: none; }
.mt-2 { margin-top: var(--sp-2); }        /* 같은 덩어리 안에서 띄운다 */
.mt-3 { margin-top: var(--sp-3); }     /* 덩어리와 덩어리 사이 */
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
/* 남는 자리를 차지한다. 가로로 늘어놓은 줄에서 제일 많이 쓰던 것 */
.grow { flex: 1; }

.inline-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); flex-wrap: wrap; }
.divider { height: 1px; background: var(--line); margin: var(--sp-4) 0; }
/* 글자로 된 링크 — 현장과 업체 이름(.plink). 글자는 한 줄이지만 짚는 자리는 위아래로 넓힌다 */
.plink { display: inline-block; font-weight: var(--w-body); padding: var(--sp-4) 0; margin: calc(-1 * var(--sp-4)) 0; }
/* 전화 ui.call — 짚는 자리는 48, 보이는 옅은 강조 동그라미는 40 (안 여백 4 안쪽만 칠한다).
   위아래로 4씩 넘쳐서 줄 높이는 40 만 쓴다. 번호 글자는 옆에 따로 (ui.phone) */
.icon { flex: none; vertical-align: middle; }
.call { flex: none; display: grid; place-items: center; width: var(--tap); height: var(--tap); margin: calc(var(--sp-1) * -1);
  padding: var(--sp-1); background: var(--main-soft) content-box; border-radius: var(--r-full); color: var(--main); }
.call:active { background: var(--press) content-box; }
.with-acts { display: inline-flex; align-items: center; gap: var(--sp-2); }
/* 이름은 본문 색 그대로 두고 › 로 '갈 수 있다'를 알린다 — 주 색은 일을 하는 단추에만 쓴다 */
.plink::after { color: var(--on-bg-muted); }


/* 홈 맨 아래 관리 링크 — 폭이 좁으면 줄만 바뀌고 글자는 안 잘리게 */
/* 여러 줄로 적는 칸 — 적으신 줄바꿈을 그대로 살린다 ("1. …  2. …" 처럼 적는 칸) */
.lines { white-space: pre-wrap; word-break: break-word; }

/* 체크 한 줄 — 여러 개 고르기. 네모와 글자를 한 줄에 두고, 글자를 눌러도 체크되게 label 로 감싼다 (켬/끔은 ui.toggle) */
.check-line {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-2) 0; font-size: var(--t-sub); cursor: pointer;
  /* 네모 자체는 20px 이지만 **글자까지 눌러도 켜진다**(label 로 감싼다).
     그러니 짚는 자리는 이 줄 전체다. 그 줄이 48 이어야 한다. */
  min-height: var(--tap);
}
.check-line input[type="checkbox"] { width: 20px; height: 20px; flex: none; margin-top: var(--sp-hair); }

/* ── 알림 띠 ui.notice — 할 일(주 색 띠) · 위험(빨강 띠 + 면) · 안내(옅은 강조 면) ──
   테두리는 두르지 않는다 — 왼쪽 띠(inset 3px)와 면 색으로만 성격을 가른다.
   0건이면 아예 안 그린다 — 늘 떠 있으면 곧 안 읽게 된다. */
.notice { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--tap);
  padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-3); border-radius: var(--r-4);
  background: var(--surface); color: var(--on-bg); font-size: var(--t-body);
  box-shadow: inset 3px 0 0 var(--main), var(--elev-card); }
.notice b { color: var(--main); font-weight: var(--w-bold); }
.notice > .chev:last-child { margin-left: auto; }
div.notice { display: block; }            /* 링크가 아니면 오른쪽 › 가 없어 글을 그냥 흘린다 */
.notice p + p { margin-top: var(--sp-2); }
.notice.risk { background: var(--danger-soft); color: var(--on-danger-soft); box-shadow: inset 3px 0 0 var(--danger); }
.notice.risk b { color: inherit; }
.notice.info { background: var(--main-soft); box-shadow: none;
  font-size: var(--t-sub); font-weight: var(--w-body); line-height: var(--lh-body); }
.notice.info b { color: var(--on-main-soft); }
.notice.info h2 { font-size: var(--t-body); margin-bottom: var(--sp-2); }
/* 여러 개면 한 묶음으로 (홈 위) — 묶음이 모서리 · 그림자를 갖고, 사이에 선 */
.notice-stack { border-radius: var(--r-4); box-shadow: var(--elev-card); margin-bottom: var(--sp-3); overflow: clip; }
.notice-stack > .notice { margin: 0; border-radius: 0; box-shadow: inset 3px 0 0 var(--main); }
.notice-stack > .notice.risk { box-shadow: inset 3px 0 0 var(--danger); }
.notice-stack > .notice + .notice { border-top: 1px solid var(--line); }

/* ───────── 안내 아이콘 ⓘ ─────────
   폰에는 마우스가 없어 title= 은 아무도 못 본다. details 로 눌러서 편다.
   아껴서 둔다 — "늘 두면 시끄러운데, 모르면 돈이 틀어지는" 자리에만. */
/* 카드 제목 줄 통째로 여는 모양 — 제목 + ⓘ 한 줄이 전부 누르는 자리 (아이콘 하나만 겨누지 않게).
   ⓘ 칸은 48 자리 · 테두리 · 면 없음, 보조색이고 열리면 주 색 */
.hint-card > summary { justify-content: space-between; padding: var(--sp-hair) 0; }
.hint-card > summary .h { font-size: var(--t-body); font-weight: var(--w-bold); color: var(--on-bg); }
.hint-card > summary .ico { width: var(--tap); height: var(--tap); margin: calc(var(--sp-2) * -1); flex: none; color: var(--on-bg-muted); }
.hint-card[open] > summary .ico { color: var(--main); }

/* ⓘ 를 펴면 나오는 설명 — 제목 줄 바로 아래 */
.hint-card > .notice.info { margin: var(--sp-3) 0 var(--sp-1); }

/* ---------- 저장이 안 됐을 때 ----------
   그 폼 위에 남겨 두고, 문제가 난 칸을 빨갛게 표시한다. 사라지지 않는다. */
.form-err, .field-err { font-size: var(--t-sub); font-weight: var(--w-bold); color: var(--on-danger-soft);
  line-height: var(--lh-body); }
.form-err::before, .field-err::before { content: "！ "; font-weight: var(--w-bold); }
/* 폼 오류도 위험 알림과 같은 모양 (빨강 띠 + 면, 링크 없음) */
.form-err {
  background: var(--danger-soft); box-shadow: inset 3px 0 0 var(--danger); border-radius: var(--r-3);
  padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-3);
}
input.bad, select.bad, textarea.bad {
  border-color: var(--danger) !important; background: var(--danger-field);
}
/* 돌아왔을 때 그 폼이 어디인지 잠깐 알려준다 (앵커로 뛰어온 자리) */
@keyframes camehere {
  0% { box-shadow: 0 0 0 3px var(--danger-ring); }
  100% { box-shadow: 0 0 0 3px var(--danger-ring-off); }
}
.came-here { animation: camehere 1.6s ease-out 1; border-radius: var(--r-4); }

/* 보내는 중 (app.js 3 · data-busy) — 두 번 눌리는 것을 눈으로도 막는다 */
.btn.sending { opacity: .62; }

/* ══════ 입력 화면 부품 — ui.section · ui.form_bar · ui.money_field · ui.stepper · ui.tag_pick · ui.toggle ══════ */
.form-sec > h2 { font-size: var(--t-head); }
/* 폼 끝 [취소] [저장] — 폰은 아래 탭 바로 위에 붙어 있다 (PC 는 desktop.css 가 폼 끝 오른쪽으로) */
.form-bar { position: sticky; bottom: calc(var(--tabbar-space) + var(--sab)); z-index: var(--z-tabs);
  display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-4) calc(var(--sp-4) * -1) 0; padding: var(--sp-3) var(--sp-4);
  background: var(--surface); box-shadow: var(--elev-2-up); }
/* 한 줄 — [취소] 35% · [저장] 나머지. 단추 기본 폭(100%)을 풀어야 저장이 다음 줄로 안 내려간다 */
.form-bar > .btn { flex: 1; width: auto; }
.form-bar > .gray { flex: 0 0 35%; }
.form-bar.pin { position: fixed; left: 0; right: 0; margin: 0; }
/* 단추 앞 요약 글(급여 'N명 · 합계')은 폰에서 단추 위 한 줄 */
.form-bar > .grow { flex-basis: 100%; }
.money-in { position: relative; display: block; }
.money-in > input { padding-right: var(--sp-7); text-align: right; }
.money-in > span { position: absolute; right: var(--sp-4); top: 50%; transform: translateY(-50%); color: var(--on-bg-muted); }
.money-ko { display: block; margin-top: var(--sp-1); font-size: var(--t-sub); color: var(--on-bg-muted); text-align: right; }
.money-ko:empty { display: none; }
/* 연락처 잇기 (_contacts.html · contact_find.js) — 고객 이름 칸 아래 목록 · 불러온 줄 · 등록된 번호 알림 · 상세의 연락처 줄 */
.cf-drop { margin: calc(var(--sp-3) * -1) 0 var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-3);
  background: var(--surface); box-shadow: var(--elev-3); overflow: hidden; }
.cf-row { display: block; width: 100%; min-height: var(--tap); padding: var(--sp-3) var(--sp-4); border: 0; border-top: 1px solid var(--line);
  background: none; font: inherit; text-align: left; cursor: pointer; }
.cf-row:first-child { border-top: 0; }
.cf-row.on, .cf-row:hover { background: var(--main-soft); }
.cf-name { display: block; font-weight: var(--w-body); color: var(--on-bg); }
.cf-name b { color: var(--main); }
.cf-foot { padding: var(--sp-2) var(--sp-4); background: var(--surface-sunken); }
.cf-got, .cf-none { display: flex; align-items: center; gap: var(--sp-2); margin: calc(var(--sp-2) * -1) 0 var(--sp-4); font-size: var(--t-sub); color: var(--main); }
.cf-got > .btn { margin-left: auto; flex: none; }
.cf-hit { margin: calc(var(--sp-2) * -1) 0 var(--sp-4); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-3);
  background: var(--main-soft); font-size: var(--t-sub); }
.cf-hit .act-pair { align-items: center; margin: var(--sp-2) 0 0; }
.cf-hit .act-pair .btn { flex: none; }
.cf-link { display: flex; align-items: center; gap: var(--sp-2); padding-bottom: var(--sp-3); font-size: var(--t-sub); color: var(--main); }
.cf-none { margin: 0; padding-bottom: var(--sp-3); }
.stepper { display: flex; align-items: center; gap: var(--sp-2); }
.stepper > button { display: grid; place-items: center; width: var(--tap); height: var(--tap); flex: none; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: var(--r-full); background: var(--surface); color: var(--main); }
.stepper > input { width: calc(var(--tap) * 1.6); text-align: center; padding-inline: var(--sp-1); -moz-appearance: textfield; }
.stepper > input::-webkit-inner-spin-button { -webkit-appearance: none; }
.tag-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.tag-row:empty { display: none; }
.tag-chip { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-1); min-width: var(--tap);
  height: calc(var(--tap) - var(--sp-3)); padding: 0 var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-full);
  background: var(--surface); color: var(--on-bg); font: inherit; font-size: var(--t-sub); cursor: pointer; }
.tag-chip.on { background: var(--main-soft); border-color: var(--brand); color: var(--on-main-soft); }
/* 켜기/끄기 스위치 줄 — 보이지 않는 체크 칸이 줄 전체를 덮는다 (짚는 자리 = 줄 · 규칙은 .choice input 과 한 줄) */
.toggle { position: relative; display: flex; align-items: center; gap: var(--sp-3); min-height: var(--tap); padding: var(--sp-2) 0; cursor: pointer; }
.toggle + .toggle { border-top: 1px solid var(--line); }
.toggle > i { position: relative; flex: none; width: 46px; height: 28px; border-radius: var(--r-full); background: var(--line-soft); transition: background .15s; }
.toggle > i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: var(--r-full);
  background: var(--surface); box-shadow: var(--elev-1); transition: transform .15s; }
.toggle > input:checked + i { background: var(--main); }
.toggle > input:checked + i::after { transform: translateX(18px); }
.toggle > input:focus-visible + i { outline: 2px solid var(--main); outline-offset: 2px; }
/* 고르기 띠 (사진첩 선택 모드) — 아래 탭 바로 위 */
.select-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-space) + var(--sab)); z-index: var(--z-nav);
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-4); background: var(--surface); box-shadow: var(--elev-2-up); }
.select-bar > span { flex: 1; font-weight: var(--w-bold); }
.select-acts { display: flex; gap: var(--sp-2); }
/* 본문 머리 ui.page_sum — 요약 글 + 보조 단추 (화면 제목은 위 막대 h1 하나) */
.page-sum { display: flex; align-items: flex-end; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.ps-over, .ps-sub { font-size: var(--t-sub); color: var(--on-bg-muted); }
.ps-acts { display: flex; gap: var(--sp-2); }
.ps-acts .btn { white-space: nowrap; }
/* 문제가 난 칸 바로 아래 — 안내는 고쳐야 할 칸 옆에 있어야 눈에 같이 들어온다 */
.field-err { display: block; margin-top: var(--sp-2); }
/* 글 칸 상한 (app.js data-limit) — 칸 바로 아래 오른쪽 'N / 상한자' · 넘으면 위험색 */
.limit-note { display: block; margin-top: var(--sp-1); text-align: right; font-size: var(--t-mini); color: var(--on-bg-muted); }
.limit-note.over { color: var(--danger); font-weight: var(--w-bold); }

/* ── 누른 표시 — 서버가 멀어 누른 자리가 바로 변해야 한다. iOS 는 touch 처리기가 있어야 :active 를 그린다 (app.js) ── */
.sched-item:active,
a.notice:active,
.tabbar a:active,
.tabs a:active,
.fchip:active,
.switch a:active,
.fmonth a:active,
.fresult a:active,
.sec-head > a:active,
.sec-more:active,
.back-link:active,
.copy:active,
.fchip-x:active,
.stepper > button:active,
.tag-chip:active,
details > summary:active { background: var(--press); }

/* 되돌릴 수 없는 쪽 · 위험 알림은 눌렀을 때도 빨강을 지킨다 */
.btn.danger:active, a.notice.risk:active { background: var(--danger-press); }

/* 사진 위 단추를 눌렀을 때 — 폰에는 마우스가 없어 :hover 가 아니라 :active 다. */
.ph .ph-hide:active { background: var(--danger-press-hard); }
.ph .ph-edit:active { background: var(--scrim-press); }

/* ═══ 화면별 덩어리 ═══
   맨 아래에 둔다 — 힘이 같은 규칙끼리는 나중 것이 이긴다. */

/* ── 프로젝트 줄의 돈 줄 (_rows.project) — 부가세 칩 · 금액 · 오른쪽 끝 미수금 ── */
.item-row .row-money { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2);
  margin-top: var(--sp-2); font-variant-numeric: tabular-nums; }
.item-row .row-money > [data-col="unpaid"] { margin-left: auto; white-space: nowrap; }
.item-row .row-money > [data-col="amount"] { display: none; }   /* 금액은 PC 표의 칸 — 폰 줄은 미수금만 */
.item-row .row-money > .amt { font-size: var(--t-body); }
.item-row .row-money .done { color: var(--on-bg-muted); font-size: var(--t-mini); }
/* 공사 기간 막대 (ui.period) — 넘기면 막대 · 글자 모두 빨강 */
.pbar { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-2); font-size: var(--t-mini); }
.pbar progress { flex: 1; height: 6px; -webkit-appearance: none; appearance: none; border: 0; border-radius: var(--r-full); background: var(--track); overflow: hidden; }
.pbar progress::-webkit-progress-bar { background: var(--track); }
.pbar progress::-webkit-progress-value { background: var(--main); }
.pbar progress::-moz-progress-bar { background: var(--main); }
.pbar em { font-style: normal; font-weight: var(--w-bold); color: var(--on-main-soft); }
.pbar.late em { color: var(--danger); }
.pbar.late progress::-webkit-progress-value { background: var(--danger); }
.pbar.late progress::-moz-progress-bar { background: var(--danger); }

/* 속도 재기 화면(/speed)의 모양은 static/speed.css — 그 화면만 쓰므로 모든 화면이 받는 이 파일에 두지 않는다 */

/* 금액은 숫자 폭을 맞춘다 — fmt_money 가 모든 금액을 이 이름으로 싸서 내보낸다. */
.won, .row-sub .day { font-variant-numeric: tabular-nums; white-space: nowrap; }   /* 금액 · 날짜(파일 줄)는 한 덩어리 — 글자를 키운 폰에서 "원"이나 날짜 끝만 다음 줄로 떨어지지 않게 */

/* ── 한 줄 부품: 간격 · 글자색 · 가운데만 (글자 크기 · 굵기 · 배치는 부품의 일) ──
   부품 규칙보다 뒤에 두어 이긴다 (qa/design.py utility_lost). 없는 이름은 qa/bugs.py 가 잡는다. */
.d-block { display: block; }
.tx-center { text-align: center; }
.tx-main { color: var(--main); }
.tx-danger { color: var(--danger); }
.mt-1 { margin-top: var(--sp-1); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mb-1 { margin-bottom: var(--sp-1); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }
.ml-2 { margin-left: var(--sp-2); }
/* 바로 위 칸에 붙여 쓰는 설명 — 위 칸의 아래 여백만큼 끌어올린다 */
.pull-1 { margin-top: calc(var(--sp-1) * -1); }

/* ── 이름 있는 자리 — 화면 하나가 쓰는 작은 모양 ── */
.card.revenue a.warn { color: inherit; text-decoration: underline; }
.amt { font-weight: var(--w-bold); }
.as-name { font-size: var(--t-body); }
.row-title.sub { font-size: var(--t-sub); }
/* 안 읽은 알림 — 옅은 면 + 제목 앞 빨간 점 (_rows.notify) */
.item-row.unread { background: var(--main-soft); }
.item-row.unread .row-title::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: var(--sp-2);
  border-radius: var(--r-full); background: var(--danger); vertical-align: middle; }
input.grow, select.grow { width: auto; }
textarea.long { min-height: 160px; }
/* 현장 [기본 정보]의 미팅 · 작업일지 미리 보기 — 줄 전체가 링크 */
.peek { display: block; color: inherit; text-decoration: none; }
.peek-date { float: right; font-weight: var(--w-body); }
.row-sub.peek-text { color: var(--on-bg); }
/* 막대 — 폭(%)만 화면이 준다. 칸이 둘이면 나란히 (저장 공간 · 홈 매출 받음 % · 미수금 준공 / 진행 중) */
.meter { display: flex; height: 10px; border-radius: var(--r-full); background: var(--track); overflow: hidden; margin: var(--sp-2) 0; }
.meter > i { display: block; height: 100%; background: var(--main); }
.meter > i.c-done { background: var(--main); }
/* 막대의 칸 이름 앞 점 — 막대와 같은 색 */
.key::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: var(--r-full);
  background: var(--main); margin-right: var(--sp-2); vertical-align: middle; }
.key.c-done::before { background: var(--main); }
.meter > i.warn { background: var(--warn); }
.meter > i.bad { background: var(--danger); }
/* 카드 안 큰 숫자 하나 — 저장 공간 % · 홈 미수금 합계 */
.err-card { text-align: center; padding: var(--sp-7) var(--sp-5); }
.err-icon { color: var(--on-bg-muted); }
.err-title { font-size: var(--t-head); }

/* ---------- 확인 시트 — 이 앱에서 묻는 창은 이것 하나 (브라우저 확인 창은 서버 주소를 붙여서 쓰지 않는다) ----------
   app.js 0) 이 그린다. 단추는 단추 규칙 그대로: 할 일 주 색 · 되돌리기 어려운 일 danger · 물러서기 gray */
.ask { position: fixed; inset: 0; z-index: var(--z-over); display: flex; flex-direction: column; justify-content: flex-end; }
.ask-dim { position: absolute; inset: 0; background: var(--scrim-sheet); }
.ask-sheet { position: relative; width: 100%; max-width: 860px; margin: 0 auto; background: var(--surface);
  border-radius: var(--r-4) var(--r-4) 0 0; padding: var(--sp-2) var(--sp-4) calc(var(--sp-5) + var(--sab)); max-height: 90vh; overflow-y: auto; }
.ask-sheet::before { content: ""; display: block; width: var(--sp-6); height: var(--sp-1); border-radius: var(--r-full);
  background: var(--line); margin: 0 auto var(--sp-4); }
.ask-title { font-size: var(--t-head); font-weight: var(--w-bold); margin: 0 0 var(--sp-1); }
.ask-body { color: var(--on-bg-muted); margin: 0; }
.ask-sheet .btn { margin-top: var(--sp-2); }
.ask-sheet .ask-body + .btn, .ask-sheet .ask-title + .btn { margin-top: var(--sp-5); }
html.asking { overflow: hidden; }
/* 은행 고르기 (ui.bank_pick · form_parts.js) — 칸 모양의 고르기 단추 · 패널 안 검색 · 묶음 목록 (줄마다 짚는 자리 48) */
.bank-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: var(--tap);
  border: 1.5px solid var(--line); border-radius: var(--r-3); background: var(--surface); padding: 0 var(--sp-4);
  font: inherit; font-size: var(--t-body); color: var(--on-bg); text-align: left; }
.bank-btn.bad { border-color: var(--danger); background: var(--danger-field); }
.bank-g { color: var(--on-bg-muted); font-size: var(--t-sub); margin: var(--sp-4) 0 var(--sp-1); }
.bank-row { display: block; width: 100%; min-height: var(--tap); border: 0; border-bottom: 1px solid var(--line); background: none;
  padding: var(--sp-2) 0; font: inherit; color: var(--on-bg); text-align: left; }
.bank-row.on { font-weight: var(--w-bold); color: var(--on-main-soft); }
.bank-other { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }
.bank-other .btn { margin-top: 0; width: auto; flex: none; }

/* ══════ 글자 크기 — 크게 ══════
   <html data-size="large"> 하나만 본다 (base.html 이 그리기 전에 붙인다). 글자 단계 · 글자를 담는 칸만 +2,
   간격 · 짚는 자리 · 아이콘은 그대로. 화면 파일은 이 일을 모른다. */
:root[data-size="large"] .fbar { flex-wrap: wrap; }
/* 크게에서는 찾기 칸이 안내글('현장·고객')을 다 보일 폭을 지킨다 — 칩이 자리를 다 먹으면 찾기 칸이 다음 줄로 내려간다 */
:root[data-size="large"] .fsearch { min-width: 12em; }
:root[data-size="large"] {
  --t-mini: 14px; --t-sub: 16px; --t-body: 18px; --t-head: 20px; --t-lg: 26px; --t-hero: 32px;
  --sched-tm: 52px; --cal-h: 74px; --badge: 20px; --chip-h: 44px; --field-h: 52px; --btn-sm: 44px;
}

/* ---------- 당겨서 새로 고침 — app.js 5) 가 위치 · 회전을 정한다 ----------
   홈 화면에 깐 앱에서만 켜진다(html.ptr-on). 켜지면 브라우저 것과 아이폰의 고무줄 튀김을 끈다 — 두 번 새로 고치지 않게. */
html.ptr-on, html.ptr-on body { overscroll-behavior-y: none; }
.ptr { position: fixed; top: 0; left: 50%; z-index: var(--z-toast); pointer-events: none; opacity: 0;
  width: calc(var(--tap) - var(--sp-2)); height: calc(var(--tap) - var(--sp-2)); margin-left: calc((var(--tap) - var(--sp-2)) / -2);
  display: flex; align-items: center; justify-content: center; border-radius: var(--r-full);
  background: var(--surface); box-shadow: var(--elev-3); color: var(--on-bg-muted); }
.ptr svg { width: var(--sp-5); height: var(--sp-5); }
.ptr.armed, .ptr.spin { color: var(--main); }
.ptr.spin svg { animation: ptr-spin .8s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ptr.spin svg { animation: none; } }

/* 화면에는 안 보이고 '화면 읽어 주기'만 읽는 글 (당겨서 새로 고침의 "새로 고쳤습니다" 등) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.only-pc { display: none; }   /* PC 에만 (desktop.css 가 보인다) — .only-phone 의 짝 */
