@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;1,14..32,400&display=swap');

:root {
    --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono: 'Cascadia Code', 'SF Mono', 'Consolas', monospace;

    --color-bg: #f8fafc;
    --color-bg-accent: #f1f5f9;
    --color-surface: #ffffff;
    --color-surface-elevated: #ffffff;
    --color-surface-muted: #f8fafc;
    --color-border: #e2e8f0;
    --color-border-strong: #cbd5e1;
    --color-ring: rgba(20, 184, 166, 0.35);

    --color-text: #0f172a;
    --color-text-secondary: #334155;
    --color-text-muted: #64748b;

    --color-brand: #14b8a6;
    --color-brand-hover: #0d9488;
    --color-brand-soft: rgba(20, 184, 166, 0.12);
    --color-brand-muted: rgba(20, 184, 166, 0.08);
    --color-guidance-bg: #ccfbf1;
    --color-guidance-border: #0f766e;
    --color-guidance-text: #134e4a;
    --color-accent: #14b8a6;
    --color-accent-soft: rgba(20, 184, 166, 0.12);
    --color-accent-strong: #0f766e;

    --color-success: #059669;
    --color-success-soft: rgba(5, 150, 105, 0.1);
    --color-warning: #d97706;
    --color-warning-soft: rgba(217, 119, 6, 0.1);
    --color-danger: #dc2626;
    --color-danger-soft: rgba(220, 38, 38, 0.08);

    --sidebar-bg: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #f8fafc;

    --color-topbar-bg: rgba(255, 255, 255, 0.82);
    --color-bg-glow-brand: rgba(20, 184, 166, 0.07);
    --color-bg-glow-neutral: rgba(15, 23, 42, 0.03);
    --color-overlay-backdrop: rgba(15, 23, 42, 0.45);
    --color-surface-gradient-start: #f8fafc;
    --color-surface-gradient-end: #eef2ff;
    --color-surface-gradient-accent-end: #f5f3ff;
    --color-alert-success-text: #065f46;
    --color-alert-danger-text: #991b1b;
    --color-alert-warning-text: #92400e;
    --color-badge-muted-bg: #f1f5f9;
    --color-placeholder: #94a3b8;
    --color-blazor-error-bg: #fef3c7;
    --color-blazor-error-text: #92400e;

    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.25rem;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 20px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.08);
    --shadow-brand: 0 8px 24px rgba(20, 184, 166, 0.22);
    --shadow-card: 0 0 0 1px rgba(15, 23, 42, 0.04), 0 4px 20px rgba(15, 23, 42, 0.05);

    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 320ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Responsive breakpoints (used in responsive.css media queries) */
    --bp-phone-max: 639px;
    --bp-tablet-min: 640px;
    --bp-tablet-max: 991px;
    --bp-tablet-wide-min: 992px;
    --bp-tablet-wide-max: 1199px;
    --bp-desktop-min: 1200px;

    --content-pad-phone: 1rem;
    --content-pad-tablet: 1.25rem;
    --content-pad-tablet-wide: 1.5rem;
    --content-pad-desktop: 2rem;
    --sidebar-width-tablet: 220px;
    --sidebar-width: 260px;
}

