/* Gaachi-Allinone 포털 — 흰 바탕 · 짙은 남색 포인트 1색 · 노랑은 '사람 확인' 강조에만. 외부 글꼴 없음(시스템 글꼴). */
:root {
  --bg: #ffffff;
  --bg2: #f5f6f9;
  --line: #dde1ea;
  --line2: #c7cdd9;
  --ink: #1b2130;
  --ink2: #4a5366;
  --muted: #727b8f;
  --navy: #1f3a68;
  --navy2: #2b4d86;
  --navy-bg: #eaf0fa;
  --human: #fff3b0;      /* 사람 확인 */
  --human-line: #e2c650;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --ok: #1d6b45;
  --ok-bg: #e7f4ec;
  --warn: #8a5a00;
  --top-h: 56px;
  --steps-h: 46px;
  --legal-w: 288px;
  --radius: 8px;
  color-scheme: light;
  font-family: "Pretendard", "Pretendard Variable", "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { min-width: 320px; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
a { color: var(--navy2); }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  border: 1px solid var(--line2); border-radius: 6px; padding: 6px 8px; background: #fff; min-width: 0; width: 100%;
}
input:focus, select:focus, textarea:focus, .dropzone:focus { outline: 2px solid var(--navy2); outline-offset: 1px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.grow { flex: 1 1 auto; }
.mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; background: var(--navy); color: #fff; font-weight: 700; font-size: 16px; flex: 0 0 auto; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--line2); background: #fff; color: var(--ink);
  border-radius: 6px; padding: 7px 14px; cursor: pointer; text-decoration: none; white-space: nowrap; font-weight: 500; }
.btn:hover { border-color: var(--navy2); color: var(--navy); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy2); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--navy-bg); }
.btn.wide { width: 100%; }
.btn.human { background: var(--human); border-color: var(--human-line); }
.btn.warn { background: #fff; border-color: var(--human-line); color: var(--warn); }
.btn.ok { border-color: var(--navy2); color: var(--navy); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn.file { position: relative; }

/* 로그인 */
.login { min-height: 100vh; display: grid; place-items: center; background: var(--bg2); padding: 16px; }
.login-card { width: min(380px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 28px; display: grid; gap: 14px; }
.login-card label { display: grid; gap: 4px; font-weight: 500; color: var(--ink2); }
.login-card label.lg-remember { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; cursor: pointer; }
.login-card label.lg-remember input { width: 18px; height: 18px; padding: 0; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--navy); }
.login-card label.lg-remember small { display: block; font-weight: 400; }
.login-brand { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.login-brand b { font-size: 18px; display: block; }
.login-brand small { color: var(--muted); }
.err { color: var(--bad); min-height: 1.2em; margin: 0; font-size: 13px; }

/* 상단 */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand h1 { font-size: 17px; white-space: nowrap; color: var(--navy); }
.brand h1 span { font-weight: 500; color: var(--ink2); margin-left: 6px; font-size: 15px; }
.sys { display: flex; gap: 6px; flex: 1 1 auto; justify-content: flex-end; flex-wrap: wrap; overflow: hidden; max-height: 26px; }
.sys .dot { font-size: 12px; color: var(--ink2); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; white-space: nowrap; }
.sys .dot::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--line2); margin-right: 5px; vertical-align: 1px; }
.sys .dot.on::before { background: var(--ok); }
.sys .dot.off::before { background: var(--bad); }
.who { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.who-name { font-weight: 600; }
.role { font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--navy-bg); color: var(--navy); font-weight: 600; }
.role.admin { background: var(--navy); color: #fff; }
.role.viewer { background: var(--bg2); color: var(--ink2); }
.legal-toggle { display: none; }

.steps { position: sticky; top: var(--top-h); z-index: 29; height: var(--steps-h); display: flex; gap: 2px; padding: 0 20px; background: #fff;
  border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.steps a { display: flex; align-items: center; gap: 8px; padding: 0 14px; color: var(--ink2); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 500; }
.steps a b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bg2); color: var(--ink2); font-size: 12px; }
.steps a:hover { color: var(--navy); }
.steps a.on { color: var(--navy); border-bottom-color: var(--navy); font-weight: 700; }
.steps a.on b { background: var(--navy); color: #fff; }

/* 본문 + 우측 고정 패널 */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--legal-w); gap: 24px; padding: 20px 20px 48px; max-width: 1600px; margin: 0 auto; align-items: start; }
main { min-width: 0; }
.stage { display: grid; gap: 16px; }
.stage-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stage-head h2 { font-size: 20px; color: var(--navy); }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; background: #fff; }
.panel-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.panel-head h3 { font-size: 16px; }

