/**
 * TalkStock Login Page — Professional Financial Product
 * =====================================================
 * Split layout: dark hero with live demo + clean form section
 * Design language: Stripe/Notion inspired, warm amber accent
 */

/* ==================== Reset & Base ==================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--brand-font-family, 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    line-height: 1.6;
}

/* ==================== Container ==================== */
.login-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    animation: loginFadeIn 0.5s ease-out;
}

@keyframes loginFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==================== Hero Section ==================== */
.login-hero {
    width: 100%;
    height: 32vh;
    min-height: 200px;
    max-height: 300px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, #1C1410 0%, #2A180C 30%, #1A0F08 65%, #0C0806 100%);
}

.hero-content {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Warm ambient gradient overlay */
.hero-content::before {
    content: '';
    position: absolute;
    top: -60%;
    left: -40%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 25% 40%, var(--color-accent-subtle) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 60%, var(--color-accent-muted) 0%, transparent 45%);
    animation: heroGlow 10s ease-in-out infinite alternate;
}

/* Bottom accent line — subtle warm gradient */
.hero-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent 10%, rgba(249, 115, 22, 0.3) 30%, rgba(249, 115, 22, 0.5) 50%, rgba(249, 115, 22, 0.3) 70%, transparent 90%);
}

@keyframes heroGlow {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.5;
    }
    100% {
        transform: translate(4%, -2%) scale(1.05);
        opacity: 0.8;
    }
}

/* ==================== Hero Brand Content ==================== */
.hero-brand {
    position: relative;
    z-index: 2;
    display: none; /* Hidden on mobile, shown on desktop */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    margin: 0 auto;
    width: 90%;
    max-width: 900px;
    height: 100%;
    animation: heroBrandIn 0.7s ease-out 0.2s both;
}

@keyframes heroBrandIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Mobile hero logo */
.hero-logo-mobile {
    height: 36px;
    width: auto;
    position: relative;
    z-index: 2;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

/* ==================== Language Switcher ==================== */
.login-lang-switcher {
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 100;
}

.login-lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--color-border-default);
    border-radius: 8px;
    background: var(--color-bg-secondary);
    color: var(--color-text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.login-lang-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-text-primary);
}

.login-lang-btn.open {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.login-lang-chevron {
    transition: transform 0.2s;
}

.login-lang-btn.open .login-lang-chevron {
    transform: rotate(180deg);
}

.login-lang-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 140px;
    background: var(--color-bg-primary, #fff);
    border: 1px solid var(--color-border-default);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    overflow: hidden;
}

.login-lang-dropdown.open {
    opacity: 1;
    visibility: visible;
}

.login-lang-option {
    display: block;
    width: 100%;
    padding: 9px 16px;
    font-size: 13px;
    color: var(--color-text-secondary);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: all 0.12s;
    font-family: inherit;
}

.login-lang-option:hover {
    background: var(--color-accent-muted, rgba(249, 115, 22, 0.08));
    color: var(--color-text-primary);
}

.login-lang-option.active {
    color: var(--color-accent);
    font-weight: 600;
}

/* Dark theme */
[data-theme="dark"] .login-lang-btn {
    background: transparent;
    border-color: var(--color-border-default);
}

[data-theme="dark"] .login-lang-dropdown {
    background: var(--color-bg-tertiary);
    border-color: var(--color-border-default);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .login-lang-option:hover {
    background: var(--color-bg-hover);
}

/* ==================== Form Section ==================== */
.login-form-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px 48px;
    background: var(--color-bg-secondary);
    position: relative;
}

/* Subtle left edge shadow for depth separation from hero */
@media (min-width: 768px) {
    .login-form-section::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 1px;
        background: rgba(0, 0, 0, 0.06);
        box-shadow: -4px 0 16px rgba(0, 0, 0, 0.03);
    }
}

.login-form-wrapper {
    width: 100%;
    max-width: 440px;
    animation: formSlideUp 0.5s ease-out 0.1s both;
}

@keyframes formSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== Logo (Desktop) ==================== */
.login-logo {
    display: none;
    height: 64px;
    width: auto;
    margin-bottom: 32px;
}

