/* 가계부 화면. 기준 화면은 430x932(아이폰 14 Pro Max)입니다. 빌드 단계 없이 이 파일 하나만 씁니다. */

:root {
  --bg: #f4f4f1;
  --surface: #ffffff;
  --surface-2: #ecece6;
  --text: #1a1c1b;
  --muted: #6b706d;
  --line: #e2e2dc;
  --accent: #1f7a5a;
  --accent-ink: #ffffff;
  --accent-soft: #e3f1ea;
  --plus: #1f7a5a;
  --minus: #1a1c1b;
  --warn: #9a5b00;
  --warn-soft: #fbf0dc;
  --danger: #b3261e;
  --danger-soft: #fbe5e3;
  --bar: #1f7a5a;
  --bar-none: #b9bcb6;
  --who-0: #1f7a5a;
  --who-1: #c2571a;
  --who-2: #3b5bc4;
  --who-3: #8a3fa8;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 8px rgba(0, 0, 0, .04);
  --radius: 16px;
  --tabbar-h: 58px;
  --gutter: 16px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121413;
    --surface: #1c1f1e;
    --surface-2: #262a28;
    --text: #ecefed;
    --muted: #9aa19d;
    --line: #2d3230;
    --accent: #4cc293;
    --accent-ink: #0c1a14;
    --accent-soft: #183328;
    --plus: #5fd0a2;
    --minus: #ecefed;
    --warn: #f0b85a;
    --warn-soft: #33281a;
    --danger: #ff8a80;
    --danger-soft: #3a1f1d;
    --bar: #4cc293;
    --bar-none: #4a4f4c;
    --who-0: #4cc293;
    --who-1: #f08a4b;
    --who-2: #7d9cff;
    --who-3: #c88ae0;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", sans-serif;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
a { color: inherit; }
h1, h2, p { margin: 0; }
h1 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* 화면 밖에 숨긴 입력. 파일 입력은 너비를 무시하고 자기 크기로 그려져 문서 폭을 넓혔으므로(430 폭에서 538) 자리를 잡는
   부모(.pick, .seg label)를 relative 로 두고 왼쪽 위에 0 크기로 붙여 둡니다 */
.sr-only {
  position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; opacity: 0;
}
input[type=file].sr-only { max-width: 1px; font-size: 1px; }
[hidden] { display: none !important; }

/* 바깥 틀. 위는 다이내믹 아일랜드, 아래는 탭 막대와 홈 인디케이터만큼 비웁니다 */
.page {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 8px) calc(env(safe-area-inset-right) + var(--gutter)) 24px calc(env(safe-area-inset-left) + var(--gutter));
}
.has-tabbar .page { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px); }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; }
.card-head .more { font-size: 14px; color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { color: var(--muted); font-size: 14px; padding: 8px 0; }
.empty.big { text-align: center; padding: 48px 0; font-size: 16px; }
.empty a { color: var(--accent); }
.count { color: var(--muted); font-weight: 600; margin-left: 4px; }
.group { margin-top: 20px; }
.group > h2 { padding: 0 4px; }
.list > .card:last-child { margin-bottom: 0; }

/* 머리 막대 */
.titlebar, .monthbar, .subbar {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 48px; margin-bottom: 8px;
}
.titlebar h1 { padding-left: 4px; }
.monthbar h1, .subbar h1 { text-align: center; flex: 1; font-size: 18px; }
.subbar > :first-child, .subbar > :last-child { width: 72px; }
.iconbtn {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 22px;
  color: var(--text); text-decoration: none;
}
.iconbtn:active { background: var(--surface-2); }
.iconbtn.disabled { visibility: hidden; }
.back { display: flex; align-items: center; gap: 2px; text-decoration: none; color: var(--accent); min-height: 44px; font-size: 16px; }

/* 홈 */
.hero { padding: 8px 4px 20px; }
.hero-label { color: var(--muted); font-size: 14px; }
.hero-total { font-size: 38px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: 2px 0 4px; }
.hero-diff { font-size: 14px; color: var(--muted); }
.hero-diff.up { color: var(--danger); }
.hero-diff.down { color: var(--plus); }

.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--warn-soft); color: var(--warn); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 12px; text-decoration: none; font-size: 15px;
}
.banner svg { width: 20px; height: 20px; flex: none; }

