:root {
    font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    color: #25263a;
    background: #fff8f2;
    font-synthesis: none;
    --ink: #282b35;
    --muted: #777488;
    --paper: #fffdf9;
    --cream: #fff7f4;
    --line: #eadfe2;
    --navy: #292c36;
    --coral: #ed8e89;
    --coral-dark: #bd5b65;
    --mint: #9ab7a4;
    --yellow: #e5aa74;
    --lilac: #9a7aa8;
    --shadow: 0 18px 50px rgba(48, 38, 47, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    background: linear-gradient(135deg, #fff8f2 0%, #f6efe7 100%);
    color: var(--ink);
}

button,
input,
select,
textarea {
    font: inherit;
}

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

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    display: flex;
    flex: 0 0 270px;
    min-height: 100vh;
    padding: 28px 20px 24px;
    color: #fffaf4;
    background: var(--navy);
}

.nav-panel {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 64px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    overflow: hidden;
    place-items: center;
    padding: 2px;
    border: 2px solid var(--coral);
    border-radius: 14px;
    background: #f7c3a7;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-name strong {
    font-family: Fredoka, "Noto Sans TC", sans-serif;
    font-size: 1.2rem;
    letter-spacing: 0;
}

.brand-name span {
    color: #b9b9c9;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
}

.mobile-menu-toggle {
    display: none;
    border: 0;
    color: inherit;
    background: transparent;
    font-size: 1.3rem;
}

.primary-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-caption {
    margin: 0 12px 8px;
    color: #a9aabb;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
}

.nav-caption-secondary {
    margin-top: 28px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px 14px;
    border-radius: 10px;
    color: #d8d6e0;
    font-size: 0.92rem;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.nav-link:hover {
    transform: translateX(2px);
}

.nav-icon {
    width: 20px;
    color: #f7c3a7;
    font-size: 1.1rem;
    text-align: center;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: auto;
}

.local-storage-card {
    display: flex;
    gap: 12px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
}

.local-storage-card strong,
.local-storage-card span {
    display: block;
}

.local-storage-card strong {
    margin-bottom: 4px;
    font-size: 0.78rem;
}

.local-storage-card span {
    color: #aaaaba;
    font-size: 0.7rem;
}

.local-storage-icon {
    color: #f7c3a7 !important;
    font-size: 1.3rem !important;
}

.version-label {
    color: #8f90a2;
    font-size: 0.7rem;
}

.app-main {
    min-width: 0;
    flex: 1;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 76px;
    padding: 16px clamp(24px, 5vw, 72px);
    border-bottom: 1px solid rgba(234, 223, 214, 0.8);
    background: rgba(255, 253, 249, 0.78);
}

.topbar-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.76rem;
}

.topbar-status strong {
    color: var(--ink);
    font-size: 0.8rem;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mint);
}

.status-divider {
    width: 1px;
    height: 16px;
    margin: 0 3px;
    background: var(--line);
}

.topbar-message {
    flex: 1;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 16px;
    border: 0;
    border-radius: 9px;
    font-size: 0.82rem;
    font-weight: 700;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(189, 81, 70, 0.18);
}

.page-content {
    width: min(1260px, 100%);
    margin: 0 auto;
    padding: 48px clamp(24px, 5vw, 72px) 72px;
}

.page-enter {
    animation: page-enter 420ms ease both;
}

@keyframes page-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ichi-welcome {
    max-width: 820px;
    padding: 18px 0 42px;
}

.ichi-welcome h1,
.page-heading h1,
.editor-heading h1 {
    margin: 0;
    font-family: Fredoka, "Noto Sans TC", sans-serif;
    font-size: clamp(2.2rem, 5vw, 4.5rem);
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.12;
}

.ichi-welcome h1 em {
    color: var(--coral-dark);
    font-style: normal;
}

.page-subtitle {
    max-width: 560px;
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.8;
}

.welcome-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 26px;
}

.button-primary {
    color: #fff;
    background: var(--coral);
}

.button-large {
    min-height: 48px;
    padding-inline: 20px;
}

.welcome-note {
    color: var(--muted);
    font-size: 0.76rem;
}

.period-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
    padding: 15px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 253, 249, 0.68);
}

.period-label,
.period-actions,
.type-card-heading,
.type-card-footer,
.total-card-topline,
.total-card-footer,
.section-heading,
.category-row,
.editor-actions,
.backup-actions,
.danger-zone,
.backup-preview-heading,
.backup-preview-actions {
    display: flex;
    align-items: center;
}

.period-label {
    gap: 12px;
}

.period-icon {
    color: var(--coral-dark);
    font-size: 1.35rem;
}

.period-caption,
.card-label,
.card-overline,
.type-share,
.backup-status-label,
.field-hint,
.field-group label span {
    color: var(--muted);
    font-size: 0.7rem;
}

.period-caption,
.period-label strong {
    display: block;
}

.period-label strong {
    margin-top: 3px;
    font-size: 0.82rem;
}

.period-actions {
    gap: 4px;
    padding: 4px;
    border-radius: 9px;
    background: #f1e9e2;
}

.period-button {
    padding: 7px 12px;
    border: 0;
    border-radius: 7px;
    color: var(--muted);
    background: transparent;
    font-size: 0.76rem;
}

.period-button.is-active {
    color: var(--ink);
    background: var(--paper);
    box-shadow: 0 2px 7px rgba(48, 38, 47, 0.08);
}

