* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #5e72e4;
    --primary-dark: #4c63d2;
    --primary-light: #7b8cee;
    --copy-accent: #06b6d4; /* teal accent for copy */
    --text-primary: #2c3e50;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --bg-white: #ffffff;
    --bg-gray: #f8fafc;
    --border-color: rgba(226, 232, 240, 0.8);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --border-width-xs: 0.0625rem; /* 1px */
    --border-width-sm: 0.125rem; /* 2px */
    --border-width-md: 0.1875rem; /* 3px */
    --border-width-lg: 0.5rem; /* 8px */
    --space-2xs: 0.25rem; /* 4px */
    --space-xs: 0.5rem; /* 8px */
    --space-sm: 0.75rem; /* 12px */
    --space-md: 1rem; /* 16px */
    --space-lg: 1.5rem; /* 24px */
    --space-xl: 2rem; /* 32px */

    /* Golden ratio helpers */
    --phi: 1.618;
    --phi-inv: 0.618;  /* 1/phi */
    --phi-comp: 0.382; /* 1 - 1/phi */
}

body {
    font-family: "Baskervville", "Times New Roman", serif;
    background: linear-gradient(to bottom right, #f0f4f8, #e2e8f0);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.58;
    font-weight: 400;
    font-style: normal;
    font-optical-sizing: auto;
    overflow-x: hidden;
    letter-spacing: 0.01em;
}

/* Initial minimal mode: show only URL input until link is entered */
body.initial-mode .initial-extra {
    /* Allow horizontal overflow so focused input scale is not clipped */
    overflow-y: hidden;
    overflow-x: visible;
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: max-height 0.44s cubic-bezier(0.34, 1, 0.64, 1),
                opacity 0.3s ease,
                transform 0.44s cubic-bezier(0.34, 1, 0.64, 1);
}
body.initial-mode .initial-extra.expanded {
    max-height: 1000px; /* generous to avoid clipping during animation */
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    /* Once expanded, allow overflow so focused elements can scale without clipping */
    overflow-y: visible;
    overflow-x: visible;
}

/* Small spacing when extra section is visible */
body.initial-mode #initial-extra.expanded {
    margin-top: var(--space-sm);
}

/* Center the single URL input within the glass card when minimal */
body.initial-mode .input-card.center-single {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: auto; /* wrap to content height */
}
/* Add a small top margin so the URL input isn't stuck to the top border */
body.initial-mode .input-card.center-single .input-group {
    margin-top: var(--space-xs);
}

/* Ensure the card itself never clips the scaling input */
body.initial-mode .input-card { overflow: visible; }

/* Make the initial card wrap tightly around the single input */
/* Keep original width and padding in initial mode as well */
body.initial-mode .main-content .input-card {
    width: 61.8%;
    padding: var(--space-md) var(--space-lg);
    align-self: auto;
}

/* Override vertical padding only when it's the single-field card */
body.initial-mode .main-content .input-card.center-single { padding-top: 0; padding-bottom: 0; }

/* Center the URL input area on first launch */
body.initial-mode .container {
    justify-content: center; /* center header + main as a block */
    transform: none; /* exact centering, no vertical offset */
}
body.initial-mode .container:not(.is-split) { transform: none; }

body.initial-mode .header {
    margin-bottom: var(--space-xl);
}
body.initial-mode .main-content {
    flex: initial; /* let content size itself */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* keep internal flow natural */
}
body.initial-mode .main-content .input-card {
    margin-top: 0;
    margin-bottom: 0;
}

/* Reduce big gap under single URL input before expansion */
body.initial-mode .input-group {
    margin-bottom: var(--space-xs);
}

.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    overflow: hidden;
}

.dynamic-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.5;
    mix-blend-mode: screen;
    animation: infinite ease-in-out;
}

@keyframes moveOrb1 {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    20% {
        transform: translate(150px, 80px) scale(1.2) rotate(90deg);
    }
    40% {
        transform: translate(80px, 150px) scale(0.85) rotate(180deg);
    }
    60% {
        transform: translate(-100px, 120px) scale(1.1) rotate(270deg);
    }
    80% {
        transform: translate(-80px, -50px) scale(0.95) rotate(360deg);
    }
}