.legal { position: sticky; top: calc(var(--top-h) + var(--steps-h) + 20px); max-height: calc(100vh - var(--top-h) - var(--steps-h) - 40px); overflow: auto;
  display: grid; gap: 8px; align-content: start; }
.legal-head { display: flex; align-items: center; }
.legal-head h2 { font-size: 14px; color: var(--ink2); flex: 1; }
.legal-close { display: none; }
.lcard { display: block; border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: 6px; padding: 8px 11px; text-decoration: none; color: var(--ink); background: #fff; }
.lcard:hover { border-color: var(--navy2); background: var(--navy-bg); }
.lcard b { display: block; font-size: 13.5px; line-height: 1.35; }
.lcard .meta { font-size: 12px; color: var(--ink2); margin-top: 3px; }
.lcard .meta em { font-style: normal; color: var(--navy); font-weight: 600; }
.lcard .chk { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.lcard .smp { font-size: 11px; line-height: 1.35; margin-top: 4px; background: var(--human); border-radius: 4px; padding: 1px 6px; display: inline-block; color: var(--ink2); }
.lcard.nolink { cursor: default; }

/* 1. 보드 4칸 */
.live { font-size: 12px; color: var(--muted); }
.live::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line2); margin-right: 5px; }
.live.on::before { background: var(--ok); }
.board4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.col { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg2); min-height: 260px; display: flex; flex-direction: column; }
.col h3 { font-size: 15px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fff; border-radius: var(--radius) var(--radius) 0 0; display: flex; align-items: baseline; gap: 6px; }
.col h3 .n { color: var(--navy); }
.col h3 small { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 12px; }
.col .list { padding: 8px; display: grid; gap: 6px; align-content: start; overflow: auto; max-height: 420px; }
.col .sub { font-size: 12px; color: var(--bad); font-weight: 600; margin: 2px 2px 0; }
.tcard { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 8px 10px; cursor: pointer; display: grid; gap: 2px; width: 100%; }
.tcard:hover { border-color: var(--navy2); }
.tcard .t { font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.tcard .m { font-size: 12.5px; color: var(--ink2); display: flex; gap: 6px; flex-wrap: wrap; }
.tcard .m .d { color: var(--navy); font-weight: 600; }
.tcard.overdue { border-left: 3px solid var(--bad); }
.tcard.overdue .m .d { color: var(--bad); }
.badge { font-size: 11px; border-radius: 4px; padding: 0 5px; background: var(--navy-bg); color: var(--navy); font-weight: 600; }
.empty { color: var(--muted); font-size: 13px; padding: 8px 4px; }

/* 2. 대상물건 */
.basicline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.6fr); gap: 10px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--bg2); }
.basicline label, .fee-form label, .rv-opts label, .dz-kind label { display: grid; gap: 3px; font-size: 12.5px; color: var(--ink2); font-weight: 500; }
.pair { display: flex; align-items: center; gap: 6px; }
.pair em { font-style: normal; color: var(--muted); }
.flow { display: grid; grid-template-columns: 260px 64px minmax(0, 1fr); gap: 12px; align-items: start; }
.flow3 { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.flow5 { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.dz-col { display: grid; gap: 10px; }
.dropzone { border: 2px dashed var(--line2); border-radius: var(--radius); min-height: 190px; display: grid; place-items: center; text-align: center; padding: 16px; cursor: pointer; background: #fff; color: var(--ink2); }
.dropzone.small { min-height: 150px; }
.dropzone .plus { font-size: 40px; line-height: 1; color: var(--navy); font-weight: 300; }
.dropzone p { margin: 6px 0 0; }
.dropzone.over { border-color: var(--navy); background: var(--navy-bg); }
.dz-actions { display: grid; gap: 6px; }
.dz-actions .btn { justify-content: flex-start; }
.arrow { align-self: center; display: grid; place-items: center; color: var(--navy); font-weight: 600; font-size: 12.5px; }
.arrow span { display: block; padding: 6px 0 22px; position: relative; }
.arrow span::after { content: "→"; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); font-size: 22px; line-height: 1; }
.case-col { display: grid; gap: 8px; min-width: 0; }
.case-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.case-head h3 { font-size: 15px; }
.case-sel { font-size: 13px; padding: 6px 10px; border-radius: 6px; background: var(--bg2); color: var(--ink2); }
.case-sel.on { background: var(--navy-bg); color: var(--navy); font-weight: 600; }
.tbl-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 6px; max-width: 100%; }
.tbl-wrap.short { max-height: 196px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { position: sticky; top: 0; background: var(--bg2); text-align: left; font-weight: 600; color: var(--ink2); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.tbl td { padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr:hover { background: var(--navy-bg); }
.tbl tr.sel { background: var(--navy-bg); box-shadow: inset 3px 0 0 var(--navy); }
.tbl.edit td { padding: 3px 4px; }
.tbl.edit input, .tbl.edit select { padding: 4px 6px; }
#f-items { min-width: 820px; }
#f-items td:first-child { width: 92px; }
#f-items td:last-child { width: 36px; }
#l-edit { min-width: 900px; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tbody tr.click { cursor: pointer; }
.mini .tbl { min-width: 720px; }
.tbl td.nw, .mini .tbl td { white-space: nowrap; }
.mini h4 { font-size: 13px; margin: 8px 0 4px; color: var(--ink2); }
.drawer-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--bg2); border-bottom: 1px solid var(--line); }

/* 3. 가격 */
.price { display: grid; gap: 12px; min-width: 0; }
.ptbl { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.ptbl caption { text-align: left; font-weight: 700; color: var(--navy); padding: 0 0 4px; font-size: 13.5px; }
.ptbl th { background: var(--navy-bg); color: var(--ink2); font-weight: 600; padding: 6px 6px; border: 1px solid var(--line); text-align: center; font-size: 12.5px; line-height: 1.3; }
.ptbl td { border: 1px solid var(--line); padding: 3px; height: 36px; }
.ptbl td input { border: 0; text-align: right; font-variant-numeric: tabular-nums; padding: 5px 6px; background: transparent; }
.ptbl td input:focus { outline: 2px solid var(--navy2); background: #fff; }
.ptbl td.calc { background: var(--bg2); text-align: right; padding: 5px 8px; font-variant-numeric: tabular-nums; color: var(--ink2); }
.ptbl td.calc.strong { color: var(--navy); font-weight: 700; }
.ptbl td.human { background: var(--human); }
.formula { margin: 0; font-size: 12.5px; color: var(--ink2); background: var(--bg2); border-radius: 6px; padding: 8px 10px; overflow-wrap: anywhere; }
.legend p { margin: 4px 0; font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 14px; height: 14px; border: 1px solid var(--line2); border-radius: 3px; }
.sw.calc { background: var(--bg2); }
.sw.human { background: var(--human); border-color: var(--human-line); }

/* 4. 보고서 */
.rcards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.rcard { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 10px; align-content: start; min-height: 200px; background: #fff; }
.rcard h3 { font-size: 16px; }
.rcard.on { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips.alt { border-top: 1px dashed var(--line); padding-top: 8px; }
.chips button { border: 1px solid var(--line2); background: #fff; border-radius: 99px; padding: 3px 10px; cursor: pointer; font-size: 13px; }
.chips button:hover { border-color: var(--navy2); }
.chips button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.route { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg2); flex-wrap: wrap; }
.route .note { font-size: 12px; color: var(--warn); }
.fee-form { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.fee-sum { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.fee-sum div { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.fee-sum div span { display: block; font-size: 12px; color: var(--muted); }
.fee-sum div b { font-size: 17px; font-variant-numeric: tabular-nums; }
.fee-sum div.total { border-color: var(--navy); background: var(--navy-bg); }
.fee-sum div.total b { color: var(--navy); }
.human-list { background: var(--human); border: 1px solid var(--human-line); border-radius: 6px; padding: 10px 12px 10px 28px; margin: 0; }
.human-list li { margin: 2px 0; }
.human-title { font-weight: 700; margin: 0 0 4px; }
.notice { border: 1px solid var(--line); background: var(--bg2); border-radius: 6px; padding: 10px 12px; }
.notice.bad { border-color: #f1b8b2; background: var(--bad-bg); color: var(--bad); }

/* 5. 리뷰 */
.rv-opts { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 220px)); align-content: start; }
.rv-opts .progress, .rv-opts p { grid-column: 1 / -1; }
.progress { display: grid; gap: 4px; }
.progress .bar { height: 8px; border-radius: 99px; background: var(--bg2); overflow: hidden; border: 1px solid var(--line); }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--navy); transition: width .3s; }
.progress .st { font-size: 12.5px; color: var(--ink2); }
.rv5 { display: grid; grid-template-columns: 1.35fr repeat(4, minmax(0, 1fr)); gap: 10px; }
.ov-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ovl { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); column-gap: 14px; }
.rcol { border: 1px solid var(--line); border-radius: var(--radius); min-height: 180px; display: flex; flex-direction: column; min-width: 0; }
.rcol h3 { font-size: 14.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--bg2); border-radius: var(--radius) var(--radius) 0 0; }
.rcol .body { padding: 8px 10px; display: grid; gap: 6px; align-content: start; overflow: auto; max-height: 420px; }
.rcol .it { font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.rcol .it a.pg { font-weight: 700; text-decoration: none; margin-right: 4px; white-space: nowrap; }
.rcol .it .f { color: var(--ink2); font-size: 12px; display: block; }
.verdict { display: inline-block; font-weight: 700; font-size: 16px; padding: 2px 12px; border-radius: 6px; }
.verdict.v-적정 { background: var(--ok-bg); color: var(--ok); }
.verdict.v-미흡 { background: var(--human); color: var(--warn); }
.verdict.v-부적정 { background: var(--bad-bg); color: var(--bad); }
.ovl { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 3px 14px; font-size: 13px; }
.ovl li { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dotted var(--line); padding-bottom: 2px; }
.ovl li b.has { color: var(--bad); }
.rv-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rep { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-left: auto; }

/* 서랍 · 대화상자 · 알림 */
.drawer { position: fixed; top: calc(var(--top-h)); right: 0; bottom: 0; width: min(1000px, 92vw); z-index: 50; background: #fff; border-left: 1px solid var(--line2);
  box-shadow: -8px 0 24px rgba(20, 30, 50, .12); display: flex; flex-direction: column; }
.drawer iframe { flex: 1; border: 0; width: 100%; }
dialog { border: 1px solid var(--line2); border-radius: 10px; padding: 0; width: min(760px, 94vw); max-height: 86vh; }
dialog::backdrop { background: rgba(20, 30, 50, .35); }
.dlg { display: grid; gap: 12px; padding: 16px 18px; }
.dlg-head { display: flex; align-items: center; }
.dlg-head h3 { flex: 1; font-size: 16px; }
.dlg label { display: grid; gap: 3px; font-size: 13px; color: var(--ink2); }
.dlg .grid2 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tokenbox { font-family: ui-monospace, Consolas, monospace; background: var(--human); border: 1px solid var(--human-line); padding: 8px; border-radius: 6px; overflow-wrap: anywhere; user-select: all; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 8px; font-size: 13.5px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 80; max-width: 90vw; }
.toast.show { opacity: 1; }
.toast.bad { background: var(--bad); }

/* 반응형: 1280 데스크톱 기준. 태블릿 이하에서 오른쪽 패널은 접힌다(버튼으로 펼침). */
@media (max-width: 1360px) {
  .rv5 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rv5 .overall { grid-column: 1 / -1; min-height: 0; }
  .basicline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .basicline .span2 { grid-column: span 2; }
}
@media (max-width: 1180px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .legal-toggle { display: inline-flex; }
  .legal { position: fixed; top: var(--top-h); right: 0; bottom: 0; width: min(320px, 88vw); max-height: none; z-index: 60; background: #fff;
    border-left: 1px solid var(--line2); box-shadow: -8px 0 24px rgba(20, 30, 50, .14); padding: 14px; transform: translateX(105%); transition: transform .2s; }
  .legal.open { transform: none; }
  .legal-close { display: inline-flex; }
  .board4, .rcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fee-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fee-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sys { display: none; }
}
@media (max-width: 860px) {
  .flow, .flow3, .flow5 { grid-template-columns: minmax(0, 1fr); }
  .arrow { display: none; }
  .brand h1 span { display: none; }
  .basicline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rv5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ptbl { min-width: 600px; }
  .price { overflow-x: auto; }
}
@media (max-width: 600px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .who-name, #btn-token, #btn-admin, .who .role { display: none !important; }
  .brand h1 { font-size: 15px; }
  .rv5 { grid-template-columns: minmax(0, 1fr); }
  .layout { padding: 14px 16px 40px; }
  .steps { padding: 0 8px; }
  .board4, .rcards, .basicline, .fee-form, .fee-sum, .rv-opts { grid-template-columns: minmax(0, 1fr); }
  .basicline .span2 { grid-column: auto; }
}

/* 격자 단일 열이 내용 최소폭만큼 늘어나 오른쪽 패널을 덮지 않도록 */
.stage, .case-col, .dz-col, .price, .panel, .dlg { grid-template-columns: minmax(0, 1fr); }
.tbl tbody tr.click { user-select: none; }

/* 3단계 — 결정단가를 명세표에 넣을지 */
.chk-inline{display:inline-flex;align-items:center;gap:6px;margin-right:auto;cursor:pointer}
.chk-inline input{width:auto;margin:0}

/* ============ 권한 v2(2026-10-07): 펼침 카드 · 종 아이콘 · 권한 요청 · 관리 탭 · PDF/인쇄 ============ */
.bell { position: relative; padding: 4px 8px; }
.bell .bdg, .bdg { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }
.bell .bdg { position: absolute; top: -3px; right: -4px; }
.bdg.sm { background: var(--navy); }
/* 업무 카드 — 기본 펼침(상세 dl), 머리 ▾ 로 카드별 접기, [상세 접기] 로 전체 */
.col .list { max-height: 640px; }
.tcard { cursor: default; padding: 0; gap: 0; overflow: hidden; }
.tcard:hover { border-color: var(--line2); }
.tc-head { display: flex; align-items: flex-start; gap: 4px; }
.tc-open { flex: 1 1 auto; text-align: left; background: none; border: 0; padding: 8px 4px 6px 10px; cursor: pointer; display: grid; gap: 2px; min-width: 0; }
.tc-open:hover .t { color: var(--navy); text-decoration: underline; }
.tc-fold { background: none; border: 0; padding: 8px 8px 4px; cursor: pointer; color: var(--muted); font-size: 13px; transition: transform .15s; }
.tc-body { margin: 0; padding: 2px 10px 6px; display: grid; gap: 1px; font-size: 12.5px; border-top: 1px dashed var(--line); }
.tc-body .r { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 6px; }
.tc-body dt { color: var(--muted); }
.tc-body dd { margin: 0; color: var(--ink2); overflow-wrap: anywhere; }
.tc-body .memo dd { color: var(--ink); }
.tc-body .st { font-weight: 600; color: var(--navy); }
.tc-body .st.today { color: var(--warn); }
.tc-body .st.bad, .tc-body .bad { color: var(--bad); }
.tc-act { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; padding: 4px 8px 8px; }
.tc-act .btn { padding: 2px 8px; font-size: 12px; }
.tcard.fold .tc-body, .tcard.fold .tc-act { display: none; }
.tcard.fold .tc-fold { transform: rotate(-90deg); }
.board4.folded .tcard:not(.fold) .tc-body, .board4.folded .tcard:not(.fold) .tc-act { display: none; }
.board4.folded .tcard:not(.fold) .tc-fold { transform: rotate(-90deg); }
.board4.folded .tcard.fold .tc-body { display: grid; }
.board4.folded .tcard.fold .tc-act { display: flex; }
.board4.folded .tcard.fold .tc-fold { transform: none; }
/* 권한 없는 버튼: 회색 + [권한 요청] */
.noperm { filter: grayscale(1); }
.dropzone.noperm { opacity: .7; }
.req-link { margin-left: 6px; color: var(--navy2); font-weight: 600; white-space: nowrap; cursor: pointer; }
.gst { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--bg2); color: var(--ink2); }
.gst.ok { background: var(--ok-bg); color: var(--ok); } .gst.warn { background: var(--human); color: var(--warn); } .gst.bad { background: var(--bad-bg); color: var(--bad); }
/* 관리 탭 */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 4px 0 12px; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 14px; cursor: pointer; font-weight: 600; color: var(--ink2); display: inline-flex; gap: 6px; align-items: center; }
.tabs button.on { border-bottom-color: var(--navy); color: var(--navy); }
.tbl .c { text-align: center; }
.tbl .acts { white-space: nowrap; display: flex; gap: 4px; }
.tbl input[type=checkbox] { width: 18px; height: 18px; }
.gh { font-size: 14px; margin: 14px 0 6px; }
.warn-t { color: var(--warn); font-weight: 600; }
.ok-t { color: var(--ok); }
.aims-res { margin-top: 4px; line-height: 1.5; }
/* 리뷰 보고서 PDF + 인쇄 */
.pgrp { display: inline-flex; gap: 2px; align-items: center; }
#print-frame { position: fixed; right: 0; bottom: 0; width: 1px; height: 1px; border: 0; opacity: 0; pointer-events: none; }
.dlg .grid2 .span2 { grid-column: 1 / -1; }
/* 펼친 카드는 머리에 제목만(담당·마감은 상세에) — 접힌 카드는 머리에 담당·마감 요약 */
.tcard .tc-open .m { display: none; }
.tcard.fold .tc-open .m, .board4.folded .tcard:not(.fold) .tc-open .m { display: flex; }
.board4.folded .tcard.fold .tc-open .m { display: none; }
.tc-act .btn.req { color: var(--navy2); font-weight: 600; }
[data-adm] .tbl td { vertical-align: top; }
.nw { white-space: nowrap; }

/* 2026-10-11 한 페이지 구성 — 단계마다 구분선, 탭으로 이동할 때 상단바·탭 아래에 맞춰 멈춤 */
.stage { scroll-margin-top: calc(var(--top-h) + var(--steps-h) + 12px); }
.stage[data-stage]:not([data-stage="1"]):not([data-stage="admin"]) { margin-top: 28px; padding-top: 24px; border-top: 2px solid var(--line); }

/* 2026-10-11 1단계 = 업무보드 화면을 그대로 넣음 */
.board-embed { width: 100%; height: max(640px, calc(100vh - var(--top-h) - var(--steps-h) - 90px)); border: 1px solid var(--line); border-radius: 10px; background: #fff; }

/* 2026-10-11 구성원 추가 */
.u-add { margin-top: 12px; padding: 12px; border: 1px dashed var(--line2); border-radius: 8px; display: grid; gap: 10px; }
.u-add-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.u-add-grid label { display: grid; gap: 3px; font-size: 13px; color: var(--ink2); }
.u-add-caps { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.u-add-caps .grow { flex: 1; }
@media (max-width: 760px) { .u-add-grid { grid-template-columns: minmax(0, 1fr); } }

/* 2026-10-11 산출물 목록 — 물건을 고르지 않아도 전체 목록(최근순) + 검색 */
.outs-q { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 10px; margin: 8px 0 10px; }
.outs-q > label { display: grid; gap: 3px; font-size: 12.5px; color: var(--ink2); font-weight: 500; min-width: 0; }
.outs-q input, .outs-q select { width: 100%; min-width: 0; }
.outs-q label:nth-child(5), .outs-q label:nth-child(6) { grid-column: span 2; }
.outs-q .oq-dates { display: flex; gap: 4px; align-items: center; min-width: 0; }
.outs-q .oq-dates select { width: auto; flex: 0 0 auto; }
.outs-q .oq-dates input { flex: 1 1 0; }
.outs-q .oq-acts { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.outs-q .oq-case { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.outs-q .oq-case input { width: 16px; height: 16px; }
.outs-tbl .of { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 2px 0; }
.outs-tbl .of + .of { border-top: 1px dashed var(--line); }
.outs-tbl .of .fn { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.outs-tbl td.d { white-space: nowrap; }
@media (max-width: 1180px) { .outs-q { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .outs-q { grid-template-columns: minmax(0, 1fr); } .outs-q label:nth-child(5), .outs-q label:nth-child(6) { grid-column: auto; }
  .outs-tbl .hm { display: none; }
  .outs-tbl td.d { white-space: normal; }
}
.outs-q .oq-case[hidden] { display: none; }

/* 2026-10-12 자주 쓰는 버튼은 각 단계 위쪽에 — 눈에 띄는 버튼 줄 */
.top-actions { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg2); margin: 4px 0 14px; }
.top-actions .btn { font-weight: 600; }
.top-actions .btn:not(.primary):not(.ghost):not(.human):not(.warn) { border-color: var(--navy2); color: var(--navy); }
.dz-actions.top { margin-bottom: 10px; }
.dz-actions.top .btn { background: var(--navy-bg); border-color: var(--navy2); color: var(--navy); font-weight: 600; }
.dz-actions.top .btn:hover { background: var(--navy); color: #fff; }

/* 건물신축단가표(원가법) — 오른편 카드 · 단가표 보기 · 3단계 건물 원가법 (2026-10-13, buildcost.js) */
.cost-box:empty { display: none; }
.lcard.cost-card { width: 100%; text-align: left; font: inherit; cursor: pointer; border-left-color: var(--ok); }
.lcard.cost-card.empty-t { border-left-color: var(--human-line); }
.lcard.cost-card:hover { background: var(--ok-bg); border-color: var(--ok); }
dialog.dlg-wide { width: min(1120px, 96vw); }
.ct-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.4fr); gap: 8px; }
.ct-tbl td.nowrap { white-space: nowrap; }
.bc-src select { width: auto; display: inline-block; padding: 1px 4px; }
.ct-wrap { max-height: 56vh; }
.ct-tbl th[data-sort] { cursor: pointer; user-select: none; }
.ct-tbl th[aria-sort="ascending"]::after { content: " ▲"; font-size: 10px; color: var(--navy); }
.ct-tbl th[aria-sort="descending"]::after { content: " ▼"; font-size: 10px; color: var(--navy); }
.ct-admin { margin: 0 0 10px; }
#ct-meta { margin: 0 0 8px; }
.ct-filters + p { margin: 8px 0 6px; }
.bc { margin-top: 16px; }
.bc-tbl { min-width: 900px; }
.bc-tbl td { vertical-align: middle; }
.bc-tbl td:nth-child(2), .bc-tbl td:nth-child(3) { min-width: 64px; }
.bc-tbl td .tiny { white-space: nowrap; }
.bc-tbl td input { text-align: right; font-variant-numeric: tabular-nums; width: 54px; }
.bc-tbl td.human { background: var(--human); }
.bc-tbl td.human input { width: 100px; background: transparent; }
.bc-tbl td.calc { background: var(--bg2); color: var(--ink2); }
.bc-tbl td.calc.strong { color: var(--navy); font-weight: 700; }
.bc-tbl td.grade { white-space: nowrap; }
.bc-tbl td.grade select { width: 160px; }
.bc-tbl tfoot td { font-weight: 700; background: var(--navy-bg); color: var(--navy); border-top: 2px solid var(--line2); padding: 6px 8px; }
.badge.rec { background: var(--ok-bg); color: var(--ok); margin-left: 6px; }
@media (max-width: 600px) {
  .ct-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ct-wrap { max-height: 50vh; }
}

/* 2026-10-13 가격 작업 창(pricepop.js) — 2단계 물건 줄 두 번 누르기. 머리(버튼)는 고정, 안쪽만 스크롤 */
body.pp-open { overflow: hidden; }
.pp { position: fixed; inset: 0; z-index: 70; background: rgba(27, 33, 48, .38); display: flex; align-items: stretch; justify-content: center; padding: 16px; }
.pp[hidden] { display: none; }
.pp-box { background: #fff; border-radius: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, .22); width: min(1480px, 100%); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.pp-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--line); background: #fff; flex: 0 0 auto; }
.pp-ttl { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1 1 260px; flex-wrap: wrap; }
.pp-ttl h3 { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pp-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pp-acts .chk-inline { margin-right: 4px; }
.pp-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px 16px; background: var(--bg2); border-bottom: 1px solid var(--line); font-size: 13px; flex: 0 0 auto; max-height: 30vh; overflow: auto; }
.pp-fact i { font-style: normal; color: var(--muted); margin-right: 5px; font-size: 12px; }
.pp-fact.ok { color: var(--ok); } .pp-fact.warn { color: var(--warn); }
.pp-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 14px 16px 24px; display: grid; gap: 14px; align-content: start; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.pp-sec { min-width: 0; }
.pp-sec > h4 { font-size: 15px; margin-bottom: 8px; }
.pp-sec .bc { margin-top: 0; }
.pp-job h4 { font-size: 15px; }
.pp-job .progress .bar i.indet { width: 100%; opacity: .35; animation: pp-pulse 1.2s ease-in-out infinite; }
@keyframes pp-pulse { 50% { opacity: .8; } }
.pp-res { display: grid; gap: 6px; }
.pp-outs { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.pp-outs li, .pp-list .of { display: flex; align-items: center; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
.pp-outs .acts, .pp-list .acts { display: inline-flex; gap: 4px; }
.pp-log pre { max-height: 200px; overflow: auto; background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 8px; font-size: 12px; white-space: pre-wrap; }
.pp-panel { margin-bottom: 14px; }
.pp-list { max-height: 300px; }
.pp-list tr.click { cursor: pointer; }
.pp-bdgs { margin-left: 4px; white-space: nowrap; }
.pp-bdg { display: inline-block; font-size: 11px; line-height: 16px; border-radius: 4px; padding: 0 5px; margin-left: 3px; font-weight: 600; vertical-align: 1px; }
.pp-bdg.price { background: var(--navy-bg); color: var(--navy); }
.pp-bdg.rep { background: var(--ok-bg); color: var(--ok); }
.pp-bdg.bad { background: var(--bad-bg); color: var(--bad); }
@media (max-width: 900px) {
  .pp { padding: 0; }
  .pp-box { border-radius: 0; }
  .pp-head { padding: 8px 10px; gap: 8px; }
  .pp-acts { width: 100%; }
  .pp-acts .chk-inline { flex: 1 1 100%; order: 9; margin: 0; }
  .pp-facts { padding: 6px 10px; max-height: 22vh; }
  .pp-body { padding: 10px 10px 20px; }
  .pp-list .hm { display: none; }
}

/* 2026-10-13 2단계 물건 목록 우클릭(길게 누르기) 메뉴 · 보고서 초안 진행 창(draftmenu.js) · 새 버전 띠(version.js) */
.cm { position: fixed; z-index: 76; min-width: 220px; max-width: min(360px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow: auto; background: #fff; border: 1px solid var(--line2); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(20, 30, 50, .18); padding: 4px; display: grid; gap: 1px; }
.cm[hidden] { display: none; }
.cm-sub { z-index: 77; min-width: 240px; }
.cm-h { padding: 6px 10px 7px; border-bottom: 1px solid var(--line); margin-bottom: 3px; display: grid; gap: 1px; }
.cm-h b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-it { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: none; color: var(--ink); font: inherit; padding: 7px 10px; border-radius: 5px; cursor: pointer; min-height: 34px; }
.cm-it:hover:not([disabled]), .cm-it:focus-visible, .cm-it.on { background: var(--navy-bg); outline: none; }
.cm-it[disabled] { color: var(--muted); cursor: default; }
.cm-it.cur { font-weight: 600; color: var(--navy); }
.cm-l { flex: 1 1 auto; min-width: 0; display: grid; }
.cm-l small { font-weight: 400; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-chk { width: 14px; flex: 0 0 14px; color: var(--navy); font-weight: 700; }
.cm-arr { color: var(--muted); font-size: 11px; }
.cm-n { font-size: 11px; color: var(--muted); white-space: nowrap; border: 1px solid var(--line); border-radius: 99px; padding: 0 6px; }
.cm-n.bad { color: var(--bad); border-color: #f1c7c2; background: var(--bad-bg); }
.cm-it.noperm .cm-n { color: var(--warn); }
.cm-sep { height: 1px; background: var(--line); margin: 3px 4px; }
.cm-note { font-size: 12px; color: var(--muted); padding: 6px 10px; margin: 0; }
#c-list tr.cm-flash td { animation: cm-flash 2.4s ease-out; }
@keyframes cm-flash { 0%, 40% { background: var(--human); } 100% { background: transparent; } }
@media (pointer: coarse) { #c-list tbody tr { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; } .cm-it { min-height: 42px; } }
.rdp { position: fixed; inset: 0; z-index: 75; background: rgba(27, 33, 48, .32); display: flex; align-items: center; justify-content: center; padding: 16px; }
.rdp[hidden] { display: none; }
.rdp-box { background: #fff; border-radius: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, .22); width: min(640px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; }
.rdp-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.rdp-head h3 { font-size: 16px; }
.rdp-sub { padding: 8px 14px 0; margin: 0; color: var(--ink2); }
.rdp-body { padding: 10px 14px; overflow: auto; min-height: 0; flex: 1 1 auto; }
.rdp-body .pp-job { display: grid; gap: 8px; }
.rdp-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--bg2); }
.upd-bar { position: fixed; left: 50%; bottom: 72px; transform: translateX(-50%); z-index: 85; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--navy); color: var(--navy);
  border-radius: 99px; padding: 6px 8px 6px 16px; box-shadow: 0 6px 20px rgba(20, 30, 50, .18); font-weight: 600; max-width: calc(100vw - 32px); }
.upd-bar[hidden] { display: none; }

/* 2026-10-14 목록 공통(listkit.js) — 1단계 검토목록 · 2단계 물건 목록 · 3단계 생성된 보고서가 같은 모양
   머리 [☐] · 오른쪽 위 [일괄 수정][일괄삭제 (n)] · 줄 끝 [수정][삭제] · 권한 없으면 회색(마우스를 올리면 이유) */
.lk-chk { width: 16px; height: 16px; margin: 0; cursor: pointer; vertical-align: middle; accent-color: var(--navy); }
.lk-all { display: inline-flex; align-items: center; align-self: center; cursor: pointer; }
.lk-bulk { display: inline-flex; gap: 4px; align-items: center; }
.btn.lk-bdel { border-color: var(--bad); color: var(--bad); background: #fff; }
.btn.lk-bdel:not([disabled]):hover { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.btn.lk-bdel[disabled] { border-color: #f1b8b2; color: #d9918a; }
.btn.lk-edit, .btn.lk-del { padding: 3px 8px; font-size: 12.5px; }
.btn.lk-edit + .btn.lk-del { margin-left: 3px; }
.btn.lk-del:not([disabled]):hover { border-color: var(--bad); color: var(--bad); background: var(--bad-bg); }
.btn.lk-edit:disabled, .btn.lk-del:disabled, .btn.lk-bedit:disabled, .btn.lk-bdel:disabled, #cl-bdel:disabled { pointer-events: auto; cursor: not-allowed; }   /* 회색이어도 이유(title)가 보이게 */
tr.lk-on > td { background: var(--navy-bg); }
.lk-c { width: 30px; text-align: center; }
.lk-acts { white-space: nowrap; text-align: right; }
.lk-acts-h { text-align: right; }
.lk-ask { white-space: pre-wrap; font: inherit; font-size: 13px; margin: 0 0 10px; max-height: 260px; overflow: auto; background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.lk-ask-ck { display: flex; gap: 6px; align-items: center; font-size: 13px; margin: 6px 0; }
.lk-ask-ck input, .lk-files input { width: 16px; height: 16px; }
.lk-ask-msg:empty { display: none; }
.lk-files { display: grid; gap: 4px; margin: 6px 0 10px; font-size: 13px; max-height: 220px; overflow: auto; }
.lk-files label { display: flex; gap: 6px; align-items: center; }
.btn.lk-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.lk-danger:hover { background: #8f1c13; border-color: #8f1c13; color: #fff; }
