@font-face {
    font-family: "Ma Shan Zheng";
    src: url("/static/fonts/MaShanZheng-Regular.ttf") format("truetype");
    font-display: swap;
    font-style: normal;
    font-weight: 400;
}

:root {
    color-scheme: light;

    --paper: #f3ead9;
    --paper-deep: #e9dcc0;
    --surface: #fffcf6;
    --surface-soft: #f8f1e5;
    --surface-muted: #efe6d3;

    --ink: #4a3d2e;
    --ink-soft: #806e59;
    --ink-faint: #a4937c;

    --line: #d8c9a3;
    --line-strong: #c7a572;
    --kraft: #c7a572;
    --kraft-dark: #876541;

    --income: #4f7a5e;
    --income-soft: #93c3ae;
    --expense: #b8463a;
    --expense-soft: #eba39c;
    --warning: #d4a23c;
    --warning-soft: #ecc463;

    --overlay: rgba(45, 37, 29, 0.46);
    --shadow-small: 0 2px 8px rgba(74, 61, 46, 0.09);
    --shadow-medium: 0 7px 22px rgba(74, 61, 46, 0.13);
    --shadow-modal: 0 22px 60px rgba(36, 29, 22, 0.28);

    --radius-small: 4px;
    --radius-medium: 8px;
    --control-height: 44px;

    --focus-ring: 0 0 0 3px rgba(199, 165, 114, 0.3);
}

body.dark {
    color-scheme: dark;

    --paper: #25221d;
    --paper-deep: #191714;
    --surface: #34302a;
    --surface-soft: #3a352f;
    --surface-muted: #464038;

    --ink: #eee5d7;
    --ink-soft: #c2b39d;
    --ink-faint: #9d8f7b;

    --line: #625642;
    --line-strong: #8c704d;
    --kraft: #a58760;
    --kraft-dark: #d0ab78;

    --income: #8bc3a2;
    --income-soft: #5d9274;
    --expense: #ef8278;
    --expense-soft: #b95c55;
    --warning: #e0b552;
    --warning-soft: #9c772e;

    --overlay: rgba(0, 0, 0, 0.64);
    --shadow-small: 0 2px 9px rgba(0, 0, 0, 0.22);
    --shadow-medium: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-modal: 0 22px 60px rgba(0, 0, 0, 0.48);

    --focus-ring: 0 0 0 3px rgba(165, 135, 96, 0.35);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--paper-deep);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    min-width: 280px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding:
        max(16px, env(safe-area-inset-top))
        max(10px, env(safe-area-inset-right))
        max(24px, env(safe-area-inset-bottom))
        max(10px, env(safe-area-inset-left));
    overflow-x: hidden;

    background-color: var(--paper);
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(147, 113, 74, 0.055) 0,
            rgba(147, 113, 74, 0.055) 1px,
            transparent 1px,
            transparent 26px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(147, 113, 74, 0.045) 0,
            rgba(147, 113, 74, 0.045) 1px,
            transparent 1px,
            transparent 26px
        );

    color: var(--ink);
    font-family:
        "Segoe UI",
        "Microsoft YaHei",
        "Noto Sans CJK SC",
        "Noto Sans SC",
        system-ui,
        -apple-system,
        sans-serif;
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

body.dark {
    background-color: var(--paper);
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(202, 173, 128, 0.035) 0,
            rgba(202, 173, 128, 0.035) 1px,
            transparent 1px,
            transparent 26px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(202, 173, 128, 0.03) 0,
            rgba(202, 173, 128, 0.03) 1px,
            transparent 1px,
            transparent 26px
        );
}

button,
input,
select,
textarea {
    font: inherit;
    letter-spacing: 0;
}

button,
select,
input[type="date"],
input[type="time"],
input[type="checkbox"] {
    touch-action: manipulation;
}

button {
    -webkit-tap-highlight-color: transparent;
}

button,
input,
select {
    max-width: 100%;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.46;
}

input::placeholder,
textarea::placeholder {
    color: var(--ink-faint);
    opacity: 1;
}

input[type="number"] {
    font-variant-numeric: tabular-nums;
}

input[type="date"],
input[type="time"] {
    min-width: 0;
}

input[type="date"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value {
    text-align: left;
}

input[type="search"] {
    -webkit-appearance: none;
    appearance: none;
}

input[type="search"]::-webkit-search-cancel-button {
    cursor: pointer;
}

::selection {
    background: rgba(236, 196, 99, 0.48);
    color: var(--ink);
}

::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background: var(--kraft);
}

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

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}

.header-area {
    margin-bottom: 26px;
    text-align: center;
    animation: card-enter 0.45s ease both;
}