/* ==================== Typography ==================== */
.login-heading {
    font-size: 36px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 10px;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.login-subheading {
    font-size: 17px;
    color: var(--color-text-tertiary, var(--color-text-secondary));
    margin-bottom: 28px;
    line-height: 1.6;
    letter-spacing: 0.01em;
}

/* ==================== Google OAuth Button ==================== */
.btn-oauth-google {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 24px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-default);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.btn-oauth-google:hover {
    background: var(--color-bg-secondary);
    border-color: var(--color-border-strong);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.btn-oauth-google:focus-visible {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.08);
}

.btn-oauth-google:active {
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
    background: var(--color-bg-tertiary, var(--color-bg-secondary));
}

.btn-oauth-google svg {
    flex-shrink: 0;
}

/* ==================== Divider ==================== */
.login-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    gap: 16px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--color-border-default), transparent);
}

.login-divider span {
    font-size: 12px;
    color: var(--color-text-muted);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

/* ==================== Form ==================== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ==================== Form Fields ==================== */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    letter-spacing: 0.02em;
    text-transform: none;
}

.form-field input {
    width: 100%;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 14px;
    color: var(--color-text-primary);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-default);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-field input:hover {
    border-color: var(--color-border-strong);
    background: var(--color-bg-secondary);
}

.form-field input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.08);
    background: var(--color-bg-elevated);
}

.form-field input::placeholder {
    color: var(--color-text-muted);
    font-weight: 400;
}

.form-field input[aria-invalid="true"] {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 3px var(--color-danger-subtle);
}

/* Password wrapper */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

.password-toggle:hover {
    color: var(--color-text-secondary);
    background: rgba(0, 0, 0, 0.04);
}

/* Field error */
.field-error {
    font-size: 13px;
    color: var(--color-danger);
    min-height: 0;
    overflow: hidden;
    transition: all 0.2s ease;
}

.field-error:empty {
    display: none;
}

/* ==================== Form Actions ==================== */
.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: -8px;
}

.forgot-password {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-accent);
    text-decoration: none;
    padding: 4px 0;
    transition: color 0.2s, opacity 0.2s;
}

.forgot-password:hover {
    color: var(--color-accent-hover);
    opacity: 0.85;
}

/* ==================== Login Button ==================== */
.btn-login {
    width: 100%;
    padding: 12px 24px;
    margin-top: 4px;
    background: var(--color-accent);
    color: var(--color-text-on-accent);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    outline: none;
    position: relative;
    overflow: hidden;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.01em;
}

.btn-login:hover {
    background: var(--color-accent-hover);
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.2);
}

.btn-login:focus-visible {
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.btn-login:active {
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
    background: var(--color-accent-hover);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: var(--shadow-accent);
}

/* Button loading state */
.btn-login.loading .btn-text {
    opacity: 0;
}

.btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--color-text-on-accent);
    border-radius: 50%;
    animation: btnSpin 0.6s linear infinite;
    position: absolute;
}

.btn-login.loading .btn-spinner {
    display: block;
}

@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

/* ==================== Auth View Switching ==================== */
.auth-view {
    display: none;
}

.auth-view.active {
    display: block;
}

.auth-view-enter {
    animation: authViewEnter 0.35s ease-out both;
}

@keyframes authViewEnter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== Register Prompt ==================== */
.register-prompt {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--color-text-tertiary, var(--color-text-secondary));
    letter-spacing: 0.01em;
}

.register-prompt a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.register-prompt a:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ==================== Legal Links ==================== */
.legal-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border-default);
    font-size: 11px;
    color: var(--color-text-muted);
    letter-spacing: 0.02em;
}

.legal-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.legal-links a:hover {
    color: var(--color-text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-dot {
    font-size: 10px;
}

/* ==================== Toast v2 (synced with styles.css) ==================== */
.toast-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    position: relative;
    background: var(--color-bg-elevated);
    border-radius: 12px;
    padding: 14px 40px 14px 16px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastIn 0.3s ease;
    min-width: 300px;
    max-width: 420px;
    font-size: 14px;
    color: var(--color-text-primary);
    overflow: hidden;
    pointer-events: auto;
    border: 1px solid rgba(28, 25, 23, 0.08);
}

.toast__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast__content {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text-primary);
}

.toast__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--color-text-tertiary);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.toast__close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--color-text-primary);
}

