:root,
:root[data-theme="light"] {
    color-scheme: light;
    --page: #f5f5f3;
    --surface: #ffffff;
    --surface-soft: #f0f0ed;
    --ink: #1c1c1a;
    --muted: #676762;
    --faint: #92928c;
    --line: #e3e3df;
    --line-strong: #c9c9c3;
    --accent: #272724;
    --income: #16845a;
    --expense: #c34545;
    --overlay: rgb(15 15 14 / 48%);
    --shadow: 0 16px 44px rgb(0 0 0 / 16%);
    --radius: 10px;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --page: #151514;
    --surface: #20201e;
    --surface-soft: #292927;
    --ink: #f2f2ee;
    --muted: #b9b9b2;
    --faint: #888881;
    --line: #373734;
    --line-strong: #50504b;
    --accent: #eeeeea;
    --income: #42c987;
    --expense: #f17676;
    --overlay: rgb(0 0 0 / 70%);
    --shadow: 0 18px 50px rgb(0 0 0 / 40%);
}

:root[data-theme="light"] .card-face[data-network="Visa"] {
    --card-bg: #202b3c;
    --card-fg: #f6f7f8;
}

:root[data-theme="light"] .card-face[data-network="Mastercard"] {
    --card-bg: #2c2928;
    --card-fg: #f8f5f1;
}

:root[data-theme="light"] .card-face[data-network="American Express"] {
    --card-bg: #284a5b;
    --card-fg: #f4f8fa;
}

:root[data-theme="light"] .card-face[data-network="Discover"] {
    --card-bg: #343332;
    --card-fg: #f7f5f1;
}

:root[data-theme="light"] .card-face[data-network="RuPay"] {
    --card-bg: #383331;
    --card-fg: #f8f5f1;
}

:root[data-theme="light"] .card-face[data-network="Other"] {
    --card-bg: #282826;
    --card-fg: #f7f7f4;
}

:root[data-theme="dark"] .card-face[data-network] {
    --card-bg: #e9e9e5;
    --card-fg: #20201e;
}

:root[data-theme="dark"] .card-face:not([data-network]) {
    --card-bg: #292927;
    --card-fg: #f2f2ee;
}

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

html {
    min-width: 320px;
    overflow-x: clip;
    background: var(--page);
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background: var(--page);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    transition: background-color 160ms ease, color 160ms ease;
}

button,
input,
select {
    font: inherit;
}