.bars { list-style: none; margin: 0; padding: 0; }
.bars li a { display: block; padding: 8px 0; text-decoration: none; }
.bars li + li a { border-top: 1px solid var(--line); }
.bar-head { display: flex; justify-content: space-between; font-size: 15px; margin-bottom: 6px; }
.bar-name.none { color: var(--muted); }
.bar-amt { font-variant-numeric: tabular-nums; font-weight: 600; }
.bar-track { display: block; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 4px; background: var(--bar); min-width: 4px; }
.bar-fill.none { background: var(--bar-none); }

/* 거래 줄. 왼쪽 동그라미는 누구 내역인지, 오른쪽 자물쇠는 공개 범위입니다 */
.txlist { margin: 0 -16px; }
.tx { display: flex; align-items: center; min-height: 56px; }
.tx + .tx { border-top: 1px solid var(--line); }
.tx-link {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 11px 16px;
  text-decoration: none;
}
.tx-link:active { background: var(--surface-2); }
.tx-link:has(+ .lock), .tx-link:has(+ .lock-gap) { padding-right: 4px; }
.lock {
  flex: none; width: 44px; height: 44px; margin-right: 6px; display: grid; place-items: center;
  border: 0; border-radius: 22px; background: transparent; color: var(--muted); opacity: .35; cursor: pointer;
}
.lock svg { width: 20px; height: 20px; }
.lock:active { background: var(--surface-2); transform: scale(.94); }
.lock.on { opacity: 1; color: var(--muted); }
.lock-gap { flex: none; width: 50px; }
.tx.private .tx-name { color: var(--muted); }
.who {
  flex: none; width: 26px; height: 26px; border-radius: 13px; display: inline-grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #fff; background: var(--who-0); line-height: 1;
}
.who.sm { width: 20px; height: 20px; font-size: 11px; vertical-align: -4px; }
.who.c1 { background: var(--who-1); }
.who.c2 { background: var(--who-2); }
.who.c3 { background: var(--who-3); }
@media (prefers-color-scheme: dark) { .who { color: #0c1a14; } }
.tx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tx-name { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-sub { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); align-items: center; }
.cat { background: var(--surface-2); border-radius: 6px; padding: 0 6px; font-size: 12px; line-height: 20px; color: var(--muted); }
.cat.none { background: var(--warn-soft); color: var(--warn); }
.cat.kind { background: transparent; border: 1px solid var(--line); }
.flag { background: var(--warn-soft); color: var(--warn); border-radius: 6px; padding: 0 6px; font-size: 12px; line-height: 20px; font-weight: 600; }
.amt { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; font-size: 16px; }
.amt.k-refund, .amt.k-income { color: var(--plus); }
.amt.k-transfer, .amt.k-card_payment { color: var(--muted); font-weight: 500; }

/* 거래 목록 */
.filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.selects { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.selects.four { grid-template-columns: 1fr 1fr; }
.count-line { padding: 0 4px 8px; }
.day { padding-top: 10px; padding-bottom: 4px; }
.day-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); padding-bottom: 6px; font-weight: 600; }
.day-sum { font-variant-numeric: tabular-nums; }

/* 입력 칸 */
input, select, textarea, button { font: inherit; color: inherit; }
input:not([type=checkbox]):not([type=file]), select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px;
  background-color: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  font-size: 16px; /* 16px 미만이면 iOS 가 확대합니다 */
  -webkit-appearance: none; appearance: none;
}
.card input:not([type=checkbox]):not([type=file]), .card select, .card textarea { background-color: var(--bg); }
select {
  background-image: url("/static/select-arrow.svg");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 30px !important;
}
input[type=date], input[type=time] { display: block; }
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 13px; color: var(--muted); padding-left: 2px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 4px 2px; font-size: 15px; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.check small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; word-break: break-all; }

