/* ---------------------------------------------------------------------------
 * SPM 공용 스타일 — 모바일 우선
 *
 * 현장에서 장갑 낀 손으로, 밝은 야외에서 본다는 전제로 짰다.
 *   - 터치 대상 44px 이상, 본문 16px 이상
 *   - 입력 폰트는 반드시 16px. 그보다 작으면 iOS 사파리가 포커스 때 화면을 확대해
 *     레이아웃이 튀어 다음 칸을 못 누른다.
 *   - 다크 모드는 대응하지 않는다. 상태를 색으로 구분하는 화면이라 팔레트를 하나로 고정한다.
 * ------------------------------------------------------------------------- */

:root {
	--bg: #f4f6f8;
	--surface: #ffffff;
	--surface-2: #eef1f5;
	--line: #d8dee6;
	--text: #1b2430;
	--text-dim: #5b6675;

	--primary: #1f6feb;
	--primary-dark: #1a5cc4;
	--primary-soft: #e8f0fe;

	--ok: #1a7f37;
	--warn: #bf8700;
	--danger: #cf222e;

	--state-reg: #6e7781;
	--state-move: #bf8700;
	--state-work: #1f6feb;
	--state-done: #1a7f37;

	/* 배지 배경: 상태색을 흰 바탕에 10% 로 깐 값. color-mix 를 쓰면 구형
	 * 안드로이드 웹뷰에서 색이 통째로 빠지므로 계산된 값을 그대로 박아 둔다. */
	--state-reg-bg: #f1f1f2;
	--state-move-bg: #f9f3e6;
	--state-work-bg: #e9f1fd;
	--state-done-bg: #e8f2eb;
	--state-reg-line: #d6d9dc;
	--state-move-line: #edddb8;
	--state-work-line: #c0d7f9;
	--state-done-line: #bfdbc7;
	/* 10% 배경 위에 원색 글자를 얹으면 대비가 4.5:1 에 못 미친다. 글자만 더 진하게. */
	--state-reg-fg: #545c66;
	--state-move-fg: #8a6200;
	--state-work-fg: #1a5cc4;
	--state-done-fg: #14622a;

	--r-s: 6px;
	--r-m: 10px;
	--r-l: 16px;

	--sp-1: 4px;
	--sp-2: 8px;
	--sp-3: 12px;
	--sp-4: 16px;
	--sp-5: 24px;
	--sp-6: 32px;

	--font: system-ui, -apple-system, "Malgun Gothic", "맑은 고딕", sans-serif;
	--shadow-1: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
	--shadow-2: 0 4px 16px rgba(16, 24, 40, .12);

	--offline-h: 34px;
	--tabbar-h: 58px;
}

/* --- 기본 ---------------------------------------------------------------- */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.5;
	/* clip 은 hidden 과 달리 스크롤 컨테이너를 만들지 않아 position:sticky 를
	 * 망가뜨리지 않는다. 가로 밀림은 .table-wrap 이 막고, 여긴 최후의 방어선이다. */
	overflow-x: clip;
	-webkit-tap-highlight-color: transparent;
}

body.modal-open {
	overflow: hidden;
}

h1, h2, h3, h4 {
	margin: 0 0 var(--sp-2);
	line-height: 1.3;
}

h1 { font-size: 22px; }
h2 { font-size: 19px; }
h3 { font-size: 17px; }

p {
	margin: 0 0 var(--sp-2);
}

a {
	color: var(--primary);
}

img, svg {
	max-width: 100%;
}

/* 포커스 링은 어떤 경우에도 없애지 않는다. 장갑 낀 손 다음으로 흔한 입력이 키보드다. */
:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
	border-radius: var(--r-s);
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* --- 버튼 ---------------------------------------------------------------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--sp-2);
	min-height: 44px;
	padding: 0 var(--sp-4);
	border: 1px solid var(--line);
	border-radius: var(--r-m);
	background: var(--surface);
	color: var(--text);
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	user-select: none;
	transition: background-color .12s ease, box-shadow .12s ease, transform .06s ease;
}

.btn:hover {
	background: var(--surface-2);
}

.btn:active {
	transform: translateY(1px);
	background: var(--surface-2);
	box-shadow: inset 0 2px 4px rgba(16, 24, 40, .14);
}

.btn:disabled,
.btn[disabled],
.btn[aria-disabled="true"] {
	opacity: .45;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.btn-primary {
	background: var(--primary);
	border-color: var(--primary);
	color: #fff;
}

.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:active { background: var(--primary-dark); }

.btn-danger {
	background: var(--danger);
	border-color: var(--danger);
	color: #fff;
}

.btn-danger:hover,
.btn-danger:active { background: #a5121c; }

.btn-ghost {
	background: transparent;
	border-color: transparent;
	color: var(--primary);
}

.btn-ghost:hover,
.btn-ghost:active { background: var(--primary-soft); }

.btn-sm {
	min-height: 36px;
	padding: 0 var(--sp-3);
	font-size: 14px;
	border-radius: var(--r-s);
}

.btn-lg {
	min-height: 56px;
	padding: 0 var(--sp-5);
	font-size: 18px;
	font-weight: 700;
}

.btn-block {
	display: flex;
	width: 100%;
}

/* 표 안의 작은 버튼도 손가락으로는 눌려야 한다. */
@media (pointer: coarse) {
	.btn-sm { min-height: 44px; }
}

/* --- 카드 ---------------------------------------------------------------- */

.card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--r-m);
	box-shadow: var(--shadow-1);
	overflow: hidden;
}

.card + .card {
	margin-top: var(--sp-3);
}

.card-head {
	display: flex;
	align-items: center;
	gap: var(--sp-2);
	padding: var(--sp-3) var(--sp-4);
	border-bottom: 1px solid var(--line);
	font-size: 16px;
	font-weight: 700;
}

.card-body {
	padding: var(--sp-4);
}

.card-foot {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: var(--sp-2);
	padding: var(--sp-3) var(--sp-4);
	border-top: 1px solid var(--line);
	background: var(--surface-2);
}

