:root {
  --ground: #F2F4F3;
  --paper: #FFFFFF;
  --ink: #16201B;
  --muted: #55615B;
  --line: #D9DFDC;
  --line-soft: #E3E8E5;
  --vault: #1D3A2F;
  --vault-2: #2E5244;
  --vault-ink: #EAF2EE;
  --vault-muted: #C5D6CD;
  --out: #B9381F;
  --out-tint: #FBE9E4;
  --in: #1F5AA8;
  --in-tint: #E6EEF9;
  --store: #6B3FA0;
  --store-tint: #F0E8F8;
  --warn: #8A4A00;
  --warn-tint: #FFF4E5;
  --focus: #2F7DD1;
  --out-fill: #B9381F;
  --in-fill: #1F5AA8;
  --sheet-bg: #FFFFFF;
  --overlay: rgba(15, 20, 18, .45);
  --radius: 12px;
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --ground: #0E1210;
  --paper: #1B201D;
  --ink: #ECEFED;
  --muted: #9CA7A1;
  --line: #343B37;
  --line-soft: #2A302C;
  --vault: #163428;
  --vault-2: #2E5244;
  --vault-ink: #E3EEE8;
  --vault-muted: #A9C2B5;
  --out: #F0806C;
  --out-tint: #3A211B;
  --out-fill: #C2482F;
  --in: #7BB0F5;
  --in-tint: #172A44;
  --in-fill: #2F6FD0;
  --store: #BE9CF2;
  --store-tint: #2C2240;
  --warn: #F3B562;
  --warn-tint: #3A2C14;
  --focus: #7BB6F7;
  --sheet-bg: #1B201D;
  --overlay: rgba(0, 0, 0, .6);
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #0E1210;
  --paper: #1B201D;
  --ink: #ECEFED;
  --muted: #9CA7A1;
  --line: #343B37;
  --line-soft: #2A302C;
  --vault: #163428;
  --vault-2: #2E5244;
  --vault-ink: #E3EEE8;
  --vault-muted: #A9C2B5;
  --out: #F0806C;
  --out-tint: #3A211B;
  --out-fill: #C2482F;
  --in: #7BB0F5;
  --in-tint: #172A44;
  --in-fill: #2F6FD0;
  --store: #BE9CF2;
  --store-tint: #2C2240;
  --warn: #F3B562;
  --warn-tint: #3A2C14;
  --focus: #7BB6F7;
  --sheet-bg: #1B201D;
  --overlay: rgba(0, 0, 0, .6);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  /* 시스템 글꼴: 아이폰은 애플 기본 글꼴, 안드로이드·PC는 각 기기 기본 글꼴 */
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums; -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
.muted { color: var(--muted); }
.boot { padding: 40px; text-align: center; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.in-c { color: var(--in); } .out-c { color: var(--out); }

/* 공통 컨트롤 */
.btn {
  min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--paper); font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn.primary { background: var(--vault); border-color: var(--vault); color: #fff; }
.btn.in { background: var(--in-fill); border-color: var(--in-fill); color: #fff; }
.btn.out { background: var(--out-fill); border-color: var(--out-fill); color: #fff; }
.btn.danger { color: var(--out); border-color: var(--line); }
.btn.sm { min-height: 36px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; padding: 8px; min-height: 44px; color: inherit; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.field > input, .field > select, .field > textarea, .input {
  height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--paper); font-size: 16px; color: var(--ink); min-width: 0;
}
.field > textarea { height: auto; padding: 10px 12px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--ground); border-radius: 10px; padding: 4px; gap: 4px; }
.seg button { min-height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg.dir button[aria-pressed="true"][data-v="out"] { color: var(--out); }
.seg.dir button[aria-pressed="true"][data-v="in"] { color: var(--in); }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
.tag.in { color: var(--in); background: var(--in-tint); }
.tag.out { color: var(--out); background: var(--out-tint); }
.tag.store { color: var(--store); background: var(--store-tint); }
.tag.neutral { color: var(--muted); background: var(--ground); }
.badge { font-size: 12px; color: var(--muted); border: 1px solid var(--line); padding: 0 6px; border-radius: 4px; background: var(--paper); }
button.badge { cursor: pointer; min-height: 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--ground); font-size: 13px; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); }
.err { color: var(--out); font-size: 14px; min-height: 1.5em; margin: 0; }

/* 로그인 */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--vault); }
.login-card { width: 100%; max-width: 440px; background: var(--paper); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.brand { font-size: 13px; font-weight: 700; color: var(--vault); letter-spacing: .02em; }
.login h1 { font-size: 22px; }
.login-opts { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.office-label { font-size: 13px; color: var(--muted); margin: 6px 0 2px; }
.names { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; max-height: 50vh; overflow-y: auto; }
.names button { min-height: 52px; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; font-size: 16px; }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin: 8px 0; }
.pin-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--vault); }
.pin-dots span.on { background: var(--vault); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { min-height: 60px; border: 0; border-radius: 12px; background: var(--ground); font-size: 22px; font-weight: 500; }
.keypad button.fn { font-size: 15px; color: var(--muted); }

/* 직원 모바일 (Apple HIG 기준: 본문 17, 큰 제목 34, 터치 44 이상, 묶음형 목록) */
.m-wrap { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; padding-bottom: 32px; }
.m-bar { display: flex; justify-content: flex-end; align-items: center; gap: 4px; padding: 6px 8px 0; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 22px; background: transparent; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn[aria-pressed="true"] { color: var(--in); }
.name-btn { min-height: 44px; border: 0; background: transparent; color: var(--in); font-size: 17px; padding: 0 8px; }
.large-title { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; padding: 0 16px 16px; margin: 0; }
.vault { margin: 0 16px; background: var(--vault); color: var(--vault-ink); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.vault .k { font-size: 15px; color: var(--vault-muted); }
.vault .v { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
.vault .row { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid rgba(255,255,255,.14); padding-top: 12px; }
.vault .row .v2 { font-size: 22px; font-weight: 600; }
.big-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 24px 16px; }
.big { height: 104px; border: 0; border-radius: 14px; color: #fff; font-size: 22px; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.big small { font-size: 15px; font-weight: 400; opacity: .9; }
.big.in { background: var(--in-fill); }
.big.out { background: var(--out-fill); }
.big:active, .list-row:active { opacity: .7; }
/* 묶음형 목록 (inset grouped) */
.section-label { display: flex; justify-content: space-between; align-items: baseline; padding: 0 32px 8px; font-size: 13px; color: var(--muted); }
.section-label h2 { font-size: 13px; font-weight: 400; text-transform: uppercase; color: var(--muted); }
.list-group { margin: 0 16px; background: var(--paper); border-radius: 12px; overflow: hidden; }
.list-row { width: 100%; display: grid; grid-template-columns: 1fr auto 16px; gap: 2px 10px; align-items: center; min-height: 60px; padding: 10px 12px 10px 16px; border: 0; background: transparent; text-align: left; color: var(--ink); position: relative; }
.list-row + .list-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 1px solid var(--line-soft); }
.list-row .main1 { display: flex; gap: 6px; align-items: center; font-size: 17px; min-width: 0; }
.list-row .main1 span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .sub { grid-column: 1; font-size: 15px; color: var(--muted); }
.list-row .amt { grid-row: 1 / span 2; grid-column: 2; font-size: 17px; font-weight: 600; text-align: right; white-space: nowrap; }
.list-row .chev { grid-row: 1 / span 2; grid-column: 3; color: var(--muted); }
.list-row.canceled .main1, .list-row.canceled .amt { text-decoration: line-through; color: var(--muted); }
.list-empty { padding: 20px 16px; color: var(--muted); text-align: center; font-size: 15px; }
.m-wrap .chip { min-height: 44px; font-size: 15px; padding: 0 14px; }
/* 액션 시트 */
.modal-wrap.as { align-items: flex-end; padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)); }
.modal-wrap.as .modal { background: transparent; padding: 0; gap: 8px; max-width: 560px; }
.as-group { background: var(--sheet-bg); border-radius: 14px; overflow: hidden; }
.as-title { padding: 14px 16px; text-align: center; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line-soft); }
.as-btn { display: block; width: 100%; min-height: 56px; border: 0; background: transparent; font-size: 20px; color: var(--in); }
.as-btn + .as-btn { border-top: 1px solid var(--line-soft); }
.as-btn.danger { color: var(--out); }
.as-btn.cancel { background: var(--sheet-bg); border-radius: 14px; font-weight: 600; }
.entry-modal { display: flex; flex-direction: column; gap: 24px; }          /* 묶음 사이 24 */
.entry-modal .group { display: flex; flex-direction: column; gap: 8px; }    /* 묶음 안 8 */
.entry-modal .field { gap: 8px; }
.entry-modal .chips { gap: 8px; }
.entry-modal .reading { min-height: 0; }
.entry-modal .err:empty { display: none; }
.entry-modal .modal-head { margin-bottom: -8px; }
/* 시트 손잡이 */
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--line); align-self: center; margin: -10px 0 -4px; }

