/* (주)바름 파트너 정산 — 화면 스타일. 우리 CRM(메디컬오 · KeyCRM 모양)과 같은 틀·글꼴·색.
   외부 글꼴·CDN 없이 자체 파일만(글꼴 = /fonts.css의 Pretendard). 인라인 스타일 금지(보안 설정). */
:root {
  --bg: #ffffff; --panel: #f8fafc; --sidebar: #f3f4f6; --card: #ffffff;
  --line: #e5e7eb; --soft-line: #edf0f3; --line-strong: #cbd5e1;
  --ink: #111827; --ink-2: #334155; --navy: #223047; --muted: #64748b; --faint: #94a3b8;
  --blue: #246bff; --blue-2: #3b82f6; --blue-ink: #2466ba; --blue-bg: #edf5ff; --blue-line: #bed4f5;
  --green: #047857; --green-bg: #ecfdf5; --green-line: #a7f3d0;
  --amber: #8f5500; --amber-bg: #fdf3e3; --amber-line: #f3d9ae;
  --red: #b42318; --red-bg: #fef3f2; --red-line: #fecdca;
  --radius: 12px; --radius-sm: 8px;
  --side-w: 84px;
  font-family: "Pretendard Variable", Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  color: var(--ink); background: var(--bg);
  -webkit-text-size-adjust: 100%;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* .b(inline-flex) 같은 모양 규칙이 hidden을 이기지 않게 */
html, body { margin: 0; padding: 0; background: var(--bg); }
body { min-height: 100vh; line-height: 1.55; font-size: 15px; letter-spacing: -.005em; -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--blue-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid rgba(59, 130, 246, .5); outline-offset: 2px; }
.num, .won { font-variant-numeric: tabular-nums; }
.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ── 왼쪽 아이콘 메뉴(CRM과 같은 모양) ── */
.side { position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--side-w); display: flex; flex-direction: column; align-items: center;
        background: var(--sidebar); border-right: 1px solid #dfe3e8; }
.side-brand { display: grid; place-items: center; width: 100%; height: 68px; }
.side-brand:hover { text-decoration: none; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; flex: none; }
.side .tabs { display: flex; flex-direction: column; gap: 2px; width: 100%; padding-top: 6px; }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; height: 68px; padding: 0 4px;
       color: #9ba7b7; font-size: 11px; font-weight: 500; text-align: center; line-height: 1.25; border-left: 3px solid transparent; }
.tab:hover { color: var(--muted); text-decoration: none; }
.tab.on { color: var(--ink); font-weight: 600; border-left-color: var(--blue); background: #eceff3; }
.tab.on .ic { stroke-width: 2; }
.tab-label { word-break: keep-all; }
.count { position: absolute; top: 9px; right: 16px; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #e5484d; color: #fff;
         font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center; }
.side-me { margin-top: auto; width: calc(100% - 12px); margin-bottom: 10px; padding: 10px 6px; border-radius: 10px; background: var(--navy); color: #fff;
           display: grid; gap: 2px; text-align: center; }
.side-me small { font-size: 10px; color: #b8c2d3; }
.side-me b { font-size: 12px; font-weight: 700; word-break: break-all; line-height: 1.3; }

/* ── 위쪽 제목줄 + 본문 ── */
.frame { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 10; height: 64px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
       background: #fff; border-bottom: 1px solid var(--line); }
.top-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top-title b, .top-title h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; color: var(--ink); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #eaf2ff; color: var(--blue-ink); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.me-box { display: inline-flex; align-items: center; gap: 7px; min-width: 0; padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
          color: var(--ink-2); font-size: 13px; font-weight: 600; background: #fff; }
.me-box:hover { text-decoration: none; background: var(--panel); }
.me-box .ic { width: 17px; height: 17px; color: var(--muted); }
.me-box .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 28vw; }
main { width: 100%; max-width: 1240px; padding: 28px 28px 56px; flex: 1; }
h1 { font-size: 23px; font-weight: 700; margin: 0 0 6px; letter-spacing: -.02em; color: var(--ink); }
h2 { font-size: 17px; font-weight: 600; margin: 32px 0 12px; letter-spacing: -.015em; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; max-width: 46em; }
footer { padding: 14px 28px; border-top: 1px solid var(--soft-line); background: var(--panel); color: var(--muted); font-size: 13px; }

/* ── 카드·표(CRM 표: 머리줄 옅은 바탕 · 가는 선) ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 12px; }
.grid { display: grid; gap: 12px; }
@media (min-width: 900px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; font-weight: 500; color: #52647d; font-size: 13px; padding: 12px 14px; background: var(--panel); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 14px; border-bottom: 1px solid var(--soft-line); vertical-align: middle; }
tbody tr:hover td { background: #f7fbff; }
td.r, th.r { text-align: right; }
tr:last-child td, tr:last-child th { border-bottom: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.card .table-wrap, .card > table { border: 0; border-radius: 0; }
.card:has(> .table-wrap:only-child), .card:has(> table:only-child) { padding: 0; overflow: hidden; }   /* 표만 든 칸만 — 표·입력이 섞인 칸(계정)은 여백 유지 */
.card .table-wrap:not(:only-child) { border: 1px solid var(--line); border-radius: var(--radius-sm); }
td input[type=month], td select { width: auto; min-width: 140px; padding: 6px 10px; font-size: 13.5px; }
/* 폰: 표를 카드처럼 — 첫 칸 = 카드 제목, 나머지 = 왼쪽 이름표 고정 + 오른쪽 값(화면 검수 6번: 양 끝으로 흩어지던 것) */
@media (max-width: 760px) {
  table.stack thead { display: none; }
  table.stack tr { display: block; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  table.stack tr:last-child { border-bottom: 0; }
  table.stack tbody tr:hover td { background: none; }
  table.stack td { display: block; position: relative; min-height: 24px; border: 0; padding: 3px 0 3px 104px; text-align: left; }   /* px — 큰 글씨 칸(em)에서 값이 밀리지 않게 */
  table.stack td::before { content: attr(data-label); position: absolute; left: 0; top: 4px; width: 96px; color: var(--muted); font-size: 12.5px; font-weight: 400; line-height: 1.6; }
  table.stack td:first-child, table.stack td:not([data-label]), table.stack td.act { padding-left: 0; }
  table.stack td:first-child::before, table.stack td:not([data-label])::before, table.stack td.act::before { content: none; }
  table.stack td:first-child { font-size: 16px; font-weight: 600; padding-bottom: 6px; }
  table.stack td:first-child .small, table.stack td:first-child .s, table.stack td:first-child small { font-size: 13px; font-weight: 400; color: var(--muted); }
  table.stack td.act { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding-top: 10px; width: auto; }   /* 넓은 화면의 width:1%가 폰에서 단추를 자르던 것(재검 🟠2) */
  table.stack td:empty { display: none; }
}

/* ── 첫 화면 큰 숫자 ── */
.hero { padding: 24px; }
.hero .label { font-size: 14px; color: var(--muted); font-weight: 600; }
.hero .big { font-size: 40px; font-weight: 700; letter-spacing: -.035em; margin: 6px 0 8px; color: var(--ink); font-variant-numeric: tabular-nums; }
.big-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
.big-line .big { margin: 6px 0; }
@media (min-width: 900px) { .hero .big { font-size: 48px; } }
.flow { margin-top: 16px; border-top: 1px solid var(--soft-line); padding-top: 12px; }
.flow-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 14.5px; }
.flow-row .k { color: var(--ink-2); }
.flow-row .v { font-variant-numeric: tabular-nums; }
.flow-row.minus .v { color: var(--red); }
.flow-row.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-weight: 700; font-size: 16.5px; }
.flow-row .hint { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }

/* ── 상태 딱지 ── */
.chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 0; white-space: nowrap; vertical-align: middle; }
.chip.ok { color: #146c39; background: #dff3e6; }
.chip.wait { color: #785700; background: #fff1b7; }
.chip.bad { color: #ae2525; background: #fde1e1; }
.chip.info { color: #3975d4; background: #eef4ff; }
.chip.plain { color: var(--muted); background: #f1f5f9; }
.reasons { margin: 8px 0 0; padding-left: 18px; color: var(--amber); font-size: 13.5px; }

/* ── 알림 띠 ── */
.note { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; border: 1px solid #d6e4fb; background: #f3f8ff; color: #1e3a6e; }
.note.warn { border-color: var(--amber-line); background: var(--amber-bg); color: #6b3f00; }
.note.bad { border-color: var(--red-line); background: var(--red-bg); color: #7a1c14; }
.note.ok { border-color: var(--green-line); background: var(--green-bg); color: #064e3b; }

/* ── 달 고르기·하위 탭(CRM 탭: 밑줄) ── */
.months { display: flex; gap: 2px; overflow-x: auto; margin: 0 0 18px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.months::-webkit-scrollbar { display: none; }
.months.wrap { flex-wrap: wrap; overflow-x: visible; }
.month { padding: 11px 16px 10px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none;
         font-size: 15px; font-weight: 600; color: var(--muted); white-space: nowrap; cursor: pointer; }
.month:hover { color: var(--ink); }
.month.on { color: var(--blue); border-bottom-color: var(--blue); }
/* 달 고르기: 회색 조건 띠 안 알약(하위 메뉴 밑줄 탭과 구분) */
.months.picker { align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.months.picker .pick-label { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 6px 0 4px; white-space: nowrap; }
.months.picker .month { margin: 0; padding: 0 14px; height: 34px; border: 1px solid transparent; border-radius: 8px; font-size: 14px; }
.months.picker .month.on { background: #fff; color: var(--blue); border-color: var(--blue-line); }
.months.picker .month .st { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; }

/* ── 목록 줄 ── */
.row-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--soft-line); color: inherit; }
.row-link:last-child { border-bottom: 0; }
.row-link:hover { text-decoration: none; background: #fafbfc; }
.row-link > :first-child { flex: 1; min-width: 0; }   /* 금액이 줄 가운데 뜨지 않고 › 옆에 붙게 */
.row-link .t { font-weight: 600; }
.row-link .s { font-size: 13px; color: var(--muted); }
.row-link .v { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* 본사(PG)가 직접 정산하는 대리점 — 내 돈과 무관한 참고 금액이라 흐리게 */
.card.ref .row-link .won { color: var(--muted); font-weight: 400; }

/* ── 입력 ── */
form.f { display: grid; gap: 14px; }
.grid { align-items: start; }
.field { align-content: start; }
.field { display: grid; gap: 5px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 13px; }
input[type=text], input[type=password], input[type=number], input[type=month], select, textarea {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid #d5dbe3; border-radius: var(--radius-sm); background: #fff; font-size: 15px; }
textarea { height: auto; min-height: 88px; padding: 10px 12px; }
input[type=file] { width: 100%; font-size: 14px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(59, 130, 246, .3); border-color: var(--blue-2); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.check { padding: 6px 0; cursor: pointer; }
.check input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--blue); flex: none; }
.radio-cards { display: grid; gap: 8px; }
.radio-card { display: flex; gap: 10px; padding: 12px 14px; border: 1px solid #d5dbe3; border-radius: var(--radius-sm); cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--blue-2); background: var(--blue-bg); }
.radio-card small { display: block; color: var(--muted); font-size: 12.5px; }

/* ── 단추(CRM: 흰 바탕 테두리 · 주 단추만 파랑) ── */
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
button.b, a.b, label.b { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
                border: 1px solid var(--line-strong); background: #fff; color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; line-height: 1.3; }
button.b:hover, a.b:hover, label.b:hover { background: var(--panel); text-decoration: none; }
button.b.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
button.b.primary:hover { background: #1d5be0; }
button.b.danger { color: var(--red); border-color: var(--red-line); }
button.b.danger:hover { background: var(--red-bg); }
button.b.small, a.b.small { height: 32px; padding: 0 11px; font-size: 13px; }
button.b.soft, a.b.soft, label.b.soft { background: var(--blue-bg); color: var(--blue-ink); border-color: var(--blue-line); }
button.b.soft:hover, a.b.soft:hover, label.b.soft:hover { background: #e2eeff; }
/* 위험 단추 확인 대기(두 번째 누름 기다림) — 빨간 채움 */
button.b.danger[data-armed] { background: #dc2626; border-color: #dc2626; color: #fff; }
button.b .ic, a.b .ic { width: 16px; height: 16px; }
.who button.b { white-space: nowrap; flex: none; }
button.b:disabled { opacity: .5; cursor: default; }
button.link { background: none; border: 0; padding: 0; color: var(--blue-ink); font-weight: 600; cursor: pointer; }
.msg { font-size: 13.5px; min-height: 18px; }
.msg:empty { display: none; }
.msg.bad { color: var(--red); }
.msg.ok { color: var(--green); }
.secret { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 18px; letter-spacing: .06em; background: #f1f5f9; border: 1px dashed var(--line-strong); border-radius: 8px; padding: 8px 12px; user-select: all; }
.empty { color: var(--muted); font-size: 14px; padding: 20px 0; text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.gap { height: 12px; }

/* ── 로그인 ── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--panel); }
.login { width: 100%; max-width: 400px; padding: 28px; }
.login .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.brand-name { font-weight: 800; font-size: 16px; white-space: nowrap; letter-spacing: -.02em; }
.brand-sub { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* 하부점 닫기·다시 열기: 달 칸 + 단추를 한 줄에 작게 */
.close-ctl { flex-wrap: nowrap; }
.close-ctl input[type=month] { width: 150px; padding: 6px 10px; font-size: 13.5px; }

/* 간격 도우미(인라인 style 대신 — 보안 설정이 인라인 스타일을 막는다) */
.mt8 { margin-top: 8px; } .mt10 { margin-top: 10px; } .mt14 { margin-top: 14px; } .my8 { margin: 8px 0; }
.row-link.flat { border: 0; padding: 0; }
td.changed { color: var(--blue-ink); font-weight: 700; }

/* 달을 바꾸는 동안(새 화면이 뜰 때까지) 흐리게 — 눌린 게 바로 보이게 */
#app.loading main { opacity: .5; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) { #app main { transition: opacity .12s; } }

/* ── 폰: 왼쪽 메뉴 → 아래 탭 막대 ── */
@media (max-width: 760px) {
  .side { inset: auto 0 0 0; width: 100%; height: calc(64px + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
          flex-direction: row; border-right: 0; border-top: 1px solid #dfe3e8; background: #fff; }
  .side-brand, .side-me { display: none; }
  .side .tabs { flex-direction: row; gap: 0; padding: 0; height: 64px; }
  .tab { flex: 1; height: 64px; font-size: 10.5px; gap: 4px; border-left: 0; border-top: 2px solid transparent; }
  .tab.on { border-top-color: var(--blue); background: none; color: var(--blue); }
  .count { top: 6px; right: calc(50% - 22px); }
  .frame { margin-left: 0; padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .top { height: 56px; padding: 0 14px; }
  .top-title b, .top-title h1 { font-size: 18px; }
  .pill { display: none; }
  .me-box { padding: 7px 9px; }
  .me-box .name { max-width: 24vw; }
  .me-box .chip { display: none; }
  main { padding: 18px 14px 28px; }
  input[type=text], input[type=password], input[type=number], input[type=month], select { font-size: 16px; height: 44px; }
  textarea { font-size: 16px; }
  button.b, a.b, label.b { min-height: 44px; }
  button.b.small, a.b.small { min-height: 44px; padding: 0 14px; }   /* 폰 누르기 칸 44px(재검 🟡16) */
  .close-ctl { flex-wrap: wrap; }
  .months.wrap { flex-wrap: nowrap; overflow-x: auto; }
  h1 { font-size: 20px; }
  .card { padding: 16px; }
  .hero { padding: 18px; }
  footer { padding: 12px 14px; }
}
@media (max-width: 380px) { .me-box .name { display: none; } }

/* ── 목록 위 도구 줄(제목 + [+ 새 ○○]) ── */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.toolbar h2 { margin: 0; }
.toolbar + .card:not([hidden]) { margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
td.act { text-align: right; white-space: nowrap; width: 1%; }
td .t { font-weight: 600; }

/* ── 오른쪽 서랍(폰은 전체 화면) ── */
body.drawer-open { overflow: hidden; }
.drawer-wrap { position: fixed; inset: 0; z-index: 50; }
.shade { position: absolute; inset: 0; background: rgba(15, 23, 42, .35); }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(480px, 100%); display: flex; flex-direction: column; background: #fff;
          border-left: 1px solid var(--line); box-shadow: -12px 0 32px rgba(15, 23, 42, .12); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 19px; font-weight: 700; }
.drawer-head h2:focus { outline: none; }
.drawer-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.drawer-x { flex: none; width: 44px; height: 44px; margin: -8px -10px 0 0; display: grid; place-items: center; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
.drawer-x:hover { background: var(--panel); color: var(--ink); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 28px; display: grid; gap: 12px; align-content: start; }
.drawer-body h3.dz-title { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); }
.link-list { border: 1px solid var(--line); border-radius: var(--radius-sm); }
.link-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--soft-line); }
.link-row:last-child { border-bottom: 0; }
.link-main { min-width: 0; flex: 1; }
.link-main .t { font-weight: 600; }
.link-act { flex: none; flex-wrap: nowrap; }
.range-edit { margin-top: 8px; }
.range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; }
.range input, .range select { height: 38px; font-size: 14px; }
.add-box { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
.danger-zone { margin-top: 12px; border: 1px solid var(--red-line); border-radius: var(--radius-sm); padding: 4px 14px; }
.danger-zone h3 { margin: 10px 0 2px; font-size: 14px; color: var(--red); }
.dz-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--soft-line); }
.dz-row:first-of-type { border-top: 0; }
.dz-row .b { flex: none; }
@media (max-width: 760px) {
  .drawer { width: 100%; border-left: 0; box-shadow: none; }
  .drawer-head { padding: 12px 14px 10px; }
  .drawer-body { padding: 14px 14px 28px; }
  .link-row { flex-direction: column; }
  .link-act { align-self: flex-end; }
  .dz-row { flex-direction: column; align-items: stretch; }
  .dz-row .b { align-self: flex-end; }
  .range input, .range select { height: 44px; font-size: 16px; }
}

/* 승인함: 반려(왼쪽) · 확정(오른쪽)을 떼어 놓는다 */
.btns.split { justify-content: space-between; }
details.same summary { cursor: pointer; color: var(--muted); font-size: 13.5px; padding: 4px 0; }
@media (max-width: 760px) { .btns.split .b { flex: 1; min-height: 48px; } }

/* 합계 줄 · 돌아가기 · 핵심 금액(내 몫) */
tfoot tr.total td { background: var(--panel); font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; }
td.key { font-weight: 700; }
a.back { display: inline-block; margin: 0 0 8px; font-size: 14px; font-weight: 600; }
@media (max-width: 760px) {
  table.stack tfoot tr.total { background: var(--panel); }
  table.stack tfoot tr.total td { border: 0; background: none; }
  table.stack tfoot td:not(:first-child):empty { display: none; }
  table.stack td.key { font-size: 18px; }
}

/* 할 일 띠 · 줄 끝 › · 계산 규칙 개수 띠 · 파일 고르기 */
.todo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--blue-line); border-radius: var(--radius-sm); background: var(--blue-bg); font-size: 14px; }
.todo b { color: var(--blue-ink); }
.todo-item { display: inline-flex; gap: 8px; align-items: baseline; color: var(--ink); font-weight: 600; }
.todo-item .go { color: var(--blue-ink); }
.todo-item.muted { font-weight: 400; color: var(--muted); }
.row-link .chev { flex: none; color: var(--faint); font-size: 20px; line-height: 1; margin-left: -4px; }
.count-band { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 16px 20px; border: 1px solid var(--amber-line); border-radius: var(--radius); background: var(--amber-bg); color: #6b3f00; font-size: 14px; }
.count-band .n { font-size: 30px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.count-band.all { border-color: var(--green-line); background: var(--green-bg); color: #064e3b; }
.rule-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.rule-head h3 { margin: 0; }
input.sr-only, .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.file-pick input:focus-visible + label { outline: 2px solid rgba(59, 130, 246, .5); outline-offset: 2px; }
.file-pick .file-name { overflow-wrap: anywhere; }
.hold-tip { margin-top: 8px; font-weight: 600; color: #7a3d00; }
.secret-box.nudge { outline: 3px solid #d97706; outline-offset: 2px; }
.effects { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
.effects li.muted { list-style: none; margin-left: -18px; }
.danger-zone .field, .add-box .field { margin-top: 6px; }
.drawer .grid.two, .drawer .grid.three { grid-template-columns: 1fr; }   /* 서랍(480px) 안에서는 한 줄에 칸 하나 */

/* 첫 화면: 진행 띠 · 조직별 작은 카드 · 입금 요약 */
.steps-bar { list-style: none; margin: 10px 0 4px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.steps-bar li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.steps-bar li.done { border-color: var(--green-line); background: var(--green-bg); }
.steps-bar .dot { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: #f1f5f9; color: var(--muted); }
.steps-bar li.done .dot { background: #16a34a; color: #fff; }
.steps-bar b { display: block; font-size: 13.5px; }
.steps-bar small { display: block; font-size: 12.5px; color: var(--muted); }
.org-grid { display: grid; gap: 12px; margin-top: 14px; }
@media (min-width: 900px) { .org-grid { grid-template-columns: 1fr 1fr; } }
.org { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.org-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.org-head h3 { margin: 0; }
.org .flow { margin-top: 10px; }
.pay-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
@media (max-width: 760px) { .pay-meta { grid-template-columns: 1fr 1fr; } .pay-meta > div:last-child { grid-column: 1 / -1; } }
.pay-meta > div { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--soft-line); }
.pay-meta small { display: block; font-size: 12.5px; color: var(--muted); }
.pay-meta b { font-size: 14.5px; }
@media (max-width: 760px) {   /* 폰: 세 칸은 가로로 두되 점을 글 위에 — 세로로 쌓으면 한 화면을 다 먹는다 */
  .steps-bar { gap: 6px; }
  .steps-bar li { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; }
  .steps-bar b { font-size: 13px; line-height: 1.35; }
  .steps-bar small { font-size: 12px; line-height: 1.35; }
}
/* 숫자·전화·비밀번호는 줄 중간에서 꺾지 않는다(재검 🟡N22) */
.won, .big, .secret, .nowrap { white-space: nowrap; overflow-wrap: normal; }   /* 전화 링크는 메모가 붙을 수 있어 꺾이게 둔다(재검 🟡P-10) */
.table-note { padding: 10px 14px; border-top: 1px solid var(--soft-line); }
.drawer-status:empty { display: none; }
.drawer-status { margin-top: 6px; }
.secret { overflow-x: auto; }
@media (max-width: 760px) { .hero .big { font-size: 34px; } }
/* 짧은 알림 — 우리 CRM 토스트 값(남색·오른쪽 아래), 폰은 아래 탭 막대 위로 */
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 60; max-width: min(420px, calc(100vw - 32px)); display: flex; gap: 10px; align-items: flex-start;
         background: #223047; color: #fff; border-radius: 9px; padding: 12px 14px; font-size: 13px; line-height: 1.5; box-shadow: 0 10px 28px rgba(15,23,42,.2); }
.toast-x { background: none; border: 0; color: #cbd5e1; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; min-height: 0; }
@media (max-width: 760px) { .toast { left: 16px; right: 16px; max-width: none; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } .toast-x { min-width: 32px; min-height: 32px; } }