.toast__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform-origin: left;
    animation: toastProgress linear forwards;
    border-radius: 0 0 12px 12px;
}

.toast--success {
    border-left: 4px solid #22c55e;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.06) 0%, #fff 100%);
}
.toast--success .toast__icon { color: #22c55e; }
.toast--success .toast__progress { background: #22c55e; }

.toast--error {
    border-left: 4px solid #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.06) 0%, #fff 100%);
}
.toast--error .toast__icon { color: #ef4444; }
.toast--error .toast__progress { background: #ef4444; }

.toast--warning {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.06) 0%, #fff 100%);
}
.toast--warning .toast__icon { color: #f59e0b; }
.toast--warning .toast__progress { background: #f59e0b; }

.toast--info {
    border-left: 4px solid #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.06) 0%, #fff 100%);
}
.toast--info .toast__icon { color: #3b82f6; }
.toast--info .toast__progress { background: #3b82f6; }

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-12px) scale(0.96);
    }
}

@keyframes toastProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* ==================== Dark Theme ==================== */
[data-theme="dark"] .login-form-section {
    background: var(--color-bg-page);
}

[data-theme="dark"] .toast {
    background: var(--color-bg-tertiary);
    border-color: var(--color-border-default);
}
[data-theme="dark"] .toast__close:hover {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .toast--success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12) 0%, var(--color-bg-tertiary) 100%);
}

[data-theme="dark"] .toast--error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, var(--color-bg-tertiary) 100%);
}

[data-theme="dark"] .toast--warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, var(--color-bg-tertiary) 100%);
}

[data-theme="dark"] .toast--info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, var(--color-bg-tertiary) 100%);
}

/* ==================== Desktop Layout (>=768px) ==================== */
@media (min-width: 768px) {
    .login-container {
        flex-direction: row;
    }

    .login-hero {
        width: 50%;
        height: 100vh;
        max-height: none;
        position: fixed;
        top: 0;
        left: 0;
    }

    .hero-content {
        align-items: center;
        justify-content: center;
    }

    .hero-brand {
        display: flex;
        padding: 0 20px;
        max-width: 900px;
        width: 90%;
    }

    .hero-logo-mobile {
        display: none;
    }

    .login-form-section {
        width: 50%;
        margin-left: 50%;
        align-items: center;
        padding: 48px 40px;
        min-height: 100vh;
    }

    .login-logo {
        display: block;
    }

    .login-logo {
        height: 68px;
    }

    .login-heading {
        font-size: 44px;
    }

    .login-subheading {
        font-size: 18px;
    }

    .login-form-wrapper {
        max-width: 420px;
    }
}

/* ==================== Large Desktop (>=1200px) ==================== */
@media (min-width: 1200px) {
    .login-hero {
        width: 55%;
    }

    .hero-brand {
        padding: 0 32px;
        max-width: 1000px;
    }

    .login-form-section {
        width: 45%;
        margin-left: 55%;
        padding: 48px 64px;
    }

    .login-logo {
        height: 72px;
    }

    .login-heading {
        font-size: 48px;
    }

    .login-subheading {
        font-size: 20px;
    }

    .login-form-wrapper {
        max-width: 400px;
    }
}

