:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #eef2f7;
    --text: #18212f;
    --muted: #64748b;
    --border: #d8e0ea;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --blue: #2563eb;
    --green: #16a34a;
    --amber: #d97706;
    --red: #dc2626;
    --shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-xxl: var(--space-2xl);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

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

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px;
    background: #111827;
    color: #f8fafc;
    z-index: 20;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--primary);
    font-weight: 800;
}

.brand-name {
    font-weight: 800;
    line-height: 1.15;
}

.brand-version {
    margin-top: 2px;
    color: #a7b2c4;
    font-size: 0.82rem;
}

.nav-list {
    display: grid;
    gap: 8px;
    margin-top: 24px;
}

.nav-link {
    display: block;
    padding: 12px 14px;
    border-radius: 8px;
    color: #cbd5e1;
    font-weight: 650;
    transition: background 0.18s ease, color 0.18s ease;
}

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

.content-shell {
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    overflow-x: clip;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 74px;
    padding: 14px 28px;
    background: rgba(245, 247, 251, 0.92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}

.icon-button {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    padding: 10px;
}

.icon-button span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: var(--text);
}

.period-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

select,
input,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    padding: 11px 12px;
    font: inherit;
}

textarea {
    resize: vertical;
}

label {
    color: var(--text);
    font-weight: 700;
}

.helper-text {
    margin: -4px 0 4px;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.main-content {
    width: min(1280px, 100%);
    max-width: 100%;
    margin: 0 auto;
    padding: 28px;
    flex: 1;
    overflow-x: clip;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.page-heading h1 {
    margin: 0;
    font-size: clamp(1.7rem, 3vw, 2.35rem);
    line-height: 1.1;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-primary-soft,
.btn-outline-soft,
.btn-danger-soft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 800;
    line-height: 1.1;
    cursor: pointer;
}

.btn-primary-soft {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary-soft:hover {
    background: var(--primary-dark);
    color: #ffffff;
}

.btn-outline-soft {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.btn-danger-soft {
    background: var(--red);
    color: #ffffff;
    border-color: var(--red);
}

.btn-danger-soft:hover {
    background: #b91c1c;
    color: #ffffff;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.full-width {
    width: 100%;
}

.status-message {
    margin-bottom: 18px;
    padding: 13px 14px;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    background: #ecfeff;
    color: #155e75;
    font-weight: 700;
}

.danger-message {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.validation-summary {
    margin: 0 0 4px;
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-weight: 800;
}

.field-error {
    margin-top: 6px;
    color: #b91c1c;
    font-size: 0.86rem;
    font-weight: 750;
    line-height: 1.35;
}

.field-error[hidden] {
    display: none;
}

.is-invalid {
    border-color: #dc2626;
    background: #fff7f7;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.kpi-grid.compact {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.kpi-card,
.panel,
.form-panel,
.info-panel,
.table-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.kpi-card {
    min-height: 116px;
    padding: 18px;
    border-top: 4px solid var(--blue);
}

.kpi-card.success {
    border-top-color: var(--green);
}

.kpi-card.warning {
    border-top-color: var(--amber);
}

.kpi-card.danger {
    border-top-color: var(--red);
}

.kpi-card span {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 750;
}

.kpi-card strong {
    display: block;
    margin-top: 10px;
    font-size: clamp(1.35rem, 2.2vw, 1.9rem);
    line-height: 1.1;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.panel,
.table-section,
.form-panel,
.info-panel {
    padding: 18px;
}

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

.panel-heading h2 {
    margin: 0;
    font-size: 1.02rem;
}

.panel-heading span {
    color: var(--muted);
    font-weight: 700;
}

.panel-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.chart-box {
    width: 100%;
    min-height: 320px;
}

.category-distribution-list {
    display: grid;
    gap: 12px;
    max-height: 320px;
    overflow: auto;
    padding-right: 4px;
}

.category-distribution-row {
    display: grid;
    gap: 7px;
}

.category-distribution-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: baseline;
    font-size: 0.92rem;
}

.category-distribution-name {
    min-width: 0;
    font-weight: 850;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-distribution-amount {
    color: var(--text);
    font-weight: 800;
}

.category-distribution-percent {
    width: 54px;
    color: var(--muted);
    font-weight: 800;
    text-align: right;
}

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

.category-distribution-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #0f766e);
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.data-table th,
.data-table td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.empty-state {
    color: var(--muted);
    text-align: center;
}

.two-column,
.split-section,
.review-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.7fr);
    gap: 18px;
}

.upload-layout {
    width: 100%;
}

.review-complete-layout,
.receipt-edit-layout {
    display: grid;
    grid-template-columns: minmax(320px, 40%) minmax(0, 60%);
    gap: 18px;
    align-items: start;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

.review-complete-layout > *,
.receipt-edit-layout > * {
    min-width: 0;
}

.review-receipt-form {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin-inline: 0;
    overflow-x: hidden;
}

.review-receipt-form,
.review-receipt-form > *,
.review-receipt-form .receipt-form-section,
.review-receipt-form .form-grid,
.review-receipt-form .payment-type-options,
.review-receipt-form .installment-fields,
.review-receipt-form .installment-fields > *,
.review-receipt-form .item-rows {
    min-width: 0;
    max-width: 100%;
}

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

.receipt-detail-main {
    display: grid;
    gap: 18px;
}

.receipt-detail-preview {
    position: sticky;
    top: 96px;
}

.receipt-thumbnail-button {
    display: block;
    width: 100%;
    max-width: 280px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.receipt-thumbnail {
    display: block;
    width: 100%;
    max-width: 280px;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.14);
}

.receipt-preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.receipt-modal {
    width: min(94vw, 980px);
    max-height: 92vh;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.32);
}

.receipt-modal::backdrop {
    background: rgba(15, 23, 42, 0.54);
}

.receipt-modal-toolbar {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: #ffffff;
}

.receipt-modal-body {
    max-height: calc(92vh - 58px);
    overflow: auto;
    padding: 16px;
}

.receipt-modal-body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.receipt-preview-panel {
    position: sticky;
    top: 96px;
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 126px);
    overflow: auto;
}

.receipt-preview-image,
.receipt-preview-frame {
    width: 100%;
    min-height: 520px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    object-fit: contain;
}

.pdf-page-stack {
    display: grid;
    gap: 16px;
}

.pdf-page-preview {
    display: grid;
    gap: 8px;
    margin: 0;
}

.pdf-page-preview figcaption {
    color: var(--muted);
    font-weight: 800;
}

.ocr-text-details {
    display: grid;
    gap: 10px;
}

.ocr-text-details summary {
    cursor: pointer;
    font-weight: 800;
}

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

.receipt-form {
    width: 100%;
    max-width: 1100px;
    margin-inline: auto;
    gap: 18px;
}

.receipt-form-section {
    display: grid;
    gap: 14px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

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

.receipt-form-section > h2,
.notes-section > h2 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.25;
}

.entry-type-section {
    gap: 10px;
}

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

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 2px;
    color: var(--text-muted, #5f7187);
    font-size: 0.95rem;
}

.checkbox-row input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.expense-detail-grid {
    grid-template-columns: minmax(150px, 0.8fr) minmax(170px, 1fr) minmax(170px, 1fr);
    align-items: end;
}

.manual-expense-detail-grid {
    grid-template-columns: minmax(260px, 1.4fr) minmax(130px, 0.6fr) minmax(220px, 1fr) minmax(220px, 1fr);
    align-items: end;
}

.receipt-review-expense-grid,
.receipt-review-category-grid {
    display: grid;
    gap: 16px;
    min-width: 0;
    max-width: 100%;
}

.receipt-review-expense-grid {
    grid-template-columns: minmax(260px, 1fr) minmax(130px, 180px);
}

.receipt-review-category-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin-top: 16px;
}

.manual-expense-detail-grid > div,
.receipt-review-expense-grid > div,
.receipt-review-category-grid > div,
.manual-expense-detail-grid input,
.manual-expense-detail-grid select,
.receipt-review-expense-grid input,
.receipt-review-expense-grid select,
.receipt-review-category-grid input,
.receipt-review-category-grid select {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.single-metric-grid {
    grid-template-columns: minmax(180px, 0.8fr);
}

.edit-classification-grid {
    grid-template-columns: minmax(150px, 0.8fr) minmax(170px, 1fr) minmax(170px, 1fr) minmax(170px, 1fr);
    align-items: end;
}

.mode-selector {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
}

.mode-selector legend {
    grid-column: 1 / -1;
    margin-bottom: 4px;
    font-weight: 850;
}

.mode-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 82px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.mode-option small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-weight: 500;
}

.mode-option.compact {
    min-height: 62px;
}

.payment-type-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.installment-fields {
    display: grid;
    gap: 14px;
    width: 100%;
    max-width: 100%;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    overflow-x: hidden;
}

.installment-fields[hidden] {
    display: none;
}

.review-receipt-form .payment-type-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.review-receipt-form .installment-fields .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.review-receipt-form .installment-fields textarea,
.review-receipt-form .installment-estimate {
    width: 100%;
    max-width: 100%;
}

.field-label {
    display: block;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.provider-readonly-display {
    align-items: center;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    display: flex;
    min-height: 42px;
    padding: 10px 12px;
    word-break: break-word;
}

.installment-estimate {
    margin-top: 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.stacked-form {
    display: grid;
    gap: 12px;
}

.action-stack {
    gap: 14px;
}

.receipt-upload-box {
    display: grid;
    gap: 8px;
    width: 100%;
    padding: 14px;
    border: 1px dashed #b8c5d4;
    border-radius: 8px;
    background: #f8fafc;
}

.receipt-upload-box input[type="file"] {
    background: #ffffff;
}

.receipt-upload-box .helper-text,
.receipt-document-status .helper-text {
    margin: 0;
    font-size: 0.86rem;
}

.receipt-document-status {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    border-style: solid;
}

.receipt-document-status > span {
    font-weight: 800;
}

.receipt-document-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.receipt-document-actions .helper-text {
    margin: 0;
}

.items-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
}

.items-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.items-header h2 {
    margin: 0;
    font-size: 1rem;
}

.item-rows {
    display: grid;
    gap: 12px;
}

.item-row {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}

.item-row-main {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 1fr) minmax(150px, 1fr) minmax(110px, 0.7fr) minmax(110px, 0.7fr) 92px;
    gap: 10px;
    align-items: end;
}

.item-field,
.item-row-notes,
.item-row input,
.item-row select {
    min-width: 0;
}

.item-row label,
.item-row-notes label {
    display: block;
    margin-bottom: 6px;
    color: #526173;
    font-size: 0.77rem;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
}

.item-row input,
.item-row select {
    min-height: 42px;
}

.item-field-amount input[name="item_amount"] {
    text-align: right;
}

.item-field-remove {
    display: flex;
    align-items: end;
}

.item-field-remove .danger-action {
    width: 100%;
    min-height: 42px;
    white-space: nowrap;
}

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

.review-receipt-form .items-header,
.review-receipt-form .items-footer {
    max-width: 100%;
}

.review-receipt-form .items-header {
    flex-wrap: wrap;
}

.review-receipt-form .item-rows {
    min-width: 0;
    max-width: 100%;
}

.category-tree-list {
    display: grid;
    gap: 12px;
}

.category-tree-card {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}

.category-tree-card ul {
    margin: 10px 0 0;
    padding-left: 18px;
    color: var(--muted);
}

.danger-action {
    color: var(--red);
}

.negative-amount {
    color: var(--red);
    font-weight: 800;
}

.danger-zone {
    border-color: #fecaca;
}

.danger-zone h2 {
    color: #991b1b;
}

.reset-form {
    max-width: 560px;
    margin-top: 18px;
}

.confirm-dialog {
    width: min(460px, calc(100vw - 32px));
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
}

.confirm-dialog::backdrop {
    background: rgba(15, 23, 42, 0.58);
}

.confirm-dialog-card {
    display: grid;
    gap: 12px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    box-shadow: var(--shadow);
}

.confirm-dialog-card h2,
.confirm-dialog-card p {
    margin: 0;
}

.confirm-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.45);
}

.loading-overlay[hidden] {
    display: none;
}

.loading-card {
    display: grid;
    justify-items: center;
    gap: 10px;
    width: min(360px, 100%);
    padding: 24px;
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    text-align: center;
    box-shadow: var(--shadow);
}

.loading-card span {
    color: var(--muted);
}

.loading-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid #dbeafe;
    border-top-color: var(--primary);
    border-radius: 999px;
    animation: spin 0.85s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.total-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    justify-self: end;
    min-width: min(320px, 100%);
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    background: #ecfeff;
}

.total-summary span {
    color: var(--muted);
    font-weight: 800;
}

.total-summary strong {
    font-size: 1.25rem;
}

.review-receipt-form .total-summary {
    justify-self: stretch;
    width: 100%;
    min-width: 0;
}

.review-receipt-form .raw-ocr-text {
    max-width: 100%;
    overflow: auto;
}

.review-receipt-form .debug-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.review-receipt-form .debug-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
}

.review-receipt-form .debug-list li {
    min-width: 0;
    overflow-wrap: anywhere;
}

.notes-section textarea {
    width: 100%;
}

.receipt-form-actions {
    padding-top: 4px;
}

.detail-list,
.metric-list {
    display: grid;
    grid-template-columns: minmax(140px, 0.45fr) minmax(0, 1fr);
    gap: 12px 16px;
    margin: 0;
}

.detail-list dt,
.metric-list dt {
    color: var(--muted);
    font-weight: 800;
}

.detail-list dd,
.metric-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.metric-list dd {
    font-weight: 850;
}

.safe-to-spend-section {
    margin-bottom: 28px;
}

.safe-to-spend-card {
    min-height: 0;
}

.safe-to-spend-card .helper-text {
    margin: 8px 0 16px;
}

.safe-to-spend-breakdown {
    margin-top: 8px;
}

.safe-to-spend-breakdown dt,
.safe-to-spend-breakdown dd {
    font-size: 0.95rem;
}

.report-safe-summary {
    max-width: 620px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
}

.status-pill.success {
    background: #dcfce7;
    color: #166534;
}

.status-pill.warning {
    background: #fef3c7;
    color: #92400e;
}

.status-pill.danger {
    background: #fee2e2;
    color: #991b1b;
}

.status-pill.neutral {
    background: #e0f2fe;
    color: #075985;
}

.table-action {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 0.88rem;
}

.raw-ocr-panel {
    min-width: 0;
}

.raw-ocr-text {
    min-height: 420px;
    max-height: 680px;
    margin: 0;
    padding: 14px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 0.88rem;
    line-height: 1.55;
    white-space: pre-wrap;
}

.upload-preview {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}

.upload-preview[hidden] {
    display: none;
}

.upload-preview span {
    color: var(--muted);
    font-weight: 800;
}

.upload-preview img {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    border-radius: 8px;
    background: #ffffff;
}

.upload-form {
    gap: 14px;
}

.upload-drop-zone {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 180px;
    padding: 30px;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: var(--text);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.upload-drop-zone:hover,
.upload-drop-zone.drag-over {
    border-color: var(--primary);
    background: #eef6ff;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.1);
}

.upload-drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-drop-title {
    font-size: 1.05rem;
    font-weight: 850;
}

.upload-drop-subtitle {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.upload-drop-action {
    min-height: 40px;
    margin-top: 6px;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 850;
}

.upload-file-rules {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin: -4px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.upload-file-rules span:last-child {
    white-space: nowrap;
}

.selected-file-name {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--text);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.selected-file-name[hidden] {
    display: none;
}

.upload-progress {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.upload-progress[hidden] {
    display: none;
}

.upload-progress span {
    display: block;
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
    animation: upload-progress-slide 1s ease-in-out infinite;
}

@keyframes upload-progress-slide {
    0% {
        transform: translateX(-110%);
    }
    100% {
        transform: translateX(245%);
    }
}

.debug-results {
    margin-top: 18px;
}

.debug-result {
    margin-top: 16px;
    box-shadow: none;
}

.debug-meta {
    margin-bottom: 14px;
}

.debug-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.debug-result h3 {
    margin: 16px 0 8px;
    font-size: 0.95rem;
}

.ocr-debug-text {
    min-height: 280px;
    font-family: Consolas, "Courier New", monospace;
    white-space: pre;
}

.debug-safe-result,
.debug-safe-result .panel,
.debug-safe-result .table-section,
.debug-safe-result .debug-visible-card,
.debug-safe-result .debug-visible-text,
.debug-safe-result .debug-visible-lines {
    background-color: #ffffff;
    color: #000000;
}

.debug-render-marker {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    background-color: #f0fdf4;
    color: #14532d;
    font-weight: 800;
}

.debug-summary-panel {
    margin-bottom: 18px;
}

.debug-db-section {
    display: grid;
    gap: 16px;
}

.debug-receipt-card {
    display: grid;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}

.debug-visible-text {
    min-height: 300px;
    border-color: #94a3b8;
    font-size: 0.92rem;
    line-height: 1.5;
}

.visually-hidden-textarea {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.line-output {
    display: grid;
    gap: 6px;
    max-height: 360px;
    margin: 0;
    padding: 14px 14px 14px 34px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}

.line-output code {
    white-space: pre-wrap;
    color: var(--text);
}

.app-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 18px 28px 26px;
    color: var(--muted);
    font-size: 0.88rem;
}

.sidebar-backdrop {
    display: none;
}

@media (max-width: 1100px) {
    .kpi-grid,
    .chart-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(300px, 86vw);
        transform: translateX(-105%);
        transition: transform 0.2s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-backdrop.open {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.42);
        z-index: 15;
    }

    .icon-button {
        display: inline-block;
        flex: 0 0 auto;
    }

    .topbar {
        padding: 12px 16px;
    }

    .period-form {
        width: 100%;
        justify-content: flex-end;
    }

    .main-content {
        padding: 22px 16px;
    }

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

    .two-column,
    .split-section,
    .review-layout,
    .review-complete-layout,
    .receipt-edit-layout {
        grid-template-columns: 1fr;
    }

    .receipt-preview-panel {
        position: static;
        max-height: min(72vh, 760px);
        overflow-y: auto;
        overflow-x: hidden;
    }

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

    .receipt-detail-preview {
        position: static;
    }

    .upload-file-rules {
        flex-direction: column;
        gap: 2px;
    }

    .mode-selector {
        grid-template-columns: 1fr;
    }

    .receipt-document-status {
        grid-template-columns: 1fr;
    }

    .receipt-document-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .item-row-main,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .total-summary {
        justify-self: stretch;
        min-width: 0;
    }
}

@media (max-width: 620px) {
    .period-form {
        display: grid;
        grid-template-columns: 1fr 0.8fr;
    }

    .period-form button {
        grid-column: 1 / -1;
    }

    .kpi-grid,
    .kpi-grid.compact,
    .chart-grid,
    .payment-type-options {
        grid-template-columns: 1fr;
    }

    .detail-list,
    .metric-list,
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 4px 0;
    }

    .chart-box {
        min-height: 280px;
    }

    .category-distribution-meta {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .category-distribution-percent {
        grid-column: 2;
    }

    .action-row,
    .action-row a,
    .action-row form,
    .items-footer button {
        width: 100%;
    }
}

/* v1.8.0 SaaS authentication and layout foundation */
:root {
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-xxl: 48px;
    --radius-sm: 10px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --bg: #f3f6fa;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --surface-muted: #eef3f8;
    --text: #172033;
    --muted: #66758d;
    --border: #d8e2ee;
    --shadow: 0 18px 48px rgba(15, 23, 42, 0.1);
    --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.055);
    --focus-ring: 0 0 0 4px rgba(15, 118, 110, 0.12);
    --sidebar-bg: #0f172a;
    --sidebar-border: rgba(148, 163, 184, 0.16);
}

body {
    background:
        linear-gradient(180deg, #f7fafc 0%, var(--bg) 240px),
        var(--bg);
    line-height: 1.5;
}

.app-shell {
    grid-template-columns: 284px minmax(0, 1fr);
}

.sidebar {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: 28px 18px 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 220px),
        var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
}

.sidebar-header,
.sidebar-body,
.sidebar-footer {
    min-width: 0;
}

.sidebar-body {
    padding-top: var(--space-xl);
    overflow: auto;
}

.sidebar-footer {
    padding-top: var(--space-lg);
    border-top: 1px solid var(--sidebar-border);
}

.brand-block {
    min-height: 52px;
    padding: 4px 6px;
    border-bottom: 0;
}

.brand-mark {
    border-radius: var(--radius-sm);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.nav-list {
    gap: 5px;
    margin-top: 0;
}

.nav-link {
    padding: 10px 13px;
    border-radius: 12px;
    font-weight: 700;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.075);
}

.nav-link.active {
    box-shadow: inset 3px 0 0 #34d399, inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.profile-menu {
    position: relative;
}

.profile-menu summary {
    list-style: none;
}

.profile-menu summary::marker {
    content: "";
}

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

.profile-trigger {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 11px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.045);
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.profile-trigger:hover,
.profile-menu[open] .profile-trigger {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
}

.profile-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: #f8fafc;
    font-weight: 800;
}

.profile-meta {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.profile-meta strong,
.profile-meta small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-meta strong {
    font-size: 0.92rem;
}

.profile-meta small {
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 700;
}

.profile-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 12px);
    display: grid;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
    box-shadow: 0 20px 52px rgba(15, 23, 42, 0.22);
}