@keyframes moveOrb2 {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    25% {
        transform: translate(-120px, -100px) scale(1.3) rotate(-90deg);
    }
    50% {
        transform: translate(100px, -140px) scale(0.9) rotate(-180deg);
    }
    75% {
        transform: translate(-50px, 80px) scale(1.15) rotate(-270deg);
    }
}

@keyframes moveOrb3 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    20% {
        transform: translate(-150px, 50px) scale(1.25);
    }
    40% {
        transform: translate(-80px, -120px) scale(0.8);
    }
    60% {
        transform: translate(120px, -80px) scale(1.05);
    }
    80% {
        transform: translate(60px, 100px) scale(0.92);
    }
}

@keyframes moveOrb4 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    33% {
        transform: translate(-180px, 150px) rotate(120deg) scale(1.35);
    }
    66% {
        transform: translate(150px, -100px) rotate(240deg) scale(0.85);
    }
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 3rem 2rem;
    position: relative;
    z-index: 1;
    transition: max-width 0.4s ease, transform 0.4s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center; /* center header + main as a block initially */
}

.container.is-split {
    max-width: 1800px;
    justify-content: flex-start; /* normal flow after split */
    transform: none; /* reset any entry offset */
}

/* Slightly raise the initial group position using phi */
.container:not(.is-split) {
    transform: translateY(calc(-8vh * var(--phi-comp))); /* slightly above center */
}

@media (max-width: 768px) {
    .container:not(.is-split) { transform: translateY(calc(-4vh * var(--phi-comp))); }
}

/* Smooth upward flow animation on split transition */
@keyframes flowUpward {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(calc(-30px * var(--phi-inv))); /* ~18px upward */
    }
}

.container.is-split.flow-up {
    animation: flowUpward 0.618s cubic-bezier(0.34, 1, 0.64, 1) forwards;
}

/* Gentle title animation when entering split - flows upward */
@keyframes titleSplitIn {
    0% { 
        opacity: 0.8; 
        transform: translateY(0) scale(1);
    }
    50% { 
        opacity: 0.95; 
        transform: translateY(calc(-20px * var(--phi-inv))) scale(1.01);
    }
    100% { 
        opacity: 1; 
        transform: translateY(calc(-30px * var(--phi-inv))) scale(1);
    }
}
.title-split-in { 
    animation: titleSplitIn 0.618s cubic-bezier(0.34, 1, 0.64, 1) both;
}

/* No page-wide blind/overlay effect; we animate elements directly */

.header {
    text-align: center;
    margin-bottom: calc(2rem * var(--phi));
    animation: fadeInDown 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.logo {
    color: var(--primary-color);
}

.title {
    font-size: calc(1.25rem * var(--phi));
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.012em;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.008em;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* Center the input card when it's the only panel */
.main-content .input-card {
    width: 61.8%;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .main-content .input-card { width: 100%; }
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 20px;
    border: var(--border-width-xs) solid var(--glass-border);
    padding: var(--space-md) var(--space-lg);
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 20px 25px -5px rgba(0, 0, 0, 0.05),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transition: all 0.382s cubic-bezier(0.165, 0.84, 0.44, 1);
    animation: fadeInUp 1.618s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.5) 50%, 
        transparent);
}

.glass-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.2) inset,
        0 30px 35px -5px rgba(0, 0, 0, 0.1),
        0 15px 15px -5px rgba(0, 0, 0, 0.06);
}

.card-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: var(--border-width-xs) solid rgba(226, 232, 240, 0.3);
}

.card-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 8px;
    letter-spacing: 0.008em;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.006em;
}

.input-group {
    margin-bottom: var(--space-lg);
    position: relative;
}

.input-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    letter-spacing: 0.008em;
}