/* ==================== Small Mobile (<=380px) ==================== */
@media (max-width: 380px) {
    .login-form-section {
        padding: 24px 20px 40px;
    }

    .login-heading {
        font-size: 22px;
    }

    .btn-oauth-google,
    .btn-login {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* ==================== Hero Ticker (Background floating stock prices) ==================== */
.hero-ticker {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.hero-ticker-item {
    position: absolute;
    white-space: nowrap;
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
    animation: tickerFloat linear infinite;
    will-change: transform;
}

.hero-ticker-item.up { color: rgba(239, 68, 68, var(--ticker-opacity)); }
.hero-ticker-item.down { color: rgba(34, 197, 94, var(--ticker-opacity)); }

@keyframes tickerFloat {
    from { transform: translateX(110vw); }
    to { transform: translateX(-120%); }
}

/* ==================== Flash Intro Animation ==================== */
.hd-flash-enter {
    animation: hdFlashReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes hdFlashReveal {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.98);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* ==================== Hero Demo Animation ==================== */
.hero-demo {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    background: rgba(12, 8, 4, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 16px 20px 20px;
    box-shadow:
        0 0 0 0.5px rgba(0, 0, 0, 0.3),
        0 8px 32px rgba(0, 0, 0, 0.25),
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Level indicator tabs */
.hero-demo-levels {
    display: flex;
    gap: 2px;
    align-items: center;
    justify-content: center;
    padding: 0 4px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.hd-level-tab {
    position: relative;
    font-size: 10.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.22);
    padding: 3px 6px 5px;
    border-bottom: 1.5px solid transparent;
    transition: color 0.35s ease, border-color 0.35s ease;
    letter-spacing: 0.02em;
    white-space: nowrap;
    cursor: default;
}

.hd-level-tab.active {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    border-bottom-color: var(--color-accent);
}

/* Active tab — no pulse dot, cleaner */

.hd-level-sep {
    font-size: 7px;
    color: rgba(255, 255, 255, 0.08);
    margin: 0 1px;
}

/* Legacy dot glow keyframe — kept for compat */
@keyframes hdDotGlow {
    from {
        width: 8px;
        box-shadow: 0 0 0px rgba(var(--color-accent-rgb, 255, 152, 0), 0);
    }
    to {
        width: 24px;
        box-shadow: 0 0 8px rgba(var(--color-accent-rgb, 255, 152, 0), 0.5);
    }
}

/* Dual-panel body */
.hero-demo-body {
    display: flex;
    flex-direction: row;
    gap: 14px;
    height: 380px;
    position: relative;
}

/* Left panel: chat */
.hero-demo-left {
    flex: 0 0 50%;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.hero-demo-left::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 48px;
    background: linear-gradient(to bottom, transparent, rgba(12, 8, 4, 0.9));
    pointer-events: none;
    z-index: 1;
}

/* Right panel: results */
.hero-demo-right {
    flex: 0 0 50%;
    min-width: 0;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    padding-left: 14px;
    opacity: 0;
}

.hero-demo-right::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 36px;
    background: linear-gradient(to bottom, transparent, rgba(12, 8, 4, 0.9));
    pointer-events: none;
    z-index: 1;
}

/* Right panel content container (JS-generated) */
.hd-right-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    overflow: hidden;
    animation: hdRightReveal 0.5s ease-out both;
}

@keyframes hdRightReveal {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Skip all animations during flash intro */
.hd-no-anim,
.hd-no-anim * {
    animation: none !important;
}

/* Right panel — scene exit */
.hd-right-fade-out {
    animation: hdRightFadeOut 0.5s ease-in both;
}

@keyframes hdRightFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; transform: translateX(-8px); filter: blur(2px); }
}

/* Right panel empty state placeholder */
.hd-right-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    opacity: 0.15;
}

/* Chat area */
.hero-demo-chat {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    overflow: hidden;
    position: relative;
}

/* User message bubble (right-aligned, orange gradient) */
.hd-msg-user {
    align-self: flex-end;
    max-width: 88%;
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-hover) 100%);
    color: #fff;
    padding: 9px 14px;
    border-radius: 14px 14px 4px 14px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.5;
    animation: hdMsgEnter 0.3s ease-out both;
    white-space: nowrap;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.2);
}

.hd-msg-user .hd-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: rgba(255, 255, 255, 0.8);
    margin-left: 1px;
    vertical-align: text-bottom;
    animation: hdCursorBlink 0.6s step-end infinite;
}

/* AI message bubble (left-aligned, glass morphism + orange left border) */
.hd-msg-ai {
    align-self: flex-start;
    max-width: 92%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 2px solid rgba(249, 115, 22, 0.6);
    padding: 10px 14px;
    border-radius: 4px 14px 14px 14px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.55;
    animation: hdMsgEnter 0.35s ease-out both;
}

/* AI result top-down reveal + border glow pulse (overrides hdMsgEnter for result blocks) */
.hd-msg-ai.hd-result {
    animation: hdResultReveal 0.6s ease-out both, hdBorderGlow 1.2s ease-out 0.3s both;
}

@keyframes hdResultReveal {
    from {
        clip-path: inset(0 0 100% 0);
        opacity: 0;
    }
    15% {
        opacity: 1;
    }
    to {
        clip-path: inset(0 0 0 0);
        opacity: 1;
    }
}