.profile-dropdown form {
    margin: 0;
}

.profile-dropdown-link {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-weight: 700;
    text-align: left;
}

.profile-dropdown-link:hover {
    background: var(--surface-muted);
}

.profile-dropdown-link.active {
    background: rgba(15, 118, 110, 0.1);
    color: var(--primary-dark);
}

.profile-dropdown-danger {
    color: var(--red);
}

.topbar {
    min-height: 78px;
    padding: 14px var(--space-xl);
    background: rgba(247, 250, 252, 0.9);
}

.topbar-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-lg);
    width: 100%;
    min-width: 0;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-language-switcher {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 0 0 auto;
    min-height: 38px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    white-space: nowrap;
}

.topbar-language-switcher a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 28px;
    border-radius: 999px;
    color: var(--text-muted);
    text-decoration: none;
}

.topbar-language-switcher a.active {
    background: rgba(15, 118, 110, 0.12);
    color: var(--primary-dark);
}

.period-form select {
    width: auto;
    min-width: 132px;
}

select,
input,
textarea {
    min-height: 46px;
    border-radius: 12px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

select:focus,
input:focus,
textarea:focus,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
    outline: none;
    border-color: rgba(15, 118, 110, 0.45);
    box-shadow: var(--focus-ring);
}

.main-content {
    width: min(1360px, 100%);
    padding: var(--space-xl);
}

.page-heading {
    margin-bottom: var(--space-xl);
}

.page-heading h1 {
    font-size: clamp(1.6rem, 2.2vw, 2rem);
}

.btn-primary-soft,
.btn-outline-soft,
.btn-danger-soft {
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.94rem;
    font-weight: 750;
    transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.btn-primary-soft {
    box-shadow: 0 10px 20px rgba(15, 118, 110, 0.18);
}

.btn-primary-soft:hover {
    transform: translateY(-1px);
}

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

.kpi-card,
.panel,
.form-panel,
.info-panel,
.table-section {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.panel,
.table-section,
.form-panel,
.info-panel {
    padding: 22px;
}

.auth-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: var(--space-xl);
    background: linear-gradient(135deg, #eaf2f7 0%, #f4f7fb 42%, #eef5fb 100%);
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(320px, 1.05fr) minmax(420px, 0.95fr);
    width: min(1160px, 100%);
    min-height: calc(100vh - (2 * var(--space-xl)));
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(10px);
}

.auth-hero-panel {
    display: flex;
    align-items: center;
    padding: 56px;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.22), transparent 38%),
        linear-gradient(180deg, #0f172a 0%, #142238 100%);
    color: #f8fafc;
}

.auth-hero-content {
    display: grid;
    gap: 30px;
    max-width: 520px;
}

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

.auth-brand-large .brand-name,
.auth-brand-large .brand-version {
    color: #f8fafc;
}

.auth-brand-large .brand-version {
    color: rgba(226, 232, 240, 0.72);
}

.auth-hero-copy {
    display: grid;
    gap: 12px;
}

.auth-eyebrow {
    color: rgba(226, 232, 240, 0.82);
}

.auth-hero-copy h1 {
    margin: 0;
    font-size: clamp(2rem, 2.6vw, 2.55rem);
    line-height: 1.06;
}

.auth-hero-copy .helper-text {
    margin: 0;
    color: rgba(226, 232, 240, 0.78);
    font-size: 1rem;
}

.auth-feature-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-feature-list li {
    position: relative;
    padding-left: 24px;
    color: rgba(241, 245, 249, 0.86);
    font-size: 0.96rem;
}

.auth-feature-list li::before {
    content: "";
    position: absolute;
    top: 9px;
    left: 0;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #34d399;
}

.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px var(--space-xl);
}

.auth-card {
    display: grid;
    gap: var(--space-lg);
    width: min(100%, 440px);
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.auth-card-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-back-link {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
}

.auth-back-link:hover,
.auth-back-link:focus-visible {
    color: var(--primary-dark);
}

.auth-language-switcher {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.92);
}

.auth-language-switcher a {
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.auth-language-switcher a.active {
    background: rgba(15, 118, 110, 0.1);
    color: var(--primary-dark);
}

.auth-heading h1 {
    margin: 0;
    font-size: clamp(1.5rem, 2vw, 1.9rem);
    line-height: 1.1;
}

.auth-heading .helper-text {
    margin-top: 8px;
}

.auth-form {
    display: grid;
    gap: 16px;
}

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

.auth-row,
.auth-footer-links {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--primary-dark);
    font-size: 0.92rem;
    font-weight: 700;
}

@media (max-width: 860px) {
    .topbar-content {
        flex-wrap: wrap;
    }

    .period-form {
        width: 100%;
        margin-left: 0;
    }

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

    .auth-shell {
        grid-template-columns: 1fr;
        width: min(720px, 100%);
        min-height: auto;
    }

    .auth-hero-panel,
    .auth-form-panel {
        padding: var(--space-xl);
    }
}

@media (max-width: 620px) {
    .auth-card,
    .auth-hero-panel,
    .auth-form-panel {
        padding: var(--space-lg);
    }

    .auth-shell {
        border-radius: 18px;
    }

    .profile-dropdown {
        left: auto;
        right: 0;
        width: min(260px, calc(100vw - 32px));
    }
}

/* v1.10.0 UI design system foundation */
:root {
    --font-sans: "Manrope", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: "Fraunces", Georgia, serif;
    --bg: #f2f6f8;
    --bg-accent: #e8f1f5;
    --surface: #ffffff;
    --surface-soft: #f8fbfc;
    --surface-muted: #eef4f7;
    --text: #142033;
    --muted: #66758a;
    --muted-strong: #4b5d73;
    --border: #d9e3ea;
    --border-strong: #c3d2dc;
    --primary: #17806d;
    --primary-dark: #116456;
    --teal: #0f766e;
    --blue: #2573a6;
    --green: #168c61;
    --amber: #c97b18;
    --red: #c43c32;
    --shadow-soft: 0 12px 30px rgba(16, 38, 56, 0.06);
    --shadow: 0 22px 48px rgba(16, 38, 56, 0.1);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
}

body {
    font-family: var(--font-sans);
    background:
        radial-gradient(circle at top right, rgba(37, 115, 166, 0.08), transparent 24rem),
        linear-gradient(180deg, #f7fbfd 0%, var(--bg) 16rem),
        var(--bg);
    color: var(--text);
}

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

.sidebar {
    padding: 30px 20px 20px;
    background:
        radial-gradient(circle at top left, rgba(23, 128, 109, 0.22), transparent 18rem),
        linear-gradient(180deg, #0f172a 0%, #152235 100%);
}

.brand-block {
    gap: 14px;
    padding: 8px 10px 18px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #1aa286 0%, #2573a6 100%);
    box-shadow: 0 16px 30px rgba(23, 128, 109, 0.32);
}

.brand-name {
    font-size: 0.98rem;
    font-weight: 850;
}

.brand-version {
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.nav-list {
    gap: 10px;
}

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

.nav-group summary {
    list-style: none;
}

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

.nav-group-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 12px;
    color: #aebfd3;
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.nav-group-summary:hover {
    color: #e5edf6;
    background: rgba(255, 255, 255, 0.04);
}

.nav-group[open] .nav-group-summary {
    color: #e5edf6;
}

.nav-group-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: #8fa4bb;
    transition: transform 0.18s ease, color 0.16s ease;
}

.nav-group-chevron svg {
    width: 16px;
    height: 16px;
}

.nav-group[open] .nav-group-chevron {
    color: #dce8f3;
    transform: rotate(180deg);
}

.nav-group-items {
    display: grid;
    gap: 6px;
    padding-left: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 11px 14px;
    border-radius: 14px;
    color: #d4dde9;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.085);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
    color: #ffffff;
    box-shadow: inset 3px 0 0 #4ade80;
}

.sidebar-footer {
    padding-top: 18px;
}

.profile-trigger {
    border-radius: 16px;
}

.content-shell {
    background: transparent;
}

.topbar {
    min-height: 82px;
    padding: 16px 32px;
    background: rgba(247, 250, 252, 0.84);
    border-bottom: 1px solid rgba(195, 210, 220, 0.7);
    backdrop-filter: blur(18px);
}

.topbar-content {
    justify-content: flex-start;
}

.topbar-actions {
    flex: 1 1 auto;
    min-width: 0;
}

.period-form {
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    padding: 8px;
    border: 1px solid rgba(195, 210, 220, 0.85);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 10px 24px rgba(16, 38, 56, 0.05);
}

.period-form select,
.period-form button {
    min-height: 42px;
}

.period-form select {
    min-width: 126px;
    background: #ffffff;
}

select,
input,
textarea {
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

label,
.field-label {
    color: var(--muted-strong);
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.helper-text {
    color: var(--muted);
    font-size: 0.9rem;
}

.main-content {
    width: min(1380px, 100%);
    padding: 34px 32px 40px;
}

.page-heading {
    align-items: end;
    gap: 18px;
    margin-bottom: 28px;
}

.page-heading h1 {
    font-size: clamp(1.85rem, 2.45vw, 2.35rem);
    font-weight: 850;
    line-height: 1.04;
}

.eyebrow,
.section-eyebrow {
    margin: 0 0 8px;
    color: var(--teal);
    font-size: 0.74rem;
    font-weight: 850;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.action-row {
    align-items: center;
    gap: 12px;
}

.btn-primary-soft,
.btn-outline-soft,
.btn-danger-soft {
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 800;
}

.btn-primary-soft {
    background: linear-gradient(135deg, var(--primary) 0%, var(--blue) 100%);
    border-color: transparent;
}

.btn-primary-soft:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1f5d88 100%);
    box-shadow: 0 14px 24px rgba(23, 128, 109, 0.22);
}

.btn-outline-soft {
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.94);
}

.btn-outline-soft:hover {
    background: var(--surface-soft);
    border-color: #b4c8d6;
}

.btn-danger-soft {
    background: linear-gradient(135deg, #cf4a40 0%, #b12525 100%);
}

.dashboard-stack {
    display: grid;
    gap: 28px;
}

.dashboard-section {
    display: grid;
    gap: 18px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
}

.section-heading.compact {
    align-items: center;
    margin-bottom: 6px;
}

.section-heading h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 820;
    line-height: 1.1;
}

.section-heading p:not(.section-eyebrow) {
    margin: 0;
}

.snapshot-grid,
.metrics-grid {
    display: grid;
    gap: 16px;
}

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

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

.activity-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    gap: 18px;
}

.chart-grid {
    gap: 18px;
}

.chart-grid > * {
    min-width: 0;
}

.kpi-card,
.panel,
.form-panel,
.info-panel,
.table-section {
    border: 1px solid rgba(217, 227, 234, 0.92);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.panel,
.table-section,
.form-panel,
.info-panel {
    padding: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
}

.kpi-card {
    min-height: 156px;
    padding: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdfe 100%);
    border-top: 0;
    position: relative;
    overflow: hidden;
}

.kpi-card::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--blue) 0%, var(--teal) 100%);
}