/* Hide titles and labels on initial single-panel view; reveal on split */
.card-header, .input-label { 
    transition: opacity 0.382s cubic-bezier(0.34, 1, 0.64, 1),
                max-height 0.618s cubic-bezier(0.34, 1, 0.64, 1),
                margin 0.618s cubic-bezier(0.34, 1, 0.64, 1),
                padding 0.618s cubic-bezier(0.34, 1, 0.64, 1);
}
.main-content .card-header,
.main-content .input-label {
    opacity: 0;
    max-height: 0;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden;
    visibility: hidden;
    transform: scale(0.95);
}

/* Smoothly reveal when switching to split */
.main-split .card-header,
.main-split .input-label {
    opacity: 1;
    max-height: 100px;
    visibility: visible;
    transform: scale(1);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-tertiary);
    pointer-events: none;
    transition: var(--transition-fast);
}

.text-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    font-size: 0.9375rem;
    font-family: "Baskervville", "Times New Roman", serif;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border: var(--border-width-xs) solid rgba(226, 232, 240, 0.5);
    border-radius: 12px;
    color: var(--text-primary);
    transition: var(--transition-fast);
    outline: none;
    letter-spacing: 0.008em;
}

.text-input::placeholder {
    color: transparent;
}

.text-input:focus {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--primary-color);
    box-shadow: 
        0 0 0 3px rgba(94, 114, 228, 0.1),
        0 1px 2px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.text-input:focus ~ .input-icon {
    color: var(--primary-color);
}

.input-hint {
    position: absolute;
    left: 2.75rem;
    top: 50%;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    letter-spacing: 0.008em;
    pointer-events: none;
    transform: translateY(-50%);
    transition: all 0.382s cubic-bezier(0.4, 0, 0.2, 1); /* phi-comp timing */
}

/* Hint positioning states in split layout */
.main-split .input-hint.hint-centered {
    top: 50%;
    transform: translateY(-50%);
    left: 2.75rem;
    opacity: 1;
    color: var(--text-tertiary);
    text-shadow: none;
    font-size: 0.75rem;
}

.main-split .input-hint.hint-top {
    top: -10px;
    transform: translateY(0) scale(0.85);
    left: 1rem;
    color: var(--primary-color);
    text-shadow: 
        0 0 20px rgba(94, 114, 228, 0.8),
        0 0 40px rgba(94, 114, 228, 0.6),
        0 0 60px rgba(94, 114, 228, 0.4),
        0 0 80px rgba(255, 255, 255, 0.9),
        0 2px 8px rgba(255, 255, 255, 1),
        0 4px 16px rgba(255, 255, 255, 0.8);
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 6px;
    padding: 0.125rem 0.375rem;
}

/* Hint staged fade with upward flow on split */
.hint-fade-prepare { 
    opacity: 0; 
    filter: blur(3px); 
    transform: translateY(calc(8px * var(--phi-inv))) translateY(-50%); /* Start below, then flow up */
}
.hint-fade-in { 
    opacity: 1; 
    filter: blur(0); 
    /* Let JS control final position */
    transition: opacity 0.382s cubic-bezier(0.34, 1, 0.64, 1), 
                filter 0.382s cubic-bezier(0.34, 1, 0.64, 1), 
                transform 0.618s cubic-bezier(0.34, 1, 0.64, 1);
}

/* Default behavior when not in split layout */
.main-content .text-input:focus ~ .input-hint,
.main-content .input-wrapper.has-value .input-hint {
    top: -10px;
    transform: translateY(0) scale(0.85);
    color: var(--primary-color);
    text-shadow: 
        0 0 20px rgba(94, 114, 228, 0.8),
        0 0 40px rgba(94, 114, 228, 0.6),
        0 0 60px rgba(94, 114, 228, 0.4),
        0 0 80px rgba(255, 255, 255, 0.9),
        0 2px 8px rgba(255, 255, 255, 1),
        0 4px 16px rgba(255, 255, 255, 0.8);
    left: 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 6px;
    padding: 0.125rem 0.375rem;
}

/* In split layout, controlled by JS classes */
.main-split .text-input:focus ~ .input-hint,
.main-split .input-wrapper.has-value .input-hint {
    /* Styles handled by .hint-top class */
}