@keyframes hdBorderGlow {
    0% {
        box-shadow: 0 0 0 rgba(var(--color-accent-rgb, 255, 152, 0), 0);
    }
    30% {
        box-shadow: 0 0 8px rgba(var(--color-accent-rgb, 255, 152, 0), 0.15),
                    inset 0 0 4px rgba(var(--color-accent-rgb, 255, 152, 0), 0.03);
    }
    100% {
        box-shadow: 0 0 0 rgba(var(--color-accent-rgb, 255, 152, 0), 0);
    }
}

/* Typing indicator (3 bouncing dots) */
.hd-typing-dots {
    display: flex;
    gap: 5px;
    padding: 4px 0;
}

.hd-typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-accent);
    opacity: 0.6;
    animation: hdDotBounce 1.2s ease-in-out infinite;
}

.hd-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.hd-typing-dots span:nth-child(3) { animation-delay: 0.3s; }

/* Result count badge */
.hd-result-count {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    animation: hdMsgEnter 0.3s ease-out both;
}

.hd-result-num {
    color: var(--color-accent);
    font-weight: 700;
    font-size: 13px;
}

/* Table bottom fade + "more results" hint */
.hd-table-fade {
    position: relative;
    height: 22px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.03), transparent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hd-more-hint {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.5px;
    animation: hdMsgEnter 0.4s ease-out 0.5s both;
}

/* Mini stock table */
.hd-stock-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 6px;
}