.kpi-card.success::after {
    background: linear-gradient(180deg, #1cad75 0%, #17806d 100%);
}

.kpi-card.teal::after {
    background: linear-gradient(180deg, #1d8f82 0%, #2573a6 100%);
}

.kpi-card.danger::after {
    background: linear-gradient(180deg, #df645b 0%, #b4332d 100%);
}

.kpi-card.primary {
    background:
        radial-gradient(circle at top right, rgba(37, 115, 166, 0.14), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f9fcfd 100%);
}

.kpi-card span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.kpi-card strong {
    margin-top: 12px;
    font-size: clamp(1.5rem, 2.4vw, 2.2rem);
    font-weight: 850;
}

.kpi-helper {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.safe-to-spend-section {
    margin: 0;
}

.safe-to-spend-card {
    grid-column: span 2;
    min-height: 100%;
}

.safe-to-spend-card .helper-text {
    margin: 10px 0 18px;
}

.safe-to-spend-breakdown {
    grid-template-columns: minmax(148px, 0.4fr) minmax(0, 1fr);
    gap: 10px 14px;
}

.safe-to-spend-breakdown dt,
.safe-to-spend-breakdown dd {
    font-size: 0.94rem;
}

.safe-to-spend-card .status-pill {
    margin-top: 16px;
    width: fit-content;
}

.panel-heading {
    margin-bottom: 16px;
}

.panel-heading h2 {
    font-size: 1.04rem;
    font-weight: 800;
}

.table-responsive {
    border-radius: 14px;
}

.data-table {
    min-width: 720px;
}

.data-table thead th {
    background: #f8fbfd;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 850;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.data-table tbody tr {
    transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
    background: rgba(23, 128, 109, 0.035);
}

.data-table th,
.data-table td {
    padding: 14px 14px;
}

.status-pill {
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.status-message {
    border-radius: 14px;
    border-color: #b9e7e3;
    background: linear-gradient(180deg, #f2fffd 0%, #ebfbf8 100%);
}

.smart-suggestion-note {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid rgba(34, 99, 146, 0.14);
    border-radius: 12px;
    background: rgba(244, 249, 255, 0.9);
    color: #3f5268;
    font-size: 0.9rem;
}

.smart-suggestion-note strong {
    font-size: 0.9rem;
}

.smart-suggestion-note span {
    color: var(--muted);
    font-size: 0.84rem;
}

.app-footer {
    padding: 20px 32px 30px;
}

.auth-page {
    background:
        radial-gradient(circle at top left, rgba(37, 115, 166, 0.14), transparent 28rem),
        linear-gradient(180deg, #f7fbfd 0%, #eef5f8 100%);
}

.auth-shell {
    border-radius: 28px;
}

.auth-hero-copy h1 {
    font-family: var(--font-display);
    font-size: clamp(2.1rem, 2.8vw, 2.85rem);
    font-weight: 700;
    line-height: 1.03;
}

.auth-card {
    border-radius: 22px;
}

@media (max-width: 1180px) {
    .snapshot-grid,
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .safe-to-spend-card {
        grid-column: span 2;
    }

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

@media (max-width: 860px) {
    .topbar {
        padding: 14px 18px;
    }

    .main-content {
        padding: 26px 18px 34px;
    }

    .period-form {
        width: 100%;
        justify-content: stretch;
    }

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

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

@media (max-width: 620px) {
    .snapshot-grid,
    .metrics-grid,
    .chart-grid {
        grid-template-columns: 1fr;
    }

    .safe-to-spend-card {
        grid-column: auto;
    }

    .page-heading {
        align-items: flex-start;
    }

    .page-heading h1 {
        font-size: 1.8rem;
    }

    .action-row,
    .action-row a,
    .action-row form {
        width: 100%;
    }
}

/* v1.10.1 final UI polish */
.page-heading .eyebrow,
.section-heading .section-eyebrow,
.auth-heading .eyebrow {
    margin-bottom: 10px;
    color: #0f766e;
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.15em;
}

.page-heading h1,
.section-heading h2,
.panel-heading h2,
.auth-heading h1 {
    color: #142033;
}

.page-heading h1 {
    letter-spacing: -0.02em;
}

.section-heading h2 {
    font-size: 1.18rem;
    font-weight: 830;
    letter-spacing: -0.01em;
}

.helper-text,
.kpi-helper,
.auth-heading .helper-text,
.panel-heading span {
    line-height: 1.55;
}

.topbar {
    min-height: 84px;
}

.period-form {
    gap: 8px;
    border-radius: 18px;
}

.period-form button {
    min-width: 86px;
}

.sidebar {
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03);
}

.brand-block {
    padding-bottom: 20px;
}

.nav-link,
.profile-trigger,
.profile-dropdown-link,
.btn-primary-soft,
.btn-outline-soft,
.btn-danger-soft,
.kpi-card,
.data-table tbody tr {
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        background-color 0.16s ease,
        border-color 0.16s ease,
        color 0.16s ease;
}

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

.kpi-card:hover,
.panel:hover,
.table-section:hover {
    box-shadow: 0 18px 32px rgba(16, 38, 56, 0.08);
}

.kpi-card:hover {
    transform: translateY(-2px);
}

.safe-to-spend-card {
    padding: 24px 24px 22px;
    border: 1px solid rgba(176, 219, 210, 0.95);
    box-shadow: 0 20px 42px rgba(16, 38, 56, 0.09);
}

.safe-to-spend-card.primary {
    background:
        radial-gradient(circle at top right, rgba(23, 128, 109, 0.16), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #f8fcfb 100%);
}

.safe-to-spend-card.danger {
    border-color: rgba(230, 182, 177, 0.92);
    background:
        radial-gradient(circle at top right, rgba(196, 60, 50, 0.12), transparent 26%),
        linear-gradient(180deg, #ffffff 0%, #fff8f7 100%);
}

.safe-to-spend-card strong {
    font-size: clamp(2rem, 3.2vw, 2.9rem);
    line-height: 0.98;
}

.safe-to-spend-breakdown {
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px solid rgba(195, 210, 220, 0.75);
}

.safe-to-spend-breakdown dt {
    color: #66758a;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.safe-to-spend-breakdown dd {
    font-weight: 820;
}

.kpi-card {
    justify-content: space-between;
}

.kpi-card span {
    font-size: 0.78rem;
}

.kpi-card strong {
    letter-spacing: -0.025em;
}

.chart-grid .panel,
.chart-grid .table-section {
    overflow: hidden;
}

.chart-box {
    min-height: 336px;
    padding: 4px 0 0;
}

.category-distribution-list {
    gap: 14px;
    padding-right: 6px;
}

.category-distribution-meta {
    font-size: 0.9rem;
}

.category-distribution-name {
    font-weight: 800;
}

.category-distribution-bar {
    height: 9px;
    background: #e6eef4;
}

.data-table {
    min-width: 720px;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding-top: 13px;
    padding-bottom: 13px;
    background: #f7fbfd;
    border-bottom: 1px solid #d7e3eb;
}

.data-table tbody td {
    color: #233246;
    font-size: 0.94rem;
    font-variant-numeric: tabular-nums;
}

.data-table tbody tr:hover td {
    background: rgba(23, 128, 109, 0.032);
}

.table-action {
    min-height: 34px;
    padding: 7px 11px;
    border-radius: 10px;
}

.status-pill {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.table-responsive::-webkit-scrollbar {
    height: 10px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #d5e1e9;
    border-radius: 999px;
}

/* v1.11.0 mobile responsive shell + basic PWA pass */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body.sidebar-open {
    overflow: hidden;
}

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

.topbar-primary {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.mobile-header-title {
    display: none;
    flex: 1 1 auto;
    min-width: 0;
    color: #142033;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
}

.mobile-profile-link {
    display: none;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    text-decoration: none;
}

.mobile-profile-avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 800;
}

.sidebar-close-button {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    transition: background-color 0.16s ease, transform 0.16s ease;
}

.sidebar-close-button span {
    position: absolute;
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.sidebar-close-button span:first-child {
    transform: rotate(45deg);
}

.sidebar-close-button span:last-child {
    transform: rotate(-45deg);
}

.sidebar-close-button:hover,
.sidebar-close-button:focus-visible {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}

.mobile-actions-menu {
    position: relative;
    display: none;
}

.mobile-actions-trigger {
    min-height: 42px;
}

.mobile-actions-menu > summary {
    list-style: none;
    cursor: pointer;
}

.mobile-actions-menu > summary::-webkit-details-marker {
    display: none;
}

.mobile-actions-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 12;
    min-width: 220px;
    padding: 10px;
    border: 1px solid rgba(214, 226, 237, 0.92);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 32px rgba(16, 38, 56, 0.12);
}

.mobile-actions-link {
    display: flex;
    align-items: center;
    min-height: 44px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    color: #223144;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
}

.mobile-actions-button {
    border: 0;
    background: transparent;
    text-align: left;
}

.mobile-actions-link:hover,
.mobile-actions-link:focus-visible {
    background: rgba(15, 118, 110, 0.08);
    color: #0f766e;
}

.dashboard-stack,
.main-content,
.page-heading,
.panel,
.table-section,
.form-panel,
.info-panel,
.kpi-card,
.safe-to-spend-card {
    min-width: 0;
}

.page-heading {
    gap: 16px;
}

.page-heading h1 {
    overflow-wrap: anywhere;
}

.action-row {
    flex-wrap: wrap;
    gap: 10px;
}

.action-row a,
.action-row button {
    min-height: 42px;
}

.period-form {
    flex-wrap: wrap;
}

.period-form select,
.period-form button {
    min-height: 44px;
}

.table-responsive {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.table-responsive > .data-table {
    width: 100%;
}

.chart-box {
    width: 100%;
    min-height: 320px;
}

.install-app-panel {
    display: grid;
    gap: 12px;
}

.auth-card {
    width: min(100%, 480px);
}

.sidebar-backdrop {
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(3px);
}

@media (min-width: 1024px) {
    .icon-button {
        display: none;
    }
}

@media (max-width: 1023px) {
    .icon-button {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        position: relative;
        width: 44px;
        height: 44px;
        padding: 0;
        border-radius: 14px;
        background: #ffffff;
        color: #142033;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    }

    .menu-icon {
        width: 22px;
        height: 22px;
    }

    .menu-icon-close {
        display: none;
    }

    .icon-button.open .menu-icon-open {
        display: none;
    }

    .icon-button.open .menu-icon-close {
        display: block;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 24;
        width: min(320px, 88vw);
        height: 100dvh;
        transform: translateX(-104%);
        transition: transform 0.22s ease;
        padding: 24px 18px 18px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-backdrop.open {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 20;
    }

    .sidebar-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 16px;
    }

    .sidebar-close-button {
        position: relative;
        display: inline-flex;
        flex: 0 0 auto;
    }

    .content-shell {
        min-width: 0;
    }

    .topbar {
        min-height: 74px;
        padding: 14px 18px;
    }

    .topbar-content {
        flex: 1 1 auto;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
    }

    .topbar-actions {
        flex: 1 1 100%;
        justify-content: flex-start;
        min-width: 0;
    }

    .period-form {
        flex: 1 1 100%;
        width: 100%;
        justify-content: stretch;
    }

    .period-form select,
    .period-form button {
        flex: 1 1 0;
        min-width: 0;
    }

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

    .snapshot-grid > .safe-to-spend-card {
        grid-column: 1 / -1;
    }

    .snapshot-grid > .metric-card {
        grid-column: span 1;
    }

    .metrics-grid,
    .chart-grid,
    .activity-grid,
    .two-column,
    .details-layout,
    .upload-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metrics-grid > *,
    .chart-grid > *,
    .activity-grid > *,
    .two-column > *,
    .details-layout > *,
    .upload-layout > * {
        min-width: 0;
    }

    .activity-grid .table-section:last-child {
        grid-column: 1 / -1;
    }

    .chart-box {
        min-height: 280px;
    }

    .auth-shell {
        grid-template-columns: 1fr;
        width: min(760px, 100%);
        min-height: auto;
    }

    .auth-hero-panel {
        min-height: 0;
    }
}

@media (max-width: 767px) {
    .topbar {
        min-height: 78px;
        padding: 12px 14px;
    }

    .topbar-content {
        align-items: stretch;
    }

    .topbar-actions {
        order: 1;
    }

    .mobile-actions-menu {
        display: inline-flex;
    }

    .desktop-action-row {
        display: none;
    }

    .period-form {
        order: 2;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 8px;
        padding: 10px;
        border: 1px solid rgba(214, 226, 237, 0.92);
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.9);
    }

    .period-form button {
        grid-column: 1 / -1;
    }

    .main-content {
        padding-left: 14px;
        padding-right: 14px;
    }

    .app-footer {
        padding-left: 14px;
        padding-right: 14px;
        gap: 8px;
    }

    .page-heading {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }

    .action-row {
        width: 100%;
        justify-content: stretch;
    }

    .action-row > * {
        flex: 1 1 100%;
    }

    .snapshot-grid,
    .metrics-grid,
    .chart-grid,
    .activity-grid,
    .two-column,
    .details-layout,
    .upload-layout,
    .kpi-grid,
    .summary-grid,
    .review-layout,
    .receipt-layout {
        grid-template-columns: 1fr;
    }

    .safe-to-spend-card {
        padding: 20px;
    }

    .safe-to-spend-card strong,
    .metric-card strong,
    .kpi-card strong {
        font-size: clamp(1.7rem, 6vw, 2.2rem);
    }

    .safe-to-spend-breakdown dt,
    .safe-to-spend-breakdown dd,
    .metric-list dt,
    .metric-list dd {
        font-size: 0.92rem;
    }

    .panel,
    .table-section,
    .form-panel,
    .info-panel,
    .kpi-card {
        padding: 18px;
    }

    .form-grid,
    .items-grid,
    .item-row {
        grid-template-columns: 1fr;
    }

    .item-row > button,
    .items-header .table-action,
    .items-footer .table-action {
        width: 100%;
    }

    .table-responsive {
        margin: 0 -4px;
        padding: 0 4px 8px;
    }

    .data-table {
        min-width: 640px;
    }

    .chart-box {
        min-height: 240px;
    }

    .upload-drop-zone,
    .mode-option,
    .profile-trigger,
    .nav-link,
    .nav-group-summary {
        min-height: 44px;
    }

    .auth-shell {
        width: 100%;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }

    .auth-hero-panel,
    .auth-form-panel,
    .auth-card {
        padding: 20px;
        border-radius: 22px;
    }

    .auth-card-topbar {
        align-items: flex-start;
    }

.auth-form-panel {
        padding-top: 0;
    }
}

/* v1.16.0-design-hardening */
.nav-link-standalone {
    margin-bottom: var(--space-xs);
}

.content-shell,
.main-content,
.panel,
.table-section,
.form-panel,
.receipt-form-section,
.review-layout,
.review-complete-layout,
.receipt-edit-layout,
.review-complete-layout > *,
.receipt-edit-layout > *,
.receipt-preview-panel,
.item-rows,
.item-row,
.item-row-main,
.item-row-notes,
.item-row-actions,
.payment-type-options,
.installment-fields,
.installment-fields .form-grid,
.form-grid,
.chart-grid,
.metrics-grid,
.activity-grid,
.snapshot-grid,
.two-column {
    min-width: 0;
    max-width: 100%;
}

.main-content {
    padding: var(--space-xl);
}

.page-heading,
.kpi-grid,
.chart-grid,
.dashboard-section,
.table-section,
.two-column,
.review-layout,
.review-complete-layout,
.receipt-edit-layout,
.forecast-header,
.forecast-kpi-grid,
.forecast-insight-banner,
.forecast-content-grid {
    margin-bottom: var(--space-xl);
}

.dashboard-section + .dashboard-section {
    margin-top: var(--space-2xl);
}

.panel,
.table-section,
.form-panel,
.info-panel,
.kpi-card {
    padding: var(--space-lg);
}

.kpi-card,
.panel,
.table-section,
.form-panel,
.info-panel {
    border-radius: 12px;
}

.kpi-card,
.metric-card {
    min-height: 0;
}

.dashboard-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-lg);
}

.dashboard-kpi-section {
    margin-bottom: var(--space-xl);
}

.dashboard-core-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-lg);
}

.dashboard-planning-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-lg);
}

.dashboard-core-grid > .metric-card,
.dashboard-planning-grid > .metric-card,
.dashboard-planning-grid > .safe-to-spend-card {
    grid-column: auto;
    min-width: 0;
}

.review-complete-layout,
.receipt-edit-layout {
    display: grid;
    grid-template-columns: minmax(360px, 40%) minmax(0, 60%);
    gap: var(--space-lg);
    align-items: start;
    overflow-x: clip;
}

.review-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
    gap: var(--space-lg);
    align-items: start;
    overflow-x: clip;
}

.receipt-preview-panel {
    position: sticky;
    top: calc(78px + var(--space-md));
    align-self: start;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

.receipt-preview-panel .panel-heading {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface);
    padding-bottom: 10px;
}

.receipt-edit-layout {
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: var(--space-lg);
    align-items: start;
}

.receipt-edit-layout > .receipt-preview-panel {
    width: 100%;
    max-width: none;
    grid-column: 1;
}

.receipt-edit-layout > .receipt-edit-form {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    grid-column: 2;
}

.review-receipt-form,
.receipt-form {
    width: 100%;
    overflow-x: hidden;
}

.items-header,
.items-footer {
    gap: var(--space-sm);
}

.item-row {
    gap: var(--space-md);
    padding: var(--space-md);
    overflow: hidden;
}

.item-row-main {
    grid-template-columns: minmax(180px, 1.45fr) minmax(140px, 1fr) minmax(150px, 1fr) minmax(110px, 0.72fr) minmax(110px, 0.72fr);
    gap: var(--space-sm);
    align-items: end;
}

.item-field-remove {
    display: none;
}

.item-row-notes {
    grid-template-columns: minmax(0, 1fr);
}

.item-row-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.item-row-actions .danger-action {
    min-height: 42px;
    min-width: 120px;
    white-space: nowrap;
}

.item-row input,
.item-row select,
.item-row textarea,
.item-row-notes input {
    min-width: 0;
    max-width: 100%;
}

.installment-fields .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-md);
}

.payment-type-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-md);
}

.forecast-page .panel,
.forecast-page .kpi-card {
    min-height: 0;
}

.forecast-content-grid {
    align-items: start;
}

.forecast-accordion {
    margin-top: var(--space-xl);
}

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

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

    .review-complete-layout,
    .receipt-edit-layout,
    .review-layout {
        grid-template-columns: 1fr;
    }

    .receipt-preview-panel {
        position: static;
    }
}

@media (max-width: 1023px) {
    .main-content {
        padding: var(--space-lg);
    }

    .payment-type-options,
    .installment-fields .form-grid,
    .dashboard-summary-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 860px) {
    .item-row-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .main-content {
        padding: var(--space-md);
    }

    .dashboard-summary-grid,
    .dashboard-core-grid,
    .dashboard-planning-grid,
    .metrics-grid,
    .activity-grid,
    .chart-grid,
    .two-column {
        grid-template-columns: 1fr;
    }

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

    .item-row-actions {
        justify-content: stretch;
    }

    .item-row-actions .danger-action,
    .items-header .table-action,
    .items-footer .table-action {
        width: 100%;
    }
}

/* v1.11.0 desktop sidebar fix for long scrolling pages */
@media (min-width: 1024px) {
    :root {
        --desktop-sidebar-width: 284px;
    }

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

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: var(--desktop-sidebar-width);
        height: 100vh;
        z-index: 24;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .sidebar-header {
        flex: 0 0 auto;
    }

    .sidebar-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .sidebar-footer {
        flex: 0 0 auto;
        margin-top: auto;
    }

    .content-shell {
        margin-left: var(--desktop-sidebar-width);
        width: calc(100% - var(--desktop-sidebar-width));
        min-height: 100vh;
    }

    .topbar,
    .app-footer {
        width: 100%;
    }
}

.auth-card {
    padding: 34px;
}

.auth-form {
    gap: 18px;
}

.auth-row a,
.auth-footer-links a {
    color: #116456;
}

@media (max-width: 860px) {
    .topbar-content {
        gap: 14px;
    }
}

@media (max-width: 620px) {
    .safe-to-spend-card strong {
        font-size: 2.15rem;
    }

    .auth-card {
        padding: 26px;
    }
}

/* v1.10.1 dashboard refinement pass */
.dashboard-stack {
    gap: 30px;
}

.snapshot-grid {
    display: grid;
    grid-template-columns: repeat(20, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.snapshot-grid > * {
    min-width: 0;
}

.snapshot-grid > .safe-to-spend-card {
    grid-column: span 8;
}

.snapshot-grid > .metric-card {
    grid-column: span 4;
}

.dashboard-section {
    position: relative;
}

.dashboard-section + .dashboard-section {
    padding-top: 10px;
}

.dashboard-section + .dashboard-section::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0), rgba(148, 163, 184, 0.32), rgba(148, 163, 184, 0));
}

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

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

.metrics-grid {
    gap: 16px;
}

.kpi-card,
.panel,
.table-section {
    position: relative;
    border: 1px solid rgba(214, 226, 237, 0.92);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.055);
}

.metric-card,
.source-card {
    min-height: 208px;
    padding: 18px 18px 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 254, 0.98)),
        #ffffff;
}

.metric-card.rich-card {
    overflow: hidden;
}

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

.metric-title-group {
    display: flex;
    align-items: center;
    min-width: 0;
}

.metric-title-group.stacked {
    display: grid;
    gap: 2px;
}

.metric-subtitle,
.panel-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.panel-subtitle {
    margin-top: 4px;
}

.forecast-page {
    display: grid;
    gap: var(--space-lg);
    min-width: 0;
}

.forecast-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-sm);
}

.forecast-title-block {
    display: grid;
    gap: var(--space-xs);
    min-width: 0;
}

.forecast-title {
    margin: 0;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.forecast-title span,
.forecast-subtitle {
    color: var(--muted);
}

.forecast-subtitle {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
}

.forecast-kpi-grid {
    gap: var(--space-md);
}

.forecast-kpi-card {
    min-height: auto;
    padding: 20px;
}

.forecast-kpi-card strong {
    margin-top: var(--space-sm);
    font-size: clamp(1.35rem, 2vw, 1.95rem);
}

.forecast-kpi-card .kpi-helper {
    margin-top: var(--space-sm);
    font-size: 0.82rem;
    line-height: 1.35;
}

.forecast-insight-banner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: var(--space-md);
    padding: 22px 24px;
}

.forecast-insight-marker {
    width: 12px;
    align-self: stretch;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(37, 115, 166, 0.5) 0%, rgba(37, 115, 166, 0.18) 100%);
}

.forecast-insight-banner.forecast-success .forecast-insight-marker {
    background: linear-gradient(180deg, rgba(28, 173, 117, 0.88) 0%, rgba(23, 128, 109, 0.42) 100%);
}

.forecast-insight-banner.forecast-warning .forecast-insight-marker {
    background: linear-gradient(180deg, rgba(217, 119, 6, 0.88) 0%, rgba(180, 83, 9, 0.38) 100%);
}

.forecast-insight-banner.forecast-danger .forecast-insight-marker {
    background: linear-gradient(180deg, rgba(223, 100, 91, 0.92) 0%, rgba(180, 51, 45, 0.42) 100%);
}

.forecast-insight-copy {
    display: grid;
    gap: var(--space-sm);
    min-width: 0;
}

.forecast-insight-top {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.forecast-insight-headline {
    margin: 0;
    color: var(--text);
    font-size: 1.02rem;
    font-weight: 780;
    line-height: 1.45;
}

.forecast-inline-warning {
    margin: 0;
    color: #9a3412;
    font-size: 0.84rem;
    font-weight: 700;
    padding-top: var(--space-xs);
}

.forecast-inline-warning.neutral {
    color: #7c8da1;
}

.forecast-content-grid {
    gap: var(--space-lg);
    margin-top: var(--space-sm);
}

.forecast-breakdown-panel,
.forecast-about-panel {
    min-width: 0;
    padding: var(--space-lg);
    align-self: start;
}

.forecast-breakdown-list {
    gap: 12px var(--space-md);
}

.forecast-breakdown-list dt {
    color: #617286;
    font-size: 0.84rem;
    font-weight: 750;
}

.forecast-breakdown-list dd {
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 800;
}

.forecast-about-copy {
    max-width: 44ch;
}

.forecast-about-stack {
    display: grid;
    gap: 12px;
}

.forecast-about-stack .helper-text {
    margin: 0;
}

.forecast-about-meta {
    display: grid;
    gap: var(--space-sm);
    padding-top: var(--space-xs);
    color: #617286;
    font-size: 0.82rem;
    font-weight: 700;
}

.forecast-accordion {
    padding: 0;
    overflow: hidden;
    margin-top: 0;
}

.forecast-accordion summary {
    padding: 16px 20px;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

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

.forecast-accordion[open] summary {
    border-bottom: 1px solid rgba(217, 227, 234, 0.92);
}

.forecast-formula-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 16px 20px 20px 36px;
    color: #526173;
    font-size: 0.88rem;
    line-height: 1.5;
}

.metric-tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border: 1px solid rgba(210, 222, 232, 0.92);
    border-radius: 999px;
    background: rgba(248, 251, 253, 0.96);
    color: #607085;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.trend-chip {
    display: inline-grid;
    gap: 2px;
    margin-top: 2px;
    margin-bottom: 10px;
}

.trend-headline {
    color: #1f2937;
    font-size: 0.84rem;
    font-weight: 800;
}

.trend-detail {
    color: #64748b;
    font-size: 0.79rem;
    font-weight: 700;
}

.trend-chip.positive .trend-headline,
.trend-chip.positive .trend-detail {
    color: #0f766e;
}

.trend-chip.negative .trend-headline,
.trend-chip.negative .trend-detail {
    color: #b45309;
}

.trend-chip.neutral .trend-headline,
.trend-chip.neutral .trend-detail {
    color: #64748b;
}

.mini-sparkline {
    width: 100%;
    height: 42px;
    margin-top: auto;
    overflow: visible;
}

.mini-sparkline polyline {
    fill: none;
    stroke: #0f766e;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mini-sparkline polygon {
    fill: rgba(15, 118, 110, 0.08);
}

.mini-sparkline.success polyline,
.hero-sparkline.success polyline {
    stroke: #0f766e;
}

.mini-sparkline.success polygon,
.hero-sparkline.success polygon {
    fill: rgba(15, 118, 110, 0.08);
}

.mini-sparkline.teal polyline {
    stroke: #0f766e;
}

.mini-sparkline.teal polygon {
    fill: rgba(15, 118, 110, 0.08);
}

.mini-sparkline.info polyline,
.mini-sparkline.cool polyline {
    stroke: #2563eb;
}

.mini-sparkline.info polygon,
.mini-sparkline.cool polygon {
    fill: rgba(37, 99, 235, 0.08);
}

.mini-sparkline.warm polyline,
.hero-sparkline.danger polyline,
.mini-sparkline.danger polyline {
    stroke: #dc6b2f;
}

.mini-sparkline.warm polygon,
.hero-sparkline.danger polygon,
.mini-sparkline.danger polygon {
    fill: rgba(220, 107, 47, 0.08);
}

.metric-card strong,
.source-card strong {
    margin-bottom: 8px;
}

.safe-to-spend-card {
    min-height: 232px;
    padding: 18px 20px 16px;
    background:
        radial-gradient(circle at top right, rgba(20, 138, 120, 0.14), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 250, 248, 0.98));
}

.safe-to-spend-card.danger {
    background:
        radial-gradient(circle at top right, rgba(220, 107, 47, 0.12), transparent 32%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(254, 247, 245, 0.98));
}

.safe-to-spend-card .metric-card-top {
    margin-bottom: 8px;
}

