html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Hide Blazor Server reconnection UI */
#components-reconnect-modal {
    display: none !important;
}

a, .btn-link {
    color: #006bb7;
}

.btn:hover {
    color: #0056b3;
    transition: color 0.3s ease;
    background-color: rgba(0, 123, 255, 0.1);
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn-oval {
    border-radius: 1.5rem;
    padding: 0.5rem 1rem;
}

/* External Login Provider Buttons */
.btn-vipps,
.btn-microsoft,
.btn-google {
    width: 100%;
    max-width: 250px;
    height: 42px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 0.5rem 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    transition: all 0.3s ease;
    text-transform: none;
}

.btn-vipps {
    color: #fff;
    background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
    box-shadow: 0 2px 12px rgba(234, 88, 12, 0.4);
}

.btn-vipps:hover {
    background: linear-gradient(135deg, #f97316 0%, #c2410c 100%);
    box-shadow: 0 4px 16px rgba(234, 88, 12, 0.5);
    transform: translateY(-2px);
    color: #fff;
}

.btn-vipps:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #ea580c;
}

.btn-microsoft {
    color: #fff;
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.4);
}

.btn-microsoft:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.5);
    transform: translateY(-2px);
    color: #fff;
}

.btn-microsoft:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #2563eb;
}

.btn-google {
    color: #fff;
    background: linear-gradient(135deg, #34d399 0%, #059669 100%);
    box-shadow: 0 2px 12px rgba(5, 150, 105, 0.4);
}

.btn-google:hover {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.5);
    transform: translateY(-2px);
    color: #fff;
}

.btn-google:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #059669;
}

.provider-logo {
    height: 20px;
    width: auto;
    vertical-align: middle;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.card {
    vertical-align: top;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.3s ease;
    background-color: white;
    color: black;
    text-decoration: none;
    display: block;
}

.card:hover {
    color: #0056b3;
    transition: color 0.3s ease;
    background-color: rgba(0, 123, 255, 0.1);
}

.card-striped {
    background-color: #f8f9fa;
    min-height: 320px;
    vertical-align: top;
    box-sizing: border-box;
    display: inline-block;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA9NC4wODE1IDI5MSA9NC42NzgyIDI5MSA9Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.quote-bubble {
    width: 320px;
    height: 220px;
    display: inline-block;
    margin: 10px;
    vertical-align: top;
    background-color: #f8f9fa;
    box-sizing: border-box;
    overflow: hidden;
    padding: 16px;
    border-radius: 16px;
    text-align: left;
    border: 2px solid transparent;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.quote-bubble:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.14);
    border-color: #1b6ec2;
    background-color: #ffffff;
}

.quote-bubble h5 {
    transition: color 0.25s ease;
}

.quote-bubble:hover h5 {
    color: #1b6ec2;
}

.quote-bubble h5 i {
    transition: transform 0.3s ease;
    display: inline-block;
}

.quote-bubble:hover h5 i {
    transform: scale(1.15);
}

.card.quote-bubble.btn-light {
    width: 320px;
    height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 10px;
    box-sizing: border-box;
    overflow: hidden;
}

/* ══════════════════════════════════════════════════════════
   GLOBAL PAGE HEADER — purple-indigo gradient (matches Budget)
   ══════════════════════════════════════════════════════════ */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.75rem 1.5rem 1.5rem;
    text-align: center;
    width: 100%;
}

.page-header h1 {
    color: white;
    font-size: 1.9rem;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    margin-bottom: 0.4rem;
}

.page-header h2 {
    color: white;
    font-size: 1.4rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.page-header p {
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 0.5rem;
}

.page-header b,
.page-header strong {
    color: white;
}

.page-header i {
    color: rgba(255, 255, 255, 0.95);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
}

/* Frosted pill badges inside page-header */
.page-header .btn-oval.btn-light {
    background: rgba(255, 255, 255, 0.18) !important;
    border: 1px solid rgba(255, 255, 255, 0.32) !important;
    color: rgba(255, 255, 255, 0.95) !important;
}

.page-header .btn-oval.btn-light i {
    color: rgba(255, 255, 255, 0.9) !important;
    filter: none !important;
}

/* Solid white action buttons — clearly readable on gradient */
.page-header .btn-action {
    background-color: white;
    color: #5a3680;
    border: none;
    font-weight: 700;
    padding: 0.5rem 1.4rem;
    border-radius: 0.375rem;
}

.page-header .btn-action:hover {
    background-color: #f0ebff;
    color: #42256b;
}

.page-header .btn-ghost {
    background: rgba(255, 255, 255, 0.18);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.45);
    font-weight: 600;
    padding: 0.5rem 1.4rem;
    border-radius: 0.375rem;
}