/* 모달 / 시트 */
.modal-wrap { position: fixed; inset: 0; background: var(--overlay); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: var(--sheet-bg); border-radius: 18px; padding: 24px 20px; width: 100%; max-width: 440px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal.wide { max-width: 760px; }
.modal-wrap.sheet { align-items: flex-end; padding: 0; }
.modal-wrap.sheet .modal { max-width: 560px; border-radius: 22px 22px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { font-size: 20px; }
.x { width: 44px; height: 44px; border: 0; background: transparent; font-size: 22px; color: var(--muted); }
.field > input.amount-in, .amount-in { height: auto; border-radius: 0; padding: 4px 0; font-size: 34px; font-weight: 700; border: 0; border-bottom: 2px solid var(--line); padding: 4px 0; width: 100%; background: transparent; }
.field > input.amount-in { border: 0; border-bottom: 2px solid var(--line); background: transparent; }
.field > input.amount-in.out { border-bottom-color: var(--out); } .field > input.amount-in.in { border-bottom-color: var(--in); }
.reading { font-size: 15px; color: var(--muted); min-height: 1.5em; }
.denom { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--line-soft); }
.vault .stock { font-size: 13px; color: var(--vault-muted); display: flex; flex-direction: column; gap: 2px; margin-top: -6px; }
.vault .stock b { color: var(--vault-ink); font-weight: 500; margin-right: 4px; }
.card .stock { font-size: 13px; margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.card .stock b { color: var(--ink); font-weight: 500; margin-right: 4px; }
.denom .cnt { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.denom .cnt input { width: 84px; height: 44px; text-align: right; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; font-size: 17px; font-weight: 700; color: var(--ink); }
.match { font-size: 14px; padding: 10px 12px; border-radius: 10px; background: var(--ground); }
.match .ok { color: var(--in); font-weight: 500; }
.match .bad { color: var(--out); font-weight: 500; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-size: 20px; }
.stepper input { width: 52px; height: 44px; text-align: center; border: 1px solid var(--line); border-radius: 10px; font-size: 17px; font-weight: 700; }
.total-box { display: flex; justify-content: space-between; align-items: baseline; background: var(--in-tint); color: var(--in); border-radius: 10px; padding: 12px 14px; }
.total-box b { font-size: 22px; }
.confirm-amt { font-size: 30px; font-weight: 700; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }

/* 데스크 (담당자 이상) */
.desk { display: flex; min-height: 100vh; }
.side { width: 230px; flex: none; background: var(--vault); color: var(--vault-ink); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side .office { padding: 0 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.side .office b { font-size: 20px; letter-spacing: -0.01em; }
.side .app-name { font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--vault-muted); }
.brand-sub { font-weight: 400; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.side select { height: 40px; border-radius: 8px; border: 0; padding: 0 8px; background: var(--vault-2); color: #fff; }
.side a { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 12px; border-radius: 8px; color: #D7E4DD; text-decoration: none; }
.side a[aria-current="page"] { background: var(--vault-2); color: #fff; font-weight: 700; }
.side .spacer { flex: 1; }
.side .me { border-top: 1px solid #3A5A4D; padding: 12px 8px 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.side .me button { background: none; border: 0; color: var(--vault-muted); text-align: left; padding: 6px 0; min-height: 36px; }
/* 설정: 담당자 목록 2열 */
.staff-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.staff-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 52px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
@media (max-width: 860px) { .staff-grid { grid-template-columns: 1fr; } }
/* 사이드바의 해·달 토글 */
.side .icon-btn { color: var(--vault-ink); }
.side .icon-btn[aria-pressed="true"] { color: #FFD60A; }
.side .me .icon-btn { width: 40px; height: 40px; min-height: 0; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--vault-ink); }
.side .me .icon-btn[aria-pressed="true"] { color: #FFD60A; }
/* 화면 모드: 한 줄 (자동 버튼 + 해·달) */
.theme-ctrl { display: inline-flex; align-items: center; gap: 4px; }
.side .me .auto-chip { min-height: 0; height: 24px; padding: 0 8px; border: 1px solid rgba(255,255,255,.25); border-radius: 12px; font-size: 12px; color: var(--vault-muted); background: transparent; }
.side .me .auto-chip:hover { color: var(--vault-ink); border-color: rgba(255,255,255,.5); }
.side .me .auto-chip[hidden] { display: none; }
/* 접속 중인 사람 */
.online { margin: 8px 4px 12px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 10px; font-size: 13px; color: var(--vault-ink); max-height: 220px; overflow-y: auto; }
.online-h { color: var(--vault-muted); margin-bottom: 6px; }
.online-h b { color: var(--vault-ink); }
.online ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.online li { display: flex; align-items: center; gap: 6px; min-width: 0; }
.online .dot { width: 8px; height: 8px; border-radius: 50%; background: #34C759; flex: none; }
.online .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online .id, .online .of { color: var(--vault-muted); }
.online .of { margin-left: auto; font-size: 12px; flex: none; }
/* 다크 모드 스위치 */
.theme-row { display: flex; align-items: center; justify-content: space-between; min-height: 40px; color: var(--vault-ink); }
.side .me .switch, .switch { width: 46px; height: 28px; min-height: 0; padding: 0; border: 0; border-radius: 14px; background: rgba(255,255,255,.22); position: relative; flex: none; cursor: pointer; transition: background .2s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch[aria-checked="true"], .side .me .switch[aria-checked="true"] { background: #34C759; }
.switch[aria-checked="true"] span { transform: translateX(18px); }
.theme-note { font-size: 12px; color: var(--vault-muted); margin-top: -4px; }
.side .me .theme-note button { display: inline; min-height: 0; padding: 0; font-size: 12px; color: var(--vault-ink); text-decoration: underline; }
.main { flex: 1; min-width: 0; padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 18px; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.page-head h1 { font-size: 24px; }
.page-head .acts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.banner { background: var(--warn-tint); color: var(--warn); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card .k { font-size: 14px; color: var(--muted); }
.card .v { font-size: 24px; font-weight: 700; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.panel h2 { font-size: 17px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters .field > input, .filters .field > select { height: 40px; font-size: 14px; }
.check { display: flex; align-items: center; gap: 6px; min-height: 40px; font-size: 14px; }
.tbl-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--muted); padding: 11px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--paper); position: sticky; top: 0; }
td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
td.r, th.r { text-align: right; white-space: nowrap; }
tr.canceled td:not(.keep) { color: #8A938E; text-decoration: line-through; }
.tbl-wrap.ledger table { min-width: 1040px; }
.row-acts { display: flex; gap: 4px; justify-content: flex-end; white-space: nowrap; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.count-grid { display: grid; grid-template-columns: 1fr 96px 1fr; gap: 6px 10px; align-items: center; font-size: 14px; }
.count-grid input { height: 40px; text-align: right; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font-size: 15px; }
.count-grid .sum { text-align: right; color: var(--muted); }
.result { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; border-top: 1px solid var(--line); padding-top: 12px; font-size: 15px; }
.result b { text-align: right; }
.diff-zero { color: var(--in); } .diff-bad { color: var(--out); }
.gift-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.gift-card.off { opacity: .6; }
.gift-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.denoms { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.denom-chip { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 99px; padding: 0 4px 0 10px; font-size: 13px; min-height: 32px; }
.denom-chip.off { color: var(--muted); text-decoration: line-through; }
.denom-chip button { border: 0; background: none; min-width: 28px; min-height: 28px; color: var(--muted); }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.diff-list { font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.diff-list .from { color: var(--out); text-decoration: line-through; }
.diff-list .to { color: var(--in); }
pre.json { background: var(--ground); padding: 10px; border-radius: 8px; overflow-x: auto; font-size: 12px; margin: 0; }

/* 토스트 */
#toasts { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 80; width: min(92vw, 420px); }
.toast { background: #222826; color: #fff; padding: 12px 16px; border-radius: 10px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.toast.bad { background: var(--out); }

@media (max-width: 860px) {
  .desk { flex-direction: column; }
  .side { width: auto; height: auto; position: sticky; top: 0; z-index: 10; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding: 8px; gap: 4px; align-items: center; }
  .side .office { padding: 0 6px; flex-direction: row; align-items: center; flex: none; }
  .side .office b { font-size: 14px; white-space: nowrap; }
  .side a { flex: none; min-height: 40px; }
  .side .spacer { display: none; }
  .side .me { border: 0; padding: 0; flex-direction: row; flex: none; }
  .side .me span { display: none; }
  .side .online { display: none; }
  .main { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
/* 금액 입력칸: 포커스 시 테두리 상자 대신 밑줄을 굵게 */
.field > input.amount-in:focus-visible { outline: none; border-bottom-width: 3px; }

/* 키보드 대응: 모달을 실제로 보이는 영역(키보드 위)에 맞춤 */
.modal-wrap { top: var(--vvt, 0px); bottom: auto; height: var(--vvh, 100%); }
.modal { max-height: calc(var(--vvh, 100dvh) - 32px); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.modal-wrap.as .modal { max-height: calc(var(--vvh, 100dvh) - 16px); }
body.modal-open { overflow: hidden; }

.modal:focus { outline: none; }

/* 실시간으로 들어온 기록 잠깐 강조 */
@keyframes flash-in { from { background: var(--in-tint); } to { background: transparent; } }
.flash, tr.flash td { animation: flash-in 3s ease-out; }

/* ---------- 공지 한 줄 ---------- */
.notice-bar { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: 10px; background: var(--warn-tint); color: var(--ink); text-align: left; cursor: pointer; }
.notice-ico { color: var(--warn); flex: none; display: inline-flex; }
.notice-ico svg { width: 20px; height: 20px; }
.notice-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.notice-more { flex: none; font-size: 13px; font-weight: 700; color: var(--warn); }
.m-notice { margin: 0 16px; }
.m-notice:not(:empty) { margin-bottom: 16px; }
.notice-list { display: flex; flex-direction: column; }
.notice-item { padding: 12px 0; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 4px; }
.notice-body { white-space: pre-wrap; word-break: break-word; }
.notice-admin { display: flex; flex-direction: column; }
.notice-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.notice-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.notice-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.office-pick { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.office-pick legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
textarea { font: inherit; }

/* ---------- 장부 상세 ---------- */
tr.click-row { cursor: pointer; }
tr.click-row:hover td { background: var(--ground); }
tr.click-row:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.detail-amt { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.detail-kv { grid-template-columns: 110px 1fr; gap: 10px 14px; font-size: 15px; border-top: 1px solid var(--line-soft); padding-top: 14px; margin: 0; }
.detail-kv dd { word-break: break-word; }
.link-inline { background: none; border: 0; padding: 0 0 0 6px; color: var(--in); text-decoration: underline; font-size: 14px; cursor: pointer; }

/* ---------- 전체 현황 ---------- */
.sec-title { font-size: 17px; margin: 8px 0 -6px; }
.banner.bad { background: var(--out-tint); color: var(--out); }
.dash-tbl td { vertical-align: top; }
.dash-tbl tfoot td { border-top: 2px solid var(--line); border-bottom: 0; }
.gift-lines { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.big-list { display: flex; flex-direction: column; }
.big-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border: 0; border-top: 1px solid var(--line-soft); background: none; text-align: left; color: var(--ink); cursor: pointer; min-height: 52px; }
.big-row b { white-space: nowrap; }
/* 그래프: 입고·출고 색은 밝은/어두운 화면 각각 색약 구분 검사를 통과한 값 */
:root { --chart-in: #1F5AA8; --chart-out: #B9381F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --chart-in: #5B93E0; --chart-out: #E2694F; } }
:root[data-theme="dark"] { --chart-in: #5B93E0; --chart-out: #E2694F; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 12px; }
.chart .b-in { fill: var(--chart-in); }
.chart .b-out { fill: var(--chart-out); }
.chart .bar-hit:hover path { opacity: .8; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.legend .sw.in { background: var(--chart-in); } .legend .sw.out { background: var(--chart-out); }
.chart-table summary { font-size: 13px; color: var(--muted); cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.chart-table table { font-size: 13px; }
.staff-item.off { opacity: .6; }
#dash { display: flex; flex-direction: column; gap: 16px; }

/* 공지 두 종류: 전체(직원 포함)=노랑, 담당자 전용=파랑 */
#notice-slot { display: flex; flex-direction: column; gap: 8px; }
#notice-slot:empty { display: none; }
.notice-bar.mgr { border-left-color: var(--in); background: var(--in-tint); }
.notice-bar.mgr .notice-ico, .notice-bar.mgr .notice-more, .notice-bar.mgr .notice-kind { color: var(--in); }
.notice-kind { flex: none; font-size: 12px; font-weight: 700; color: var(--warn); border: 1px solid currentColor; border-radius: 99px; padding: 0 8px; line-height: 20px; }
.tag.warn { color: var(--warn); background: var(--warn-tint); }
