/* 영우 업무 — 화면 스타일 (부품 설명·마크업 예시는 docs/DESIGN.md)
   기준: 흰 바탕 · 파랑 하나 · 굵은 한글 제목 · 가는 괘선. 상자를 쌓지 않고 표·목록·괘선으로 구획한다(yvote 홍보 사이트와 같은 계열).
   글꼴은 기기에 깔린 것만 쓴다(내려받지 않는다). 인라인 style을 쓰지 않는다(CSP style-src 'self'). 그림은 CSS 안의 작은 SVG만(img-src data:).
   차례: 1 기준 값 · 2 바탕 · 3 틀(메뉴) · 4 글머리 · 5 꼬리표·알림 줄 · 6 구역 · 7 목록 줄 · 8 표 · 9 입력·단추 · 10 탭·도구 줄
        · 11 화면별 부품 · 12 새 부품(권한표·사람 목록·6자리 번호) · 13 로그인 전 화면 · 14 좁은 화면 · 15 임시 연결 */

/* ── 1. 기준 값 ─────────────────────────────────────────── */
:root {
  /* 글자 */
  --ink: #191f28;      /* 제목·핵심 글자 */
  --body: #333d4b;     /* 본문 */
  --sub: #4e5968;      /* 보조(표 머리글, 이름표) */
  --mute: #5d6878;     /* 흐린 글자(안내, 빈 상태) */
  --faint: #8b95a1;    /* 입력 칸 안내 글자만 */
  /* 선·바탕 */
  --line: #e5e8eb;     /* 가는 선 */
  --line-s: #c9cfd6;   /* 진한 선(입력 칸 테두리, 표 머리 밑줄) */
  --band: #f2f4f6;     /* 띠 바탕 */
  --band-s: #f8f9fb;   /* 옅은 띠(줄에 올렸을 때, 합계 줄) */
  --surface: #fff;
  /* 파랑(강조색은 이것 하나) */
  --blue: #1b64da;
  --blue-d: #1552b8;
  --tint: #e8f3ff;
  /* 상태: 급함·확인·완료 */
  --red: #d22030;
  --red-d: #b0182a;
  --red-tint: #fdecee;
  --amber: #d48c00;
  --amber-d: #7a4d00;
  --amber-tint: #fff4d6;
  --ok: #0a6b47;
  --ok-tint: #e3f5ec;
  /* 치수 */
  --side: 232px;       /* 왼쪽 메뉴 폭 */
  --topbar: 52px;      /* 좁은 화면 위 줄 */
  --tabbar: 60px;      /* 좁은 화면 아래 탭 줄 */
  --label: 200px;      /* 구역 이름표 칸 폭(넓은 화면) */
  --ctl: 40px;         /* 입력 칸·단추 높이 */
  --ctl-s: 32px;       /* 작은 단추 높이 */
  --r: 8px;
  --r-s: 6px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
  /* 예전 이름(남겨 둔다) */
  --bg: var(--surface);
  --text: var(--ink);
  --accent: var(--blue);
  --accent-weak: var(--tint);
  --radius: var(--r);
  --gap: 16px;
}

/* ── 2. 바탕 ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--surface); color: var(--body);
  font-family: var(--font); font-size: 16px; line-height: 1.55; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;            /* 숫자는 어디서나 같은 폭 */
  word-break: keep-all; overflow-wrap: break-word; /* 한글은 낱말 중간에서 끊지 않는다 */
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { color: var(--ink); line-height: 1.35; letter-spacing: -.03em; text-wrap: balance; }
p { margin: 0 0 12px; }
p, li, dd, td, th, summary, label { text-wrap: pretty; }
a { color: var(--blue-d); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
strong, b { font-weight: 700; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; }
code, pre { font-family: ui-monospace, Consolas, monospace; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
[id] { scroll-margin-top: 24px; }
.muted { color: var(--mute); }
.pre { white-space: pre-wrap; }
.is-hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* 눈여겨볼 값: 글자색을 바꾸지 않고 앞에 작은 표식을 단다 */
.warn { color: var(--ink); font-weight: 500; }
.warn::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--amber); vertical-align: 2px; }

