h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNj YuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.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;
}

/* Modern Professional Color Scheme for Students */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Newsreader:ital,opsz,wght@0,6..72,300..800;1,6..72,300..800&display=swap');

:root {
    /* Primary palette - Professional Blue */
    --primary-color: #0066FF;
    --primary-hover: #0052CC;
    --primary-light: #E6F0FF;
    --primary-subtle: #F0F7FF;

    /* Secondary palette - Teal accent */
    --secondary-color: #00B8A9;
    --secondary-hover: #009688;
    --secondary-light: #E0F7F5;

    /* Accent colors */
    --accent-color: #FF6B6B;
    --accent-light: #FFE8E8;

    /* Semantic colors */
    --success-color: #00C853;
    --success-light: #E8F5E9;
    --warning-color: #FF9800;
    --warning-light: #FFF3E0;
    --error-color: #F44336;
    --error-light: #FFEBEE;
    --info-color: #2196F3;
    --info-light: #E3F2FD;

    /* Neutral palette */
    --text-primary: #1A1D21;
    --text-secondary: #5E6C84;
    --text-muted: #8993A4;
    --bg-primary: #ffffff;
    --bg-secondary: #F7F9FC;
    --bg-tertiary: #EDF1F7;
    --bg-card: #ffffff;
    --border-color: #E4E7EB;
    --border-light: #F0F2F5;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

/* When the Maya session page is rendered, suppress body scroll so the only
   scroll containers are the chat (inside .maya-canvas-col) and the notebook
   (inside .maya-notebook-wrap). Eliminates the "third scrollbar" the user
   was seeing on wide screens. Uses :has() — supported in all modern browsers. */
body:has(.maya-page) {
    overflow: hidden;
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #0066FF 0%, #00B8A9 100%);
}

.login-card {
    background: var(--bg-card);
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    max-width: 500px;
    width: 100%;
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #0066FF 0%, #00B8A9 100%);
    color: white;
    padding: 2.5rem 2rem;
    text-align: center;
}

.login-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    opacity: 0.9;
    font-size: 1rem;
}

.login-content {
    padding: 2rem;
}

.login-content h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.login-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.login-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    background: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.login-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.login-btn:active {
    transform: translateY(0);
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.microsoft-btn:hover {
    border-color: #0078d4;
    background-color: #f3f9ff;
}

.google-btn:hover {
    border-color: #4285f4;
    background-color: #f8fbff;
}

.login-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.login-footer p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.login-benefits {
    background: var(--bg-secondary);
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
}

.login-benefits h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.login-benefits ul {
    list-style: none;
    padding: 0;
}

.login-benefits li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.938rem;
}

.loading-container {
    text-align: center;
    margin-top: 1.5rem;
}

.loading-container p {
    color: var(--text-secondary);
    margin-top: 1rem;
}

/* Home Page Styles */
.home-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.hero-section {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 1rem;
    margin-bottom: 3rem;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.tagline {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 1rem;
}

.description {
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.95;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.feature-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.feature-card p {
    color: var(--text-secondary);
}

.cta-section {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-card);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
}

.cta-section h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.cta-button {
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
    padding: 1rem 3rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Onboarding Styles */
.onboarding-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    transition: width 0.3s ease;
}

.onboarding-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
}

