html,
body {
    font-family: 'Outfit', Helvetica, Arial, sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', Helvetica, Arial, sans-serif;
}

p {
    font-family: 'Inter', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a,
.btn-link {
    color: #1a1a1a;
}

.btn-primary,
.btn-secondary {
    color: #1a1a1a;
    background-color: #cfe8f7;
    border-color: #1d3557;
}

.btn-primary:disabled,
.btn-primary.disabled {
    background-color: #1d3557 !important;
    /* Lighter blue */
    border-color: #1d3557 !important;
    color: #ffffff !important;
    opacity: 1 !important;
    /* Remove Bootstrap's default opacity if you want full color */
    cursor: not-allowed;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-secondary:hover,
.btn-secondary:focus {
    color: #ffffff !important;
    background-color: #1d3557 !important;
    border-color: #1d3557 !important;
}

.btn-outline-primary,
.btn-outline-secondary {
    color: #1a1a1a;
    border-color: #1d3557;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    color: #1a1a1a !important;
    background-color: #cfe8f7 !important;
    border-color: #1d3557 !important;
}

.btn-outline-success,
.btn.text-success.btn-outline-success {
    color: #198754 !important;
    /* Bootstrap green */
    border-color: #198754 !important;
    background-color: #ffffff !important;
    /* White background */
}

.btn-outline-success:hover,
.btn.text-success.btn-outline-success:hover,
.btn-outline-success:focus,
.btn.text-success.btn-outline-success:focus {
    color: #ffffff !important;
    background-color: #198754 !important;
    border-color: #198754 !important;
}

.btn-outline-danger,
.btn.text-danger.btn-outline-danger {
    color: #df1616 !important;
    /* Your red */
    border-color: #df1616 !important;
    background-color: #ffffff !important;
    /* White background */
}

.btn-outline-danger:hover,
.btn.text-danger.btn-outline-danger:hover,
.btn-outline-danger:focus,
.btn.text-danger.btn-outline-danger:focus {
    color: #ffffff !important;
    background-color: #df1616 !important;
    border-color: #df1616 !important;
}

.top-row.navbar,
.navbar {
    background-color: #1d3557 !important;
    color: #ffffff !important;
}

.top-row.navbar .navbar-brand,
.top-row.navbar .nav-link,
.top-row.navbar .navbar-toggler,
.navbar .navbar-brand,
.navbar .nav-link,
.navbar .navbar-toggler {
    color: #ffffff !important;
}

.nav-scrollable {
    background: #1d3557 !important;
    color: #ffffff !important;
}

.nav-scrollable .btn.btn-primary.bg-warning.text-dark,
.badge.shadow-sm.bg-warning.text-dark.trial-badge {
    background-color: #cfe8f7 !important;
    color: #1a1a1a !important;
    border-color: #1d3557 !important;
}

.nav-scrollable .nav-link,
.nav-scrollable .navbar-brand,
.nav-scrollable .navbar-toggler,
.nav-scrollable .link-account-container,
.nav-scrollable .btn,
.nav-scrollable .trial-badge {
    color: #ffffff !important;
    background: transparent !important;
}

.nav-scrollable .nav-link.active,
.nav-scrollable .nav-link:focus,
.nav-scrollable .nav-link:hover {
    color: #cfe8f7 !important;
    /* Optional: lighter blue on hover/active */
    background: rgba(255, 255, 255, 0.05) !important;
    /* Optional: subtle highlight */
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem #ffffff, 0 0 0 0.25rem #cfe8f7;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: #ffffff;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.bunny-spinner {
    display: inline-block;
    width: 10rem;
    /* Matches spinner-border default size */
    height: 10rem;
    /* Matches spinner-border default size */
    background: url('/loading_120x120.gif') center/contain no-repeat;
    animation: bunny-spin 1s linear infinite;
    /* Ensures the animation plays on repeat */
}

.bunny-error {
    display: inline-block;
    width: 1.7em;
    height: 1.7rem;
    background: url('/error_120x120.png') center/contain no-repeat;
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #cfe8f7;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #1d3557;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

code {
    color: #c02d76;
}

/* Hide the text inside the progress bar when the width is too small */
.progress-bar {
    position: relative;
    overflow: hidden;
}

.progress-text {
    color: #1a1a1a;
    font-size: smaller;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.feed-input-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: flex-start;
    padding: 10px;
    box-sizing: border-box;
    background-color: #ffffff;
    margin-bottom: 10px;
    /* Add spacing below the container */
    z-index: 1;
    /* Ensure it appears above other content if necessary */
}

.lightbulb-container {
    transition: all 0.3s ease-in-out;
}

.lightbulb-icon {
    transition: color 0.3s ease-in-out, transform 0.3s ease-in-out;
    color: #1d3557;
}

.recommendation-badge {
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.fade-in {
    opacity: 1;
    transform: scale(1);
}

.fade-out {
    opacity: 0;
    transform: scale(0.8);
}

.list-group-item.active {
    background-color: #cfe8f7 !important;
    color: inherit;
    /* Keeps the text color unchanged */
    border-color: inherit;
    /* Keeps the border color unchanged */
}

.rounded-textbox {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border: 1px solid #ced4da;
    border-radius: 25px;
    background-color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    width: 100%;
}

.rounded-textbox:hover {
    background-color: #e9ecef;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.rounded-textbox.disabled {
    background-color: #e9ecef;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    cursor: not-allowed;
}

.rounded-textbox.disabled:hover {
    background-color: #e9ecef;
    /* Keep the same as the disabled state */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    /* Keep the same as the disabled state */
}

.disclaimer-banner {
    background-color: #faf2a4;
    box-shadow: 0 2px 8px 0 #fff3cd;
}

.placeholder-text {
    color: #6c757d;
    font-size: 1rem;
}

.nav-menu-icon {
    display: inline-flex;
    /* Ensures the icon aligns properly with text */
    align-items: center;
    /* Vertically centers the icon */
    justify-content: center;
    /* Centers the icon horizontally if needed */
    font-size: 1.2rem;
    /* Adjust size if necessary */
    vertical-align: middle;
    /* Ensures alignment with surrounding text */
    line-height: 1;
    /* Ensures consistent alignment */
    margin-right: 0.5rem;
    /* Adds spacing between the icon and text */
}

.subtle-line {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    /* Light gray line */
    width: 80%;
    /* 80% width */
    margin: 1rem auto;
    /* Centered with spacing */
}

/* Textarea styling */
.feed-textarea {
    flex: 1;
    resize: none;
    /* Disable resizing */
    min-height: 40px;
    max-height: 150px;
    /* Optional: Limit the height */
    overflow-y: auto;
    /* Enable scrolling if content exceeds max height */
    box-sizing: border-box;
    /* Include padding and border in the total size */
}

/* Submit button styling */
.feed-submit-button {
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 5px;
    /* Additional margin for better spacing */
    height: fit-content;
    /* Ensure the button height adjusts to its content */
}

.feed-card {
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    border: none;
}

/* Timestamp and expiration styles */
.feed-item-timestamp {
    font-size: smaller;
    color: gray;
}

.feed-item-expiration {
    font-size: smaller;
    color: gray;
    text-align: right;
}

.chevron-icon {
    transition: transform 0.2s ease-in-out;
}

/* Sticky container for alerts and reply input */
.sticky-bottom-container {

    bottom: env(safe-area-inset-bottom);
    /* Adjust for iOS safe area */
    left: var(--navbar-width, 0);
    /* Dynamically adjust based on navbar width */
    width: 100%;
    background-color: #ffffff;
    /* Ensure it has a consistent background */
    padding: 10px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    /* Optional: Add a shadow for better visibility */
    z-index: 10;
    /* Ensure it appears above other content */
    box-sizing: border-box;
    /* Include padding and border in the total size */
    transition: width 0.3s ease, left 0.3s ease;
    /* Smooth transition for responsiveness */
}

/* Ensure the textarea and button are styled properly */
.sticky-bottom-container .feed-textarea {
    flex: 1;
    resize: none;
    /* Disable resizing */
    min-height: 40px;
    max-height: 150px;
    /* Optional: Limit the height */
    overflow-y: auto;
    /* Enable scrolling if content exceeds max height */
    box-sizing: border-box;
    /* Include padding and border in the total size */
}

.sticky-bottom-container .feed-submit-button {
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 5px;
    /* Additional margin for better spacing */
    height: fit-content;
    /* Ensure the button height adjusts to its content */
}

/* Ensure the alert is styled properly */
.sticky-bottom-container .alert {
    margin-bottom: 10px;
    /* Add spacing below the alert */
    padding: 10px;
    border-radius: 5px;
    /* Optional: Add rounded corners */
    box-sizing: border-box;
    width: 100%;
    /* Ensure it spans the full width */
}

#scrollableDiv {
    height: calc(100vh - 150px);
    /* Default height adjustment */
    overflow-y: auto;
    /* Enable vertical scrolling */
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
    position: relative;
    padding-bottom: 20px;
    /* Prevent content cutoff */
    border-radius: 10px 10px 0 0;
    /* Rounded corners only at the top */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    /* Optional: Add a shadow for consistency */
    border: 1px solid #ddd;
    /* Optional: Add a light border for better visibility */
    background-color: #ffffff;
    ;
    /* Ensure it has a consistent background */
}

.link-account-container {
    display: flex;
    justify-content: flex-end;
    /* Align the button to the right */
    padding: 10px 15px;
    /* Add padding for spacing */
    background-color: transparent;
    /* Ensure it blends with the navmenu */
}

.nav-scrollable .link-account-container {
    display: flex;
    justify-content: flex-start;
    /* Align with the nav menu items */
    align-items: center;
    /* Vertically center the button */
    padding: 10px 15px;
    /* Match the padding of other nav items */
    margin-top: 10px;
    /* Add spacing between the button and other nav items */
}

.nav-scrollable .link-account-container .btn-primary {
    width: 100%;
    /* Ensure the button spans the container width */
    text-align: center;
    /* Center the text inside the button */
    font-size: 14px;
    /* Match the font size of other nav items */
    padding: 8px 16px;
    /* Adjust padding for consistency */
    border-radius: 5px;
    /* Optional: Add rounded corners */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    /* Optional: Add a subtle shadow */
}

.link-account-container .btn-primary {
    padding: 8px 16px;
    /* Adjust padding for better spacing */
    font-size: 14px;
    /* Ensure consistent font size */
    border-radius: 5px;
    /* Optional: Add rounded corners */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    /* Optional: Add a subtle shadow */
}

.content-container {
    position: relative;
    overflow: hidden;
    max-height: 7.5em;
    /* Approx. 5 lines */
    line-height: 1.5em;
}

.content-container.collapsed::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2em;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #ffffff);
}

.content-container.expanded {
    max-height: none;
}

.content-container table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 1em;
    overflow-x: auto;
    /* Ensure horizontal scrolling */
    display: block;
    /* Allow scrolling */
}

.content-container table th,
.content-container table td {
    border: 1px solid #1a1a1a;
    padding: 8px;
    text-align: left;
}

.content-container table th {
    background-color: #ffffff;
    font-weight: bold;
}

.content-container table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 1em;
    overflow-x: auto;
    white-space: nowrap;
    display: block;
}