.page-header .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.30);
    color: white;
}

/* ══════════════════════════════════════════════════════════
   ACCOUNT HEADER — slim variant for auth / account pages
   ══════════════════════════════════════════════════════════ */
.account-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.25rem 1.5rem 1.1rem;
    text-align: center;
    width: 100%;
    margin-bottom: 1.5rem;
}

.account-header h1 {
    color: white;
    font-size: 1.55rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.account-header .account-header-icon {
    font-size: 1.6rem;
    margin-right: 0.5rem;
    vertical-align: middle;
    opacity: 0.92;
}

/* ══════════════════════════════════════════════════════════
   MOBILE RESPONSIVENESS
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .page-header {
        padding: 1.25rem 0.75rem 1.1rem;
    }

    .page-header h1 {
        font-size: 1.45rem;
    }

    .page-header h2 {
        font-size: 1.15rem;
    }

    .page-header p {
        font-size: 0.95rem !important;
    }

    .account-header h1 {
        font-size: 1.25rem;
    }

    /* Quote-bubbles stack full-width on mobile */
    .quote-bubble {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        display: block !important;
        margin: 8px 0 !important;
        box-sizing: border-box;
    }

    .card.quote-bubble.btn-light {
        width: 100% !important;
        height: auto !important;
    }

    /* Pill badges wrap cleanly */
    .page-header p,
    .content p {
        word-wrap: break-word;
    }

    /* Tighter horizontal padding in content sections */
    .content.px-4 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    /* Buttons stack vertically */
    .page-header .btn {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .page-header .btn + .btn {
        margin-left: 0 !important;
    }
}

.ql-code-block-container {
    background-color: #f0f0f0; /* Light grey background */
    border: 1px solid #ccc; /* Subtle border */
    border-radius: 5px; /* Rounded corners */
    padding: 15px; /* Internal spacing */
    margin-bottom: 1em; /* Space below the code block */
    font-family: 'Courier New', Courier, monospace; /* Monospaced font */
    font-size: 0.9em; /* Slightly smaller font size */
    line-height: 1.5; /* Line spacing */
    overflow-x: auto; /* Enable horizontal scrolling for long lines */
    white-space: pre-wrap; /* Preserve whitespace and wrap lines */
}

    /* Styling for the actual code within the container */
    .ql-code-block-container pre.ql-syntax {
        margin: 0; /* Remove default margin from the pre tag */
        padding: 0; /* Remove default padding from the pre tag */
        color: #333; /* Darker text color */
    }

        /* Example of highlighting for specific code languages (if using a syntax highlighter like highlight.js) */
        .ql-code-block-container pre.ql-syntax .hljs-keyword {
            color: #007bff; /* Blue for keywords */
        }

        .ql-code-block-container pre.ql-syntax .hljs-string {
            color: #28a745; /* Green for strings */
        }

/* ══════════════════════════════════════════════════════════
   TABLE STYLING — modern, responsive tables with gradient headers
   ══════════════════════════════════════════════════════════ */

/* Base table styling — applies to blog content and general tables */
.blog-content table,
table.data-table {
    border-collapse: separate;
    border-spacing: 0;
    empty-cells: show;
    width: 100%;
    margin: 20px 0;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Cell styling with proper alignment */
.blog-content table td,
.blog-content table th,
table.data-table td,
table.data-table th {
    border: none;
    border-bottom: 1px solid #e8e8f0;
    min-width: 80px;
    padding: 12px 16px;
    vertical-align: middle;
    text-align: left;
}

/* Ensure numeric columns are right-aligned */
.blog-content table td.numeric,
.blog-content table th.numeric,
table.data-table td.numeric,
table.data-table th.numeric {
    text-align: right;
}

/* Center-aligned columns */
.blog-content table td.center,
.blog-content table th.center,
table.data-table td.center,
table.data-table th.center {
    text-align: center;
}

/* Header styling with purple-indigo gradient matching the app theme */
.blog-content table th,
table.data-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    font-size: 0.8em;
    letter-spacing: 0.8px;
    border-bottom: 3px solid #5a3680;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

/* Sticky header for scrollable tables */
.blog-content table thead th,
table.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* First column styling - slightly emphasized */
.blog-content table tbody tr td:first-child,
table.data-table tbody tr td:first-child {
    font-weight: 600;
    color: #2d2d4e;
}

/* Row striping for better readability */
.blog-content table tbody tr:nth-child(odd),
table.data-table tbody tr:nth-child(odd) {
    background-color: white;
}

.blog-content table tbody tr:nth-child(even),
table.data-table tbody tr:nth-child(even) {
    background-color: #f8f9fb;
}

/* Hover effect with subtle purple tint */
.blog-content table tbody tr:hover,
table.data-table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.08);
    transition: background-color 0.2s ease;
    cursor: default;
}

