:root { font-family: Inter, system-ui, sans-serif; color: #22352f; background: #f5f5ef; font-synthesis: none; }
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #d19450; outline-offset: 2px; }
.shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #173c35; color: #fff; padding: 30px 20px; display: flex; flex-direction: column; gap: 28px; }
.brand { font-family: Georgia, serif; font-size: 29px; letter-spacing: -.04em; margin: 0; }
.brand small { display: block; font: 10px system-ui; letter-spacing: .17em; text-transform: uppercase; color: #a9c1b6; margin-top: 4px; }
.nav { display: grid; gap: 6px; }
.nav button { border: 0; border-radius: 9px; text-align: left; background: transparent; color: #d5e4db; padding: 11px 13px; }
.nav button.active, .nav button:hover { background: #31564b; color: white; }
.side-note { margin-top: auto; font-size: 12px; line-height: 1.6; color: #bdd0c5; }
main { padding: 44px clamp(20px, 5vw, 70px); max-width: 1400px; width: 100%; }
.topline { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 28px; }
.eyebrow { text-transform: uppercase; color: #788c80; letter-spacing: .15em; font-weight: 700; font-size: 11px; margin: 0 0 9px; }
h1, h2, h3 { font-family: Georgia, serif; font-weight: 500; color: #173c35; margin: 0; }
h1 { font-size: clamp(30px, 4vw, 42px); letter-spacing: -.03em; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { line-height: 1.55; }
.muted { color: #718178; font-size: 14px; }
.pill { border-radius: 30px; background: #e3eee5; color: #416a50; padding: 8px 12px; font-size: 12px; white-space: nowrap; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.card { background: #fff; border: 1px solid #e3e9e1; border-radius: 15px; padding: 22px; box-shadow: 0 5px 20px #24483108; }
.metric { font-size: 30px; font-family: Georgia, serif; margin: 13px 0 3px; color: #183e35; overflow-wrap: anywhere; }
.metric.expense { color: #a9664b; }
.section { margin-top: 24px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(250px, 1fr); gap: 18px; align-items: start; }
.split > * { min-width: 0; }
.transactions-layout { grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
label { display: grid; gap: 7px; color: #425c4d; font-size: 13px; font-weight: 650; }
input, select, textarea { width: 100%; min-width: 0; border: 1px solid #d9e2d9; background: #fff; border-radius: 8px; padding: 11px; color: #213a30; }
.form-grid label, .filters label { min-width: 0; }
textarea { resize: vertical; min-height: 76px; }
.full { grid-column: 1 / -1; }
.actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.button { display: inline-flex; justify-content: center; align-items: center; border: 1px solid #173c35; background: #173c35; color: white; border-radius: 8px; padding: 10px 15px; text-decoration: none; font-weight: 650; font-size: 13px; }
.button.secondary { color: #31584a; background: white; border-color: #d5e0d5; }
.button.danger { color: #a24e40; background: white; border-color: #ead8d2; }
.button.small { padding: 7px 10px; font-size: 12px; }
.list { display: grid; grid-template-columns: minmax(0, 1fr); }
.list > * { min-width: 0; }
.transaction-list { max-height: min(65vh, 640px); overflow-y: auto; overscroll-behavior: contain; }
.transaction-list .row { display: grid; grid-template-columns: minmax(0, 1fr) max-content; }
.transaction-list .row .actions { flex-wrap: nowrap; gap: 6px; }
.transaction-list .row .category-identity > div { min-width: 0; }
.transaction-list .row .category-identity strong, .transaction-list .row .category-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid #edf0eb; }
.row:last-child { border: 0; }
.record-facts { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(0, 2fr); gap: 10px; margin: 0; font-size: 13px; }
.record-facts dt { color: #718178; }
.record-facts dd { margin: 0; overflow-wrap: anywhere; }
.transaction-record summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.app-toolbar .muted { font-size: 12px; }
.app-status { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 5; background: #173c35; color: white; border-radius: 9px; padding: 10px 16px; max-width: min(90vw, 600px); font-size: 13px; pointer-events: none; }
.app-status:empty { display: none; }
button:disabled { opacity: .55; cursor: wait; }
.row strong { display: block; font-size: 14px; }
.row small { display: block; color: #7b8b80; margin-top: 4px; }
.amount { white-space: nowrap; font-weight: 700; }
.owed-positive { color: #287849; }
.owed-negative { color: #b4473f; }
.split-activity { border-bottom: 1px solid #edf0eb; }
.split-activity summary { display: flex; align-items: center; gap: 12px; padding: 10px 2px; cursor: pointer; list-style: none; }
.split-activity summary::-webkit-details-marker { display: none; }
.split-activity summary:focus-visible { outline: 3px solid #d19450; outline-offset: -3px; border-radius: 6px; }
.split-activity-title { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; font-size: 13px; }
.split-activity-title > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.split-activity-title strong, .split-activity-title small, .split-detail-row small { display: block; }
.split-activity-title small, .split-detail-row small { color: #718178; margin-top: 3px; }
.split-chevron { color: #718178; font-size: 20px; }
.split-activity[open] .split-chevron { transform: rotate(180deg); }
.split-activity-details { background: #f7faf6; border-radius: 9px; margin: 0 0 12px; padding: 14px; font-size: 13px; }
.split-activity-details .eyebrow { margin: 16px 0 4px; }
.split-detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; }
.split-detail-row > span { overflow-wrap: anywhere; min-width: 0; }
.settlement-form { max-width: 420px; margin-top: 18px; padding: 18px; border: 1px solid #dce7dc; border-radius: 10px; background: #f8faf7; }
.settlement-form p { margin: 0; }
.empty { color: #809087; font-size: 14px; padding: 16px 0; }
.notice { padding: 13px 15px; background: #fff7e7; color: #795b30; border: 1px solid #f0dfbd; border-radius: 9px; font-size: 13px; line-height: 1.5; }
.error { background: #fff1ed; color: #9c4438; border-color: #efd3cc; }
.auth { max-width: 510px; margin: 8vh auto; padding: 0 20px; }
.auth .card { padding: 30px; }
.auth .brand { margin-bottom: 30px; color: #173c35; }
.auth .brand small { color: #718178; }
.stack { display: grid; gap: 15px; }
.key { overflow-wrap: anywhere; font-family: monospace; font-size: 16px; color: #173c35; background: #eef5eb; padding: 14px; border-radius: 8px; user-select: all; }
.filters { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-bottom: 10px; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.report-wide { grid-column: 1 / -1; min-width: 0; }
.report-insights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 18px 22px; background: #e9f0e8; border-radius: 12px; }
.report-insights strong { display: block; color: #173c35; font-size: 18px; overflow-wrap: anywhere; }
.donut-layout { display: flex; align-items: center; gap: 24px; margin: 22px 0; }
.donut { width: min(42%, 190px); flex-shrink: 0; }
.chart-total { font-family: Georgia, serif; font-size: 26px; color: #173c35; overflow-wrap: anywhere; }
.chart-legend { list-style: none; padding: 0; margin: 0; }
.chart-legend-row { display: flex; justify-content: space-between; gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid #edf0eb; font-size: 13px; }
.chart-legend-row:last-child { border-bottom: 0; }
.chart-legend-row > span:last-child { text-align: right; white-space: nowrap; }
.chart-legend-row small { display: block; color: #718178; margin-top: 3px; }
.chart-label { min-width: 0; overflow-wrap: anywhere; }
.chart-label svg { vertical-align: middle; flex-shrink: 0; }
.chart-key { display: flex; flex-wrap: wrap; gap: 18px; color: #718178; font-size: 12px; margin: 20px 0 4px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; }
.income-swatch { background: #386c59; }
.expense-swatch { background: #d28a58; }
.chart-scroll, .table-scroll { overflow-x: auto; max-width: 100%; }
.chart-scroll svg { display: block; max-width: none; }
.table-scroll table { border-collapse: collapse; width: 100%; font-size: 13px; text-align: right; }
.table-scroll th, .table-scroll td { padding: 10px 8px; white-space: nowrap; border-bottom: 1px solid #edf0eb; }
.table-scroll th:first-child { text-align: left; }
.person-chart-row { margin-top: 22px; }
.person-chart-row .section-head { margin-bottom: 8px; font-size: 13px; }
.person-chart-row small { display: block; color: #718178; line-height: 1.5; margin-top: 6px; }
.person-bar { width: 100%; height: 8px; display: block; }
.avatar { display: inline-flex; width: 52px; height: 52px; flex: 0 0 auto; }
.avatar svg { display: block; width: 100%; height: 100%; }
.avatar-current { width: 64px; height: 64px; }
.avatar-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 10px; margin-top: 18px; }
.avatar-choice { display: grid; justify-items: center; gap: 6px; padding: 10px 5px; background: #fafbf8; border: 2px solid transparent; border-radius: 12px; color: #425c4d; font-size: 12px; }
.avatar-choice:hover { background: #eef5ec; }
.avatar-choice.selected { background: #e9f2e8; border-color: #386c59; color: #173c35; font-weight: 700; }
.person-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person-avatar { width: 42px; height: 42px; }
.split-editor { border: 1px solid #e3e9e1; border-radius: 10px; padding: 14px; }
.check-label { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.check-label input { width: auto; min-width: auto; margin: 0; }
.split-people { display: grid; gap: 10px; border: 0; padding: 0; margin: 14px 0; }
.split-member { padding: 8px 10px; border: 1px solid #e3e9e1; border-radius: 9px; background: #fafbf8; cursor: pointer; }
.split-avatar { width: 32px; height: 32px; }
.split-people legend { font-size: 13px; font-weight: 650; color: #425c4d; margin-bottom: 10px; }
.split-shares { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.split-shares p { grid-column: 1 / -1; margin: 0; }
.category-identity { display: flex; align-items: center; gap: 10px; min-width: 0; overflow-wrap: anywhere; }
.category-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 11px; }
.category-icon.income, [data-icon-picker][data-kind="income"] .category-icon { color: #357657; background: #e5f2e8; }
.category-icon.expense, [data-icon-picker][data-kind="expense"] .category-icon { color: #b65d58; background: #f9e9e5; }
.category-icon svg { width: 21px; height: 21px; }
.icon-picker-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.icon-picker-field legend { margin-bottom: 10px; font-size: 13px; font-weight: 650; color: #425c4d; }
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 8px; }
.icon-choice { position: relative; display: block; cursor: pointer; }
.icon-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.icon-choice-content { display: grid; justify-items: center; gap: 5px; padding: 9px 3px; border: 2px solid transparent; border-radius: 10px; background: #fafbf8; font-size: 11px; }
.icon-choice input:checked + .icon-choice-content { border-color: #386c59; background: #edf5ec; }
.icon-choice input:focus-visible + .icon-choice-content { outline: 3px solid #d19450; outline-offset: 2px; }
@media (max-width: 760px) { .shell { display: block; padding-bottom: 74px; } .sidebar { padding: 16px 20px; } .sidebar .brand { font-size: 24px; } .side-note { display: none; } .nav { position: fixed; z-index: 2; bottom: 0; left: 0; right: 0; display: flex; overflow-x: auto; background: #173c35; padding: 7px; } .nav button { text-align: center; font-size: 11px; white-space: nowrap; padding: 10px; flex: 1; } main { padding: 28px 18px; } .grid { grid-template-columns: 1fr; } .split { grid-template-columns: 1fr; } .filters { grid-template-columns: repeat(2,1fr); } .topline { align-items: center; } }
@media (max-width: 1100px) { .transactions-layout { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .report-grid { grid-template-columns: 1fr; } .report-wide { grid-column: auto; } .report-insights { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .form-grid { grid-template-columns: 1fr; } .full { grid-column: auto; } .pill { display: none; } }
@media (max-width: 420px) { .split-shares { grid-template-columns: 1fr; } }
.card { min-width: 0; }
.person-identity strong { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding-bottom: max(7px, env(safe-area-inset-bottom)); }
  .nav button { white-space: normal; padding: 10px 4px; min-height: 44px; }
  .shell { padding-bottom: 114px; }
  .app-status { bottom: 114px; }
  .transaction-list { max-height: none; overflow: visible; }
  .button.small { min-height: 44px; }
  .section-head { flex-wrap: wrap; }
}