html[data-theme-resolved="dark"] {
    --color-bg: #0b1220;
    --color-bg-accent: #111827;
    --color-surface: #1e293b;
    --color-surface-elevated: #243044;
    --color-surface-muted: #162032;
    --color-border: #334155;
    --color-border-strong: #475569;
    --color-ring: rgba(45, 212, 191, 0.35);

    --color-text: #f1f5f9;
    --color-text-secondary: #cbd5e1;
    --color-text-muted: #94a3b8;

    --color-brand-soft: rgba(20, 184, 166, 0.18);
    --color-brand-muted: rgba(20, 184, 166, 0.1);
    --color-guidance-bg: #115e59;
    --color-guidance-border: #5eead4;
    --color-guidance-text: #f0fdfa;
    --color-accent-soft: rgba(20, 184, 166, 0.18);

    --color-success-soft: rgba(5, 150, 105, 0.18);
    --color-warning-soft: rgba(217, 119, 6, 0.18);
    --color-danger-soft: rgba(220, 38, 38, 0.16);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.45);
    --shadow-brand: 0 8px 24px rgba(20, 184, 166, 0.18);
    --shadow-card: 0 0 0 1px rgba(148, 163, 184, 0.08), 0 4px 20px rgba(0, 0, 0, 0.35);

    --color-topbar-bg: rgba(15, 23, 42, 0.88);
    --color-bg-glow-brand: rgba(20, 184, 166, 0.12);
    --color-bg-glow-neutral: rgba(148, 163, 184, 0.06);
    --color-overlay-backdrop: rgba(2, 6, 23, 0.62);
    --color-surface-gradient-start: #1e293b;
    --color-surface-gradient-end: #1e3a5f;
    --color-surface-gradient-accent-end: #312e81;
    --color-alert-success-text: #6ee7b7;
    --color-alert-danger-text: #fca5a5;
    --color-alert-warning-text: #fcd34d;
    --color-badge-muted-bg: #334155;
    --color-placeholder: #64748b;
    --color-blazor-error-bg: #451a03;
    --color-blazor-error-text: #fcd34d;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a, .btn-link {
    color: var(--color-brand-hover);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover, .btn-link:hover {
    color: var(--color-accent-strong);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--color-text);
    letter-spacing: -0.025em;
    font-weight: 700;
    line-height: 1.25;
}

code, .font-mono, .user-select-all {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.btn {
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition);
    letter-spacing: -0.01em;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-hover) 100%);
    border: none;
    box-shadow: var(--shadow-brand);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    color: #fff;
    background: linear-gradient(135deg, #2dd4bf 0%, var(--color-brand) 100%);
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(20, 184, 166, 0.28);
}

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

.btn-primary:disabled {
    background: #94a3b8;
    box-shadow: none;
    transform: none;
    opacity: 0.85;
}

.btn-outline-secondary {
    color: var(--color-text-secondary);
    border-color: var(--color-border-strong);
    background: var(--color-surface);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
    color: var(--color-brand-hover);
    border-color: var(--color-brand);
    background: var(--color-brand-soft);
}

.btn-scan {
    color: var(--color-accent-strong);
    border-color: rgba(20, 184, 166, 0.35);
    background: var(--color-accent-soft);
}

.btn-scan:hover,
.btn-scan:focus-visible {
    color: #fff;
    border-color: var(--color-brand);
    background: var(--color-brand);
}

.form-control,
.form-select {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:hover:not(:focus):not(:disabled),
.form-select:hover:not(:focus):not(:disabled) {
    border-color: var(--color-border-strong);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-brand);
    box-shadow: 0 0 0 3px var(--color-brand-soft);
}

.form-control::placeholder {
    color: var(--color-placeholder);
}

.form-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.btn:focus-visible,
.btn-link.nav-link:focus-visible,
.form-control:focus-visible,
.form-check-input:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--color-ring);
}

.content {
    padding-top: 1.75rem;
    padding-bottom: 3.5rem;
}

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

.card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2xl);
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.table thead th {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    border-bottom-width: 1px;
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
}

.table tbody td {
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
    color: var(--color-text-secondary);
    vertical-align: middle;
}

.table-hover tbody tr {
    transition: background var(--transition);
}

.table-hover tbody tr:hover {
    background: var(--color-brand-muted);
}

.alert {
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
}

.alert-success {
    background: var(--color-success-soft);
    border-color: rgba(5, 150, 105, 0.2);
    color: var(--color-alert-success-text);
}

.alert-danger {
    background: var(--color-danger-soft);
    border-color: rgba(220, 38, 38, 0.15);
    color: var(--color-alert-danger-text);
}

.alert-warning {
    background: var(--color-warning-soft);
    border-color: rgba(217, 119, 6, 0.2);
    color: var(--color-alert-warning-text);
}

