:root {
  --ink: #282b26;
  --muted: #77786f;
  --line: #deddd4;
  --paper: #f8f7f2;
  --card: #fffefb;
  --lime: #d9f542;
  --lime-dark: #b8d126;
  --orange: #ff7d52;
  --purple: #8a6cf5;
  --blue: #68a8eb;
  --shadow: 0 18px 50px rgba(43, 46, 38, .08);
  font-family: "Manrope", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:disabled { cursor: wait; opacity: .65; }
.hidden { display: none !important; }
.app-shell { min-width: 0; min-height: 100vh; display: grid; grid-template-columns: 274px minmax(0, 1fr); }

.sidebar {
  border-right: 1px solid var(--line); padding: 28px 20px; background: #f2f0e8;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar-brand-row { position: relative; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 20px; font-weight: 800; letter-spacing: -.7px; margin: 0 8px 34px; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--ink); color: var(--lime); transform: rotate(-3deg); }
.side-label { color: #97988f; text-transform: uppercase; letter-spacing: 1.3px; font-size: 10px; font-weight: 800; padding: 0 10px; margin-bottom: 10px; }
.room-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; overflow-y: auto; }
.room-list-item { min-width: 0; position: relative; }
.room-link { min-width: 0; border: 0; background: transparent; text-align: left; padding: 11px 44px 11px 10px; border-radius: 12px; cursor: pointer; display: flex; align-items: center; gap: 10px; width: 100%; }
.room-link:hover { background: rgba(255,255,255,.55); }
.room-link.active { background: var(--card); box-shadow: 0 4px 12px rgba(30,30,20,.04); }
.room-emoji { width: 31px; height: 31px; flex: 0 0 31px; border-radius: 10px; display: grid; place-items: center; background: #e1ded2; font-size: 15px; }
.room-link.active .room-emoji { background: var(--lime); }
.room-link span:last-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; font-weight: 700; }
.room-leave { position: absolute; z-index: 1; top: 50%; right: 7px; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: #aaa; cursor: pointer; display: grid; place-items: center; transform: translateY(-50%); }
.room-leave-icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.room-leave:hover { color: var(--ink); background: #f0efe8; }
.room-leave:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.new-room-side { margin-top: 8px; border: 1px dashed #c8c7be; background: transparent; border-radius: 12px; padding: 11px; color: #686960; cursor: pointer; font-size: 12px; font-weight: 700; }
.new-room-side:hover { border-color: var(--ink); color: var(--ink); }
.sidebar-foot { margin-top: auto; font-size: 11px; color: #96978e; padding: 12px 8px 0; line-height: 1.5; }
.sidebar-close, .sidebar-scrim { display: none; }

.main { min-width: 0; padding: 28px clamp(24px, 5vw, 74px) 72px; }
.topbar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-bottom: 42px; }
.topbar-room-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { border: 1px solid var(--line); background: var(--card); width: 39px; height: 39px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { border-color: #aaa99f; }
.ghost-btn, .primary-btn, .dark-btn { border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 800; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.ghost-btn { border: 1px solid var(--line); background: var(--card); }
.primary-btn { background: var(--lime); }
.primary-btn:hover { background: #cee93a; transform: translateY(-1px); }
.dark-btn { background: var(--ink); color: white; }
.dark-btn:hover { background: #11130f; transform: translateY(-1px); }
.danger-btn { color: #b74a35; }
.ghost-btn.danger-btn:hover { color: #a83d2a; border-color: #e3b8ab; background: #fff1ec; }

.empty-page { min-height: calc(100vh - 150px); display: grid; place-items: center; }
.empty-card { width: min(620px, 100%); text-align: center; }
.empty-art { width: 170px; height: 150px; margin: 0 auto 26px; position: relative; }
.empty-art .shape { position: absolute; border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); }
.shape.one { width: 105px; height: 88px; border-radius: 25px; background: var(--lime); transform: rotate(-8deg); left: 8px; top: 18px; }
.shape.two { width: 79px; height: 72px; border-radius: 50%; background: var(--orange); right: 4px; bottom: 7px; }
.empty-art::after { content: "₽"; font-size: 49px; font-weight: 800; position: absolute; left: 44px; top: 33px; transform: rotate(-8deg); }
.empty-card h1 { font-size: clamp(34px, 6vw, 58px); line-height: 1.03; margin: 0; letter-spacing: -2.8px; }
.empty-card p { color: var(--muted); max-width: 430px; margin: 18px auto 27px; line-height: 1.65; font-size: 14px; }
.empty-card .dark-btn { padding: 15px 22px; font-size: 13px; }

.access-error-page { padding: 20px 0 50px; }
.access-error-card { width: min(570px, 100%); border: 1px solid #e3cbbf; border-radius: 24px; background: var(--card); box-shadow: var(--shadow); padding: 34px; text-align: center; }
.access-error-icon { width: 52px; height: 52px; border-radius: 17px; display: grid; place-items: center; margin: 0 auto 18px; background: #fff0e9; color: #b94d39; font-size: 25px; font-weight: 900; }
.access-error-card .eyebrow { justify-content: center; }
.access-error-card h1 { margin: 0; font-size: clamp(29px, 5vw, 43px); line-height: 1.08; letter-spacing: -1.7px; }
.access-error-message p { max-width: 470px; margin: 15px auto 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.access-error-hint { max-width: 470px; margin: 19px auto 0; border: 1px solid #e2e1d9; border-radius: 13px; background: #f7f6f0; padding: 13px 15px; color: #606159; font-size: 11px; line-height: 1.55; }
.access-error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 22px; }
.help-button { flex: 0 0 auto; font-weight: 900; }

.room-header { margin-bottom: 30px; }
.room-heading { min-width: 0; max-width: 100%; }
.eyebrow { display: flex; align-items: center; gap: 7px; color: #8b8c83; text-transform: uppercase; letter-spacing: 1.3px; font-size: 10px; font-weight: 800; margin-bottom: 8px; }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--lime-dark); }
.room-header h1 { font-size: clamp(32px, 5vw, 52px); letter-spacing: -2.4px; line-height: 1.05; margin: 0 0 16px; overflow-wrap: anywhere; }
.member-row { display: flex; align-items: center; gap: 0; max-width: 100%; overflow-x: auto; padding-bottom: 3px; }
.avatar { width: 34px; height: 34px; flex: 0 0 34px; margin-left: -6px; border: 3px solid var(--paper); border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #222; }
.avatar:first-child { margin-left: 0; }
.avatar-add { border: 1px dashed #aaa99f; background: transparent; color: #777; cursor: pointer; margin-left: 6px; }
.member-count { flex: 0 0 auto; color: var(--muted); font-size: 11px; margin-left: 10px; }
.room-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .8fr); gap: 26px; align-items: start; }
.room-grid > main { min-width: 0; }
.section-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; gap: 14px; }
.section-title-row h2 { margin: 0; font-size: 17px; letter-spacing: -.5px; }
.events-title-row h2 { min-width: 0; }
.events-title-row .ghost-btn { flex: 0 0 auto; }
.event-tabs-row { min-width: 0; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 8px; align-items: start; margin-bottom: 17px; }
.event-sort-control { position: relative; width: 36px; }
.event-sort-trigger { width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--card); display: grid; place-items: center; cursor: pointer; font-size: 17px; font-weight: 900; line-height: 1; }
.event-sort-trigger:hover { border-color: #aaa99f; }
.event-sort-trigger[aria-expanded="true"] { border-color: var(--ink); background: var(--ink); color: white; }
.event-sort-trigger:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.event-sort-menu { position: absolute; z-index: 12; top: calc(100% + 7px); left: 0; min-width: 190px; padding: 6px; border: 1px solid var(--line); border-radius: 13px; background: var(--card); box-shadow: 0 15px 38px rgba(35, 37, 31, .16); display: grid; gap: 2px; }
.event-sort-menu[hidden] { display: none; }
.event-sort-menu-title { margin: 0 4px 3px; padding: 5px 6px 7px; border-bottom: 1px solid #ecebe4; color: #92938a; font-size: 9px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; }
.event-sort-option { width: 100%; border: 0; border-radius: 9px; background: transparent; padding: 9px 10px; display: grid; grid-template-columns: minmax(0, 1fr) 16px; align-items: center; gap: 9px; color: #62645b; cursor: pointer; text-align: left; font-size: 11px; font-weight: 700; white-space: nowrap; }
.event-sort-option:hover, .event-sort-option:focus-visible { outline: 0; background: #f0efe8; color: var(--ink); }
.event-sort-option[aria-checked="true"] { color: var(--ink); font-weight: 800; }
.event-sort-check { visibility: hidden; text-align: center; }
.event-sort-option[aria-checked="true"] .event-sort-check { visibility: visible; }
.event-tabs { min-width: 0; display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; }
.event-tab { white-space: nowrap; border: 1px solid var(--line); background: transparent; padding: 8px 12px; border-radius: 999px; font-size: 10px; font-weight: 800; cursor: pointer; max-width: 230px; overflow: hidden; text-overflow: ellipsis; flex: 0 0 auto; }
.event-tab.active { background: var(--ink); color: white; border-color: var(--ink); }
.event-date { color: #aaa; margin-left: 4px; font-weight: 600; }
.event-card { border: 1px solid var(--line); background: var(--card); border-radius: 18px; overflow: hidden; }
.event-card-head { padding: 17px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.event-card-head-copy { min-width: 0; }
.event-card-title { font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-card-date { color: var(--muted); font-size: 10px; margin-top: 3px; }
.event-card-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; margin-left: 12px; }
.edit-event, .delete-event { border: 0; background: #f0efe8; color: #777970; width: 33px; height: 33px; border-radius: 10px; cursor: pointer; }
.edit-event:hover { color: var(--ink); background: #e7e5dc; }
.delete-event:hover { color: #b94d39; background: #fff1ec; }
.system-event-pill { color: #6f762f; background: #eff5d1; border-radius: 999px; padding: 6px 9px; font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; }
.expense-list { display: grid; }
.expense-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 14px 17px; border-bottom: 1px solid #ebeae3; }
.expense-row:last-child { border-bottom: 0; }
.expense-icon { width: 39px; height: 39px; border-radius: 13px; display: grid; place-items: center; font-size: 17px; }
.expense-copy { min-width: 0; }
.expense-title { font-weight: 800; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.expense-meta { color: var(--muted); font-size: 10px; line-height: 1.4; margin-top: 3px; overflow-wrap: anywhere; }
.expense-note { color: #55574f; font-size: 10px; line-height: 1.45; margin-top: 6px; overflow-wrap: anywhere; }
.expense-money { min-width: 0; }
.expense-amount { font-weight: 800; font-size: 13px; text-align: right; }
.expense-split { font-size: 9px; color: var(--muted); margin-top: 3px; }
.transfer-icon { font-weight: 800; }
.transfer-label { color: #687b24; white-space: nowrap; }
.expense-actions { display: flex; align-items: center; gap: 2px; }
.info-expense, .edit-expense, .delete-expense { border: 0; background: transparent; color: #aaa; cursor: pointer; width: 30px; height: 30px; border-radius: 9px; }
.info-expense { font-weight: 900; font-family: Georgia, serif; }
.info-expense:hover { color: #536a12; background: #f1f6d8; }
.edit-expense:hover { color: var(--ink); background: #f0efe8; }
.delete-expense:hover { color: #b94d39; background: #fff1ec; }
.event-empty { padding: 48px 22px; text-align: center; color: var(--muted); }
.event-empty strong { color: var(--ink); display: block; margin-bottom: 6px; }

.event-summary { border-top: 1px solid var(--line); background: #f7f6f0; padding: 18px; }
.event-summary-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 13px; }
.event-summary-label { color: #8b8c83; font-size: 9px; font-weight: 800; letter-spacing: .9px; text-transform: uppercase; }
.event-summary-title { font-size: 14px; font-weight: 800; margin-top: 3px; }
.event-summary-total { display: grid; justify-items: end; gap: 2px; }
.event-summary-total span { color: var(--muted); font-size: 9px; }
.event-summary-total strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.event-summary-list { border: 1px solid #dfded6; border-radius: 13px; background: var(--card); overflow: hidden; }
.event-summary-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #ebeae3; }
.event-summary-row:last-child { border-bottom: 0; }
.event-summary-avatar { width: 30px; height: 30px; margin: 0; border-color: var(--card); }
.event-summary-person { min-width: 0; display: grid; gap: 2px; }
.event-summary-person strong { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-summary-person span { color: var(--muted); font-size: 9px; line-height: 1.45; }
.event-summary-balance { display: grid; justify-items: end; gap: 2px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.event-summary-balance span { color: var(--muted); font-size: 8px; }
.event-summary-balance strong { font-size: 11px; }
.event-summary-balance.positive strong { color: #5f7b16; }
.event-summary-balance.negative strong { color: #c2533b; }
.event-summary-balance.neutral strong { color: var(--muted); }
.event-summary-note { color: var(--muted); font-size: 9px; padding-top: 10px; line-height: 1.45; }
.transfer-summary .event-summary-head { margin-bottom: 0; }

.expense-info-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.expense-info-overview > div { min-width: 0; display: grid; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #f7f6f0; }
.expense-info-overview span, .expense-info-label, .expense-info-note span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; }
.expense-info-overview strong { min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.expense-info-label { margin: 0 0 8px 2px; }
.expense-info-note { border: 1px solid var(--line); border-radius: 13px; padding: 13px 14px; background: #fff; }
.expense-info-note p { margin: 5px 0 0; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }

.settle-card { min-width: 0; background: #34372f; color: white; border-radius: 20px; padding: 20px; box-shadow: var(--shadow); }
.settle-card .section-title-row { margin-bottom: 17px; }
.settle-card h2 { color: white; }
.settle-pill { color: #bdc0b5; font-size: 9px; background: rgba(255,255,255,.08); padding: 5px 8px; border-radius: 999px; }
.transfer-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.transfer { display: grid; grid-template-columns: 31px minmax(0,1fr) 31px; gap: 10px; align-items: center; }
.transfer .avatar { border-color: #34372f; margin: 0; width: 31px; height: 31px; }
.transfer-copy { min-width: 0; }
.transfer-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 10px; }
.transfer-line strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfer-line strong { font-size: 11px; }
.transfer-arrow { color: #a5a89d; font-size: 9px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfer-amount { color: var(--lime); font-weight: 800; white-space: nowrap; }
.confirm-transfer { border: 1px solid rgba(217,245,66,.4); background: rgba(217,245,66,.12); color: var(--lime); width: 31px; height: 31px; border-radius: 10px; cursor: pointer; font-weight: 900; }
.confirm-transfer:hover { background: var(--lime); color: var(--ink); }
.all-square { text-align: center; padding: 24px 8px; color: #c8c9c2; font-size: 11px; }
.all-square .check { width: 38px; height: 38px; border-radius: 50%; background: var(--lime); color: var(--ink); display: grid; place-items: center; margin: 0 auto 10px; font-size: 19px; font-weight: 900; }
.balance-details { margin-top: 22px; border-top: 1px solid rgba(255,255,255,.12); padding-top: 15px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.balance-row { min-width: 0; display: flex; justify-content: space-between; color: #bfc1b9; font-size: 9px; }
.balance-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 8px; }
.balance-row b { flex: 0 0 auto; color: white; font-size: 10px; white-space: nowrap; }
.balance-row b.positive { color: var(--lime); }
.balance-row b.negative { color: #ff9a78; }
.settle-total { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.12); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 14px; }
.settle-total-label { color: white; font-size: 10px; font-weight: 800; }
.settle-total-events { margin-top: 3px; color: #aeb1a6; font-size: 9px; }
.settle-total-value { color: var(--lime); font-size: 20px; line-height: 1; letter-spacing: -.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(34,35,30,.38); backdrop-filter: blur(5px); display: grid; place-items: center; padding: 18px; animation: fade .16s ease; }
.modal { min-width: 0; width: min(540px, 100%); max-height: calc(100vh - 36px); max-height: calc(100dvh - 36px); overflow-y: auto; overscroll-behavior: contain; background: var(--card); border-radius: 23px; box-shadow: 0 28px 90px rgba(20,20,15,.22); padding: 25px; animation: rise .2s ease; }
.modal.wide { width: min(650px, 100%); }
.modal.compact { width: min(440px, 100%); }
.modal-head { min-width: 0; display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 23px; }
.modal-head > div { min-width: 0; }
.modal-head h2 { margin: 0; font-size: 22px; letter-spacing: -.8px; }
.modal-head h2, .modal-head p { overflow-wrap: anywhere; }
.modal-head p { color: var(--muted); margin: 5px 0 0; font-size: 11px; }
.close-btn { border: 0; background: #f0efe8; width: 32px; height: 32px; border-radius: 10px; cursor: pointer; }
.leave-room-warning { margin-bottom: 18px; padding: 15px; border: 1px solid #e2e0d6; border-radius: 14px; background: #f7f6f0; }
.leave-room-warning strong { font-size: 12px; }
.leave-room-warning p { margin: 6px 0 0; color: #65675e; font-size: 11px; line-height: 1.55; }
.leave-room-submit { background: #b94d39; }
.leave-room-submit:hover { background: #a83d2a; }
.help-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.help-step { min-width: 0; display: grid; grid-template-columns: 31px minmax(0, 1fr); align-items: start; gap: 10px; border: 1px solid var(--line); border-radius: 14px; background: #faf9f4; padding: 13px; }
.help-step > span { width: 31px; height: 31px; border-radius: 10px; display: grid; place-items: center; background: var(--lime); font-size: 11px; font-weight: 900; }
.help-step h3 { margin: 1px 0 0; font-size: 13px; }
.help-step p { margin: 4px 0 0; color: #65675e; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.help-note { margin-top: 12px; border: 1px solid #dfe6bd; border-radius: 14px; background: #f4f8df; padding: 13px 15px; }
.help-note strong { font-size: 13px; }
.help-note p { margin: 4px 0 0; color: #65675e; font-size: 11px; line-height: 1.55; }
.help-note code { overflow-wrap: anywhere; font-size: inherit; }
.form-grid { min-width: 0; display: grid; gap: 16px; }
.two-col { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.field { min-width: 0; display: grid; gap: 7px; }
.field label { font-size: 10px; font-weight: 800; color: #696a62; }
.field-hint { color: var(--muted); font-size: 9px; line-height: 1.5; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); background: white; border-radius: 12px; padding: 12px 13px; outline: 0; color: var(--ink); font-size: 12px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #aabf2d; box-shadow: 0 0 0 3px rgba(217,245,66,.24); }
.member-input-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.member-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { background: #efeee7; border-radius: 999px; padding: 7px 9px; font-size: 10px; font-weight: 700; max-width: 100%; display: inline-flex; align-items: center; min-width: 0; }
.chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { border: 0; background: transparent; color: #999; cursor: pointer; padding: 0 0 0 5px; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; padding-top: 5px; }

.split-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.split-type { border: 1px solid var(--line); background: white; border-radius: 12px; padding: 10px 8px; text-align: center; cursor: pointer; font-size: 9px; font-weight: 800; }
.split-type span { display: block; font-size: 17px; margin-bottom: 3px; }
.split-type.active { border-color: var(--ink); background: var(--ink); color: white; }
.share-field-head { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.share-selection-toggle { flex: 0 0 auto; border: 0; background: transparent; color: #65751e; padding: 5px 2px; font-size: 10px; font-weight: 800; cursor: pointer; }
.share-selection-toggle:hover { color: var(--ink); text-decoration: underline; }
.share-selection-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.share-selection-toggle:disabled { cursor: default; color: var(--muted); text-decoration: none; }
.share-list { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.share-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 124px; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid #ecebe4; }
.share-row:last-child { border: 0; }
.share-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--ink); }
.share-row input[type="checkbox"].automatic { pointer-events: none; }
.equal-share-row { cursor: pointer; transition: background .15s ease, box-shadow .15s ease; }
.equal-share-row:hover { background: #f7f8ed; }
.equal-share-row:focus-within { box-shadow: inset 0 0 0 2px #b8d126; }
.equal-share-row .share-name, .equal-share-row .share-value { pointer-events: none; }
.event-participant-list { display: grid; }
.event-participant-row { min-width: 0; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid #ecebe4; cursor: pointer; }
.event-participant-row:last-child { border-bottom: 0; }
.event-participant-row:has(input:disabled) { cursor: default; background: #f7f6f0; }
.event-participant-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }
.event-participant-name { min-width: 0; display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; }
.event-participant-name small { flex: 0 0 auto; color: #747841; background: #eff3d8; border-radius: 999px; padding: 3px 6px; font-size: 8px; font-weight: 800; }
.share-name { font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-value { position: relative; }
.share-value input { padding: 8px 50px 8px 9px; text-align: right; font-variant-numeric: tabular-nums; }
#expense-amount,
.share-value input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
#expense-amount::-webkit-inner-spin-button,
#expense-amount::-webkit-outer-spin-button,
.share-value input[type="number"]::-webkit-inner-spin-button,
.share-value input[type="number"]::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.share-value small { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); color: #aaa; font-size: 9px; pointer-events: none; }
.split-check { font-size: 10px; color: var(--muted); text-align: right; }
.split-check.error { color: #c44e38; }

.transfer-explainer { display: flex; align-items: flex-start; gap: 12px; border: 1px solid #dfe6bd; background: #f4f8df; border-radius: 14px; padding: 13px; }
.transfer-explainer > span { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--lime); font-weight: 900; }
.transfer-explainer strong { font-size: 11px; }
.transfer-explainer p { color: var(--muted); font-size: 9px; line-height: 1.5; margin: 3px 0 0; }
.bank-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.bank-option { min-width: 0; position: relative; border: 1px solid var(--line); border-radius: 13px; background: white; padding: 10px 7px; display: grid; justify-items: center; align-content: start; gap: 6px; cursor: pointer; text-align: center; font-size: 9px; font-weight: 800; }
.bank-option:hover { border-color: #b9b8ae; }
.bank-option:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(40,43,38,.08); }
.bank-option:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.bank-option input { position: absolute; opacity: 0; pointer-events: none; }
.bank-mark { width: 35px; height: 35px; border-radius: 11px; display: grid; place-items: center; background: var(--bank-color); color: white; font-size: 10px; font-weight: 900; }
.bank-option > span:last-child { max-width: 100%; overflow-wrap: anywhere; }
.other-bank-mark { background: #eeece4; color: var(--ink); font-size: 16px; }

.toast { position: fixed; z-index: 40; left: 50%; bottom: 26px; transform: translateX(-50%); max-width: calc(100vw - 32px); background: #292c26; color: white; padding: 11px 15px; border-radius: 12px; font-size: 11px; font-weight: 700; text-align: center; overflow-wrap: anywhere; box-shadow: var(--shadow); animation: toast .25s ease; }
.mobile-menu { display: none; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(8px) scale(.985); opacity: 0; } }
@keyframes toast { from { transform: translate(-50%, 10px); opacity: 0; } }

@media (max-width: 880px) {
  .app-shell { grid-template-columns: 1fr; }
  body.sidebar-open { overflow: hidden; }
  .sidebar { position: fixed; z-index: 15; width: min(294px, calc(100vw - 36px)); height: 100dvh; transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: grid; place-items: center; position: absolute; z-index: 1; right: 0; top: 0; width: 34px; height: 34px; border: 0; border-radius: 10px; background: #e4e1d7; cursor: pointer; font-size: 19px; }
  .sidebar-brand-row .brand { padding-right: 32px; }
  .room-link { padding-right: 52px; }
  .room-leave { right: 0; width: 44px; height: 44px; }
  .sidebar-scrim.visible { display: block; position: fixed; inset: 0; z-index: 14; border: 0; background: rgba(34,35,30,.38); backdrop-filter: blur(2px); }
  .mobile-menu { display: grid; margin-right: auto; }
  .main { padding: 18px 20px 60px; }
  .topbar { margin-bottom: 28px; }
  .room-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  .topbar { gap: 7px; flex-wrap: wrap; }
  .topbar-room-actions { gap: 7px; }
  .topbar .ghost-btn { padding: 10px 12px; }
  .topbar .icon-btn, .close-btn { width: 44px; height: 44px; }
  .access-error-card { padding: 25px 18px; }
  .help-steps { grid-template-columns: minmax(0, 1fr); }
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .bank-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-types { gap: 5px; }
  .split-type { font-size: 8px; }
  .share-row { grid-template-columns: 22px minmax(0, 1fr) 112px; }
  .modal { padding: 20px; }
  .field input, .field select, .field textarea { font-size: 16px; }
  .expense-row { grid-template-columns: 38px minmax(0,1fr) auto; gap: 7px 8px; padding: 12px; align-items: start; }
  .expense-icon { grid-row: 1 / span 2; }
  .expense-copy { grid-column: 2; }
  .expense-money { grid-column: 2; }
  .expense-amount { text-align: left; }
  .expense-actions { display: grid; gap: 0; grid-column: 3; grid-row: 1 / span 2; }
  .event-card-head { padding: 14px 12px; }
  .event-card-actions { margin-left: 8px; }
  .event-card-actions .primary-btn { padding: 10px 11px; }
  .event-summary { padding: 14px 12px; }
  .event-summary-head { align-items: flex-start; }
  .event-summary-row { grid-template-columns: 28px minmax(0, 1fr) auto; padding: 9px; gap: 8px; }
  .event-summary-avatar { width: 28px; height: 28px; }
}