.overview-grid {
    display: grid;
    grid-template-columns: 1.35fr repeat(3, 1fr);
    gap: 14px;
}

.total-card,
.type-card,
.surface-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 253, 249, 0.84);
    box-shadow: var(--shadow);
}

.total-card,
.type-card {
    min-height: 170px;
    padding: 20px;
}

.total-card {
    color: #fffaf4;
    border-color: var(--navy);
    background: var(--navy);
}

.total-card-topline,
.total-card-footer,
.type-card-heading,
.type-card-footer {
    justify-content: space-between;
}

.total-card .card-label,
.total-card .card-overline,
.total-note {
    color: #bebdcb;
}

.total-amount,
.type-amount {
    display: block;
    margin: 28px 0 20px;
    font-family: Fredoka, "Noto Sans TC", sans-serif;
    font-size: 1.65rem;
    font-weight: 600;
}

.total-arrow {
    color: #f7c3a7;
}

.type-card-heading {
    gap: 8px;
    justify-content: flex-start;
    color: var(--muted);
    font-size: 0.82rem;
}

.type-emblem {
    display: grid;
    width: 30px;
    height: 30px;
    margin-right: 3px;
    place-items: center;
    border-radius: 9px;
    background: #f7eee5;
}

.type-consumption .type-emblem {
    color: #c27c40;
}

.type-waste .type-emblem {
    color: var(--coral-dark);
}

.type-investment .type-emblem {
    color: var(--lilac);
}

.type-share {
    margin-left: auto;
}

.type-amount {
    margin: 25px 0 24px;
    color: var(--ink);
}

.type-card-footer {
    color: var(--muted);
    font-size: 0.72rem;
}

.mini-meter,
.category-bar {
    overflow: hidden;
    border-radius: 999px;
    background: #eee5dc;
}

.mini-meter {
    width: 45%;
    height: 5px;
}

.mini-meter span,
.category-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--coral);
}

.dashboard-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 18px;
}

.surface-card {
    padding: 24px;
}

.section-heading {
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 24px;
}

.section-heading h2,
.form-section-heading h2,
.danger-zone h2,
.backup-preview h3 {
    margin: 4px 0 0;
    font-size: 1.05rem;
}

.text-link {
    color: var(--coral-dark);
    font-size: 0.76rem;
    font-weight: 700;
}

.empty-state {
    display: grid;
    min-height: 170px;
    place-items: center;
    align-content: center;
    gap: 7px;
    color: var(--muted);
    text-align: center;
}

.empty-state strong {
    color: var(--ink);
    font-size: 0.85rem;
}

.empty-state span,
.empty-state p {
    margin: 0;
    font-size: 0.76rem;
}

.empty-mark {
    margin-bottom: 4px;
    color: var(--coral);
    font-size: 1.6rem !important;
}

.category-list,
.recent-list {
    display: grid;
    gap: 16px;
}

.category-row {
    gap: 12px;
}

.category-name {
    display: flex;
    align-items: center;
    flex: 0 0 76px;
    gap: 7px;
    font-size: 0.76rem;
}

.category-bullet {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--coral);
}

.category-bar {
    flex: 1;
    height: 7px;
}

.category-row strong {
    flex: 0 0 74px;
    font-size: 0.76rem;
    text-align: right;
}

.recent-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
}

.transaction-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 11px;
    background: #f7eee5;
}

.recent-details {
    display: grid;
    flex: 1;
    gap: 3px;
    min-width: 0;
}