.hd-stock-table th {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: left;
    padding: 4px 6px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

/* Numeric columns right-align (all except first th/td) */
.hd-stock-table th:not(:first-child),
.hd-stock-table td:not(:first-child) {
    text-align: right;
}

.hd-stock-table td {
    font-size: 12.5px;
    padding: 5px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.hd-stock-table tbody tr {
    animation: hdRowEnter 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hd-stock-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.hd-stock-table tbody tr:nth-child(2) { animation-delay: 0.12s; }
.hd-stock-table tbody tr:nth-child(3) { animation-delay: 0.19s; }
.hd-stock-table tbody tr:nth-child(4) { animation-delay: 0.26s; }
.hd-stock-table tbody tr:nth-child(5) { animation-delay: 0.33s; }
.hd-stock-table tbody tr:nth-child(6) { animation-delay: 0.40s; }

/* First row subtle highlight — hints interactivity */
.hd-stock-table tbody tr:first-child {
    background: rgba(var(--color-accent-rgb, 255, 152, 0), 0.06);
    border-radius: 4px;
}

/* Auto-scan row highlight */
.hd-row-scan {
    background: rgba(var(--color-accent-rgb, 255, 152, 0), 0.1) !important;
    transform: scale(1.01);
    transition: background 0.15s ease, transform 0.15s ease;
}

.hd-stock-table tbody tr:not(.hd-row-scan) {
    transition: background 0.2s ease, transform 0.2s ease;
}

/* Rank badge (#1, #2...) */
.hd-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(var(--color-accent-rgb, 255, 152, 0), 0.2);
    color: var(--color-accent);
    font-size: 9px;
    font-weight: 700;
    margin-right: 5px;
    vertical-align: middle;
}

.hd-stock-name {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.hd-stock-code {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    margin-left: 4px;
}

.hd-up { color: #ef4444; }
.hd-down { color: #22c55e; }

/* Stats pills row */
.hd-stats-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 6px 0 2px;
    animation: hdMsgEnter 0.3s ease-out 0.3s both;
}

.hd-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 9.5px;
    color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 2px 7px;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.hd-pill-icon {
    color: var(--color-accent);
    font-size: 8px;
}

/* K-line candlestick chart */
.hd-kline-wrap {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    animation: hdChartEnter 0.5s ease-out both;
    animation-delay: 0.3s;
}

.hd-kline-svg {
    width: 100%;
    height: auto;
    display: block;
}

/* K-line area fill under close prices */
.hd-kline-area {
    opacity: 0;
    animation: hdAreaFadeIn 0.8s ease-out 0.5s both;
}

@keyframes hdAreaFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* MA5 moving average line */
.hd-kline-ma-line {
    fill: none;
    stroke: rgba(255, 255, 255, 0.35);
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hd-kline-label {
    font-size: 8px;
    font-weight: 600;
    fill: rgba(255, 255, 255, 0.45);
    font-family: inherit;
}

/* RSI overlay line */
.hd-kline-rsi-line {
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* RSI threshold dashed line (RSI=30) */
.hd-kline-threshold {
    stroke: rgba(255, 255, 255, 0.25);
    stroke-width: 0.7;
    stroke-dasharray: 4 3;
}

/* RSI / overlay label */
.hd-kline-overlay-label {
    font-size: 7px;
    font-weight: 500;
    fill: rgba(255, 255, 255, 0.4);
    font-family: inherit;
}

@keyframes hdChartEnter {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Candle stagger grow-in */
.hd-candle {
    animation: hdCandleGrow 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Last candle pulse — emphasize latest data */
.hd-candle-last {
    animation: hdCandleGrow 0.35s cubic-bezier(0.22, 1, 0.36, 1) both,
               hdCandlePulse 1.5s ease-in-out 1s both;
}

@keyframes hdCandlePulse {
    0%, 100% { opacity: 1; filter: brightness(1); }
    50% { opacity: 1; filter: brightness(1.5); }
}

@keyframes hdCandleGrow {
    from {
        opacity: 0;
        transform: scaleY(0.3);
    }
    to {
        opacity: 1;
        transform: scaleY(1);
    }
}

/* RSI line draw animation */
.hd-line-draw {
    transition: stroke-dashoffset 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.4s;
}

/* Shimmer "AI 分析中..." text */
.hd-shimmer-text {
    display: inline-block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.4) 0%,
        rgba(255, 255, 255, 0.8) 50%,
        rgba(255, 255, 255, 0.4) 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: hdShimmer 1.5s ease-in-out infinite;
}

@keyframes hdShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Highlight pulse for key numbers/phrases in summary */
.hd-highlight-pulse {
    color: var(--color-accent);
    font-weight: 600;
    animation: hdHighlightPop 0.4s ease-out both;
}

@keyframes hdHighlightPop {
    0% {
        color: rgba(255, 255, 255, 0.65);
        text-shadow: none;
    }
    50% {
        color: var(--color-accent);
        text-shadow: 0 0 8px rgba(var(--color-accent-rgb, 255, 152, 0), 0.6);
    }
    100% {
        color: var(--color-accent);
        text-shadow: none;
    }
}

/* AI summary text */
.hd-ai-summary {
    margin-top: 8px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.6;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 8px;
}

.hd-ai-summary .hd-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--color-accent);
    margin-left: 1px;
    vertical-align: text-bottom;
    animation: hdCursorBlink 0.6s step-end infinite;
}

/* Scene entrance shimmer */
.hd-scene-enter {
    position: relative;
}

.hd-scene-enter::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.04) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: hdSceneShimmer 0.6s ease-out both;
    pointer-events: none;
    border-radius: 12px;
}

@keyframes hdSceneShimmer {
    from { background-position: 200% 0; opacity: 1; }
    to { background-position: -200% 0; opacity: 0; }
}

/* Fade out animation class — slide up + blur */
.hd-fade-out {
    animation: hdSceneExit 0.6s cubic-bezier(0.4, 0, 1, 1) both;
}

/* ===== Keyframes ===== */
@keyframes hdMsgEnter {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@keyframes hdSceneExit {
    from {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
    to {
        opacity: 0;
        transform: translateY(-16px);
        filter: blur(4px);
    }
}

@keyframes hdCursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes hdDotBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

@keyframes hdRowEnter {
    from {
        opacity: 0;
        transform: translateX(-12px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* ===== Responsive: <1024px — right panel hidden ===== */
@media (max-width: 1023px) {
    .hero-demo-right { display: none; }
    .hd-pt-right { display: none; }
    .hero-demo-left  { flex: none; width: 100%; }
    .hd-pt-left { flex: none; width: 100%; }
    .hero-demo-chat  { height: 380px; }
}

/* ===== Responsive: 1200px+ enlarge ===== */
@media (min-width: 1200px) {
    .hero-demo-body {
        height: 460px;
    }

    .hero-demo {
        padding: 18px 24px 24px;
    }

    .hd-msg-user {
        font-size: 14px;
    }

    .hd-msg-ai {
        font-size: 13px;
    }
}

/* ==================== Scene Crossfade (Act transition) ==================== */
@keyframes hdSceneCrossFadeOut {
    from { opacity: 1; transform: scale(1); filter: blur(0); }
    to   { opacity: 0; transform: scale(0.98); filter: blur(2px); }
}

@keyframes hdSceneCrossFadeIn {
    from { opacity: 0; transform: scale(0.98); filter: blur(2px); }
    to   { opacity: 1; transform: scale(1); filter: blur(0); }
}

.hd-crossfade-out {
    animation: hdSceneCrossFadeOut 0.3s ease-in both;
}

.hd-crossfade-in {
    animation: hdSceneCrossFadeIn 0.3s ease-out both;
}

/* ==================== Mode Tabs (Price Trends scene) ==================== */
.hd-mode-tabs {
    display: flex;
    gap: 2px;
    align-items: center;
    justify-content: center;
    padding: 0 4px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.hd-mode-tab {
    font-size: 10.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.22);
    padding: 3px 8px 5px;
    border-bottom: 1.5px solid transparent;
    transition: color 0.35s ease, border-color 0.35s ease;
    letter-spacing: 0.02em;
    white-space: nowrap;
    cursor: default;
}

.hd-mode-tab.active {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    border-bottom-color: var(--color-accent);
}

.hd-mode-dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #22c55e;
    margin-left: 4px;
    vertical-align: middle;
    animation: hdModeDotPulse 1.5s ease-in-out infinite;
}

@keyframes hdModeDotPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ==================== Price Trends Scene ==================== */
.hd-pt-container {
    display: flex;
    flex-direction: row;
    gap: 0;
    height: 100%;
    width: 100%;
}

.hd-pt-left {
    flex: 0 0 50%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hd-pt-right {
    flex: 0 0 50%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    padding-left: 14px;
    overflow: hidden;
}

/* ── Tree Panel ── */
.hd-pt-tree {
    flex: 0 0 auto;
    overflow: hidden;
    padding: 4px 8px;
}

.hd-pt-tree-node {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.55);
    cursor: default;
}

.hd-pt-tree-node.level-1 { padding-left: 16px; }
.hd-pt-tree-node.level-2 { padding-left: 32px; }

.hd-pt-tree-icon {
    font-size: 8px;
    width: 12px;
    text-align: center;
    flex-shrink: 0;
}

.hd-pt-tree-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hd-pt-tree-node.active .hd-pt-tree-label {
    color: var(--color-accent);
    font-weight: 600;
}

.hd-pt-tree-count {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 5px;
    border-radius: 8px;
    font-variant-numeric: tabular-nums;
}

.hd-pt-tree-node.active .hd-pt-tree-count {
    color: var(--color-accent);
    background: rgba(249, 115, 22, 0.15);
}

/* ── Splitter ── */
.hd-pt-splitter {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 4px 8px;
    flex-shrink: 0;
}

/* ── Table Panel ── */
.hd-pt-table-wrap {
    flex: 1;
    overflow: hidden;
    padding: 4px 8px 0;
}

.hd-pt-table-wrap table {
    width: 100%;
    border-collapse: collapse;
}

.hd-pt-table-wrap th {
    font-size: 9.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: left;
    padding: 3px 4px 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.hd-pt-table-wrap th:not(:first-child),
.hd-pt-table-wrap td:not(:first-child) {
    text-align: right;
}

.hd-pt-table-wrap td {
    font-size: 11.5px;
    padding: 4px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.75);
}

.hd-pt-table-wrap tbody tr {
    transition: background 0.15s ease;
}

.hd-pt-table-wrap .hd-stock-name {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.hd-pt-table-wrap .hd-stock-code {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.35);
    margin-left: 3px;
}

/* ── Price Flash Animation ── */
@keyframes hdPriceFlashUp {
    0% { background: transparent; }
    30% { background: rgba(239, 68, 68, 0.2); }
    100% { background: transparent; }
}

@keyframes hdPriceFlashDown {
    0% { background: transparent; }
    30% { background: rgba(34, 197, 94, 0.2); }
    100% { background: transparent; }
}

.hd-price-flash-up td { animation: hdPriceFlashUp 0.8s ease-out both; }
.hd-price-flash-down td { animation: hdPriceFlashDown 0.8s ease-out both; }

/* ── Chart Header ── */
.hd-pt-chart-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 4px 0 6px;
    flex-wrap: wrap;
}

.hd-pt-chart-stock-name {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
}

.hd-pt-chart-stock-code {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

.hd-pt-chart-price {
    font-size: 20px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin-left: auto;
}

.hd-pt-chart-change {
    font-size: 12px;
    font-weight: 600;
    margin-left: 6px;
}

/* ==================== Price Trends Scene — Act 2 Enhancements ==================== */

/* ── Mock Cursor ── */
.hd-mock-cursor {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
    opacity: 0;
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.4s ease;
}

.hd-mock-cursor.visible {
    opacity: 1;
}

/* ── Context Menu Mock ── */
.hd-ctx-menu {
    position: absolute;
    z-index: 20;
    min-width: 140px;
    background: rgba(30, 28, 26, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    padding: 4px 0;
    opacity: 0;
    transform: scale(0.95) translateY(-5px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
}

.hd-ctx-menu.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.hd-ctx-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    transition: background 0.15s ease;
}

.hd-ctx-icon {
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    font-size: 12px;
}

.hd-ctx-label {
    flex: 1;
}

.hd-ctx-highlight.hd-ctx-hover {
    background: rgba(249, 115, 22, 0.2);
}

/* Strategy node highlight ring when context menu is shown */
.hd-pt-tree-node.hd-ctx-target {
    box-shadow: 0 0 0 1.5px rgba(249, 115, 22, 0.5);
    border-radius: 4px;
    background: rgba(249, 115, 22, 0.08);
}

/* ── Schedule Confirmation Toast ── */
.hd-schedule-toast {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 6px;
    font-size: 11px;
    color: #4ade80;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 15;
    white-space: nowrap;
}

.hd-schedule-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.hd-schedule-toast-icon {
    font-weight: 700;
    font-size: 12px;
}

/* ── Schedule Badge ── */
.hd-pt-schedule-badge {
    font-size: 9px;
    margin-left: 4px;
    display: inline-block;
    transform: scale(0);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hd-pt-schedule-badge.visible {
    transform: scale(1);
}

@keyframes hdBadgeFlash {
    0% { opacity: 1; }
    25% { opacity: 0.3; }
    50% { opacity: 1; }
    75% { opacity: 0.3; }
    100% { opacity: 1; }
}

.hd-pt-schedule-badge.flash {
    animation: hdBadgeFlash 0.6s ease;
}

/* ── Time Skip Hint ── */
.hd-time-skip {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 5;
    pointer-events: none;
}

.hd-time-skip.visible {
    opacity: 1;
}

/* ── Notification Card ── */
.hd-notif-card {
    padding: 16px;
    background: rgba(30, 28, 26, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hd-notif-card.visible {
    opacity: 1;
    transform: scale(1);
}

.hd-notif-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.hd-notif-icon {
    font-size: 16px;
}

.hd-notif-title {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    flex: 1;
}

.hd-notif-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

.hd-notif-matched {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}

.hd-notif-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.hd-notif-chip {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.hd-notif-chip.visible {
    opacity: 1;
    transform: translateY(0);
}

.hd-notif-chip.added {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.hd-notif-chip.removed {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* ── K-line fade out for notification transition ── */
.hd-pt-right .hd-kline-wrap.hd-fade-out {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hd-pt-right .hd-pt-chart-header.hd-fade-out {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ── Responsive: notification card on narrow screens ── */
@media (max-width: 1023px) {
    .hd-notif-card {
        position: absolute;
        bottom: 12px;
        right: 12px;
        left: 12px;
        z-index: 20;
    }
}

/* ==================== Accessibility ==================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hero-demo { display: none !important; }
    .hero-ticker { display: none !important; }
}

/* High contrast focus — consistent ring */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: inherit;
}

/* Smooth transitions for all interactive elements */
a, button {
    transition-property: color, background, border-color, box-shadow, opacity;
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

/* Register prompt dot separator */
.register-prompt-dot {
    margin: 0 4px;
    color: var(--color-text-tertiary);
}
