/* --- Design Tokens (from your provided CSS) --- */
:root {
    /* ... (no changes in this section) ... */
    --bg-main: #09090b;
    --bg-secondary: #18181b;
    --glass-bg: rgba(24, 24, 27, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --accent-primary: #8b5cf6; /* Purple */
    --accent-secondary: #06b6d4; /* Cyan */
    --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    --warning-bg: rgba(234, 179, 8, 0.1);
    --warning-border: rgba(234, 179, 8, 0.4);
    --warning-text: #fde047;

    /* --- Color Palette for Timeline --- */
    --c1: #ec4899; /* Pink */
    --c2: #8b5cf6; /* Purple */
    --c3: #22c55e; /* Green */
    --c4: #06b6d4; /* Cyan */
    --c5: #f59e0b; /* Amber */
}

body.light-mode {
    /* ... (no changes in this section) ... */
    --bg-main: #f4f4f5;
    --bg-secondary: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.1);
    --text-primary: #18181b;
    --text-secondary: #52525b;
    --warning-bg: rgba(217, 119, 6, 0.1);
    --warning-border: rgba(217, 119, 6, 0.4);
    --warning-text: #b45309;
    --c1: #db2777;
    --c2: #7c3aed;
    --c3: #16a34a;
    --c4: #0891b2;
    --c5: #d97706;
}

/* ... (Global Reset, Body, Background, Layout, Glass Card, Typography are all the same) ... */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background-color: var(--bg-main); color: var(--text-primary); min-height: 100vh; padding: 2rem 1rem; transition: background-color 0.3s ease, color 0.3s ease; }
.background-overlay { position: fixed; inset: 0; z-index: -2; background: radial-gradient(circle at 15% 15%, rgba(139, 92, 246, 0.15), transparent 40%), radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.15), transparent 40%); }
.app-container { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.5rem; }
.glass-card { background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--glass-border); border-radius: 24px; padding: 2rem; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12); }
h1 { font-weight: 800; font-size: 2.5rem; background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 0.5rem; }
h2 { font-size: 1.25rem; margin-bottom: 1rem; font-weight: 600; }
p, li, label { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.5; }
.hero-card { text-align: center; padding: 3rem 1rem; }
.main-content-card { display: grid; grid-template-columns: 1fr 1.5fr; gap: 2.5rem; }
.input-section, .output-section { display: flex; flex-direction: column; }
textarea { width: 100%; padding: 1rem; border-radius: 12px; border: 1px solid var(--glass-border); background: var(--bg-secondary); color: var(--text-primary); font-family: inherit; font-size: 0.9rem; line-height: 1.6; resize: vertical; }
textarea:focus { outline: 2px solid var(--accent-primary); }
#generate-button { padding: 0.75rem 1.5rem; border: none; border-radius: 12px; font-weight: 600; cursor: pointer; transition: transform 0.2s ease, opacity 0.2s ease; background: var(--accent-gradient); color: white; margin-top: 1rem; }
#generate-button:hover { opacity: 0.9; transform: translateY(-2px); }
.settings-row { margin: 1rem 0; }
.toggle-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.toggle-switch span:last-child { margin-left: 0.75rem; font-weight: 500;}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: relative; width: 44px; height: 24px; background-color: var(--bg-secondary); border: 1px solid var(--glass-border); border-radius: 34px; transition: 0.4s; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: var(--text-secondary); border-radius: 50%; transition: 0.4s; }
input:checked + .slider { background-color: var(--accent-primary); }
input:checked + .slider:before { transform: translateX(20px); background-color: white; }

