/* ============================================================
   COOKLEADS — DESIGN SYSTEM
   Strategy:
     - body / html  → pure white (#fff)
     - navbar       → brand yellow #FFF4D6  (theme-color, unchanged)
     - sections     → alternate between surfaces (see below)
     - footer       → #2a3347 body / #1d273b copyright bar

   SURFACE CLASSES (apply to <section> or wrapper divs):
     .bg-white       #ffffff      hero, main content, pricing
     .bg-soft        #FAFAF8      alternating rows, FAQ, stat bars
     .bg-cream       #FFF9EC      timeline, platform badges
     .bg-gray        #e6e7e9      footer top band, divider rows
     .theme-color    #FFF4D6      CTA, testimonials, highlights
     .bg-footer      #2a3347      footer main body
     .bg-footer-dark #1d273b      copyright strip

   TEXT HIGHLIGHT CLASSES:
     .text-highlight       warm amber marker on light/white bg
     .text-highlight-dark  subtle glow variant for dark sections
   ============================================================ */

:root {
    /* ── Brand yellow ── */
    --theme-color: #FFF4D6;
    --theme-light-color: #fff9ec;
    --theme-hover: #FFE9A8;
    --theme-active: #FFD84C;
    --theme-border: #C9A000;
    --theme-text: #4A3900;

    /* ── Page surfaces ── */
    --surface-white: #ffffff;
    --surface-soft: #FAFAF8;
    --surface-cream: #FFF9EC;
    --surface-gray: #e6e7e9; /* light gray — footer band, divider rows  */

    /* ── Text highlight ── */
    --highlight: #FFE066; /* warm amber marker — wraps key words     */
    --highlight-glow: #FFE066; /* text colour of highlight on dark bg     */
    --highlight-text: #4A3900; /* text colour sitting on highlight        */

    /* ── Footer ── */
    --footer-bg: #2a3347;
    --footer-dark: #1d273b;
    --footer-text: #cbd5e1;
    --footer-muted: #94a3b8;
    --footer-border: rgba(255, 255, 255, 0.08);

    /* ── Warm neutral (greige) ── */
    --neutral-50: #FAF8F3;
    --neutral-100: #F0ECE2;
    --neutral-200: #DCD6C8;
    --neutral-400: #A39E91;
    --neutral-600: #6B6659;
    --neutral-800: #3A3630;
    --neutral-950: #1C1A16;

    /* ── Action blue ── */
    --primary: #1A6FCC;
    --primary-soft: #EDF4FD;
    --primary-light: #C2DAF8;
    --primary-mid: #4F96E8;
    --primary-hover: #0D4A8F;

    /* ── Success green ── */
    --success: #1E7D44;
    --success-soft: #EDF7F0;
    --success-light: #B8E4C4;
    --success-mid: #3AAA66;
    --success-dark: #0F4D29;

    /* ── Warning amber ── */
    --warning: #B07010;
    --warning-soft: #FEF6E6;
    --warning-light: #FCDFA0;
    --warning-mid: #E8A020;
    --warning-dark: #6A4108;

    /* ── Danger red ── */
    --danger: #C0282A;
    --danger-soft: #FEF0F0;
    --danger-light: #F9C4C4;
    --danger-mid: #E05252;
    --danger-dark: #7A1516;

    /* ── Legacy aliases — keeps existing templates working ── */
    --white: #ffffff;
    --dark: #1C1A16;
    --light: #FAFAF8;
    --secondary: #1A6FCC;
    --blue: #1A6FCC;
    --green: #1E7D44;
    --red: #C0282A;
    --yellow: #FFD84C;
    --yellow-dark: #C9A000;

    /* ── Kept unchanged — used elsewhere ── */
    --new-color: #e1d3ff;
    --purple-light: #b980ff;
    --light-green: #1effae;
    --indigo: #6610f2;
    --purple: #6f42c1;
    --pink: #d63384;
    --orange: #fd7e14;
    --teal: #20c997;
    --cyan: #0dcaf0;
}

