/*!*************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[13].oneOf[10].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[13].oneOf[10].use[3]!./app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************/
:root {
  --bg: #fbfbfa;
  --panel: #ffffff;
  --border: #e4e4e1;
  --text: #1c1c1a;
  --muted: #7a7a72;
  --accent: #2f6f4e;
  --warn-bg: #fdf6ec;
  --warn-br: #e6cfa8;
  --warn-tx: #7a5116;
  --bad: #a03232;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17171a;
    --panel: #1f1f23;
    --border: #33333a;
    --text: #ececea;
    --muted: #9a9a94;
    --accent: #6fbf92;
    --warn-bg: #2a2318;
    --warn-br: #574526;
    --warn-tx: #e0bd80;
    --bad: #e08585;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, "Segoe UI", "Pretendard", "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
}

main { max-width: 1040px; margin: 0 auto; padding: 32px 24px 96px; }
main.wide { max-width: 1360px; }   /* POS 입력 표 — 오른쪽 열이 잘리지 않게 */

h1 { font-size: 19px; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 14px; margin: 30px 0 10px; letter-spacing: -0.01em; color: var(--muted); font-weight: 600; }
.sub { color: var(--muted); font-size: 12.5px; margin: 2px 0 0; }
.muted { color: var(--muted); }
.bad { color: var(--bad); }
.ok { color: var(--accent); }
.sm { font-size: 12.5px; }
.est { color: var(--warn-tx); }   /* 확인 전 추정값 */
.b { font-weight: 600; }

/* 상단 */
.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.ymsel { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.ymsel b { font-size: 14px; min-width: 88px; text-align: center; }

/* 경고 */
.alerts {
  background: var(--warn-bg); border: 1px solid var(--warn-br);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px;
}
.alerts p { margin: 0; font-size: 13px; line-height: 1.65; color: var(--warn-tx); }
.alerts p + p { margin-top: 6px; }

/* 드롭존 */
.drop {
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  padding: 30px 24px; text-align: center; background: var(--panel);
  transition: border-color .15s, background .15s; cursor: pointer;
}
.drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--panel)); }
.drop strong { display: block; font-size: 14.5px; font-weight: 600; margin-bottom: 4px; }
.drop span { color: var(--muted); font-size: 12.5px; }

.upl {
  font-size: 13px; padding: 8px 14px; margin-top: 8px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
}

/* 카드 */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
}

/* 표 */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 5px 8px; text-align: right; }
th:first-child, td:first-child { text-align: left; }
thead th { color: var(--muted); font-weight: 500; font-size: 12.5px; border-bottom: 1px solid var(--border); }
td.num, input.num { font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
td.ind { padding-left: 18px; }

tr.sec td {
  color: var(--muted); font-size: 12px; font-weight: 600;
  padding-top: 14px; padding-bottom: 2px; letter-spacing: .02em;
}
tr.total td { border-top: 1px solid var(--border); font-weight: 600; padding-top: 8px; }
tr.grand td {
  border-top: 2px solid var(--border); font-weight: 700; font-size: 15px;
  padding-top: 10px; color: var(--accent);
}

.note { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; line-height: 1.6; }

/* 입력 */
button {
  padding: 6px 12px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--border); border-radius: 7px;
  background: var(--panel); color: var(--text); cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }
button.x { border: 0; color: var(--muted); padding: 2px 6px; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--panel); }
button.primary:hover:not(:disabled) { color: var(--panel); filter: brightness(1.08); }
button.linkbtn { border: 0; background: none; padding: 4px 0; color: var(--accent); font-size: 12.5px; }
button.linkbtn:hover { text-decoration: underline; }

input, select {
  padding: 5px 8px; font-size: 13.5px; font-family: inherit;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text);
}
input:focus, select:focus { outline: none; border-color: var(--accent); }

