﻿* {
    box-sizing: border-box;
}


html {
    overflow-x: hidden;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f6f8fb;
    color: #0f172a;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow-x: hidden;
}

button,
input,
textarea {
    font: inherit;
}

.auth-page {
    min-height: 100vh;
    background: #ffffff;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 0.74fr) minmax(500px, 1fr);
    width: 100%;
    min-height: 100vh;
}

.auth-copy {
    position: relative;
    display: grid;
    align-content: space-between;
    min-height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 74%, rgb(16 185 129 / 0.2), transparent 26%),
        linear-gradient(135deg, #f5fffb 0%, #edfdf6 48%, #f8fbff 100%);
    padding: clamp(34px, 5vw, 80px);
}

.auth-copy::before {
    content: "";
    position: absolute;
    right: -130px;
    bottom: -130px;
    width: 620px;
    height: 620px;
    border-radius: 50%;
    background:
        repeating-radial-gradient(circle, rgb(16 185 129 / 0.12) 0 1px, transparent 1px 32px);
    pointer-events: none;
}

.auth-brand {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    color: #071126;
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: min(190px, 100%);
    height: auto;
    object-fit: contain;
}

.auth-brand em {
    color: #16a34a;
    font-style: normal;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #16a34a;
}

.brand-mark i {
    display: block;
    width: 5px;
    border-radius: 999px;
    background: currentColor;
}

.brand-mark i:nth-child(1),
.brand-mark i:nth-child(4) {
    height: 16px;
}

.brand-mark i:nth-child(2) {
    height: 28px;
}

.brand-mark i:nth-child(3) {
    height: 40px;
}

.pill {
    width: fit-content;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    background: #ffffff;
    color: #047857;
    font-size: 14px;
    font-weight: 700;
    padding: 6px 12px;
}

.auth-copy h1 {
    position: relative;
    z-index: 1;
    max-width: 430px;
    margin: 0;
    color: #071126;
    font-size: clamp(34px, 4vw, 46px);
    line-height: 1.12;
    font-weight: 850;
}

.lead {
    position: relative;
    z-index: 1;
    max-width: 440px;
    margin: 18px 0 0;
    color: #526179;
    font-size: 17px;
    line-height: 1.55;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-width: 650px;
}

.mini-card,
.auth-card,
.assistant-message {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.06);
}

.mini-card {
    padding: 16px;
}

.mini-card span,
.assistant-message span {
    display: block;
    color: #64748b;
    font-size: 13px;
}

.mini-card strong {
    display: block;
    margin-top: 8px;
}

.auth-card {
    width: min(100%, 620px);
    padding: clamp(28px, 5vw, 64px);
    box-shadow: 0 24px 70px rgb(15 23 42 / 0.06);
}

.auth-panel {
    display: grid;
    align-content: center;
    justify-items: center;
    min-width: 0;
    min-height: 100vh;
    padding: 42px 24px;
}

.card-heading h2 {
    margin: 0;
    color: #071126;
    font-size: 31px;
    line-height: 1.15;
    text-align: center;
}

.card-heading p {
    margin: 10px 0 34px;
    color: #526179;
    font-size: 17px;
    text-align: center;
}

.form-stack {
    display: grid;
    gap: 22px;
}

.form-stack label span {
    display: block;
    margin-bottom: 9px;
    color: #071126;
    font-size: 14px;
    font-weight: 850;
}

.form-stack input,
.composer-inner textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    padding: 13px 14px;
    color: #0f172a;
    transition: border-color 160ms, box-shadow 160ms;
}

.input-shell {
    display: grid !important;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 64px;
    margin: 0 !important;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #ffffff;
    color: #667085;
    padding: 0 16px;
    transition: border-color 160ms, box-shadow 160ms;
}

.input-shell input {
    min-height: 60px;
    border: 0;
    border-radius: 0;
    padding: 0;
    color: #071126;
}

.input-shell:focus-within {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgb(16 185 129 / 0.14);
}

.form-stack input:focus,
.composer-inner textarea:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgb(16 185 129 / 0.14);
}

.input-shell input:focus {
    box-shadow: none;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #526179;
    font-size: 14px;
}

.check-row input {
    width: 20px;
    height: 20px;
    accent-color: #10b981;
}

.primary-button,
.secondary-button,
.send-button {
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
    padding: 13px 16px;
}

.primary-button,
.send-button {
    background: #059669;
    color: #ffffff;
}

.primary-button:hover,
.send-button:hover {
    background: #047857;
}

.secondary-button,
.ghost-button,
.icon-button {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
}

.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover {
    background: #f8fafc;
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 30px 0;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.auth-visual {
    position: relative;
    z-index: 1;
    min-height: 360px;
}

.finance-preview {
    position: relative;
    width: min(360px, 82%);
    margin: 0 auto;
    border-radius: 22px;
    background: rgb(255 255 255 / 0.72);
    padding: 24px;
    box-shadow: 0 28px 70px rgb(16 185 129 / 0.18);
    transform: rotate(4deg);
}

.finance-preview > * {
    transform: rotate(-4deg);
}

.balance-preview,
.preview-stats > div,
.chart-preview {
    border: 1px solid rgb(226 232 240 / 0.75);
    border-radius: 8px;
    background: rgb(255 255 255 / 0.9);
    padding: 18px;
}

.balance-preview span,
.preview-stats span,
.chart-preview span {
    display: block;
    color: #526179;
    font-size: 13px;
    font-weight: 750;
}

.balance-preview strong {
    display: block;
    margin-top: 10px;
    color: #22c55e;
    font-size: 25px;
}

.balance-preview small {
    display: inline-block;
    margin-left: 8px;
    border-radius: 999px;
    background: #dcfce7;
    color: #16a34a;
    font-size: 12px;
    padding: 6px 8px;
    vertical-align: middle;
}

.balance-preview p {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 12px;
}

.preview-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.preview-stats strong {
    display: block;
    margin-top: 10px;
    color: #071126;
    font-size: 14px;
}

.chart-preview {
    margin-top: 12px;
}

.chart-preview svg {
    display: block;
    width: 100%;
    margin-top: 14px;
}

.sparkle-bubble {
    position: absolute;
    left: 2%;
    top: 36%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: #ffffff;
    color: #16a34a;
    font-size: 25px;
    box-shadow: 0 18px 40px rgb(16 185 129 / 0.12);
}

.auth-security,
.auth-footer {
    position: relative;
    z-index: 1;
    margin: 0;
    color: #526179;
    font-size: 14px;
}

.auth-security {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.auth-footer {
    margin-top: 56px;
    text-align: center;
}

.register-details {
    display: grid;
    gap: 18px;
}

.register-details summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 58px;
    list-style: none;
}

.register-details summary::-webkit-details-marker {
    display: none;
}

.register-form {
    margin-top: 18px;
}

.divider::before,
.divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: #e2e8f0;
}

.form-error {
    margin-bottom: 16px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    color: #b91c1c;
    padding: 12px 14px;
}

.chat-layout {
    display: flex;
    min-height: 100vh;
}

.chat-sidebar {
    display: flex;
    flex-direction: column;
    flex: 0 0 240px;
    width: 240px;
    height: 100vh;
    min-height: 100vh;
    border-right: 1px solid #e2e8f0;
    background: #ffffff;
    padding: 28px 20px 24px;
}

.brand-block {
    display: flex;
    align-items: center;
    min-height: 42px;
    margin-bottom: 26px;
}

.brand-block .brand-logo {
    width: min(158px, 100%);
}

.sidebar-user {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 12px;
    margin-bottom: 26px;
    border: 1px solid #e4f2ed;
    border-radius: 12px;
    background: #f5fbf8;
    color: #1e293b;
    padding: 10px 12px;
}

.sidebar-user-avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #dff4eb;
    color: #059669;
    font-size: 16px;
    font-weight: 800;
}

.sidebar-user strong {
    overflow: hidden;
    color: #334155;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-nav {
    display: grid;
    gap: 6px;
    border-top: 1px solid #eef2f1;
    padding-top: 22px;
}

.side-nav a,
.ghost-button {
    border-radius: 11px;
    color: #475569;
    font-size: 15px;
    padding: 11px 14px;
    text-align: left;
    text-decoration: none;
}

.side-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    border-left: 4px solid transparent;
    transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.side-nav a i {
    width: 20px;
    color: #64748b;
    text-align: center;
    transition: color 150ms ease;
}

.side-nav a:hover,
.side-nav a:focus-visible {
    background: #f5fbf8;
    color: #047857;
}

.side-nav .active {
    border-left-color: #10b981;
    background: #edf9f4;
    color: #047857;
    font-weight: 700;
}

.side-nav .active i,
.side-nav a:hover i,
.side-nav a:focus-visible i {
    color: #059669;
}

.content-page {
    flex: 1;
    width: 100%;
    min-width: 0;
    padding: 24px clamp(20px, 2vw, 32px);
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    max-width: 980px;
}

.info-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    padding: 18px;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.06);
}

.info-card span {
    display: block;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.info-card strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
}

.info-card p {
    margin: 10px 0 0;
    color: #64748b;
    line-height: 1.5;
}

.page-actions {
    display: flex;
    justify-content: flex-end;
    max-width: 980px;
    margin-bottom: 16px;
}

.primary-link {
    border-radius: 8px;
    background: #059669;
    color: #ffffff;
    font-weight: 800;
    padding: 10px 14px;
    text-decoration: none;
}

.primary-link:hover {
    background: #047857;
}

.conversation-list {
    display: grid;
    gap: 10px;
    max-width: 980px;
}

.conversation-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    color: inherit;
    padding: 16px;
    text-decoration: none;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.06);
}

.conversation-row:hover {
    border-color: #10b981;
}

.conversation-row strong {
    display: block;
    font-size: 16px;
}

.conversation-row p,
.conversation-row span {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 14px;
}

.pagination-wrap {
    max-width: 980px;
    margin-top: 18px;
    color: #64748b;
}

.ghost-button {
    width: 100%;
    cursor: pointer;
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid #eef2f1;
    padding-top: 22px;
}

.sidebar-footer .ghost-button {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    border-radius: 11px;
    padding: 11px 14px;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.sidebar-footer .ghost-button i {
    width: 20px;
    color: #64748b;
    text-align: center;
}

.sidebar-footer .ghost-button:hover,
.sidebar-footer .ghost-button:focus-visible {
    border-color: #fecaca;
    background: #fff7f7;
    color: #b42318;
}

.sidebar-footer .ghost-button:hover i,
.sidebar-footer .ghost-button:focus-visible i {
    color: #dc2626;
}

.chat-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    width: 100%;
    background: #f6f8fb;
}

.desktop-assistant {
    display: flex;
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 50;
    flex: 0 0 auto;
    width: 370px;
    height: min(640px, calc(100vh - 32px));
    max-height: calc(100vh - 32px);
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 18px 42px rgb(15 23 42 / 0.12);
    flex-direction: column;
    transform-origin: right bottom;
    transition: width 180ms ease, height 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.desktop-assistant.is-minimized {
    width: 360px;
    height: 84px;
}

.chat-layout:has(.review-page) .desktop-assistant {
    bottom: 96px;
}

.assistant-minimized-card {
    display: none;
    align-items: center;
    gap: 14px;
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
    color: #061332;
    cursor: pointer;
    padding: 14px 16px;
    text-align: left;
}

.assistant-minimized-card img {
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    border-radius: 50%;
}

.assistant-minimized-card span {
    display: grid;
    min-width: 0;
    flex: 1;
    gap: 3px;
}

.assistant-minimized-card strong {
    color: #061332;
    font-size: 18px;
    line-height: 1.1;
}

.assistant-minimized-card small {
    color: #64748b;
    font-size: 15px;
    line-height: 1.2;
}

.assistant-minimized-card i {
    display: grid;
    place-items: center;
    width: 48px;
    height: 52px;
    flex: 0 0 auto;
    border-left: 1px solid #e2e8f0;
    color: #334155;
    font-size: 24px;
}

.desktop-assistant.is-minimized .assistant-minimized-card {
    display: flex;
}

.desktop-assistant.is-minimized > header,
.desktop-assistant.is-minimized > .desktop-chat-history,
.desktop-assistant.is-minimized > .desktop-chat-composer {
    display: none;
}

.desktop-assistant > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 14px 14px;
}

.desktop-assistant-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.desktop-assistant > header strong,
.desktop-assistant > header span {
    display: block;
}

.desktop-assistant > header strong {
    color: #061332;
    font-size: 16px;
}

.desktop-assistant > header span {
    margin-top: 3px;
    color: #64748b;
    font-size: 13px;
}

.desktop-chat-history {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
}

.desktop-message-stack {
    max-width: none;
}

.desktop-assistant .assistant-message,
.desktop-assistant .user-message {
    max-width: 100%;
}

.desktop-assistant .assistant-message {
    padding: 12px;
}

.desktop-chat-composer {
    border-top: 1px solid #e2e8f0;
    padding: 12px;
}

.desktop-chat-composer .composer-inner {
    max-width: none;
}

.desktop-chat-composer .icon-button {
    width: 42px;
    min-width: 42px;
    height: 42px;
}

.desktop-chat-composer .send-button {
    min-height: 42px;
    padding: 10px 12px;
}

.message-author-avatar {
    display: block;
    border-radius: 50%;
    object-fit: cover;
}

.message-author-avatar { width: 32px; height: 32px; }

.clear-chat-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    color: #991b1b;
}

.chat-header,
.chat-composer {
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    padding: 16px 24px;
}

.chat-page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    padding: 12px 24px;
}

.chat-page-actions .secondary-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.assistant-personality-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 14px;
    font-weight: 850;
    padding: 8px 12px;
    text-decoration: none;
}

.assistant-settings-page {
    display: grid;
    gap: 24px;
    width: min(100%, 1040px);
    padding: 28px clamp(18px, 3vw, 40px) 112px;
}

.settings-hero,
.intensity-section,
.assistant-preview {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    padding: 20px;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.06);
}

.settings-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.settings-hero span,
.assistant-preview > span {
    display: block;
    color: #047857;
    font-size: 13px;
    font-weight: 850;
}

.settings-hero h2 {
    margin: 6px 0 0;
    color: #061332;
    font-size: 26px;
    line-height: 1.15;
}

.settings-hero p,
.intensity-section p {
    max-width: 620px;
    margin: 8px 0 0;
    color: #64748b;
    line-height: 1.55;
}

.settings-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 13px;
    font-weight: 850;
    padding: 8px 12px;
}

.settings-status[data-state="saving"] {
    background: #f8fafc;
    color: #475569;
}

.settings-status[data-state="error"] {
    background: #fef2f2;
    color: #b91c1c;
}

.personality-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.personality-card {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 150px;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
    padding: 16px;
    text-align: left;
    transition: border-color 160ms, background 160ms, box-shadow 160ms, transform 160ms;
}

.personality-card:hover {
    border-color: #10b981;
    box-shadow: 0 12px 26px rgb(15 23 42 / 0.07);
    transform: translateY(-1px);
}

.personality-card.selected {
    border-color: #059669;
    background: #f0fdf4;
    box-shadow: 0 0 0 3px rgb(16 185 129 / 0.12);
}