/* ============================================================
   THEME BUTTON
   ============================================================ */
.btn-theme {
    background-color: var(--theme-color);
    color: var(--theme-text);
    border: 1px solid var(--theme-border);
    font-weight: 600;
}

.btn-theme:hover {
    background-color: var(--theme-hover);
    color: var(--theme-text);
    border-color: var(--theme-active);
}

.btn-theme:active,
.btn-theme:focus {
    background-color: var(--theme-active);
    color: var(--theme-text);
    border-color: var(--theme-border);
    box-shadow: none;
}

/* ============================================================
   BASE
   ============================================================ */
html, body {
    font-size: 1rem;
    background-color: var(--surface-white);
    color: var(--neutral-800);
}

a, a:hover {
    text-decoration: none;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.big-title {
    font-size: 2.5rem !important;
    font-weight: bolder;
    line-height: initial;
    color: var(--neutral-950);
}

/* ============================================================
   SURFACE UTILITIES
   ============================================================ */

/* Section surfaces — use on <section> or wrapper <div> */
.bg-white {
    background-color: var(--surface-white) !important;
}

.bg-soft {
    background-color: var(--surface-soft) !important;
}

.bg-cream {
    background-color: var(--surface-cream) !important;
}

.theme-color {
    background-color: var(--theme-color) !important;
}

.theme-light-color {
    background-color: var(--theme-light-color) !important;
}

/* Footer surfaces */
.bg-footer {
    background-color: var(--footer-bg) !important;
}

.bg-footer-dark {
    background-color: var(--footer-dark) !important;
}

/* Light gray surface — footer top band, divider rows */
.bg-gray {
    background-color: var(--surface-gray) !important;
}

/* Semantic backgrounds */
.bg-primary {
    background-color: var(--primary) !important;
}

.bg-primary-soft {
    background-color: var(--primary-soft) !important;
}

.bg-secondary {
    background-color: var(--secondary) !important;
}

.bg-light {
    background-color: var(--light) !important;
}

.bg-neutral {
    background-color: var(--neutral-50) !important;
}

.bg-neutral-100 {
    background-color: var(--neutral-100) !important;
}

.bg-green {
    background-color: var(--success) !important;
}

.bg-green-light {
    background-color: var(--success-soft) !important;
}

.bg-success {
    background-color: var(--success) !important;
}

.bg-success-soft {
    background-color: var(--success-soft) !important;
}

.bg-warning-soft {
    background-color: var(--warning-soft) !important;
}

.bg-danger-soft {
    background-color: var(--danger-soft) !important;
}

.bg-indigo {
    background-color: var(--indigo) !important;
}

/* ============================================================
   TEXT UTILITIES
   ============================================================ */
.text-theme {
    color: var(--theme-text) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.text-secondary {
    color: var(--secondary) !important;
}

.text-muted {
    color: var(--neutral-600) !important;
}

.text-ink {
    color: var(--neutral-950) !important;
}

.text-body {
    color: var(--neutral-800) !important;
}

.text-indigo {
    color: var(--indigo) !important;
}

.text-yellow-dark {
    color: var(--yellow-dark) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-danger {
    color: var(--danger) !important;
}

/* ── Inline text highlight ── */
/* Usage: <span class="text-highlight">key word</span>           */
/* Or on dark bg: <span class="text-highlight-dark">word</span>  */
.text-highlight {
    background-color: var(--highlight);
    color: var(--highlight-text);
    padding: 0 4px 1px;
    border-radius: 3px;
    font-weight: inherit;
}

/* Variant for use inside dark footer sections */
.text-highlight-dark {
    /*background-color: rgba(255, 224, 102, 0.18);*/
    color: var(--highlight-glow);
    padding: 0 4px 1px;
    border-radius: 3px;
    font-weight: inherit;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
}

footer ul li {
    padding: 4px 0;
}

footer ul li a {
    color: var(--footer-muted);
    transition: color 0.2s;
}

footer ul li a:hover {
    color: var(--surface-white);
}

.footer-copyright {
    background-color: var(--footer-dark);
    color: var(--footer-muted);
    border-top: 1px solid var(--footer-border);
}

.footer-copyright a {
    color: var(--footer-muted);
}

.footer-copyright a:hover {
    color: var(--theme-color);
}

/* ============================================================
   STATUS BADGE CLASSES
   ============================================================ */
.badge-success {
    color: var(--success-dark);
    background-color: var(--success-soft);
}

.badge-warning {
    color: var(--warning-dark);
    background-color: var(--warning-soft);
}

.badge-danger {
    color: var(--danger-dark);
    background-color: var(--danger-soft);
}

.badge-primary {
    color: var(--primary-hover);
    background-color: var(--primary-soft);
}

/* ============================================================
   CARD HOVER
   ============================================================ */
.card-hover {
    border: 1px solid var(--neutral-200);
    transition: transform .5s, box-shadow .5s, border-color .5s;
}

.card-hover:hover {
    transform: translate(0px, -10%);
    overflow: hidden;
    border-color: var(--neutral-950);
    box-shadow: 20px 20px 1px 0 rgba(26, 111, 204, 0.18) !important;
}

/* ============================================================
   SEARCH BOX
   ============================================================ */
.search-box input::placeholder {
    color: var(--neutral-400);
}

.search-box .suggestions-box {
    left: 0;
    position: absolute;
    top: calc(100% + 5px);
    width: 100%;
    background-color: var(--surface-white);
    border: 0.5px solid var(--neutral-200);
    border-radius: 8px;
}

.search-box .suggestions-box .item {
    animation: showItem .3s ease forwards;
    box-shadow: -6px -6px 8px -10px rgb(0 0 0 / 20%);
    box-sizing: border-box;
    color: var(--neutral-800);
    cursor: pointer;
    display: block;
    font-size: .8rem;
    opacity: 0;
    outline: none;
    padding: 4px 10px;
    text-decoration: none;
    transform-origin: top;
    transform: translateX(10px);
}

.search-box .suggestions-box .item:hover,
.search-box .suggestions-box .item:focus {
    background-color: var(--theme-hover);
    color: var(--warning-dark);
}

@keyframes showItem {
    0% {
        opacity: 0;
        transform: translateX(10px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================================
   NAVIGATION SUBMENU
   ============================================================ */
#submenu-lg {
    display: none;
    overflow: hidden;
}

.submenu:hover #submenu-lg {
    display: block;
    position: absolute;
    top: 99%;
    width: 100%;
    left: 0;
    min-height: 45vh;
    padding: 20px 0;
    z-index: 11;
    transition: .5s;
    right: 0;
    background: var(--surface-white);
    border-bottom: 1px solid var(--neutral-200);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.submenu:hover::before {
    content: "";
    position: absolute;
    margin: 0 10px;
    bottom: 0%;
    width: 100px;
    z-index: 99;
    border-bottom: solid var(--primary) 4px;
    border-radius: 20px;
}

#submenu-lg ul li a {
    font-size: 16px;
    color: var(--neutral-800);
}

#submenu-lg ul li a:hover {
    color: var(--primary);
}

/* ============================================================
   FORMS
   ============================================================ */
.search-form {
    box-shadow: none !important;
    padding: 12px 11px;
}

.form-control:focus {
    box-shadow: none !important;
    border-color: var(--primary-light);
}

.form-check-input:focus {
    box-shadow: none !important;
}

.asteriskField {
    color: var(--danger) !important;
}

/* ============================================================
   STATUS CLASSES (lead / company record badges)
   ============================================================ */
.ACTIVE {
    color: var(--success-dark) !important;
    background-color: var(--success-soft);
}

.NAFE {
    color: var(--danger) !important;
    background-color: var(--danger-soft) !important;
}

.STRIKE {
    color: var(--danger) !important;
    background-color: var(--danger-soft) !important;
}

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.small {
    font-size: 11.5px !important;
}

.error-font-size {
    font-size: 10rem;
    font-weight: bolder;
    line-height: 1;
    color: var(--danger);
}

/* ============================================================
   DIN LENGTH VALIDATOR (static/js/main.js — data-validate-din)
   ============================================================ */
.din-error-message {
    font-size: .76rem;
}

.din-error-message i {
    font-size: .85rem;
    flex-shrink: 0;
}

.contact-bg-img {
    background-image: url("../img/contact-bg-img.c0ecc4f9ed89.svg");
    background-repeat: no-repeat;
    background-size: 40%;
    background-position: center bottom;
}

/* ============================================================
   CREDIT PILL INDICATOR
   ============================================================ */
.credit-pill-link {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.credit-pill-link:hover {
    opacity: 0.8;
}

.credit-pill {
    display: flex;
    align-items: center;
    justify-content: center;
}

.credit-pill-track {
    position: relative;
    width: 8px;
    height: 35px;
    border-radius: 10px;
    background: var(--neutral-200);
    overflow: hidden;
}

.credit-pill-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--success-mid);
    transition: height 0.4s ease;
    border-radius: 10px;
}

.credit-pill-fill[style*="height: 0"] {
    background: var(--danger);
}

.credit-pill-fill[style*="height: 10%"] {
    background: var(--warning-mid);
}

.credit-pill-fill[style*="height: 20%"] {
    background: var(--warning-mid);
}

.credit-pill-fill[style*="height: 50%"] {
    background: var(--warning);
}

.credit-pill-fill[style*="height: 70%"] {
    background: var(--success-mid);
}

.credit-pill-fill[style*="height: 100%"] {
    background: var(--success);
}

.credit-pill-text {
    line-height: 1;
}

/* ============================================================
   COPY BUTTON
   ============================================================ */
.cursor-pointer {
    cursor: pointer;
}

.copy-btn {
    cursor: pointer;
    transition: color 0.2s;
}

.copy-btn:hover i {
    color: var(--primary);
}

.copy-btn .bx-check {
    transform: scale(1.1);
    transition: transform 0.2s;
}

/* ============================================================
   CREDIT POLICY PAGE (templates/leadapp/credit_policy.html)
   Every selector starts with .policy-page, so nothing here can
   affect any other page.
   ============================================================ */
.policy-page .page-header {
    padding: 1.25rem 0 .25rem;
    min-height: 0;
}

.policy-page .page-body {
    margin-top: .75rem;
    margin-bottom: 4rem;
}

/* Card + reading column */
.policy-page .card-lg > .card-body {
    padding: clamp(1.5rem, 4vw, 3rem);
}

.policy-page .markdown {
    max-width: 46rem;
    color: var(--neutral-800);
    font-size: 1rem;
    line-height: 1.7;
}

.policy-page .markdown p,
.policy-page .markdown li {
    line-height: 1.7;
}

.policy-page .markdown p {
    margin-bottom: 1rem;
}

.policy-page .markdown a:not(.nav-link) {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-color: var(--primary-light);
    text-underline-offset: 3px;
    transition: text-decoration-color .15s ease, color .15s ease;
}

.policy-page .markdown a:not(.nav-link):hover {
    color: var(--primary-hover);
    text-decoration-color: currentColor;
}

/* Title block */
.policy-page .policy-hero {
    margin-bottom: 2rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--neutral-100);
}

.policy-page .policy-title {
    margin: 0 0 .6rem;
    font-size: clamp(1.75rem, 3.4vw, 2.25rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.01em;
    color: var(--neutral-950);
}

.policy-page .policy-updated {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin: 0 0 1.1rem;
    padding: .25rem .75rem;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--neutral-100);
    font-size: .8125rem;
    line-height: 1.4;
    color: var(--neutral-600);
}

.policy-page .policy-updated i {
    font-size: 1rem;
    color: var(--neutral-400);
}

.policy-page .policy-lead {
    margin: 0;
    font-size: 1.0625rem;
    color: var(--neutral-600);
}

/* Mobile contents box */
.policy-page .policy-contents {
    margin-bottom: 2.25rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--neutral-100);
    border-radius: 12px;
    background: var(--surface-soft);
}