button,
select {
    color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: fixed;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.header {
    position: sticky;
    z-index: 10;
    top: 0;
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem max(1.5rem, calc((100vw - 1320px) / 2));
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.data-picker,
.theme-toggle,
.settings-button,
.export-btn {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.data-picker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.7rem;
    color: var(--muted);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.data-picker i {
    color: var(--faint);
}

.theme-toggle {
    position: relative;
    display: inline-flex;
    width: 52px;
    height: 30px;
    min-height: 30px;
    align-items: center;
    padding: 3px;
    border-radius: 30px;
    background: var(--surface-soft);
    cursor: pointer;
}

.theme-toggle-track {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
}

.theme-toggle-knob {
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 50%;
    background: var(--ink);
    color: var(--page);
    transition: transform 160ms ease;
}

.theme-toggle-knob i {
    font-size: 0.7rem;
}

:root[data-theme="dark"] .theme-toggle-knob {
    transform: translateX(21px);
}

.settings-button,
.export-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 550;
    cursor: pointer;
    transition: background-color 140ms ease, opacity 140ms ease;
}

.settings-button {
    background: var(--surface);
    color: var(--ink);
}

.settings-button:hover {
    background: var(--surface-soft);
}

.export-btn {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--page);
}

.export-btn:hover,
.btn-primary:hover {
    opacity: 0.82;
}

.main-content {
    display: flex;
    width: min(100%, 1360px);
    flex-direction: column;
    gap: 1.25rem;
    margin: 0 auto;
    padding: 1.75rem 2rem 5rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(320px, 1fr);
    align-items: stretch;
    gap: 1rem;
}

.card {
    min-width: 0;
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    container-type: inline-size;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.card-title {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 550;
}

.summary-icon {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--muted);
    font-size: 0.72rem;
}

.income-icon {
    color: var(--income);
}

.expense-icon {
    color: var(--expense);
}

.amount,
.total-expenses,
.spending-limit {
    min-width: 0;
    margin: 0 0 0.4rem;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    font-size: clamp(1rem, 2.2vw, 2.2rem);
    font-weight: 600;
    letter-spacing: -0.045em;
    line-height: 1.2;
    overflow-wrap: normal;
    white-space: normal;
}

.spending-used.long-money,
.spending-limit.long-money {
    flex-basis: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.amount.income-amount {
    color: var(--income);
}

.amount.expense-amount {
    color: var(--expense);
}

.amount.long-money,
.total-expenses.long-money {
    font-size: clamp(1rem, calc(90cqw / var(--amount-length, 12)), 2.2rem);
}

.summary-note {
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.76rem;
}

.payment-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.55rem;
}

.card-face {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 410px;
    aspect-ratio: 1.4 / 1;
    align-self: center;
    min-height: 292px;
    container-type: inline-size;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
    padding: 1.1rem 1.2rem 0.95rem;
    border: 1px solid rgb(0 0 0 / 10%);
    border-radius: 13px;
    background: linear-gradient(145deg, var(--card-bg, #292927), color-mix(in srgb, var(--card-bg, #292927) 76%, #858585));
    color: var(--card-fg, #f7f7f4);
    box-shadow: 0 8px 20px rgb(0 0 0 / 18%), inset 0 1px 0 rgb(255 255 255 / 13%);
}

.card-face::after {
    position: absolute;
    right: -54px;
    bottom: -110px;
    width: 235px;
    height: 235px;
    border: 1px solid rgb(255 255 255 / 9%);
    border-radius: 50%;
    box-shadow: 0 0 0 22px rgb(255 255 255 / 3%), 0 0 0 48px rgb(255 255 255 / 3%);
    content: "";
    pointer-events: none;
}

.card-face-top,
.card-face-bottom {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.card-face-top {
    min-height: 20px;
}

.card-bank {
    overflow: hidden;
    font-size: 0.8rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-contactless {
    transform: rotate(90deg);
    opacity: 0.75;
}

.card-chip {
    position: relative;
    z-index: 1;
    width: 43px;
    height: 32px;
    margin: 1.05rem 0 0.6rem;
    overflow: hidden;
    border: 1px solid rgb(0 0 0 / 23%);
    border-radius: 6px;
    background: linear-gradient(135deg, #e5e2d3, #aaa99e);
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 34%);
}

.card-chip::before,
.card-chip::after,
.card-chip span::before,
.card-chip span::after {
    position: absolute;
    border-color: rgb(79 77 67 / 55%);
    content: "";
}

.card-chip::before {
    top: 0;
    bottom: 0;
    left: 33%;
    width: 34%;
    border-right: 1px solid;
    border-left: 1px solid;
}

.card-chip::after {
    top: 32%;
    right: 0;
    left: 0;
    height: 36%;
    border-top: 1px solid;
    border-bottom: 1px solid;
}

.card-chip span::before {
    top: 0;
    bottom: 0;
    left: 50%;
    border-left: 1px solid;
}

.card-chip span::after {
    top: 50%;
    right: 0;
    left: 0;
    border-top: 1px solid;
}

.card-number {
    position: relative;
    z-index: 1;
    margin: 0 0 0.8rem;
    font-size: clamp(0.9rem, 1.4vw, 1.05rem);
    letter-spacing: 0.13em;
    white-space: nowrap;
}

.card-face-bottom {
    min-height: 20px;
    margin-top: auto;
    color: var(--card-fg, #f7f7f4);
}

.card-holder {
    overflow: hidden;
    font-size: 0.68rem;
    font-weight: 550;
    letter-spacing: 0.07em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.card-network {
    margin-left: auto;
    font-size: 0.9rem;
    font-style: italic;
    font-weight: 750;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.card-empty {
    padding: 0 0.2rem;
    color: var(--muted);
    font-size: 0.75rem;
}

.spending-section {
    position: relative;
    z-index: 1;
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid color-mix(in srgb, var(--card-fg, #f7f7f4) 24%, transparent);
}

.spending-heading,
.spending-values {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.spending-heading {
    color: color-mix(in srgb, var(--card-fg, #f7f7f4) 76%, transparent);
    font-size: 0.72rem;
}

.text-button {
    padding: 0.15rem 0.3rem;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    font-size: 0.72rem;
    cursor: pointer;
}

.text-button:hover {
    background: rgb(255 255 255 / 12%);
}

.spending-values {
    display: flex;
    flex-wrap: wrap;
    container-type: inline-size;
    min-width: 0;
    margin: 0.15rem 0 0.4rem;
}

.spending-limit {
    flex: 0 1 auto;
    flex-shrink: 0;
    overflow: hidden;
    color: color-mix(in srgb, var(--card-fg, #f7f7f4) 70%, transparent);
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
    font-size: clamp(0.62rem, calc(100cqw / var(--amount-length, 12)), 0.8rem);
}

.spending-used {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    color: var(--card-fg, #f7f7f4);
    font-size: clamp(0.82rem, calc(130cqw / var(--amount-length, 12)), 1rem);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-bar {
    height: 6px;
    overflow: hidden;
    border-radius: 6px;
    background: color-mix(in srgb, var(--card-fg, #f7f7f4) 23%, transparent);
}

.progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--card-fg, #f7f7f4);
    transition: width 180ms ease;
}

.limit-caption {
    margin: 0.3rem 0 0;
    overflow-wrap: anywhere;
    color: color-mix(in srgb, var(--card-fg, #f7f7f4) 70%, transparent);
    font-size: 0.68rem;
    white-space: normal;
}

.card-picker-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.15rem 0;
    color: var(--muted);
    font-size: 0.7rem;
}

.card-picker-wrap select {
    max-width: 75%;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: inherit;
}

.chart-section {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 1rem;
}

.chart-card,
.breakdown-card {
    min-height: 340px;
}

.section-card-header {
    margin-bottom: 0.75rem;
}

.chart-controls,
.transaction-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.45rem;
}

.control-select {
    min-height: 34px;
    max-width: 100%;
    padding: 0.35rem 1.7rem 0.35rem 0.6rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background-color: var(--surface);
    color: var(--muted);
    font-size: 0.74rem;
}

.chart-legend {
    display: flex;
    gap: 1rem;
    margin: 0.25rem 0 0.7rem;
    color: var(--muted);
    font-size: 0.72rem;
}

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

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 2px;
    background: var(--income);
}

.expense-dot {
    background: var(--expense);
}

.chart-frame {
    display: grid;
    height: 245px;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 0.35rem;
}

.chart-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.25rem 0 1.2rem;
    color: var(--faint);
    font-size: 0.62rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.chart-axis span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chart-container {
    display: flex;
    min-width: 0;
    align-items: stretch;
    gap: 0.7rem;
    padding: 0.45rem 0.35rem 0;
    overflow-x: auto;
    border-bottom: 1px solid var(--line-strong);
    background: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent calc(25% - 1px),
        var(--line) calc(25% - 1px),
        var(--line) 25%
    );
}

.chart-group {
    display: flex;
    min-width: 28px;
    flex: 1 0 28px;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}

.chart-bars {
    display: flex;
    width: min(100%, 44px);
    height: calc(100% - 19px);
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
}

.chart-bar {
    width: 43%;
    min-height: 2px;
    border-radius: 3px 3px 0 0;
    background: var(--income);
}

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

.chart-label {
    min-height: 15px;
    color: var(--faint);
    font-size: 0.67rem;
    white-space: nowrap;
}

.chart-empty,
.table-empty {
    padding: 1.5rem 0.25rem;
    color: var(--muted);
    font-size: 0.82rem;
    text-align: center;
}

.total-expenses {
    margin: 1.2rem 0 0.2rem;
}

.category-list {
    display: flex;
    flex-direction: column;
    margin-top: 0.95rem;
}

.category-row {
    container-type: inline-size;
    padding: 0.7rem 0;
    border-top: 1px solid var(--line);
}

.category-row-heading {
    display: flex;
    min-width: 0;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.category-row-heading strong {
    flex: 0 1 62%;
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    font-weight: 550;
    font-size: clamp(0.62rem, calc(75cqw / var(--amount-length, 12)), 0.78rem);
    text-align: right;
}

.category-track {
    height: 3px;
    margin-top: 0.4rem;
    overflow: hidden;
    border-radius: 3px;
    background: var(--line);
}

.category-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--expense);
}

.transactions-section {
    padding-bottom: 0.7rem;
}

.transactions-heading {
    margin-bottom: 0.6rem;
}

.table-wrap {
    overflow-x: auto;
}

.transactions-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    text-align: left;
}

.transactions-table th {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--line);
    color: var(--faint);
    font-size: 0.68rem;
    font-weight: 550;
    text-transform: uppercase;
}

.transactions-table td {
    padding: 0.8rem 0.75rem;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.8rem;
}

.transactions-table tbody tr:last-child td {
    border-bottom: 0;
}

.transactions-table tbody tr:hover {
    background: var(--surface-soft);
}

.transaction-description {
    color: var(--ink) !important;
    font-weight: 550;
}

.transaction-amount {
    color: var(--ink) !important;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
}

.transaction-amount.income {
    color: var(--income) !important;
}

.transaction-amount.expense {
    color: var(--expense) !important;
}

.action-btn {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--faint);
    cursor: pointer;
}

.action-btn:hover {
    background: var(--surface-soft);
    color: var(--ink);
}

.add-button {
    position: fixed;
    z-index: 9;
    right: max(1.4rem, calc((100vw - 1320px) / 2));
    bottom: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.fab {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid var(--ink);
    border-radius: 50%;
    background: var(--ink);
    color: var(--page);
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: opacity 140ms ease;
}

.fab:hover {
    opacity: 0.82;
}

.modal,
.drawer-backdrop {
    position: fixed;
    z-index: 30;
    inset: 0;
    display: none;
    background: var(--overlay);
}

.modal {
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 1rem;
}

.modal.show {
    display: flex;
}

.modal-content {
    width: min(100%, 440px);
    max-height: min(90vh, 760px);
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.onboarding-modal {
    z-index: 40;
}

.onboarding-modal .modal-content {
    width: min(100%, 420px);
}

.modal-header,
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem;
}

.modal-header {
    border-bottom: 1px solid var(--line);
}

.modal-title {
    margin: 0;
    color: var(--ink);
    font-size: 1.1rem;
    font-weight: 600;
}

.intro-copy {
    margin: 0.3rem 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.modal-body {
    padding: 1.1rem 1.2rem;
}

.form-group {
    margin-bottom: 0.9rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.77rem;
    font-weight: 550;
}

.form-input,
.form-select {
    width: 100%;
    min-height: 40px;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink);
}

.form-input::placeholder {
    color: var(--faint);
}

.field-note {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.72rem;
}

.field-note strong {
    color: var(--ink);
}

.modal-footer {
    justify-content: flex-end;
    border-top: 1px solid var(--line);
}

.btn {
    min-height: 37px;
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink);
    font-size: 0.81rem;
    font-weight: 550;
    cursor: pointer;
}

.btn:hover {
    background: var(--surface-soft);
}

.btn-primary {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--page);
}

.btn-primary:hover {
    background: var(--ink);
}

.btn-secondary {
    color: var(--muted);
}

.close-btn,
.icon-button {
    display: inline-grid;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
}

.close-btn {
    font-size: 1.2rem;
}

.drawer-backdrop {
    z-index: 20;
    display: block;
    visibility: hidden;
    opacity: 0;
    transition: opacity 150ms ease, visibility 150ms ease;
}

.settings-panel {
    position: fixed;
    z-index: 21;
    top: 0;
    right: 0;
    bottom: 0;
    display: none;
    width: min(100%, 390px);
    flex-direction: column;
    overflow-y: auto;
    border-left: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
    visibility: hidden;
    transform: translateX(102%);
    transition: transform 180ms ease, visibility 0s linear 180ms;
}

body.settings-open .drawer-backdrop {
    visibility: visible;
    opacity: 1;
}

body.settings-open .settings-panel {
    display: flex;
    visibility: visible;
    transform: translateX(0);
    transition: transform 180ms ease;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.2rem;
    border-bottom: 1px solid var(--line);
}

.settings-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.eyebrow {
    margin: 0 0 0.2rem;
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.09em;
}

.settings-section {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--line);
}

.settings-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.settings-section-heading h3 {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 600;
}

.settings-section-heading p {
    margin: 0.15rem 0 0;
    color: var(--muted);
    font-size: 0.72rem;
}

.reset-section {
    margin-top: auto;
    border-top: 1px solid var(--line);
    border-bottom: 0;
}

.reset-section .settings-section-heading {
    margin-bottom: 0.65rem;
}

.reset-section .settings-section-heading p {
    max-width: 260px;
}

.reset-button {
    border-color: color-mix(in srgb, var(--expense) 45%, var(--line));
    color: var(--expense);
}

.reset-button:hover {
    background: color-mix(in srgb, var(--expense) 9%, var(--surface));
}

.profile-form .form-group {
    margin-bottom: 0.7rem;
}

.profile-form .form-input {
    min-height: 38px;
}

.settings-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.settings-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.65rem;
    border: 1px solid var(--line);
    border-radius: 7px;
}

.settings-card-row.active {
    border-color: var(--line-strong);
    background: var(--surface-soft);
}

.settings-card-select {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.settings-card-name {
    overflow: hidden;
    max-width: 100%;
    color: var(--ink);
    font-size: 0.79rem;
    font-weight: 550;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-card-meta {
    overflow: hidden;
    max-width: 100%;
    color: var(--muted);
    font-size: 0.7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-card-empty {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.toast {
    position: fixed;
    z-index: 50;
    right: 1rem;
    bottom: 1rem;
    max-width: min(360px, calc(100vw - 2rem));
    padding: 0.75rem 1rem;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow);
    font-size: 0.82rem;
}

@media (max-width: 1000px) {
    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .payment-card {
        grid-column: 1 / -1;
    }

    .payment-card .card-face {
        max-width: 410px;
    }

    .payment-card .card-picker-wrap {
        align-self: center;
    }

    .payment-card .card-empty {
        text-align: center;
    }

    .chart-section {
        grid-template-columns: minmax(0, 1.6fr) minmax(250px, 1fr);
    }
}

@media (max-width: 760px) {
    .chart-section {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 620px) {
    .header {
        min-height: 60px;
        gap: 0.5rem;
        padding: 0.65rem 0.8rem;
    }

    .header h2 {
        font-size: 0.88rem;
    }

    .header-controls {
        gap: 0.35rem;
    }

    .data-picker {
        gap: 0.3rem;
        padding: 0.35rem;
        border: 0;
        font-size: 0.68rem;
    }

    .settings-button {
        width: 34px;
        min-width: 34px;
        padding: 0.35rem;
    }

    .settings-button span {
        display: none;
    }

    .export-btn {
        min-height: 33px;
        padding: 0.35rem 0.55rem;
        font-size: 0.73rem;
    }

    .main-content {
        gap: 0.8rem;
        padding: 1rem 0.8rem 5rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

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

    .card {
        padding: 1rem;
    }

    .payment-card {
        padding: 0.8rem;
    }

    .card-face {
        min-height: 285px;
    }

    .chart-card,
    .breakdown-card {
        min-height: 0;
    }

    .section-card-header {
        align-items: flex-start;
    }

    .chart-controls {
        gap: 0.3rem;
    }

    .chart-controls .control-select {
        min-height: 31px;
        max-width: 137px;
        padding-right: 1.25rem;
        font-size: 0.68rem;
    }

    .transactions-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .transaction-controls {
        width: 100%;
        justify-content: flex-start;
    }

    .transaction-controls .control-select {
        flex: 1;
    }

    .chart-container {
        gap: 0.45rem;
    }

    .chart-frame {
        height: 210px;
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .chart-group {
        min-width: 25px;
        flex-basis: 25px;
    }

    .settings-panel {
        width: min(100%, 360px);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