.recent-details strong {
    overflow: hidden;
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-details span {
    color: var(--muted);
    font-size: 0.7rem;
}

.recent-amount {
    font-size: 0.78rem;
}

.heading-actions {
    display: flex;
    align-items: flex-end;
    gap: 14px;
}

.transaction-toolbar {
    margin-bottom: 18px;
    box-shadow: none;
}

.filter-heading,
.filter-actions,
.insight-row-heading,
.chart-legend,
.month-label {
    display: flex;
    align-items: center;
}

.filter-heading {
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.filter-heading h2 {
    margin: 4px 0 0;
    font-size: 1.05rem;
}

.filter-result,
.table-hint {
    color: var(--muted);
    font-size: 0.72rem;
}

.transaction-filters {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(120px, 1fr));
    gap: 12px;
}

.filter-actions {
    justify-content: space-between;
    gap: 14px;
    min-height: 40px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.transaction-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

.stat-card {
    display: grid;
    gap: 7px;
    min-height: 116px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 253, 249, 0.84);
}

.stat-card span,
.stat-card small {
    color: var(--muted);
    font-size: 0.7rem;
}

.stat-card strong {
    overflow: hidden;
    font-family: Fredoka, "Noto Sans TC", sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-card-accent {
    border-color: #e7c2b6;
    background: #fff3ed;
}

.stat-card-accent strong {
    color: var(--coral-dark);
}

.page-empty-state {
    min-height: 250px;
    box-shadow: none;
}

.page-empty-state .button {
    margin-top: 12px;
}

.transaction-table-card,
.insights-section,
.monthly-trend-section {
    box-shadow: none;
}

.transaction-list {
    display: grid;
}

.transaction-row {
    display: grid;
    grid-template-columns: 62px 40px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    min-height: 74px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.transaction-date {
    display: grid;
    gap: 2px;
    color: var(--muted);
    text-align: center;
}

.transaction-date strong {
    color: var(--ink);
    font-family: Fredoka, "Noto Sans TC", sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
}

.transaction-date span {
    font-size: 0.65rem;
}

.transaction-details {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.transaction-details strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-details span,
.transaction-details small {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-details small {
    color: #9b8d8c;
}

.transaction-amount {
    font-size: 0.8rem;
    white-space: nowrap;
}

.transaction-actions {
    display: flex;
    gap: 3px;
}

.transaction-actions .icon-button {
    width: 30px;
    height: 30px;
}

.insights-columns {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 18px;
    margin-top: 18px;
}

.insight-category-list,
.insight-type-list {
    display: grid;
    gap: 18px;
}

.insight-category-row,
.insight-type-row {
    display: grid;
    gap: 8px;
}

.insight-row-heading {
    justify-content: space-between;
    gap: 12px;
}

.insight-row-heading > strong {
    font-size: 0.76rem;
    white-space: nowrap;
}

.category-name,
.insight-type-label {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
    font-size: 0.78rem;
}

.insight-type-label .transaction-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.insight-bar {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #eee5dc;
}

.insight-bar span {
    display: block;
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    background: var(--coral);
}

.insight-bar span.type-consumption {
    background: #c27c40;
}

.insight-bar span.type-waste {
    background: var(--coral-dark);
}

.insight-bar span.type-investment {
    background: var(--lilac);
}

.insight-category-row small,
.insight-type-row small {
    color: var(--muted);
    font-size: 0.68rem;
}

.monthly-trend-section {
    margin-top: 18px;
}

.monthly-chart {
    display: grid;
    grid-template-columns: repeat(6, minmax(54px, 1fr));
    gap: 12px;
    align-items: end;
    min-height: 236px;
    padding: 12px 8px 0;
}

.month-column {
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 10px;
    min-width: 0;
    height: 220px;
}

.month-bar-track {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 0;
    border-bottom: 1px solid var(--line);
    background: repeating-linear-gradient(to top, transparent 0, transparent 48px, rgba(234, 223, 226, 0.55) 49px);
}

.month-bar {
    display: flex;
    width: min(42px, 72%);
    min-height: 0;
    flex-direction: column-reverse;
    overflow: hidden;
    border-radius: 7px 7px 0 0;
    background: #f1e9e2;
}

.month-bar-segment {
    display: block;
    width: 100%;
    min-height: 0;
}

.month-bar-segment.type-consumption {
    background: #c27c40;
}

.month-bar-segment.type-waste {
    background: var(--coral-dark);
}

.month-bar-segment.type-investment {
    background: var(--lilac);
}

.month-label {
    flex-direction: column;
    gap: 3px;
    text-align: center;
}

.month-label strong {
    font-size: 0.72rem;
}

.month-label small {
    color: var(--muted);
    font-size: 0.65rem;
}

.chart-legend {
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 0.7rem;
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-swatch {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--coral);
}

.legend-swatch.type-consumption {
    background: #c27c40;
}

.legend-swatch.type-waste {
    background: var(--coral-dark);
}

.legend-swatch.type-investment {
    background: var(--lilac);
}

.loading-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    min-height: 184px;
    padding: 22px 28px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 253, 249, 0.76);
    box-shadow: 0 12px 30px rgba(89, 61, 63, 0.05);
}

.loading-panel-illustration {
    position: relative;
    width: 116px;
    height: 116px;
    flex: 0 0 auto;
}

.loading-panel-illustration::before {
    position: absolute;
    right: 4px;
    bottom: 5px;
    left: 4px;
    height: 32px;
    border-radius: 50%;
    background: #f7c3a7;
    content: "";
    transform: rotate(-4deg);
}

.loading-panel-illustration img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: ichi-loading-bob 2.4s ease-in-out infinite;
}

.loading-panel-illustration > span {
    position: absolute;
    top: 2px;
    right: -1px;
    z-index: 1;
    color: var(--coral-dark);
    font-family: Fredoka, sans-serif;
    font-size: 1.5rem;
    transform: rotate(12deg);
}

.loading-panel-copy {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.loading-panel-copy strong {
    color: var(--ink);
    font-family: Fredoka, "Noto Sans TC", sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
}

.loading-panel-copy > span {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.6;
}

.loading-panel-dots {
    display: flex;
    gap: 5px;
    margin-top: 2px;
}

.loading-panel-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--coral);
    animation: ichi-loading-dot 1.2s ease-in-out infinite;
}

.loading-panel-dots span:nth-child(2) {
    background: var(--yellow);
    animation-delay: 120ms;
}

.loading-panel-dots span:nth-child(3) {
    background: var(--mint);
    animation-delay: 240ms;
}

.ichi-loading-screen {
    display: grid;
    min-height: 100vh;
    overflow: hidden;
    place-items: center;
    padding: 32px 20px;
    color: var(--ink);
    background-color: #fff8f2;
    background-image: linear-gradient(rgba(234, 223, 226, 0.3) 1px, transparent 1px), linear-gradient(90deg, rgba(234, 223, 226, 0.3) 1px, transparent 1px), linear-gradient(135deg, rgba(247, 195, 167, 0.18), transparent 48%), linear-gradient(315deg, rgba(154, 183, 164, 0.16), transparent 46%);
    background-size: 28px 28px, 28px 28px, auto, auto;
}

.ichi-loading-scene {
    position: relative;
    display: grid;
    justify-items: center;
    width: min(100%, 430px);
    text-align: center;
}

.ichi-loading-character {
    position: relative;
    width: min(58vw, 244px);
    aspect-ratio: 1;
}

.ichi-loading-character::before {
    position: absolute;
    right: 7%;
    bottom: 10%;
    left: 7%;
    height: 23%;
    border-radius: 50%;
    background: #f7c3a7;
    content: "";
    transform: rotate(-4deg);
}

.ichi-loading-character img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: ichi-loading-bob 2.4s ease-in-out infinite;
}

