@import url("/public/styles/animations.css");

#readme-button {
    display: none
}

/* Theme toggle button is now visible */
/* #theme-toggle {
    display: none
} */

.watermark {
    display: none !important;
}

/* Hide share button in thread menu */
#share-thread,
div[id="share-thread"],
[role="menuitem"]:has(.lucide-share2),
button[aria-label*="Share"],
button[title*="Share"],
button[data-testid*="share"],
[data-testid="thread-share-button"],
.thread-share-button,
button:has(svg[data-testid="ShareIcon"]),
button:has([data-icon="share"]) {
    display: none !important;
}


button.bg-primary {
    background-color: hsl(var(--brand-primary));
}


button.bg-primary:hover {
    background-color: hsl(var(--brand-primary-hover));
}

#message-composer {
    margin-bottom: 4px;
}

@media (min-width: 640px) {
    #message-composer {
        margin-bottom: 12px;
    }
}

#message-composer.workflow-generating {
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

/* Hide the send arrow and show a stop square via CSS — no React DOM touch */
#message-composer.workflow-generating #chat-submit svg {
    visibility: hidden;
}

#message-composer.workflow-generating #chat-submit {
    position: relative;
    cursor: not-allowed;
}

#message-composer.workflow-generating #chat-submit::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: currentColor;
    border-radius: 2px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Checking state: applied to body immediately on thread pages while poll is in-flight.
   CSS takes effect as soon as #message-composer is rendered by React — no JS timing needed. */
body.workflow-checking #message-composer {
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

body.workflow-checking #message-composer #chat-submit svg {
    visibility: hidden;
}

body.workflow-checking #message-composer #chat-submit {
    position: relative;
    cursor: not-allowed;
}

body.workflow-checking #message-composer #chat-submit::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: currentColor;
    border-radius: 2px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}


img[alt="Avatar for LangGraph"] {
    display: none;
}

img[alt="Avatar for Lumi"] {
    display: none;
}

.lu-expandable-text-block a {
    color: hsl(var(--link));
}


.lu-expandable-text-block table {
    border-collapse: collapse;
    width: 100%;
}

.lu-expandable-text-block table th,
.lu-expandable-text-block table td {
    border: 1px solid hsl(var(--table-border));
}

.lu-expandable-text-block h1 {
    font-size: 1.15rem;
    font-weight: 600;
}

.lu-expandable-text-block h2 {
    font-size: 1.10rem;
    font-weight: 500;
}

.lu-expandable-text-block ul {
    list-style-type: disc;
    padding-left: 1.25rem;
}

.lu-expandable-text-block ol {
    list-style-type: decimal;
    padding-left: 1.25rem;
}

.lu-expandable-text-block li {
    margin-bottom: 0.25rem;
}

.login-page-side {
    background-image: url('/public/images/background.webp');
}


:root {
    --ring: 218 93% 26% !important;
}

/* Workflow Progress Animation */
.workflow-progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    background-color: hsl(var(--brand-primary) / 0.05);
    border: 1px solid hsl(var(--brand-primary) / 0.2);
    margin: 4px 0;
}

.workflow-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid hsl(var(--brand-primary) / 0.2);
    border-top-color: hsl(var(--brand-primary));
    border-radius: 50%;
    animation: workflow-spin 1s linear infinite;
}

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

.workflow-text {
    font-size: 0.875rem;
    color: hsl(var(--brand-primary));
    font-weight: 500;
}

/* Dark mode support */
.dark .workflow-progress-container {
    background-color: hsl(var(--brand-primary) / 0.15);
    border-color: hsl(var(--brand-primary) / 0.4);
}

.dark .workflow-spinner {
    border-color: hsl(var(--brand-primary-hover) / 0.3);
    border-top-color: hsl(var(--brand-primary-hover));
}

.dark .workflow-text {
    color: hsl(var(--brand-primary-hover));
}

/* ========================================
   Navbar Workflow Status Indicator
   ======================================== */
#workflow-status-indicator {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    margin: 0 8px !important;
    padding: 0 !important;
    cursor: pointer !important;
    position: relative !important;
    border-radius: 8px !important;
    transition: background-color 0.2s ease !important;
    box-sizing: border-box !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    flex-shrink: 0 !important;
}

#workflow-status-indicator:hover {
    background-color: hsl(var(--warning) / 0.15) !important;
}

#workflow-status-indicator.hidden {
    display: none !important;
}

/* Static document icon (default state) */
#workflow-status-indicator .workflow-icon-static {
    width: 20px !important;
    height: 20px !important;
    color: hsl(var(--strong-muted));
    transition: color 0.2s ease;
}

#workflow-status-indicator:hover .workflow-icon-static {
    color: hsl(var(--warning));
}

.dark #workflow-status-indicator .workflow-icon-static {
    color: hsl(var(--subtle-foreground));
}

.dark #workflow-status-indicator:hover .workflow-icon-static {
    color: hsl(var(--warning-soft));
}

/* Spinning loader icon (processing state) */
#workflow-status-indicator .workflow-icon-spinner {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    border: 3px solid hsl(var(--subtle-foreground) / 0.3) !important;
    border-top-color: hsl(var(--subtle-foreground)) !important;
    border-radius: 50% !important;
    animation: workflow-icon-spin 0.8s linear infinite !important;
    box-sizing: border-box !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
}

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

/* Tooltip */
#workflow-status-indicator[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: hsl(var(--overlay) / 0.85);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 10000;
    pointer-events: none;
}

#workflow-status-indicator[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Dark mode indicator */
.dark #workflow-status-indicator:hover {
    background-color: hsl(var(--subtle-foreground) / 0.15) !important;
}