.safe-to-spend-card .metric-title-group > span:first-child,
.metric-card .metric-title-group > span:first-child,
.metric-card .metric-title-group.stacked > span:first-child {
    color: #223146;
    font-size: 0.82rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.safe-to-spend-card .status-pill {
    align-self: flex-start;
}

.safe-to-spend-card .trend-chip {
    margin-top: 6px;
    margin-bottom: 10px;
}

.safe-to-spend-summary-card {
    min-height: 0;
    padding: 18px 20px;
}

.safe-to-spend-summary-card strong {
    margin-bottom: 6px;
    font-size: clamp(1.3rem, 2vw, 1.9rem);
}

.safe-to-spend-summary-card .kpi-helper,
.safe-to-spend-summary-card .helper-text {
    margin-bottom: 0;
}

.safe-to-spend-page {
    display: grid;
    gap: var(--space-lg);
}

.safe-to-spend-page > .page-heading,
.safe-to-spend-page > .table-section,
.safe-to-spend-page > .two-column,
.safe-to-spend-page > .forecast-accordion {
    margin-bottom: 0;
}

.safe-to-spend-detail-grid {
    gap: var(--space-lg);
}

.safe-to-spend-breakdown {
    margin-top: 10px;
    padding-top: 12px;
    row-gap: 6px;
}

.safe-to-spend-breakdown dt {
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.8rem;
}

.safe-to-spend-breakdown dd {
    font-size: 0.88rem;
}

.financial-timeline-page {
    display: grid;
    gap: var(--space-xl);
}

.financial-timeline-page > .page-heading,
.financial-timeline-page > .snapshot-grid,
.financial-timeline-page > .table-section {
    margin-bottom: 0;
}

.financial-timeline-kpis {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    gap: var(--space-md);
}

.financial-timeline-kpis > .metric-card,
.financial-timeline-kpis > .kpi-card,
.financial-timeline-kpis > * {
    grid-column: span 1;
}

.financial-timeline-kpi-card {
    display: flex;
    flex-direction: column;
    min-height: 152px;
    max-height: 176px;
    height: 100%;
    padding: 14px 16px;
}

.financial-timeline-kpi-card .metric-card-top {
    margin-bottom: 6px;
    gap: 10px;
}

.financial-timeline-kpi-card strong {
    margin-bottom: 6px;
    font-size: clamp(1.35rem, 1.9vw, 1.75rem);
    line-height: 1.05;
}

.financial-timeline-kpi-card .kpi-helper {
    margin-top: auto;
    font-size: 0.8rem;
    line-height: 1.35;
}

.financial-timeline-kpi-card .metric-title-group > span:first-child {
    font-size: 0.76rem;
    letter-spacing: 0.05em;
}

.financial-timeline-kpi-card .status-pill {
    align-self: flex-start;
    white-space: nowrap;
}

.financial-timeline-section {
    overflow: hidden;
    padding: 20px;
}

.financial-timeline-chart {
    min-height: 320px;
    margin-top: 0;
}

.financial-timeline-insights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-md);
}

.financial-timeline-insight {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: var(--space-md);
    border: 1px solid rgba(219, 228, 237, 0.9);
    border-radius: 12px;
    background: rgba(248, 251, 253, 0.88);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.financial-timeline-insight-label {
    color: #617286;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.financial-timeline-insight strong {
    color: var(--text);
    font-size: 1rem;
    font-weight: 850;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.financial-timeline-insight small {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.4;
}

.timeline-table {
    display: grid;
    gap: 0;
}

.timeline-header {
    display: block;
}

.timeline-row {
    display: grid;
    grid-template-columns:
        minmax(92px, 0.8fr)
        minmax(0, 1.7fr)
        minmax(110px, 0.9fr)
        minmax(104px, 0.8fr)
        minmax(122px, 0.9fr)
        minmax(138px, 0.95fr);
    gap: var(--space-md);
    align-items: center;
    min-width: 0;
}

.timeline-row-header {
    padding: 0 0 var(--space-sm);
    border-bottom: 1px solid rgba(217, 227, 234, 0.92);
    color: var(--muted-strong);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.timeline-row-event {
    padding: 16px 0;
    border-bottom: 1px solid rgba(226, 234, 241, 0.9);
}

.timeline-row-event:last-child {
    border-bottom: 0;
}

.timeline-cell {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.timeline-cell-main {
    overflow-wrap: anywhere;
}

.timeline-cell-amount,
.timeline-cell-balance {
    justify-items: end;
    text-align: right;
}

.timeline-cell-label {
    display: none;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.timeline-cell-value,
.timeline-event-detail {
    color: var(--muted);
    font-size: 0.88rem;
}

.timeline-event-label,
.timeline-balance,
.timeline-amount {
    font-variant-numeric: tabular-nums;
}

.timeline-event-label {
    color: var(--text);
    font-size: 0.96rem;
    font-weight: 800;
}

.timeline-event-detail {
    line-height: 1.35;
}

.timeline-type-chip {
    display: inline-flex;
    width: fit-content;
    min-width: 0;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(231, 241, 247, 0.92);
    color: #40556d;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
}

.timeline-row-event .status-pill,
.timeline-row-event .timeline-type-chip {
    width: fit-content;
}

.timeline-type-money_in {
    background: rgba(26, 173, 117, 0.12);
    color: #15785a;
}

.timeline-type-expense {
    background: rgba(214, 96, 86, 0.12);
    color: #9f342d;
}

.timeline-type-installment,
.timeline-type-recurring {
    background: rgba(48, 104, 161, 0.12);
    color: #28547f;
}

.timeline-amount.positive {
    color: #15785a;
}

.timeline-amount.negative {
    color: #aa3c33;
}

.balance-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 250, 251, 0.98));
}

.expense-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 244, 0.98));
}

.tint-blue {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 255, 0.98));
}

.tint-savings {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 255, 0.98));
}

.tint-project {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(242, 251, 250, 0.98));
}

.tint-installment {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 245, 255, 0.98));
}

.chart-grid {
    gap: 18px;
}

.panel-heading {
    align-items: flex-start;
}

.panel-heading > div:first-child {
    min-width: 0;
}

.chart-box {
    min-height: 312px;
    margin-top: 8px;
}

.chart-box-compact {
    min-height: 268px;
}

.category-distribution-list {
    gap: 12px;
}

.category-distribution-row {
    padding: 12px 12px 11px;
    border: 1px solid rgba(219, 228, 237, 0.9);
    border-radius: 14px;
    background: rgba(248, 251, 253, 0.88);
}

.category-distribution-meta {
    margin-bottom: 10px;
}

.activity-grid {
    gap: 18px;
}

.table-section {
    overflow: hidden;
    min-width: 0;
}

.table-section .panel-heading {
    padding-bottom: 6px;
}

.summary-list {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.summary-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
    padding: 12px 0;
    border-top: 1px solid rgba(226, 234, 241, 0.9);
}

.summary-list-row:first-child {
    border-top: 0;
    padding-top: 2px;
}

.summary-list-main,
.summary-list-side {
    min-width: 0;
}

.summary-list-main {
    display: grid;
    gap: 4px;
    flex: 1 1 auto;
}

.summary-list-side {
    display: grid;
    justify-items: end;
    gap: 8px;
    flex: 0 0 auto;
}

.summary-list-titleline {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap;
}

.summary-list-date {
    color: #6b7c90;
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.summary-list-separator {
    color: #9aaabc;
    font-size: 0.9rem;
}

.summary-list-title {
    min-width: 0;
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--text);
    overflow-wrap: anywhere;
}

.summary-list-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.89rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.summary-list-amount {
    font-size: 0.98rem;
    font-weight: 850;
    color: var(--text);
    white-space: nowrap;
}

.chart-box-compact {
    min-height: 260px;
}

.data-table thead th {
    color: #6b7c90;
    font-size: 0.73rem;
    letter-spacing: 0.08em;
}

.data-table tbody td {
    padding-top: 15px;
    padding-bottom: 15px;
}

.data-table tbody tr + tr td {
    border-top: 1px solid rgba(226, 234, 241, 0.9);
}

.table-responsive {
    padding-bottom: 4px;
}

@media (max-width: 1180px) {
    .review-complete-layout,
    .receipt-edit-layout {
        grid-template-columns: 1fr;
    }

    .receipt-edit-layout > .receipt-preview-panel,
    .receipt-edit-layout > .receipt-edit-form {
        grid-column: 1;
    }

    .receipt-preview-panel {
        position: static;
        max-height: none;
    }

    .item-row-main {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .item-field-remove .danger-action {
        width: 100%;
    }

    .review-receipt-form .payment-type-options,
    .review-receipt-form .installment-fields .form-grid {
        grid-template-columns: 1fr;
    }

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

    .financial-timeline-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .snapshot-grid > .safe-to-spend-card,
    .snapshot-grid > .metric-card {
        grid-column: span 1;
    }

    .metric-card,
    .source-card {
        min-height: 204px;
    }
}

@media (max-width: 1440px) {
    .review-complete-layout,
    .receipt-edit-layout {
        grid-template-columns: minmax(300px, 36%) minmax(0, 64%);
    }

    .item-row-main {
        grid-template-columns: minmax(180px, 1.35fr) minmax(140px, 1fr) minmax(150px, 1fr) minmax(110px, 0.7fr) minmax(110px, 0.7fr) 92px;
    }
}

@media (min-width: 1181px) and (max-width: 1440px) {
    .receipt-edit-layout {
        grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    }
}

@media (max-width: 1180px) {
    .receipt-edit-layout {
        grid-template-columns: 1fr;
    }

    .receipt-edit-layout > .receipt-preview-panel,
    .receipt-edit-layout > .receipt-edit-form {
        grid-column: 1;
    }
}

@media (max-width: 860px) {
    .dashboard-stack {
        gap: 24px;
    }

    .financial-timeline-kpis,
    .financial-timeline-insights {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .financial-timeline-chart {
        min-height: 290px;
    }

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

    .metric-card,
    .source-card,
    .safe-to-spend-card {
        min-height: 0;
    }

    .summary-list-row {
        align-items: flex-start;
    }
}

@media (max-width: 620px) {
    .snapshot-grid {
        grid-template-columns: 1fr;
    }

    .financial-timeline-kpis,
    .financial-timeline-insights {
        grid-template-columns: 1fr;
    }

    .financial-timeline-kpi-card {
        min-height: 0;
        max-height: none;
    }

    .metric-card-top {
        gap: 10px;
    }

    .panel-subtitle,
    .metric-subtitle {
        font-size: 0.82rem;
    }

    .summary-list-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

.summary-list-side {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
    }
}

/* v1.23.1 monthly spending plan UX */
.budget-summary-grid {
    margin-bottom: var(--space-lg);
}

.budget-layout {
    align-items: start;
}

.spending-plan-explainer {
    margin-bottom: var(--space-lg);
    padding: var(--space-md) var(--space-lg);
    border: 1px solid rgba(15, 118, 110, 0.12);
    border-radius: 12px;
    background: rgba(240, 253, 250, 0.9);
}

.spending-plan-explainer p {
    margin: 0;
    color: var(--muted);
}

.budget-table .data-table {
    min-width: 0;
    table-layout: fixed;
}

.budget-table .data-table th,
.budget-table .data-table td {
    overflow-wrap: anywhere;
}

.budget-usage-cell {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.budget-usage-text {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.budget-progress {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #e4ecf3;
    overflow: hidden;
}

.budget-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.budget-progress .is-safe {
    background: #1f9d63;
}

.budget-progress .is-warning {
    background: #d89b2b;
}

.budget-progress .is-exceeded {
    background: #d45b5b;
}

.budget-form-panel .panel-heading,
.budget-table .panel-heading {
    gap: var(--space-md);
}

.budget-form-actions {
    justify-content: flex-end;
    margin-top: var(--space-md);
}

.budget-health-card .kpi-helper {
    line-height: 1.45;
}

.budget-health-card strong {
    line-height: 1.3;
}

.budget-health-card .trend-chip {
    margin-top: auto;
}

.panel-empty-state {
    display: grid;
    gap: var(--space-sm);
    justify-items: start;
    padding: 0 0 var(--space-lg);
}

.panel-empty-state h3,
.panel-empty-state p {
    margin: 0;
}

.panel-empty-state p {
    color: var(--muted);
}

.cell-subtitle {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.84rem;
}

@media (max-width: 1023px) {
    .budget-layout {
        grid-template-columns: 1fr;
    }

    .spending-plan-explainer {
        padding: var(--space-md);
    }
}

/* v1.23.5 dashboard alignment hardening */
.dashboard-stack {
    width: 100%;
    max-width: 100%;
    gap: var(--space-2xl);
}

.dashboard-section,
.dashboard-kpi-section,
.dashboard-core-grid,
.dashboard-planning-grid,
.dashboard-section .metrics-grid {
    width: 100%;
    max-width: 100%;
}

.dashboard-core-grid,
.dashboard-planning-grid,
.dashboard-section .metrics-grid {
    display: grid;
    gap: var(--space-lg);
    align-items: stretch;
}

.dashboard-core-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.dashboard-core-grid > .metric-card,
.dashboard-planning-grid > .metric-card,
.dashboard-planning-grid > .safe-to-spend-card {
    grid-column: auto;
    min-width: 0;
}

.dashboard-section .metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-core-grid > *,
.dashboard-planning-grid > *,
.dashboard-section .metrics-grid > * {
    min-width: 0;
}

@media (max-width: 1023px) {
    .dashboard-core-grid,
    .dashboard-planning-grid,
    .dashboard-section .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .dashboard-core-grid,
    .dashboard-planning-grid,
    .dashboard-section .metrics-grid {
        grid-template-columns: 1fr;
    }
}

/* v1.11.0 final responsive overrides */
@media (max-width: 1023px) {
    .forecast-kpi-grid,
    .forecast-content-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .financial-timeline-insights {
        grid-template-columns: 1fr;
    }

    .financial-timeline-chart {
        min-height: 290px;
    }

    .forecast-content-grid > * {
        min-width: 0;
    }

    .forecast-about-panel {
        grid-column: 1 / -1;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 24;
        width: min(320px, 88vw);
        height: 100dvh;
        transform: translateX(-104%);
        transition: transform 0.22s ease;
        padding: 24px 18px 18px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 16px;
    }

    .sidebar-close-button {
        position: relative;
        display: inline-flex;
        flex: 0 0 auto;
    }

    .topbar {
        min-height: 74px;
        padding: 14px 18px;
    }

    .topbar-content {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 14px;
    }

    .topbar-actions,
    .period-form {
        flex: 1 1 100%;
        width: 100%;
    }

    .topbar-language-switcher {
        order: 2;
        margin-left: auto;
    }

    .period-form {
        order: 3;
    }

    .period-form select,
    .period-form button {
        flex: 1 1 0;
        min-width: 0;
    }

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

    .snapshot-grid > .safe-to-spend-card {
        grid-column: 1 / -1;
    }

    .snapshot-grid > .metric-card {
        grid-column: span 1;
    }

    .metrics-grid,
    .chart-grid,
    .activity-grid,
    .two-column,
    .details-layout,
    .upload-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .activity-grid .table-section:last-child {
        grid-column: 1 / -1;
    }

    .auth-shell {
        grid-template-columns: 1fr;
        width: min(760px, 100%);
        min-height: auto;
    }

    .timeline-header {
        display: none;
    }

    .timeline-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 16px;
    }

    .timeline-cell-label {
        display: inline-flex;
    }

    .timeline-cell-main {
        grid-column: 1 / -1;
    }

    .review-receipt-form .payment-type-options,
    .review-receipt-form .installment-fields .form-grid,
    .review-receipt-form .debug-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .forecast-page {
        gap: var(--space-md);
    }

    .forecast-header,
    .forecast-kpi-grid,
    .forecast-content-grid,
    .forecast-insight-banner {
        grid-template-columns: 1fr;
    }

    .forecast-title {
        font-size: 1rem;
    }

    .forecast-subtitle {
        font-size: 0.84rem;
    }

    .forecast-kpi-card {
        padding: var(--space-md);
    }

    .forecast-insight-banner {
        gap: 12px;
        padding: var(--space-md);
    }

    .forecast-insight-marker {
        width: 100%;
        min-height: 8px;
    }

    .forecast-breakdown-panel,
    .forecast-about-panel {
        padding: var(--space-md);
    }

    .forecast-formula-list {
        padding: var(--space-md) var(--space-md) var(--space-md) 32px;
    }

    .topbar-primary {
        display: flex;
    }

    .mobile-header-title,
    .mobile-profile-link {
        display: inline-flex;
    }

    .mobile-actions-menu {
        display: flex;
        width: 100%;
    }

    .desktop-action-row {
        display: none;
    }

    .topbar {
        min-height: 78px;
        padding: 12px 14px;
    }

    .topbar-content {
        align-items: stretch;
    }

    .topbar-actions {
        order: 2;
        justify-content: stretch;
    }

    .period-form {
        order: 1;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 8px;
        padding: 10px;
        border: 1px solid rgba(214, 226, 237, 0.92);
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.9);
    }

    .period-form button {
        grid-column: 1 / -1;
    }

    .mobile-actions-trigger,
    .mobile-actions-dropdown {
        width: 100%;
    }

    .mobile-actions-dropdown {
        left: 0;
        right: 0;
        min-width: 0;
    }

    .main-content,
    .app-footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    .page-heading {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }

    .action-row {
        width: 100%;
        justify-content: stretch;
    }

    .action-row > * {
        flex: 1 1 100%;
    }

    .snapshot-grid,
    .metrics-grid,
    .chart-grid,
    .activity-grid,
    .two-column,
    .details-layout,
    .upload-layout,
    .kpi-grid,
    .summary-grid,
    .review-layout,
    .receipt-layout,
    .form-grid,
    .item-row-main {
        grid-template-columns: 1fr;
    }

    .safe-to-spend-card strong,
    .metric-card strong,
    .kpi-card strong {
        font-size: clamp(1.7rem, 6vw, 2.2rem);
    }

    .panel,
    .table-section,
    .form-panel,
    .info-panel,
    .kpi-card,
    .safe-to-spend-card {
        padding: 18px;
    }

.item-field-remove .danger-action,
.items-header .table-action,
.items-footer .table-action {
    width: 100%;
}


    .table-responsive {
        margin: 0 -4px;
        padding: 0 4px 8px;
    }

    .data-table {
        min-width: 640px;
    }

    .chart-box {
        min-height: 240px;
    }

    .timeline-header {
        display: none;
    }

    .timeline-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .timeline-row-event {
        padding: 16px 0;
    }

    .timeline-cell-label {
        display: inline-flex;
    }

    .timeline-cell-amount,
    .timeline-cell-balance {
        justify-items: start;
        text-align: left;
    }

    .auth-shell {
        width: 100%;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }

    .auth-hero-panel,
    .auth-form-panel,
    .auth-card {
        padding: 20px;
        border-radius: 22px;
    }

    .auth-form-panel {
        padding-top: 0;
    }
}

/* v1.21.3 receipt item-card layout hardening */
.receipt-form .item-rows,
.receipt-form .item-row,
.receipt-form .item-row-main,
.receipt-form .item-row-notes,
.receipt-form .item-row-actions,
.receipt-form .item-field,
.receipt-form .item-field > label,
.receipt-form .item-field > input,
.receipt-form .item-field > select,
.receipt-form .item-row-notes > input,
.receipt-form .item-row-notes > textarea {
    min-width: 0;
    max-width: 100%;
}

.receipt-form .item-row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-md);
    padding: var(--space-md);
    overflow: hidden;
}

.receipt-form .item-row-main {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(0, 0.75fr) minmax(120px, 0.75fr);
    gap: var(--space-sm);
    align-items: end;
}

.receipt-form .item-field-name {
    grid-column: 1 / -1;
}

.receipt-form .item-field,
.receipt-form .item-row-notes,
.receipt-form .item-row-actions {
    width: 100%;
}

.receipt-form .item-row input,
.receipt-form .item-row select,
.receipt-form .item-row textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.receipt-form .item-field-amount input[name="item_amount"] {
    text-align: right;
}