/* ── 3. 틀: 왼쪽 메뉴(넓은 화면) ─────────────────────────── */
.layout { display: flex; min-height: 100vh; }
.topbar { display: none; }
.sidenav {
  flex: 0 0 var(--side); width: var(--side); position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; padding: 0 0 12px;
  background: var(--surface); border-right: 1px solid var(--line);
}
.sidenav__brand { display: block; padding: 26px 24px 22px; font-size: 20px; font-weight: 800; letter-spacing: -.04em; color: var(--ink); }
.sidenav__brand:hover { text-decoration: none; }
.sidenav__list { list-style: none; margin: 0; padding: 0; }
.sidenav__item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 46px; padding: 0 20px 0 24px; font-size: 16px; font-weight: 500; color: var(--sub);
}
.sidenav__item:hover { background: var(--band-s); color: var(--ink); text-decoration: none; }
.sidenav__item.is-active { background: var(--band); color: var(--ink); font-weight: 700; box-shadow: inset 3px 0 0 var(--blue); }
.sidenav__shortcuts { display: flex; flex-direction: column; margin-top: 20px; padding: 18px 24px 0; border-top: 1px solid var(--line); }
.sidenav__label { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--mute); }
.sidenav__ext { display: inline-flex; align-items: center; min-height: 36px; font-size: 15px; color: var(--sub); }
.sidenav__ext:hover { color: var(--ink); }
/* 새 창으로 열리는 바로가기 표시 */
.sidenav__ext::after, .topbar__ext[target]::after {
  content: ""; flex: none; width: 11px; height: 11px; margin-left: 5px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%235d6878' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 2.5h-2v7h7v-2M7 2.5h2.5V5M9.5 2.5l-4 4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.sidenav__settings { margin-top: auto; }
.main { flex: 1 1 auto; min-width: 0; max-width: 1240px; padding: 36px 40px 96px; }

/* ── 4. 글머리 ─────────────────────────────────────────── */
.page-title { margin: 0 0 20px; font-size: 26px; font-weight: 800; letter-spacing: -.035em; line-height: 1.3; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 0 20px; }
.page-head .page-title { margin: 0; }
.section-title { margin: 36px 0 12px; font-size: 18px; font-weight: 700; }
.lead { margin: 0 0 20px; font-size: 17px; color: var(--ink); }
.lead strong { font-weight: 800; }
.lead .muted { font-size: 14px; }
.hint { font-size: 14px; color: var(--mute); }
.back { display: inline-flex; align-items: center; min-height: 32px; font-size: 15px; color: var(--sub); }
/* 화살표 글자 대신 CSS로 그린 꺾쇠(템플릿에서 "←"를 지우고 back--mark를 붙였을 때) */
.back--mark::before { content: ""; flex: none; width: 7px; height: 7px; margin: 0 8px 0 3px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.count { font-size: 14px; font-weight: 400; color: var(--mute); }

/* ── 5. 꼬리표 · 알림 줄 ─────────────────────────────────── */
/* 꼬리표: 네모에 가까운 작은 딱지. 기본(회색)=참고·상태, 급함·확인·완료·새것은 변형 */
.tag, .pill {
  display: inline-block; padding: 2px 7px; border-radius: 4px; background: var(--band); color: var(--sub);
  font-size: 13px; font-weight: 600; line-height: 1.45; white-space: nowrap; vertical-align: 1px;
}
.tag--info { background: var(--band); color: var(--sub); }
.tag--urgent { background: var(--red-tint); color: var(--red-d); }
.tag--check { background: var(--amber-tint); color: var(--amber-d); }
.tag--done, .tag--ok { background: var(--ok-tint); color: var(--ok); }
.tag--new { background: var(--tint); color: var(--blue-d); }
/* 메뉴 옆 개수 */
.badge { display: inline-block; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--blue); color: #fff; font-size: 13px; font-weight: 700; line-height: 22px; text-align: center; }
.badge.is-empty { display: none; }
/* 알림 줄: 성공·실패·안내·주의 */
.notice { margin: 0 0 16px; padding: 12px 14px; border-radius: var(--r); background: var(--band); color: var(--ink); font-size: 15px; font-weight: 500; line-height: 1.5; }
.notice--ok { background: var(--ok-tint); color: var(--ok); }
.notice--error { background: var(--red-tint); color: var(--red-d); }
.notice--info { background: var(--tint); color: var(--blue-d); }
.notice--warn { background: var(--amber-tint); color: var(--amber-d); }

/* ── 6. 구역 ───────────────────────────────────────────── */
/* 구역(.card)은 상자가 아니다. 가는 선으로 나누고, 넓은 화면에서는 왼쪽에 이름표·오른쪽에 내용을 둔다.
   내용이 없는 구역은 이름표 옆 한 줄로 끝난다. 구역 묶음의 첫 줄은 굵은 선으로 연다. */
.card { margin: 0; padding: 22px 0; border-top: 1px solid var(--line); }
:not(.card) + section.card { border-top: 2px solid var(--ink); }
.card__title { margin: 0 0 12px; font-size: 17px; font-weight: 700; color: var(--ink); }
.card > :not(.card__title) { margin-top: 0; margin-bottom: 14px; }
.card > :last-child { margin-bottom: 0; }
.card > .muted { font-size: 15px; }
.card + :not(.card) { margin-top: 8px; }
@media (min-width: 1200px) {
  section.card { display: grid; grid-template-columns: var(--label) minmax(0, 1fr); column-gap: 32px; align-items: start; padding: 24px 0; }
  section.card > .card__title { grid-column: 1; grid-row: 1 / span 12; margin: 0; }
  section.card > :not(.card__title) { grid-column: 2; min-width: 0; }
}
@media (max-width: 1199px) {
  /* 좁을 때: 내용이 한 줄 안내뿐이거나 목록이 한 줄뿐인 구역은 이름표와 한 줄로 */
  section.card:has(> .card__title + .muted:last-child) { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; padding: 14px 0; }
  section.card:has(> .card__title + .muted:last-child) > .card__title { margin: 0; font-size: 15px; }
  section.card:has(> .card__title + .todo:last-child > :only-child) { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; padding: 14px 0; }
  section.card:has(> .card__title + .todo:last-child > :only-child) > .card__title { margin: 0; font-size: 15px; }
  section.card:has(> .card__title + .todo:last-child > :only-child) > .todo { flex: 1 1 12em; min-width: 0; }
}
/* 접어 둔 넣기·고치기 칸 */
details.card { padding: 4px 0; border-top: 0; }
section.card + details.card { padding: 16px 0; border-top: 1px solid var(--line); }
.fold { margin: 0; }
.fold__summary { display: inline-flex; align-items: center; min-height: 36px; font-size: 15px; font-weight: 600; color: var(--blue-d); cursor: pointer; list-style: none; }
.fold__summary::-webkit-details-marker { display: none; }
.fold__summary::before { content: ""; flex: none; width: 7px; height: 7px; margin: 0 10px 0 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); }
.fold[open] > .fold__summary::before { margin: -3px 9px 0 3px; transform: rotate(45deg); }
.fold[open] > .fold__summary { margin-bottom: 10px; }
.danger-zone { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); }