.dark #workflow-status-indicator .workflow-icon-spinner {
    border-color: hsl(var(--subtle-foreground) / 0.3) !important;
    border-top-color: hsl(var(--subtle-foreground)) !important;
}

.dark #workflow-status-indicator[data-tooltip]::after {
    background: hsl(var(--panel-dark) / 0.95);
}

/* ========================================
   Workflow Status Modal
   ======================================== */
.workflow-status-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.workflow-status-modal.hidden {
    display: none !important;
}

.workflow-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: hsl(var(--overlay) / 0.5);
}

#header {
    background: hsl(var(--muted) / 0.25);
}

.workflow-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px hsl(var(--overlay) / 0.1), 0 10px 10px -5px hsl(var(--overlay) / 0.04);
    overflow: hidden;
}

.workflow-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid hsl(var(--border));
}

.workflow-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: hsl(var(--emphasis));
}

.workflow-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: hsl(var(--strong-muted));
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.workflow-modal-close:hover {
    color: hsl(var(--emphasis));
}

.workflow-modal-body {
    padding: 0;
}

/* Active processing section (centered) */
.workflow-modal-active {
    padding: 24px 20px 20px;
    text-align: center;
    border-bottom: 1px solid hsl(var(--border));
}

.workflow-modal-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid hsl(var(--border));
    border-top-color: hsl(var(--subtle-foreground));
    border-radius: 50%;
    animation: workflow-modal-spin 1s linear infinite;
    margin: 0 auto 14px;
}

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

.workflow-modal-text {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 500;
    color: hsl(var(--emphasis));
}

.workflow-modal-subtext {
    margin: 0 0 14px;
    font-size: 13px;
    color: hsl(var(--strong-muted));
}

.workflow-modal-goto-btn {
    background: hsl(var(--warning));
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.workflow-modal-goto-btn:hover {
    background: hsl(var(--warning-hover));
}

/* History section */
.workflow-modal-history {
    padding: 0;
}

.workflow-history-header {
    padding: 10px 20px 6px;
    font-size: 12px;
    font-weight: 600;
    color: hsl(var(--subtle-foreground));
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.workflow-history-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 0 8px 8px;
}

.workflow-history-empty {
    padding: 16px 12px;
    text-align: center;
    font-size: 13px;
    color: hsl(var(--subtle-foreground));
}

.workflow-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s;
    gap: 8px;
}

.workflow-history-item:hover {
    background-color: hsl(var(--surface-muted));
}

.workflow-history-item-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.workflow-history-item-type {
    font-size: 14px;
    font-weight: 500;
    color: hsl(var(--emphasis));
}

.workflow-history-item-date {
    font-size: 12px;
    color: hsl(var(--strong-muted));
}

.workflow-history-item-arrow {
    font-size: 16px;
    color: hsl(var(--subtle-foreground));
    flex-shrink: 0;
}

/* Dark mode modal */
.dark .workflow-modal-content {
    background: hsl(var(--panel-dark));
}

.dark .workflow-modal-header {
    border-bottom-color: hsl(var(--panel-dark-border));
}

.dark .workflow-modal-header h3 {
    color: hsl(var(--card-foreground));
}

.dark .workflow-modal-close {
    color: hsl(var(--subtle-foreground));
}

.dark .workflow-modal-close:hover {
    color: hsl(var(--card-foreground));
}

.dark .workflow-modal-spinner {
    border-color: hsl(var(--panel-dark-border));
    border-top-color: hsl(var(--subtle-foreground));
}

.dark .workflow-modal-text {
    color: hsl(var(--card-foreground));
}

.dark .workflow-modal-subtext {
    color: hsl(var(--subtle-foreground));
}

.dark .workflow-modal-active {
    border-bottom-color: hsl(var(--panel-dark-border));
}

.dark .workflow-modal-goto-btn {
    background: hsl(var(--warning-soft));
    color: hsl(var(--panel-dark));
}

.dark .workflow-modal-goto-btn:hover {
    background: hsl(var(--warning));
}

/* Dark mode history */
.dark .workflow-history-header {
    color: hsl(var(--strong-muted));
}

.dark .workflow-history-item:hover {
    background-color: hsl(var(--panel-dark-border));
}

.dark .workflow-history-item-type {
    color: hsl(var(--card-foreground));
}

.dark .workflow-history-item-date {
    color: hsl(var(--strong-muted));
}

.dark .workflow-history-item-arrow {
    color: hsl(var(--strong-muted));
}

.dark .workflow-history-empty {
    color: hsl(var(--strong-muted));
}

/* ========================================
   Report Waiting Modal
   ======================================== */
.hitl-waiting-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10002;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: hitl-fade-in 0.3s ease-out;
}

.hitl-waiting-modal.hidden {
    display: none !important;
}

@keyframes hitl-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes hitl-steam {

    0%,
    100% {
        transform: translateY(0) scaleX(1);
        opacity: 0.4;
    }

    50% {
        transform: translateY(-4px) scaleX(1.1);
        opacity: 0.8;
    }
}

@keyframes hitl-wm-float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(0, -6px);
    }
}