/* --- 입력 ---------------------------------------------------------------- */

.field {
	display: block;
	margin-bottom: var(--sp-4);
	min-width: 0;
}

.field-label {
	display: block;
	margin-bottom: var(--sp-1);
	color: var(--text-dim);
	font-size: 14px;
	font-weight: 600;
}

.input,
.select,
.textarea {
	display: block;
	width: 100%;
	min-height: 44px;
	padding: 10px var(--sp-3);
	border: 1px solid var(--line);
	border-radius: var(--r-m);
	background: var(--surface);
	color: var(--text);
	font-family: inherit;
	/* 16px 미만이면 iOS 가 포커스 때 확대한다. 절대 줄이지 말 것. */
	font-size: 16px;
	line-height: 1.4;
}

.textarea {
	min-height: 88px;
	resize: vertical;
}

.select {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 36px;
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%235b6675' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right var(--sp-3) center;
}

.input:focus,
.select:focus,
.textarea:focus {
	border-color: var(--primary);
	outline: 2px solid var(--primary-soft);
	outline-offset: 0;
}

.input:disabled,
.select:disabled,
.textarea:disabled {
	background: var(--surface-2);
	color: var(--text-dim);
}

.input[aria-invalid="true"],
.select[aria-invalid="true"],
.textarea[aria-invalid="true"] {
	border-color: var(--danger);
}

.field-error {
	margin-top: var(--sp-1);
	color: var(--danger);
	font-size: 14px;
	font-weight: 600;
}

/* --- 레이아웃 ------------------------------------------------------------ */

.row {
	display: flex;
	align-items: center;
	gap: var(--sp-2);
	min-width: 0;
}

.col {
	display: flex;
	flex-direction: column;
	gap: var(--sp-2);
	min-width: 0;
}

.spread {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--sp-2);
	min-width: 0;
}

.center {
	display: flex;
	align-items: center;
	justify-content: center;
}

.wrap { flex-wrap: wrap; }

.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }

/* min-width:0 이 없으면 긴 이름 하나가 flex 칸을 밀어 가로 스크롤을 만든다. */
.grow {
	flex: 1 1 auto;
	min-width: 0;
}

/* --- 표 ------------------------------------------------------------------ */

/* 가로 스크롤은 오직 여기서만 일어난다. 표는 반드시 이 안에 넣는다. */
.table-wrap {
	overflow-x: auto;
	overflow-y: visible;
	-webkit-overflow-scrolling: touch;
	max-width: 100%;
	border: 1px solid var(--line);
	border-radius: var(--r-m);
	background: var(--surface);
	overscroll-behavior-x: contain;
}

.table {
	width: 100%;
	border-collapse: collapse;
	font-size: 15px;
}

.table th,
.table td {
	padding: 10px var(--sp-3);
	border-bottom: 1px solid var(--line);
	text-align: left;
	vertical-align: middle;
}

.table th {
	position: sticky;
	top: 0;
	z-index: 1;
	background: var(--surface-2);
	color: var(--text-dim);
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
}

/* --- 정렬 가능한 표 머리글 (docs/PLAN14.md 4장) --------------------------------
 *
 * 열 이름을 누르면 그 열로 정렬된다. **진짜 <button> 이라** 키보드로도 된다.
 * 표식(↕/▲/▼) 자리를 늘 잡아 둔다 — th 가 nowrap 이라 화살표가 생겼다
 * 없어지면 정렬할 때마다 열 폭이 튄다.
 *
 * 색만으로 알리지 않는다 — 화살표가 형태로 한 번 더 말한다(탭과 같은 원칙). */
.table th:has(.th-sort) {
	padding: 0;
}

.th-sort {
	display: inline-flex;
	align-items: center;
	gap: var(--sp-1);
	width: 100%;
	padding: 10px var(--sp-3);
	background: none;
	border: 0;
	border-radius: 0;
	font: inherit;
	color: inherit;
	text-align: left;
	cursor: pointer;
}

.th-sort:hover {
	color: var(--text);
	background: rgba(0, 0, 0, .04);
}

.th-sort:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: -2px;
}

/* 기준이 아닌 열의 표식은 흐리게. 자리는 그대로 차지한다. */
.th-mark {
	font-size: 11px;
	line-height: 1;
	color: var(--text-dim);
	opacity: .45;
}

/* 지금 정렬 기준인 열 — 글자도 함께 진해진다(색만으로 알리지 않는다). */
.table th.is-sorted {
	color: var(--text);
}

.table th.is-sorted .th-mark {
	color: var(--primary);
	opacity: 1;
}

.table tbody tr:last-child td {
	border-bottom: 0;
}

.table tbody tr:hover td {
	background: #f7f9fc;
}

.table tfoot td {
	background: var(--surface-2);
	font-weight: 700;
	border-top: 2px solid var(--line);
}

