/* 旅遊記帳 — 紙本風格（T1 樣稿） */
:root {
  --paper: #F5F1E8; --card: #FFFDF8; --ink: #2A2823; --muted: #66605A; --line: #E2DACB; --line2: #EDE6D8; --chip-line: #D6CDBB;
  --accent: #2D4A6B; --accent-d: #1E3550; --accent-bg: #E7EDF3; --pay: #9A4A22; --warn: #C27A2C; --warn-t: #8A5410; --tint: #F0EADC;
  --ok: #3E6E4E; --radius: 16px;
  --on-accent: #FFFDF8; --pay-bg: #F6E3D8; --warn-bg: #F6EBDA; --green-bg: #E6EDE3; --green-t: #3F5A37; --gray-bg: #EEEAE2; --tint2: #FBF8F1;
  --c1: #2F6AA8; --c2: #B5702F; --grid: #E7E0D2; --scrim: rgba(42, 40, 35, .35);
  color-scheme: light;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --serif: "Songti TC", "Noto Serif TC", "PMingLiU", "PingFang TC", serif;
}

/* 深色模式（O4）：自動跟隨系統，或在設定指定 */
:root[data-theme=dark] {
  --paper: #171614; --card: #23211D; --ink: #ECE7DD; --muted: #A8A196; --line: #3A3731; --line2: #2E2C28; --chip-line: #4A463F;
  --accent: #9DBDE3; --accent-d: #C2D6EE; --accent-bg: #24344A; --pay: #E8A27C; --warn: #D9A04A; --warn-t: #E3B66E; --tint: #2C2A25; --ok: #86B892;
  --on-accent: #12202E; --pay-bg: #3A2720; --warn-bg: #3A3020; --green-bg: #263326; --green-t: #9CC39A; --gray-bg: #2E2C28; --tint2: #26241F;
  --c1: #5590D2; --c2: #BE7B39; --grid: #34312C; --scrim: rgba(0, 0, 0, .55);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --paper: #171614; --card: #23211D; --ink: #ECE7DD; --muted: #A8A196; --line: #3A3731; --line2: #2E2C28; --chip-line: #4A463F;
    --accent: #9DBDE3; --accent-d: #C2D6EE; --accent-bg: #24344A; --pay: #E8A27C; --warn: #D9A04A; --warn-t: #E3B66E; --tint: #2C2A25; --ok: #86B892;
    --on-accent: #12202E; --pay-bg: #3A2720; --warn-bg: #3A3020; --green-bg: #263326; --green-t: #9CC39A; --gray-bg: #2E2C28; --tint2: #26241F;
    --c1: #5590D2; --c2: #BE7B39; --grid: #34312C; --scrim: rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.45; font-variant-numeric: tabular-nums; -webkit-tap-highlight-color: transparent; }
body.no-scroll { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
a:hover { color: var(--accent-d); }
h1, h2, p { margin: 0; }
.serif { font-family: var(--serif); font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 600; }
.center { text-align: center; padding: 24px 0; }
.err { color: var(--pay); font-size: 13px; }
.danger-text { color: var(--pay); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.col.end { align-items: flex-end; text-align: right; }
.grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pad { padding: 8px 4px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 版面 */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.main { flex: 1; padding-bottom: calc(96px + env(safe-area-inset-bottom)); max-width: 640px; width: 100%; margin: 0 auto; }
.page { padding: 4px 16px 24px; display: flex; flex-direction: column; gap: 12px; }
.splash { min-height: 100vh; display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--muted); }
.demo-bar { background: var(--accent); color: var(--on-accent); text-align: center; font-size: 12px; padding: 6px 12px; padding-top: calc(6px + env(safe-area-inset-top)); }

.hdr { display: flex; align-items: center; gap: 4px; padding: calc(14px + env(safe-area-inset-top)) 12px 8px 16px; }
.hdr-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hdr-text.center { align-items: center; text-align: center; }
.hdr h1 { font-size: 26px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.hdr-text.center h1 { font-size: 19px; }
.hdr-sub { font-size: 13px; color: var(--muted); }
.hdr-right { display: flex; align-items: center; gap: 4px; }
.sync { display: inline-flex; align-items: center; gap: 5px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 4px; background: var(--muted); }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.off { background: #9A928A; }

.icon-btn { width: 44px; height: 44px; border: none; background: transparent; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); border-radius: 12px; cursor: pointer; text-decoration: none; flex: none; }
.icon-btn:hover { background: rgba(0, 0, 0, .04); color: var(--ink); }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 8px 8px calc(10px + env(safe-area-inset-bottom)); z-index: 20; }
.tab { text-decoration: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; min-height: 48px; justify-content: center; }
.tab.on { color: var(--accent); font-weight: 700; }
.tab:hover { color: var(--muted); } .tab.on:hover { color: var(--accent); }

/* 卡片與清單 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.section-label { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 1px; margin: 8px 4px 0; }
.section-label small { letter-spacing: 0; font-weight: 400; margin-left: 6px; }
.trip-card { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.trip-card:hover { color: inherit; border-color: var(--chip-line); }
.trip-name { font-size: 21px; }
.stat-row { padding-top: 12px; border-top: 1px dashed var(--line); }
.big { font-size: 20px; font-weight: 700; }
.badge { font-size: 12px; padding: 4px 10px; border-radius: 10px; background: var(--accent-bg); color: var(--accent); font-weight: 500; white-space: nowrap; }
.list-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; list-style: none; margin: 0; padding: 0; overflow: hidden; }
.list-card > li + li, .list-card > .list-row + .list-row, .list-card > .list-row + button, .list-card > button + .list-row, .list-card > button + button { border-top: 1px solid var(--line2); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-decoration: none; color: inherit; background: none; border: none; width: 100%; text-align: left; cursor: pointer; min-height: 56px; }
.list-row.disabled { cursor: default; opacity: .65; }
.list-row.add { color: var(--accent); font-weight: 600; gap: 8px; }
div.list-row { cursor: default; }
.list-row .toggle-row { width: 100%; }
.notice { background: var(--tint); border-radius: 12px; padding: 10px 14px; font-size: 13px; color: var(--ink); display: flex; gap: 8px; align-items: center; }
.notice.error { background: var(--pay-bg); color: var(--pay); }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-title { color: var(--ink); font-weight: 600; }

/* 按鈕 */
.btn { height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--accent); background: transparent; color: var(--accent); font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 700; }
.btn.primary:hover:not(:disabled) { background: var(--accent-d); }
.btn.ghost { border-color: transparent; }
.btn.danger { border-color: var(--pay); color: var(--pay); }
.btn.block { width: 100%; }
.btn.pill { border-radius: 22px; }
.btn.small { height: 36px; padding: 0 12px; font-size: 13px; align-self: center; }
.link-btn { background: none; border: none; color: var(--accent); font-weight: 500; padding: 6px 0; cursor: pointer; font-size: 14px; text-align: left; min-height: 36px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }

/* 表單 */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label { font-size: 13px; color: var(--muted); }
.field small, .hint { font-size: 12px; color: var(--muted); }
.field small.err { color: var(--pay); }
input[type=text], input[type=password], input[type=date], input[type=number] { height: 46px; border: 1px solid var(--chip-line); border-radius: 12px; background: var(--card); padding: 0 14px; font-size: 16px; width: 100%; min-width: 0; }
input[type=date] { -webkit-appearance: none; appearance: none; }
.inline { display: flex; align-items: center; gap: 8px; }
.inline label, .inline span { white-space: nowrap; font-size: 14px; color: var(--muted); }
.inline input { flex: 1; }
.fixed-rates { display: flex; flex-direction: column; gap: 8px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--tint); border-radius: 12px; padding: 4px; gap: 2px; }
.seg button { height: 40px; border: none; border-radius: 9px; background: transparent; color: var(--muted); font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; padding: 0 10px; white-space: nowrap; }
.seg button.on { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.seg.small { display: inline-grid; padding: 3px; border-radius: 10px; }
.seg.small button { height: 32px; font-size: 13px; border-radius: 8px; padding: 0 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 38px; padding: 0 14px; border-radius: 19px; border: 1px solid var(--chip-line); background: transparent; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.chip small { color: var(--muted); font-size: 12px; }
.chip.on { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.chip.on small { color: var(--on-accent); opacity: .8; }
.chip .avatar { margin-left: -10px; }
.avatar { border-radius: 50%; color: #FFFDF8; display: inline-flex; align-items: center; justify-content: center; flex: none; border: 2px solid var(--card); }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toggle-text { display: flex; flex-direction: column; gap: 2px; }
.toggle-text small { font-size: 12px; color: var(--muted); }
.switch { width: 50px; height: 30px; flex: none; border: none; border-radius: 15px; background: var(--chip-line); padding: 3px; display: flex; justify-content: flex-start; cursor: pointer; transition: background .15s; }
.switch span { width: 24px; height: 24px; border-radius: 12px; background: var(--card); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.switch.on { background: var(--accent); justify-content: flex-end; }

/* 記帳表單 */
.expense-form { padding: 18px; gap: 16px; }
.expense-form.flat { border: none; padding: 0; background: transparent; }
.amount-line { display: flex; align-items: baseline; gap: 8px; border-bottom: 2px solid var(--ink); padding-bottom: 4px; }
.amount-line .cur { font-size: 22px; color: var(--muted); }
.amount-line input { flex: 1; border: none !important; background: transparent !important; font-size: 36px !important; font-weight: 700; padding: 0 !important; height: 50px !important; outline: none; border-radius: 0 !important; }
.sub-amount { margin-top: 4px; }
.sub-amount input { height: 40px; }
.est { color: var(--muted); font-size: 13px; min-height: 18px; }
.method-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.method-grid button { height: 44px; border-radius: 10px; border: 1px solid var(--chip-line); background: transparent; font-size: 14px; cursor: pointer; }
.method-grid button.on { border: 1.5px solid var(--accent); background: var(--accent-bg); color: var(--accent); font-weight: 700; }
.split { display: flex; flex-direction: column; gap: 8px; }
.more { display: flex; flex-direction: column; gap: 14px; padding: 12px; background: var(--tint); border-radius: 12px; }
.submit-row { display: flex; gap: 8px; }
.submit-row input { flex: 1; height: 48px; }
.submit-row .btn { height: 48px; padding: 0 22px; font-size: 16px; }

/* 最近花費 */
.recent { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.day { display: flex; flex-direction: column; gap: 8px; }
.day-hdr { padding: 6px 4px 0; align-items: baseline; }
.day-hdr h2 { font-size: 17px; }
.exp-row { display: flex; gap: 12px; align-items: center; width: 100%; padding: 13px 16px; background: none; border: none; text-align: left; cursor: pointer; min-height: 60px; }
.exp-row:hover { background: rgba(0, 0, 0, .02); }
.cat-ic { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; }
.cat-ic.warm { background: var(--tint); color: var(--warn-t); }
.cat-ic.blue { background: var(--accent-bg); color: var(--accent); }
.cat-ic.green { background: var(--green-bg); color: var(--green-t); }
.cat-ic.gray { background: var(--gray-bg); color: var(--muted); }
.st-wait { color: var(--warn-t); display: inline-flex; align-items: center; gap: 4px; }
.st-fail { color: var(--pay); font-weight: 600; }
.st-info { color: var(--accent); }

/* 明細 */
.detail { display: flex; flex-direction: column; gap: 14px; }
.detail-title { font-size: 20px; }
.kv { margin: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line2); }
.kv div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line2); }
.kv dt { color: var(--muted); font-size: 14px; }
.kv dd { margin: 0; text-align: right; font-size: 14px; }

/* 對話框 */
.sheet-wrap { position: fixed; inset: 0; background: var(--scrim); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--paper); width: 100%; max-width: 560px; max-height: 92vh; border-radius: 20px 20px 0 0; display: flex; flex-direction: column; outline: none; animation: up .18s ease-out; }
@keyframes up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-hdr { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 4px 20px; }
.sheet-hdr h2 { font-size: 19px; }
.sheet-body { overflow-y: auto; padding: 8px 20px 20px; -webkit-overflow-scrolling: touch; }
.sheet-foot { padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
@media (min-width: 700px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 20px; max-height: 86vh; } }

/* 登入 */
.center-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 32px 20px; text-align: center; max-width: 420px; margin: 0 auto; }
.center-page h1 { font-size: 30px; }
.center-page .card { width: 100%; text-align: left; }
.logo { width: 64px; height: 64px; border-radius: 18px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(100px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 80; max-width: calc(100% - 32px); box-shadow: 0 4px 16px rgba(0, 0, 0, .15); }
.toast.error { background: var(--pay); color: var(--on-accent); }
.toast.ok { background: var(--accent); color: var(--on-accent); }

@media (min-width: 900px) {
  .main { max-width: 720px; }
  .tabbar { left: 50%; transform: translateX(-50%); max-width: 720px; border: 1px solid var(--line); border-bottom: none; border-radius: 16px 16px 0 0; }
}

/* T4：成員、邀請、結算、分攤 */
.card-title { font-size: 18px; }
.invite-card { display: flex; flex-direction: column; gap: 12px; border-style: dashed; }
.invite-body { display: flex; gap: 14px; align-items: center; }
.qr { width: 132px; height: 132px; flex: none; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.link-text { font-size: 12px !important; height: 38px !important; color: var(--muted); }
.member .list-row svg.flip { transform: rotate(180deg); }
.member.open { background: var(--tint2); }
.member-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.perm-box { background: var(--card); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; }
.perm-box .toggle-row { padding: 10px 14px; }
.perm-box .toggle-row + .toggle-row { border-top: 1px solid var(--line2); }
.btn-col { display: flex; flex-direction: column; gap: 4px; }
.av-pending .avatar { opacity: .45; border: 1.5px dashed #9A928A; }
.switch:disabled { opacity: .45; cursor: default; }
.join-info { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.join-info p { display: flex; gap: 8px; align-items: flex-start; }
.join-info svg { flex: none; margin-top: 3px; color: var(--accent); }

.summary { display: flex; flex-direction: column; gap: 6px; }
.huge { font-size: 30px; font-weight: 700; }
.pending-refund { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--warn-t); background: var(--warn-bg); border-radius: 8px; padding: 6px 10px; align-self: flex-start; }
.table-card { padding: 4px 16px; }
.t-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.25fr; gap: 6px; padding: 13px 0; font-size: 14px; align-items: center; }
.t-row > span:not(.t-name) { text-align: right; }
.t-row + .t-row { border-top: 1px solid var(--line2); }
.t-head { font-size: 12px; color: var(--muted); padding: 10px 0; }
.t-name { display: flex; align-items: center; gap: 6px; font-weight: 500; min-width: 0; }
.t-net { font-weight: 700; }
.t-net.recv { color: var(--accent); }
.t-net.pay { color: var(--pay); }
.t-note { padding: 0 0 10px; }
.col.gap { gap: 10px; }
.pad-x { padding: 0 4px; }
.h2 { font-size: 17px; }
.sug { display: flex; align-items: center; gap: 10px; padding: 14px; }
.settled { display: flex; align-items: center; gap: 8px; justify-content: center; color: var(--accent); font-weight: 700; }
.detail-table { padding: 4px 16px; }
.dt-row { padding: 10px 0; display: flex; flex-direction: column; gap: 3px; }
.dt-row + .dt-row { border-top: 1px solid var(--line2); }
.split-edit { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--tint); border-radius: 12px; }
.split-row label { display: inline-flex; align-items: center; gap: 6px; min-width: 88px; color: var(--ink) !important; }
.split-row input { height: 40px; }
.notice.tip { flex-direction: column; align-items: flex-start; text-align: left; gap: 6px; }
.notice.tip ol { margin: 0; padding-left: 20px; }
.badge.warn { background: var(--pay-bg); color: var(--pay); }
.badge.new { background: var(--green-bg); color: var(--green-t); margin-left: 8px; font-size: 11px; padding: 2px 8px; }
.gap6 { gap: 6px; }
select { height: 46px; border: 1px solid var(--chip-line); border-radius: 12px; background: var(--card); padding: 0 12px; font-size: 16px; width: 100%; }
.btn.danger-fill { background: var(--pay); border-color: var(--pay); color: var(--on-accent); font-weight: 700; }
.del-list { padding: 12px 16px; }
.del-list ul { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.big-title { font-size: 20px; }
.center-text { text-align: center; }
.row-wrap { display: flex; align-items: center; }
.row-wrap > .list-row { flex: 1; min-width: 0; }
.row-wrap > .icon-btn { margin-right: 6px; }
.list-card > .row-wrap + .row-wrap { border-top: 1px solid var(--line2); }
.danger-zone { border-color: #E8C9B8; }

/* T5：統計 */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile:first-child { grid-column: 1 / -1; }
.tile:first-child .tile-v { font-size: 26px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile-v { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.chart-card { display: flex; flex-direction: column; gap: 10px; }
.chart-title { font-size: 15px; font-weight: 700; margin: 0; }
.chart-title small { font-weight: 400; color: var(--muted); }
.chart { margin: 0; }
.chart svg { width: 100%; height: auto; display: block; touch-action: manipulation; }
.day-detail { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; background: var(--tint); border-radius: 10px; }
.barlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bl-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.bl-val { font-weight: 600; white-space: nowrap; }
.bl-val small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.bl-track { height: 10px; margin-top: 4px; }
.bl-bar { height: 10px; background: var(--c1); border-radius: 0 4px 4px 0; }
.splitbar { display: flex; flex-direction: column; gap: 8px; }
.sb-track { display: flex; gap: 2px; height: 14px; }
.sb-track div:first-child { border-radius: 4px 0 0 4px; } .sb-track div:last-child { border-radius: 0 4px 4px 0; } .sb-track div:only-child { border-radius: 4px; }
.sb-legend { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.sb-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.mini-table { display: flex; flex-direction: column; }
.mt-row { display: grid; grid-template-columns: 1.6fr 1fr 0.8fr 0.8fr; gap: 6px; padding: 8px 0; font-size: 14px; }
.mt-row > span:not(:first-child) { text-align: right; }
.mt-row + .mt-row { border-top: 1px solid var(--line2); }
.mt-head { font-size: 12px; color: var(--muted); }
.mt-total { font-weight: 700; }
.cash-row { padding: 6px 0; }

/* B／O 追加 */
.tiny { font-size: 11px; }
.gap4 { gap: 4px; }
.badge.gray { background: var(--gray-bg); color: var(--muted); }
.trip-card.lost { opacity: .75; border-style: dashed; }
.inline-ic { margin-left: 6px; vertical-align: -2px; color: var(--muted); }
.filter-bar { display: flex; gap: 8px; align-items: center; }
.filter-bar input { height: 40px; font-size: 15px; }
.filter-panel { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--tint); border-radius: 12px; }
.receipts { display: flex; flex-direction: column; gap: 8px; }
.rc-row { display: flex; gap: 8px; flex-wrap: wrap; }
.rc-thumb, .rc-add { width: 72px; height: 72px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; padding: 0; color: var(--accent); }
.rc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rc-add { border-style: dashed; }
.rc-add.disabled { opacity: .5; cursor: default; }
.rc-view { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .85); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; }
.rc-view img { max-width: 100%; max-height: 80vh; border-radius: 8px; }
.cat-editor { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-chip { display: inline-flex; align-items: center; gap: 2px; min-height: 34px; padding: 0 4px 0 12px; border-radius: 17px; border: 1px solid var(--chip-line); font-size: 14px; }
.cat-chip button { width: 28px; height: 28px; border: none; background: none; color: var(--muted); cursor: pointer; border-radius: 14px; }
.me-summary { display: flex; flex-direction: column; gap: 4px; }
.me-summary .huge.recv { color: var(--accent); } .me-summary .huge.pay { color: var(--pay); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { padding: 6px 4px; border-top: 1px solid var(--line2); text-align: right; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.chart .c1 { fill: var(--c1); } .chart .grid { stroke: var(--grid); } .chart .axis { fill: var(--muted); } .chart .lbl { fill: var(--ink); }
.qr { background: #fff; }