/* Clickable rows */
.blog-content table tbody tr.clickable,
table.data-table tbody tr.clickable {
    cursor: pointer;
}

.blog-content table tbody tr.clickable:hover,
table.data-table tbody tr.clickable:hover {
    background-color: rgba(102, 126, 234, 0.12);
    transform: translateX(2px);
    transition: all 0.2s ease;
}

/* Last row - no bottom border */
.blog-content table tbody tr:last-child td,
table.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Responsive table wrapper for mobile */
.table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .blog-content table,
    table.data-table {
        font-size: 0.85rem;
        box-shadow: none;
    }

    .blog-content table td,
    .blog-content table th,
    table.data-table td,
    table.data-table th {
        padding: 8px 10px;
        min-width: 60px;
    }

    .blog-content table th,
    table.data-table th {
        font-size: 0.7em;
        letter-spacing: 0.5px;
    }

    /* Stack table vertically on very small screens */
    @media (max-width: 480px) {
        .blog-content table.stack-mobile,
        table.data-table.stack-mobile {
            border: 0;
        }

        .blog-content table.stack-mobile thead,
        table.data-table.stack-mobile thead {
            display: none;
        }

        .blog-content table.stack-mobile tr,
        table.data-table.stack-mobile tr {
            display: block;
            margin-bottom: 1rem;
            border: 1px solid #e8e8f0;
            border-radius: 8px;
            overflow: hidden;
        }

        .blog-content table.stack-mobile td,
        table.data-table.stack-mobile td {
            display: block;
            text-align: right;
            border-bottom: 1px solid #e8e8f0;
            padding: 10px 12px;
        }

        .blog-content table.stack-mobile td:last-child,
        table.data-table.stack-mobile td:last-child {
            border-bottom: none;
        }

        .blog-content table.stack-mobile td::before,
        table.data-table.stack-mobile td::before {
            content: attr(data-label);
            float: left;
            font-weight: 700;
            color: #5a3680;
            text-transform: uppercase;
            font-size: 0.75em;
            letter-spacing: 0.5px;
        }
    }
}

/* Table caption styling */
.blog-content table caption,
table.data-table caption {
    caption-side: top;
    padding: 10px 0;
    font-weight: 600;
    color: #5a3680;
    text-align: left;
    font-size: 1.05em;
}

.blog-content img {
    max-width: 100%;
    height: auto;
}

.blog-content p {
    margin: 0 0 10px;
}

.blog-content ul, .blog-content ol {
    margin: 10px 0;
    padding-left: 30px;
}

.blog-content li {
    margin-bottom: 5px;
}

.blog-content h1, .blog-content h2, .blog-content h3, 
.blog-content h4, .blog-content h5, .blog-content h6 {
    margin: 15px 0 10px;
    line-height: 1.4;
}

.blog-content pre {
    background-color: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px;
    overflow-x: auto;
    margin: 10px 0;
}

.blog-content code {
    background-color: #f5f5f5;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
}

.blog-content pre code {
    background-color: transparent;
    padding: 0;
}

.blog-content blockquote {
    border-left: 4px solid #ddd;
    margin: 15px 0;
    padding-left: 15px;
    color: #666;
    font-style: italic;
}

.boards-flex {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-direction: row;
}

@media (max-width: 700px) {
    .boards-flex {
        flex-direction: column;
        align-items: center;
    }
}