/* ── 7. 목록 줄 ────────────────────────────────────────── */
/* .todo > .todo__item (새 화면은 .rows > .row 도 같은 모양). 줄 = [표식] 문장 … [핵심 숫자] [단추] */
.todo, .rows { list-style: none; margin: 0; padding: 0; }
.todo__item, .row {
  --pt: 13px;
  position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
  padding: var(--pt) 0 13px; border-bottom: 1px solid var(--line); font-size: 16px; color: var(--ink);
}
.card > .todo > :first-child, .card > .rows > :first-child { --pt: 0px; }
.card > .todo:last-child > :last-child, .card > .rows:last-child > :last-child { padding-bottom: 0; border-bottom: 0; }
.todo__item > p, .row > p { flex: 0 0 100%; margin: 0; font-size: 15px; color: var(--body); }
.todo__item > form.inline, .row > form.inline, .row__side { margin-left: auto; }
.todo__item > .muted, .row > .muted { font-size: 15px; }
/* 줄 전체가 한 곳으로 가는 줄: 글자는 잉크색, 어디를 눌러도 간다 */
.todo__item > a:only-child, .todo__text, .row__text { flex: 1 1 12em; min-width: 0; color: inherit; font-weight: 500; }
.todo__item > a:only-child::after, a.todo__text::after, a.row__text::after { content: ""; position: absolute; inset: 0; }
.todo__item > a:only-child:hover, a.todo__text:hover, a.row__text:hover { color: var(--blue-d); text-decoration: none; }
/* 줄 오른쪽에 맞춰 세우는 핵심 숫자(금액·날짜·남은 날) */
.todo__num, .row__num { flex: 0 0 auto; min-width: 7.5em; margin-left: auto; font-weight: 700; color: var(--ink); text-align: right; white-space: nowrap; }
.todo__when, .row__when { flex: 0 0 auto; min-width: 6.5em; font-size: 15px; color: var(--mute); text-align: right; white-space: nowrap; }
.row__sub { flex: 0 0 100%; font-size: 14px; color: var(--mute); }
/* 왼쪽 표식(점): 급함=빨강, 확인=노랑, 그 밖의 할 일=파랑. 글자색은 바꾸지 않는다 */
.todo__item[class*="todo__item--"], .row[class*="row--"] { padding-left: 20px; }
.todo__item[class*="todo__item--"]::before, .row[class*="row--"]::before {
  content: ""; position: absolute; left: 3px; top: calc(var(--pt) + 9px); width: 7px; height: 7px; border-radius: 50%; background: var(--blue);
}
.todo__item.todo__item--urgent::before, .todo__item.todo__item--deadline::before, .row.row--urgent::before { background: var(--red); }
.todo__item.todo__item--check::before, .todo__item.todo__item--money::before, .todo__item.todo__item--bill::before, .row.row--check::before { background: var(--amber); }
.todo__item.todo__item--info::before, .row.row--info::before { background: var(--line-s); }
.todo__item.todo__item--quiet::before, .row.row--quiet::before { content: none; }
.todo__item--quiet > a:only-child, .row--quiet { color: var(--mute); font-weight: 400; }
/* 끝에 단추가 붙은 줄: 문장이 길어도 단추는 같은 줄 오른쪽에 */
.todo__item:has(> form.inline:last-child), .row:has(> .row__side:last-child) { flex-wrap: nowrap; }
.todo__item > form.inline, .row__side { flex: 0 0 auto; }
/* 꼬리표를 맨 앞에 단 줄은 점을 빼고 꼬리표 칸을 맞춘다 */
.todo__item > .tag:first-child, .row > .tag:first-child { flex: 0 0 auto; min-width: 3.4em; text-align: center; }
.todo__item:has(> .tag:first-child), .row:has(> .tag:first-child) { padding-left: 0; }
.todo__item:has(> .tag:first-child)::before, .row:has(> .tag:first-child)::before { content: none; }
.todo__item.is-done, .row.is-done { color: var(--mute); text-decoration: line-through; }
/* 회차 줄: 이름·상태·날짜 / 집계, 오른쪽에 관리자 열기 */
.todo__item--job > a:first-child { font-weight: 600; color: var(--ink); }
.todo__item > .tally { order: 3; }
.todo__item--job > .btn { order: 2; margin-left: auto; }
.tally { margin: 0; font-size: 14px; color: var(--sub); }
/* 시간순 기록 */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__item { display: flex; align-items: baseline; gap: 2px 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--ink); }
.timeline__item > .muted { flex: 0 0 auto; min-width: 12.5em; font-size: 14px; }
.card > .timeline:last-child > :last-child { padding-bottom: 0; border-bottom: 0; }