/* 숫자 칸: 오른쪽 정렬 + 자릿수 고정폭이라야 눈으로 합계를 훑을 수 있다. */
.num {
	text-align: right;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* 표 안에서도 입력칸이 44px 을 지키되 칸을 덜 먹게 */
.table .input,
.table .select {
	min-height: 40px;
	padding: 6px var(--sp-2);
}

/* --- 대기실 줄 (PC 일별현황 · 모바일 공용) -------------------------------- */
/*
 * 줄마다 **이름과 그날 요약 한 줄**을 둔다(PLAN4 요구 4 · 8장 → PLAN8 요구 2).
 *
 * 처음에는 여섯 칸(이름·시간·회차·수당·입금·수당입금)이 한 줄에 섰다. 값이 0 인
 * 사람은 칸이 비어 보여 줄마다 눈이 흔들렸고, 칸 여섯을 세우려고 화면 폭마다
 * 격자를 세 벌(휴대폰 3줄 / 태블릿 2줄 / 1600px 1줄) 들고 있어야 했다. 그래서
 * PLAN4 에서 '오늘 2시간' 만 남겼다.
 *
 * 지금은 그 자리에 **요약 한 줄**이 다시 들어간다.
 *
 *   ☑  직원01
 *      외횟:2, 근시:3.5, 수횟:2(회횟1,개횟1), 부금:20
 *   ☑  직원13  진영
 *      외횟:6, 근시:7.5, 수횟:2(회횟1,개횟1)
 *
 * **칸을 다시 세우는 것이 아니다.** 줄 하나라 0 인 값이 빈 칸으로 남지 않고,
 * 미수·부가수입은 값이 있을 때만 붙는다(shared/util.js waitingLine). 격자는
 * 여전히 한 벌이고 화면 폭마다 배치를 바꾸지 않는다.
 *
 * 요약을 **이름 아래 둘째 줄**에 둔다. 오른쪽 칸에 넣으면 35자 남짓한 글자가
 * 이름 칸을 눌러 같은 이름을 구분하지 못하고, 좁은 창에서는 줄이 잘린다.
 *
 * 자세한 뜻(외횟이 무엇인가)은 줄의 툴팁이 풀어 적고, 고치는 것은 줄을 눌러
 * 열리는 회차별 체크 시트에서 한다(daily.js openTripSheet).
 *
 *   - 이름 칸은 남는 폭(1fr)을 먹고 넘치면 말줄임한다. 지역은 이름 칸 **안에**
 *     들어간다.
 *   - 요약 줄은 체크 칸을 비켜 이름과 같은 세로선에서 시작한다. 눈이 왼쪽 한
 *     선만 따라 내려가면 되고, 숫자는 tabular-nums 라 자리가 흔들리지 않는다.
 *   - 고정 폭은 체크 26px 하나뿐이라 375px 화면에서도 요약 한 줄이 들어간다.
 */

:root {
	--wait-check: 26px;
	--wait-gap: 8px;
}

.wait-row {
	display: grid;
	align-items: center;
	gap: 2px var(--wait-gap);
	padding: var(--sp-2) var(--sp-3);
	border-bottom: 1px solid var(--line);
	min-width: 0;
	cursor: pointer;
	grid-template-columns: var(--wait-check) minmax(0, 1fr);
}

.wait-row:last-child { border-bottom: 0; }
.wait-row:hover { background: var(--surface-2); }

.wait-c-check { grid-column: 1; grid-row: 1; }
.wait-c-name  { grid-column: 2; grid-row: 1; }
/* 요약은 이름 아래 둘째 줄이다. 체크 칸을 비켜 이름과 같은 선에서 시작한다. */
.wait-c-sum   { grid-column: 2; grid-row: 2; }

/* 체크 칸은 선택 전용이다(줄을 누르면 회차 시트가 열린다 — daily.js 참고). */
.wait-c-check {
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	min-height: 24px;
}

.wait-c-check input {
	width: 18px;
	height: 18px;
	margin: 0;
}

/* 좁은 창에서 넘치면 말줄임한다. 줄바꿈하지 않는 것은 줄 높이가 사람마다 달라지면
 * 대기실 목록을 훑어 내려가는 눈이 걸리기 때문이다. 잘려도 툴팁이 다 적어 준다. */
.wait-c-sum {
	font-size: 13px;
	color: var(--text-dim);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}

.wait-c-name {
	min-width: 0;
	overflow: hidden;
}

/* 이름 칸은 시트를 여는 버튼이다. 키보드로도 닿아야 하므로 <button> 을 쓰되,
 * 클릭 처리는 줄이 맡는다(버튼에도 걸면 한 번 눌러 두 번 열린다). */
.wait-name {
	display: block;
	width: 100%;
	max-width: 100%;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}

.wait-name-main { font-weight: 700; }

.wait-name-sub {
	margin-left: var(--sp-2);
	font-size: 13px;
	color: var(--text-dim);
}

/* 옛 값 칸(회차·입금·수당입금). PC 는 더 이상 내지 않는다 — 모바일이 아직 내고
 * 있어서 격자에서 통째로 빠지면 세 값이 한 줄에 겹쳐 찍힌다. 자리를 지정하지 않고
 * 이름 칸 아래 줄로 흘려보낸다. 모바일도 같은 단순화를 마치면 이 규칙을 지운다. */
.wait-c-trip,
.wait-c-dep,
.wait-c-allow {
	grid-column: 2 / -1;
	font-size: 13px;
	color: var(--text-dim);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}

/* --- 칩 ------------------------------------------------------------------ */

.chip {
	display: inline-flex;
	align-items: center;
	gap: var(--sp-1);
	min-height: 44px;
	padding: 0 var(--sp-3);
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text);
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	user-select: none;
	transition: background-color .12s ease;
}

/* 체크 자리를 미리 비워 둔다. 선택할 때 칩 너비가 흔들리면 다음 칩을 잘못 누른다. */
.chip::before {
	content: "";
	display: inline-block;
	width: 1em;
	text-align: center;
	font-weight: 800;
}

.chip-on {
	background: var(--primary-soft);
	border-color: var(--primary);
	color: var(--primary-dark);
	font-weight: 700;
}

.chip-on::before {
	content: "✓";
}

.chip:active {
	transform: translateY(1px);
}

/* --- 상태 배지 ----------------------------------------------------------- */

.badge {
	display: inline-flex;
	align-items: center;
	min-height: 26px;
	padding: 2px var(--sp-2);
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface-2);
	color: var(--text-dim);
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
}

.badge-REGISTERED {
	background: var(--state-reg-bg);
	border-color: var(--state-reg-line);
	color: var(--state-reg-fg);
}

.badge-MOVING {
	background: var(--state-move-bg);
	border-color: var(--state-move-line);
	color: var(--state-move-fg);
}

.badge-WORKING {
	background: var(--state-work-bg);
	border-color: var(--state-work-line);
	color: var(--state-work-fg);
}

.badge-RETURNED {
	background: var(--state-done-bg);
	border-color: var(--state-done-line);
	color: var(--state-done-fg);
}

/* --- 상단 바 ------------------------------------------------------------- */