.hitl-waiting-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: hsl(var(--overlay) / 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.hitl-waiting-content {
    position: relative;
    background: hsl(var(--background));
    border-radius: 20px;
    width: 90%;
    max-width: 440px;
    padding: 40px 32px 32px;
    box-shadow:
        0 0 0 1px hsl(var(--brand-primary) / 0.05),
        0 25px 60px -12px hsl(var(--overlay) / 0.25);
    text-align: center;
    animation: slide-right 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
    overflow: hidden;
}

/* Scattered "Lumier" watermarks */
.hitl-waiting-watermarks {
    position: absolute;
    inset: 0;
    pointer-events: none;
    user-select: none;
    overflow: hidden;
    z-index: 0;
}

.hitl-wm {
    position: absolute;
    font-size: 64px;
    font-weight: 900;
    letter-spacing: -1px;
    white-space: nowrap;
    color: hsl(var(--brand-primary) / 0.06);
    animation: hitl-wm-float 8s ease-in-out infinite;
}

.hitl-wm-1 {
    top: -8px;
    left: -20px;
    font-size: 72px;
}

.hitl-wm-2 {
    bottom: 20px;
    right: -30px;
    font-size: 56px;
    animation-delay: -3s;
}

.hitl-wm-3 {
    top: 50%;
    left: 50%;
    font-size: 90px;
    margin-left: -100px;
    margin-top: -30px;
    animation-delay: -5s;
}

.hitl-wm-4 {
    top: 35%;
    right: -10px;
    font-size: 48px;
    animation-delay: -2s;
}

.hitl-wm-5 {
    bottom: -5px;
    left: 30%;
    font-size: 60px;
    animation-delay: -7s;
}

/* Circular countdown button (replaces X) */
.hitl-waiting-countdown-btn {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    transition: background-color 0.15s;
}

.hitl-waiting-countdown-btn:hover {
    background-color: hsl(var(--overlay) / 0.05);
}

.hitl-countdown-ring {
    position: absolute;
    top: 0;
    left: 0;
}

.hitl-countdown-track {
    stroke: hsl(var(--border));
}

.hitl-countdown-progress {
    stroke: hsl(var(--brand-primary));
    stroke-linecap: round;
    transition: stroke-dashoffset 0.4s ease;
}

.hitl-countdown-number {
    position: relative;
    font-size: 12px;
    font-weight: 700;
    color: hsl(var(--strong-muted));
    line-height: 1;
}

/* Coffee icon wrapper */
.hitl-waiting-icon-wrap {
    position: relative;
    z-index: 1;
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, hsl(var(--brand-primary) / 0.08), hsl(var(--brand-primary) / 0.04));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hitl-waiting-icon-wrap svg {
    color: hsl(var(--brand-primary));
    animation: hitl-steam 3s ease-in-out infinite;
}

.hitl-waiting-title {
    position: relative;
    z-index: 1;
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 800;
    color: hsl(var(--emphasis));
    letter-spacing: -0.02em;
}

.hitl-waiting-description {
    position: relative;
    z-index: 1;
    margin: 0 0 24px;
    font-size: 14.5px;
    line-height: 1.7;
    color: hsl(var(--emphasis-muted));
}

.hitl-waiting-description strong {
    color: hsl(var(--brand-primary));
    font-weight: 700;
}

/* Info row with icons */
.hitl-waiting-info-row {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 28px;
    padding: 16px;
    background: hsl(var(--brand-primary) / 0.03);
    border-radius: 12px;
    border: 1px solid hsl(var(--brand-primary) / 0.06);
}

.hitl-waiting-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    color: hsl(var(--panel-dark-border));
    text-align: left;
}

.hitl-waiting-info-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: hsl(var(--brand-primary) / 0.07);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hitl-waiting-info-icon svg {
    color: hsl(var(--brand-primary));
}

.hitl-waiting-dismiss-btn {
    position: relative;
    z-index: 1;
    background: hsl(var(--brand-primary));
    color: white;
    border: none;
    padding: 12px 36px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
    width: 100%;
    max-width: 220px;
    box-shadow: 0 4px 12px hsl(var(--brand-primary) / 0.25);
}

.hitl-waiting-dismiss-btn:hover {
    background: hsl(var(--brand-primary-active));
    box-shadow: 0 6px 16px hsl(var(--brand-primary) / 0.35);
}

.hitl-waiting-dismiss-btn:active {
    transform: scale(0.97);
}

/* ---- Dark mode ---- */
.dark .hitl-waiting-backdrop {
    background: hsl(var(--overlay) / 0.7);
}

.dark .hitl-waiting-content {
    background: hsl(var(--panel-dark-elevated));
    box-shadow:
        0 0 0 1px hsl(var(--primary-foreground) / 0.06),
        0 25px 60px -12px hsl(var(--overlay) / 0.6);
}

.dark .hitl-wm {
    color: hsl(var(--primary-foreground) / 0.05);
}

.dark .hitl-waiting-countdown-btn:hover {
    background-color: hsl(var(--primary-foreground) / 0.06);
}

.dark .hitl-countdown-track {
    stroke: hsl(var(--panel-dark-border));
}

.dark .hitl-countdown-progress {
    stroke: hsl(var(--brand-dark-accent));
}

.dark .hitl-countdown-number {
    color: hsl(var(--slate-muted));
}

.dark .hitl-waiting-icon-wrap {
    background: linear-gradient(135deg, hsl(var(--brand-dark-accent) / 0.15), hsl(var(--brand-dark-accent) / 0.07));
}

.dark .hitl-waiting-icon-wrap svg {
    color: hsl(var(--brand-dark-accent));
}

.dark .hitl-waiting-title {
    color: hsl(var(--slate-soft));
}

.dark .hitl-waiting-description {
    color: hsl(var(--slate-muted));
}

.dark .hitl-waiting-description strong {
    color: hsl(var(--brand-dark-accent));
}

.dark .hitl-waiting-info-row {
    background: hsl(var(--primary-foreground) / 0.03);
    border-color: hsl(var(--primary-foreground) / 0.06);
}

.dark .hitl-waiting-info-item {
    color: hsl(var(--slate-line));
}

.dark .hitl-waiting-info-icon {
    background: hsl(var(--brand-dark-accent) / 0.12);
}