.ichi-loading-ring {
    position: absolute;
    inset: 12%;
    border: 1px dashed rgba(189, 91, 101, 0.3);
    border-radius: 50%;
    animation: ichi-loading-ring 7s linear infinite;
}

.ichi-loading-sticker {
    position: absolute;
    z-index: 2;
    color: var(--coral-dark);
    font-family: Fredoka, sans-serif;
    font-size: 1.8rem;
}

.ichi-loading-sticker-one {
    top: 18%;
    left: 12%;
    transform: rotate(-14deg);
}

.ichi-loading-sticker-two {
    top: 7%;
    right: 15%;
    color: var(--yellow);
    font-size: 1.3rem;
    transform: rotate(10deg);
}

.ichi-loading-note {
    position: absolute;
    top: 8%;
    left: 3%;
    z-index: 2;
    padding: 7px 11px;
    border: 1px solid #eadfe2;
    border-radius: 9px;
    color: #81544a;
    background: #fffdf9;
    box-shadow: 0 5px 14px rgba(89, 61, 63, 0.06);
    font-size: 0.68rem;
    transform: rotate(-5deg);
}

.ichi-loading-note::after {
    position: absolute;
    right: 10px;
    bottom: -5px;
    width: 9px;
    height: 9px;
    border-right: 1px solid #eadfe2;
    border-bottom: 1px solid #eadfe2;
    background: #fffdf9;
    content: "";
    transform: rotate(45deg);
}

.ichi-loading-trail {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 206px;
    margin-top: -3px;
}

.ichi-loading-trail span {
    width: 13px;
    height: 13px;
    border: 3px solid #fffdf9;
    border-radius: 50%;
    background: var(--coral);
    box-shadow: 0 0 0 1px rgba(189, 91, 101, 0.14);
    animation: ichi-loading-dot 1.5s ease-in-out infinite;
}

.ichi-loading-trail span:nth-of-type(2) {
    background: var(--yellow);
    animation-delay: 180ms;
}

.ichi-loading-trail span:nth-of-type(3) {
    background: var(--mint);
    animation-delay: 360ms;
}

.ichi-loading-trail i {
    width: 34px;
    border-top: 2px dashed rgba(189, 91, 101, 0.38);
}

.ichi-loading-copy {
    display: grid;
    gap: 4px;
    margin-top: 19px;
}

.ichi-loading-copy strong {
    font-family: Fredoka, "Noto Sans TC", sans-serif;
    font-size: 2rem;
    font-weight: 600;
}

.ichi-loading-kicker {
    color: var(--muted);
    font-size: 0.58rem;
    letter-spacing: 0.18em;
}

.ichi-loading-message {
    margin-top: 8px;
    color: var(--coral-dark);
    font-size: 0.82rem;
    font-weight: 700;
}

.ichi-loading-progress {
    width: 154px;
    height: 6px;
    overflow: hidden;
    margin-top: 18px;
    border-radius: 999px;
    background: rgba(234, 223, 226, 0.72);
}

.ichi-loading-progress span {
    display: block;
    width: 45%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--coral), var(--yellow));
    animation: ichi-loading-progress 1.8s ease-in-out infinite;
}

@keyframes ichi-loading-bob {
    0%,
    100% {
        transform: translateY(0) rotate(-1deg);
    }
    50% {
        transform: translateY(-8px) rotate(1deg);
    }
}

@keyframes ichi-loading-ring {
    to {
        transform: rotate(360deg);
    }
}

@keyframes ichi-loading-dot {
    0%,
    100% {
        transform: translateY(0) scale(0.88);
    }
    50% {
        transform: translateY(-4px) scale(1);
    }
}

@keyframes ichi-loading-progress {
    0% {
        transform: translateX(-125%);
    }
    50%,
    100% {
        transform: translateX(340%);
    }
}
}

.page-heading,
.editor-heading {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
}

.compact-heading h1,
.editor-heading h1 {
    font-size: clamp(1.9rem, 4vw, 3.3rem);
}

.heading-ichi,
.aside-mascot,
.aside-note,
.aside-quote {
    padding: 20px;
    border-radius: 12px;
}

.heading-ichi {
    align-self: flex-end;
    color: #81544a;
    background: #f7c3a7;
    font-size: 0.8rem;
}

.settings-layout {
    display: grid;
    gap: 18px;
}

.settings-section {
    box-shadow: none;
}

.settings-section-number {
    color: #c7b4a7;
    font-family: Fredoka, sans-serif;
    font-size: 1.5rem;
}

.field-group {
    display: grid;
    gap: 8px;
}

.field-group label {
    font-size: 0.8rem;
    font-weight: 700;
}

.field-group label span {
    margin-left: 5px;
    font-weight: 400;
}

.form-control,
.add-category-row input {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: 0;
    color: var(--ink);
    background: #fffaf5;
}

.form-control:focus,
.add-category-row input:focus {
    border-color: var(--coral);
    box-shadow: 0 0 0 3px rgba(232, 121, 97, 0.14);
}

