@font-face {
    font-family: 'Berkeley Mono';
    src: url('/fonts/BerkeleyMono-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Berkeley Mono';
    src: url('/fonts/BerkeleyMono-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Berkeley Mono';
    src: url('/fonts/BerkeleyMono-Oblique.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Berkeley Mono';
    src: url('/fonts/BerkeleyMono-Bold-Oblique.woff2') format('woff2');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

* {
    box-sizing: border-box;
}

[x-cloak] {
    display: none !important;
}

html {
    color: #202520;
    background: #f3f4f1;
    font-family: 'Berkeley Mono', monospace;
    font-size: 13px;
}

body {
    min-width: 0;
    margin: 0;
}

button,
a,
input,
dialog {
    font: inherit;
}

button,
.arrow {
    min-height: 2rem;
    border: 1px solid #aeb4aa;
    border-radius: 2px;
    background: #fff;
    color: #263128;
    cursor: pointer;
}

button:hover:not(:disabled),
.arrow:hover {
    background: #f3f4f1;
    border-color: #667265;
}

button:focus,
button:focus-visible,
a:focus,
a:focus-visible,
input:focus,
input:focus-visible {
    outline: 0;
    box-shadow: none;
}

button:disabled {
    color: #90958f;
    background: #eceeeb;
    cursor: not-allowed;
}

h2,
p {
    margin: 0;
}

button.text-action {
    min-height: 0;
    padding: 2px 0;
    border: 0;
    background: transparent;
    color: #173f2a;
    font-weight: 600;
}

button.text-action:hover {
    border: 0;
    background: transparent;
    text-decoration: underline;
}

button.primary {
    padding: 6px 14px;
    border-color: #173f2a;
    background: #173f2a;
    color: white;
    font-weight: 650;
}

button.primary:hover {
    border-color: #0d2c1b;
    background: #245c3b;
}

main {
    padding-top: 20px;
}

.table-wrap {
    width: 100%;
    padding-bottom: 1.5rem;
    overflow-x: auto;
    background: #fff;
}

main table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    table-layout: auto;
    font-variant-numeric: tabular-nums;
}

main th,
main td {
    height: 27px;
    padding: 2px 6px;
    border: 0;
}

thead tr {
    border-bottom: 1px solid #aeb4aa;
}

thead th {
    height: 38px;
    background: #e7e9e4;
    color: #3d463e;
    font-size: 0.78rem;
    letter-spacing: 0.025em;
    text-align: center;
    text-transform: uppercase;
}

.money-column {
    white-space: nowrap;
    text-align: right;
}

.month-column {
    padding-inline: 5px;
}

.month-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.month-heading span {
    flex: 1;
    text-align: center;
}

.arrow {
    display: grid;
    min-width: 20px;
    min-height: 22px;
    padding: 1px 4px;
    border: 0;
    background: transparent;
    color: #173f2a;
    font-size: 1.35rem;
    line-height: 1;
    place-items: center;
    text-decoration: none;
}

.arrow:hover {
    border: 0;
    background: transparent;
}

button.arrow:disabled {
    background: transparent;
    color: #90958f;
}

.envelope-name {
    text-align: left;
    white-space: normal;
}

.envelope-edit-form {
    min-width: 0;
    flex: 1;
}

.envelope-name .envelope-edit {
    display: block;
    width: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-weight: 600;
    text-align: left;
}

.default-value .default-edit {
    width: 11ch;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: right;
}

.current-balance {
    font-weight: 600;
}

.default-value {
    font-style: italic;
    text-align: right;
}

.selected-value {
    white-space: nowrap;
}

.selected-value button {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-weight: 700;
    text-align: right;
}

.negative {
    color: #d46e50 !important;
}

dialog {
    top: 0;
    bottom: auto;
    width: min(430px, calc(100vw - 1.5rem));
    max-height: calc(var(--vvh, 100dvh) - 1.5rem);
    margin: 0.75rem auto 0;
    padding: 0;
    overflow-y: auto;
    border: 1px solid #667265;
    border-radius: 2px;
    box-sizing: border-box;
    background: #fff;
    color: #202520;
    font-size: 13px;
}

dialog::backdrop {
    background: rgb(225 228 224 / 72%);
}

.dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    border-bottom: 1px solid #d4d8d1;
    background: #f3f4f1;
}

.dialog-header h2 {
    color: #173f2a;
    font-size: 1.15rem;
}

.close-button {
    min-width: 30px;
    padding: 0;
    font-size: 1.2rem;
}

dialog > form {
    display: grid;
    padding: 16px;
}

dialog.month-dialog {
    width: min(390px, calc(100vw - 1.5rem));
}

dialog label {
    margin-bottom: 4px;
    font-size: 0.82rem;
    font-weight: 650;
}

dialog label:not(:first-of-type) {
    margin-top: 13px;
}

dialog label span,
.hint {
    color: #687068;
    font-weight: 400;
}

dialog input:not([type='hidden']) {
    width: 100%;
    min-height: 35px;
    padding: 6px 8px;
    border: 1px solid #aeb4aa;
    border-radius: 1px;
    background: #fff;
}

dialog input[aria-invalid='true'] {
    border-color: #781f1f;
}

.hint {
    margin-top: 5px;
    font-size: 0.78rem;
    line-height: 1.35;
}

.field-error {
    margin-top: 5px;
    color: #781f1f;
    font-size: 0.8rem;
}

.form-actions {
    display: flex;
    gap: 7px;
    margin-top: 18px;
}

.form-actions button {
    padding: 5px 10px;
}

.empty-state {
    padding: 56px 24px;
    border: 1px solid #c8cdc5;
    background: #fff;
    text-align: center;
}

.empty-state h2 {
    margin-bottom: 6px;
    color: #173f2a;
}

.empty-state p {
    margin-bottom: 18px;
    color: #626a62;
}

@media (pointer: coarse), (max-width: 640px) {
    input,
    button {
        font-size: 16px;
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Compact mint accounting-paper treatment. */
.design {
    --ledger-font: 13px;
    --ledger-pad-y: 4px;
    --ledger-pad-x: 8px;
    --ledger-graph: 2px;
    --ledger-envelope-width: 270px;
    --ledger-amount-width: 200px;
    --ink: #1f5146;
    --muted-ink: #547c72;
    --paper: #fbfff9;
    --paper-shade: #dcefe5;
    --rule: #a3cab9;
    --strong-rule: #4a8f77;
    --accent: #d06748;
    --desk: #eef0e8;
    --body-font: 'Berkeley Mono', monospace;
    --heading-font: 'Berkeley Mono', monospace;
    --table-font: 'Berkeley Mono', monospace;
    --number-font: 'Berkeley Mono', monospace;
    --paper-shadow: 0 1px 0 rgb(36 79 65 / 16%);
    min-height: 100vh;
    background: var(--desk);
    color: var(--ink);
    font-family: var(--body-font);
    font-size: 11px;
    line-height: 1.15;
}

.design button,
.design a,
.design input,
dialog.design {
    font-family: inherit;
    font-size: inherit;
}

.design button:focus,
.design button:focus-visible,
.design a:focus,
.design a:focus-visible,
.design input:focus,
.design input:focus-visible {
    outline: 0;
    box-shadow: none;
}

.design button,
.design .arrow {
    min-height: 18px;
    border-radius: 0;
}

.design button.text-action {
    color: var(--ink);
    font-size: 10px;
}

.design main {
    width: 100%;
    padding: 6px 8px 18px;
}

.design .table-wrap {
    position: relative;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0;
    overflow: auto;
    border: 1px solid #d46e50;
    background: var(--paper);
    box-shadow: var(--paper-shadow, 0 2px 10px rgb(35 42 36 / 9%));
}

.design main table {
    min-width: 650px;
    table-layout: auto;
    color: var(--ink);
    font-family: var(--table-font, Arial, Helvetica, sans-serif);
    font-size: 9px;
}

.design main th,
.design main td {
    height: 20px;
    padding: 2px 7px;
    border-right: 1px solid var(--strong-rule);
    border-bottom: 1px solid var(--rule);
}

.design main tr > td:last-of-type,
.design main tr > th:last-child {
    border-right: 0;
}

.design main tbody tr:last-child > * {
    border-bottom: 0;
}

.design main thead tr {
    border: 0;
}

.design main thead th {
    height: 25px;
    background: var(--paper-shade);
    color: var(--ink);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-align: left;
}

.design main thead th:first-child {
    width: auto;
    text-align: left;
}

.design main thead th:nth-child(2),
.design main thead th:nth-child(3),
.design main thead th:nth-child(4) {
    width: 1%;
    white-space: nowrap;
}

.design .envelope-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.design main thead .money-column {
    text-align: right;
}

.design button.column-action {
    display: grid;
    width: 18px;
    min-width: 18px;
    min-height: 16px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    place-items: center;
}

.design button.column-action:hover,
.design .add-month:hover,
.design a.arrow:hover,
.design button.delete-transaction:hover {
    border: 0;
    background: transparent;
    color: var(--accent);
}

.design main tbody tr,
.design main tbody tr:hover {
    background: transparent;
}

.design .envelope-cell {
    display: flex;
    align-items: center;
    width: 100%;
}

.design .envelope-edit-form {
    display: block;
    position: relative;
}

.design .last-updated-marker {
    position: absolute;
    top: 0;
    color: var(--accent);
    pointer-events: none;
}

.design .delete-envelope-form {
    display: flex;
    margin-left: auto;
}

.design .envelope-name .envelope-edit,
.design .default-value .default-edit,
.design .selected-value button {
    font-size: inherit;
    font-weight: inherit;
}

.design .selected-value button:hover,
.design button.text-action:hover {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.design .current-balance,
.design .selected-value button,
.design .default-value {
    font-family: var(--number-font);
    font-size: 10px;
}

.design .current-balance {
    font-weight: 700;
}

.design .default-value {
    color: var(--muted-ink);
    font-style: normal;
}

.design .envelope-edit[aria-invalid='true'],
.design .default-edit[aria-invalid='true'] {
    box-shadow: inset 0 0 0 1px #781f1f;
}

.design main tbody tr.expanded > :is(th, td) {
    box-shadow: 0 -1px 0 var(--strong-rule);
}

.design main tbody tr.expanded .selected-value button {
    font-weight: 700;
}

.design main tbody tr.transaction-list-end > td {
    border-bottom-color: var(--strong-rule);
}

.design main tbody tr.transaction-row > td {
    height: 20px;
    padding: 0;
}

.design .transaction-row input {
    display: block;
    min-width: 0;
    height: 19px;
    min-height: 0;
    margin: 0;
    padding: 2px 7px;
    border: 0;
    border-radius: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    font: inherit;
}

.design .transaction-amount input {
    margin-left: auto;
    font-family: var(--number-font);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.design .transaction-note input {
    text-align: left;
}

.design .transaction-row td.invalid-cell {
    box-shadow: inset 0 0 0 1px #781f1f;
}

.design .transaction-delete {
    text-align: right;
}

.design button.delete-transaction,
.design button.delete-envelope {
    display: inline-grid;
    width: 18px;
    min-width: 18px;
    min-height: 18px;
    margin-right: 2px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted-ink);
    font-size: 12px;
    line-height: 1;
    place-items: center;
}

.design button.delete-envelope:hover,
.design button.delete-envelope:focus-visible {
    border: 0;
    background: transparent;
    color: #781f1f;
    outline: 0;
}

.design .transaction-error-row td {
    padding: 3px 7px;
    color: #781f1f;
    font-size: 8px;
}

.design .arrow {
    min-width: 16px;
    min-height: 17px;
    padding: 0;
    color: var(--ink);
    font-size: 14px;
}

.design .month-heading .arrow {
    justify-items: start;
}

.design .month-heading .arrow ~ .arrow,
.design button.column-action {
    justify-items: end;
}

.design .add-month {
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
}

dialog.design {
    --paper-shadow: none;
    width: min(390px, calc(100vw - 1rem));
    min-height: 0;
    max-height: calc(var(--vvh, 100dvh) - 1rem);
    margin-top: 0.5rem;
    border: 1px solid #d46e50;
    border-radius: 0;
    background: var(--paper);
    color: var(--ink);
    font-size: 10px;
    box-shadow: 4px 4px 0 rgb(35 42 36 / 12%);
}

dialog.design::backdrop {
    background: rgb(220 219 207 / 68%);
}

.design .dialog-header {
    min-height: 32px;
    padding: 6px 9px;
    border-color: var(--rule);
    background: var(--paper-shade);
}

.design .dialog-header h2 {
    color: var(--ink);
    font-family: var(--heading-font, Georgia, 'Times New Roman', serif);
    font-size: 12px;
}

.design .close-button {
    min-width: 22px;
    padding: 0;
    border-color: var(--rule);
    background: transparent;
    font-size: 13px;
}

dialog.design > form {
    padding: 10px;
}

dialog.design label {
    margin-bottom: 3px;
    font-size: 9px;
}

dialog.design label:not(:first-of-type) {
    margin-top: 9px;
}

dialog.design input:not([type='hidden']) {
    min-height: 25px;
    padding: 3px 5px;
    border-color: var(--rule);
    border-radius: 0;
    background: transparent;
}

.design .form-actions {
    margin-top: 11px;
}

.design .form-actions button {
    min-height: 22px;
    padding: 3px 7px;
}

.design button.primary {
    border-color: var(--ink);
    background: var(--ink);
}

.design main tbody tr:not(.transaction-row) .current-balance {
    background-image: linear-gradient(
        to right,
        transparent calc(100% - 1px),
        rgb(74 143 119 / 12%) calc(100% - 1px)
    );
    background-position: right var(--ledger-pad-x) top;
    background-size: var(--ledger-graph) 100%;
    background-repeat: repeat-x;
}

@media (max-width: 700px) {
    .design main {
        padding-inline: 0;
    }
}

.design main {
    padding: 0;
}

.design .table-wrap {
    width: fit-content;
    max-width: 100%;
    height: 100dvh;
    margin: 0;
    overflow-x: auto;
    overflow-y: hidden;
    border: 0;
    border-right: 1px solid #d46e50;
    box-shadow: none;
}

.design main table {
    display: flex;
    flex-direction: column;
    width: max-content;
    min-width: 0;
    table-layout: fixed;
    font-size: var(--ledger-font);
    height: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.design main thead th:nth-child(n) {
    width: auto;
}

.design main th,
.design main td,
.design main tbody tr.transaction-row > td {
    height: auto;
    padding: var(--ledger-pad-y) var(--ledger-pad-x);
}

.design main :is(thead, tfoot) {
    flex: none;
    position: relative;
    z-index: 2;
    background: var(--paper-shade);
}

.design main tbody {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: max-content;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    overscroll-behavior-y: contain;
}

.design main tr {
    display: grid;
    grid-template-columns: var(--ledger-envelope-width) repeat(3, var(--ledger-amount-width));
    flex: none;
}

.design main .transaction-error-row td {
    grid-column: 1 / -1;
}

.design main tbody tr.ledger-space {
    flex: 1;
}

.design main tbody tr.ledger-space > td {
    padding: 0;
}

.design main thead th,
.design main tfoot th,
.design main tfoot td {
    height: 28px;
    background: var(--paper-shade);
    font-weight: 700;
}

.design :is(thead, tfoot) > tr > :is(th, td) {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.design tbody > tr > :is(th, td) {
    align-content: center;
}

.design main thead {
    margin-bottom: -1px;
}

.design main tbody tr:first-of-type > * {
    border-top: 1px solid var(--rule);
}

.design main tfoot {
    margin-top: -1px;
}

.design main tfoot th,
.design main tfoot td {
    border-top: 1px solid var(--strong-rule);
    border-bottom: 0;
}

.design main tfoot th {
    color: var(--muted-ink);
    font-size: calc(var(--ledger-font) * 0.9);
    letter-spacing: 0.09em;
    text-align: left;
    text-transform: uppercase;
}

.design main thead th,
.design main tfoot td {
    font-size: calc(var(--ledger-font) * 0.9);
}

.design .current-balance,
.design .selected-value button,
.design .default-value,
.design .transaction-row input {
    font-size: var(--ledger-font);
}

.design .envelope-heading {
    gap: 4px;
    flex-wrap: nowrap;
}

.design main :is(th, td) {
    white-space: nowrap;
}

.design .envelope-heading > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.design .transaction-row input {
    width: 100%;
    padding: var(--ledger-pad-y) var(--ledger-pad-x);
    height: auto;
    line-height: 18px;
    max-width: 100%;
}

.design main tbody tr.transaction-row > td:not(.transaction-delete) {
    padding: 0;
}

.design .default-edit {
    width: 100%;
    max-width: 100%;
}

.error-page main {
    max-width: 760px;
    margin: 80px auto;
    padding: 0 24px;
}

.error-page section {
    padding: 24px;
    border: 1px solid #aeb4aa;
    border-top: 3px solid #781f1f;
    border-radius: 2px;
    background: #fff;
}

.error-page h1 {
    margin: 4px 0 12px;
    color: #173f2a;
    font-size: 1.5rem;
}

.error-page p {
    line-height: 1.5;
}

.error-page .status {
    color: #781f1f;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

dialog.design.triage-dialog {
    inset: 48px;
    width: calc(100vw - 96px);
    height: calc(100dvh - 96px);
    max-width: none;
    max-height: none;
    outline: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-size: var(--ledger-font);
}

.triage-dialog[open] {
    display: flex;
    flex-direction: column;
}

.triage-dialog .dialog-header,
.triage-footer {
    flex: none;
}

.triage-dialog .dialog-header h2 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.triage-filename {
    margin-left: 16px;
    color: var(--muted-ink);
    font-weight: 400;
}

.triage-status {
    padding: 10px;
}

.triage-scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
}

.triage-table {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    /* Leave room for the reserved scrollbar gutter at the minimum column widths. */
    min-width: calc(436px + var(--ledger-envelope-width) + 3 * var(--ledger-amount-width) + 2rem);
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--ledger-font);
}

.triage-table thead,
.triage-table tbody {
    display: block;
    scrollbar-gutter: stable;
}

.triage-table thead {
    flex: none;
    overflow: hidden;
    position: relative;
    z-index: 2;
    margin-bottom: -1px;
    background: var(--paper-shade);
}

.triage-table tbody {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
}

.triage-table tr {
    display: grid;
    grid-template-columns: 36px minmax(400px, 1fr) var(--ledger-amount-width) var(--ledger-envelope-width) repeat(2, var(--ledger-amount-width));
}

.triage-table thead tr {
    border: 0;
}

.design .triage-table tbody tr:first-of-type td {
    border-top: 1px solid var(--rule);
}

.design .triage-table th,
.design .triage-table td {
    width: auto;
    padding: var(--ledger-pad-y) var(--ledger-pad-x);
    height: 28px;
    border: 0;
    border-right: 1px solid var(--strong-rule);
    border-bottom: 1px solid var(--rule);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.triage-table thead th {
    background: var(--paper-shade);
    color: var(--ink);
    font-size: calc(var(--ledger-font) * 0.9);
    font-weight: 700;
    letter-spacing: 0.09em;
    text-align: left;
}

.triage-table thead .money-column {
    text-align: right;
}

.triage-table thead .triage-month-heading {
    text-align: center;
}

.design .triage-table .triage-input-cell,
.design .triage-table .triage-check-cell {
    padding: 0;
}

.design.triage-dialog .triage-input-cell input,
.design.triage-dialog .triage-input-cell select {
    display: block;
    width: 100%;
    min-width: 0;
    height: 27px;
    margin: 0;
    padding: var(--ledger-pad-y) var(--ledger-pad-x);
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font: inherit;
}

.triage-input-cell select {
    appearance: none;
    cursor: pointer;
}

.design.triage-dialog .triage-input-cell select:hover:not(:disabled) {
    color: #781f1f;
}

.design .triage-check {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    line-height: 1;
}

.design.triage-dialog .close-button {
    border: 0;
    background: transparent;
}

.design .triage-check:hover:not(:disabled),
.design.triage-dialog .close-button:hover:not(:disabled) {
    background: transparent;
    color: var(--accent);
}

.triage-excluded .triage-description,
.triage-excluded .money-column {
    color: color-mix(in srgb, var(--ink) 45%, transparent);
}

.triage-excluded .money-column.negative {
    color: color-mix(in srgb, #d46e50 45%, transparent) !important;
}

.triage-excluded :is(button, select, input, .month-heading span) {
    opacity: 0.45;
}

.design.triage-dialog .arrow,
.design.triage-dialog .arrow:hover {
    border: 0;
    background: transparent;
    color: var(--ink);
    font-weight: 700;
}

.design.triage-dialog .arrow:disabled {
    opacity: 0.35;
}

.design.triage-dialog :is(.arrow, .triage-check) {
    user-select: none;
    -webkit-user-select: none;
}

.design.triage-dialog .arrow:hover:not(:disabled),
.design.triage-dialog :is(.arrow, .triage-check).triage-range-hover {
    color: var(--accent);
    opacity: 1;
}

dialog.design.triage-dialog:focus,
.design.triage-dialog :is(button, select, input, textarea):focus {
    outline: 0;
    box-shadow: none;
}

.triage-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    /* Cover the body's last pixel at the scroll boundary, without hiding a short table's last rule. */
    position: relative;
    margin-top: -1px;
    padding: 8px;
    border-top: 1px solid var(--strong-rule);
    background: var(--paper-shade);
    font-size: 11px;
}

.triage-footer .primary {
    margin-left: auto;
}

.design .triage-footer button {
    padding: 6px 14px;
    font-weight: 650;
}

.design .triage-footer button:not(.primary):hover {
    background: #fff;
    border-color: #aeb4aa;
}

.design .triage-footer button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .design {
        --ledger-font: 11px;
        --ledger-pad-y: 2px;
        --ledger-pad-x: 4px;
        --ledger-envelope-width: 150px;
        --ledger-amount-width: 120px;
    }

    .design .arrow {
        min-width: 16px;
        padding-inline: 2px;
    }

    .design .month-heading span {
        font-size: 9px;
        letter-spacing: 0;
    }

    .design .transaction-row input {
        line-height: 16px;
    }

    dialog.design.triage-dialog {
        inset: 6px;
        width: calc(100vw - 12px);
        height: calc(100dvh - 12px);
    }

    .triage-table {
        min-width: calc(228px + var(--ledger-envelope-width) + 3 * var(--ledger-amount-width) + 2rem);
    }

    .triage-table tr {
        grid-template-columns: 28px minmax(200px, 1fr) var(--ledger-amount-width) var(--ledger-envelope-width) repeat(2, var(--ledger-amount-width));
    }

    .design .triage-table tbody td {
        height: 24px;
    }

    .design.triage-dialog .triage-input-cell :is(input, select) {
        height: 100%;
    }

    .triage-dialog .dialog-header {
        min-height: 28px;
        padding: 4px 6px;
    }

    .triage-filename {
        margin-left: 6px;
    }

    .triage-footer {
        gap: 6px;
        padding: 4px;
        font-size: 10px;
    }

    .design .triage-footer button {
        padding: 4px 8px;
    }
}