.dark .hitl-waiting-info-icon svg {
    color: hsl(var(--brand-dark-accent));
}

.dark .hitl-waiting-dismiss-btn {
    background: hsl(var(--blue-action));
    box-shadow: 0 4px 12px hsl(var(--blue-action) / 0.3);
}

.dark .hitl-waiting-dismiss-btn:hover {
    background: hsl(var(--blue-action-hover));
    box-shadow: 0 6px 16px hsl(var(--blue-action) / 0.4);
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
    .hitl-waiting-content {
        width: 95%;
        padding: 32px 20px 24px;
        border-radius: 16px;
    }

    .hitl-wm-1 {
        font-size: 52px;
    }

    .hitl-wm-2 {
        font-size: 40px;
    }

    .hitl-wm-3 {
        font-size: 64px;
    }

    .hitl-wm-4 {
        font-size: 36px;
    }

    .hitl-wm-5 {
        font-size: 44px;
    }

    .hitl-waiting-title {
        font-size: 19px;
    }

    .hitl-waiting-description {
        font-size: 13.5px;
    }

    .hitl-waiting-icon-wrap {
        width: 60px;
        height: 60px;
    }

    .hitl-waiting-icon-wrap svg {
        width: 32px;
        height: 32px;
    }

    .hitl-waiting-info-row {
        padding: 12px;
    }
}

/* ---- Mobile header: prevent button overflow ---- */
@media (max-width: 768px) {

    /* Chainlit renders the top bar as a <header> or nav with flex */
    header,
    nav {
        overflow: visible !important;
        flex-wrap: nowrap !important;
    }

    /* Make the plan badge (Enterprise / Free etc.) shrink */
    [class*="MuiChip-label"],
    [class*="MuiChip-root"],
    [class*="plan-badge"],
    [class*="tier"],
    [class*="badge"] {
        font-size: 11px !important;
        padding: 2px 6px !important;
    }

    /* Add more credits / Extend button */
    button[data-custom-pricing-hooked="true"] {
        font-size: 11px !important;
        padding: 4px 8px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }
}

/* ========================================
   Mode Picker Modal  (mode-picker.js)
   ======================================== */
.lu-mp-backdrop {
    position: fixed;
    inset: 0;
    background: hsl(var(--overlay) / 0.35);
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow: auto;
}

/* ── Sheet — desktop: centred card, mobile: bottom sheet ── */
.lu-mp-sheet {
    position: relative;
    background: hsl(var(--background));
    border-radius: 14px;
    width: 92%;
    max-width: 680px;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    border: 1px solid hsl(var(--overlay) / 0.08);
    box-shadow:
        0 4px 6px -1px hsl(var(--overlay) / 0.07),
        0 20px 48px -8px hsl(var(--overlay) / 0.14);
    overflow: hidden;
    animation: lu-mp-in 0.15s ease-out both;
}

@keyframes lu-mp-in {
    from {
        transform: scale(0.97) translateY(8px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Mobile: full-width bottom sheet */
@media (max-width: 599px) {
    #lu-mode-picker-modal {
        align-items: flex-end !important;
    }

    .lu-mp-sheet {
        width: 100%;
        max-width: 100%;
        max-height: 80vh;
        border-radius: 18px 18px 0 0;
        animation: lu-mp-slide-up 0.2s ease-out both;
    }

    @keyframes lu-mp-slide-up {
        from {
            transform: translateY(100%);
            opacity: 0;
        }

        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
}

.lu-mp-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1px solid hsl(var(--overlay) / 0.07);
}

.lu-mp-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: hsl(var(--emphasis));
}

.lu-mp-close {
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: hsl(var(--strong-muted));
    cursor: pointer;
    padding: 0;
    transition: background 0.1s, color 0.1s;
}

.lu-mp-close:hover {
    background: hsl(var(--surface-muted));
    color: hsl(var(--emphasis));
}

/* ── Grid list ── */
.lu-mp-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

@media (max-width: 599px) {
    .lu-mp-list {
        grid-template-columns: repeat(2, 1fr);
        padding: 10px 10px 20px;
        gap: 7px;
    }
}

/* ── Grid card option ── */
.lu-mp-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    padding: 12px 12px 11px;
    border-radius: 10px;
    border: 1px solid hsl(var(--overlay) / 0.07);
    background: hsl(var(--surface-subtle));
    cursor: pointer;
    text-align: left;
    transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}

.lu-mp-option:hover {
    background: hsl(var(--surface-muted));
    border-color: hsl(var(--overlay) / 0.1);
}

.lu-mp-option--active {
    background: hsl(var(--brand-surface));
    border-color: hsl(var(--brand-border-soft));
    box-shadow: 0 0 0 1px hsl(var(--brand-border-soft));
}

.lu-mp-option--active:hover {
    background: hsl(var(--brand-surface-hover));
}

.lu-mp-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: hsl(var(--surface-panel));
    display: flex;
    align-items: center;
    justify-content: center;
    color: hsl(var(--strong-muted));
}

.lu-mp-option--active .lu-mp-icon {
    background: hsl(var(--brand-surface-active));
    color: hsl(var(--brand-primary));
}

.lu-mp-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

.lu-mp-name {
    font-size: 12px;
    font-weight: 600;
    color: hsl(var(--emphasis));
    line-height: 1.3;
}

.lu-mp-option--active .lu-mp-name {
    color: hsl(var(--brand-primary));
}

.lu-mp-desc {
    font-size: 11px;
    color: hsl(var(--subtle-foreground));
    line-height: 1.4;
}