/* --- Timeline Output Styles --- */
#timeline-output-container {
    background-color: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    flex-grow: 1;
}
.timeline { list-style: none; padding-left: 1.5rem; position: relative; }
.timeline-item { position: relative; padding-bottom: 24px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:last-child::after { display: none; } 

.timeline-item::before { /* The dot */
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 5px;
    transform: translateX(-45%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-secondary);
    border: 2px solid var(--bg-secondary);
    transition: background-color 0.3s ease;
    z-index: 1; 
}

.timeline-item::after { /* The line */
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 12px; 
    bottom: -12px;
    transform: translateX(-50%);
    width: 2px;
    background-color: var(--glass-border);
    transition: background-color 0.3s ease;
    z-index: 0; 
}

.timeline-time { font-weight: 600; font-size: 1rem; color: var(--text-primary); margin-bottom: 0.25rem; transition: color 0.3s ease; }
.timeline-description { color: var(--text-secondary); line-height: 1.5; }
.placeholder-text { height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--text-secondary); opacity: 0.7; }

/* --- Colorful Timeline Styles --- */
.colorful .timeline-item:nth-child(5n + 1)::before, .colorful .timeline-item:nth-child(5n + 1)::after { background-color: var(--c1); }
.colorful .timeline-item:nth-child(5n + 1) .timeline-time { color: var(--c1); }
.colorful .timeline-item:nth-child(5n + 2)::before, .colorful .timeline-item:nth-child(5n + 2)::after { background-color: var(--c2); }
.colorful .timeline-item:nth-child(5n + 2) .timeline-time { color: var(--c2); }
.colorful .timeline-item:nth-child(5n + 3)::before, .colorful .timeline-item:nth-child(5n + 3)::after { background-color: var(--c3); }
.colorful .timeline-item:nth-child(5n + 3) .timeline-time { color: var(--c3); }
.colorful .timeline-item:nth-child(5n + 4)::before, .colorful .timeline-item:nth-child(5n + 4)::after { background-color: var(--c4); }
.colorful .timeline-item:nth-child(5n + 4) .timeline-time { color: var(--c4); }
.colorful .timeline-item:nth-child(5n + 5)::before, .colorful .timeline-item:nth-child(5n + 5)::after { background-color: var(--c5); }
.colorful .timeline-item:nth-child(5n + 5) .timeline-time { color: var(--c5); }

/* --- Export Controls, Debug, and Responsive styles (UPDATED) --- */
#export-controls { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; }
#export-controls.hidden { display: none; }
#export-controls h3 { font-size: 1rem; font-weight: 500; margin-bottom: 0; color: var(--text-secondary); }
#export-controls .export-title { margin-top: 0.75rem; }
.export-buttons { display: flex; gap: 0.75rem; }
.export-buttons button, .export-buttons input {
    flex-grow: 1; padding: 0.6rem 1rem; border: 1px solid var(--glass-border); background: var(--bg-secondary); color: var(--text-primary); border-radius: 8px; font-weight: 500; font-family: inherit; font-size: 100%; cursor: pointer; transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.export-buttons button:hover { background-color: var(--glass-border); border-color: var(--accent-secondary); }
.export-buttons button.active { background: var(--accent-primary); border-color: var(--accent-primary); color: white; }
.custom-ratio-wrapper { flex-grow: 1; display: flex; }
.custom-ratio-wrapper input { text-align: center; }
.custom-ratio-wrapper input:focus {
    outline: none; background: var(--accent-primary); border-color: var(--accent-primary); color: white;
}
.custom-ratio-wrapper input::placeholder { color: var(--text-secondary); opacity: 0.8; }
.custom-ratio-wrapper input:focus::placeholder { color: rgba(255, 255, 255, 0.7); }

#debug-output p { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 0.5rem; font-size: 0.85rem; line-height: 1.4; border: 1px solid transparent; }
#debug-output p.info { background: rgba(6, 182, 212, 0.1); border-color: rgba(6, 182, 212, 0.4); color: #67e8f9; }
#debug-output p.warn { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-text); }
#debug-output p.warn strong { color: inherit; font-weight: 600; }
@media (max-width: 820px) { .main-content-card { grid-template-columns: 1fr; gap: 2rem; } }
@media (max-width: 768px) { .hero-card h1 { font-size: 2rem; } .glass-card { padding: 1.5rem; } }