@font-face {
  font-family: "Wanted Sans";
  src: url("/miaaga/assets/wanted-sans.ttf") format("truetype");
  font-weight: 100 1000;
  font-display: swap;
}
/* From flutter/lib/ui.dart: paper, brand, brandAccent, ink, corner. */
:root {
  color-scheme: light;
  --paper: #f7f5f0;
  --brand: #2c3f58;
  --accent: #fde1b8;
  --button-fill: #edf0f3;
  --button-selected-fill: #f5c88e;
  --button-shadow: #854c4a;
  --ink: #1d1d1f;
  --muted: #555e6a;
  --line: #e1e2e2;
  --corner: 22px;
  --bad: #9b332d;
  --good: #27654d;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 "Wanted Sans", system-ui, sans-serif; }
:where(h1,h2,h3,p,li,dd,dt,label,small,.trip strong,.trip span) { word-break: keep-all; overflow-wrap: break-word; }
h1, h2, h3 { text-wrap: balance; color: var(--brand); line-height: 1.22; margin: 0; }
p { text-wrap: pretty; margin: 0; }
h1 { font-size: clamp(28px, 5vw, 38px); letter-spacing: -.035em; }
h2 { font-size: 21px; letter-spacing: -.025em; }
h3 { font-size: 16px; }
small, .muted { color: var(--muted); }
small { font-size: 13px; }
ul { margin: 0; padding: 0; list-style: none; }
.shell { width: min(100% - 36px, 1040px); margin-inline: auto; }
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 67px; padding-block: 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.brand { display: flex; align-items: center; justify-content: center; gap: 8px; }
#brand-icon { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.wordmark { color: var(--brand); font-size: 29px; font-weight: 850; letter-spacing: -.08em; line-height: 1.15; }
nav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
nav button { padding-inline: 14px; }
nav button[aria-current="page"] { background: var(--button-selected-fill); font-weight: 800; }
main { padding-block: 32px 64px; }
.stack { display: grid; gap: 18px; }
.flow { display: grid; gap: 10px; }
.card, .hero, dialog { padding: clamp(16px, 3vw, 27px); border-radius: var(--corner); }
.card, dialog { background: white; border: 1px solid var(--line); }
@supports (corner-shape: squircle) { .card, .hero, dialog { corner-shape: squircle; } }
.hero { background: var(--accent); }
.gate { width: min(100%, 460px); margin: clamp(6px, 6vh, 68px) auto 0; }
.gate form { margin-top: 6px; }
.line { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.line > *, .row > *, .columns > * { min-width: 0; }
.columns { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-block: 11px; }
li + li > .row, .rows > .row + .row { border-top: 1px solid var(--line); }
.row strong, .money { white-space: nowrap; font-variant-numeric: tabular-nums; }
.row .money { flex-shrink: 0; text-align: end; }
.row small { display: block; text-wrap: pretty; }
.numeric { font-size: clamp(22px, 4vw, 34px); letter-spacing: -.025em; font-weight: 800; }
.totals { display: flex; gap: 12px 36px; flex-wrap: wrap; }
.income { color: var(--good); }
button, input, select, textarea { font: inherit; }
button { min-height: 44px; border: 0; border-radius: 13px; padding: 8px 16px; background: var(--button-fill); color: var(--brand); font-weight: 700; cursor: pointer; }
button:enabled { box-shadow: 3px 3px 0 var(--button-shadow); }
button:enabled:is(:active, [data-pressed]), nav button[aria-current="page"] { box-shadow: inset 3px 3px 0 var(--button-shadow); }
button:disabled { opacity: .55; cursor: default; }
.error { color: var(--bad); }
:focus-visible { outline: 3px solid #976010; outline-offset: 3px; }
label.field { display: grid; gap: 5px; font-weight: 700; }
input:not([type=checkbox]), select, textarea {
  min-height: 43px; min-width: 0; width: 100%; padding: 8px 10px; border: 1px solid #aeb7bf;
  border-radius: 10px; color: var(--ink); background: white;
}
textarea { resize: vertical; }
input[type=checkbox] { accent-color: var(--brand); inline-size: 18px; block-size: 18px; }
.check { display: flex; align-items: center; gap: 8px; }
fieldset { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
legend { padding: 0; margin-bottom: 6px; font-weight: 700; }
.pin-grid input:nth-child(5) { grid-column: 6; }
.pin-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)) clamp(2px, 1.5vw, 10px) repeat(4,minmax(0,1fr)); gap: clamp(3px, 1vw, 8px); }
.pin-grid input:not([type=checkbox]) { padding-inline: 0; text-align: center; font-size: 21px; font-weight: 750; }
.sas { font-size: clamp(34px, 9vw, 54px); color: var(--brand); letter-spacing: .22em; font-weight: 800; font-variant-numeric: tabular-nums; }
.trip { width: 100%; background: var(--button-fill); text-align: left; display: grid; gap: 4px; }
.notice { padding: 11px 18px; background: var(--brand); color: white; position: fixed; z-index: 2; bottom: 14px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 28px); border-radius: 14px; word-break: keep-all; pointer-events: none; }
dialog { width: min(460px, calc(100% - 28px)); max-height: calc(100% - 28px); color: var(--ink); }
dialog::backdrop { background: #17283e70; }
@media (max-width: 680px) {
  .columns { grid-template-columns: minmax(0, 1fr); }
  nav button { padding-inline: 10px; }
  main { padding-block-start: 22px; }
}
.month { width: min(100%, 185px); }
.memo { white-space: pre-wrap; }
.day-plan + .day-plan { border-top: 1px solid var(--line); padding-top: 12px; }
.ledger-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ledger-actions button[aria-pressed="true"] { background: var(--button-selected-fill); box-shadow: inset 3px 3px 0 var(--button-shadow); }
.paste-dialog { width: min(760px, calc(100% - 28px)); }
.paste-dialog .stack { grid-template-columns: minmax(0, 1fr); }
.preview-table { max-height: 32vh; overflow: auto; }
.preview-table table { border-collapse: collapse; text-align: start; font-size: 14px; width: 100%; }
.preview-table :is(td, th) { text-align: start; border-bottom: 1px solid var(--line); padding: 6px 8px; word-break: keep-all; overflow-wrap: break-word; }
.preview-table :is(td, th):nth-child(3), .preview-table :is(td, th):nth-child(5) { white-space: nowrap; }
.preview-table :is(td, th):nth-child(4) { min-width: 7em; max-width: 16em; }
.preview-table :is(td, th):last-child { min-width: 6em; }
.preview-table td small { white-space: pre-wrap; }
