:root {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    color: #193d39;
    background: #f4f7f6;
    line-height: 1.5;
    font-synthesis: none;
    --ink: #193d39;
    --muted: #657a74;
    --green: #176e58;
    --line: #dfe8e3;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--green); text-underline-offset: 3px; }
button, input, select { font: inherit; }
button, summary, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #79bba5; outline-offset: 4px; }
header {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px max(calc((100vw - 1120px) / 2), 28px);
    background: #fff;
    border-bottom: 1px solid var(--line);
}
header > a {
    color: var(--ink);
    font-size: 21px;
    font-weight: 750;
    letter-spacing: -.04em;
    text-decoration: none;
    white-space: nowrap;
}
header > a::before {
    content: "";
    display: inline-block;
    width: 11px;
    height: 19px;
    margin-right: 11px;
    vertical-align: -2px;
    border-radius: 4px;
    background: var(--green);
    box-shadow: 6px -5px 0 #d7eee2;
}
.account-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.account-nav > a { padding: 8px 12px; border-radius: 8px; color: #5c716a; text-decoration: none; font-size: 14px; font-weight: 600; }
.account-nav > a:hover, .account-nav > a[aria-current="page"] { color: var(--green); background: #edf5f0; }
.account-name { margin-right: 12px; color: var(--muted); font-size: 14px; }
.account-nav form { margin: 0 0 0 8px; }
main { width: min(100% - 56px, 1120px); margin: 36px auto 0; }
h1 { margin: 0 0 8px; font-size: clamp(27px, 3vw, 36px); line-height: 1.2; letter-spacing: -.045em; font-weight: 750; }
h2 { margin: 0; font-size: 20px; line-height: 1.3; letter-spacing: -.025em; }
h3 { margin: 22px 0 8px; font-size: 15px; }
p { margin: 0 0 14px; }
.page-description { color: var(--muted); margin: 0 0 22px; font-size: 15px; }
.section-nav { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 24px; }
.section-nav a { padding: 7px 13px; border: 1px solid #dbe6df; background: #fff; border-radius: 8px; color: #516b60; font-size: 13px; font-weight: 600; text-decoration: none; }
.section-nav a:hover { color: var(--green); border-color: #a4c8b6; background: #edf5f0; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; margin: 0 0 20px; scroll-margin-top: 24px; box-shadow: 0 2px 4px #244f3603; }
.section-heading { display: flex; gap: 10px; align-items: center; margin: 0 0 6px; }
.count-badge { min-width: 24px; padding: 2px 8px; border-radius: 7px; font-size: 12px; font-weight: 700; background: #edf4ef; color: #587765; text-align: center; font-variant-numeric: tabular-nums; }
.section-description { color: var(--muted); margin: 0 0 18px; font-size: 14px; max-width: 800px; }
.empty-state { display: flex; align-items: center; gap: 14px; background: #f6f9f7; border: 1px dashed #dce7df; border-radius: 10px; padding: 18px 20px; margin: 18px 0; }
.empty-mark { position: relative; flex: 0 0 36px; width: 36px; height: 36px; border: 1px solid #dfebe3; border-radius: 10px; background: #edf4ef; }
.empty-mark::before { content: ""; position: absolute; inset: 10px 9px; border: 1.5px solid #9ab5a5; border-radius: 3px; }
.empty-mark::after { content: ""; position: absolute; width: 8px; height: 2px; left: 13px; top: 17px; background: #9ab5a5; border-radius: 2px; }
.empty-state strong { display: block; font-size: 14px; font-weight: 650; color: #405f50; }
.empty-state p { margin: 3px 0 0; color: #5e7568; font-size: 13px; }
.table-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; margin: 18px 0; }
table { display: table; width: 100%; border-collapse: collapse; margin: 0; background: #fff; font-size: 14px; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid #e8eeea; vertical-align: middle; overflow-wrap: anywhere; }
th { color: #6b7e73; font-size: 12px; font-weight: 650; background: #f5f8f6; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcfb; }
td form { margin: 0; max-width: none; }
.numeric { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.amount { font-weight: 700; }
.credit { color: #177650; }
.debit { color: #926045; }
.date-cell { color: #6b7f75; white-space: nowrap; font-size: 13px; }
.status-badge { display: inline-block; border-radius: 6px; padding: 4px 9px; font-size: 12px; white-space: nowrap; }
.status-badge.muted { color: #718078; background: #f0f3f1; }
form { max-width: 580px; margin: 20px 0 0; }
label { display: block; margin: 15px 0; color: #405c4e; font-size: 14px; font-weight: 550; }
input, select { display: block; width: 100%; min-height: 44px; margin-top: 6px; padding: 10px 12px; border: 1px solid #ccdcd2; border-radius: 8px; color: var(--ink); background: #fff; font-size: 15px; font-weight: 400; }
input:hover, select:hover { border-color: #a6beb0; }
input:focus, select:focus { border-color: #3c8d70; outline: 3px solid #e3f1e8; outline-offset: 1px; }
button { min-height: 42px; padding: 10px 17px; border: 1px solid transparent; border-radius: 8px; background: var(--green); color: #fff; font-weight: 650; font-size: 14px; cursor: pointer; }
button:hover { background: #115941; }
button:active { transform: translateY(1px); }
button.secondary { min-height: 34px; padding: 6px 11px; background: #fff; color: #557062; border-color: #dbe6df; font-size: 12px; font-weight: 550; }
button.secondary:hover { background: #f0f6f2; border-color: #b9cebf; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { flex: 0 0 17px; width: 17px; height: 17px; min-height: 0; margin: 2px 0 0; accent-color: var(--green); }
fieldset { min-width: 0; padding: 2px 16px; border: 1px solid #dbe6df; border-radius: 10px; }
legend { padding: 0 5px; color: #637c6c; font-size: 13px; }
details { border: 1px solid #dfe9e2; border-radius: 9px; background: #fff; padding: 14px 16px; margin: 12px 0; }
summary { cursor: pointer; font-size: 14px; font-weight: 650; }
details[open] > summary { margin-bottom: 18px; }
details.add-form { margin: 16px 0 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.add-form > summary { display: inline-flex; align-items: center; gap: 8px; list-style: none; padding: 8px 12px; border: 1px solid #c7ded0; background: #f2f8f4; border-radius: 8px; color: #2c7554; font-size: 13px; }
.add-form > summary::-webkit-details-marker { display: none; }
.add-form > summary::before { content: "+"; font-size: 18px; line-height: 1; font-weight: 400; }
.add-form[open] > summary::before { content: "−"; }
.add-form > summary:hover { border-color: #8fbaa2; background: #e9f4ed; }
.add-form[open] > form { margin-top: 0; padding: 2px 20px 20px; border: 1px solid #e3ece6; border-radius: 10px; background: #fafcfb; }
.answer-card { border-color: var(--line); }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #f5f8f6; padding: 15px; border-radius: 8px; color: #43604f; font: inherit; font-size: 14px; }
.notice { padding: 18px 20px; margin: 0 0 22px; border: 1px solid #e4d6a6; border-radius: 12px; background: #fffae9; color: #706037; overflow-wrap: anywhere; font-size: 14px; }
.notice p { margin: 6px 0 12px; }
code { display: inline-block; max-width: 100%; font-size: 13px; word-break: break-all; }
.balance { margin: 26px 0 22px; padding: 28px 32px; border-radius: 16px; background: #1d5d49; color: #fff; font-size: 64px; line-height: 1.1; font-weight: 750; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.balance small { display: block; margin-top: 8px; color: #d1e8d9; font-size: 16px; font-weight: 450; letter-spacing: 0; }
.auth-page { max-width: 460px; margin-top: 64px; padding: 32px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 8px 30px #1a553a05; }
.auth-page h1 { font-size: 29px; }
.auth-page > p { color: var(--muted); font-size: 14px; margin-top: 16px; }
.auth-page > form { margin-top: 24px; }
.auth-page form > button { width: 100%; margin-top: 8px; }
footer { width: min(100% - 56px, 1120px); margin: 28px auto 0; padding: 22px 0 30px; border-top: 1px solid var(--line); color: #83958a; font-size: 13px; }
@media (max-width: 720px) {
    header { min-height: 0; padding: 18px 20px; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
    header > a { font-size: 20px; }
    .account-nav { width: 100%; gap: 4px; }
    .account-name { flex-basis: 100%; margin: 0 0 5px; font-size: 13px; }
    .account-nav > a { padding: 7px 10px; font-size: 13px; }
    .account-nav form { margin-left: auto; }
    main { width: calc(100% - 32px); margin-top: 26px; }
    h1 { font-size: 28px; }
    .page-description { font-size: 14px; margin-bottom: 18px; }
    .section-nav { gap: 6px; margin-bottom: 20px; }
    .section-nav a { font-size: 12px; padding: 6px 10px; }
    .panel { padding: 20px 16px; border-radius: 12px; margin-bottom: 16px; }
    h2 { font-size: 18px; }
    .section-description { font-size: 13px; margin-bottom: 16px; }
    .empty-state { align-items: flex-start; gap: 12px; padding: 16px 12px; }
    .empty-mark { flex-basis: 32px; width: 32px; height: 32px; }
    .empty-mark::before { inset: 9px 8px; }
    .empty-mark::after { left: 11px; top: 15px; }
    th, td { padding: 12px; }
    .table-scroll table { min-width: 520px; }
    .table-scroll:has(th:nth-child(2):last-child) table { min-width: 300px; }
    .add-form[open] > form { padding: 2px 14px 16px; }
    .balance { font-size: 54px; padding: 24px; }
    .auth-page { max-width: 460px; margin-top: 30px; padding: 24px; }
    footer { width: calc(100% - 32px); margin-top: 24px; }
}
@media (prefers-reduced-motion: no-preference) {
    button, a, input, select, summary { transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
}