.step h2 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-size: 1.75rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.step-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-primary, .btn-secondary, .btn-link {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-link {
    background: transparent;
    color: var(--primary-color);
    padding: 0.5rem;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Dashboard Styles */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-header h1 {
    color: var(--primary-color);
    font-size: 2rem;
}

.profile-completion {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar-small {
    width: 150px;
    height: 6px;
    background: var(--border-color);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill-small {
    height: 100%;
    background: var(--success-color);
    transition: width 0.3s ease;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.dashboard-card {
    background: var(--bg-card);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1.5rem;
}

.card-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.card-content {
    padding: 1.5rem;
}

.card-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.career-list {
    margin: 1rem 0;
}

.career-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.match-score {
    color: var(--success-color);
    font-weight: 600;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-message {
    background: #fee2e2;
    color: var(--error-color);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .login-card {
        margin: 1rem;
    }
}

/* ============================================================
   EssayStory-specific overrides & additions
   ============================================================ */

/* Override primary palette for EssayStory (warm, writerly indigo + amber) */
:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --primary-light: #EEF2FF;
    --primary-subtle: #F5F3FF;
    /* EssayStory brand gradient — used for wordmark, hero, doc headings, login header */
    --es-brand-gradient: linear-gradient(135deg, #F59E0B 0%, #EC4899 55%, #6366F1 100%);

    --secondary-color: #F59E0B;
    --secondary-hover: #D97706;
    --secondary-light: #FEF3C7;

    --accent-color: #EC4899;
    --accent-light: #FCE7F3;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    line-height: 1.25;
    letter-spacing: -0.01em;
    font-weight: 700;
}

p { color: var(--text-secondary); }

/* ----- EssayStory landing page ----- */
.es-hero {
    position: relative;
    overflow: hidden;
    padding: 6rem 2rem 5rem;
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(245,158,11,0.18), transparent 60%),
        radial-gradient(900px 500px at -10% 20%, rgba(79,70,229,0.22), transparent 60%),
        linear-gradient(180deg, #0B1020 0%, #11163A 100%);
    color: white;
    text-align: center;
}

.es-hero .es-eyebrow {
    display: inline-block;
    padding: .4rem 1rem;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    color: #E0E7FF;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
    backdrop-filter: blur(6px);
}

.es-hero h1 {
    font-size: clamp(2.4rem, 5vw, 4rem);
    line-height: 1.08;
    color: white;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.es-hero h1 .grad {
    background: var(--es-brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.es-hero .es-sub {
    font-size: 1.2rem;
    max-width: 720px;
    margin: 0 auto 2rem;
    color: #C7D2FE;
    line-height: 1.6;
}

.es-cta-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.es-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .95rem 1.75rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    border: 0;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.es-btn-primary {
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.es-btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
    color: white;
}

.es-btn-ghost {
    background: rgba(255,255,255,0.08);
    color: white;
    border: 1px solid rgba(255,255,255,0.25);
}

.es-btn-ghost:hover {
    background: rgba(255,255,255,0.14);
    color: white;
}

.es-btn-google {
    background: white;
    color: #1f1f1f;
    border: 1px solid rgba(0,0,0,0.18);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    font-size: 1rem;
    font-weight: 600;
}

.es-btn-google:hover {
    background: #f8f8f8;
    box-shadow: 0 4px 14px rgba(0,0,0,0.16);
    transform: translateY(-1px);
    color: #1f1f1f;
}

.es-cta-band .es-btn-google {
    box-shadow: 0 12px 32px rgba(0,0,0,0.18);
}

.es-cta-band .es-btn-google:hover {
    transform: translateY(-2px);
}

.es-cta-or-link {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    align-self: center;
}

.es-cta-or-link a {
    color: rgba(255,255,255,0.9);
    text-underline-offset: 2px;
}

.es-cta-or-link a:hover {
    color: white;
}

/* Inside the hero the text contrast is dark since es-hero--split may have light backgrounds */
.es-hero-copy .es-cta-or-link {
    color: rgba(255,255,255,0.65);
}

.es-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5rem 2rem;
}

.es-section-head {
    text-align: center;
    margin-bottom: 3rem;
}

.es-section-head h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    margin-bottom: .75rem;
}

.es-section-head p {
    font-size: 1.1rem;
    max-width: 640px;
    margin: 0 auto;
}

.es-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.es-feature {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.es-feature:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.es-feature .es-feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
}

.es-feature h3 {
    font-size: 1.2rem;
    margin-bottom: .5rem;
    color: var(--text-primary);
}

.es-feature p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: .98rem;
}

.es-how {
    background: linear-gradient(180deg, var(--bg-secondary), white);
}

.es-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    counter-reset: step;
}

.es-step {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    position: relative;
}

.es-step::before {
    counter-increment: step;
    content: "0" counter(step);
    position: absolute;
    top: -1rem;
    left: 1.5rem;
    background: var(--primary-color);
    color: white;
    padding: .25rem .75rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: .85rem;
    box-shadow: var(--shadow-md);
}

.es-step h3 {
    margin: .5rem 0 .5rem;
    font-size: 1.1rem;
}

.es-step-optional {
    font-weight: 500;
    font-size: .8rem;
    color: var(--text-secondary, #6b7280);
    margin-left: .35rem;
    letter-spacing: .01em;
}

.es-cta-band {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    padding: 4rem 2rem;
    text-align: center;
    color: white;
}

.es-cta-band h2 {
    color: white;
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    margin-bottom: 1rem;
}

.es-cta-band p {
    color: rgba(255,255,255,0.92);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.es-cta-band .es-btn-primary {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 12px 32px rgba(0,0,0,0.18);
}

.es-cta-band .es-btn-primary:hover {
    color: var(--primary-hover);
    transform: translateY(-2px);
}

/* Hero micro-reassurance row under CTAs */
.es-hero-microreassurance {
    list-style: none;
    padding: 0;
    margin: 1.1rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.88);
}
.es-hero-microreassurance li {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.es-hero-microreassurance li span {
    color: #34D399;
    font-weight: 700;
}

/* Trust band */
.es-trust-band {
    padding: 1rem 1.5rem;
    background: linear-gradient(180deg, #F8FAFC 0%, #EEF2FF 100%);
    border-top: 1px solid #E2E8F0;
    border-bottom: 1px solid #E2E8F0;
}
.es-trust-band-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem 1.6rem;
    max-width: 1100px;
    margin-inline: auto;
    font-size: 0.92rem;
    color: #334155;
    font-weight: 500;
}
.es-trust-band-list li {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}
.es-trust-band-icon {
    font-size: 1.05rem;
    line-height: 1;
}

/* Review-flow section */
.es-reviewflow {
    background: #ffffff;
}
.es-reviewflow-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: 1rem;
    align-items: stretch;
    max-width: 1200px;
    margin-inline: auto;
    padding: 0 1rem;
}
.es-reviewflow-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #E2E8F0;
    border-radius: 18px;
    padding: 1.5rem 1.4rem 1.4rem;
    box-shadow: 0 6px 16px -10px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.es-reviewflow-card h3 {
    margin: 0.3rem 0 0;
    font-size: 1.15rem;
    color: #0F172A;
}
.es-reviewflow-card p {
    margin: 0;
    color: #475569;
    line-height: 1.55;
    font-size: 0.95rem;
}
.es-reviewflow-card--result {
    background: linear-gradient(160deg, #F5F3FF 0%, #EEF2FF 100%);
    border-color: #C7D2FE;
}
.es-reviewflow-badge {
    align-self: flex-start;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.es-reviewflow-badge--ai { background: #DBEAFE; color: #1D4ED8; }
.es-reviewflow-badge--human { background: #FCE7F3; color: #BE185D; }
.es-reviewflow-badge--you { background: #DDD6FE; color: #5B21B6; }
.es-reviewflow-list {
    list-style: none;
    margin: 0.4rem 0 0;
    padding: 0;
    color: #334155;
    font-size: 0.88rem;
}
.es-reviewflow-list li {
    padding: 0.25rem 0 0.25rem 1.2rem;
    position: relative;
}
.es-reviewflow-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #6366F1;
    font-weight: 700;
}
.es-reviewflow-arrow {
    align-self: center;
    font-size: 2rem;
    font-weight: 700;
    color: #94A3B8;
    line-height: 1;
}
@media (max-width: 900px) {
    .es-reviewflow-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .es-reviewflow-arrow {
        transform: rotate(90deg);
        margin: 0.25rem 0;
    }
}

/* FAQ */
.es-faq {
    background: #ffffff;
}
.es-faq-list {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.es-faq-item {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 1rem 1.2rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.es-faq-item[open] {
    background: #ffffff;
    border-color: #C7D2FE;
    box-shadow: 0 6px 16px -10px rgba(99, 102, 241, 0.35);
}
.es-faq-item summary {
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    color: #0F172A;
    font-size: 1.02rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.es-faq-item summary::-webkit-details-marker { display: none; }
.es-faq-item summary::after {
    content: "+";
    font-size: 1.4rem;
    font-weight: 400;
    color: #6366F1;
    line-height: 1;
    transition: transform 0.15s ease;
}
.es-faq-item[open] summary::after { content: "−"; }
.es-faq-item p {
    margin: 0.7rem 0 0;
    color: #475569;
    line-height: 1.55;
}
.es-faq-item p a { color: #6366F1; font-weight: 500; }

/* Closing CTA: first-run mini-list + fineprint */
.es-cta-firstrun {
    list-style: none;
    counter-reset: ctafr;
    padding: 0;
    margin: 1.5rem auto 0;
    max-width: 480px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem 1rem;
    text-align: left;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.92rem;
}
.es-cta-firstrun li {
    counter-increment: ctafr;
    position: relative;
    padding-left: 2rem;
    line-height: 1.3;
}
.es-cta-firstrun li::before {
    content: counter(ctafr);
    position: absolute;
    left: 0;
    top: -0.05rem;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.es-cta-fineprint {
    margin-top: 1.5rem !important;
    font-size: 0.92rem !important;
    color: rgba(255, 255, 255, 0.85) !important;
}
.es-cta-fineprint strong { color: #ffffff; }
@media (max-width: 600px) {
    .es-cta-firstrun { grid-template-columns: 1fr; }
}

/* ----- Header / Layout ----- */
.es-header {
    background: rgba(255,255,255,0.96);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.es-header::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
}

.es-nav-spacer { flex: 1; }

.es-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: .85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.es-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.es-brand .es-brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-block;
    box-shadow: 0 8px 20px rgba(236, 72, 153, 0.28);
    transition: transform .18s ease, box-shadow .18s ease;
}

.es-brand:hover .es-brand-mark {
    transform: translateY(-1px) rotate(-2deg);
    box-shadow: 0 10px 24px rgba(236, 72, 153, 0.36);
}

.es-brand-name .grad {
    background: var(--es-brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-brand-mark {
    display: block;
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    border-radius: 18px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

.es-nav {
    display: flex;
    gap: .25rem;
    align-items: center;
}

.es-nav a {
    padding: .55rem .9rem;
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: .95rem;
}

.es-nav a:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.es-nav a.active {
    background: var(--primary-light);
    color: var(--primary-color);
}

.es-header-right {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.es-user-pill {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .5rem .35rem .85rem;
    background: var(--bg-secondary);
    border-radius: 999px;
    color: var(--text-primary);
    font-size: .92rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background .15s, border-color .15s;
}

.es-user-pill:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.es-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    font-size: .8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.es-signout {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: .5rem .9rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: .9rem;
    transition: all var(--transition-fast);
}

.es-signout:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-light);
}

 .es-signin {
    background: var(--primary-color);
    color: white;
    padding: .55rem 1.1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: .95rem;
}

.es-signin:hover { color: white; transform: translateY(-1px); }

.es-main {
    min-height: calc(100vh - 64px - 80px);
}

.es-footer {
    background: #0B1020;
    color: #94A3B8;
    padding: 2rem;
    margin-top: 4rem;
}

.es-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: .9rem;
}

.es-footer a { color: #CBD5E1; }
.es-footer a:hover { color: white; }

/* ----- Login (override uAppl gradient with EssayStory palette) ----- */
.login-container {
    background: radial-gradient(900px 500px at 20% 10%, rgba(245,158,11,0.25), transparent 60%),
                radial-gradient(1200px 600px at 90% 90%, rgba(236,72,153,0.22), transparent 60%),
                linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
}

.login-header {
    background: var(--es-brand-gradient);
}

.login-header h1 { color: #fff; }
.login-header p { color: rgba(255, 255, 255, 0.92); }

.cta-button {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Tabs row above essays */
.my-stuff-tabs {
    display: flex;
    gap: .5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.my-stuff-tabs .tab {
    padding: .65rem 1.1rem;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.my-stuff-tabs .tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

@media (max-width: 720px) {
    .es-header-inner { flex-wrap: wrap; }
    .es-nav { order: 3; width: 100%; justify-content: center; }
    .es-section { padding: 3rem 1.25rem; }
    .es-hero { padding: 4rem 1.25rem 3.5rem; }
    .es-footer-inner { flex-direction: column; text-align: center; }
}

/* Flat SaaS button polish */
.btn-primary, .es-btn-primary, .cta-button {
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    transition: background-color .15s, box-shadow .15s, transform .05s;
}

.btn-primary:hover:not(:disabled), .es-btn-primary:hover:not(:disabled), .cta-button:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
    transform: none;
}

.btn-primary:active:not(:disabled), .es-btn-primary:active:not(:disabled), .cta-button:active:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.10);
}

.btn-primary:disabled, .es-btn-primary:disabled, .cta-button:disabled {
    background: var(--text-muted);
    border-color: var(--text-muted);
    color: white;
    cursor: not-allowed;
    opacity: .55;
    box-shadow: none;
}

.btn-secondary {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-light);
}

.btn-secondary:active:not(:disabled), .btn-secondary.active {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.es-signin {
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: white;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.es-signin:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: white;
}
/* ----- Footer links ----- */
.es-footer-links {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    flex-wrap: wrap;
}
.es-footer-links a {
    text-decoration: none;
    font-weight: 500;
}
.es-footer-links a:hover { text-decoration: underline; }

/* ----- Static doc pages (About, Privacy) ----- */
.es-doc {
    max-width: 760px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
    color: #1F2937;
}
.es-doc-head { margin-bottom: 2.5rem; }
.es-doc-head .es-eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .75rem;
    font-weight: 700;
    color: #4F46E5;
    margin-bottom: .75rem;
}
.es-doc-head h1 {
    font-size: 2.25rem;
    line-height: 1.15;
    margin: 0 0 1rem;
    font-weight: 700;
    color: #0B1020;
}
.es-doc-head h1 .grad {
    background: var(--es-brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.es-doc-lede {
    font-size: 1.125rem;
    line-height: 1.65;
    color: #475569;
    margin: 0 0 .75rem;
}
.es-doc-meta {
    font-size: .85rem;
    color: #94A3B8;
    margin: .5rem 0 0;
}
.es-doc-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #E5E7EB;
}
.es-doc-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0B1020;
    margin: 0 0 .75rem;
}
.es-doc-section p {
    line-height: 1.7;
    color: #334155;
    margin: 0 0 .75rem;
}
.es-doc-list {
    margin: 0;
    padding-left: 1.25rem;
    line-height: 1.75;
    color: #334155;
}
.es-doc-list li { margin-bottom: .5rem; }
.es-doc-list strong { color: #0B1020; }
.es-doc a {
    color: #4F46E5;
    font-weight: 500;
}

/* ----- Blog ----- */
.es-blog-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}
.es-blog-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 1.25rem 1.35rem;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.es-blog-card:hover {
    border-color: #C7D2FE;
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.08);
    transform: translateY(-1px);
}
.es-blog-card-tag {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #4F46E5;
    background: #EEF2FF;
    border-radius: 999px;
    padding: .2rem .6rem;
    margin-bottom: .6rem;
}
.es-blog-card h2 {
    font-size: 1.15rem;
    line-height: 1.35;
    margin: 0 0 .5rem;
}
.es-blog-card h2 a {
    color: #0B1020;
    text-decoration: none;
    font-weight: 600;
}
.es-blog-card h2 a:hover {
    color: #4F46E5;
}
.es-blog-card-summary {
    color: #475569;
    font-size: .95rem;
    line-height: 1.5;
    margin: 0 0 .75rem;
}
.es-blog-card-meta {
    color: #94A3B8;
    font-size: .8rem;
    margin: 0;
}
.es-blog-post .es-eyebrow a {
    color: inherit;
    font-weight: 500;
    text-decoration: none;
}
.es-blog-post .es-eyebrow a:hover {
    color: #4F46E5;
}
.es-blog-post-next {
    border-top: 1px solid #E2E8F0;
    padding-top: 1rem;
    color: #475569;
}
.es-doc-link {
    display: inline-block;
    font-weight: 600;
}

/* ----- Homepage showcase (screenshot panels) ----- */
.es-showcase {
    background: linear-gradient(180deg, #F8FAFC 0%, #ffffff 100%);
}
.es-shot {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 3rem;
    align-items: center;
    margin: 3rem auto;
    max-width: 1100px;
    padding: 0 1rem;
}
.es-shot.reverse {
    grid-template-columns: 1.4fr 1fr;
}
.es-shot.reverse .es-shot-copy {
    order: 2;
}
.es-shot.reverse .es-shot-frame {
    order: 1;
}
.es-shot-copy h3 {
    font-size: 1.6rem;
    line-height: 1.2;
    margin: .5rem 0 .75rem;
    color: #0B1020;
    font-weight: 700;
}
.es-shot-copy p {
    color: #475569;
    line-height: 1.65;
    font-size: 1.02rem;
}
.es-shot-eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .72rem;
    font-weight: 700;
    color: #4F46E5;
    background: rgba(79, 70, 229, 0.08);
    padding: .35rem .6rem;
    border-radius: 999px;
}
.es-shot-frame {
    display: block;
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #E5E7EB;
    box-shadow: 0 20px 50px -15px rgba(15, 23, 42, 0.25), 0 6px 16px -6px rgba(15, 23, 42, 0.15);
    transition: transform .2s ease, box-shadow .2s ease;
}
.es-shot-frame:hover {
    transform: translateY(-2px);
    box-shadow: 0 28px 60px -18px rgba(15, 23, 42, 0.32), 0 8px 20px -6px rgba(15, 23, 42, 0.18);
}
.es-shot-frame img {
    display: block;
    width: 100%;
    height: auto;
}

@media (max-width: 860px) {
    .es-shot,
    .es-shot.reverse {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin: 2rem auto;
    }
    .es-shot.reverse .es-shot-copy { order: 0; }
    .es-shot.reverse .es-shot-frame { order: 1; }
}

/* ----- Reset button-as-shot-frame ----- */
button.es-shot-frame {
    padding: 0;
    border: 1px solid #E5E7EB;
    cursor: zoom-in;
    width: 100%;
    font: inherit;
    color: inherit;
    text-align: left;
}
button.es-shot-frame:focus-visible {
    outline: 3px solid #818CF8;
    outline-offset: 3px;
}

/* ----- Inline lightbox ----- */
.es-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(11, 16, 32, 0.85);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: zoom-out;
    animation: es-lightbox-in .15s ease-out;
}
@keyframes es-lightbox-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.es-lightbox img {
    max-width: 95vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 30px 80px -10px rgba(0, 0, 0, 0.6);
    cursor: default;
}
.es-lightbox-close {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease;
}
.es-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================================
   Auth — login page + sign-in modal (premium look, EssayStory)
   ============================================================ */
.auth-page {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: clamp(1rem, 4vw, 3rem);
    background:
        radial-gradient(700px 400px at 15% 15%, rgba(245, 158, 11, 0.10), transparent 60%),
        radial-gradient(900px 500px at 95% 90%, rgba(99, 102, 241, 0.10), transparent 60%),
        linear-gradient(180deg, #F8FAFC 0%, #EEF2FF 100%);
}

.auth-shell {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    width: 100%;
    max-width: 1100px;
    min-height: 620px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 30px 80px -20px rgba(15, 23, 42, 0.25), 0 10px 30px -10px rgba(15, 23, 42, 0.15);
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

/* Left hero panel */
.auth-hero {
    position: relative;
    color: #ffffff;
    padding: clamp(2rem, 4vw, 3.5rem);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    background:
        radial-gradient(600px 360px at 20% 10%, rgba(245, 158, 11, 0.55), transparent 55%),
        radial-gradient(700px 400px at 90% 95%, rgba(99, 102, 241, 0.70), transparent 60%),
        linear-gradient(135deg, #1E1B4B 0%, #312E81 50%, #4C1D95 100%);
    isolation: isolate;
}

.auth-hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
}
.auth-hero-blob-a { width: 280px; height: 280px; top: -60px; left: -60px; background: #F59E0B; }
.auth-hero-blob-b { width: 320px; height: 320px; bottom: -80px; right: -80px; background: #EC4899; }
.auth-hero-blob-c { width: 240px; height: 240px; top: 40%; left: 60%; background: #6366F1; opacity: 0.45; }

.auth-hero > *:not(.auth-hero-blob) { position: relative; z-index: 1; }

.auth-hero-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}
.auth-hero-brand img { display: block; border-radius: 10px; }
.auth-hero-brand .grad {
    background: linear-gradient(90deg, #FCD34D, #F9A8D4, #C4B5FD);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-hero-body { margin-top: 2rem; }

.auth-hero-eyebrow {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.20);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    backdrop-filter: blur(6px);
}

.auth-hero-title {
    font-size: clamp(1.7rem, 2.6vw, 2.25rem);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 1rem 0;
    color: #ffffff;
}
.auth-hero-title .grad {
    background: linear-gradient(90deg, #FCD34D, #F9A8D4, #C4B5FD);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-hero-lede {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    line-height: 1.55;
    margin: 0 0 2rem 0;
    max-width: 38ch;
}

.auth-hero-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.auth-hero-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    color: rgba(255, 255, 255, 0.95);
}
.auth-hero-features strong {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: #ffffff;
    line-height: 1.3;
}
.auth-hero-features span:not(.auth-hero-check) {
    display: block;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.85rem;
    line-height: 1.45;
    margin-top: 2px;
}

.auth-hero-check {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F59E0B, #EC4899);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px -2px rgba(236, 72, 153, 0.45);
}

.auth-hero-foot {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    flex-wrap: wrap;
}
.auth-hero-foot a {
    color: #FCD34D;
    text-decoration: none;
    font-weight: 600;
}
.auth-hero-foot a:hover { color: #F9A8D4; }

/* Right card */
.auth-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 4vw, 3rem);
    background: #ffffff;
}
.auth-card-inner {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}
.auth-trust-above {
    margin-top: 0;
    margin-bottom: 0.25rem;
}
.auth-trust-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: #F1F5F9;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid #E2E8F0;
}
.auth-trust-pill svg { color: #6366F1; }

/* Shared panel (used by page + modal) */
.auth-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.auth-panel-head h2 {
    margin: 0 0 0.4rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #0F172A;
    line-height: 1.2;
}
.auth-panel-sub {
    margin: 0;
    color: #64748B;
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
    font-size: 0.875rem;
    line-height: 1.45;
}
.auth-alert-icon { flex-shrink: 0; margin-top: 2px; color: #DC2626; }

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.auth-provider-btn {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
    padding: 1.05rem 1.15rem;
    border-radius: 14px;
    border: 1.5px solid #CBD5E1;
    background: #ffffff;
    color: #0F172A;
    font-size: 1.02rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    text-align: left;
    font-family: inherit;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.auth-provider-btn:hover {
    border-color: #6366F1;
    background: #FAFAFF;
    box-shadow: 0 8px 22px -8px rgba(99, 102, 241, 0.30);
    transform: translateY(-1px);
}
.auth-provider-btn:active { transform: translateY(0); }
.auth-provider-btn:focus-visible {
    outline: 2px solid #6366F1;
    outline-offset: 2px;
}
.auth-provider-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}
.auth-provider-icon svg { width: 22px; height: 22px; }
.auth-provider-label { flex: 1; }

.auth-finewrite {
    margin: 0;
    color: #64748B;
    font-size: 0.8rem;
    line-height: 1.5;
    text-align: center;
}
.auth-finewrite a {
    color: #6366F1;
    text-decoration: none;
    font-weight: 500;
}
.auth-finewrite a:hover { text-decoration: underline; }

/* Primary CTA variant: Google = most common student account, get the visual weight */
.auth-provider-btn-primary {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    border-color: transparent;
    color: #ffffff;
    padding: 1.2rem 1.25rem;
    font-size: 1.06rem;
    box-shadow: 0 10px 24px -10px rgba(99, 102, 241, 0.55), 0 2px 4px rgba(15, 23, 42, 0.06);
}
.auth-provider-btn-primary .auth-provider-icon {
    background: #ffffff;
    border-radius: 8px;
    width: 34px;
    height: 34px;
}
.auth-provider-btn-primary .auth-provider-arrow {
    margin-left: auto;
    font-size: 1.2rem;
    font-weight: 700;
    opacity: 0.9;
    transition: transform 0.15s ease;
}
.auth-provider-btn-primary:hover {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    border-color: transparent;
    box-shadow: 0 14px 30px -10px rgba(99, 102, 241, 0.65), 0 4px 6px rgba(15, 23, 42, 0.08);
}
.auth-provider-btn-primary:hover .auth-provider-arrow { transform: translateX(3px); }
.auth-provider-arrow { display: none; }
.auth-provider-btn-primary .auth-provider-arrow { display: inline-block; }

/* Free-preview banner inside the sign-in panel */
.auth-preview-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #ECFDF5 0%, #F0FDF4 100%);
    border: 1px solid #6EE7B7;
    color: #065F46;
    font-size: 0.9rem;
    line-height: 1.45;
}
.auth-preview-banner-icon {
    font-size: 1.1rem;
    line-height: 1.2;
    flex-shrink: 0;
}
.auth-preview-banner-text strong { color: #047857; }

/* Social proof microline under the buttons */
.auth-socialproof {
    margin: 0;
    text-align: center;
    color: #64748B;
    font-size: 0.82rem;
    font-style: italic;
    line-height: 1.4;
}

/* Modal dialog */
.auth-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: auth-fade-in 0.18s ease-out;
}
.auth-dialog {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 30px 80px -20px rgba(15, 23, 42, 0.55);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: auth-pop-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}
.auth-dialog-close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: #64748B;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.auth-dialog-close:hover { background: #F1F5F9; color: #0F172A; border-color: #E2E8F0; }
.auth-dialog-close:focus-visible { outline: 2px solid #6366F1; outline-offset: 2px; }

.auth-dialog-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    text-align: center;
    padding: 0.25rem 2rem 0;
}
.auth-dialog-mark {
    border-radius: 14px;
    flex-shrink: 0;
    box-shadow: 0 6px 18px -8px rgba(99, 102, 241, 0.35);
}
.auth-dialog-title {
    margin: 0;
    font-family: var(--font-display, 'Newsreader', Georgia, 'Times New Roman', serif);
    font-optical-sizing: auto;
    font-size: 1.6rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: #0F172A;
    line-height: 1.15;
}

.auth-dialog-fallback {
    display: block;
    text-align: center;
    font-size: 0.8rem;
    color: #64748B;
    text-decoration: none;
    padding-top: 0.5rem;
    border-top: 1px solid #F1F5F9;
}
.auth-dialog-fallback:hover { color: #6366F1; }

@keyframes auth-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes auth-pop-in {
    from { opacity: 0; transform: translateY(8px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Responsive: stack on small screens — put the sign-in card ABOVE the hero
   so the CTA is visible without scrolling. */
@media (max-width: 860px) {
    .auth-shell {
        grid-template-columns: 1fr;
        min-height: 0;
    }
    .auth-card {
        order: 1;
    }
    .auth-hero {
        order: 2;
        padding: 2rem 1.5rem;
        min-height: 0;
    }
    .auth-hero-features { gap: 0.75rem; }
    .auth-hero-body { margin-top: 1.5rem; }
    .auth-hero-foot { margin-top: 1.5rem; }
}
@media (max-width: 520px) {
    .auth-page { padding: 0; }
    .auth-shell {
        border-radius: 0;
        box-shadow: none;
        border: 0;
        min-height: 100vh;
    }
    .auth-dialog { padding: 1.5rem; border-radius: 16px; }
}
/* ============================================================
   Hero — split layout (text left, demo storyboard right)
   ============================================================ */
.es-hero--split {
    text-align: left;
}
.es-hero--split .es-hero-copy {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    align-items: flex-start;
}
.es-hero--split .es-hero-copy h1 { margin-bottom: 0; }
.es-hero--split .es-hero-copy .es-sub { margin: 0; max-width: none; }
.es-hero--split .es-cta-row { justify-content: flex-start; }

.es-hero--split {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.1fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
    max-width: 1280px;
    margin: 0 auto;
}
.es-hero-demo { width: 100%; min-width: 0; }

@media (max-width: 980px) {
    .es-hero--split {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .es-hero--split .es-hero-copy { align-items: center; }
    .es-hero--split .es-cta-row { justify-content: center; }
    .es-hero--split .es-hero-copy .es-sub { max-width: 600px; }
}

/* ============================================================
   DemoStoryboard
   ------------------------------------------------------------
   Animation loop = 20s total, 4 scenes of 5s each.
     Scene 1 (0-5s): typing
     Scene 2 (5-10s): save v1
     Scene 3 (10-15s): edit + save v2
     Scene 4 (15-20s): diff + scorecard
   ============================================================ */
.ds-frame { width: 100%; perspective: 1200px; }
.ds-frame.ds-paused *, .ds-frame.ds-reduce * {
    animation-play-state: paused !important;
}

.ds-window {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 520px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow:
        0 30px 60px -20px rgba(15, 23, 42, 0.45),
        0 12px 30px -10px rgba(15, 23, 42, 0.30),
        0 0 0 1px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    transform: rotate(-0.6deg);
    color: #0F172A;
}

/* Browser chrome */
.ds-chrome {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.9rem;
    background: linear-gradient(180deg, #F8FAFC, #EEF2F7);
    border-bottom: 1px solid #E2E8F0;
}
.ds-dot {
    width: 11px; height: 11px; border-radius: 50%;
    display: inline-block;
}
.ds-dot-r { background: #FF5F57; }
.ds-dot-y { background: #FEBC2E; }
.ds-dot-g { background: #28C840; }
.ds-url {
    flex: 1;
    text-align: center;
    font-size: 0.72rem;
    color: #475569;
    background: #ffffff;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: 0.2rem 0.6rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
    margin: 0 0.5rem;
}
.ds-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #F1F5F9;
    color: #334155;
    border-radius: 999px;
    padding: 0.18rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 600;
    position: relative;
    min-width: 80px;
    justify-content: center;
}
.ds-status-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #6366F1;
    animation: ds-pulse 2s ease-in-out infinite;
}
.ds-status-label {
    position: absolute;
    right: 0.55rem;
    opacity: 0;
    animation: ds-label-swap 20s linear infinite;
}
.ds-status-label[data-scene="1"] { animation-delay: 0s; color: #6366F1; }
.ds-status-label[data-scene="2"] { animation-delay: -15s; color: #10B981; }
.ds-status-label[data-scene="3"] { animation-delay: -10s; color: #F59E0B; }
.ds-status-label[data-scene="4"] { animation-delay: -5s; color: #EC4899; }
@keyframes ds-label-swap {
    0%, 22% { opacity: 1; }
    25%, 100% { opacity: 0; }
}
@keyframes ds-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}
.ds-status .ds-status-dot { margin-right: auto; }
/* push the dot left so the swapping label has room */
.ds-status { justify-content: flex-start; padding-right: 4.5rem; }

/* Stage holds all 4 scenes, layered */
.ds-stage {
    position: relative;
    height: calc(100% - 40px);
    padding: 1.25rem 1.5rem;
    background:
        radial-gradient(600px 240px at 100% 0%, rgba(245, 158, 11, 0.06), transparent 60%),
        radial-gradient(600px 240px at 0% 100%, rgba(99, 102, 241, 0.06), transparent 60%),
        #ffffff;
}
.ds-scene {
    position: absolute;
    inset: 1.25rem 1.5rem;
    opacity: 0;
    animation: ds-scene 20s ease-in-out infinite;
}
.ds-scene-1 { animation-delay: 0s; }
.ds-scene-2 { animation-delay: -15s; }
.ds-scene-3 { animation-delay: -10s; }
.ds-scene-4 { animation-delay: -5s; }
@keyframes ds-scene {
    0%       { opacity: 0; transform: translateY(6px); }
    3%, 22%  { opacity: 1; transform: translateY(0); }
    25%, 100%{ opacity: 0; transform: translateY(-6px); }
}

/* --- Essay common --- */
.ds-essay {
    font-family: 'Consolas', 'Courier New', ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #1F2937;
}
.ds-essay-title {
    font-family: var(--font-sans, system-ui, sans-serif);
    font-weight: 700;
    font-size: 0.95rem;
    color: #0F172A;
    margin-bottom: 0.25rem;
}
.ds-essay-meta {
    font-family: var(--font-sans, system-ui, sans-serif);
    font-size: 0.72rem;
    color: #64748B;
    margin-bottom: 1rem;
}
.ds-line, .ds-line-static {
    font-size: 0.88rem;
    line-height: 1.85;
    margin: 0 0 0.6rem 0;
    letter-spacing: 0;
}

/* --- Scene 1: typing (per-character, true keystroke feel) --- */
.ds-typed .ds-w {
    display: inline-block;
    white-space: nowrap;
}
.ds-typed .ds-c {
    display: inline-block;
    opacity: 0;
    animation: ds-char-in 0.04s linear forwards;
}
.ds-typed .ds-c-space::before { content: "\00a0"; }
@keyframes ds-char-in {
    to { opacity: 1; }
}

/* Moving cursor: one tiny flash per character slot. Adjacent slots stitch into
   a continuous cursor that visually follows the typed text. */
.ds-ck {
    display: inline-block;
    width: 0;
    position: relative;
    vertical-align: text-bottom;
    opacity: 0;
    animation: ds-ck-flash 0.028s linear forwards;
}
.ds-ck::before {
    content: "";
    position: absolute;
    left: -1px;
    bottom: 0.05em;
    width: 2px;
    height: 1.05em;
    background: #6366F1;
    border-radius: 1px;
}
@keyframes ds-ck-flash {
    0%, 95% { opacity: 1; }
    100%    { opacity: 0; }
}

/* End-of-text caret: starts hidden, blinks after typing completes */
.ds-caret {
    display: inline-block;
    width: 2px;
    background: #6366F1;
    color: transparent;
    margin-left: 1px;
    vertical-align: text-bottom;
    font-size: 1rem;
    line-height: 1;
    height: 1em;
    opacity: 0;
}
.ds-caret-late {
    animation: ds-caret-appear 0.001s linear forwards, ds-caret-blink 1s steps(1) infinite 0.001s;
}
@keyframes ds-caret-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}
@keyframes ds-caret-appear {
    to { opacity: 1; }
}

/* --- Scene 2 & 3: save button + toast --- */
.ds-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: 10px;
    border: 0;
    background: linear-gradient(135deg, #F59E0B, #EC4899);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.85rem;
    font-family: var(--font-sans, system-ui, sans-serif);
    box-shadow: 0 6px 16px -4px rgba(236, 72, 153, 0.45);
    cursor: default;
}
.ds-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: rgba(255,255,255,0.20);
    font-size: 0.7rem;
}
.ds-btn-glow {
    animation: ds-btn-pulse 0.6s ease-out 0.4s 2;
}
.ds-btn-late { animation-delay: 2.4s; }
@keyframes ds-btn-pulse {
    0%   { box-shadow: 0 6px 16px -4px rgba(236, 72, 153, 0.45), 0 0 0 0 rgba(236, 72, 153, 0.5); transform: scale(1); }
    50%  { box-shadow: 0 6px 16px -4px rgba(236, 72, 153, 0.45), 0 0 0 12px rgba(236, 72, 153, 0); transform: scale(1.04); }
    100% { box-shadow: 0 6px 16px -4px rgba(236, 72, 153, 0.45), 0 0 0 0 rgba(236, 72, 153, 0); transform: scale(1); }
}

.ds-toast {
    position: absolute;
    bottom: 4rem;
    right: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.9rem;
    background: #0F172A;
    color: #ffffff;
    border-radius: 12px;
    font-family: var(--font-sans, system-ui, sans-serif);
    font-size: 0.8rem;
    box-shadow: 0 12px 30px -10px rgba(15, 23, 42, 0.45);
    opacity: 0;
    transform: translateY(8px);
    animation: ds-toast-in 4s ease-out 1s 1 forwards;
}
.ds-toast strong { display: block; font-size: 0.85rem; }
.ds-toast span { color: #94A3B8; font-size: 0.72rem; }
.ds-toast-icon {
    font-size: 1.1rem;
    width: 28px; height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #F59E0B, #EC4899);
    border-radius: 8px;
}
.ds-toast-late { animation-delay: 3s; }
@keyframes ds-toast-in {
    0%   { opacity: 0; transform: translateY(8px); }
    10%  { opacity: 1; transform: translateY(0); }
    85%  { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-4px); }
}

/* --- Scene 3: inline diff markers in the essay text --- */
.ds-del {
    color: #94A3B8;
    text-decoration: line-through;
    background: rgba(244, 63, 94, 0.10);
    border-radius: 3px;
    padding: 0 2px;
    margin-right: 2px;
}
.ds-ins {
    color: #047857;
    background: rgba(16, 185, 129, 0.14);
    border-radius: 3px;
    padding: 0 2px;
    margin-right: 2px;
    text-decoration: none;
    opacity: 0;
    animation: ds-ins-in 0.5s ease-out forwards;
}
.ds-scene-3 .ds-ins:nth-of-type(1) { animation-delay: 0.8s; }
.ds-scene-3 .ds-ins:nth-of-type(2) { animation-delay: 1.5s; }
.ds-scene-3 .ds-ins:nth-of-type(3) { animation-delay: 2.0s; }
@keyframes ds-ins-in {
    from { opacity: 0; transform: translateY(-2px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Scene 4: word stats + per-metric deltas --- */
.ds-diff-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.7rem;
    font-family: var(--font-sans, system-ui, sans-serif);
}
.ds-diff-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.ds-diff-pill-v1 { background: #EEF2FF; color: #4338CA; }
.ds-diff-pill-v2 { background: linear-gradient(135deg, #FEF3C7, #FCE7F3); color: #9D174D; }
.ds-diff-vs { font-size: 0.7rem; color: #94A3B8; font-weight: 600; }

.ds-wordstats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.7rem;
    font-family: var(--font-sans, system-ui, sans-serif);
}
.ds-wordstat {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: #64748B;
}
.ds-wordstat strong {
    font-size: 0.95rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.ds-wordstat-add strong { color: #047857; }
.ds-wordstat-rem strong { color: #B91C1C; }
.ds-wordstat-net strong { color: #4338CA; }

.ds-deltas {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
    font-family: var(--font-sans, system-ui, sans-serif);
}
.ds-delta {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 0.5rem;
    row-gap: 0.15rem;
    padding: 0.5rem 0.65rem;
    background: #ffffff;
    border: 1px solid #E2E8F0;
    border-radius: 9px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    opacity: 0;
    transform: translateY(4px);
    animation: ds-delta-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.ds-scene-4 .ds-delta:nth-of-type(1) { animation-delay: 0.6s; }
.ds-scene-4 .ds-delta:nth-of-type(2) { animation-delay: 0.85s; }
.ds-scene-4 .ds-delta:nth-of-type(3) { animation-delay: 1.10s; }
.ds-scene-4 .ds-delta:nth-of-type(4) { animation-delay: 1.35s; }
@keyframes ds-delta-in {
    to { opacity: 1; transform: translateY(0); }
}
.ds-delta-label {
    grid-column: 1;
    grid-row: 1;
    font-size: 0.68rem;
    font-weight: 600;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ds-delta-vals {
    grid-column: 1;
    grid-row: 2;
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
    font-variant-numeric: tabular-nums;
}
.ds-delta-old { font-size: 0.85rem; color: #94A3B8; font-weight: 600; }
.ds-delta-arr { font-size: 0.7rem; color: #CBD5E1; }
.ds-delta-new { font-size: 1.05rem; font-weight: 700; }
.ds-delta-pill {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.ds-delta-up .ds-delta-new   { color: #047857; }
.ds-delta-up .ds-delta-pill  { background: #D1FAE5; color: #047857; }
.ds-delta-down .ds-delta-new { color: #B91C1C; }
.ds-delta-down .ds-delta-pill{ background: #FEE2E2; color: #B91C1C; }
.ds-delta-flat .ds-delta-pill{ background: #E2E8F0; color: #475569; }

/* Static essay rendering (scenes 2/3) */
.ds-essay-static .ds-line-static {
    font-family: 'Consolas', 'Courier New', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.86rem;
    line-height: 1.85;
    color: #1F2937;
}

/* Small screens: shrink the storyboard */
@media (max-width: 640px) {
    .ds-window { aspect-ratio: 5 / 4; }
    .ds-url { font-size: 0.65rem; max-width: 60%; }
    .ds-scene { inset: 1rem 1rem; }
    .ds-stage { padding: 1rem; }
    .ds-line, .ds-line-static { font-size: 0.82rem; }
    .ds-diff-col { font-size: 0.7rem; padding: 0.55rem 0.6rem; min-height: 110px; }
    .ds-toast { font-size: 0.72rem; bottom: 3.5rem; }
}
/* ============================================================
   Score deltas strip (diff modal — cross-version score deltas)
   ============================================================ */
.score-deltas {
    margin: 1rem 0 1.25rem;
    padding: 1rem 1.1rem;
    background: linear-gradient(180deg, #FAFBFE, #F4F6FB);
    border: 1px solid #E2E8F0;
    border-radius: 12px;
}
.score-deltas-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.7rem;
    flex-wrap: wrap;
}
.score-deltas-title {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #475569;
}
.score-deltas-sub {
    font-size: 0.78rem;
    color: #64748B;
    font-weight: 500;
}
.score-deltas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 0.5rem;
}
.score-delta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.6rem 0.7rem;
    background: #ffffff;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.score-delta-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.score-delta-values {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    font-variant-numeric: tabular-nums;
}
.score-delta-old {
    font-size: 0.95rem;
    color: #94A3B8;
    font-weight: 600;
}
.score-delta-arrow {
    font-size: 0.75rem;
    color: #CBD5E1;
}
.score-delta-new {
    font-size: 1.15rem;
    color: #0F172A;
    font-weight: 700;
}
.score-delta-pill {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.score-delta.up .score-delta-pill   { background: #D1FAE5; color: #047857; }
.score-delta.down .score-delta-pill { background: #FEE2E2; color: #B91C1C; }
.score-delta.flat .score-delta-pill { background: #E2E8F0; color: #475569; }
.score-delta.up .score-delta-new    { color: #047857; }
.score-delta.down .score-delta-new  { color: #B91C1C; }

.score-deltas-empty {
    margin: 1rem 0 1.25rem;
    padding: 0.85rem 1rem;
    background: #F8FAFC;
    border: 1px dashed #CBD5E1;
    border-radius: 10px;
    color: #64748B;
    font-size: 0.85rem;
    text-align: center;
}

/* ============================================================
   Common App countdown ribbon
   ============================================================ */
.es-countdown-ribbon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
    padding: 0.6rem 1.25rem;
    background: linear-gradient(90deg, #FEF3C7 0%, #FCE7F3 50%, #E0E7FF 100%);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    color: #0F172A;
    font-size: 0.92rem;
    text-align: center;
}
.es-countdown-ribbon-icon {
    font-size: 1.05rem;
}
.es-countdown-ribbon-text strong {
    font-weight: 700;
}
.es-countdown-ribbon-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: #0F172A;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.85rem;
    transition: transform 120ms ease, background 120ms ease;
}
.es-countdown-ribbon-cta:hover {
    background: #1E293B;
    transform: translateY(-1px);
}
@media (max-width: 640px) {
    .es-countdown-ribbon { font-size: 0.85rem; padding: 0.55rem 0.85rem; }
}

/* ============================================================
   Hero — jazzed background, stickers, underline, live pill
   ============================================================ */
.es-hero--jazzed {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    /* lift the demo column upward so stickers can peek out the top */
    padding-top: 5.5rem;
}

/* --- Background stack: aurora orbs + grain --- */
.es-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.es-aurora {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.55;
    mix-blend-mode: screen;
    will-change: transform;
}
.es-aurora-1 {
    width: 620px; height: 620px;
    top: -180px; right: -120px;
    background: radial-gradient(circle at 30% 30%, #F59E0B 0%, rgba(245,158,11,0) 65%);
    animation: esAuroraDrift1 22s ease-in-out infinite alternate;
}
.es-aurora-2 {
    width: 540px; height: 540px;
    bottom: -160px; left: -100px;
    background: radial-gradient(circle at 40% 40%, #6366F1 0%, rgba(99,102,241,0) 65%);
    animation: esAuroraDrift2 26s ease-in-out infinite alternate;
}
.es-aurora-3 {
    width: 460px; height: 460px;
    top: 40%; left: 45%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at 50% 50%, #EC4899 0%, rgba(236,72,153,0) 65%);
    opacity: 0.38;
    animation: esAuroraDrift3 30s ease-in-out infinite alternate;
}
@keyframes esAuroraDrift1 {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-60px, 80px) scale(1.12); }
}
@keyframes esAuroraDrift2 {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(80px, -50px) scale(1.18); }
}
@keyframes esAuroraDrift3 {
    0%   { transform: translate(-50%, -50%) scale(1); }
    100% { transform: translate(-40%, -60%) scale(1.2); }
}

/* Subtle SVG grain — tiny inline noise, ~1.5% opacity */
.es-hero-grain {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.06;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.65 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Push hero content above background */
.es-hero--jazzed > .es-hero-copy,
.es-hero--jazzed > .es-hero-demo { position: relative; z-index: 1; }

/* --- Live eyebrow pill --- */
.es-eyebrow--live {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem .85rem .4rem .65rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: none;
    color: #E0E7FF;
    text-decoration: none;
    backdrop-filter: blur(8px);
    transition: all .25s ease;
}
.es-eyebrow--live:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.28);
    transform: translateY(-1px);
}
.es-eyebrow--live .es-eyebrow-tag {
    background: var(--es-brand-gradient);
    color: white;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.es-eyebrow--live .es-eyebrow-text { color: #F8FAFC; }
.es-eyebrow--live .es-eyebrow-arrow {
    color: #A5B4FC;
    transition: transform .25s ease;
}
.es-eyebrow--live:hover .es-eyebrow-arrow { transform: translateX(3px); }
.es-live-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #34D399;
    box-shadow: 0 0 0 0 rgba(52,211,153,0.7);
    animation: esLivePulse 2s ease-out infinite;
}
@keyframes esLivePulse {
    0%   { box-shadow: 0 0 0 0 rgba(52,211,153,0.6); }
    70%  { box-shadow: 0 0 0 8px rgba(52,211,153,0); }
    100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}

/* --- Headline gradient slow shift + SVG underline --- */
.es-headline-grad {
    background: linear-gradient(110deg, #F59E0B 0%, #EC4899 45%, #818CF8 70%, #6366F1 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: esGradShift 9s ease-in-out infinite alternate;
}
/* Inline brand-wordmark echo — used to color "Essay" / "Story" in the hero sub-headline
   with the same gradient as the EssayStory wordmark. */
.es-brand-echo {
    background: var(--es-brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    letter-spacing: -0.005em;
}
@keyframes esGradShift {
    0%   { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}
.es-headline-wrap {
    position: relative;
    display: inline-block;
    padding-bottom: 0.18em;
}
.es-headline-underline {
    position: absolute;
    left: -2%;
    right: -2%;
    bottom: -0.15em;
    width: 104%;
    height: 0.32em;
    overflow: visible;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: esUnderlineDraw 1.6s ease-out 0.4s forwards;
}
@keyframes esUnderlineDraw {
    to { stroke-dashoffset: 0; }
}

/* --- Floating sticker badges around the demo --- */
.es-hero-demo { position: relative; }
.es-sticker {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem .8rem;
    background: white;
    color: #1E293B;
    border-radius: 12px;
    font-size: .8rem;
    font-weight: 600;
    box-shadow:
        0 12px 30px -8px rgba(15,23,42,0.45),
        0 2px 6px rgba(15,23,42,0.18),
        0 0 0 1px rgba(15,23,42,0.05);
    white-space: nowrap;
    z-index: 3;
    transform-origin: center;
}
.es-sticker--score {
    top: -18px;
    left: -22px;
    transform: rotate(-6deg);
    animation: esStickerFloat1 6s ease-in-out infinite;
}
.es-sticker--score .es-sticker-label { color: #64748B; font-weight: 500; }
.es-sticker--score .es-sticker-delta {
    color: #059669;
    background: rgba(16,185,129,0.12);
    padding: .15rem .5rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
}
.es-sticker--saved {
    bottom: 30px;
    left: -34px;
    transform: rotate(4deg);
    animation: esStickerFloat2 7s ease-in-out infinite;
}
.es-sticker--saved .es-sticker-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--es-brand-gradient);
    color: white;
    font-size: .7rem;
    font-weight: 800;
}
.es-sticker--ai {
    top: 22%;
    right: -28px;
    transform: rotate(5deg);
    animation: esStickerFloat3 8s ease-in-out infinite;
}
.es-sticker--ai .es-sticker-ai-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F59E0B, #EC4899);
    box-shadow: 0 0 8px rgba(236,72,153,0.6);
    animation: esLivePulse 2.4s ease-out infinite;
}
@keyframes esStickerFloat1 {
    0%, 100% { transform: rotate(-6deg) translateY(0); }
    50%      { transform: rotate(-6deg) translateY(-8px); }
}
@keyframes esStickerFloat2 {
    0%, 100% { transform: rotate(4deg) translateY(0); }
    50%      { transform: rotate(4deg) translateY(-6px); }
}
@keyframes esStickerFloat3 {
    0%, 100% { transform: rotate(5deg) translateY(0); }
    50%      { transform: rotate(5deg) translateY(-10px); }
}

/* Hide stickers on narrow screens to avoid clipping under the demo */
@media (max-width: 1100px) {
    .es-sticker--score { left: -8px; top: -14px; }
    .es-sticker--ai { right: -10px; }
    .es-sticker--saved { left: -14px; bottom: 18px; }
}
@media (max-width: 720px) {
    .es-sticker { display: none; }
}

/* Reduced motion: stop all hero animations */
@media (prefers-reduced-motion: reduce) {
    .es-aurora,
    .es-headline-grad,
    .es-live-dot,
    .es-sticker,
    .es-sticker--ai .es-sticker-ai-dot,
    .es-headline-underline {
        animation: none !important;
    }
    .es-headline-underline { stroke-dashoffset: 0; }
}


/* ============================================================
   "Why versioning matters" — pain vs. fix split
   ============================================================ */
.es-why { background: linear-gradient(180deg, #FAFAF7 0%, #F5F3FF 100%); }
.es-why-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
    max-width: 1200px;
    margin: 0 auto;
}
@media (max-width: 900px) {
    .es-why-split { grid-template-columns: 1fr; }
}

.es-why-card {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 2rem 2rem 2.25rem;
    box-shadow: 0 14px 40px -18px rgba(15,23,42,0.18), 0 2px 8px rgba(15,23,42,0.05);
    border: 1px solid rgba(15,23,42,0.06);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.es-why-card--pain {
    background: linear-gradient(180deg, #FFFAFC 0%, #FFF5F8 100%);
    border-color: rgba(244,114,182,0.15);
}
.es-why-card--fix {
    background: linear-gradient(180deg, #FAFBFF 0%, #F1F5FE 100%);
    border-color: rgba(99,102,241,0.18);
}

.es-why-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .8rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    align-self: flex-start;
}
.es-why-eyebrow--pain { background: rgba(244,63,94,0.10); color: #BE123C; }
.es-why-eyebrow--fix  { background: rgba(99,102,241,0.10); color: #4338CA; }
.es-why-eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.es-why-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #0F172A;
    margin: 0;
    letter-spacing: -.01em;
}

/* --- Pain: file sprawl --- */
.es-why-files {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    font-family: var(--font-sans, system-ui, sans-serif);
}
.es-why-file {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .55rem .8rem;
    background: white;
    border: 1px solid #FECDD3;
    border-radius: 10px;
    font-size: .85rem;
    color: #475569;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04);
    transition: transform .2s ease;
}
.es-why-file:nth-child(odd) { transform: rotate(-0.35deg); }
.es-why-file:nth-child(even) { transform: rotate(0.4deg); }
.es-why-file-icon { font-size: 1rem; }
.es-why-file--lost {
    border-color: #F472B6;
    background: linear-gradient(90deg, white 0%, #FFF1F5 100%);
    box-shadow: 0 4px 14px -4px rgba(244,114,182,0.35);
}
.es-why-file--lost strong { color: #BE185D; }
.es-why-file-tag {
    margin-left: auto;
    font-size: .72rem;
    color: #DB2777;
    font-style: italic;
    font-weight: 500;
}

/* --- Fix: mini score chart --- */
.es-why-chart {
    background: white;
    border: 1px solid rgba(99,102,241,0.18);
    border-radius: 14px;
    padding: 1.1rem 1.1rem 1rem;
    box-shadow: 0 4px 14px -6px rgba(99,102,241,0.18);
}
.es-why-chart-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .9rem;
    gap: .75rem;
    flex-wrap: wrap;
}
.es-why-chart-title { font-size: .85rem; font-weight: 700; color: #1E293B; }
.es-why-chart-legend {
    font-size: .72rem;
    color: #64748B;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.es-why-chart-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--es-brand-gradient);
}
.es-why-chart-bars {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: .6rem;
    align-items: end;
    height: 150px;
    padding: 0 .25rem;
}
.es-why-bar {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: .35rem;
}
.es-why-bar-val {
    font-size: .75rem;
    font-weight: 700;
    color: #475569;
    font-variant-numeric: tabular-nums;
}
.es-why-bar-fill {
    width: 100%;
    height: var(--bar, 50%);
    background: linear-gradient(180deg, #818CF8 0%, #6366F1 100%);
    border-radius: 6px 6px 2px 2px;
    box-shadow: 0 -2px 6px -2px rgba(99,102,241,0.4);
    transform-origin: bottom;
    animation: es-why-bar-grow 1s cubic-bezier(.2,.8,.2,1) both;
}
.es-why-bar:nth-child(1) .es-why-bar-fill { animation-delay: .05s; }
.es-why-bar:nth-child(2) .es-why-bar-fill { animation-delay: .15s; }
.es-why-bar:nth-child(3) .es-why-bar-fill { animation-delay: .25s; }
.es-why-bar:nth-child(4) .es-why-bar-fill { animation-delay: .35s; }
.es-why-bar:nth-child(5) .es-why-bar-fill { animation-delay: .45s; }
@keyframes es-why-bar-grow {
    from { transform: scaleY(0); opacity: 0; }
    to   { transform: scaleY(1); opacity: 1; }
}
.es-why-bar--dip .es-why-bar-fill {
    background: linear-gradient(180deg, #FCA5A5 0%, #EF4444 100%);
    box-shadow: 0 -2px 6px -2px rgba(239,68,68,0.4);
}
.es-why-bar--dip .es-why-bar-val { color: #B91C1C; }
.es-why-bar--peak .es-why-bar-fill {
    background: linear-gradient(180deg, #34D399 0%, #059669 100%);
    box-shadow: 0 -2px 8px -2px rgba(5,150,105,0.45);
}
.es-why-bar--peak .es-why-bar-val { color: #047857; }
.es-why-bar-lbl {
    font-size: .7rem;
    font-weight: 600;
    color: #94A3B8;
    margin-top: .25rem;
}
.es-why-callout {
    margin-top: .9rem;
    padding: .6rem .8rem;
    background: rgba(99,102,241,0.07);
    border-left: 3px solid #6366F1;
    border-radius: 0 8px 8px 0;
    font-size: .82rem;
    color: #334155;
}
.es-why-callout strong { color: #4338CA; }

/* --- Lists shared by both cards --- */
.es-why-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .65rem;
}
.es-why-list li {
    position: relative;
    padding-left: 1.4rem;
    font-size: .92rem;
    line-height: 1.55;
    color: #334155;
}
.es-why-list li::before {
    content: "✕";
    position: absolute;
    left: 0;
    top: 0;
    color: #F43F5E;
    font-weight: 700;
    font-size: .85rem;
}
.es-why-list--fix li::before {
    content: "✓";
    color: #10B981;
}
.es-why-list strong { color: #0F172A; font-weight: 700; }
.es-why-list em { color: #BE185D; font-style: italic; font-weight: 600; }


/* ============================================================
   ScoreTimeline — across-version score chart in the versions rail
   ============================================================ */
.es-score-timeline {
    background: linear-gradient(180deg, #FAFBFF 0%, #F3F4FE 100%);
    border: 1px solid rgba(99,102,241,0.18);
    border-radius: 12px;
    padding: 0.85rem 0.9rem 0.75rem;
    margin: 0.5rem 1rem 1rem;
    box-shadow: 0 2px 8px -3px rgba(99,102,241,0.15);
}
.es-tl-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.6rem;
    gap: 0.5rem;
}
.es-tl-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1E293B;
    letter-spacing: -0.01em;
}
.es-tl-sub { font-size: 0.7rem; color: #64748B; }

.es-tl-bars {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 0.35rem;
    align-items: end;
    height: 110px;
    padding: 0 0.1rem;
    margin-bottom: 0.65rem;
}
.es-tl-bar {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 0.2rem;
    min-width: 0;
}
.es-tl-val {
    font-size: 0.65rem;
    font-weight: 700;
    color: #475569;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.es-tl-fill {
    width: 100%;
    max-width: 28px;
    height: var(--bar, 50%);
    background: linear-gradient(180deg, #818CF8 0%, #6366F1 100%);
    border-radius: 4px 4px 1px 1px;
    box-shadow: 0 -2px 5px -2px rgba(99,102,241,0.35);
    transform-origin: bottom;
    animation: es-tl-grow 0.7s cubic-bezier(.2,.8,.2,1) both;
}
.es-tl-bar:nth-child(odd)  .es-tl-fill { animation-delay: 0.05s; }
.es-tl-bar:nth-child(even) .es-tl-fill { animation-delay: 0.12s; }
.es-tl-bar:nth-child(n+5)  .es-tl-fill { animation-delay: 0.20s; }
@keyframes es-tl-grow {
    from { transform: scaleY(0); opacity: 0; }
    to   { transform: scaleY(1); opacity: 1; }
}
.es-tl-bar--peak .es-tl-fill {
    background: linear-gradient(180deg, #34D399 0%, #059669 100%);
    box-shadow: 0 -2px 6px -2px rgba(5,150,105,0.45);
}
.es-tl-bar--peak .es-tl-val { color: #047857; }
.es-tl-bar--dip .es-tl-fill {
    background: linear-gradient(180deg, #FCA5A5 0%, #EF4444 100%);
    box-shadow: 0 -2px 5px -2px rgba(239,68,68,0.35);
}
.es-tl-bar--dip .es-tl-val { color: #B91C1C; }
.es-tl-lbl {
    font-size: 0.62rem;
    font-weight: 600;
    color: #94A3B8;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.es-tl-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    border-top: 1px dashed rgba(99,102,241,0.18);
    padding-top: 0.55rem;
}
.es-tl-pill {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: #64748B;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.es-tl-pill:hover { background: rgba(99,102,241,0.08); color: #4338CA; }
.es-tl-pill.active {
    background: white;
    color: #4338CA;
    border-color: rgba(99,102,241,0.35);
    box-shadow: 0 1px 3px rgba(15,23,42,0.06);
}

.es-tl-empty {
    margin: 0.5rem 1rem 1rem;
    padding: 0.85rem 1rem;
    background: #F8FAFC;
    border: 1px dashed #CBD5E1;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.4;
}
.es-tl-empty-icon { font-size: 1.1rem; }


/* ============================================================
   Homepage display typography — Newsreader literary serif
   (scoped to marketing page only; app UI keeps Inter)
   ============================================================ */
:root {
    --font-display: 'Newsreader', 'Georgia', 'Times New Roman', serif;
}

.es-hero h1,
.es-section-head h2,
.es-shot-copy h3,
.es-cta-band h2,
.es-why-title {
    font-family: var(--font-display);
    font-optical-sizing: auto;
    letter-spacing: -0.02em;
    font-weight: 500;
}

.es-hero h1 {
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: -0.025em;
}
.es-hero h1 .grad,
.es-hero h1 .es-headline-grad {
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.02em;
}

.es-section-head h2,
.es-cta-band h2 {
    font-size: clamp(1.95rem, 3.6vw, 2.75rem);
    line-height: 1.12;
    font-weight: 500;
}
.es-shot-copy h3 {
    font-size: clamp(1.4rem, 2.3vw, 1.75rem);
    line-height: 1.2;
    font-weight: 500;
}
.es-why-title {
    font-size: 1.6rem;
    font-weight: 500;
    line-height: 1.18;
}


/* ============================================================
   Essays empty-state — onboarding steps + section title + CTA row
   ============================================================ */
.empty-onboarding {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.5rem auto 2rem;
    max-width: 920px;
    text-align: left;
}
.onboarding-step {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 1rem 1.1rem;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}
.onboarding-step h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.95rem;
    color: #0F172A;
    font-weight: 700;
}
.onboarding-step p {
    margin: 0;
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.5;
}
.onboarding-step p strong { color: #1E293B; font-weight: 600; }
.onboarding-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--es-brand-gradient, linear-gradient(135deg, #F59E0B 0%, #EC4899 55%, #6366F1 100%));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 4px 10px -3px rgba(99,102,241,0.35);
}

.empty-section-title {
    margin: 1.75rem 0 0.85rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6B7280;
}

.empty-cta-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}
.empty-cta-row .btn-secondary {
    padding: 0.95rem 1.5rem;
    border-radius: 0.75rem;
    background: white;
    border: 1px solid #CBD5E1;
    color: #1E293B;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.empty-cta-row .btn-secondary:hover {
    border-color: #818CF8;
    color: #4338CA;
    background: #F8FAFC;
}


/* ============================================================
   Delete confirmation — type-to-confirm input (GitHub-style)
   ============================================================ */
.delete-confirm-field {
    margin-top: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.delete-confirm-field label {
    font-size: 0.875rem;
    color: #334155;
    line-height: 1.5;
}
.delete-confirm-field label strong {
    color: #0F172A;
    font-weight: 700;
    background: #FEF3C7;
    padding: 0.05rem 0.35rem;
    border-radius: 4px;
    word-break: break-word;
}
.delete-confirm-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    background: white;
    color: #0F172A;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.delete-confirm-input:focus {
    outline: none;
    border-color: #EF4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}
.delete-confirm-input::placeholder {
    color: #94A3B8;
    font-style: italic;
}
.modal-footer .btn-danger[disabled],
.modal-footer .btn-danger:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: #9CA3AF;
    border-color: #9CA3AF;
    box-shadow: none;
}
.modal-footer .btn-danger[disabled]:hover,
.modal-footer .btn-danger:disabled:hover {
    background: #9CA3AF;
    transform: none;
}

/* Site-wide Free Preview ending banner */
.es-preview-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    background: linear-gradient(90deg, #FEF3C7 0%, #FDE68A 100%);
    color: #78350F;
    font-size: 14px;
    line-height: 1.4;
    border-bottom: 1px solid #FCD34D;
}
.es-preview-banner-icon { font-size: 18px; line-height: 1; flex-shrink: 0; }
.es-preview-banner-text { flex: 1; }
.es-preview-banner-text strong { color: #78350F; }
.es-preview-banner-link {
    flex-shrink: 0;
    color: #92400E;
    font-weight: 600;
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
    transition: background 0.15s ease;
}
.es-preview-banner-link:hover { background: rgba(255, 255, 255, 0.85); color: #78350F; }
@media (max-width: 640px) {
    .es-preview-banner { flex-wrap: wrap; padding: 10px 14px; font-size: 13.5px; }
    .es-preview-banner-link { margin-left: auto; }
}

/* Homepage Free Preview promo pill */
.es-preview-pill {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0 4px;
    padding: 9px 16px;
    border-radius: 999px;
    background: linear-gradient(90deg, #ECFDF5 0%, #EEF2FF 100%);
    border: 1px solid #A7F3D0;
    text-decoration: none;
    font-size: 14px;
    line-height: 1;
    color: #0F172A;
    box-shadow: 0 4px 14px -6px rgba(16, 185, 129, 0.30);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.es-preview-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px -8px rgba(16, 185, 129, 0.45);
    border-color: #34D399;
}
.es-preview-pill-strike {
    position: relative;
    color: #334155;
    font-weight: 600;
    font-size: 15px;
    padding: 0 2px;
    text-decoration: none;
}
.es-preview-pill-strike::after {
    content: '';
    position: absolute;
    left: -3px;
    right: -3px;
    top: 50%;
    height: 2px;
    background: #DC2626;
    border-radius: 2px;
    transform: translateY(-50%) rotate(-9deg);
    transform-origin: center;
    pointer-events: none;
}
.es-preview-pill-now {
    color: #047857;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.01em;
}
@media (max-width: 520px) {
    .es-preview-pill { font-size: 13px; gap: 9px; padding: 8px 14px; }
    .es-preview-pill-strike, .es-preview-pill-now { font-size: 14px; }
}

/* ===================================================================== */
/* Inline review comments & counselor share dialog (collaboration UI)    */
/* ===================================================================== */
.es-comments-rail {
    width: 320px;
    flex-shrink: 0;
    border-left: 1px solid var(--border-color);
    background: var(--bg-card);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}
.es-comments-header { display: flex; align-items: center; justify-content: space-between; }
.es-comments-header h3 { margin: 0; font-size: 1rem; }
.es-comments-count { background: var(--bg-tertiary); color: var(--text-secondary); padding: 2px 8px; border-radius: 12px; font-size: 0.8rem; }
.es-comment-composer { background: var(--bg-secondary); padding: 10px; border-radius: 8px; display: flex; flex-direction: column; gap: 8px; }
.es-comment-hint { color: var(--text-muted); font-size: 0.85rem; }
.es-comment-anchor-preview { background: #fff; border-left: 3px solid var(--primary-color); padding: 6px 8px; border-radius: 4px; font-size: 0.85rem; }
.es-comment-anchor-label { color: var(--text-muted); margin-right: 4px; }
.es-comment-anchor-text { color: var(--text-primary); font-style: italic; }
.es-comment-input, .es-comment-name-input { width: 100%; padding: 8px; border: 1px solid var(--border-color); border-radius: 6px; font: inherit; }
.es-comment-composer-actions { display: flex; gap: 8px; justify-content: flex-end; }
.es-comments-list { display: flex; flex-direction: column; gap: 10px; }
.es-comments-empty { color: var(--text-muted); font-size: 0.9rem; padding: 12px 0; text-align: center; }
.es-comment-card { background: #fff; border: 1px solid var(--border-color); border-radius: 8px; padding: 10px; }
.es-comment-card.resolved { opacity: 0.65; background: var(--bg-secondary); }
.es-comment-meta { display: flex; gap: 6px; align-items: center; font-size: 0.8rem; color: var(--text-muted); flex-wrap: wrap; }
.es-comment-author { color: var(--text-primary); font-weight: 600; }
.es-comment-role { background: var(--primary-subtle); color: var(--primary-hover); padding: 1px 6px; border-radius: 10px; font-size: 0.7rem; text-transform: uppercase; }
.es-comment-resolved-badge { background: var(--success-light); color: var(--success-color); padding: 1px 6px; border-radius: 10px; font-size: 0.7rem; }
.es-comment-anchor { font-style: italic; color: var(--text-secondary); margin: 6px 0; border-left: 2px solid var(--border-color); padding-left: 8px; font-size: 0.85rem; }
.es-comment-body { margin: 6px 0; color: var(--text-primary); white-space: pre-wrap; }
.es-comment-replies { margin-top: 8px; padding-left: 8px; border-left: 2px solid var(--border-light); display: flex; flex-direction: column; gap: 6px; }
.es-comment-reply { background: var(--bg-secondary); padding: 6px 8px; border-radius: 6px; font-size: 0.9rem; }
.es-comment-actions { display: flex; gap: 4px; margin-top: 6px; }
.es-comment-actions .danger { color: var(--error-color); }
.es-comment-reply-composer { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.es-comment-reply-composer textarea { width: 100%; padding: 6px; border: 1px solid var(--border-color); border-radius: 6px; font: inherit; }

/* Share dialog */
.es-share-modal { max-width: 640px; }
.es-share-intro { color: var(--text-secondary); }
.es-share-form { display: flex; flex-direction: column; gap: 10px; }
.es-share-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; color: var(--text-secondary); }
.es-share-form input[type=text], .es-share-form select { padding: 8px; border: 1px solid var(--border-color); border-radius: 6px; font: inherit; }
.es-share-checkbox { flex-direction: row !important; align-items: center; gap: 8px; }
.es-share-heading { margin-top: 8px; }
.es-share-list { display: flex; flex-direction: column; gap: 10px; }
.es-share-card { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 8px; padding: 10px; }
.es-share-card.inactive { opacity: 0.6; }
.es-share-card-top { display: flex; justify-content: space-between; align-items: center; }
.es-share-label { font-weight: 600; }
.es-share-perm { background: var(--primary-subtle); color: var(--primary-hover); padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; text-transform: uppercase; }
.es-share-url { display: flex; gap: 6px; margin: 8px 0; }
.es-share-url input { flex: 1; padding: 6px; border: 1px solid var(--border-color); border-radius: 6px; font: inherit; background: #fff; }
.es-share-meta { font-size: 0.8rem; color: var(--text-muted); display: flex; gap: 4px; flex-wrap: wrap; }
.es-share-tag { padding: 1px 6px; border-radius: 10px; background: var(--bg-tertiary); }
.es-share-tag.revoked { background: var(--error-light); color: var(--error-color); }
.es-share-tag.expired { background: var(--warning-light); color: var(--warning-color); }

/* Public /share/{token} page */
.es-shared-page { display: flex; flex-direction: column; min-height: 100vh; background: var(--bg-secondary); }
.es-shared-header { padding: 16px 24px; background: #fff; border-bottom: 1px solid var(--border-color); display: flex; gap: 24px; align-items: baseline; }
.es-shared-brand a { font-family: 'Fraunces', serif; font-size: 1.4rem; color: var(--primary-color); text-decoration: none; }
.es-shared-title h1 { margin: 0; font-size: 1.4rem; }
.es-shared-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }
.es-shared-perm { background: var(--primary-subtle); color: var(--primary-hover); padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; text-transform: uppercase; }
.es-shared-body { display: flex; flex: 1; }
.es-shared-main { flex: 1; padding: 32px; max-width: 760px; margin: 0 auto; }
.es-shared-essay { background: #fff; padding: 32px; border-radius: 12px; box-shadow: var(--shadow-sm); line-height: 1.7; font-family: 'Newsreader', Georgia, serif; font-size: 1.05rem; white-space: pre-wrap; word-wrap: break-word; cursor: text; }
.es-shared-essay p { margin: 0 0 1em 0; }
/* Readonly textarea used on the public share page. Same look + font as the
   author's editor so reviewers see the essay exactly as the writer does, and
   selection uses native textarea behavior (no Edge "Search/Copilot" AI
   selection toolbar). */
.es-shared-textarea {
    width: 100%;
    min-height: 60vh;
    box-sizing: border-box;
    background: #fff;
    color: #1F2937;
    padding: 32px;
    border: 0;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    font-family: 'Consolas', 'Courier New', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 15px;
    line-height: 1.85;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: none;
    resize: none;
    cursor: text;
}
.es-shared-textarea:focus { outline: 2px solid #c7d2fe; outline-offset: 2px; }
.es-shared-hint { background: #eef2ff; color: #3730a3; padding: 8px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 0.85rem; border: 1px solid #c7d2fe; }
.es-shared-rail { width: 340px; flex-shrink: 0; border-left: 1px solid var(--border-color); background: #fff; padding: 16px; overflow-y: auto; }

/* Composer buttons inside the share page rail (and the owner's notes panel
   when shown elsewhere). The global .es-btn-ghost is white-on-dark for the
   hero band; here we need it readable on a light card. Pill-shape matches
   the rest of the review UX. */
.es-comment-composer-actions .es-btn-primary,
.es-comment-composer-actions .es-btn-ghost,
.es-comment-actions .es-btn-primary,
.es-comment-actions .es-btn-ghost {
    padding: 5px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 999px;
    line-height: 1.3;
    cursor: pointer;
    transition: background-color .12s, color .12s, border-color .12s, box-shadow .12s;
}
.es-comment-composer-actions .es-btn-primary,
.es-comment-actions .es-btn-primary {
    background: #4f46e5;
    border: 1px solid #4f46e5;
    color: white;
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.18);
}
.es-comment-composer-actions .es-btn-primary:hover:not(:disabled),
.es-comment-actions .es-btn-primary:hover:not(:disabled) {
    background: #4338ca;
    border-color: #4338ca;
    box-shadow: 0 2px 6px rgba(67, 56, 202, 0.28);
}
.es-comment-composer-actions .es-btn-ghost,
.es-comment-actions .es-btn-ghost {
    background: #f8fafc;
    color: #334155;
    border: 1px solid #e2e8f0;
}
.es-comment-composer-actions .es-btn-ghost:hover,
.es-comment-actions .es-btn-ghost:hover {
    background: #eef2f7;
    color: #1e293b;
    border-color: #cbd5e1;
}
.es-comment-composer-actions .es-btn-ghost.danger,
.es-comment-actions .es-btn-ghost.danger { color: #b91c1c; border-color: #fecaca; }
.es-comment-composer-actions .es-btn-ghost.danger:hover,
.es-comment-actions .es-btn-ghost.danger:hover { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }

/* Comment anchor visual highlight (pulses when "Show in text" clicked) */
@keyframes es-anchor-pulse-kf {
    0%   { box-shadow: 0 0 0 0 rgba(255, 213, 79, 0.0); background-color: transparent; }
    20%  { box-shadow: 0 0 0 4px rgba(255, 213, 79, 0.55); background-color: rgba(255, 249, 196, 0.6); }
    100% { box-shadow: 0 0 0 0 rgba(255, 213, 79, 0.0); background-color: transparent; }
}
.es-anchor-pulse {
    animation: es-anchor-pulse-kf 1.3s ease-out;
}

.es-comment-card.orphan {
    border-left-color: #b58900;
    background: rgba(255, 248, 220, 0.6);
}
.es-comment-orphan-badge {
    background: #fff3cd;
    color: #8a6d3b;
    border: 1px solid #f0d878;
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 6px;
}

/* Global modal styles (for components outside Pages/, e.g. ShareDialog).
   Pages/Essays.razor and Pages/EssayDetail.razor have their own scoped copies
   so this only takes effect for unscoped components. */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}
.modal-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}
.modal-header h2 { margin: 0; font-size: 1.1rem; font-weight: 600; color: #111827; }
.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1 1 auto;
}
.close-btn {
    background: transparent;
    border: 0;
    font-size: 1.5rem;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
}
.close-btn:hover { background: #f3f4f6; color: #111827; }

/* ShareDialog form layout tweaks */
.es-share-modal { max-width: 720px; }
.es-share-form { display: flex; flex-direction: column; gap: 0.75rem; }
.es-share-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: #374151; }
.es-share-form input[type=text], .es-share-form select {
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
}
.es-share-form .es-share-checkbox { flex-direction: row; align-items: center; gap: 8px; }
.es-share-form .es-btn-primary { align-self: flex-start; margin-top: 4px; }

/* Share dialog buttons — same pill styling as the other panels (the global
   .es-btn-* is sized/colored for the dark hero band). */
.es-share-form .es-btn-primary,
.es-share-actions .es-btn-ghost,
.es-share-url .es-btn-ghost,
.es-share-card-top .es-btn-ghost {
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 999px;
    line-height: 1.3;
    cursor: pointer;
    transition: background-color .12s, color .12s, border-color .12s, box-shadow .12s;
}
.es-share-form .es-btn-primary {
    background: #4f46e5;
    border: 1px solid #4f46e5;
    color: white;
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.18);
}
.es-share-form .es-btn-primary:hover:not(:disabled) {
    background: #4338ca;
    border-color: #4338ca;
    box-shadow: 0 2px 6px rgba(67, 56, 202, 0.28);
}
.es-share-actions .es-btn-ghost,
.es-share-url .es-btn-ghost,
.es-share-card-top .es-btn-ghost {
    background: #f8fafc;
    color: #334155;
    border: 1px solid #e2e8f0;
}
.es-share-actions .es-btn-ghost:hover,
.es-share-url .es-btn-ghost:hover,
.es-share-card-top .es-btn-ghost:hover {
    background: #eef2f7;
    color: #1e293b;
    border-color: #cbd5e1;
}
.es-share-actions .es-btn-ghost.danger,
.es-share-card-top .es-btn-ghost.danger { color: #b91c1c; border-color: #fecaca; }
.es-share-actions .es-btn-ghost.danger:hover,
.es-share-card-top .es-btn-ghost.danger:hover { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }
.es-share-intro { font-size: 0.85rem; color: #6b7280; margin: 0 0 0.75rem 0; }
.es-share-heading { font-size: 0.95rem; margin: 0.5rem 0 0.75rem 0; }
/* Breathing room around the section divider so the Create button doesn't
   collide with the "Active links" rule. */
.es-share-form + hr,
.modal-body hr { margin: 1.5rem 0 1.25rem 0; border: 0; border-top: 1px solid var(--border-light); }
.es-share-card-top { display: flex; justify-content: flex-start; align-items: center; gap: 8px; margin-bottom: 6px; }
.es-share-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.es-share-perm { font-size: 0.7rem; background: #eef2ff; color: #4338ca; padding: 2px 8px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.4px; flex-shrink: 0; }
.es-share-revoke { padding: 3px 10px !important; font-size: 0.72rem !important; flex-shrink: 0; }
.es-share-list { display: flex; flex-direction: column; gap: 0.75rem; }
.es-share-card { border: 1px solid #e5e7eb; border-radius: 8px; padding: 0.75rem; background: #fafafa; }
.es-share-card.inactive { opacity: 0.65; }
.es-share-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.es-share-label { font-weight: 600; color: #111827; }
.es-share-perm { font-size: 0.75rem; background: #eef2ff; color: #4338ca; padding: 2px 8px; border-radius: 10px; }
.es-share-url { display: flex; gap: 6px; margin-bottom: 6px; }
.es-share-url input { flex: 1; padding: 6px 8px; border: 1px solid #d1d5db; border-radius: 6px; font-family: monospace; font-size: 0.8rem; background: #fff; }
.es-share-meta { font-size: 0.75rem; color: #6b7280; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.es-share-tag { padding: 1px 8px; border-radius: 10px; font-weight: 600; }
.es-share-tag.revoked { background: #fee2e2; color: #b91c1c; }
.es-share-tag.expired { background: #f3f4f6; color: #6b7280; }
.es-share-actions { margin-top: 6px; display: flex; justify-content: flex-end; }
.es-share-empty { font-size: 0.85rem; color: #6b7280; padding: 0.5rem 0; }

/* ---------------- Feedback rail (combined scorecard + AI suggestions + notes) ---------------- */
.es-feedback-rail {
    width: 380px;
    flex-shrink: 0;
    border-left: 1px solid #e5e7eb;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 64px);
    overflow: hidden;
}
.es-feedback-rail .es-rail-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1rem; border-bottom: 1px solid #e5e7eb; background: #fff;
}
.es-feedback-rail .es-rail-header h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.es-feedback-panel { flex: 1; overflow-y: auto; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.75rem; }

.es-feedback-scorecard {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    padding: 0.75rem; display: flex; gap: 0.75rem; align-items: center;
}
.es-feedback-scorecard .es-score-circle {
    width: 64px; height: 64px; border-radius: 50%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; flex-shrink: 0;
}
.es-feedback-scorecard .es-score-circle.score-excellent { background: #10b981; }
.es-feedback-scorecard .es-score-circle.score-good { background: #3b82f6; }
.es-feedback-scorecard .es-score-circle.score-fair { background: #f59e0b; }
.es-feedback-scorecard .es-score-circle.score-poor { background: #ef4444; }
.es-feedback-scorecard .es-score-value { font-size: 1.25rem; line-height: 1; }
.es-feedback-scorecard .es-score-label { font-size: 0.65rem; opacity: 0.9; }
.es-score-breakdown.compact { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.es-score-breakdown.compact .es-score-row {
    display: grid; grid-template-columns: 64px 1fr 28px;
    align-items: center; gap: 6px; font-size: 0.75rem; color: #374151;
}
.es-score-breakdown.compact .es-score-bar {
    height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden;
}
.es-score-breakdown.compact .es-score-bar-fill {
    height: 100%; background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

.es-feedback-locked, .es-feedback-runrow {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    padding: 0.75rem; display: flex; gap: 0.5rem; align-items: center; justify-content: center;
    flex-direction: column; text-align: center; font-size: 0.85rem;
}
.es-feedback-runrow { flex-direction: row; }

/* Run Auto Review / Refresh sit in the same runrow card. Give them a tidy
   pill treatment so the primary CTA doesn't read as a flat purple square and
   the secondary doesn't fall through to unstyled. */
.es-feedback-runrow .es-btn-primary,
.es-feedback-runrow .es-btn-secondary {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 999px;
    line-height: 1.2;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.es-feedback-runrow .es-btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: 1px solid #6366f1;
    color: #fff;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.30);
}
.es-feedback-runrow .es-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-color: #4f46e5;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
}
.es-feedback-runrow .es-btn-primary:active:not(:disabled) { transform: translateY(0); }
.es-feedback-runrow .es-btn-primary:disabled {
    background: #c7c9d6;
    border-color: #c7c9d6;
    color: #fff;
    cursor: not-allowed;
    box-shadow: none;
    opacity: .7;
}
.es-feedback-runrow .es-btn-secondary {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
}
.es-feedback-runrow .es-btn-secondary:hover:not(:disabled) {
    border-color: #6366f1;
    color: #4f46e5;
    background: #eef2ff;
}
.es-feedback-runrow .es-btn-secondary:disabled {
    color: #9ca3af;
    background: #f9fafb;
    cursor: not-allowed;
    opacity: .8;
}

.es-feedback-composer {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 0.6rem;
    display: flex; flex-direction: column; gap: 6px;
}
.es-feedback-composer .es-comment-input {
    width: 100%; padding: 6px 8px; border: 1px solid #d1d5db; border-radius: 6px;
    font-family: inherit; font-size: 0.85rem; resize: vertical;
}
.es-feedback-composer .es-comment-composer-actions { display: flex; justify-content: flex-end; gap: 6px; }
.es-feedback-hint { color: #6b7280; font-size: 0.8rem; padding: 0.25rem 0.5rem; }

.es-feedback-tabs { display: flex; gap: 4px; border-bottom: 1px solid #e5e7eb; padding-bottom: 4px; }
.es-feedback-tab {
    background: transparent; border: 0; padding: 5px 9px; font-size: 0.75rem;
    color: #6b7280; cursor: pointer; border-radius: 6px 6px 0 0;
}
.es-feedback-tab.active { background: #fff; color: #111827; font-weight: 600; border: 1px solid #e5e7eb; border-bottom: 0; }

.es-feedback-list { display: flex; flex-direction: column; gap: 8px; }
.es-feedback-empty { color: #9ca3af; font-size: 0.85rem; padding: 1rem; text-align: center; }

.es-feedback-card {
    background: #fff; border: 1px solid #e5e7eb; border-left: 4px solid #d1d5db;
    border-radius: 8px; padding: 0.6rem 0.75rem; font-size: 0.85rem;
    display: flex; flex-direction: column; gap: 6px;
}
.es-feedback-card.note { border-left-color: #ca8a04; }
.es-feedback-card.note.orphan { background: rgba(255, 248, 220, 0.6); }
.es-feedback-card.note.resolved { opacity: 0.65; }
.es-feedback-card.ai { border-left-color: #2563eb; }
.es-feedback-card.ai.accepted { border-left-color: #10b981; opacity: 0.65; }
.es-feedback-card.ai.rejected { border-left-color: #94a3b8; opacity: 0.55; }
.es-feedback-card.auto { border-left-color: #2563eb; }
.es-feedback-card.auto.accepted { border-left-color: #10b981; opacity: 0.65; }
.es-feedback-card.auto.rejected { border-left-color: #94a3b8; opacity: 0.55; }

.es-feedback-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 0.75rem; color: #6b7280; }
.es-feedback-badge { padding: 1px 7px; border-radius: 10px; font-weight: 600; font-size: 0.7rem; }
.es-feedback-badge.ai { background: #dbeafe; color: #1d4ed8; }
.es-feedback-badge.auto { background: #dbeafe; color: #1d4ed8; }
.es-feedback-badge.note { background: #fef3c7; color: #92400e; }

/* Secondary button (global, used inside shared Components/) */
.es-btn-secondary {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #111827;
    border-radius: 8px;
    padding: .55rem 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.es-btn-secondary:hover:not(:disabled) {
    border-color: #4338ca;
    color: #4338ca;
    background: #eef2ff;
}
.es-btn-secondary:disabled { opacity: .55; cursor: not-allowed; }
.es-btn-secondary.active { background: #eef2ff; border-color: #4338ca; color: #4338ca; }
.es-btn-primary.small { padding: 4px 10px; font-size: .75rem; }
.es-feedback-type { color: #6b7280; }
.es-feedback-sev { padding: 1px 6px; border-radius: 8px; font-size: 0.7rem; font-weight: 600; }
.es-feedback-sev.sev-high { background: #fee2e2; color: #991b1b; }
.es-feedback-sev.sev-medium { background: #fef3c7; color: #92400e; }
.es-feedback-sev.sev-low { background: #e0e7ff; color: #3730a3; }

.es-feedback-diff { display: flex; flex-direction: column; gap: 2px; font-size: 0.78rem; }
.es-feedback-orig { background: #fee2e2; color: #7f1d1d; padding: 4px 6px; border-radius: 4px; text-decoration: line-through; }
.es-feedback-arrow { color: #6b7280; padding-left: 4px; }
.es-feedback-sugg { background: #dcfce7; color: #14532d; padding: 4px 6px; border-radius: 4px; }
.es-feedback-body { color: #1f2937; line-height: 1.4; }
.es-feedback-status { color: #6b7280; font-size: 0.75rem; font-style: italic; }
.es-feedback-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }

/* Button styling scoped to feedback cards so they read well on a white
   card background (the global .es-btn-ghost uses white text for the dark
   hero band, which is invisible here). Pill-shaped, compact. */
.es-feedback-actions .es-btn-primary,
.es-feedback-actions .es-btn-ghost {
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 999px;
    line-height: 1.3;
    cursor: pointer;
    transition: background-color .12s, color .12s, border-color .12s, box-shadow .12s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
/* Accept = positive primary (green) so it doesn't read as a generic purple square. */
.es-feedback-actions .es-btn-primary {
    background: #16a34a;
    border: 1px solid #16a34a;
    color: white;
    box-shadow: 0 1px 2px rgba(22, 163, 74, 0.18);
}
.es-feedback-actions .es-btn-primary:hover:not(:disabled) {
    background: #15803d;
    border-color: #15803d;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.28);
}
.es-feedback-actions .es-btn-primary.small { padding: 4px 12px; font-size: 0.78rem; }

/* Ghost = neutral on light background, dark text, hairline border. */
.es-feedback-actions .es-btn-ghost {
    background: #f8fafc;
    color: #334155;
    border: 1px solid #e2e8f0;
}
.es-feedback-actions .es-btn-ghost:hover {
    background: #eef2f7;
    color: #1e293b;
    border-color: #cbd5e1;
}
/* Destructive ghost (Dismiss / Delete) — red text + red-tinged hover. */
.es-feedback-actions .es-btn-ghost.danger,
.es-feedback-actions .es-btn-ghost.dismiss {
    color: #b91c1c;
    border-color: #fecaca;
}
.es-feedback-actions .es-btn-ghost.danger:hover,
.es-feedback-actions .es-btn-ghost.dismiss:hover {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fca5a5;
}

/* AI inline highlights in mirror overlay, severity-based (red/amber/green/blue).
   The mirror layer is behind the textarea so color: transparent keeps the
   actual glyphs from the textarea visible — only the background tints show.
   font/padding/line-height inherit so the mark layout matches the textarea
   character-for-character (no glyph drift). */
.es-textarea-mirror .es-anchor-mark,
.es-textarea-mirror mark.es-anchor-mark.ai {
    font: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    padding: 0;
    margin: 0;
    border: 0;
    vertical-align: baseline;
    color: transparent;
    background: transparent; /* override browser-default <mark> yellow */
    border-radius: 2px;
    box-shadow: none;
    /* Mirror itself has pointer-events: none so the textarea catches edits.
       Marks opt back in so we can show a pointer cursor + capture clicks
       (routed to Blazor via essayStory.bindAnchorClicks). */
    pointer-events: auto;
    cursor: pointer;
}
.es-textarea-mirror .es-anchor-mark.note { background: rgba(250, 204, 21, 0.32); }
.es-textarea-mirror .es-anchor-mark.pending {
    background: rgba(250, 204, 21, 0.55);
    outline: 1px dashed #a16207;
    outline-offset: 0;
    pointer-events: none; /* draft selection isn't clickable */
    cursor: default;
}
.es-textarea-mirror .es-anchor-mark.ai { background: rgba(59, 130, 246, 0.22); }
.es-textarea-mirror .es-anchor-mark.ai.sev-error { background: rgba(239, 68, 68, 0.28); }
.es-textarea-mirror .es-anchor-mark.ai.sev-warning { background: rgba(245, 158, 11, 0.28); }
.es-textarea-mirror .es-anchor-mark.ai.sev-suggestion { background: rgba(34, 197, 94, 0.28); }
.es-textarea-mirror .es-anchor-mark.ai.sev-info { background: rgba(59, 130, 246, 0.22); }

/* Stale mode: draft has changed since the last review so highlight offsets
   may be off. Mute the marks so the user sees they're approximate; save the
   draft to re-anchor via prefix/suffix. */
.es-textarea-mirror.stale .es-anchor-mark { opacity: 0.35; outline: 1px dashed rgba(100, 116, 139, 0.6); cursor: help; }

/* Active anchor (clicked highlight) — solid outline so the reader can tell
   at a glance which highlight goes with the connector line and active card. */
.es-textarea-mirror .es-anchor-mark.active {
    outline: 2px solid #4338ca;
    outline-offset: 1px;
    border-radius: 3px;
}

/* Active Feedback card — matching outline + subtle lift. */
.es-feedback-card.active {
    outline: 2px solid #4338ca;
    outline-offset: -1px;
    box-shadow: 0 6px 16px rgba(67, 56, 202, 0.18);
    background: #eef2ff;
}

/* Show/hide highlights toggle styling so it doesn't blend into surrounding text. */
.es-share-icon { display: inline-block; vertical-align: -2px; margin-right: 4px; }
.es-toggle-highlights {
    font-size: .78rem;
    padding: .25rem .55rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-secondary);
}
.es-toggle-highlights:hover { background: var(--bg-tertiary); color: var(--text-primary); }

/* Pulse a Feedback card briefly when the user clicks its anchor in the editor. */
.es-feedback-card.es-card-pulse {
    animation: es-card-pulse 1.4s ease;
}
@keyframes es-card-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(67, 56, 202, 0.55); }
    40%  { box-shadow: 0 0 0 6px rgba(67, 56, 202, 0.0); }
    100% { box-shadow: 0 0 0 0 rgba(67, 56, 202, 0.0); }
}

/* Floating "Feedback" tab button when rail is collapsed */
.es-feedback-tab-button {
    position: fixed; right: 0; top: 50%; transform: translateY(-50%);
    background: #4338ca; color: #fff; border: 0; padding: 14px 8px;
    border-radius: 6px 0 0 6px; cursor: pointer; writing-mode: vertical-rl;
    text-orientation: mixed; font-weight: 600; box-shadow: -2px 0 8px rgba(0,0,0,0.1);
    z-index: 10;
}
.es-feedback-tab-button:hover { background: #3730a3; }

@media (max-width: 1280px) {
    .es-feedback-rail { width: 320px; }
}
@media (max-width: 960px) {
    .es-feedback-rail {
        position: fixed; top: 64px; right: 0; height: calc(100vh - 64px);
        width: 90vw; max-width: 380px; z-index: 50; box-shadow: -8px 0 24px rgba(0,0,0,0.15);
    }
}