.toolbar {
	position: sticky;
	top: 0;
	z-index: 30;
	display: flex;
	align-items: center;
	gap: var(--sp-2);
	min-height: 56px;
	padding: var(--sp-2) var(--sp-3);
	padding-top: calc(var(--sp-2) + env(safe-area-inset-top, 0px));
	background: var(--surface);
	border-bottom: 1px solid var(--line);
	box-shadow: var(--shadow-1);
}

.toolbar-title {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 18px;
	font-weight: 800;
}

/* 오프라인 줄이 먼저 오면 그만큼 아래에 붙는다(둘 다 sticky 라 안 겹치게). */
.offline-bar + .toolbar {
	top: var(--offline-h);
}

/* --- 하단 탭 (모바일) ---------------------------------------------------- */

.tabbar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 40;
	display: flex;
	background: var(--surface);
	border-top: 1px solid var(--line);
	padding-bottom: env(safe-area-inset-bottom, 0px);
	box-shadow: 0 -1px 3px rgba(16, 24, 40, .08);
}

.tabbar a {
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	min-height: var(--tabbar-h);
	color: var(--text-dim);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}

.tabbar a.on {
	color: var(--primary);
	background: var(--primary-soft);
	font-weight: 800;
}

/* 탭바가 있으면 마지막 줄이 가려지지 않게 본문 아래를 비워 둔다.
 * (모바일 화면에서 따로 padding-bottom 을 또 주면 두 번 들어간다) */
body:has(.tabbar) {
	padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}

/* --- 좌측 메뉴 (PC) ------------------------------------------------------ */

.sidenav {
	position: sticky;
	top: 0;
	align-self: flex-start;
	flex: 0 0 216px;
	width: 216px;
	height: 100vh;
	height: 100dvh;
	overflow-y: auto;
	padding: var(--sp-3);
	background: var(--surface);
	border-right: 1px solid var(--line);
}

.sidenav a {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 0 var(--sp-3);
	border-radius: var(--r-s);
	color: var(--text);
	font-size: 16px;
	font-weight: 600;
	text-decoration: none;
}

.sidenav a + a {
	margin-top: 2px;
}

.sidenav a:hover {
	background: var(--surface-2);
}

.sidenav a.on {
	background: var(--primary-soft);
	color: var(--primary-dark);
	font-weight: 800;
}

/* 좁은 화면에서는 가로로 눕혀 스크롤한다. */
@media (max-width: 860px) {
	.sidenav {
		position: static;
		flex: 0 0 auto;
		width: auto;
		height: auto;
		display: flex;
		gap: var(--sp-1);
		overflow-x: auto;
		border-right: 0;
		border-bottom: 1px solid var(--line);
	}

	.sidenav a + a { margin-top: 0; }
	.sidenav a { white-space: nowrap; }
}

/* --- 비었을 때 ----------------------------------------------------------- */

.empty {
	padding: var(--sp-6) var(--sp-4);
	border: 1px dashed var(--line);
	border-radius: var(--r-m);
	background: var(--surface);
	color: var(--text-dim);
	font-size: 16px;
	text-align: center;
}

/* --- 오프라인 표시줄 ----------------------------------------------------- */

.offline-bar {
	position: sticky;
	top: 0;
	z-index: 60;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--sp-2);
	height: var(--offline-h);
	padding: 0 var(--sp-3);
	background: var(--warn);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* --- 토스트 -------------------------------------------------------------- */

.toast-wrap {
	position: fixed;
	left: 50%;
	bottom: calc(var(--tabbar-h) + var(--sp-4) + env(safe-area-inset-bottom, 0px));
	transform: translateX(-50%);
	z-index: 80;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--sp-2);
	width: min(92vw, 520px);
	pointer-events: none;
}

.toast {
	max-width: 100%;
	padding: var(--sp-3) var(--sp-4);
	border-radius: var(--r-m);
	background: #1b2430;
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	box-shadow: var(--shadow-2);
	pointer-events: auto;
	cursor: pointer;
	animation: toast-in .18s ease-out;
}

.toast-err {
	background: var(--danger);
}

.toast.is-out {
	animation: toast-out .18s ease-in forwards;
}

/* --- 모달 ---------------------------------------------------------------- */

.modal-back {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	background: rgba(16, 24, 40, .45);
	animation: fade-in .15s ease-out;
}

/* 모바일에서는 아래에서 올라오는 시트. 한 손으로 닿는 곳에 버튼이 있어야 한다. */
.modal {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 560px;
	max-height: 88vh;
	max-height: 88dvh;
	padding-bottom: env(safe-area-inset-bottom, 0px);
	border-radius: var(--r-l) var(--r-l) 0 0;
	background: var(--surface);
	box-shadow: var(--shadow-2);
	animation: sheet-up .2s cubic-bezier(.2, .8, .3, 1);
}

.modal-head {
	display: flex;
	align-items: center;
	gap: var(--sp-2);
	padding: var(--sp-3) var(--sp-4);
	border-bottom: 1px solid var(--line);
}

.modal-title {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 17px;
	font-weight: 800;
}

.modal-x {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: var(--r-m);
	background: transparent;
	color: var(--text-dim);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.modal-x:hover {
	background: var(--surface-2);
}

.modal-body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: var(--sp-4);
	overscroll-behavior: contain;
}

.modal-msg {
	margin: 0;
	font-size: 16px;
	line-height: 1.6;
	/* 줄바꿈이 든 안내문을 그대로 보여준다 */
	white-space: pre-line;
}

.modal-foot {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: var(--sp-2);
	padding: var(--sp-3) var(--sp-4);
	border-top: 1px solid var(--line);
	background: var(--surface-2);
}

@media (min-width: 600px) {
	.modal-back {
		align-items: center;
		padding: var(--sp-4);
	}

	.modal {
		border-radius: var(--r-l);
		animation: pop-in .16s ease-out;
	}
}

/* --- 진행 표시 ----------------------------------------------------------- */

.loading-back {
	position: fixed;
	inset: 0;
	z-index: 120;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(244, 246, 248, .55);
}

.spinner {
	width: 38px;
	height: 38px;
	border: 4px solid var(--line);
	border-top-color: var(--primary);
	border-radius: 50%;
	animation: spin .7s linear infinite;
}