.policy-page .policy-contents-title {
    margin: 0 0 .5rem;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--neutral-600);
}

.policy-page .policy-contents li {
    padding: .2rem 0;
    font-size: .9375rem;
}

/* Sections: even rhythm, thin divider, anchors clear the sticky bar */
.policy-page .markdown section[id] {
    scroll-margin-top: 90px;
    padding-top: 2.25rem;
    margin-top: 2.25rem;
    border-top: 1px solid var(--neutral-100);
}

.policy-page .markdown section[id]:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.policy-page .markdown h2 {
    margin: 0 0 1rem;
    font-size: clamp(1.25rem, 2.2vw, 1.5rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.005em;
    color: var(--neutral-950);
}

.policy-page .markdown h3 {
    margin: 1.75rem 0 .5rem;
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--neutral-950);
}

.policy-page .markdown h3.mt-4 {
    margin-top: 1.75rem !important;
}

.policy-page .markdown ul,
.policy-page .markdown ol {
    padding-left: 1.25rem;
    margin-bottom: 1rem;
}

.policy-page .markdown li {
    margin-bottom: .4rem;
    padding-left: .15rem;
}

.policy-page .markdown strong {
    font-weight: 600;
    color: var(--neutral-950);
}

/* Sidebar */
.policy-page #policy-nav .nav-link {
    padding: .45rem .75rem;
    border-radius: 8px;
    font-size: .875rem;
    line-height: 1.4;
    color: var(--neutral-600);
    transition: background-color .15s ease, color .15s ease;
}

