:root {
  color-scheme: light;
  --ink: #171927;
  --muted: #777b8c;
  --line: #e7e8ee;
  --canvas: #f4f5f8;
  --panel: #ffffff;
  --violet: #6558e8;
  --violet-soft: #eeecff;
  --green: #178352;
  --green-soft: #e9f7ef;
  --coral: #db5a55;
  --coral-soft: #fff0ee;
  --blue: #3484d4;
  --blue-soft: #eaf4ff;
  --shadow: 0 12px 35px rgba(22, 25, 39, .055);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); }
button, input, select { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 25px 18px; display: flex; flex-direction: column; background: #171a29; color: white; z-index: 10; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px 25px; }
.brand-mark, .viewer-logo { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #8174ff, #5748d9); color: white; font-weight: 850; font-size: 20px; box-shadow: 0 9px 24px #6658e84a; }
.brand strong { display: block; font-size: 15px; }
.brand small { display: block; color: #8e93a8; margin-top: 2px; font-size: 11px; }
.sidebar-label { margin: 30px 10px 10px; color: #787d93; text-transform: uppercase; letter-spacing: .1em; font-size: 10px; font-weight: 800; }
.trip-list { display: grid; gap: 5px; overflow: auto; }
.trip-nav-item { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 11px; padding: 11px; text-align: left; background: transparent; color: #abb0c3; cursor: pointer; }
.trip-nav-item:hover { background: #202437; color: white; }
.trip-nav-item.active { background: #2b2d48; color: white; }
.trip-nav-icon { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: #30344b; font-size: 13px; }
.trip-nav-item.active .trip-nav-icon { background: var(--violet); }
.trip-nav-copy { min-width: 0; }
.trip-nav-copy strong, .trip-nav-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-nav-copy strong { font-size: 13px; }
.trip-nav-copy small { margin-top: 2px; color: #7f8499; font-size: 10px; }
.sidebar-footer { margin-top: auto; padding: 15px 9px 0; border-top: 1px solid #292c3d; color: #84899e; font-size: 10px; display: flex; align-items: center; gap: 7px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #42ca85; box-shadow: 0 0 0 4px #42ca8517; }

.main { min-width: 0; padding: 28px clamp(22px, 3vw, 48px) 55px; }
.topbar { min-height: 76px; display: flex; align-items: center; gap: 18px; margin-bottom: 25px; }
.trip-heading { min-width: 0; }
.eyebrow { display: block; margin-bottom: 5px; color: #979baa; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.title-row { display: flex; align-items: center; gap: 8px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 3px; font-size: clamp(26px, 3vw, 38px); line-height: 1; letter-spacing: -.045em; }
h2 { margin-bottom: 0; font-size: 18px; letter-spacing: -.02em; }
.trip-dates { color: var(--muted); font-size: 12px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar { width: 39px; height: 39px; border: 0; border-radius: 50%; background: var(--ink); color: white; font-weight: 800; }
.icon-button, .close-button { border: 0; background: transparent; cursor: pointer; }
.icon-button { width: 31px; height: 31px; border-radius: 9px; color: #858999; }
.icon-button:hover { background: #e9eaf0; color: var(--ink); }
.menu-button { display: none; }

.button { min-height: 39px; border: 1px solid transparent; border-radius: 10px; padding: 0 14px; font-weight: 750; font-size: 12px; cursor: pointer; transition: transform .12s ease, background .12s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--ink); color: white; }
.button-primary:hover { background: #2a2e44; }
.button-secondary { background: white; border-color: var(--line); color: #575b6b; }
.button-wide { width: 100%; }
.sidebar .button-primary { background: var(--violet); }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 13px; }
.metric-card, .panel { border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.metric-card { min-width: 0; border-radius: 15px; padding: 17px; display: flex; align-items: center; gap: 13px; }
.metric-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; font-weight: 900; }
.metric-icon.violet { background: var(--violet-soft); color: var(--violet); }
.metric-icon.coral { background: var(--coral-soft); color: var(--coral); }
.metric-icon.green { background: var(--green-soft); color: var(--green); }
.metric-icon.blue { background: var(--blue-soft); color: var(--blue); }
.metric-card span { display: block; color: var(--muted); font-size: 10px; margin-bottom: 5px; }
.metric-card strong { font-size: clamp(17px, 2vw, 22px); white-space: nowrap; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(350px, .8fr); gap: 13px; margin-bottom: 13px; }
.panel { border-radius: 16px; padding: 19px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.badge, .counter, .read-only-badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-size: 10px; font-weight: 800; }
.badge { padding: 6px 9px; background: var(--green-soft); color: var(--green); }
.counter { min-width: 25px; height: 25px; padding: 0 8px; background: #eceef2; color: #676b7b; }
.counter.success { background: #dff2e7; color: var(--green); }
.balance-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.balance-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fbfbfc; }
.balance-item-head { display: flex; align-items: center; gap: 9px; }
.person-avatar { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; background: #eeeff4; color: #626778; font-size: 11px; font-weight: 850; }
.balance-item strong { display: block; font-size: 12px; }
.balance-item small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.balance-amount { margin-top: 10px; font-size: 15px; font-weight: 850; }
.balance-amount.positive { color: var(--green); }
.balance-amount.negative { color: var(--coral); }
.balance-amount.neutral { color: var(--muted); }

.chart-content { min-height: 180px; display: flex; align-items: center; justify-content: center; gap: 28px; }
.donut { width: 145px; height: 145px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: conic-gradient(#e8e9ef 0 100%); position: relative; }
.donut::after { content: ""; position: absolute; inset: 24px; background: white; border-radius: 50%; }
.donut > div { position: relative; z-index: 1; text-align: center; }
.donut small, .donut strong { display: block; }
.donut small { color: var(--muted); font-size: 9px; }
.donut strong { margin-top: 3px; font-size: 17px; }
.chart-legend { display: grid; gap: 9px; min-width: 125px; }
.legend-item { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 7px; font-size: 10px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-item span:nth-child(2) { color: var(--muted); }
.legend-item strong { font-size: 10px; }

.action-panel, .settlements-panel, .participants-panel { margin-bottom: 13px; }
.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 9px; border-bottom: 1px solid var(--line); color: #999dac; text-align: left; text-transform: uppercase; letter-spacing: .07em; font-size: 8px; }
td { padding: 13px 9px; border-bottom: 1px solid #f0f1f4; color: #575b6a; font-size: 11px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td strong { color: var(--ink); }
.align-right { text-align: right; }
.category-pill { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: #f0efff; color: #6255d9; font-size: 9px; font-weight: 750; }
.row-actions { text-align: right; }
.delete-button { border: 0; background: transparent; color: #b4b7c1; cursor: pointer; }
.delete-button:hover { color: var(--coral); }
.mobile-card-list { display: none; }

.settlement-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.settlement-column { padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fafafd; }
.settled-column { background: #f5faf7; border-color: #dcefe4; }
.column-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; font-size: 11px; font-weight: 850; }
.settlement-list { display: grid; gap: 8px; }
.settlement-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 11px; border: 1px solid #e8e9ee; border-radius: 11px; background: white; }
.settlement-route { font-size: 11px; font-weight: 800; }
.settlement-route .arrow { margin: 0 5px; color: #a2a5b0; }
.settlement-value { margin-top: 5px; font-size: 15px; font-weight: 900; }
.partial-form { display: flex; align-items: center; gap: 5px; }
.partial-input { width: 78px; height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font-size: 10px; }
.pay-button { height: 32px; border: 0; border-radius: 8px; padding: 0 9px; background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 850; cursor: pointer; }
.settled-item { border-color: #dcefe4; }
.settled-item .settlement-route, .settled-item .settlement-value { color: var(--green); }
.paid-date { margin-top: 4px; color: #92998f; font-size: 8px; }
.undo-button { align-self: center; border: 0; background: transparent; color: #92978f; text-decoration: underline; font-size: 9px; cursor: pointer; }
.subtle, .panel-description { color: var(--muted); font-size: 10px; }
.panel-description { margin: -6px 0 15px; }
.empty-state { padding: 20px 10px; color: #969aa9; text-align: center; font-size: 10px; }

.participant-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.participant-card { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fbfbfc; }
.participant-card-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.participant-card strong { font-size: 11px; }
.participant-card small { display: block; color: var(--muted); font-size: 8px; margin-top: 2px; }
.participant-card .button { width: 100%; min-height: 34px; font-size: 9px; }

.modal { width: min(520px, calc(100vw - 28px)); border: 0; border-radius: 18px; padding: 22px; box-shadow: 0 30px 100px #1a1b2e42; }
.modal-large { width: min(720px, calc(100vw - 28px)); }
.modal-small { width: min(430px, calc(100vw - 28px)); }
.modal::backdrop { background: rgba(21, 23, 36, .45); backdrop-filter: blur(5px); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.modal-head h2 { font-size: 22px; }
.close-button { width: 32px; height: 32px; border-radius: 9px; background: #f1f2f5; color: #747888; font-size: 20px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { color: #747888; font-size: 10px; font-weight: 750; }
.field input, .field select { width: 100%; height: 42px; border: 1px solid #dcdee5; border-radius: 10px; background: white; padding: 0 11px; outline: none; color: var(--ink); }
.field input:focus, .field select:focus { border-color: var(--violet); box-shadow: 0 0 0 3px #6558e812; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.three-fields { grid-template-columns: 1fr 1fr 1fr; }
.expense-main-fields { grid-template-columns: minmax(0, 1fr) 130px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.split-header { margin: 3px 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.split-header strong, .split-header small { display: block; }
.split-header strong { font-size: 12px; }
.split-header small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.segmented { display: inline-flex; padding: 3px; background: #eff0f4; border-radius: 9px; }
.segmented button { min-height: 29px; border: 0; border-radius: 7px; background: transparent; padding: 0 9px; color: #787c8c; font-size: 9px; font-weight: 750; cursor: pointer; }
.segmented button.active { background: white; color: var(--ink); box-shadow: 0 2px 7px #20223513; }
.split-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.split-person { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fbfbfc; }
.split-person label { flex: 1; min-width: 0; font-size: 10px; font-weight: 750; }
.split-person input[type="checkbox"] { accent-color: var(--violet); }
.split-person .exact-input { width: 84px; height: 33px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; text-align: right; font-size: 10px; }
.split-summary { min-height: 22px; padding-top: 9px; color: var(--muted); text-align: right; font-size: 9px; }
.split-summary.error { color: var(--coral); }
.copy-row { display: flex; gap: 7px; }
.copy-row input { min-width: 0; }
.pin-box { padding: 14px; border: 1px dashed #beb9f2; border-radius: 12px; background: var(--violet-soft); text-align: center; }
.pin-box span, .pin-box strong { display: block; }
.pin-box span { color: #7a72be; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.pin-box strong { margin-top: 5px; color: #5144c9; letter-spacing: .18em; font-size: 27px; }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; max-width: min(360px, calc(100vw - 44px)); padding: 11px 14px; border-radius: 11px; background: #1d2030; color: white; box-shadow: 0 14px 38px #1516263b; font-size: 11px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #a83d3b; }

.viewer-body { min-height: 100vh; background: #f5f6f9; }
.viewer-shell { width: min(1100px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 70px; }
.viewer-login { width: min(400px, 100%); margin: 8vh auto 0; padding: 30px; }
.viewer-login .viewer-logo { margin-bottom: 20px; }
.viewer-login h1 { margin-bottom: 10px; }
.viewer-login p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.viewer-login .field input { height: 52px; text-align: center; font-size: 22px; letter-spacing: .28em; }
.form-error { min-height: 20px; padding-top: 10px; color: var(--coral); text-align: center; font-size: 10px; }
.viewer-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.viewer-header p { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.read-only-badge { padding: 7px 10px; background: #eceaff; color: var(--violet); }
.viewer-hero { border-radius: 20px; padding: 28px; color: white; background: linear-gradient(120deg, #1c2032, #30365b); box-shadow: 0 18px 48px #1a1e3138; margin-bottom: 13px; }
.viewer-hero span, .viewer-hero small, .viewer-hero strong { display: block; }
.viewer-hero span { color: #b8bdd5; font-size: 11px; }
.viewer-hero small { margin-top: 18px; color: #8e95b4; }
.viewer-hero strong { margin-top: 3px; font-size: clamp(30px, 6vw, 48px); letter-spacing: -.04em; }
.viewer-hero p { margin: 5px 0 0; color: #b6bbd1; font-size: 11px; }
.viewer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-bottom: 13px; }
.viewer-expenses { display: grid; gap: 8px; }
.viewer-expense { display: grid; grid-template-columns: 1fr auto; gap: 15px; align-items: center; padding: 12px 0; border-bottom: 1px solid #eff0f3; }
.viewer-expense:last-child { border-bottom: 0; }
.viewer-expense strong, .viewer-expense small { display: block; }
.viewer-expense strong { font-size: 12px; }
.viewer-expense small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.viewer-expense > strong { font-size: 14px; }

@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
  .participant-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; width: 250px; transform: translateX(-101%); transition: transform .2s ease; box-shadow: 20px 0 60px #15182736; }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 20px 14px 40px; }
  .menu-button { display: inline-grid; place-items: center; flex: 0 0 auto; }
  .topbar { align-items: flex-start; }
  .top-actions .button { display: none; }
  .avatar { width: 34px; height: 34px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric-card { padding: 13px; }
  .metric-icon { width: 33px; height: 33px; }
  .balance-list, .settlement-columns, .participant-grid, .viewer-grid { grid-template-columns: 1fr; }
  .table-wrap { display: none; }
  .mobile-card-list { display: grid; gap: 8px; }
  .expense-mobile-card { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; }
  .expense-mobile-card strong, .expense-mobile-card small { display: block; }
  .expense-mobile-card small { color: var(--muted); font-size: 9px; margin-top: 4px; }
  .responsive-heading { align-items: flex-start; }
  .chart-content { gap: 18px; }
  .donut { width: 132px; height: 132px; }
  .split-header { align-items: flex-start; flex-direction: column; }
  .split-list { grid-template-columns: 1fr; }
  .three-fields, .field-row, .expense-main-fields { grid-template-columns: 1fr; }
  .viewer-shell { width: min(100% - 24px, 1100px); padding-top: 25px; }
  .viewer-header { align-items: flex-start; gap: 15px; }
}

@media (max-width: 460px) {
  .metrics { grid-template-columns: 1fr; }
  .metric-card strong { font-size: 20px; }
  .chart-content { align-items: flex-start; flex-direction: column; }
  .chart-legend { width: 100%; }
  .settlement-item { grid-template-columns: 1fr; }
  .partial-form { justify-content: flex-start; }
  .panel { padding: 15px; }
}

/* Compact dashboard refinement */
.app-shell { grid-template-columns: 220px minmax(0, 1fr); }
.sidebar { padding: 19px 14px; }
.brand { padding-bottom: 18px; }
.sidebar-label { margin-top: 22px; }
.main { padding: 20px clamp(16px, 2.4vw, 34px) 38px; }
.topbar { min-height: 62px; margin-bottom: 16px; }
h1 { font-size: clamp(25px, 2.5vw, 34px); }
.metrics, .overview-grid, .action-panel, .settlements-panel, .participants-panel { margin-bottom: 9px; }
.metrics, .overview-grid { gap: 9px; }
.metric-card { padding: 13px 14px; border-radius: 13px; }
.metric-icon { width: 34px; height: 34px; border-radius: 10px; }
.panel { padding: 15px; border-radius: 14px; }
.panel-heading { margin-bottom: 13px; }
.balance-item { padding: 10px; }
.chart-content { min-height: 150px; }
.donut { width: 126px; height: 126px; }
.donut::after { inset: 21px; }
th { padding-top: 8px; padding-bottom: 8px; }
td { padding-top: 10px; padding-bottom: 10px; }
.settlement-column { padding: 10px; }
.settlement-item { padding: 9px; }
.participant-card { padding: 10px; }

.mobile-actions { display: none; }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 18px; background: radial-gradient(circle at 50% 0%, #eceaff 0, #f5f6f9 42%); }
.login-shell { width: min(390px, 100%); }
.login-card { padding: 28px; border: 1px solid var(--line); border-radius: 19px; background: white; box-shadow: 0 24px 75px #1c20311a; }
.login-card .viewer-logo { margin-bottom: 20px; }
.login-card h1 { margin-bottom: 9px; }
.login-card > p { color: var(--muted); font-size: 11px; line-height: 1.55; margin-bottom: 20px; }
.login-card .button { min-height: 44px; margin-top: 4px; }
.local-key { padding: 10px; border-radius: 9px; background: var(--violet-soft); color: #5d52c7; text-align: center; font-size: 10px; }

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { width: min(86vw, 270px); padding: 20px 15px 90px; }
  .main { padding: 14px 10px 92px; }
  .topbar { min-height: 53px; margin-bottom: 10px; gap: 9px; }
  .trip-heading .eyebrow { display: none; }
  .title-row h1 { font-size: 25px; }
  .trip-dates { font-size: 10px; }
  .metrics { gap: 6px; margin-bottom: 7px; }
  .metric-card { padding: 10px; gap: 9px; border-radius: 11px; }
  .metric-card span { margin-bottom: 3px; font-size: 9px; }
  .metric-card strong { font-size: 17px; }
  .metric-icon { width: 31px; height: 31px; }
  .panel { padding: 12px; border-radius: 12px; }
  .panel-heading { margin-bottom: 11px; }
  .panel-heading h2 { font-size: 16px; }
  .panel-heading .eyebrow, .subtle { display: none; }
  .balance-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .balance-item { padding: 9px; }
  .balance-item-head { gap: 6px; }
  .balance-amount { margin-top: 7px; font-size: 14px; }
  .chart-content { min-height: 0; justify-content: flex-start; }
  .donut { width: 118px; height: 118px; }
  .participant-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .participant-card { padding: 9px; }
  .participant-card-head { margin-bottom: 8px; }
  .action-panel .panel-heading .button { display: none; }
  .settlement-columns { gap: 8px; }
  .settlement-column { padding: 9px; }
  .settlement-item { padding: 10px; }
  .partial-input { width: 92px; height: 38px; font-size: 12px; }
  .pay-button { height: 38px; font-size: 10px; }
  .mobile-actions { position: fixed; left: 9px; right: 9px; bottom: 9px; z-index: 25; display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 5px; padding: 6px; border: 1px solid #dfe1e8; border-radius: 16px; background: rgba(255,255,255,.94); box-shadow: 0 15px 45px #17192731; backdrop-filter: blur(16px); }
  .mobile-actions button { min-height: 48px; display: grid; place-items: center; gap: 1px; border: 0; border-radius: 11px; background: transparent; color: #747888; font-size: 9px; font-weight: 800; }
  .mobile-actions button span { font-size: 17px; line-height: 1; }
  .mobile-actions button.primary { background: var(--ink); color: white; }
  .modal[open] { width: 100%; max-width: none; max-height: 92vh; margin: auto 0 0; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 18px 14px calc(18px + env(safe-area-inset-bottom)); }
  .modal-head { margin-bottom: 15px; }
  .modal-actions { position: sticky; bottom: -18px; padding: 10px 0 0; background: white; }
  .field input, .field select { min-height: 46px; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; min-height: 36px; }
  .split-person { min-height: 48px; }
  .viewer-shell { padding-bottom: 30px; }
  .viewer-hero { padding: 20px; border-radius: 15px; }
}

@media (max-width: 380px) {
  .balance-list, .participant-grid { grid-template-columns: 1fr; }
  .metric-card strong { font-size: 15px; }
  .metric-icon { display: none; }
}
