@font-face {
  font-family: Nunito;
  src: url("/static/fonts/nunito-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: light;
  --paper: #fff8f2;
  --surface: #fffdf9;
  --ink: #3d182e;
  --muted: #795f6d;
  --line: #e9cfd8;
  --primary: #510d37;
  --positive: #742451;
  --negative: #ae292e;
  font-family:
    Nunito,
    ui-rounded,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  font-size: 16px;
}
button,
a,
input,
select,
summary {
  touch-action: manipulation;
}
button {
  min-height: 46px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 11px 16px;
  background: var(--primary);
  color: white;
  font-weight: 650;
}
button:hover {
  filter: brightness(0.95);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button.secondary,
.button.secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--primary);
}
button.danger {
  background: transparent;
  color: var(--negative);
  border-color: var(--line);
}
button.link {
  color: var(--primary);
  background: transparent;
  padding: 8px;
  min-height: 44px;
}
a {
  color: var(--primary);
}
:focus-visible {
  outline: 3px solid #c75b7e;
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 30px;
  letter-spacing: -1px;
  line-height: 1.15;
}
h2 {
  font-size: 21px;
  letter-spacing: -0.35px;
}
h3 {
  font-size: 17px;
}
p {
  line-height: 1.5;
}
small,
.muted {
  color: var(--muted);
}
small {
  font-size: 13px;
  line-height: 1.45;
}
.shell {
  max-width: 900px;
  margin: auto;
  padding: 22px 22px 115px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.brand {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.7px;
}
.brand span {
  font-size: 19px;
}
main {
  display: grid;
  gap: 20px;
}
body > #app > main {
  max-width: 440px;
  margin: 60px auto;
  padding: 24px;
}
.groupbar {
  display: flex;
  gap: 8px;
  margin-bottom: 26px;
}
.groupbar select {
  flex: 1;
  min-width: 0;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 16px;
}
.panel > h2,
.panel > h3 {
  margin-bottom: 12px;
}
.stack {
  display: grid;
  gap: 14px;
}
.compact {
  gap: 8px;
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child {
  border-bottom: 0;
}
.row .copy {
  min-width: 0;
  overflow-wrap: anywhere;
}
.row strong {
  font-size: 18px;
}
.money {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.positive {
  color: var(--positive);
}
.negative {
  color: var(--negative);
}
.total {
  font-size: 38px;
  font-weight: 750;
  letter-spacing: -1.4px;
  margin: 5px 0 10px;
}
.full {
  width: 100%;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.actions > * {
  flex: 1;
}
.actions .link {
  flex: 0 0 auto;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.activity {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  font-weight: 400;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
}
.activity:last-child {
  border-bottom: 0;
}
.activity span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.activity small {
  display: block;
  margin-top: 5px;
}
.empty {
  padding: 16px 0;
  color: var(--muted);
  line-height: 1.55;
}
nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  background: var(--paper);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
  padding: 7px 12px max(10px, env(safe-area-inset-bottom));
}
nav button {
  background: transparent;
  color: var(--muted);
  border-radius: 0;
  display: grid;
  gap: 4px;
  justify-items: center;
  min-width: 100px;
  font-size: 13px;
  padding: 5px 20px;
}
nav button.active {
  color: var(--primary);
  font-weight: 750;
}
svg.icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
label {
  display: grid;
  gap: 7px;
  font-size: 14px;
  color: var(--muted);
}
input,
select,
textarea {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 11px 12px;
  color: var(--ink);
  width: 100%;
  min-width: 0;
}
textarea {
  resize: vertical;
  min-height: 80px;
}
input[type="checkbox"] {
  width: 22px;
  min-height: 22px;
  accent-color: var(--primary);
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  min-height: 44px;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.warning,
.error {
  padding: 12px;
  border-radius: 8px;
  background: #fae8ca;
  color: #744c22;
  font-size: 14px;
  line-height: 1.5;
}
.error {
  background: #fbe1e4;
  color: var(--negative);
}
.success {
  background: #f9e8ef;
  color: var(--positive);
  padding: 12px;
  border-radius: 8px;
}
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--line);
  flex: 1;
  min-width: 70px;
  padding: 9px 12px;
}
.chip.selected {
  color: white;
  background: var(--primary);
  border-color: var(--primary);
}
.split-editor {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.split-values {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: var(--surface);
}
.item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.item-title h3 {
  flex: 1;
}
.item-title button {
  padding: 6px 10px;
}
.receipt-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
.receipt-image {
  width: 100%;
  max-height: 390px;
  object-fit: contain;
  object-position: top;
  background: #fbd5df;
  border-radius: 9px;
}
.image-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 180px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-size: 14px;
  padding: 16px;
}
details {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
  background: var(--surface);
}
summary {
  cursor: pointer;
  min-height: 28px;
  color: var(--ink);
  font-weight: 600;
}
details[open] > summary {
  margin-bottom: 14px;
}
.reconciliation {
  position: relative;
}
.inline {
  display: flex;
  align-items: center;
  gap: 8px;
}
#notice {
  position: fixed;
  bottom: 94px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  width: max-content;
  background: var(--ink);
  color: white;
  padding: 13px 18px;
  border-radius: 9px;
  z-index: 20;
  box-shadow: 0 4px 18px #0002;
  font-size: 14px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  max-width: 480px;
  width: calc(100% - 28px);
  max-height: 85dvh;
  padding: 22px;
}
dialog::backdrop {
  background: #3d182e66;
}
dialog #close-modal {
  width: 100%;
  margin-top: 20px;
}
.auth {
  padding-top: 30px;
}
.auth h1 {
  font-size: 36px;
}
.auth .brand {
  margin-bottom: 30px;
}
.auth form {
  margin-top: 24px;
}
.auth p {
  margin-top: 12px;
}
.receipt-layout {
  display: grid;
  gap: 20px;
}
.pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  max-height: 300px;
  overflow: auto;
}
.divider {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.subtitle {
  margin-top: 8px;
}
.balance-list .row {
  padding: 10px 0;
}
.tag {
  font-size: 12px;
  color: var(--muted);
  text-transform: capitalize;
}
.file-label {
  border: 1px dashed var(--line);
  padding: 20px;
  border-radius: 10px;
  background: var(--surface);
}
.file-label input {
  background: transparent;
  border: 0;
  padding: 10px 0;
}
.tabs {
  display: flex;
  gap: 8px;
}
.tabs button {
  flex: 1;
}
.quiet {
  font-size: 13px;
}
#review-summary {
  scroll-margin-bottom: 100px;
}
button.icon-only {
  min-width: 46px;
  padding: 8px;
}
.history-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.spacer {
  margin-top: 12px;
}
.read-list {
  display: grid;
  gap: 8px;
}
.read-list .row {
  align-items: flex-start;
}
.processing {
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.55;
  }
}
@media (min-width: 760px) {
  .shell {
    padding-top: 32px;
  }
  .brand {
    font-size: 28px;
  }
  .dashboard {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .dashboard > .intro,
  .dashboard > .primary-action {
    grid-column: 1/-1;
  }
  .dashboard > .balances {
    grid-row: 2/4;
  }
  .dashboard > .recent {
    grid-column: 2;
  }
  .dashboard > .settlements {
    grid-column: 2;
  }
  .primary-action {
    max-width: 100%;
  }
  .receipt-layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .receipt-layout > .receipt-top {
    grid-column: 1/-1;
  }
  .receipt-layout > .receipt-top .receipt-image {
    max-height: 280px;
  }
  .receipt-layout > .review-items {
    grid-column: 1;
  }
  .receipt-layout > .review-side {
    grid-column: 2;
  }
  .receipt-top {
    grid-template-columns: 1fr 1fr;
  }
  .auth {
    max-width: 430px;
    margin: 30px auto;
  }
  .total {
    font-size: 44px;
  }
  nav button {
    min-width: 160px;
  }
  .history-filters {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 370px) {
  .shell {
    padding: 16px 14px 110px;
  }
  .brand {
    font-size: 22px;
  }
  .brand span {
    font-size: 16px;
  }
  h1 {
    font-size: 27px;
  }
  nav button {
    min-width: 90px;
    padding: 5px 16px;
  }
  .grid3 {
    grid-template-columns: 1fr;
  }
  .receipt-top {
    gap: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

@media (min-width: 760px) {
  .dashboard {
    grid-template-areas: "intro intro" "balances settlements" "primary recent";
  }
  .dashboard > .intro {
    grid-area: intro;
  }
  .dashboard > .balances {
    grid-area: balances;
  }
  .dashboard > .primary-action {
    grid-area: primary;
  }
  .dashboard > .settlements {
    grid-area: settlements;
  }
  .dashboard > .recent {
    grid-area: recent;
  }
}

.brand { display:flex; align-items:center; gap:10px; }
.brand-icon { width:40px; height:40px; border-radius:10px; flex:none; }
nav button.active { background:#fbd5df; border-radius:9px; }
@media(max-width:400px) { header .brand {font-size:22px;} header .brand span[lang] {font-size:16px;} }