.policy-page #policy-nav .nav-link:hover {
    background: var(--surface-soft);
    color: var(--neutral-950);
}

.policy-page #policy-nav .nav-link.active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

/* Callouts for the rules people look for */
.policy-page .policy-callout {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin: 0 0 1.25rem;
    padding: .9rem 1.1rem;
    border: 1px solid var(--neutral-100);
    border-left-width: 3px;
    border-radius: 10px;
    background: var(--surface-soft);
}

.policy-page .policy-callout > i {
    flex-shrink: 0;
    margin-top: .1rem;
    font-size: 1.35rem;
    line-height: 1.5;
}

.policy-page .policy-callout > p {
    margin: 0;
    font-size: .9688rem;
}

.policy-page .policy-callout--success {
    background: var(--success-soft);
    border-color: var(--success-light);
    border-left-color: var(--success);
}

.policy-page .policy-callout--success > i {
    color: var(--success);
}

.policy-page .policy-callout--info {
    background: var(--primary-soft);
    border-color: var(--primary-light);
    border-left-color: var(--primary);
}

.policy-page .policy-callout--info > i {
    color: var(--primary);
}

/* Table */
.policy-page .policy-table-card {
    overflow: hidden;
    border: 1px solid var(--neutral-100);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(28, 26, 22, .04);
}