.legal-prose h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d2d4e;
    border-left: 4px solid #667eea;
    padding-left: 0.6rem;
    margin-top: 1.75rem;
    margin-bottom: 0.6rem;
}

.legal-prose h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #3a3a5c;
    margin-top: 1.25rem;
    margin-bottom: 0.4rem;
}

.legal-prose h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #4a4a6a;
    margin-top: 1rem;
    margin-bottom: 0.3rem;
}

.legal-prose p,
.legal-prose li {
    color: #4a4a5a;
    font-size: 0.95rem;
    line-height: 1.7;
}

.legal-prose ul,
.legal-prose ol {
    padding-left: 1.4rem;
}

.legal-prose a {
    color: #667eea;
}

.footer-legal-link {
    color: #888;
    font-size: 0.82rem;
    text-decoration: none;
    white-space: nowrap;
    padding: 0.25rem 0.4rem;
    border-radius: 0.3rem;
    transition: color 0.2s, background-color 0.2s;
}

    .footer-legal-link:hover {
        color: #667eea;
        text-decoration: underline;
    }

/* ── Legal pages ────────────────────────────────────────────────────────── */
.legal-hero {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 3rem 1rem 2.5rem;
    text-align: center;
}

.legal-hero-back {
    position: absolute;
    top: 1rem;
    left: 1rem;
}

.legal-hero-icon {
    font-size: 2.8rem;
    opacity: 0.9;
    display: block;
    margin-bottom: 0.75rem;
}

.legal-hero h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.legal-hero .legal-hero-subtitle {
    font-size: 1.05rem;
    opacity: 0.85;
    margin-bottom: 0.75rem;
}

.legal-hero .legal-updated {
    font-size: 0.82rem;
    opacity: 0.7;
}

.legal-page {
    background: #f4f7fb;
    min-height: 60vh;
    padding-bottom: 3rem;
}

.legal-content {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.legal-toc {
    border-radius: 12px;
    border-left: 4px solid #667eea;
    background: #fff;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.75rem;
}

.legal-toc h6 {
    font-weight: 700;
    color: #4a4a6a;
    margin-bottom: 0.6rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.legal-toc ol {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.9rem;
    color: #555;
    column-count: 2;
    column-gap: 1.5rem;
}

    .legal-toc ol li {
        margin-bottom: 0.2rem;
    }

    .legal-toc ol li a {
        color: #667eea;
        text-decoration: none;
    }

        .legal-toc ol li a:hover {
            text-decoration: underline;
        }

.legal-section {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-left: 4px solid #667eea;
}

.legal-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.legal-section-num {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
}

.legal-section h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #2d2d4e;
    margin: 0;
}

.legal-section p,
.legal-section li {
    color: #4a4a5a;
    font-size: 0.95rem;
    line-height: 1.7;
}

.legal-section ul,
.legal-section ol {
    padding-left: 1.4rem;
    margin-bottom: 0;
}

.legal-section ul li,
.legal-section ol li {
    margin-bottom: 0.3rem;
}

.legal-infobox {
    background: #f4f7fb;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-top: 0.75rem;
}

.legal-footer {
    text-align: center;
    color: #888;
    font-size: 0.85rem;
    padding: 1.5rem 0 0.5rem;
    border-top: 1px solid #e2e8f0;
    margin-top: 0.5rem;
}

.legal-lang-switcher {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.legal-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    color: #667eea;
    border: 1.5px solid #c9d3f5;
    background: #fff;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.legal-lang-btn:hover {
    background: #eef1fd;
    border-color: #667eea;
    color: #4a5cc4;
    text-decoration: none;
}

.legal-lang-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: transparent;
}

/* ── Global back-to-top button ──────────────────────────────────────────── */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 16px rgba(102,126,234,0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease, box-shadow 0.2s ease;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 0 6px 22px rgba(118,75,162,0.5);
    transform: translateY(-3px);
}

.back-to-top:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(102,126,234,0.4);
}

@media (max-width: 576px) {
    .legal-toc ol {
        column-count: 1;
    }

    .legal-section {
        padding: 1.1rem 1.1rem;
    }
}

/* Quill Editor Toolbar Normalization */
.ql-toolbar {
    display: flex;
    align-items: center;
    padding: 8px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px 4px 0 0;
}