.primary-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    --btn-pad-y: var(--space-sm);
    --btn-pad-x: var(--space-lg);
    padding: var(--btn-pad-y) var(--btn-pad-x);
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: "Baskervville", "Times New Roman", serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: var(--border-width-md) solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: relative;
    letter-spacing: 0.008em;
}

.primary-button:hover {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 12px 20px -5px rgba(94, 114, 228, 0.25),
        0 6px 8px -2px rgba(94, 114, 228, 0.15);
}

.primary-button:active {
    transform: translateY(0) scale(1);
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

.button-icon {
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.primary-button:hover .button-icon {
    transform: translateX(calc(2px * var(--phi)));
}

.secondary-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    --btn2-pad-y: var(--space-xs);
    --btn2-pad-x: var(--space-md);
    padding: var(--btn2-pad-y) var(--btn2-pad-x);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: "Baskervville", "Times New Roman", serif;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    border: var(--border-width-xs) solid rgba(226, 232, 240, 0.5);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
    letter-spacing: 0.008em;
}

.secondary-button:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--primary-light);
    color: var(--primary-color);
    transform: translateY(-2px) scale(1.02);
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    animation: fadeIn 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.spinner {
    width: 40px;
    height: 40px;
    border: var(--border-width-sm) solid rgba(94, 114, 228, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    margin-top: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    letter-spacing: 0.008em;
}

.citation-block {
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(94, 114, 228, 0.05) 0%, rgba(94, 114, 228, 0.02) 100%);
    border-radius: 12px;
    border: var(--border-width-xs) solid rgba(94, 114, 228, 0.1);
}

.citation-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.citation-text {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-style: italic;
    line-height: 1.6;
    letter-spacing: 0.008em;
}

.evidence-block {
    margin-bottom: 2rem;
}