.header-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.header-area h1 {
    min-width: 0;
    margin: 0 0 5px;
    color: var(--ink);
    font-family: "Ma Shan Zheng", cursive;
    font-size: 2.5rem;
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: 0;
    overflow-wrap: anywhere;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.55);
}

body.dark .header-area h1 {
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.42);
}

.header-area .greeting {
    min-height: 21px;
    margin-bottom: 2px;
    color: var(--ink-soft);
    font-size: 13px;
}

.header-area .subtitle {
    color: var(--ink-soft);
    font-size: 12px;
    opacity: 0.9;
}

.header-area .divider {
    width: 66px;
    height: 8px;
    margin: 12px auto 0;
    border-radius: 2px;
    background:
        repeating-linear-gradient(
            45deg,
            var(--expense-soft),
            var(--expense-soft) 6px,
            rgba(255, 255, 255, 0.42) 6px,
            rgba(255, 255, 255, 0.42) 12px
        );
    transform: rotate(-1deg);
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--control-height);
    height: var(--control-height);
    min-width: var(--control-height);
    min-height: var(--control-height);
    flex: 0 0 var(--control-height);
    padding: 0;
    border: 1.5px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-small);
    cursor: pointer;
    font-size: 19px;
    line-height: 1;
    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        transform 0.18s ease;
}

.icon-button:hover {
    border-color: var(--kraft);
    background: var(--surface-soft);
}

.icon-button:active {
    transform: scale(0.96);
}

.card-animate {
    animation: card-enter 0.5s ease both;
}

@keyframes card-enter {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    position: relative;
    width: 100%;
    margin-bottom: 24px;
    padding: 22px 18px;
    overflow: visible;
    border: 1px solid rgba(147, 113, 74, 0.27);
    border-radius: var(--radius-medium);
    background: var(--surface);
    box-shadow: var(--shadow-medium);
}

.card::before {
    content: "";
    position: absolute;
    z-index: 2;
    top: -9px;
    left: 50%;
    width: 68px;
    height: 19px;
    border-radius: 2px;
    background:
        repeating-linear-gradient(
            45deg,
            var(--expense-soft),
            var(--expense-soft) 6px,
            rgba(255, 255, 255, 0.44) 6px,
            rgba(255, 255, 255, 0.44) 12px
        );
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    opacity: 0.9;
    transform: translateX(-50%) rotate(-2deg);
}

.card h4 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 15px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 650;
    line-height: 1.4;
}

.stats-card::before {
    background:
        repeating-linear-gradient(
            45deg,
            var(--income-soft),
            var(--income-soft) 6px,
            rgba(255, 255, 255, 0.44) 6px,
            rgba(255, 255, 255, 0.44) 12px
        );
    transform: translateX(-50%) rotate(2deg);
}

.target-card::before {
    background:
        repeating-linear-gradient(
            45deg,
            var(--warning-soft),
            var(--warning-soft) 6px,
            rgba(255, 255, 255, 0.44) 6px,
            rgba(255, 255, 255, 0.44) 12px
        );
}

.target-card h4 {
    color: var(--kraft-dark);
}

.balance-section {
    padding: 23px 16px 25px;
    overflow: visible;
    border: 2px dashed var(--kraft);
    background: var(--surface);
    text-align: center;
}

.balance-section::before {
    display: none;
}

.balance-section .stamp-corner {
    position: absolute;
    top: -14px;
    right: 10px;
    font-size: 22px;
    opacity: 0.55;
    transform: rotate(8deg);
}

.balance-content {
    position: relative;
    z-index: 1;
}

.balance-section h4 {
    display: inline-block;
    margin: 0 auto 13px;
    padding: 4px 16px;
    border-radius: 3px;
    background: var(--warning-soft);
    color: #493b29;
    font-size: 12px;
    font-weight: 650;
    transform: rotate(-1deg);
}

body.dark .balance-section h4 {
    color: #201b15;
}

.stamp-badge {
    display: inline-block;
    max-width: 100%;
    padding: 9px 22px;
    border: 3px double var(--expense);
    border-radius: var(--radius-medium);
    box-shadow: inset 0 0 0 2px rgba(184, 70, 58, 0.11);
    transform: rotate(-2deg);
}