.receipt-form .item-row-notes {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.receipt-form .item-row-notes input,
.receipt-form .item-row-notes textarea {
    width: 100%;
}

.receipt-form .item-row-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.receipt-form .item-row-actions .danger-action {
    width: auto;
    min-width: 120px;
    max-width: 100%;
}

@media (max-width: 1199px) {
    .manual-expense-detail-grid,
    .receipt-review-expense-grid,
    .receipt-review-category-grid {
        grid-template-columns: minmax(0, 1fr) minmax(130px, 0.6fr);
    }

    .receipt-review-expense-grid,
    .receipt-review-category-grid {
        grid-template-columns: 1fr;
    }

    .receipt-form .item-row-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .manual-expense-detail-grid,
    .receipt-review-expense-grid,
    .receipt-review-category-grid {
        grid-template-columns: 1fr;
    }

    .receipt-form .item-row-main {
        grid-template-columns: 1fr;
    }

    .receipt-form .item-row-actions {
        justify-content: stretch;
    }

    .receipt-form .item-row-actions .danger-action {
        width: 100%;
    }
}

/* Public SaaS website */
.public-site {
    background: #f8fafc;
    color: #111827;
    font-family: Manrope, Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.public-site h1,
.public-site h2,
.public-site h3,
.public-site p {
    margin-top: 0;
}

.public-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-lg);
    max-width: 1180px;
    margin: 0 auto;
    padding: 18px var(--space-lg);
    background: rgba(248, 250, 252, 0.92);
    backdrop-filter: blur(14px);
}

.public-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: #111827;
}

.public-beta-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    vertical-align: middle;
}

.public-scope-note {
    margin-top: var(--space-sm);
    max-width: 620px;
    padding: 12px 16px;
    border-left: 3px solid #f59e0b;
    border-radius: 8px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.5;
}

.public-nav,
.public-header-actions,
.public-language-switcher,
.public-hero-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.public-nav {
    justify-content: center;
    font-size: 0.95rem;
    color: #4b5563;
}

.public-nav a,
.public-login-link,
.public-language-switcher a,
.public-footer a {
    color: inherit;
}

.public-nav a.active,
.public-language-switcher a.active,
.public-footer a.active {
    color: var(--primary);
    font-weight: 800;
}

.public-header-actions {
    justify-content: flex-end;
    font-size: 0.92rem;
}

.public-language-switcher {
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid #d8e0ea;
    border-radius: 999px;
    color: #64748b;
    background: #ffffff;
}

.public-cta-small,
.public-cta-primary,
.public-cta-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    font-weight: 800;
}

.public-cta-small,
.public-cta-primary {
    color: #ffffff;
    background: var(--primary);
    box-shadow: 0 14px 30px rgba(15, 118, 110, 0.22);
}

.public-cta-secondary {
    color: #111827;
    border: 1px solid #d8e0ea;
    background: #ffffff;
}

.public-hero {
    position: relative;
    display: grid;
    align-items: center;
    min-height: 620px;
    max-width: 1180px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-lg);
    overflow: hidden;
}

.public-hero::before {
    content: "";
    position: absolute;
    inset: 44px 0 44px 38%;
    border: 1px solid rgba(15, 118, 110, 0.12);
    border-radius: 28px;
    background:
        radial-gradient(circle at 18% 20%, rgba(15, 118, 110, 0.12), transparent 32%),
        linear-gradient(135deg, #ffffff 0%, #eef8f6 100%);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
}

.public-hero-copy {
    position: relative;
    z-index: 2;
    max-width: 680px;
}

.public-eyebrow {
    margin-bottom: var(--space-sm);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.public-hero h1,
.public-page-hero h1 {
    max-width: 760px;
    margin-bottom: var(--space-md);
    color: #0f172a;
    font-size: clamp(2.5rem, 6vw, 5.2rem);
    line-height: 0.96;
    letter-spacing: 0;
}

.public-hero p,
.public-page-hero p,
.public-section-heading p,
.public-banner p,
.public-final-cta p,
.public-contact-panel p {
    color: #475569;
    font-size: 1.08rem;
    line-height: 1.7;
}

.public-hero-copy > p:not(.public-eyebrow) {
    max-width: 620px;
    margin-bottom: var(--space-lg);
}

.public-product-preview {
    position: absolute;
    right: var(--space-lg);
    bottom: var(--space-2xl);
    z-index: 1;
    width: min(490px, 44vw);
    padding: var(--space-lg);
    border: 1px solid rgba(216, 224, 234, 0.9);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(10px);
}

.preview-topline,
.preview-list,
.preview-kpis {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.preview-topline {
    margin-bottom: var(--space-md);
    color: #64748b;
    font-size: 0.9rem;
}

.preview-topline strong {
    color: var(--primary);
}

.preview-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.preview-kpis span,
.preview-list {
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.preview-kpis small {
    display: block;
    margin-bottom: 4px;
    color: #64748b;
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-kpis strong,
.preview-list strong {
    color: #0f172a;
}

.preview-chart {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: end;
    gap: 10px;
    height: 160px;
    margin: var(--space-md) 0;
    padding: 18px;
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fafc, #eef8f6);
}

.preview-chart span {
    border-radius: 999px 999px 4px 4px;
    background: linear-gradient(180deg, #14b8a6, #0f766e);
}

.preview-chart span:nth-child(1) { height: 46%; }
.preview-chart span:nth-child(2) { height: 72%; }
.preview-chart span:nth-child(3) { height: 58%; }
.preview-chart span:nth-child(4) { height: 86%; }
.preview-chart span:nth-child(5) { height: 64%; }

.public-section,
.public-split-section,
.public-page-hero,
.public-banner,
.public-final-cta,
.public-contact-panel {
    max-width: 1180px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-lg);
}

.public-section-heading {
    max-width: 720px;
    margin-bottom: var(--space-xl);
}

.public-section-heading h2,
.public-split-section h2,
.public-banner h2,
.public-final-cta h2,
.public-contact-panel h2 {
    margin-bottom: var(--space-sm);
    color: #0f172a;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.05;
}

.public-card-grid {
    display: grid;
    gap: var(--space-md);
}

.public-card-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.public-card,
.public-price-card,
.public-faq-list details,
.public-faq-preview details {
    border: 1px solid #d8e0ea;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.06);
}

.public-card,
.public-price-card {
    padding: var(--space-lg);
}

.public-card h2,
.public-card h3,
.public-price-card h2 {
    margin-bottom: var(--space-sm);
    color: #0f172a;
    font-size: 1.15rem;
}

.public-card p,
.public-price-card p,
.public-price-card li,
.public-footer p,
.public-footer a {
    color: #536276;
    line-height: 1.65;
}

.public-split-section {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: var(--space-xl);
    align-items: center;
}

.public-receipt-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.public-receipt-chip-list span {
    padding: 10px 14px;
    border: 1px solid rgba(15, 118, 110, 0.22);
    border-radius: 999px;
    color: #0f766e;
    background: #eef8f6;
    font-weight: 800;
}

.public-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-md);
}

.public-steps article {
    padding: var(--space-lg);
    border-top: 3px solid var(--primary);
    background: #ffffff;
}

.public-steps span {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-bottom: var(--space-md);
    border-radius: 999px;
    color: #ffffff;
    background: var(--primary);
    font-weight: 900;
}

.public-banner,
.public-final-cta,
.public-contact-panel {
    margin-top: var(--space-lg);
    border-radius: 24px;
    background: #0f172a;
    color: #ffffff;
}

.public-banner h2,
.public-final-cta h2,
.public-contact-panel h2 {
    color: #ffffff;
}

.public-banner p,
.public-final-cta p,
.public-contact-panel p {
    color: #dbe7f4;
}

.public-final-cta {
    text-align: center;
}

.public-faq-preview details,
.public-faq-list details {
    margin-bottom: var(--space-md);
    padding: var(--space-md) var(--space-lg);
}

.public-faq-preview summary,
.public-faq-list summary {
    cursor: pointer;
    color: #0f172a;
    font-weight: 900;
}

.public-text-link {
    color: var(--primary);
    font-weight: 900;
}

.public-pricing-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.9fr 0.9fr;
    gap: var(--space-md);
    align-items: stretch;
}

.public-price-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.public-price-card.featured {
    border-color: rgba(15, 118, 110, 0.36);
}

.public-price-card > span {
    align-self: flex-start;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--primary);
    background: #eef8f6;
    font-size: 0.78rem;
    font-weight: 900;
}

.public-price-card strong {
    color: #0f172a;
    font-size: 2rem;
}

.public-price-card ul {
    display: grid;
    gap: 8px;
    margin: 0 0 var(--space-sm);
    padding-left: 18px;
}

.public-contact-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

.public-footer {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, minmax(140px, 0.6fr));
    gap: var(--space-xl);
    max-width: 1180px;
    margin: var(--space-2xl) auto 0;
    padding: var(--space-2xl) var(--space-lg);
    border-top: 1px solid #d8e0ea;
}

.public-footer nav {
    display: grid;
    align-content: start;
    gap: 8px;
}

.public-footer strong {
    color: #0f172a;
}

.public-footer-brand {
    margin-bottom: var(--space-md);
}

@media (max-width: 1023px) {
    .public-header {
        grid-template-columns: 1fr;
    }

    .public-nav,
    .public-header-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .public-hero {
        min-height: auto;
        padding-top: var(--space-xl);
    }

    .public-hero::before {
        inset: 38% var(--space-lg) 0 var(--space-lg);
    }

    .public-product-preview {
        position: relative;
        right: auto;
        bottom: auto;
        width: 100%;
        max-width: 620px;
        margin-top: var(--space-xl);
    }

    .public-card-grid.three,
    .public-card-grid.two,
    .public-pricing-grid,
    .public-steps,
    .public-split-section,
    .public-footer {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .public-header,
    .public-section,
    .public-split-section,
    .public-page-hero,
    .public-banner,
    .public-final-cta,
    .public-contact-panel,
    .public-footer {
        padding-left: var(--space-md);
        padding-right: var(--space-md);
    }

    .public-nav {
        display: none;
    }

    .public-header-actions {
        gap: var(--space-sm);
    }

    .public-cta-small {
        padding: 0 14px;
    }

    .public-hero h1,
    .public-page-hero h1 {
        font-size: 2.5rem;
    }

    .preview-kpis,
    .public-card-grid.three,
    .public-card-grid.two,
    .public-pricing-grid,
    .public-steps,
    .public-split-section,
    .public-footer {
        grid-template-columns: 1fr;
    }

    .public-contact-panel {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Privacy Policy / Terms of Service legal pages */
.public-legal-content {
    display: grid;
    gap: var(--space-2xl);
}

.public-legal-block h2 {
    margin-bottom: var(--space-sm);
    color: #0f172a;
    font-size: 1.5rem;
    line-height: 1.2;
}

.public-legal-block p {
    max-width: 760px;
    color: #536276;
    line-height: 1.7;
}

.public-legal-disclaimer {
    padding: var(--space-lg);
    border: 1px solid #f3d9a4;
    border-radius: 16px;
    background: #fdf6e8;
}

.public-legal-disclaimer h2 {
    color: #8a5a12;
}

.public-legal-disclaimer p {
    max-width: none;
    color: #6b4a15;
}

.public-page-banner p.public-legal-updated {
    margin-top: var(--space-sm);
    color: #77f7b7;
    font-size: 0.95rem;
}

/* Cookie notice: factual disclosure only, no accept/reject choice needed
   because the only cookies set are strictly necessary (session + locale). */
.public-cookie-notice {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 60;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    max-width: 640px;
    width: calc(100% - 32px);
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid #d8e0ea;
    background: #ffffff;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.16);
}

.public-cookie-notice[hidden] {
    display: none;
}

.public-cookie-notice p {
    margin: 0;
    color: #536276;
    font-size: 0.9rem;
    line-height: 1.5;
}

.public-cookie-notice a {
    color: var(--fintech-green-dark, #079669);
    font-weight: 600;
}

.public-cookie-notice button {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 999px;
    border: none;
    background: #0f172a;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
}

@media (max-width: 680px) {
    .public-cookie-notice {
        flex-direction: column;
        align-items: flex-start;
        bottom: 12px;
    }
}

/* v1.28.1 simplified public website direction */
.public-site-simple {
    background: #fbfcfd;
}

.public-site-simple .public-header {
    max-width: 1120px;
    padding: 16px var(--space-lg);
}

.public-site-simple .public-nav {
    gap: var(--space-lg);
}

.public-site-simple .public-hero.simple {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: clamp(32px, 7vw, 84px);
    min-height: 560px;
    padding-top: 72px;
    padding-bottom: 72px;
}

.public-site-simple .public-hero.simple::before {
    content: none;
}

.public-site-simple .public-hero h1,
.public-site-simple .public-page-hero h1 {
    max-width: 720px;
    font-size: clamp(2.7rem, 5.6vw, 5rem);
    line-height: 1;
}

.public-site-simple .public-hero-copy > p:not(.public-eyebrow),
.public-site-simple .public-page-hero p {
    max-width: 640px;
    font-size: 1.08rem;
}

.public-trust-note,
.public-language-note,
.public-footer-note {
    color: #64748b;
    font-size: 0.92rem;
}

.public-trust-note {
    margin-top: var(--space-md);
    font-weight: 800;
}

.public-language-note {
    margin-bottom: 0;
}

.public-concept-visual {
    position: relative;
    display: grid;
    gap: var(--space-md);
    padding: var(--space-lg);
    border: 1px solid #d8e0ea;
    border-radius: 28px;
    background: linear-gradient(180deg, #ffffff, #f0fdfa);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.09);
}

.concept-card {
    display: grid;
    gap: 6px;
    padding: var(--space-md);
    border: 1px solid rgba(216, 224, 234, 0.92);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.88);
}

.concept-card span {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.concept-card strong {
    color: #0f172a;
    font-size: 1.08rem;
}

.concept-card small {
    color: #64748b;
}

.concept-card.safe {
    margin-left: 44px;
    border-color: rgba(15, 118, 110, 0.28);
}

.concept-card.upcoming {
    margin-right: 34px;
}

.public-section.compact {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
}

.public-feature-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--space-sm);
}

.public-feature-strip article {
    display: grid;
    min-height: 92px;
    place-items: center;
    padding: var(--space-md);
    border: 1px solid #d8e0ea;
    border-radius: 16px;
    background: #ffffff;
    text-align: center;
}

.public-feature-strip h2 {
    margin: 0;
    color: #0f172a;
    font-size: 0.98rem;
}

.public-steps.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.public-security-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-md);
    max-width: 1120px;
    margin: var(--space-lg) auto;
    padding: var(--space-xl) var(--space-lg);
    border-top: 1px solid #d8e0ea;
    border-bottom: 1px solid #d8e0ea;
}

.public-security-strip article {
    min-width: 0;
}

.public-security-strip h2 {
    margin-bottom: var(--space-xs);
    color: #0f172a;
    font-size: 1rem;
}

.public-security-strip p {
    margin: 0;
    color: #64748b;
    line-height: 1.6;
}

.public-faq-layout,
.public-contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: var(--space-xl);
    max-width: 1120px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg) var(--space-2xl);
}

.public-side-card,
.public-contact-form,
.public-contact-details article {
    padding: var(--space-lg);
    border: 1px solid #d8e0ea;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.05);
}

.public-side-card h2 {
    margin-bottom: var(--space-sm);
    color: #0f172a;
    font-size: 1.3rem;
}

.public-contact-details {
    display: grid;
    gap: var(--space-md);
}

.public-contact-details span {
    display: block;
    margin-bottom: var(--space-xs);
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.public-contact-details a {
    color: var(--primary);
    font-weight: 900;
}

.public-contact-form {
    display: grid;
    gap: var(--space-md);
}

.public-contact-form label {
    display: grid;
    gap: 7px;
    color: #0f172a;
    font-weight: 800;
}

.public-contact-form input,
.public-contact-form textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid #d8e0ea;
    border-radius: 12px;
    padding: 11px 12px;
    font: inherit;
}

.public-contact-form p {
    margin: 0;
    color: #64748b;
    font-size: 0.92rem;
}

.public-split-section.portugal,
.public-split-section.about {
    max-width: 1120px;
}

@media (max-width: 1023px) {
    .public-site-simple .public-hero.simple,
    .public-faq-layout,
    .public-contact-layout {
        grid-template-columns: 1fr;
    }

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

    .public-concept-visual {
        max-width: 520px;
    }
}

@media (max-width: 680px) {
    .public-site-simple .public-header {
        gap: var(--space-sm);
    }

    .public-site-simple .public-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .public-site-simple .public-hero.simple {
        padding-top: var(--space-xl);
        padding-bottom: var(--space-xl);
    }

    .concept-card.safe,
    .concept-card.upcoming {
        margin-left: 0;
        margin-right: 0;
    }

    .public-feature-strip,
    .public-security-strip,
    .public-steps.three {
        grid-template-columns: 1fr;
    }
}