.policy-page .policy-table-card .table {
    margin: 0;
    font-size: .9688rem;
}

.policy-page .policy-table-card thead th {
    padding: .75rem 1.1rem;
    background: var(--surface-soft);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--neutral-600);
}

.policy-page .policy-table-card td {
    padding: .85rem 1.1rem;
    line-height: 1.5;
}

.policy-page .policy-table-card td:last-child,
.policy-page .policy-table-card th:last-child {
    white-space: nowrap;
}

/* Refund steps */
.policy-page .markdown ol.policy-steps {
    counter-reset: policy-step;
    list-style: none;
    padding-left: 0;
    margin: 1rem 0 1.25rem;
}

.policy-page .markdown ol.policy-steps > li {
    position: relative;
    counter-increment: policy-step;
    margin-bottom: .75rem;
    padding: .7rem 1rem .7rem 3.25rem;
    border: 1px solid var(--neutral-100);
    border-radius: 10px;
    background: var(--surface-white);
}

.policy-page .markdown ol.policy-steps > li::before {
    content: counter(policy-step);
    position: absolute;
    left: 1rem;
    top: .7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: .8125rem;
    font-weight: 700;
    line-height: 1;
}

/* Related pages */
.policy-page .markdown ul.policy-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem;
    list-style: none;
    padding-left: 0;
    margin: 0 0 1.25rem;
}