.settings-field {
    max-width: 340px;
    margin-bottom: 22px;
}

.button-dark {
    color: #fff;
    background: var(--navy);
}

.button-quiet {
    color: var(--ink);
    background: #f1e9e2;
}

.button-danger {
    color: #fff;
    background: var(--coral-dark);
}

.button:disabled,
.backup-action:disabled {
    cursor: wait;
    opacity: 0.56;
}

.category-edit-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.category-edit-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    border-radius: 8px;
    background: #f8eee7;
    font-size: 0.78rem;
}

.icon-button {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--muted);
    background: transparent;
}

.icon-button:hover {
    color: var(--coral-dark);
    background: #f4ddd3;
}

.add-category-row {
    display: flex;
    max-width: 480px;
    gap: 8px;
}

.field-hint {
    line-height: 1.6;
}

.settings-copy,
.danger-zone p,
.aside-note p,
.aside-quote p {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.75;
}

.backup-status {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    margin: 22px 0;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff8f2;
}

.backup-status-item {
    display: grid;
    gap: 5px;
}

.backup-status-item strong {
    font-size: 0.9rem;
}

.backup-status-item small {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 400;
}

.backup-status-empty {
    color: var(--muted);
    font-weight: 400;
}

.backup-actions {
    flex-wrap: wrap;
    gap: 10px;
}

.backup-action {
    display: flex;
    flex: 1 1 180px;
    align-items: center;
    gap: 12px;
    min-height: 66px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--ink);
    background: #fffaf5;
    text-align: left;
}

.backup-action:hover {
    border-color: var(--coral);
}

.backup-action-icon {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 8px;
    color: var(--coral-dark);
    background: #f7e2d9;
}

.backup-action strong,
.backup-action small {
    display: block;
}

.backup-action strong {
    font-size: 0.78rem;
}

.backup-action small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.68rem;
}

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

.backup-preview {
    margin-top: 20px;
    padding: 18px;
    border: 1px solid #e7c2b6;
    border-radius: 10px;
    background: #fff3ed;
}

.backup-preview-heading {
    justify-content: space-between;
}

.backup-preview-file {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.68rem;
}

.backup-preview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 18px 0;
}

.backup-preview-item {
    display: grid;
    gap: 5px;
    padding: 10px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.6);
}

.backup-preview-item span {
    color: var(--muted);
    font-size: 0.68rem;
}

.backup-preview-item strong {
    font-size: 0.78rem;
}

.backup-preview p {
    color: var(--muted);
    font-size: 0.74rem;
}

.backup-preview-actions {
    justify-content: flex-end;
    gap: 8px;
}

.danger-zone {
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px;
    border: 1px solid #e5b4aa;
    border-radius: 12px;
    background: #fff2ee;
}

.danger-zone h2 {
    color: #9e463f;
}

.danger-zone p {
    margin: 7px 0 0;
}

.editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 18px;
    align-items: start;
}

.editor-main {
    box-shadow: none;
}

.form-section {
    padding: 26px 0;
    border-top: 1px solid var(--line);
}

.form-section-first {
    padding-top: 0;
    border-top: 0;
}

.form-section-heading {
    display: flex;
    gap: 13px;
    margin-bottom: 20px;
}

.form-section-heading p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 0.76rem;
}

.step-number {
    color: var(--coral-dark);
    font-family: Fredoka, sans-serif;
    font-size: 1.2rem;
}

.type-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.type-option {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    min-height: 76px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--ink);
    background: #fffaf5;
    text-align: left;
}

.type-option.is-selected {
    border-color: var(--coral);
    background: #fff0e9;
    box-shadow: 0 0 0 2px rgba(232, 121, 97, 0.12);
}

.type-option-symbol {
    font-size: 1.25rem;
}

.type-option strong,
.type-option small {
    display: block;
}

.type-option strong {
    font-size: 0.8rem;
}

.type-option small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.65rem;
}

.type-check {
    color: var(--coral-dark);
    opacity: 0;
}

.type-option.is-selected .type-check {
    opacity: 1;
}

.amount-input-wrap {
    display: flex;
    align-items: center;
    max-width: 440px;
    border-bottom: 2px solid var(--ink);
}

.currency-prefix,
.amount-unit {
    color: var(--muted);
    font-size: 0.84rem;
}

.amount-input {
    min-height: 62px;
    padding: 0 10px;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
    font-family: Fredoka, "Noto Sans TC", sans-serif;
    font-size: 2.4rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.field-span-2 {
    grid-column: span 2;
}

.textarea-control {
    min-height: 100px;
    resize: vertical;
}

.validation-message,
.form-error {
    color: var(--coral-dark);
    font-size: 0.72rem;
}

.editor-actions {
    justify-content: flex-end;
    gap: 9px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.editor-aside {
    display: grid;
    gap: 12px;
}

.aside-mascot {
    color: #805247;
    background: #f7c3a7;
}

.aside-mascot strong,
.aside-mascot span {
    display: block;
}

.aside-mascot strong {
    font-size: 0.85rem;
}

.aside-mascot span {
    margin-top: 8px;
    font-size: 0.74rem;
    line-height: 1.6;
}

.aside-note {
    border: 1px solid var(--line);
    background: rgba(255, 253, 249, 0.8);
}

.aside-note-mark {
    display: grid;
    width: 24px;
    height: 24px;
    margin-bottom: 9px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--mint);
    font-size: 0.75rem;
}

.aside-note strong {
    font-size: 0.78rem;
}

.aside-note p {
    margin: 8px 0 0;
}

.aside-quote {
    color: #fffaf4;
    background: var(--navy);
}

.aside-quote span {
    color: #f7c3a7;
    font-size: 0.7rem;
}

.aside-quote p {
    margin-bottom: 0;
    color: #d4d2db;
}

.back-link {
    display: inline-flex;
    gap: 6px;
    margin-bottom: 22px;
    color: var(--coral-dark);
    font-size: 0.76rem;
    font-weight: 700;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1000;
    max-width: min(420px, calc(100vw - 2rem));
    padding: 12px 16px;
    border: 1px solid #e5b4aa;
    border-radius: 9px;
    color: #7d3733;
    background: #fff2ee;
    box-shadow: var(--shadow);
}

#blazor-error-ui .reload {
    margin-left: 6px;
    color: var(--coral-dark);
    font-weight: 700;
}