.stamp-badge h2 {
    max-width: 100%;
    min-height: 44px;
    margin: 0;
    color: var(--expense);
    font-size: 2.25rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.stamp-badge.deficit {
    border-color: var(--expense);
    background: rgba(184, 70, 58, 0.08);
    box-shadow:
        inset 0 0 0 2px rgba(184, 70, 58, 0.15),
        0 0 14px rgba(184, 70, 58, 0.2);
    animation: deficit-pulse 2s ease-in-out infinite;
}

.stamp-badge.deficit h2 {
    color: var(--expense);
}

@keyframes deficit-pulse {
    0%,
    100% {
        box-shadow:
            inset 0 0 0 2px rgba(184, 70, 58, 0.15),
            0 0 10px rgba(184, 70, 58, 0.16);
    }

    50% {
        box-shadow:
            inset 0 0 0 2px rgba(184, 70, 58, 0.24),
            0 0 19px rgba(184, 70, 58, 0.3);
    }
}

.balance-label {
    display: table;
    margin: 13px auto 0;
    padding: 3px 12px;
    border-radius: 8px;
    background: rgba(199, 165, 114, 0.18);
    color: var(--ink-soft);
    font-size: 11px;
}

.balance-label.deficit {
    background: rgba(184, 70, 58, 0.14);
    color: var(--expense);
}

.summary-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.summary-item {
    position: relative;
    min-width: 0;
    min-height: 103px;
    padding: 17px 12px;
    overflow: hidden;
    border: 1px solid rgba(147, 113, 74, 0.24);
    border-radius: var(--radius-medium);
    background: var(--surface);
    box-shadow: var(--shadow-small);
    text-align: center;
}

.summary-item.income {
    border-bottom: 4px solid var(--income-soft);
}

.summary-item.expense {
    border-bottom: 4px solid var(--expense-soft);
}

.summary-item .icon-bg {
    position: absolute;
    right: -4px;
    bottom: -10px;
    font-size: 39px;
    opacity: 0.09;
    pointer-events: none;
}

.summary-item .label {
    position: relative;
    margin-bottom: 7px;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 550;
}

.summary-item .value {
    position: relative;
    min-height: 30px;
    color: var(--ink);
    font-size: 1.25rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.summary-item.income .value {
    color: var(--income);
}

.summary-item.expense .value {
    color: var(--expense);
}

.stats-toggle {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 14px;
}

.stats-toggle button {
    min-width: 0;
    min-height: var(--control-height);
    padding: 7px 4px;
    overflow: hidden;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-medium);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        color 0.18s ease;
}

.stats-toggle button:hover {
    border-color: var(--kraft);
    background: var(--surface-soft);
}

.stats-toggle button.active {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--paper);
}

body.dark .stats-toggle button.active {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--paper-deep);
}

.stats-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 17px;
}

.donut-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.donut-chart {
    position: relative;
    width: 128px;
    height: 128px;
    min-width: 128px;
    flex: 0 0 128px;
    border-radius: 50%;
    background: var(--surface-muted);
    box-shadow: inset 0 0 0 1px rgba(147, 113, 74, 0.15);
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    width: 69px;
    height: 69px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: inset 0 2px 7px rgba(74, 61, 46, 0.09);
    transform: translate(-50%, -50%);
}

.donut-total-label {
    color: var(--ink-soft);
    font-size: 10px;
}

.donut-total-value {
    max-width: 62px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.donut-legend {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 7px;
}

.donut-legend-item {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    color: var(--ink-soft);
    font-size: 12px;
}

.donut-legend-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 3px;
}