.alert-info {
    background: var(--color-brand-soft);
    border-color: rgba(20, 184, 166, 0.2);
    color: var(--color-accent-strong);
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

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

.badge-pill--accent {
    background: var(--color-accent-soft);
    color: var(--color-accent-strong);
}

.badge-pill--muted {
    background: var(--color-badge-muted-bg);
    color: var(--color-text-muted);
}

.spinner-border-sm {
    border-width: 0.15em;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--color-success);
}

.invalid {
    outline: 1px solid var(--color-danger);
}

.validation-message {
    color: var(--color-danger);
    font-size: 0.875rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: var(--radius-lg);
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Brand mark — global so LookupLayout top bar and sidebar both get sizing */
.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #5eead4;
    flex-shrink: 0;
}

.brand-mark__svg {
    width: 2.125rem;
    height: 0.875rem;
    display: block;
    flex-shrink: 0;
}

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

.brand-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.2;
    white-space: nowrap;
}

.brand-link--compact {
    gap: 0.5rem;
}

.brand-link--compact .brand-mark__svg {
    width: 1.625rem;
    height: 0.675rem;
}

.brand-link--compact .brand-name {
    font-size: 0.9375rem;
    font-weight: 700;
}

.brand-link--light .brand-name {
    color: var(--color-text);
}

.brand-link--light .brand-mark {
    color: #2dd4bf;
}

/* Top bar — shared by MainLayout and LookupLayout */
.top-row__inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0 1.5rem;
}

.top-row__left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex-shrink: 0;
}

.top-row__spacer {
    flex: 1 1 auto;
    min-width: 0.5rem;
}

.top-row__right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    flex-shrink: 1;
}

.top-row__cluster {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    min-width: 0;
    flex-wrap: nowrap;
}

.customer-activity {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.customer-activity__led {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #94a3b8;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.18);
}

.customer-activity__led--on {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.28);
}

.theme-selector {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

/* Full width only inside the account menu. On the guest top bar, 100% width
   consumes the row and pushes Sign up / Sign in past the window. */
.user-menu .theme-selector--compact {
    width: 100%;
}

.user-menu .theme-selector--compact .theme-selector__select {
    width: 100%;
    max-width: none;
    min-width: 0;
}

.theme-selector__icon {
    width: 1rem;
    height: 1rem;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.theme-selector__select {
    width: auto;
    min-width: 5.75rem;
    max-width: 7.5rem;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
    padding-left: 0.55rem;
    padding-right: 1.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    background-color: var(--color-surface);
    border-color: var(--color-border);
}

@media (max-width: 720px) {
    .top-row__cluster {
        flex-wrap: wrap;
        justify-content: flex-end;
        row-gap: 0.35rem;
    }
}

/* Shared by MainLayout and LookupLayout — must be global so lookup pages hide the banner until Blazor shows an error. */
#blazor-error-ui {
    color-scheme: light dark;
    background: var(--color-blazor-error-bg);
    color: var(--color-blazor-error-text);
    bottom: 0;
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.12);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-weight: 500;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.onboarding-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg, #f8fafc);
}

.onboarding-layout__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border, #e2e8f0);
    background: var(--color-surface, #fff);
}

.onboarding-layout__main {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem 3rem;
}

.onboarding-card {
    width: min(720px, 100%);
}

.onboarding-agreement-list {
    padding-left: 1.25rem;
    margin-bottom: 1.25rem;
}

.onboarding-agreement-list--compact {
    font-size: 0.925rem;
}

.agreement-document {
    max-height: min(52vh, 28rem);
    overflow-y: auto;
    margin-bottom: 1rem;
    padding-right: 0.25rem;
}

.agreement-document__heading {
    margin-top: 1rem;
    margin-bottom: 0.35rem;
}

.agreement-document__paragraph {
    font-size: 0.925rem;
    margin-bottom: 0.65rem;
}

.privacy-policy h1 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.privacy-policy h2 {
    font-size: 1.15rem;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--bs-border-color, #e5e7eb);
}

.privacy-policy h3 {
    font-size: 1rem;
    margin-top: 1.1rem;
    margin-bottom: 0.35rem;
}