#blazor-error-ui .dismiss {
    margin-left: 8px;
    cursor: pointer;
}

@media (max-width: 980px) {
    .sidebar {
        flex-basis: 220px;
    }

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

    .total-card {
        grid-column: span 2;
    }

    .editor-layout {
        grid-template-columns: 1fr;
    }

    .editor-aside {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 720px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        display: block;
        min-height: auto;
        padding: 15px 18px;
    }

    .brand-row {
        margin-bottom: 0;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .nav-panel {
        display: none;
    }

    .nav-panel.is-open {
        display: flex;
        padding-top: 18px;
    }

    .sidebar-footer {
        display: none;
    }

    .topbar {
        display: none;
    }

    .page-content {
        padding: 30px 18px 48px;
    }

    .ichi-welcome h1,
    .page-heading h1,
    .editor-heading h1 {
        font-size: 2.3rem;
    }

    .period-bar,
    .danger-zone {
        align-items: flex-start;
        flex-direction: column;
    }

    .period-actions {
        width: 100%;
    }

    .period-button {
        flex: 1;
    }

    .overview-grid,
    .dashboard-columns,
    .form-grid,
    .type-selector,
    .editor-aside {
        grid-template-columns: 1fr;
    }

    .total-card {
        grid-column: auto;
    }

    .field-span-2 {
        grid-column: auto;
    }

    .backup-preview-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-heading,
    .editor-heading {
        display: block;
    }

    .heading-ichi {
        display: inline-block;
        margin-top: 18px;
    }

    .add-category-row {
        display: grid;
        grid-template-columns: 1fr auto;
    }
}

@media (max-width: 980px) {
    .transaction-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-search {
        grid-column: span 2;
    }

    .monthly-chart {
        grid-template-columns: repeat(6, minmax(42px, 1fr));
        gap: 8px;
    }
}

@media (max-width: 720px) {
    .heading-actions {
        align-items: stretch;
        flex-direction: column;
        margin-top: 18px;
    }

    .heading-actions .button {
        width: 100%;
    }

    .heading-actions .text-link {
        text-align: center;
    }

    .transaction-filters,
    .transaction-stats,
    .insights-columns {
        grid-template-columns: 1fr;
    }

    .filter-search {
        grid-column: auto;
    }

    .filter-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .filter-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .transaction-row {
        grid-template-columns: 48px 38px minmax(0, 1fr) auto;
        gap: 10px;
    }

    .transaction-amount {
        grid-column: 3 / -1;
        grid-row: 2;
        justify-self: start;
        padding-left: 48px;
    }

    .transaction-actions {
        grid-column: 4;
        grid-row: 1;
    }

    .monthly-chart {
        grid-template-columns: repeat(3, 1fr);
        row-gap: 24px;
    }

    .month-column {
        height: 180px;
    }
}

:root {
    --ink: #30313b;
    --muted: #7d7781;
    --paper: #fffdf9;
    --cream: #fff8f1;
    --line: #eaded9;
    --navy: #303a40;
    --coral: #f08f8b;
    --coral-dark: #c66570;
    --mint: #9fc8b5;
    --yellow: #f2c56f;
    --lilac: #b8a4c7;
    --shadow: 0 12px 30px rgba(89, 61, 63, 0.08);
}

body {
    background-color: var(--cream);
    background-image: linear-gradient(rgba(240, 143, 139, 0.045) 1px, transparent 1px);
    background-size: 100% 36px;
}

.sidebar {
    flex-direction: column;
    padding: 28px 20px 24px;
    color: var(--ink);
    background: #fff0e7;
    border-right: 1px solid #f0dcd4;
}

.brand-row {
    flex-shrink: 0;
    margin-bottom: 52px;
}

.brand {
    gap: 13px;
}

.brand-mark {
    width: 50px;
    height: 50px;
    padding: 3px;
    border: 0;
    border-radius: 16px;
    background: #f6b8a5;
    box-shadow: 0 5px 0 #e99284;
}

.brand-name strong {
    color: var(--ink);
    font-size: 1.24rem;
}

.brand-name span {
    color: #9d7f7c;
}

.nav-caption {
    color: #b17d7c;
    font-weight: 700;
}

.nav-link {
    color: #665e69;
    border-radius: 9px;
    font-weight: 600;
}

.nav-link:hover {
    color: var(--ink);
    background: #ffe0d6;
}

.nav-link.active {
    color: #fff;
    background: var(--coral);
    box-shadow: 0 4px 0 #d97878;
}

.nav-icon {
    color: var(--coral-dark);
}

.nav-link.active .nav-icon {
    color: #fff5ed;
}

.local-storage-card {
    border-color: rgba(112, 159, 138, 0.26);
    background: rgba(159, 200, 181, 0.28);
}

.local-storage-card strong {
    color: #4e6d5f;
}

.local-storage-card span {
    color: #769184;
}

.local-storage-icon {
    color: #5f967b !important;
}

.version-label {
    color: #b08f8d;
}

.topbar {
    min-height: 72px;
    border-bottom-color: #f0dfd8;
    background: rgba(255, 253, 249, 0.88);
}

.topbar-status {
    padding: 7px 11px;
    border-radius: 999px;
    background: #f5eee8;
}

.status-dot {
    background: var(--mint);
    box-shadow: 0 0 0 3px rgba(159, 200, 181, 0.2);
}

.button {
    border-radius: 9px;
}

.button-primary {
    box-shadow: 0 4px 0 #d97878;
}

.button:hover:not(:disabled) {
    box-shadow: 0 6px 0 #d97878;
}

.button-primary:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #d97878;
}