.evidence-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.evidence-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.evidence-item {
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: var(--border-width-xs) solid rgba(226, 232, 240, 0.3);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    animation: slideIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideIn {
    0% {
        opacity: 0;
        transform: translateX(-30px) scale(0.9);
    }
    60% {
        opacity: 0.8;
        transform: translateX(5px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.evidence-item:hover {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(94, 114, 228, 0.2);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.evidence-text {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text-primary);
    letter-spacing: 0.008em;
}

.evidence-text .highlight {
    background: linear-gradient(180deg, transparent 50%, rgba(94, 114, 228, 0.2) 50%);
    font-weight: 500;
    padding: 0 0.1875rem;
    border-radius: 2px;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    padding: 1rem 1.5rem;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition-base);
    z-index: 1000;
    border: var(--border-width-xs) solid rgba(226, 232, 240, 0.3);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
    animation: toastSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes toastSlideIn {
    0% {
        transform: translateY(100px) scale(0.9);
        opacity: 0;
    }
    60% {
        transform: translateY(-10px) scale(1.02);
        opacity: 0.9;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-icon {
    color: #10b981;
    flex-shrink: 0;
}

.toast-message {
    font-size: 0.875rem;
    color: var(--text-primary);
    letter-spacing: 0.008em;
}

.toast-action {
    margin-left: 0.5rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary-color);
    background: rgba(255,255,255,0.8);
    border: var(--border-width-xs) solid rgba(226, 232, 240, 0.7);
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition-fast);
}
.toast-action:hover {
    background: rgba(255,255,255,1);
    transform: translateY(-1px);
}

@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    50% {
        opacity: 0.7;
        transform: translateY(-10px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ====== New split layout and cuts panel ====== */
.main-split {
    display: grid;
    grid-template-columns: 1.618fr 1fr;
    grid-template-areas: 'input cuts';
    gap: var(--space-lg);
    align-items: start;
}

@media (max-width: 900px) {
    .main-split { grid-template-columns: 1fr; }
}

.cuts-panel {
    grid-area: cuts;
    max-height: calc(100vh * var(--phi-inv));
    display: flex;
    flex-direction: column;
    overflow: visible;
    opacity: 0;
    transform: translateX(calc(30px * var(--phi-inv)));
    transition: opacity 0.618s cubic-bezier(0.34, 1, 0.64, 1),
                transform 0.618s cubic-bezier(0.34, 1, 0.64, 1);
}
.cuts-panel.show {
    opacity: 1;
    transform: translateX(0);
}

/* Smooth slide and flow for input card when entering split layout */
@keyframes inputCardSplit {
    0% {
        transform: translateX(0) translateY(0);
    }
    50% {
        transform: translateX(calc(-20px * var(--phi-inv))) translateY(calc(-10px * var(--phi-comp)));
    }
    100% {
        transform: translateX(0) translateY(0);
    }
}
.input-card.split-shift { 
    animation: inputCardSplit 0.618s cubic-bezier(0.34, 1, 0.64, 1);
}

/* Ensure input card is left in split layout */
.input-card { grid-area: input; }

/* Reveal helpers with smooth upward flow */
.reveal-prepare { 
    opacity: 0 !important; 
    transform: translateY(calc(12px * var(--phi-inv))) !important; /* Start below */
    visibility: visible !important;
    max-height: 100px !important;
}
.reveal-in { 
    opacity: 1 !important; 
    transform: translateY(0) !important; 
    transition: opacity 0.382s cubic-bezier(0.34, 1, 0.64, 1), 
                transform 0.618s cubic-bezier(0.34, 1, 0.64, 1);
}

.cuts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}
.cuts-title-wrap { display: flex; align-items: center; gap: 0.5rem; }

.cuts-scroll {
    overflow-y: auto;
    overflow-x: visible;
    padding-right: 4px;
    flex: 1;
}

.cuts-empty {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    text-align: center;
    padding: var(--space-md) var(--space-sm);
}
.cuts-footer { margin-top: auto; }

/* Side-by-side actions within cuts footer */
.cuts-footer .action-buttons {
    display: flex;
    --action-gap: var(--space-sm);
    gap: var(--action-gap);
    flex-wrap: nowrap;
    width: 100%;
}

.cuts-footer .action-buttons > .primary-button,
.cuts-footer .action-buttons > .secondary-button {
    width: auto; /* override global 100% on primary */
    flex: 1 1 calc((100% - var(--action-gap)) / 2);
    max-width: calc((100% - var(--action-gap)) / 2);
    min-width: calc((100% - var(--action-gap)) / 2);
}

/* Copy button: same overall style and size as primary, but glassy */
.cuts-footer .action-buttons > .copy-button {
    --btn-pad-y: var(--space-sm);
    --btn-pad-x: var(--space-lg);
    padding: var(--btn-pad-y) var(--btn-pad-x);
    font-size: 0.9375rem;
    border-radius: 12px;
    border: var(--border-width-md) solid rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.38);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    color: var(--text-primary);
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 26px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    overflow: hidden;
}

.cuts-footer .action-buttons > .copy-button:hover,
.cuts-footer .action-buttons > .copy-button:focus-visible {
    color: var(--copy-accent);
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.cuts-footer .action-buttons > .copy-button:active {
    transform: translateY(0);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.copy-button .button-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.82);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.165, 0.84, 0.44, 1),
    transform 0.25s cubic-bezier(0.165, 0.84, 0.44, 1),
    color 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.copy-button:hover .button-icon,
.copy-button:focus-visible .button-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    color: var(--copy-accent);
}

.copy-button .button-text {
    flex: 1 0 auto;
    text-align: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.copy-button:hover .button-text,
.copy-button:focus-visible .button-text {
    opacity: 0;
    transform: translateY(-6px);
}

.card-group {
    position: relative;
    border: var(--border-width-xs) solid rgba(226, 232, 240, 0.6);
    border-radius: 14px;
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    background: rgba(255,255,255,0.6);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
    overflow: visible;
}
.card-group:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16,24,40,0.10); background: rgba(255,255,255,0.8); }

.group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--space-sm);
    overflow: visible;
}
.group-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    letter-spacing: 0.008em;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.group-title:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.rating-container {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    overflow: visible;
    position: relative;
}

.rating-bar {
    width: 20px;
    height: 6px;
    border-radius: 3px;
    background: rgba(148, 163, 184, 0.2);
    transition: all 0.3s ease;
}

.rating-bar.filled {
    transform: scaleX(1.05);
}