/* Public SaaS website v1.28.1 */
.public-site-premium,
.public-auth-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 72% 18%, rgba(16, 185, 129, 0.08), transparent 32%),
        linear-gradient(180deg, #fbfdfc 0%, #f7faf9 52%, #ffffff 100%);
    color: #0b1220;
    font-family: var(--font-sans, Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
}

.public-site-premium .public-header,
.public-auth-page .public-header {
    position: sticky;
    top: 0;
    z-index: 50;
    width: min(100% - 32px, 1280px);
    margin: 10px auto 0;
    padding: 12px 18px;
    border: 1px solid rgba(209, 218, 226, 0.82);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(18px);
}

.public-logo-mark {
    display: inline-grid;
    grid-template-columns: repeat(3, 5px);
    align-items: end;
    gap: 3px;
    width: 24px;
    height: 24px;
}

.public-logo-mark span {
    display: block;
    width: 5px;
    border-radius: 999px 999px 2px 2px;
    background: linear-gradient(180deg, #10b981, #047857);
}

.public-logo-mark span:nth-child(1) {
    height: 10px;
}

.public-logo-mark span:nth-child(2) {
    height: 16px;
}

.public-logo-mark span:nth-child(3) {
    height: 22px;
}

.public-site-premium .public-brand,
.public-auth-page .public-brand {
    gap: 8px;
    color: #07111f;
    font-weight: 900;
}

.public-site-premium .public-nav,
.public-auth-page .public-nav {
    gap: 26px;
}

.public-site-premium .public-nav a,
.public-auth-page .public-nav a {
    color: #243143;
    font-size: 0.9rem;
    font-weight: 800;
}

.public-site-premium .public-nav a:hover,
.public-site-premium .public-nav a.active,
.public-auth-page .public-nav a:hover {
    color: #047857;
}

.public-site-premium .public-language-switcher,
.public-auth-page .public-language-switcher {
    padding: 6px 10px;
    border: 1px solid #d8e0ea;
    border-radius: 999px;
    background: #ffffff;
    font-size: 0.82rem;
    font-weight: 900;
}

.public-site-premium .public-login-link,
.public-auth-page .public-login-link {
    padding: 9px 18px;
    border: 1px solid #cfd8e3;
    border-radius: 10px;
    color: #0b1220;
    background: #ffffff;
    font-weight: 900;
}

.public-site-premium .public-cta-small,
.public-auth-page .public-cta-small,
.public-site-premium .public-cta-primary,
.public-auth-page .public-cta-primary {
    border: 0;
    border-radius: 10px;
    color: #ffffff;
    background: linear-gradient(135deg, #10b981, #047857);
    box-shadow: 0 14px 24px rgba(4, 120, 87, 0.18);
    font-weight: 900;
}

.public-site-premium .public-cta-secondary,
.public-auth-page .public-cta-secondary {
    border: 1px solid #d6dee8;
    border-radius: 10px;
    color: #0b1220;
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
    font-weight: 900;
}

.premium-hero {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(440px, 1.08fr);
    align-items: center;
    gap: clamp(42px, 7vw, 92px);
    width: min(100% - 36px, 1240px);
    margin: 0 auto;
    padding: clamp(72px, 8vw, 120px) 0 70px;
}

.public-site-premium .public-hero h1 {
    max-width: 620px;
    color: #07111f;
    font-size: clamp(3.1rem, 7vw, 6.2rem);
    line-height: 0.95;
    letter-spacing: 0;
}

.public-site-premium .public-hero h1 strong {
    color: #047857;
}

.public-site-premium .public-hero-copy > p:not(.public-eyebrow) {
    max-width: 560px;
    color: #475569;
    font-size: 1.12rem;
    line-height: 1.8;
}

.public-product-visual {
    position: relative;
    min-height: 560px;
    display: grid;
    place-items: center;
    border-radius: 42px;
}

.public-product-visual::before {
    content: "";
    position: absolute;
    inset: 72px 34px 50px;
    border-radius: 48% 52% 49% 51%;
    background: linear-gradient(145deg, rgba(236, 253, 245, 0.92), rgba(241, 245, 249, 0.92));
}

.public-product-visual::after {
    content: "";
    position: absolute;
    right: 54px;
    bottom: 42px;
    width: 170px;
    height: 90px;
    opacity: 0.34;
    background-image: radial-gradient(#10b981 1.2px, transparent 1.2px);
    background-size: 12px 12px;
}

.phone-mockup {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 14px;
    width: min(285px, 78vw);
    min-height: 500px;
    padding: 42px 28px 28px;
    border: 8px solid #050b14;
    border-radius: 36px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    box-shadow: 0 28px 75px rgba(15, 23, 42, 0.22);
    text-align: center;
}

.phone-speaker {
    position: absolute;
    top: 14px;
    left: 50%;
    width: 76px;
    height: 17px;
    border-radius: 0 0 14px 14px;
    background: #050b14;
    transform: translateX(-50%);
}

.phone-mockup > span,
.floating-card > span {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 900;
}

.phone-mockup > strong {
    color: #059669;
    font-size: 2.2rem;
    line-height: 1;
}

.phone-mockup > small,
.floating-card small {
    color: #64748b;
}

.mini-line-chart {
    position: relative;
    height: 56px;
    margin: 6px 0 2px;
    border-radius: 18px;
    background: linear-gradient(180deg, #ecfdf5, #ffffff);
    overflow: hidden;
}

.mini-line-chart span {
    position: absolute;
    inset: 14px 22px;
    border-bottom: 4px solid #10b981;
    border-radius: 45%;
    transform: skewX(-18deg) rotate(-5deg);
}

.phone-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid #eef2f7;
    color: #475569;
    font-size: 0.86rem;
    text-align: left;
}

.phone-row strong {
    color: #0f172a;
}

.phone-row.positive strong {
    color: #047857;
}

.floating-card {
    position: absolute;
    z-index: 3;
    display: grid;
    gap: 9px;
    min-width: 190px;
    padding: 18px;
    border: 1px solid rgba(214, 222, 232, 0.86);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 20px 55px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(14px);
}

.floating-card strong {
    color: #0b1220;
    font-size: 1rem;
}

.receipt-card {
    left: 10px;
    top: 185px;
}

.category-card {
    right: 8px;
    top: 120px;
    grid-template-columns: 78px 1fr;
}

.category-card > span {
    grid-column: 1 / -1;
}

.payment-card {
    right: 35px;
    bottom: 112px;
}

.receipt-paper {
    width: 64px;
    height: 78px;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    background:
        linear-gradient(#e2e8f0 0 0) 14px 16px / 36px 4px no-repeat,
        linear-gradient(#e2e8f0 0 0) 14px 30px / 28px 4px no-repeat,
        linear-gradient(#e2e8f0 0 0) 14px 44px / 42px 4px no-repeat,
        #ffffff;
}

.donut-preview {
    width: 70px;
    height: 70px;
    border-radius: 999px;
    background: conic-gradient(#10b981 0 35%, #f59e0b 35% 57%, #6366f1 57% 75%, #e2e8f0 75% 100%);
    box-shadow: inset 0 0 0 18px #ffffff;
}

.category-list {
    display: grid;
    align-content: center;
    gap: 5px;
}

.public-section-heading.centered {
    text-align: center;
}

.public-feature-strip.premium {
    width: min(100% - 36px, 1160px);
    margin: 0 auto;
}

.public-feature-strip.premium article {
    min-height: 164px;
    align-content: start;
    justify-items: center;
    gap: 10px;
    border-color: rgba(214, 222, 232, 0.85);
    border-radius: 22px;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.05);
}

.public-feature-strip.premium h3 {
    margin: 0;
    color: #0b1220;
    font-size: 0.96rem;
}

.public-feature-strip.premium p {
    margin: 0;
    color: #64748b;
    font-size: 0.86rem;
    line-height: 1.55;
}

.public-feature-icon {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: #ecfdf5;
    border: 1px solid #c7f5df;
}

.public-feature-icon::before {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid #059669;
    border-radius: 6px;
}

.icon-smart_categories::before,
.icon-smart_categorization::before {
    border-radius: 4px;
    transform: rotate(45deg);
}

.icon-safe_to_spend::before {
    border-radius: 999px 999px 6px 6px;
}

.icon-financial_timeline::before,
.icon-en_pt::before {
    border-width: 0 0 3px 3px;
    border-radius: 0;
    transform: rotate(-45deg);
}

.public-how-panel {
    width: min(100% - 36px, 1160px);
    margin: 36px auto;
    border: 1px solid #e0e7ef;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 20px 55px rgba(15, 23, 42, 0.06);
}

.public-steps.premium {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}

.public-steps.premium::before {
    content: "";
    position: absolute;
    top: 33px;
    left: 18%;
    right: 18%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #a7f3d0, transparent);
}

.public-steps.premium article {
    position: relative;
    z-index: 1;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.public-steps.premium article > span {
    background: #059669;
    box-shadow: 0 0 0 12px #ecfdf5;
}

.public-security-panel,
.public-pricing-panel {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 34px;
    width: min(100% - 36px, 1160px);
    margin: 54px auto;
    padding: 34px;
    border: 1px solid #dde7ef;
    border-radius: 28px;
    background: linear-gradient(135deg, #ffffff, #f3fbf8);
    box-shadow: 0 20px 55px rgba(15, 23, 42, 0.06);
}

.public-security-panel h2,
.public-final-cta h2,
.public-pricing-panel h2 {
    color: #07111f;
    font-size: clamp(1.8rem, 3vw, 2.7rem);
    line-height: 1.05;
}

.public-security-panel p,
.public-pricing-panel p {
    color: #64748b;
    line-height: 1.7;
}

.security-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.security-mini-grid article,
.public-pricing-panel article,
.public-pricing-panel aside {
    border: 1px solid #dbe5ee;
    border-radius: 18px;
    background: #ffffff;
    padding: 18px;
}

.security-mini-grid h3 {
    margin: 0 0 6px;
    color: #0b1220;
    font-size: 0.98rem;
}

.public-final-cta {
    width: min(100% - 36px, 980px);
    margin: 56px auto 80px;
    padding: clamp(32px, 6vw, 64px);
    border-radius: 30px;
    background:
        radial-gradient(circle at 88% 20%, rgba(16, 185, 129, 0.18), transparent 28%),
        linear-gradient(135deg, #0b1220, #0f2b27);
    color: #ffffff;
    text-align: center;
}

.public-final-cta h2,
.public-final-cta p {
    margin-left: auto;
    margin-right: auto;
    color: #ffffff;
}

.public-final-cta p {
    max-width: 620px;
    color: #d1fae5;
}

.premium-page-hero {
    max-width: 860px;
    padding-top: 76px;
    padding-bottom: 34px;
    text-align: center;
}

.premium-page-hero h1 {
    color: #07111f;
    font-size: clamp(2.5rem, 5vw, 4.4rem);
    line-height: 1;
}

.premium-feature-grid .public-card {
    display: grid;
    align-content: start;
    gap: 14px;
    min-height: 245px;
    border-radius: 22px;
}

.premium-feature-grid .public-card h2 {
    margin: 0;
    color: #07111f;
    font-size: 1.12rem;
}

.premium-portugal {
    border-radius: 26px;
    background: linear-gradient(135deg, #ffffff, #eefdf7);
}

.public-faq-list details,
.public-faq-preview details {
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.premium-help-card {
    display: grid;
    place-items: center;
    min-height: 285px;
    text-align: center;
}

.public-mail-icon {
    width: 62px;
    height: 46px;
    border: 3px solid #059669;
    border-radius: 10px;
    background: linear-gradient(135deg, transparent 48%, #059669 49%, #059669 52%, transparent 53%);
}

.premium-contact-layout {
    align-items: start;
}

.public-pricing-panel {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.public-pricing-panel article {
    padding: 30px;
}

.public-pricing-panel article > span {
    display: inline-flex;
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
}

.public-pricing-panel ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
    margin: 24px 0;
    padding: 0;
    list-style: none;
}

.public-pricing-panel li {
    position: relative;
    padding-left: 24px;
    color: #334155;
    font-weight: 800;
}

.public-pricing-panel li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45em;
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: #10b981;
}

.public-auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 470px);
    align-items: center;
    gap: clamp(28px, 6vw, 80px);
    width: min(100% - 36px, 1140px);
    min-height: calc(100vh - 96px);
    margin: 0 auto;
    padding: 54px 0 70px;
}

.public-auth-copy h1 {
    margin: 0 0 16px;
    color: #07111f;
    font-size: clamp(2.6rem, 5.5vw, 5rem);
    line-height: 0.98;
}

.public-auth-copy p:not(.public-eyebrow) {
    max-width: 560px;
    color: #64748b;
    line-height: 1.8;
}

.auth-mini-preview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 220px));
    gap: 14px;
    margin-top: 28px;
}

.auth-mini-preview article {
    display: grid;
    gap: 7px;
    padding: 18px;
    border: 1px solid #dbe5ee;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.07);
}

.auth-mini-preview span {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 900;
}

.auth-mini-preview strong {
    color: #047857;
}

.public-auth-page .auth-form-panel {
    width: 100%;
}

.public-auth-page .auth-card,
.public-login-card {
    width: 100%;
    max-width: 470px;
    padding: clamp(26px, 4vw, 42px);
    border: 1px solid #dbe5ee;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.1);
}

.public-auth-page .auth-heading {
    text-align: center;
}

.public-auth-page .auth-heading h1 {
    color: #07111f;
    font-size: 2rem;
}

.public-auth-page .auth-field input {
    border-radius: 12px;
}

.public-auth-page .btn-primary-soft {
    border-radius: 12px;
    background: linear-gradient(135deg, #10b981, #047857);
}

@media (max-width: 1120px) {
    .premium-hero,
    .public-auth-shell {
        grid-template-columns: 1fr;
    }

    .public-product-visual {
        min-height: 520px;
        max-width: 680px;
        margin: 0 auto;
    }

    .public-site-premium .public-nav,
    .public-auth-page .public-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 16px;
    }
}

@media (max-width: 860px) {
    .public-security-panel,
    .public-pricing-panel {
        grid-template-columns: 1fr;
    }

    .public-pricing-panel ul,
    .security-mini-grid {
        grid-template-columns: 1fr;
    }

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

    .public-steps.premium {
        grid-template-columns: 1fr;
    }

    .public-steps.premium::before {
        content: none;
    }
}

@media (max-width: 680px) {
    .public-site-premium .public-header,
    .public-auth-page .public-header {
        width: min(100% - 18px, 1280px);
        align-items: center;
        gap: 10px;
        padding: 10px;
    }

    .public-site-premium .public-header-actions,
    .public-auth-page .public-header-actions {
        margin-left: 0;
        gap: 8px;
    }

    .public-site-premium .public-login-link {
        display: none;
    }

    .public-site-premium .public-cta-small,
    .public-auth-page .public-cta-small {
        padding: 8px 11px;
        font-size: 0.78rem;
    }

    .public-site-premium .public-hero h1 {
        font-size: clamp(2.75rem, 14vw, 4.2rem);
    }

    .public-product-visual {
        min-height: 640px;
        align-content: start;
        padding-top: 22px;
    }

    .public-product-visual::before {
        inset: 30px 0 70px;
    }

    .phone-mockup {
        width: min(270px, 86vw);
        min-height: 470px;
    }

    .floating-card {
        position: relative;
        left: auto;
        right: auto;
        top: auto;
        bottom: auto;
        width: min(100%, 300px);
        margin: -8px auto 0;
    }

    .category-card {
        grid-template-columns: 64px 1fr;
    }

    .public-feature-strip.premium,
    .auth-mini-preview {
        grid-template-columns: 1fr;
    }

    .public-security-panel,
    .public-pricing-panel,
    .public-how-panel {
        width: min(100% - 24px, 1160px);
        padding: 22px;
    }
}

/* Premium fintech public redesign */
.public-site-fintech {
    --fintech-ink: #08111f;
    --fintech-muted: #6b7280;
    --fintech-line: #dfe7ef;
    --fintech-green: #00d26a;
    --fintech-green-dark: #079669;
    --fintech-card: rgba(255, 255, 255, 0.88);
    overflow-x: hidden;
    background:
        linear-gradient(180deg, #0b1020 0 720px, #f8fafc 720px 100%),
        #f8fafc;
    color: var(--fintech-ink);
}

.public-site-fintech main {
    overflow: hidden;
}

.fintech-container {
    width: min(100% - 40px, 1220px);
    margin: 0 auto;
}

.public-site-fintech .public-header,
.public-auth-page .public-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: min(100% - 40px, 1220px);
    margin-top: 16px;
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(13, 19, 35, 0.76);
    color: #ffffff;
}

.public-site-fintech .public-brand,
.public-auth-page .public-brand,
.public-site-fintech .public-nav a,
.public-auth-page .public-nav a {
    color: #f8fafc;
}

.public-site-fintech .public-menu,
.public-auth-page .public-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    gap: 24px;
}

.public-site-fintech .public-nav,
.public-auth-page .public-nav {
    display: flex;
    align-items: center;
}

.public-site-fintech .public-nav a,
.public-auth-page .public-nav a {
    opacity: 0.82;
}

.public-site-fintech .public-nav a:hover,
.public-site-fintech .public-nav a.active,
.public-auth-page .public-nav a:hover {
    color: #ffffff;
    opacity: 1;
}

.public-site-fintech .public-language-switcher,
.public-auth-page .public-language-switcher,
.public-site-fintech .public-login-link {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.public-site-fintech .public-language-switcher a,
.public-auth-page .public-language-switcher a {
    color: rgba(255, 255, 255, 0.72);
}

.public-site-fintech .public-language-switcher a.active,
.public-auth-page .public-language-switcher a.active {
    color: #ffffff;
}

.public-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
}

.public-menu-toggle span:not(.sr-only) {
    display: block;
    width: 18px;
    height: 2px;
    margin: 3px 0;
    border-radius: 999px;
    background: #ffffff;
}

.fintech-hero {
    position: relative;
    margin-top: -86px;
    padding: 168px 0 104px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        radial-gradient(circle at 72% 32%, rgba(0, 210, 106, 0.16), transparent 28%),
        radial-gradient(circle at 20% 20%, rgba(45, 212, 191, 0.1), transparent 30%),
        #0b1020;
    background-size: 28px 28px, 28px 28px, auto, auto, auto;
    color: #ffffff;
}

.fintech-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 120px;
    background: linear-gradient(180deg, transparent, rgba(248, 250, 252, 0.96) 72%, #f8fafc);
    pointer-events: none;
}

.fintech-hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(420px, 0.98fr);
    align-items: center;
    gap: clamp(34px, 5vw, 68px);
}

.fintech-hero-copy h1 {
    max-width: 680px;
    margin: 0;
    color: #ffffff;
    font-size: clamp(2.9rem, 4.15vw, 4.25rem);
    line-height: 1.02;
    letter-spacing: 0;
}

.fintech-hero-copy > p:not(.public-eyebrow) {
    max-width: 590px;
    margin: 24px 0 0;
    color: #aeb8c8;
    font-size: clamp(1rem, 1.4vw, 1.16rem);
    line-height: 1.75;
}

.fintech-hero .public-eyebrow,
.public-final-cta .public-eyebrow {
    color: var(--fintech-green);
}

.fintech-hero .public-hero-actions {
    margin-top: 32px;
}

.fintech-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 26px;
    color: #aeb8c8;
    font-size: 0.92rem;
    font-weight: 700;
}

.fintech-trust-row span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.fintech-trust-row span::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--fintech-green);
    box-shadow: 0 0 0 6px rgba(0, 210, 106, 0.1);
}

.fintech-mockup {
    position: relative;
    min-height: 560px;
}

.mock-dashboard-card,
.mock-float,
.showcase-panel,
.ocr-card {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(145deg, rgba(30, 37, 62, 0.92), rgba(18, 25, 45, 0.9));
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(18px);
}

.mock-main {
    position: absolute;
    inset: 124px 48px auto 92px;
    display: grid;
    gap: 22px;
    padding: 26px;
    border-radius: 30px;
}

.mock-topline,
.showcase-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: #9ca8b8;
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.mock-topline strong,
.showcase-header strong {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(0, 210, 106, 0.14);
    color: var(--fintech-green);
}

.mock-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.mock-kpi-grid div {
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
}

.mock-kpi-grid span,
.mock-ledger span,
.mock-float span,
.mock-float small {
    color: #9ca8b8;
}

.mock-kpi-grid strong {
    display: block;
    margin-top: 8px;
    color: #ffffff;
    font-size: 1.7rem;
}

.mock-kpi-grid div:first-child strong,
.mock-ledger div:last-child strong {
    color: var(--fintech-green);
}

.mock-balance-chart {
    display: flex;
    align-items: end;
    gap: 10px;
    height: 120px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.05);
}

.mock-balance-chart span {
    flex: 1;
    border-radius: 999px 999px 4px 4px;
    background: linear-gradient(180deg, var(--fintech-green), rgba(0, 210, 106, 0.12));
}

.mock-balance-chart span:nth-child(1) { height: 38%; }
.mock-balance-chart span:nth-child(2) { height: 58%; }
.mock-balance-chart span:nth-child(3) { height: 46%; }
.mock-balance-chart span:nth-child(4) { height: 72%; }
.mock-balance-chart span:nth-child(5) { height: 62%; }

.mock-ledger {
    display: grid;
    gap: 10px;
}

.mock-ledger div,
.showcase-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #e5edf6;
    font-weight: 800;
}

.mock-float {
    position: absolute;
    z-index: 2;
    display: grid;
    gap: 10px;
    width: 190px;
    padding: 18px;
    border-radius: 22px;
}

.mock-float strong {
    color: #ffffff;
}

.mock-receipt {
    left: -28px;
    top: 48px;
    width: 150px;
}

.mock-category {
    right: 0;
    top: 18px;
}

.mock-payment {
    right: 22px;
    bottom: 24px;
    width: 225px;
}

.fintech-section {
    padding: clamp(54px, 7vw, 96px) 0;
    background: #f8fafc;
}

.fintech-section + .fintech-section {
    padding-top: 24px;
}

.public-site-fintech .public-section-heading h2,
.product-showcase h2,
.portugal-intelligence h2,
.security-trust h2,
.faq-teaser h2 {
    max-width: 780px;
    margin: 0;
    color: var(--fintech-ink);
    font-size: clamp(2rem, 4vw, 3.85rem);
    line-height: 1.02;
}

.centered h2 {
    margin-left: auto;
    margin-right: auto;
}

.fintech-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 38px;
}

.fintech-feature-grid article,
.public-card,
.public-side-card,
.public-contact-form,
.public-contact-details article,
.public-faq-list details {
    border: 1px solid var(--fintech-line);
    border-radius: 24px;
    background: var(--fintech-card);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.06);
}

.fintech-feature-grid article {
    min-height: 210px;
    padding: 24px;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.fintech-feature-grid article:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 210, 106, 0.45);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.1);
}

.fintech-feature-grid h3,
.timeline-steps h3,
.security-mini-grid h3 {
    color: var(--fintech-ink);
    font-size: 1.08rem;
}

.fintech-feature-grid p,
.timeline-steps p,
.security-mini-grid p,
.product-showcase p,
.portugal-intelligence p,
.faq-teaser p {
    color: var(--fintech-muted);
    line-height: 1.7;
}