/* ── 8. 표 ─────────────────────────────────────────────── */
/* 굵은 선으로 열고 가는 선으로 줄을 나눈다. 세로선·바깥 상자 없음. 숫자 칸은 .num(오른쪽 맞춤) */
.table { width: 100%; margin: 0 0 24px; border-collapse: collapse; border-top: 2px solid var(--ink); font-size: 15px; line-height: 1.5; }
.table th, .table td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table thead th { padding-top: 10px; padding-bottom: 10px; border-bottom-color: var(--line-s); font-size: 14px; font-weight: 600; color: var(--sub); white-space: nowrap; vertical-align: bottom; }
.table tbody th { font-weight: 600; color: var(--ink); }
.table td { color: var(--body); }
.table tbody tr:hover > td, .table tbody tr:hover > th { background: var(--band-s); }
.table tr:target > td { background: var(--tint); }
.table .num { text-align: right; white-space: nowrap; }
.table td.num { color: var(--ink); }
.col-date { white-space: nowrap; }
.table td .muted, .table td.muted { font-size: 14px; }
.table td > a { font-weight: 500; }
.table td .tag { margin-left: 2px; }
.table td > p { margin: 0 0 4px; }
/* 합계 줄(표 안의 한 줄) */
.table .row-total > td, .table tfoot td { border-top: 1px solid var(--ink); border-bottom-color: var(--line-s); background: var(--band-s); font-weight: 700; color: var(--ink); }
/* 줄 바로 아래에 붙는 고치기 칸 */
.table .row-edit > td { padding-top: 0; padding-bottom: 8px; }
.table tbody tr.row-edit:hover > td { background: none; }
.table tr:has(+ .row-edit) > td { border-bottom: 0; }
/* 이름–값 표(명세) */
.table--kv tbody th { width: 160px; font-weight: 500; color: var(--sub); white-space: nowrap; }
.table--kv tbody tr:hover > td, .table--kv tbody tr:hover > th { background: none; }
/* 구역 안의 표: 구역 선이 이미 있으니 굵은 선을 다시 긋지 않는다 */
.card > .table { border-top: 0; }
.card > .table thead th { padding-top: 0; }
.card > .table:last-child > tbody > tr:last-child > td { border-bottom: 0; }
/* 가로로 미는 표(칸이 많을 때 붙인다) */
.table--scroll th, .table--scroll td { white-space: nowrap; }
/* 칸 종류(템플릿이 th·td에 붙인다): 꺾지 않는 칸 · 이름 칸 · 긴 번호 칸 · 단추 칸 */
.table .col-keep { white-space: nowrap; }
.table td.col-main { min-width: 11em; color: var(--ink); }
.table td.col-code { max-width: 13em; font-size: 14px; color: var(--mute); overflow-wrap: anywhere; }
.table .col-act { width: 1%; padding-top: 8px; padding-bottom: 8px; text-align: right; white-space: nowrap; }
@media (min-width: 1200px) { .table td.col-main { white-space: nowrap; } }
/* 빈 상태 한 줄: 표가 놓일 자리에 선만 긋고 한 줄 */
.empty { margin: 0 0 24px; padding: 20px 12px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); background: none; color: var(--mute); font-size: 15px; text-align: left; }
.card > .empty { padding: 0; border: 0; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 24px; font-size: 14px; }