.rating-bar.filled.score-contradicts {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.rating-bar.filled.score-poor,
.rating-bar.filled.score-moderate,
.rating-bar.filled.score-good,
.rating-bar.filled.score-excellent {
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.rating-bar.filled.score-excellent {
    animation: excellentPulse 2s ease-in-out infinite;
}

@keyframes excellentPulse {
    0%, 100% {
        transform: scaleX(1.05);
        box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
    }
    50% {
        transform: scaleX(1.1);
        box-shadow: 0 4px 12px rgba(34, 197, 94, 0.6);
    }
}

.reevaluate-btn {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: var(--border-width-xs) solid rgba(226, 232, 240, 0.7);
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    font-size: 14px;
    margin-left: 4px;
}

.reevaluate-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 1);
    transform: rotate(180deg);
}

.hint-btn {
    position: relative;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: var(--border-width-xs) solid rgba(226, 232, 240, 0.7);
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    font-size: 12px;
    font-weight: 600;
    margin-left: 4px;
}

.hint-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 1);
}

.hint-btn:hover .evaluation-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.evaluation-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 280px;

    /* Glass morphism effect */
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);

    border: var(--border-width-xs) solid var(--glass-border);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset,
    0 20px 25px -5px rgba(0, 0, 0, 0.05),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);

    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.24s cubic-bezier(0.34, 1.2, 0.64, 1);
    z-index: 9999;
    pointer-events: none;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

/* Subtle top highlight matching glass cards */
.evaluation-tooltip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, 0.5) 50%,
    transparent);
}

/* Left-Right Layout */
.tooltip-layout {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
}

/* Left Side: Bars */
.tooltip-left {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
}

.metric-row {
    display: flex;
    align-items: center;
}

.metric-bars {
    display: flex;
    gap: 4px;
    align-items: center;
}

.bar {
    width: 24px;
    height: 8px;
    border-radius: 4px;
    background: rgba(148, 163, 184, 0.25);
    transition: all 0.3s ease;
}

.bar.filled {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: 0 2px 8px rgba(94, 114, 228, 0.3);
    transform: scaleY(1.1);
}

/* Score-based color variations */
.metric-row.score-excellent .bar.filled {
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
}

.metric-row.score-excellent .metric-label {
    color: #16a34a;
    font-weight: 600;
}

.metric-row.score-good .bar.filled {
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.metric-row.score-good .metric-label {
    color: #22c55e;
}

.metric-row.score-moderate .bar.filled {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.metric-row.score-moderate .metric-label {
    color: #d97706;
}

.metric-row.score-poor .bar.filled {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.metric-row.score-poor .metric-label {
    color: #dc2626;
}

.metric-row.score-contradicts .bar.filled {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.metric-row.score-contradicts .metric-label {
    color: #dc2626;
    font-weight: 600;
}

/* Right Side: Labels */
.tooltip-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    min-width: 100px;
}

.metric-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 0.008em;
    line-height: 8px;
    display: flex;
    align-items: center;
}

.tooltip-empty {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

.tooltip-empty-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--primary-dark);
    background: rgba(94, 114, 228, 0.12);
    border: var(--border-width-xs) solid rgba(94, 114, 228, 0.2);
}

.tooltip-empty-text {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.group-delete {
    position: relative; right: 0; top: 0; width: 28px; height: 28px; border-radius: 999px;
    border: var(--border-width-xs) solid rgba(226, 232, 240, 0.7);
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-secondary); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: var(--transition-fast);
    flex-shrink: 0;
}
.group-delete:hover { color: #ef4444; border-color: #fecaca; background: rgba(255,255,255,1); }

.group-body { max-height: 140px; overflow: hidden; transition: max-height 0.3s ease; }
.card-group:hover .group-body { max-height: 600px; }

.group-card {
    border: var(--border-width-xs) solid rgba(226, 232, 240, 0.6);
    border-radius: 12px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.7);
}
.group-card { position: relative; }
.group-cite { font-weight: 600; color: var(--text-primary); margin-bottom: 0.25rem; font-size: 0.9rem; }
.group-content { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.45; margin-bottom: 0.4rem; }

.group-content .highlight {
    background: linear-gradient(180deg, transparent 50%, rgba(94, 114, 228, 0.2) 50%);
    font-weight: 500;
    padding: 0 0.1875rem;
    border-radius: 2px;
}
.group-link { display: inline-block; color: var(--primary-color); text-decoration: none; font-size: 0.8rem; overflow-wrap: anywhere; }
.group-link:hover { text-decoration: underline; }

/* Inline/mini spinner for card content */
.mini-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.25rem 0;
}