.donut-legend-text {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.donut-legend-val {
    flex: 0 0 auto;
    color: var(--ink);
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.chart-container {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
}

.chart-bar-item {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: 66px minmax(0, 1fr) 76px;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.chart-bar-item .cat-name {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-weight: 550;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chart-bar-item .bar-track {
    height: 23px;
    overflow: hidden;
    border-radius: 7px;
    background: var(--surface-muted);
    box-shadow: inset 0 1px 3px rgba(74, 61, 46, 0.08);
}

.chart-bar-item .bar-fill {
    display: flex;
    width: 0;
    min-width: 2px;
    height: 100%;
    align-items: center;
    padding-left: 7px;
    overflow: hidden;
    border-radius: 7px;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    transition: width 0.55s ease;
}

.chart-bar-item .cat-amount {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 12px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trend-container {
    display: flex;
    width: 100%;
    gap: 8px;
    padding: 4px 2px 10px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.trend-month {
    display: flex;
    min-width: 54px;
    flex: 0 0 54px;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.trend-bar-col {
    display: flex;
    height: 105px;
    align-items: flex-end;
    gap: 3px;
}

.trend-bar {
    width: 17px;
    min-width: 17px;
    min-height: 4px;
    border-radius: 4px 4px 0 0;
    transition: height 0.45s ease;
}

.trend-bar.income {
    background: var(--income);
}

.trend-bar.expense {
    background: var(--expense);
}

.trend-sum {
    color: var(--ink-soft);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
    text-align: center;
}

.trend-month-label {
    color: var(--ink-soft);
    font-size: 11px;
}

#calendar-section {
    width: 100%;
}

.cal-month-nav {
    display: grid;
    grid-template-columns: 44px minmax(82px, 1fr) 44px;
    align-items: center;
    gap: 10px;
    max-width: 220px;
    margin: 0 auto 8px;
}

.cal-month-nav button,
.month-navigation button {
    display: inline-flex;
    width: var(--control-height);
    height: var(--control-height);
    min-width: var(--control-height);
    min-height: var(--control-height);
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-medium);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font-size: 15px;
}

.cal-month-nav button:hover,
.month-navigation button:hover {
    border-color: var(--kraft);
    background: var(--surface-soft);
}

.cal-month-label {
    min-width: 0;
    color: var(--ink);
    font-size: 14px;
    font-weight: 650;
    text-align: center;
}

.calendar-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    padding: 5px 0 0;
}

.calendar-grid .cal-day-header {
    min-width: 0;
    padding: 4px 0;
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 650;
    text-align: center;
}

.calendar-grid .cal-cell {
    position: relative;
    display: flex;
    min-width: 0;
    aspect-ratio: 1;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(147, 113, 74, 0.1);
    border-radius: 4px;
    color: var(--ink);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.calendar-grid .cal-cell.empty {
    border-color: transparent;
    background: transparent;
}

.calendar-grid .cal-cell .cal-tip {
    position: absolute;
    z-index: 10;
    bottom: calc(100% + 5px);
    left: 50%;
    display: none;
    padding: 4px 7px;
    border-radius: 4px;
    background: var(--ink);
    color: var(--paper);
    box-shadow: var(--shadow-small);
    font-size: 10px;
    pointer-events: none;
    transform: translateX(-50%);
    white-space: nowrap;
}

.calendar-grid .cal-cell:hover .cal-tip {
    display: block;
}

.budget-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-top: 2px;
}

.budget-row input {
    min-height: var(--control-height);
    font-size: 16px;
}

.budget-row button {
    flex: 0 0 auto;
    min-height: var(--control-height);
}

.budget-bar-wrap {
    width: 100%;
    height: 14px;
    margin: 0;
    overflow: hidden;
    border-radius: 7px;
    background: var(--surface-muted);
    box-shadow: inset 0 2px 4px rgba(74, 61, 46, 0.1);
}

.budget-bar-fill {
    width: 0;
    height: 100%;
    border-radius: 7px;
    background: var(--income);
    transition: width 0.55s ease;
}

.budget-bar-fill.warn {
    background: var(--warning);
}

.budget-bar-fill.danger {
    background: var(--expense);
}

.budget-text {
    color: var(--ink-soft);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    line-height: 1.5;
}

.input-group {
    display: flex;
    align-items: stretch;
    gap: 9px;
    margin-bottom: 14px;
}

.input-icon-wrapper {
    position: relative;
    min-width: 0;
}

.input-icon-wrapper .input-icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 12px;
    color: var(--ink-soft);
    font-size: 14px;
    pointer-events: none;
    transform: translateY(-50%);
}

.input-icon-wrapper input {
    padding-left: 36px;
}

input,
select,
textarea {
    min-height: var(--control-height);
    padding: 10px 12px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-medium);
    outline: none;
    background: var(--surface);
    color: var(--ink);
    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        box-shadow 0.18s ease;
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--kraft);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--kraft);
    box-shadow: var(--focus-ring);
}

body.dark input,
body.dark select,
body.dark textarea {
    background: var(--surface-soft);
}

select {
    cursor: pointer;
}

.btn-main {
    position: relative;
    display: inline-flex;
    min-height: var(--control-height);
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    overflow: hidden;
    border: 0;
    border-radius: var(--radius-medium);
    background: var(--ink);
    color: var(--paper);
    box-shadow: 0 3px 10px rgba(74, 61, 46, 0.18);
    cursor: pointer;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    transition:
        box-shadow 0.18s ease,
        opacity 0.18s ease,
        transform 0.12s ease;
}

body.dark .btn-main {
    color: var(--paper-deep);
}

.btn-main:hover {
    box-shadow: 0 5px 14px rgba(74, 61, 46, 0.25);
}

.btn-main:active {
    transform: scale(0.98);
}

.btn-add {
    width: 100%;
    min-height: 48px;
    margin-top: 10px;
    background: var(--expense);
    color: #ffffff;
    font-size: 15px;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.34);
    pointer-events: none;
    transform: scale(0);
    animation: ripple-animation 0.55s ease-out;
}

@keyframes ripple-animation {
    to {
        opacity: 0;
        transform: scale(4);
    }
}

.progress-container {
    position: relative;
    width: 100%;
    height: 18px;
    margin-bottom: 8px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--surface-muted);
    box-shadow: inset 0 2px 4px rgba(74, 61, 46, 0.1);
}