/* Chat button — highlighted when chat mode is active (no command selected) */
button[data-lu-chat-active="1"] {
    background: hsl(var(--brand-surface)) !important;
    color: hsl(var(--brand-primary)) !important;
    border-color: hsl(var(--brand-border-soft)) !important;
    box-shadow: 0 0 0 1px hsl(var(--brand-border-soft)) !important;
}

.dark button[data-lu-chat-active="1"] {
    background: hsl(var(--brand-dark-surface)) !important;
    color: hsl(var(--brand-dark-text)) !important;
    border-color: hsl(var(--brand-dark-border)) !important;
    box-shadow: 0 0 0 1px hsl(var(--brand-dark-border)) !important;
}

/* Professional Report button — highlighted when active */
button[data-lu-report-active="1"] {
    background: hsl(var(--brand-surface)) !important;
    color: hsl(var(--brand-primary)) !important;
    border-color: hsl(var(--brand-border-soft)) !important;
    box-shadow: 0 0 0 1px hsl(var(--brand-border-soft)) !important;
}

.dark button[data-lu-report-active="1"] {
    background: hsl(var(--brand-dark-surface)) !important;
    color: hsl(var(--brand-dark-text)) !important;
    border-color: hsl(var(--brand-dark-border)) !important;
    box-shadow: 0 0 0 1px hsl(var(--brand-dark-border)) !important;
}

/* Active-mode badge next to the Modes trigger button */
.lu-mode-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    background: hsl(var(--surface-muted));
    color: hsl(var(--panel-dark-border));
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
    white-space: nowrap;
    vertical-align: middle;
    pointer-events: none;
    line-height: 1.6;
    border: 1px solid hsl(var(--overlay) / 0.07);
}

/* ---- Dark mode ---- */
.dark .lu-mp-sheet {
    background: hsl(var(--surface-elevated));
    border-color: hsl(var(--primary-foreground) / 0.08);
    box-shadow:
        0 4px 6px -1px hsl(var(--overlay) / 0.3),
        0 20px 48px -8px hsl(var(--overlay) / 0.55);
}

.dark .lu-mp-header {
    border-bottom-color: hsl(var(--primary-foreground) / 0.07);
}

.dark .lu-mp-title {
    color: hsl(var(--card-foreground));
}

.dark .lu-mp-close {
    color: hsl(var(--strong-muted));
}

.dark .lu-mp-close:hover {
    background: hsl(var(--surface-elevated-hover));
    color: hsl(var(--card-foreground));
}

.dark .lu-mp-option {
    background: hsl(var(--surface-elevated-muted));
    border-color: hsl(var(--primary-foreground) / 0.06);
}

.dark .lu-mp-option:hover {
    background: hsl(var(--accent));
    border-color: hsl(var(--primary-foreground) / 0.1);
}

.dark .lu-mp-option--active {
    background: hsl(var(--brand-dark-surface));
    border-color: hsl(var(--brand-dark-border));
    box-shadow: 0 0 0 1px hsl(var(--brand-dark-border));
}

.dark .lu-mp-option--active:hover {
    background: hsl(var(--brand-dark-surface));
}

.dark .lu-mp-icon {
    background: hsl(var(--surface-elevated-hover));
    color: hsl(var(--subtle-foreground));
}

.dark .lu-mp-option--active .lu-mp-icon {
    background: hsl(var(--brand-surface-active));
    color: hsl(var(--brand-dark-accent));
}

.dark .lu-mp-name {
    color: hsl(var(--card-foreground));
}

.dark .lu-mp-option--active .lu-mp-name {
    color: hsl(var(--brand-dark-text));
}

.dark .lu-mp-desc {
    color: hsl(var(--strong-muted));
}

.dark .lu-mode-badge {
    background: hsl(var(--surface-elevated-hover));
    color: hsl(var(--slate-line));
    border-color: hsl(var(--foreground) / 0.08);
}

/* ========================================
   Pricing Modal (React component)
   ======================================== */
#custom-pricing-modal-overlay {
    position: fixed;
    inset: 0;
    background: hsl(var(--overlay) / 0.45);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    animation: pricingFadeIn 0.3s ease-out;
}

/* Plan CTA — scoped to modal theme class, not global :root tokens */
#custom-pricing-modal .upgrade-btn {
    background: var(--Button-primary-black);
    color: var(--text-onblack);
    border: 1px solid transparent;
}

#custom-pricing-modal .upgrade-btn:hover:not(:disabled) {
    opacity: 0.92;
    filter: brightness(1.05);
}

#custom-pricing-modal .pricing-card.featured .upgrade-btn {
    background: var(--Button-primary-brand);
    color: var(--text-white);
}

#custom-pricing-modal.dark-mode .upgrade-btn {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-color: hsl(var(--primary) / 0.35);
}

#custom-pricing-modal.dark-mode .pricing-card.featured .upgrade-btn {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    box-shadow: 0 2px 12px hsl(var(--primary) / 0.35);
}

#custom-pricing-modal.light-mode .upgrade-btn {
    background: hsl(var(--emphasis));
    color: hsl(0 0% 100%);
}

#custom-pricing-modal.light-mode .pricing-card.featured .upgrade-btn {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    box-shadow: 0 2px 10px hsl(var(--primary) / 0.28);
}

/* Light mode — refreshed pricing cards */
#custom-pricing-modal.light-mode .toggle-wrapper {
    background: hsl(var(--surface-muted));
    border-color: hsl(var(--brand-border-soft));
    box-shadow: inset 0 1px 2px hsl(var(--emphasis) / 0.04);
}

#custom-pricing-modal.light-mode .toggle-slider {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--brand-border-soft));
    box-shadow:
        0 1px 2px hsl(var(--emphasis) / 0.06),
        0 4px 12px hsl(var(--primary) / 0.08);
}