/* 단추 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn.small-btn { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn[disabled], .htmx-request .btn { opacity: .6; }
.row { display: flex; gap: 8px; margin-top: 12px; }
.row > .btn { flex: 1; }

/* 올리기 */
.pick {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  border: 1.5px dashed var(--line); border-radius: 12px; padding: 14px;
}
.pick:active { background: var(--surface-2); }
.pick svg { flex: none; color: var(--accent); }
.pick-text { display: flex; flex-direction: column; }
.pick-title { font-weight: 700; font-size: 16px; }
.pick-sub { font-size: 13px; color: var(--muted); }
.pick.big {
  flex-direction: column; justify-content: center; gap: 4px; text-align: center;
  min-height: 150px; background: var(--accent-soft); border-color: transparent;
}
.pick.big svg { width: 40px; height: 40px; margin-bottom: 4px; }
.pick.big .pick-title { font-size: 18px; }
.pick-card { padding: 10px; }
.fold > summary {
  list-style: none; cursor: pointer; min-height: 40px; display: flex; align-items: center;
  font-size: 15px; font-weight: 600; color: var(--muted);
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: "+"; display: inline-block; width: 20px; color: var(--accent); font-weight: 700; }
.fold[open] > summary::before { content: "-"; }
.fold .field { margin-top: 4px; }
details.card.fold { padding-top: 8px; padding-bottom: 8px; }
details.card.fold[open] { padding-bottom: 16px; }
.fold.small > summary { min-height: 28px; font-size: 13px; }