.privacy-policy p,
.privacy-policy li {
    font-size: 0.925rem;
}

.privacy-policy ul {
    padding-left: 1.25rem;
    margin-bottom: 0.75rem;
}

@media print {
    .trade-in-receipt-staff-note {
        display: none !important;
    }
}

.sidebar-footer__legal {
    font-size: 0.75rem;
    margin-top: 0.35rem;
    margin-bottom: 0;
}

.sidebar-footer__legal a {
    color: inherit;
    opacity: 0.85;
    text-decoration: none;
}

.sidebar-footer__legal a:hover {
    opacity: 1;
    text-decoration: underline;
}

.onboarding-tier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.onboarding-tier-card {
    text-align: left;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--color-surface, #fff);
    cursor: pointer;
}

.onboarding-tier-card--selected {
    border-color: var(--bs-primary, #0d6efd);
    box-shadow: 0 0 0 1px var(--bs-primary, #0d6efd);
}

.nav-busy {
    pointer-events: none;
}

.nav-busy__bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 1080;
    overflow: hidden;
    background: var(--color-brand-soft);
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left center;
}

html.ui-busy-visible .nav-busy__bar,
.nav-busy--visible .nav-busy__bar {
    opacity: 1;
    transform: scaleX(1);
}

.nav-busy__bar-fill {
    display: block;
    height: 100%;
    width: 40%;
    background: var(--color-brand);
    border-radius: 999px;
    animation: nav-busy-slide 0.9s ease-in-out infinite;
}

.nav-busy__overlay {
    position: fixed;
    inset: 0;
    z-index: 1075;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--color-bg) 62%, transparent);
    opacity: 0;
    pointer-events: none;
}

html.ui-busy-visible .nav-busy__overlay,
.nav-busy--visible .nav-busy__overlay {
    opacity: 1;
}

html.ui-busy-blocking .nav-busy__overlay,
.nav-busy--visible:not(.nav-busy--passive) .nav-busy__overlay {
    pointer-events: auto;
    cursor: progress;
}

.nav-busy__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.15rem 1.4rem;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    color: var(--color-text);
}

.nav-busy__spinner {
    width: 1.75rem;
    height: 1.75rem;
    color: var(--color-brand);
    border-width: 0.18em;
}

.nav-busy__label {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.pulse-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: end;
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 0.75rem 0;
    background: var(--bs-body-bg, #0f172a);
}

.pulse-filters__field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--bs-secondary-color, #94a3b8);
}

.pulse-filters__field .form-select {
    min-width: 9rem;
}