#custom-pricing-modal.light-mode .indicative-usage-note {
    background: hsl(var(--brand-surface));
    border-color: hsl(var(--brand-border-soft));
    color: hsl(var(--emphasis-muted));
}

#custom-pricing-modal.light-mode .indicative-usage-note strong {
    color: hsl(var(--emphasis));
    font-weight: 600;
}

#custom-pricing-modal.light-mode .pricing-cards-grid {
    gap: 20px;
    padding-bottom: 48px;
}

#custom-pricing-modal.light-mode .pricing-card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--brand-border-soft));
    border-radius: 20px;
    box-shadow:
        0 1px 2px hsl(var(--emphasis) / 0.04),
        0 8px 28px hsl(var(--emphasis) / 0.06);
    min-height: 520px;
    overflow: hidden;
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease;
}

#custom-pricing-modal.light-mode .pricing-card:hover {
    transform: translateY(-3px);
    border-color: hsl(var(--primary) / 0.22);
    box-shadow:
        0 2px 4px hsl(var(--emphasis) / 0.05),
        0 16px 40px hsl(var(--primary) / 0.1);
}

#custom-pricing-modal.light-mode .pricing-card.featured {
    border: 1px solid hsl(var(--primary) / 0.35);
    outline: none;
    background:
        linear-gradient(165deg,
            hsl(var(--brand-surface)) 0%,
            hsl(var(--card)) 42%,
            hsl(var(--card)) 100%);
    box-shadow:
        0 0 0 1px hsl(var(--primary) / 0.12),
        0 12px 40px hsl(var(--primary) / 0.14);
}

#custom-pricing-modal.light-mode .pricing-card.featured:hover {
    box-shadow:
        0 0 0 1px hsl(var(--primary) / 0.2),
        0 20px 48px hsl(var(--primary) / 0.18);
}

#custom-pricing-modal.light-mode .card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 20px 0;
    min-height: 44px;
}

#custom-pricing-modal.light-mode .plan-name {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: hsl(var(--emphasis-muted));
}

#custom-pricing-modal.light-mode .pricing-card.featured .plan-name {
    color: hsl(var(--primary));
}

#custom-pricing-modal.light-mode .plan-badge {
    position: static;
    padding: 5px 10px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    border-radius: 9999px;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    box-shadow: 0 2px 8px hsl(var(--primary) / 0.25);
}

#custom-pricing-modal.light-mode .plan-badge-current {
    background: hsl(var(--surface-muted));
    color: hsl(var(--emphasis-muted));
    box-shadow: none;
    border: 1px solid hsl(var(--brand-border-soft));
}

#custom-pricing-modal.light-mode .card-header {
    padding: 12px 20px 0;
}

#custom-pricing-modal.light-mode .price-amount {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: hsl(var(--emphasis));
}

#custom-pricing-modal.light-mode .price-period {
    font-size: 15px;
    color: hsl(var(--strong-muted));
    font-weight: 500;
}

#custom-pricing-modal.light-mode .price-description {
    padding: 10px 20px 0;
    font-size: 15px;
    line-height: 1.5;
    color: hsl(var(--emphasis-muted));
}

#custom-pricing-modal.light-mode .card-cta {
    padding: 20px 20px 0;
}

#custom-pricing-modal.light-mode .upgrade-btn {
    width: 100%;
    height: 44px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    background: hsl(var(--emphasis));
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

#custom-pricing-modal.light-mode .upgrade-btn:hover:not(:disabled) {
    opacity: 1;
    filter: none;
    background: hsl(var(--emphasis) / 0.92);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px hsl(var(--emphasis) / 0.2);
}

#custom-pricing-modal.light-mode .features-divider {
    height: 1px;
    margin: 20px 20px 0;
    background: linear-gradient(90deg,
            transparent,
            hsl(var(--brand-border-soft)) 12%,
            hsl(var(--brand-border-soft)) 88%,
            transparent);
}

#custom-pricing-modal.light-mode .features-list {
    padding: 20px 20px 24px;
    gap: 12px;
}

#custom-pricing-modal.light-mode .feature-icon {
    color: hsl(var(--primary));
    background: hsl(var(--brand-surface));
    border-radius: 50%;
    padding: 2px;
    box-sizing: content-box;
}

#custom-pricing-modal.light-mode .feature-text {
    font-size: 14px;
    line-height: 1.45;
    color: hsl(var(--emphasis-muted));
}

#custom-pricing-modal.light-mode .pricing-card.featured .feature-text {
    color: hsl(var(--emphasis));
}

@keyframes pricingFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pricingSlideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#custom-pricing-modal {
    --text-primary: hsl(var(--emphasis));
    --text-secondary: hsl(var(--emphasis-muted));
    --text-tertiary: hsl(var(--strong-muted));
    --text-white: hsl(var(--background));
    --text-onblack: hsl(var(--background));
    --background-main: hsl(var(--background));
    --background-menu-white: hsl(var(--background));
    --border-main: hsl(var(--border));
    --border-dark: hsl(var(--input));
    --border-light: hsl(var(--surface-panel));
    --border-btn-main: hsl(var(--input));
    --fill-tsp-gray-main: hsl(var(--surface-muted));
    --fill-tsp-white-main: hsl(var(--surface-subtle));
    --fill-tsp-white-light: hsl(var(--surface-subtle));
    --fill-white: hsl(var(--background));
    --icon-primary: hsl(var(--emphasis));
    --icon-secondary: hsl(var(--emphasis-muted));
    --icon-tertiary: hsl(var(--strong-muted));
    --icon-blue: hsl(var(--blue-action-hover));
    --Button-primary-black: hsl(var(--emphasis));
    --Button-primary-brand: hsl(var(--blue-action-hover));
    --shadow-S: hsl(var(--overlay) / 0.1);
}