.page-content {
    padding-top: 42px;
}

.ichi-welcome {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 26px;
    align-items: center;
    max-width: 900px;
    padding: 10px 0 36px;
}

.welcome-mascot {
    display: grid;
    justify-items: center;
    gap: 4px;
    position: relative;
    padding-top: 8px;
}

.welcome-mascot img {
    width: 142px;
    height: 142px;
    object-fit: contain;
    filter: drop-shadow(0 10px 0 rgba(223, 150, 130, 0.18));
}

.welcome-mascot span {
    padding: 7px 10px;
    border: 1px solid #e7c880;
    border-radius: 8px;
    color: #87673a;
    background: #fff0b9;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.ichi-welcome h1,
.page-heading h1,
.editor-heading h1 {
    letter-spacing: -0.01em;
}

.page-subtitle {
    color: #817984;
}

.period-bar,
.surface-card,
.total-card,
.type-card,
.stat-card {
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.period-bar {
    border-color: #eaded9;
    background: rgba(255, 253, 249, 0.84);
}

.period-icon {
    color: var(--coral-dark);
}

.period-actions {
    background: #f7eae2;
}

.period-button.is-active {
    color: var(--ink);
    background: #fffdf9;
}

.total-card {
    background: var(--navy);
    box-shadow: 0 12px 30px rgba(48, 58, 64, 0.16);
}

.type-card {
    background: rgba(255, 253, 249, 0.9);
}

.type-card:nth-child(2) .type-emblem {
    color: #ba7b3e;
    background: #fff0c7;
}

.type-card:nth-child(3) .type-emblem {
    color: var(--coral-dark);
    background: #ffe0d7;
}

.type-card:nth-child(4) .type-emblem {
    color: #718f79;
    background: #e2f1e7;
}

.surface-card {
    background: rgba(255, 253, 249, 0.9);
}

.section-heading {
    margin-bottom: 20px;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--coral-dark);
}

.text-link:hover,
.back-link:hover {
    color: #a64f5a;
}

.category-bullet {
    background: var(--coral);
    box-shadow: 0 0 0 3px rgba(240, 143, 139, 0.15);
}

.category-bar,
.insight-bar {
    background: #f1e6dd;
}

.category-bar span,
.insight-bar span {
    background: var(--coral);
}

.recent-row {
    border-radius: 8px;
    transition: background 160ms ease, transform 160ms ease;
}

.recent-row:hover {
    background: #fff1e9;
    transform: translateX(3px);
}

.transaction-icon {
    background: #fff0c7;
}

.type-waste .transaction-icon,
.transaction-icon.type-waste {
    background: #ffe0d7;
}

.type-investment .transaction-icon,
.transaction-icon.type-investment {
    background: #e2f1e7;
}

.transaction-toolbar {
    border-top: 3px solid var(--coral);
    box-shadow: var(--shadow);
}

.filter-result {
    padding: 5px 9px;
    border-radius: 999px;
    color: #6d746b;
    background: #e8f3e9;
    font-weight: 700;
}

.filter-helper {
    color: var(--muted);
    font-size: 0.72rem;
}

.form-control,
.add-category-row input {
    border-color: #e7dad5;
    border-radius: 8px;
    background: #fffaf6;
}

.form-control:hover,
.add-category-row input:hover {
    border-color: #d9b8b1;
}

.form-control:focus,
.add-category-row input:focus {
    border-color: var(--coral);
    box-shadow: 0 0 0 3px rgba(240, 143, 139, 0.16);
}

.button-quiet {
    background: #f6ece5;
}

.button-quiet:hover:not(:disabled) {
    background: #ffe0d6;
}

.stat-card {
    background: rgba(255, 253, 249, 0.9);
}

.stat-card-accent {
    border-color: #efc2b7;
    background: #fff0e9;
}

.transaction-row {
    margin-inline: -10px;
    padding-inline: 10px;
    border-radius: 8px;
    transition: background 160ms ease;
}

.transaction-row:hover {
    background: #fff3ec;
}

.transaction-row:first-child {
    border-top-color: transparent;
}

.transaction-actions .icon-button {
    width: 32px;
    height: 32px;
}

.icon-button:hover {
    color: var(--coral-dark);
    background: #ffe0d6;
}

.settings-section,
.insights-section,
.monthly-trend-section,
.transaction-table-card,
.editor-main {
    box-shadow: var(--shadow);
}

.heading-ichi,
.aside-mascot {
    border: 1px solid #edc1ae;
    background: #ffe0ca;
}

.backup-action {
    border-radius: 8px;
    background: #fffaf6;
}

.backup-action:hover {
    border-color: var(--coral);
    background: #fff4ed;
}

.backup-action-icon {
    color: var(--coral-dark);
    background: #ffe0d6;
}

.danger-zone {
    border-radius: 8px;
}

.type-option {
    border-radius: 8px;
    background: #fffaf6;
}

.type-option:hover {
    border-color: #e7b9ad;
    background: #fff4ed;
}

.type-option.is-selected {
    border-color: var(--coral);
    background: #fff0e9;
    box-shadow: 0 0 0 3px rgba(240, 143, 139, 0.14);
}

.step-number {
    color: var(--coral-dark);
}

.amount-input-wrap {
    width: 100%;
    min-width: 0;
    max-width: 440px;
    border-bottom-color: var(--coral-dark);
}

.amount-input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}