.pulse-filters__note {
    font-size: 0.8rem;
    color: var(--bs-secondary-color, #94a3b8);
    max-width: 16rem;
}

.pulse-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.pulse-tabs__tab {
    border: 1px solid var(--color-border, #334155);
    background: transparent;
    color: inherit;
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.pulse-tabs__tab--active {
    background: #0f766e;
    border-color: #0f766e;
    color: #fff;
}

.pulse-kpi-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.pulse-kpi {
    border: 1px solid var(--color-border, #334155);
    border-radius: 0.75rem;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.35);
}

.pulse-kpi__label {
    font-size: 0.75rem;
    color: #94a3b8;
}

.pulse-kpi__value {
    font-size: 1.25rem;
    font-weight: 650;
}

.pulse-kpi__delta--up { color: #14b8a6; font-size: 0.75rem; }
.pulse-kpi__delta--down { color: #f59e0b; font-size: 0.75rem; }
.pulse-kpi__note { font-size: 0.7rem; color: #94a3b8; }

.pulse-spark { width: 100%; height: 1.5rem; color: #14b8a6; }

.pulse-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.pulse-row--corridor {
    grid-template-columns: 2fr 1fr;
}

.pulse-chart {
    border: 1px solid var(--color-border, #334155);
    border-radius: 0.85rem;
    padding: 1rem;
}

.pulse-insight {
    color: #94a3b8;
    font-size: 0.875rem;
    margin-bottom: 0.35rem;
}

.pulse-line-chart { width: 100%; height: 10rem; }
.pulse-ask-line { stroke: #94a3b8; }
.pulse-sold-line { stroke: #14b8a6; }
.pulse-band { fill: rgba(20, 184, 166, 0.16); }

.pulse-legend {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.35rem;
}

.pulse-compare {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.pulse-stack__row {
    display: grid;
    grid-template-columns: 5.5rem 1fr auto;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
}

.pulse-stack__track {
    background: rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    height: 0.65rem;
}

.pulse-stack__bar {
    height: 100%;
    border-radius: inherit;
    background: #64748b;
}

.pulse-stack__bar--hot { background: #d97706; }

.pulse-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1rem;
    margin: 0.75rem 0 0;
}

.pulse-stats dt { font-size: 0.75rem; color: #94a3b8; }
.pulse-stats dd { margin: 0; font-weight: 600; }

.pulse-cats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.pulse-watch-input { max-width: 14rem; }
.pulse-watch-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pulse-watch-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: 1px solid var(--color-border, #334155);
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
}

.pulse-teaser {
    max-width: 40rem;
}

.pulse-subchart {
    border-top: 1px solid var(--color-border, #334155);
    padding-top: 0.75rem;
}

.pulse-buckets__row {
    display: grid;
    grid-template-columns: 4rem 1fr 2rem;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
}

.pulse-buckets__label,
.pulse-buckets__value {
    font-variant-numeric: tabular-nums;
}

.pulse-comp-row {
    border: 1px solid var(--color-border, #334155);
    border-radius: 0.5rem;
    padding: 0.5rem 0.65rem;
}

.pulse-heatmap {
    display: grid;
    grid-template-columns: repeat(24, minmax(0, 1fr));
    grid-template-rows: repeat(7, 0.85rem);
    gap: 2px;
    margin-top: 0.75rem;
    min-height: 6rem;
}

.pulse-heatmap__cell {
    border-radius: 2px;
    min-height: 0.75rem;
}

.pulse-agent-install {
    border: 1px solid var(--color-border, #cbd5e1);
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--color-surface, #fff);
    margin-bottom: 0.85rem;
}

.pulse-agent-install--compact {
    padding: 0.7rem 0.85rem;
}

.pulse-agent-install__lead,
.pulse-agent-install__status {
    font-size: 0.875rem;
}

.pulse-agent-install__status--ok {
    color: #0f766e;
}

.pulse-agent-install__status--warn {
    color: #b45309;
}

.pulse-agent-install__steps {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.875rem;
}

.pulse-agent-install__steps li + li {
    margin-top: 0.35rem;
}

@media (max-width: 1100px) {
    .pulse-kpi-strip,
    .pulse-row,
    .pulse-row--corridor,
    .pulse-cats,
    .pulse-compare {
        grid-template-columns: 1fr;
    }
}

@keyframes nav-busy-slide {
    0% {
        transform: translateX(-120%);
    }

    100% {
        transform: translateX(350%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .nav-busy__bar,
    .nav-busy__overlay {
        transition: none;
    }

    .nav-busy__bar-fill {
        animation: none;
        width: 100%;
    }
}

html.ui-busy,
html.ui-busy body {
    cursor: wait;
}

html.ui-busy * {
    cursor: wait !important;
}

.ebay-listing-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.ebay-listing-photos__item {
    width: 8.5rem;
    position: relative;
}

.ebay-listing-photos__item img {
    display: block;
    width: 8.5rem;
    height: 8.5rem;
    object-fit: cover;
    border: 1px solid var(--color-border);
    border-radius: 0.4rem;
    background: var(--color-surface-muted);
}

.ebay-listing-photos__badge {
    position: absolute;
    top: 0.3rem;
    left: 0.3rem;
    background: rgba(15, 23, 42, 0.8);
    color: #fff;
    font-size: 0.7rem;
    padding: 0.05rem 0.35rem;
    border-radius: 0.25rem;
}

.ebay-listing-photos__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.35rem;
}