.grp {
  font-size: 12px; color: var(--muted); font-weight: 600;
  margin: 14px 0 8px; letter-spacing: .02em;
}
.flds { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); grid-gap: 10px; gap: 10px; }
.fld { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.fld span { color: var(--muted); }
.fld input { text-align: right; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
.fld em { font-style: normal; font-size: 11.5px; color: var(--muted); }

.pw { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pw input { width: 130px; }

table.exp td { padding: 3px 6px; vertical-align: top; }
table.exp input:not([type="checkbox"]) { width: 100%; }
table.exp td:nth-child(3) input { text-align: right; }
table.exp td:nth-child(1) { width: 104px; }
table.exp td:nth-child(3) { width: 130px; }
table.exp td:nth-child(4) { width: 44px; }
table.exp td:nth-child(5) { width: 76px; }
table.exp td:nth-child(6) { width: 44px; }
table.exp th:nth-child(4), table.exp th:nth-child(5) { text-align: center; white-space: nowrap; }
table.exp td:nth-child(5) { width: 92px; }
table.exp td.ctr { text-align: center; padding-top: 9px; }
table.exp td.ctr input { width: 18px; height: 18px; accent-color: var(--accent); }
table.exp td.exp-add { width: auto; padding: 6px 6px 4px; }
table.exp tr.estrow td:nth-child(3) input { border-color: var(--warn-br); background: var(--warn-bg); }
.itemcell { display: flex; align-items: center; gap: 6px; }
.exp-note { font-size: 11.5px; padding: 2px 2px 0; line-height: 1.4; }
button.x.big { width: 34px; height: 34px; font-size: 18px; line-height: 1; border-radius: 8px; }
button.x.big:hover { background: color-mix(in srgb, var(--bad) 10%, var(--panel)); color: var(--bad); }
.tplgroups { display: flex; flex-direction: column; gap: 6px; }
.tplgrp { display: grid; grid-template-columns: 64px 1fr; grid-gap: 8px; gap: 8px; align-items: baseline; }
.tpllabel { font-size: 12px; color: var(--muted); font-weight: 600; }

.btns { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.btns .muted { margin-left: auto; font-size: 13px; }

/* 상단 탭 */
.maintabs {
  display: flex; gap: 2px; margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.maintabs button {
  border: 0; border-radius: 0; background: none; padding: 8px 14px;
  font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent;
  margin-bottom: -1px; position: relative;
}
.maintabs button:hover { color: var(--text); }
.maintabs button.on { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.maintabs .dot {
  display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--warn-br); margin-left: 5px; vertical-align: 3px;
}

/* 카드 안 탭 */
/* POS 매출 — 왼쪽 사이드바에서 표를 고르고, 오른쪽에 그 표를 보여준다 */
.poslayout { display: grid; grid-template-columns: 190px minmax(0, 1fr); grid-gap: 14px; gap: 14px; align-items: start; }
.poslayout .side { position: -webkit-sticky; position: sticky; top: 16px; padding: 10px; }
.sidenav { display: flex; flex-direction: column; gap: 2px; }
.sidenav button {
  display: flex; flex-direction: column; gap: 1px; text-align: left;
  border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; font-weight: 600;
}
.sidenav button em { font-style: normal; font-size: 11.5px; font-weight: 400; color: var(--muted); }
.sidenav button.on { background: color-mix(in srgb, var(--accent) 10%, var(--panel)); color: var(--accent); }
.sidesum { border-top: 1px solid var(--border); margin-top: 10px; padding: 0 4px; }
.sidesum dl { display: grid; grid-template-columns: auto 1fr; grid-gap: 5px 8px; gap: 5px 8px; margin: 0; font-size: 12.5px; }
.sidesum dt { color: var(--muted); }
.sidesum dd { margin: 0; text-align: right; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sidesum .note { font-size: 11.5px; }
.posmain { min-width: 0; }
@media (max-width: 760px) {
  .poslayout { grid-template-columns: 1fr; }
  .poslayout .side { position: static; }
  .sidenav { flex-direction: row; flex-wrap: wrap; }
  .sidenav button em { display: none; }
}

.tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.tabs button { font-size: 12.5px; padding: 5px 12px; }
.tabs button.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* 칩 · 체크 */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
button.chip {
  font-size: 12px; padding: 4px 10px; border-radius: 999px; font-weight: 400;
}
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.chk {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 12.5px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted);
}
.chk.on { border-color: var(--accent); color: var(--accent); }
.chk input { margin: 0; accent-color: var(--accent); }

.chanlist { display: flex; flex-direction: column; gap: 6px; }
.chanrow {
  display: flex; align-items: baseline; gap: 9px; cursor: pointer;
  padding: 7px 11px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; color: var(--muted);
}
.chanrow.on { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.chanrow.on b { color: var(--text); }
.chanrow b { font-weight: 600; white-space: nowrap; }
.chanrow em { font-style: normal; font-size: 12px; color: var(--muted); }
.chanrow input { margin: 0; accent-color: var(--accent); }

a { color: var(--accent); cursor: pointer; text-decoration: none; }
a:hover { text-decoration: underline; }

/* 일별 그리드 */
/* 제목 행·날짜 열·합계 행이 고정되도록 표 안에서 스크롤한다 */
.gridwrap {
  overflow: auto; border: 1px solid var(--border); border-radius: 8px;
  max-height: calc(100vh - 250px); min-height: 320px;
}
table.grid { font-size: 12px; border-collapse: separate; border-spacing: 0; min-width: 100%; }
table.grid th, table.grid td { padding: 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
table.grid thead th {
  position: -webkit-sticky;
  position: sticky; top: 0; z-index: 2; background: var(--panel);
  padding: 6px 6px; font-size: 11.5px; white-space: nowrap;
  border-bottom: 1px solid var(--border); text-align: center;
}
table.grid thead th.rec { color: var(--accent); }
table.grid td.day, table.grid th.day {
  position: -webkit-sticky;
  position: sticky; left: 0; z-index: 1; background: var(--panel);
  width: 34px; min-width: 34px; text-align: center; color: var(--muted);
  font-size: 11.5px; border-right: 1px solid var(--border);
}
table.grid thead th.day { z-index: 3; }
table.grid td input {
  width: 100%; min-width: 82px; border: 0; border-radius: 0; background: transparent;
  padding: 4px 6px; text-align: right; font-size: 12px; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums;
}
table.grid td input:focus {
  outline: 2px solid var(--accent); outline-offset: -2px;
  background: color-mix(in srgb, var(--accent) 6%, var(--panel));
}
table.grid tfoot td {
  position: -webkit-sticky;
  position: sticky; bottom: 0; background: var(--panel);
  border-top: 1px solid var(--border); padding: 5px 6px;
  font-weight: 600; font-size: 11.5px;
}
/* 현장결제 열 — 입력 칸이 아니라 명세에서 계산한 값 (결정 25) */
table.grid th.ro, table.grid td.ro {
  color: var(--muted); background: color-mix(in srgb, var(--border) 25%, var(--panel));
  text-align: right; white-space: nowrap; padding: 4px 8px; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums;
  min-width: 78px;
}
table.grid td.ro.est { color: var(--warn-tx); }
/* 자동 합계 열 (매출 · 건수) — 입력 칸이 아니다 */
table.grid th.tot, table.grid td.tot {
  text-align: right; white-space: nowrap; padding: 4px 8px; font-weight: 600;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums; min-width: 86px;
  background: color-mix(in srgb, var(--accent) 6%, var(--panel));
}
table.grid td.cnt input { min-width: 56px; }
table.grid td.ro.bad { color: var(--bad); }
table.grid td.ro em { display: block; font-style: normal; font-size: 10.5px; line-height: 1.2; }
table.grid th small { font-weight: 400; color: var(--muted); font-size: 10.5px; }
/* 칸 묶음 제목 행 (결제수단 / 배달앱 / 기타 주문경로) */
table.grid thead tr.grow th { height: 26px; padding: 3px 6px; font-size: 11px; font-weight: 600; }
table.grid thead tr:nth-child(2) th { top: 26px; }
table.grid thead th.gh { border-left: 1px solid var(--border); color: var(--muted); letter-spacing: .03em; }
table.grid thead th.gh.app { color: var(--accent); }
/* 매출(자동) 열도 날짜 옆에 고정 */
table.grid .stick2 { position: -webkit-sticky; position: sticky; left: 34px; z-index: 1; }
table.grid thead th.stick2 { z-index: 3; }
table.grid tfoot td.day, table.grid tfoot td.stick2 { z-index: 3; }
table.grid td.tot.stick2 { box-shadow: 1px 0 0 var(--border); }
.note.top { margin-top: 0; margin-bottom: 10px; }
/* 저장 버튼은 늘 보이게 */
.savebar {
  position: -webkit-sticky;
  position: sticky; bottom: 0; z-index: 4; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 12px -18px -16px; padding: 10px 18px; background: var(--panel);
  border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius);
}

/* ── 손익: 상단 요약 ─────────────────────────────── */
.ov { padding: 18px 20px; }
.kpis { display: grid; grid-template-columns: 1.3fr 1fr 1fr; grid-gap: 16px; gap: 16px; }
.kpi { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi .k { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi .v { font-size: 22px; font-weight: 700; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi.hero .v { font-size: 30px; color: var(--accent); }
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi .sub.est { color: var(--warn-tx); }
.kpitag {
  align-self: flex-start; font-size: 12px; color: var(--warn-tx); background: var(--warn-bg);
  border: 1px solid var(--warn-br); border-radius: 999px; padding: 1px 9px; margin: 2px 0;
}
details.assume { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
details summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
details summary:hover { color: var(--text); }
details.assume ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
details.assume li { border-left: 3px solid var(--warn-br); padding: 2px 0 2px 10px; }
details.assume .arow { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
details.assume .arow .num { font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; white-space: nowrap; }
details.assume p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.55; }

/* ── 손익: 할 일 ─────────────────────────────────── */
.todos { margin-top: 12px; padding: 12px 16px; }
.todohead { font-size: 13px; margin-bottom: 6px; }
.todos ul { list-style: none; margin: 0; padding: 0; }
.todos li {
  display: grid; grid-template-columns: 10px 1fr auto; grid-gap: 10px; gap: 10px; align-items: center;
  padding: 8px 0; border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.todos li:first-child { border-top: 0; }
.todos .lv { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.todos li.warn .lv { background: var(--warn-br); box-shadow: 0 0 0 2px var(--warn-bg); }
.todos .tx b { font-size: 13.5px; font-weight: 600; }
.todos .tx p {
  margin: 1px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.todos li button { font-size: 12.5px; white-space: nowrap; }
.h2sub { font-weight: 400; margin-left: 6px; }

/* ── 손익: 계산 흐름 ─────────────────────────────── */
table.flow td.src { font-size: 12px; color: var(--muted); text-align: right; }
table.flow td.src.est { color: var(--warn-tx); }
table.flow tr.sec td.num { color: var(--text); font-size: 13.5px; }
table.flow td.ind2 { padding-left: 30px; font-size: 12.5px; }
table.flow tr.subrow td { padding-top: 0; }
.badge {
  display: inline-block; font-size: 11px; font-weight: 600; line-height: 1.5;
  padding: 0 7px; border-radius: 999px; white-space: nowrap; vertical-align: 1px;
}
.badge.est { color: var(--warn-tx); background: var(--warn-bg); border: 1px solid var(--warn-br); }
.badge.ok { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.disclose { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.disclose-btn {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  padding: 11px 16px; font-size: 13.5px; font-weight: 600; background: var(--panel);
}
.disclose-btn span { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.cardtitle { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
details.more { margin-top: 8px; }
details.more summary { font-size: 12.5px; font-weight: 500; }

/* ── 로그인 ──────────────────────────────────────── */
.userbar {
  display: flex; justify-content: flex-end; align-items: center; gap: 10px;
  max-width: 1360px; margin: 0 auto; padding: 8px 24px 0; font-size: 12.5px; color: var(--muted);
}
.userbar form { margin: 0; }
main.login { max-width: 420px; padding-top: 12vh; }
.loginbox { display: flex; flex-direction: column; gap: 10px; padding: 26px 24px; }
.loginbox h1 { font-size: 20px; }
.loginmsg { border-left: 3px solid var(--warn-br); background: var(--warn-bg); padding: 8px 12px; border-radius: 6px; }
.loginmsg.bad { border-left-color: var(--bad); }
.loginmsg b { font-size: 13.5px; }
.loginmsg p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.googlebtn { width: 100%; padding: 10px 12px; font-size: 14px; }

/* ── 운영자 ──────────────────────────────────────── */
.storesel { font-size: 17px; font-weight: 700; padding: 3px 8px; }
.backlink { margin-left: auto; font-size: 13.5px; }
.userbar a { font-weight: 600; }
.adminmsg { margin-bottom: 12px; padding: 10px 16px; font-size: 13.5px; border-color: var(--accent); }
.approw {
  display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr) auto; grid-gap: 12px; gap: 12px; align-items: start;
  padding: 10px 0; border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.approw:first-child { border-top: 0; }
.approw .who { display: flex; flex-direction: column; gap: 1px; min-width: 0; overflow-wrap: anywhere; }
.approw .how { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.approw .howflds { display: flex; gap: 6px; width: 100%; flex-wrap: wrap; }
.approw .howflds input { flex: 1 1 220px; }
.approw .acts { display: flex; gap: 6px; }
.orgchip {
  display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; margin: 1px 4px 1px 0;
  padding: 1px 4px 1px 9px; border: 1px solid var(--border); border-radius: 999px;
}
.rejrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; font-size: 13.5px; }
@media (max-width: 640px) {
  .approw { grid-template-columns: 1fr; }
}

/* ── 거래처 (후불·선불) ───────────────────────────── */
table.grid thead th.acct, table.grid thead th.gh.acct { color: var(--warn-tx); }
.acctcard { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-top: 10px; }
.accthead { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.accthead .badge:not(.est) { color: var(--muted); border: 1px solid var(--border); }
.acctstats { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 10px; gap: 10px; margin: 10px 0; }
.acctstats > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.acctstats span { font-size: 12px; color: var(--muted); }
.acctstats b { font-size: 17px; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
.acctstats small { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.acctstats .bad b, .acctstats .bad small { color: var(--bad); }
table.pay td { padding: 4px 6px; vertical-align: middle; }
table.pay tr.payadd td { border-top: 1px solid var(--border); padding-top: 8px; }
table.pay tr.payadd input, table.pay tr.payadd select { width: 100%; }
table.pay tr.payadd td:nth-child(1) { width: 150px; }
table.pay tr.payadd td:nth-child(2) { width: 130px; }
table.pay tr.payadd td:nth-child(3) { width: 104px; }
table.pay tr.payadd td:nth-child(5) { width: 64px; }
/* 거래처 탭 */
.sidebtns { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.acctinfo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.acctinfo .acctname { font-size: 15px; font-weight: 600; min-width: 180px; flex: 1 1 200px; }
.acctbody { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 1.4fr); grid-gap: 18px; gap: 18px; align-items: start; }
.acctbody section { min-width: 0; }
.gridwrap.deliv { max-height: calc(100vh - 360px); min-height: 280px; }
table.grid td.wk { text-align: center; color: var(--muted); font-size: 11.5px; padding: 0 6px; }
/* 입금 입력: 날짜·금액·수단 한 줄, 메모·버튼 다음 줄로 자연스럽게 넘어간다 */
.payform { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.payform input[type="date"] { flex: 0 0 150px; }
.payform input.num { flex: 1 1 110px; min-width: 0; }
.payform select { flex: 0 0 92px; }
.payform input[aria-label="메모"] { flex: 1 1 180px; min-width: 0; }
.payform button { flex: 0 0 auto; white-space: nowrap; }
table.pay th, table.pay td:nth-child(1), table.pay td:nth-child(2), table.pay td:nth-child(3) { white-space: nowrap; }
table.pay td:nth-child(4) { font-size: 12px; line-height: 1.45; }
@media (max-width: 760px) {
  .acctbody { grid-template-columns: 1fr; }
}
.acctlist { display: flex; flex-direction: column; gap: 6px; }
.acctrow {
  display: grid; grid-template-columns: minmax(0, 1fr) 220px auto; grid-gap: 8px; gap: 8px; align-items: center;
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px;
}
.acctrow:not(.on) { opacity: .6; }
.acctrow input:not([type="checkbox"]) { text-align: left; }
.chk-inline { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.chk-inline input { accent-color: var(--accent); }
@media (max-width: 640px) {
  .acctstats { grid-template-columns: 1fr 1fr; }
  .acctrow { grid-template-columns: 1fr auto; }
  .acctrow select { grid-column: 1 / -1; grid-row: 2; }
  table.pay tr.payadd { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 6px; gap: 6px; }
  table.pay tr.payadd td { width: auto !important; padding: 0; border: 0; }
}

/* ── 정산명세 ────────────────────────────────────── */
.filehead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 12px; }
.filegroup { margin-top: 12px; }
.fghead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14.5px; }
.fgmeta { display: flex; flex-direction: column; gap: 1px; margin: 4px 0 8px; font-size: 12.5px; color: var(--muted); }
.fgmeta b { color: var(--text); font-weight: 600; }
table.brk { font-size: 12.5px; max-width: 420px; margin-top: 6px; }
table.brk td { padding: 2px 6px; }

/* 붙여넣기 */
textarea {
  width: 100%; padding: 10px; font-size: 12.5px; line-height: 1.5;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); resize: vertical;
}
textarea:focus { outline: none; border-color: var(--accent); }
.prev { margin-top: 12px; font-size: 12.5px; }
.prev p { margin: 0 0 4px; }

@media (max-width: 560px) {
  main { padding: 20px 14px 80px; }
  .flds { grid-template-columns: 1fr 1fr; }
}

/* ── 모바일 ───────────────────────────────────────── */
@media (max-width: 640px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi.hero { grid-column: 1 / -1; }
  .kpi .v { font-size: 18px; }
  .kpi.hero .v { font-size: 26px; }
  .todos li { grid-template-columns: 10px 1fr; }
  .todos li button { grid-column: 2; justify-self: start; }
  .h2sub { display: block; margin: 2px 0 0; }

  /* 계산 흐름: 항목 · 금액 한 줄, 기준은 그 아래 */
  table.flow tr { display: grid; grid-template-columns: 1fr auto; }
  table.flow td { padding: 3px 4px; }
  table.flow td.src { grid-column: 1 / -1; text-align: left; padding: 0 4px 4px 18px; }
  table.flow td.src:empty { display: none; }
  table.flow td.ind { padding-left: 12px; }
  table.flow td.ind2 { padding-left: 22px; }

  /* 채널 표는 카드로 — 이름이 한 글자씩 끊어지지 않게 */
  table.rtable thead { display: none; }
  table.rtable, table.rtable tbody, table.rtable tr, table.rtable td { display: block; width: 100%; }
  table.rtable tr { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
  table.rtable td { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; text-align: right; }
  table.rtable td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; }
  table.rtable td:first-child { font-weight: 600; font-size: 14px; }
  table.rtable td:first-child::before { content: none; }

  .savebar { margin: 12px -18px -16px; }
  .tplgrp { grid-template-columns: 1fr; gap: 2px; }
  table.exp thead { display: none; }
  table.exp tr { display: grid; grid-template-columns: 96px 1fr 40px; grid-gap: 4px; gap: 4px; padding: 6px 0;
                 border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
  table.exp td { padding: 0; width: auto !important; }
  table.exp td:nth-child(2) { grid-column: 2 / 4; }
  table.exp td:nth-child(3) { grid-column: 1 / 3; }
  table.exp td.ctr { display: none; }
  table.exp td:nth-child(6) { grid-row: 1; grid-column: 3; }
  table.exp td.exp-add, table.exp tr.total td { grid-column: 1 / -1; }
  table.exp tr.total td:empty { display: none; }
}