/* --- 근무시간 스테퍼 ----------------------------------------------------- */

.stepper {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid var(--line);
	border-radius: var(--r-m);
	background: var(--surface);
	overflow: hidden;
}

.stepper-btn {
	width: 54px;
	min-height: 48px;
	border: 0;
	background: var(--surface-2);
	color: var(--text);
	font-family: inherit;
	font-size: 24px;
	font-weight: 800;
	line-height: 1;
	cursor: pointer;
}

.stepper-btn:hover {
	background: #e2e7ee;
}

.stepper-btn:active {
	background: #d9e0e9;
}

.stepper-btn:disabled {
	opacity: .35;
	cursor: not-allowed;
}

.stepper-val {
	min-width: 96px;
	min-height: 48px;
	padding: 0 var(--sp-2);
	border: 0;
	border-left: 1px solid var(--line);
	border-right: 1px solid var(--line);
	background: var(--surface);
	color: var(--text);
	font-family: inherit;
	font-size: 18px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	cursor: pointer;
}

.stepper-val:hover {
	background: var(--primary-soft);
}

/* --- 글자 ---------------------------------------------------------------- */

.muted { color: var(--text-dim); }
.small { font-size: 13px; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }

/* --- 애니메이션 ---------------------------------------------------------- */

@keyframes fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes sheet-up {
	from { transform: translateY(18px); opacity: .6; }
	to { transform: translateY(0); opacity: 1; }
}

@keyframes pop-in {
	from { transform: scale(.97); opacity: .6; }
	to { transform: scale(1); opacity: 1; }
}