.product-showcase,
.portugal-intelligence,
.security-trust,
.faq-teaser {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
    align-items: center;
    gap: clamp(28px, 5vw, 72px);
}

.showcase-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.showcase-pills span {
    padding: 9px 12px;
    border: 1px solid #cce9dd;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.86rem;
    font-weight: 900;
}

.showcase-panel {
    display: grid;
    gap: 18px;
    min-height: 430px;
    padding: 26px;
    border-radius: 30px;
    color: #ffffff;
}

.showcase-chart {
    position: relative;
    min-height: 180px;
    border-radius: 24px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        rgba(255, 255, 255, 0.04);
    background-size: 22px 22px;
}

.showcase-chart span {
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 48px;
    height: 76px;
    border-bottom: 5px solid var(--fintech-green);
    border-radius: 50%;
    transform: rotate(-4deg);
}

.how-timeline {
    padding: 46px;
    border: 1px solid var(--fintech-line);
    border-radius: 34px;
    background: #ffffff;
    box-shadow: 0 18px 60px rgba(15, 23, 42, 0.06);
}

.timeline-steps {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    margin-top: 36px;
}

.timeline-steps::before {
    content: "";
    position: absolute;
    top: 22px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #a7f3d0, transparent);
}

.timeline-steps article {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 10px;
    text-align: center;
}

.timeline-steps article > span {
    z-index: 1;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: var(--fintech-green-dark);
    color: #ffffff;
    font-weight: 900;
    box-shadow: 0 0 0 12px #ecfdf5;
}

.portugal-intelligence {
    padding: clamp(28px, 5vw, 54px);
    border-radius: 34px;
    background:
        radial-gradient(circle at 86% 18%, rgba(0, 210, 106, 0.14), transparent 28%),
        #ffffff;
    border: 1px solid var(--fintech-line);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.07);
}

.ocr-card {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    align-items: center;
    gap: 22px;
    min-height: 250px;
    padding: 28px;
    border-radius: 28px;
    color: #ffffff;
}

.ocr-card span {
    color: var(--fintech-green);
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.ocr-card strong {
    display: block;
    margin: 8px 0;
    font-size: 1.4rem;
}

.ocr-card small {
    color: #b6c2d2;
    line-height: 1.7;
}

.receipt-paper.large {
    width: 100px;
    height: 132px;
}

.security-trust {
    align-items: start;
}

.security-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.security-mini-grid article {
    min-height: 150px;
    padding: 22px;
    border: 1px solid var(--fintech-line);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 16px 45px rgba(15, 23, 42, 0.05);
}

.faq-teaser {
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1fr) minmax(280px, 0.58fr);
    align-items: start;
}