#custom-pricing-modal.dark-mode .card-top {
    padding: 20px 20px 0;
}

#custom-pricing-modal.dark-mode .plan-name {
    color: hsl(var(--subtle-foreground));
}

#custom-pricing-modal.dark-mode .pricing-card.featured .plan-name {
    color: hsl(var(--primary) / 0.9);
}

#custom-pricing-modal.dark-mode .plan-badge {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

#custom-pricing-modal.dark-mode .features-divider {
    margin: 20px 20px 0;
    background: hsl(var(--border));
}

#custom-pricing-modal.dark-mode {
    --text-primary: hsl(var(--foreground));
    --text-secondary: hsl(var(--subtle-foreground));
    --text-tertiary: hsl(var(--muted-foreground));
    --text-white: hsl(0 0% 100%);
    --text-onblack: hsl(0 0% 100%);
    --background-main: hsl(var(--background));
    --background-menu-white: hsl(var(--card));
    --border-main: hsl(var(--border));
    --border-dark: hsl(var(--panel-dark-border));
    --border-light: hsl(var(--surface-panel));
    --border-btn-main: hsl(var(--panel-dark-border));
    --fill-tsp-gray-main: hsl(var(--card));
    --fill-tsp-white-main: hsl(var(--surface-panel));
    --fill-tsp-white-light: hsl(var(--surface-panel));
    --fill-white: hsl(var(--accent));
    --icon-primary: hsl(var(--foreground));
    --icon-secondary: hsl(var(--subtle-foreground));
    --icon-tertiary: hsl(var(--muted-foreground));
    --icon-blue: hsl(var(--blue-action-hover));
    --Button-primary-black: hsl(var(--primary));
    --Button-primary-brand: hsl(var(--primary));
    --shadow-S: hsl(var(--overlay) / 0.5);
}

#custom-pricing-modal {
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    animation: pricingSlideUp 0.4s ease-out;
    background-color: var(--background-main);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
}

#custom-pricing-modal.light-mode {
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, hsl(var(--brand-surface)) 0%, transparent 55%),
        hsl(var(--background));
}

#custom-pricing-modal h1 {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-weight: 700;
    font-size: 48px;
    line-height: 58px;
    font-family: Georgia, 'Times New Roman', serif;
    padding: 100px 16px 16px;
    color: var(--text-primary);
}

#custom-pricing-modal .pricing-subtitle {
    max-width: 800px;
    margin: 0 auto 32px;
    text-align: center;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-secondary);
    padding: 0 16px;
}

.toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.toggle-wrapper {
    position: relative;
    border-radius: 8px;
    border: 1px solid var(--border-main);
    background: var(--fill-tsp-gray-main);
    height: 32px;
    padding: 2px;
    display: flex;
    align-items: center;
}

.toggle-slider {
    position: absolute;
    background: var(--fill-white);
    border-radius: 6px;
    box-shadow: 0px 0.5px 3px 0px var(--shadow-S);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: calc(100% - 4px);
    top: 2px;
    left: 2px;
}

.toggle-btn {
    position: relative;
    z-index: 10;
    min-width: 48px;
    padding: 0 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 13px;
    line-height: 18px;
    color: var(--text-tertiary);
    transition: color 0.2s, font-weight 0.2s;
    white-space: nowrap;
}

.toggle-btn.active {
    color: var(--text-primary);
    font-weight: 500;
}

.toggle-btn:hover {
    color: var(--text-secondary);
}

.pricing-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 12px;
    padding: 0 16px 24px;
    max-width: 1052px;
    margin: 0 auto;
    width: 100%;
}

.indicative-usage-note {
    text-align: center;
    font-size: 14px;
    color: var(--text-primary);
    padding: 12px 24px;
    max-width: 1052px;
    margin: 0 auto 20px;
    line-height: 1.6;
    background: var(--background-secondary, hsl(var(--alert-important-icon) / 0.08));
    border: 1px solid var(--border-main);
    border-radius: 10px;
}

@media (max-width: 768px) {
    .indicative-usage-note {
        font-size: 13px;
        padding: 10px 16px;
        margin: 0 16px 16px;
    }
}

.pricing-card {
    position: relative;
    border-radius: 16px;
    background: var(--background-menu-white);
    border: 1px solid var(--border-dark);
    animation: fadeIn 0.5s ease-out forwards;
    display: flex;
    flex-direction: column;
    min-height: 510px
}

.pricing-card.featured {
    border: 2px solid var(--icon-blue);
    outline: 2px var(--icon-blue) solid;
    outline-offset: -2px;
}

.pricing-card.current-plan {
    border: 2px solid var(--icon-blue);
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 0;
}

.plan-name {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.plan-badge {
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--icon-blue);
    color: hsl(var(--primary-foreground));
    flex-shrink: 0;
}

.plan-badge-current {
    background: var(--fill-tsp-gray-main);
    color: var(--text-secondary);
    border: 1px solid var(--border-main);
}

.features-divider {
    height: 1px;
    margin: 16px 16px 0;
    background: var(--border-main);
}

.card-header {
    padding: 24px 16px 0;
}

.price-display {
    display: flex;
    align-items: baseline;
    gap: 4px;
    height: 66px;
}

.price-amount {
    font-size: 32px;
    font-weight: 600;
    line-height: 40px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.price-period {
    font-size: 14px;
    color: var(--text-tertiary);
}

.plan-price-contact {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-tertiary);
    height: 66px;
    display: flex;
    align-items: center;
}