.mini-loading .spinner {
    width: 20px;
    height: 20px;
    border-width: var(--border-width-sm);
}

/* Download all button icon behavior */
.download-all .button-icon { opacity: 0; transform: translateX(-6px); }
.download-all:hover .button-icon { opacity: 1; transform: translateX(0); color: var(--primary-color); }
.download-all:hover .button-text { display: none; }

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    50% {
        opacity: 0.7;
        transform: translateY(10px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem;
    }

    .title {
        font-size: 1.75rem;
    }

    .glass-card {
        padding: 1.75rem;
        border-radius: 16px;
    }

    .card-title {
        font-size: 1.125rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .secondary-button {
        width: 100%;
    }

    .cuts-footer .action-buttons {
        flex-direction: row;
    }

    .cuts-footer .action-buttons > .primary-button,
    .cuts-footer .action-buttons > .secondary-button {
        width: auto;
    }

    .gradient-orb {
        filter: blur(80px);
    }
}

/* Inline Editing Panel Styles */
.card-editing-panel {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 0;
    margin-top: 8px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-editing-panel.show {
    opacity: 1;
    max-height: 48px;
}

.editing-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 28px;
    margin-top: 4px;
    padding-bottom: 6px;
    border-bottom: var(--border-width-sm) solid rgba(226, 232, 240, 0.6);
}

.highlight-toggle {
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: var(--text-secondary);
    height: 24px;
    line-height: 16px;
    outline: none;
}

.highlight-toggle:hover {
    background: rgba(94, 114, 228, 0.08);
}

.highlight-toggle.active {
    background: rgba(94, 114, 228, 0.2);
    color: var(--primary-color);
}


/* Color picker container */
.color-picker-container {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    position: relative;
    overflow: visible;
    cursor: pointer;
    flex-shrink: 0;
    align-self: center;
}

/* Override Pickr styles for minimal appearance */
.pcr-button {
    width: 14px !important;
    height: 14px !important;
    margin-left: 4px !important;
    margin-bottom: 10px !important;
    position: relative !important;
}

.pcr-app {
    border-radius: 8px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12) !important;
}

/* Make card content clickable and editable */
.group-content {
    cursor: text;
    transition: background-color 0.15s ease;
    position: relative;
}

.group-content:hover {
    background: rgba(94, 114, 228, 0.02);
    border-radius: 4px;
}

/* Editable content state */
.group-content[contenteditable="true"] {
    background: rgba(94, 114, 228, 0.05);
    border: var(--border-width-xs) dashed rgba(94, 114, 228, 0.3);
    border-radius: 4px;
    padding: 0.25rem;
    outline: none;
}

.group-content[contenteditable="true"]:focus {
    background: rgba(94, 114, 228, 0.08);
    border-color: rgba(94, 114, 228, 0.5);
    box-shadow: 0 0 0 2px rgba(94, 114, 228, 0.1);
}

/* Text selection styling in editable content */
.group-content[contenteditable="true"]::selection {
    background: rgba(94, 114, 228, 0.2);
}

/* ====== Onboarding Tutorial Styles ====== */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.onboarding-overlay.show {
    display: block;
    opacity: 1;
}


.onboarding-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.onboarding-content {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 20px;
    border: var(--border-width-xs) solid var(--glass-border);
    padding: 1.5rem;
    max-width: 400px;
    width: 90%;
    max-width: min(400px, calc(100vw - 4rem));
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset,
    0 20px 25px -5px rgba(0, 0, 0, 0.05),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 10001;
    animation: slideInFromRight 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Add the same subtle top highlight as glass cards */
.onboarding-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, 0.5) 50%,
    transparent);
}

