:root {
  color-scheme: light;
  --green: #20a968;
  --green-dark: #168653;
  --green-soft: #e7f6ed;
  --green-pale: #f3fbf6;
  --ink: #1d2b24;
  --muted: #819087;
  --line: #e8eee9;
  --surface: #fff;
  --canvas: #f7faf8;
  --red: #eb6866;
  --orange: #e9a43c;
  --shadow: 0 16px 48px rgba(37, 67, 49, .08);
  font-family: 'DM Sans', 'Noto Sans TC', sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
 [hidden] { display: none !important; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--canvas); color: var(--ink); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(32,169,104,.2); outline-offset: 2px; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 252px; flex: 0 0 252px; background: #fff; border-right: 1px solid var(--line); padding: 27px 17px 18px; display: flex; flex-direction: column; min-height: 100vh; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); padding: 0 9px; margin-bottom: 34px; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; background: var(--green); color: white; border-radius: 13px 13px 13px 4px; font-size: 20px; font-weight: 800; box-shadow: 0 6px 15px rgba(32,169,104,.2); }
.brand-copy { display: flex; flex-direction: column; gap: 1px; }
.brand-copy strong { font-size: 17px; letter-spacing: .3px; }
.brand-copy small { color: #a4b0a8; font-size: 9px; letter-spacing: 1.4px; font-weight: 700; }
.group-switcher { width: calc(100% - 4px); font: inherit; text-align: left; color: inherit; display: flex; align-items: center; gap: 10px; padding: 12px 10px; border: 1px solid var(--line); border-radius: 13px; margin: 0 2px 27px; background: #fcfdfc; }
.group-switcher:hover { border-color: #bde8cf; background: #f9fdfb; }
.group-avatar { width: 35px; height: 35px; border-radius: 11px; display: grid; place-items: center; background: #fff4dc; font-size: 18px; }
.group-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.group-copy small { color: var(--muted); font-size: 10px; }
.group-copy strong { font-size: 12px; white-space: nowrap; }
.chevron { color: #9aa79f; font-size: 19px; margin-top: -6px; }
.sidebar-label { color: #a0aaa4; font-weight: 700; font-size: 10px; letter-spacing: .8px; text-transform: uppercase; padding: 0 10px; }
.primary-nav { display: grid; gap: 5px; margin-top: 11px; }
.nav-item { border: 0; background: transparent; color: #65756b; border-radius: 10px; min-height: 43px; padding: 0 11px; display: flex; align-items: center; gap: 12px; text-align: left; font-weight: 600; transition: background .16s, color .16s; }
.nav-item:hover { background: #f4f8f5; color: var(--green-dark); }
.nav-item.active { color: var(--green-dark); background: var(--green-soft); }
.nav-icon { font-size: 18px; width: 20px; text-align: center; font-weight: 700; }
.nav-badge { margin-left: auto; background: #fff; color: var(--green-dark); border-radius: 20px; font-size: 10px; min-width: 20px; padding: 3px 6px; text-align: center; }
.sidebar-divider { border-top: 1px solid var(--line); margin: 22px 4px 19px; }
.member-heading { display: flex; justify-content: space-between; align-items: center; }
.text-icon { background: transparent; border: 0; border-radius: 7px; color: var(--green); font-size: 21px; width: 28px; height: 26px; line-height: 20px; }
.text-icon:hover { background: var(--green-soft); }
.member-list { display: grid; gap: 8px; margin-top: 15px; }
.member-row { display: flex; align-items: center; gap: 9px; padding: 5px 8px; border-radius: 9px; color: #4a5b50; font-size: 12px; }
.member-row.current { background: var(--green-pale); color: var(--green-dark); font-weight: 700; }
.avatar { display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 50%; width: 31px; height: 31px; font-size: 11px; font-weight: 700; color: #fff; }
.member-row .avatar { width: 27px; height: 27px; font-size: 10px; }
.member-row .member-presence { margin-left: auto; color: #b6c4bb; font-size: 10px; }
.sidebar-bottom { margin-top: auto; }
.local-note { background: #f5faf6; border-radius: 8px; color: #819087; font-size: 10px; padding: 9px 10px; display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.note-dot, .sync-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: #46bd7d; }
.reset-button { border: 0; background: transparent; color: #a3aea6; font-size: 10px; padding: 4px 10px 12px; }
.reset-button:hover { color: var(--red); }
.profile-card { border-top: 1px solid var(--line); padding: 14px 5px 0; display: flex; align-items: center; gap: 9px; }
.avatar-me { background: #d7efff; color: #317ca4; }
.profile-copy { display: flex; flex-direction: column; flex: 1; gap: 2px; }
.profile-copy strong { font-size: 12px; }
.profile-copy small { font-size: 10px; color: #9aa69e; }
.profile-switch { border: 0; background: transparent; color: #8b9b91; font-size: 18px; }

.main-area { flex: 1; min-width: 0; }
.topbar { height: 69px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 38px; position: sticky; top: 0; z-index: 4; backdrop-filter: blur(14px); }
.breadcrumb { color: #9ba69f; font-size: 12px; display: flex; align-items: center; gap: 10px; }
.breadcrumb strong { color: #435249; font-weight: 600; }
.breadcrumb-sep { color: #d2dad5; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.sync-status { color: #91a097; font-size: 10px; display: flex; align-items: center; gap: 6px; }
.icon-button { border: 1px solid var(--line); background: #fff; border-radius: 10px; width: 35px; height: 35px; color: #728078; font-size: 17px; }
.icon-button:hover { border-color: #b7e6cb; color: var(--green); }
.top-avatar { width: 33px; height: 33px; }
.mobile-menu { display: none; border: 0; background: transparent; color: #59695e; font-size: 19px; }
.content-wrap { width: min(1190px, 100%); margin: 0 auto; padding: 34px 38px 70px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 25px; }
.page-heading h1 { font-size: 25px; letter-spacing: -.5px; margin: 0 0 6px; line-height: 1.25; }
.page-heading p { color: var(--muted); margin: 0; font-size: 12px; }
.heading-actions { display: flex; align-items: center; gap: 9px; }
.button { min-height: 40px; border-radius: 10px; border: 1px solid transparent; padding: 0 15px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .16s, background .16s, box-shadow .16s; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--green); color: #fff; box-shadow: 0 7px 17px rgba(32,169,104,.17); }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { background: #fff; border-color: var(--line); color: #5e6f64; }
.button-secondary:hover { border-color: #bde8cf; color: var(--green-dark); }
.button-small { min-height: 34px; font-size: 11px; padding: 0 12px; }
.line-auth-button { font-size: 10px; white-space: nowrap; }

.currency-switch { display: inline-flex; gap: 3px; background: #f0f4f1; padding: 3px; border-radius: 9px; }
.currency-switch button { background: transparent; border: 0; border-radius: 7px; padding: 6px 10px; color: #87948b; font-size: 10px; font-weight: 700; }
.currency-switch button.active { background: #fff; color: var(--green-dark); box-shadow: 0 2px 6px rgba(30,60,40,.08); }
.currency-select { min-width: 145px; max-width: 190px; font-size: 10px; }
.overview-grid { display: grid; grid-template-columns: 1.55fr 1fr 1fr; gap: 14px; margin-bottom: 19px; }
.summary-card { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 17px 19px; min-height: 112px; position: relative; overflow: hidden; }
.summary-card.primary-summary { background: linear-gradient(120deg, #e9f8ee, #f3fbf6); border-color: #e0f2e6; }
.summary-label { color: #819087; font-size: 10px; display: flex; align-items: center; gap: 6px; }
.summary-card strong { display: block; font-size: clamp(21px, 2.2vw, 29px); letter-spacing: -.8px; margin-top: 11px; font-weight: 700; }
.summary-card.primary-summary strong { color: #168653; }
.summary-foot { color: #92a098; font-size: 10px; margin-top: 4px; }
.summary-icon { position: absolute; right: 15px; top: 13px; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,.74); color: var(--green); font-size: 14px; }
.amount-positive { color: #168653 !important; }
.amount-negative { color: var(--red) !important; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 286px; align-items: start; gap: 17px; }
.ledger-panel { width: 100%; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 3px 13px rgba(37,67,49,.025); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 19px; border-bottom: 1px solid #f0f3f1; }
.panel-title { margin: 0; font-size: 13px; font-weight: 700; }
.panel-subtitle { color: #99a59d; font-size: 10px; margin-top: 4px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 13px 18px; border-bottom: 1px solid #f0f3f1; }
.search-field { border: 1px solid var(--line); background: #fbfcfb; border-radius: 8px; padding: 8px 10px; min-width: 160px; flex: 1; color: var(--ink); font-size: 11px; }
.select-field { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 10px; color: #65756b; font-size: 10px; }
.records-list { padding: 0 17px 8px; }
.date-group { padding-top: 14px; }
.date-label { color: #98a49c; font-size: 10px; font-weight: 700; margin: 0 3px 5px; display: flex; align-items: center; gap: 8px; }
.date-label::after { content: ''; height: 1px; flex: 1; background: #eff3f0; }
.record-row { display: flex; gap: 11px; align-items: center; padding: 11px 5px; border-bottom: 1px solid #f3f5f3; }
.record-row:last-child { border-bottom: 0; }
.category-icon { width: 39px; height: 39px; flex: 0 0 39px; display: grid; place-items: center; border-radius: 12px; font-size: 17px; }
.record-main { flex: 1; min-width: 0; }
.record-title { font-size: 12px; font-weight: 700; color: #324239; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.record-meta { color: #98a39c; font-size: 10px; margin-top: 4px; }
.record-amounts { text-align: right; min-width: 100px; }
.record-total { color: #34443a; font-size: 12px; font-weight: 700; white-space: nowrap; }
.record-share { color: #99a59d; font-size: 9px; margin-top: 3px; }
.record-actions { display: flex; align-items: center; gap: 2px; opacity: 0; transition: opacity .12s; }
.record-row:hover .record-actions { opacity: 1; }
.record-edit, .record-delete { border: 0; background: transparent; border-radius: 6px; padding: 6px; font-size: 14px; color: #94a198; }
.record-edit:hover { background: #eaf7ef; color: var(--green-dark); }
.record-delete { color: #c1cbc4; }
.record-delete:hover { background: #fff1f0; color: var(--red); }
.empty-state { padding: 36px 15px; text-align: center; color: #99a69d; font-size: 12px; }
.empty-state span { display: block; font-size: 27px; margin-bottom: 9px; }

.side-stack { display: grid; gap: 15px; }
.settlement-panel { padding: 17px; }
.settlement-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.settlement-head h2 { font-size: 13px; margin: 0; }
.mini-link { border: 0; padding: 0; background: transparent; color: var(--green); font-size: 10px; font-weight: 700; }
.currency-caption { color: #9aa69e; font-size: 10px; margin: 3px 0 13px; }
.settlement-item { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid #f0f3f1; }
.settlement-avatar { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-size: 9px; font-weight: 700; }
.settlement-copy { flex: 1; min-width: 0; color: #68766d; font-size: 10px; }
.settlement-copy strong { color: #37473d; }
.settlement-amount { font-size: 10px; font-weight: 700; color: #4d5c52; white-space: nowrap; }
.settlement-amount .currency-small { color: #99a49d; font-size: 9px; font-weight: 500; }
.no-settlements { color: #99a69d; text-align: center; padding: 20px 6px; font-size: 11px; }
.invite-card { background: #173c2b; color: #fff; padding: 18px; border-radius: 15px; overflow: hidden; position: relative; }
.invite-card::after { content: '✳'; position: absolute; right: 10px; top: -19px; font-size: 92px; color: rgba(255,255,255,.06); }
.invite-card h3 { margin: 0 0 7px; font-size: 13px; position: relative; z-index: 1; }
.invite-card p { color: #c4d8cb; line-height: 1.6; margin: 0 0 15px; font-size: 10px; position: relative; z-index: 1; }
.invite-card .button { background: #fff; color: #176f45; min-height: 32px; font-size: 10px; position: relative; z-index: 1; }

.balance-list { padding: 4px 18px 12px; }
.balance-row { display: flex; align-items: center; gap: 12px; padding: 14px 2px; border-bottom: 1px solid #f0f3f1; }
.balance-row:last-child { border-bottom: 0; }
.balance-row .avatar { width: 36px; height: 36px; }
.balance-member { flex: 1; }
.balance-member strong { display: block; font-size: 12px; }
.balance-member small { display: block; color: #9ba79f; font-size: 10px; margin-top: 3px; }
.balance-number { text-align: right; font-size: 13px; font-weight: 700; }
.balance-number small { display: block; font-size: 9px; font-weight: 500; color: #9ba79f; margin-top: 3px; }
.transfer-list { padding: 7px 18px 16px; }
.transfer-row { background: #f8fbf9; border: 1px solid #edf3ee; border-radius: 10px; padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.transfer-route { display: flex; align-items: center; gap: 7px; font-size: 10px; color: #6d7a71; }
.transfer-route strong { color: #38493e; }
.transfer-route .arrow { color: #a4b1a8; }
.transfer-value { font-size: 11px; font-weight: 700; color: #35463b; white-space: nowrap; }
.member-currency-tabs { display: flex; gap: 6px; }

.stats-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; }
.chart-panel { padding-bottom: 16px; }
.chart-total { font-size: 19px; font-weight: 700; color: #25372b; }
.chart-total small { display: block; font-size: 10px; font-weight: 500; color: #95a199; margin-top: 3px; }
.donut-wrap { display: flex; align-items: center; justify-content: center; gap: 28px; padding: 28px 20px 20px; }
.donut { width: 176px; height: 176px; border-radius: 50%; background: conic-gradient(#31af70 0 30%, #67c8aa 30% 52%, #8dc8e8 52% 68%, #f3bd63 68% 82%, #ef8582 82% 92%, #bbabe9 92% 100%); position: relative; flex: 0 0 auto; }
.donut::after { content: ''; position: absolute; inset: 30px; border-radius: 50%; background: white; }
.donut-center { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; text-align: center; color: #8c9a91; font-size: 9px; }
.donut-center strong { color: #324238; font-size: 16px; margin-top: 4px; }
.legend { display: grid; gap: 11px; min-width: 126px; }
.legend-item { display: flex; align-items: center; gap: 8px; color: #718077; font-size: 10px; }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; }
.legend-item strong { margin-left: auto; color: #435249; font-size: 10px; }
.category-bars { padding: 8px 20px 20px; display: grid; gap: 16px; }
.category-bar-head { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; color: #718077; margin-bottom: 7px; }
.category-bar-head strong { color: #45554b; }
.bar-track { background: #f1f5f2; height: 7px; border-radius: 10px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--green); }
.member-spend-list { padding: 5px 18px 14px; }
.member-spend-row { display: flex; align-items: center; gap: 9px; padding: 10px 0; border-bottom: 1px solid #f1f4f2; }
.member-spend-row:last-child { border-bottom: 0; }
.member-spend-row .avatar { width: 28px; height: 28px; }
.member-spend-row strong { flex: 1; font-size: 10px; }
.member-spend-row span:last-child { color: #536258; font-size: 10px; font-weight: 700; }
.settlement-report { margin-top: 16px; }
.stats-mode-switch { display: inline-flex; gap: 3px; background: #f0f4f1; padding: 3px; border-radius: 9px; }
.stats-mode-switch button { background: transparent; border: 0; border-radius: 7px; padding: 7px 10px; color: #87948b; font-size: 10px; font-weight: 700; white-space: nowrap; }
.stats-mode-switch button.active { background: #fff; color: var(--green-dark); box-shadow: 0 2px 6px rgba(30,60,40,.08); }
.stats-mode-switch button:disabled { opacity: .48; cursor: not-allowed; }
.fx-notice { border: 1px solid #dcefe3; background: #f4fbf6; color: #587062; border-radius: 10px; padding: 10px 13px; font-size: 10px; line-height: 1.65; margin: -9px 0 16px; }
.fx-notice.fx-error { color: #a44c49; border-color: #f1d8d6; background: #fff8f7; }
.fx-details { margin-top: 12px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: #68766d; font-size: 10px; }
.fx-details summary { cursor: pointer; font-weight: 700; color: #516257; }
.fx-rate-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 7px; margin-top: 11px; }
.fx-rate-list > div { display: grid; gap: 4px; background: #f7faf8; border-radius: 8px; padding: 9px; }
.fx-rate-list strong { color: #33453a; }
.fx-rate-list small, .fx-source { color: #98a49c; font-size: 9px; }
.fx-source { margin-top: 10px; }

.modal-root:empty { display: none; }
.modal-root { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; overflow-y: auto; overscroll-behavior: contain; padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom)); background: rgba(17,34,25,.38); backdrop-filter: blur(4px); }
.modal { width: min(560px, 100%); max-height: min(90dvh, 780px); min-height: 0; flex: 0 1 auto; display: flex; flex-direction: column; background: #fff; border-radius: 18px; box-shadow: 0 24px 80px rgba(16,43,27,.22); overflow: hidden; animation: modal-in .18s ease-out; }
@keyframes modal-in { from { opacity: .7; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header { padding: 19px 22px 15px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #eff3f0; }
.modal-header h2 { font-size: 16px; margin: 0; }
.modal-close { border: 0; background: transparent; color: #839087; font-size: 22px; line-height: 1; width: 30px; height: 30px; }
.modal-body { padding: 18px 22px; overflow-y: auto; overscroll-behavior: contain; }
.modal > form { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow: hidden; }
.modal > form .modal-body { flex: 1 1 auto; min-height: 0; }
.modal-footer { flex: 0 0 auto; border-top: 1px solid #eff3f0; padding: 13px 22px; display: flex; justify-content: flex-end; gap: 9px; background: #fff; }
.type-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; border-radius: 10px; padding: 4px; background: #f2f6f3; margin-bottom: 18px; }
.type-tabs button { border: 0; background: transparent; border-radius: 7px; padding: 9px 6px; font-weight: 700; font-size: 11px; color: #8a968e; }
.type-tabs button.active { background: #fff; color: var(--green-dark); box-shadow: 0 2px 7px rgba(34,65,43,.08); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 12px; }
.form-field { display: grid; gap: 6px; min-width: 0; }
.form-field.full { grid-column: 1 / -1; }
.form-field label, .field-label { color: #59695f; font-size: 10px; font-weight: 700; }
.form-field input, .form-field select, .form-field textarea { width: 100%; border: 1px solid #e3ebe5; border-radius: 9px; background: #fff; color: #34443a; padding: 10px 11px; min-height: 39px; font-size: 11px; }
.form-field textarea { resize: vertical; min-height: 64px; }
.form-field input::placeholder, .form-field textarea::placeholder { color: #b0bbb3; }
.payer-select { display: flex; flex-wrap: wrap; gap: 7px; }
.choice-chip { cursor: pointer; }
.choice-chip input { position: absolute; opacity: 0; pointer-events: none; }
.choice-chip span { display: flex; align-items: center; gap: 6px; border: 1px solid #e5ece7; color: #6e7c72; padding: 7px 10px; border-radius: 30px; font-size: 10px; }
.choice-chip input:checked + span { border-color: #b4e2c6; background: #eef9f2; color: #168653; font-weight: 700; }
.split-mode { display: flex; align-items: center; gap: 8px; }
.split-mode button { border: 1px solid #e5ece7; border-radius: 30px; padding: 7px 11px; background: #fff; color: #78857c; font-size: 10px; }
.split-mode button.active { background: #eef9f2; color: var(--green-dark); border-color: #b4e2c6; font-weight: 700; }
.participants { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr)); gap: 7px; }
.participant-option { border: 1px solid #e7eee9; border-radius: 10px; padding: 8px 9px; display: flex; align-items: center; gap: 7px; cursor: pointer; color: #67756b; font-size: 10px; }
.participant-option:has(input:checked) { background: #f2faf5; border-color: #b8e4c9; }
.participant-option input { accent-color: var(--green); width: 13px; height: 13px; margin: 0; }
.participant-option .avatar { width: 23px; height: 23px; font-size: 9px; }
.custom-share-list { display: grid; gap: 7px; margin-top: 9px; }
.custom-share-row { display: flex; align-items: center; gap: 8px; color: #718077; font-size: 10px; }
.custom-share-row .avatar { width: 22px; height: 22px; font-size: 8px; }
.custom-share-row input { margin-left: auto; width: 120px; min-height: 33px; padding: 6px 9px; text-align: right; }
.share-currency-unit { min-width: 32px; color: #8b9990; font-size: 9px; font-weight: 700; }
.form-hint { color: #a1ada4; font-size: 9px; margin-top: 2px; }
.error-text { color: #d95452; font-size: 10px; margin-top: 8px; min-height: 14px; }
.invite-explain { border: 1px solid #dcefe3; border-radius: 12px; background: #f4fbf6; padding: 14px; color: #5e7065; font-size: 11px; line-height: 1.75; }
.invite-explain strong { color: #168653; }
.invite-existing { margin-top: 16px; }
.invite-existing-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #edf2ee; color: #748178; font-size: 10px; }
.danger-link { color: #d65e5b; }
.invite-url-row { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.invite-url-row .search-field { min-width: 0; }
.created-invite { margin-top: 16px; border: 1px solid #e4eee6; background: #fbfdfb; padding: 12px; border-radius: 10px; }
.group-choice-list { display: grid; gap: 7px; }
.group-choice { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid #e7eee9; border-radius: 10px; background: white; padding: 10px; color: #536258; }
.group-choice.selected { background: #f2faf5; border-color: #b7e4c8; }
.group-choice-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; background: #e8f6ed; color: var(--green-dark); }
.group-choice > span:last-child { display: grid; gap: 3px; }
.group-choice strong { font-size: 11px; }
.group-choice small { color: #96a39a; font-size: 9px; }
.create-group-form { border-top: 1px solid #edf2ee; margin-top: 16px; padding-top: 15px; }
.invite-steps { display: grid; gap: 9px; margin: 15px 0; }
.invite-step { display: flex; gap: 9px; align-items: flex-start; color: #748178; font-size: 10px; line-height: 1.6; }
.step-number { background: #e8f6ed; color: var(--green-dark); width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 21px; font-weight: 700; }
.toast { position: fixed; z-index: 40; bottom: 23px; left: 50%; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; background: #203b2c; color: #fff; padding: 10px 15px; border-radius: 10px; box-shadow: var(--shadow); font-size: 11px; transition: opacity .18s, transform .18s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1080px) {
  .sidebar { width: 225px; flex-basis: 225px; }
  .content-wrap { padding: 28px 24px 60px; }
  .topbar { padding: 0 24px; }
  .content-grid { grid-template-columns: minmax(0,1fr) 255px; }
  .overview-grid { grid-template-columns: 1.25fr 1fr 1fr; }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; z-index: 12; inset: 0 auto 0 0; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 12px 0 35px rgba(25,50,35,.12); }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: inline-grid; place-items: center; }
  .topbar { height: 60px; padding: 0 18px; gap: 12px; }
  .breadcrumb { flex: 1; }
  .content-wrap { padding: 25px 18px 50px; }
  .content-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .topbar { padding: 0 13px; }
  .topbar-actions { gap: 9px; }
  .sync-status { display: none; }
  .line-auth-button { min-height: 30px; padding: 0 8px; }
  .content-wrap { padding: 22px 13px 42px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
  .page-heading h1 { font-size: 22px; }
  .heading-actions { width: 100%; }
  .heading-actions .button-primary { flex: 1; }
  .heading-actions .currency-select { flex: 1; max-width: none; min-width: 0; }
  .stats-mode-switch { width: 100%; }
  .stats-mode-switch button { flex: 1; }
  .overview-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .summary-card { min-height: 98px; padding: 13px; }
  .summary-card.primary-summary { grid-column: 1 / -1; }
  .summary-card strong { font-size: 22px; }
  .filter-row { padding: 11px; }
  .search-field { min-width: 100%; }
  .records-list { padding: 0 10px 7px; }
  .record-row { gap: 8px; padding: 10px 2px; }
  .category-icon { width: 34px; height: 34px; flex-basis: 34px; border-radius: 10px; }
  .record-amounts { min-width: 86px; }
  .record-actions { opacity: 1; }
  .side-stack { grid-template-columns: 1fr; }
  .stats-grid { gap: 12px; }
  .donut-wrap { flex-direction: column; gap: 20px; }
  .legend { width: 100%; grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .modal-root { align-items: flex-start; padding: max(9px, env(safe-area-inset-top)) 9px max(9px, env(safe-area-inset-bottom)); }
  .modal { max-height: calc(100dvh - max(18px, env(safe-area-inset-top)) - max(18px, env(safe-area-inset-bottom))); border-radius: 15px; margin-block: auto; }
  .modal-header { padding: 16px 17px 12px; }
  .modal-body { padding: 15px 17px; }
  .modal-footer { padding: 11px 17px max(11px, env(safe-area-inset-bottom)); }
  .custom-share-row input { width: 100px; }
}