/* ── 9. 입력 · 단추 ─────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 16px; max-width: 480px; margin: 0; }
.form > .btn { align-self: flex-start; }
.form > .btn--block { align-self: stretch; }
.form > p { margin: 0; }
.form > .section-title { margin: 14px 0 0; }
.form > .check { align-self: flex-start; }
.form--wide { max-width: 760px; }
.form--row { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; max-width: none; }
.form--row > .field__input { flex: 1 1 200px; min-width: 0; }
.form--row > .field__input--short, .form--row > .field__input--date { flex: 0 0 auto; width: auto; }
.form--row > .btn { align-self: center; }
.form--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 16px; align-items: end; max-width: none; }
.form--grid > .btn { justify-self: start; }
.form--grid > .hint { margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.field__label { font-size: 14px; font-weight: 600; color: var(--sub); }
.field__hint { font-size: 14px; color: var(--mute); }
.field__error { font-size: 14px; font-weight: 500; color: var(--red-d); }
.field__input {
  width: 100%; min-height: var(--ctl); padding: 7px 12px; border: 1px solid var(--line-s); border-radius: var(--r);
  background-color: var(--surface); color: var(--ink); font-size: 16px; line-height: 1.4;
}
.field__input::placeholder { color: var(--faint); }
.field__input:hover { border-color: #aeb6c0; }
.field__input:focus, .field__input:focus-visible { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27, 100, 218, .18); }
.field__input.is-invalid { border-color: var(--red); }
.field__input:disabled { background-color: var(--band); color: var(--mute); }
.field__input--area { min-height: 96px; padding-top: 10px; padding-bottom: 10px; line-height: 1.6; resize: vertical; }
.field__input--short, .field__input--date { width: auto; }
select.field__input {
  -webkit-appearance: none; appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%234e5968' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px;
}
input[type="file"].field__input { padding: 5px; font-size: 15px; color: var(--sub); }
input[type="file"].field__input::file-selector-button {
  min-height: 28px; margin-right: 10px; padding: 0 12px; border: 1px solid var(--line-s); border-radius: var(--r-s);
  background: var(--band-s); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
/* 체크 칸 · 고르는 칸 */
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--body); cursor: pointer; }
.check input[type="checkbox"], .check input[type="radio"], .perm input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; flex: none; width: 20px; height: 20px; margin: 0;
  border: 1.5px solid var(--line-s); border-radius: 5px; background: var(--surface) center / 14px no-repeat; cursor: pointer;
}
.check input[type="radio"] { border-radius: 50%; }
.check input[type="checkbox"]:checked, .perm input[type="checkbox"]:checked {
  border-color: var(--blue); background-color: var(--blue);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7.4 5.8 10 11 4.4'/%3E%3C/svg%3E");
}
.check input[type="radio"]:checked { border-color: var(--blue); background: var(--blue); box-shadow: inset 0 0 0 4px var(--surface); }
.check input:disabled, .perm input[type="checkbox"]:disabled { border-color: var(--line); background-color: var(--band); cursor: not-allowed; }
.check input[type="checkbox"]:checked:disabled, .perm input[type="checkbox"]:checked:disabled { border-color: #a9b4c2; background-color: #a9b4c2; }
/* 단추: 기본=보조, --primary=주, --danger=위험, --small=작은 것, --block=폭 가득 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--ctl); padding: 6px 16px; border: 1px solid var(--line-s); border-radius: var(--r);
  background: var(--surface); color: var(--ink); font-size: 15px; font-weight: 500; line-height: 1.25; text-align: center; cursor: pointer;
}
.btn:hover { background: var(--band); text-decoration: none; }
.btn:active { background: var(--line); }
.btn--primary { border-color: var(--blue); background: var(--blue); color: #fff; font-weight: 600; }
.btn--primary:hover, .btn--primary:active { border-color: var(--blue-d); background: var(--blue-d); }
.btn--danger { border-color: #efc2c7; color: var(--red-d); }
.btn--danger:hover, .btn--danger:active { background: var(--red-tint); }
.btn--small { min-height: var(--ctl-s); padding: 4px 11px; border-radius: var(--r-s); font-size: 14px; }
.btn--block { display: flex; width: 100%; min-height: 50px; font-size: 16px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.inline { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
/* 보내기 전 확인 */
.confirm { padding: 14px 16px; border-radius: var(--r); background: var(--tint); }
.confirm__line { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.signature { margin: 0; padding: 10px 12px; border-radius: var(--r-s); background: var(--band); font-family: inherit; font-size: 14px; color: var(--sub); white-space: pre-wrap; }
.secret { padding: 2px 6px; border-radius: 4px; background: var(--band); letter-spacing: .06em; overflow-wrap: anywhere; }
.qr { display: inline-block; align-self: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }

/* ── 10. 탭 · 도구 줄 ───────────────────────────────────── */
.tabs { display: flex; flex-wrap: wrap; gap: 0 24px; box-shadow: inset 0 -1px 0 var(--line); }
.tabs--page { margin: 0 0 20px; }
.page-title + .tabs--page { margin-top: -8px; }
.tabs__item { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 2px; font-size: 16px; font-weight: 500; color: var(--sub); white-space: nowrap; }
.tabs__item:hover { color: var(--ink); text-decoration: none; }
.tabs__item.is-active { color: var(--ink); font-weight: 700; box-shadow: inset 0 -2px 0 var(--blue); }
.tabs__item.is-active .count { color: var(--sub); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 0 16px; }
.toolbar > .tabs { flex: 1 1 auto; }
.search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.search > .field__input { flex: 0 1 auto; width: auto; }
.search > .search__input { width: 260px; min-width: 0; }
.toolbar.search { justify-content: flex-start; }
@media (min-width: 721px) {
  /* 탭과 찾기 칸이 한 줄일 때: 밑줄은 줄 전체에 */
  .toolbar:has(> .tabs) { align-items: flex-end; box-shadow: inset 0 -1px 0 var(--line); }
  .toolbar:has(> .tabs) > .tabs { flex: 0 1 auto; box-shadow: none; }
  .toolbar:has(> .tabs) > .search { padding-bottom: 8px; }
}

/* ── 11. 화면별 부품 ────────────────────────────────────── */
/* 이름–값 묶음 */
.meta { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 20px; margin: 0 0 20px; font-size: 15px; }
.meta dt { color: var(--mute); }
.meta dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
/* 대장 위 합계: 표 머리에 붙는 띠 */
.sum { margin: 0; padding: 12px 12px; border-top: 2px solid var(--ink); background: var(--band-s); font-size: 15px; color: var(--ink); }
.sum p { margin: 2px 0; }
.sum + .table { border-top: 1px solid var(--line-s); }
/* 메일 목록: 안 읽은 메일은 굵은 글자와 앞의 점 하나로만 구분(꼬리표는 화면에서 숨김) */
.mail-list { margin: 0; }
.table--mail td > a { color: var(--body); font-weight: 400; }
.table--mail .col-from { position: relative; width: 22%; max-width: 0; padding-left: 28px; overflow: hidden; color: var(--sub); text-overflow: ellipsis; white-space: nowrap; }
.table--mail thead th:first-child { padding-left: 28px; }
.table--mail .col-folder { font-size: 14px; color: var(--mute); white-space: nowrap; }
.table--mail .col-date { width: 1%; font-size: 14px; color: var(--mute); text-align: right; }
.table--mail .is-unread .col-from, .table--mail .is-unread td > a { color: var(--ink); font-weight: 700; }
.table--mail .is-unread .col-from::before { content: ""; position: absolute; left: 10px; top: 21px; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.table--mail .is-unread .col-date { color: var(--sub); }
.table--mail .tag--new { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip-path: inset(50%); }
/* 메일 읽기 */
.mail-view-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 14px; }
.mail-text { max-width: 46em; margin: 0 0 20px; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: none; font-family: inherit; font-size: 16px; line-height: 1.75; color: var(--body); white-space: pre-wrap; overflow-wrap: anywhere; }
.card > .mail-text { padding: 0; border: 0; }
.mail-frame { display: block; width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.files { list-style: none; max-width: 46em; margin: 0 0 12px; padding: 0; border-top: 1px solid var(--line); }
.files__item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.files__item .muted { font-size: 14px; }
/* 입금 후보 */
.cands { list-style: none; margin: 0 0 8px; padding: 0; }
.cands__item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 6px 0; font-size: 15px; color: var(--ink); }
/* 복구 코드 */
.codes { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 20px; padding: 0; }
.codes__item code { display: block; padding: 10px 8px; border-radius: var(--r-s); background: var(--band); color: var(--ink); font-size: 17px; letter-spacing: .04em; text-align: center; }
/* 화면 끝의 따로 선 폼(로그아웃 등) */
.main > form:last-child:not([class]) { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }

/* ── 12. 새 부품 ───────────────────────────────────────── */
/* 권한표: 행=메뉴, 열=보기/고치기 체크 */
.perm th, .perm td { vertical-align: middle; }
.perm thead th.perm__col, .perm td.perm__cell { width: 84px; padding-left: 4px; padding-right: 4px; text-align: center; }
.perm thead th.perm__team { border-left: 1px solid var(--line); color: var(--ink); text-align: center; }
.perm__menu { font-weight: 600; color: var(--ink); }
.perm__desc { display: block; font-size: 14px; font-weight: 400; color: var(--mute); }
.perm__check { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -11px 0; cursor: pointer; }
.perm__none { color: var(--line-s); }
/* 사람 목록 줄: 이름(+메일) · 팀 · 상태 · 단추 */
.people { list-style: none; margin: 0 0 24px; padding: 0; border-top: 2px solid var(--ink); }
.card > .people { border-top: 0; }
.person { display: grid; grid-template-columns: minmax(0, 1fr) 9em 7em auto; align-items: center; column-gap: 16px; padding: 12px; border-bottom: 1px solid var(--line); }
.card > .people > .person { padding-left: 0; padding-right: 0; }
.card > .people > .person:first-child { padding-top: 0; }
.person__main { min-width: 0; }
.person__name { display: block; font-size: 16px; font-weight: 600; color: var(--ink); }
.person__sub { display: block; overflow: hidden; font-size: 14px; color: var(--mute); text-overflow: ellipsis; white-space: nowrap; }
.person__team { font-size: 15px; color: var(--sub); }
.person__side { display: flex; justify-content: flex-end; gap: 6px; }
.person.is-off .person__name { color: var(--mute); font-weight: 500; }
/* 6자리 번호 입력 칸(칸 하나에 크게, 붙여넣기·자동 입력이 그대로 된다) */
.otp { width: 100%; max-width: 260px; min-height: 60px; padding: 8px 0 8px .45em; font-size: 28px; font-weight: 700; letter-spacing: .45em; text-align: center; }
.otp::placeholder { font-weight: 400; letter-spacing: .45em; }

/* ── 13. 로그인 전 화면 ─────────────────────────────────── */
body.public { display: block; padding: 0 20px; }
.public__box { width: 100%; max-width: 400px; margin: 0 auto; padding: 72px 0 64px; border: 0; border-radius: 0; background: none; }
.public__brand { margin: 0 0 28px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); font-size: 20px; font-weight: 800; letter-spacing: -.04em; color: var(--ink); }
.public__box .form { max-width: none; }
.public__box .section-title { margin-top: 20px; font-size: 17px; }
.public__box > .hint { margin-top: 16px; }

/* ── 14. 좁은 화면 ─────────────────────────────────────── */
@media (max-width: 1000px) {
  :root { --side: 204px; }
  .main { padding: 28px 24px 80px; }
}
/* 폰(폭 390 안팎): 왼쪽 메뉴 → 아래 탭 줄, 바로가기·설정은 위 줄로 */
@media (max-width: 720px) {
  :root { --ctl: 46px; --ctl-s: 38px; }
  [id] { scroll-margin-top: calc(var(--topbar) + 12px); }
  .layout { display: block; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; top: 0; z-index: 20; height: var(--topbar); padding: 0 16px;
    background: var(--surface); border-bottom: 1px solid var(--line);
  }
  .topbar__brand { font-size: 18px; font-weight: 800; letter-spacing: -.04em; color: var(--ink); white-space: nowrap; }
  .topbar__brand:hover { text-decoration: none; }
  .topbar__links { display: flex; align-items: center; gap: 0 14px; font-size: 14px; }
  .topbar__ext { display: inline-flex; align-items: center; min-height: 44px; color: var(--sub); white-space: nowrap; }
  .sidenav {
    position: fixed; top: auto; right: 0; bottom: 0; left: 0; z-index: 30; flex: none; flex-direction: row;
    width: auto; height: auto; overflow: visible; padding: 0 0 env(safe-area-inset-bottom);
    border-right: 0; border-top: 1px solid var(--line);
  }
  .sidenav__brand, .sidenav__shortcuts, .sidenav__settings { display: none; }
  .sidenav__list { display: flex; width: 100%; }
  .sidenav__list > li { flex: 1 1 0; min-width: 0; }
  .sidenav__item { position: relative; justify-content: center; min-height: var(--tabbar); padding: 8px 2px 0; font-size: 14px; font-weight: 600; white-space: nowrap; }
  .sidenav__item:hover { background: none; }
  .sidenav__item.is-active { background: none; color: var(--blue-d); box-shadow: inset 0 3px 0 var(--blue); }
  .sidenav__item .badge { position: absolute; top: 5px; left: calc(50% + 16px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 12px; line-height: 18px; }
  .main { max-width: none; padding: 20px 16px calc(var(--tabbar) + env(safe-area-inset-bottom) + 40px); }
  .page-title { margin-bottom: 16px; font-size: 23px; }
  .page-head { margin-bottom: 16px; }
  .section-title { margin-top: 28px; }
  .card { padding: 20px 0; }
  /* 목록 줄: 단추·숫자는 줄바꿈되면 왼쪽부터 */
  .todo__item--job > .btn { order: 4; margin-left: 0; }
  .todo__num, .row__num { min-width: 0; }
  .todo__when, .row__when { min-width: 0; }
  .timeline__item { flex-wrap: wrap; }
  .timeline__item > .muted { min-width: 0; flex-basis: 100%; }
  /* 탭: 넘치면 옆으로 민다 */
  .tabs { flex-wrap: nowrap; gap: 0 20px; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .toolbar.search { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .search > .search__input { flex: 1 1 160px; width: auto; }
  .meta { grid-template-columns: 6.5em minmax(0, 1fr); gap: 4px 12px; }
  .form, .form--wide { max-width: none; }
  .form--grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .form--row > .field__input { flex-basis: 150px; }
  .mail-frame { height: 60vh; }
  /* 표(기본): 칸이 좁으면 표 안에서 옆으로 민다 */
  .table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table th, .table td { padding: 12px 10px; }
  .table th:first-child, .table td:first-child { padding-left: 2px; }
  .table--kv { display: table; }
  .table--kv tbody th { width: 6.5em; white-space: normal; }
  /* 메일 목록: 줄마다 두 줄(보낸 사람·받은 때 / 제목). 줄 어디를 눌러도 열린다 */
  .table--mail, .table--fold { overflow: visible; }
  .table--mail > thead, .table--fold > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table--mail > tbody, .table--fold > tbody { display: block; }
  .table--mail tbody tr { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
  .table--mail tbody td { display: block; padding: 0; border: 0; }
  .table--mail tbody tr:hover > td { background: none; }
  .table--mail td.col-from { grid-area: 1 / 1; width: auto; max-width: none; padding-left: 0; font-size: 15px; }
  .table--mail td.col-date { grid-area: 1 / 2; width: auto; }
  .table--mail td:nth-child(2) { grid-area: 2 / 1 / 3 / 3; font-size: 16px; }
  .table--mail td.col-folder { display: none; }
  .table--mail .is-unread .col-from::before { position: static; display: inline-block; margin-right: 7px; vertical-align: 2px; }
  .table--mail td > a::after { content: ""; position: absolute; inset: 0; }
  /* 접히는 표(.table--fold): 첫 칸이 제목 줄, 나머지 칸은 data-label을 이름표로 달고 둘째 줄에 */
  .table--fold > tbody > tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 14px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
  .table--fold > tbody > tr > td { display: block; padding: 0; border: 0; font-size: 14px; color: var(--sub); text-align: left; white-space: normal; }
  .table--fold > tbody > tr > td:first-child { flex: 0 0 100%; font-size: 16px; color: var(--ink); }
  .table--fold > tbody > tr > td[data-label]::before { content: attr(data-label); margin-right: 6px; color: var(--mute); font-weight: 400; }
  .table--fold > tbody > tr > td.num { margin-left: auto; font-size: 15px; font-weight: 700; color: var(--ink); }
  .table--fold > tbody > tr > td:empty { display: none; }
  /* 제목 줄이 첫 칸이 아닐 때는 그 칸에 fold-title을 붙인다 */
  .table--fold > tbody > tr:has(> .fold-title) > td:first-child:not(.fold-title) { flex: 0 1 auto; font-size: 14px; color: var(--sub); }
  .table--fold > tbody > tr > td.fold-title { order: -1; flex: 0 0 100%; font-size: 16px; color: var(--ink); }
  .table--fold > tbody > tr:hover > td { background: none; }
  .table--fold > tbody > tr.row-total { background: var(--band-s); }
  /* 사람 목록 줄: 두 줄로 */
  .person { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding-left: 2px; padding-right: 2px; }
  .person__main { grid-area: 1 / 1; }
  .person__team { grid-area: 2 / 1; font-size: 14px; }
  .person__state { grid-area: 1 / 2; justify-self: end; }
  .person__side { grid-area: 2 / 2; }
  /* 권한표: 메뉴 칸을 붙잡아 두고 체크 칸을 옆으로 민다 */
  .perm thead th.perm__col, .perm td.perm__cell { width: 60px; min-width: 60px; }
  .perm th:first-child { position: sticky; left: 0; z-index: 1; min-width: 7.5em; background: var(--surface); }
  .public__box { padding-top: 40px; }
}

/* ── 15. 임시 연결 ─────────────────────────────────────────
   템플릿에 아직 클래스가 없어 구조(순서·id)로 짚은 곳. docs/DESIGN.md "템플릿 변경 요청"이 반영되면 이 묶음은 지운다. */
/* 숫자 칸(td.num)이 있는 열은 머리글도 오른쪽 맞춤 */
.table:has(tbody td.num:nth-child(2)) thead th:nth-child(2),
.table:has(tbody td.num:nth-child(3)) thead th:nth-child(3),
.table:has(tbody td.num:nth-child(4)) thead th:nth-child(4),
.table:has(tbody td.num:nth-child(5)) thead th:nth-child(5),
.table:has(tbody td.num:nth-child(6)) thead th:nth-child(6),
.table:has(tbody td.num:nth-child(7)) thead th:nth-child(7),
.table:has(tbody td.num:nth-child(8)) thead th:nth-child(8) { text-align: right; }
/* 단추 하나만 든 칸은 오른쪽 끝에 좁게 */
.table:not(.table--kv) td:last-child:has(> form.inline:only-child) { width: 1%; padding-top: 8px; padding-bottom: 8px; text-align: right; white-space: nowrap; }
/* 세금 대장(.sum 바로 아래 표): 날짜·구분·청구·입금 칸은 꺾지 않는다. 승인번호는 작게 */
.sum + .table td:nth-child(1), .sum + .table td:nth-child(2), .sum + .table td:nth-child(8), .sum + .table td:nth-child(9) { white-space: nowrap; }
.sum + .table td:nth-child(3) { min-width: 11em; color: var(--ink); }
.sum + .table td:nth-child(7) { max-width: 13em; overflow-wrap: anywhere; }
@media (min-width: 1200px) { .sum + .table td:nth-child(3) { white-space: nowrap; } }
/* 부가세 요약 표 · 기록 표 */
form.toolbar + .table td:first-child, form.toolbar + .table td:last-child { white-space: nowrap; }
.hint + .table td:first-child, .hint + .table td:nth-child(2) { white-space: nowrap; }
/* 거래처 화면: 회차·계산서 표의 날짜·금액 칸 */
#jobs .table > tbody > tr[id] > td:nth-child(2), #jobs .table > tbody > tr[id] > td:nth-child(4), #invoices .table td:nth-child(1), #invoices .table td:nth-child(5) { white-space: nowrap; }
#jobs .table > tbody > tr[id] > td:nth-child(3), #invoices .table td:nth-child(3), #invoices .table td:nth-child(4),
#jobs .table thead th:nth-child(3), #invoices .table thead th:nth-child(3), #invoices .table thead th:nth-child(4) { text-align: right; white-space: nowrap; }
#jobs .table > tbody > tr[id] > td:nth-child(1) { font-weight: 600; color: var(--ink); }
#jobs .table > tbody > tr[id] > td:nth-child(1) > .muted, #jobs .table > tbody > tr[id] > td:nth-child(1) > a { font-weight: 400; }
/* 받을 돈 표: 날짜·지난 날 칸, 입금 확인 칸 폭 */
tr[id^="inv-"] > td:nth-child(2), tr[id^="inv-"] > td:nth-child(4) { white-space: nowrap; }
tr[id^="inv-"] > td:nth-child(5) { width: 36%; }
tr[id^="inv-"] > td:nth-child(1) > .tag { margin: 4px 0 0; }
@media (max-width: 720px) {
  /* 칸이 많은 표(대장·부가세 요약)는 꺾지 않고 옆으로 민다 */
  .sum + .table th, .sum + .table td, form.toolbar + .table th, form.toolbar + .table td { white-space: nowrap; }
  .sum + .table td:nth-child(7) { max-width: none; }
  @supports selector(:has(a)) {
    /* 받을 돈 표 · 회차 표: 줄마다 접어서 보여 준다(칸 안에 입력 폼이 있어 옆으로 밀면 쓰기 어렵다) */
    .table:has(> tbody > tr[id^="inv-"]), .table:has(> tbody > tr[id^="job-"]) { overflow: visible; }
    .table:has(> tbody > tr[id^="inv-"]) > thead, .table:has(> tbody > tr[id^="job-"]) > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .table:has(> tbody > tr[id^="inv-"]) > tbody, .table:has(> tbody > tr[id^="job-"]) > tbody { display: block; }
    tr[id^="inv-"] { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 2px; border-bottom: 1px solid var(--line); }
    tr[id^="inv-"] > td, tr[id^="job-"] > td { display: block; width: auto; padding: 0; border: 0; white-space: normal; }
    tr[id^="inv-"]:hover > td, tr[id^="job-"]:hover > td { background: none; }
    tr[id^="inv-"] > td:nth-child(1) { grid-area: 1 / 1 / 2 / 4; font-size: 16px; }
    tr[id^="inv-"] > td:nth-child(2) { grid-area: 2 / 1; font-size: 14px; color: var(--mute); }
    tr[id^="inv-"] > td:nth-child(4) { grid-area: 2 / 2; font-size: 14px; }
    tr[id^="inv-"] > td:nth-child(3) { grid-area: 2 / 3; font-weight: 700; }
    tr[id^="inv-"] > td:nth-child(5) { grid-area: 3 / 1 / 4 / 4; width: auto; padding-top: 4px; }
    tr[id^="job-"] { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 14px 2px 4px; }
    tr[id^="job-"] > td:nth-child(1), tr[id^="job-"] > td:nth-child(5) { flex: 0 0 100%; }
    tr[id^="job-"] > td:nth-child(1) { font-size: 16px; }
    tr[id^="job-"] > td:nth-child(2) { color: var(--mute); }
    #jobs .table > tbody > tr[id] > td:nth-child(3) { text-align: left; font-weight: 700; color: var(--ink); }
    .table:has(> tbody > tr[id^="job-"]) tr.row-edit { display: block; border-bottom: 1px solid var(--line); }
    .table:has(> tbody > tr[id^="job-"]) tr.row-edit > td { display: block; padding: 0 2px 8px; border: 0; }
    /* 거래처 목록(표 바로 뒤에 '새 거래처 넣기') · 문의 목록(div.toolbar 바로 뒤 표): .table--fold와 같은 모양으로 접는다.
       이름표 글자는 표 머리글을 그대로 옮긴 것(템플릿에 data-label이 붙으면 지운다) */
    .table:has(+ details.card), div.toolbar + .table { overflow: visible; }
    .table:has(+ details.card) > thead, div.toolbar + .table > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .table:has(+ details.card) > tbody, div.toolbar + .table > tbody { display: block; }
    .table:has(+ details.card) > tbody > tr, div.toolbar + .table > tbody > tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 14px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
    .table:has(+ details.card) > tbody > tr > td, div.toolbar + .table > tbody > tr > td { display: block; padding: 0; border: 0; background: none; font-size: 14px; color: var(--sub); }
    .table:has(+ details.card) > tbody > tr > td:first-child, div.toolbar + .table > tbody > tr > td:nth-child(2) { flex: 0 0 100%; font-size: 16px; color: var(--ink); }
    div.toolbar + .table > tbody > tr > td:nth-child(2) { order: -1; }
    .table:has(+ details.card) > tbody > tr > td:empty { display: none; }
    .table:has(+ details.card) > tbody > tr > td:nth-child(n+2)::before { margin-right: 6px; color: var(--mute); }
    .table:has(+ details.card) > tbody > tr > td:nth-child(2)::before { content: "대표"; }
    .table:has(+ details.card) > tbody > tr > td:nth-child(3)::before { content: "진행 중 회차"; }
    .table:has(+ details.card) > tbody > tr > td:nth-child(4)::before { content: "받을 돈"; }
  }
}