.ql-toolbar .ql-formats {
    margin-right: 15px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Normalize select dropdowns */
.ql-toolbar select.ql-header {
    height: 32px;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    vertical-align: middle;
    min-width: 80px;
}

/* Normalize all toolbar buttons */
.ql-toolbar button,
.ql-toolbar .ql-picker-label {
    height: 32px;
    width: 32px;
    padding: 4px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.ql-toolbar button:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.ql-toolbar button.ql-active {
    background: #e0e0e0;
    border-color: #aaa;
}

/* Normalize custom image upload label */
.ql-toolbar label[for="imageUploadInput"] {
    height: 32px;
    min-width: 32px;
    padding: 4px 8px;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s ease;
}

.ql-toolbar label[for="imageUploadInput"]:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

/* Ensure color and background pickers are consistent */
.ql-toolbar select.ql-color,
.ql-toolbar select.ql-background {
    height: 32px;
    width: 32px;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    vertical-align: middle;
}

/* ══════════════════════════════════════════════════════════
   ADMIN PAGES — reset link-card overrides for Bootstrap
   structural cards (card-header / card-body / card-footer).
   The global .card rule was written for clickable blog/quote
   cards and adds padding + hover that breaks panel layouts.
   ══════════════════════════════════════════════════════════ */
.admin-page .card {
    padding: 0;       /* card-body owns padding, not .card   */
    cursor: default;
}

.admin-page .card:hover {
    color: inherit;
    background-color: white;
}

/* ══════════════════════════════════════════════════════════
   PAGINATION — shared style for Blog and all admin pages.
   Defined globally so the scoped Blog.razor.css rule is not
   the only source (admin pages have no scope attribute).
   ══════════════════════════════════════════════════════════ */
.blog-pagination .page-link {
    border: 1px solid #e8e8f0;
    color: #5a3680;
    border-radius: 6px !important;
    margin: 0 2px;
    min-width: 36px;
    text-align: center;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.blog-pagination .page-item.active .page-link {
    background-color: #667eea;
    border-color: #667eea;
    color: white;
    font-weight: 600;
}

.blog-pagination .page-item.disabled .page-link {
    color: #ccc;
    border-color: #f0f0f5;
}

.blog-pagination .page-link:hover {
    background-color: rgba(102, 126, 234, 0.1);
    color: #5a3680;
}

/* ══════════════════════════════════════════════════════════
   GLOBAL PRINT STYLES — PDF Export for Blog Posts
   ══════════════════════════════════════════════════════════ */
@media print {
    /* Hide all global navigation and UI elements */
    nav,
    header,
    footer,
    .navbar,
    .sidebar,
    .back-to-top,
    #blazor-error-ui,
    .blazor-reconnect-ui,
    .print-hide {
        display: none !important;
        visibility: hidden !important;
    }

    /* Hide specific blog page elements that are not content */
    [class*="post-action-bar"],
    [class*="translation-bar"],
    [class*="rating"],
    [class*="comment"] {
        display: none !important;
    }

    /* Reset body and html for print */
    html, body {
        background: white !important;
        color: black !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
    }

    /* Ensure main content area takes full width */
    main,
    .container,
    .container-fluid {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Ensure article is visible and properly formatted */
    article {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        page-break-before: auto;
    }

    /* Optimize images for print */
    img {
        max-width: 100% !important;
        height: auto !important;
        page-break-inside: avoid;
    }

    /* Remove unnecessary shadows and transitions */
    * {
        box-shadow: none !important;
        transition: none !important;
        animation: none !important;
    }

    /* Ensure text is black for readability */
    p, li, td, th, span, div {
        color: black !important;
    }

    /* Optimize headings */
    h1, h2, h3, h4, h5, h6 {
        color: black !important;
        page-break-after: avoid;
    }

    /* Avoid breaking these elements across pages */
    p, blockquote, pre, ul, ol, table {
        page-break-inside: avoid;
        orphans: 3;
        widows: 3;
    }

    /* Links should show URL in print if needed */
    a {
        color: #0066cc !important;
        text-decoration: underline;
    }

    /* Ensure proper page breaks */
    .page-break {
        page-break-before: always;
    }

    .no-break {
        page-break-inside: avoid;
    }
}