* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Dark Premium - Light mode */
:root {
    --bg-color: #f1f5f9;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent: #0ea5e9;
    --accent-light: #38bdf8;
    --accent-gradient: linear-gradient(135deg, #0284c7, #0ea5e9);
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --surface: var(--bg-color);
    --surface-2: var(--bg-color);
    --muted: var(--text-secondary);
}

/* Dark Premium - Dark mode (grigi scuri, accent blu) */
[data-theme="dark"] {
    --bg-color: #0c0d0e;
    --card-bg: #16181b;
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --accent: #38bdf8;
    --accent-light: #7dd3fc;
    --accent-gradient: linear-gradient(135deg, #0284c7, #38bdf8);
    --danger: #f87171;
    --success: #4ade80;
    --warning: #fbbf24;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.05);
    --surface: var(--card-bg);
    --surface-2: rgba(255, 255, 255, 0.03);
    --muted: var(--text-secondary);
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    transition: all 0.3s ease;
    min-height: 100vh;
}

/* License Status Styles */
.license-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.license-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.license-status.free .license-badge {
    background: var(--border);
    color: var(--text-secondary);
}

.license-status.trial .license-badge {
    background: linear-gradient(135deg, var(--warning), #f59e0b);
    color: white;
}

.license-status.premium .license-badge {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: white;
}

/* Premium Banner */
.premium-banner {
    background: linear-gradient(160deg, rgba(10, 18, 34, 0.96), rgba(12, 28, 56, 0.92));
    border-radius: 18px;
    margin: 14px 0 18px;
    overflow: hidden;
    border: 1px solid rgba(86, 123, 202, 0.22);
    box-shadow: 0 10px 26px rgba(3, 8, 20, 0.34), inset 0 1px 0 rgba(255,255,255,0.04);
}

.premium-content {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
}

.premium-text h3 {
    margin: 0 0 3px 0;
    color: #f8fbff;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.premium-text p {
    margin: 0;
    color: rgba(225, 236, 255, 0.78);
    font-size: 0.84rem;
    line-height: 1.35;
}

.premium-btn {
    background: linear-gradient(135deg, rgba(126, 170, 255, 0.22), rgba(78, 125, 255, 0.32));
    color: #eef4ff;
    border: 1px solid rgba(126, 170, 255, 0.28);
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.22s ease;
    white-space: nowrap;
    min-height: 42px;
}

.premium-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(11, 29, 62, 0.32);
    border-color: rgba(145, 186, 255, 0.42);
}

.premium-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    padding: 8px 10px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(111, 162, 255, 0.18), rgba(111, 162, 255, 0.06));
    border: 1px solid rgba(111, 162, 255, 0.18);
    color: #dce9ff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.premium-mini-points {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 9px;
}

.premium-mini-points span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.06);
    color: rgba(235, 242, 255, 0.88);
    font-size: 0.72rem;
    font-weight: 600;
}

@media (max-width: 640px) {
    .premium-content {
        grid-template-columns: auto 1fr;
        gap: 10px 12px;
        padding: 12px;
    }

    .premium-btn {
        grid-column: 1 / -1;
        width: 100%;
        justify-self: stretch;
    }

    .premium-text h3 {
        font-size: 0.96rem;
    }

    .premium-text p {
        font-size: 0.8rem;
    }

    .premium-mini-points {
        margin-top: 8px;
    }
}

/* Plan Comparison */
.plan-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.plan {
    padding: 20px;
    border-radius: 16px;
    border: 2px solid var(--border);
}

.plan.free {
    background: var(--bg-color);
    border-color: var(--border);
}

.plan.premium {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(56, 189, 248, 0.1));
    border-color: var(--accent);
    position: relative;
}

.plan.premium::before {
    content: "POPOLARE";
    position: absolute;
    top: -12px;
    right: 20px;
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
}

.plan h3 {
    margin: 0 0 15px 0;
    text-align: center;
    font-size: 1.2rem;
}

.plan ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.plan li {
    padding: 8px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}

.plan li:last-child {
    border-bottom: none;
}

.price {
    text-align: center;
    padding: 15px 0;
    background: var(--card-bg);
    border-radius: 12px;
    margin-top: 15px;
}

.amount {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
}

.period {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

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

.modal-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Feature Lock Overlay */
.feature-locked {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.feature-locked::after {
    content: "Premium";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--accent);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 10;
}

/* Upgrade Prompt */
.upgrade-prompt {
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    color: white;
    padding: 16px;
    border-radius: 12px;
    margin: 15px 0;
    text-align: center;
}

.upgrade-prompt h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
}

.upgrade-prompt p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.upgrade-prompt button {
    background: white;
    color: var(--accent);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    margin-top: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upgrade-prompt button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Animazioni di ingresso */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.summary-card, .section-card, .guide-message {
    animation: fadeInUp 0.5s ease forwards;
}

.section-card:nth-of-type(1) { animation-delay: 0.1s; }
.section-card:nth-of-type(2) { animation-delay: 0.2s; }
.section-card:nth-of-type(3) { animation-delay: 0.3s; }
.section-card:nth-of-type(4) { animation-delay: 0.4s; }
.section-card:nth-of-type(5) { animation-delay: 0.5s; }
.section-card:nth-of-type(6) { animation-delay: 0.6s; }
.section-card:nth-of-type(7) { animation-delay: 0.7s; }
.section-card:nth-of-type(8) { animation-delay: 0.8s; }
.section-card:nth-of-type(9) { animation-delay: 0.9s; }

@keyframes gentlePulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.95; transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}

.guide-message {
    background: var(--accent-gradient);
    color: white;
    padding: 16px 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    font-weight: 500;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Stili per gli hint delle date */
.date-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
    font-style: italic;
    opacity: 0.8;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

h1 {
    font-size: 1.8rem;
    color: var(--accent);
}

.version {
    font-size: 0.9rem;
    background: var(--accent);
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    margin-left: 8px;
}

.theme-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    box-shadow: var(--shadow);
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 1rem;
}

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

.brand-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.14) 0%, rgba(30, 58, 138, 0.18) 100%);
    border: 1px solid rgba(37, 99, 235, 0.18);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.brand-mark img,
.brand-mark svg {
    width: 28px;
    height: 28px;
    display: block;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-copy h1 {
    margin: 0;
    line-height: 1;
}

.brand-caption {
    margin-top: 4px;
    font-size: 0.72rem;
    line-height: 1.2;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* Toast */
.toast {
    position: fixed;
    left: 50%;
    bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%) translateY(18px);
    width: fit-content;
    max-width: min(calc(100vw - 32px), 360px);
    background: var(--success);
    color: white;
    padding: 14px 18px;
    border-radius: 28px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.32);
    z-index: 1200;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    font-weight: 700;
    text-align: center;
    line-height: 1.25;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Card */
.summary-card, .section-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.summary-card:hover, .section-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

[data-theme="dark"] .summary-card:hover,
[data-theme="dark"] .section-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 255, 255, 0.08);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.summary-item {
    text-align: center;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 16px;
}

.summary-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.summary-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    letter-spacing: -0.02em;
}

.period-info {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

h2 {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge {
    background: var(--accent-gradient);
    color: white;
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(14, 165, 233, 0.25);
}

/* Form elements */
.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.input-group-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

input, select, button {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-color);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.input-group-row input, .input-group-row select {
    flex: 1;
    min-width: 120px;
}

.date-input {
    width: 100%;
    margin-bottom: 12px;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger, .btn-text {
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    width: 100%;
    padding: 14px;
    box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.35);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--border);
    width: 100%;
}

/* Import UX */
.import-actions{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:flex-start;
  flex-wrap:wrap;
}

.btn-link{
  background: transparent;
  border: 0;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn-link:hover{
  background: color-mix(in srgb, var(--bg-color) 70%, transparent);
  color: var(--text-primary);
}

.import-advanced{
  margin-top: 10px;
}

.btn-secondary:hover {
    background: var(--border);
    border-color: var(--accent);
}

.btn-danger {
    background: var(--danger);
    color: white;
    width: 100%;
    margin-top: 8px;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.4);
}

.btn-text {
    background: none;
    color: var(--accent);
    text-decoration: underline;
    padding: 8px;
}

.button-group {
    display: flex;
    gap: 8px;
}

.button-group button {
    flex: 1;
}

/* Liste spese */
.expenses-list {
    margin-bottom: 16px;
}

.expense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 12px;
    margin-bottom: 8px;
    border-left: 4px solid var(--accent);
    transition: all 0.2s ease;
}

.expense-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
    border-left-width: 6px;
}


.expense-item.linked {
    border-left-color: rgba(34, 197, 94, 0.95);
}

.expense-link-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    margin-top: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #d1fae5;
    background: rgba(34, 197, 94, 0.16);
    border: 1px solid rgba(34, 197, 94, 0.32);
}

.expense-info {
    display: flex;
    flex-direction: column;
}

.expense-name {
    font-weight: 600;
}

.expense-category {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.expense-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.expense-amount {
    font-weight: 700;
    color: var(--danger);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.expense-amount[style*="color: var(--success)"] {
    color: var(--success) !important;
}

.expense-actions button {
    padding: 6px 10px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
}

/* Stili per spese fisse avanzate */
.half {
    flex: 1;
    min-width: 120px;
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 8px;
    text-align: center;
}

.fixed-expense-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: block;
}

/* Stili per input con microfono */
.input-with-mic {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.input-with-mic input {
    flex: 1;
    min-width: 0;
}

.mic-icon-btn {
    background: var(--accent-light);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
    flex-shrink: 0;
}

.mic-icon-btn:hover {
    transform: scale(1.1);
    background: var(--accent);
}

.mic-icon-btn.listening {
    background: #ef233c;
    animation: pulse 1.5s infinite;
}

.mic-icon-btn:active {
    transform: scale(0.95);
}

/* Stili per microfono unico spese fisse */
.voice-fixed-container {
    background: var(--bg-color);
    border-radius: 16px;
    padding: 16px;
    margin: 16px 0;
    border: 2px dashed var(--accent-light);
}

.voice-fixed-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 14px 24px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 12px;
}

.voice-fixed-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
}

.voice-fixed-btn.listening {
    background: linear-gradient(135deg, #ef233c, #d9042b);
    animation: pulse 1.5s infinite;
}

.voice-fixed-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Stili per input vocale variabili */
.voice-input-container {
    background: var(--bg-color);
    border-radius: 16px;
    padding: 16px;
    margin: 16px 0;
    border: 2px dashed var(--accent-light);
}

.voice-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 200px;
}

.voice-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
}

.voice-btn.listening {
    background: linear-gradient(135deg, #ef233c, #d9042b);
    animation: pulse 1.5s infinite;
}

.voice-status {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
    min-height: 24px;
    padding: 6px 12px;
    background: var(--card-bg);
    border-radius: 30px;
    border: 1px solid var(--border);
    flex: 2;
}

.voice-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* Stile per selettore lingua */
.language-select {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-color);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
}

.language-select:hover {
    border-color: var(--accent);
}

/* Stili per la chat */
.chat-container {
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    background: var(--bg-color);
}

.chat-messages {
    height: 200px;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-message {
    padding: 8px 12px;
    border-radius: 12px;
    max-width: 80%;
}

.chat-message.bot {
    align-self: flex-start;
    background: var(--bg-color);
    border: 1px solid var(--border);
}

.chat-message.user {
    align-self: flex-end;
    background: var(--accent-gradient);
    color: white;
}

.message-sender {
    font-weight: 600;
    font-size: 0.8rem;
    margin-right: 4px;
}

.message-text {
    word-wrap: break-word;
}

.chat-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
}

.chat-input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 30px;
    background: var(--bg-color);
}

.chat-voice-btn {
    background: var(--accent-light);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
}

.chat-voice-btn:hover {
    transform: scale(1.1);
    background: var(--accent);
}

.chat-voice-btn.listening {
    background: #ef233c;
    animation: pulse 1.5s infinite;
}

.chat-send-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(14, 165, 233, 0.2);
}

.chat-send-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.25);
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.suggestion-chip {
    background: var(--bg-color);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.suggestion-chip:hover {
    background: var(--accent-gradient);
    color: white;
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* Grafico Doughnut */
.chart-wrapper {
    position: relative;
}

.chart-container {
    position: relative;
    max-width: 280px;
    margin: 0 auto 16px;
}

#expenseChart {
    max-width: 100%;
    height: auto;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    justify-content: center;
    margin: 12px 0;
}

.chart-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    font-size: 0.9rem;
}

.chart-legend-item:hover {
    background: var(--bg-color);
    transform: translateY(-1px);
}

.chart-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.chart-legend-label {
    color: var(--text-primary);
    font-weight: 500;
}

.chart-legend-value {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.chart-note {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 20px;
}


/* STEP 6.1 - Analysis chart redesign */
.analysis-chart-card {
    border: 1px solid rgba(56, 189, 248, 0.14);
    background:
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.14), transparent 34%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.96));
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.22);
}

.analysis-chart-card .section-content {
    padding-top: 14px;
}

.analysis-chart-card .chart-container {
    width: 100%;
    max-width: none;
    min-height: 250px;
    margin: 0 auto 14px;
}

.analysis-chart-card--donut .chart-container {
    max-width: 320px;
    height: 320px;
    min-height: 240px;
}

.analysis-chart-card--bars .chart-container,
.analysis-chart-card--trend .chart-container {
    height: 240px;
    min-height: 240px;
}

.analysis-chart-card canvas {
    width: 100% !important;
}

.chart-legend {
    justify-content: flex-start;
    gap: 10px;
}

.chart-legend-item {
    flex: 1 1 220px;
    justify-content: flex-start;
    gap: 10px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(8px);
}

.chart-legend-item:hover,
.chart-legend-item:focus-visible {
    background: rgba(30, 41, 59, 0.82);
    border-color: rgba(56, 189, 248, 0.22);
    transform: translateY(-1px);
    outline: none;
}

.chart-legend-dot {
    width: 12px;
    height: 12px;
    box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.08);
}

.chart-legend-label {
    flex: 1;
    min-width: 0;
}

.chart-legend-value {
    font-size: 0.8rem;
    white-space: nowrap;
}

.chart-note {
    padding: 10px 6px 0;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .analysis-chart-card .section-content {
        padding-top: 10px;
    }

    .analysis-chart-card--donut .chart-container {
        max-width: 270px;
        height: 270px;
        min-height: 270px;
    }

    .analysis-chart-card--bars .chart-container,
    .analysis-chart-card--trend .chart-container {
        height: 220px;
        min-height: 220px;
    }

    .chart-legend {
        gap: 8px;
    }

    .chart-legend-item {
        flex-basis: 100%;
        padding: 10px 11px;
    }

    .chart-legend-value {
        font-size: 0.78rem;
    }
}

/* Progress bar */
.progress-container {
    margin-top: 16px;
    background: var(--bg-color);
    border-radius: 30px;
    height: 30px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent-gradient);
    color: white;
    text-align: center;
    line-height: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: width 0.3s ease;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 30px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Stato salute e trend */
.status-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.trend-indicator {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
    font-style: italic;
}

/* Dettaglio categoria */
.category-detail {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-color);
    border-radius: 24px;
    border: 1px solid var(--border);
    animation: fadeInUp 0.3s ease;
    box-shadow: var(--shadow);
}

.category-detail h3 {
    margin-bottom: 15px;
    color: var(--accent);
    font-size: 1.3rem;
}

.category-detail p {
    margin: 5px 0;
    font-size: 1rem;
}

.detail-expenses-list {
    margin: 15px 0;
    max-height: 200px;
    overflow-y: auto;
}

.detail-expense-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--card-bg);
    border-radius: 12px;
    margin-bottom: 5px;
    border-left: 3px solid var(--accent);
    transition: transform 0.2s ease;
}

.detail-expense-item:hover {
    transform: translateX(4px);
}

.detail-expense-item .expense-name {
    font-weight: 500;
}

.detail-expense-item .expense-amount {
    color: var(--danger);
    font-weight: 600;
}

#closeDetailBtn {
    width: 100%;
    margin-top: 10px;
}

/* Sparkline container */
.sparkline-container {
    width: 100%;
    height: 30px;
    margin-top: 8px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.sparkline-container:hover {
    opacity: 1;
}

.sparkline-container canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Timeline spese fisse */
.fixed-expense-item {
    transition: all 0.2s;
    border-left-width: 6px !important;
}

.fixed-expense-item.future {
    border-left-color: #2dc653 !important;
    background: rgba(45, 198, 83, 0.05);
}

.fixed-expense-item.warning {
    border-left-color: #ff9e00 !important;
    background: rgba(255, 158, 0, 0.05);
}

.fixed-expense-item.expired {
    border-left-color: #ef233c !important;
    background: rgba(239, 35, 60, 0.05);
    opacity: 0.8;
}

/* Badge per i giorni rimasti */
.days-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 8px;
}

.days-badge.future {
    background: #2dc653;
    color: white;
}

.days-badge.warning {
    background: #ff9e00;
    color: white;
}

.days-badge.expired {
    background: #ef233c;
    color: white;
}

/* Barra risparmio emozionale */
.savings-container {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-color);
    border-radius: 24px;
    text-align: center;
}

.savings-pig {
    position: relative;
    width: 100%;
    height: 80px;
    background: var(--border);
    border-radius: 40px 40px 20px 20px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.pig-emoji {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    z-index: 2;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.2));
}

.progress-emotional {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ffd166, #ffb347, #ff9f1c);
    transition: width 0.5s ease;
    border-radius: 40px 40px 20px 20px;
    opacity: 0.9;
}

.progress-fill {
    height: 100%;
    width: 100%;
}

.savings-message {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    margin: 10px 0;
    padding: 10px;
    background: var(--card-bg);
    border-radius: 16px;
    border-left: 4px solid var(--accent);
}

.savings-tip {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    padding: 8px;
    background: var(--card-bg);
    border-radius: 16px;
}

/* Widget AI */
.ai-suggestion {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--accent-gradient);
    color: white;
    border-radius: 24px;
    margin-bottom: 12px;
    animation: fadeInUp 0.3s ease;
    box-shadow: 0 10px 20px -5px rgba(14, 165, 233, 0.25);
}

.ai-icon {
    font-size: 2rem;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.2));
}

#aiMessage {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.4;
}

.ai-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

#applyAiSuggestion {
    background: white;
    color: var(--accent);
    border: none;
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

#applyAiSuggestion:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#dismissAiSuggestion {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

#dismissAiSuggestion:hover {
    opacity: 1;
}
/* ========== STILI PER I SELETTORI DI COLORE ========== */

/* Contenitore di ogni riga colore (già inline nel HTML, ma possiamo rafforzare) */
.setting-item {
    margin-bottom: 16px;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Wrapper per il picker e il campo testo (già in flex nel HTML) */
.setting-item > div[style*="display: flex"] {
    display: flex !important;
    gap: 8px;
    align-items: center;
}

/* Stile per l'input color nativo - lo rendiamo più grande e accattivante */
.setting-item input[type="color"] {
    width: 60px;
    height: 40px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    background: var(--card-bg);
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.setting-item input[type="color"]:hover {
    border-color: var(--accent);
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.setting-item input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.setting-item input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

/* Stile per il campo di testo affiancato (codice esadecimale) */
.setting-item input[type="text"][id*="Text"] {
    flex: 1;
    min-width: 100px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', monospace;  /* Usa monospace per i codici colore */
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.setting-item input[type="text"][id*="Text"]:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.setting-item input[type="text"][id*="Text"]:hover {
    border-color: var(--accent-light);
}

/* Bottone ripristina colori */
#resetColorsBtn {
    margin-top: 8px;
    width: 100%;
    background: var(--bg-color);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

#resetColorsBtn:hover {
    background: var(--border);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* Responsive: su schermi piccoli, impila i campi */
@media (max-width: 480px) {
    .setting-item > div[style*="display: flex"] {
        flex-direction: column;
        align-items: stretch;
    }
    
    .setting-item input[type="color"] {
        width: 100%;
        height: 50px;
    }
}
/* ========== REVISIONE IMPORT CSV ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 24px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.3s ease;
}

.review-item {
    background: var(--bg-color);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid var(--accent);
    transition: transform 0.2s ease;
}

.review-item:hover {
    transform: translateX(4px);
}

.review-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.review-date {
    color: var(--text-secondary);
    min-width: 100px;
}

.review-name {
    font-weight: 600;
    flex: 1;
}

.review-amount {
    font-weight: 700;
    color: var(--danger);
    min-width: 80px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.review-category {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.review-select {
    width: 100%;
    padding: 10px;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.review-select:hover {
    border-color: var(--accent);
}

.review-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.review-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-left: 4px;
}

/* ========== MAPPATURA CSV ========== */
.csv-mapping-select {
    width: 100%;
    padding: 10px;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: var(--bg-color);
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.csv-mapping-select:hover {
    border-color: var(--accent);
}

.csv-mapping-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.preview-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}

#csvMappingHeaders th {
    padding: 12px;
    font-weight: 600;
    text-align: left;
    background: var(--accent);
    color: white;
}

#csvMappingPreview td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--card-bg);
}

#csvMappingPreview tr:last-child td {
    border-bottom: none;
}

/* ========== GESTIONE CATEGORIE ========== */
.categories-list {
    margin: 15px 0;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: 4px 0;
    background: var(--bg-color);
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.category-item:hover {
    transform: translateX(4px);
}

.category-item.default {
    border-left: 3px solid var(--accent);
}

.category-item.custom {
    border-left: 3px solid var(--success);
}

.category-item button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 4px;
    padding: 4px;
    transition: transform 0.2s;
}

.category-item button:hover {
    transform: scale(1.1);
}

.empty-message {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 15px;
}

/* Toggle row (es. mostra tutte le spese del periodo) */
.toggle-row {
    margin: 10px 0 8px;
}

.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    color: var(--text-primary);
    font-weight: 600;
}

.toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

/* ========== TAB BAR ========== */
.tab-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0 16px;
    margin-bottom: 8px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.tab-bar::-webkit-scrollbar {
    height: 4px;
}

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

.tab-btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.tab-btn:hover {
    background: var(--border);
    border-color: var(--accent);
}

.tab-btn.active {
    background: var(--accent);
    color: #0c0d0e;
    border-color: var(--accent);
}

[data-theme="dark"] .tab-btn.active {
    color: #0c0d0e;
}

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 8px;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .input-group-row {
        flex-direction: column;
    }
    
    h1 {
        font-size: 1.5rem;
    }
}
.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin: 15px 0;
}
.color-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.color-item label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.color-item input[type="color"] {
    width: 100%;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
}
/* Stili per i selettori Excel */
#excelSheet:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
    font-style: italic;
}
/* Stili per i nuovi input numerici */
#skipRows, #headerRowManual {
    width: 100%;
}

/* ===== Fixed status list (Home) ===== */
.fixed-status-list{display:flex;flex-direction:column;gap:10px;}
.fixed-status-row{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:10px 12px;border:1px solid var(--border);background:var(--surface-2);border-radius:14px;}
.fixed-status-left{min-width:0;display:flex;flex-direction:column;gap:2px;}
.fixed-status-name{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.fixed-status-sub{font-size:12px;color:var(--muted);}
.fixed-status-right{display:flex;flex-direction:column;align-items:flex-end;gap:6px;}
.fixed-status-amount{font-weight:700;}
.fixed-pill{font-size:12px;padding:3px 8px;border-radius:999px;border:1px solid var(--border);}
.fixed-pill.paid{background:rgba(34,197,94,0.12);}
.fixed-pill.due{background:rgba(245,158,11,0.12);}
.fixed-match{font-size:11px;color:var(--muted);max-width:160px;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

/* ============================================
   WIDGET RISPARMIO MIGLIORATO
   ============================================ */

.savings-widget {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
}

.widget-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    border-radius: 16px;
    color: white;
}

.pig-icon-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pig-emoji {
    font-size: 32px;
    z-index: 2;
    position: relative;
}

.progress-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.progress-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: bold;
    color: var(--accent);
}

.widget-info h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}

.target-date {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

.interactive-controls {
    display: grid;
    gap: 20px;
    margin-bottom: 24px;
}

.slider-container {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.slider-container label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-color);
}

.percentage-value {
    color: var(--accent);
    font-weight: bold;
}

.savings-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 8px;
}

.savings-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.savings-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.savings-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.goal-input-container,
.initial-savings-container {
    background: var(--card-bg);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.goal-input-container label,
.initial-savings-container label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.input-with-icon {
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-icon {
    font-size: 20px;
}

.goal-input,
.initial-input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    background: var(--bg);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.goal-input:focus,
.initial-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

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

.insight-card {
    background: var(--card-bg);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    min-width: 0;
    overflow: hidden;
}

.insight-card h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.insight-card p {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.insight-card strong {
    color: var(--accent);
    font-weight: 600;
}

.insight-card.suggestion {
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    border-color: var(--accent);
    color: white;
}

.insight-card.suggestion h4,
.insight-card.suggestion p {
    color: white;
}

.insight-card.suggestion strong {
    color: white;
    font-weight: 700;
}

.btn-suggestion {
    background: white;
    color: var(--accent);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.3s ease;
}

.btn-suggestion:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Animazioni per il widget */
@keyframes progressRingAnimation {
    from {
        stroke-dashoffset: 157;
    }
    to {
        stroke-dashoffset: var(--progress-offset);
    }
}

.progress-circle {
    transition: stroke-dashoffset 0.5s ease-in-out;
}

/* Responsive */
@media (max-width: 768px) {
    .savings-insights {
        grid-template-columns: 1fr;
    }
    
    .widget-header {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .widget-info h3 {
        font-size: 16px;
    }
    
    .target-date {
        font-size: 14px;
    }
}


/* ===== WISESCORE HOME ===== */
.wise-score-home {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wise-score-main {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.wise-score-ring {
    min-width: 110px;
    min-height: 110px;
    border-radius: 50%;
    border: 8px solid var(--primary-color, #2563eb);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--card-bg, #fff);
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

.wise-score-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.wise-score-label {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 4px;
}

.wise-score-summary {
    flex: 1;
    min-width: 220px;
}

.wise-score-status {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.wise-score-meta {
    font-size: 0.92rem;
    opacity: 0.82;
    line-height: 1.45;
}

.wise-pillars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wise-pillar-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wise-pillar-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 0.92rem;
}

.wise-pillar-name {
    font-weight: 600;
}

.wise-pillar-value {
    font-weight: 700;
}

.wise-pillar-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.18);
}

.wise-pillar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #3b82f6 0%, #0ea5e9 100%);
    transition: width 0.25s ease;
}

@media (max-width: 640px) {
    .wise-score-main {
        align-items: flex-start;
    }

    .wise-score-ring {
        min-width: 96px;
        min-height: 96px;
        border-width: 7px;
    }

    .wise-score-value {
        font-size: 1.7rem;
    }
}


/* ===== REPORT VIEWER ===== */
.report-modal-content {
    width: min(1080px, 96vw);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.report-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.report-modal-header h3,
.report-section-head h3 {
    margin: 0 0 6px 0;
}

.report-modal-header--hero {
    margin-bottom: 12px;
}

.report-modal-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.report-modal-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.report-view-content {
    overflow: auto;
    padding-right: 4px;
}

.report-sheet {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.report-sheet + .report-sheet {
    margin-top: 14px;
}

.report-hero-sheet {
    background: linear-gradient(180deg, color-mix(in srgb, var(--card-bg) 88%, #ffffff 12%) 0%, var(--card-bg) 100%);
}

.report-hero-topline {
    margin-bottom: 12px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}

.report-hero-score-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 14px;
    align-items: stretch;
    margin-bottom: 14px;
}

.report-hero-score-card {
    border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border) 76%);
    border-radius: 18px;
    padding: 18px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--card-bg) 90%) 0%, color-mix(in srgb, var(--accent) 18%, var(--card-bg) 82%) 100%);
}

.report-hero-score-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.report-hero-score-value {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    font-size: 3rem;
    line-height: 1;
    font-weight: 900;
}

.report-hero-score-value small {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.report-hero-meta {
    display: grid;
    gap: 10px;
}

.report-hero-meta-item,
.report-summary-item,
.report-kpi,
.report-pillar-item,
.report-list-item {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    background: color-mix(in srgb, var(--card-bg) 94%, var(--accent) 6%);
}

.report-hero-meta-item span,
.report-kpi-label {
    display: block;
    font-size: 0.83rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.report-hero-meta-item strong,
.report-kpi-value {
    display: block;
    font-weight: 800;
    font-size: 1.05rem;
}

.report-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 12px;
    margin: 16px 0 0;
}

.report-kpis--highlight .report-kpi {
    min-height: 84px;
}

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

.report-summary-item {
    line-height: 1.45;
    background: color-mix(in srgb, var(--card-bg) 97%, #ffffff 3%);
}

.report-grid-two {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 14px;
}

.report-grid-two--top {
    align-items: start;
}

.report-section-spacer {
    height: 14px;
}

.report-pillar-list,
.report-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.report-pillar-head,
.report-list-item-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

.report-pillar-bar {
    width: 100%;
    height: 10px;
    background: rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    overflow: hidden;
}

.report-pillar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #0ea5e9 100%);
    border-radius: 999px;
}

.report-list-item-sub {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.report-note {
    color: var(--text-secondary);
    line-height: 1.5;
}

.report-hero-note {
    margin: 0;
}

.report-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.18);
    font-weight: 700;
    font-size: 0.88rem;
}

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

.report-insight-column {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
    background: color-mix(in srgb, var(--card-bg) 96%, var(--accent) 4%);
    min-width: 0;
}

.report-insight-column-head {
    margin-bottom: 10px;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.report-insight-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.report-insight-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    background: color-mix(in srgb, var(--card-bg) 97%, #ffffff 3%);
    min-width: 0;
    overflow: hidden;
}

.report-insight-card--positive {
    background: color-mix(in srgb, var(--card-bg) 84%, #dcfce7 16%);
    border-color: color-mix(in srgb, var(--border) 78%, #22c55e 22%);
}

.report-insight-card--warning {
    background: color-mix(in srgb, var(--card-bg) 86%, #fef3c7 14%);
    border-color: color-mix(in srgb, var(--border) 78%, #f59e0b 22%);
}

.report-insight-card--critical {
    background: color-mix(in srgb, var(--card-bg) 86%, #fee2e2 14%);
    border-color: color-mix(in srgb, var(--border) 78%, #ef4444 22%);
}

.report-insight-card--action {
    background: color-mix(in srgb, var(--card-bg) 84%, #dbeafe 16%);
    border-color: color-mix(in srgb, var(--border) 78%, #3b82f6 22%);
}

.report-insight-title {
    font-weight: 800;
    margin-bottom: 6px;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
}

.report-insight-text {
    color: var(--text-secondary);
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
}

@media (max-width: 768px) {
    .report-hero-score-row,
    .report-grid-two,
    .report-summary-grid,
    .report-insights-grid {
        grid-template-columns: 1fr;
    }

    .report-sheet {
        padding: 16px;
        border-radius: 18px;
    }

    .report-hero-score-value {
        font-size: 2.4rem;
    }
}



/* ===== STEP 4.1 PRINT REPORT OPTIMIZATION ===== */
@media print {

    body{
        background:#ffffff !important;
        color:#000000 !important;
    }

    .report-container{
        max-width:100%;
        margin:0;
        padding:20px;
    }

    .report-hero{
        padding:16px 20px;
        margin-bottom:16px;
        border-bottom:2px solid #e5e7eb;
    }

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

    .kpi-card{
        padding:10px 12px;
        border:1px solid #e5e7eb;
        border-radius:8px;
        page-break-inside:avoid;
    }

    .executive-summary{
        margin-top:10px;
        margin-bottom:14px;
        line-height:1.45;
    }

    .pillar-section{
        margin-top:12px;
        page-break-inside:avoid;
    }

    h1,h2,h3{
        page-break-after:avoid;
    }

    .section{
        margin-bottom:14px;
    }

    .report-insights-grid,
    .report-insight-column,
    .report-insight-card,
    .report-sheet,
    .report-list-item,
    .report-pillar-item,
    .report-kpi{
        page-break-inside:avoid;
        break-inside:avoid;
    }

}


#balanceChartCard .chart-container {
    min-height: 320px;
}

.bar-chart-container canvas {
    width: 100% !important;
    height: 240px !important;
    max-height: none;
}


#monthlyBalanceChartCard .chart-container {
    min-height: 240px;
}


/* STEP 7.3 - fixed expense live status */
.fixed-expense-right{display:flex;flex-direction:column;align-items:flex-end;gap:8px;}
.fixed-expense-live{display:flex;flex-direction:column;gap:6px;margin-top:8px;min-width:0;}
.fixed-expense-match{font-size:12px;color:var(--muted);overflow-wrap:anywhere;word-break:break-word;}
.fixed-expense-item .fixed-pill{display:inline-flex;align-items:center;gap:6px;align-self:flex-start;}
@media (max-width:768px){
  .fixed-expense-right{align-items:flex-start;width:100%;}
}


/* ===== STEP 7.4 Fixed expenses live summary ===== */
.fixed-expense-summary-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px;
    margin-bottom:14px;
}
.fixed-expense-summary-card{
    border:1px solid var(--border);
    background:var(--surface-2);
    border-radius:16px;
    padding:12px 14px;
    min-width:0;
}
.fixed-expense-summary-card.paid{
    border-color:rgba(34,197,94,.28);
}
.fixed-expense-summary-card.due{
    border-color:rgba(245,158,11,.30);
}
.fixed-expense-summary-label{
    font-size:12px;
    color:var(--muted);
    margin-bottom:6px;
}
.fixed-expense-summary-value{
    font-size:18px;
    font-weight:800;
    line-height:1.15;
    overflow-wrap:anywhere;
}
.fixed-expense-summary-meta{
    margin-top:6px;
    font-size:12px;
    color:var(--muted);
}
@media (max-width: 768px){
    .fixed-expense-summary-grid{
        grid-template-columns:1fr;
    }
}


/* STEP 7.5 — Home fixed coherence */
#fixedStatusHomeBadge{white-space:normal;text-align:center;line-height:1.2;}
.wise-score-home .wise-score-meta{overflow-wrap:anywhere;}
.fixed-status-row{align-items:flex-start;}


.fixed-manual-match-box{margin-top:10px;padding:10px 12px;border:1px solid rgba(244,163,0,.35);border-radius:12px;background:rgba(244,163,0,.08)}
.fixed-manual-match-title{font-weight:700;font-size:.92rem;margin-bottom:4px}
.fixed-manual-match-text,.fixed-manual-match-meta{font-size:.85rem;opacity:.85}
.fixed-manual-match-mov{font-size:.9rem;font-weight:600;margin:6px 0 2px}
.fixed-manual-match-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.fixed-confirm-match-btn,.fixed-reject-match-btn{border:none;border-radius:999px;padding:8px 12px;font-weight:600;cursor:pointer}
.fixed-confirm-match-btn{background:#0ea5e9;color:#fff}
.fixed-reject-match-btn{background:rgba(148,163,184,.18);color:inherit}


.fixed-status-box {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-top: 6px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.55);
    border: 1px solid rgba(0,0,0,0.06);
}
.fixed-status-box.paid {
    background: rgba(76, 175, 80, 0.08);
    border-color: rgba(76, 175, 80, 0.18);
}
.fixed-status-box.due {
    background: rgba(255, 193, 7, 0.08);
    border-color: rgba(255, 193, 7, 0.20);
}
.fixed-status-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.fixed-status-line {
    font-size: 0.92rem;
    color: #4b5563;
    line-height: 1.3;
}

/* STEP 7.9.1 premium metrics row */
.fixed-status-box{
display:flex;
flex-direction:column;
gap:4px;
}

.fixed-metrics-row{
display:flex;
gap:18px;
font-size:12px;
opacity:0.85;
align-items:center;
}

.fixed-metric{
display:flex;
gap:4px;
white-space:nowrap;
}

.fixed-metric-label{
font-weight:500;
opacity:0.7;
}

.fixed-metric-value{
font-weight:600;
}

/* STEP R1.1 — Home quick voice */
.home-quick-card .section-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.home-quick-actions {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 12px;
}

.home-voice-btn,
.home-manual-btn {
    width: 100%;
}

.home-quick-hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@media (max-width: 640px) {
    .home-quick-actions {
        grid-template-columns: 1fr;
    }
}


/* ===== CHECKPOINT 2 — HOME MODERNA + PRIVACY ===== */
.home-hero-card {
  padding: 22px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(17,24,39,0.98) 0%, rgba(10,14,24,0.98) 100%);
  border: 1px solid rgba(79,124,255,0.16);
  box-shadow: 0 14px 32px rgba(0,0,0,0.28);
}
.hero-card-header {
  display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin-bottom:16px;
}
.hero-eyebrow {
  font-size: 12px; letter-spacing: .16em; color: var(--text-secondary); font-weight:700;
}
.hero-period-line, .period-source {
  color: var(--text-secondary); font-size: 0.95rem; margin-top: 8px;
}
.hero-main {
  font-size: clamp(2.2rem, 6vw, 3.9rem);
  line-height: 1;
  font-weight: 800;
  color: #4F7CFF;
  margin: 10px 0 20px;
  letter-spacing: -0.04em;
}
.hero-meta-grid {
  display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px;
}
.hero-meta-card {
  background: rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.05); border-radius: 16px; padding: 14px;
}
.hero-meta-label { display:block; font-size: .86rem; color: var(--text-secondary); margin-bottom: 8px; }
.hero-meta-value { font-size: 1.35rem; font-weight: 700; color: var(--text-primary); }
.hero-meta-inline { display:flex; align-items:center; gap:6px; }
.privacy-toggle-btn {
  border:1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.04); color: var(--text-primary); padding:10px 14px; border-radius: 12px; cursor:pointer; font-weight:600;
}
.privacy-toggle-btn:hover { transform: translateY(-1px); }
.compact-header h2 { margin: 0; }
body.privacy-hidden .sensitive-amount,
body.privacy-hidden .expense-amount,
body.privacy-hidden .fixed-status-amount,
body.privacy-hidden .fixed-expense-summary-value,
body.privacy-hidden .review-amount,
body.privacy-hidden .chart-legend-value,
body.privacy-hidden #totalIncomeDisplay,
body.privacy-hidden .report-kpi-value,
body.privacy-hidden .sensitive-insight {
  color: transparent !important;
  text-shadow: 0 0 10px rgba(79,124,255,0.65);
  user-select: none;
}
body.privacy-hidden .sensitive-insight { text-shadow: 0 0 12px rgba(255,255,255,0.28); }
body.privacy-hidden #remainingStatus { filter: none; }
body.privacy-hidden #dailyBudget {
    color: transparent !important;
    text-shadow: 0 0 18px rgba(255,255,255,0.42), 0 0 34px rgba(79,124,255,0.20);
    filter: blur(4px);
    user-select: none;
}
@media (min-width: 860px) {
  .hero-meta-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
}


.future-fixed-section {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
}

.future-fixed-section.empty {
    background: rgba(255,255,255,0.02);
}

.future-fixed-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.future-fixed-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-color, #f3f4f6);
}

.future-fixed-subtitle,
.future-fixed-meta,
.future-fixed-date {
    color: var(--text-secondary, #9ca3af);
    font-size: 0.86rem;
}

.future-fixed-total {
    font-weight: 700;
    font-size: 1rem;
}

.future-fixed-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.future-fixed-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.future-fixed-row:first-child {
    border-top: none;
    padding-top: 0;
}

.future-fixed-left,
.future-fixed-right {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.future-fixed-right {
    align-items: flex-end;
}

.future-fixed-name {
    font-weight: 600;
}

.future-fixed-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(79,124,255,0.14);
    color: #9bb5ff;
    font-size: 0.78rem;
    font-weight: 600;
}


.list-toggle-row {
    display: flex;
    justify-content: flex-end;
    margin: 10px 0 14px;
}

.list-toggle-btn {
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: var(--text-primary, #fff);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.88rem;
    cursor: pointer;
}

.list-toggle-btn.future {
    margin-top: 8px;
}

.toggle-list-shell.collapsed,
.future-fixed-list.collapsed {
    display: none;
}

.future-fixed-right-header {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}


.panel-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.02));
  border-radius: 14px;
}
.panel-section-header.compact {
  margin-top: 0;
}
.panel-section-header.split .list-toggle-btn {
  flex-shrink: 0;
}
.panel-section-header.variable {
  margin-top: 14px;
}
.panel-section-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
}
.panel-section-subtitle {
  margin-top: 4px;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--text-secondary);
}
.fixed-expense-summary-grid {
  margin-top: 0;
}
.toggle-list-shell {
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 4px 0;
  background: rgba(255,255,255,0.015);
}
.toggle-list-shell.collapsed {
  padding: 0;
  border: 0;
  background: transparent;
}
.future-fixed-section {
  margin-top: 20px;
  background: linear-gradient(180deg, rgba(16,185,129,0.06), rgba(255,255,255,0.02));
}
.future-fixed-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #4ade80;
  margin-bottom: 4px;
}
.future-fixed-title {
  font-size: 1rem;
}
#fixedExpensesList .expense-item,
#variableExpensesList .expense-item {
  border-radius: 14px;
}
body.privacy-hidden .future-fixed-badge {
  color: #86efac;
}
@media (max-width: 640px) {
  .panel-section-header,
  .panel-section-header.split {
    flex-direction: column;
    align-items: stretch;
  }
  .panel-section-header.split .list-toggle-btn {
    width: 100%;
  }
}

.fixed-term-badge {
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-left:8px;
  margin-top:6px;
  padding:4px 8px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:10px;
  font-size:11px;
  color:var(--muted);
  background:rgba(255,255,255,.04);
}
.future-fixed-term {
  margin-top:4px;
  font-size:12px;
  color:var(--muted);
}
body.privacy-hidden .fixed-term-badge,
body.privacy-hidden .future-fixed-term {
  opacity:.92;
}


/* ===== WiseForecast home ===== */
.forecast-card {
    border: 1px solid rgba(79, 124, 255, 0.18);
    background: linear-gradient(180deg, rgba(17,24,39,0.96) 0%, rgba(15,23,42,0.98) 100%);
}
.forecast-subtitle {
    margin: 0 0 12px;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.92rem;
}
.forecast-grid {
    display: grid;
    grid-template-columns: 1.45fr 0.9fr;
    gap: 12px;
}
.forecast-main-card,
.forecast-side-card {
    border: 1px solid rgba(148,163,184,0.16);
    border-radius: 14px;
    background: rgba(15,23,42,0.82);
    padding: 14px;
}
.forecast-label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-secondary, #94a3b8);
    margin-bottom: 8px;
}
.forecast-value {
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}
.forecast-side-value {
    font-size: 1.25rem;
    font-weight: 700;
}
.forecast-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.82rem;
    font-weight: 700;
    background: rgba(148,163,184,0.12);
}
.forecast-status.positive { color: #22c55e; }
.forecast-status.negative { color: #ef4444; }
.forecast-status.neutral { color: #f59e0b; }
@media (max-width: 760px) {
    .forecast-grid { grid-template-columns: 1fr; }
    .forecast-value { font-size: 1.65rem; }
}


/* === v102 Form UI System === */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
select,
textarea {
    width: 100%;
    min-height: 48px;
    padding: 13px 15px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--border) 86%, transparent);
    background: linear-gradient(180deg, color-mix(in srgb, var(--card-bg) 96%, transparent), color-mix(in srgb, var(--surface-2) 88%, transparent));
    color: var(--text-primary);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 1px 2px rgba(0,0,0,0.04);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: color-mix(in srgb, var(--text-secondary) 82%, transparent);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):hover,
select:hover,
textarea:hover {
    border-color: color-mix(in srgb, var(--accent) 24%, var(--border));
    background: linear-gradient(180deg, color-mix(in srgb, var(--card-bg) 100%, transparent), color-mix(in srgb, var(--surface-2) 100%, transparent));
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--accent) 70%, white 0%);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14), inset 0 1px 0 rgba(255,255,255,0.04);
}

.input-group,
.input-group-row {
    margin-bottom: 18px;
}

.input-group label,
.goal-input-container label {
    margin-bottom: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--text-secondary);
}

.input-group-row {
    gap: 10px;
}

.input-group-row input:not([type="checkbox"]):not([type="radio"]),
.input-group-row select {
    min-width: 132px;
}

.date-input {
    margin-bottom: 14px;
}

.btn-primary, .btn-secondary, .btn-danger, .btn-text {
    min-height: 46px;
    border-radius: 14px;
}

.btn-secondary {
    background: color-mix(in srgb, var(--surface-2) 100%, transparent);
    color: var(--text-primary);
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.btn-secondary:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
    background: color-mix(in srgb, var(--surface-2) 78%, var(--card-bg));
}

.btn-danger:hover,
.btn-text:hover {
    transform: translateY(-1px);
}

.chat-input-area {
    padding: 12px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--card-bg) 98%, transparent), color-mix(in srgb, var(--surface-2) 100%, transparent));
}

.chat-input {
    min-height: 46px;
    border-radius: 16px;
}

.language-select,
.review-select,
.csv-mapping-select,
.goal-input,
.initial-input {
    border-radius: 14px;
}

@media (max-width: 768px) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
    select,
    textarea {
        font-size: 16px;
    }
}


/* === v109 UI consistency lock === */
body {
  padding-bottom: 92px;
}

.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  margin: 0;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(12,13,14,0.96);
  border-top: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 -10px 30px rgba(0,0,0,0.35);
}

.tab-btn {
  padding: 10px 16px;
}

.voice-input-container,
.voice-fixed-container,
.home-quick-card {
  border: 1px solid rgba(79,124,255,0.18) !important;
}

.voice-input-container,
.voice-fixed-container {
  background: linear-gradient(180deg, rgba(17,24,39,0.82), rgba(15,23,42,0.62));
  border-radius: 18px;
  padding: 16px;
}

.voice-btn,
.voice-fixed-btn,
.home-voice-btn {
  background: linear-gradient(135deg, #1d4ed8, #38bdf8) !important;
  color: #eff6ff;
  border: 1px solid rgba(147,197,253,0.20);
  box-shadow: 0 10px 24px rgba(29,78,216,0.18);
}

.voice-btn:hover,
.voice-fixed-btn:hover,
.home-voice-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(29,78,216,0.24);
}

.voice-btn.listening,
.voice-fixed-btn.listening,
.home-voice-btn.listening {
  background: linear-gradient(135deg, #1d4ed8, #2563eb) !important;
  box-shadow: 0 0 0 1px rgba(96,165,250,0.35), 0 0 0 6px rgba(37,99,235,0.12), 0 14px 28px rgba(29,78,216,0.24);
  animation: pulse 1.5s infinite;
}

.voice-status {
  min-height: 46px;
  display: flex;
  align-items: center;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  font-style: normal;
  color: #cbd5e1;
}

.search-container {
  margin: 16px 0 !important;
  padding: 16px !important;
  background: linear-gradient(180deg, rgba(17,24,39,0.88), rgba(15,23,42,0.74)) !important;
  border-radius: 18px !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
}

.search-container > div:first-child {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

#searchExpenses {
  border-radius: 999px !important;
  padding-left: 40px !important;
}

#searchCategory {
  border-radius: 999px !important;
}

select option,
#searchCategory option,
#expenseCategory option {
  background: #ffffff;
  color: #111827;
}

.forecast-status {
  border: 1px solid rgba(148,163,184,0.14);
}

.forecast-status.negative {
  color: #fda4af;
  background: rgba(239,68,68,0.14);
  border-color: rgba(239,68,68,0.28);
}

.forecast-status.positive {
  background: rgba(34,197,94,0.14);
  border-color: rgba(34,197,94,0.22);
}

.forecast-status.neutral {
  background: rgba(245,158,11,0.14);
  border-color: rgba(245,158,11,0.24);
}

.btn-danger {
  background: linear-gradient(180deg, rgba(127,29,29,0.88), rgba(69,10,10,0.96));
  color: #fee2e2;
  border: 1px solid rgba(248,113,113,0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 10px 20px rgba(69,10,10,0.22);
}

.btn-danger:hover {
  background: linear-gradient(180deg, rgba(153,27,27,0.96), rgba(88,28,28,1));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 14px 24px rgba(88,28,28,0.28);
}

.button-group {
  gap: 10px;
}

#resetFixedBtn,
#resetDayBtn {
  margin-top: 0;
}

@media (max-width: 760px) {
  body {
    padding-bottom: 98px;
  }

  .tab-bar {
    gap: 6px;
    padding-inline: 8px;
  }

  .voice-row {
    flex-direction: column;
    align-items: stretch;
  }

  .voice-btn,
  .voice-fixed-btn,
  .home-voice-btn,
  .voice-status {
    width: 100%;
    min-width: 0;
  }
}


/* === v112 UI lock refinement / no-translation-touch === */
:root {
  --bw-electric-blue-1: #4f8cff;
  --bw-electric-blue-2: #79a8ff;
  --bw-electric-blue-3: rgba(79, 140, 255, 0.26);
  --bw-premium-panel: linear-gradient(180deg, rgba(10,16,30,0.94), rgba(8,13,24,0.94));
}

body {
  padding-bottom: 104px;
}

.tab-bar {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 10px;
  transform: translateX(-50%);
  width: min(calc(100% - 16px), 940px);
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  margin: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: linear-gradient(180deg, rgba(8,12,20,0.92), rgba(12,18,32,0.96));
  border: 1px solid rgba(112, 141, 196, 0.16);
  border-radius: 18px;
  box-shadow: 0 18px 44px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  scroll-snap-type: x proximity;
}

.tab-bar::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  flex: 0 0 auto;
  min-width: max-content;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.07);
  background: linear-gradient(180deg, rgba(19,24,37,0.95), rgba(14,18,29,0.98));
  color: #dbe5f7;
  scroll-snap-align: start;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.tab-btn:hover {
  background: linear-gradient(180deg, rgba(24,30,45,0.98), rgba(17,22,35,0.98));
  border-color: rgba(121,168,255,0.22);
}

.tab-btn.active,
[data-theme="dark"] .tab-btn.active {
  background: linear-gradient(135deg, var(--bw-electric-blue-1), var(--bw-electric-blue-2));
  color: #f8fbff;
  border-color: rgba(160, 196, 255, 0.65);
  box-shadow: 0 12px 24px rgba(79,140,255,0.30), inset 0 1px 0 rgba(255,255,255,0.18);
}

.expense-item,
.detail-expense-item {
  border-radius: 10px;
}

.expense-item {
  padding: 10px 12px;
}

.expense-info {
  min-width: 0;
  gap: 2px;
}

.expense-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expense-amount,
.detail-expense-item .expense-amount {
  color: #dbe7ff !important;
}

#variableExpensesList .expense-item,
.variable-home-card {
  background: linear-gradient(180deg, rgba(8,12,22,0.98), rgba(6,10,18,0.98));
  border: 1px solid rgba(86,123,202,0.14);
  border-left: 3px solid rgba(79,140,255,0.95);
  margin-bottom: 10px;
}

.variable-home-card .expense-main-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.variable-home-card .expense-side-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.variable-card-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.variable-card-actions {
  display: flex;
  gap: 6px;
}

.variable-card-actions button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}

.search-container {
  margin: 14px 0 16px !important;
  padding: 14px !important;
  background: var(--bw-premium-panel) !important;
  border: 1px solid rgba(86,123,202,0.14) !important;
  border-radius: 10px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.search-container > div:first-child {
  display: grid !important;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.9fr) auto;
  gap: 10px;
  align-items: center;
}

.search-container > div:first-child > div:first-child {
  min-width: 0 !important;
}

#searchExpenses,
#searchCategory,
#resetSearchBtn {
  min-height: 46px;
  border-radius: 10px !important;
}

#searchExpenses,
#searchCategory {
  background: linear-gradient(180deg, rgba(18,24,38,0.96), rgba(13,18,30,0.98)) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  color: #e5ecf8 !important;
  box-shadow: none !important;
}

#searchExpenses::placeholder {
  color: #8fa1bf !important;
}

#searchExpenses:focus,
#searchCategory:focus {
  outline: none;
  border-color: rgba(121,168,255,0.42) !important;
  box-shadow: 0 0 0 3px rgba(79,140,255,0.12) !important;
}

#resetSearchBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px !important;
  background: linear-gradient(180deg, rgba(18,24,38,0.96), rgba(13,18,30,0.98)) !important;
  color: #bcd1ff !important;
  border: 1px solid rgba(86,123,202,0.18) !important;
  text-decoration: none !important;
}

#searchResultsCount {
  color: #8fa1bf !important;
}

.btn-danger {
  background: linear-gradient(180deg, rgba(26,35,56,0.96), rgba(15,22,36,0.98));
  color: #dbe7ff;
  border: 1px solid rgba(86,123,202,0.20);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 10px 20px rgba(0,0,0,0.18);
}

.btn-danger:hover {
  background: linear-gradient(180deg, rgba(31,42,67,0.98), rgba(18,26,42,0.99));
  border-color: rgba(121,168,255,0.28);
}

.forecast-status.negative {
  color: #dce8ff;
  background: rgba(79,140,255,0.14);
  border-color: rgba(79,140,255,0.28);
}

@media (max-width: 760px) {
  body {
    padding-bottom: 112px;
  }

  .tab-bar {
    width: calc(100% - 12px);
    bottom: 6px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    gap: 6px;
    border-radius: 16px;
  }

  .tab-btn {
    padding: 10px 12px;
    font-size: 0.88rem;
  }

  .search-container > div:first-child {
    grid-template-columns: 1fr;
  }

  #resetSearchBtn {
    width: 100%;
  }

  .variable-home-card .expense-main-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .variable-home-card .expense-side-block {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}


.analysis-chart-actions {
    display: flex;
    justify-content: flex-end;
    margin: 10px 0 6px;
}

.analysis-inline-btn {
    min-height: 40px;
    border-radius: 12px;
}

.category-print-panel {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92) 0%, rgba(10, 18, 33, 0.98) 100%);
    box-shadow: 0 10px 28px rgba(2, 6, 23, 0.26);
}

.category-print-panel__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.category-print-panel__eyebrow {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent, #38bdf8);
}

.category-print-panel h3 {
    margin: 0;
    font-size: 20px;
}

.category-print-panel__meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.category-print-kpi {
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.58);
}

.category-print-kpi span {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--text-secondary, #94a3b8);
}

.category-print-kpi strong {
    display: block;
    font-size: 17px;
    color: var(--text-primary, #f8fafc);
}

.category-print-panel__cta {
    display: flex;
    justify-content: flex-start;
}

@media (max-width: 640px) {
    .category-print-panel__head,
    .category-print-panel__cta {
        flex-direction: column;
        align-items: stretch;
    }

    .category-print-panel__meta {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 390px), (max-height: 700px) {
    .premium-banner--fintech {
        margin: 12px 0 14px;
        border-radius: 18px;
    }

    .premium-content--fintech {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 10px 12px;
    }

    .premium-badge {
        min-width: 0;
        width: fit-content;
        padding: 5px 9px;
        border-radius: 10px;
        font-size: 0.7rem;
    }

    .premium-text--fintech h3 {
        font-size: 0.92rem;
        margin-bottom: 4px;
    }

    .premium-text--fintech p {
        font-size: 0.78rem;
        line-height: 1.3;
    }

    .premium-mini-points {
        gap: 5px;
        margin-top: 6px;
    }

    .premium-mini-points span {
        min-height: 20px;
        padding: 0 8px;
        font-size: 0.68rem;
    }

    .premium-btn--fintech {
        min-height: 38px;
        padding: 8px 12px;
        border-radius: 12px;
        font-size: 0.92rem;
    }
}


/* Premium modal redesign v123 */
.premium-modal-overlay {
    padding: 14px;
}

.premium-modal-shell {
    width: min(100%, 560px);
    max-height: min(92vh, 860px);
    padding: 22px !important;
    border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
    background: linear-gradient(180deg, color-mix(in srgb, var(--card-bg) 92%, #081224), color-mix(in srgb, var(--card-bg) 98%, #040a14));
    box-shadow: 0 26px 60px rgba(0,0,0,0.45), 0 0 0 1px rgba(56,189,248,0.08) inset !important;
    overflow-x: hidden;
}

.premium-modal-header {
    margin-bottom: 16px;
}

.premium-modal-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(56,189,248,0.24);
    background: rgba(56,189,248,0.08);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-bottom: 10px;
}

.premium-modal-title {
    margin: 0 0 8px;
    color: var(--text-primary) !important;
    text-align: left !important;
    font-size: 1.5rem;
    line-height: 1.15;
}

.premium-modal-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.45;
}

.premium-modal-body {
    margin-bottom: 14px;
}

.premium-plan-comparison {
    gap: 14px;
    align-items: stretch;
}

.premium-plan-card {
    padding: 16px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
}

.premium-plan-card--free {
    background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.015));
}

.premium-plan-card--premium {
    background: linear-gradient(180deg, rgba(14,165,233,0.14), rgba(56,189,248,0.06));
}

.premium-plan-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.premium-plan-head h3 {
    margin: 0;
    text-align: left;
    font-size: 1rem;
}

.premium-plan-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.premium-plan-chip--accent {
    color: white;
    background: linear-gradient(135deg, var(--accent), #4cc9ff);
    border-color: transparent;
}

.plan.premium::before {
    display: none;
}

.premium-plan-card ul {
    margin-bottom: 0;
}

.premium-plan-card li {
    padding: 8px 0;
    font-size: 0.84rem;
    line-height: 1.35;
}

.premium-price-box {
    margin-top: 14px;
    padding: 14px 12px;
    background: rgba(4,10,20,0.45);
    border: 1px solid rgba(56,189,248,0.18);
}

.premium-trial-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px !important;
    margin-bottom: 16px !important;
    text-align: left !important;
}

.premium-trial-box h4 {
    margin: 0 0 4px !important;
}

.premium-trial-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,0.14);
    font-size: 1.1rem;
}

.premium-modal-actions {
    gap: 10px !important;
}

.premium-modal-primary,
.premium-modal-secondary,
.premium-modal-later {
    width: 100%;
}

.premium-modal-primary {
    min-height: 48px;
    font-size: 1rem !important;
}

.premium-modal-secondary {
    min-height: 44px;
}

.premium-modal-later {
    min-height: 40px;
    color: var(--accent);
}

@media (max-width: 768px) {
    .premium-modal-shell {
        width: min(100%, 520px);
        padding: 18px !important;
        border-radius: 22px;
    }

    .premium-plan-comparison {
        grid-template-columns: 1fr;
    }

    .premium-plan-card {
        padding: 14px;
    }
}

@media (max-width: 390px), (max-height: 700px) {
    .premium-modal-overlay {
        padding: 10px;
        align-items: flex-start;
    }

    .premium-modal-shell {
        width: 100%;
        max-height: calc(100vh - 20px);
        margin: 0 auto;
        padding: 16px !important;
        border-radius: 20px;
    }

    .premium-modal-kicker {
        margin-bottom: 8px;
        font-size: 0.7rem;
    }

    .premium-modal-title {
        font-size: 1.28rem;
        margin-bottom: 6px;
    }

    .premium-modal-subtitle {
        font-size: 0.86rem;
    }

    .premium-modal-header {
        margin-bottom: 12px;
    }

    .premium-modal-body {
        margin-bottom: 12px;
    }

    .premium-plan-comparison {
        gap: 10px;
    }

    .premium-plan-card {
        padding: 12px;
        border-radius: 18px;
    }

    .premium-plan-head {
        margin-bottom: 10px;
    }

    .premium-plan-head h3 {
        font-size: 0.94rem;
    }

    .premium-plan-chip {
        padding: 4px 8px;
        font-size: 0.68rem;
    }

    .premium-plan-card li {
        padding: 6px 0;
        font-size: 0.79rem;
    }

    .premium-price-box {
        margin-top: 10px;
        padding: 10px 8px;
    }

    .premium-trial-box {
        padding: 14px !important;
        gap: 10px;
        border-radius: 18px;
        margin-bottom: 12px !important;
    }

    .premium-trial-icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .premium-trial-box p {
        font-size: 0.86rem;
    }

    .premium-modal-actions {
        gap: 8px !important;
    }

    .premium-modal-primary {
        min-height: 44px;
        font-size: 0.95rem !important;
    }

    .premium-modal-secondary {
        min-height: 40px;
    }

    .premium-modal-later {
        min-height: 34px;
        font-size: 0.9rem;
        padding: 8px 12px !important;
    }

    .amount {
        font-size: 1.55rem;
    }

    .period {
        font-size: 0.82rem;
    }
}


/* Premium modal refinement v124 */
.premium-plan-card ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.premium-plan-card li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.premium-plan-card li:first-child {
    border-top: 0;
    padding-top: 0;
}

.premium-plan-card li span {
    display: block;
    color: var(--text-primary);
}

.premium-price-box {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.premium-price-box .amount {
    line-height: 1;
}

.premium-price-box .period {
    color: var(--text-secondary);
    font-weight: 600;
}

@media (max-width: 390px), (max-height: 700px) {
    .premium-plan-card li span {
        font-size: 0.8rem;
        line-height: 1.35;
    }

    .premium-price-box {
        gap: 4px;
    }
}


/* ===== PATCH v130 — voice icon restoration ===== */
.voice-btn,
.voice-fixed-btn,
.voice-status {
    position: relative;
}

.voice-btn::before,
.voice-fixed-btn::before,
.voice-status::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    background-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%252398B6FF%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M12%203a3%203%200%200%200-3%203v6a3%203%200%200%200%206%200V6a3%203%200%200%200-3-3Z%27/%3E%3Cpath%20d%3D%27M19%2010v2a7%207%200%200%201-14%200v-2%27/%3E%3Cpath%20d%3D%27M12%2019v3%27/%3E%3Cpath%20d%3D%27M8%2022h8%27/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
}

.voice-fixed-btn::before {
    width: 19px;
    height: 19px;
    flex-basis: 19px;
    background-size: 19px 19px;
}

.voice-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.voice-status::before {
    opacity: 0.92;
}

.voice-btn > span,
.voice-fixed-btn > span {
    display: inline-flex;
    align-items: center;
}



/* === v133 theme icon alignment freeze-safe patch === */
.help-text-income,
.help-text-fixed,
#assistantTitle,
#aiWidgetTitle,
#savingsTitle,
#savingsWidgetTitle,
#settingsTitle,
#csvTitle,
#categoriesSectionTitle,
#colorsTitle,
#backupLabel,
#backupBtn,
#restoreBtn,
#resetAllBtn,
#manageCategoriesBtn,
#assistantNameLabel,
#suggestion1,
#suggestion2,
#suggestion3,
#suggestion4,
#totalIncomeLabel,
#goalLabel {
    position: relative;
}

.help-text-income,
.help-text-fixed,
#assistantTitle,
#aiWidgetTitle,
#savingsTitle,
#savingsWidgetTitle,
#settingsTitle,
#csvTitle,
#categoriesSectionTitle,
#colorsTitle,
#backupLabel,
#backupBtn,
#restoreBtn,
#resetAllBtn,
#manageCategoriesBtn,
#assistantNameLabel,
#suggestion1,
#suggestion2,
#suggestion3,
#suggestion4,
#totalIncomeLabel,
#goalLabel {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

#assistantTitle::before,
#aiWidgetTitle::before,
#savingsTitle::before,
#savingsWidgetTitle::before,
#settingsTitle::before,
#csvTitle::before,
#categoriesSectionTitle::before,
#colorsTitle::before,
#backupLabel::before,
#backupBtn::before,
#restoreBtn::before,
#resetAllBtn::before,
#manageCategoriesBtn::before,
#assistantNameLabel::before,
#suggestion1::before,
#suggestion2::before,
#suggestion3::before,
#suggestion4::before,
#totalIncomeLabel::before,
#goalLabel::before,
.help-text-income::before,
.help-text-fixed::before,
.pig-emoji::before,
.input-icon-goal::before,
.input-icon-savings::before,
.ai-icon::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    background-color: var(--accent-light, #8fdcff);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    opacity: 0.95;
}

#assistantTitle::before,
#aiWidgetTitle::before,
#assistantNameLabel::before,
#suggestion2::before,
#suggestion4::before,
.ai-icon::before {
    background-color: var(--text-primary);
}

.help-text-income::before,
#totalIncomeLabel::before,
#suggestion4::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%203v18h18%22/%3E%3Cpath%20d%3D%22m19%209-5%205-4-4-3%203%22/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%203v18h18%22/%3E%3Cpath%20d%3D%22m19%209-5%205-4-4-3%203%22/%3E%3C/svg%3E");
}

.help-text-fixed::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%229%22/%3E%3Cpath%20d%3D%22M12%207v5l3%202%22/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%229%22/%3E%3Cpath%20d%3D%22M12%207v5l3%202%22/%3E%3C/svg%3E");
}

#savingsTitle::before,
#savingsWidgetTitle::before,
#goalLabel::before,
#suggestion3::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%228%22/%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%224%22/%3E%3Cpath%20d%3D%22M22%202%2012%2012%22/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%228%22/%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%224%22/%3E%3Cpath%20d%3D%22M22%202%2012%2012%22/%3E%3C/svg%3E");
}

.pig-emoji,
.input-icon,
.ai-icon {
    font-size: 0;
    line-height: 0;
}

.pig-emoji::before {
    width: 18px;
    height: 18px;
    -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M5%2013a7%207%200%200%201%207-7h1a6%206%200%200%201%206%206v1h1a2%202%200%200%201%200%204h-1a6%206%200%200%201-6%205h-3a5%205%200%200%201-5-5v-4Z%22/%3E%3Cpath%20d%3D%22M8%2011h.01%22/%3E%3Cpath%20d%3D%22M16%2010h.01%22/%3E%3Cpath%20d%3D%22M13%206V3%22/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M5%2013a7%207%200%200%201%207-7h1a6%206%200%200%201%206%206v1h1a2%202%200%200%201%200%204h-1a6%206%200%200%201-6%205h-3a5%205%200%200%201-5-5v-4Z%22/%3E%3Cpath%20d%3D%22M8%2011h.01%22/%3E%3Cpath%20d%3D%22M16%2010h.01%22/%3E%3Cpath%20d%3D%22M13%206V3%22/%3E%3C/svg%3E");
}

.input-icon-goal::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M19%207V5a2%202%200%200%200-2-2H5a2%202%200%200%200-2%202v14a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2v-2%22/%3E%3Cpath%20d%3D%22M3%207h17a1%201%200%200%201%201%201v8a1%201%200%200%201-1%201H3%22/%3E%3Cpath%20d%3D%22M16%2012h.01%22/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M19%207V5a2%202%200%200%200-2-2H5a2%202%200%200%200-2%202v14a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2v-2%22/%3E%3Cpath%20d%3D%22M3%207h17a1%201%200%200%201%201%201v8a1%201%200%200%201-1%201H3%22/%3E%3Cpath%20d%3D%22M16%2012h.01%22/%3E%3C/svg%3E");
}

.input-icon-savings::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%2022h18%22/%3E%3Cpath%20d%3D%22M6%2018V9%22/%3E%3Cpath%20d%3D%22M10%2018V9%22/%3E%3Cpath%20d%3D%22M14%2018V9%22/%3E%3Cpath%20d%3D%22M18%2018V9%22/%3E%3Cpath%20d%3D%22M12%202%203%207h18Z%22/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%2022h18%22/%3E%3Cpath%20d%3D%22M6%2018V9%22/%3E%3Cpath%20d%3D%22M10%2018V9%22/%3E%3Cpath%20d%3D%22M14%2018V9%22/%3E%3Cpath%20d%3D%22M18%2018V9%22/%3E%3Cpath%20d%3D%22M12%202%203%207h18Z%22/%3E%3C/svg%3E");
}

#assistantTitle::before,
#aiWidgetTitle::before,
#assistantNameLabel::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%208V4%22/%3E%3Cpath%20d%3D%22M8%204h8%22/%3E%3Crect%20x%3D%224%22%20y%3D%228%22%20width%3D%2216%22%20height%3D%2212%22%20rx%3D%223%22/%3E%3Cpath%20d%3D%22M9%2013h.01%22/%3E%3Cpath%20d%3D%22M15%2013h.01%22/%3E%3Cpath%20d%3D%22M9%2017h6%22/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%208V4%22/%3E%3Cpath%20d%3D%22M8%204h8%22/%3E%3Crect%20x%3D%224%22%20y%3D%228%22%20width%3D%2216%22%20height%3D%2212%22%20rx%3D%223%22/%3E%3Cpath%20d%3D%22M9%2013h.01%22/%3E%3Cpath%20d%3D%22M15%2013h.01%22/%3E%3Cpath%20d%3D%22M9%2017h6%22/%3E%3C/svg%3E");
}

#suggestion1::before,
#aiWidgetBadge::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m12%203%201.9%204.8L19%2010l-5.1%202.2L12%2017l-1.9-4.8L5%2010l5.1-2.2L12%203Z%22/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m12%203%201.9%204.8L19%2010l-5.1%202.2L12%2017l-1.9-4.8L5%2010l5.1-2.2L12%203Z%22/%3E%3C/svg%3E");
}

.ai-icon::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M9%2018h6%22/%3E%3Cpath%20d%3D%22M10%2022h4%22/%3E%3Cpath%20d%3D%22M12%202a7%207%200%200%200-4%2012c.5.4%201%201.3%201.2%202H15c.2-.7.7-1.6%201.2-2A7%207%200%200%200%2012%202Z%22/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M9%2018h6%22/%3E%3Cpath%20d%3D%22M10%2022h4%22/%3E%3Cpath%20d%3D%22M12%202a7%207%200%200%200-4%2012c.5.4%201%201.3%201.2%202H15c.2-.7.7-1.6%201.2-2A7%207%200%200%200%2012%202Z%22/%3E%3C/svg%3E");
}

#suggestion2::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m12%203%201.9%204.8L19%2010l-5.1%202.2L12%2017l-1.9-4.8L5%2010l5.1-2.2L12%203Z%22/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m12%203%201.9%204.8L19%2010l-5.1%202.2L12%2017l-1.9-4.8L5%2010l5.1-2.2L12%203Z%22/%3E%3C/svg%3E");
}

#backupLabel::before,
#backupBtn::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%203v12%22/%3E%3Cpath%20d%3D%22m7%2010%205%205%205-5%22/%3E%3Cpath%20d%3D%22M5%2021h14%22/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%203v12%22/%3E%3Cpath%20d%3D%22m7%2010%205%205%205-5%22/%3E%3Cpath%20d%3D%22M5%2021h14%22/%3E%3C/svg%3E");
}

#restoreBtn::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%2021V9%22/%3E%3Cpath%20d%3D%22m7%2014%205-5%205%205%22/%3E%3Cpath%20d%3D%22M5%203h14%22/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%2021V9%22/%3E%3Cpath%20d%3D%22m7%2014%205-5%205%205%22/%3E%3Cpath%20d%3D%22M5%203h14%22/%3E%3C/svg%3E");
}

#resetAllBtn::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M21%2012a9%209%200%201%201-2.6-6.4%22/%3E%3Cpath%20d%3D%22M21%203v6h-6%22/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M21%2012a9%209%200%201%201-2.6-6.4%22/%3E%3Cpath%20d%3D%22M21%203v6h-6%22/%3E%3C/svg%3E");
}

#settingsTitle::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%2015.5A3.5%203.5%200%201%200%2012%208.5a3.5%203.5%200%200%200%200%207.0Z%22/%3E%3Cpath%20d%3D%22M19.4%2015a1.7%201.7%200%200%200%20.3%201.9l.1.1a2%202%200%201%201-2.8%202.8l-.1-.1a1.7%201.7%200%200%200-1.9-.3%201.7%201.7%200%200%200-1%201.5V21a2%202%200%201%201-4%200v-.2a1.7%201.7%200%200%200-1-1.5%201.7%201.7%200%200%200-1.9.3l-.1.1a2%202%200%201%201-2.8-2.8l.1-.1a1.7%201.7%200%200%200%20.3-1.9%201.7%201.7%200%200%200-1.5-1H3a2%202%200%201%201%200-4h.2a1.7%201.7%200%200%200%201.5-1%201.7%201.7%200%200%200-.3-1.9l-.1-.1a2%202%200%201%201%202.8-2.8l.1.1a1.7%201.7%200%200%200%201.9.3%201.7%201.7%200%200%200%201-1.5V3a2%202%200%201%201%204%200v.2a1.7%201.7%200%200%200%201%201.5%201.7%201.7%200%200%200%201.9-.3l.1-.1a2%202%200%201%201%202.8%202.8l-.1.1a1.7%201.7%200%200%200-.3%201.9%201.7%201.7%200%200%200%201.5%201H21a2%202%200%201%201%200%204h-.2a1.7%201.7%200%200%200-1.4%201Z%22/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%2015.5A3.5%203.5%200%201%200%2012%208.5a3.5%203.5%200%200%200%200%207.0Z%22/%3E%3Cpath%20d%3D%22M19.4%2015a1.7%201.7%200%200%200%20.3%201.9l.1.1a2%202%200%201%201-2.8%202.8l-.1-.1a1.7%201.7%200%200%200-1.9-.3%201.7%201.7%200%200%200-1%201.5V21a2%202%200%201%201-4%200v-.2a1.7%201.7%200%200%200-1-1.5%201.7%201.7%200%200%200-1.9.3l-.1.1a2%202%200%201%201-2.8-2.8l.1-.1a1.7%201.7%200%200%200%20.3-1.9%201.7%201.7%200%200%200-1.5-1H3a2%202%200%201%201%200-4h.2a1.7%201.7%200%200%200%201.5-1%201.7%201.7%200%200%200-.3-1.9l-.1-.1a2%202%200%201%201%202.8-2.8l.1.1a1.7%201.7%200%200%200%201.9.3%201.7%201.7%200%200%200%201-1.5V3a2%202%200%201%201%204%200v.2a1.7%201.7%200%200%200%201%201.5%201.7%201.7%200%200%200%201.9-.3l.1-.1a2%202%200%201%201%202.8%202.8l-.1.1a1.7%201.7%200%200%200-.3%201.9%201.7%201.7%200%200%200%201.5%201H21a2%202%200%201%201%200%204h-.2a1.7%201.7%200%200%200-1.4%201Z%22/%3E%3C/svg%3E");
}

#csvTitle::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%203v12%22/%3E%3Cpath%20d%3D%22m7%2010%205%205%205-5%22/%3E%3Cpath%20d%3D%22M5%2021h14%22/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%203v12%22/%3E%3Cpath%20d%3D%22m7%2010%205%205%205-5%22/%3E%3Cpath%20d%3D%22M5%2021h14%22/%3E%3C/svg%3E");
}

#categoriesSectionTitle::before,
#manageCategoriesBtn::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%207a2%202%200%200%201%202-2h4l2%202h8a2%202%200%200%201%202%202v8a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2Z%22/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%207a2%202%200%200%201%202-2h4l2%202h8a2%202%200%200%201%202%202v8a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2Z%22/%3E%3C/svg%3E");
}

#colorsTitle::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%203a9%209%200%201%200%200%2018h1.5a2.5%202.5%200%201%200%200-5H12a2%202%200%201%201%200-4h4a5%205%200%200%200%200-10Z%22/%3E%3Cpath%20d%3D%22M7.5%2010h.01%22/%3E%3Cpath%20d%3D%22M12%207h.01%22/%3E%3Cpath%20d%3D%22M16.5%2010h.01%22/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%203a9%209%200%201%200%200%2018h1.5a2.5%202.5%200%201%200%200-5H12a2%202%200%201%201%200-4h4a5%205%200%200%200%200-10Z%22/%3E%3Cpath%20d%3D%22M7.5%2010h.01%22/%3E%3Cpath%20d%3D%22M12%207h.01%22/%3E%3Cpath%20d%3D%22M16.5%2010h.01%22/%3E%3C/svg%3E");
}

#aiWidgetBadge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(18, 31, 53, 0.9);
    border: 1px solid rgba(96, 165, 250, 0.22);
    color: var(--text-primary);
    box-shadow: none;
}

#suggestion1,
#suggestion2,
#suggestion3,
#suggestion4 {
    border-radius: 12px;
}

#manageCategoriesBtn,
#backupBtn,
#restoreBtn,
#resetAllBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#fixedHelp,
.help-text-income {
    color: var(--text-secondary);
}

#searchCategory option {
    font-family: inherit;
}


/* ===== PATCH v137 — premium modal theme lock ===== */
.premium-modal-shell {
    border-color: rgba(96,165,250,0.22) !important;
    background: linear-gradient(180deg, #121F35 0%, #0F1A2D 100%) !important;
    box-shadow: 0 22px 60px rgba(0,0,0,0.52), 0 0 0 1px rgba(59,130,246,0.10) inset !important;
}

.premium-modal-kicker {
    border-color: rgba(96,165,250,0.25) !important;
    background: rgba(59,130,246,0.12) !important;
    color: #93C5FD !important;
}

.premium-modal-title,
.premium-plan-head h3,
.premium-plan-card li span,
.premium-price-box .amount {
    color: #E6EDF6 !important;
}

.premium-modal-subtitle,
.premium-price-box .period {
    color: #9FB3C8 !important;
}

.premium-plan-card {
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 18px;
    background: #121F35 !important;
}

.premium-plan-card--free {
    background: linear-gradient(180deg, rgba(18,31,53,0.92), rgba(11,18,32,0.98)) !important;
}

.premium-plan-card--premium {
    background: linear-gradient(180deg, rgba(24,41,68,0.98), rgba(18,31,53,1)) !important;
    border-color: rgba(59,130,246,0.48) !important;
    box-shadow: 0 0 0 1px rgba(59,130,246,0.10) inset;
}

.premium-plan-chip {
    background: rgba(255,255,255,0.04) !important;
    color: #9FB3C8 !important;
    border-color: rgba(255,255,255,0.08) !important;
}

.premium-plan-chip--accent {
    background: rgba(59,130,246,0.18) !important;
    color: #E6EDF6 !important;
    border: 1px solid rgba(59,130,246,0.35) !important;
}

.premium-plan-card li {
    position: relative;
    padding: 10px 0 10px 28px !important;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.premium-plan-card li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 14px 14px;
}

.premium-plan-card li.feature-enabled::before {
    background-color: rgba(34,197,94,0.18);
    border: 1px solid rgba(34,197,94,0.35);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322C55E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6 9 17l-5-5'/></svg>");
}

.premium-plan-card li.feature-disabled::before {
    background-color: rgba(239,68,68,0.16);
    border: 1px solid rgba(239,68,68,0.32);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23EF4444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M18 6 6 18'/><path d='m6 6 12 12'/></svg>");
}

.premium-price-box {
    background: rgba(11,18,32,0.72) !important;
    border: 1px solid rgba(59,130,246,0.20) !important;
    border-radius: 16px !important;
}

.premium-trial-box {
    background: linear-gradient(135deg, rgba(59,130,246,0.20), rgba(96,165,250,0.16)) !important;
    border: 1px solid rgba(59,130,246,0.24);
    border-radius: 16px !important;
}

.premium-trial-icon {
    background: rgba(255,255,255,0.08) !important;
    border: 1px solid rgba(255,255,255,0.08);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E6EDF6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='8' width='18' height='13' rx='2'/><path d='M12 8v13'/><path d='M19 8v-.8A2.2 2.2 0 0 0 16.8 5 2.2 2.2 0 0 0 12 7.2V8'/><path d='M5 8v-.8A2.2 2.2 0 0 1 7.2 5 2.2 2.2 0 0 1 12 7.2'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
    color: transparent !important;
}

.premium-modal-primary,
.premium-modal-secondary,
.premium-modal-later {
    border-radius: 12px !important;
}

.premium-modal-primary {
    background: linear-gradient(135deg, #3B82F6, #60A5FA) !important;
    border: 1px solid rgba(147,197,253,0.22) !important;
    box-shadow: 0 8px 18px rgba(59,130,246,0.18);
}

.premium-modal-secondary {
    background: #182944 !important;
    color: #E6EDF6 !important;
    border: 1px solid rgba(96,165,250,0.25) !important;
}

.premium-modal-later {
    background: transparent !important;
    color: #60A5FA !important;
    border: 0 !important;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.premium-modal-title::before,
.premium-plan-card--premium .premium-plan-head h3::before,
.premium-plan-card--free .premium-plan-head h3::before,
.premium-modal-primary::before,
.premium-modal-secondary::before,
.premium-modal-later::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    vertical-align: -2px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.premium-modal-title::before,
.premium-modal-primary::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2360A5FA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4.5 16.5c-1.5 1.5-2 4-2 4s2.5-.5 4-2c.8-.8 1.2-1.8 1.2-2.8l4.3-4.3c1 .4 2.3.2 3.1-.6l4.8-4.8c.4-.4.4-1 0-1.4l-1.3-1.3c-.4-.4-1-.4-1.4 0l-4.8 4.8c-.8.8-1 2.1-.6 3.1l-4.3 4.3c-1 0-2 .4-2.8 1.2Z'/><path d='m9 15 3 3'/><path d='M15 6 18 9'/></svg>");
}

.premium-plan-card--premium .premium-plan-head h3::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2360A5FA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 3 6 7 6-7 3 6-9 12L3 9l3-6Z'/></svg>");
}

.premium-plan-card--free .premium-plan-head h3::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239FB3C8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M19 7V4a1 1 0 0 0-1-1H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h13a1 1 0 0 0 1-1v-3'/><path d='M3 7h17'/><path d='M16 16h.01'/></svg>");
}

.premium-modal-secondary::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E6EDF6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='7.5' cy='15.5' r='1.5'/><circle cx='16.5' cy='8.5' r='1.5'/><path d='m12 12 3-3'/><path d='M7 15h2a2 2 0 0 0 2-2V9a2 2 0 0 1 2-2h4'/></svg>");
}

.premium-modal-later::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2360A5FA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M18 6 6 18'/><path d='m6 6 12 12'/></svg>");
}

@media (max-width: 390px), (max-height: 700px) {
    .premium-plan-card li { padding-left: 26px !important; }
}


/* STEP v141 - Analisi grafici fintech compact */
.analysis-chart-card {
    border: 1px solid rgba(59, 130, 246, 0.14);
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(18, 31, 53, 0.96), rgba(11, 18, 32, 0.98));
    box-shadow: 0 14px 32px rgba(2, 6, 23, 0.18);
}

.analysis-chart-card .section-content {
    padding-top: 10px;
}

.analysis-chart-card .chart-container {
    width: 100%;
    max-width: none;
    min-height: 224px;
    margin: 0 auto 10px;
}

.analysis-chart-card--donut .chart-container {
    max-width: 286px;
    height: 286px;
    min-height: 220px;
}

.analysis-chart-card--bars .chart-container,
.analysis-chart-card--trend .chart-container {
    height: 214px;
    min-height: 214px;
}

.chart-legend {
    justify-content: flex-start;
    gap: 8px;
    margin: 10px 0 0;
}

.chart-legend-item {
    flex: 1 1 208px;
    min-height: 40px;
    padding: 9px 11px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(18, 31, 53, 0.78);
    backdrop-filter: blur(8px);
}

.chart-legend-dot {
    width: 10px;
    height: 10px;
    box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.08);
}

.chart-legend-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.chart-legend-value {
    font-size: 0.76rem;
    white-space: nowrap;
}

.chart-note {
    padding: 8px 4px 0;
    font-size: 0.86rem;
}

#balanceChartCard .chart-container {
    min-height: 214px;
}

.bar-chart-container canvas {
    width: 100% !important;
    height: 214px !important;
    max-height: none;
}

#monthlyBalanceChartCard .chart-container {
    min-height: 214px;
}

@media (max-width: 768px) {
    .analysis-chart-card--donut .chart-container {
        max-width: 248px;
        height: 248px;
        min-height: 248px;
    }

    .analysis-chart-card--bars .chart-container,
    .analysis-chart-card--trend .chart-container,
    #balanceChartCard .chart-container,
    #monthlyBalanceChartCard .chart-container {
        height: 206px;
        min-height: 206px;
    }

    .bar-chart-container canvas {
        height: 206px !important;
    }

    .chart-legend-item {
        flex-basis: 100%;
        padding: 9px 10px;
    }

    .chart-legend-value {
        font-size: 0.74rem;
    }
}


/* ===== BudgetKedrix UI Polish v143 ===== */

/* Standard card radius fintech */
.card, .bw-card, .panel, .widget {
    border-radius: 10px !important;
    padding: 16px !important;
}

/* Financial primary numbers */
.balance,
.total-amount,
.main-amount,
.bw-forecast-value {
    font-size: 34px !important;
    font-weight: 600 !important;
    letter-spacing: -0.5px;
}

/* Secondary financial numbers */
.stat-number,
.metric-value {
    font-size: 16px;
}

/* Slider fintech style */
input[type="range"] {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 4px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

/* Forecast card grid */
.bw-forecast-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    margin-top: 10px;
    font-size: 14px;
}

/* Risk colors */
.bw-forecast-risk.green { color: var(--success); }
.bw-forecast-risk.warning { color: var(--warning); }
.bw-forecast-risk.danger { color: var(--danger); }



/* ===== BudgetKedrix visual coherence audit patch v144 ===== */
:root {
    --bw-radius-sm: 10px;
    --bw-radius-md: 14px;
    --bw-radius-lg: 18px;
    --bw-space: 16px;
}

.header h1,
.section-header h2,
.section-header h3,
#wiseForecastTitle,
#wiseScoreHomeTitle,
#incomesTitle,
#fixedTitle,
#variableTitle,
#chartTitle,
#calendarToolsTitle {
    letter-spacing: -0.02em;
}

.section-card,
.summary-card,
.guide-message,
.modal-content,
.report-modal-content,
.forecast-card,
.home-quick-card {
    border-radius: var(--bw-radius-lg) !important;
    padding: var(--bw-space) !important;
}

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-link,
.btn-text,
.premium-btn,
.voice-btn,
.home-voice-btn,
.home-manual-btn,
.tab-btn,
.theme-btn,
.privacy-toggle-btn,
input,
select,
textarea {
    border-radius: var(--bw-radius-sm) !important;
}

.btn-primary,
.btn-secondary,
.btn-danger,
.premium-btn,
.home-manual-btn,
.voice-btn,
.home-voice-btn {
    min-height: 48px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.voice-btn,
.home-voice-btn {
    min-width: 0 !important;
    width: 100%;
    padding: 14px 18px !important;
    background: linear-gradient(135deg, rgba(2,132,199,0.95), rgba(56,189,248,0.92)) !important;
    box-shadow: 0 10px 24px rgba(14,165,233,0.18) !important;
}

.home-manual-btn,
.btn-secondary {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
}

.tab-bar {
    gap: 8px;
    padding: 10px;
    border-radius: var(--bw-radius-lg);
}

.tab-btn {
    font-size: 0.9rem;
    padding: 10px 12px !important;
    min-height: 42px;
}

.tab-btn.active,
[data-theme="dark"] .tab-btn.active {
    background: rgba(56,189,248,0.16) !important;
    color: var(--text-primary) !important;
    border-color: rgba(56,189,248,0.35) !important;
}

.theme-btn {
    min-width: 64px;
    font-size: 0.8rem;
}

.status-icon:empty {
    display: none;
}

.forecast-status,
.wise-score-status,
.voice-status {
    font-weight: 600;
}

.search-prefix {
    position: absolute;
    left: 12px;
    top: 50%;
    width: 14px;
    height: 14px;
    transform: translateY(-50%);
    border: 2px solid var(--text-secondary);
    border-radius: 999px;
    opacity: 0.7;
}
.search-prefix::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 2px;
    background: var(--text-secondary);
    right: -4px;
    bottom: -2px;
    transform: rotate(45deg);
    border-radius: 2px;
    opacity: 0.7;
}

.premium-badge::before {
    content: '';
}

body .voice-btn::before,
body .home-voice-btn::before {
    content: '' !important;
}

@media (max-width: 520px) {
    .tab-bar {
        overflow-x: auto;
        scrollbar-width: none;
    }
    .tab-bar::-webkit-scrollbar {
        display: none;
    }
    .tab-btn {
        white-space: nowrap;
    }
}


/* === v148 theme alignment: categories / secondary controls === */
#categoryManagerOverlay .modal-content {
  background: linear-gradient(180deg, color-mix(in srgb, var(--card-bg) 94%, #081224 6%), color-mix(in srgb, var(--card-bg) 98%, #040814 2%));
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--border));
  box-shadow: 0 20px 48px rgba(0,0,0,0.34), 0 0 0 1px rgba(255,255,255,0.02) inset;
}

#categoryManagerOverlay h3,
#categoryManagerOverlay h4 {
  letter-spacing: -0.01em;
}

#categoryManagerOverlay h4 {
  margin-top: 18px;
  margin-bottom: 10px;
  color: color-mix(in srgb, var(--text-secondary) 84%, var(--text-primary));
  font-size: 0.95rem;
}

.categories-list {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 86%, transparent), color-mix(in srgb, var(--card-bg) 94%, transparent));
  border: 1px solid color-mix(in srgb, var(--border) 88%, var(--accent) 12%);
  border-radius: 16px;
  padding: 8px;
}

.category-item {
  background: linear-gradient(180deg, color-mix(in srgb, var(--card-bg) 98%, transparent), color-mix(in srgb, var(--surface-2) 100%, transparent));
  border: 1px solid color-mix(in srgb, var(--border) 90%, var(--accent) 10%);
  border-radius: 14px;
  padding: 10px 12px;
  margin: 6px 0;
  gap: 10px;
}

.category-item:hover {
  transform: translateX(2px);
  border-color: color-mix(in srgb, var(--accent) 26%, var(--border));
  box-shadow: 0 10px 22px rgba(0,0,0,0.16);
}

.category-item.default {
  border-left: 3px solid color-mix(in srgb, var(--accent) 88%, #93c5fd 12%);
}

.category-item.custom {
  border-left: 3px solid color-mix(in srgb, var(--success) 88%, #bbf7d0 12%);
}

.category-item button {
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--text-secondary);
}

.category-item button:hover {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--surface-2) 82%, transparent);
  transform: scale(1.04);
}

#newCategoryName,
#expenseCategory,
#searchCategory,
#csvDelimiter,
#csvSeparator,
#excelSheet,
#excelHeaderRow,
#languageSelect {
  border-color: color-mix(in srgb, var(--border) 84%, var(--accent) 16%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--card-bg) 98%, transparent), color-mix(in srgb, var(--surface-2) 100%, transparent));
}

#expenseCategory:hover,
#searchCategory:hover,
#csvDelimiter:hover,
#csvSeparator:hover,
#excelSheet:hover,
#excelHeaderRow:hover,
#languageSelect:hover {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}

#expenseCategory:focus,
#searchCategory:focus,
#csvDelimiter:focus,
#csvSeparator:focus,
#excelSheet:focus,
#excelHeaderRow:focus,
#languageSelect:focus,
#newCategoryName:focus {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}

.suggestion-chip,
.expense-link-badge {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#searchCategory,
#expenseCategory {
  font-weight: 600;
}

@media (max-width: 768px) {
  #categoryManagerOverlay .modal-content {
    padding: 18px;
    border-radius: 20px;
  }

  .category-item {
    padding: 10px 10px;
  }

  .category-item button {
    min-width: 32px;
    min-height: 32px;
  }
}


/* ===== PATCH v149 — final visual QA (Home + Analisi + Premium) ===== */
.home-hero-card {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(79,124,255,0.18), transparent 38%),
        linear-gradient(180deg, rgba(17,24,39,0.98) 0%, rgba(10,14,24,0.98) 100%);
}

.home-hero-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.02), transparent 45%);
    pointer-events: none;
}

.home-hero-card .hero-card-header,
.home-hero-card .hero-main,
.home-hero-card .hero-meta-grid {
    position: relative;
    z-index: 1;
}

.home-hero-card .hero-main {
    margin: 8px 0 18px;
    text-shadow: 0 0 22px rgba(79,124,255,0.14);
}

.home-hero-card .hero-meta-card {
    min-height: 92px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.home-hero-card .hero-meta-card:first-child {
    border-color: rgba(79,124,255,0.24);
    background: linear-gradient(180deg, rgba(79,124,255,0.09), rgba(255,255,255,0.03));
}

.home-hero-card .hero-meta-value {
    letter-spacing: -0.02em;
}

#wiseForecastCard,
#wiseScoreHomeCard,
.analysis-savings-card {
    position: relative;
    overflow: hidden;
}

#wiseForecastCard::before,
#wiseScoreHomeCard::before,
.analysis-savings-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, rgba(79,124,255,0), rgba(79,124,255,0.28), rgba(79,124,255,0));
    pointer-events: none;
}

.forecast-card .section-header,
.home-score-card .section-header {
    margin-bottom: 4px;
}

.forecast-main-card {
    background: linear-gradient(180deg, rgba(15,23,42,0.92), rgba(11,18,32,0.96));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.forecast-side-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(180deg, rgba(11,18,32,0.9), rgba(15,23,42,0.88));
}

.forecast-value,
.wise-score-value {
    letter-spacing: -0.03em;
}

.wise-score-ring {
    box-shadow: 0 10px 24px rgba(0,0,0,0.26), inset 0 0 0 1px rgba(255,255,255,0.03);
}

.wise-pillars {
    padding: 14px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.028), rgba(255,255,255,0.015));
    border: 1px solid rgba(255,255,255,0.05);
}

.analysis-savings-card {
    background:
        radial-gradient(circle at top right, rgba(79,124,255,0.10), transparent 34%),
        linear-gradient(180deg, color-mix(in srgb, var(--card-bg) 98%, #0b1220), color-mix(in srgb, var(--card-bg) 96%, #08111f));
}

.analysis-savings-card > #savingsTitle {
    margin-bottom: 12px;
}

.analysis-savings-card .savings-widget {
    border: 1px solid rgba(79,124,255,0.10);
    background: linear-gradient(180deg, rgba(255,255,255,0.022), rgba(255,255,255,0.012));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.025);
}

.analysis-savings-card .widget-header {
    align-items: center;
    margin-bottom: 16px;
}

.analysis-savings-card .interactive-controls {
    gap: 14px;
}

.analysis-savings-card .slider-container,
.analysis-savings-card .goal-input-container,
.analysis-savings-card .initial-savings-container {
    padding: 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.05);
}

.analysis-savings-card .savings-insights {
    gap: 12px;
}

.analysis-savings-card .savings-message,
.analysis-savings-card .savings-tip {
    border-radius: 14px;
}

.premium-modal-shell {
    background:
        radial-gradient(circle at top right, rgba(59,130,246,0.14), transparent 36%),
        linear-gradient(180deg, #121F35 0%, #0F1A2D 100%) !important;
}

.premium-modal-header {
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.premium-plan-comparison {
    margin-top: 2px;
}

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

.premium-price-box {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
}

.premium-modal-actions {
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

@media (max-width: 760px) {
    .home-hero-card .hero-meta-grid {
        grid-template-columns: 1fr;
    }

    .home-hero-card .hero-meta-card {
        min-height: 82px;
    }

    .wise-score-main {
        align-items: flex-start;
    }

    .analysis-savings-card .slider-container,
    .analysis-savings-card .goal-input-container,
    .analysis-savings-card .initial-savings-container {
        padding: 12px;
    }
}


/* ===== PATCH v150 — beta freeze QA (visual consistency + touch safety) ===== */
:root {
    --bw-focus-ring: 0 0 0 3px rgba(79,124,255,0.18);
}

.section-card,
.summary-card,
.home-hero-card,
.hero-meta-card,
.forecast-main-card,
.forecast-side-card,
.wise-score-main,
.wise-pillars,
.premium-modal-shell,
.premium-plan-card,
.analysis-savings-card,
.analysis-chart-card,
.category-item,
.modal-content {
    min-width: 0;
}

.section-header,
.hero-card-header,
.premium-modal-header,
.widget-header {
    gap: 10px;
}

.section-header h2,
.hero-main,
.forecast-value,
.forecast-side-value,
.wise-score-value,
.premium-modal-title,
.premium-text h3,
.premium-plan-head h3,
#savingsTitle,
#wiseForecastTitle,
#wiseScoreHomeTitle {
    overflow-wrap: anywhere;
}

button,
select,
input,
textarea,
.analysis-inline-btn,
.home-voice-btn,
.home-manual-btn,
.premium-btn,
#manageCategoriesBtn,
#backupBtn,
#restoreBtn,
#resetAllBtn {
    -webkit-tap-highlight-color: transparent;
}

button:not(.tab-btn),
select,
input,
textarea,
.analysis-inline-btn,
.home-voice-btn,
.home-manual-btn,
.premium-btn {
    min-height: 42px;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
.analysis-inline-btn:focus-visible,
.home-voice-btn:focus-visible,
.home-manual-btn:focus-visible,
.premium-btn:focus-visible,
.tab-btn:focus-visible {
    outline: none;
    box-shadow: var(--bw-focus-ring);
}

.hero-meta-grid,
.forecast-grid,
.premium-plan-comparison,
.home-quick-actions,
.action-grid,
.button-group,
.filters-row {
    align-items: stretch;
}

.hero-meta-card,
.forecast-main-card,
.forecast-side-card,
.wise-pillar-row,
.premium-plan-card,
.category-item {
    backface-visibility: hidden;
    transform: translateZ(0);
}

.home-hero-card .hero-meta-card,
.forecast-main-card,
.forecast-side-card,
.wise-pillars,
.analysis-savings-card .savings-widget,
.premium-plan-card {
    border-color: rgba(255,255,255,0.065);
}

.premium-modal-actions,
.home-quick-actions,
.button-group {
    row-gap: 10px;
}

.tab-bar {
    backdrop-filter: blur(16px);
}

@media (max-width: 760px) {
    .section-card,
    .summary-card {
        scroll-margin-top: 84px;
    }

    .premium-modal-actions,
    .home-quick-actions,
    .button-group {
        grid-template-columns: 1fr;
    }

    .premium-modal-shell {
        max-height: min(88vh, 880px);
    }

    .section-header,
    .hero-card-header,
    .premium-modal-header,
    .widget-header {
        gap: 8px;
    }
}


/* ===== STEP 12 — home hierarchy correction ===== */
.home-quick-card[data-tab="home"] {
    background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.015));
    border-color: rgba(255,255,255,0.06) !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

.home-quick-card[data-tab="home"] .section-header h2 {
    font-size: 1.08rem;
    color: var(--text-secondary);
}

.home-quick-card[data-tab="home"] .voice-status {
    background: rgba(255,255,255,0.035);
}


/* ===== STEP 13 — analysis chart / category export visual polish ===== */
.analysis-chart-card {
    position: relative;
    overflow: hidden;
}

.analysis-chart-card::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255,255,255,0.018), transparent 42%);
    opacity: 0.9;
}

.analysis-chart-card > h2,
.analysis-chart-card > .section-content {
    position: relative;
    z-index: 1;
}

.analysis-chart-card .section-content {
    gap: 12px;
}

.analysis-chart-card .chart-container {
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(11,18,32,0.72), rgba(15,23,42,0.42));
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.025);
    padding: 8px;
}

.analysis-chart-card--donut .chart-container {
    padding: 10px;
}

.analysis-chart-actions {
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 12px 0 4px;
}

.analysis-inline-btn {
    min-height: 40px;
    padding-inline: 14px;
    border-radius: 12px;
    border-color: rgba(255,255,255,0.07);
    background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.018));
    box-shadow: 0 8px 20px rgba(0,0,0,0.16);
}

.analysis-inline-btn:hover {
    border-color: rgba(79,124,255,0.26);
    box-shadow: 0 10px 22px rgba(0,0,0,0.20);
}

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

.chart-legend-item {
    border-color: rgba(255,255,255,0.07);
    box-shadow: 0 8px 18px rgba(0,0,0,0.14);
}

.chart-legend-item:hover,
.chart-legend-item:focus-visible {
    border-color: rgba(79,124,255,0.22);
    transform: translateY(-1px);
}

.chart-note,
#monthlyBalanceEmpty {
    margin-top: 2px;
    padding: 10px 12px 0;
    color: color-mix(in srgb, var(--text-secondary) 92%, #dbeafe 8%);
}

.category-print-panel {
    position: relative;
    overflow: hidden;
    margin-top: 14px;
    padding: 16px;
    border-color: rgba(79,124,255,0.22);
    background:
        radial-gradient(circle at top right, rgba(79,124,255,0.10), transparent 34%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.94) 0%, rgba(10, 18, 33, 0.99) 100%);
    box-shadow: 0 14px 32px rgba(2, 6, 23, 0.28), inset 0 1px 0 rgba(255,255,255,0.025);
}

.category-print-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 18px;
    right: 18px;
    height: 1px;
    background: linear-gradient(90deg, rgba(79,124,255,0), rgba(79,124,255,0.34), rgba(79,124,255,0));
}

.category-print-panel__head {
    margin-bottom: 14px;
}

.category-print-panel h3 {
    letter-spacing: -0.02em;
}

.category-print-panel__meta {
    gap: 12px;
}

.category-print-kpi {
    border-color: rgba(255,255,255,0.07);
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.018));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.025);
}

.category-print-kpi strong {
    letter-spacing: -0.02em;
}

.category-print-panel__cta .btn-primary {
    min-height: 42px;
    box-shadow: 0 12px 26px rgba(37,99,235,0.20);
}

#balanceChartCard .chart-container,
#monthlyBalanceChartCard .chart-container {
    padding: 10px 12px 6px;
}

@media (max-width: 768px) {
    .analysis-chart-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .analysis-inline-btn,
    .category-print-panel__cta .btn-primary {
        width: 100%;
    }

    .chart-note,
    #monthlyBalanceEmpty {
        padding-inline: 4px;
    }

    .category-print-panel {
        padding: 14px;
        border-radius: 16px;
    }
}

/* ===== STEP 14 — tools surfaces + technical modal consistency ===== */
.tools-surface-card {
    position: relative;
    overflow: hidden;
    border-color: rgba(255,255,255,0.065);
    background:
        radial-gradient(circle at top right, rgba(79,124,255,0.075), transparent 30%),
        linear-gradient(180deg, rgba(17,24,39,0.96), rgba(10,15,26,0.985));
    box-shadow:
        0 14px 30px rgba(2,6,23,0.22),
        inset 0 1px 0 rgba(255,255,255,0.03);
}

.tools-surface-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 18px;
    right: 18px;
    height: 1px;
    background: linear-gradient(90deg, rgba(79,124,255,0), rgba(79,124,255,0.24), rgba(79,124,255,0));
    pointer-events: none;
}

.tools-surface-card > h2,
.tools-surface-card > .section-content {
    position: relative;
    z-index: 1;
}

.tools-surface-card .section-content {
    gap: 14px;
}

.tools-surface-card .chart-note,
.tools-surface-card .subtitle {
    padding: 0;
    margin-top: 0;
    color: color-mix(in srgb, var(--text-secondary) 94%, #dbeafe 6%);
}

.tools-surface-card .button-group,
.tools-surface-card .import-actions {
    align-items: stretch;
    gap: 10px;
}

.tools-surface-card .btn-secondary,
.tools-surface-card .btn-link {
    min-height: 42px;
}

.tools-surface-card select,
.tools-surface-card input[type="number"],
.tools-surface-card input[type="text"],
.tools-surface-card input[type="email"] {
    border-color: rgba(255,255,255,0.07);
    background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.02));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.018);
}

.tools-import-card .file-name,
.tools-import-card #csvMappingStatus {
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.065);
    background: rgba(255,255,255,0.028);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

.tools-import-card .import-advanced {
    border-color: rgba(79,124,255,0.14);
    background:
        radial-gradient(circle at top right, rgba(79,124,255,0.06), transparent 26%),
        linear-gradient(180deg, rgba(255,255,255,0.028), rgba(255,255,255,0.015));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

.tools-report-card .button-group,
.tools-calendar-card .button-group {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.tools-settings-card .setting-item {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.055);
    background: linear-gradient(180deg, rgba(255,255,255,0.026), rgba(255,255,255,0.012));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

.tools-settings-card .setting-item + .setting-item {
    margin-top: 10px;
}

.tools-settings-card .setting-item label {
    margin-bottom: 8px;
}

.modal-overlay-upgraded {
    padding: clamp(16px, 3vw, 28px);
}

.license-modal-card,
.import-review-card,
.csv-mapping-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.065);
    background:
        radial-gradient(circle at top right, rgba(79,124,255,0.085), transparent 32%),
        linear-gradient(180deg, rgba(17,24,39,0.985), rgba(10,15,26,0.99));
    box-shadow:
        0 22px 48px rgba(0,0,0,0.34),
        0 0 0 1px rgba(255,255,255,0.015) inset;
}

.license-modal-card::before,
.import-review-card::before,
.csv-mapping-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 1px;
    background: linear-gradient(90deg, rgba(79,124,255,0), rgba(79,124,255,0.3), rgba(79,124,255,0));
    pointer-events: none;
}

.license-modal-card > *,
.import-review-card > *,
.csv-mapping-card > * {
    position: relative;
    z-index: 1;
}

.license-modal-card input,
.csv-mapping-card select,
.import-review-card select {
    border-color: rgba(255,255,255,0.075);
    background: linear-gradient(180deg, rgba(255,255,255,0.038), rgba(255,255,255,0.018));
}

.csv-mapping-card table {
    background: rgba(7,12,22,0.42);
}

.csv-mapping-card th,
.csv-mapping-card td {
    white-space: normal;
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    .tools-surface-card .button-group,
    .tools-surface-card .import-actions,
    .tools-report-card .button-group,
    .tools-calendar-card .button-group {
        grid-template-columns: 1fr;
    }

    .tools-settings-card .setting-item {
        padding: 13px 14px;
    }

    .license-modal-card,
    .import-review-card,
    .csv-mapping-card {
        padding: 22px !important;
        border-radius: 22px !important;
        width: min(100%, 96vw) !important;
    }
}


/* ===== STEP 15 — empty states + premium micro-details ===== */
.empty-message,
.chart-note,
#monthlyBalanceEmpty {
    position: relative;
    border-radius: 16px;
}

.empty-message,
#monthlyBalanceEmpty,
.tools-surface-card .chart-note,
.tools-import-card .file-name,
.tools-import-card #csvMappingStatus {
    border: 1px dashed rgba(125, 211, 252, 0.14);
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.06), transparent 36%),
        linear-gradient(180deg, rgba(255,255,255,0.028), rgba(255,255,255,0.014));
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.024),
        0 10px 24px rgba(2, 6, 23, 0.12);
}

.empty-message,
.chart-note,
#monthlyBalanceEmpty {
    color: color-mix(in srgb, var(--text-secondary) 88%, #e0f2fe 12%);
    line-height: 1.5;
}

.empty-message {
    margin-top: 8px;
    padding: 16px 18px;
}

.chart-note,
#monthlyBalanceEmpty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    text-align: center;
}

.chart-note::before,
#monthlyBalanceEmpty::before,
.empty-message::before {
    content: '✦';
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--accent-light);
    background: rgba(56, 189, 248, 0.10);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

#monthlyBalanceEmpty {
    margin-top: 12px;
    padding: 16px 18px;
}

.tools-import-card .file-name,
.tools-import-card #csvMappingStatus {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 14px;
    text-align: center;
    color: color-mix(in srgb, var(--text-secondary) 90%, #e0f2fe 10%);
}

.tools-import-card .file-name {
    font-weight: 500;
}

.tools-import-card .file-name::before,
.tools-import-card #csvMappingStatus::before {
    content: '•';
    color: var(--accent-light);
    margin-right: 8px;
    font-size: 1rem;
}

.section-card > h2,
.premium-modal-shell h2,
.modal-content h2 {
    letter-spacing: -0.02em;
}

.section-card .button-group .btn-secondary,
.section-card .button-group .btn-link,
.modal-content .btn-secondary {
    backdrop-filter: blur(8px);
}

@media (max-width: 768px) {
    .chart-note,
    #monthlyBalanceEmpty,
    .empty-message,
    .tools-import-card .file-name,
    .tools-import-card #csvMappingStatus {
        min-height: 0;
        padding: 14px;
        border-radius: 14px;
    }

    .chart-note,
    #monthlyBalanceEmpty {
        flex-direction: column;
        gap: 8px;
    }
}

/* STEP 16 — final mobile density & spacing pass */
@media (max-width: 768px) {
    .section-card,
    .summary-card,
    .guide-message,
    .forecast-main-card,
    .forecast-side-card,
    .analysis-chart-card,
    .premium-plan-card,
    .tools-surface-card,
    .tools-import-card,
    .tools-report-card,
    .tools-calendar-card,
    .tools-settings-card {
        padding: 16px;
        border-radius: 18px;
    }

    .section-header,
    .widget-header,
    .panel-section-header,
    .premium-plan-head,
    .report-modal-header,
    .premium-modal-header {
        margin-bottom: 12px;
        gap: 8px;
    }

    .section-content,
    .premium-modal-body,
    .report-view-content {
        gap: 12px;
    }

    .home-hero-card {
        padding: 18px 16px;
    }

    .hero-card-header {
        margin-bottom: 12px;
        gap: 8px;
    }

    .hero-main,
    .wise-score-value,
    .forecast-value,
    .bw-forecast-value {
        line-height: 1.05;
    }

    .hero-main {
        margin-bottom: 12px;
    }

    .hero-meta-grid,
    .summary-grid,
    .forecast-grid,
    .bw-forecast-grid,
    .report-grid-two,
    .report-summary-grid,
    .fixed-expense-summary-grid,
    .action-grid,
    .kpi-grid {
        gap: 10px;
    }

    .hero-meta-card,
    .summary-item,
    .report-summary-item,
    .report-hero-meta-item,
    .fixed-expense-summary-card,
    .forecast-side-card,
    .premium-trial-box,
    .license-modal-card {
        padding: 12px;
        border-radius: 14px;
    }

    .button-group,
    .analysis-chart-actions,
    .premium-modal-actions,
    .report-modal-actions,
    .import-actions,
    .expense-actions,
    .variable-card-actions,
    .fixed-manual-match-actions,
    .interactive-controls {
        gap: 8px;
    }

    .button-group .btn,
    .button-group button,
    .analysis-inline-btn,
    .premium-btn,
    .premium-modal-primary,
    .premium-modal-secondary,
    .premium-modal-later,
    .home-manual-btn,
    .home-voice-btn {
        min-height: 42px;
    }

    .premium-banner,
    .premium-content,
    .premium-content--fintech {
        gap: 10px;
    }

    .premium-mini-points {
        gap: 6px;
    }

    .premium-mini-points span,
    .home-quick-hint,
    .chart-note,
    .empty-message {
        line-height: 1.35;
    }

    .modal-content,
    .report-modal-content,
    .premium-modal-shell {
        padding: 18px 16px;
        border-radius: 20px;
    }
}

@media (max-width: 520px) {
    .section,
    .section-card,
    .summary-card,
    .guide-message {
        margin-bottom: 12px;
    }

    .home-hero-card,
    .section-card,
    .summary-card,
    .forecast-main-card,
    .forecast-side-card,
    .analysis-chart-card,
    .tools-surface-card,
    .modal-content,
    .report-modal-content,
    .premium-modal-shell {
        padding: 14px;
    }

    .hero-eyebrow,
    .hero-period-line,
    .summary-label,
    .forecast-label,
    .forecast-subtitle,
    .panel-section-subtitle,
    .premium-modal-kicker,
    .report-modal-subtitle {
        font-size: 0.82rem;
    }

    .hero-main,
    .wise-score-main,
    .forecast-main-card .forecast-value,
    .bw-forecast-value {
        margin-bottom: 10px;
    }

    .hero-meta-grid,
    .summary-grid,
    .forecast-grid,
    .bw-forecast-grid,
    .action-grid,
    .kpi-grid,
    .button-group,
    .analysis-chart-actions,
    .premium-modal-actions,
    .report-modal-actions {
        gap: 8px;
    }

    .hero-meta-card,
    .summary-item,
    .report-summary-item,
    .report-hero-meta-item,
    .fixed-expense-summary-card,
    .premium-trial-box,
    .license-modal-card {
        padding: 10px 11px;
    }

    .premium-mini-points span,
    .chart-note,
    .empty-message,
    .tools-import-card .file-name,
    .tools-import-card #csvMappingStatus {
        padding: 12px;
    }
}


/* ===== STEP 17 — contrast / focus / visual accessibility pass ===== */
:root {
    --bw-focus-ring: 0 0 0 2px rgba(14, 165, 233, 0.26), 0 0 0 4px rgba(14, 165, 233, 0.10), 0 10px 24px rgba(2, 132, 199, 0.18);
    --bw-focus-outline: rgba(14, 165, 233, 0.46);
    --bw-muted-strong: #334155;
    --bw-surface-contrast: rgba(15, 23, 42, 0.04);
}

[data-theme="dark"] {
    --bw-focus-ring: 0 0 0 2px rgba(56, 189, 248, 0.34), 0 0 0 4px rgba(56, 189, 248, 0.12), 0 10px 26px rgba(2, 132, 199, 0.26);
    --bw-focus-outline: rgba(125, 211, 252, 0.58);
    --bw-muted-strong: #c4c8d0;
    --bw-surface-contrast: rgba(255, 255, 255, 0.045);
}

body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hero-eyebrow,
.hero-period-line,
.summary-label,
.forecast-label,
.forecast-subtitle,
.panel-section-subtitle,
.report-modal-subtitle,
.empty-message,
.chart-note,
.premium-text p,
.premium-mini-points span,
.modal-subtitle,
.helper-text,
.setting-description,
.category-print-panel__hint,
#footerFeatures {
    color: var(--bw-muted-strong);
}

input::placeholder,
textarea::placeholder,
.tools-import-card .file-name,
#csvMappingStatus,
#reportGeneratedAt,
.modal-content .empty-state,
.report-view-empty {
    color: color-mix(in srgb, var(--bw-muted-strong) 82%, white 0%);
    opacity: 1;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
.analysis-inline-btn:focus-visible,
.home-voice-btn:focus-visible,
.home-manual-btn:focus-visible,
.premium-btn:focus-visible,
.tab-btn:focus-visible,
.chart-legend-item:focus-visible,
.review-select:focus-visible,
.csv-mapping-select:focus-visible,
.language-select:focus-visible {
    outline: 1px solid var(--bw-focus-outline);
    outline-offset: 2px;
    box-shadow: var(--bw-focus-ring);
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-danger:focus-visible,
.btn-text:focus-visible,
.analysis-inline-btn:focus-visible,
.home-voice-btn:focus-visible,
.home-manual-btn:focus-visible,
.premium-btn:focus-visible {
    transform: none;
}

.tab-btn,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-text,
.analysis-inline-btn,
.home-voice-btn,
.home-manual-btn,
.premium-btn,
.chart-legend-item {
    transition: box-shadow 0.22s ease, border-color 0.22s ease, background-color 0.22s ease, color 0.22s ease, transform 0.22s ease;
}

button[disabled],
input[disabled],
select[disabled],
textarea[disabled],
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: saturate(0.82);
}

.summary-card,
.section-card,
.home-hero-card,
.forecast-main-card,
.forecast-side-card,
.analysis-chart-card,
.tools-surface-card,
.modal-content,
.report-modal-content,
.premium-modal-shell,
.category-item,
.hero-meta-card,
.fixed-expense-summary-card {
    background-image: linear-gradient(180deg, rgba(255,255,255,0.018), rgba(255,255,255,0));
}

[data-theme="dark"] .summary-card,
[data-theme="dark"] .section-card,
[data-theme="dark"] .home-hero-card,
[data-theme="dark"] .forecast-main-card,
[data-theme="dark"] .forecast-side-card,
[data-theme="dark"] .analysis-chart-card,
[data-theme="dark"] .tools-surface-card,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .report-modal-content,
[data-theme="dark"] .premium-modal-shell,
[data-theme="dark"] .category-item,
[data-theme="dark"] .hero-meta-card,
[data-theme="dark"] .fixed-expense-summary-card {
    border-color: rgba(255,255,255,0.09);
}

.hero-meta-card,
.summary-item,
.report-summary-item,
.report-hero-meta-item,
.fixed-expense-summary-card,
.premium-trial-box,
.license-modal-card,
.category-print-panel,
.tools-import-card {
    background-color: color-mix(in srgb, var(--card-bg) 88%, var(--bw-surface-contrast));
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
select,
textarea,
.goal-input,
.initial-input,
.review-select,
.csv-mapping-select,
.language-select {
    border-color: color-mix(in srgb, var(--border) 78%, var(--accent) 10%);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):hover,
select:hover,
textarea:hover,
.goal-input:hover,
.initial-input:hover,
.review-select:hover,
.csv-mapping-select:hover,
.language-select:hover {
    border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.18);
}

input[type="range"]:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.18);
}

@media (prefers-contrast: more) {
    .summary-card,
    .section-card,
    .home-hero-card,
    .forecast-main-card,
    .forecast-side-card,
    .analysis-chart-card,
    .tools-surface-card,
    .modal-content,
    .report-modal-content,
    .premium-modal-shell,
    .category-item,
    .hero-meta-card,
    .fixed-expense-summary-card {
        border-width: 1.5px;
        box-shadow: none;
    }

    button:focus-visible,
    select:focus-visible,
    input:focus-visible,
    textarea:focus-visible,
    .analysis-inline-btn:focus-visible,
    .home-voice-btn:focus-visible,
    .home-manual-btn:focus-visible,
    .premium-btn:focus-visible,
    .tab-btn:focus-visible,
    .chart-legend-item:focus-visible {
        outline-width: 2px;
        outline-offset: 3px;
    }
}


/* ===== Desktop Floating Dock Navigation (STEP 18) ===== */
@media (min-width: 900px){
  .tab-bar,
  .tabs,
  .bottom-tabs,
  .nav-tabs{
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: 900px;
    padding: 10px 14px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    background: rgba(10,18,35,0.85);
    box-shadow: 0 10px 30px rgba(0,0,0,0.45),
                0 0 0 1px rgba(80,140,255,0.15);
    display:flex;
    gap:8px;
    justify-content:center;
    z-index:999;
  }

  .tab-bar button,
  .tabs button,
  .bottom-tabs button,
  .nav-tabs button{
    padding:8px 14px;
    border-radius:10px;
    font-size:0.9rem;
  }

  body{
    padding-bottom:120px;
  }
}
/* ===============================
   DESKTOP DOCK NAVIGATION FIX
   =============================== */

@media (min-width: 900px) {

  .tab-bar{
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    
    width: auto;
    max-width: 820px;

    padding: 10px 18px;
    border-radius: 16px;

    background: rgba(20,20,25,0.85);
    backdrop-filter: blur(10px);

    box-shadow:
      0 10px 30px rgba(0,0,0,0.45),
      0 0 0 1px rgba(255,255,255,0.04);

    display: flex;
    gap: 10px;
  }

  .tab-btn{
    padding: 8px 14px;
    border-radius: 10px;
    transition: all .2s ease;
  }

  .tab-btn:hover{
    background: rgba(255,255,255,0.06);
  }

}
.home-card,
.hero-card,
.metric-card,
.dashboard-card {
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  will-change: transform, box-shadow;
}

.home-card:hover,
.hero-card:hover,
.metric-card:hover,
.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.22);
  border-color: rgba(90,140,255,0.28);
}

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

.home-card,
.hero-card,
.metric-card,
.dashboard-card {
  animation: fadeSlideUpSoft .35s ease;
}


/* ===== PATCH v171 — home priority hierarchy ===== */
.home-priority-card[data-tab="home"] {
    order: 2;
    background: linear-gradient(180deg, rgba(18, 28, 46, 0.98), rgba(11, 17, 30, 0.98));
    border: 1px solid rgba(79,124,255,0.18) !important;
    box-shadow: 0 14px 32px rgba(0,0,0,0.24);
}

.home-priority-kicker {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.home-priority-card .home-quick-actions {
    grid-template-columns: 1.45fr 1fr;
}

.home-priority-card .home-voice-btn {
    min-height: 54px;
}

@media (max-width: 640px) {
    .home-priority-card .home-quick-actions {
        grid-template-columns: 1fr;
    }
}


/* === v172 WiseForecast evoluto (patch chirurgica) === */
.forecast-grid-evolved {
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.95fr);
    align-items: stretch;
}

.forecast-metrics-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.forecast-metric-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 104px;
}

.forecast-projection-card {
    border-color: rgba(96, 165, 250, 0.16);
    background: linear-gradient(180deg, rgba(15,23,42,0.88) 0%, rgba(15,23,42,0.78) 100%);
}

.forecast-risk-day-card {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.82) 0%, rgba(15, 23, 42, 0.72) 100%);
}

.forecast-risk-day-value {
    margin-top: 8px;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.45;
}

.forecast-risk-day-value.positive {
    color: #22c55e;
}

.forecast-risk-day-value.negative {
    color: #f59e0b;
}

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

    .forecast-risk-day-card {
        padding: 13px 14px;
    }
}


/* === v176 Expense Simulator minimale === */
.forecast-risk-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 14px;
}

.forecast-simulator-card {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(96, 165, 250, 0.18);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.88) 0%, rgba(15, 23, 42, 0.78) 100%);
}

.forecast-simulator-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.forecast-simulator-title {
    display: inline-block;
}

.forecast-simulator-hint {
    font-size: 0.78rem;
    color: rgba(191, 219, 254, 0.78);
    text-align: right;
}

.forecast-simulator-input {
    width: 100%;
    min-height: 46px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.72);
    color: #e5eefc;
    padding: 0 14px;
    font-size: 1rem;
    outline: none;
}

.forecast-simulator-input:focus {
    border-color: rgba(96, 165, 250, 0.48);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.forecast-simulator-empty {
    margin-top: 10px;
    font-size: 0.82rem;
    color: rgba(191, 219, 254, 0.76);
}

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

.forecast-simulator-metric {
    padding: 12px 13px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.52);
}

.forecast-simulator-value {
    margin-top: 8px;
    font-size: 1.18rem;
    font-weight: 800;
    line-height: 1.2;
}

.forecast-simulator-value.positive {
    color: #e5eefc;
}

.forecast-simulator-value.negative {
    color: #fca5a5;
}

@media (max-width: 760px) {
    .forecast-simulator-card {
        padding: 13px 14px;
    }

    .forecast-simulator-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .forecast-simulator-hint {
        text-align: left;
    }

    .forecast-simulator-grid {
        grid-template-columns: 1fr;
    }
}


.safe-to-spend-card {
    margin-top: 14px;
    border: 1px solid rgba(78, 146, 255, 0.22);
    border-radius: 14px;
    padding: 14px;
    background: linear-gradient(180deg, rgba(11, 18, 32, 0.92), rgba(10, 17, 28, 0.98));
}

.safe-to-spend-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.safe-to-spend-hint {
    font-size: 12px;
}

.safe-to-spend-value {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
}

.safe-to-spend-value.positive {
    color: #7be495;
}

.safe-to-spend-value.negative {
    color: #ff8f8f;
}


/* === v178 Daily Financial Check-in === */
.daily-checkin-card {
    border: 1px solid rgba(78, 146, 255, 0.18);
    background: linear-gradient(180deg, rgba(10, 18, 32, 0.96) 0%, rgba(8, 15, 25, 0.98) 100%);
}

.daily-checkin-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.daily-checkin-badge {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.14);
    border: 1px solid rgba(96, 165, 250, 0.22);
    flex-shrink: 0;
}

.daily-checkin-copy {
    min-width: 0;
}

.daily-checkin-title {
    font-size: 0.98rem;
    font-weight: 800;
    color: #e8f2ff;
}

.daily-checkin-subtitle {
    margin-top: 3px;
    font-size: 0.8rem;
}

.daily-checkin-value {
    margin-top: 12px;
    padding: 12px 13px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(15, 23, 42, 0.5);
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1.45;
}

.daily-checkin-value.positive { color: #7be495; }
.daily-checkin-value.neutral { color: #dbeafe; }
.daily-checkin-value.warning { color: #fbbf24; }
.daily-checkin-value.negative { color: #fca5a5; }

@media (max-width: 760px) {
    .daily-checkin-head {
        gap: 10px;
    }

    .daily-checkin-value {
        padding: 11px 12px;
    }
}


/* === v191 Decision layer + Home light readability === */
[data-theme="light"] .home-hero-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.98) 100%);
    border: 1px solid rgba(148,163,184,0.24);
    box-shadow: 0 8px 24px rgba(15,23,42,0.08);
}
[data-theme="light"] .hero-main-value,
[data-theme="light"] .hero-amount,
[data-theme="light"] .hero-balance,
[data-theme="light"] .summary-total-amount,
[data-theme="light"] #currentBalance {
    color: #0f172a;
    text-shadow: none;
}
[data-theme="light"] .hero-meta-card {
    background: #ffffff;
    border: 1px solid rgba(148,163,184,0.22);
    box-shadow: 0 2px 8px rgba(15,23,42,0.05);
}
[data-theme="light"] .hero-meta-card .metric-label,
[data-theme="light"] .hero-meta-card .summary-label,
[data-theme="light"] .hero-meta-label {
    color: #64748b;
}
[data-theme="light"] .hero-meta-card .metric-value,
[data-theme="light"] .hero-meta-card .summary-value,
[data-theme="light"] .hero-meta-value {
    color: #0f172a;
}
[data-theme="light"] .safe-to-spend-card,
[data-theme="light"] .forecast-risk-day-card,
[data-theme="light"] .forecast-simulator-card,
[data-theme="light"] .forecast-simulator-metric,
[data-theme="light"] .daily-checkin-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.98) 100%);
    border: 1px solid rgba(148,163,184,0.22);
    box-shadow: 0 4px 14px rgba(15,23,42,0.06);
}
[data-theme="light"] .safe-to-spend-head .forecast-label,
[data-theme="light"] .forecast-risk-day-card .forecast-label,
[data-theme="light"] .forecast-simulator-title,
[data-theme="light"] .daily-checkin-title {
    color: #334155;
}
[data-theme="light"] .safe-to-spend-hint,
[data-theme="light"] .forecast-simulator-hint,
[data-theme="light"] .forecast-simulator-empty,
[data-theme="light"] .daily-checkin-subtitle {
    color: #64748b;
}
[data-theme="light"] .safe-to-spend-value.negative { color: #dc2626; }
[data-theme="light"] .safe-to-spend-value.positive { color: #15803d; }
[data-theme="light"] .forecast-risk-day-value.negative { color: #d97706; }
[data-theme="light"] .forecast-risk-day-value.positive { color: #16a34a; }
[data-theme="light"] .forecast-simulator-input {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid rgba(148,163,184,0.28);
}
[data-theme="light"] .forecast-simulator-input::placeholder {
    color: #94a3b8;
}
[data-theme="light"] .forecast-simulator-value.negative { color: #dc2626; }
[data-theme="light"] .forecast-simulator-value.positive { color: #0f172a; }
[data-theme="light"] .daily-checkin-badge {
    background: rgba(37,99,235,0.08);
    border-color: rgba(37,99,235,0.18);
}
[data-theme="light"] .daily-checkin-value {
    background: rgba(15,23,42,0.04);
    border: 1px solid rgba(148,163,184,0.18);
}
[data-theme="light"] .daily-checkin-value.negative {
    color: #b91c1c;
    background: rgba(239,68,68,0.08);
    border-color: rgba(239,68,68,0.18);
}
[data-theme="light"] .daily-checkin-value.warning {
    color: #b45309;
    background: rgba(245,158,11,0.10);
    border-color: rgba(245,158,11,0.18);
}
[data-theme="light"] .daily-checkin-value.positive {
    color: #166534;
    background: rgba(34,197,94,0.10);
    border-color: rgba(34,197,94,0.16);
}


/* === v206 UI coherence hardening — controlled override === */
:root {
  --bw-radius-sm: 12px;
  --bw-radius-md: 16px;
  --bw-radius-lg: 20px;
  --bw-panel-bg: linear-gradient(180deg, rgba(17,24,39,0.92), rgba(11,16,27,0.92));
  --bw-panel-soft: linear-gradient(180deg, rgba(18,24,38,0.96), rgba(13,18,30,0.98));
  --bw-stroke-1: rgba(255,255,255,0.08);
  --bw-stroke-2: rgba(96,165,250,0.22);
  --bw-focus-ring: 0 0 0 3px rgba(56,189,248,0.16);
}

.section-card,
.savings-widget,
.chat-container,
.search-container,
.voice-input-container,
.voice-fixed-container,
.future-fixed-section,
.expense-item,
.fixed-expense-summary-card,
.hero-meta-card,
.forecast-main-card,
.forecast-side-card,
.insight-card,
.slider-container,
.goal-input-container,
.initial-savings-container,
.variable-home-card,
.category-item,
.modal-content {
  border-radius: var(--bw-radius-md) !important;
}

.section-card,
.savings-widget,
.search-container,
.voice-input-container,
.voice-fixed-container,
.future-fixed-section,
.chat-container {
  background: var(--bw-panel-bg);
  border: 1px solid var(--bw-stroke-1) !important;
  box-shadow: 0 10px 26px rgba(0,0,0,0.26);
}

.input-group-row,
.button-group,
.chat-input-area,
.filters-row,
.home-quick-actions {
  gap: 12px !important;
}

button,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-text,
.chat-send-btn,
.voice-btn,
.voice-fixed-btn,
.home-voice-btn,
.home-manual-btn,
#resetSearchBtn,
#backupBtn,
#restoreBtn,
#manageCategoriesBtn,
#resetAllBtn,
#resetColorsBtn,
#applySuggestionBtn,
#applyAiSuggestion,
#dismissAiSuggestion,
#sendChatBtn {
  min-height: 46px;
  border-radius: 14px !important;
  font-weight: 600;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
select,
textarea,
#searchExpenses,
#searchCategory,
.chat-input,
.goal-input,
.initial-input {
  min-height: 46px;
  border-radius: 14px !important;
  background: var(--bw-panel-soft) !important;
  border: 1px solid var(--bw-stroke-1) !important;
  color: var(--text-primary) !important;
  box-shadow: none !important;
}

input:focus,
select:focus,
textarea:focus,
.chat-input:focus,
.goal-input:focus,
.initial-input:focus,
#searchExpenses:focus,
#searchCategory:focus {
  outline: none;
  border-color: rgba(96,165,250,0.42) !important;
  box-shadow: var(--bw-focus-ring) !important;
}

.date-hint { display: none !important; }

.home-voice-btn,
.voice-btn,
.voice-fixed-btn,
.chat-send-btn,
#applySaveBtn,
#applySuggestionBtn {
  background: linear-gradient(135deg, #2563eb, #38bdf8) !important;
  color: #eff6ff !important;
  border: 1px solid rgba(147,197,253,0.22) !important;
  box-shadow: 0 10px 22px rgba(37,99,235,0.18);
}

.home-manual-btn,
#resetSearchBtn,
#backupBtn,
#restoreBtn,
#manageCategoriesBtn,
#dismissAiSuggestion,
#applyAiSuggestion,
#resetColorsBtn {
  background: var(--bw-panel-soft) !important;
  border: 1px solid var(--bw-stroke-2) !important;
  color: #dbeafe !important;
}

.voice-status {
  min-height: 46px;
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 14px !important;
  padding: 0 14px !important;
  color: #cbd5e1 !important;
  font-style: normal !important;
}

.search-container > div:first-child {
  display: grid !important;
  grid-template-columns: minmax(0,1.35fr) minmax(190px,0.9fr) auto;
  gap: 12px;
  align-items: stretch;
}

@media (max-width: 720px) {
  .search-container > div:first-child,
  .home-quick-actions,
  .savings-insights,
  .forecast-grid-evolved {
    grid-template-columns: 1fr !important;
  }
}

.search-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-color: #93c5fd;
  -webkit-mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") center/contain no-repeat;
  opacity: .9;
}

.widget-header {
  display: grid !important;
  grid-template-columns: auto minmax(0,1fr);
  align-items: center;
  gap: 16px;
  padding: 18px 18px 18px 16px !important;
  background: linear-gradient(135deg, rgba(56,189,248,0.9), rgba(37,99,235,0.82)) !important;
  border-radius: 18px !important;
}

.pig-icon-container {
  width: 56px;
  min-width: 56px;
  height: 56px;
}

.progress-ring svg { width: 56px; height: 56px; }
.progress-percentage { color: #eff6ff !important; font-size: 11px !important; font-weight: 800; }
.widget-info h3 { margin: 0 0 4px 0 !important; font-size: 1.55rem; line-height: 1.15; color: #f8fbff; }
.target-date { font-size: 1.05rem !important; color: rgba(255,255,255,0.88) !important; }

.slider-container,
.goal-input-container,
.initial-savings-container,
.insight-card {
  background: rgba(255,255,255,0.02) !important;
  border: 1px solid rgba(255,255,255,0.07) !important;
}

.slider-container label,
.goal-input-container label,
.initial-savings-container label,
.section-card h2,
.panel-section-title,
.future-fixed-title,
.widget-info h3,
#assistantTitle,
#aiWidgetTitle {
  color: var(--text-primary) !important;
}

.savings-slider { height: 10px !important; background: rgba(255,255,255,0.12) !important; }
.savings-slider::-webkit-slider-thumb,
.savings-slider::-moz-range-thumb {
  width: 18px; height: 18px; border: 3px solid #dbeafe; background: #38bdf8; box-shadow: 0 0 0 4px rgba(56,189,248,0.18);
}

.savings-insights { gap: 12px !important; }
#applySuggestionBtn, .btn-suggestion {
  display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; background: rgba(255,255,255,0.96) !important; color: #0f172a !important; border: none !important; border-radius: 12px !important; font-weight: 700; min-height: 42px;
}

.chat-container { padding: 0 !important; }
.chat-messages { background: rgba(0,0,0,0.28); min-height: 188px; }
.chat-message { max-width: 100% !important; line-height: 1.4; }
.chat-message.bot { background: rgba(0,0,0,0.18) !important; }
.chat-input-area { padding: 12px !important; }
.chat-send-btn { padding: 0 18px !important; }
.chat-suggestions { gap: 10px !important; }
.suggestion-chip { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: rgba(0,0,0,0.32) !important; }

.ai-suggestion {
  display: grid !important;
  grid-template-columns: 18px minmax(0,1fr);
  align-items: start;
  gap: 10px;
  padding: 16px !important;
  border-radius: 16px !important;
  background: linear-gradient(135deg, rgba(56,189,248,0.18), rgba(37,99,235,0.12)) !important;
  border: 1px solid rgba(96,165,250,0.18) !important;
  color: #eaf4ff !important;
}
.ai-icon,
.ai-icon::before { width: 18px !important; height: 18px !important; }
#aiMessage { display: block; color: #eaf4ff !important; font-size: .95rem; line-height: 1.45; min-height: 1.45em; }
.ai-action { margin-top: 12px !important; justify-content: flex-start !important; }

.future-fixed-section {
  background: linear-gradient(180deg, rgba(14,34,36,0.68), rgba(15,23,42,0.7)) !important;
}
.future-fixed-kicker { color: #4ade80 !important; font-size: .76rem; letter-spacing: .05em; text-transform: uppercase; font-weight: 700; }
.future-fixed-right-header { gap: 10px !important; }
.future-fixed-badge { background: rgba(59,130,246,0.18) !important; color: #c7dbff !important; }

.footer { margin-top: 24px !important; padding-bottom: 10px; }
.footer p:first-child { font-size: .92rem; }
#footerFeatures { margin-top: .4rem !important; font-size: .76rem !important; opacity: .78; }

.daily-checkin-badge,
.status-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(56,189,248,0.16);
}
.daily-checkin-badge::before {
  content: '';
  width: 12px;
  height: 12px;
  background-color: #7dd3fc;
  -webkit-mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6'/%3E%3Cpath d='M10 22h4'/%3E%3Cpath d='M12 2a7 7 0 0 0-4 12c.5.4 1 1.3 1.2 2H15c.2-.7.7-1.6 1.2-2A7 7 0 0 0 12 2Z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6'/%3E%3Cpath d='M10 22h4'/%3E%3Cpath d='M12 2a7 7 0 0 0-4 12c.5.4 1 1.3 1.2 2H15c.2-.7.7-1.6 1.2-2A7 7 0 0 0 12 2Z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.icon-only-btn,
.delete-income-btn,
.delete-fixed-btn,
.edit-variable-btn,
.delete-variable-btn,
.edit-category-btn,
.delete-category-btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0 !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  background: rgba(255,255,255,0.03) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0 !important;
  line-height: 0 !important;
}
.icon-only-btn::before,
.delete-income-btn::before,
.delete-fixed-btn::before,
.edit-variable-btn::before,
.delete-variable-btn::before,
.edit-category-btn::before,
.delete-category-btn::before,
#sendChatBtn::before,
#backupBtn::before,
#restoreBtn::before,
#manageCategoriesBtn::before,
#resetSearchBtn::before,
#resetColorsBtn::before,
#homeManualBtn::before,
#homeVoiceBtn::before,
#micFixedBtn::before,
#applySuggestionBtn::before,
#applyAiSuggestion::before,
#dismissAiSuggestion::before {
  content: '';
  width: 16px;
  height: 16px;
  display: inline-block;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.delete-income-btn::before,
.delete-fixed-btn::before,
.delete-variable-btn::before,
.delete-category-btn::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16'/%3E%3Cpath d='M10 11v6'/%3E%3Cpath d='M14 11v6'/%3E%3Cpath d='M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12'/%3E%3Cpath d='M9 7V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16'/%3E%3Cpath d='M10 11v6'/%3E%3Cpath d='M14 11v6'/%3E%3Cpath d='M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12'/%3E%3Cpath d='M9 7V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3'/%3E%3C/svg%3E");
}
.edit-variable-btn::before,
.edit-category-btn::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5Z'/%3E%3C/svg%3E");
}
#sendChatBtn,
#backupBtn,
#restoreBtn,
#manageCategoriesBtn,
#resetSearchBtn,
#resetColorsBtn,
#homeManualBtn,
#homeVoiceBtn,
#micFixedBtn,
#applySuggestionBtn,
#applyAiSuggestion,
#dismissAiSuggestion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
#sendChatBtn::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m22 2-7 20-4-9-9-4Z'/%3E%3Cpath d='M22 2 11 13'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m22 2-7 20-4-9-9-4Z'/%3E%3Cpath d='M22 2 11 13'/%3E%3C/svg%3E");
}
#backupBtn::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M5 21h14'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M5 21h14'/%3E%3C/svg%3E");
}
#restoreBtn::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21V9'/%3E%3Cpath d='m17 14-5-5-5 5'/%3E%3Cpath d='M5 3h14'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21V9'/%3E%3Cpath d='m17 14-5-5-5 5'/%3E%3Cpath d='M5 3h14'/%3E%3C/svg%3E");
}
#manageCategoriesBtn::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16'/%3E%3Cpath d='M7 12h10'/%3E%3Cpath d='M9 17h6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16'/%3E%3Cpath d='M7 12h10'/%3E%3Cpath d='M9 17h6'/%3E%3C/svg%3E");
}
#resetSearchBtn::before,
#dismissAiSuggestion::before,
#resetColorsBtn::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m18 6-12 12'/%3E%3Cpath d='M6 6l12 12'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m18 6-12 12'/%3E%3Cpath d='M6 6l12 12'/%3E%3C/svg%3E");
}
#homeManualBtn::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5Z'/%3E%3C/svg%3E");
}
#homeVoiceBtn::before,
#micFixedBtn::before,
#applyAiSuggestion::before,
#applySuggestionBtn::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a3 3 0 0 0-3 3v6a3 3 0 0 0 6 0V6a3 3 0 0 0-3-3Z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2'/%3E%3Cpath d='M12 19v3'/%3E%3Cpath d='M8 22h8'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a3 3 0 0 0-3 3v6a3 3 0 0 0 6 0V6a3 3 0 0 0-3-3Z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2'/%3E%3Cpath d='M12 19v3'/%3E%3Cpath d='M8 22h8'/%3E%3C/svg%3E");
}

#resetSearchBtn,
#manageCategoriesBtn,
#backupBtn,
#restoreBtn,
#resetColorsBtn,
#homeManualBtn { white-space: nowrap; }

.language-select option { color: #0f172a; }


.category-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.category-inline.manager {
  font-weight: 600;
}

.category-inline-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  flex: 0 0 16px;
  background-color: var(--accent, #3bb8ff);
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  opacity: 0.95;
}

.category-inline-text {
  min-width: 0;
}

.category-icon-groceries {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 21s1-2 5-2 5 2 5 2'/%3E%3Cpath d='M8 18c0-4 1.5-7 4-10 2.5 3 4 6 4 10'/%3E%3Cpath d='M12 8c-1-2-2.5-3-5-4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 21s1-2 5-2 5 2 5 2'/%3E%3Cpath d='M8 18c0-4 1.5-7 4-10 2.5 3 4 6 4 10'/%3E%3Cpath d='M12 8c-1-2-2.5-3-5-4'/%3E%3C/svg%3E");
}
.category-icon-transport {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 17h14l-1-5a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2l-1 5z'/%3E%3Ccircle cx='7.5' cy='17.5' r='1.5'/%3E%3Ccircle cx='16.5' cy='17.5' r='1.5'/%3E%3Cpath d='M8 10V7a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v3'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 17h14l-1-5a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2l-1 5z'/%3E%3Ccircle cx='7.5' cy='17.5' r='1.5'/%3E%3Ccircle cx='16.5' cy='17.5' r='1.5'/%3E%3Cpath d='M8 10V7a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v3'/%3E%3C/svg%3E");
}
.category-icon-leisure {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12a5 5 0 0 1 5-5h4a5 5 0 1 1 0 10h-4a5 5 0 0 1-5-5z'/%3E%3Cpath d='M8 12h.01'/%3E%3Cpath d='M16 11h.01'/%3E%3Cpath d='M18 13h.01'/%3E%3Cpath d='M15 14h.01'/%3E%3Cpath d='M9 10v4'/%3E%3Cpath d='M7 12h4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12a5 5 0 0 1 5-5h4a5 5 0 1 1 0 10h-4a5 5 0 0 1-5-5z'/%3E%3Cpath d='M8 12h.01'/%3E%3Cpath d='M16 11h.01'/%3E%3Cpath d='M18 13h.01'/%3E%3Cpath d='M15 14h.01'/%3E%3Cpath d='M9 10v4'/%3E%3Cpath d='M7 12h4'/%3E%3C/svg%3E");
}
.category-icon-health {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 6h4v4h4v4h-4v4h-4v-4H6v-4h4z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 6h4v4h4v4h-4v4h-4v-4H6v-4h4z'/%3E%3C/svg%3E");
}
.category-icon-clothing {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5l4 2 4-2 3 4-3 2v8H8v-8L5 9z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5l4 2 4-2 3 4-3 2v8H8v-8L5 9z'/%3E%3C/svg%3E");
}
.category-icon-other {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 4v10l-7 4-7-4V7z'/%3E%3Cpath d='M12 12l7-5'/%3E%3Cpath d='M12 12L5 7'/%3E%3Cpath d='M12 21V12'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 4v10l-7 4-7-4V7z'/%3E%3Cpath d='M12 12l7-5'/%3E%3Cpath d='M12 12L5 7'/%3E%3Cpath d='M12 21V12'/%3E%3C/svg%3E");
}
.category-icon-custom {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7h10v10H7z'/%3E%3Cpath d='M10 10h4v4h-4z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7h10v10H7z'/%3E%3Cpath d='M10 10h4v4h-4z'/%3E%3C/svg%3E");
}

.expense-category .category-inline,
.category-item .category-inline {
  color: inherit;
}


/* === v207 PATCH 1 — Surface System (Light Mode reale) === */
html:not([data-theme="dark"]) {
  --bg-color: #F4F7FB;
  --card-bg: #FFFFFF;
  --border: #DCE6F2;
  --surface: #F8FBFF;
  --surface-2: #F8FBFF;
  --text-primary: #10233E;
  --text-secondary: #5E718B;
  --shadow: 0 10px 24px rgba(16, 35, 62, 0.06);
  --bw-panel-bg-light: #FFFFFF;
  --bw-panel-soft-light: #F8FBFF;
  --bw-stroke-light: #DCE6F2;
  --bw-chart-area-light: #F7FAFE;
  --bw-chart-grid-light: #E3EDF7;
}

html:not([data-theme="dark"]) body {
  background: var(--bg-color);
  color: var(--text-primary);
}

html:not([data-theme="dark"]) .section-card,
html:not([data-theme="dark"]) .summary-card,
html:not([data-theme="dark"]) .savings-widget,
html:not([data-theme="dark"]) .chat-container,
html:not([data-theme="dark"]) .search-container,
html:not([data-theme="dark"]) .voice-input-container,
html:not([data-theme="dark"]) .voice-fixed-container,
html:not([data-theme="dark"]) .future-fixed-section,
html:not([data-theme="dark"]) .expense-item,
html:not([data-theme="dark"]) .fixed-expense-summary-card,
html:not([data-theme="dark"]) .hero-meta-card,
html:not([data-theme="dark"]) .forecast-main-card,
html:not([data-theme="dark"]) .forecast-side-card,
html:not([data-theme="dark"]) .insight-card,
html:not([data-theme="dark"]) .slider-container,
html:not([data-theme="dark"]) .goal-input-container,
html:not([data-theme="dark"]) .initial-savings-container,
html:not([data-theme="dark"]) .variable-home-card,
html:not([data-theme="dark"]) .category-item,
html:not([data-theme="dark"]) .modal-content,
html:not([data-theme="dark"]) .home-quick-card,
html:not([data-theme="dark"]) .forecast-card {
  background: var(--bw-panel-bg-light) !important;
  border: 1px solid var(--bw-stroke-light) !important;
  box-shadow: var(--shadow) !important;
  color: var(--text-primary);
}

html:not([data-theme="dark"]) .slider-container,
html:not([data-theme="dark"]) .goal-input-container,
html:not([data-theme="dark"]) .initial-savings-container,
html:not([data-theme="dark"]) .insight-card,
html:not([data-theme="dark"]) .future-fixed-item,
html:not([data-theme="dark"]) .fixed-detail-chip,
html:not([data-theme="dark"]) .forecast-side-card,
html:not([data-theme="dark"]) .chat-input-area {
  background: var(--bw-panel-soft-light) !important;
  border-color: var(--bw-stroke-light) !important;
}

html:not([data-theme="dark"]) input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
html:not([data-theme="dark"]) select,
html:not([data-theme="dark"]) textarea,
html:not([data-theme="dark"]) #searchExpenses,
html:not([data-theme="dark"]) #searchCategory,
html:not([data-theme="dark"]) .chat-input,
html:not([data-theme="dark"]) .goal-input,
html:not([data-theme="dark"]) .initial-input {
  background: var(--bw-panel-bg-light) !important;
  border: 1px solid var(--bw-stroke-light) !important;
  color: var(--text-primary) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85) !important;
}

html:not([data-theme="dark"]) input::placeholder,
html:not([data-theme="dark"]) textarea::placeholder {
  color: var(--text-secondary) !important;
}

html:not([data-theme="dark"]) input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):hover,
html:not([data-theme="dark"]) select:hover,
html:not([data-theme="dark"]) textarea:hover {
  border-color: #C7D8EA !important;
  background: #FFFFFF !important;
}

html:not([data-theme="dark"]) input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):focus,
html:not([data-theme="dark"]) select:focus,
html:not([data-theme="dark"]) textarea:focus,
html:not([data-theme="dark"]) #searchExpenses:focus,
html:not([data-theme="dark"]) #searchCategory:focus,
html:not([data-theme="dark"]) .chat-input:focus,
html:not([data-theme="dark"]) .goal-input:focus,
html:not([data-theme="dark"]) .initial-input:focus {
  border-color: rgba(37, 99, 235, 0.32) !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10) !important;
}

html:not([data-theme="dark"]) .voice-input-container,
html:not([data-theme="dark"]) .voice-fixed-container,
html:not([data-theme="dark"]) .home-quick-card {
  border-color: rgba(37, 99, 235, 0.10) !important;
}

html:not([data-theme="dark"]) .voice-status {
  background: #F8FBFF !important;
  border: 1px solid var(--bw-stroke-light) !important;
  color: var(--text-secondary) !important;
}

html:not([data-theme="dark"]) .search-container {
  background: var(--bw-panel-bg-light) !important;
}

html:not([data-theme="dark"]) .analysis-chart-card,
html:not([data-theme="dark"]) #balanceChartCard,
html:not([data-theme="dark"]) #monthlyBalanceChartCard {
  background: var(--bw-panel-bg-light) !important;
  border-color: var(--bw-stroke-light) !important;
}

html:not([data-theme="dark"]) .chart-container,
html:not([data-theme="dark"]) .analysis-chart-card .chart-container,
html:not([data-theme="dark"]) #balanceChartCard .chart-container,
html:not([data-theme="dark"]) #monthlyBalanceChartCard .chart-container {
  background: var(--bw-chart-area-light) !important;
  border: 1px solid var(--bw-chart-grid-light) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85) !important;
}

html:not([data-theme="dark"]) .chart-note,
html:not([data-theme="dark"]) .voice-status,
html:not([data-theme="dark"]) .forecast-label,
html:not([data-theme="dark"]) .target-date,
html:not([data-theme="dark"]) .input-group label,
html:not([data-theme="dark"]) .goal-input-container label {
  color: var(--text-secondary) !important;
}

html:not([data-theme="dark"]) .chat-messages,
html:not([data-theme="dark"]) .chat-message.bot,
html:not([data-theme="dark"]) .suggestion-chip {
  background: var(--bw-panel-soft-light) !important;
  color: var(--text-primary) !important;
}

html:not([data-theme="dark"]) .forecast-status {
  border-color: rgba(94, 113, 139, 0.18);
  background: rgba(94, 113, 139, 0.08);
}


/* === v208 PATCH 2 — Icon System lock (zero regressioni) === */
:root {
  --bw-icon-ui: 20px;
  --bw-icon-action: 24px;
  --bw-icon-meta: 18px;
  --bw-icon-xs: 16px;
}

/* Base icon grammar */
.status-icon,
.ai-icon,
.input-icon,
.input-icon-goal,
.input-icon-savings,
.premium-trial-icon,
.category-inline-icon,
.daily-checkin-badge,
.search-prefix,
.pig-emoji {
  flex-shrink: 0;
}

.status-icon,
.daily-checkin-badge,
.ai-icon,
.premium-trial-icon {
  width: var(--bw-icon-meta) !important;
  height: var(--bw-icon-meta) !important;
}

.input-icon,
.input-icon-goal,
.input-icon-savings,
.search-prefix,
.pig-emoji {
  width: var(--bw-icon-ui) !important;
  height: var(--bw-icon-ui) !important;
}

.category-inline-icon {
  width: var(--bw-icon-ui) !important;
  height: var(--bw-icon-ui) !important;
  flex: 0 0 var(--bw-icon-ui) !important;
  border-radius: 6px;
}

.ai-icon::before,
.input-icon-goal::before,
.input-icon-savings::before,
.pig-emoji::before,
.premium-trial-icon::before,
.status-icon::before,
.daily-checkin-badge::before {
  width: 100% !important;
  height: 100% !important;
}

/* Action icons */
.icon-only-btn,
.delete-income-btn,
.delete-fixed-btn,
.edit-variable-btn,
.delete-variable-btn,
.edit-category-btn,
.delete-category-btn {
  width: 38px !important;
  min-width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  border-radius: 12px !important;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease;
}

.icon-only-btn::before,
.delete-income-btn::before,
.delete-fixed-btn::before,
.edit-variable-btn::before,
.delete-variable-btn::before,
.edit-category-btn::before,
.delete-category-btn::before {
  width: var(--bw-icon-action) !important;
  height: var(--bw-icon-action) !important;
}

.icon-only-btn:hover,
.delete-income-btn:hover,
.delete-fixed-btn:hover,
.edit-variable-btn:hover,
.delete-variable-btn:hover,
.edit-category-btn:hover,
.delete-category-btn:hover {
  transform: translateY(-1px);
}

/* Text buttons with icons */
#sendChatBtn::before,
#backupBtn::before,
#restoreBtn::before,
#manageCategoriesBtn::before,
#resetSearchBtn::before,
#resetColorsBtn::before,
#homeManualBtn::before,
#homeVoiceBtn::before,
#micFixedBtn::before,
#applySuggestionBtn::before,
#applyAiSuggestion::before,
#dismissAiSuggestion::before {
  width: var(--bw-icon-ui) !important;
  height: var(--bw-icon-ui) !important;
  flex: 0 0 var(--bw-icon-ui) !important;
  opacity: .96;
}

#homeVoiceBtn,
#homeManualBtn,
#micFixedBtn,
#sendChatBtn,
#backupBtn,
#restoreBtn,
#manageCategoriesBtn,
#resetSearchBtn,
#resetColorsBtn,
#applySuggestionBtn,
#applyAiSuggestion,
#dismissAiSuggestion {
  gap: 10px !important;
}

/* Stronger icon legibility in light mode */
html:not([data-theme="dark"]) .icon-only-btn,
html:not([data-theme="dark"]) .delete-income-btn,
html:not([data-theme="dark"]) .delete-fixed-btn,
html:not([data-theme="dark"]) .edit-variable-btn,
html:not([data-theme="dark"]) .delete-variable-btn,
html:not([data-theme="dark"]) .edit-category-btn,
html:not([data-theme="dark"]) .delete-category-btn {
  background: #F8FBFF !important;
  border-color: #DCE6F2 !important;
  color: #10233E !important;
  box-shadow: 0 6px 16px rgba(16, 35, 62, 0.08) !important;
}

html:not([data-theme="dark"]) .status-icon,
html:not([data-theme="dark"]) .daily-checkin-badge {
  background: rgba(37,99,235,0.10) !important;
}

html:not([data-theme="dark"]) .category-inline {
  color: #10233E;
}

html:not([data-theme="dark"]) .category-inline-icon {
  background-color: #2563EB !important;
  opacity: 1;
}

/* Dark mode: preserve current character, only tighten sizing */
[data-theme="dark"] .icon-only-btn,
[data-theme="dark"] .delete-income-btn,
[data-theme="dark"] .delete-fixed-btn,
[data-theme="dark"] .edit-variable-btn,
[data-theme="dark"] .delete-variable-btn,
[data-theme="dark"] .edit-category-btn,
[data-theme="dark"] .delete-category-btn {
  box-shadow: 0 8px 18px rgba(0,0,0,0.18) !important;
}

/* Premium trial / AI utility icons */
.premium-trial-icon,
.ai-icon,
.status-icon,
.daily-checkin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Safety: no broken glyph fallback */
.mic-icon-btn,
.voice-fixed-btn,
.home-voice-btn,
#homeVoiceBtn,
#micFixedBtn {
  font-variant-ligatures: none;
}


/* === v209 PATCH 3 — Chart System lock (zero regressioni) === */
:root {
  --bw-chart-card-radius: 20px;
  --bw-chart-inner-radius: 16px;
  --bw-chart-card-shadow-light: 0 14px 32px rgba(16, 35, 62, 0.08);
  --bw-chart-card-shadow-dark: 0 16px 34px rgba(0, 0, 0, 0.22);
  --bw-chart-note-light: #5E718B;
}

.analysis-chart-card {
  border-radius: var(--bw-chart-card-radius) !important;
}

.analysis-chart-card .section-content {
  gap: 14px !important;
}

.analysis-chart-card .chart-container,
#balanceChartCard .chart-container,
#monthlyBalanceChartCard .chart-container {
  border-radius: var(--bw-chart-inner-radius) !important;
  width: 100% !important;
  max-width: none !important;
  overflow: hidden;
}

.analysis-chart-card--donut .chart-container {
  max-width: 320px !important;
  min-height: 320px !important;
  height: 320px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-inline: auto !important;
}

.analysis-chart-card--bars .chart-container,
.analysis-chart-card--trend .chart-container,
#balanceChartCard .chart-container,
#monthlyBalanceChartCard .chart-container {
  min-height: 248px !important;
  height: 248px !important;
}

.analysis-chart-card canvas,
#balanceChart,
#monthlyBalanceChart,
#expenseChart {
  width: 100% !important;
}

#balanceChart,
#monthlyBalanceChart {
  height: 224px !important;
  max-height: 224px !important;
}

#expenseChart {
  max-width: 100% !important;
  max-height: 100% !important;
}

.chart-legend {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px !important;
  margin: 12px 0 0 !important;
}

.chart-legend-item {
  min-height: 46px !important;
  padding: 10px 12px !important;
  border-radius: 14px !important;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background-color .18s ease !important;
}

.chart-legend-item:hover,
.chart-legend-item:focus-visible {
  transform: translateY(-1px);
}

.chart-legend-dot {
  width: 11px !important;
  height: 11px !important;
}

.chart-legend-label {
  font-size: 0.92rem !important;
  font-weight: 600 !important;
}

.chart-legend-value {
  font-size: 0.78rem !important;
}

.chart-note,
#monthlyBalanceEmpty,
#balanceChartNote,
#monthlyBalanceChartNote,
#chartNote,
#categoryPrintHint {
  font-style: normal !important;
  line-height: 1.45;
}

.analysis-inline-btn {
  min-height: 40px !important;
}

html:not([data-theme="dark"]) .analysis-chart-card,
html:not([data-theme="dark"]) #balanceChartCard,
html:not([data-theme="dark"]) #monthlyBalanceChartCard {
  background: linear-gradient(180deg, #FFFFFF 0%, #FBFDFF 100%) !important;
  border: 1px solid #DCE6F2 !important;
  box-shadow: var(--bw-chart-card-shadow-light) !important;
}

html:not([data-theme="dark"]) .analysis-chart-card::after {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), transparent 42%) !important;
  opacity: 1 !important;
}

html:not([data-theme="dark"]) .analysis-chart-card .chart-container,
html:not([data-theme="dark"]) #balanceChartCard .chart-container,
html:not([data-theme="dark"]) #monthlyBalanceChartCard .chart-container {
  background: linear-gradient(180deg, #F7FAFE 0%, #FDFEFF 100%) !important;
  border: 1px solid #E3EDF7 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.92) !important;
}

html:not([data-theme="dark"]) .chart-legend-item {
  background: #F8FBFF !important;
  border: 1px solid #E3EDF7 !important;
  box-shadow: 0 8px 18px rgba(16, 35, 62, 0.05) !important;
}

html:not([data-theme="dark"]) .chart-legend-item:hover,
html:not([data-theme="dark"]) .chart-legend-item:focus-visible {
  background: #FFFFFF !important;
  border-color: rgba(37, 99, 235, 0.20) !important;
  box-shadow: 0 10px 22px rgba(16, 35, 62, 0.08) !important;
}

html:not([data-theme="dark"]) .chart-legend-dot {
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08) !important;
}

html:not([data-theme="dark"]) .chart-legend-label {
  color: #10233E !important;
}

html:not([data-theme="dark"]) .chart-legend-value,
html:not([data-theme="dark"]) .chart-note,
html:not([data-theme="dark"]) #monthlyBalanceEmpty,
html:not([data-theme="dark"]) #balanceChartNote,
html:not([data-theme="dark"]) #monthlyBalanceChartNote,
html:not([data-theme="dark"]) #chartNote,
html:not([data-theme="dark"]) #categoryPrintHint {
  color: var(--bw-chart-note-light) !important;
}

html:not([data-theme="dark"]) .analysis-inline-btn {
  border-color: #DCE6F2 !important;
  background: #FFFFFF !important;
  box-shadow: 0 8px 20px rgba(16, 35, 62, 0.06) !important;
}

[data-theme="dark"] .analysis-chart-card,
[data-theme="dark"] #balanceChartCard,
[data-theme="dark"] #monthlyBalanceChartCard {
  box-shadow: var(--bw-chart-card-shadow-dark) !important;
}

[data-theme="dark"] .analysis-chart-card .chart-container,
[data-theme="dark"] #balanceChartCard .chart-container,
[data-theme="dark"] #monthlyBalanceChartCard .chart-container {
  border-color: rgba(255,255,255,0.07) !important;
}

@media (max-width: 768px) {
  .analysis-chart-card .section-content {
    gap: 12px !important;
  }

  .analysis-chart-card--donut .chart-container {
    max-width: 272px !important;
    min-height: 272px !important;
    height: 272px !important;
  }

  .analysis-chart-card--bars .chart-container,
  .analysis-chart-card--trend .chart-container,
  #balanceChartCard .chart-container,
  #monthlyBalanceChartCard .chart-container {
    min-height: 224px !important;
    height: 224px !important;
  }

  #balanceChart,
  #monthlyBalanceChart {
    height: 202px !important;
    max-height: 202px !important;
  }

  .chart-legend {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .chart-legend-item {
    min-height: 44px !important;
    padding: 9px 10px !important;
  }

  .chart-legend-label {
    font-size: 0.9rem !important;
  }

  .chart-legend-value {
    font-size: 0.76rem !important;
  }
}


/* ===== PATCH 4 — Bottom Navigation System Lock (v210) ===== */
:root {
  --bw-nav-light-bg: #FFFFFF;
  --bw-nav-light-border: #E1EAF4;
  --bw-nav-light-pill: linear-gradient(135deg, #2563EB, #3B82F6);
  --bw-nav-light-text: #10233E;
  --bw-nav-light-muted: #5E718B;
  --bw-nav-light-shadow: 0 14px 36px rgba(16, 35, 62, 0.12), 0 2px 8px rgba(16, 35, 62, 0.06);
  --bw-nav-dark-bg: linear-gradient(180deg, rgba(8,12,20,0.92), rgba(12,18,32,0.96));
  --bw-nav-dark-border: rgba(112, 141, 196, 0.16);
  --bw-nav-dark-text: #DBE5F7;
  --bw-nav-dark-muted: #9FB0C8;
  --bw-nav-dark-pill: linear-gradient(135deg, #2563EB, #60A5FA);
  --bw-nav-dark-shadow: 0 18px 44px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.04);
}

body {
  padding-bottom: 112px;
}

.tab-bar {
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  bottom: 12px !important;
  transform: translateX(-50%) !important;
  width: min(calc(100% - 18px), 980px) !important;
  max-width: 980px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  margin: 0 !important;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom)) !important;
  border-radius: 20px !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  z-index: 999 !important;
}

.tab-bar::-webkit-scrollbar {
  display: none !important;
}

.tab-bar .tab-btn {
  flex: 0 0 auto !important;
  min-width: max-content !important;
  min-height: 46px !important;
  padding: 11px 14px !important;
  border-radius: 14px !important;
  font-size: 0.92rem !important;
  font-weight: 650 !important;
  letter-spacing: -0.01em;
  white-space: nowrap !important;
  scroll-snap-align: start;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease !important;
}

html:not([data-theme="dark"]) .tab-bar,
html[data-theme="light"] .tab-bar {
  background: var(--bw-nav-light-bg) !important;
  border: 1px solid var(--bw-nav-light-border) !important;
  box-shadow: var(--bw-nav-light-shadow) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
}

html:not([data-theme="dark"]) .tab-bar .tab-btn,
html[data-theme="light"] .tab-bar .tab-btn {
  background: transparent !important;
  color: var(--bw-nav-light-muted) !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
}

html:not([data-theme="dark"]) .tab-bar .tab-btn:hover,
html[data-theme="light"] .tab-bar .tab-btn:hover {
  background: #F4F7FB !important;
  color: var(--bw-nav-light-text) !important;
  border-color: #DCE6F2 !important;
}

html:not([data-theme="dark"]) .tab-bar .tab-btn.active,
html[data-theme="light"] .tab-bar .tab-btn.active {
  background: var(--bw-nav-light-pill) !important;
  color: #FFFFFF !important;
  border-color: transparent !important;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24) !important;
}

[data-theme="dark"] .tab-bar {
  background: var(--bw-nav-dark-bg) !important;
  border: 1px solid var(--bw-nav-dark-border) !important;
  box-shadow: var(--bw-nav-dark-shadow) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
}

[data-theme="dark"] .tab-bar .tab-btn {
  background: linear-gradient(180deg, rgba(19,24,37,0.95), rgba(14,18,29,0.98)) !important;
  color: var(--bw-nav-dark-text) !important;
  border: 1px solid rgba(255,255,255,0.07) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03) !important;
}

[data-theme="dark"] .tab-bar .tab-btn:hover {
  background: linear-gradient(180deg, rgba(24,30,45,0.98), rgba(17,22,35,0.98)) !important;
  border-color: rgba(121,168,255,0.22) !important;
  color: #F8FBFF !important;
}

[data-theme="dark"] .tab-bar .tab-btn.active {
  background: var(--bw-nav-dark-pill) !important;
  color: #EFF6FF !important;
  border-color: rgba(147,197,253,0.16) !important;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.24) !important;
}

@media (max-width: 899px) {
  body {
    padding-bottom: 104px;
  }

  .tab-bar {
    width: calc(100% - 14px) !important;
    bottom: 8px !important;
    padding-inline: 8px !important;
    gap: 6px !important;
    border-radius: 18px !important;
  }

  .tab-bar .tab-btn {
    min-height: 44px !important;
    padding: 10px 12px !important;
    font-size: 0.88rem !important;
  }
}

@media (min-width: 900px) {
  body {
    padding-bottom: 128px;
  }

  .tab-bar {
    width: auto !important;
    min-width: min(720px, calc(100% - 40px)) !important;
    max-width: 920px !important;
    justify-content: center !important;
    bottom: 22px !important;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom)) !important;
    border-radius: 18px !important;
  }

  .tab-bar .tab-btn {
    padding-inline: 15px !important;
  }
}


/* === v213 PATCH 5 — Input System Lock (cumulativa da v210) === */
:root {
  --bw-input-radius: 14px;
  --bw-input-min-height: 48px;
  --bw-input-border-light: #DCE6F2;
  --bw-input-border-light-hover: #C7D8EA;
  --bw-input-surface-light: #FFFFFF;
  --bw-input-surface-light-soft: #F8FBFF;
  --bw-input-text-light: #10233E;
  --bw-input-placeholder-light: #5E718B;
  --bw-input-focus-ring-light: 0 0 0 4px rgba(37, 99, 235, 0.10);
  --bw-input-border-dark: rgba(255,255,255,0.10);
  --bw-input-border-dark-hover: rgba(147,197,253,0.20);
  --bw-input-surface-dark: #141B2D;
  --bw-input-surface-dark-soft: #182133;
  --bw-input-text-dark: #E6EEF8;
  --bw-input-placeholder-dark: #8CA0BC;
  --bw-input-focus-ring-dark: 0 0 0 4px rgba(96, 165, 250, 0.12);
}

select,
textarea,
#searchExpenses,
#searchCategory,
.chat-input,
.goal-input,
.initial-input,
.language-select,
.review-select,
.csv-mapping-select,
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]) {
  min-height: var(--bw-input-min-height) !important;
  border-radius: var(--bw-input-radius) !important;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease !important;
}

textarea { min-height: 112px !important; }

select,
.language-select,
.review-select,
.csv-mapping-select,
#searchCategory {
  -webkit-appearance: none !important;
  appearance: none !important;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 19px) calc(50% - 3px),
    calc(100% - 13px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 38px !important;
}

html:not([data-theme="dark"]) select,
html:not([data-theme="dark"]) textarea,
html:not([data-theme="dark"]) #searchExpenses,
html:not([data-theme="dark"]) #searchCategory,
html:not([data-theme="dark"]) .chat-input,
html:not([data-theme="dark"]) .goal-input,
html:not([data-theme="dark"]) .initial-input,
html:not([data-theme="dark"]) .language-select,
html:not([data-theme="dark"]) .review-select,
html:not([data-theme="dark"]) .csv-mapping-select,
html:not([data-theme="dark"]) input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]) {
  background-color: var(--bw-input-surface-light) !important;
  color: var(--bw-input-text-light) !important;
  border: 1px solid var(--bw-input-border-light) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.84) !important;
}

html:not([data-theme="dark"]) .chat-input-area,
html:not([data-theme="dark"]) .goal-input-container,
html:not([data-theme="dark"]) .initial-savings-container {
  background: var(--bw-input-surface-light-soft) !important;
  border: 1px solid var(--bw-input-border-light) !important;
}

html:not([data-theme="dark"]) select:hover,
html:not([data-theme="dark"]) textarea:hover,
html:not([data-theme="dark"]) #searchExpenses:hover,
html:not([data-theme="dark"]) #searchCategory:hover,
html:not([data-theme="dark"]) .chat-input:hover,
html:not([data-theme="dark"]) .goal-input:hover,
html:not([data-theme="dark"]) .initial-input:hover,
html:not([data-theme="dark"]) .language-select:hover,
html:not([data-theme="dark"]) .review-select:hover,
html:not([data-theme="dark"]) .csv-mapping-select:hover,
html:not([data-theme="dark"]) input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):hover {
  border-color: var(--bw-input-border-light-hover) !important;
  background-color: #FFFFFF !important;
}

html:not([data-theme="dark"]) select:focus,
html:not([data-theme="dark"]) textarea:focus,
html:not([data-theme="dark"]) #searchExpenses:focus,
html:not([data-theme="dark"]) #searchCategory:focus,
html:not([data-theme="dark"]) .chat-input:focus,
html:not([data-theme="dark"]) .goal-input:focus,
html:not([data-theme="dark"]) .initial-input:focus,
html:not([data-theme="dark"]) .language-select:focus,
html:not([data-theme="dark"]) .review-select:focus,
html:not([data-theme="dark"]) .csv-mapping-select:focus,
html:not([data-theme="dark"]) input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):focus {
  border-color: rgba(37, 99, 235, 0.34) !important;
  box-shadow: var(--bw-input-focus-ring-light) !important;
  outline: none !important;
}

html:not([data-theme="dark"]) input::placeholder,
html:not([data-theme="dark"]) textarea::placeholder {
  color: var(--bw-input-placeholder-light) !important;
}

[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] #searchExpenses,
[data-theme="dark"] #searchCategory,
[data-theme="dark"] .chat-input,
[data-theme="dark"] .goal-input,
[data-theme="dark"] .initial-input,
[data-theme="dark"] .language-select,
[data-theme="dark"] .review-select,
[data-theme="dark"] .csv-mapping-select,
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]) {
  background-color: var(--bw-input-surface-dark) !important;
  color: var(--bw-input-text-dark) !important;
  border: 1px solid var(--bw-input-border-dark) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02) !important;
}

[data-theme="dark"] .chat-input-area,
[data-theme="dark"] .goal-input-container,
[data-theme="dark"] .initial-savings-container {
  background: var(--bw-input-surface-dark-soft) !important;
  border: 1px solid var(--bw-input-border-dark) !important;
}

[data-theme="dark"] select:hover,
[data-theme="dark"] textarea:hover,
[data-theme="dark"] #searchExpenses:hover,
[data-theme="dark"] #searchCategory:hover,
[data-theme="dark"] .chat-input:hover,
[data-theme="dark"] .goal-input:hover,
[data-theme="dark"] .initial-input:hover,
[data-theme="dark"] .language-select:hover,
[data-theme="dark"] .review-select:hover,
[data-theme="dark"] .csv-mapping-select:hover,
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):hover {
  border-color: var(--bw-input-border-dark-hover) !important;
}

[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] #searchExpenses:focus,
[data-theme="dark"] #searchCategory:focus,
[data-theme="dark"] .chat-input:focus,
[data-theme="dark"] .goal-input:focus,
[data-theme="dark"] .initial-input:focus,
[data-theme="dark"] .language-select:focus,
[data-theme="dark"] .review-select:focus,
[data-theme="dark"] .csv-mapping-select:focus,
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):focus {
  border-color: rgba(96, 165, 250, 0.28) !important;
  box-shadow: var(--bw-input-focus-ring-dark) !important;
  outline: none !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder,
[data-theme="dark"] select {
  color: var(--bw-input-placeholder-dark) !important;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: #2563EB;
}

/* === v214 PATCH 6 — Voice UI System (cumulativa sopra nuova base) === */
:root {
  --bw-voice-radius: 18px;
  --bw-voice-btn-height: 52px;
}

.voice-input-container,
.voice-fixed-container {
  border-radius: var(--bw-voice-radius) !important;
  padding: 14px !important;
}

.voice-btn,
.voice-fixed-btn,
.home-voice-btn {
  min-height: var(--bw-voice-btn-height) !important;
  border-radius: 16px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease !important;
}

.voice-btn:hover,
.voice-fixed-btn:hover,
.home-voice-btn:hover {
  transform: translateY(-1px);
}

.voice-status {
  min-height: 46px !important;
  border-radius: 14px !important;
  display: flex !important;
  align-items: center !important;
  line-height: 1.35 !important;
  padding: 10px 12px !important;
}

html:not([data-theme="dark"]) .voice-input-container,
html:not([data-theme="dark"]) .voice-fixed-container {
  background: #FFFFFF !important;
  border: 1px solid #DCE6F2 !important;
  box-shadow: 0 10px 24px rgba(16, 35, 62, 0.06) !important;
}

html:not([data-theme="dark"]) .voice-btn,
html:not([data-theme="dark"]) .voice-fixed-btn,
html:not([data-theme="dark"]) .home-voice-btn {
  background: linear-gradient(180deg, #2563EB 0%, #1D4ED8 100%) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(37, 99, 235, 0.18) !important;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22) !important;
}

html:not([data-theme="dark"]) .voice-btn.listening,
html:not([data-theme="dark"]) .voice-fixed-btn.listening,
html:not([data-theme="dark"]) .home-voice-btn.listening {
  background: linear-gradient(180deg, #1D4ED8 0%, #1E3A8A 100%) !important;
  box-shadow: 0 14px 28px rgba(29, 78, 216, 0.28) !important;
}

html:not([data-theme="dark"]) .voice-status {
  background: #F8FBFF !important;
  color: #5E718B !important;
  border: 1px solid #DCE6F2 !important;
}

[data-theme="dark"] .voice-input-container,
[data-theme="dark"] .voice-fixed-container {
  border: 1px solid rgba(255,255,255,0.08) !important;
  box-shadow: 0 16px 32px rgba(0,0,0,0.22) !important;
}

[data-theme="dark"] .voice-btn,
[data-theme="dark"] .voice-fixed-btn,
[data-theme="dark"] .home-voice-btn {
  border: 1px solid rgba(121,168,255,0.16) !important;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.24) !important;
}

[data-theme="dark"] .voice-status {
  border: 1px solid rgba(255,255,255,0.08) !important;
  color: #AFC0D8 !important;
}

@media (max-width: 899px) {
  .voice-btn,
  .voice-fixed-btn,
  .home-voice-btn {
    width: 100% !important;
  }

  .voice-status {
    font-size: 0.94rem !important;
  }
}


/* === v215 PATCH 7 — Home / KPI / Forecast visual polish (cumulativa sopra v214) === */
:root {
  --bw-home-radius-lg: 24px;
  --bw-home-radius-md: 18px;
  --bw-home-shadow-light: 0 14px 34px rgba(16, 35, 62, 0.08);
  --bw-home-shadow-dark: 0 18px 38px rgba(0, 0, 0, 0.24);
}

.home-hero-card,
.home-quick-card,
.forecast-card,
.home-score-card {
  border-radius: var(--bw-home-radius-lg) !important;
}

.hero-card-header,
.forecast-card .section-header,
.home-score-card .section-header,
.home-quick-card .section-header {
  align-items: flex-start;
}

.hero-period-line,
.home-quick-hint,
.forecast-subtitle,
.wise-score-meta,
.safe-to-spend-hint,
.forecast-simulator-hint {
  line-height: 1.45;
}

.hero-main,
.forecast-value,
.wise-score-value {
  letter-spacing: -0.035em;
}

.hero-main {
  line-height: 0.98;
}

.forecast-value,
.safe-to-spend-value,
.wise-score-value {
  line-height: 1.02;
}

.home-hero-card .hero-meta-grid,
.forecast-grid-evolved,
.forecast-risk-stack,
.forecast-simulator-grid,
.wise-pillars {
  gap: 14px !important;
}

.wise-score-main,
.forecast-main-card,
.home-priority-card,
.safe-to-spend-card,
.forecast-risk-day-card,
.forecast-simulator-card,
.wise-pillar-row {
  border-radius: var(--bw-home-radius-md) !important;
}

html:not([data-theme="dark"]) .home-hero-card,
html:not([data-theme="dark"]) .home-quick-card,
html:not([data-theme="dark"]) .forecast-card,
html:not([data-theme="dark"]) .home-score-card {
  background: linear-gradient(180deg, #FFFFFF 0%, #FBFDFF 100%) !important;
  border: 1px solid #DCE6F2 !important;
  box-shadow: var(--bw-home-shadow-light) !important;
}

html:not([data-theme="dark"]) .home-hero-card {
  background: linear-gradient(180deg, #FFFFFF 0%, #F7FAFE 100%) !important;
}

html:not([data-theme="dark"]) .hero-card-header,
html:not([data-theme="dark"]) .forecast-card .section-header,
html:not([data-theme="dark"]) .home-score-card .section-header,
html:not([data-theme="dark"]) .home-quick-card .section-header {
  padding-bottom: 4px;
}

html:not([data-theme="dark"]) .hero-eyebrow,
html:not([data-theme="dark"]) .home-priority-kicker,
html:not([data-theme="dark"]) .forecast-label,
html:not([data-theme="dark"]) .wise-pillar-name,
html:not([data-theme="dark"]) .wise-score-label {
  color: #5E718B !important;
}

html:not([data-theme="dark"]) .hero-period-line,
html:not([data-theme="dark"]) .forecast-subtitle,
html:not([data-theme="dark"]) .home-quick-hint,
html:not([data-theme="dark"]) .wise-score-meta,
html:not([data-theme="dark"]) .safe-to-spend-hint,
html:not([data-theme="dark"]) .forecast-simulator-hint,
html:not([data-theme="dark"]) .forecast-simulator-empty {
  color: #6E8098 !important;
}

html:not([data-theme="dark"]) .hero-main,
html:not([data-theme="dark"]) .forecast-value,
html:not([data-theme="dark"]) .forecast-side-value,
html:not([data-theme="dark"]) .safe-to-spend-value,
html:not([data-theme="dark"]) .wise-score-value,
html:not([data-theme="dark"]) .wise-score-status,
html:not([data-theme="dark"]) .wise-pillar-value,
html:not([data-theme="dark"]) .hero-meta-value {
  color: #10233E !important;
}

html:not([data-theme="dark"]) .hero-main {
  font-size: clamp(2.2rem, 4.4vw, 3.2rem) !important;
}

html:not([data-theme="dark"]) .forecast-value,
html:not([data-theme="dark"]) .wise-score-value {
  font-size: clamp(2rem, 4vw, 2.8rem) !important;
}

html:not([data-theme="dark"]) .hero-meta-card,
html:not([data-theme="dark"]) .forecast-main-card,
html:not([data-theme="dark"]) .forecast-side-card,
html:not([data-theme="dark"]) .safe-to-spend-card,
html:not([data-theme="dark"]) .forecast-risk-day-card,
html:not([data-theme="dark"]) .forecast-simulator-card,
html:not([data-theme="dark"]) .forecast-simulator-metric,
html:not([data-theme="dark"]) .wise-score-main,
html:not([data-theme="dark"]) .wise-pillar-row {
  background: #F8FBFF !important;
  border: 1px solid #DCE6F2 !important;
  box-shadow: 0 6px 18px rgba(16, 35, 62, 0.05) !important;
}

html:not([data-theme="dark"]) .forecast-main-card {
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FBFF 100%) !important;
  border-color: rgba(37, 99, 235, 0.18) !important;
}

html:not([data-theme="dark"]) .safe-to-spend-card {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.06) 0%, #F8FBFF 100%) !important;
}

html:not([data-theme="dark"]) .home-priority-card {
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FBFF 100%) !important;
  border: 1px solid rgba(37, 99, 235, 0.16) !important;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.10) !important;
}

html:not([data-theme="dark"]) .home-manual-btn {
  background: #FFFFFF !important;
  color: #1D4ED8 !important;
  border: 1px solid rgba(37, 99, 235, 0.20) !important;
}

html:not([data-theme="dark"]) .wise-score-ring {
  background: radial-gradient(circle at 50% 35%, rgba(255,255,255,0.98) 0%, #F8FBFF 72%) !important;
  border: 1px solid #DCE6F2 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 10px 26px rgba(16, 35, 62, 0.08) !important;
}

html:not([data-theme="dark"]) .wise-pillar-bar {
  background: #EAF1F8 !important;
}

html:not([data-theme="dark"]) .wise-pillar-fill {
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.06), 0 4px 10px rgba(37, 99, 235, 0.18) !important;
}

html:not([data-theme="dark"]) .forecast-status,
html:not([data-theme="dark"]) .wise-score-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #DCE6F2;
  background: #FFFFFF;
}

html:not([data-theme="dark"]) .forecast-status.positive,
html:not([data-theme="dark"]) .safe-to-spend-value.positive,
html:not([data-theme="dark"]) .forecast-risk-day-value.positive {
  color: #15803D !important;
}

html:not([data-theme="dark"]) .forecast-status.negative,
html:not([data-theme="dark"]) .safe-to-spend-value.negative {
  color: #B42318 !important;
}

html:not([data-theme="dark"]) .forecast-risk-day-value.negative,
html:not([data-theme="dark"]) .forecast-status.warning {
  color: #B45309 !important;
}

[data-theme="dark"] .home-hero-card,
[data-theme="dark"] .home-quick-card,
[data-theme="dark"] .forecast-card,
[data-theme="dark"] .home-score-card {
  box-shadow: var(--bw-home-shadow-dark) !important;
}

[data-theme="dark"] .home-priority-card,
[data-theme="dark"] .forecast-main-card,
[data-theme="dark"] .safe-to-spend-card,
[data-theme="dark"] .forecast-risk-day-card,
[data-theme="dark"] .forecast-simulator-card,
[data-theme="dark"] .wise-score-main,
[data-theme="dark"] .wise-pillar-row {
  border-color: rgba(148, 163, 184, 0.12) !important;
}

[data-theme="dark"] .hero-main,
[data-theme="dark"] .forecast-value,
[data-theme="dark"] .wise-score-value {
  text-shadow: 0 1px 0 rgba(255,255,255,0.02);
}

@media (max-width: 899px) {
  .home-hero-card,
  .home-quick-card,
  .forecast-card,
  .home-score-card {
    border-radius: 22px !important;
  }

  .hero-main {
    font-size: clamp(2.05rem, 8vw, 2.6rem) !important;
  }

  .forecast-value,
  .wise-score-value {
    font-size: clamp(1.82rem, 7vw, 2.3rem) !important;
  }

  .hero-card-header {
    gap: 12px;
  }

  .forecast-grid-evolved,
  .hero-meta-grid,
  .wise-pillars,
  .forecast-simulator-grid {
    gap: 12px !important;
  }
}


/* ===== PATCH 8 v216 — AI / Tools / Future section alignment (cumulative, zero-regression) ===== */
:root {
  --bw-tools-light-bg: linear-gradient(180deg, #FFFFFF 0%, #F8FBFF 100%);
  --bw-tools-light-soft: #F8FBFF;
  --bw-tools-light-border: #DCE6F2;
  --bw-tools-light-accent: rgba(37, 99, 235, 0.12);
  --bw-tools-dark-bg: linear-gradient(180deg, rgba(17,24,39,0.96), rgba(10,15,26,0.985));
  --bw-tools-dark-soft: linear-gradient(180deg, rgba(255,255,255,0.028), rgba(255,255,255,0.015));
}

html:not([data-theme="dark"]) .section-card[data-tab="tools"],
html:not([data-theme="dark"]) .tools-surface-card,
html:not([data-theme="dark"]) #reportToolsCard,
html:not([data-theme="dark"]) #calendarToolsCard {
  position: relative;
  overflow: hidden;
  background: var(--bw-tools-light-bg) !important;
  border: 1px solid var(--bw-tools-light-border) !important;
  box-shadow: 0 12px 28px rgba(16, 35, 62, 0.07) !important;
}

html:not([data-theme="dark"]) .section-card[data-tab="tools"]::before,
html:not([data-theme="dark"]) .tools-surface-card::before {
  background: linear-gradient(90deg, rgba(37,99,235,0), rgba(37,99,235,0.18), rgba(37,99,235,0)) !important;
}

html:not([data-theme="dark"]) .section-card[data-tab="tools"] > h2,
html:not([data-theme="dark"]) .section-card[data-tab="tools"] .section-content,
html:not([data-theme="dark"]) .tools-surface-card > h2,
html:not([data-theme="dark"]) .tools-surface-card > .section-content,
html:not([data-theme="dark"]) .section-card[data-tab="ai"] > h2,
html:not([data-theme="dark"]) .section-card[data-tab="ai"] .section-content {
  position: relative;
  z-index: 1;
}

html:not([data-theme="dark"]) .section-card[data-tab="tools"] .section-content,
html:not([data-theme="dark"]) .tools-surface-card .section-content,
html:not([data-theme="dark"]) .section-card[data-tab="ai"] .section-content {
  gap: 14px;
}

html:not([data-theme="dark"]) .section-card[data-tab="tools"] .chart-note,
html:not([data-theme="dark"]) .section-card[data-tab="tools"] .subtitle,
html:not([data-theme="dark"]) .section-card[data-tab="tools"] .help-text,
html:not([data-theme="dark"]) .section-card[data-tab="ai"] .chart-note,
html:not([data-theme="dark"]) .section-card[data-tab="ai"] .subtitle {
  color: #5E718B !important;
}

html:not([data-theme="dark"]) .tools-import-card .file-name,
html:not([data-theme="dark"]) .tools-import-card #csvMappingStatus,
html:not([data-theme="dark"]) .tools-import-card .import-advanced,
html:not([data-theme="dark"]) .tools-settings-card .setting-item,
html:not([data-theme="dark"]) .section-card[data-tab="tools"] .color-item,
html:not([data-theme="dark"]) .section-card[data-tab="tools"] .input-group,
html:not([data-theme="dark"]) .section-card[data-tab="tools"] .input-group.half,
html:not([data-theme="dark"]) .section-card[data-tab="tools"] .setting-item,
html:not([data-theme="dark"]) .section-card[data-tab="ai"] .chat-input-area,
html:not([data-theme="dark"]) .section-card[data-tab="ai"] .chat-messages,
html:not([data-theme="dark"]) .section-card[data-tab="ai"] .chat-message.bot,
html:not([data-theme="dark"]) .section-card[data-tab="ai"] .suggestion-chip,
html:not([data-theme="dark"]) .section-card[data-tab="ai"] .insight-card,
html:not([data-theme="dark"]) .future-fixed-section,
html:not([data-theme="dark"]) .future-fixed-row {
  background: var(--bw-tools-light-soft) !important;
  border: 1px solid var(--bw-tools-light-border) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.92) !important;
}

html:not([data-theme="dark"]) .section-card[data-tab="ai"],
html:not([data-theme="dark"]) #aiWidget {
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FBFF 100%) !important;
  border: 1px solid #DCE6F2 !important;
  box-shadow: 0 12px 28px rgba(16, 35, 62, 0.07) !important;
}

html:not([data-theme="dark"]) .chat-container {
  background: #FFFFFF !important;
  border: 1px solid #DCE6F2 !important;
  box-shadow: 0 10px 24px rgba(16, 35, 62, 0.06) !important;
}

html:not([data-theme="dark"]) .chat-messages {
  min-height: 188px;
}

html:not([data-theme="dark"]) .chat-message.bot {
  border-color: #DCE6F2 !important;
  color: #10233E !important;
}

html:not([data-theme="dark"]) .chat-message.user {
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.16) !important;
}

html:not([data-theme="dark"]) .suggestion-chip {
  color: #244A7C !important;
}

html:not([data-theme="dark"]) .suggestion-chip:hover {
  background: #FFFFFF !important;
  border-color: rgba(37, 99, 235, 0.22) !important;
}

html:not([data-theme="dark"]) .ai-suggestion {
  background: linear-gradient(135deg, rgba(37,99,235,0.10), rgba(59,130,246,0.08)) !important;
  border: 1px solid rgba(37,99,235,0.16) !important;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.10) !important;
  color: #10233E !important;
}

html:not([data-theme="dark"]) #aiMessage,
html:not([data-theme="dark"]) .ai-suggestion,
html:not([data-theme="dark"]) .ai-suggestion strong {
  color: #10233E !important;
}

html:not([data-theme="dark"]) .ai-action {
  justify-content: flex-start !important;
}

html:not([data-theme="dark"]) #applyAiSuggestion {
  background: #FFFFFF !important;
  color: #1D4ED8 !important;
  border: 1px solid rgba(37,99,235,0.18) !important;
  box-shadow: 0 8px 18px rgba(37,99,235,0.10) !important;
}

html:not([data-theme="dark"]) .savings-insights {
  gap: 12px !important;
}

html:not([data-theme="dark"]) .insight-card.current-plan {
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FBFF 100%) !important;
}

html:not([data-theme="dark"]) .insight-card.suggestion {
  background: linear-gradient(180deg, rgba(37,99,235,0.07) 0%, #F8FBFF 100%) !important;
  border-color: rgba(37,99,235,0.16) !important;
}

html:not([data-theme="dark"]) #applySuggestionBtn {
  background: #2563EB !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(37,99,235,0.2) !important;
  box-shadow: 0 10px 20px rgba(37,99,235,0.18) !important;
}

html:not([data-theme="dark"]) .future-fixed-section {
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FBFF 100%) !important;
  border: 1px solid #DCE6F2 !important;
  box-shadow: 0 12px 28px rgba(16, 35, 62, 0.07) !important;
}

html:not([data-theme="dark"]) .future-fixed-section.empty {
  background: #F8FBFF !important;
}

html:not([data-theme="dark"]) .future-fixed-title,
html:not([data-theme="dark"]) .future-fixed-name,
html:not([data-theme="dark"]) .future-fixed-total {
  color: #10233E !important;
}

html:not([data-theme="dark"]) .future-fixed-subtitle,
html:not([data-theme="dark"]) .future-fixed-meta,
html:not([data-theme="dark"]) .future-fixed-date,
html:not([data-theme="dark"]) .future-fixed-term,
html:not([data-theme="dark"]) .future-fixed-kicker {
  color: #5E718B !important;
}

html:not([data-theme="dark"]) .future-fixed-row {
  padding: 12px 14px !important;
  border-radius: 16px !important;
}

html:not([data-theme="dark"]) .future-fixed-badge,
html:not([data-theme="dark"]) .list-toggle-btn.future {
  background: rgba(37,99,235,0.08) !important;
  color: #1D4ED8 !important;
  border: 1px solid rgba(37,99,235,0.16) !important;
}

[data-theme="dark"] .section-card[data-tab="tools"],
[data-theme="dark"] .tools-surface-card,
[data-theme="dark"] .section-card[data-tab="ai"],
[data-theme="dark"] #aiWidget,
[data-theme="dark"] .future-fixed-section {
  background: var(--bw-tools-dark-bg) !important;
  border-color: rgba(148, 163, 184, 0.12) !important;
  box-shadow: 0 14px 30px rgba(2,6,23,0.24) !important;
}

[data-theme="dark"] .tools-import-card .file-name,
[data-theme="dark"] .tools-import-card #csvMappingStatus,
[data-theme="dark"] .tools-import-card .import-advanced,
[data-theme="dark"] .tools-settings-card .setting-item,
[data-theme="dark"] .section-card[data-tab="ai"] .chat-input-area,
[data-theme="dark"] .section-card[data-tab="ai"] .chat-messages,
[data-theme="dark"] .section-card[data-tab="ai"] .chat-message.bot,
[data-theme="dark"] .section-card[data-tab="ai"] .suggestion-chip,
[data-theme="dark"] .section-card[data-tab="ai"] .insight-card,
[data-theme="dark"] .future-fixed-row {
  background: var(--bw-tools-dark-soft) !important;
  border-color: rgba(148, 163, 184, 0.10) !important;
}

[data-theme="dark"] .ai-suggestion {
  border-color: rgba(96,165,250,0.16) !important;
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.28) !important;
}

@media (max-width: 899px) {
  html:not([data-theme="dark"]) .section-card[data-tab="tools"],
  html:not([data-theme="dark"]) .tools-surface-card,
  html:not([data-theme="dark"]) .section-card[data-tab="ai"],
  html:not([data-theme="dark"]) #aiWidget,
  html:not([data-theme="dark"]) .future-fixed-section {
    border-radius: 22px !important;
  }

  html:not([data-theme="dark"]) .future-fixed-header,
  html:not([data-theme="dark"]) .future-fixed-right-header,
  html:not([data-theme="dark"]) .section-card[data-tab="ai"] .chat-input-area,
  html:not([data-theme="dark"]) .section-card[data-tab="tools"] .button-group,
  html:not([data-theme="dark"]) .section-card[data-tab="tools"] .import-actions {
    gap: 10px !important;
  }

  html:not([data-theme="dark"]) .future-fixed-row {
    padding: 12px !important;
  }
}


/* === v217 PATCH 9 — Light CTA Contrast Fix (base v216, CSS/UI only) === */
:root {
  --bw-cta-light-bg: linear-gradient(180deg, #FFFFFF 0%, #F8FBFF 100%);
  --bw-cta-light-soft: #F8FBFF;
  --bw-cta-light-border: #DCE6F2;
  --bw-cta-light-text: #17365D;
  --bw-cta-light-text-strong: #10233E;
  --bw-cta-light-blue-bg: linear-gradient(180deg, #F2F7FF 0%, #EAF2FF 100%);
  --bw-cta-light-blue-border: rgba(37, 99, 235, 0.20);
  --bw-cta-light-blue-text: #1D4ED8;
  --bw-cta-light-danger-bg: linear-gradient(180deg, #FFF5F5 0%, #FFEEEE 100%);
  --bw-cta-light-danger-border: rgba(220, 38, 38, 0.16);
  --bw-cta-light-danger-text: #B42318;
}

html:not([data-theme="dark"]) #backupBtn,
html:not([data-theme="dark"]) #restoreBtn,
html:not([data-theme="dark"]) #manageCategoriesBtn,
html:not([data-theme="dark"]) #applyAiSuggestion,
html:not([data-theme="dark"]) #closeCategoryPanelBtn {
  background: var(--bw-cta-light-bg) !important;
  color: var(--bw-cta-light-text) !important;
  border: 1px solid var(--bw-cta-light-border) !important;
  box-shadow: 0 8px 18px rgba(16, 35, 62, 0.07) !important;
  text-shadow: none !important;
}

html:not([data-theme="dark"]) #backupBtn:hover,
html:not([data-theme="dark"]) #restoreBtn:hover,
html:not([data-theme="dark"]) #manageCategoriesBtn:hover,
html:not([data-theme="dark"]) #applyAiSuggestion:hover,
html:not([data-theme="dark"]) #closeCategoryPanelBtn:hover {
  background: #FFFFFF !important;
  border-color: rgba(37, 99, 235, 0.18) !important;
  color: var(--bw-cta-light-text-strong) !important;
}

html:not([data-theme="dark"]) #resetSearchBtn,
html:not([data-theme="dark"]) #dismissAiSuggestion,
html:not([data-theme="dark"]) #aiWidgetBadge {
  background: var(--bw-cta-light-blue-bg) !important;
  color: var(--bw-cta-light-blue-text) !important;
  border: 1px solid var(--bw-cta-light-blue-border) !important;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.08) !important;
  text-decoration: none !important;
  text-shadow: none !important;
}

html:not([data-theme="dark"]) #dismissAiSuggestion,
html:not([data-theme="dark"]) #aiWidgetBadge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 42px;
  padding: 0 14px !important;
  border-radius: 14px !important;
  opacity: 1 !important;
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
}

html:not([data-theme="dark"]) #dismissAiSuggestion:hover,
html:not([data-theme="dark"]) #resetSearchBtn:hover,
html:not([data-theme="dark"]) #aiWidgetBadge:hover {
  background: #FFFFFF !important;
  border-color: rgba(37, 99, 235, 0.24) !important;
  color: #1E40AF !important;
}

html:not([data-theme="dark"]) #resetFixedBtn,
html:not([data-theme="dark"]) #resetDayBtn,
html:not([data-theme="dark"]) #resetAllBtn {
  background: var(--bw-cta-light-danger-bg) !important;
  color: var(--bw-cta-light-danger-text) !important;
  border: 1px solid var(--bw-cta-light-danger-border) !important;
  box-shadow: 0 8px 18px rgba(220, 38, 38, 0.08) !important;
  text-shadow: none !important;
}

html:not([data-theme="dark"]) #resetFixedBtn:hover,
html:not([data-theme="dark"]) #resetDayBtn:hover,
html:not([data-theme="dark"]) #resetAllBtn:hover {
  background: #FFF1F1 !important;
  border-color: rgba(220, 38, 38, 0.22) !important;
  color: #991B1B !important;
}

html:not([data-theme="dark"]) #backupBtn::before,
html:not([data-theme="dark"]) #restoreBtn::before,
html:not([data-theme="dark"]) #manageCategoriesBtn::before,
html:not([data-theme="dark"]) #resetAllBtn::before,
html:not([data-theme="dark"]) #aiWidgetBadge::before,
html:not([data-theme="dark"]) #dismissAiSuggestion::before,
html:not([data-theme="dark"]) #resetSearchBtn::before {
  opacity: 0.92 !important;
}

html:not([data-theme="dark"]) #backupBtn::before,
html:not([data-theme="dark"]) #restoreBtn::before,
html:not([data-theme="dark"]) #manageCategoriesBtn::before,
html:not([data-theme="dark"]) #applyAiSuggestion::before,
html:not([data-theme="dark"]) #closeCategoryPanelBtn::before {
  background-color: #3B82F6 !important;
}

html:not([data-theme="dark"]) #resetFixedBtn::before,
html:not([data-theme="dark"]) #resetDayBtn::before,
html:not([data-theme="dark"]) #resetAllBtn::before {
  background-color: #EF4444 !important;
}

html:not([data-theme="dark"]) #dismissAiSuggestion::before,
html:not([data-theme="dark"]) #aiWidgetBadge::before,
html:not([data-theme="dark"]) #resetSearchBtn::before {
  background-color: #2563EB !important;
}

html:not([data-theme="dark"]) #dismissAiSuggestion,
html:not([data-theme="dark"]) #closeCategoryPanelBtn {
  width: auto !important;
}


/* ===== PATCH 11 v219 — Analysis Goal Card Mobile Fix (from available v217 base; CSS-only) ===== */
html:not([data-theme="dark"]) .analysis-savings-card .savings-widget {
  background: linear-gradient(180deg, #FFFFFF 0%, #FBFDFF 100%) !important;
  border: 1px solid #DCE6F2 !important;
}

html:not([data-theme="dark"]) .analysis-savings-card .widget-header {
  background: linear-gradient(135deg, #55B8F7 0%, #3B82F6 100%) !important;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 10px 22px rgba(59, 130, 246, 0.16);
}

html:not([data-theme="dark"]) .analysis-savings-card .widget-info {
  min-width: 0;
}

html:not([data-theme="dark"]) .analysis-savings-card #savingsWidgetTitle,
html:not([data-theme="dark"]) .analysis-savings-card .widget-info h3 {
  color: #10233E !important;
  font-size: clamp(1.15rem, 4.7vw, 1.7rem) !important;
  line-height: 1.12 !important;
  letter-spacing: -0.02em;
  max-width: 11ch;
  text-wrap: balance;
}

html:not([data-theme="dark"]) .analysis-savings-card .target-date {
  color: rgba(16, 35, 62, 0.68) !important;
  font-size: clamp(0.92rem, 3.4vw, 1.02rem) !important;
  line-height: 1.2;
}

html:not([data-theme="dark"]) .analysis-savings-card .pig-icon-container {
  width: 64px;
  min-width: 64px;
  height: 64px;
}

html:not([data-theme="dark"]) .analysis-savings-card .progress-ring svg {
  width: 64px;
  height: 64px;
}

html:not([data-theme="dark"]) .analysis-savings-card .progress-percentage {
  color: #F8FAFC !important;
}

@media (max-width: 430px) {
  html:not([data-theme="dark"]) .analysis-savings-card .savings-widget {
    padding: 18px !important;
    border-radius: 20px !important;
  }

  html:not([data-theme="dark"]) .analysis-savings-card .widget-header {
    grid-template-columns: 60px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 14px !important;
    border-radius: 18px !important;
  }

  html:not([data-theme="dark"]) .analysis-savings-card .pig-icon-container {
    width: 60px;
    min-width: 60px;
    height: 60px;
  }

  html:not([data-theme="dark"]) .analysis-savings-card .progress-ring svg {
    width: 60px;
    height: 60px;
  }

  html:not([data-theme="dark"]) .analysis-savings-card #savingsWidgetTitle,
  html:not([data-theme="dark"]) .analysis-savings-card .widget-info h3 {
    font-size: clamp(1.02rem, 5vw, 1.28rem) !important;
    line-height: 1.08 !important;
    max-width: 10ch;
    margin-bottom: 2px !important;
  }

  html:not([data-theme="dark"]) .analysis-savings-card .target-date {
    font-size: 0.92rem !important;
  }

  html:not([data-theme="dark"]) .analysis-savings-card .interactive-controls {
    gap: 12px !important;
  }
}

@media (max-width: 380px) {
  html:not([data-theme="dark"]) .analysis-savings-card .widget-header {
    grid-template-columns: 56px minmax(0, 1fr) !important;
    gap: 12px !important;
    padding: 13px !important;
  }

  html:not([data-theme="dark"]) .analysis-savings-card .pig-icon-container {
    width: 56px;
    min-width: 56px;
    height: 56px;
  }

  html:not([data-theme="dark"]) .analysis-savings-card .progress-ring svg {
    width: 56px;
    height: 56px;
  }

  html:not([data-theme="dark"]) .analysis-savings-card #savingsWidgetTitle,
  html:not([data-theme="dark"]) .analysis-savings-card .widget-info h3 {
    font-size: 1rem !important;
    max-width: 9.5ch;
  }

  html:not([data-theme="dark"]) .analysis-savings-card .target-date {
    font-size: 0.88rem !important;
  }
}

/* === v220 PATCH 12 — CTA Hierarchy Light System Fix (base v219, CSS/UI only) === */
:root {
  --bw-light-primary-bg: linear-gradient(180deg, #2563EB 0%, #1D4ED8 100%);
  --bw-light-primary-text: #FFFFFF;
  --bw-light-primary-border: rgba(37, 99, 235, 0.20);
  --bw-light-secondary-bg: linear-gradient(180deg, #FFFFFF 0%, #F8FBFF 100%);
  --bw-light-secondary-text: #17365D;
  --bw-light-secondary-border: #DCE6F2;
  --bw-light-utility-bg: linear-gradient(180deg, #F2F7FF 0%, #EAF2FF 100%);
  --bw-light-utility-text: #1D4ED8;
  --bw-light-utility-border: rgba(37, 99, 235, 0.18);
  --bw-light-danger-bg: linear-gradient(180deg, #FFF7F7 0%, #FFEFEF 100%);
  --bw-light-danger-text: #B42318;
  --bw-light-danger-border: rgba(220, 38, 38, 0.16);
}

html:not([data-theme="dark"]) #applyAiSuggestion,
html:not([data-theme="dark"]) #applySuggestionBtn,
html:not([data-theme="dark"]) #applySaveBtn {
  background: var(--bw-light-primary-bg) !important;
  color: var(--bw-light-primary-text) !important;
  border: 1px solid var(--bw-light-primary-border) !important;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18) !important;
}

html:not([data-theme="dark"]) #backupBtn,
html:not([data-theme="dark"]) #restoreBtn,
html:not([data-theme="dark"]) #manageCategoriesBtn,
html:not([data-theme="dark"]) #closeCategoryPanelBtn {
  background: var(--bw-light-secondary-bg) !important;
  color: var(--bw-light-secondary-text) !important;
  border: 1px solid var(--bw-light-secondary-border) !important;
  box-shadow: 0 8px 18px rgba(16, 35, 62, 0.07) !important;
}

html:not([data-theme="dark"]) #resetSearchBtn,
html:not([data-theme="dark"]) #dismissAiSuggestion,
html:not([data-theme="dark"]) #aiWidgetBadge {
  background: var(--bw-light-utility-bg) !important;
  color: var(--bw-light-utility-text) !important;
  border: 1px solid var(--bw-light-utility-border) !important;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.08) !important;
}

html:not([data-theme="dark"]) #resetFixedBtn,
html:not([data-theme="dark"]) #resetDayBtn,
html:not([data-theme="dark"]) #resetAllBtn {
  background: var(--bw-light-danger-bg) !important;
  color: var(--bw-light-danger-text) !important;
  border: 1px solid var(--bw-light-danger-border) !important;
  box-shadow: 0 8px 18px rgba(220, 38, 38, 0.08) !important;
}

html:not([data-theme="dark"]) #backupBtn,
html:not([data-theme="dark"]) #restoreBtn,
html:not([data-theme="dark"]) #manageCategoriesBtn,
html:not([data-theme="dark"]) #closeCategoryPanelBtn,
html:not([data-theme="dark"]) #resetSearchBtn,
html:not([data-theme="dark"]) #dismissAiSuggestion,
html:not([data-theme="dark"]) #resetFixedBtn,
html:not([data-theme="dark"]) #resetDayBtn,
html:not([data-theme="dark"]) #resetAllBtn,
html:not([data-theme="dark"]) #applyAiSuggestion,
html:not([data-theme="dark"]) #applySuggestionBtn,
html:not([data-theme="dark"]) #applySaveBtn {
  min-height: 46px !important;
  border-radius: 14px !important;
  font-weight: 700 !important;
  text-shadow: none !important;
}

html:not([data-theme="dark"]) #backupBtn:hover,
html:not([data-theme="dark"]) #restoreBtn:hover,
html:not([data-theme="dark"]) #manageCategoriesBtn:hover,
html:not([data-theme="dark"]) #closeCategoryPanelBtn:hover {
  background: #FFFFFF !important;
  border-color: rgba(37, 99, 235, 0.20) !important;
  color: #10233E !important;
}

html:not([data-theme="dark"]) #resetSearchBtn:hover,
html:not([data-theme="dark"]) #dismissAiSuggestion:hover,
html:not([data-theme="dark"]) #aiWidgetBadge:hover {
  background: #FFFFFF !important;
  border-color: rgba(37, 99, 235, 0.24) !important;
  color: #1E40AF !important;
}

html:not([data-theme="dark"]) #resetFixedBtn:hover,
html:not([data-theme="dark"]) #resetDayBtn:hover,
html:not([data-theme="dark"]) #resetAllBtn:hover {
  background: #FFF1F1 !important;
  border-color: rgba(220, 38, 38, 0.22) !important;
  color: #991B1B !important;
}

html:not([data-theme="dark"]) #backupBtn::before,
html:not([data-theme="dark"]) #restoreBtn::before,
html:not([data-theme="dark"]) #manageCategoriesBtn::before,
html:not([data-theme="dark"]) #closeCategoryPanelBtn::before {
  background-color: #3B82F6 !important;
}

html:not([data-theme="dark"]) #resetSearchBtn::before,
html:not([data-theme="dark"]) #dismissAiSuggestion::before,
html:not([data-theme="dark"]) #aiWidgetBadge::before {
  background-color: #2563EB !important;
  opacity: 0.92 !important;
}

html:not([data-theme="dark"]) #resetFixedBtn::before,
html:not([data-theme="dark"]) #resetDayBtn::before,
html:not([data-theme="dark"]) #resetAllBtn::before {
  background-color: #EF4444 !important;
}

html:not([data-theme="dark"]) #applyAiSuggestion::before,
html:not([data-theme="dark"]) #applySuggestionBtn::before,
html:not([data-theme="dark"]) #applySaveBtn::before {
  background-color: #EFF6FF !important;
}

html:not([data-theme="dark"]) #aiWidgetBadge {
  min-height: 36px !important;
  padding: 0 12px !important;
  border-radius: 999px !important;
  font-size: 0.82rem !important;
  letter-spacing: 0.02em !important;
}

/* === v221 PATCH 13 — Functional UI Regression Fix === */
body.privacy-hidden .privacy-sensitive-runtime {
  color: transparent !important;
  text-shadow: 0 0 10px rgba(79, 124, 255, 0.65) !important;
  filter: blur(4px);
  user-select: none;
}

body.privacy-hidden .privacy-sensitive-runtime.positive,
body.privacy-hidden .privacy-sensitive-runtime.negative {
  color: transparent !important;
}

#chartLegend.is-collapsed,
#chartLegend[hidden] {
  display: none !important;
}

html:not([data-theme="dark"]) #categoryPrintPanel {
  background: #ffffff !important;
  border: 1px solid #dce6f2 !important;
  box-shadow: 0 12px 28px rgba(16, 35, 62, 0.08) !important;
  color: #10233e !important;
}

html:not([data-theme="dark"]) #categoryPrintPanel::before {
  display: none !important;
}

html:not([data-theme="dark"]) #categoryPrintPanel .category-print-panel__eyebrow {
  color: #2563eb !important;
}

html:not([data-theme="dark"]) #categoryPrintPanel h3,
html:not([data-theme="dark"]) #categoryPrintPanel .chart-note,
html:not([data-theme="dark"]) #categoryPrintPanel .category-print-kpi strong {
  color: #10233e !important;
}

html:not([data-theme="dark"]) #categoryPrintPanel .category-print-kpi {
  background: #f8fbff !important;
  border: 1px solid #dce6f2 !important;
}

html:not([data-theme="dark"]) #categoryPrintPanel .category-print-kpi span {
  color: #5e718b !important;
}

html:not([data-theme="dark"]) #categoryPrintPanel .btn-secondary.analysis-inline-btn {
  background: #eef4ff !important;
  color: #20406f !important;
  border: 1px solid #cfe0f7 !important;
  box-shadow: none !important;
}

html:not([data-theme="dark"]) #categoryPrintPanel .btn-secondary.analysis-inline-btn:hover,
html:not([data-theme="dark"]) #categoryPrintPanel .btn-secondary.analysis-inline-btn:focus-visible {
  background: #e4efff !important;
  color: #173766 !important;
}

html:not([data-theme="dark"]) #categoryPrintPanel .category-print-panel__cta .btn-primary {
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.18) !important;
}


/* === v222 PATCH 14 — Tools Card Layout Fix (base v221, CSS/UI only) === */
html:not([data-theme="dark"]) #reportToolsCard .section-content,
html:not([data-theme="dark"]) #calendarToolsCard .section-content,
html:not([data-theme="dark"]) .tools-settings-card .section-content {
  gap: 12px !important;
}

html:not([data-theme="dark"]) #reportToolsCard .chart-note,
html:not([data-theme="dark"]) #calendarToolsCard .chart-note {
  display: block !important;
  min-height: 0 !important;
  padding: 12px 14px !important;
  border-radius: 14px !important;
  text-align: left !important;
  line-height: 1.42 !important;
}

html:not([data-theme="dark"]) #reportToolsCard .chart-note::before,
html:not([data-theme="dark"]) #calendarToolsCard .chart-note::before {
  display: none !important;
}

html:not([data-theme="dark"]) #reportToolsCard .button-group,
html:not([data-theme="dark"]) #calendarToolsCard .button-group,
html:not([data-theme="dark"]) .tools-settings-card .setting-item .button-group {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px !important;
  width: 100% !important;
}

html:not([data-theme="dark"]) #reportToolsCard .button-group > *,
html:not([data-theme="dark"]) #calendarToolsCard .button-group > *,
html:not([data-theme="dark"]) .tools-settings-card .setting-item .button-group > * {
  min-width: 0 !important;
}

html:not([data-theme="dark"]) #openReportBtn,
html:not([data-theme="dark"]) #refreshReportBtn,
html:not([data-theme="dark"]) #exportCalendarBtn,
html:not([data-theme="dark"]) #backupBtn,
html:not([data-theme="dark"]) #restoreBtn,
html:not([data-theme="dark"]) #resetColorsBtn {
  width: 100% !important;
  min-width: 0 !important;
  padding-inline: 14px !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
  text-align: center !important;
}

html:not([data-theme="dark"]) #resetColorsBtn {
  background: var(--bw-light-utility-bg, linear-gradient(180deg, #F2F7FF 0%, #EAF2FF 100%)) !important;
  color: var(--bw-light-utility-text, #1D4ED8) !important;
  border: 1px solid var(--bw-light-utility-border, rgba(37, 99, 235, 0.18)) !important;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.08) !important;
  text-shadow: none !important;
}

html:not([data-theme="dark"]) #resetColorsBtn:hover {
  background: #FFFFFF !important;
  color: #1E40AF !important;
  border-color: rgba(37, 99, 235, 0.24) !important;
}

@media (max-width: 430px) {
  html:not([data-theme="dark"]) #reportToolsCard .chart-note,
  html:not([data-theme="dark"]) #calendarToolsCard .chart-note {
    padding: 10px 12px !important;
    font-size: 0.94rem !important;
    line-height: 1.35 !important;
  }

  html:not([data-theme="dark"]) #reportToolsCard .button-group,
  html:not([data-theme="dark"]) #calendarToolsCard .button-group,
  html:not([data-theme="dark"]) .tools-settings-card .setting-item .button-group {
    grid-template-columns: 1fr !important;
  }

  html:not([data-theme="dark"]) #openReportBtn,
  html:not([data-theme="dark"]) #refreshReportBtn,
  html:not([data-theme="dark"]) #exportCalendarBtn,
  html:not([data-theme="dark"]) #backupBtn,
  html:not([data-theme="dark"]) #restoreBtn,
  html:not([data-theme="dark"]) #resetColorsBtn {
    min-height: 44px !important;
    padding-inline: 12px !important;
    font-size: 0.96rem !important;
  }
}


/* === v223 PATCH 15 — Financial Numbers & Insights Contrast Fix === */
html:not([data-theme="dark"]) .forecast-simulator-metric .forecast-label,
html:not([data-theme="dark"]) #forecastSimulatorForecastLabel,
html:not([data-theme="dark"]) #forecastSimulatorBudgetLabel {
  color: #5E718B !important;
}

html:not([data-theme="dark"]) .forecast-simulator-value,
html:not([data-theme="dark"]) #forecastSimulatorForecastValue,
html:not([data-theme="dark"]) #forecastSimulatorBudgetValue {
  color: #10233E !important;
  font-weight: 800 !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

html:not([data-theme="dark"]) .forecast-simulator-value.negative,
html:not([data-theme="dark"]) #forecastSimulatorForecastValue.negative,
html:not([data-theme="dark"]) #forecastSimulatorBudgetValue.negative {
  color: #C2410C !important;
}

html:not([data-theme="dark"]) .insight-card.suggestion,
html:not([data-theme="dark"]) #suggestionCard {
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.96) 0%, #F8FBFF 100%) !important;
  border-color: rgba(59, 130, 246, 0.18) !important;
}

html:not([data-theme="dark"]) .insight-card.suggestion h4,
html:not([data-theme="dark"]) #suggestionTitle {
  color: #10233E !important;
  font-weight: 700 !important;
  opacity: 1 !important;
}

html:not([data-theme="dark"]) .insight-card.suggestion p,
html:not([data-theme="dark"]) #suggestionMessage {
  color: #5E718B !important;
  font-weight: 500 !important;
  opacity: 1 !important;
}


/* === v224 PATCH 16 — Fisse / Variabili Micro Polish (base v223, CSS/UI only) === */
html:not([data-theme="dark"]) #resetFixedBtn,
html:not([data-theme="dark"]) #resetDayBtn {
  min-height: 44px !important;
  padding: 11px 16px !important;
  font-size: 0.96rem !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
}

html:not([data-theme="dark"]) #addFixedBtn,
html:not([data-theme="dark"]) #addExpenseBtn,
html:not([data-theme="dark"]) #resetSearchBtn {
  min-height: 44px !important;
  padding: 11px 16px !important;
  font-size: 0.96rem !important;
  line-height: 1.2 !important;
}

html:not([data-theme="dark"]) #resetSearchBtn {
  border-radius: 12px !important;
  justify-content: center !important;
  text-align: center !important;
  white-space: normal !important;
}

html:not([data-theme="dark"]) .list-toggle-btn.future,
html:not([data-theme="dark"]) .future-fixed-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  line-height: 1.12 !important;
  letter-spacing: 0 !important;
  font-weight: 700 !important;
}

html:not([data-theme="dark"]) .list-toggle-btn.future {
  min-height: 34px !important;
  padding: 7px 12px !important;
  border-radius: 999px !important;
  font-size: 0.78rem !important;
}

html:not([data-theme="dark"]) .future-fixed-badge {
  min-height: 28px !important;
  padding: 5px 10px !important;
  border-radius: 999px !important;
  font-size: 0.72rem !important;
  background: rgba(37,99,235,0.07) !important;
  color: #1D4ED8 !important;
  border: 1px solid rgba(37,99,235,0.14) !important;
}

html:not([data-theme="dark"]) .section-card[data-tab="variable"] .section-content {
  gap: 12px !important;
}

html:not([data-theme="dark"]) .section-card[data-tab="variable"] .voice-input-container {
  padding: 14px !important;
}

html:not([data-theme="dark"]) .section-card[data-tab="variable"] .voice-row {
  gap: 8px !important;
}

html:not([data-theme="dark"]) .section-card[data-tab="variable"] #addExpenseBtn,
html:not([data-theme="dark"]) .section-card[data-tab="variable"] #resetDayBtn {
  margin-top: 0 !important;
}

html:not([data-theme="dark"]) .section-card[data-tab="variable"] .search-container {
  padding: 12px !important;
}

html:not([data-theme="dark"]) .section-card[data-tab="fixed"] .button-group,
html:not([data-theme="dark"]) .section-card[data-tab="variable"] .button-group {
  gap: 8px !important;
}

@media (max-width: 430px) {
  html:not([data-theme="dark"]) .list-toggle-btn.future {
    min-height: 32px !important;
    padding: 6px 10px !important;
    font-size: 0.74rem !important;
  }

  html:not([data-theme="dark"]) .future-fixed-badge {
    min-height: 26px !important;
    padding: 4px 8px !important;
    font-size: 0.68rem !important;
  }

  html:not([data-theme="dark"]) .future-fixed-right-header {
    gap: 6px !important;
  }

  html:not([data-theme="dark"]) .section-card[data-tab="variable"] .search-container > div:first-child {
    gap: 8px !important;
  }

  html:not([data-theme="dark"]) .section-card[data-tab="variable"] .search-container {
    padding: 10px !important;
  }

  html:not([data-theme="dark"]) .section-card[data-tab="variable"] #resetSearchBtn,
  html:not([data-theme="dark"]) #addExpenseBtn,
  html:not([data-theme="dark"]) #resetDayBtn,
  html:not([data-theme="dark"]) #addFixedBtn,
  html:not([data-theme="dark"]) #resetFixedBtn {
    font-size: 0.93rem !important;
  }
}


/* === v225 PATCH 16.1 — Suggestion Percentage Contrast Fix (base v224, CSS/UI only) === */
html:not([data-theme="dark"]) #suggestionMessage strong,
html:not([data-theme="dark"]) .insight-card.suggestion p strong,
html:not([data-theme="dark"]) .insight-card.suggestion strong {
  color: #10233E !important;
  font-weight: 700 !important;
  opacity: 1 !important;
}


/* PATCH 16.2 — Suggestion number rendering fix */
html:not([data-theme="dark"]) #suggestionMessage .suggestion-value {
  color: #10233E !important;
  font-weight: 700 !important;
  opacity: 1 !important;
}
html:not([data-theme="dark"]) #suggestionMessage .suggestion-meta {
  color: #5E718B !important;
  font-weight: 600 !important;
  opacity: 1 !important;
}


/* === v228 PATCH 17 — Premium + AI + Mobile Density Cleanup (base v227, CSS/UI only) === */
html:not([data-theme="dark"]) #premiumBanner,
html:not([data-theme="dark"]) .premium-banner,
html:not([data-theme="dark"]) .premium-banner--fintech {
  background: linear-gradient(180deg, #FFFFFF 0%, #F5F9FF 100%) !important;
  border: 1px solid #DCE6F2 !important;
  box-shadow: 0 10px 24px rgba(16, 35, 62, 0.08) !important;
}

html:not([data-theme="dark"]) .premium-content,
html:not([data-theme="dark"]) .premium-content--fintech {
  padding: 12px 14px !important;
  gap: 10px !important;
}

html:not([data-theme="dark"]) .premium-badge {
  background: linear-gradient(180deg, #F2F7FF 0%, #EAF2FF 100%) !important;
  color: #1D4ED8 !important;
  border: 1px solid rgba(37, 99, 235, 0.16) !important;
  box-shadow: none !important;
}

html:not([data-theme="dark"]) .premium-text h3,
html:not([data-theme="dark"]) .premium-text--fintech h3 {
  color: #10233E !important;
}

html:not([data-theme="dark"]) .premium-text p,
html:not([data-theme="dark"]) .premium-text--fintech p {
  color: #5E718B !important;
}

html:not([data-theme="dark"]) .premium-mini-points span {
  background: #F8FBFF !important;
  color: #5E718B !important;
  border: 1px solid #DCE6F2 !important;
  box-shadow: none !important;
}

html:not([data-theme="dark"]) .premium-btn,
html:not([data-theme="dark"]) .premium-btn--fintech {
  min-height: 40px !important;
  padding: 9px 13px !important;
  border-radius: 14px !important;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.16) !important;
}

html:not([data-theme="dark"]) #aiWidgetBadge {
  min-height: 32px !important;
  padding: 0 11px !important;
  font-size: 0.76rem !important;
  letter-spacing: 0.04em !important;
}

html:not([data-theme="dark"]) #dismissAiSuggestion {
  min-height: 40px !important;
  padding: 0 14px !important;
  border-radius: 13px !important;
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FBFF 100%) !important;
  color: #425774 !important;
  border: 1px solid #DCE6F2 !important;
  box-shadow: 0 8px 16px rgba(16, 35, 62, 0.06) !important;
}

html:not([data-theme="dark"]) #dismissAiSuggestion:hover {
  background: #FFFFFF !important;
  color: #10233E !important;
  border-color: rgba(37, 99, 235, 0.18) !important;
}

html:not([data-theme="dark"]) #dismissAiSuggestion::before {
  background-color: #64748B !important;
}

html:not([data-theme="dark"]) #resetColorsBtn {
  min-height: 40px !important;
  padding: 10px 14px !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, #F8FBFF 0%, #EEF5FF 100%) !important;
  color: #1D4ED8 !important;
  border: 1px solid rgba(37, 99, 235, 0.16) !important;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.07) !important;
}

html:not([data-theme="dark"]) .section-card[data-tab="variable"] .section-content > .btn-primary,
html:not([data-theme="dark"]) .section-card[data-tab="variable"] .section-content > .btn-secondary,
html:not([data-theme="dark"]) .section-card[data-tab="variable"] #addExpenseBtn,
html:not([data-theme="dark"]) .section-card[data-tab="variable"] #resetDayBtn {
  min-height: 42px !important;
}

html:not([data-theme="dark"]) .section-card[data-tab="variable"] .button-group {
  gap: 8px !important;
}

html:not([data-theme="dark"]) .footer {
  margin-top: 28px !important;
  padding-bottom: 80px !important;
}

html:not([data-theme="dark"]) #footerFeatures {
  margin-top: .45rem !important;
  opacity: .72 !important;
}

@media (max-width: 430px) {
  html:not([data-theme="dark"]) .premium-banner,
  html:not([data-theme="dark"]) .premium-banner--fintech {
    margin: 10px 0 14px !important;
    border-radius: 18px !important;
  }

  html:not([data-theme="dark"]) .premium-content,
  html:not([data-theme="dark"]) .premium-content--fintech {
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 11px 12px !important;
  }

  html:not([data-theme="dark"]) .premium-text h3,
  html:not([data-theme="dark"]) .premium-text--fintech h3 {
    font-size: 0.95rem !important;
    margin-bottom: 3px !important;
  }

  html:not([data-theme="dark"]) .premium-text p,
  html:not([data-theme="dark"]) .premium-text--fintech p {
    font-size: 0.78rem !important;
    line-height: 1.28 !important;
  }

  html:not([data-theme="dark"]) .premium-mini-points {
    gap: 6px !important;
  }

  html:not([data-theme="dark"]) .premium-mini-points span {
    padding: 6px 10px !important;
    font-size: 0.74rem !important;
  }

  html:not([data-theme="dark"]) .premium-btn,
  html:not([data-theme="dark"]) .premium-btn--fintech {
    width: 100% !important;
    min-height: 40px !important;
    font-size: 0.95rem !important;
  }

  html:not([data-theme="dark"]) #aiWidget .section-header {
    gap: 8px !important;
    align-items: center !important;
  }

  html:not([data-theme="dark"]) #aiWidgetBadge {
    min-height: 30px !important;
    padding: 0 10px !important;
    font-size: 0.72rem !important;
  }

  html:not([data-theme="dark"]) #aiAction {
    gap: 8px !important;
  }

  html:not([data-theme="dark"]) #dismissAiSuggestion,
  html:not([data-theme="dark"]) #applyAiSuggestion {
    min-height: 40px !important;
    font-size: 0.94rem !important;
  }

  html:not([data-theme="dark"]) .section-card[data-tab="variable"] .voice-input-container {
    padding: 12px !important;
  }

  html:not([data-theme="dark"]) .section-card[data-tab="variable"] .section-content {
    gap: 12px !important;
  }

  html:not([data-theme="dark"]) .footer {
    padding-bottom: 92px !important;
  }
}


/* === v229 PATCH 18 — Premium CTA Hierarchy Fix (base v228, CSS/UI only) === */
html:not([data-theme="dark"]) #upgradeBtn,
html:not([data-theme="dark"]) .premium-btn,
html:not([data-theme="dark"]) .premium-btn--fintech {
  background: linear-gradient(180deg, #2F6BFF 0%, #2459E0 100%) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(29, 78, 216, 0.18) !important;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.24) !important;
  min-height: 38px !important;
  padding: 0 14px !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
}

html:not([data-theme="dark"]) #upgradeBtn:hover,
html:not([data-theme="dark"]) .premium-btn:hover,
html:not([data-theme="dark"]) .premium-btn--fintech:hover {
  background: linear-gradient(180deg, #3A77FF 0%, #2A62EB 100%) !important;
  color: #FFFFFF !important;
  border-color: rgba(29, 78, 216, 0.28) !important;
}

html:not([data-theme="dark"]) #premiumBanner .premium-content,
html:not([data-theme="dark"]) .premium-banner .premium-content,
html:not([data-theme="dark"]) .premium-banner--fintech .premium-content--fintech {
  grid-template-columns: auto minmax(0,1fr) auto !important;
  align-items: center !important;
}

html:not([data-theme="dark"]) .premium-trial-box {
  background: linear-gradient(180deg, #F6FAFF 0%, #EDF4FF 100%) !important;
  border: 1px solid #D7E6FF !important;
  box-shadow: 0 12px 24px rgba(16, 35, 62, 0.05) !important;
  text-align: left !important;
}

html:not([data-theme="dark"]) .premium-trial-icon {
  background: linear-gradient(180deg, #EAF2FF 0%, #DCE8FF 100%) !important;
  color: #1D4ED8 !important;
  border: 1px solid rgba(37, 99, 235, 0.14) !important;
}

html:not([data-theme="dark"]) .premium-trial-box h4,
html:not([data-theme="dark"]) .premium-trial-box [data-i18n="freeTrial"] {
  color: #10233E !important;
  font-weight: 700 !important;
}

html:not([data-theme="dark"]) .premium-trial-box p,
html:not([data-theme="dark"]) .premium-trial-box [data-i18n="freeTrialText"] {
  color: #5E718B !important;
  opacity: 1 !important;
}

html:not([data-theme="dark"]) #startTrialBtn,
html:not([data-theme="dark"]) .premium-modal-primary {
  background: linear-gradient(180deg, #2F6BFF 0%, #2459E0 100%) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(29, 78, 216, 0.18) !important;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24) !important;
}

html:not([data-theme="dark"]) #activateLicenseBtn,
html:not([data-theme="dark"]) .premium-modal-secondary {
  background: linear-gradient(180deg, #FFFFFF 0%, #F5F9FF 100%) !important;
  color: #10233E !important;
  border: 1px solid #DCE6F2 !important;
  box-shadow: 0 10px 18px rgba(16, 35, 62, 0.06) !important;
}

html:not([data-theme="dark"]) #closePremiumBtn,
html:not([data-theme="dark"]) .premium-modal-later {
  background: transparent !important;
  color: #5B6F8C !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
}

html:not([data-theme="dark"]) #closePremiumBtn:hover,
html:not([data-theme="dark"]) .premium-modal-later:hover {
  color: #1D4ED8 !important;
}

@media (max-width: 430px) {
  html:not([data-theme="dark"]) #premiumBanner .premium-content,
  html:not([data-theme="dark"]) .premium-banner .premium-content,
  html:not([data-theme="dark"]) .premium-banner--fintech .premium-content--fintech {
    grid-template-columns: auto minmax(0,1fr) auto !important;
    gap: 8px !important;
  }

  html:not([data-theme="dark"]) .premium-badge {
    min-width: 56px !important;
    padding: 6px 8px !important;
    font-size: 0.68rem !important;
  }

  html:not([data-theme="dark"]) .premium-text h3,
  html:not([data-theme="dark"]) .premium-text--fintech h3 {
    font-size: 0.92rem !important;
    line-height: 1.1 !important;
  }

  html:not([data-theme="dark"]) .premium-text p,
  html:not([data-theme="dark"]) .premium-text--fintech p {
    font-size: 0.76rem !important;
  }

  html:not([data-theme="dark"]) #upgradeBtn,
  html:not([data-theme="dark"]) .premium-btn,
  html:not([data-theme="dark"]) .premium-btn--fintech {
    width: auto !important;
    min-width: 88px !important;
    justify-self: end !important;
    font-size: 0.82rem !important;
    padding: 0 12px !important;
  }

  html:not([data-theme="dark"]) .premium-trial-box {
    padding: 14px !important;
    gap: 10px !important;
  }

  html:not([data-theme="dark"]) .premium-trial-box h4 {
    margin-bottom: 4px !important;
    font-size: 1rem !important;
  }

  html:not([data-theme="dark"]) .premium-trial-box p {
    font-size: 0.84rem !important;
    line-height: 1.4 !important;
  }

  html:not([data-theme="dark"]) .premium-modal-primary,
  html:not([data-theme="dark"]) .premium-modal-secondary {
    font-size: 0.98rem !important;
  }
}


/* === v229.1 MICRO PATCH — Premium contrast cleanup (base v229, CSS/UI only) === */
html:not([data-theme="dark"]) .premium-modal-kicker,
html:not([data-theme="dark"]) .premium-modal-title,
html:not([data-theme="dark"]) .premium-modal-subtitle,
html:not([data-theme="dark"]) .premium-text h3,
html:not([data-theme="dark"]) .premium-text p,
html:not([data-theme="dark"]) .premium-trial-box h4,
html:not([data-theme="dark"]) .premium-trial-box p,
html:not([data-theme="dark"]) .premium-trial-box [data-i18n="freeTrial"],
html:not([data-theme="dark"]) .premium-trial-box [data-i18n="freeTrialText"] {
  opacity: 1 !important;
}

html:not([data-theme="dark"]) .premium-modal-kicker {
  color: #2563EB !important;
}

html:not([data-theme="dark"]) .premium-modal-title {
  color: #10233E !important;
  text-shadow: none !important;
}

html:not([data-theme="dark"]) .premium-modal-subtitle {
  color: #5E718B !important;
}

html:not([data-theme="dark"]) .premium-trial-box {
  background: linear-gradient(180deg, #F8FBFF 0%, #EEF5FF 100%) !important;
}

html:not([data-theme="dark"]) .premium-trial-icon,
html:not([data-theme="dark"]) .premium-trial-icon::before {
  color: #2563EB !important;
  background-color: #2563EB !important;
  opacity: 1 !important;
}

html:not([data-theme="dark"]) #upgradeBtn,
html:not([data-theme="dark"]) .premium-btn,
html:not([data-theme="dark"]) .premium-btn--fintech {
  min-width: 96px !important;
  color: #FFFFFF !important;
  opacity: 1 !important;
}

html:not([data-theme="dark"]) #startTrialBtn,
html:not([data-theme="dark"]) .premium-modal-primary {
  color: #FFFFFF !important;
  opacity: 1 !important;
}

html:not([data-theme="dark"]) #startTrialBtn::before,
html:not([data-theme="dark"]) .premium-modal-primary::before,
html:not([data-theme="dark"]) #activateLicenseBtn::before,
html:not([data-theme="dark"]) .premium-modal-secondary::before {
  opacity: 1 !important;
  background-color: currentColor !important;
}

@media (max-width: 430px) {
  html:not([data-theme="dark"]) .premium-modal-title {
    font-size: 1.9rem !important;
    line-height: 1.05 !important;
  }

  html:not([data-theme="dark"]) .premium-modal-subtitle {
    font-size: 0.98rem !important;
  }

  html:not([data-theme="dark"]) #upgradeBtn,
  html:not([data-theme="dark"]) .premium-btn,
  html:not([data-theme="dark"]) .premium-btn--fintech {
    min-width: 94px !important;
    font-size: 0.84rem !important;
  }
}


/* === v229c PATCH 19 — Premium Micro Polish (base v229b, CSS/UI only) === */
.premium-modal-shell {
  border: 1px solid rgba(148, 163, 184, 0.16) !important;
  box-shadow: 0 24px 60px rgba(2, 8, 23, 0.28) !important;
}

.premium-modal-kicker {
  color: #7FB2FF !important;
  letter-spacing: 0.12em !important;
  font-weight: 800 !important;
  opacity: 1 !important;
}

.premium-modal-title {
  color: #F8FBFF !important;
  text-shadow: 0 1px 0 rgba(255,255,255,0.03);
}

.premium-modal-subtitle,
.premium-price-box .period,
.premium-plan-card li span {
  opacity: 1 !important;
}

.premium-modal-subtitle {
  color: #B8C7DB !important;
}

.premium-plan-card--free .premium-plan-chip {
  background: rgba(255,255,255,0.08) !important;
  border-color: rgba(255,255,255,0.10) !important;
  color: #DDE7F5 !important;
}

.premium-plan-chip--accent {
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24) !important;
}

.premium-trial-box {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.30), rgba(59, 130, 246, 0.22)) !important;
  border: 1px solid rgba(147, 197, 253, 0.22) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 16px 34px rgba(2, 8, 23, 0.18) !important;
}

.premium-trial-box h4,
.premium-trial-box p {
  color: #FFFFFF !important;
}

.premium-trial-box p {
  opacity: 0.96 !important;
}

.premium-trial-icon {
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.18), rgba(255,255,255,0.08)) !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), 0 10px 22px rgba(15, 23, 42, 0.16) !important;
  background-size: 20px 20px !important;
}

.premium-modal-secondary {
  color: #EAF2FF !important;
  border-color: rgba(147, 197, 253, 0.24) !important;
}

.premium-modal-later {
  color: #C8D5E6 !important;
}

html:not([data-theme="dark"]) .premium-modal-shell {
  background: linear-gradient(180deg, #FFFFFF 0%, #F7FAFF 100%) !important;
  border: 1px solid #DCE6F2 !important;
  box-shadow: 0 22px 48px rgba(16, 35, 62, 0.16) !important;
}

html:not([data-theme="dark"]) .premium-modal-kicker {
  color: #1D4ED8 !important;
}

html:not([data-theme="dark"]) .premium-modal-title,
html:not([data-theme="dark"]) .premium-plan-head h3,
html:not([data-theme="dark"]) .premium-price-box .amount {
  color: #10233E !important;
  text-shadow: none !important;
}

html:not([data-theme="dark"]) .premium-modal-subtitle,
html:not([data-theme="dark"]) .premium-price-box .period,
html:not([data-theme="dark"]) .premium-plan-card li span {
  color: #526780 !important;
}

html:not([data-theme="dark"]) .premium-plan-card--free .premium-plan-chip {
  background: #F8FBFF !important;
  border-color: #DCE6F2 !important;
  color: #526780 !important;
}

html:not([data-theme="dark"]) .premium-plan-chip--accent {
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.16) !important;
}

html:not([data-theme="dark"]) .premium-trial-box {
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%) !important;
  border: 1px solid rgba(37, 99, 235, 0.20) !important;
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.16) !important;
}

html:not([data-theme="dark"]) .premium-trial-icon {
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.28), rgba(255,255,255,0.14)) !important;
  border: 1px solid rgba(255,255,255,0.20) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 10px 20px rgba(16, 35, 62, 0.14) !important;
}

html:not([data-theme="dark"]) .premium-modal-secondary {
  color: #10233E !important;
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FBFF 100%) !important;
  border-color: #DCE6F2 !important;
}

html:not([data-theme="dark"]) .premium-modal-later {
  color: #5E718B !important;
}

@media (max-width: 430px) {
  .premium-modal-shell {
    box-shadow: 0 18px 38px rgba(2, 8, 23, 0.22) !important;
  }

  .premium-modal-kicker {
    font-size: 0.72rem !important;
  }

  .premium-trial-box {
    gap: 10px !important;
  }

  .premium-trial-icon {
    background-size: 18px 18px !important;
  }
}


/* === v229j PATCH 23A — Home Density Real Fix (CSS/UI only, no logic changes) === */
#subtitle {
  white-space: nowrap;
  font-size: clamp(0.76rem, 2.35vw, 0.98rem) !important;
  line-height: 1.12 !important;
  letter-spacing: -0.015em;
  margin-bottom: 12px !important;
}

#premiumBanner,
.premium-banner,
.premium-banner--fintech {
  margin: 8px 0 12px !important;
}

#premiumBanner .premium-content,
.premium-banner .premium-content,
.premium-banner--fintech .premium-content--fintech {
  padding: 10px 12px !important;
  gap: 8px !important;
  align-items: center !important;
  min-height: 0 !important;
}

#premiumBanner .premium-badge,
.premium-banner .premium-badge {
  min-width: 54px !important;
  padding: 5px 8px !important;
  font-size: 0.66rem !important;
}

#premiumBanner .premium-text h3,
#premiumBanner .premium-text--fintech h3,
.premium-banner .premium-text h3,
.premium-banner--fintech .premium-text--fintech h3 {
  margin-bottom: 2px !important;
  font-size: 0.96rem !important;
  line-height: 1.08 !important;
}

#premiumBanner .premium-text p,
#premiumBanner .premium-text--fintech p,
.premium-banner .premium-text p,
.premium-banner--fintech .premium-text--fintech p {
  font-size: 0.77rem !important;
  line-height: 1.24 !important;
}

#premiumBanner .premium-mini-points,
.premium-banner .premium-mini-points {
  gap: 6px !important;
}

#premiumBanner .premium-mini-points span,
.premium-banner .premium-mini-points span {
  padding: 5px 8px !important;
  font-size: 0.68rem !important;
  line-height: 1 !important;
}

#upgradeBtn,
.premium-btn,
.premium-btn--fintech {
  min-height: 34px !important;
  height: 34px !important;
  padding: 0 12px !important;
  font-size: 0.80rem !important;
  min-width: 84px !important;
  border-radius: 12px !important;
}

html:not([data-theme="dark"]) .premium-modal-subtitle,
html:not([data-theme="dark"]) .premium-plan-card li span,
html:not([data-theme="dark"]) .premium-price-box .period {
  color: #425774 !important;
}

html:not([data-theme="dark"]) .premium-trial-box,
html:not([data-theme="dark"]) .premium-trial-box[style] {
  background: linear-gradient(180deg, #F4F8FF 0%, #EAF2FF 100%) !important;
  border: 1px solid #CFE0FF !important;
}

html:not([data-theme="dark"]) .premium-trial-box h4,
html:not([data-theme="dark"]) .premium-trial-box [data-i18n="freeTrial"] {
  color: #10233E !important;
  font-weight: 800 !important;
}

html:not([data-theme="dark"]) .premium-trial-box p,
html:not([data-theme="dark"]) .premium-trial-box [data-i18n="freeTrialText"] {
  color: #425774 !important;
  font-weight: 600 !important;
}

#homeQuickAddCard .section-content {
  gap: 8px !important;
}

#homeQuickAddCard .home-priority-kicker {
  font-size: 0.64rem !important;
  line-height: 1.05 !important;
  letter-spacing: 0.11em !important;
}

#homeQuickAddCard .home-quick-actions {
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr) !important;
  gap: 8px !important;
}

#homeQuickAddCard .home-voice-btn,
#homeQuickAddCard .home-manual-btn {
  min-height: 38px !important;
  height: 38px !important;
  padding: 0 11px !important;
  border-radius: 13px !important;
  font-size: 0.79rem !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

#homeQuickAddCard .home-voice-btn span,
#homeQuickAddCard .home-manual-btn span {
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
}

#homeQuickAddCard .voice-status {
  min-height: 30px !important;
  padding: 7px 11px !important;
  border-radius: 11px !important;
  font-size: 0.76rem !important;
  line-height: 1.05 !important;
}

#homeQuickAddCard .home-quick-hint {
  font-size: 0.72rem !important;
  margin-top: -1px !important;
}

#wiseScoreHomeCard .wise-score-main {
  gap: 12px !important;
  align-items: center !important;
}

#wiseScoreHomeCard .wise-score-ring {
  min-width: 92px !important;
  min-height: 92px !important;
  border-width: 6px !important;
}

#wiseScoreHomeCard .wise-score-value {
  font-size: 1.62rem !important;
}

#wiseScoreHomeCard .wise-score-label {
  font-size: 0.74rem !important;
  margin-top: 2px !important;
}

#wiseScoreHomeCard .wise-score-meta {
  font-size: 0.84rem !important;
  line-height: 1.3 !important;
}

@media (max-width: 760px) {
  #subtitle {
    font-size: clamp(0.72rem, 2.9vw, 0.90rem) !important;
  }

  #homeQuickAddCard .home-quick-actions {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr) !important;
  }
}

@media (max-width: 430px) {
  #premiumBanner .premium-content,
  .premium-banner .premium-content,
  .premium-banner--fintech .premium-content--fintech {
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    gap: 7px !important;
    padding: 9px 10px !important;
  }

  #premiumBanner .premium-text h3,
  .premium-banner .premium-text h3,
  .premium-banner--fintech .premium-text--fintech h3 {
    font-size: 0.88rem !important;
  }

  #premiumBanner .premium-text p,
  .premium-banner .premium-text p,
  .premium-banner--fintech .premium-text--fintech p {
    font-size: 0.72rem !important;
  }

  #premiumBanner .premium-mini-points span,
  .premium-banner .premium-mini-points span {
    padding: 4px 7px !important;
    font-size: 0.64rem !important;
  }

  #upgradeBtn,
  .premium-btn,
  .premium-btn--fintech {
    min-width: 78px !important;
    font-size: 0.76rem !important;
  }

  #homeQuickAddCard .home-quick-actions {
    grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr) !important;
    gap: 7px !important;
  }

  #homeQuickAddCard .home-voice-btn,
  #homeQuickAddCard .home-manual-btn {
    min-height: 36px !important;
    height: 36px !important;
    padding: 0 9px !important;
    font-size: 0.73rem !important;
  }

  #homeQuickAddCard .voice-status {
    min-height: 28px !important;
    padding: 6px 10px !important;
    font-size: 0.72rem !important;
  }

  #wiseScoreHomeCard .wise-score-ring {
    min-width: 84px !important;
    min-height: 84px !important;
    border-width: 5px !important;
  }

  #wiseScoreHomeCard .wise-score-value {
    font-size: 1.46rem !important;
  }
}


/* ===== PATCH 23B v229k — Fisse + Variabili Readability Fix ===== */
.section-card[data-tab="fixed"] #fixedExpensesList .expense-amount,
.section-card[data-tab="fixed"] #fixedExpensesList .fixed-status-amount,
.section-card[data-tab="variable"] #variableExpensesList .expense-amount,
.section-card[data-tab="variable"] .detail-expense-item .expense-amount {
  color: #0f172a !important;
  font-weight: 800;
  letter-spacing: -0.01em;
}

[data-theme="dark"] .section-card[data-tab="fixed"] #fixedExpensesList .expense-amount,
[data-theme="dark"] .section-card[data-tab="fixed"] #fixedExpensesList .fixed-status-amount,
[data-theme="dark"] .section-card[data-tab="variable"] #variableExpensesList .expense-amount,
[data-theme="dark"] .section-card[data-tab="variable"] .detail-expense-item .expense-amount {
  color: #eef4ff !important;
}

.section-card[data-tab="fixed"] .voice-fixed-container,
.section-card[data-tab="variable"] .voice-input-container {
  padding: 12px 13px !important;
  margin: 12px 0 14px !important;
  border-radius: 16px !important;
}

.section-card[data-tab="fixed"] .voice-fixed-btn,
.section-card[data-tab="variable"] .voice-btn {
  min-height: 42px !important;
  padding: 10px 16px !important;
  border-radius: 14px !important;
  font-size: 0.96rem !important;
  line-height: 1.12 !important;
  gap: 8px !important;
  box-shadow: 0 8px 18px rgba(29,78,216,0.16) !important;
}

.section-card[data-tab="fixed"] #micFixedText,
.section-card[data-tab="variable"] #voiceBtnText {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-card[data-tab="fixed"] #micFixedText::before,
.section-card[data-tab="variable"] #voiceBtnText::before {
  content: "🎤";
  font-size: 0.95em;
  line-height: 1;
  display: inline-block;
}

.section-card[data-tab="fixed"] .voice-status,
.section-card[data-tab="variable"] .voice-status {
  min-height: 38px !important;
  padding: 8px 12px !important;
  border-radius: 12px !important;
  font-size: 0.84rem !important;
  line-height: 1.22 !important;
  color: #334155 !important;
  background: rgba(255,255,255,0.86) !important;
  border-color: rgba(148,163,184,0.24) !important;
}

[data-theme="dark"] .section-card[data-tab="fixed"] .voice-status,
[data-theme="dark"] .section-card[data-tab="variable"] .voice-status {
  color: #dbe7ff !important;
  background: rgba(15,23,42,0.72) !important;
  border-color: rgba(148,163,184,0.16) !important;
}

.section-card[data-tab="fixed"] .voice-fixed-container .voice-status {
  display: block !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-card[data-tab="variable"] .voice-row {
  align-items: center !important;
  gap: 10px !important;
  margin-top: 10px !important;
  flex-wrap: nowrap !important;
}

.section-card[data-tab="variable"] .voice-status {
  flex: 1 1 185px !important;
  display: flex !important;
  align-items: center !important;
  white-space: nowrap;
}

.section-card[data-tab="variable"] .voice-btn {
  flex: 0 1 260px !important;
  min-width: 0 !important;
}

.section-card[data-tab="fixed"] .voice-fixed-btn {
  margin-bottom: 8px !important;
}

.section-card[data-tab="fixed"] .expense-item,
.section-card[data-tab="variable"] .expense-item,
.section-card[data-tab="fixed"] .fixed-status-row {
  border-color: rgba(148,163,184,0.18);
}

[data-theme="light"] .section-card[data-tab="fixed"] .expense-item,
[data-theme="light"] .section-card[data-tab="variable"] .expense-item,
[data-theme="light"] .section-card[data-tab="fixed"] .fixed-status-row {
  background: rgba(255,255,255,0.92);
}

@media (max-width: 680px) {
  .section-card[data-tab="fixed"] .voice-fixed-btn,
  .section-card[data-tab="variable"] .voice-btn {
    font-size: 0.92rem !important;
    padding: 9px 14px !important;
  }

  .section-card[data-tab="variable"] .voice-row {
    gap: 8px !important;
  }

  .section-card[data-tab="variable"] .voice-status {
    flex-basis: 156px !important;
    font-size: 0.81rem !important;
  }
}

@media (max-width: 560px) {
  .section-card[data-tab="fixed"] .voice-fixed-container,
  .section-card[data-tab="variable"] .voice-input-container {
    padding: 10px 11px !important;
  }

  .section-card[data-tab="fixed"] .voice-fixed-btn,
  .section-card[data-tab="variable"] .voice-btn,
  .section-card[data-tab="variable"] .voice-status {
    min-height: 40px !important;
  }

  .section-card[data-tab="variable"] .voice-row {
    flex-wrap: nowrap !important;
  }

  .section-card[data-tab="variable"] #voiceBtnText,
  .section-card[data-tab="fixed"] #micFixedText {
    font-size: 0.9rem;
  }
}

@media (max-width: 430px) {
  .section-card[data-tab="fixed"] #micFixedText,
  .section-card[data-tab="variable"] #voiceBtnText {
    gap: 6px;
    font-size: 0.86rem;
  }

  .section-card[data-tab="fixed"] .voice-status,
  .section-card[data-tab="variable"] .voice-status {
    font-size: 0.78rem !important;
    padding-inline: 10px !important;
  }

  .section-card[data-tab="variable"] .voice-btn {
    flex-basis: 214px !important;
  }

  .section-card[data-tab="variable"] .voice-status {
    flex-basis: 132px !important;
  }
}


/* ===== PATCH 23B1 v229k1 — Voice CTA hotfix (Fisse + Variabili, no logic changes) ===== */
.section-card[data-tab="fixed"] #micFixedText::before,
.section-card[data-tab="variable"] #voiceBtnText::before {
  content: none !important;
  display: none !important;
}

.section-card[data-tab="fixed"] #micFixedBtn::before,
.section-card[data-tab="variable"] #voiceBtn::before {
  content: "" !important;
  display: inline-block !important;
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 18px !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 18px 18px !important;
  opacity: 1 !important;
}

.section-card[data-tab="fixed"] .voice-fixed-btn,
.section-card[data-tab="variable"] .voice-btn {
  width: auto !important;
  align-self: stretch;
}

.section-card[data-tab="fixed"] .voice-fixed-btn {
  min-height: 40px !important;
  padding: 9px 14px !important;
}

.section-card[data-tab="fixed"] #micFixedText,
.section-card[data-tab="variable"] #voiceBtnText {
  white-space: nowrap !important;
}

.section-card[data-tab="variable"] .voice-input-container {
  padding: 10px 11px !important;
}

.section-card[data-tab="variable"] .voice-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
}

.section-card[data-tab="variable"] .voice-btn {
  flex: 0 0 178px !important;
  min-height: 40px !important;
  min-width: 0 !important;
  padding: 9px 12px !important;
  border-radius: 14px !important;
  font-size: 0.9rem !important;
  gap: 7px !important;
  box-shadow: 0 7px 16px rgba(29,78,216,0.14) !important;
}

.section-card[data-tab="variable"] .voice-status {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  min-height: 40px !important;
  padding: 8px 11px !important;
  font-size: 0.8rem !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

@media (max-width: 760px) {
  .section-card[data-tab="variable"] .voice-row {
    flex-direction: row !important;
    align-items: stretch !important;
  }

  .section-card[data-tab="variable"] .voice-btn,
  .section-card[data-tab="variable"] .voice-status {
    width: auto !important;
  }
}

@media (max-width: 430px) {
  .section-card[data-tab="fixed"] .voice-fixed-btn {
    min-height: 38px !important;
    padding: 8px 12px !important;
  }

  .section-card[data-tab="fixed"] #micFixedText,
  .section-card[data-tab="variable"] #voiceBtnText {
    font-size: 0.84rem !important;
  }

  .section-card[data-tab="variable"] .voice-btn {
    flex-basis: 164px !important;
    min-height: 38px !important;
    padding: 8px 10px !important;
  }

  .section-card[data-tab="variable"] .voice-status {
    min-height: 38px !important;
    font-size: 0.76rem !important;
    padding-inline: 9px !important;
  }
}


/* ===== PATCH 23B2 v229k2 — Voice alignment + icon correction ===== */
.section-card[data-tab="fixed"] #micFixedBtn::before,
.section-card[data-tab="variable"] #voiceBtn::before {
  content: "" !important;
  display: inline-block !important;
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 18px !important;
  background-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%2523FFFFFF%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M12%203a3%203%200%200%200-3%203v6a3%203%200%200%200%206%200V6a3%203%200%200%200-3-3Z%27/%3E%3Cpath%20d%3D%27M19%2010v2a7%207%200%200%201-14%200v-2%27/%3E%3Cpath%20d%3D%27M12%2019v3%27/%3E%3Cpath%20d%3D%27M8%2022h8%27/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 18px 18px !important;
  opacity: 0.98 !important;
}

.section-card[data-tab="fixed"] .voice-fixed-container {
  align-items: center !important;
}

.section-card[data-tab="fixed"] .voice-fixed-btn,
.section-card[data-tab="fixed"] .voice-status {
  width: 100% !important;
  max-width: 278px !important;
  margin-inline: auto !important;
}

.section-card[data-tab="fixed"] .voice-fixed-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 8px !important;
}

.section-card[data-tab="fixed"] #micFixedText,
.section-card[data-tab="variable"] #voiceBtnText {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}

.section-card[data-tab="fixed"] .voice-status {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}

.section-card[data-tab="variable"] .voice-row {
  justify-content: center !important;
  align-items: stretch !important;
}

.section-card[data-tab="variable"] .voice-btn,
.section-card[data-tab="variable"] .voice-status {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}

.section-card[data-tab="variable"] .voice-btn {
  flex: 0 1 172px !important;
}

.section-card[data-tab="variable"] .voice-status {
  flex: 0 1 148px !important;
}

@media (max-width: 430px) {
  .section-card[data-tab="fixed"] .voice-fixed-btn,
  .section-card[data-tab="fixed"] .voice-status {
    max-width: 276px !important;
  }

  .section-card[data-tab="variable"] .voice-btn {
    flex-basis: 168px !important;
  }

  .section-card[data-tab="variable"] .voice-status {
    flex-basis: 138px !important;
  }
}


/* ===== PATCH 23B3 v229k3 — Voice centering final hotfix ===== */
.section-card[data-tab="fixed"] .voice-fixed-container {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

.section-card[data-tab="fixed"] .voice-fixed-btn,
.section-card[data-tab="fixed"] .voice-status {
  width: min(100%, 290px) !important;
  max-width: 290px !important;
  margin-inline: auto !important;
}

.section-card[data-tab="fixed"] .voice-fixed-btn {
  margin: 0 auto 10px !important;
  justify-content: center !important;
}

.section-card[data-tab="fixed"] .voice-status {
  margin: 0 auto !important;
  justify-content: center !important;
  text-align: center !important;
}

.section-card[data-tab="fixed"] #micFixedBtn::before,
.section-card[data-tab="variable"] #voiceBtn::before {
  content: none !important;
  display: none !important;
}

.section-card[data-tab="fixed"] .bw-voice-icon,
.section-card[data-tab="variable"] .bw-voice-icon {
  display: inline-block !important;
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 18px !important;
  background-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%2523FFFFFF%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M12%203a3%203%200%200%200-3%203v6a3%203%200%200%200%206%200V6a3%203%200%200%200-3-3Z%27/%3E%3Cpath%20d%3D%27M19%2010v2a7%207%200%200%201-14%200v-2%27/%3E%3Cpath%20d%3D%27M12%2019v3%27/%3E%3Cpath%20d%3D%27M8%2022h8%27/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 18px 18px !important;
  opacity: 0.98 !important;
}

.section-card[data-tab="fixed"] .voice-fixed-btn,
.section-card[data-tab="variable"] .voice-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.section-card[data-tab="fixed"] #micFixedText,
.section-card[data-tab="variable"] #voiceBtnText {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
}

.section-card[data-tab="variable"] .voice-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: stretch !important;
}

.section-card[data-tab="variable"] .voice-btn,
.section-card[data-tab="variable"] .voice-status {
  width: 100% !important;
  min-width: 0 !important;
}

.section-card[data-tab="variable"] .voice-btn {
  margin: 0 !important;
  gap: 8px !important;
}

.section-card[data-tab="variable"] .voice-status {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

@media (max-width: 430px) {
  .section-card[data-tab="fixed"] .voice-fixed-btn,
  .section-card[data-tab="fixed"] .voice-status {
    width: min(100%, 286px) !important;
    max-width: 286px !important;
  }

  .section-card[data-tab="variable"] .voice-row {
    gap: 8px !important;
  }

  .section-card[data-tab="variable"] .voice-btn,
  .section-card[data-tab="variable"] .voice-status {
    min-height: 40px !important;
  }

  .section-card[data-tab="variable"] #voiceBtnText,
  .section-card[data-tab="fixed"] #micFixedText {
    font-size: 0.84rem !important;
  }
}


/* === PATCH 23B4 — voice icon restore + center lock === */
.section-card[data-tab="fixed"] .voice-fixed-container,
.section-card[data-tab="variable"] .voice-input-container {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

.section-card[data-tab="fixed"] .voice-fixed-btn,
.section-card[data-tab="fixed"] .voice-status,
.section-card[data-tab="variable"] .voice-btn,
.section-card[data-tab="variable"] .voice-status {
  place-content: center !important;
  place-items: center !important;
}

.section-card[data-tab="fixed"] .bw-voice-icon,
.section-card[data-tab="variable"] .bw-voice-icon {
  background-image: none !important;
  width: auto !important;
  height: auto !important;
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 15px !important;
  line-height: 1 !important;
  margin-right: 2px !important;
  color: #FFFFFF !important;
}

.section-card[data-tab="fixed"] .voice-fixed-btn {
  padding-inline: 18px !important;
  gap: 8px !important;
}

.section-card[data-tab="fixed"] .voice-status {
  display: flex !important;
  width: min(100%, 282px) !important;
}

.section-card[data-tab="variable"] .voice-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  align-items: center !important;
}

.section-card[data-tab="variable"] .voice-btn,
.section-card[data-tab="variable"] .voice-status {
  min-width: 0 !important;
  width: 100% !important;
  padding-inline: 12px !important;
}

.section-card[data-tab="variable"] .voice-status {
  display: flex !important;
  justify-content: center !important;
  text-align: center !important;
}

@media (max-width: 430px) {
  .section-card[data-tab="variable"] .voice-btn,
  .section-card[data-tab="variable"] .voice-status {
    font-size: 0.84rem !important;
  }
}


/* === PATCH 23C/23D — analysis + AI CTA purge, tools spacing, dark backup stack === */
.analysis-savings-card .savings-widget {
  padding-block: 16px !important;
}

.analysis-savings-card .widget-header {
  align-items: center !important;
  gap: 12px !important;
  margin-bottom: 12px !important;
}

.analysis-savings-card .widget-info {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 4px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

.analysis-savings-card #savingsWidgetTitle {
  margin: 0 !important;
  font-size: clamp(0.94rem, 2.8vw, 1.08rem) !important;
  line-height: 1.18 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.analysis-savings-card #targetDate {
  margin: 0 !important;
}

.analysis-savings-card .progress-circle {
  width: 86px !important;
  height: 86px !important;
  min-width: 86px !important;
}

.analysis-savings-card .progress-circle svg {
  width: 56px !important;
  height: 56px !important;
}

.analysis-savings-card .progress-circle .progress-percentage {
  font-size: 0.96rem !important;
}

.analysis-savings-card .interactive-controls {
  gap: 14px !important;
}

.analysis-savings-card .goal-input-container {
  margin-top: 2px !important;
}

#applySuggestionBtn,
#applySaveBtn,
#applyAiSuggestion {
  min-height: 42px !important;
  padding: 10px 16px !important;
  border-radius: 14px !important;
  font-size: 0.92rem !important;
  line-height: 1.15 !important;
  gap: 0 !important;
}

#applySuggestionBtn,
#applyAiSuggestion {
  white-space: nowrap !important;
}

#applySuggestionBtn::before,
#applyAiSuggestion::before {
  content: none !important;
  display: none !important;
}

.analysis-savings-card #applySuggestionBtn {
  position: relative !important;
  z-index: 2 !important;
  pointer-events: auto !important;
  width: auto !important;
  align-self: flex-start !important;
}

#aiAction {
  gap: 10px !important;
  align-items: center !important;
  flex-wrap: wrap !important;
}

#applyAiSuggestion {
  width: auto !important;
}

.tools-import-card .section-content,
.tools-report-card .section-content,
.tools-calendar-card .section-content {
  gap: 0 !important;
}

.tools-import-card #csvSubtitle,
.tools-report-card .chart-note,
.tools-calendar-card .chart-note {
  margin-bottom: 18px !important;
}

.tools-import-card .file-name,
.tools-import-card #csvMappingStatus {
  margin-top: 10px !important;
  margin-bottom: 14px !important;
}

.tools-import-card .import-actions {
  margin-top: 4px !important;
}

.tools-report-card .button-group,
.tools-calendar-card .button-group {
  margin-top: 4px !important;
}

[data-theme="dark"] .tools-settings-card .setting-item .button-group {
  flex-direction: column !important;
  align-items: stretch !important;
}

[data-theme="dark"] #backupBtn,
[data-theme="dark"] #restoreBtn {
  width: 100% !important;
}

@media (max-width: 430px) {
  .analysis-savings-card .widget-header {
    gap: 10px !important;
  }

  .analysis-savings-card #savingsWidgetTitle {
    font-size: 0.92rem !important;
  }

  .analysis-savings-card .progress-circle {
    width: 82px !important;
    height: 82px !important;
    min-width: 82px !important;
  }

  .analysis-savings-card .progress-circle svg {
    width: 54px !important;
    height: 54px !important;
  }

  #applySuggestionBtn,
  #applySaveBtn,
  #applyAiSuggestion {
    min-height: 40px !important;
    padding-inline: 14px !important;
    font-size: 0.88rem !important;
  }
}

/* ===== PATCH v229p — premium home light structure lock (safe override) ===== */
html:not([data-theme="dark"]) #premiumBanner .premium-content,
html:not([data-theme="dark"]) .premium-banner .premium-content,
html:not([data-theme="dark"]) .premium-banner--fintech .premium-content--fintech {
  grid-template-columns: auto minmax(0, 1fr) 1fr !important;
  align-items: center !important;
}

html:not([data-theme="dark"]) #upgradeBtn,
html:not([data-theme="dark"]) .premium-btn,
html:not([data-theme="dark"]) .premium-btn--fintech {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-width: 0 !important;
  justify-self: stretch !important;
}

@media (max-width: 430px) {
  html:not([data-theme="dark"]) #premiumBanner .premium-content,
  html:not([data-theme="dark"]) .premium-banner .premium-content,
  html:not([data-theme="dark"]) .premium-banner--fintech .premium-content--fintech {
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
  }

  html:not([data-theme="dark"]) #upgradeBtn,
  html:not([data-theme="dark"]) .premium-btn,
  html:not([data-theme="dark"]) .premium-btn--fintech {
    width: 100% !important;
    min-width: 0 !important;
    justify-self: stretch !important;
  }
}


/* PATCH 23C6 FINAL — WiseMind / Daily Check-In contrast fix */
/* Light mode only: default light state is html without data-theme="dark" */
html:not([data-theme="dark"]) .daily-checkin-card .daily-checkin-title,
html:not([data-theme="dark"]) #dailyCheckInTitle,
[data-theme="light"] .daily-checkin-card .daily-checkin-title,
[data-theme="light"] #dailyCheckInTitle {
  color: #0f172a !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

html:not([data-theme="dark"]) .daily-checkin-card .daily-checkin-subtitle,
html:not([data-theme="dark"]) #dailyCheckInSubtitle,
[data-theme="light"] .daily-checkin-card .daily-checkin-subtitle,
[data-theme="light"] #dailyCheckInSubtitle {
  color: #334155 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

html:not([data-theme="dark"]) .daily-checkin-card .daily-checkin-value,
html:not([data-theme="dark"]) #dailyCheckInValue,
[data-theme="light"] .daily-checkin-card .daily-checkin-value,
[data-theme="light"] #dailyCheckInValue {
  background: #ecfdf5 !important;
  border-color: rgba(34, 197, 94, 0.18) !important;
}

html:not([data-theme="dark"]) .daily-checkin-card .daily-checkin-value.positive,
html:not([data-theme="dark"]) #dailyCheckInValue.positive,
[data-theme="light"] .daily-checkin-card .daily-checkin-value.positive,
[data-theme="light"] #dailyCheckInValue.positive {
  color: #15803d !important;
}

html:not([data-theme="dark"]) .daily-checkin-card .daily-checkin-value.neutral,
html:not([data-theme="dark"]) #dailyCheckInValue.neutral,
[data-theme="light"] .daily-checkin-card .daily-checkin-value.neutral,
[data-theme="light"] #dailyCheckInValue.neutral {
  color: #334155 !important;
}


/* PATCH 24E — Savings goal banner right padding fix */
.analysis-tab .analysis-savings-card .goal-text{
    padding-right:8px !important;
}

.analysis-tab .analysis-savings-card .goal-text-main{
    white-space:nowrap !important;
    overflow:visible !important;
}


/* PATCH 24F — Reduce goal banner font so text fits */
.analysis-tab .analysis-savings-card .goal-text-main{
    font-size:0.82rem !important;
    line-height:1.1 !important;
    white-space:nowrap !important;
}


/* === PATCH 25A — Savings goal percent input refactor === */
.analysis-savings-card .pig-icon-container,
.analysis-savings-card .progress-circle,
.analysis-savings-card .progress-ring {
  display: none !important;
}

.analysis-savings-card .widget-header {
  display: block !important;
  margin-bottom: 14px !important;
}

.analysis-savings-card .widget-info {
  width: 100% !important;
}

.analysis-savings-card #savingsWidgetTitle {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  font-size: clamp(1rem, 3.2vw, 1.55rem) !important;
  line-height: 1.12 !important;
}

.analysis-savings-card #targetDate {
  margin-top: 4px !important;
  font-size: 0.82rem !important;
  opacity: 0.9 !important;
}

.analysis-savings-card .savings-percent-field-card {
  padding: 16px !important;
}

.analysis-savings-card .savings-percent-input-wrap {
  gap: 10px !important;
  align-items: center !important;
}

.analysis-savings-card .input-icon-percent {
  width: 18px !important;
  min-width: 18px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1rem !important;
  font-weight: 800 !important;
  color: var(--accent) !important;
}

.analysis-savings-card .savings-percent-input {
  width: 100% !important;
  min-height: 46px !important;
  border-radius: 14px !important;
  border: 1px solid var(--border) !important;
  background: var(--card-bg) !important;
  color: var(--text-color) !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  padding: 0 14px !important;
  box-shadow: none !important;
  appearance: textfield;
  -moz-appearance: textfield;
}

.analysis-savings-card .savings-percent-input::-webkit-outer-spin-button,
.analysis-savings-card .savings-percent-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.analysis-savings-card .savings-percent-hint {
  display: flex !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin-top: 8px !important;
  font-size: 0.78rem !important;
  color: var(--text-secondary) !important;
}

.analysis-savings-card .slider-labels,
.analysis-savings-card .savings-slider,
.analysis-savings-card .percentage-value {
  display: none !important;
}

.analysis-savings-card #suggestionCard {
  position: relative !important;
}

.analysis-savings-card #applySuggestionBtn {
  position: relative !important;
  z-index: 5 !important;
  pointer-events: auto !important;
  touch-action: manipulation !important;
}

@media (max-width: 430px) {
  .analysis-savings-card #savingsWidgetTitle {
    font-size: 1.02rem !important;
  }

  .analysis-savings-card .savings-percent-input {
    min-height: 44px !important;
    font-size: 0.98rem !important;
  }
}


/* ===== Decision Engine Completion Patch v230 ===== */
.home-priority-card {
  border: 1px solid rgba(37, 99, 235, 0.16);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.10);
}
.home-priority-card .section-content {
  display: grid;
  gap: 14px;
}
.home-priority-card .section-header h2 {
  font-size: 1.08rem;
  letter-spacing: 0.01em;
}
.home-priority-kicker {
  font-size: 0.95rem;
  font-weight: 600;
}
.home-quick-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.home-voice-btn {
  min-height: 56px;
  border-radius: 18px;
  font-size: 1rem;
  font-weight: 700;
}
.home-manual-btn {
  min-height: 48px;
  border-radius: 16px;
}
.wise-decision-card {
  position: relative;
  border: 1px solid rgba(37, 99, 235, 0.14) !important;
  border-radius: 22px !important;
  background: var(--card-bg, rgba(255,255,255,0.92)) !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08) !important;
  overflow: hidden;
}
.wise-decision-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: rgba(37, 99, 235, 0.22);
}
.wise-decision-card[data-tone="safe"]::before,
.wise-decision-card[data-tone="balanced"]::before {
  background: rgba(37, 99, 235, 0.34);
}
.wise-decision-card[data-tone="cautious"]::before {
  background: rgba(245, 158, 11, 0.38);
}
.wise-decision-card[data-tone="critical"]::before {
  background: rgba(220, 38, 38, 0.42);
}
.wise-decision-card .section-content {
  display: grid !important;
  gap: 10px !important;
  padding: 20px 20px 18px !important;
}
.wise-decision-head {
  display: block !important;
  margin: 0 !important;
}
.wise-decision-title {
  font-size: 0.78rem !important;
  line-height: 1.1 !important;
  font-weight: 800 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  color: var(--muted-text, #64748b) !important;
}
.wise-decision-label {
  font-size: 0.98rem !important;
  line-height: 1.15 !important;
  font-weight: 700 !important;
  color: var(--text-primary, #0f172a) !important;
  margin: 0 !important;
}
.wise-decision-main {
  font-size: clamp(1.35rem, 1.1rem + 0.8vw, 1.75rem) !important;
  line-height: 1.08 !important;
  font-weight: 800 !important;
  color: var(--text-primary, #0f172a) !important;
  margin: 0 !important;
}
.wise-decision-main.safe,
.wise-decision-main.balanced {
  color: #1e3a8a !important;
}
.wise-decision-main.cautious {
  color: #b45309 !important;
}
.wise-decision-main.critical {
  color: #b91c1c !important;
}
.wise-decision-copy {
  font-size: 0.98rem !important;
  line-height: 1.45 !important;
  color: var(--text-primary, #0f172a) !important;
  max-width: 42ch;
}
.wise-decision-reason {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: fit-content;
  max-width: 100%;
  padding: 6px 12px !important;
  border-radius: 999px !important;
  font-size: 0.76rem !important;
  line-height: 1.15 !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  border: 1px solid rgba(37, 99, 235, 0.16) !important;
  background: rgba(37, 99, 235, 0.08) !important;
  color: #2563eb !important;
}
.wise-decision-reason.safe,
.wise-decision-reason.balanced {
  background: rgba(37, 99, 235, 0.08) !important;
  border-color: rgba(37, 99, 235, 0.16) !important;
  color: #1d4ed8 !important;
}
.wise-decision-reason.cautious {
  background: rgba(245, 158, 11, 0.10) !important;
  border-color: rgba(245, 158, 11, 0.18) !important;
  color: #b45309 !important;
}
.wise-decision-reason.critical {
  background: rgba(220, 38, 38, 0.10) !important;
  border-color: rgba(220, 38, 38, 0.18) !important;
  color: #b91c1c !important;
}
.wise-saving-summary {
  display: grid;
  gap: 12px;
  margin: 10px 0 16px;
}
.wise-saving-summary-card {
  border: 1px solid rgba(59,130,246,0.14);
  border-radius: 20px;
  padding: 16px;
  background: rgba(37,99,235,0.06);
}
.wise-saving-summary-label,
.wise-saving-mini-label {
  font-size: 0.8rem;
  font-weight: 700;
  opacity: 0.78;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.wise-saving-summary-value {
  margin-top: 6px;
  font-size: 1.8rem;
  line-height: 1;
  font-weight: 800;
}
.wise-saving-summary-note {
  margin-top: 8px;
  font-size: 0.84rem;
}
.wise-saving-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.wise-saving-mini-card {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  padding: 14px 12px;
  background: rgba(15, 23, 42, 0.03);
}
.wise-saving-mini-value {
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 800;
}
.wise-saving-mini-value.comfortable,
.wise-saving-mini-value.safe { color: #16a34a; }
.wise-saving-mini-value.balanced { color: #2563eb; }
.wise-saving-mini-value.aggressive { color: #d97706; }
.wise-saving-mini-value.overstretched,
.wise-saving-mini-value.critical { color: #dc2626; }
.home-hero-card .hero-main {
  font-size: clamp(2rem, 5vw, 2.9rem);
  font-weight: 800;
}
.home-hero-card .hero-eyebrow {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}
html:not([data-theme="dark"]) .wise-decision-card,
html:not([data-theme="dark"]) .home-priority-card,
html:not([data-theme="dark"]) .home-hero-card,
html:not([data-theme="dark"]) .analysis-savings-card {
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}
html:not([data-theme="dark"]) .wise-decision-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96)) !important;
}
html[data-theme="dark"] .wise-decision-card,
[data-theme="dark"] .wise-decision-card {
  background: linear-gradient(180deg, rgba(15,23,42,0.98), rgba(15,23,42,0.94)) !important;
  border-color: rgba(96, 165, 250, 0.18) !important;
  box-shadow: 0 18px 34px rgba(2, 6, 23, 0.42) !important;
}
html[data-theme="dark"] .wise-decision-title,
[data-theme="dark"] .wise-decision-title {
  color: rgba(191, 219, 254, 0.76) !important;
}
html[data-theme="dark"] .wise-decision-label,
html[data-theme="dark"] .wise-decision-copy,
[data-theme="dark"] .wise-decision-label,
[data-theme="dark"] .wise-decision-copy {
  color: #e5eefc !important;
}
html[data-theme="dark"] .wise-decision-main.safe,
html[data-theme="dark"] .wise-decision-main.balanced,
[data-theme="dark"] .wise-decision-main.safe,
[data-theme="dark"] .wise-decision-main.balanced {
  color: #dbeafe !important;
}
html[data-theme="dark"] .wise-decision-main.cautious,
[data-theme="dark"] .wise-decision-main.cautious {
  color: #fcd34d !important;
}
html[data-theme="dark"] .wise-decision-main.critical,
[data-theme="dark"] .wise-decision-main.critical {
  color: #fca5a5 !important;
}
html:not([data-theme="dark"]) .wise-saving-summary-card {
  background: linear-gradient(180deg, rgba(37,99,235,0.08), rgba(37,99,235,0.03));
}
html[data-theme="dark"] .wise-saving-mini-card,
[data-theme="dark"] .wise-saving-mini-card {
  background: rgba(255,255,255,0.03);
}
@media (max-width: 1024px) {
  .wise-decision-card .section-content {
    padding: 18px 18px 16px !important;
  }
  .wise-decision-copy {
    max-width: 100%;
  }
}
@media (max-width: 768px) {
  .wise-saving-summary-grid {
    grid-template-columns: 1fr;
  }
  .wise-decision-card .section-content {
    padding: 17px 16px 16px !important;
    gap: 9px !important;
  }
  .wise-decision-title {
    font-size: 0.74rem !important;
  }
  .wise-decision-label {
    font-size: 0.94rem !important;
  }
  .wise-decision-main {
    font-size: 1.55rem !important;
  }
  .wise-decision-copy {
    font-size: 0.95rem !important;
    line-height: 1.4 !important;
  }
}
@media (max-width: 480px) {
  .wise-decision-card {
    border-radius: 20px !important;
  }
  .wise-decision-card .section-content {
    padding: 16px 14px 15px !important;
  }
  .wise-decision-main {
    font-size: 1.45rem !important;
  }
  .wise-decision-reason {
    font-size: 0.72rem !important;
    padding: 6px 10px !important;
  }
}
@media (min-width: 1280px) {
  .wise-decision-card .section-content {
    padding: 22px 22px 20px !important;
  }
  .wise-decision-copy {
    max-width: 48ch;
  }
}
.wise-decision-card{
position:relative;
overflow:hidden;
}

.wise-decision-card::before{
content:"";
position:absolute;
inset:0;
background:radial-gradient(
circle at top left,
rgba(37,99,235,0.18),
transparent 65%
);
pointer-events:none;
}


.forecast-na {
  opacity: 0.6;
  font-weight: 500;
  letter-spacing: 0.03em;
}

/* ===== PATCH v240 — dark mode savings widget deep typography fix ===== */
html[data-theme="dark"] .analysis-savings-card .widget-header,
body[data-theme="dark"] .analysis-savings-card .widget-header,
body.dark .analysis-savings-card .widget-header {
  padding: 14px 16px !important;
}

html[data-theme="dark"] .analysis-savings-card .widget-info,
body[data-theme="dark"] .analysis-savings-card .widget-info,
body.dark .analysis-savings-card .widget-info {
  width: 100% !important;
  text-align: center !important;
}

html[data-theme="dark"] .analysis-savings-card #savingsWidgetTitle,
body[data-theme="dark"] .analysis-savings-card #savingsWidgetTitle,
body.dark .analysis-savings-card #savingsWidgetTitle {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto 6px auto !important;
  font-size: clamp(0.86rem, 3vw, 0.98rem) !important;
  line-height: 1.16 !important;
  font-weight: 700 !important;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

html[data-theme="dark"] .analysis-savings-card #savingsWidgetTitle::before,
body[data-theme="dark"] .analysis-savings-card #savingsWidgetTitle::before,
body.dark .analysis-savings-card #savingsWidgetTitle::before {
  content: none !important;
  display: none !important;
}

html[data-theme="dark"] .analysis-savings-card #targetDate,
body[data-theme="dark"] .analysis-savings-card #targetDate,
body.dark .analysis-savings-card #targetDate {
  display: block !important;
  margin: 0 auto !important;
  font-size: 0.76rem !important;
  line-height: 1.15 !important;
  font-weight: 700 !important;
  text-align: center !important;
  opacity: 0.96 !important;
}


/* ===== PATCH v242 — savings widget title/theme stabilization (surgical) ===== */
.analysis-savings-card #savingsWidgetTitle::before,
.analysis-savings-card .widget-info h3::before {
  content: none !important;
  display: none !important;
}

.analysis-savings-card .widget-info {
  min-width: 0 !important;
  width: 100% !important;
  text-align: center !important;
}

.analysis-savings-card #savingsWidgetTitle,
.analysis-savings-card .widget-info h3 {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto 6px auto !important;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-wrap: nowrap !important;
  letter-spacing: -0.01em !important;
}

.analysis-savings-card #targetDate,
.analysis-savings-card .target-date {
  display: block !important;
  width: 100% !important;
  margin: 0 auto !important;
  text-align: center !important;
}

html:not([data-theme="dark"]) .analysis-savings-card #savingsWidgetTitle,
html:not([data-theme="dark"]) .analysis-savings-card .widget-info h3,
body:not(.dark) .analysis-savings-card #savingsWidgetTitle,
body:not(.dark) .analysis-savings-card .widget-info h3 {
  font-size: clamp(1rem, 3.2vw, 1.32rem) !important;
  line-height: 1.12 !important;
  max-width: none !important;
}

html:not([data-theme="dark"]) .analysis-savings-card #targetDate,
html:not([data-theme="dark"]) .analysis-savings-card .target-date,
body:not(.dark) .analysis-savings-card #targetDate,
body:not(.dark) .analysis-savings-card .target-date {
  font-size: 0.92rem !important;
  line-height: 1.18 !important;
  font-weight: 500 !important;
  margin-top: 2px !important;
}

html[data-theme="dark"] .analysis-savings-card #savingsWidgetTitle,
html[data-theme="dark"] .analysis-savings-card .widget-info h3,
body[data-theme="dark"] .analysis-savings-card #savingsWidgetTitle,
body[data-theme="dark"] .analysis-savings-card .widget-info h3,
body.dark .analysis-savings-card #savingsWidgetTitle,
body.dark .analysis-savings-card .widget-info h3 {
  font-size: clamp(0.88rem, 2.6vw, 1rem) !important;
  line-height: 1.14 !important;
}

html[data-theme="dark"] .analysis-savings-card #targetDate,
html[data-theme="dark"] .analysis-savings-card .target-date,
body[data-theme="dark"] .analysis-savings-card #targetDate,
body[data-theme="dark"] .analysis-savings-card .target-date,
body.dark .analysis-savings-card #targetDate,
body.dark .analysis-savings-card .target-date {
  font-size: 0.86rem !important;
  line-height: 1.12 !important;
  font-weight: 700 !important;
  margin-top: 2px !important;
  opacity: 0.96 !important;
}


/* ===== v243 — UI hardening: voice alignment + WiseScore report theme ===== */
.section-card[data-tab="variable"] .voice-row {
  align-items: stretch !important;
}

.section-card[data-tab="variable"] .voice-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  padding-inline: 16px !important;
}

.section-card[data-tab="variable"] .voice-btn .bw-voice-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  line-height: 1 !important;
  font-size: 0.95rem !important;
  transform: translateY(0) !important;
}

.section-card[data-tab="variable"] #voiceBtnText {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  line-height: 1 !important;
  transform: translateY(0) !important;
}

.section-card[data-tab="variable"] #voiceBtnText::before {
  content: none !important;
  display: none !important;
}

.section-card[data-tab="variable"] .voice-status {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  line-height: 1.05 !important;
}

.report-title-mark {
  display: inline-flex;
  width: 0.9rem;
  height: 0.9rem;
  margin-right: 0.55rem;
  border-radius: 999px;
  vertical-align: -0.06rem;
  background: linear-gradient(135deg, #60A5FA 0%, #2563EB 100%);
  box-shadow: 0 0 0 1px rgba(37,99,235,0.16), 0 6px 14px rgba(37,99,235,0.18);
}

.report-title-mark--subtle {
  width: 0.74rem;
  height: 0.74rem;
  margin-right: 0.5rem;
  opacity: 0.92;
}

.report-modal-header h3,
.report-section-head h3 {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

html:not([data-theme="dark"]) .report-sheet {
  border-color: #DCE6F2;
  box-shadow: 0 12px 28px rgba(16, 35, 62, 0.06);
}

html:not([data-theme="dark"]) .report-hero-sheet {
  background: linear-gradient(180deg, #F8FBFF 0%, #FFFFFF 100%);
}

[data-theme="dark"] .report-title-mark,
body.dark .report-title-mark {
  box-shadow: 0 0 0 1px rgba(121,168,255,0.2), 0 8px 18px rgba(37,99,235,0.24);
}
/* ===== BudgetKedrix v244 - Premium cards readability fix (light mode only) ===== */
html:not([data-theme="dark"]) .premium-plan-card,
body:not(.dark) .premium-plan-card {
    background: linear-gradient(180deg, #1F3154 0%, #162744 100%) !important;
    border: 1px solid rgba(37, 99, 235, 0.22) !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.10) !important;
}

html:not([data-theme="dark"]) .premium-plan-card .plan-title,
html:not([data-theme="dark"]) .premium-plan-card .plan-name,
body:not(.dark) .premium-plan-card .plan-title,
body:not(.dark) .premium-plan-card .plan-name {
    color: #FFFFFF !important;
    font-weight: 700 !important;
}

html:not([data-theme="dark"]) .premium-plan-card .plan-badge,
html:not([data-theme="dark"]) .premium-plan-card .premium-badge,
body:not(.dark) .premium-plan-card .plan-badge,
body:not(.dark) .premium-plan-card .premium-badge {
    background: rgba(255,255,255,0.12) !important;
    color: #FFFFFF !important;
    border: 1px solid rgba(255,255,255,0.16) !important;
}

html:not([data-theme="dark"]) .premium-plan-card li,
html:not([data-theme="dark"]) .premium-plan-card .feature-item,
body:not(.dark) .premium-plan-card li,
body:not(.dark) .premium-plan-card .feature-item {
    color: rgba(255,255,255,0.90) !important;
}

html:not([data-theme="dark"]) .premium-plan-card hr,
html:not([data-theme="dark"]) .premium-plan-card .feature-divider,
body:not(.dark) .premium-plan-card hr,
body:not(.dark) .premium-plan-card .feature-divider {
    border-color: rgba(255,255,255,0.16) !important;
    opacity: 1 !important;
}

html:not([data-theme="dark"]) .premium-plan-card .icon-check,
body:not(.dark) .premium-plan-card .icon-check {
    color: #22C55E !important;
}

html:not([data-theme="dark"]) .premium-plan-card .icon-x,
body:not(.dark) .premium-plan-card .icon-x {
    color: #EF4444 !important;
}
/* ===== BudgetKedrix v245 - voice buttons alignment fix ===== */

/* bottone sinistro: Inserisci con voce */
.voice-entry-btn,
.voice-input-btn,
.quick-voice-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    text-align: center !important;
    line-height: 1 !important;
    padding: 0 16px !important;
}

/* icona interna */
.voice-entry-btn i,
.voice-entry-btn svg,
.voice-input-btn i,
.voice-input-btn svg,
.quick-voice-btn i,
.quick-voice-btn svg {
    position: static !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
    width: 16px !important;
    height: 16px !important;
}

/* testo interno */
.voice-entry-btn span,
.voice-input-btn span,
.quick-voice-btn span {
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
}

/* bottone destro: Tocca per parlare */
.voice-trigger-btn,
.voice-listen-btn,
.voice-placeholder-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    line-height: 1.1 !important;
    padding: 0 16px !important;
}

/* se c'è un pseudo-elemento mic che sfalsa tutto, lo neutralizza */
.voice-entry-btn::before,
.voice-input-btn::before,
.quick-voice-btn::before {
    position: static !important;
    margin-right: 0 !important;
}


/* ===== v244 — surgical fix: voice buttons + premium light readability ===== */
/* Voice buttons: kill inherited pseudo-icons and center real content */
.section-card[data-tab="variable"] .voice-btn::before,
.section-card[data-tab="variable"] .voice-status::before,
.section-card[data-tab="fixed"] .voice-fixed-btn::before,
.section-card[data-tab="fixed"] .voice-status::before {
  content: none !important;
  display: none !important;
}

.section-card[data-tab="variable"] .voice-row {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important;
  gap: 12px !important;
  align-items: stretch !important;
}

.section-card[data-tab="variable"] .voice-btn,
.section-card[data-tab="fixed"] .voice-fixed-btn {
  width: 100% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  padding-inline: 18px !important;
  text-align: center !important;
}

.section-card[data-tab="variable"] .voice-status,
.section-card[data-tab="fixed"] .voice-status {
  width: 100% !important;
  min-height: 42px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding-inline: 18px !important;
  text-align: center !important;
  line-height: 1.1 !important;
}

.section-card[data-tab="variable"] .voice-btn .bw-voice-icon,
.section-card[data-tab="fixed"] .voice-fixed-btn .bw-voice-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 16px !important;
  height: 16px !important;
  flex: 0 0 16px !important;
  margin: 0 !important;
  font-size: 14px !important;
  line-height: 1 !important;
  transform: none !important;
  position: static !important;
}

.section-card[data-tab="variable"] #voiceBtnText,
.section-card[data-tab="fixed"] #micFixedText {
  display: inline-block !important;
  flex: 0 1 auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.1 !important;
  text-align: center !important;
  white-space: nowrap !important;
}

/* Premium modal readability in light mode only */
html:not([data-theme="dark"]) .premium-modal-shell {
  background: linear-gradient(180deg, #F8FBFF 0%, #FFFFFF 100%) !important;
  border: 1px solid #DCE6F2 !important;
  box-shadow: 0 18px 40px rgba(16,35,62,0.12) !important;
}

html:not([data-theme="dark"]) .premium-modal-subtitle {
  color: #4E647F !important;
}

html:not([data-theme="dark"]) .premium-plan-card {
  background: linear-gradient(180deg, #1B2C4C 0%, #10203A 100%) !important;
  border: 1px solid rgba(37,99,235,0.22) !important;
  box-shadow: 0 12px 26px rgba(16,35,62,0.14), inset 0 1px 0 rgba(255,255,255,0.04) !important;
}

html:not([data-theme="dark"]) .premium-plan-card--premium {
  background: linear-gradient(180deg, #20365B 0%, #142847 100%) !important;
  border-color: rgba(37,99,235,0.34) !important;
  box-shadow: 0 14px 28px rgba(16,35,62,0.16), 0 0 0 1px rgba(37,99,235,0.14) inset !important;
}

html:not([data-theme="dark"]) .premium-plan-head h3,
html:not([data-theme="dark"]) .premium-plan-card li span,
html:not([data-theme="dark"]) .premium-price-box .amount {
  color: #F8FBFF !important;
}

html:not([data-theme="dark"]) .premium-plan-chip {
  background: rgba(255,255,255,0.14) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255,255,255,0.18) !important;
}

html:not([data-theme="dark"]) .premium-plan-chip--accent {
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%) !important;
  color: #FFFFFF !important;
  border-color: rgba(255,255,255,0.08) !important;
}

html:not([data-theme="dark"]) .premium-plan-card li {
  border-top: 1px solid rgba(255,255,255,0.12) !important;
}

html:not([data-theme="dark"]) .premium-plan-card li:first-child {
  border-top-color: transparent !important;
}

html:not([data-theme="dark"]) .premium-price-box {
  background: rgba(7, 15, 28, 0.34) !important;
  border-color: rgba(96,165,250,0.28) !important;
}

html:not([data-theme="dark"]) .premium-price-box .period {
  color: #C7D5E6 !important;
}


/* ===== v245 — variable tab voice button final centering fix ===== */
.section-card[data-tab="variable"] .voice-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1.24fr) minmax(0, 0.96fr) !important;
  gap: 10px !important;
  align-items: stretch !important;
}

.section-card[data-tab="variable"] #voiceBtn {
  width: 100% !important;
  min-width: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 0 12px !important;
  text-align: center !important;
  overflow: hidden !important;
}

.section-card[data-tab="variable"] #voiceBtn::before {
  content: none !important;
  display: none !important;
}

.section-card[data-tab="variable"] #voiceBtn .bw-voice-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 14px !important;
  height: 14px !important;
  flex: 0 0 14px !important;
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1 !important;
  position: static !important;
  transform: none !important;
}

.section-card[data-tab="variable"] #voiceBtnText {
  display: inline-block !important;
  flex: 0 1 auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 0.93rem !important;
  line-height: 1.05 !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  text-align: center !important;
}

.section-card[data-tab="variable"] #voiceStatus {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 0 !important;
  padding: 0 12px !important;
  font-size: 0.95rem !important;
  line-height: 1.05 !important;
  text-align: center !important;
}

@media (max-width: 420px) {
  .section-card[data-tab="variable"] .voice-row {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.92fr) !important;
    gap: 8px !important;
  }

  .section-card[data-tab="variable"] #voiceBtn,
  .section-card[data-tab="variable"] #voiceStatus {
    padding-inline: 10px !important;
  }

  .section-card[data-tab="variable"] #voiceBtnText {
    font-size: 0.88rem !important;
  }

  .section-card[data-tab="variable"] #voiceStatus {
    font-size: 0.9rem !important;
  }
}


/* ===== PATCH v246 — Variabili voice button deep fix ===== */
.section-card[data-tab="variable"] .voice-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr) !important;
  gap: 8px !important;
  align-items: stretch !important;
}

.section-card[data-tab="variable"] #voiceBtn {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 40px !important;
  padding: 8px 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  text-align: center !important;
  overflow: hidden !important;
}

.section-card[data-tab="variable"] #voiceBtn .bw-voice-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 14px !important;
  width: 14px !important;
  height: 14px !important;
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1 !important;
}

.section-card[data-tab="variable"] #voiceBtnText {
  display: inline-block !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 0.84rem !important;
  line-height: 1.05 !important;
  white-space: nowrap !important;
  text-align: center !important;
}

.section-card[data-tab="variable"] #voiceStatus {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 40px !important;
  padding: 8px 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 0.84rem !important;
}

@media (max-width: 430px) {
  .section-card[data-tab="variable"] .voice-row {
    grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr) !important;
    gap: 7px !important;
  }

  .section-card[data-tab="variable"] #voiceBtn {
    padding-inline: 9px !important;
  }

  .section-card[data-tab="variable"] #voiceBtnText {
    font-size: 0.80rem !important;
  }

  .section-card[data-tab="variable"] #voiceStatus {
    font-size: 0.80rem !important;
    padding-inline: 9px !important;
  }
}

/* ==== Category Intelligence Engine patch ==== */
#expenseSubCategory,
#newSubcategoryParent,
#newSubcategoryName,
.review-subselect {
  min-height: 46px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-primary);
  padding: 10px 12px;
}

.review-category-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-tree-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.subcategory-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.subcategory-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card-bg) 88%, var(--accent) 12%);
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .input-group-row {
    flex-wrap: wrap;
  }

  #expenseSubCategory,
  #newSubcategoryParent,
  #newSubcategoryName {
    width: 100%;
  }
}


/* ==== Step 2.2 UI hardening ==== */
body.bw-overlay-open {
  overflow: hidden;
}

.bw-category-entry-row {
  align-items: stretch;
}

.bw-category-stack {
  flex: 1.2;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bw-parent-category-select,
.bw-subcategory-select {
  width: 100%;
}

.bw-category-manager-modal {
  width: min(500px, calc(100vw - 24px));
  max-height: min(84vh, 760px);
  overflow-y: auto;
}

.review-current-path {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.review-current-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.review-suggestion-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border));
  background: color-mix(in srgb, var(--accent) 14%, var(--card-bg));
  color: var(--text-primary);
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  font-weight: 700;
}

@media (max-width: 768px) {
  .bw-category-stack {
    min-width: 100%;
  }

  .bw-category-manager-modal {
    width: calc(100vw - 16px);
    max-height: 88vh;
  }

  .review-current-path {
    align-items: flex-start;
  }
}

/* === STEP 3B UI Freeze Patch === */
.footer-period-card {
  margin-top: 18px;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  border-radius: 20px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  background: linear-gradient(180deg, rgba(10, 18, 36, 0.96) 0%, rgba(8, 14, 28, 0.98) 100%);
  box-shadow: 0 14px 34px rgba(3, 10, 24, 0.28);
}

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

.footer-period-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.footer-period-item {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  min-width: 0;
}

.footer-period-item--accent {
  border-color: rgba(200, 167, 91, 0.34);
  box-shadow: inset 0 0 0 1px rgba(200, 167, 91, 0.08);
}

.footer-period-label {
  display: block;
  font-size: 0.74rem;
  line-height: 1.2;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.footer-period-value {
  display: block;
  font-size: 0.95rem;
  line-height: 1.25;
  color: var(--text-primary);
  font-weight: 700;
}

.footer-period-note {
  margin-top: 12px;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

.footer-brand-signature {
  margin-top: 10px;
  font-size: 0.76rem;
  line-height: 1.35;
  color: var(--text-secondary);
  text-align: center;
  letter-spacing: 0.01em;
}

.home-score-card {
  border-top: 1px solid rgba(37, 99, 235, 0.18);
}

[data-theme="dark"] .home-score-card {
  box-shadow: 0 18px 40px rgba(4, 11, 24, 0.34);
}

.wise-score-status {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  background: rgba(37, 99, 235, 0.08);
}

html:not([data-theme="dark"]) .footer-period-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(245,249,255,0.98) 100%);
  border-color: rgba(37, 99, 235, 0.12);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

html:not([data-theme="dark"]) .footer-period-item {
  background: rgba(37, 99, 235, 0.03);
  border-color: rgba(37, 99, 235, 0.08);
}

html:not([data-theme="dark"]) .footer-period-item--accent {
  border-color: rgba(200, 167, 91, 0.4);
}

@media (max-width: 640px) {
  .footer-period-grid {
    grid-template-columns: 1fr;
  }

  .footer-period-card {
    padding: 16px 14px calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .footer-period-item {
    padding: 11px 12px;
  }
}


/* === STEP 3C — Variable expenses compact mobile layout === */
@media (max-width: 560px) {
  #variableExpensesList .expense-item.variable-home-card {
    padding: 10px 11px !important;
    margin-bottom: 8px !important;
    border-radius: 16px;
  }

  #variableExpensesList .expense-item.variable-home-card .expense-main-row {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
    align-items: start !important;
  }

  #variableExpensesList .expense-item.variable-home-card .expense-info {
    gap: 1px !important;
  }

  #variableExpensesList .expense-item.variable-home-card .expense-name {
    font-size: 0.99rem !important;
    line-height: 1.2 !important;
    margin-bottom: 1px !important;
  }

  #variableExpensesList .expense-item.variable-home-card .expense-category,
  #variableExpensesList .expense-item.variable-home-card .expense-date,
  #variableExpensesList .expense-item.variable-home-card .expense-link-badge {
    font-size: 0.78rem !important;
  }

  #variableExpensesList .expense-item.variable-home-card .variable-card-meta-row {
    gap: 5px !important;
    margin-top: 1px !important;
  }

  #variableExpensesList .expense-item.variable-home-card .expense-side-block {
    width: 100% !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
  }

  #variableExpensesList .expense-item.variable-home-card .expense-amount {
    font-size: 1.02rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  #variableExpensesList .expense-item.variable-home-card .variable-card-actions {
    gap: 8px !important;
    margin-top: 0 !important;
    flex-shrink: 0 !important;
  }

  #variableExpensesList .expense-item.variable-home-card .icon-only-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    padding: 0 !important;
  }
}

@media (max-width: 400px) {
  #variableExpensesList .expense-item.variable-home-card {
    padding: 9px 10px !important;
  }

  #variableExpensesList .expense-item.variable-home-card .expense-name {
    font-size: 0.96rem !important;
  }

  #variableExpensesList .expense-item.variable-home-card .expense-amount {
    font-size: 0.98rem !important;
  }

  #variableExpensesList .expense-item.variable-home-card .icon-only-btn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
  }
}

/* ===== STEP 3C HOTFIX — Variable cards mobile compact v2 ===== */
@media (max-width: 640px) {
  #variableExpensesList .expense-item.variable-home-card {
    padding: 8px 10px !important;
    margin-bottom: 8px !important;
    border-radius: 12px !important;
  }

  #variableExpensesList .expense-item.variable-home-card .expense-main-row {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 6px !important;
    align-items: stretch !important;
  }

  #variableExpensesList .expense-item.variable-home-card .expense-info {
    gap: 0 !important;
  }

  #variableExpensesList .expense-item.variable-home-card .expense-name {
    font-size: 16px !important;
    line-height: 1.15 !important;
    margin-bottom: 2px !important;
  }

  #variableExpensesList .expense-item.variable-home-card .expense-category {
    font-size: 13px !important;
    line-height: 1.15 !important;
  }

  #variableExpensesList .expense-item.variable-home-card .variable-card-meta-row {
    margin-top: 1px !important;
    gap: 4px !important;
  }

  #variableExpensesList .expense-item.variable-home-card .variable-card-meta-row .expense-category {
    font-size: 12px !important;
    opacity: 0.82 !important;
  }

  #variableExpensesList .expense-item.variable-home-card .expense-side-block {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 8px !important;
  }

  #variableExpensesList .expense-item.variable-home-card .expense-amount {
    font-size: 18px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important;
  }

  #variableExpensesList .expense-item.variable-home-card .expense-actions.variable-card-actions {
    gap: 6px !important;
    margin-left: auto !important;
    flex: 0 0 auto !important;
  }

  #variableExpensesList .expense-item.variable-home-card .edit-variable-btn,
  #variableExpensesList .expense-item.variable-home-card .delete-variable-btn {
    width: 30px !important;
    min-width: 30px !important;
    height: 30px !important;
    min-height: 30px !important;
    border-radius: 9px !important;
  }

  #variableExpensesList .expense-item.variable-home-card .edit-variable-btn::before,
  #variableExpensesList .expense-item.variable-home-card .delete-variable-btn::before {
    width: 15px !important;
    height: 15px !important;
  }
}

/* ===== HOTFIX v3 — Variable cards compact mobile real width usage ===== */
@media (max-width: 640px) {
  #variableExpensesList .expense-item.variable-home-card {
    padding: 8px 10px !important;
    margin-bottom: 8px !important;
    border-radius: 12px !important;
  }

  #variableExpensesList .expense-item.variable-home-card .expense-main-row {
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 10px !important;
    align-items: center !important;
  }

  #variableExpensesList .expense-item.variable-home-card .expense-info {
    min-width: 0 !important;
    gap: 1px !important;
  }

  #variableExpensesList .expense-item.variable-home-card .expense-name {
    font-size: 15px !important;
    line-height: 1.12 !important;
    margin-bottom: 2px !important;
  }

  #variableExpensesList .expense-item.variable-home-card .expense-category {
    font-size: 13px !important;
    line-height: 1.14 !important;
  }

  #variableExpensesList .expense-item.variable-home-card .variable-card-meta-row {
    margin-top: 0 !important;
    gap: 4px !important;
  }

  #variableExpensesList .expense-item.variable-home-card .variable-card-meta-row .expense-category {
    font-size: 12px !important;
    opacity: 0.82 !important;
  }

  #variableExpensesList .expense-item.variable-home-card .expense-side-block {
    width: auto !important;
    min-width: 108px !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    justify-content: center !important;
    gap: 6px !important;
  }

  #variableExpensesList .expense-item.variable-home-card .expense-amount {
    font-size: 17px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    text-align: right !important;
  }

  #variableExpensesList .expense-item.variable-home-card .expense-actions.variable-card-actions {
    gap: 6px !important;
    margin-left: auto !important;
    flex-wrap: nowrap !important;
  }

  #variableExpensesList .expense-item.variable-home-card .edit-variable-btn,
  #variableExpensesList .expense-item.variable-home-card .delete-variable-btn {
    width: 30px !important;
    min-width: 30px !important;
    height: 30px !important;
    min-height: 30px !important;
    border-radius: 9px !important;
    padding: 0 !important;
  }

  #variableExpensesList .expense-item.variable-home-card .edit-variable-btn::before,
  #variableExpensesList .expense-item.variable-home-card .delete-variable-btn::before {
    width: 14px !important;
    height: 14px !important;
  }
}

@media (max-width: 400px) {
  #variableExpensesList .expense-item.variable-home-card .expense-main-row {
    grid-template-columns: minmax(0, 1fr) 98px !important;
    gap: 8px !important;
  }

  #variableExpensesList .expense-item.variable-home-card .expense-side-block {
    min-width: 98px !important;
  }

  #variableExpensesList .expense-item.variable-home-card .expense-name {
    font-size: 14px !important;
  }

  #variableExpensesList .expense-item.variable-home-card .expense-amount {
    font-size: 16px !important;
  }
}


.duplicate-import-overlay {
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}

.duplicate-import-modal {
  border: 1px solid rgba(59, 130, 246, 0.24);
  background: linear-gradient(180deg, rgba(9, 21, 48, 0.98), rgba(6, 14, 34, 0.98));
}

.duplicate-import-modal__header {
  margin-bottom: 16px;
}

.duplicate-import-modal__kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.duplicate-import-modal__title {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.2;
}

.duplicate-import-modal__subtitle {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.45;
}

.duplicate-import-modal__body {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.duplicate-import-card {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(12, 20, 42, 0.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

.duplicate-import-card__label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 6px;
}

.duplicate-import-card__value {
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text-primary);
  word-break: break-word;
}

.duplicate-import-modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.duplicate-import-modal__actions button {
  width: 100%;
  min-height: 46px;
}

@media (max-width: 640px) {
  .duplicate-import-modal {
    width: min(94vw, 420px);
    padding: 18px;
    border-radius: 20px;
  }

  .duplicate-import-modal__title {
    font-size: 1rem;
  }

  .duplicate-import-modal__subtitle,
  .duplicate-import-card__value {
    font-size: 0.88rem;
  }

  .duplicate-import-modal__actions {
    grid-template-columns: 1fr;
  }
}


/* === v207 savings clarity hardening — surgical UI patch === */
.analysis-savings-card > .section-content {
  position: relative;
}

.analysis-savings-card .savings-widget-clarified {
  padding: 18px;
  border-radius: 22px;
  display: grid;
  gap: 16px;
  background:
    radial-gradient(circle at top right, rgba(37,99,235,0.12), transparent 36%),
    linear-gradient(180deg, rgba(15,23,42,0.94), rgba(11,18,32,0.98));
}

.analysis-savings-card .savings-widget-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(148,163,184,0.12);
}

.analysis-savings-card .widget-info {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.analysis-savings-card #savingsWidgetTitle,
.analysis-savings-card .widget-info h3 {
  margin: 0;
  font-size: clamp(1.02rem, 2.4vw, 1.24rem);
  line-height: 1.2;
  font-weight: 800;
}

.analysis-savings-card .target-date {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.analysis-savings-card .wise-saving-summary {
  margin: 0;
  gap: 12px;
}

.analysis-savings-card .wise-saving-summary-card {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(37,99,235,0.14), rgba(37,99,235,0.06));
  border-color: rgba(96,165,250,0.18);
}

.analysis-savings-card .wise-saving-summary-value {
  font-size: clamp(1.7rem, 5vw, 2.15rem);
}

.analysis-savings-card .wise-saving-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.analysis-savings-card .wise-saving-mini-card {
  min-height: 92px;
  display: grid;
  align-content: start;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(148,163,184,0.14);
}

.analysis-savings-card .wise-saving-mini-value {
  font-size: 1.02rem;
  line-height: 1.25;
}

.analysis-savings-card .savings-plan-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.analysis-savings-card .savings-plan-controls > * {
  min-width: 0;
}

.analysis-savings-card .slider-container,
.analysis-savings-card .goal-input-container,
.analysis-savings-card .initial-savings-container {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 124px;
}

.analysis-savings-card .savings-percent-hint {
  margin-top: auto;
}

.analysis-savings-card .savings-insights-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.analysis-savings-card .savings-insight-card {
  min-height: 148px;
  padding: 16px;
  border-radius: 18px;
  display: grid;
  align-content: start;
  gap: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(148,163,184,0.14);
}

.analysis-savings-card .savings-insight-card h4 {
  margin: 0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.8;
}

.analysis-savings-card .savings-insight-card p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.48;
}

.analysis-savings-card .savings-insight-card strong {
  color: var(--text-primary);
}

.analysis-savings-card #suggestionCard {
  background: linear-gradient(180deg, rgba(200,167,91,0.12), rgba(200,167,91,0.05));
  border-color: rgba(200,167,91,0.24);
}

.analysis-savings-card .savings-suggestion-btn {
  justify-self: start;
  min-width: 170px;
}

.analysis-savings-card .savings-cta-row {
  display: flex;
  justify-content: flex-end;
}

.analysis-savings-card .savings-apply-btn {
  min-width: 220px;
}

html:not([data-theme="dark"]) .analysis-savings-card .savings-widget-clarified {
  background:
    radial-gradient(circle at top right, rgba(37,99,235,0.09), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
}

html:not([data-theme="dark"]) .analysis-savings-card .savings-widget-hero,
html:not([data-theme="dark"]) .analysis-savings-card .wise-saving-mini-card,
html:not([data-theme="dark"]) .analysis-savings-card .savings-insight-card,
html:not([data-theme="dark"]) .analysis-savings-card .slider-container,
html:not([data-theme="dark"]) .analysis-savings-card .goal-input-container,
html:not([data-theme="dark"]) .analysis-savings-card .initial-savings-container {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.94));
  border-color: rgba(148,163,184,0.2);
}

html:not([data-theme="dark"]) .analysis-savings-card #suggestionCard {
  background: linear-gradient(180deg, rgba(200,167,91,0.12), rgba(200,167,91,0.06));
  border-color: rgba(200,167,91,0.22);
}

@media (max-width: 900px) {
  .analysis-savings-card .savings-plan-controls,
  .analysis-savings-card .wise-saving-summary-grid,
  .analysis-savings-card .savings-insights-grid {
    grid-template-columns: 1fr;
  }

  .analysis-savings-card .savings-insight-card,
  .analysis-savings-card .slider-container,
  .analysis-savings-card .goal-input-container,
  .analysis-savings-card .initial-savings-container {
    min-height: unset;
  }
}

@media (max-width: 640px) {
  .analysis-savings-card .savings-widget-clarified {
    padding: 15px;
    gap: 14px;
  }

  .analysis-savings-card .savings-widget-hero {
    grid-template-columns: 1fr;
    justify-items: start;
    padding: 14px;
  }

  .analysis-savings-card .pig-icon-container {
    width: 100%;
    justify-content: space-between;
  }

  .analysis-savings-card .savings-suggestion-btn,
  .analysis-savings-card .savings-apply-btn {
    width: 100%;
    min-width: 0;
  }

  .analysis-savings-card .savings-cta-row {
    justify-content: stretch;
  }
}


/* === WiseBrain Supervisor Patch WB-1 === */
.wisebrain-inline {
  margin-top: 12px;
  display: grid;
  gap: 6px;
}
.wisebrain-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}
.wisebrain-pill.warning,
#wiseDecisionCard[data-brain="warning"] .wisebrain-pill {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
}
.wisebrain-pill.mismatch,
#wiseDecisionCard[data-brain="mismatch"] .wisebrain-pill {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
}
.wisebrain-copy {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}
#wiseDecisionCard[data-brain="warning"] .wisebrain-copy {
  color: var(--warning);
}
#wiseDecisionCard[data-brain="mismatch"] .wisebrain-copy {
  color: var(--danger);
}
@media (max-width: 768px) {
  .wisebrain-inline {
    gap: 5px;
  }
  .wisebrain-copy {
    font-size: 11px;
  }
}

/* === PRE-BETA UI STABILIZATION PASS (PATCH 07) === */
:root {
  --bw-card-border-soft: rgba(255,255,255,0.07);
  --bw-card-shadow-soft: 0 10px 28px rgba(0,0,0,0.28);
  --bw-card-shadow-strong: 0 14px 36px rgba(0,0,0,0.34);
}

.section-card,
.summary-card,
.home-hero-card,
.analysis-savings-card,
.forecast-main-card,
.forecast-side-card,
.forecast-risk-day-card,
.safe-to-spend-card,
.forecast-simulator-card,
.hero-meta-card,
.daily-checkin-card,
#aiWidget,
#wiseDecisionCard {
  border: 1px solid var(--bw-card-border-soft);
  box-shadow: var(--bw-card-shadow-soft);
}

.section-card {
  margin-bottom: 18px;
}

.section-card > h2,
.section-header h2,
.analysis-savings-card > #savingsTitle,
#wiseForecastTitle,
#wiseScoreHomeTitle,
#aiWidgetTitle {
  letter-spacing: -0.02em;
}

.hero-main,
#dailyBudget,
.forecast-value,
.savings-amount,
.savings-main-value,
#allocationAmount,
#wiseForecastValue,
#remaining,
#totalIncomeDisplay,
#totalVariableExpensesDisplay,
#fixedDueValue,
#fixedPaidValue,
#variablePeriodTotal,
#savingsAccumulatedValue,
#currentBalance,
#remainingDisplay,
#budgetTodayValue,
#forecastSimulatorForecastValue,
#forecastSimulatorBudgetValue {
  letter-spacing: -0.03em;
  font-weight: 700;
}

.home-hero-card .hero-main,
#dailyBudget {
  font-size: clamp(2rem, 6vw, 2.8rem);
  line-height: 1;
}

.home-hero-card .hero-meta-grid {
  gap: 12px;
}

.home-hero-card .hero-meta-card {
  min-height: 88px;
  justify-content: center;
}

.home-hero-card .hero-meta-value,
.forecast-side-value,
.forecast-simulator-value,
.wise-score-value,
#savePercent,
#saveGoal,
#savingsPotInput {
  font-size: clamp(1.05rem, 3.2vw, 1.35rem);
}

.forecast-grid-evolved {
  gap: 14px;
}

.forecast-main-card {
  min-height: 150px;
}

.forecast-metrics-stack,
.forecast-risk-stack,
.forecast-simulator-grid,
.hero-meta-grid,
.interactive-controls,
.savings-insights {
  gap: 12px;
}

#wiseDecisionCard,
.wise-decision-card {
  box-shadow: var(--bw-card-shadow-strong);
}

.wisebrain-badge,
.wisebrain-chip,
#wiseBrainBadge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
}

#aiWidget .section-content,
.analysis-savings-card .section-content,
.forecast-card .section-content,
.home-score-card .section-content,
.section-card .section-content {
  gap: 14px;
}

.expense-item,
.expense-row,
.income-item,
.fixed-expense-item,
.variable-expense-item,
#incomeList > div,
#fixedExpensesList > div,
#variableExpensesList > div {
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 6px 20px rgba(0,0,0,0.20);
}

.expense-actions button,
.transaction-actions button,
.expense-btn,
.edit-btn,
.delete-btn {
  min-width: 34px;
  min-height: 34px;
  border-radius: 10px;
}

.search-container,
.search-container > div:first-child,
#searchExpenses,
#searchCategory {
  border-radius: 16px !important;
}

.btn-secondary,
.analysis-inline-btn,
#applyAiSuggestion,
#dismissAiSuggestion,
#chartLegendToggleBtn,
#closeCategoryPanelBtn,
#resetSearchBtn,
.home-manual-btn,
#homeManualBtn,
#addIncomeBtn,
#addExpenseBtn,
#addFixedBtn,
#resetDayBtn,
#resetFixedBtn {
  border-radius: 12px;
}

.tab-bar {
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}

body,
.app-shell,
.main-content,
.container {
  padding-bottom: max(84px, env(safe-area-inset-bottom));
}

@media (max-width: 820px) {
  .section-card,
  .summary-card,
  .home-hero-card,
  .analysis-savings-card,
  #wiseDecisionCard {
    border-radius: 20px;
  }

  .home-hero-card {
    padding: 16px;
  }

  .home-hero-card .hero-card-header {
    gap: 10px;
    align-items: flex-start;
  }

  .home-hero-card .hero-main,
  #dailyBudget {
    font-size: 2.25rem;
  }

  .home-hero-card .hero-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-quick-card .section-content {
    gap: 10px;
  }

  .home-quick-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .forecast-grid-evolved {
    grid-template-columns: 1fr;
  }

  .forecast-main-card {
    min-height: 132px;
  }

  .forecast-metrics-stack,
  .forecast-risk-stack,
  .forecast-simulator-grid,
  .interactive-controls,
  .savings-insights {
    grid-template-columns: 1fr;
  }

  .chart-container,
  .chart-card,
  .analysis-chart-card .section-content {
    padding-left: 14px;
    padding-right: 14px;
  }

  .wise-score-home {
    gap: 14px;
  }
}

@media (max-width: 640px) {
  .section-card {
    margin-bottom: 14px;
  }

  /* Mobile-first hierarchy: keep Home focused and reduce scroll */
  #dailyCheckInCard[data-tab="home"] {
    display: block !important;
    padding: 12px 14px;
  }

  #dailyCheckInCard[data-tab="home"] .section-header {
    margin-bottom: 8px;
  }

  #dailyCheckInCard[data-tab="home"] .daily-checkin-title {
    font-size: 0.98rem;
  }

  #dailyCheckInCard[data-tab="home"] .daily-checkin-message {
    font-size: 0.86rem;
    line-height: 1.35;
  }

  #dailyCheckInCard[data-tab="home"] .daily-checkin-highlight,
  #dailyCheckInCard[data-tab="home"] .daily-checkin-action,
  #dailyCheckInCard[data-tab="home"] .daily-checkin-warning {
    font-size: 0.84rem;
    line-height: 1.35;
    padding: 10px 12px;
  }

  #wiseForecastCard[data-tab="home"] .forecast-risk-day-card.forecast-safe-days-card,
  #wiseForecastCard[data-tab="home"] .forecast-simulator-card,
  #wiseScoreHomeCard[data-tab="home"] .wise-pillars {
    display: none;
  }

  #wiseForecastCard[data-tab="home"] .forecast-card .section-content,
  #wiseForecastCard[data-tab="home"] .section-content,
  #wiseScoreHomeCard[data-tab="home"] .section-content {
    gap: 10px;
  }

  .home-hero-card .hero-card-header {
    flex-direction: column;
  }

  .privacy-toggle-btn {
    width: 100%;
  }

  .home-hero-card .hero-main,
  #dailyBudget {
    font-size: 2rem;
  }

  .home-hero-card .hero-meta-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .home-hero-card .hero-meta-card {
    min-height: 78px;
    padding: 10px 12px;
  }

  #wiseDecisionCard,
  .wise-decision-card {
    padding: 18px 16px;
  }

  #wiseDecisionCard h2,
  .wise-decision-title {
    font-size: 1.75rem;
    line-height: 1.05;
  }

  #wiseDecisionCard p,
  .wise-decision-copy,
  .wisebrain-note,
  #wiseBrainNote {
    font-size: 0.96rem;
    line-height: 1.4;
  }

  .forecast-main-card,
  .safe-to-spend-card,
  .forecast-risk-day-card,
  .analysis-savings-card .slider-container,
  .analysis-savings-card .goal-input-container,
  .analysis-savings-card .initial-savings-container {
    padding: 14px;
  }

  .wise-score-home .wise-score-main {
    align-items: center;
  }

  .wise-score-ring {
    width: 84px;
    height: 84px;
  }

  .wise-score-value {
    font-size: 1.55rem;
  }

  .search-container {
    padding: 12px !important;
  }

  .search-container > div:first-child {
    gap: 8px !important;
  }

  #searchExpenses,
  #searchCategory,
  #resetSearchBtn {
    min-height: 44px;
  }

  #variableExpensesList > div,
  #incomeList > div,
  #fixedExpensesList > div {
    padding: 12px;
  }
}


/* -------------------------------------------------
   PATCH 10 — WiseMind Light Mode Text Contrast
   Scope: ONLY the hint text inside WiseMind check
   Safe: no layout or dark-mode impact
-------------------------------------------------- */
body.light .wisemind-check .wisemind-hint,
body.light .wisemind-check .wisemind-hint p,
body.light .wisemind-check .wisemind-hint span,
body.light .wisemind-check .wisemind-hint strong,
body.light .wisemind-check .hint-box,
body.light .wisemind-check .hint-box p,
body.light .wisemind-check .hint-box span,
body.light .wisemind-check .hint-box strong {
    color: #475569 !important;
    opacity: 1 !important;
}
/* Fix leggibilità WiseMind box (solo light mode) */

body.light .wisemind-check .hint-box {
    color: #1f2937 !important;   /* grigio scuro leggibile */
}

body.light .wisemind-check .hint-box * {
    color: #1f2937 !important;
    opacity: 1 !important;
}


@media (max-width: 640px) {
  .brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 12px;
  }

  .brand-mark img,
  .brand-mark svg {
    width: 25px;
    height: 25px;
  }

  .brand-caption {
    font-size: 0.68rem;
  }
}


/* ===== PATCH 20260316 — Beta gate + beta build labels ===== */
.brand-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.beta-build-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.28);
  background: rgba(37, 99, 235, 0.14);
  color: var(--accent, #2563EB);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.beta-build-badge--soft {
  background: rgba(37, 99, 235, 0.08);
}

.beta-info-card {
  padding: 16px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(37,99,235,0.08), rgba(37,99,235,0.03));
}

.beta-info-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.beta-info-text,
.footer-build-label {
  color: var(--text-secondary);
}

.footer-build-label {
  margin-top: 10px;
  font-size: 0.92rem;
}

.footer-feedback-row {
  margin-top: 14px;
}

.footer-feedback-btn {
  width: 100%;
  justify-content: center;
}

.beta-access-overlay {
  position: fixed;
  inset: 0;
  z-index: 10040;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 7, 18, 0.82);
  backdrop-filter: blur(8px);
}

.beta-access-card {
  width: min(100%, 440px);
  border-radius: 24px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.34);
}

.beta-access-kicker {
  margin-bottom: 8px;
  color: var(--accent, #2563EB);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.beta-access-text {
  color: var(--text-secondary);
}

.beta-access-error {
  min-height: 22px;
  margin-top: 10px;
  color: #f87171;
  font-size: 0.92rem;
}

.beta-access-actions .btn-primary {
  width: 100%;
}

body.beta-gate-open {
  overflow: hidden;
}


/* ===== Kedrix Brand Lockup Patch ===== */
.header { gap: 14px; }
.brand-lockup--logo { gap: 12px; flex: 1 1 auto; min-width: 0; }
.brand-logo-shell { display:flex; align-items:center; justify-content:center; padding: 8px 14px; border-radius: 18px; background: linear-gradient(180deg, #04103a 0%, #020a24 100%); border: 1px solid rgba(93, 192, 255, 0.18); box-shadow: 0 16px 34px rgba(2, 7, 23, 0.24); min-width: 0; }
.brand-logo-img { display:block; width: min(100%, 360px); height: auto; max-height: 54px; }
.brand-lockup--logo .beta-build-badge { flex: 0 0 auto; }
@media (max-width: 768px) { .header { align-items:flex-start; } .brand-lockup--logo { gap: 10px; } .brand-logo-shell { padding: 8px 10px; border-radius: 16px; } .brand-logo-img { max-height: 40px; width: min(100%, 240px); } }
@media (max-width: 560px) { .header { gap: 10px; } .brand-lockup--logo { width: 100%; } .brand-logo-shell { width: 100%; } .brand-logo-img { width: 100%; max-height: none; } }


/* ===== KEDRIX HEADER BRAND FIX ===== */
.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.brand-lockup--logo {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}

.brand-combo {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}

.brand-symbol-img {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(37, 99, 235, 0.28));
  margin-top: 1px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.brand-line {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: nowrap;
  min-width: 0;
}

.brand-wordmark-img {
  display: block;
  width: 140px;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-submark-img {
  display: block;
  width: 238px;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  opacity: 0.98;
  flex: 0 1 auto;
  transform: translateY(-1px);
}

.beta-build-badge {
  margin-top: 10px;
}

.brand-logo-shell,
.brand-logo-img,
.brand-block,
.brand-logo,
.brand-text,
.brand-wordmark,
.brand-submark,
.brand-stack {
  all: unset;
}

@media (min-width: 1280px) {
  .brand-symbol-img {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .brand-wordmark-img {
    width: 150px;
  }

  .brand-submark-img {
    width: 252px;
  }
}

@media (max-width: 767px) {
  .header {
    gap: 12px;
  }

  .brand-combo {
    gap: 12px;
  }

  .brand-symbol-img {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .brand-line {
    gap: 10px;
    flex-wrap: wrap;
  }

  .brand-wordmark-img {
    width: 120px;
  }

  .brand-submark-img {
    width: 210px;
  }
}

@media (max-width: 560px) {
  .header {
    gap: 10px;
  }

  .brand-symbol-img {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .brand-line {
    gap: 8px;
  }

  .brand-wordmark-img {
    width: 112px;
  }

  .brand-submark-img {
    width: 188px;
  }

  .beta-build-badge {
    margin-top: 8px;
  }
}

@media (max-width: 420px) {
  .brand-combo {
    gap: 10px;
  }

  .brand-symbol-img {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .brand-wordmark-img {
    width: 100px;
  }

  .brand-submark-img {
    width: 168px;
  }
}


/* ===== final transparent logos: sizing only ===== */
.brand-lockup--logo { display:flex; flex:1 1 auto; min-width:0; }
.brand-combo { display:flex; align-items:flex-start; gap:0; min-width:0; }
.brand-copy { display:flex; flex-direction:column; align-items:flex-start; min-width:0; }
.brand-line { display:flex; align-items:flex-start; gap:14px; flex-wrap:nowrap; min-width:0; }
.brand-logo-group { display:block; line-height:0; flex:0 0 auto; }
.brand-logo-asset { display:block; width:100%; height:auto; object-fit:contain; }
.brand-logo-dark { display:none; }
html[data-theme="dark"] .brand-logo-light { display:none; }
html[data-theme="dark"] .brand-logo-dark { display:block; }
.brand-wordmark-img { width:132px; max-width:100%; }
.brand-submark-img { width:118px; max-width:100%; margin-top:1px; }
.beta-build-badge { margin-top:8px; }
.brand-symbol-img,.brand-logo-shell,.brand-logo-img,.brand-block,.brand-logo,.brand-text,.brand-wordmark,.brand-submark,.brand-stack { display:none !important; }
@media (max-width:767px){ .brand-line{gap:10px;} .brand-wordmark-img{width:110px;} .brand-submark-img{width:96px;} .beta-build-badge{margin-top:6px;} }
@media (max-width:560px){ .brand-line{gap:8px;} .brand-wordmark-img{width:102px;} .brand-submark-img{width:90px;} }
@media (max-width:420px){ .brand-wordmark-img{width:96px;} .brand-submark-img{width:84px;} }


/* ===== 2026-03-19 SURGICAL HEADER PATCH ===== */
body {
  margin: 0;
  padding: 0;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 14px calc(110px + env(safe-area-inset-bottom, 0px));
}

.header.header--surgical {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  margin: 0 0 8px;
  padding: 0;
}

.brand-lockup--surgical {
  min-width: 0;
}

.brand-logo-frame {
  width: min(100%, 360px);
  line-height: 0;
  overflow: visible;
}

.brand-logo-full {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.header-actions--stacked {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  min-width: fit-content;
}

.header-actions-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-actions--stacked .license-status {
  margin: 0;
}

.header-actions--stacked .license-badge {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  line-height: 1;
}

.theme-btn {
  width: auto;
  min-width: 58px;
  height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 700;
  background: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.beta-build-badge--header {
  margin-top: 0;
  min-height: 28px;
  padding: 6px 12px;
}

#subtitle,
.subtitle {
  margin: 0 0 16px;
  font-size: 1rem;
  line-height: 1.35;
}

@media (min-width: 1024px) {
  .brand-logo-frame {
    width: 380px;
  }
}

@media (max-width: 767px) {
  .container {
    padding: 10px 10px calc(108px + env(safe-area-inset-bottom, 0px));
  }

  .header.header--surgical {
    gap: 10px;
    margin-bottom: 6px;
  }

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

  .theme-btn {
    min-width: 56px;
    height: 36px;
    padding: 0 11px;
    font-size: 0.86rem;
  }

  .header-actions-top {
    gap: 6px;
  }
}

@media (max-width: 560px) {
  .header.header--surgical {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

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

  .header-actions--stacked {
    gap: 6px;
  }

  .header-actions-top {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }

  .header-actions--stacked .license-badge,
  .theme-btn,
  .beta-build-badge--header {
    min-width: 72px;
    justify-content: center;
    text-align: center;
  }

  #subtitle,
  .subtitle {
    margin-bottom: 14px;
    font-size: 0.96rem;
  }
}

@media (max-width: 400px) {
  .brand-logo-frame {
    width: min(100%, 200px);
  }

  .header-actions--stacked .license-badge,
  .theme-btn,
  .beta-build-badge--header {
    min-width: 68px;
    padding-left: 10px;
    padding-right: 10px;
  }
}


/* ===== 2026-03-19 beta merged into top-right status ===== */
.beta-combo-status {
  margin: 0;
}

.beta-combo-badge {
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  line-height: 1;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.28);
  color: var(--accent, #2563EB);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.header-actions--stacked {
  gap: 0;
}

.header.header--surgical {
  margin-bottom: 4px;
}

#subtitle,
.subtitle {
  margin: 0 0 14px;
}

@media (max-width: 560px) {
  .header-actions--stacked {
    gap: 0;
  }

  .header-actions-top {
    gap: 6px;
  }

  .beta-combo-badge,
  .theme-btn {
    min-width: 72px;
    justify-content: center;
    text-align: center;
  }
}


/* ===== KEDRIX PATCH v151 — phase 1 UI refinement (surgical / beta-safe) ===== */
:root {
  --kdx-card-radius: 22px;
  --kdx-card-padding: 18px;
  --kdx-card-gap: 12px;
  --kdx-title-tight: -0.028em;
  --kdx-title-medium: -0.02em;
  --kdx-copy-tight: -0.01em;
  --kdx-subtle-strong: color-mix(in srgb, var(--text-secondary) 76%, var(--text-primary) 24%);
  --kdx-subtle-soft: color-mix(in srgb, var(--text-secondary) 88%, var(--text-primary) 12%);
}

/* refined brand + headline tracking */
.brand-lockup,
.brand-lockup img,
.subtitle,
.section-header h2,
.section-header h3,
.home-quick-card .section-header h2,
.premium-text h3,
.premium-modal-title,
#wiseForecastTitle,
#wiseScoreHomeTitle,
.wise-decision-title,
.daily-checkin-title {
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

.subtitle {
  margin: 8px 2px 18px;
  letter-spacing: -0.014em;
  line-height: 1.42;
  color: var(--kdx-subtle-strong);
  max-width: 58ch;
}

.section-header h2,
.section-header h3,
#wiseForecastTitle,
#wiseScoreHomeTitle,
#savingsTitle,
.premium-text h3,
.premium-modal-title {
  letter-spacing: var(--kdx-title-tight) !important;
  line-height: 1.08;
}

.home-quick-card .section-header h2,
#homeQuickAddCard .section-header h2 {
  letter-spacing: -0.024em !important;
}

.wise-decision-title {
  letter-spacing: 0.10em !important;
}

.hero-period-line,
.period-source,
.forecast-subtitle,
.daily-checkin-subtitle,
.home-priority-kicker,
.premium-modal-subtitle,
.hero-meta-label,
.forecast-label,
.wise-score-label,
.wise-decision-label,
.panel-section-subtitle,
.future-fixed-subtitle,
.report-modal-subtitle {
  color: var(--kdx-subtle-strong) !important;
}

.hero-eyebrow,
.premium-badge,
.premium-plan-chip,
.wise-decision-title,
.wise-saving-summary-label,
.wise-saving-mini-label {
  letter-spacing: 0.08em;
}

/* vertical rhythm tightening */
.header.header--surgical {
  margin-bottom: 0;
}

.section-card,
.summary-card,
.home-hero-card,
#wiseDecisionCard,
.wise-decision-card,
#wiseForecastCard,
#wiseScoreHomeCard,
.home-quick-card,
.daily-checkin-card,
.premium-banner--fintech {
  border-radius: var(--kdx-card-radius) !important;
}

.section-card,
.summary-card,
.home-hero-card,
#wiseDecisionCard,
.wise-decision-card,
#wiseForecastCard,
#wiseScoreHomeCard,
.home-quick-card,
.daily-checkin-card {
  padding: var(--kdx-card-padding) !important;
  margin-bottom: 14px;
}

.section-card .section-content,
.summary-card .section-content,
.home-quick-card .section-content,
.forecast-card .section-content,
.wise-decision-card .section-content,
.daily-checkin-card .section-content {
  gap: var(--kdx-card-gap) !important;
}

.section-header,
.hero-card-header,
.daily-checkin-head,
.premium-content--fintech {
  margin-bottom: 10px;
}

.home-hero-card .hero-main {
  margin: 6px 0 16px;
}

.home-hero-card .hero-meta-grid,
.forecast-grid-evolved,
.home-quick-actions,
.premium-mini-points {
  gap: 10px;
}

.hero-meta-card,
.forecast-main-card,
.forecast-side-card,
.wise-pillars,
.analysis-savings-card .savings-widget,
.home-quick-card,
.daily-checkin-card,
#wiseDecisionCard,
.wise-decision-card,
.premium-banner--fintech,
.premium-plan-card {
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.10);
}

/* consistent card system for Premium / Quick Entry / WiseDecision */
.home-quick-card,
#wiseDecisionCard,
.wise-decision-card,
.premium-banner--fintech {
  border: 1px solid color-mix(in srgb, var(--border) 82%, var(--accent) 18%) !important;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--card-bg) 98%, transparent) 0%,
      color-mix(in srgb, var(--surface-2) 100%, transparent) 100%) !important;
}

.home-quick-card::before,
#wiseDecisionCard::after,
.wise-decision-card::after,
.premium-banner--fintech::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.03), transparent 42%);
}

.home-quick-card,
#wiseDecisionCard,
.wise-decision-card,
.premium-banner--fintech {
  position: relative;
  overflow: hidden;
}

.home-priority-kicker,
.voice-status,
.home-quick-hint,
.wise-decision-copy,
.premium-text p,
.premium-mini-points span {
  letter-spacing: var(--kdx-copy-tight);
}

.voice-status,
.home-quick-hint,
.daily-checkin-subtitle,
.forecast-subtitle,
.premium-text p,
.wise-decision-copy {
  color: var(--kdx-subtle-strong) !important;
}

.premium-content--fintech {
  align-items: stretch;
  gap: 14px;
}

.premium-badge,
.wise-decision-reason,
.beta-combo-status .badge,
.hero-eyebrow {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

.home-quick-card .section-header h2,
.premium-text h3,
.wise-decision-label,
.daily-checkin-title {
  color: var(--text-primary) !important;
}

/* tighter action rhythm */
.home-quick-actions .home-voice-btn,
.home-quick-actions .home-manual-btn,
.premium-btn--fintech {
  min-height: 46px;
}

.home-quick-actions .home-manual-btn,
.premium-btn--fintech {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

/* light theme needs a bit more contrast on secondary text */
html:not([data-theme="dark"]) .subtitle,
html:not([data-theme="dark"]) .hero-period-line,
html:not([data-theme="dark"]) .period-source,
html:not([data-theme="dark"]) .forecast-subtitle,
html:not([data-theme="dark"]) .daily-checkin-subtitle,
html:not([data-theme="dark"]) .home-priority-kicker,
html:not([data-theme="dark"]) .premium-text p,
html:not([data-theme="dark"]) .voice-status,
html:not([data-theme="dark"]) .home-quick-hint,
html:not([data-theme="dark"]) .wise-decision-copy,
html:not([data-theme="dark"]) .wise-decision-label,
html:not([data-theme="dark"]) .hero-meta-label,
html:not([data-theme="dark"]) .forecast-label {
  color: color-mix(in srgb, #475569 78%, #0f172a 22%) !important;
}

html[data-theme="dark"] .subtitle,
[data-theme="dark"] .subtitle {
  color: color-mix(in srgb, #cbd5e1 70%, #ffffff 30%) !important;
}

html[data-theme="dark"] .home-quick-card,
html[data-theme="dark"] #wiseDecisionCard,
html[data-theme="dark"] .wise-decision-card,
html[data-theme="dark"] .premium-banner--fintech,
[data-theme="dark"] .home-quick-card,
[data-theme="dark"] #wiseDecisionCard,
[data-theme="dark"] .wise-decision-card,
[data-theme="dark"] .premium-banner--fintech {
  border-color: rgba(148, 163, 184, 0.16) !important;
  box-shadow: 0 16px 34px rgba(2, 6, 23, 0.34) !important;
}

@media (max-width: 820px) {
  .subtitle {
    margin-bottom: 16px;
  }

  .section-card,
  .summary-card,
  .home-hero-card,
  #wiseDecisionCard,
  .wise-decision-card,
  #wiseForecastCard,
  #wiseScoreHomeCard,
  .home-quick-card,
  .daily-checkin-card {
    padding: 16px !important;
    margin-bottom: 12px;
  }

  .home-hero-card .hero-main {
    margin-bottom: 14px;
  }
}

@media (max-width: 640px) {
  .subtitle {
    line-height: 1.38;
  }

  .section-header,
  .hero-card-header,
  .daily-checkin-head,
  .premium-content--fintech {
    margin-bottom: 8px;
  }

  .home-hero-card .hero-meta-grid,
  .forecast-grid-evolved,
  .home-quick-actions,
  .premium-mini-points {
    gap: 8px;
  }
}


/* ===== STEP 17 — beta launch + installable distribution ===== */
.tools-beta-launch-card .section-content {
    gap: 16px;
}

.beta-launch-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(125, 211, 252, 0.18);
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.09), rgba(56, 189, 248, 0.035));
    color: color-mix(in srgb, var(--text-primary) 84%, #dbeafe 16%);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

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

.beta-pillar {
    padding: 15px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.06);
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

.beta-pillar-label {
    display: block;
    margin-bottom: 8px;
    color: color-mix(in srgb, var(--text-secondary) 90%, #e2e8f0 10%);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.beta-pillar strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.96rem;
    line-height: 1.45;
}

.beta-launch-actions {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.beta-launch-status {
    min-height: 22px;
    color: color-mix(in srgb, var(--text-secondary) 88%, #dbeafe 12%);
    font-size: 0.9rem;
    line-height: 1.45;
}

.beta-launch-status.is-success {
    color: var(--success);
}

.beta-launch-status.is-warning {
    color: var(--warning);
}

.beta-launch-status.is-neutral {
    color: color-mix(in srgb, var(--text-secondary) 88%, #dbeafe 12%);
}

@media (max-width: 900px) {
    .beta-pillars-grid {
        grid-template-columns: 1fr;
    }
}