@keyframes toast-in {
	from { transform: translateY(10px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

@keyframes toast-out {
	from { opacity: 1; }
	to { transform: translateY(6px); opacity: 0; }
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

/* 움직임을 줄여 달라고 한 사용자에게는 등장 효과만 끈다.
 * 스피너는 "돌고 있다"가 곧 정직원03서 없애지 않고 느리게만 돌린다. */
@media (prefers-reduced-motion: reduce) {
	.modal,
	.modal-back,
	.toast,
	.toast.is-out {
		animation: none !important;
	}

	.btn,
	.chip {
		transition: none;
	}

	.btn:active,
	.chip:active {
		transform: none;
	}

	.spinner {
		animation-duration: 2s;
	}
}

/* --- 인쇄 ---------------------------------------------------------------- */
/* 관리자가 집계표를 그대로 뽑는 일이 잦다. 조작용 요소는 빼고 표만 남긴다. */

@media print {
	@page {
		margin: 12mm;
	}

	body {
		background: #fff;
		font-size: 11pt;
		padding-bottom: 0 !important;
	}

	.toolbar,
	.tabbar,
	.sidenav,
	.offline-bar,
	.toast-wrap,
	.modal-back,
	.loading-back,
	.btn,
	.stepper,
	.no-print {
		display: none !important;
	}

	.card {
		border: 1px solid #333;
		box-shadow: none;
		break-inside: avoid;
	}

	.table-wrap {
		overflow: visible;
		border: 0;
		border-radius: 0;
	}

	.table {
		width: 100%;
		font-size: 10pt;
	}

	.table th,
	.table td {
		border: 1px solid #333;
		padding: 4px 6px;
	}

	.table th {
		position: static;
		background: #e8e8e8;
		color: #000;
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}

	.table thead {
		display: table-header-group;
	}

	.table tr {
		break-inside: avoid;
	}

	.badge {
		border: 1px solid #333;
		background: #fff;
		color: #000;
	}

	a {
		color: #000;
		text-decoration: none;
	}
}

/* --- 라디오 무리 (docs/PLAN9.md 2장) --------------------------------------
 *
 * 셋 중 하나를 고르는 자리를 펼치지 않아도 보이게 그린다. `<select>` 를 버린
 * 이유는 components.js 의 radioRow 주석에 적었다.
 *
 * 칩(.chip)과 모양을 일부러 다르게 한다. 칩은 '켜고 끄는 것' 이고 라디오는
 * '셋 중 하나' 다 — 같은 모양이면 셋을 다 켤 수 있다고 읽는다. 그래서 둥근
 * 알약이 아니라 네모난 칸에 진짜 동그라미를 둔다.
 *
 * 손가락으로 누르는 자리라 라벨 전체가 눌린다(input 만 누르게 하면 조준이 어렵다).
 * 최소 높이는 다른 누르는 것들과 같은 44px 다.
 */

.radio-row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--sp-2);
	min-width: 0;
}

.radio-item {
	display: inline-flex;
	align-items: center;
	gap: var(--sp-2);
	min-height: 44px;
	padding: 0 var(--sp-3);
	border: 1px solid var(--line);
	border-radius: var(--r-m);
	background: var(--surface);
	color: var(--text);
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	user-select: none;
	white-space: nowrap;
}

.radio-item:hover { background: var(--surface-2); }

.radio-item input {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--primary);
	cursor: pointer;
	flex: 0 0 auto;
}

/* 골라진 칸만 칠한다. :has 를 못 읽는 브라우저에서도 동그라미로 알 수 있으므로
 * 색은 거들 뿐이다 — 색만 보고 판단하게 만들지 않는다. */
.radio-item:has(input:checked) {
	background: var(--primary-soft);
	border-color: var(--primary);
	color: var(--primary-dark);
	font-weight: 700;
}

/* 키보드로 옮겨 다닐 때 어디에 있는지 보여야 한다. 전역 :focus-visible 이
 * input 자체에 걸리는데, 동그라미가 작아 테두리가 눈에 잘 안 띈다.
 * 칸 전체를 함께 칠한다. */
.radio-item:has(input:focus-visible) {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}

.radio-item input:disabled,
.radio-item:has(input:disabled) {
	cursor: not-allowed;
	color: var(--text-dim);
	background: var(--surface-2);
}

/* 표 안(PC 회차 카드)에서는 한 줄에 서야 하므로 조금 작게. 모바일은 위 기본값. */
.radio-row.is-tight .radio-item {
	min-height: 34px;
	padding: 0 var(--sp-2);
	font-size: 14px;
	gap: var(--sp-1);
}

.radio-row.is-tight .radio-item input { width: 15px; height: 15px; }

/* --- PC 일별현황의 회차 카드 (docs/PLAN9.md 6장) ---------------------------
 *
 * 회차 하나가 표의 열 칸에 나뉘어 들어가던 것을 한 칸(colspan=열 수)짜리
 * 카드로 바꿨다. 라디오 셋과 수당 네 칸을 옛 자리에 넣으면 표가 무너진다 —
 * 자세한 이유는 daily.js 의 tripRows 주석에 적었다.
 *
 * 대기실 [오늘 상세] 의 회차별 체크 시트와 **같은 부품**을 쓰고 배치만 다르다.
 * 표 안이라 가로로 눕히고, 시트에서는 세로로 쌓는다.
 */

.adm-trip-cell {
	padding: var(--sp-2) var(--sp-3) !important;
}

.adm-trip {
	display: flex;
	flex-direction: column;
	gap: var(--sp-2);
	min-width: 0;
}

.adm-trip-head {
	display: flex;
	align-items: center;
	gap: var(--sp-2);
	flex-wrap: wrap;
	min-width: 0;
}

/* 묶음들(시각 / 외근지 / 시간 입금 / 수당 / 금액 / 작업내용)을 나란히 눕힌다.
 * 좁아지면 저절로 접힌다 — 화면 폭마다 격자를 따로 들고 있지 않는다. */
.adm-trip-grid {
	display: flex;
	flex-wrap: wrap;
	gap: var(--sp-2) var(--sp-4);
	align-items: flex-start;
	min-width: 0;
}

.adm-trip-group {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

/* 묶음 이름은 아주 작게. 이름표가 커지면 정작 값이 묻힌다. */
.adm-trip-title {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: var(--text-dim);
	text-transform: none;
}

.adm-trip-items {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--sp-1) var(--sp-2);
	min-width: 0;
}

/* 칸 하나 = 작은 이름표 + 입력칸. label 이라 이름표를 눌러도 칸에 들어간다. */
.adm-trip-item {
	display: inline-flex;
	align-items: center;
	gap: var(--sp-1);
	min-width: 0;
}

/* 라디오 무리·설명 줄처럼 스스로 무엇인지 말하는 것은 줄을 통째로 쓴다. */
.adm-trip-item.is-wide {
	flex: 1 1 100%;
	min-width: 0;
}

.adm-trip-label {
	font-size: 12px;
	color: var(--text-dim);
	white-space: nowrap;
}

@media (max-width: 900px) {
	/* 좁으면 묶음마다 줄을 바꾼다. 옆으로 밀려 잘리는 것보다 낫다. */
	.adm-trip-group { flex: 1 1 100%; }
}

/* --- 탭 (docs/PLAN9.md 6.1) -------------------------------------------------
 *
 * 회차를 위아래로 쌓지 말고 한 번에 하나만 보이게 한다. 여섯 번 나간 사람을
 * 펼치면 카드 여섯 장이 세로로 늘어서 표가 화면을 넘어갔다.
 *
 * 탭 줄은 밑줄로 붙인다. 고른 탭만 굵은 밑줄이 그어지고 배경이 밝아진다 —
 * 색만으로 알리지 않는다(밑줄이 형태로 한 번 더 말한다).
 */

.tabs {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

/* 회차가 열 개를 넘으면 옆으로 밀린다. 줄을 바꾸면 탭 줄이 두 층이 되어
 * 아래 내용이 위아래로 출렁인다 — 가로로 굴리는 편이 낫다. */
.tab-bar {
	display: flex;
	gap: 2px;
	overflow-x: auto;
	border-bottom: 2px solid var(--line);
	min-width: 0;
	scrollbar-width: thin;
}

.tab {
	display: inline-flex;
	align-items: center;
	gap: var(--sp-1);
	flex: 0 0 auto;
	min-height: 34px;
	padding: 0 var(--sp-3);
	border: 0;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;              /* 탭 줄의 밑줄과 겹쳐 한 선처럼 보이게 */
	background: transparent;
	color: var(--text-dim);
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
	cursor: pointer;
	border-radius: var(--r-s) var(--r-s) 0 0;
}

.tab:hover { background: var(--surface-2); color: var(--text); }

.tab.is-on {
	color: var(--primary-dark);
	font-weight: 700;
	background: var(--surface);
	border-bottom-color: var(--primary);
}

.tab-panel {
	padding-top: var(--sp-2);
	min-width: 0;
}

/* 접힌 회차에 미수가 있으면 탭 이름 옆에 점을 찍는다. 탭을 하나씩 열어 보기
 * 전에는 그날 청구할 것이 있는지 알 수 없기 때문이다. */
.tab-dot {
	width: 7px;
	height: 7px;
	border-radius: 999px;
	background: var(--danger);
	flex: 0 0 auto;
}

/* 탭의 회차 번호. '회차' 두 글자를 빼는 대신 번호를 작고 흐리게 칠해 이름과
 * 갈라 놓는다 — 기호(1_짱, 1.짱)를 넣지 않아도 눈이 둘로 읽는다.
 * 고른 탭에서는 함께 진해진다(흐린 채로 두면 켜진 탭만 반쪽으로 보인다). */
.tab-n {
	font-size: 12px;
	font-weight: 700;
	color: var(--text-dim);
	font-variant-numeric: tabular-nums;
}

.tab.is-on .tab-n { color: var(--primary); }

/* --- 시트의 배열 (docs/PLAN10.md) -----------------------------------------
 *
 * 시트 안의 칸을 **구역 → 줄 → 칸** 한 가지 구조로 세운다. 받은 요구가
 * "일관된 배열로 잘 꾸며줘" 이고, 기준으로 삼은 것은 외근 편집 화면이다 —
 * 그 화면만 구역이 나뉘어 있었다.
 *
 * 예전에는 칸을 flex-wrap 으로 늘어놓았다. **flex 는 내용 길이만큼 자리를
 * 차지하므로 줄마다 칸의 시작점이 다르다.** 그래서 격자로 못 박는다.
 *
 * 시트 폭은 560px 로 고정돼 있다(.modal). 넷으로 나누면 칸마다 126px 이고,
 * 숫자칸(72px)과 짧은 이름표가 딱 들어간다. **칸 수를 줄마다 달리하지 않는다** —
 * 달리하면 세로선이 어긋나 '배열' 이 아니게 된다. 두 칸짜리는 span-2 로 먹는다.
 */

.sheet-sec {
	display: flex;
	flex-direction: column;
	gap: var(--sp-2);
	margin-top: var(--sp-4);
}

.sheet-sec:first-child { margin-top: 0; }

/* 구역 제목에 밑줄을 둔다. 굵은 글씨만으로는 칸 무리와 구별되지 않아
 * '구역이 있다' 는 것이 눈에 들어오지 않았다. */
.sheet-sec-title {
	display: flex;
	align-items: baseline;
	gap: var(--sp-2);
	padding-bottom: 3px;
	border-bottom: 1px solid var(--line);
	font-size: 13px;
	font-weight: 700;
	color: var(--text);
}

.sheet-sec-title .hint {
	font-size: 12px;
	font-weight: 400;
	color: var(--text-dim);
	min-width: 0;
}

.sheet-row {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--sp-2);
	align-items: start;
	min-width: 0;
}

.sheet-cell {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.sheet-cell.span-2 { grid-column: span 2; }
.sheet-cell.span-3 { grid-column: span 3; }
.sheet-cell.span-4 { grid-column: span 4; }

/* 이름표는 한 줄로 둔다. 두 줄이 되면 그 칸만 키가 커져 격자가 어긋난다.
 * 그래서 이름표를 짧게 쓰고(구역 제목이 문맥을 준다) 넘치면 말줄임한다. */
.sheet-label {
	font-size: 12px;
	color: var(--text-dim);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* 칸 안의 입력칸은 칸 폭을 꽉 채운다 — 폭이 제각각이면 격자를 만든 뜻이 없다.
 * 숫자칸의 고정 폭(.adm-w-num 72px)도 여기서는 풀어 준다. */
.sheet-cell .input,
.sheet-cell .select {
	width: 100%;
	min-width: 0;
}

/* 구역 아래에 한 번만 붙는 설명. 칸마다 붙이면 칸 높이가 제각각이 되어
 * 격자가 무너진다 — 예전 fieldBox 의 hint 가 그랬다. */
.sheet-note {
	font-size: 12px;
	color: var(--text-dim);
	margin: 0;
}

/* --- 시트 안의 인원 목록 (docs/PLAN10.md 3장) ------------------------------
 *
 * 받은 요구가 "보미…, 은영… 데이터를 세로가 같은 위치" · "대기실의 직원처럼
 * 배열하듯이" 다. 대기실 줄(.wait-row)이 세로줄을 지키는 비결은 격자다.
 *
 * 같은 방법을 쓰되 인원 줄에는 **버튼**이 붙는다. 사람마다 버튼 수가 다르므로
 * (이동중이면 [근무 시작] 이 하나 더) 버튼을 오른쪽 끝에 두 줄을 함께 쓰게 해
 * 왼쪽 자료의 세로선이 밀리지 않게 한다.
 */

.adm-member {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 2px var(--sp-2);
	align-items: center;
	padding: var(--sp-2) var(--sp-3);
	border-bottom: 1px solid var(--line);
	border-left: 3px solid transparent;
	cursor: pointer;
	min-width: 0;
}

.adm-member:last-child { border-bottom: 0; }
.adm-member:hover { background: var(--surface-2); }

/* 고른 사람. 색만으로 알리지 않는다 — 왼쪽 띠가 형태로 한 번 더 말한다. */
.adm-member.is-on {
	background: var(--primary-soft);
	border-left-color: var(--primary);
}

.adm-member-name { grid-column: 1; grid-row: 1; min-width: 0; }
.adm-member-acts { grid-column: 2; grid-row: 1 / span 2; justify-self: end; }

/* 둘째 줄의 자료. **여기가 안쪽 격자다** — 글자 하나로 이어 붙이면
 * (`22:10 ~ 진행 중 · 근무중 · 11시간 초과`) 시각 길이에 따라 상태가 밀린다. */
.adm-member-data {
	grid-column: 1;
	grid-row: 2;
	display: grid;
	grid-template-columns: 8.75rem 3.6rem minmax(0, 1fr);
	gap: var(--sp-2);
	align-items: center;
	font-size: 13px;
	color: var(--text-dim);
	min-width: 0;
}

.adm-member-when {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.adm-member-remain { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 아래 구역들이 누구의 것인지 한 번만 크게 적는 줄(외근 편집 시트).
 * 예전에는 구역 제목마다 이름을 붙였는데(`보미 · 시각`), 구역이 다섯이 되면서
 * 같은 이름이 다섯 번 되풀이되어 정작 구역 이름이 묻혔다. */
.sheet-who {
	margin-top: var(--sp-4);
	padding: var(--sp-2) var(--sp-3);
	border-radius: var(--r-m);
	background: var(--surface-2);
	font-size: 15px;
}

/* --- 달력 (docs/PLAN16.md 4장) --------------------------------------------
 *
 * 한 달 격자. **표가 아니다.**
 *
 * 이 저장소는 "지급(결산)과 수납(외주비)을 한 표·한 칸에 넣지 않는다" 를 문서
 * 다섯 곳에서 반복한다. 15차가 그 경계를 그어 두었다 — 금지된 것은 한 표의 한 칸·
 * 한 열·한 합계이지 한 화면에 함께 있는 것이 아니고, 회사 손익은 "한 표가 아니라
 * 한 카드에서" 두 방향이 만나는 자리다.
 *
 * 달력 칸은 그래서 **작은 카드**로 만든다. 격자는 31칸이 같은 좌표에 찍히므로
 * 사람이 자동으로 세로로 읽어 열을 만든다 — 라벨과 구분선 없이 숫자를 나란히
 * 찍으면 "나란히 놓으면 남는 돈으로 읽는다" 가 그대로 일어난다.
 *
 * 그래서 칸 안에 구역이 셋이고 사이에 실선을 긋는다.
 *   .cal-money   손익   — 맨 위, 굵게
 *   .cal-in      받을 돈 — 외근지 -> 회사
 *   .cal-out     줄 돈   — 회사 -> 직원
 *
 * **월 합계 줄을 달력 아래에 두지 않는다.** 청구·미수·직원합계를 같은 열로 세우면
 * 그 순간 달력이 표가 된다. 합계는 머리의 손익 한 줄로만 낸다.
 *
 * --- 18차: 여기 규칙은 두 무리다 (docs/PLAN18.md 1.2장) ----------------------
 *
 * **공용** — shared/calendar.js 의 monthCalendar 가 쓴다. 결산이라는 낱말이 없고
 * [일별 현황]·[월회비]·[집계] 달력도 그대로 쓴다:
 *   .cal · .cal-wrap · .cal-dow · .cal-cell(+ .cal-thin/.is-out/.is-today/
 *   .is-empty/.is-pick) · .cal-head · .cal-day · .cal-lock · .cal-sec ·
 *   .cal-sec-name · .cal-row · .cal-go
 *
 * **결산 전용** — 칸 속을 만드는 pages/calendar.js 만 쓴다:
 *   .cal-money · .cal-in · .cal-out · .cal-sum · .cal-calc · .cal-unpaid
 *
 * 새 달력을 붙일 때 아래 여섯을 쓰고 싶어지면 멈춰라 — 그 칸이 돈 두 방향을
 * 말하고 있는지 먼저 물어야 한다.
 */

.cal {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 6px;
}

/* 요일 머리. 칸과 같은 격자를 쓰므로 .cal 안에 그대로 넣는다. */
.cal-dow {
	text-align: center;
	font-size: 12px;
	font-weight: 600;
	color: var(--text-dim);
	padding: 2px 0 4px;
}
.cal-dow.is-sun { color: var(--danger); }
.cal-dow.is-sat { color: var(--primary); }

.cal-cell {
	min-height: 128px;
	border: 1px solid var(--line);
	border-radius: var(--r-s);
	background: var(--surface);
	padding: 6px 8px 8px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

/* 그 달이 아닌 앞뒤 칸. 지우지 않고 흐리게 둔다 — 빈 자리로 두면 격자가
 * 어긋나 보이고, 그 주의 첫날이 어디인지 읽기 어려워진다. */
.cal-cell.is-out { background: var(--bg); border-style: dashed; }
.cal-cell.is-out .cal-day { color: var(--text-dim); }

/* 오늘. 색이 아니라 테두리로 알린다 — 색은 미수에만 쓴다. */
.cal-cell.is-today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }

.cal-cell.is-empty { background: var(--bg); }

/* 석 줄짜리 칸(일별 현황·집계·월회비). 결산 칸은 구역이 셋이라 128px 가 필요하지만
 * 이쪽은 두세 줄이라 그 높이면 달력이 화면을 넘어간다. */
.cal-cell.cal-thin { min-height: 76px; }

/* 누를 수 있는 칸. 그 달 밖 칸과 빈 칸에는 안 붙는다 — 갈 곳이 없다. */
.cal-cell.is-pick { cursor: pointer; }
.cal-cell.is-pick:hover { border-color: var(--primary); }
.cal-cell.is-pick:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

.cal-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px;
}
.cal-day { font-weight: 700; font-size: 13px; }
.cal-day.is-sun { color: var(--danger); }
.cal-day.is-sat { color: var(--primary); }
.cal-lock { font-size: 11px; color: var(--text-dim); }

/* 구역 셋. 사이의 실선이 카드 테두리가 하던 일을 칸 안에서 대신한다. */
.cal-sec { font-size: 11px; line-height: 1.45; }
.cal-sec + .cal-sec { border-top: 1px solid var(--line); padding-top: 4px; }
.cal-sec-name { color: var(--text-dim); font-size: 10px; letter-spacing: .02em; }

/* 손익만 크다. 셋을 같은 크기로 찍으면 세 값이 대등해 보여 더해진다. */
.cal-money .cal-sum { font-weight: 700; font-size: 15px; }
.cal-money .cal-calc { color: var(--text-dim); font-size: 10px; }

.cal-row { display: flex; justify-content: space-between; gap: 6px; }
.cal-row > span:last-child { font-variant-numeric: tabular-nums; }

/* **색은 미수에만.** 손익 적자는 색이 아니라 세모(△)와 굵기로 알린다 —
 * 한 칸 안에서 붉은색이 두 뜻을 가지면 색이 뜻을 잃는다. */
.cal-unpaid { color: var(--danger); font-weight: 700; }

.cal-go {
	margin-top: auto;
	align-self: flex-start;
	font-size: 11px;
	padding: 2px 6px;
}

/* 좁은 화면. 7열 격자는 폭이 줄면 숫자가 겹치므로 가로 스크롤로 흡수한다
 * — 표를 .table-wrap 에 넣는 것과 같은 수법이다. */
@media (max-width: 900px) {
	.cal-wrap { overflow-x: auto; }
	.cal { min-width: 760px; }
}

/* 숙소 복귀예정 묶음(068) — 좁은 폰에서 스테퍼가 눌려 표적이 27px 까지 줄었다.
   `.stepper-btn { width: 54px }` 는 flex 안에서 줄어들 수 있어(기본 flex-shrink:1),
   여기서만 최소폭을 못 박는다. 줄이 모자라면 칸이 아랫줄로 내려가면 된다. */
.m-lodge-due { flex-wrap: wrap; row-gap: var(--sp-1, 4px); }
.m-lodge-due .stepper-btn { min-width: 44px; flex-shrink: 0; }
.m-lodge-due .stepper-val { min-width: 64px; flex-shrink: 0; }