.personality-card > i {
    width: 34px;
    height: 34px;
    color: #047857;
    font-size: 24px;
}

.personality-card strong {
    align-self: end;
    overflow-wrap: anywhere;
    font-size: 16px;
}

.personality-card span {
    color: #64748b;
    font-size: 13px;
    font-weight: 750;
}

.selected-indicator {
    display: none;
    align-items: center;
    gap: 5px;
    margin-top: 12px;
    color: #047857;
    font-size: 12px;
    font-weight: 900;
}

.personality-card.selected .selected-indicator {
    display: inline-flex;
}

.intensity-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
}

.intensity-section h3 {
    margin: 0;
    color: #061332;
    font-size: 20px;
}

.intensity-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.intensity-options button {
    min-height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    font-weight: 850;
    padding: 9px 13px;
}

.intensity-options button.selected {
    border-color: #059669;
    background: #059669;
    color: #ffffff;
}

.assistant-preview {
    display: grid;
    gap: 14px;
}

.assistant-preview div {
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    background: #f7fffb;
    padding: 18px;
}

.assistant-preview strong {
    display: block;
    color: #061332;
    font-size: 16px;
}

.assistant-preview p {
    margin: 12px 0 0;
    color: #334155;
    line-height: 1.65;
    white-space: pre-line;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-page-actions {
    display: none;
}

.chat-header h1 {
    margin: 0;
    font-size: 20px;
}

.chat-header p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 14px;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
}

.message-stack {
    display: grid;
    gap: 16px;
    max-width: 760px;
    margin: 0 auto;
}

.assistant-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: min(760px, 92%);
    padding: 0;
}

.user-message {
    justify-self: end;
    max-width: 80%;
    border-radius: 8px;
    background: #059669;
    color: #ffffff;
    padding: 14px 16px;
}

.message-bubble {
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #ffffff;
    padding: 14px 16px;
}

.assistant-message .message-bubble {
    min-width: 0;
    background: #f8fafc;
}

.assistant-message:not(:has(.message-bubble)) {
    display: block;
    padding: 18px;
}

.user-message .message-bubble {
    border: 0;
    background: transparent;
    padding: 0;
}

.assistant-avatar {
    display: inline-grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    background: #ecfdf5;
    color: #047857;
    font-size: 15px;
    font-weight: 900;
}

.message-author {
    display: flex !important;
    align-items: center;
    flex-direction: row;
    gap: 6px;
    width: fit-content;
}

.user-message span {
    display: block;
    color: #d1fae5;
    font-size: 13px;
    font-weight: 800;
}

.user-message p {
    margin: 6px 0 0;
    line-height: 1.55;
}

.assistant-message span {
    color: #047857;
    font-weight: 800;
}

.assistant-message p,
.assistant-message .message-content {
    margin: 8px 0 0;
    color: #334155;
    line-height: 1.6;
}

.assistant-message .message-content {
    overflow-wrap: anywhere;
    word-break: normal;
}

.assistant-message .message-content > * {
    margin-block: 0;
}

.assistant-message .message-content > * + * {
    margin-top: 8px;
}

.assistant-message .message-content ul,
.assistant-message .message-content ol {
    padding-left: 1.25rem;
}

.assistant-message .message-content li + li {
    margin-top: 6px;
}

.assistant-message .message-content strong {
    color: #0f172a;
    font-weight: 850;
}

.assistant-message .message-content em {
    font-style: italic;
}

.assistant-message .message-content code {
    border: 1px solid #dbe4ee;
    border-radius: 6px;
    background: #f8fafc;
    color: #0f172a;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.92em;
    padding: 1px 5px;
}

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.sticker-message {
    display: inline-grid;
    width: 104px;
    min-height: 92px;
    place-items: center;
    margin: 12px 0 0;
    overflow: hidden;
}

.sticker-message img {
    display: block;
    width: 96px;
    height: 96px;
    object-fit: contain;
}

.sticker-message[data-placeholder="true"] {
    border: 1px dashed #a7f3d0;
    border-radius: 8px;
    background: #ecfdf5;
    color: #047857;
    padding: 10px;
}

.sticker-message > span {
    font-size: 28px;
    line-height: 1;
}

.sticker-message figcaption {
    max-width: 100%;
    color: #047857;
    font-size: 12px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.typing-dots i {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #10b981;
    animation: typing-bounce 1s infinite ease-in-out;
}

.typing-dots i:nth-child(2) {
    animation-delay: 0.16s;
}

.typing-dots i:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes typing-bounce {
    0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

.quick-replies button {
    border: 1px solid #10b981;
    border-radius: 8px;
    background: #ecfdf5;
    color: #047857;
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    padding: 8px 10px;
}

.quick-replies button:hover {
    background: #d1fae5;
}

.assistant-message.error {
    border-color: #fecaca;
    background: #fef2f2;
}

.assistant-message.error span,
.assistant-message.error p,
.assistant-message.error .message-content {
    color: #b91c1c;
}

.assistant-message.muted span {
    color: #64748b;
}

.chat-composer {
    border-top: 1px solid #e2e8f0;
    border-bottom: 0;
}

.composer-inner {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    max-width: 760px;
    margin: 0 auto;
}

.composer-actions {
    position: relative;
    flex: 0 0 auto;
}

.composer-action-menu {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    z-index: 30;
    display: grid;
    min-width: 190px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 40px rgb(15 23 42 / 0.14);
}

.composer-action-menu[hidden] {
    display: none;
}

.composer-action-menu button,
.composer-action-menu a {
    display: flex;
    align-items: center;
    width: 100%;
    border: 0;
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    padding: 11px 12px;
    text-align: left;
    text-decoration: none;
}

.composer-action-menu button:hover,
.composer-action-menu button:focus,
.composer-action-menu a:hover,
.composer-action-menu a:focus {
    background: #f8fafc;
    outline: none;
}

.purchase-item-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 92px 82px 112px;
    gap: 10px;
    margin-top: 12px;
}

.purchase-modal-card {
    width: min(50vw, calc(100vw - 32px));
    min-width: 720px;
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
}

.purchase-modal-card .transaction-manual-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.purchase-modal-card .transaction-manual-fields .field-wide {
    grid-column: 1 / -1;
}

.purchase-item-grid label,
.purchase-item-grid label span {
    display: grid;
    gap: 5px;
    min-width: 0;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.purchase-item-grid input {
    width: 100%;
    min-height: 40px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 10px;
}

@media (max-width: 767px) {
    .purchase-modal-card {
        width: min(100%, calc(100vw - 24px));
        min-width: 0;
        max-height: calc(100dvh - 24px);
    }

    .purchase-modal-card .transaction-manual-fields,
    .purchase-item-grid {
        grid-template-columns: 1fr;
    }
}

.purchases-dashboard {
    display: grid;
    gap: 24px;
    width: 100%;
    max-width: 1440px;
    margin-inline: auto;
    padding-bottom: 118px;
}

.purchases-hero,
.purchases-hero-title,
.purchases-tabs,
.purchases-filters,
.purchase-summary-card small,
.purchases-side-card header,
.purchases-category-widget li,
.purchases-top-products li,
.purchases-helper {
    display: flex;
    align-items: center;
}

.purchases-hero {
    justify-content: space-between;
    gap: 20px;
}

.purchases-hero-title {
    min-width: 0;
    gap: 16px;
}

.purchases-hero-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    border-radius: 12px;
    background: #dff7ec;
    color: #047857;
    font-size: 26px;
}

.purchases-hero h1 {
    margin: 0;
    color: #061332;
    font-size: 32px;
    line-height: 1.1;
}

.purchases-hero p {
    margin: 8px 0 0;
    color: #526179;
}

.purchases-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.purchase-summary-card {
    position: relative;
    min-height: 146px;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #ffffff;
    padding: 28px 28px 20px 92px;
    box-shadow: 0 10px 26px rgb(15 23 42 / 0.04);
}

.purchase-summary-card b {
    position: absolute;
    left: 28px;
    top: 28px;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #e5f8ef;
    color: #059669;
    font-size: 24px;
}

.purchase-summary-card span {
    display: block;
    color: #061332;
    font-size: 15px;
    font-weight: 800;
}

.purchase-summary-card strong {
    display: block;
    margin: 14px 0;
    color: #061332;
    font-size: 30px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.purchase-summary-card small {
    gap: 8px;
    color: #526179;
    font-size: 13px;
}

.purchase-summary-card small i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #10b981;
}

.purchases-tabs {
    gap: 34px;
    border-bottom: 1px solid #dbe4ee;
}

.purchases-tabs a {
    position: relative;
    color: #334155;
    font-weight: 700;
    padding: 0 0 14px;
    text-decoration: none;
}

.purchases-tabs a.active {
    color: #061332;
}

.purchases-tabs a.active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: #0891b2;
}

.purchases-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(320px, 28vw, 390px);
    gap: 28px;
    align-items: start;
}

.purchases-primary-column,
.purchases-side-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.purchases-filters {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) auto auto;
    gap: 12px;
}

.purchases-filters label,
.purchases-filters button {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    padding: 0 14px;
}

.purchases-filters label {
    min-width: 0;
}

.purchases-filters input {
    width: 100%;
    border: 0;
    outline: 0;
    color: #061332;
}

.purchases-filters button {
    min-width: 142px;
    justify-content: space-between;
    cursor: pointer;
}

.purchases-history-card,
.purchases-side-card {
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 10px 26px rgb(15 23 42 / 0.04);
}

.purchases-history-card {
    width: 100%;
}

.purchases-empty-state {
    display: grid;
    justify-items: center;
    align-content: center;
    min-height: 380px;
    gap: 14px;
    padding: 42px 24px;
    text-align: center;
}

.purchases-empty-state > span {
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    border-radius: 18px;
    background: #dff7ec;
    color: #059669;
    font-size: 42px;
}

.purchases-empty-state strong {
    color: #061332;
    font-size: 20px;
}

.purchases-empty-state p {
    max-width: 470px;
    margin: 0;
    color: #526179;
    line-height: 1.55;
}

.purchases-helper {
    justify-content: center;
    gap: 12px;
    margin: 8px 0 0;
    color: #526179;
    text-align: center;
}

.purchases-side-card {
    min-width: 0;
    padding: 26px;
}

.purchases-side-card header {
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.purchases-side-card h2 {
    margin: 0;
    color: #061332;
    font-size: 17px;
}

.purchases-side-card header a {
    color: #059669;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.purchases-category-widget {
    display: grid;
    grid-template-columns: minmax(112px, 150px) minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}

.purchases-donut {
    display: grid;
    place-items: center;
    width: min(150px, 100%);
    aspect-ratio: 1;
    border-radius: 50%;
    background: conic-gradient(#e5e7eb 0 100%);
}

.purchases-donut span {
    display: grid;
    place-items: center;
    width: 88px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #ffffff;
    text-align: center;
}

.purchases-donut strong {
    color: #061332;
    font-size: 14px;
}

.purchases-donut small {
    color: #64748b;
}

@media (max-width: 1100px) {
    .purchases-main-grid {
        grid-template-columns: 1fr;
    }

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

.purchases-category-widget ul,
.purchases-top-products {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.purchases-category-widget li {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    min-width: 0;
    gap: 10px;
    color: #334155;
    font-size: 13px;
}

.purchases-category-widget li i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--category-color);
}

.purchases-category-widget li span,
.product-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    gap: 12px;
}

.product-count {
    flex-shrink: 0;
}

.purchases-side-empty {
    display: grid;
    justify-items: center;
    gap: 10px;
    min-height: 150px;
    color: #526179;
    text-align: center;
}

.purchases-side-empty i {
    color: #94a3b8;
    font-size: 34px;
}

.purchases-side-empty strong {
    color: #061332;
}

.purchases-side-empty p {
    margin: 0;
    line-height: 1.45;
}

.purchases-top-products li {
    color: #334155;
}

.composer-inner textarea {
    min-height: 48px;
    max-height: 140px;
    resize: vertical;
}

.icon-button {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 22px;
}

.mobile-logout {
    display: none;
}

.mobile-bottom-nav {
    display: none;
}

.mobile-nav-add {
    display: none;
}

.home-page {
    display: grid;
    gap: 28px;
    max-width: 1040px;
}

.balance-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
}

.balance-strip > div {
    min-width: 0;
    padding: 18px;
}

.balance-strip > div + div {
    border-left: 1px solid #e2e8f0;
}

.balance-strip span,
.assistant-panel > div:first-child > span,
.movement-row span {
    display: block;
    color: #64748b;
    font-size: 13px;
}

.balance-strip strong {
    display: block;
    margin-top: 8px;
    font-size: 22px;
}

.positive { color: #047857; }
.negative { color: #b42318; }

.assistant-panel {
    border: 1px solid #b7e4d2;
    border-radius: 8px;
    background: #f7fffb;
    padding: 22px;
}

.assistant-panel h2,
.section-heading h2 {
    margin: 5px 0 0;
    font-size: 20px;
}

.compact-chat:empty,
.compact-chat .message-stack:empty {
    display: none;
}

.compact-chat {
    max-height: 280px;
    overflow-y: auto;
    padding: 14px 0 0;
}

.compact-chat .message-stack {
    gap: 10px;
    max-width: none;
}

.home-composer {
    max-width: none;
    margin-top: 16px;
}

.quick-prompts,
.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.quick-prompts button,
.filter-tabs a {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    padding: 8px 11px;
    text-decoration: none;
}

.filter-tabs {
    margin: 0 0 18px;
    -ms-overflow-style: none;
    scrollbar-width: none !important;
}

.filter-tabs::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.filter-tabs .active {
    border-color: #059669;
    background: #ecfdf5;
    color: #047857;
    font-weight: 800;
}

.section-heading,
.movement-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

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

.section-heading a {
    color: #047857;
    font-weight: 700;
    text-decoration: none;
}

.movement-list {
    border-top: 1px solid #e2e8f0;
}

.movement-row {
    min-height: 68px;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 4px;
}

.movement-row > div {
    min-width: 0;
}

.movement-row span {
    margin-top: 5px;
}

.movement-row > strong {
    flex: 0 0 auto;
}

.full-list {
    max-width: 980px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    padding: 0 16px;
}

.empty-state {
    color: #64748b;
    padding: 20px 4px;
}

.transactions-page {
    width: min(100%, 1960px);
    max-width: 1960px;
    margin-inline: auto;
}

.transactions-hero,
.transactions-toolbar,
.transactions-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.transactions-hero {
    margin-bottom: 28px;
}

.transactions-hero h1,
.transactions-section-heading h2,
.category-ranking-card h2 {
    color: #061332;
}

.transactions-hero h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.15;
}

.transactions-hero p {
    margin: 6px 0 0;
    color: #64748b;
}

.transactions-actions {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.transactions-actions .primary-button,
.transactions-actions .secondary-button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    text-decoration: none;
}

.transactions-actions .primary-button {
    background: #061332;
}

.transactions-actions .primary-button:hover {
    background: #0b2459;
}

.transactions-toolbar {
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.period-navigation {
    display: flex;
    align-items: center;
    gap: 10px;
}

.period-picker {
    position: relative;
}

.period-picker input {
    width: 210px;
    min-height: 46px;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #ffffff;
    color: transparent;
    cursor: pointer;
    padding: 10px 14px;
}

.period-picker span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    color: #0f172a;
    font-weight: 800;
}

.period-arrow {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    font-size: 24px;
    line-height: 1;
    text-decoration: none;
}

.period-arrow:hover {
    border-color: #a7f3d0;
    background: #f8fffc;
}

.period-summary.finance-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    border: 0;
    background: transparent;
    margin-bottom: 32px;
    width: 100%;
}