.progress-bar {
    position: relative;
    width: 0;
    height: 100%;
    border-radius: 8px;
    background: var(--income);
    transition: width 0.65s ease;
}

.progress-bar::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 18px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.32)
    );
}

.surplus-box {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 13px 14px;
    border: 1.5px dashed var(--kraft);
    border-radius: var(--radius-medium);
    background: rgba(236, 196, 99, 0.14);
}

.surplus-box > span {
    min-width: 0;
    color: var(--ink-soft);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.surplus-box .tag {
    color: var(--kraft-dark);
    font-weight: 700;
}

.surplus-box b {
    flex: 0 0 auto;
    color: var(--kraft-dark);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
    text-align: right;
}

.form-primary-row {
    display: grid;
    grid-template-columns: minmax(104px, 0.8fr) minmax(0, 2fr);
    gap: 9px;
    margin-bottom: 10px;
}

.form-primary-row > *,
.preset-primary-row > * {
    min-width: 0;
    width: 100%;
}

.form-primary-row input,
.form-primary-row select,
.preset-primary-row input,
.preset-primary-row select {
    width: 100%;
}

.date-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 9px;
    margin-bottom: 10px;
}

.date-row > * {
    min-width: 0;
}

.preset-primary-row {
    display: grid;
    grid-template-columns: minmax(90px, 0.8fr) minmax(0, 2fr);
    gap: 8px;
    margin-bottom: 8px;
}

.preset-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.preset-options label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--ink-soft);
    cursor: pointer;
    font-size: 13px;
}

.preset-options input[type="checkbox"] {
    width: 21px;
    height: 21px;
    min-height: 21px;
    margin: 0;
    padding: 0;
    accent-color: var(--kraft-dark);
}

.preset-options input[type="number"] {
    width: 58px;
    min-width: 58px;
    min-height: 40px;
    padding: 7px;
    text-align: center;
}

#preset-list {
    align-items: stretch;
}

.preset-btn {
    position: relative;
    min-height: var(--control-height);
    max-width: 100%;
    color: var(--ink) !important;
    line-height: 1.35;
    overflow-wrap: anywhere;
    touch-action: manipulation;
}

.preset-del {
    display: inline-flex;
    width: 26px;
    height: 26px;
    align-items: center;
    justify-content: center;
    margin-left: 5px !important;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 3px 0 13px 6px;
    color: var(--ink);
    font-family: "Ma Shan Zheng", cursive;
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 0;
}

.section-title::after {
    content: "";
    height: 1px;
    min-width: 24px;
    flex: 1;
    background:
        repeating-linear-gradient(
            90deg,
            var(--line) 0,
            var(--line) 4px,
            transparent 4px,
            transparent 8px
        );
}

.month-navigation {
    display: grid;
    grid-template-columns: 44px minmax(105px, 1fr) 44px;
    align-items: center;
    gap: 8px;
    max-width: 240px;
    margin: 0 auto 12px;
}

.month-navigation span {
    min-width: 0;
    color: var(--ink);
    font-size: 14px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.filter-bar {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.filter-bar input {
    min-width: 128px;
    flex: 1 1 150px;
}

.filter-bar select {
    min-width: 100px;
    flex: 0 1 auto;
}

.time-filter-box {
    width: 100%;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: var(--radius-medium);
    background: rgba(199, 165, 114, 0.08);
}

.filter-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 9px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 650;
}

.toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 15px;
}

.toolbar button {
    display: inline-flex;
    width: 100%;
    min-width: 0;
    min-height: var(--control-height);
    align-items: center;
    justify-content: center;
    padding: 8px 7px;
    border: 1.5px dashed var(--line);
    border-radius: var(--radius-medium);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    overflow-wrap: anywhere;
}

.toolbar button:hover {
    border-color: var(--kraft);
    background: var(--surface-soft);
}

.list {
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.date-group-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 14px;
    align-items: center;
    gap: 7px;
    margin: 14px 0 8px;
    padding: 10px 11px;
    border-radius: var(--radius-small);
    background: rgba(199, 165, 114, 0.14);
    color: var(--ink-soft);
    cursor: pointer;
    font-size: 12px;
    font-weight: 650;
    user-select: none;
}

.date-group-header:first-child {
    margin-top: 4px;
}