.content-container ul>li>.mjx-container {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    /* Prevent wrapping */
    max-width: 100%;
    /* Ensure it doesn't exceed the container width */
}

div.card-body table.custom-table tbody tr {
    border-bottom: 1px solid #dee2e6 !important;
    /* Ensure the border is applied */
}

div.card-body table.custom-table tbody tr:last-child {
    border-bottom: none !important;
    /* Ensure the last row has no border */
}

.custom-table a.text-primary {
    cursor: pointer;
    /* Ensures the cursor changes to a pointer on hover */
    /* Keeps the link styling consistent */
}

.trial-badge {
    animation: fadeInScale 0.5s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    /* Ensures it aligns with the text height */
}

.trial-button-container .btn {
    transition: background-color 0.3s ease, color 0.3s ease;
}

.trial-button-container .btn:hover {
    background-color: #df1616;
    /* Slightly lighter yellow */
    color: #ffffff;
    /* Ensure text remains dark */
}

.container-fluid {
    display: flex;
    align-items: center;
    /* Ensures vertical alignment of all children */
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.chartJs_v4 {
    min-height: 350px;
    max-height: 600px;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.budget-charts {
    min-height: 350px;
    max-height: 600px;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.reconnect-rotating {
    display: inline-block;
    animation: reconnect-spin 1s linear infinite;
}

@keyframes reconnect-spin {
    100% {
        transform: rotate(360deg);
    }
}

.modal-open {
    overflow: hidden !important;
}

.custom-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    accent-color: #1a1a1a;
    /* Bootstrap primary */
    vertical-align: middle;
}

.form-select,
.form-select option {
    font-size: 1rem !important;
}

.custom-category-dropdown {
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.10);
    min-width: 100%;
    border: 1px solid #e0e0e0;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

.dropdown-group {
    font-weight: 600;
    font-size: 0.95em;
    color: #888;
}

.btn-empty-bookmark {
    width: 2.5rem;
    height: 2.5rem;
    background: transparent url('/bookmark-empty-icon.svg') center/2.5rem 2.5rem no-repeat;
    border: none;
    cursor: pointer;
    padding: 0;
}

.btn-empty-bookmark,
.btn-filled-bookmark {
    border-radius: 50%;
    transition: background 0.2s, box-shadow 0.2s;
}

.btn-empty-bookmark:hover,
.btn-filled-bookmark:hover {
    background-color: #f5f7fa;
    /* Light gray background on hover */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 50%;
}

.btn-filled-bookmark {
    width: 2.5rem;
    height: 2.5rem;
    background: transparent url('/bookmark-icon.svg') center/2.5rem 2.5rem no-repeat;
    border: none;
    cursor: pointer;
    padding: 0;
}

.filled-hourglass {
    width: 2rem;
    height: 2rem;
    background: transparent url('/hourglass-icon.svg') center/2rem 2rem no-repeat;
    border: none;
    padding: 0;
}

.amount-positive {
    color: #198754;
    /* Bootstrap green */
    font-weight: bold;
}

.transaction-divider {
    border-bottom: 1px solid #e5e7eb;
    /* subtle light grey */
    margin-bottom: 8px;
    /* Add spacing below the row */
}

tr.transaction-divider>td {
    padding-bottom: 12px;
}

.transaction-row-link:hover {
    background-color: #f5f7fa;
    transition: background 0.15s;
}

.transaction-selectable-row:hover {
    background-color: #f5f7fa;
    transition: background 0.15s;
}

.transaction-selected-row {
    background-color: #1d3557 !important;
    color: #f5f7fa !important;
}

.transaction-row-link {
    transition: background 0.15s;
}

.transaction-row-disabled {
    pointer-events: none;
    opacity: 0.7;
}

.large-checkbox {
    width: 1.5em;
    height: 1.5em;
}

.slider-labels-mobile {
    flex-wrap: nowrap !important;
}

.min-width-0 {
    min-width: 0;
}

.slider-labels-fixed {
    flex-wrap: nowrap !important;
}

.slider-label {
    width: 33.33%;
    min-width: 0;
    display: block;
}

.slider-label-left {
    text-align: left;
}

.slider-label-center {
    text-align: center;
}

.slider-label-right {
    text-align: right;
}

.budget-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.budget-main-content {
    flex: 1;
    padding-right: 20px;
}

.budget-sidebar {
    flex: 0 0 30%;
}

.summary-item {
    display: grid;
    grid-template-columns: 100px 100px 140px;
    gap: 20px;
    align-items: center;
}

.summary-item>div,
.summary-item>span:not(:first-child) {
    text-align: right;
}

.tab-navigation {
    display: flex;
    border-bottom: 2px solid #e1e5e9;
    margin-bottom: 20px;
}

.tab-button {
    background: none;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-button:hover {
    color: #495057;
    background-color: #f8f9fa;
}

.tab-button.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background-color: #fff;
}

.budget-grid-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.budget-grid-header {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr 1.5fr;
    gap: 16px;
    background-color: #f8f9fa;
    padding: 16px;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #e1e5e9;
}

.budget-grid-body {
    display: flex;
    flex-direction: column;
}

.budget-grid-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr 1.5fr;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid #e1e5e9;
    transition: background-color 0.2s ease;
}

.budget-grid-row:hover {
    background-color: #f8f9fa;
}

.budget-grid-totals {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr 1.5fr;
    gap: 16px;
    padding: 16px;
    background-color: #f8f9fa;
    border-top: 2px solid #dee2e6;
    font-weight: 600;
}

.grid-cell {
    display: flex;
    align-items: center;
    min-height: 24px;
}

.grid-header-item {
    font-weight: 600;
    color: #495057;
}

.category-name {
    font-weight: 500;
}

.budgeted-amount,
.actual-amount,
.remaining-amount,
.total-budgeted,
.total-actual,
.total-remaining {
    justify-content: flex-end;
    font-family: monospace;
    text-align: right;
}

.amount-content {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.mobile-label {
    display: none;
    font-weight: 600;
    color: #6c757d;
    margin-right: 8px;
    min-width: 80px;
}

.change-positive {
    color: #28a745;
    font-size: 0.875em;
    margin-left: 8px;
}

.change-negative {
    color: #dc3545;
    font-size: 0.875em;
    margin-left: 8px;
}

.arrow-up {
    font-size: 0.75em;
    margin-right: 2px;
}

.arrow-down {
    font-size: 0.75em;
    margin-right: 2px;
}

.positive {
    color: #28a745;
}

.negative {
    color: #dc3545;
}

.totals-row {
    background-color: #f8f9fa;
    border-top: 2px solid #dee2e6;
}

.budget-sidebar {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.sidebar-content {
    padding: 20px;
}

.sidebar-content h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #495057;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e1e5e9;
}

.summary-item:last-child {
    border-bottom: none;
    font-weight: 600;
}

.budget-mode-toggle {
    cursor: pointer;
    user-select: none;
}

.toggle-pill {
    display: flex;
    border-radius: 20px;
    border: 2px solid #dee2e6;
    overflow: hidden;
    width: 140px;
    height: 32px;
    position: relative;
    transition: all 0.3s ease;
}

.toggle-pill.manual-active {
    background: linear-gradient(to right, #1d3557 50%, #fff 50%);
    border-color: #1d3557;
}

.toggle-pill.auto-active {
    background: linear-gradient(to right, #fff 50%, #1d3557 50%);
    border-color: #1d3557;
}

.toggle-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 8px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.toggle-pill.manual-active .toggle-option:first-child.active {
    color: #fff;
}

.toggle-pill.manual-active .toggle-option:last-child {
    color: #6c757d;
}

.toggle-pill.auto-active .toggle-option:first-child {
    color: #6c757d;
}

.toggle-pill.auto-active .toggle-option:last-child.active {
    color: #fff;
}

/* Responsive behavior for smaller screens */
@media (max-width: 576px) {

    html,
    body {
        height: 100%;
        margin: 0;
        padding: 0;
        overflow-x: hidden; /* Prevent horizontal scroll on body */
    }

    /* Anchored tour mobile overrides */
    .anchored-tour-step {
        position: fixed !important;
        /* Don't force bottom/top - let JavaScript position it */
        left: 16px !important;
        right: 16px !important;
        width: auto !important;
        max-width: none !important;
        transform: none !important;
    }

    /* Hide arrows on mobile since we're using fixed bottom positioning */
    .tour-arrow {
        display: none !important;
    }

    /* Adjust overlay to allow seeing highlighted element */
    .anchored-tour-overlay {
        background: rgba(0, 0, 0, 0.3) !important;
    }

    /* Make highlight more prominent on mobile */
    .tour-highlight {
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.5), 
                    0 0 20px rgba(102, 126, 234, 0.3) !important;
        animation: mobilePulse 2s infinite;
    }

    @keyframes mobilePulse {
        0%, 100% {
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.5), 
                        0 0 20px rgba(102, 126, 234, 0.3);
        }
        50% {
            box-shadow: 0 0 0 5px rgba(102, 126, 234, 0.7), 
                        0 0 30px rgba(102, 126, 234, 0.5);
        }
    }

    /* Ensure content is scrollable if needed */
    .tour-body {
        max-height: 200px;
        overflow-y: auto;
    }

    /* Accounts page table responsiveness */
    .accounts-name-col {
        width: 50%;
        min-width: 0;
    }
    
    .accounts-updated-col {
        width: 25%;
        min-width: 0;
    }
    
    .accounts-balance-col {
        width: 25%;
        min-width: 0;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border: none;
    }

    .custom-table {
        min-width: 100%;
        table-layout: fixed;
    }

    .custom-table th,
    .custom-table td {
        padding: 0.5rem 0.25rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        font-size: 0.875rem;
    }

    /* Accounts page mobile responsiveness - scoped to prevent affecting other pages */
    
    /* Date range buttons responsiveness - specific to accounts page */
    .date-range-btn {
        min-width: 0;
        max-width: none;
        flex: 0 1 auto;
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
        width: auto;
    }

    /* Accounts page specific: button container overflow control */
    .accounts-page .d-flex.w-100 {
        max-width: calc(100vw - 2rem);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 0.5rem;
    }

    /* Accounts page specific: Override em padding with rem for better mobile control */
    .accounts-page .d-flex.flex-column.mb-3 {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* Accounts page specific: Ensure all cards have proper mobile margins */
    .accounts-page .card.mb-3.ms-1.me-1 {
        margin-left: 0.25rem !important;
        margin-right: 0.25rem !important;
    }

    /* Accounts page specific: Chart containers */
    .accounts-page .net-wealth-container {
        max-width: 100%;
        overflow: hidden;
    }

    /* Accounts page specific: Ensure containers don't exceed viewport */
    .accounts-page .container,
    .accounts-page .container-fluid,
    .accounts-page .card,
    .accounts-page .card-body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .content-container table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        /* Prevent wrapping */
    }

    .content-container table th,
    .content-container table td {
        white-space: nowrap;
        /* Prevent text wrapping in cells */
    }

    .feed-input-container {
        margin-top: auto;
        /* Ensure it stays at the bottom of the ScrollableDiv */
    }

    .link-account-container {
        justify-content: center;
        /* Center the button on smaller screens */
        padding: 10px;
        /* Adjust padding for smaller screens */
    }

    .link-account-container .btn-primary {
        width: 100%;
        /* Make the button full-width */
        text-align: center;
        /* Center the text inside the button */
    }

    .feed-submit-button {
        width: 100%;
        /* Make the button full-width */
    }

    #scrollableDiv {
        height: calc(var(--vh, 1vh) * 100 - 250px);
        /* Dynamically adjust height for iOS */
    }

    .sticky-bottom-container {
        left: 0;
        /* Remove left offset for smaller screens */
        width: 100%;
        /* Full width for mobile */
    }

    .sticky-bottom-container .feed-submit-button {
        width: 100%;
        /* Make the button full-width */
    }

    .article {
        height: 100%;
        display: flex;
        flex-direction: column;
        padding-left: 0px;
        padding-right: 0px;
    }

    .progress-text {
        font-size: x-small;
    }

    .processing-item {
        background: linear-gradient(90deg, #f8f9fa 0%, #e9ecef 50%, #f8f9fa 100%);
        background-size: 200% 100%;
        animation: shimmer 2s infinite;
        opacity: 0.95;
    }

    @keyframes shimmer {
        0% {
            background-position: -200% 0;
        }
        100% {
            background-position: 200% 0;
        }
    }

    .feed-card.mobile-format {
        border: none;
        box-shadow: none;
        margin: 0;
        border-top: 4px solid #ddd;
        border-bottom: 4px solid #ddd;
        padding: 0.5rem;
    }

    .feed-card.mobile-format .card-body {
        padding: 0.75rem;
    }

    /* .budget-chart {
        font-size: 0.9rem;
    } */

    .chart-bar {
        height: 16px;
    }

    .actual {
        font-size: 0.8rem;
    }

    .slider-labels-mobile {
        max-width: 200px;
        margin: 0 auto;
        flex-direction: column !important;
        gap: 0.5rem;
    }

    /* Mobile-specific MathJax styling */
    .MathJax_Display {
        font-size: 14px !important;
        transform-origin: left center;
        transform: scale(0.9);
        min-height: 2.5em !important;
        padding: 0.5em 0.2em !important;
        margin: 0.8em 0 !important;
        overflow: visible !important;
    }

    .MathJax {
        font-size: 14px !important;
        min-height: 2em !important;
        line-height: 1.6 !important;
        padding: 0.3em 0.1em !important;
        margin: 0.4em 0 !important;
        overflow: visible !important;
    }

    mjx-container {
        overflow-x: auto !important;
        overflow-y: visible !important;
        max-width: 100% !important;
        min-height: 2em !important;
        padding: 0.4em 0.2em !important;
        margin: 0.5em 0 !important;
    }

    mjx-math {
        max-width: 100% !important;
        min-height: 1.8em !important;
        padding: 0.2em 0 !important;
        overflow: visible !important;
    }

    .budget-container {
        flex-direction: column;
    }

    .budget-main-content,
    .budget-sidebar {
        flex: 1 1 100%;
    }

    .tab-navigation {
        overflow-x: auto;
        white-space: nowrap;
    }

    .tab-button {
        min-width: 100px;
    }

    /* Mobile grid layout */
    .budget-grid-header {
        display: none;
    }

    .budget-grid-row,
    .budget-grid-totals {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 16px;
    }

    .grid-cell {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid #f1f3f4;
    }

    .grid-cell:last-child {
        border-bottom: none;
    }

    .mobile-label {
        display: block;
    }

    .budgeted-amount,
    .actual-amount,
    .remaining-amount,
    .total-budgeted,
    .total-actual,
    .total-remaining {
        justify-content: flex-start;
    }

    .amount-content {
        justify-content: flex-start;
    }

    .budget-grid-row {
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        margin-bottom: 12px;
        border: none;
    }

    .budget-grid-totals {
        background: #f8f9fa;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        margin-top: 16px;
        border: none;
    }
}

/* Hide bullet for li elements in .content-container ul that have a direct child with class mjx-container */
.content-container ul>li>.mjx-container {
    display: inline-block;
}

.content-container ul>li>.mjx-container {
    /* Hide bullet for the parent li */
    list-style: none;
    list-style-type: none;
    margin-left: 0;
    padding-left: 0;
}

.content-container ul>li {
    /* Hide bullet if the li contains only MathJax */
    list-style: none;
    list-style-type: none;
    margin-left: 0;
    padding-left: 0;
}

/* MathJax responsive styling */
.MathJax_Display {
    overflow-x: auto;
    overflow-y: visible;
    max-width: 100%;
    min-height: 2em;
    padding: 0.4em 0.2em;
    margin: 0.6em 0;
}

.MathJax {
    max-width: 100% !important;
    overflow-x: auto;
    overflow-y: visible;
    min-height: 1.8em;
    padding: 0.3em 0.1em;
    margin: 0.4em 0;
}

/* Additional MathJax container styling */
mjx-container {
    overflow-x: auto !important;
    overflow-y: visible !important;
    max-width: 100% !important;
    min-height: 1.8em !important;
    padding: 0.3em 0.1em !important;
    margin: 0.4em 0 !important;
}

mjx-math {
    max-width: 100% !important;
    min-height: 1.5em !important;
    padding: 0.2em 0 !important;
    overflow: visible !important;
}

/* Anchored Tour Styles */
.anchored-tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
}

.anchored-tour-step {
    position: absolute;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    max-width: 320px;
    width: 320px;
    z-index: 1051;
    animation: tourFadeIn 0.3s ease-out;
}

@keyframes tourFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tour-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.anchored-tour-step.position-bottom .tour-arrow {
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 8px 8px 8px;
    border-color: transparent transparent white transparent;
}

.anchored-tour-step.position-top .tour-arrow {
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 8px 0 8px;
    border-color: white transparent transparent transparent;
}

.anchored-tour-step.position-left .tour-arrow {
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 8px 0 8px 8px;
    border-color: transparent transparent transparent white;
}

.anchored-tour-step.position-right .tour-arrow {
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 8px 8px 8px 0;
    border-color: transparent white transparent transparent;
}

.tour-content {
    padding: 16px;
}

.tour-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
}

.tour-header h6 {
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.tour-header .btn-close {
    padding: 0;
    width: 20px;
    height: 20px;
}

.tour-body {
    margin-bottom: 16px;
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
}

.tour-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #e9ecef;
}

.tour-progress {
    display: flex;
    gap: 6px;
}

.tour-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #dee2e6;
    transition: all 0.3s ease;
}

.tour-dot.active {
    background-color: #667eea;
    width: 20px;
    border-radius: 4px;
}

.tour-actions {
    display: flex;
    gap: 8px;
}

.tour-actions .btn {
    font-size: 0.85rem;
    padding: 4px 12px;
}

/* Highlight target element */
.tour-highlight {
    position: relative;
    z-index: 1052 !important;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.3) !important;
    border-radius: 4px;
    transition: all 0.3s ease;
}

/* File upload drag and drop overlay */
.drag-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.95);
    border: 2px dashed #0d6efd;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

.drag-overlay-content {
    text-align: center;
    color: #0d6efd;
    font-weight: 500;
}