.public-site-fintech .public-final-cta {
    width: min(100%, 1220px);
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        radial-gradient(circle at 76% 18%, rgba(0, 210, 106, 0.18), transparent 26%),
        linear-gradient(135deg, #0b1020, #11182c);
    background-size: 26px 26px, 26px 26px, auto, auto;
}

.public-site-fintech .public-final-cta h2 {
    max-width: 720px;
    color: #ffffff;
    font-size: clamp(2.2rem, 5vw, 4.8rem);
}

.public-site-fintech .public-footer {
    width: min(100% - 40px, 1220px);
    border-top: 1px solid #dfe7ef;
}

.public-site-fintech .public-footer .public-brand,
.public-site-fintech .public-footer a,
.public-site-fintech .public-footer strong {
    color: var(--fintech-ink);
}

.public-site-fintech .public-footer p {
    color: var(--fintech-muted);
}

@media (max-width: 1100px) {
    .fintech-hero-grid,
    .product-showcase,
    .portugal-intelligence,
    .security-trust,
    .faq-teaser {
        grid-template-columns: 1fr;
    }

    .fintech-mockup {
        max-width: 720px;
        width: 100%;
        margin: 0 auto;
    }

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

    .timeline-steps::before {
        content: none;
    }
}

@media (max-width: 900px) {
    .public-site-fintech .public-header,
    .public-auth-page .public-header {
        flex-wrap: wrap;
        width: min(100% - 32px, 1220px);
    }

    .public-menu-toggle {
        display: grid;
    }

    .public-site-fintech .public-menu,
    .public-auth-page .public-menu {
        display: none;
        width: 100%;
        padding-top: 12px;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

    .public-menu-open .public-menu {
        display: grid;
        gap: 14px;
    }

    .public-site-fintech .public-nav,
    .public-auth-page .public-nav,
    .public-site-fintech .public-header-actions,
    .public-auth-page .public-header-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

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

@media (max-width: 680px) {
    .fintech-container,
    .public-site-fintech .public-footer {
        width: min(100% - 40px, 1220px);
    }

    .fintech-hero {
        padding: 146px 0 74px;
    }

    .fintech-hero-copy h1 {
        font-size: clamp(2.65rem, 13vw, 4rem);
    }

    .fintech-mockup {
        min-height: auto;
        display: grid;
        gap: 14px;
    }

    .mock-main,
    .mock-float {
        position: relative;
        inset: auto;
        right: auto;
        left: auto;
        top: auto;
        bottom: auto;
        width: 100%;
    }

    .mock-kpi-grid,
    .fintech-feature-grid,
    .security-mini-grid,
    .timeline-steps,
    .ocr-card {
        grid-template-columns: 1fr;
    }

    .how-timeline,
    .portugal-intelligence {
        padding: 24px;
    }

    .public-site-fintech .public-header-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .public-site-fintech .public-language-switcher {
        grid-column: 1 / -1;
        justify-content: center;
    }
}

/* v1.28.2 public typography and navy polish */
.public-site-fintech,
.public-auth-page {
    --fintech-navy: #080d1f;
    --fintech-navy-2: #0d1428;
    --fintech-navy-3: #121a33;
    --fintech-green: #00dc70;
    --fintech-green-dark: #03a66f;
    --fintech-text-soft: #b8c1d2;
    font-family: Inter, Manrope, Sora, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.public-site-fintech .public-header,
.public-auth-page .public-header {
    background: rgba(8, 13, 31, 0.84);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.fintech-hero {
    background:
        linear-gradient(rgba(255, 255, 255, 0.032) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.032) 1px, transparent 1px),
        radial-gradient(circle at 74% 28%, rgba(0, 220, 112, 0.18), transparent 25%),
        radial-gradient(circle at 18% 18%, rgba(59, 130, 246, 0.08), transparent 28%),
        linear-gradient(180deg, #080d1f 0%, #0a1022 100%);
    background-size: 30px 30px, 30px 30px, auto, auto, auto;
}

.fintech-hero-copy h1 {
    max-width: 690px;
    font-size: clamp(2.75rem, 4.7vw, 4.75rem);
    line-height: 1.01;
    font-weight: 900;
    letter-spacing: 0;
}

.fintech-hero-copy > p:not(.public-eyebrow) {
    color: var(--fintech-text-soft);
    font-size: clamp(1rem, 1.28vw, 1.13rem);
    line-height: 1.78;
}

.public-site-fintech .public-eyebrow {
    letter-spacing: 0.08em;
}

.public-site-fintech .public-cta-primary,
.public-auth-page .public-cta-primary,
.public-site-fintech .public-cta-small,
.public-auth-page .public-cta-small {
    background: linear-gradient(135deg, #00dc70, #05a86f);
    box-shadow: 0 18px 44px rgba(0, 220, 112, 0.22);
}

.public-site-fintech .public-cta-secondary,
.public-auth-page .public-cta-secondary,
.public-site-fintech .public-login-link {
    border-color: rgba(255, 255, 255, 0.18);
}

.mock-dashboard-card,
.mock-float,
.showcase-panel,
.ocr-card {
    background:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(145deg, rgba(24, 32, 60, 0.96), rgba(11, 17, 36, 0.96));
    background-size: 22px 22px, 22px 22px, auto;
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
}

.mock-main {
    padding: 28px;
    border-radius: 32px;
}

.mock-kpi-grid div,
.mock-balance-chart {
    background: rgba(255, 255, 255, 0.065);
    border-color: rgba(255, 255, 255, 0.12);
}

.mock-kpi-grid strong,
.mock-ledger strong,
.showcase-row strong {
    font-variant-numeric: tabular-nums;
}

.mock-kpi-grid div:first-child strong,
.mock-ledger div:last-child strong,
.showcase-row strong {
    color: var(--fintech-green);
}

.mock-float {
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.mock-receipt {
    top: 58px;
}

.mock-category {
    top: 56px;
}

.product-showcase {
    width: min(100% - 40px, 1220px);
    padding: clamp(34px, 5vw, 58px);
    border-radius: 34px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        radial-gradient(circle at 78% 24%, rgba(0, 220, 112, 0.16), transparent 25%),
        linear-gradient(135deg, #080d1f, #111936);
    background-size: 28px 28px, 28px 28px, auto, auto;
    box-shadow: 0 30px 90px rgba(8, 13, 31, 0.2);
}

.product-showcase h2,
.product-showcase p {
    color: #ffffff;
}

.product-showcase p:not(.public-eyebrow) {
    color: var(--fintech-text-soft);
}

.product-showcase .public-eyebrow {
    color: var(--fintech-green);
}

.product-showcase .showcase-panel {
    box-shadow: none;
}

.public-site-fintech .public-section-heading h2,
.portugal-intelligence h2,
.security-trust h2,
.faq-teaser h2 {
    font-size: clamp(2rem, 3.65vw, 3.5rem);
    line-height: 1.04;
    letter-spacing: 0;
}

.fintech-feature-grid article {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.055);
}

.portugal-intelligence {
    background:
        linear-gradient(rgba(15, 23, 42, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.025) 1px, transparent 1px),
        radial-gradient(circle at 82% 18%, rgba(0, 220, 112, 0.14), transparent 25%),
        #ffffff;
    background-size: 28px 28px, 28px 28px, auto, auto;
}

.public-site-fintech .public-final-cta {
    background:
        linear-gradient(rgba(255, 255, 255, 0.036) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.036) 1px, transparent 1px),
        radial-gradient(circle at 72% 22%, rgba(0, 220, 112, 0.2), transparent 28%),
        linear-gradient(135deg, #080d1f, #101832);
    background-size: 28px 28px, 28px 28px, auto, auto;
}

.public-site-fintech .public-footer {
    color: #111827;
    background: linear-gradient(180deg, #f8fafc, #ffffff);
}

/* v1.28.3 BudgetFlow AI public UX polish */
.public-site-fintech .public-logo-mark {
    position: relative;
    width: 30px;
    height: 30px;
    grid-template-columns: repeat(3, 6px);
    gap: 4px;
    padding: 4px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(0, 220, 112, 0.18), rgba(8, 13, 31, 0.06));
}

.public-site-fintech .public-logo-mark span {
    width: 6px;
    background: linear-gradient(180deg, #00dc70, #059669);
    box-shadow: 0 0 14px rgba(0, 220, 112, 0.2);
}

.public-site-fintech .public-brand {
    letter-spacing: -0.01em;
}

.public-page-banner {
    position: relative;
    overflow: hidden;
    margin: 18px auto 44px;
    padding: clamp(64px, 8vw, 108px) 0;
    color: #ffffff;
    background:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        radial-gradient(circle at 78% 18%, rgba(0, 220, 112, 0.22), transparent 30%),
        linear-gradient(135deg, #080d1f 0%, #111936 62%, #0b3329 100%);
    background-size: 30px 30px, 30px 30px, auto, auto;
}

.public-page-banner::after {
    content: "";
    position: absolute;
    inset: auto -8% -40% 46%;
    height: 180px;
    border-radius: 50%;
    background: rgba(0, 220, 112, 0.16);
    filter: blur(54px);
}

.public-page-banner .fintech-container {
    position: relative;
    z-index: 1;
    max-width: 860px;
    text-align: center;
}

.public-page-banner .public-eyebrow {
    color: #77f7b7;
}

.public-page-banner h1 {
    margin: 0 auto 18px;
    max-width: 820px;
    color: #ffffff;
    font-size: clamp(2.45rem, 5vw, 4.75rem);
    line-height: 1.02;
    letter-spacing: -0.015em;
}

.public-page-banner p:not(.public-eyebrow) {
    max-width: 680px;
    margin: 0 auto;
    color: #b8c4d8;
    font-size: clamp(1rem, 1.4vw, 1.18rem);
    line-height: 1.75;
}

.public-feature-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.95), transparent 30%),
        linear-gradient(135deg, #eafff4, #d8fbe8);
    border: 1px solid rgba(0, 166, 99, 0.22);
    box-shadow: 0 14px 28px rgba(5, 150, 105, 0.12);
}

.public-feature-icon::before {
    content: none;
}

.public-feature-icon svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: #047857;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fintech-feature-grid article,
.premium-feature-grid .public-card {
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.fintech-feature-grid article:hover,
.premium-feature-grid .public-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 166, 99, 0.28);
    box-shadow: 0 22px 64px rgba(15, 23, 42, 0.095);
}

.premium-feature-grid {
    width: min(100% - 36px, 1180px);
    margin: 0 auto;
}

.premium-feature-grid .public-card {
    min-height: 236px;
    padding: 28px;
}

.pricing-card-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 20px;
    margin-top: 32px;
    margin-bottom: 80px;
}

.pricing-card {
    display: grid;
    align-content: start;
    gap: 16px;
    min-width: 0;
    padding: 30px;
    border: 1px solid #dde7ef;
    border-radius: 26px;
    background: #ffffff;
    box-shadow: 0 18px 54px rgba(15, 23, 42, 0.06);
}

.pricing-card.featured {
    color: #ffffff;
    background:
        radial-gradient(circle at 82% 14%, rgba(0, 220, 112, 0.2), transparent 28%),
        linear-gradient(135deg, #080d1f, #111936);
    border-color: rgba(0, 220, 112, 0.22);
}

.pricing-card > span {
    justify-self: start;
    padding: 6px 10px;
    border-radius: 999px;
    color: #047857;
    background: #eafff4;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.pricing-card.featured > span {
    color: #77f7b7;
    background: rgba(0, 220, 112, 0.12);
}

.pricing-card h2 {
    margin: 0;
    color: #0b1220;
    font-size: 1.55rem;
}

.pricing-card.featured h2,
.pricing-card.featured p,
.pricing-card.featured li {
    color: #ffffff;
}

.pricing-card > strong {
    color: #0b1220;
    font-size: clamp(2rem, 4vw, 3.3rem);
    line-height: 1;
}

.pricing-card.featured > strong {
    color: #00dc70;
}

.pricing-card p {
    margin: 0;
    color: #64748b;
    line-height: 1.65;
}

.pricing-card ul {
    display: grid;
    gap: 9px;
    padding: 0;
    margin: 4px 0;
    list-style: none;
}

.pricing-card li::before {
    content: "✓";
    margin-right: 8px;
    color: #00dc70;
    font-weight: 900;
}

.pricing-muted {
    padding-top: 16px;
    border-top: 1px solid #e4ebf2;
}

.register-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
    gap: 26px;
    align-items: start;
    margin-top: 32px;
    margin-bottom: 86px;
}

.register-benefits,
.register-card {
    border: 1px solid #dde7ef;
    border-radius: 28px;
    background: #ffffff;
    box-shadow: 0 20px 58px rgba(15, 23, 42, 0.07);
}

.register-benefits {
    padding: 30px;
    background:
        radial-gradient(circle at 88% 18%, rgba(0, 220, 112, 0.13), transparent 28%),
        linear-gradient(135deg, #ffffff, #f2fbf7);
}

.register-benefits h2 {
    margin: 0 0 18px;
    color: #0b1220;
    font-size: clamp(1.6rem, 3vw, 2.35rem);
    line-height: 1.05;
}

.register-benefits ul {
    display: grid;
    gap: 12px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.register-benefits li::before {
    content: "✓";
    margin-right: 10px;
    color: #059669;
    font-weight: 900;
}

.register-card {
    display: grid;
    gap: 18px;
    padding: 30px;
}

.register-card label {
    display: grid;
    gap: 8px;
    min-width: 0;
    color: #0f172a;
    font-weight: 850;
}

.register-card input,
.register-card select {
    width: 100%;
    min-width: 0;
    border: 1px solid #d8e0ea;
    border-radius: 14px;
    padding: 13px 14px;
    color: #0f172a;
    background: #ffffff;
    font: inherit;
}

.register-two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.register-terms {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    font-weight: 700;
}

.register-terms input {
    width: auto;
    margin-top: 4px;
}

.register-card small,
.register-error {
    color: #b91c1c;
    font-weight: 800;
}

.register-login-note {
    margin: 0;
    color: #64748b;
    text-align: center;
}

.register-login-note a {
    color: #047857;
    font-weight: 900;
}

@media (max-width: 1024px) {
    .pricing-card-grid,
    .register-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .public-page-banner {
        margin-top: 10px;
        padding: 48px 0 56px;
    }

    .register-two-column {
        grid-template-columns: 1fr;
    }

    .pricing-card,
    .register-card,
    .register-benefits {
        padding: 22px;
        border-radius: 22px;
    }
}

/* v1.28.4 free early-access pricing page */
.pricing-hero {
    position: relative;
    overflow: hidden;
    color: #ffffff;
    background:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        radial-gradient(circle at 50% 18%, rgba(0, 220, 112, 0.24), transparent 28%),
        radial-gradient(circle at 86% 28%, rgba(0, 148, 255, 0.12), transparent 26%),
        linear-gradient(180deg, #080d1f 0%, #101832 74%, #f8fafc 74%, #f8fafc 100%);
    background-size: 30px 30px, 30px 30px, auto, auto, auto;
}

.pricing-hero-inner {
    display: grid;
    justify-items: center;
    padding: clamp(76px, 9vw, 128px) 0 clamp(132px, 14vw, 190px);
    text-align: center;
}

.pricing-hero .public-eyebrow {
    color: #77f7b7;
}

.pricing-hero h1 {
    max-width: 780px;
    margin: 0;
    color: #ffffff;
    font-size: clamp(3.1rem, 7vw, 6.8rem);
    line-height: 0.95;
    letter-spacing: -0.02em;
}

.pricing-hero p:not(.public-eyebrow) {
    max-width: 760px;
    margin: 24px auto 0;
    color: #bfcbdd;
    font-size: clamp(1.05rem, 1.55vw, 1.25rem);
    line-height: 1.78;
}

.pricing-trust-points {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 26px;
}

.pricing-trust-points span {
    padding: 9px 13px;
    border: 1px solid rgba(119, 247, 183, 0.24);
    border-radius: 999px;
    color: #d9ffe9;
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.9rem;
    font-weight: 850;
}

.pricing-free-plan {
    margin-top: clamp(-110px, -8vw, -76px);
    margin-bottom: 84px;
}

.pricing-free-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(260px, 0.82fr) minmax(260px, 1fr) minmax(280px, 0.9fr);
    gap: clamp(22px, 4vw, 40px);
    align-items: stretch;
    padding: clamp(24px, 4vw, 42px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 34px;
    background:
        radial-gradient(circle at 82% 18%, rgba(0, 220, 112, 0.16), transparent 26%),
        linear-gradient(135deg, rgba(11, 18, 32, 0.98), rgba(17, 25, 54, 0.98));
    box-shadow: 0 36px 90px rgba(8, 13, 31, 0.26);
    overflow: hidden;
}

.pricing-free-card::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.55;
    background:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

.pricing-free-copy,
.pricing-feature-list,
.pricing-product-mockup {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.pricing-free-copy {
    display: grid;
    align-content: start;
    gap: 18px;
}

.pricing-free-badge {
    justify-self: start;
    padding: 8px 12px;
    border-radius: 999px;
    color: #04130c;
    background: #00dc70;
    font-size: 0.78rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.pricing-price-row {
    display: grid;
    gap: 6px;
}

.pricing-price-row strong {
    color: #ffffff;
    font-size: clamp(4rem, 8vw, 7rem);
    line-height: 0.9;
    letter-spacing: -0.04em;
}

.pricing-price-row span {
    color: #77f7b7;
    font-weight: 900;
}

.pricing-free-copy p,
.pricing-free-copy small {
    color: #bfcbdd;
    line-height: 1.72;
}

.pricing-free-copy .public-cta-primary {
    justify-self: start;
    margin-top: 6px;
}

.pricing-feature-list {
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.055);
    backdrop-filter: blur(12px);
}

.pricing-feature-list h2 {
    margin: 0 0 18px;
    color: #ffffff;
    font-size: 1.25rem;
}

.pricing-feature-list ul {
    display: grid;
    gap: 11px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.pricing-feature-list li {
    display: flex;
    gap: 10px;
    color: #e7edf7;
    line-height: 1.45;
}

.pricing-feature-list li::before {
    content: "✓";
    display: inline-grid;
    flex: 0 0 22px;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    color: #04130c;
    background: #00dc70;
    font-weight: 950;
}

.pricing-product-mockup {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-content: center;
}

.pricing-mock-card {
    display: grid;
    gap: 8px;
    min-height: 128px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.075);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.pricing-mock-card span,
.pricing-mock-card small {
    color: #aebbd1;
    font-size: 0.84rem;
    font-weight: 850;
}

.pricing-mock-card strong {
    color: #ffffff;
    font-size: 1.12rem;
}

.pricing-mock-card.safe {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(0, 220, 112, 0.16), rgba(255, 255, 255, 0.07));
}

.pricing-mock-card.safe strong {
    color: #00dc70;
    font-size: clamp(1.9rem, 3vw, 2.8rem);
}

.pricing-mock-card.chart {
    align-items: center;
    justify-items: start;
}

.pricing-mock-card.timeline {
    grid-column: 1 / -1;
}

.pricing-why-section,
.pricing-faq-section {
    background: #f8fafc;
}

.pricing-why-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 30px;
}

.pricing-why-grid article {
    display: grid;
    align-content: start;
    gap: 14px;
    min-width: 0;
    padding: 26px;
    border: 1px solid #dfe8f0;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 18px 52px rgba(15, 23, 42, 0.055);
}

.pricing-why-grid h3 {
    margin: 0;
    color: #0b1220;
    font-size: 1.12rem;
}

.pricing-why-grid p {
    margin: 0;
    color: #64748b;
    line-height: 1.65;
}

.pricing-support-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: 28px;
    align-items: center;
    margin-top: 26px;
    margin-bottom: 76px;
    padding: clamp(28px, 5vw, 48px);
    border: 1px solid #dfe8f0;
    border-radius: 30px;
    background:
        radial-gradient(circle at 88% 20%, rgba(0, 220, 112, 0.12), transparent 24%),
        #ffffff;
    box-shadow: 0 22px 64px rgba(15, 23, 42, 0.065);
}

.pricing-support-section h2 {
    max-width: 620px;
    margin: 0 0 14px;
    color: #0b1220;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.03;
}

.pricing-support-section p {
    max-width: 680px;
    color: #64748b;
    line-height: 1.72;
}

.paypal-support-card {
    display: grid;
    gap: 14px;
    padding: 26px;
    border: 1px solid rgba(0, 166, 99, 0.18);
    border-radius: 24px;
    background: linear-gradient(135deg, #f6fff9, #ffffff);
}

.paypal-support-card span {
    color: #047857;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
}

.paypal-support-card strong {
    color: #0b1220;
    font-size: 2rem;
}

.pricing-faq-layout {
    grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
}

.pricing-final-cta {
    margin-top: 0;
}

@media (max-width: 1100px) {
    .pricing-free-card {
        grid-template-columns: 1fr;
    }

    .pricing-product-mockup {
        max-width: 620px;
    }
}

@media (max-width: 860px) {
    .pricing-why-grid,
    .pricing-support-section,
    .pricing-faq-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .pricing-hero h1 {
        font-size: clamp(3rem, 16vw, 4.2rem);
    }

    .pricing-free-card {
        border-radius: 26px;
    }

    .pricing-product-mockup {
        grid-template-columns: 1fr;
    }

    .pricing-mock-card.safe,
    .pricing-mock-card.timeline {
        grid-column: auto;
    }
}

/* v1.28.5 pricing hero spacing refinement */
.pricing-hero {
    background:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        radial-gradient(circle at 50% 22%, rgba(0, 220, 112, 0.24), transparent 30%),
        radial-gradient(circle at 86% 30%, rgba(0, 148, 255, 0.12), transparent 28%),
        linear-gradient(180deg, #080d1f 0%, #101832 80%, #f8fafc 80%, #f8fafc 100%);
    background-size: 30px 30px, 30px 30px, auto, auto, auto;
}

.pricing-hero-inner {
    padding-top: clamp(88px, 9.5vw, 136px);
    padding-bottom: clamp(172px, 17vw, 248px);
}

.pricing-hero p:not(.public-eyebrow) {
    margin-top: 30px;
}

.pricing-trust-points {
    margin-top: 36px;
    margin-bottom: 12px;
}

.pricing-free-plan {
    margin-top: clamp(-102px, -6.4vw, -66px);
}

@media (max-width: 860px) {
    .pricing-hero {
        background:
            linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
            linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
            radial-gradient(circle at 50% 20%, rgba(0, 220, 112, 0.22), transparent 32%),
            linear-gradient(180deg, #080d1f 0%, #101832 82%, #f8fafc 82%, #f8fafc 100%);
        background-size: 28px 28px, 28px 28px, auto, auto;
    }

    .pricing-hero-inner {
        padding-top: clamp(72px, 11vw, 104px);
        padding-bottom: clamp(150px, 22vw, 206px);
    }

    .pricing-free-plan {
        margin-top: clamp(-82px, -10vw, -52px);
    }
}

@media (max-width: 560px) {
    .pricing-hero-inner {
        padding-top: 64px;
        padding-bottom: 132px;
    }

    .pricing-hero p:not(.public-eyebrow) {
        margin-top: 24px;
    }

    .pricing-trust-points {
        margin-top: 30px;
        margin-bottom: 8px;
    }

    .pricing-free-plan {
        margin-top: -54px;
    }
}

/* v1.28.6 FAQ and Contact public polish */
.faq-premium-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
    gap: clamp(24px, 4vw, 42px);
    align-items: start;
    margin-top: 48px;
    margin-bottom: 92px;
}

.faq-accordion-list {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.faq-accordion-card {
    border: 1px solid #dfe8f0;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 44px rgba(15, 23, 42, 0.045);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.faq-accordion-card:hover {
    border-color: rgba(0, 166, 99, 0.24);
    box-shadow: 0 20px 56px rgba(15, 23, 42, 0.07);
    transform: translateY(-1px);
}

.faq-accordion-card summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    min-height: 72px;
    padding: 18px 20px;
    color: #0b1220;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 780;
    list-style: none;
}

.faq-accordion-card summary::-webkit-details-marker {
    display: none;
}

.faq-accordion-card .public-feature-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
}

.faq-accordion-card .public-feature-icon svg {
    width: 21px;
    height: 21px;
}

.faq-chevron {
    width: 10px;
    height: 10px;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotate(45deg);
    transition: transform 160ms ease;
}

.faq-accordion-card[open] .faq-chevron {
    transform: rotate(225deg);
}

.faq-accordion-card p {
    margin: 0;
    padding: 0 20px 22px 76px;
    color: #64748b;
    line-height: 1.72;
}

.faq-support-card {
    position: sticky;
    top: 104px;
    display: grid;
    gap: 18px;
    min-width: 0;
    padding: 30px;
    border: 1px solid rgba(0, 220, 112, 0.16);
    border-radius: 28px;
    color: #ffffff;
    background:
        radial-gradient(circle at 82% 12%, rgba(0, 220, 112, 0.2), transparent 32%),
        linear-gradient(145deg, #080d1f, #111936);
    box-shadow: 0 28px 72px rgba(8, 13, 31, 0.22);
}

.faq-support-icon {
    display: inline-grid;
    place-items: center;
    width: 62px;
    height: 62px;
    border-radius: 22px;
    background: rgba(0, 220, 112, 0.12);
    border: 1px solid rgba(119, 247, 183, 0.22);
}

.faq-support-icon svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: #77f7b7;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.faq-support-card h2 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    line-height: 1.04;
}

.faq-support-card p {
    margin: 0;
    color: #bfcbdd;
    line-height: 1.7;
}

.faq-trust-list,
.contact-trust-list {
    display: grid;
    gap: 12px;
}

.faq-trust-list > div,
.contact-trust-list article {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.faq-trust-list .public-feature-icon,
.contact-trust-list .public-feature-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(0, 220, 112, 0.12);
    border-color: rgba(119, 247, 183, 0.2);
}

.faq-trust-list .public-feature-icon svg,
.contact-trust-list .public-feature-icon svg {
    width: 18px;
    height: 18px;
    stroke: #77f7b7;
}

.faq-trust-list strong,
.contact-trust-list strong {
    display: block;
    color: #ffffff;
    font-size: 0.96rem;
}

.faq-trust-list small,
.contact-trust-list small {
    display: block;
    margin-top: 2px;
    color: #aebbd1;
    line-height: 1.45;
}

.contact-premium-section {
    position: relative;
    overflow: hidden;
    padding: clamp(64px, 8vw, 108px) 0 96px;
    color: #ffffff;
    background:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        radial-gradient(circle at 18% 22%, rgba(0, 220, 112, 0.18), transparent 28%),
        radial-gradient(circle at 86% 18%, rgba(0, 148, 255, 0.12), transparent 28%),
        linear-gradient(135deg, #080d1f, #111936);
    background-size: 30px 30px, 30px 30px, auto, auto, auto;
}

.contact-premium-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.85fr);
    gap: clamp(28px, 5vw, 64px);
    align-items: center;
}

.contact-premium-copy {
    display: grid;
    gap: 22px;
    min-width: 0;
}

.contact-premium-copy .public-eyebrow {
    color: #77f7b7;
}

.contact-premium-copy h1 {
    margin: 0;
    max-width: 620px;
    color: #ffffff;
    font-size: clamp(3.4rem, 8vw, 7rem);
    line-height: 0.92;
    letter-spacing: -0.025em;
}

.contact-premium-copy > p {
    max-width: 650px;
    margin: 0;
    color: #bfcbdd;
    font-size: clamp(1.05rem, 1.5vw, 1.2rem);
    line-height: 1.75;
}

.contact-email-card,
.contact-support-card,
.contact-premium-form {
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.07);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
}

.contact-email-card {
    display: grid;
    gap: 6px;
    max-width: 420px;
    padding: 18px 20px;
}

.contact-email-card span,
.contact-support-card span {
    color: #77f7b7;
    font-size: 0.78rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.contact-email-card a {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 900;
}

.contact-support-card {
    display: grid;
    gap: 10px;
    max-width: 520px;
    padding: 20px;
}

.contact-support-card p {
    margin: 0;
    color: #bfcbdd;
}

.contact-support-card a {
    justify-self: start;
    color: #77f7b7;
    font-weight: 900;
}

.contact-premium-form {
    display: grid;
    gap: 18px;
    min-width: 0;
    padding: clamp(24px, 4vw, 36px);
    background:
        radial-gradient(circle at 86% 10%, rgba(0, 220, 112, 0.14), transparent 30%),
        rgba(255, 255, 255, 0.08);
}

.contact-premium-form label {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.contact-premium-form label span {
    color: #e7edf7;
    font-weight: 850;
}

.contact-premium-form input,
.contact-premium-form textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    padding: 14px 15px;
    color: #ffffff;
    background: rgba(8, 13, 31, 0.48);
    font: inherit;
}

.contact-premium-form textarea {
    resize: vertical;
}

.contact-premium-form input:focus,
.contact-premium-form textarea:focus {
    outline: 2px solid rgba(0, 220, 112, 0.42);
    border-color: rgba(119, 247, 183, 0.48);
}

.contact-premium-form p,
.contact-premium-form small {
    margin: 0;
    color: #aebbd1;
    line-height: 1.55;
}

.contact-premium-form .public-cta-primary {
    width: 100%;
    justify-content: center;
}

@media (max-width: 1024px) {
    .faq-premium-layout,
    .contact-premium-layout {
        grid-template-columns: 1fr;
    }

    .faq-support-card {
        position: static;
    }
}

@media (max-width: 640px) {
    .faq-premium-layout {
        margin-top: 32px;
        margin-bottom: 64px;
    }

    .faq-accordion-card summary {
        grid-template-columns: auto minmax(0, 1fr) auto;
        padding: 16px;
        font-size: 0.98rem;
    }

    .faq-accordion-card p {
        padding: 0 16px 18px;
    }

    .faq-accordion-card .public-feature-icon {
        width: 36px;
        height: 36px;
    }

    .contact-premium-section {
        padding: 52px 0 72px;
    }

    .contact-premium-copy h1 {
        font-size: clamp(3rem, 17vw, 4.4rem);
    }
}

@media (max-width: 1024px) {
    .fintech-hero-copy h1 {
        font-size: clamp(3rem, 6vw, 3.5rem);
        line-height: 1.04;
    }
}

@media (max-width: 680px) {
    .fintech-hero-copy h1 {
        font-size: clamp(2.38rem, 10vw, 2.75rem);
        line-height: 1.06;
    }

    .fintech-hero-copy > p:not(.public-eyebrow) {
        font-size: 1rem;
    }

    .mock-dashboard-card,
    .mock-float,
    .showcase-panel,
    .ocr-card {
        border-radius: 24px;
    }
}

/* ==========================================================================
   Stage 1 UI foundation — shared design tokens + light/dark theme system
   Visual reference: dashboard_redesign_v5_enterprise.html and
   report_and_sidebar_redesign.html (provided outside the repo). Adds the
   mockups' token names, a client-driven [data-theme] toggle, a visual
   restyle of the existing sidebar/topbar (colors only — layout, the
   <details>/<summary> collapsible mechanism, and the mobile slide-in
   mechanics defined above are untouched), and a set of shared component
   classes (.card, table defaults, .tag, .btn/.btn-primary, .select,
   .badge, .num) for later stages to build page content on top of.
   `.status-pill` already has an established base style used by
   dashboard/report content today (see v1.10.0 above); only new `.ok`/
   `.review` modifier classes are added here rather than redefining the
   base rule, so existing pages keep their current look until restyled.
   `.kpi-card` is likewise left alone for the same reason.
   ========================================================================== */

:root,
[data-theme="light"] {
    --surface-2: #f8fafc;
    --text-2: #475467;
    --text-3: #98a2b3;
    --navy: #1d2b53;
    --navy-2: #243568;
    --blue-soft: #eaf1fe;
    --positive: #16a34a;
    --positive-soft: #e9f7ef;
    --warning: #f59e0b;
    --warning-soft: #fef6e7;
    --negative: #dc2626;
    --negative-soft: #fdecec;
    --shadow-lg: 0 8px 22px rgba(16, 24, 40, 0.09);
}

[data-theme="dark"] {
    --bg: #0d1117;
    --surface: #151b24;
    --surface-soft: #1a212b;
    --surface-muted: #1a212b;
    --surface-2: #1a212b;
    --border: #252c38;
    --text: #f0f2f5;
    --text-2: #9aa4b2;
    --text-3: #69707c;
    --muted: #9aa4b2;
    --navy: #223059;
    --navy-2: #182238;
    --blue: #5b8df8;
    --blue-soft: rgba(91, 141, 248, 0.14);
    --positive: #3ecf7e;
    --positive-soft: rgba(62, 207, 126, 0.14);
    --warning: #f5a623;
    --warning-soft: rgba(245, 166, 35, 0.14);
    --negative: #f0554e;
    --negative-soft: rgba(240, 85, 78, 0.14);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 26px rgba(0, 0, 0, 0.4);
    --sidebar-bg: #10182b;
    --sidebar-border: rgba(255, 255, 255, 0.1);
}

html {
    transition: background-color 0.2s ease;
}

body,
.card,
.panel,
.topbar,
.sidebar,
.profile-dropdown {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.num {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

/* ---- Theme toggle ---------------------------------------------------- */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    width: 52px;
    height: 28px;
    flex: 0 0 auto;
    border-radius: 20px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    cursor: pointer;
    padding: 3px;
    position: relative;
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.theme-toggle .knob {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--navy);
    transition: transform 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.theme-toggle .knob svg {
    width: 11px;
    height: 11px;
    stroke: #fff;
    fill: none;
    stroke-width: 2.2;
}

/* ---- Sidebar visual restyle (colors only) ----------------------------- */
.sidebar {
    background: var(--navy);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-mark {
    background: var(--blue);
}

.brand-version {
    color: #a7b2c4;
}

.nav-link {
    color: #b7c0d6;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
    color: #ffffff;
    box-shadow: inset 3px 0 0 var(--blue);
}

.nav-group-summary {
    color: #8fa0bd;
}

.nav-group-summary:hover {
    color: #e5edf6;
    background: rgba(255, 255, 255, 0.05);
}

.nav-group[open] .nav-group-summary {
    color: #e5edf6;
}

.nav-group-chevron {
    color: #7c8bab;
}

.nav-group[open] .nav-group-chevron {
    color: #dce8f3;
}

.profile-trigger {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.profile-trigger:hover,
.profile-menu[open] .profile-trigger {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
}

.profile-meta small {
    color: #93a0bd;
}

.profile-dropdown {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.profile-dropdown-link {
    color: var(--text);
}

.profile-dropdown-link:hover {
    background: var(--surface-2);
}

/* ---- Topbar visual restyle (colors only) ------------------------------ */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.mobile-header-title {
    color: var(--text);
}

.icon-button {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}

/* ---- Shared component classes for later stages ------------------------ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table th {
    text-align: left;
    font-size: 10.5px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--text-3);
    padding: 0 8px 10px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
}

table td {
    padding: 11px 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover td {
    background: var(--surface-2);
}

.status-pill.ok {
    background: var(--positive-soft);
    color: var(--positive);
}

.status-pill.review {
    background: var(--negative-soft);
    color: var(--negative);
}

.tag {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    background: var(--surface-2);
    color: var(--text-2);
    border: 1px solid var(--border);
}

.btn {
    font-weight: 600;
    font-size: 13px;
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: box-shadow 0.15s ease;
}

.btn:hover {
    box-shadow: var(--shadow-lg);
}

.btn:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

.select {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

.badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.badge svg {
    width: 19px;
    height: 19px;
    stroke-width: 2;
    fill: none;
}

.badge.blue {
    background: var(--blue-soft);
}

.badge.blue svg {
    stroke: var(--blue);
}

.badge.red {
    background: var(--negative-soft);
}

.badge.red svg {
    stroke: var(--negative);
}

.badge.green {
    background: var(--positive-soft);
}

.badge.green svg {
    stroke: var(--positive);
}

.badge.navy {
    background: var(--blue-soft);
}

.badge.navy svg {
    stroke: var(--navy);
}

/* ---- Compact row-action buttons (e.g. View/Edit/Delete in a table row) -
   Not yet adopted by any template — report.html's `.report-table-actions`
   still holds full-size `.btn` elements today; migrating existing pages to
   this class is separate Stage 2 page work. Intended markup:
   <div class="report-table-actions">
     <a class="action-btn" href="...">View</a>
     <a class="action-btn" href="...">Edit</a>
     <form ...><button class="action-btn action-btn-delete" type="submit">Delete</button></form>
   </div>
   Sized to sit inline in a table row (unlike `.btn`, which is full-size).
   Neutral border by default; the text carries the neutral/blue tone for
   view/edit and the existing negative/red tone for delete (same token
   pairing `.status-pill`/`.badge` already use), with the border and a
   `.btn`-style hover shadow picking up that color on interaction. */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-weight: 600;
    font-size: 12px;
    line-height: 1;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--blue);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.action-btn:hover {
    border-color: var(--blue);
    box-shadow: var(--shadow-lg);
}

.action-btn:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.action-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.action-btn-delete {
    color: var(--negative);
}

.action-btn-delete:hover {
    border-color: var(--negative);
}

@media (prefers-reduced-motion: reduce) {
    html,
    body,
    .card,
    .panel,
    .topbar,
    .sidebar,
    .profile-dropdown,
    .theme-toggle .knob {
        transition: none !important;
    }
}