.date-group-header > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.date-group-header .day-total {
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.date-group-header .arrow {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.date-group-header.collapsed .arrow {
    transform: rotate(-90deg);
}

.date-group-content {
    max-height: 100000px;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.date-group-content.collapsed {
    max-height: 0 !important;
}

.list li {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    padding: 12px;
    border: 1px solid rgba(147, 113, 74, 0.15);
    border-left: 4px solid var(--line);
    border-radius: var(--radius-medium);
    background: var(--surface);
    box-shadow: var(--shadow-small);
    animation: list-enter 0.3s ease both;
}

@keyframes list-enter {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.list li.li-plus {
    border-left-color: var(--income);
}

.list li.li-minus {
    border-left-color: var(--expense);
}

.record-info {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 3px;
}

.record-name-row {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
}

.record-emoji {
    flex: 0 0 auto;
    font-size: 18px;
}

.record-name {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.record-type-badge {
    flex: 0 0 auto;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.record-type-badge.income-badge {
    background: rgba(79, 122, 94, 0.14);
    color: var(--income);
}

.record-type-badge.expense-badge {
    background: rgba(184, 70, 58, 0.12);
    color: var(--expense);
}

.record-time {
    min-height: 16px;
    color: var(--ink-soft);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.record-note {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: var(--ink-soft);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.record-actions {
    display: flex;
    min-width: 0;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
}

.record-actions b {
    max-width: 120px;
    overflow: hidden;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.edit-btn,
.copy-btn,
.delete-btn {
    display: inline-flex;
    min-width: 46px;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    touch-action: manipulation;
}

.edit-btn {
    background: rgba(147, 113, 74, 0.15);
    color: var(--kraft-dark);
}

.copy-btn {
    background: rgba(79, 122, 94, 0.13);
    color: var(--income);
}

.delete-btn {
    background: rgba(184, 70, 58, 0.12);
    color: var(--expense);
}

.edit-btn:hover {
    background: rgba(147, 113, 74, 0.25);
}

.copy-btn:hover {
    background: rgba(79, 122, 94, 0.23);
}

.delete-btn:hover {
    background: rgba(184, 70, 58, 0.22);
}

.empty-state {
    display: flex !important;
    min-height: 190px;
    flex-direction: column;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    padding: 32px 14px !important;
    border-left-color: var(--line) !important;
    background: rgba(199, 165, 114, 0.08) !important;
    color: var(--ink-soft);
    text-align: center;
}

.empty-state .empty-icon {
    margin-bottom: 3px;
    font-size: 38px;
}

.empty-state .empty-text {
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
}

.empty-state .empty-hint {
    color: var(--ink-soft);
    font-size: 12px;
}

.pagination {
    display: flex;
    width: 100%;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
    padding: 5px 0;
}

.pagination button {
    display: inline-flex;
    min-width: var(--control-height);
    min-height: var(--control-height);
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-medium);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.pagination button:hover:not(:disabled) {
    border-color: var(--kraft);
    background: var(--surface-soft);
}

.pagination button.active {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--paper);
}

body.dark .pagination button.active {
    color: var(--paper-deep);
}

.pagination .page-info {
    display: inline-flex;
    min-height: var(--control-height);
    align-items: center;
    color: var(--ink-soft);
    font-size: 13px;
}

.modal-overlay {
    position: fixed;
    z-index: 999;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding:
        max(16px, env(safe-area-inset-top))
        max(16px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom))
        max(16px, env(safe-area-inset-left));
    background: var(--overlay);
    overscroll-behavior: contain;
}

@supports (backdrop-filter: blur(5px)) {
    .modal-overlay {
        backdrop-filter: blur(5px);
    }
}

.modal-overlay.show {
    display: flex;
}

.modal {
    position: relative;
    width: 100%;
    max-width: 360px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    padding: 27px 20px 20px;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid rgba(147, 113, 74, 0.28);
    border-radius: var(--radius-medium);
    background: var(--surface);
    box-shadow: var(--shadow-modal);
    text-align: center;
    animation: modal-enter 0.24s ease both;
}

.modal::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 50%;
    width: 62px;
    height: 18px;
    border-radius: 2px;
    background:
        repeating-linear-gradient(
            45deg,
            var(--warning-soft),
            var(--warning-soft) 6px,
            rgba(255, 255, 255, 0.44) 6px,
            rgba(255, 255, 255, 0.44) 12px
        );
    transform: translateX(-50%) rotate(-2deg);
}

@keyframes modal-enter {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal h3 {
    margin: 0 0 10px;
    color: var(--ink);
    font-size: 18px;
    line-height: 1.4;
}

.modal p {
    margin: 0 0 18px;
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.modal-btns {
    display: flex;
    width: 100%;
    gap: 9px;
}

.modal-btns button {
    display: inline-flex;
    min-width: 0;
    min-height: 46px;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 0;
    border-radius: var(--radius-medium);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.modal-btns .cancel-btn {
    background: var(--surface-muted);
    color: var(--ink);
}

.modal-btns .confirm-btn {
    background: var(--expense);
    color: #ffffff;
}

.modal-btns .save-btn {
    background: var(--income);
    color: #ffffff;
}

.modal-btns .cancel-btn:hover {
    filter: brightness(0.97);
}

.modal-btns .confirm-btn:hover,
.modal-btns .save-btn:hover {
    filter: brightness(1.05);
}

.edit-form {
    width: 100%;
    text-align: left;
}

.edit-form label {
    display: block;
    margin: 11px 0 4px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 600;
}

.edit-form input,
.edit-form select {
    width: 100%;
}

.settle-field {
    margin: 17px 0;
}

.settle-field label {
    display: block;
    margin-bottom: 6px;
    color: var(--ink-soft);
    font-size: 13px;
}

.settle-field input {
    width: 100%;
    min-height: 50px;
    text-align: center;
    font-size: 20px;
    font-variant-numeric: tabular-nums;
}

.settle-preview {
    min-height: 44px;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: var(--radius-medium);
    background: rgba(199, 165, 114, 0.12);
    color: var(--ink-soft);
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.toast {
    position: fixed;
    z-index: 1100;
    top: max(14px, env(safe-area-inset-top));
    left: 50%;
    width: max-content;
    max-width: calc(100vw - 28px);
    max-height: 45vh;
    padding: 12px 17px;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid rgba(147, 113, 74, 0.24);
    border-radius: var(--radius-medium);
    background: var(--warning-soft);
    color: #493b29;
    box-shadow: var(--shadow-medium);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.5;
    opacity: 0;
    pointer-events: none;
    text-align: center;
    transform: translate(-50%, -70px);
    transition:
        opacity 0.24s ease,
        transform 0.24s ease;
    overflow-wrap: anywhere;
}

body.dark .toast {
    background: #6f5734;
    color: #fff4df;
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.toast-undo {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    margin-left: 6px;
    padding: 4px 8px;
    color: var(--expense);
    cursor: pointer;
    font-weight: 800;
    text-decoration: underline;
}

.footer {
    padding:
        29px
        10px
        max(14px, env(safe-area-inset-bottom));
    color: var(--ink-soft);
    font-size: 12px;
    text-align: center;
}

.footer-leaf {
    display: block;
    margin-bottom: 8px;
    font-size: 18px;
}

.footer-line {
    width: 42px;
    height: 1px;
    margin: 8px auto;
    background:
        repeating-linear-gradient(
            90deg,
            var(--line) 0,
            var(--line) 4px,
            transparent 4px,
            transparent 8px
        );
}

.footer-text {
    line-height: 1.6;
}

.number-pop {
    animation: number-pop 0.25s ease;
}

@keyframes number-pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.04);
    }

    100% {
        transform: scale(1);
    }
}

/* Compatibility with older HTML versions. */
.falling-leaf,
.bokeh-particle {
    display: none !important;
}

/* Default Android and narrow mobile layout. */
@media (max-width: 600px) {
    body {
        padding:
            max(12px, env(safe-area-inset-top))
            max(7px, env(safe-area-inset-right))
            max(20px, env(safe-area-inset-bottom))
            max(7px, env(safe-area-inset-left));
    }

    input,
    select,
    textarea {
        font-size: 16px;
    }

    .header-area {
        margin-bottom: 22px;
    }

    .header-area h1 {
        font-size: 2.15rem;
    }

    .card {
        margin-bottom: 21px;
        padding: 20px 15px;
    }

    .balance-section {
        padding: 21px 13px 23px;
    }

    .stamp-badge {
        max-width: calc(100% - 8px);
        padding: 8px 15px;
    }

    .stamp-badge h2 {
        font-size: 2rem;
    }

    .stats-toggle {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .donut-section {
        align-items: flex-start;
    }

    .chart-bar-item {
        grid-template-columns: 58px minmax(0, 1fr) 70px;
        gap: 6px;
    }

    .form-primary-row {
        grid-template-columns: 105px minmax(0, 1fr);
    }

    .preset-primary-row {
        grid-template-columns: 90px minmax(0, 1fr);
    }

    .filter-bar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(104px, 0.55fr);
    }

    .filter-bar input,
    .filter-bar select {
        width: 100%;
        min-width: 0;
    }

    .filter-bar input:first-child {
        grid-column: 1 / -1;
    }

    .time-filter-box .filter-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .time-filter-box .filter-bar input:first-child {
        grid-column: auto;
    }

    .time-filter-box #filter-amount-min {
        grid-column: 1 / -1;
    }

    .toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .date-group-header {
        grid-template-columns: minmax(0, 1fr) 14px;
    }

    .date-group-header .day-total {
        grid-column: 1 / -1;
        grid-row: 2;
        white-space: normal;
    }

    .date-group-header .arrow {
        grid-column: 2;
        grid-row: 1;
    }

    .list li {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 9px;
    }

    .record-info {
        width: 100%;
        flex-basis: 100%;
    }

    .record-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .record-actions b {
        display: inline-flex;
        min-height: var(--control-height);
        align-items: center;
        margin-right: auto;
    }

    .edit-btn,
    .copy-btn,
    .delete-btn {
        min-width: 50px;
        min-height: var(--control-height);
    }

    .modal-overlay {
        align-items: center;
        padding:
            max(12px, env(safe-area-inset-top))
            max(10px, env(safe-area-inset-right))
            max(12px, env(safe-area-inset-bottom))
            max(10px, env(safe-area-inset-left));
    }

    .modal {
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
    }
}

@media (max-width: 420px) {
    .container {
        max-width: 100%;
    }

    .header-title-row {
        gap: 7px;
    }

    .header-area h1 {
        font-size: 2rem;
    }

    .summary-row {
        gap: 8px;
    }

    .summary-item {
        min-height: 98px;
        padding: 15px 8px;
    }

    .summary-item .value {
        font-size: 1.05rem;
    }

    .donut-section {
        flex-direction: column;
        align-items: center;
    }

    .donut-legend {
        width: 100%;
    }

    .donut-legend-item {
        min-height: 25px;
    }

    .budget-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .surplus-box {
        align-items: flex-start;
        flex-direction: column;
    }

    .surplus-box b {
        width: 100%;
        text-align: left;
    }
}

@media (max-width: 360px) {
    body {
        min-width: 280px;
        padding-right: 5px;
        padding-left: 5px;
    }

    .card {
        padding-right: 12px;
        padding-left: 12px;
    }

    .header-area h1 {
        font-size: 1.8rem;
    }

    .icon-button {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
        flex-basis: 42px;
    }

    .stamp-badge h2 {
        font-size: 1.75rem;
    }

    .form-primary-row,
    .preset-primary-row,
    .date-row {
        grid-template-columns: 1fr;
    }

    .stats-toggle {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-bar,
    .time-filter-box .filter-bar {
        grid-template-columns: 1fr;
    }

    .filter-bar input:first-child,
    .time-filter-box .filter-bar input:first-child,
    .time-filter-box #filter-amount-min {
        grid-column: auto;
    }

    .toolbar {
        grid-template-columns: 1fr;
    }

    .chart-bar-item {
        grid-template-columns: 50px minmax(0, 1fr);
    }

    .chart-bar-item .cat-amount {
        grid-column: 2;
        text-align: left;
    }

    .record-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) repeat(3, 48px);
    }

    .record-actions b {
        min-width: 0;
        max-width: none;
    }

    .edit-btn,
    .copy-btn,
    .delete-btn {
        width: 48px;
        min-width: 48px;
        padding: 5px;
    }

    .modal-btns:not([style*="flex-direction"]) {
        flex-direction: column-reverse;
    }
}

@media (min-width: 720px) {
    body {
        padding-top: 28px;
        padding-bottom: 36px;
    }

    .container {
        max-width: 560px;
    }

    .card {
        padding: 24px 22px;
    }

    .toolbar {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (hover: hover) and (pointer: fine) {
    .card {
        transition:
            border-color 0.2s ease,
            box-shadow 0.2s ease,
            transform 0.2s ease;
    }

    .card:hover {
        border-color: rgba(147, 113, 74, 0.38);
        box-shadow: 0 9px 26px rgba(74, 61, 46, 0.16);
    }

    .summary-item {
        transition:
            box-shadow 0.2s ease,
            transform 0.2s ease;
    }

    .summary-item:hover {
        box-shadow: 0 6px 16px rgba(74, 61, 46, 0.14);
        transform: translateY(-1px);
    }

    .list li {
        transition:
            border-color 0.18s ease,
            box-shadow 0.18s ease,
            transform 0.18s ease;
    }

    .list li:hover {
        box-shadow: 0 5px 14px rgba(74, 61, 46, 0.12);
        transform: translateX(2px);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .stamp-badge.deficit {
        animation: none;
    }

    .progress-bar,
    .budget-bar-fill,
    .chart-bar-item .bar-fill,
    .trend-bar {
        transition: none;
    }
}

@media print {
    body {
        padding: 0;
        background: #ffffff;
        color: #000000;
    }

    .container {
        max-width: none;
    }

    .header-area,
    .card,
    .summary-item,
    .list li {
        box-shadow: none;
    }

    .card {
        break-inside: avoid;
        border: 1px solid #bbbbbb;
    }

    .header-area .divider,
    .card::before,
    .stamp-corner,
    .toolbar,
    .pagination,
    .icon-button,
    .edit-btn,
    .copy-btn,
    .delete-btn,
    .modal-overlay,
    .toast,
    form,
    #preset-list,
    .preset-options {
        display: none !important;
    }
}