.result h2 { font-size: 17px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
.stats > div { background: var(--bg); border-radius: 12px; padding: 10px 4px; text-align: center; display: flex; flex-direction: column; }
.stats b { font-size: 22px; font-variant-numeric: tabular-nums; }
.stats span { font-size: 11.5px; color: var(--muted); line-height: 1.25; word-break: keep-all; }
.stats .warn { background: var(--warn-soft); }
.stats .warn b, .stats .warn span { color: var(--warn); }
.fails { margin: 0 0 12px; padding-left: 18px; font-size: 14px; color: var(--danger); }
.result .banner { margin: 12px 0 4px; }
.result form { margin-top: 8px; }

.msg { border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 12px; }
.msg.ok { background: var(--accent-soft); color: var(--accent); }
.msg.err { background: var(--danger-soft); color: var(--danger); }
.msg.warn { background: var(--warn-soft); color: var(--warn); }

/* 확인함 */
.reason { font-size: 14px; color: var(--warn); margin-bottom: 10px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.side { background: var(--bg); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.side-label { font-size: 12px; color: var(--muted); }
.side-name { font-size: 15px; overflow-wrap: anywhere; }
.side-amt { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.side-meta { display: block; font-size: 13px; color: var(--muted); }
.needs-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.needs-head > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.needs .reason { margin: 8px 0 0; }
.hint { font-size: 13px; color: var(--accent); margin-top: 6px; }
.chips {
  display: flex; gap: 6px; overflow-x: auto; margin: 10px -16px -4px; padding: 0 16px 4px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--line);
  background: var(--bg); font-size: 15px; cursor: pointer; white-space: nowrap;
}
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.chip:active { transform: scale(.96); }
#uncat > .btn, #uncat > form { margin-bottom: 12px; }
#uncat > .muted { padding: 0 4px 10px; }

/* 근거 */
.evidence { list-style: none; margin: 0; padding: 0; }
.evidence li { padding: 10px 0; }
.evidence li + li { border-top: 1px solid var(--line); }
.ev-head { display: flex; justify-content: space-between; align-items: baseline; }
.ev-line { font-size: 14px; margin: 2px 0; overflow-wrap: anywhere; }
.raw { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 12px; margin: 4px 0 0; }
.raw dt { color: var(--muted); }
.raw dd { margin: 0; overflow-wrap: anywhere; }

/* 세 칸 전환(공동, 나, 상대). 탭 막대와 같은 초록을 씁니다 */
.seg {
  display: flex; gap: 2px; padding: 3px; margin: 0 0 4px; border-radius: 12px; background: var(--surface-2);
}
.seg > a, .seg > label {
  position: relative;
  flex: 1; min-height: 38px; display: flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 9px; text-decoration: none; font-size: 15px; font-weight: 600; color: var(--muted);
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px;
}
.seg > a.on, .seg > label:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
@media (prefers-color-scheme: dark) { .seg > a.on, .seg > label:has(input:checked) { background: #3a403d; } }
.seg.small > label { min-height: 34px; font-size: 14px; }
.seg .ico { width: 16px; height: 16px; }
.seg > label:has(input:focus-visible) { outline: 2px solid var(--accent); }
.seg > label:has(input:disabled) { opacity: .4; cursor: not-allowed; }
/* 설정의 "내가 올리는 내역". 누르면 바로 저장하는 두 칸 단추입니다 */
.seg > button {
  flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-size: 14px;
  font-weight: 600; color: var(--muted); cursor: pointer; padding: 0 6px;
}
.seg > button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
@media (prefers-color-scheme: dark) { .seg > button.on { background: #3a403d; } }
.seg > button:focus-visible { outline: 2px solid var(--accent); }
.choice-notes { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }

/* 누가 얼마 냈는지 */
.payers { display: flex; flex-direction: column; gap: 12px; }
.payer { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 10px; }
.payer-name { font-size: 15px; font-weight: 600; }
.payer-amt { font-variant-numeric: tabular-nums; font-weight: 700; }
.payer-bar { grid-column: 2 / 4; height: 6px; }
.who-fill { background: var(--who-0); }
.who-fill.c1 { background: var(--who-1); }
.who-fill.c2 { background: var(--who-2); }
.who-fill.c3 { background: var(--who-3); }

/* 올리기 선택 */
.opts { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; }
.opt-row { display: flex; align-items: center; gap: 12px; }
.opt-label { font-size: 14px; color: var(--muted); flex: none; }
.opt-row .seg { flex: 1; margin: 0; }
.opt-private { padding-bottom: 0; }

/* 거래 고치기 */
.owner-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.owner-line .muted { font-weight: 400; }
fieldset.field { border: 0; margin: 0; padding: 0; }

/* 설정 */
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.people li + li { border-top: 1px solid var(--line); }
.person-name { flex: 1; font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px !important; }
.head-links { display: flex; gap: 6px; }
a.more.small, .batch .more { display: inline-block; margin-top: 6px; color: var(--accent); text-decoration: none; font-size: 14px; }
.rules-note { padding: 0 4px 10px; }

/* 기록 */
.fname { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.batch-stats { font-size: 14px; margin: 6px 0 0; }
.batch.reverted { opacity: .6; }
.logout { margin-top: 24px; }
form > .btn.block.danger { margin-bottom: 12px; }

/* 로그인 */
.login { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; }
.login img { border-radius: 14px; }
.login .card { width: 100%; text-align: left; }

/* 아래 탭 막대. 엄지가 닿는 자리입니다 */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600;
}
.tabbar a.on { color: var(--accent); }
.tabbar svg { width: 25px; height: 25px; }
.tabbar .plus {
  width: 40px; height: 30px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
}
.tabbar .plus svg { width: 22px; height: 22px; stroke-width: 2.4; }
.iconwrap { position: relative; display: block; height: 25px; }
.badge {
  position: absolute; top: -4px; left: 16px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; text-align: center;
}

/* 진행 중 표시. htmx 가 요청 동안 htmx-request 를 붙입니다 */
.busy {
  display: none; position: fixed; inset: 0; z-index: 20; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.busy.htmx-request { display: flex; }
.busy-box { background: var(--surface); border-radius: var(--radius); padding: 24px 28px; text-align: center; box-shadow: var(--shadow); max-width: 300px; }
.busy-title { font-weight: 700; margin-top: 12px; }
.busy-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.spinner {
  width: 36px; height: 36px; margin: 0 auto; border-radius: 50%;
  border: 3px solid var(--surface-2); border-top-color: var(--accent); animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; left: 16px; right: 16px; z-index: 30; max-width: 528px; margin: 0 auto;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px);
  background: var(--text); color: var(--bg); border-radius: 12px; padding: 10px 10px 10px 14px; font-size: 14px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
}
.toast-text { flex: 1 1 180px; }
.toast-act { margin: 0; }
.toast-btn {
  min-height: 36px; padding: 0 12px; border-radius: 10px; border: 0; cursor: pointer;
  background: color-mix(in srgb, var(--bg) 18%, transparent); color: var(--bg); font-size: 14px; font-weight: 700;
}

.htmx-swapping { opacity: 0; transition: opacity .15s; }
.logout + .logout { margin-top: 12px; }
.logout .muted { margin-top: 8px; }

/* 2026-11-12 화면 흐름 다듬기 */
.tx-name.fallback { color: var(--muted); }
.cat.together { background: var(--accent-soft); color: var(--accent); }
.cat.private-tag { background: var(--surface-2); color: var(--muted); }
.lock.other { opacity: .18; }
.tx.hl { background: var(--accent-soft); transition: background .6s; }
.tx.deleted-row .tx-link { padding-right: 4px; }
.restore-form { margin: 0 12px 0 0; flex: none; }
.side .diff { color: var(--warn); font-weight: 700; }
.side-meta.diff { font-weight: 600; }
.diff-note { margin-top: 8px; }
.later-btn { margin-top: 6px; min-height: 40px; font-size: 14px; font-weight: 500; color: var(--muted); border-color: transparent; }
.dup.later { opacity: .65; }
.summary-lines { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.summary-lines .warn { color: var(--warn); }
.summary-lines .merged > summary { min-height: 24px; font-weight: 400; color: var(--text); font-size: 15px; align-items: flex-start; }
.summary-lines .merged > summary span { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.summary-lines .merged .txlist { margin-top: 6px; }
.result > .btn.block { margin-bottom: 12px; }
.result .more-list { margin-top: 4px; }
.warns { margin: 0 0 12px; padding-left: 18px; font-size: 14px; color: var(--warn); }
.guide-text {
  white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border-radius: 12px; padding: 12px 14px;
  font-size: 15px; margin: 10px 0 12px; user-select: text; -webkit-user-select: text;
}
.guide + .btn { margin-top: 4px; }
.conflict { border: 1.5px solid var(--warn); }
.conflicts { margin: 8px 0 0; padding-left: 18px; font-size: 14px; }
.conflicts li + li { margin-top: 4px; }
.together-line { display: flex; justify-content: space-between; align-items: center; text-decoration: none; font-size: 15px; }
.together-line b { font-variant-numeric: tabular-nums; }
.private-line b { color: var(--muted); }
/* 올리기 결과의 "방금 올린 N건 모두 같이 보기로"와 거래 목록의 "보이는 N건 모두" */
.share-all { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 4px; }
.share-all .msg { margin: 0; }
.bulk { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; }
.hero-note { margin-top: 4px; }
.hero-add { margin-top: 12px; gap: 4px; }
.hero-add svg { width: 18px; height: 18px; }
.tag-card { display: flex; flex-direction: column; gap: 8px; }
.tag-btn {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; min-height: 40px; padding: 0 14px;
  border-radius: 20px; border: 1px solid var(--line); background: var(--bg); font-size: 15px; cursor: pointer;
}
.tag-btn svg { width: 20px; height: 20px; }
.tag-btn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.sub-form { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.sub-form h2 { margin-bottom: 0; }
.opt-note { padding: 0 2px; }
#manual-preview:empty { display: none; }
.edited { margin-top: 10px; }
.welcome .btn.ghost { width: 100%; }
/* 만든 뒤 항목별로 정하기(2026-11-13). 줄 오른쪽 펼치기 단추, 줄 아래 작은 판, 고르기 칸과 아래 막대.
   지운 줄은 흐리게 두고 되돌리기를 남깁니다 */
.share-all .btn { margin: 0; }
.tx-item + .tx-item { border-top: 1px solid var(--line); }
.tx-item > .tx + .tx-panel { border-top: 1px dashed var(--line); }
.tx-link:has(+ .lock), .tx-link:has(+ .more) { padding-right: 2px; }
.tx-item .lock { margin-right: 0; width: 40px; }
.more {
  flex: none; width: 38px; height: 44px; margin-right: 6px; display: grid; place-items: center;
  border: 0; border-radius: 19px; background: transparent; color: var(--muted); cursor: pointer;
}
.more svg { width: 18px; height: 18px; transition: transform .15s; }
.more[aria-expanded="true"] svg { transform: rotate(180deg); }
.more:active { background: var(--surface-2); }
.tx-panel { display: flex; flex-direction: column; gap: 8px; padding: 10px 16px 14px; background: var(--surface-2); }
.tx-panel[hidden] { display: none; }
.panel-cat { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.panel-cat select { flex: 1; min-width: 0; }
.panel-row { display: flex; gap: 8px; }
.panel-row > .btn { flex: 1; }
.panel-note { margin: 0; }
.tx-panel .btn { margin: 0; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.tx-pick { display: none; flex: none; width: 36px; align-self: stretch; align-items: center; justify-content: flex-end; }
.tx-pick input { width: 20px; height: 20px; accent-color: var(--accent); }
body.picking .tx-pick { display: flex; }
body.picking .tx-pick + .tx-link { padding-left: 10px; }
.list-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 12px 0 4px; }
.list-tools.count-line { margin: 0; }
.linkbtn {
  flex: none; border: 0; background: transparent; color: var(--accent); font-size: 14px; font-weight: 600;
  min-height: 36px; padding: 0 4px; cursor: pointer;
}
.bulk-bar {
  position: fixed; left: 0; right: 0; z-index: 20;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 10px calc(env(safe-area-inset-right) + 12px) 10px calc(env(safe-area-inset-left) + 12px);
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
  display: flex; flex-direction: column; gap: 8px;
}
.bulk-bar[hidden] { display: none; }
.bulk-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.bulk-head > span { flex: 1; }
.bulk-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 6px; }
.bulk-btns .btn { padding: 0 6px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.picking .page { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 130px); }
.cat.asked { background: var(--accent-soft); color: var(--accent); }
.add-lead { padding: 0 4px; margin: -4px 0 12px; }
#opts-more .opts { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.fill-form { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.ask-from { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.ask-tx { color: inherit; }
.tx.gone { padding: 8px 10px 8px 16px; gap: 8px; }
/* 거래 목록 위 달력(2026-11-13). 일곱 칸이 430 폭에서 넘치지 않게 칸마다 최소 폭을 두지 않고 금액은 짧게 씁니다 */
.cal { padding: 8px 8px 10px; }
.cal-head { display: flex; align-items: center; gap: 4px; padding: 0 4px 6px; }
.cal-label { flex: 1; font-weight: 700; font-size: 15px; text-align: center; }
.cal-month .cal-label { text-align: left; padding-left: 4px; }
.iconbtn.sm { width: 36px; height: 36px; }
.iconbtn.sm svg { width: 20px; height: 20px; }
.cal-toggle { text-decoration: none; display: inline-flex; align-items: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-wd { text-align: center; font-size: 12px; color: var(--muted); padding-bottom: 2px; }
.cal-wd.sun { color: var(--danger); }
.cal-wd.sat { color: var(--who-2); }
.cal-day {
  display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; min-height: 54px;
  padding: 4px 1px; border-radius: 10px; text-decoration: none; color: var(--text);
}
.cal-month .cal-day { min-height: 50px; }
.cal-day:active { background: var(--surface-2); }
.cal-num { font-size: 14px; font-weight: 600; line-height: 22px; width: 24px; height: 22px; text-align: center; border-radius: 11px; }
.cal-day.today .cal-num { background: var(--accent-soft); color: var(--accent); }
.cal-day.sel { background: var(--accent); color: var(--accent-ink); }
.cal-day.sel .cal-num { background: transparent; color: inherit; }
.cal-day.other { opacity: .4; }
.cal-in, .cal-out {
  font-size: 10px; line-height: 13px; font-variant-numeric: tabular-nums; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.2px;
}
.cal-in { color: var(--plus); }
.cal-out { color: var(--muted); }
.cal-day.sel .cal-in, .cal-day.sel .cal-out { color: inherit; }
.cal-note { padding: 8px 4px 0; margin: 0; }
.cal-note a { color: var(--accent); }
.tx.gone .tx-name { color: var(--muted); text-decoration: line-through; font-weight: 500; }
.gone-undo { flex: none; }
/* 서로 요청 보내기(2026-11-13) */
.ask-body { font-size: 15px; margin: 8px 0 0; overflow-wrap: anywhere; }
.ask .row > a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.ask.sent .btn.block { margin: 10px 0 0; }
.ask.closed .ask-body { color: var(--muted); }
.ask.sent .ask-body + .side-meta { margin-top: 6px; }
.flag.done { background: var(--accent-soft); color: var(--accent); }
.ask-banner { border: 1px solid var(--accent); }
.ask-banner .ask-from { font-size: 13px; color: var(--muted); font-weight: 600; }
.ask-banner .ask-body { margin: 4px 0 8px; font-size: 16px; font-weight: 600; }
.ask-banner .btn { margin-top: 10px; }
.ask-banner .msg { margin: 0; }
#asks-sent .form { margin-top: 10px; }

/* 금액 칸(2026-11-13). 숫자는 오른쪽에 붙이고 뒤에 "원" 을 둡니다 */
.amount-wrap { position: relative; display: block; }
.amount-wrap input[data-amount] { text-align: right; padding-right: 36px; font-variant-numeric: tabular-nums; }
.amount-wrap .unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 16px; pointer-events: none; }

/* 어떤 돈인지 고르기(카드 결제, 계좌이체, 들어온 돈) */
.money-seg { margin: 0; }
[data-when][hidden] { display: none !important; }
.cat.xfer { background: transparent; border: 1px solid var(--accent); color: var(--accent); }
.acct-line { margin: 0; font-size: 13px; color: var(--muted); }

/* 낸 사람과 쓴 사람(2026-11-13) */
.who-pair { display: inline-flex; flex: none; margin-right: 10px; }
.who-pair .who.sm { margin: 0; }
.who-pair .who.sm + .who.sm { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.paid-by { font-size: 12px; color: var(--muted); }
.people-pick { display: flex; flex-direction: column; gap: 6px; }
.people-row { display: flex; align-items: center; gap: 10px; }
.people-label { flex: none; width: 76px; font-size: 13px; color: var(--muted); }
.people-row .seg { flex: 1; margin: 0; }
.seg > button:disabled { opacity: .45; cursor: not-allowed; }
.bulk-people { align-items: center; }

/* 메모 먼저(2026-11-13). 메모가 있으면 큰 글씨가 메모이고 가게 이름은 그 아래 한 줄로 줄입니다 */
.tx-shop { font-size: 13px; color: var(--text); opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-memo { display: flex; gap: 8px; align-items: center; }
.panel-memo input { flex: 1; min-width: 0; min-height: 40px; }
.panel-memo .btn { flex: none; }

/* 분류 관리(2026-11-13) */
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-item { padding: 10px 0; }
.cat-item + .cat-item { border-top: 1px solid var(--line); }
.cat-head { display: flex; align-items: center; gap: 10px; }
.cat-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-move { display: flex; gap: 4px; }
.cat-move form { margin: 0; }
.iconbtn.small { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: transparent; }
.iconbtn.small svg { width: 18px; height: 18px; }
.iconbtn.small:disabled { opacity: .3; }
.cat-new { display: grid; grid-template-columns: 72px 1fr; gap: 10px; }
.cat-form { margin-top: 10px; }
.panel-cat a { flex: none; }
.chip.new-chip { border-style: dashed; }