@media (min-width: 576px) {
    .policy-page .markdown ul.policy-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

.policy-page .markdown ul.policy-links > li {
    margin: 0;
    padding: 0;
}

.policy-page .markdown ul.policy-links a {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    height: 100%;
    padding: .8rem 1rem;
    border: 1px solid var(--neutral-100);
    border-radius: 10px;
    background: var(--surface-white);
    text-decoration: none;
    color: var(--neutral-950);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.policy-page .markdown ul.policy-links a:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 14px rgba(28, 26, 22, .07);
    transform: translateY(-1px);
    color: var(--neutral-950);
}

.policy-page .markdown ul.policy-links span {
    font-size: .875rem;
    line-height: 1.45;
    color: var(--neutral-600);
}

.policy-page .policy-top {
    margin: 0;
    text-align: right;
    font-size: .875rem;
}

.policy-page .policy-top i {
    vertical-align: -2px;
    margin-right: .15rem;
    font-size: 1.1rem;
}

/* Subtle fade-in on scroll (data-clp-reveal in products.js adds js-reveal, then is-in) */
@media (prefers-reduced-motion: no-preference) {
    .policy-page section.js-reveal {
        transition: opacity .5s ease, transform .5s cubic-bezier(.2, .7, .2, 1);
    }

    .policy-page section.js-reveal:not(.is-in) {
        opacity: 0;
        transform: translateY(10px);
    }
}

@media (max-width: 575.98px) {
    .policy-page .policy-table-card td:last-child,
    .policy-page .policy-table-card th:last-child {
        white-space: normal;
    }
}

@media print {
    .policy-page .markdown section[id] {
        break-inside: avoid-page;
    }
}

/* ============================================================
   DASHBOARD (templates/users/user_dashboard.html)
   Soft neutral cards with a gentle hover lift and a staggered
   fade-in on load. Motion is skipped for reduced-motion users.
   ============================================================ */
.dash-card {
    border: 1px solid var(--neutral-200);
    box-shadow: 0 1px 3px rgba(28, 26, 22, 0.08), 0 4px 14px rgba(28, 26, 22, 0.05);
}

/* Current-plan card: cream surface (.theme-light-color) with the brand yellow edge */
.dash-plan {
    border-left: 4px solid var(--theme-active);
}

@media (prefers-reduced-motion: no-preference) {
    .dash-card {
        transition: transform .18s ease-out, box-shadow .18s ease-out;
    }

    .dash-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(28, 26, 22, 0.12);
    }

    .dash-btn {
        transition: transform .15s ease-out, box-shadow .15s ease-out, background-color .15s, color .15s;
    }

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

    .dash-btn:active {
        transform: translateY(0);
    }

    .dash-table tbody tr {
        transition: background-color .15s ease-out;
    }

    .dash-table tbody tr td:first-child {
        transition: transform .15s ease-out;
    }

    .dash-table tbody tr:hover {
        background-color: var(--theme-light-color);
    }

    .dash-table tbody tr:hover td:first-child {
        transform: translateX(2px);
    }

    .dash-reveal {
        animation: dash-reveal .35s ease-out backwards;
        animation-delay: calc(var(--i, 0) * 60ms);
    }
}