/* Adaptive positioning when spotlight is active */
.onboarding-content.adaptive {
    bottom: auto;
    right: auto;
    transform: none;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.onboarding-progress {
    margin-bottom: 1.5rem;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    display: block;
    margin-bottom: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(226, 232, 240, 0.5);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 12.5%; /* 1/8 steps */
}

.onboarding-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: 0.006em;
}

.onboarding-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.onboarding-description code {
    background: rgba(94, 114, 228, 0.1);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9em;
    color: var(--primary-color);
}

.onboarding-example {
    background: rgba(94, 114, 228, 0.05);
    border: var(--border-width-xs) solid rgba(94, 114, 228, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.example-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--primary-color);
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.example-content {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.onboarding-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
}

.nav-buttons {
    display: flex;
    gap: 0.75rem;
}

.onboarding-btn {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.onboarding-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.onboarding-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(94, 114, 228, 0.3);
}

.onboarding-btn.secondary {
    background: transparent;
    color: var(--text-secondary);
    border: var(--border-width-xs) solid rgba(226, 232, 240, 0.5);
}

.onboarding-btn.secondary:hover {
    background: rgba(226, 232, 240, 0.2);
    color: var(--text-primary);
}

/* Spotlight border that appears around highlighted elements */
.spotlight-border {
    position: fixed;
    border: var(--border-width-md) solid var(--primary-color);
    border-radius: 12px;
    z-index: 10000;
    display: none;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 0 9999px rgba(255, 255, 255, 0.25),
    0 0 20px rgba(94, 114, 228, 0.6),
    0 0 40px rgba(94, 114, 228, 0.3);
}

/* Pulse animation for the border */
@keyframes spotlightPulse {
    0%, 100% {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 9999px rgba(255, 255, 255, 0.25),
        0 0 20px rgba(94, 114, 228, 0.6),
        0 0 40px rgba(94, 114, 228, 0.3);
    }
    50% {
        border-color: var(--primary-light);
        box-shadow: 0 0 0 9999px rgba(255, 255, 255, 0.3),
        0 0 30px rgba(94, 114, 228, 0.8),
        0 0 60px rgba(94, 114, 228, 0.4);
    }
}

.spotlight-border.show {
    display: block;
    animation: spotlightPulse 2s ease-in-out infinite;
}

/* Tooltip for contextual help */
.onboarding-tooltip {
    position: fixed;
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 10002;
    display: none;
    max-width: 300px;
    animation: tooltipIn 0.3s ease;
}

@keyframes tooltipIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.onboarding-tooltip.show {
    display: block;
}

.tooltip-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.tooltip-arrow.top {
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: var(--border-width-lg) var(--border-width-lg) 0 var(--border-width-lg);
    border-color: white transparent transparent transparent;
}

.tooltip-arrow.bottom {
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 var(--border-width-lg) var(--border-width-lg) var(--border-width-lg);
    border-color: transparent transparent white transparent;
}

.tooltip-arrow.left {
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-width: var(--border-width-lg) 0 var(--border-width-lg) var(--border-width-lg);
    border-color: transparent transparent transparent white;
}

.tooltip-arrow.right {
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-width: var(--border-width-lg) var(--border-width-lg) var(--border-width-lg) 0;
    border-color: transparent white transparent transparent;
}

.tooltip-content {
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.tooltip-content strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Highlight animation for interactive elements during tutorial */
@keyframes tutorialHighlight {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(94, 114, 228, 0.2);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(94, 114, 228, 0.1);
    }
}

.tutorial-highlight {
    animation: tutorialHighlight 2s ease-in-out infinite;
}

/* Mobile responsive onboarding */
@media (max-width: 768px) {
    .onboarding-content {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
        width: auto;
        padding: 1.25rem;
    }

    .onboarding-title {
        font-size: 1.25rem;
    }

    .onboarding-description {
        font-size: 0.9375rem;
    }

    .onboarding-actions {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-buttons {
        width: 100%;
        justify-content: space-between;
    }

    .onboarding-btn {
        flex: 1;
    }
}