.price-description {
    padding: 6px 16px 0;
    font-size: 14px;
    line-height: 22px;
    color: var(--text-secondary);
}

.card-cta {
    padding: 16px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    font-weight: 500;
    height: 40px;
    min-width: 80px;
    padding: 0 16px;
    gap: 6px;
    font-size: 14px;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn:hover:not(:disabled) {
    opacity: 0.9;
}

.btn:active:not(:disabled) {
    opacity: 0.8;
}

.btn-primary-black {
    background: var(--Button-primary-black);
    color: var(--text-onblack);
}

.btn-primary-brand {
    background: var(--Button-primary-brand) !important;
    color: var(--text-white) !important;
}

.btn-contact-sales {
    background: linear-gradient(135deg, hsl(var(--success)) 0%, hsl(var(--alert-success-icon)) 100%);
    color: white;
}

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

.credit-selector {
    padding: 12px 16px 0;
}

.credit-selector-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: 40px;
    background: var(--fill-tsp-white-main);
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.credit-selector-button:hover {
    background: var(--fill-tsp-white-light);
}

.credit-display {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
}

.credit-amount {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    padding-left: 12px;
}

.credit-label {
    font-size: 14px;
    color: var(--text-primary);
}

.chevron-icon {
    width: 32px;
    height: 32px;
    transition: transform 0.3s;
}

.credit-slider-panel {
    position: absolute;
    margin-top: 16px;
    padding: 0;
    left: 16px;
    right: 16px;
    background: var(--fill-tsp-white-main);
    border: 1px solid hsl(var(--overlay) / 0.12);
    border-radius: 10px;
    display: none;
    max-height: 250px;
    overflow-y: auto;
    user-select: none;
    box-shadow: 0 4px 11px 0px hsl(var(--overlay) / 0.08);
}

.credit-slider-panel.active {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.plan-dropdown {
    display: flex;
    flex-direction: column;
}

.plan-option {
    padding: 8px 24px;
    padding-right: 16px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.plan-option:hover {
    background: var(--fill-tsp-white-light);
}

.plan-option.selected {
    background: var(--icon-blue);
    color: white;
}

.plan-option.selected .plan-option-name,
.plan-option.selected .plan-option-credits,
.plan-option.selected .plan-option-price {
    color: white;
}

.plan-option-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.plan-option-credits {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0 12px;
    white-space: nowrap;
}

.plan-option-price {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.features-list {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.feature-icon {
    width: 16px;
    height: 16px;
    margin-top: 3px;
    flex-shrink: 0;
    color: var(--icon-primary);
}

.feature-text {
    flex: 1;
    font-size: 14px;
    color: var(--text-secondary);
}

#pricing-close-btn {
    position: sticky;
    top: 14px;
    align-self: flex-end;
    margin: 14px 16px -46px 0;
    padding: 7px 0;
    background: hsl(var(--background) / 0.84);
    backdrop-filter: blur(12px);
    border: 1px solid hsl(var(--border) / 0.72);
    color: hsl(var(--muted-foreground));
    width: 32px;
    height: 32px;
    border-radius: 999px;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

#pricing-close-btn .pricing-close-icon {
    display: block;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    transform-origin: center center;
    transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

#pricing-close-btn:hover {
    background: hsl(var(--muted) / 0.9);
    border-color: hsl(var(--border));
    color: hsl(var(--foreground));
    box-shadow: 0 8px 20px hsl(var(--overlay) / 0.08);
    transform: translateY(-1px);
}

#pricing-close-btn:hover .pricing-close-icon {
    transform: scale(1.04);
}

#pricing-close-btn:active .pricing-close-icon {
    transform: scale(0.94);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    #custom-pricing-modal h1 {
        font-size: 32px;
        line-height: 40px;
        padding: 60px 16px 12px;
    }

    .pricing-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* Scrollbars — tokens: --scrollbar-* in src/index.css (:root / .dark) */
.workflow-history-list,
.lu-mp-overlay,
.lu-mp-list,
#custom-pricing-modal,
.credit-slider-panel {
    scrollbar-width: thin;
    scrollbar-color: hsl(var(--scrollbar-thumb)) hsl(var(--scrollbar-track));
}

.workflow-history-list::-webkit-scrollbar,
.lu-mp-overlay::-webkit-scrollbar,
.lu-mp-list::-webkit-scrollbar,
#custom-pricing-modal::-webkit-scrollbar,
.credit-slider-panel::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.workflow-history-list::-webkit-scrollbar-track,
.lu-mp-overlay::-webkit-scrollbar-track,
.lu-mp-list::-webkit-scrollbar-track,
#custom-pricing-modal::-webkit-scrollbar-track,
.credit-slider-panel::-webkit-scrollbar-track {
    background: hsl(var(--scrollbar-track));
    border-radius: 999px;
}

.workflow-history-list::-webkit-scrollbar-thumb,
.lu-mp-overlay::-webkit-scrollbar-thumb,
.lu-mp-list::-webkit-scrollbar-thumb,
#custom-pricing-modal::-webkit-scrollbar-thumb,
.credit-slider-panel::-webkit-scrollbar-thumb {
    background: hsl(var(--scrollbar-thumb));
    border-radius: 999px;
    border: 2px solid hsl(var(--scrollbar-track));
    background-clip: padding-box;
}

.workflow-history-list::-webkit-scrollbar-thumb:hover,
.lu-mp-overlay::-webkit-scrollbar-thumb:hover,
.lu-mp-list::-webkit-scrollbar-thumb:hover,
#custom-pricing-modal::-webkit-scrollbar-thumb:hover,
.credit-slider-panel::-webkit-scrollbar-thumb:hover {
    background-color: hsl(var(--scrollbar-thumb-hover));
}