.finance-card {
    position: relative;
    min-width: 0;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #ffffff;
    padding: 18px;
    box-shadow: 0 4px 14px rgb(15 23 42 / 0.04);
}

.finance-card.income { background: #f7fffb; }
.finance-card.expense { background: #fffafa; }
.finance-card.result { background: #f8fbff; }
.finance-card.projected { background: #fffdf7; }

.finance-card span,
.finance-card small {
    display: block;
    color: #475569;
    font-size: 13px;
}

.finance-card span {
    font-weight: 800;
}

.finance-card b {
    position: absolute;
    top: 18px;
    right: 18px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 18px;
    font-size: 11px;
}

.finance-card.income b { background: #bbf7d0; color: #047857; }
.finance-card.expense b { background: #fecaca; color: #b42318; }
.finance-card.result b { background: #bfdbfe; color: #1d4ed8; }
.finance-card.projected b { background: #fde68a; color: #b45309; }

.finance-card strong {
    display: block;
    margin: 18px 0 12px;
    font-size: 24px;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.manual-entry {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 18px;
    padding: 14px 16px;
}

.manual-entry > summary {
    cursor: pointer;
    font-weight: 800;
}

.inline-chat-panel {
    display: grid;
    gap: 14px;
    border: 1px solid #b7e4d2;
    border-radius: 8px;
    background: #f7fffb;
    margin: -10px 0 24px;
    padding: 18px;
    box-shadow: 0 14px 36px rgb(15 23 42 / 0.07);
}

.inline-chat-panel[hidden] {
    display: none;
}

.inline-chat-panel > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.inline-chat-panel > header strong {
    display: block;
    font-size: 17px;
}

.inline-chat-panel > header p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 14px;
}

.inline-chat-panel .icon-button {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    font-size: 16px;
    font-weight: 900;
}

.inline-chat-history {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #ffffff;
    padding: 14px;
}

.inline-chat-history .message-stack {
    max-width: none;
}

.inline-chat-composer {
    max-width: none;
}
.manual-entry-form, .recurrence-options > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.manual-entry-form label { min-width: 0; color: #475569; font-size: 12px; font-weight: 700; }
.manual-entry-form input, .manual-entry-form select { display: block; width: 100%; min-height: 40px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; margin-top: 5px; padding: 8px; }
.manual-entry-form .field-wide { grid-column: span 2; }
.recurring-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid #e2e8f0; padding-top: 14px; }
.recurring-toggle span, .recurring-toggle strong, .recurring-toggle small { display: block; }
.recurring-toggle small { color: #64748b; font-weight: 400; margin-top: 3px; }
.manual-entry-form .recurring-toggle input { appearance: none; position: relative; width: 44px; min-width: 44px; height: 24px; min-height: 24px; border: 0; border-radius: 12px; background: #cbd5e1; cursor: pointer; margin: 0; padding: 0; transition: background 160ms ease; }
.manual-entry-form .recurring-toggle input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 160ms ease; }
.manual-entry-form .recurring-toggle input:checked { background: #059669; }
.manual-entry-form .recurring-toggle input:checked::after { transform: translateX(20px); }
.manual-entry-form .recurring-toggle input:focus-visible { outline: 3px solid #a7f3d0; outline-offset: 2px; }
.recurrence-options { grid-column: 1 / -1; border-top: 1px solid #e2e8f0; padding-top: 2px; }
.recurrence-options[hidden] { display: none; }
.form-success { border: 1px solid #86b7a7; border-radius: 6px; background: #ecfdf5; color: #047857; margin: 0 0 14px; padding: 10px 12px; }

.registration-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.turnstile-field {
    display: flex;
    justify-content: flex-start;
    min-height: 65px;
}

@media (max-width: 420px) {
    .turnstile-field {
        transform: scale(.92);
        transform-origin: left center;
    }
}
.row-recurrence { flex: 0 0 100%; border-top: 1px dashed #cbd5e1; padding: 9px 0 2px 58px; }
.row-recurrence summary { width: fit-content; color: #047857; cursor: pointer; font-size: 12px; font-weight: 800; }
.row-recurrence form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.row-recurrence label { color: #64748b; font-size: 11px; font-weight: 700; }
.row-recurrence input, .row-recurrence select { display: block; width: 100%; min-height: 36px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; margin-top: 4px; padding: 7px; }
.row-recurrence button { align-self: end; min-height: 36px; border: 0; border-radius: 6px; background: #047857; color: #fff; cursor: pointer; font-weight: 800; padding: 8px 12px; }

.transactions-analytics {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, .9fr);
    gap: 14px;
    margin-bottom: 14px;
}

.category-analytics-card,
.quick-insights-card {
    min-width: 0;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #ffffff;
    padding: 18px;
    box-shadow: 0 4px 14px rgb(15 23 42 / 0.04);
}

.analytics-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.analytics-card-heading span {
    color: #64748b;
    font-size: 12px;
}

.analytics-card-heading span:first-child {
    display: block;
    color: #047857;
    font-weight: 800;
    text-transform: uppercase;
}

.analytics-card-heading h2 {
    margin: 4px 0 0;
    color: #061332;
    font-size: 17px;
}

.category-chart-layout {
    display: grid;
    grid-template-columns: minmax(150px, .8fr) minmax(0, 1.4fr);
    align-items: center;
    gap: 20px;
}

.category-donut-wrap {
    position: relative;
    width: min(190px, 100%);
    aspect-ratio: 1;
    margin-inline: auto;
}

.category-expense-chart {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.category-donut-total {
    position: absolute;
    inset: 0;
    display: grid;
    align-content: center;
    justify-content: center;
    gap: 4px;
    pointer-events: none;
    text-align: center;
}

.category-donut-total small { color: #64748b; font-size: 11px; }
.category-donut-total strong { color: #061332; font-size: 16px; }

.category-donut-total > * {
    display: grid;
}

.category-legend {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.category-legend li {
    display: grid;
    grid-template-columns: 9px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 7px;
    color: #334155;
    font-size: 12px;
}

.category-legend li > i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--legend-color);
}

.category-legend strong,
.category-legend span,
.category-legend em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-legend strong { font-weight: 700; }
.category-legend span { color: #475569; }
.category-legend em { color: #64748b; font-style: normal; }

.quick-insight-item,
.quick-insight-empty {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid #eef2f7;
    border-radius: 8px;
    background: #f8fafc;
    padding: 12px;
}

.quick-insight-item b {
    display: grid;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 8px;
    background: #ecfdf5;
    color: #047857;
}

.quick-insight-item p,
.quick-insight-empty p { margin: 0; color: #475569; font-size: 13px; line-height: 1.5; }
.quick-insight-empty i { color: #64748b; font-size: 18px; }

.diagnostic-content {
    max-height: 260px;
    overflow-y: auto;
    color: #334155;
    font-size: 13px;
    line-height: 1.55;
}

.diagnostic-content p { margin: 0; }
.diagnostic-content p + p,
.diagnostic-content ul + p { margin-top: 8px; }
.diagnostic-content ul { margin: 8px 0 0; padding-left: 18px; }
.diagnostic-meta { color: #64748b; font-size: 11px; }

.diagnostic-form { margin-top: 14px; }
.diagnostic-form button { display: inline-flex; align-items: center; gap: 8px; }

.transactions-content-stack {
    min-width: 0;
}

@media (max-width: 1100px) {
    .transactions-analytics {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .category-chart-layout {
        grid-template-columns: 1fr;
    }

    .category-donut-wrap {
        width: min(170px, 65vw);
    }
}

.transactions-insights-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
    gap: 14px;
}

.transactions-list-column {
    min-width: 0;
}

.transactions-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.transactions-section-heading h2,
.category-ranking-card h2 {
    margin: 0;
    font-size: 20px;
}

.transactions-section-heading p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 13px;
}

.category-ranking-card {
    position: sticky;
    top: 18px;
    display: grid;
    gap: 18px;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #ffffff;
    padding: 18px;
    box-shadow: 0 4px 14px rgb(15 23 42 / 0.04);
}

.category-ranking-card header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.category-ranking-card header span {
    display: block;
    color: #047857;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.category-ranking-card header strong {
    flex: 0 0 auto;
    color: #0f172a;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

.category-ranking-list {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.category-ranking-list li {
    display: grid;
    gap: 9px;
}

.ranking-row {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.ranking-row b {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #ecfdf5;
    color: #047857;
    font-size: 13px;
}

.ranking-row div {
    min-width: 0;
}

.ranking-row strong,
.ranking-row span,
.ranking-row em {
    display: block;
}

.ranking-row strong {
    overflow: hidden;
    color: #0f172a;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-row span {
    margin-top: 3px;
    color: #64748b;
    font-size: 12px;
}

.ranking-row em {
    color: #0f172a;
    font-size: 13px;
    font-style: normal;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
}

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

.ranking-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #059669;
}

.ranking-empty {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    padding: 16px;
}

.ranking-empty strong {
    display: block;
    color: #0f172a;
}

.ranking-empty p {
    margin: 6px 0 0;
    color: #64748b;
    line-height: 1.45;
}

.transactions-list-section h2 {
    margin: 0 0 16px;
    font-size: 20px;
}

.transactions-section-heading h2 {
    margin: 0;
}

.transaction-group {
    display: grid;
    gap: 10px;
    margin-bottom: 22px;
}

.transaction-group h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #0f172a;
    font-size: 15px;
}

.transaction-group h3 small {
    border-left: 1px solid #cbd5e1;
    color: #047857;
    font-size: 13px;
    padding-left: 8px;
}

.date-icon {
    width: 16px;
    height: 16px;
    border: 2px solid #475569;
    border-radius: 4px;
}

.transaction-group-list {
    overflow: visible;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 4px 14px rgb(15 23 42 / 0.04);
}

.transactions-data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.transactions-data-table th {
    border-bottom: 1px solid #dbe4ee;
    background: #f8fafc;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
    padding: 11px 18px;
    text-align: left;
    text-transform: uppercase;
}

.transactions-data-table th:first-child { width: 86px; }
.transactions-data-table th:nth-child(2) { width: 28%; }
.transactions-data-table th:nth-child(3) { width: 15%; }
.transactions-data-table th:nth-child(4) { width: 14%; }
.transactions-data-table th:nth-child(5) { width: 18%; }
.transactions-data-table .amount-column { width: 13%; text-align: right; }
.transactions-data-table .actions-column { width: 54px; }

.transaction-row {
    position: relative;
    align-items: center;
    transition: background-color 180ms ease;
}

.transaction-row + .transaction-row {
    border-top: 1px solid #e2e8f0;
}

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

.transaction-row > td {
    padding: 14px 10px;
    vertical-align: middle;
}

.transaction-row > td:first-child { padding-left: 18px; }
.transaction-row > td:last-child { padding-left: 0; padding-right: 12px; width: 54px; }

.transaction-main-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.transaction-date-cell strong,
.transaction-date-cell span {
    display: block;
}

.transaction-date-cell strong {
    color: #0f172a;
    font-size: 14px;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
}

.transaction-date-cell span {
    margin-top: 3px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.transactions-empty-cell {
    padding: 0 !important;
}

.transactions-empty-cell .empty-state {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.transaction-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 900;
}

.transaction-icon.cup { background: #fff1f2; color: #e11d48; }
.transaction-icon.money { background: #dcfce7; color: #047857; }
.transaction-icon.home { background: #ffedd5; color: #ea580c; }
.transaction-icon.water { background: #e0f2fe; color: #0284c7; }
.transaction-icon.wifi { background: #f3e8ff; color: #7e22ce; }
.transaction-icon.bank { background: #f3e8ff; color: #9333ea; }
.transaction-icon.beauty { background: #fce7f3; color: #db2777; }
.transaction-icon.pet { background: #fff7ed; color: #b45309; }
.transaction-icon.card { background: #e0f2fe; color: #2563eb; }
.transaction-icon.generic { background: #f1f5f9; color: #475569; }

.transaction-copy {
    min-width: 0;
}

.transaction-menu-cell {
    position: relative;
}

@media (max-width: 1500px) {
    .transactions-insights-layout {
        grid-template-columns: 1fr;
    }

    .category-ranking-card {
        position: static;
    }
}

.transaction-copy strong {
    display: block;
    overflow: hidden;
    color: #0f172a;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-copy span,
.transaction-value span {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 13px;
}

@media (min-width: 1200px) {
    .transaction-copy span {
        display: none;
    }
}

.transaction-meta {
    min-width: 0;
}

.transaction-meta span {
    display: block;
    margin-bottom: 4px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.transaction-meta strong {
    display: block;
    overflow: hidden;
    color: #334155;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 768px) and (max-width: 1199px) {
    .transactions-page {
        width: 100%;
        max-width: none;
    }

    .transaction-row {
        font-size: 13px;
    }

    .transactions-data-table th:nth-child(3),
    .transactions-data-table td:nth-child(3),
    .transactions-data-table th:nth-child(4),
    .transactions-data-table td:nth-child(4) { display: none; }

    .transaction-account {
        display: none;
    }

    .transaction-copy span {
        display: block;
    }
}

@media (max-width: 767px) {
    .transaction-group-list { border-radius: 8px; }

    .transactions-data-table,
    .transactions-data-table tbody,
    .transactions-data-table tr,
    .transactions-data-table td { display: block; }

    .transactions-data-table thead { display: none; }

    .transaction-row { padding: 14px; }
    .transaction-row + .transaction-row { border-top: 1px solid #e2e8f0; }
    .transaction-row > td,
    .transaction-row > td:first-child,
    .transaction-row > td:last-child {
        width: auto;
        padding: 0;
    }

    .transaction-date-cell {
        display: flex !important;
        align-items: center;
        gap: 8px;
        margin-bottom: 10px;
        color: #64748b;
    }

    .transaction-date-cell strong,
    .transaction-date-cell span {
        display: inline;
        margin: 0;
    }

    .transaction-main-cell { padding-right: 42px !important; }
    .transaction-copy { min-height: 40px; }
    .transaction-copy span { display: block; }
    .transaction-meta,
    .transaction-badges-cell {
        display: inline-block !important;
        margin-top: 12px;
        margin-right: 16px;
        max-width: calc(50% - 20px);
        vertical-align: top;
    }

    .transaction-badges-cell { max-width: 100%; }
    .transaction-value { margin-top: 12px; text-align: left; }
    .transaction-menu-cell { position: absolute; top: 14px; right: 8px; }
}

.transaction-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
}

.status-badge {
    display: inline-flex !important;
    align-items: center;
    width: fit-content;
    min-height: 22px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #f8fafc;
    color: #475569 !important;
    font-size: 10px !important;
    font-weight: 900;
    line-height: 1;
    padding: 4px 8px;
}

.status-badge.realized {
    border-color: #a7f3d0;
    background: #ecfdf5;
    color: #047857 !important;
}

.status-badge.scheduled {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8 !important;
}

.status-badge.recurring {
    border-color: #fde68a;
    background: #fffbeb;
    color: #b45309 !important;
}

.status-badge.cancelled {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b42318 !important;
}

.transaction-value {
    min-width: 0;
    text-align: right;
}

.transaction-value strong {
    display: block;
    font-size: 16px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.transaction-menu {
    position: relative;
}

.transaction-menu > summary {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: #334155;
    cursor: pointer;
    list-style: none;
}

.transaction-menu > summary::-webkit-details-marker,
.recurrence-menu > summary::-webkit-details-marker {
    display: none;
}

.transaction-menu > summary:hover,
.transaction-menu[open] > summary {
    background: #eef2f7;
}

.transaction-menu > summary span {
    display: block;
    margin-top: -8px;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
    transform: rotate(90deg);
}

.transaction-menu > summary > i,
.period-arrow > i,
.filter-action > i,
.finance-card b > i,
.transaction-icon > i,
.mobile-bottom-nav .nav-icon {
    line-height: 1;
}

.transaction-menu-panel {
    position: absolute;
    top: 36px;
    right: 0;
    z-index: 10;
    width: 320px;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 20px 48px rgb(15 23 42 / 0.16);
    padding: 6px;
}

.transaction-menu-panel button,
.recurrence-menu > summary,
.edit-transaction-menu > summary,
.menu-note {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #334155;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    padding: 9px 10px;
    text-align: left;
}

.transaction-menu-panel button:hover,
.recurrence-menu > summary:hover,
.edit-transaction-menu > summary:hover {
    background: #f1f5f9;
}

.transaction-menu-panel .danger-menu-action {
    color: #b91c1c;
}

.transaction-menu-panel .danger-menu-action:hover {
    background: #fef2f2;
}

.installments-option span,
.installments-option small {
    display: block;
}

.installments-option span {
    color: #334155;
    font-weight: 800;
}

.installments-option input {
    width: auto;
    margin-right: 6px;
}

.installments-option small {
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.menu-note {
    color: #64748b;
    cursor: default;
}

.recurrence-menu,
.edit-transaction-menu {
    border-top: 1px solid #eef2f7;
    margin-top: 4px;
    padding-top: 4px;
}

.edit-transaction-menu {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

.recurrence-menu form,
.edit-transaction-menu form {
    display: grid;
    gap: 8px;
    padding: 8px 4px 4px;
}

.recurrence-menu label,
.edit-transaction-menu label {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
}

.recurrence-menu input,
.recurrence-menu select,
.edit-transaction-menu input,
.edit-transaction-menu select {
    display: block;
    width: 100%;
    min-height: 34px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    margin-top: 4px;
    padding: 6px 8px;
}

.recurrence-menu form button,
.edit-transaction-menu form button {
    background: #047857;
    color: #ffffff;
    text-align: center;
}

.transactions-footer {
    margin-top: 14px;
    color: #64748b;
    font-size: 14px;
}

.transactions-footer p,
.transactions-footer .pagination-wrap {
    margin: 0;
}

[data-dashboard-summary],
[data-transactions-analytics],
[data-transactions-list],
[data-transactions-pagination] {
    position: relative;
}

.is-loading {
    overflow: hidden;
}

.region-skeleton {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: grid;
    gap: 12px;
    border-radius: 8px;
    background: rgba(248, 250, 252, .88);
    padding: 14px;
}

.region-skeleton.cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.skeleton-card {
    display: grid;
    align-content: center;
    gap: 12px;
    min-height: 118px;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #ffffff;
    padding: 18px;
}

.skeleton-line,
.skeleton-donut {
    position: relative;
    overflow: hidden;
    display: block;
    border-radius: 8px;
    background: #e2e8f0;
}

.skeleton-line {
    width: 58%;
    height: 12px;
}

.skeleton-line.wide { width: 82%; height: 18px; }
.skeleton-line.short { width: 38%; }

.skeleton-donut {
    width: min(170px, 45%);
    aspect-ratio: 1;
    border-radius: 50%;
    margin: 20px auto;
}

.skeleton-line::after,
.skeleton-donut::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .62), transparent);
    animation: skeleton-loading 1.2s infinite;
}

.region-skeleton.table {
    position: static;
    padding: 0;
}

.region-skeleton.table table {
    width: 100%;
    border-collapse: collapse;
}

.region-skeleton.table td {
    padding: 14px 10px;
}

.region-skeleton.table tr + tr {
    border-top: 1px solid #e2e8f0;
}

.is-row-loading {
    opacity: .55;
    pointer-events: none;
}

.is-row-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 8px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent);
    animation: skeleton-loading 1.2s infinite;
}

.transaction-feedback.is-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b42318;
}

.field-error {
    display: block;
    margin-top: 5px;
    color: #b42318;
    font-size: 11px;
    font-weight: 800;
}

[aria-invalid="true"] {
    border-color: #fca5a5 !important;
}

@keyframes skeleton-loading {
    100% {
        transform: translateX(100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton-line::after,
    .skeleton-donut::after {
        animation: none;
    }
}

@media (max-width: 767px) {
    .region-skeleton.cards {
        grid-template-columns: 1fr;
    }

    .region-skeleton.table table,
    .region-skeleton.table tbody,
    .region-skeleton.table tr,
    .region-skeleton.table td {
        display: block;
    }
}

.simple-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.simple-pagination a,
.simple-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 34px;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    font-size: 13px;
    font-weight: 800;
    padding: 7px 10px;
    text-decoration: none;
}

.simple-pagination a:hover {
    border-color: #86efac;
    background: #ecfdf5;
    color: #047857;
}

.simple-pagination .active {
    border-color: #059669;
    background: #059669;
    color: #ffffff;
}

.simple-pagination .disabled {
    color: #94a3b8;
}

.ai-tip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    background: #f0fdfa;
    margin-top: 24px;
    padding: 16px 20px;
}

.ai-tip strong {
    color: #047857;
}

.ai-tip p {
    margin: 4px 0 0;
    color: #334155;
}

.ai-tip a {
    flex: 0 0 auto;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    background: #ffffff;
    color: #047857;
    font-size: 13px;
    font-weight: 800;
    padding: 9px 14px;
    text-decoration: none;
}

.empty-transactions {
    display: grid;
    gap: 10px;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #ffffff;
    padding: 28px;
}

.empty-transactions strong {
    font-size: 18px;
}

.empty-transactions p {
    margin: 0;
}

.home-page {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 18px;
    max-width: 1120px;
}

.home-hero,
.home-empty-state,
.home-balance-card,
.home-period-link,
.home-month-summary,
.home-section {
    min-width: 0;
}

.home-hero {
    grid-column: 1 / -1;
}

.home-hero span {
    display: block;
    color: #047857;
    font-size: 15px;
    font-weight: 800;
}

.home-hero h1 {
    margin: 4px 0 0;
    font-size: 30px;
    line-height: 1.12;
}

.home-empty-state,
.home-balance-card,
.home-section {
    border: 1px solid #dbe4ee;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgb(15 23 42 / 0.05);
}

.home-empty-state {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
}

.home-empty-state strong {
    display: block;
    font-size: 18px;
}

.home-empty-state p {
    margin: 6px 0 0;
    color: #64748b;
    line-height: 1.5;
}

.home-balance-card {
    display: grid;
    gap: 12px;
    align-content: start;
    padding: 24px;
    background: linear-gradient(145deg, #063f32, #059669);
    color: #ffffff;
}

.home-balance-card > span,
.home-balance-card small {
    color: rgb(255 255 255 / 0.76);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.home-balance-card > strong {
    overflow: hidden;
    font-size: clamp(30px, 5vw, 42px);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-balance-card div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-top: 1px solid rgb(255 255 255 / 0.24);
    padding-top: 12px;
}

.home-balance-card b {
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.home-balance-card p {
    display: flex;
    gap: 8px;
    margin: 0;
    border-radius: 12px;
    background: rgb(255 255 255 / 0.12);
    padding: 10px;
    font-size: 13px;
    line-height: 1.35;
}

.home-period-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #dbe4ee;
    border-radius: 14px;
    background: #ffffff;
    color: #0f172a;
    font-weight: 850;
    padding: 14px 16px;
    text-decoration: none;
}

.home-month-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.home-mini-card,
.home-result-card {
    min-width: 0;
    border: 1px solid #dbe4ee;
    border-radius: 14px;
    background: #ffffff;
    padding: 16px;
}

.home-mini-card.income { border-color: #b7ead7; background: #f0fdf8; }
.home-mini-card.expense { border-color: #f5c7c7; background: #fff7f7; }

.home-mini-card span,
.home-result-card span {
    display: block;
    color: #475569;
    font-size: 13px;
    font-weight: 800;
}

.home-mini-card strong,
.home-result-card strong {
    display: block;
    overflow: hidden;
    margin-top: 10px;
    font-size: 22px;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-result-card {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.home-result-card strong {
    margin: 0;
}

.home-section {
    padding: 18px;
}

.upcoming-section,
.projection-card,
.recent-section {
    grid-column: 1;
}

.home-ai-panel,
.category-section {
    grid-column: 2;
}

.home-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.home-section-heading h2,
.projection-card h2,
.home-ai-panel h2 {
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
}

.home-section-heading a {
    flex: 0 0 auto;
    color: #047857;
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
}

.attention-card {
    display: grid;
    gap: 4px;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    background: #fff7ed;
    margin-bottom: 12px;
    padding: 12px;
}

.attention-card span {
    color: #b45309;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.attention-card strong {
    color: #7c2d12;
}

.upcoming-list {
    display: grid;
    gap: 4px;
}

.upcoming-item,
.movement-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-width: 0;
    padding: 12px 0;
}

.upcoming-item + .upcoming-item,
.movement-row + .movement-row {
    border-top: 1px solid #edf2f7;
}

.upcoming-item > div:nth-child(2),
.movement-row > div:nth-child(2) {
    min-width: 0;
}

.upcoming-item strong,
.movement-row strong {
    display: block;
    overflow: hidden;
    color: #0f172a;
    font-size: 15px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upcoming-item span,
.movement-row span {
    display: block;
    overflow: hidden;
    margin-top: 4px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-pill {
    display: inline-flex;
    width: fit-content;
    min-height: 20px;
    align-items: center;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    margin-top: 6px;
    padding: 5px 8px;
}

.status-pill.overdue { background: #fef2f2; color: #b42318; }
.status-pill.today { background: #fffbeb; color: #b45309; }

.upcoming-amount {
    display: grid;
    justify-items: end;
    gap: 6px;
}

.upcoming-amount > strong,
.movement-row > strong:last-child {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.upcoming-amount button {
    min-height: 32px;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    cursor: pointer;
    font-size: 12px;
    font-weight: 850;
    padding: 6px 10px;
}

.projection-card dl {
    display: grid;
    gap: 12px;
    margin: 0;
}

.projection-card dl > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.projection-card dt {
    color: #64748b;
    font-size: 14px;
}

.projection-card dd {
    margin: 0;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.projection-total {
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
}

.projection-total dt,
.projection-total dd {
    color: #0f172a;
    font-size: 17px;
    font-weight: 900;
}

.home-ai-panel {
    display: grid;
    gap: 12px;
}

.home-ai-panel > div:first-child span {
    color: #047857;
    font-size: 13px;
    font-weight: 900;
}

.home-ai-panel > div:first-child h2 {
    margin-top: 4px;
}

.home-ai-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 8px;
}

.home-ai-form textarea {
    width: 100%;
    min-height: 46px;
    max-height: 110px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    outline: none;
    padding: 12px 16px;
    resize: vertical;
}

.home-ai-form textarea:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgb(16 185 129 / 0.14);
}

.home-ai-form button {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #059669;
    color: #ffffff;
    cursor: pointer;
}

.home-prompt-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-top: 0;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
}

.home-prompt-chips button {
    flex: 0 0 auto;
    border-radius: 999px;
    white-space: nowrap;
}

.category-row {
    display: grid;
    gap: 8px;
    padding: 11px 0;
}

.category-row + .category-row {
    border-top: 1px solid #edf2f7;
}

.category-row > div:first-child {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
}

.category-row strong {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-row span,
.category-row small {
    color: #475569;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.category-row small {
    color: #047857;
    font-weight: 900;
}

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

.category-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #059669;
}

.soft-empty {
    margin: 0;
    color: #64748b;
    line-height: 1.5;
}

@media (max-width: 820px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-copy,
    .auth-panel {
        min-height: auto;
    }

    .auth-copy {
        gap: 28px;
        padding: 28px 18px 36px;
    }

    .auth-copy h1 {
        font-size: 34px;
    }

    .auth-visual {
        min-height: auto;
    }

    .finance-preview {
        width: min(340px, 92%);
        transform: none;
    }

    .finance-preview > * {
        transform: none;
    }

    .sparkle-bubble {
        left: 0;
        top: 28%;
        width: 58px;
        height: 58px;
        font-size: 20px;
    }

    .auth-panel {
        padding: 24px 14px 32px;
    }

    .auth-card {
        padding: 24px 18px;
        box-shadow: 0 14px 34px rgb(15 23 42 / 0.08);
    }

    .card-heading h2 {
        font-size: 26px;
    }

    .auth-footer {
        margin-top: 24px;
    }

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

    .chat-sidebar {
        display: none;
    }

    .chat-header,
    .chat-history,
    .chat-composer,
    .content-page {
        padding-left: 16px;
        padding-right: 16px;
    }

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

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

    .balance-strip > div + div {
        border-left: 0;
    }

    .balance-strip > div:nth-child(even) {
        border-left: 1px solid #e2e8f0;
    }

    .balance-strip > div:nth-child(n+3) {
        border-top: 1px solid #e2e8f0;
    }

    .movement-row {
        align-items: flex-start;
    }

    .transactions-hero,
    .transactions-toolbar,
    .transactions-footer,
    .ai-tip {
        align-items: stretch;
        flex-direction: column;
    }

    .transactions-actions {
        width: 100%;
    }

    .transactions-actions > * {
        flex: 1;
    }

    .transactions-actions .primary-button,
    .transactions-actions .secondary-button {
        justify-content: center;
    }

    .period-navigation {
        justify-content: space-between;
    }

    .period-picker {
        flex: 1;
    }

    .period-picker input {
        width: 100%;
    }

    .period-summary.finance-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .manual-entry-form, .recurrence-options > div { grid-template-columns: 1fr; }
    .manual-entry-form .field-wide { grid-column: auto; }
    .row-recurrence { padding-left: 0; }
    .row-recurrence form { grid-template-columns: 1fr; }

    .transaction-row {
        grid-template-columns: 40px minmax(0, 1fr) 32px;
        gap: 12px;
        padding: 14px;
    }

    .transaction-copy {
        grid-column: 2;
    }

    .transaction-copy strong {
        white-space: normal;
    }

    .transaction-badges {
        grid-column: 2 / 4;
    }

    .transaction-value {
        grid-column: 2 / 4;
        text-align: right;
    }

    .transaction-menu {
        grid-column: 3;
        grid-row: 1;
    }

    .transaction-menu-panel {
        right: 0;
        width: min(280px, calc(100vw - 72px));
    }

    .mobile-logout {
        display: block;
    }
}

@media (max-width: 520px) {
    .period-summary.finance-cards {
        grid-template-columns: 1fr;
    }

    .filter-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
    }
}

@media (max-width: 820px) {
    body {
        background: #ffffff;
    }

    .chat-layout {
        display: block;
        min-height: 100dvh;
        overflow-x: hidden;
        padding-bottom: calc(74px + env(safe-area-inset-bottom));
    }

    .desktop-assistant {
        right: 12px;
        bottom: calc(82px + env(safe-area-inset-bottom));
        width: min(370px, calc(100vw - 24px));
        height: min(640px, calc(100dvh - 110px));
        max-height: calc(100dvh - 110px);
    }

    .chat-layout:has(.review-page) .desktop-assistant {
        bottom: calc(172px + env(safe-area-inset-bottom));
        height: min(640px, calc(100dvh - 200px));
        max-height: calc(100dvh - 200px);
    }

    .desktop-assistant.is-minimized {
        width: min(340px, calc(100vw - 24px));
        height: 78px;
    }

    .assistant-minimized-card {
        gap: 12px;
        padding: 12px 14px;
    }

    .assistant-minimized-card img {
        width: 48px;
        height: 48px;
    }

    .assistant-minimized-card strong {
        font-size: 17px;
    }

    .assistant-minimized-card small {
        font-size: 14px;
    }

    .assistant-minimized-card i {
        width: 42px;
        height: 48px;
        font-size: 22px;
    }

    .chat-main {
        display: flex;
        flex-direction: column;
        min-height: 100dvh;
        overflow-x: hidden;
    }

    .chat-header {
        position: sticky;
        top: 0;
        z-index: 30;
        min-height: 62px;
        border-bottom: 1px solid rgb(226 232 240 / 0.85);
        background: rgb(255 255 255 / 0.92);
        padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
        backdrop-filter: blur(18px);
    }

    .mobile-page-actions {
        display: flex;
        justify-content: flex-end;
        padding: 10px 16px 0;
    }

    .mobile-page-actions .mobile-logout {
        display: block;
    }

    .chat-header h1 {
        font-size: 17px;
        line-height: 1.2;
    }

    .chat-header p {
        display: none;
    }

    .chat-page-actions {
        flex: 0 0 auto;
        padding-right: 16px;
        padding-left: 16px;
    }

    .chat-history {
        min-height: 0;
        padding-top: 16px;
        padding-bottom: 18px;
    }

    .assistant-message {
        max-width: 96%;
    }

    .user-message {
        max-width: 88%;
    }

    .quick-replies {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .quick-replies::-webkit-scrollbar {
        display: none;
    }

    .quick-replies button {
        flex: 0 0 auto;
        max-width: 220px;
        white-space: normal;
    }

    .sticker-message {
        width: 88px;
        min-height: 80px;
    }

    .sticker-message img {
        width: 80px;
        height: 80px;
    }

    .chat-composer {
        flex: 0 0 auto;
        padding: 12px 16px calc(88px + env(safe-area-inset-bottom));
    }

    .chat-composer .composer-inner {
        gap: 8px;
    }

    .chat-composer .icon-button {
        width: 42px;
        min-width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .chat-composer .send-button {
        min-height: 42px;
        padding: 10px 12px;
    }

    .chat-composer textarea {
        min-height: 42px;
    }

    .mobile-logout .ghost-button {
        min-height: 34px;
        padding: 7px 10px;
        text-align: center;
    }

    .mobile-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 4px;
        border-top: 1px solid rgb(203 213 225 / 0.9);
        background: rgb(255 255 255 / 0.94);
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
        box-shadow: 0 -12px 30px rgb(15 23 42 / 0.08);
        backdrop-filter: blur(18px);
    }

    .mobile-bottom-nav a {
        display: grid;
        justify-items: center;
        gap: 3px;
        border-radius: 8px;
        color: #64748b;
        font-size: 11px;
        font-weight: 800;
        padding: 6px 2px;
        text-decoration: none;
    }

    .mobile-bottom-nav span {
        display: grid;
        place-items: center;
        width: 26px;
        height: 22px;
        border-radius: 8px;
        font-size: 9px;
        letter-spacing: 0;
    }

    .mobile-bottom-nav small {
        font-size: 11px;
    }

    .mobile-bottom-nav .active {
        color: #047857;
    }

    .mobile-bottom-nav .active span {
        background: #dcfce7;
    }

    .content-page {
        padding: 20px 18px;
    }

    .transactions-page,
    .home-page {
        max-width: none;
    }

    .transactions-hero {
        position: sticky;
        top: 0;
        z-index: 25;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 14px;
        margin: -20px -18px 20px;
        background: rgb(255 255 255 / 0.94);
        padding: calc(24px + env(safe-area-inset-top)) 18px 14px;
        backdrop-filter: blur(18px);
    }

    .transactions-hero h1 {
        font-size: 30px;
        line-height: 1.05;
    }

    .transactions-hero p {
        margin-top: 8px;
        color: #475569;
        font-size: 17px;
        line-height: 1.3;
    }

    .transactions-actions {
        display: flex;
        align-items: center;
        width: auto;
        gap: 10px;
        margin-top: 0;
    }

    .transactions-actions .primary-button {
        position: fixed;
        right: 16px;
        bottom: calc(86px + env(safe-area-inset-bottom));
        z-index: 45;
        display: grid;
        place-items: center;
        width: 58px;
        height: 58px;
        min-height: 58px;
        overflow: hidden;
        border-radius: 50%;
        box-shadow: 0 12px 24px rgb(5 150 105 / 0.22);
        color: transparent;
        padding: 0;
        white-space: nowrap;
    }

    .transactions-actions .primary-button::before {
        content: "";
        color: #ffffff;
        font-size: 30px;
        font-weight: 700;
        line-height: 1;
    }

    .transactions-actions .secondary-button {
        display: grid;
        place-items: center;
        width: 58px;
        height: 58px;
        min-width: 58px;
        min-height: 58px;
        border-radius: 50%;
        justify-content: center;
        padding: 0;
    }

    .transactions-actions .secondary-button strong {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .transactions-actions .secondary-button span {
        font-size: 12px;
        font-weight: 900;
    }

    .inline-chat-panel {
        margin: 0 0 16px;
        padding: 14px;
    }

    .inline-chat-history {
        max-height: 260px;
        padding: 10px;
    }

    .inline-chat-composer {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 8px;
    }

    .inline-chat-composer .icon-button {
        display: none;
    }

    .inline-chat-composer textarea {
        min-height: 46px;
        border-radius: 8px;
    }

    .inline-chat-composer .send-button {
        min-height: 46px;
        padding: 11px 14px;
    }

    .transactions-toolbar {
        gap: 12px;
        margin-bottom: 16px;
        overflow: hidden;
    }

    .period-navigation {
        display: grid;
        grid-template-columns: 52px minmax(0, 1fr) 52px;
        gap: 0;
        width: 100%;
        overflow: hidden;
        border: 1px solid #dbe4ee;
        border-radius: 28px;
        background: #ffffff;
        box-shadow: 0 8px 24px rgb(15 23 42 / 0.04);
    }

    .period-arrow,
    .period-picker input {
        height: 54px;
        min-height: 54px;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .period-picker input {
        padding: 9px 36px 9px 10px;
    }

    .period-picker span {
        overflow: hidden;
        padding: 0 30px 0 10px;
        font-size: 17px;
        line-height: 1.15;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .filter-tabs {
        width: calc(100% + 32px);
        margin: 0 -18px;
        padding: 0 18px 4px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none !important;
    }

    .filter-tabs::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
        background: transparent;
    }

    .filter-tabs a {
        flex: 0 0 auto;
        min-height: 52px;
        border-radius: 999px;
        padding: 14px 20px;
        font-size: 17px;
        white-space: nowrap;
    }

    .period-summary.finance-cards {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        width: 100%;
        margin: 4px 0 26px;
        overflow: visible;
        padding: 0 16px 4px;
        padding: 0;
    }

    .finance-card {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr);
        align-items: start;
        gap: 6px 12px;
        min-height: 154px;
        border-radius: 8px;
        padding: 18px;
    }

    .finance-card strong {
        grid-column: 2;
        margin: 8px 0 6px;
        font-size: 24px;
    }

    .finance-card b {
        width: 42px;
        height: 42px;
        border-radius: 999px;
        font-size: 11px;
        grid-column: 1;
        grid-row: 1;
    }

    .finance-card span {
        grid-column: 2;
        align-self: center;
        font-size: 18px;
        font-weight: 600;
    }

    .finance-card small {
        grid-column: 2;
        overflow: hidden;
        font-size: 15px;
        line-height: 1.35;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .transactions-list-section h2 {
        margin-bottom: 22px;
        font-size: 24px;
    }

    .transaction-group {
        gap: 8px;
        margin-bottom: 18px;
    }

    .transaction-group h3 {
        position: sticky;
        top: 0;
        z-index: 8;
        width: 100%;
        border: 0;
        border-radius: 0;
        background: rgb(255 255 255 / 0.92);
        padding: 10px 0;
        font-size: 18px;
        backdrop-filter: blur(12px);
    }

    .transaction-group h3 small {
        font-size: 16px;
    }

    .transaction-group-list {
        display: grid;
        gap: 10px;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .transaction-row {
        grid-template-columns: 58px minmax(0, 1fr) 34px;
        align-items: center;
        min-height: 118px;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        background: #ffffff;
        padding: 16px;
        box-shadow: 0 10px 24px rgb(15 23 42 / 0.05);
    }

    .transaction-row + .transaction-row {
        border-top: 1px solid #e2e8f0;
    }

    .transaction-icon {
        width: 58px;
        height: 58px;
        font-size: 14px;
    }

    .transaction-copy strong {
        display: -webkit-box;
        overflow: hidden;
        font-size: 18px;
        line-height: 1.25;
        white-space: normal;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .transaction-copy span {
        font-size: 16px;
    }

    .transaction-badges {
        grid-column: 2 / 4;
        grid-row: 2;
        align-self: end;
        justify-content: flex-start;
        margin-top: 4px;
    }

    .transaction-value {
        grid-column: 2 / 4;
        grid-row: 3;
        align-self: end;
        display: flex;
        justify-content: flex-end;
        border-top: 0;
        margin-top: 2px;
        padding-top: 0;
        text-align: right;
    }

    .transaction-value strong {
        margin-left: 0;
        font-size: 16px;
    }

    .transaction-value span {
        display: none;
    }

    .transaction-menu > summary {
        width: 34px;
        height: 34px;
    }

    .transaction-menu {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
    }

    .transaction-menu-panel {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(92px + env(safe-area-inset-bottom));
        top: auto;
        width: auto;
        max-height: min(76dvh, 620px);
        overflow-y: auto;
        border-radius: 8px;
        padding: 10px;
    }

    .transaction-menu[open]::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 9;
        background: rgb(15 23 42 / 0.22);
    }

    .transaction-menu-panel {
        z-index: 10;
    }

    .transaction-menu-panel button,
    .recurrence-menu > summary,
    .edit-transaction-menu > summary,
    .menu-note {
        min-height: 44px;
        font-size: 15px;
        padding: 12px;
    }

    .edit-transaction-menu form,
    .recurrence-menu form {
        gap: 10px;
    }

    .edit-transaction-menu input,
    .edit-transaction-menu select,
    .recurrence-menu input,
    .recurrence-menu select {
        min-height: 42px;
        font-size: 16px;
    }

    .transactions-footer {
        display: grid;
        gap: 10px;
        margin-bottom: 8px;
    }

    .simple-pagination {
        justify-content: flex-start;
    }

    .ai-tip {
        margin-top: 18px;
        padding: 14px;
    }

    .ai-tip a {
        text-align: center;
    }

    .balance-strip {
        overflow: hidden;
        border-radius: 8px;
    }

    .assistant-panel {
        border-radius: 8px;
        padding: 16px;
    }
}

@media (max-width: 380px) {
    .transactions-actions {
        grid-template-columns: 1fr;
    }

    .transactions-actions .secondary-button {
        min-width: 0;
    }

    .period-navigation {
        grid-template-columns: 40px minmax(0, 1fr) 40px;
        gap: 6px;
        border-radius: 8px;
    }

    .period-arrow,
    .period-picker input {
        height: 40px;
        min-height: 40px;
    }

    .period-picker span {
        padding-right: 26px;
        font-size: 12px;
    }

    .filter-tabs a {
        min-height: 42px;
        padding: 10px 14px;
        font-size: 14px;
    }

    .finance-card {
        min-height: 128px;
        padding: 12px;
        grid-template-columns: 32px minmax(0, 1fr);
        gap: 4px 8px;
    }

    .finance-card b {
        width: 30px;
        height: 30px;
    }

    .finance-card span {
        font-size: 13px;
        font-weight: 800;
    }

    .finance-card strong {
        font-size: 18px;
    }

    .finance-card small {
        font-size: 11px;
    }

    .purchases-dashboard {
        gap: 18px;
    }

    .purchases-hero {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .purchases-main-grid {
        grid-template-columns: 1fr;
    }

    .purchases-summary-grid {
        gap: 12px;
    }

    .purchase-summary-card {
        min-height: 118px;
        padding: 16px 10px 14px 62px;
    }

    .purchase-summary-card b {
        left: 12px;
        top: 16px;
        width: 40px;
        height: 40px;
        font-size: 17px;
    }

    .purchase-summary-card strong {
        margin: 10px 0;
        font-size: 20px;
    }

    .purchase-summary-card span,
    .purchase-summary-card small {
        font-size: 11px;
    }

    .purchases-filters {
        grid-template-columns: 1fr;
    }

    .purchases-category-widget {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .purchases-side-column {
        gap: 14px;
    }

    .transaction-value {
        margin-top: 34px;
    }

    .transaction-value strong {
        font-size: 14px;
    }
}

@media (max-width: 820px) {
    .content-page.transactions-page {
        padding: 18px 18px calc(96px + env(safe-area-inset-bottom));
    }

    .transaction-meta {
        display: none;
    }

    .transactions-hero {
        position: relative;
        top: auto;
        z-index: 1;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 58px;
        gap: 12px;
        margin: 0 0 22px;
        padding: calc(18px + env(safe-area-inset-top)) 0 0;
        background: transparent;
        backdrop-filter: none;
    }

    .transactions-hero h1 {
        font-size: 28px;
        line-height: 1.08;
    }

    .transactions-hero p {
        max-width: 260px;
        margin-top: 8px;
        font-size: 16px;
        line-height: 1.35;
    }

    .transactions-actions {
        grid-column: 2;
        grid-row: 1;
        display: block;
        width: 58px;
        margin: 0;
    }

    .transactions-actions .primary-button {
        position: fixed;
        top: auto;
        right: 18px;
        bottom: calc(92px + env(safe-area-inset-bottom));
        z-index: 45;
        width: 58px;
        height: 58px;
        min-height: 58px;
        border-radius: 50%;
        color: transparent;
        padding: 0;
        box-shadow: 0 16px 30px rgb(5 150 105 / 0.28);
    }

    .transactions-actions .primary-button::before {
        content: "";
        color: #ffffff;
        font-size: 34px;
        font-weight: 600;
        line-height: 1;
    }

    .transactions-actions .filter-action {
        display: grid;
        place-items: center;
        width: 54px;
        height: 54px;
        min-width: 54px;
        min-height: 54px;
        border-radius: 50%;
        padding: 0;
    }

    .transactions-actions .filter-action strong {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .transactions-toolbar {
        gap: 14px;
        margin-bottom: 18px;
        overflow: visible;
    }

    .period-navigation {
        grid-template-columns: 48px minmax(0, 1fr) 48px;
        gap: 0;
        border-radius: 8px;
    }

    .period-arrow,
    .period-picker input {
        height: 48px;
        min-height: 48px;
    }

    .period-picker span {
        padding: 0 30px 0 8px;
        font-size: 14px;
        font-weight: 800;
    }

    .filter-tabs {
        width: calc(100% + 36px);
        margin: 0 -18px;
        padding: 0 18px 2px;
    }

    .filter-tabs a {
        min-height: 42px;
        padding: 10px 15px;
        font-size: 14px;
    }

    .period-summary.finance-cards {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        width: 100%;
        margin: 0 0 26px;
        padding: 0;
        overflow: visible;
    }

    .finance-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 30px;
        gap: 4px 8px;
        min-height: 132px;
        padding: 14px;
    }

    .finance-card span {
        grid-column: 1;
        align-self: start;
        font-size: 13px;
        font-weight: 800;
        line-height: 1.2;
    }

    .finance-card b {
        grid-column: 2;
        grid-row: 1 / 3;
        justify-self: end;
        width: 30px;
        height: 30px;
        font-size: 9px;
    }

    .finance-card strong {
        grid-column: 1 / -1;
        margin: 4px 0;
        font-size: 20px;
        line-height: 1.05;
        white-space: nowrap;
    }

    .finance-card small {
        grid-column: 1 / -1;
        overflow: hidden;
        font-size: 11px;
        line-height: 1.25;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .transactions-list-section h2 {
        margin: 0 0 18px;
        font-size: 22px;
        line-height: 1.2;
    }

    .transaction-group h3 {
        position: relative;
        top: auto;
        z-index: 1;
        background: transparent;
        padding: 0;
        font-size: 16px;
        backdrop-filter: none;
    }

    .transaction-group h3 small {
        font-size: 14px;
    }

    .transaction-row {
        grid-template-columns: 48px minmax(0, 1fr) 32px;
        gap: 12px;
        min-height: 104px;
        padding: 14px;
    }

    .transaction-icon {
        width: 48px;
        height: 48px;
        font-size: 12px;
    }

    .transaction-copy strong {
        font-size: 16px;
    }

    .transaction-copy span {
        font-size: 13px;
    }

    .transaction-badges {
        grid-column: 2 / 4;
        grid-row: 2;
    }

    .transaction-value {
        grid-column: 2 / 4;
        grid-row: 3;
        display: flex;
        justify-content: flex-end;
        margin-top: 0;
        text-align: right;
    }

    .transaction-value strong {
        font-size: 16px;
    }

    .transaction-menu {
        grid-column: 3;
        grid-row: 1;
    }
}

@media (max-width: 380px) {
    .transactions-hero h1 {
        font-size: 25px;
    }

    .transactions-hero p {
        font-size: 14px;
    }

    .period-navigation {
        grid-template-columns: 40px minmax(0, 1fr) 40px;
    }

    .period-picker span {
        font-size: 12px;
    }

    .finance-card {
        min-height: 124px;
        padding: 12px;
    }

    .finance-card strong {
        font-size: 18px;
    }
}

@media (max-width: 767px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
    }

    body {
        background: #ffffff;
    }

    .chat-layout,
    .chat-main,
    .content-page.transactions-page,
    .transactions-page * {
        min-width: 0;
    }

    .chat-layout {
        display: block;
        width: 100%;
        max-width: 100%;
        min-height: 100dvh;
        padding-bottom: 0;
    }

    .chat-main {
        width: 100%;
        max-width: 100%;
        min-height: 100dvh;
    }

    .content-page.transactions-page {
        width: 100%;
        max-width: 100%;
        padding: calc(16px + env(safe-area-inset-top)) 16px calc(132px + env(safe-area-inset-bottom));
    }

    .transactions-hero {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 12px;
        width: 100%;
        margin: 0 0 22px;
        padding: 0;
        background: transparent;
    }

    .transactions-hero h1 {
        margin: 0;
        font-size: 26px;
        font-weight: 750;
        line-height: 1.15;
    }

    .transactions-hero p {
        max-width: none;
        margin: 6px 0 0;
        color: #526179;
        font-size: 14px;
        line-height: 1.4;
    }

    .transactions-actions {
        grid-column: 2;
        grid-row: 1;
        display: flex;
        width: auto;
        gap: 8px;
        margin: 0;
    }

    .transactions-actions .filter-action {
        position: relative;
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        border-radius: 50%;
        border-color: #dbe4ee;
        padding: 0;
        box-shadow: 0 8px 20px rgb(15 23 42 / 0.05);
    }

    .transactions-actions .filter-action strong {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .transactions-actions .primary-button {
        display: none;
    }

    .transactions-toolbar {
        display: grid;
        gap: 14px;
        width: 100%;
        margin: 0 0 20px;
        overflow: visible;
    }

    .period-navigation {
        display: grid;
        grid-template-columns: 48px minmax(0, 1fr) 48px;
        align-items: center;
        width: 100%;
        height: 54px;
        overflow: hidden;
        border: 1px solid #dbe4ee;
        border-radius: 16px;
        background: #ffffff;
        box-shadow: 0 8px 22px rgb(15 23 42 / 0.04);
    }

    .period-arrow,
    .period-picker input {
        width: 100%;
        height: 54px;
        min-height: 54px;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .period-arrow {
        font-size: 16px;
    }

    .period-picker {
        width: 100%;
        min-width: 0;
    }

    .period-picker input {
        min-width: 0;
        padding: 0;
    }

    .period-picker span {
        overflow: hidden;
        padding: 0 8px;
        font-size: 16px;
        font-weight: 800;
        line-height: 1.2;
        text-align: center;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .filter-tabs {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        width: calc(100% + 32px);
        max-width: none;
        margin: 0 -16px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0 16px 2px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none !important;
    }

    .filter-tabs a {
        flex: 0 0 auto;
        min-height: 44px;
        border-radius: 999px;
        padding: 11px 17px;
        font-size: 14px;
        line-height: 1.2;
        white-space: nowrap;
    }

    .filter-tabs .active {
        border-color: #059669;
        background: #059669;
        color: #ffffff;
    }

    .period-summary.finance-cards {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        width: 100%;
        margin: 0 0 28px;
        padding: 0;
        overflow: visible;
    }

    .finance-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 36px;
        gap: 6px 8px;
        min-height: 122px;
        border-radius: 14px;
        padding: 14px;
        box-shadow: none;
    }

    .finance-card.income { border-color: #b7ead7; background: #f0fdf8; }
    .finance-card.expense { border-color: #f5c7c7; background: #fff7f7; }
    .finance-card.result { border-color: #cfe1fb; background: #f7fbff; }
    .finance-card.projected { border-color: #f4dfaf; background: #fffaf0; }

    .finance-card b {
        position: static;
        grid-column: 2;
        grid-row: 1 / 3;
        justify-self: end;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        font-size: 16px;
        line-height: 1;
    }

    .finance-card span {
        grid-column: 1;
        color: #0f172a;
        font-size: 13px;
        font-weight: 700;
        line-height: 1.2;
    }

    .finance-card strong {
        grid-column: 1 / -1;
        overflow: hidden;
        margin: 2px 0 4px;
        font-size: clamp(17px, 4.7vw, 21px);
        font-weight: 800;
        line-height: 1.08;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .finance-card small {
        grid-column: 1 / -1;
        overflow: hidden;
        color: #0f172a;
        font-size: 12px;
        line-height: 1.25;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .transactions-list-section h2 {
        margin: 0 0 16px;
        font-size: 20px;
        font-weight: 750;
        line-height: 1.2;
    }

    .transaction-group {
        gap: 10px;
        margin-bottom: 24px;
    }

    .transaction-group h3 {
        position: relative;
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 0;
        background: transparent;
        padding: 0;
        font-size: 15px;
        font-weight: 700;
    }

    .transaction-group h3 small {
        border-left: 0;
        color: #059669;
        font-size: 13px;
        font-weight: 800;
        padding-left: 0;
    }

    .transaction-group h3 small::before {
        content: "";
    }

    .date-icon {
        flex: 0 0 auto;
        width: auto;
        height: auto;
        border: 0;
        border-radius: 0;
        color: #334155;
        font-size: 17px;
    }

    .transaction-group-list {
        display: block;
        overflow: visible;
        border: 1px solid #dfe7f0;
        border-radius: 14px;
        background: #ffffff;
        box-shadow: 0 8px 22px rgb(15 23 42 / 0.04);
    }

    .transaction-row {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) auto;
        gap: 10px;
        align-items: center;
        min-height: 88px;
        border: 0;
        border-radius: 0;
        background: transparent;
        padding: 12px;
        box-shadow: none;
    }

    .transaction-row + .transaction-row {
        border-top: 1px solid #edf2f7;
    }

    .transaction-icon {
        grid-column: 1;
        grid-row: 1 / 3;
        width: 44px;
        height: 44px;
        border-radius: 10px;
        font-size: 12px;
    }

    .transaction-icon > i {
        font-size: 18px;
    }

    .transaction-copy {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }

    .transaction-meta {
        display: none;
    }

    .transaction-copy strong {
        display: -webkit-box;
        overflow: hidden;
        font-size: 15px;
        font-weight: 800;
        line-height: 1.25;
        text-overflow: initial;
        white-space: normal;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .transaction-copy span {
        overflow: hidden;
        margin-top: 4px;
        color: #526179;
        font-size: 13px;
        line-height: 1.25;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .transaction-value {
        grid-column: 3;
        grid-row: 1;
        align-self: center;
        min-width: 0;
        margin: 0;
        text-align: right;
    }

    .transaction-value strong {
        display: block;
        font-size: clamp(13px, 3.7vw, 15px);
        font-weight: 850;
        line-height: 1.2;
        white-space: nowrap;
    }

    .transaction-value span {
        display: none;
    }

    .transaction-badges {
        grid-column: 2 / 4;
        grid-row: 2;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: flex-start;
        margin: 0;
    }

    .status-badge {
        min-height: 22px;
        border-radius: 999px;
        font-size: 10px !important;
        font-weight: 850;
        padding: 5px 8px;
    }

    .transaction-menu {
        grid-column: 3;
        grid-row: 2;
        justify-self: end;
        align-self: end;
    }

    .transaction-menu > summary {
        width: 44px;
        height: 44px;
        margin: -10px -8px -10px 0;
    }

    .transaction-menu > summary > i {
        font-size: 18px;
    }

    .transaction-menu-panel {
        position: fixed;
        top: auto;
        right: 10px;
        bottom: calc(86px + env(safe-area-inset-bottom));
        left: 10px;
        width: auto;
        max-height: min(76dvh, 620px);
        overflow-y: auto;
        border-radius: 16px;
        padding: 10px;
    }

    .transaction-menu[open]::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 9;
        background: rgb(15 23 42 / 0.22);
    }

    .transaction-menu-panel {
        z-index: 10;
    }

    .empty-transactions {
        border-radius: 14px;
        padding: 24px 16px;
        text-align: left;
    }

    .transactions-footer,
    .ai-tip {
        align-items: stretch;
        gap: 10px;
        margin-top: 16px;
    }

    .mobile-bottom-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 40;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 2px;
        min-height: calc(66px + env(safe-area-inset-bottom));
        border-top: 1px solid rgb(203 213 225 / 0.82);
        background: rgb(255 255 255 / 0.96);
        padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
        box-shadow: 0 -10px 24px rgb(15 23 42 / 0.08);
        backdrop-filter: blur(18px);
    }

    .mobile-bottom-nav a,
    .mobile-nav-add {
        display: grid;
        place-items: center;
        gap: 3px;
        min-width: 0;
        min-height: 52px;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: #475569;
        cursor: pointer;
        font-size: 11px;
        font-weight: 750;
        font: inherit;
        text-decoration: none;
    }

    .mobile-bottom-nav small,
    .mobile-nav-add small {
        font-size: 11px;
        line-height: 1.1;
    }

    .mobile-bottom-nav .active {
        color: #047857;
    }

    .nav-icon {
        display: grid;
        place-items: center;
        width: 28px;
        height: 24px;
        font-size: 22px;
    }

    .content-page.home-page {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
        width: 100%;
        max-width: 100%;
        padding: calc(16px + env(safe-area-inset-top)) 16px calc(112px + env(safe-area-inset-bottom));
    }

    .home-page,
    .home-page * {
        min-width: 0;
    }

    .home-hero,
    .home-empty-state,
    .home-balance-card,
    .home-period-link,
    .home-month-summary,
    .home-section,
    .upcoming-section,
    .projection-card,
    .home-ai-panel,
    .category-section,
    .recent-section {
        grid-column: 1;
        width: 100%;
        max-width: 100%;
    }

    .home-hero span {
        color: #526179;
        font-size: 15px;
        font-weight: 700;
    }

    .home-hero h1 {
        margin-top: 4px;
        font-size: 26px;
        line-height: 1.15;
    }

    .home-empty-state {
        display: grid;
        gap: 14px;
        border-radius: 16px;
        padding: 16px;
    }

    .home-empty-state .primary-button {
        width: fit-content;
        min-height: 44px;
    }

    .home-balance-card {
        gap: 10px;
        border-radius: 18px;
        padding: 20px;
        box-shadow: 0 14px 34px rgb(5 150 105 / 0.16);
    }

    .home-balance-card > strong {
        font-size: clamp(28px, 8vw, 36px);
    }

    .home-balance-card b {
        overflow: hidden;
        font-size: 17px;
        text-overflow: ellipsis;
    }

    .home-period-link {
        min-height: 46px;
        border-radius: 14px;
        padding: 12px 14px;
    }

    .home-month-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .home-mini-card,
    .home-result-card,
    .home-section {
        border-radius: 16px;
        box-shadow: none;
    }

    .home-mini-card {
        padding: 14px;
    }

    .home-mini-card span,
    .home-result-card span {
        font-size: 12px;
    }

    .home-mini-card strong {
        font-size: clamp(18px, 5vw, 21px);
    }

    .home-result-card {
        padding: 14px;
    }

    .home-result-card strong {
        font-size: clamp(18px, 5vw, 22px);
    }

    .home-section {
        padding: 16px;
    }

    .home-section-heading {
        margin-bottom: 10px;
    }

    .home-section-heading h2,
    .projection-card h2,
    .home-ai-panel h2 {
        font-size: 19px;
    }

    .upcoming-item,
    .movement-row {
        grid-template-columns: 42px minmax(0, 1fr) auto;
        gap: 10px;
        padding: 12px 0;
    }

    .upcoming-item .transaction-icon,
    .movement-row .transaction-icon {
        width: 42px;
        height: 42px;
    }

    .upcoming-item strong,
    .movement-row strong {
        font-size: 14px;
    }

    .upcoming-amount > strong,
    .movement-row > strong:last-child {
        max-width: 112px;
        overflow: hidden;
        font-size: 13px;
        text-overflow: ellipsis;
    }

    .upcoming-amount button {
        min-height: 30px;
        padding: 5px 9px;
    }

    .projection-card dl {
        gap: 10px;
    }

    .home-ai-form {
        grid-template-columns: minmax(0, 1fr) 44px;
    }

    .home-ai-form textarea {
        min-height: 44px;
        border-radius: 14px;
    }

    .home-ai-form button {
        width: 44px;
        height: 44px;
    }

    .home-prompt-chips {
        width: calc(100% + 32px);
        margin-right: -16px;
        margin-left: -16px;
        padding-right: 16px;
        padding-left: 16px;
        scrollbar-width: none;
    }

    .home-prompt-chips::-webkit-scrollbar {
        display: none;
    }

    .category-row > div:first-child {
        grid-template-columns: minmax(0, 1fr) auto auto;
    }
}

@media (max-width: 340px) {
    .content-page.transactions-page {
        padding-right: 12px;
        padding-left: 12px;
    }

    .filter-tabs {
        width: calc(100% + 24px);
        margin-right: -12px;
        margin-left: -12px;
        padding-right: 12px;
        padding-left: 12px;
    }

    .finance-card {
        min-height: 116px;
        padding: 12px;
    }

    .finance-card b {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .transaction-row {
        grid-template-columns: 40px minmax(0, 1fr) auto;
        gap: 8px;
        padding: 11px 10px;
    }

    .transaction-icon {
        width: 40px;
        height: 40px;
    }

    .content-page.home-page {
        padding-right: 12px;
        padding-left: 12px;
    }

    .home-prompt-chips {
        width: calc(100% + 24px);
        margin-right: -12px;
        margin-left: -12px;
        padding-right: 12px;
        padding-left: 12px;
    }

    .upcoming-item,
    .movement-row {
        grid-template-columns: 38px minmax(0, 1fr) auto;
        gap: 8px;
    }

    .upcoming-item .transaction-icon,
    .movement-row .transaction-icon {
        width: 38px;
        height: 38px;
    }

    .upcoming-amount > strong,
    .movement-row > strong:last-child {
        max-width: 96px;
        font-size: 12px;
    }
}

body.modal-open {
    overflow: hidden;
}

.side-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
}

.side-nav a i {
    width: 18px;
    color: #64748b;
    text-align: center;
}

.side-nav .active i {
    color: #047857;
}

.imports-dashboard {
    --import-border: #dbe4ee;
    --import-surface: #ffffff;
    --import-muted: #526179;
    display: grid;
    gap: 22px;
    width: min(100%, 1320px);
    max-width: 1320px;
    padding: 28px 32px 40px;
}

.import-page-hero,
.import-hero-title,
.history-header,
.history-filters,
.history-actions {
    display: flex;
    align-items: center;
}

.import-page-hero {
    justify-content: space-between;
    gap: 18px;
}

.import-hero-title {
    min-width: 0;
    gap: 16px;
}

.import-hero-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: #059669;
    color: #fff;
    box-shadow: 0 14px 28px rgb(5 150 105 / 0.18);
}

.import-page-hero h1 {
    margin: 0;
    color: #061332;
    font-size: 28px;
    line-height: 1.15;
}

.import-page-hero p {
    margin: 6px 0 0;
    color: var(--import-muted);
}

.help-button,
.icon-action,
.modal-close,
.history-card footer button {
    display: inline-grid;
    place-items: center;
    min-width: 44px;
    min-height: 44px;
    border: 1px solid var(--import-border);
    border-radius: 10px;
    background: #fff;
    color: #334155;
    cursor: pointer;
}

.help-button {
    grid-auto-flow: column;
    gap: 8px;
    padding: 0 14px;
    font-weight: 750;
}

.import-panel,
.import-history-panel {
    border: 1px solid var(--import-border);
    border-radius: 16px;
    background: var(--import-surface);
    box-shadow: 0 10px 26px rgb(15 23 42 / 0.055);
}

.import-panel {
    padding: 26px;
}

.import-panel h2,
.import-history-panel h2 {
    margin: 0;
    color: #061332;
    font-size: 19px;
}

.import-panel h2 {
    color: #047857;
}

.import-upload-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 28px;
    margin-top: 24px;
}

.import-dropzone {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 230px;
    border: 1.5px dashed #b8c7dc;
    border-radius: 12px;
    background: #fbfdff;
    cursor: pointer;
    padding: 24px;
    transition: border-color 160ms, background 160ms, transform 160ms;
}

.import-dropzone:hover,
.import-dropzone.drag-over {
    border-color: #059669;
    background: #f0fdf8;
}

.import-dropzone.drag-over .dropzone-empty strong {
    color: #047857;
}

.import-dropzone input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.dropzone-empty,
.dropzone-file {
    display: grid;
    justify-items: center;
    gap: 8px;
    min-width: 0;
    text-align: center;
}

.dropzone-empty i {
    color: #059669;
    font-size: 40px;
}

.dropzone-empty strong {
    color: #061332;
    font-size: 16px;
}

.dropzone-empty small,
.dropzone-empty em,
.dropzone-file small {
    color: var(--import-muted);
    font-style: normal;
}

.dropzone-file {
    grid-template-columns: 42px minmax(0, 1fr) 44px;
    align-items: center;
    width: min(520px, 100%);
    justify-items: stretch;
    border: 1px solid #cde8db;
    border-radius: 12px;
    background: #fff;
    padding: 14px;
    text-align: left;
}

.dropzone-file > i {
    color: #059669;
    font-size: 26px;
}

.dropzone-file strong {
    display: block;
    overflow: hidden;
    color: #061332;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropzone-file button {
    border: 0;
    border-radius: 10px;
    background: #f1f5f9;
    color: #334155;
    cursor: pointer;
}

.import-upload-side {
    display: grid;
    align-content: center;
    gap: 16px;
}

.import-upload-side label,
.statement-upload label {
    color: #061332;
    font-weight: 800;
}

.import-upload-side select,
.history-filters select,
.search-field input {
    width: 100%;
    min-height: 46px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #061332;
    padding: 10px 12px;
}

.import-upload-side select {
    margin-top: 8px;
}

.upload-tip {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 10px;
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    background: #ecfdf5;
    color: #065f46;
    padding: 14px;
}

.upload-tip p {
    margin: 0;
    line-height: 1.45;
}

.import-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    width: 100%;
}

.import-submit:disabled {
    cursor: progress;
    opacity: 0.82;
}

.import-stepper {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.import-stepper span {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: #64748b;
}

.import-stepper span:not(:last-child)::after {
    content: "";
    position: absolute;
    right: -12px;
    left: 44px;
    top: 50%;
    height: 1px;
    background: #dbe4ee;
    transform: translateY(-50%);
}

.import-stepper small {
    position: relative;
    z-index: 1;
    min-width: 0;
    background: #ffffff;
    line-height: 1.2;
    overflow: hidden;
    padding-right: 4px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.import-stepper b {
    z-index: 1;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    background: #fff;
    font-size: 13px;
}

.import-stepper .active b {
    border-color: #059669;
    background: #059669;
    color: #fff;
}

.import-stepper .active small {
    color: #047857;
    font-weight: 850;
}

.import-history-panel {
    overflow: hidden;
}

.history-header {
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
}

.history-filters {
    gap: 12px;
}

.search-field {
    position: relative;
    display: block;
    width: 270px;
}

.search-field i {
    position: absolute;
    top: 50%;
    left: 13px;
    color: #64748b;
    transform: translateY(-50%);
}

.search-field input {
    padding-left: 38px;
}

.history-status-chips {
    display: none;
}

.history-table-wrap {
    overflow-x: auto;
    border-top: 1px solid #e2e8f0;
}

.history-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.history-column-purchase { width: auto; }
.history-column-date { width: 120px; }
.history-column-items { width: 90px; }
.history-column-total { width: 110px; }
.history-column-status { width: 120px; }
.history-column-actions { width: 60px; }

.history-table th,
.history-table td {
    border-bottom: 1px solid #e2e8f0;
    padding: 14px 12px;
    text-align: left;
    vertical-align: middle;
}

.history-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 850;
}

.history-table td,
.history-table small {
    color: #0f172a;
    font-size: 14px;
}

.history-table td:not(:first-child) strong,
.history-table td:not(:first-child) small {
    white-space: nowrap;
}

.history-table small,
.file-cell small {
    display: block;
    margin-top: 5px;
    color: #526179;
    font-size: 12px;
}

.file-cell {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.file-cell > i {
    color: #ef4444;
    font-size: 24px;
}

.file-cell strong {
    display: block;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 850;
}

.status-pill.success { background: #dcfce7; color: #047857; }
.status-pill.info { background: #dbeafe; color: #1d4ed8; }
.status-pill.warning { background: #fef3c7; color: #92400e; }
.status-pill.danger { background: #fee2e2; color: #b91c1c; }
.status-pill.muted { background: #f1f5f9; color: #475569; }

.history-actions {
    display: flex;
    gap: 8px;
}

.icon-action {
    color: #475569;
    text-decoration: none;
}

.icon-action.danger,
.danger-button {
    border-color: #fecaca;
    background: #fef2f2;
    color: #dc2626;
}

.danger-button {
    min-height: 44px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 850;
    padding: 10px 14px;
}

.history-cards {
    display: none;
}

.history-card-heading,
.history-card-details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.history-card-details {
    align-items: flex-start;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.history-card-details > span {
    display: grid;
    gap: 4px;
    min-width: 84px;
}

.history-card-details small {
    color: #64748b;
    font-size: 11px;
}

.history-card-details strong {
    overflow: visible;
    white-space: normal;
}

.import-empty-state {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 42px 18px;
    text-align: center;
}

.import-empty-state i {
    color: #94a3b8;
    font-size: 34px;
}

.import-empty-state p {
    margin: 0;
    color: #64748b;
}

.import-warning {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 12px;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    background: #fffbeb;
    color: #92400e;
    padding: 14px;
}

.import-warning p {
    margin: 4px 0 0;
}

.import-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    background: rgb(15 23 42 / 0.36);
    padding: 18px;
}

.import-modal[hidden] {
    display: none;
}

.import-modal-card {
    position: relative;
    display: grid;
    gap: 16px;
    width: min(460px, 100%);
    border-radius: 16px;
    background: #fff;
    padding: 24px;
    box-shadow: 0 28px 70px rgb(15 23 42 / 0.22);
}

.import-modal-card h2 {
    margin: 0;
    color: #061332;
}

.import-modal-card p,
.import-modal-card ol {
    margin: 0;
    color: #475569;
    line-height: 1.6;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    min-width: 38px;
    min-height: 38px;
}

.danger-modal h2 {
    color: #991b1b;
}

.modal-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff7f7;
    padding: 12px;
    color: #7f1d1d;
    cursor: pointer;
}

.modal-check input {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: #dc2626;
}

.modal-check span,
.modal-check strong,
.modal-check small {
    display: block;
}

.modal-check small {
    margin-top: 3px;
    color: #991b1b;
    line-height: 1.4;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.transaction-method-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 4px;
}

.transaction-method-modal .import-modal-card {
    grid-template-columns: minmax(250px, .8fr) minmax(0, 1.55fr);
    gap: 0;
    width: min(900px, 100%);
    padding: 0;
    overflow: hidden;
}

.transaction-method-modal [data-transaction-method-choice] {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    min-height: 540px;
    border-right: 1px solid #dbe4ee;
    background: #f8fafc;
    padding: 42px 28px;
    text-align: center;
}

.transaction-method-modal [data-transaction-method-choice] p {
    margin: 0;
}

.transaction-method-modal .transaction-method-actions {
    grid-template-columns: 1fr;
    margin-top: 12px;
}

.transaction-method-modal .transaction-method-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.transaction-method-modal .transaction-manual-form {
    align-content: space-between;
    min-width: 0;
    padding: 42px 28px 24px;
}

.transaction-method-modal .transaction-manual-form h2 {
    color: #061332;
    font-size: 22px;
}

.transaction-method-actions button {
    min-height: 48px;
}

.transaction-manual-form {
    display: grid;
    gap: 16px;
}

.transaction-manual-form h2 {
    margin: 0;
}

.transaction-manual-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.transaction-manual-fields label {
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.transaction-manual-fields .field-wide {
    grid-column: 1 / -1;
}

.transaction-manual-fields input,
.transaction-manual-fields select {
    display: block;
    width: 100%;
    min-height: 40px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    margin-top: 5px;
    padding: 8px;
}

.review-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 767px) {
    .transactions-insights-layout {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .category-ranking-card {
        position: static;
        order: -1;
        gap: 16px;
        padding: 16px;
    }

    .category-ranking-card header {
        display: grid;
        gap: 8px;
    }

    .transactions-section-heading {
        display: grid;
        gap: 6px;
    }

    .assistant-settings-page {
        width: 100%;
        padding: calc(16px + env(safe-area-inset-top)) 14px calc(100px + env(safe-area-inset-bottom));
        gap: 16px;
    }

    .settings-hero,
    .intensity-section {
        display: grid;
        gap: 14px;
        padding: 16px;
    }

    .settings-hero h2 {
        font-size: 24px;
    }

    .settings-status {
        width: fit-content;
    }

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

    .personality-card {
        min-height: 132px;
        padding: 14px;
    }

    .personality-card strong {
        font-size: 15px;
    }

    .intensity-options {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .intensity-options button {
        min-width: 0;
        padding: 9px 6px;
        font-size: 13px;
    }

    .assistant-preview {
        padding: 16px;
    }

    .assistant-personality-chip {
        max-width: 100%;
    }

    .chat-page-actions {
        justify-content: space-between;
        padding: 10px 14px;
    }

    .imports-dashboard {
        width: 100%;
        max-width: 100%;
        padding: calc(16px + env(safe-area-inset-top)) 14px calc(110px + env(safe-area-inset-bottom));
        gap: 16px;
    }

    .import-page-hero {
        align-items: flex-start;
    }

    .import-hero-title {
        align-items: flex-start;
        gap: 12px;
    }

    .import-hero-icon {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .import-page-hero h1 {
        font-size: 25px;
    }

    .import-page-hero p {
        font-size: 14px;
        line-height: 1.45;
    }

    .help-button {
        width: 44px;
        padding: 0;
    }

    .help-button:not(:focus) {
        font-size: 0;
    }

    .help-button i {
        font-size: 16px;
    }

    .import-panel,
    .import-history-panel {
        border-radius: 14px;
        box-shadow: none;
    }

    .import-panel {
        padding: 16px;
    }

    .import-upload-form {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-top: 16px;
    }

    .import-dropzone {
        min-height: 210px;
        padding: 18px;
    }

    .dropzone-empty strong {
        font-size: 15px;
    }

    .dropzone-file {
        grid-template-columns: 34px minmax(0, 1fr) 40px;
    }

    .import-upload-side {
        align-content: stretch;
    }

    .import-stepper {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-top: 18px;
    }

    .import-stepper::before {
        content: "Etapas";
        flex: 0 0 100%;
        color: #047857;
        font-size: 13px;
        font-weight: 850;
    }

    .import-stepper span {
        flex: 1;
        gap: 0;
    }

    .import-stepper small {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .import-stepper b {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }

    .import-stepper span:not(:last-child)::after {
        left: 25px;
        right: -2px;
    }

    .history-header {
        display: grid;
        gap: 14px;
        padding: 16px;
    }

    .history-filters {
        display: grid;
        gap: 10px;
    }

    .search-field {
        width: 100%;
    }

    .history-filters select {
        display: none;
    }

    .history-status-chips {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        width: calc(100% + 32px);
        margin: -4px -16px 12px;
        overflow-x: auto;
        padding: 0 16px 4px;
        scrollbar-width: none;
    }

    .history-status-chips a {
        flex: 0 0 auto;
        min-height: 40px;
        border: 1px solid #cbd5e1;
        border-radius: 999px;
        background: #fff;
        color: #334155;
        padding: 10px 14px;
        text-decoration: none;
    }

    .history-status-chips .active {
        border-color: #059669;
        background: #059669;
        color: #fff;
        font-weight: 850;
    }

    .history-table-wrap {
        display: none;
    }

    .history-cards {
        display: grid;
        gap: 12px;
        padding: 0 16px 16px;
    }

    .history-card {
        display: grid;
        gap: 13px;
        border: 1px solid #e2e8f0;
        border-radius: 14px;
        background: #fff;
        padding: 14px;
    }

    .history-card strong {
        display: block;
        overflow: hidden;
        color: #061332;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .history-card span,
    .history-card small {
        color: #526179;
    }

    .history-card dl {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin: 0;
    }

    .history-card dt {
        color: #64748b;
        font-size: 12px;
        font-weight: 750;
    }

    .history-card dd {
        margin: 4px 0 0;
        color: #061332;
        font-weight: 850;
    }

    .history-card footer {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto 44px;
        align-items: center;
        gap: 10px;
    }

    .history-card footer a {
        color: #047857;
        font-weight: 850;
        text-decoration: none;
    }

    .import-modal {
        align-items: end;
        padding: 10px;
    }

    .import-modal-card {
        width: 100%;
        border-radius: 18px 18px 14px 14px;
        padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
    }

    .transaction-method-actions,
    .transaction-manual-fields {
        grid-template-columns: 1fr;
    }

    .transaction-method-modal .import-modal-card {
        display: block;
        max-height: calc(100dvh - 20px);
        overflow-y: auto;
    }

    .transaction-method-modal [data-transaction-method-choice] {
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid #dbe4ee;
        padding: 28px 18px;
    }

    .transaction-method-modal .transaction-manual-form {
        padding: 28px 18px 22px;
    }

    .transaction-manual-fields .field-wide {
        grid-column: auto;
    }
}

.import-detail-page {
    display: grid;
    gap: 22px;
    width: min(100%, 1380px);
    max-width: 1380px;
    padding: 28px 32px 40px;
}

.detail-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    color: #334155;
    font-weight: 800;
    text-decoration: none;
}

.detail-hero,
.detail-title,
.detail-summary-card,
.detail-success-banner,
.detail-tabs nav,
.detail-filters,
.detail-search-actions,
.detail-footer-actions {
    display: flex;
    align-items: center;
}

.detail-hero {
    justify-content: space-between;
    gap: 16px;
}

.detail-title {
    min-width: 0;
    gap: 16px;
}

.detail-hero-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 62px;
    height: 62px;
    border-radius: 16px;
    background: #059669;
    color: #fff;
    font-size: 26px;
    box-shadow: 0 16px 30px rgb(5 150 105 / 0.2);
}

.detail-hero h1 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: #061332;
    font-size: 30px;
    line-height: 1.15;
}

.detail-hero p {
    margin: 6px 0 0;
    color: #526179;
}

.danger-outline-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    border: 1px solid #fca5a5;
    border-radius: 10px;
    background: #fff;
    color: #dc2626;
    cursor: pointer;
    font-weight: 850;
    padding: 10px 14px;
}

.detail-summary-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr 1.2fr 1.2fr;
    gap: 12px;
}

.detail-summary-card {
    min-width: 0;
    gap: 18px;
    border: 1px solid #dbe4ee;
    border-radius: 12px;
    background: #fff;
    padding: 18px 20px;
    box-shadow: 0 8px 22px rgb(15 23 42 / 0.04);
}

.detail-summary-card > i {
    flex: 0 0 auto;
    color: #475569;
    font-size: 28px;
}

.detail-summary-card span {
    display: block;
    color: #526179;
    font-size: 12px;
    font-weight: 850;
}

.detail-summary-card strong {
    display: block;
    overflow: hidden;
    margin-top: 8px;
    color: #061332;
    font-size: 17px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-summary-card small {
    display: block;
    margin-top: 6px;
    color: #526179;
}

.detail-summary-card.totals {
    align-items: flex-start;
}

.detail-summary-card dl {
    display: grid;
    gap: 10px;
    margin: 10px 0 0;
}

.detail-summary-card dl div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.detail-summary-card dt {
    color: #526179;
}

.detail-summary-card dd {
    margin: 0;
    color: #047857;
    font-weight: 900;
}

.detail-success-banner {
    gap: 14px;
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    background: #ecfdf5;
    color: #065f46;
    padding: 16px 18px;
}

.detail-success-banner.warning {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.detail-success-banner > i {
    font-size: 24px;
}

.detail-success-banner div {
    min-width: 0;
    flex: 1;
}

.detail-success-banner p {
    margin: 4px 0 0;
}

.detail-tabs {
    display: grid;
    gap: 18px;
}

.detail-tabs nav {
    gap: 24px;
    border-bottom: 1px solid #dbe4ee;
    padding: 0 12px;
}

.detail-tabs nav a {
    border-bottom: 3px solid transparent;
    color: #334155;
    font-weight: 850;
    padding: 14px 0;
    text-decoration: none;
}

.detail-tabs nav .active {
    border-color: #059669;
    color: #047857;
}

.detail-filters {
    justify-content: space-between;
    gap: 16px;
}

.detail-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.detail-filter-chips a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    border: 1px solid #dbe4ee;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    font-weight: 800;
    padding: 10px 16px;
    text-decoration: none;
}

.detail-filter-chips .active {
    border-color: #059669;
    color: #047857;
}

.detail-filter-chips b {
    display: grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #eef2f7;
    font-size: 12px;
}

.detail-search-actions {
    gap: 10px;
}

.detail-search-actions .search-field {
    width: 260px;
}

.detail-search-actions .secondary-button,
.detail-footer-actions .secondary-button,
.detail-success-banner .secondary-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    text-decoration: none;
}

.detail-table-wrap {
    overflow-x: auto;
    border: 1px solid #dbe4ee;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 22px rgb(15 23 42 / 0.04);
}

.detail-table {
    width: 100%;
    min-width: 1050px;
    border-collapse: collapse;
}

.detail-table th,
.detail-table td {
    border-bottom: 1px solid #e2e8f0;
    padding: 14px 18px;
    text-align: left;
    vertical-align: middle;
}

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

.detail-table th {
    background: #f8fafc;
    color: #526179;
    font-size: 12px;
    font-weight: 900;
}

.detail-table td small {
    display: block;
    margin-top: 5px;
    color: #526179;
}

.movement-cell {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.movement-cell strong {
    display: block;
    overflow: hidden;
    color: #061332;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.merchant-icon,
.type-pill {
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
}

.merchant-icon {
    width: 34px;
    height: 34px;
    background: #ecfdf5;
    color: #059669;
}

.category-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    margin-right: 8px;
}

.type-pill {
    grid-auto-flow: column;
    gap: 8px;
    width: fit-content;
    min-height: 34px;
    padding: 6px 10px;
    font-weight: 800;
}

.type-pill.income {
    background: #ecfdf5;
    color: #047857;
}

.type-pill.expense {
    background: #fff7ed;
    color: #c2410c;
}

.detail-mobile-list {
    display: none;
}

.category-summary-panel {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.category-summary-panel div {
    border: 1px solid #dbe4ee;
    border-radius: 12px;
    background: #fff;
    padding: 14px;
}

.category-summary-panel span,
.category-summary-panel small {
    display: block;
    color: #526179;
}

.category-summary-panel strong {
    display: block;
    margin: 8px 0;
    color: #061332;
}

.detail-footer-actions {
    justify-content: space-between;
    gap: 16px;
}

.detail-footer-actions > span {
    margin-left: auto;
    color: #526179;
}

@media (max-width: 767px) {
    .import-detail-page {
        width: 100%;
        max-width: 100%;
        padding: calc(16px + env(safe-area-inset-top)) 14px calc(110px + env(safe-area-inset-bottom));
        gap: 16px;
    }

    .detail-hero {
        align-items: flex-start;
    }

    .detail-title {
        align-items: flex-start;
        gap: 12px;
    }

    .detail-hero-icon {
        width: 48px;
        height: 48px;
        border-radius: 14px;
        font-size: 21px;
    }

    .detail-hero h1 {
        font-size: 25px;
    }

    .danger-outline-button {
        width: 44px;
        padding: 0;
        font-size: 0;
    }

    .danger-outline-button i {
        font-size: 16px;
    }

    .detail-summary-grid,
    .category-summary-panel {
        grid-template-columns: 1fr;
    }

    .detail-summary-card {
        border-radius: 14px;
        padding: 16px;
    }

    .detail-success-banner {
        display: grid;
        grid-template-columns: 24px minmax(0, 1fr);
        border-radius: 14px;
    }

    .detail-success-banner .secondary-button {
        grid-column: 1 / -1;
        justify-content: center;
    }

    .detail-tabs nav,
    .detail-filter-chips {
        flex-wrap: nowrap;
        width: calc(100% + 28px);
        margin-right: -14px;
        margin-left: -14px;
        overflow-x: auto;
        padding-right: 14px;
        padding-left: 14px;
        scrollbar-width: none;
    }

    .detail-tabs nav a,
    .detail-filter-chips a {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .detail-filters {
        display: grid;
        gap: 12px;
    }

    .detail-search-actions {
        display: grid;
    }

    .detail-search-actions .search-field {
        width: 100%;
    }

    .detail-search-actions .secondary-button {
        justify-content: center;
    }

    .detail-table-wrap {
        display: none;
    }

    .detail-mobile-list {
        display: grid;
        gap: 12px;
    }

    .detail-mobile-card {
        display: grid;
        gap: 12px;
        border: 1px solid #dbe4ee;
        border-radius: 14px;
        background: #fff;
        padding: 14px;
    }

    .detail-mobile-card strong,
    .detail-mobile-card span {
        display: block;
    }

    .detail-mobile-card strong {
        overflow: hidden;
        color: #061332;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .detail-mobile-card span {
        margin-top: 4px;
        color: #526179;
        font-size: 13px;
    }

    .detail-mobile-card footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .detail-mobile-card footer a {
        color: #047857;
        font-weight: 850;
        text-decoration: none;
    }

    .detail-footer-actions {
        display: grid;
        gap: 10px;
    }

    .detail-footer-actions > span {
        margin: 0;
        text-align: center;
    }

    .detail-footer-actions .secondary-button {
        justify-content: center;
    }
}

.statement-upload select,
.statement-upload input:not([type="file"]),
.review-fields input,
.review-fields select {
    width: 100%;
    min-height: 44px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    padding: 10px 12px;
}

.import-status,
.review-meta b {
    color: #b45309 !important;
    font-weight: 850;
}

.import-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.import-summary > div {
    min-width: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    padding: 16px;
}

.import-summary span {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.import-summary strong {
    display: block;
    overflow: hidden;
    margin-top: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.review-list {
    display: grid;
    gap: 12px;
    padding-bottom: 108px;
}

.review-item {
    display: grid;
    gap: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    padding: 14px;
}

.review-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-weight: 800;
}

.review-fields {
    display: grid;
    grid-template-columns: 150px minmax(180px, 1fr) 130px minmax(160px, 1fr) 90px 90px;
    gap: 10px;
}

.review-meta {
    display: grid;
    gap: 4px;
    color: #64748b;
    font-size: 13px;
}

.review-footer,
.confirm-import-form {
    position: sticky;
    bottom: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: rgb(255 255 255 / 0.96);
    padding: 12px;
    box-shadow: 0 -10px 28px rgb(15 23 42 / 0.08);
}

.confirm-import-form {
    justify-content: flex-end;
    margin-top: -18px;
    border-top: 0;
    box-shadow: none;
}

@media (max-width: 767px) {
    .import-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .review-fields {
        grid-template-columns: 1fr 1fr;
    }

    .review-fields input[name$="[description_normalized]"],
    .review-fields select {
        grid-column: 1 / -1;
    }

    .review-footer,
    .confirm-import-form {
        position: fixed;
        right: 10px;
        left: 10px;
        bottom: calc(76px + env(safe-area-inset-bottom));
        border-radius: 14px;
    }

    .confirm-import-form {
        bottom: calc(18px + env(safe-area-inset-bottom));
    }

    .review-footer .secondary-button,
    .confirm-import-form .primary-button {
        min-height: 44px;
    }
}

.transactions-datatable-wrap {
    overflow-x: auto;
}

@media (max-width: 767px) {
    .transactions-datatable-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .transactions-datatable-wrap .transactions-data-table,
    .transactions-datatable-wrap .transactions-data-table tbody {
        display: grid;
        gap: 10px;
    }

    .transactions-datatable-wrap .transaction-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px 12px;
        min-height: 0;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        background: #ffffff;
        padding: 14px;
        box-shadow: 0 10px 24px rgb(15 23 42 / 0.05);
    }

    .transactions-datatable-wrap .transaction-row > td,
    .transactions-datatable-wrap .transaction-row > td:first-child,
    .transactions-datatable-wrap .transaction-row > td:last-child {
        width: auto;
        padding: 0;
    }

    .transactions-datatable-wrap .transaction-date-cell,
    .transactions-datatable-wrap .transaction-main-cell {
        grid-column: 1 / 3;
    }

    .transactions-datatable-wrap .transaction-main-cell {
        padding-right: 42px !important;
    }

    .transactions-datatable-wrap .transaction-meta,
    .transactions-datatable-wrap .transaction-badges-cell {
        display: block !important;
        max-width: none;
        margin: 0;
    }

    .transactions-datatable-wrap .transaction-value {
        grid-column: 1 / 3;
        justify-content: flex-start;
        margin: 0;
        text-align: left;
    }

    .transactions-datatable-wrap .transaction-menu-cell {
        position: absolute;
        top: 14px;
        right: 8px;
    }
}