@keyframes dash-reveal {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* Dashboard typography: system SF font, tighter scale, tabular numerals */
.page-title.dash-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.dash-num {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    font-weight: 700;
}

.dash-card .subheader {
    font-weight: 600;
    letter-spacing: 0.06em;
}

/* Brand gradient text, with a solid fallback */
.dash-gradient {
    color: var(--primary-hover);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .dash-gradient {
        background: linear-gradient(90deg, var(--primary-hover), var(--purple));
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}

.dash-progress {
    background: linear-gradient(90deg, var(--primary-hover), var(--purple));
}

.btn.dash-btn-ghost:hover {
    background-color: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
}

.dash-link {
    cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
    .dash-arrow {
        display: inline-block;
        transition: transform .15s ease-out;
    }

    .dash-link:hover .dash-arrow {
        transform: translateX(3px);
    }

    /* Light sweep across the credits bar */
    .dash-progress {
        background-image: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent),
        linear-gradient(90deg, var(--primary-hover), var(--purple));
        background-size: 40% 100%, 100% 100%;
        background-repeat: no-repeat;
        animation: dash-shimmer 2.4s ease-in-out infinite;
    }

    /* Transaction rows fade in one after another */
    .dash-table tbody tr {
        animation: dash-reveal .35s ease-out backwards;
    }

    .dash-table tbody tr:nth-child(1) { animation-delay: .35s; }
    .dash-table tbody tr:nth-child(2) { animation-delay: .41s; }
    .dash-table tbody tr:nth-child(3) { animation-delay: .47s; }
    .dash-table tbody tr:nth-child(4) { animation-delay: .53s; }
    .dash-table tbody tr:nth-child(5) { animation-delay: .59s; }
}

@keyframes dash-shimmer {
    from {
        background-position: -60% 0, 0 0;
    }
    to {
        background-position: 160% 0, 0 0;
    }
}

/* Transaction type badges: colour = meaning (paid / free credits / adjustment / other) */
.dash-type {
    font-weight: 600;
}

.dash-type-paid {
    background-color: var(--primary-soft);
    color: var(--primary);
}

.dash-type-free {
    background-color: var(--success-soft);
    color: var(--success);
}

.dash-type-adjust {
    background-color: var(--warning-soft);
    color: var(--warning);
}

.dash-type-other {
    background-color: var(--neutral-100);
    color: var(--neutral-600);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Logout confirmation — the header modal (partials/_logout_modal.html) and the
   /accounts/logout/ fallback page (account/logout.html).
   Built from the same pieces as the dashboard above: the cream surface
   (--theme-light-color) with a thin brand-yellow edge (--theme-active, as on the
   current-plan card), neutral borders + soft layered shadow, small uppercase
   labels, and the same 0.35s staggered reveal. Motion is off for reduced-motion users.
   ═══════════════════════════════════════════════════════════════════════════ */
.signout-dialog { max-width: 380px; }
.signout-card {
    position: relative;
    overflow: hidden;
    padding: 36px 28px 22px;
    text-align: center;
    background: var(--theme-light-color, #fff9ec);
    border: 1px solid var(--neutral-200, #DCD6C8);
    border-radius: 20px;
    box-shadow: 0 1px 3px rgba(28, 26, 22, .08), 0 24px 56px rgba(28, 26, 22, .18);
    animation: signout-card-in .3s ease-out both;
}
.signout-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--theme-active, #FFD84C);
}
.signout-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.85rem;
    line-height: 1;
    background: var(--surface-white, #fff);
    border-radius: 50%;
    box-shadow: 0 0 0 6px rgba(201, 160, 0, .12), 0 6px 16px rgba(28, 26, 22, .08);
    animation: signout-pop .45s .05s cubic-bezier(.34, 1.56, .64, 1) both;
}
.signout-emoji {
    display: inline-block;
    transform-origin: 70% 70%;
}
/* the face changes when a button is hovered / focused (static/js/main.js) */
.signout-emoji.is-changing { animation: signout-face .28s ease-out both; }
/* ...and waves goodbye once Logout is clicked */
.signout-emoji.is-bye { animation: signout-wave 1.2s ease-in-out both; }
.signout-title {
    margin: 0 0 4px;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -.02em;
    color: var(--neutral-950, #1C1A16);
    animation: signout-reveal .35s .1s ease-out both;
}
.signout-sub {
    margin: 0 0 22px;
    font-size: .84rem;
    line-height: 1.5;
    color: var(--neutral-600, #6B6659);
    animation: signout-reveal .35s .16s ease-out both;
}
.signout-label {
    margin: 0 0 6px 2px;
    text-align: left;
    font-size: .62rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--neutral-400, #A39E91);
    animation: signout-reveal .35s .22s ease-out both;
}
.signout-account {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    padding: 10px 12px;
    text-align: left;
    background: var(--surface-white, #fff);
    border: 1px solid var(--neutral-200, #DCD6C8);
    border-radius: 12px;
    animation: signout-reveal .35s .22s ease-out both;
}
.signout-avatar {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 700;
    color: var(--primary, #1A6FCC);
    background: var(--primary-soft, #EDF4FD);
    border-radius: 50%;
}
.signout-who { min-width: 0; line-height: 1.3; }
.signout-name {
    font-size: .85rem;
    font-weight: 600;
    color: var(--neutral-950, #1C1A16);
}
.signout-email {
    font-size: .75rem;
    color: var(--neutral-600, #6B6659);
    overflow-wrap: anywhere;
}
.signout-actions {
    display: flex;
    gap: 10px;
    animation: signout-reveal .35s .28s ease-out both;
}
.signout-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: .84rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform .15s ease-out, box-shadow .15s ease-out,
                background-color .15s, border-color .15s, color .15s;
}
/* Cancel = the dashboard's outline / ghost button */
.signout-btn-cancel {
    color: var(--neutral-800, #3A3630);
    background: var(--surface-white, #fff);
    border: 1px solid var(--neutral-200, #DCD6C8);
}
.signout-btn-cancel:hover,
.signout-btn-cancel:focus-visible {
    color: var(--primary, #1A6FCC);
    background: var(--primary-soft, #EDF4FD);
    border-color: var(--primary, #1A6FCC);
}
/* Logout = the primary action */
.signout-btn-confirm {
    color: #fff;
    background: var(--primary, #1A6FCC);
    border: 1px solid var(--primary, #1A6FCC);
    box-shadow: 0 1px 2px rgba(13, 74, 143, .30), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.signout-btn-confirm:hover,
.signout-btn-confirm:focus-visible {
    color: #fff;
    background: var(--primary-hover, #0D4A8F);
    border-color: var(--primary-hover, #0D4A8F);
    box-shadow: 0 6px 16px rgba(26, 111, 204, .28), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.signout-btn:hover { transform: translateY(-1px); }
.signout-btn:active { transform: translateY(0); }
.signout-btn:focus-visible { outline: 2px solid var(--primary, #1A6FCC); outline-offset: 2px; }
.signout-btn:disabled { opacity: .8; transform: none; cursor: progress; }
.signout-hint {
    margin: 14px 0 0;
    font-size: .7rem;
    color: var(--neutral-400, #A39E91);
    animation: signout-reveal .35s .34s ease-out both;
}
.signout-hint kbd {
    padding: 1px 5px;
    font-size: .66rem;
    color: var(--neutral-600, #6B6659);
    background: var(--surface-white, #fff);
    border: 1px solid var(--neutral-200, #DCD6C8);
    border-radius: 5px;
    box-shadow: none;
}
.signout-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
}
@keyframes signout-card-in {
    from { opacity: 0; transform: translateY(8px) scale(.985); }
    to   { opacity: 1; transform: none; }
}
@keyframes signout-pop {
    from { opacity: 0; transform: scale(.7); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes signout-reveal {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}
@keyframes signout-face {
    from { opacity: .4; transform: scale(.78); }
    60%  { opacity: 1; transform: scale(1.1); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes signout-wave {
    0%, 100% { transform: rotate(0); }
    15%      { transform: rotate(14deg); }
    30%      { transform: rotate(-8deg); }
    45%      { transform: rotate(14deg); }
    60%      { transform: rotate(-4deg); }
    75%      { transform: rotate(10deg); }
}
@media (max-width: 420px) {
    .signout-card { padding: 32px 22px 20px; }
    .signout-actions { flex-direction: column-reverse; }
}
@media (prefers-reduced-motion: reduce) {
    .signout-card, .signout-card * {
        animation: none !important;
        transition: none !important;
    }
}