.aside-note {
    box-shadow: var(--shadow);
}

@media (max-width: 720px) {
    .sidebar {
        padding: 14px 18px 16px;
        border-right: 0;
        border-bottom: 1px solid #f0dcd4;
    }

    .brand-row {
        margin-bottom: 0;
    }

    .mobile-menu-toggle {
        color: var(--ink);
    }

    .nav-panel.is-open {
        padding-top: 16px;
    }

    .page-content {
        padding: 28px 16px 48px;
    }

    .ichi-welcome {
        grid-template-columns: minmax(0, 1fr) 92px;
        gap: 8px;
        padding-top: 4px;
    }

    .ichi-welcome h1 {
        font-size: 2.2rem;
    }

    .welcome-mascot {
        align-self: end;
        gap: 0;
        padding-top: 0;
    }

    .welcome-mascot img {
        width: 92px;
        height: 92px;
    }

    .welcome-mascot span {
        display: none;
    }

    .welcome-actions {
        gap: 10px;
    }

    .welcome-note {
        font-size: 0.7rem;
    }

    .period-bar {
        box-shadow: 0 8px 22px rgba(89, 61, 63, 0.06);
    }

    .transaction-toolbar {
        padding: 18px;
        border-top-width: 2px;
    }

    .editor-layout,
    .editor-main {
        width: 100%;
        min-width: 0;
    }

    .amount-input-wrap {
        max-width: none;
    }

    .transaction-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px 10px;
    }

    .filter-search {
        grid-column: 1 / -1;
    }

    .transaction-row {
        grid-template-columns: 48px 38px minmax(0, 1fr) auto;
        align-items: start;
        gap: 10px;
        min-height: 82px;
    }

    .transaction-amount {
        grid-column: 3;
        grid-row: 2;
        justify-self: start;
        padding-left: 0;
        margin-top: -2px;
    }

    .transaction-actions {
        grid-column: 4;
        grid-row: 1 / span 2;
        align-self: center;
    }
}

.type-card:nth-child(2) .mini-meter span {
    background: var(--yellow);
}

.type-card:nth-child(3) .mini-meter span {
    background: var(--coral);
}

.type-card:nth-child(4) .mini-meter span {
    background: var(--mint);
}

.stat-card:nth-child(1) {
    border-color: #d7e9dc;
    background: #f0f7ef;
}

.stat-card:nth-child(2) {
    border-color: #efc2b7;
    background: #fff0e9;
}

.stat-card:nth-child(3) {
    border-color: #ecd9a9;
    background: #fff8df;
}

.heading-ichi {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.heading-ichi img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.type-option-symbol {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 13px;
    font-family: Fredoka, "Noto Sans TC", sans-serif;
    font-size: 1.2rem;
}

.type-option.type-consumption .type-option-symbol {
    color: #a87636;
    background: #fff0c7;
}

.type-option.type-waste .type-option-symbol {
    color: var(--coral-dark);
    background: #ffe0d7;
}

.type-option.type-investment .type-option-symbol {
    color: #628d76;
    background: #e2f1e7;
}

.step-number {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 12px;
    color: var(--coral-dark);
    background: #ffe7dc;
    font-family: Fredoka, sans-serif;
    font-size: 1rem;
}

.editor-main {
    width: 100%;
    min-width: 0;
    border-top: 3px solid var(--coral);
}

.aside-mascot {
    display: flex;
    align-items: center;
    gap: 10px;
}

.aside-mascot img {
    width: 54px;
    height: 54px;
    flex: 0 0 auto;
    object-fit: contain;
}

@media (max-width: 720px) {
    .settings-page .compact-heading h1 {
        font-size: 2rem;
    }
}

@media (max-width: 520px) {
    .loading-panel {
        flex-direction: column;
        gap: 8px;
        min-height: 270px;
        padding: 26px 18px;
        text-align: center;
    }

    .loading-panel-copy {
        justify-items: center;
    }

    .ichi-loading-character {
        width: min(68vw, 224px);
    }

    .ichi-loading-note {
        left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ichi-loading-character img,
    .loading-panel-illustration img,
    .ichi-loading-ring,
    .ichi-loading-trail span,
    .loading-panel-dots span,
    .ichi-loading-progress span {
        animation: none;
    }
}
