/* =============================================
   TitleForge — Visual Identity
   Aesthetic: Bold editorial / cinematic dark
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Core palette */
    --bg-deep: #0a0a0f;
    --bg-card: #12121a;
    --bg-elevated: #1a1a26;
    --bg-input: #16161f;
    --border-subtle: rgba(255,255,255,0.06);
    --border-hover: rgba(255,255,255,0.12);
    
    /* Accent: electric amber → warm energy */
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --accent-dim: rgba(245,158,11,0.15);
    --accent-glow: rgba(245,158,11,0.3);
    
    /* Secondary accent */
    --secondary: #6366f1;
    --secondary-dim: rgba(99,102,241,0.15);
    
    /* Status */
    --success: #22c55e;
    --error: #ef4444;
    --warning: #eab308;
    
    /* Text */
    --text-primary: #f0f0f5;
    --text-secondary: #8b8b9e;
    --text-muted: #5a5a6e;
    
    /* Typography */
    --font-display: 'Sora', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 32px rgba(0,0,0,0.4);
    --shadow-lg: 0 16px 64px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 40px var(--accent-glow);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background noise texture */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* ========== Typography ========== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.display-xl {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
}

.display-lg {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
}

.display-md {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-light);
}

/* ========== Layout ========== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

.container-narrow {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* ========== Navigation ========== */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px 0;
    background: rgba(10,10,15,0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    transition: all 0.3s;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.03em;
}

.nav-logo .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), #f97316);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #000;
    font-weight: 800;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links .btn {
    color: #000;
}

/* Hamburger button (hidden on desktop) */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.25s;
}

.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ========== Buttons ========== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #f97316);
    color: #000;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--accent-glow);
    color: #000;
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    background: #1f1f2e;
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-outline:hover {
    background: var(--accent-dim);
}

.btn-sm {
    padding: 8px 18px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 16px 40px;
    font-size: 1.1rem;
    border-radius: var(--radius-lg);
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ========== Cards ========== */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: all 0.3s;
}

.card:hover {
    border-color: var(--border-hover);
}

.card-glow {
    box-shadow: var(--shadow-glow);
    border-color: rgba(245,158,11,0.2);
}

/* ========== Forms ========== */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.25s;
    outline: none;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input-lg {
    padding: 18px 22px;
    font-size: 1.1rem;
    border-radius: var(--radius-lg);
}

/* ========== Hero Section ========== */

.hero {
    padding: 160px 0 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
    opacity: 0.3;
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: var(--accent-dim);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: 100px;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 32px;
    animation: fadeUp 0.6s ease-out;
}

.hero-title {
    margin-bottom: 24px;
    animation: fadeUp 0.6s ease-out 0.1s both;
}

.hero-title .accent {
    background: linear-gradient(135deg, var(--accent), #f97316, #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-highlight {
    color: var(--accent-light);
    font-weight: 600;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 48px;
    line-height: 1.7;
    animation: fadeUp 0.6s ease-out 0.2s both;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    animation: fadeUp 0.6s ease-out 0.3s both;
}

/* ========== Features ========== */

.features {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 16px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.feature-card {
    padding: 36px;
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
    background: var(--accent-dim);
}

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ========== How It Works ========== */

.how-it-works {
    padding: 100px 0;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 32px;
    counter-reset: step;
}

.step {
    text-align: center;
    padding: 40px 24px;
    counter-increment: step;
    position: relative;
}

.step::before {
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--accent), #f97316);
    color: #000;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.3rem;
    border-radius: 50%;
}

.step h3 {
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.step p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========== Pricing ========== */

.pricing {
    padding: 100px 0;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 28px;
    max-width: 800px;
    margin: 0 auto;
}

.pricing-card {
    padding: 40px;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
}

.pricing-card .btn-full {
    margin-top: auto;
}

.pricing-card.popular {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.pricing-card.popular::before {
    content: 'MOST POPULAR';
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, var(--accent), #f97316);
    color: #000;
    font-family: var(--font-display);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 100px;
    letter-spacing: 0.12em;
    white-space: nowrap;
}

.pricing-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.pricing-price {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.pricing-price .currency {
    font-size: 1.5rem;
    vertical-align: super;
    color: var(--text-secondary);
}

.pricing-period {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 32px;
}

.pricing-features {
    list-style: none;
    text-align: left;
    margin-bottom: 36px;
}

.pricing-features li {
    padding: 10px 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.pricing-features li:last-child {
    border-bottom: none;
}

.pricing-features li::before {
    content: '✓';
    color: var(--success);
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* ========== Auth Pages ========== */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 24px 60px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 48px;
}

.auth-card h1 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 1.8rem;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 36px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========== Dashboard ========== */

.dashboard {
    padding: 100px 0 60px;
}

.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.dash-greeting h1 {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.dash-greeting p {
    color: var(--text-secondary);
}

/* Credits bar */
.credits-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.credits-info {
    flex: 1;
    min-width: 200px;
}

.credits-info .label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.credits-progress {
    width: 100%;
    height: 8px;
    background: var(--bg-elevated);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 6px;
}

.credits-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #f97316);
    border-radius: 100px;
    transition: width 0.5s ease;
}

.credits-progress-fill.warning {
    background: linear-gradient(90deg, var(--warning), var(--error));
}

.credits-numbers {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.credits-count {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    min-width: 80px;
    text-align: center;
}

.credits-count small {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Tools Grid */
.tools-section {
    margin-bottom: 32px;
}

.tools-section h2 {
    margin-bottom: 16px;
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

.tool-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}


.tool-card-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    width: 40px;
    text-align: center;
}

.tool-card-info {
    flex: 1;
    min-width: 0;
}

.tool-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 3px;
}

.tool-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-card-credit {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 3px 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Back link */
.back-link {
    display: inline-block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 8px;
    text-decoration: none;
    transition: color 0.2s;
}
.back-link:hover { color: var(--text-primary); }

/* Channel Audit results */
.audit-channel-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 0 16px;
    margin-bottom: 4px;
}

.audit-channel-thumb {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.audit-channel-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.audit-channel-stats {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.audit-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 40px;
}

.audit-table thead th {
    padding: 14px 16px;
    text-align: left;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-input);
    border-bottom: 1px solid var(--border-subtle);
}

.audit-table tbody tr {
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.15s;
}

.audit-table tbody tr:last-child {
    border-bottom: none;
}

.audit-table tbody tr:hover {
    background: var(--bg-input);
}

.audit-table td {
    padding: 14px 16px;
    vertical-align: middle;
}

.audit-thumb-cell {
    width: 80px;
}

.audit-thumb {
    width: 72px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.audit-thumb-placeholder {
    width: 72px;
    height: 40px;
    background: var(--bg-input);
    border-radius: 4px;
}

.audit-title-text {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
}

.audit-title-reason {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.audit-score-cell {
    width: 110px;
    text-align: center;
}

.ctr-badge {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    min-width: 52px;
    text-align: center;
}

.ctr-badge.strong {
    background: rgba(34,197,94,0.15);
    color: #4ade80;
}

.ctr-badge.decent {
    background: rgba(245,158,11,0.15);
    color: #fbbf24;
}

.ctr-badge.weak {
    background: rgba(239,68,68,0.15);
    color: #f87171;
}

.audit-action-cell {
    width: 120px;
    text-align: right;
}

@media (max-width: 768px) {
    .tools-grid { grid-template-columns: 1fr; }
    .audit-thumb-cell { display: none; }
    .audit-table thead th:first-child { display: none; }
}

/* Generator */
.generator-card {
    padding: 40px;
    margin-bottom: 40px;
}

.generator-card h2 {
    margin-bottom: 8px;
}

.generator-card .desc {
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.input-row {
    display: flex;
    gap: 12px;
}

.input-row .form-input {
    flex: 1;
}

/* Results */
.results-card {
    padding: 40px;
    margin-bottom: 24px;
    animation: fadeUp 0.4s ease-out;
}

.title-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    transition: all 0.25s;
    cursor: pointer;
}

.title-option:hover {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.title-option .number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.title-option .text {
    flex: 1;
    font-size: 1.05rem;
    font-weight: 500;
}

.title-option .copy-btn {
    padding: 6px 14px;
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
}

.title-option .copy-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ========== Additional Settings Panel ========== */

.additional-settings-header {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 1rem;
}

.settings-optional {
    font-size: 0.8rem;
    opacity: 0.5;
}

.additional-settings {
    padding: 20px 0 0;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

.example-title-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.example-title-input-row .form-input {
    flex: 1;
}

.example-titles-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.example-title-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    color: var(--text-primary);
}

.example-title-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.example-title-remove {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.example-title-remove:hover {
    border-color: var(--error);
    color: var(--error);
}

/* ========== Description & Tags in Results ========== */

.result-description {
    padding: 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.result-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.result-section-header h4 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
}

.desc-content {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-wrap;
}

.result-tags {
    padding: 16px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.tags-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: var(--secondary-dim);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #a5b4fc;
    white-space: nowrap;
}

.tag-pill.tag-more {
    background: var(--bg-elevated);
    border-color: var(--border-subtle);
    color: var(--text-muted);
}

/* Description preview in history */
.desc-preview {
    margin-top: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.desc-toggle-btn {
    display: inline;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.82rem;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    font-family: var(--font-body);
}

.desc-toggle-btn:hover {
    color: var(--accent-light);
}

.result-tags-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

/* ========== Competitor Card Links ========== */

.yt-card-anchor {
    text-decoration: none;
    color: inherit;
    display: block;
}

.yt-card-anchor:hover {
    color: inherit;
}

.yt-card-link {
    cursor: pointer;
}

.yt-card-link:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* History */
.history-section h2 {
    margin-bottom: 24px;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.history-header h2 {
    margin-bottom: 0;
}

.search-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-input {
    width: 260px;
    padding: 10px 16px !important;
    font-size: 0.9rem !important;
}

.history-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    transition: all 0.2s;
}

.history-item:hover {
    border-color: var(--border-hover);
}

.history-left {
    display: flex;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.history-thumb {
    width: 120px;
    height: 68px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-elevated);
}

.history-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    line-height: 1.3;
}

.history-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.history-status.completed { background: var(--success); }
.history-status.pending, .history-status.transcribing, .history-status.generating { background: var(--warning); }
.history-status.failed { background: var(--error); }

.history-info {
    flex: 1;
    min-width: 0;
}

.history-info .url {
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-info .date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.history-info .titles-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ========== Demo Preview ========== */

.demo-preview {
    padding: 0 0 80px;
    margin-top: -40px;
}

.demo-window {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    max-width: 900px;
    margin: 0 auto;
}

.demo-topbar {
    background: var(--bg-elevated);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-subtle);
}

.demo-topbar .demo-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.demo-content {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 0;
}

.demo-left {
    padding: 24px;
    border-right: 1px solid var(--border-subtle);
}

.demo-right {
    padding: 24px;
}

.demo-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.demo-url-field {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.demo-url-icon {
    color: #ef4444;
    font-size: 0.8rem;
}

.demo-url-text {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.demo-thumbnail {
    margin-bottom: 16px;
}

.demo-thumb-placeholder {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: var(--radius-sm);
    padding: 32px 20px;
    text-align: center;
    position: relative;
}

.demo-play-btn {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.demo-upload-badge {
    display: inline-block;
    background: rgba(234,179,8,0.15);
    color: var(--warning);
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.demo-thumb-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.demo-original-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.demo-original-title {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.demo-titles-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.demo-title-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: border-color 0.2s;
}

.demo-title-item.best {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.demo-title-text {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.demo-title-item.best .demo-title-text {
    font-weight: 600;
}

.demo-title-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    min-width: 36px;
}

.demo-score-num {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
}

.demo-title-item:not(.best) .demo-score-num {
    color: var(--text-secondary);
}

.demo-score-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.demo-note {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 16px;
}

/* Demo Tabs */
.demo-tabs {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
}

.demo-tab {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.demo-tab:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.demo-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #0a0a0f;
}

/* Tab Panels */
.demo-tab-panel {
    display: none;
}

.demo-tab-panel.active {
    display: block;
}

.demo-panel-body {
    padding: 24px;
}

.demo-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.demo-panel-header .demo-label {
    margin-bottom: 0;
}

.demo-panel-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.demo-btn-regen {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    cursor: default;
    white-space: nowrap;
    flex-shrink: 0;
    opacity: 0.7;
}

.demo-panel-footer {
    margin-top: 16px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Description Tab */
.demo-description-preview {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 20px 24px;
}

.demo-description-preview p {
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.demo-description-preview p:last-child {
    margin-bottom: 0;
}

.demo-description-preview .demo-desc-cta {
    color: var(--text-muted);
    font-style: italic;
    border-top: 1px solid var(--border-subtle);
    padding-top: 14px;
    margin-top: 14px;
}

/* Tags Tab */
.demo-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.demo-tag {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.demo-tag.primary {
    background: var(--accent-dim);
    border-color: rgba(245,158,11,0.25);
    color: var(--accent-light);
}

/* Competitors Tab */
.demo-competitors-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.demo-comp-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color 0.2s;
}

.demo-comp-card.yours {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(245,158,11,0.1);
}

.demo-comp-thumb {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.demo-comp-thumb-inner {
    color: var(--text-muted);
    font-size: 0.9rem;
    opacity: 0.5;
}

.demo-comp-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    font-family: var(--font-display);
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--accent);
    color: #0a0a0f;
    padding: 2px 8px;
    border-radius: 4px;
}

.demo-comp-info {
    padding: 10px 12px;
}

.demo-comp-title {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.demo-comp-channel {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.demo-comp-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.demo-comp-views {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.demo-comp-ctr {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 4px;
}

.demo-comp-ctr.high {
    color: var(--accent);
    background: var(--accent-dim);
}

@media (max-width: 768px) {
    .demo-content {
        grid-template-columns: 1fr;
    }
    .demo-left {
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }
    .demo-preview {
        margin-top: -20px;
    }
    .demo-tabs {
        flex-wrap: wrap;
    }
    .demo-competitors-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .demo-panel-header {
        flex-direction: column;
        gap: 8px;
    }
}

/* ========== Footer ========== */

.footer {
    padding: 64px 0 32px;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand .nav-logo {
    font-size: 1.2rem;
    margin-bottom: 12px;
    display: inline-flex;
}

.footer-tagline {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
    margin-top: 12px;
}

.footer-col-title {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.footer-col-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col-links a {
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer-col-links a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ========== Legal Pages ========== */

.legal-page {
    padding: 120px 0 60px;
}

.legal-page h1 {
    margin-bottom: 12px;
}

.legal-page .updated {
    color: var(--text-muted);
    margin-bottom: 48px;
}

.legal-content h2 {
    font-size: 1.3rem;
    margin: 40px 0 16px;
}

.legal-content p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.8;
}

/* ========== Alerts ========== */

.alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.2);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.2);
    color: #86efac;
}

.alert-info {
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.2);
    color: #a5b4fc;
}

/* ========== Loader ========== */

.loader {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    margin-top: 20px;
}

.loader.active {
    display: flex;
}

.loader-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loader-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========== Plan Badge ========== */

.plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    border-radius: 100px;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.plan-badge.free {
    background: var(--secondary-dim);
    color: #a5b4fc;
}

.plan-badge.starter {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.plan-badge.pro {
    background: var(--accent-dim);
    color: var(--accent);
}

/* ========== Animations ========== */

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

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

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

/* ========== Responsive ========== */

@media (max-width: 768px) {
    /* Mobile nav */
    .nav-hamburger { display: flex; }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: rgba(10,10,15,0.97);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border-subtle);
        padding: 8px 0 16px;
    }

    .nav-links.open { display: flex; }

    .nav-links li { width: 100%; }

    .nav-links a {
        display: block;
        padding: 12px 24px;
        font-size: 1rem;
        border-radius: 0;
    }

    .nav-links .btn {
        margin: 8px 24px 0;
        width: calc(100% - 48px);
        text-align: center;
        display: block;
    }

    .hero { padding: 120px 0 60px; }
    .hero-cta { flex-direction: column; align-items: center; }

    .pricing-grid { grid-template-columns: 1fr; max-width: 400px; }
    .features-grid { grid-template-columns: 1fr; }
    .steps { grid-template-columns: 1fr; }

    .dash-header { flex-direction: column; align-items: flex-start; }
    .credits-bar { flex-direction: column; align-items: stretch; }

    .input-row { flex-direction: column; }
    .history-item { flex-wrap: wrap; }
    .history-left { flex-direction: column; }
    .history-thumb { width: 100%; height: auto; max-width: 200px; }
    .history-actions { width: 100%; justify-content: flex-start; margin-top: 12px; }
    .history-header { flex-direction: column; align-items: flex-start; }
    .search-input { width: 100% !important; }
    .search-form { width: 100%; }

    .auth-card { padding: 32px 24px; }

    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .footer-bottom { text-align: center; }
}

@media (max-width: 480px) {
    .container, .container-narrow { padding: 0 16px; }
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ========== History Actions ========== */

.history-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
}

.btn-danger {
    background: rgba(239,68,68,0.1);
    color: #fca5a5;
    border: 1px solid rgba(239,68,68,0.2);
}

.btn-danger:hover {
    background: rgba(239,68,68,0.2);
    border-color: rgba(239,68,68,0.4);
    color: #fca5a5;
}

.btn-regenerate:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ========== Modal ========== */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: fadeUp 0.3s ease-out;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px 28px;
    overflow-y: auto;
}

.modal-gen-info {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-url {
    font-size: 0.9rem;
    color: var(--text-primary);
    word-break: break-all;
}

.modal-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ========== Title Rounds ========== */

.title-round {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.round-header {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--accent);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.round-date {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ========== Utility ========== */

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ========== Pagination ========== */

.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.pagination .btn {
    min-width: 40px;
    text-align: center;
    justify-content: center;
}

.pagination-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 12px;
}

/* ========== Admin Panel ========== */

.admin-search {
    margin-bottom: 24px;
}

.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.admin-table thead {
    background: var(--bg-elevated);
}

.admin-table th {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 14px 12px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-subtle);
}

.admin-table td {
    padding: 12px 12px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background: rgba(255,255,255,0.02);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-credits-form {
    display: flex;
    gap: 6px;
    align-items: center;
}

.admin-credits-input {
    width: 70px !important;
    padding: 8px 10px !important;
    font-size: 0.85rem !important;
    text-align: center;
}

/* ========== Admin Filter Bar ========== */

.admin-filter-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.admin-filter-select {
    width: auto !important;
    min-width: 140px;
    padding: 10px 16px !important;
    font-size: 0.9rem !important;
    cursor: pointer;
    appearance: auto;
}

/* ========== CTR Badges ========== */

.ctr-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: default;
}

.ctr-badge.ctr-high {
    background: rgba(34,197,94,0.15);
    color: #4ade80;
}

.ctr-badge.ctr-mid {
    background: rgba(234,179,8,0.15);
    color: #facc15;
}

.ctr-badge.ctr-low {
    background: rgba(239,68,68,0.15);
    color: #f87171;
}

/* ========== Competitor Comparison — YouTube Simulation ========== */

/* Compare button */
.btn-compare {
    background: var(--secondary-dim);
    color: #a5b4fc;
    border: 1px solid rgba(99,102,241,0.2);
}

.btn-compare:hover {
    background: rgba(99,102,241,0.25);
    border-color: rgba(99,102,241,0.4);
}

/* Wide competitor modal */
.modal-competitor {
    max-width: 1100px;
}

/* Competitors tool results header */
.comp-tool-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

/* View toggle pill (Desktop / Mobile) */
.view-toggle {
    display: flex;
    background: var(--bg-elevated);
    border-radius: 100px;
    padding: 3px;
    border: 1px solid var(--border-subtle);
}

.view-btn {
    padding: 6px 18px;
    border: none;
    border-radius: 100px;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.view-btn.active {
    background: var(--accent);
    color: #000;
}

.view-btn:hover:not(.active) {
    color: var(--text-primary);
}

/* Title selector dropdown bar */
.title-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 28px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    min-height: 48px;
}

.title-selector label {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.title-selector select {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    outline: none;
    cursor: pointer;
    min-width: 0;
}

.title-selector select:focus {
    border-color: var(--accent);
}

/* Desktop grid */
.yt-sim-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

/* YouTube-style card (desktop) */
.yt-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    transition: all 0.25s;
}

.yt-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.yt-card-thumb {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    overflow: hidden;
    background: var(--bg-deep);
}

.yt-card-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yt-card-thumb-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-deep);
}

.yt-card-body {
    padding: 12px;
}

.yt-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

.yt-card-channel {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.yt-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

/* Highlighted user card */
.yt-card.yt-card-user {
    border: 2px solid var(--accent);
    box-shadow: 0 0 20px var(--accent-glow), 0 0 40px rgba(245,158,11,0.1);
}

.yt-card-mobile.yt-card-user {
    border: 2px solid var(--accent);
    box-shadow: 0 0 20px var(--accent-glow), 0 0 40px rgba(245,158,11,0.1);
}

.yt-user-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 10px;
    background: var(--accent);
    color: #000;
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 800;
    border-radius: 100px;
    letter-spacing: 0.06em;
    z-index: 2;
    text-transform: uppercase;
}

/* Mobile list view */
.yt-sim-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 480px;
    margin: 0 auto;
}

.yt-card-mobile {
    position: relative;
    display: flex;
    gap: 12px;
    padding: 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: border-color 0.2s;
}

.yt-card-mobile:hover {
    border-color: var(--border-hover);
}

.yt-card-thumb-mobile {
    width: 160px;
    height: 90px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-deep);
}

.yt-card-thumb-mobile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yt-card-mobile .yt-card-body {
    padding: 0;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.yt-card-mobile .yt-user-badge {
    top: 4px;
    right: auto;
    left: 4px;
    font-size: 0.55rem;
    padding: 2px 7px;
    letter-spacing: 0.04em;
}

/* Responsive tweaks for competitor modal */
@media (max-width: 1140px) {
    .modal-competitor {
        max-width: 95vw;
    }
}

@media (max-width: 768px) {
    .modal-competitor .modal-header {
        flex-wrap: wrap;
        gap: 10px;
    }
    .yt-sim-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 14px;
    }
    .title-selector {
        flex-wrap: wrap;
        padding: 10px 16px;
    }
}

@media (max-width: 480px) {
    .yt-sim-grid {
        grid-template-columns: 1fr;
    }
    .yt-card-thumb-mobile {
        width: 120px;
        height: 68px;
    }
}

/* ========== Status Badges ========== */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    border-radius: 100px;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-badge.status-completed {
    background: rgba(34,197,94,0.15);
    color: #4ade80;
}

.status-badge.status-pending,
.status-badge.status-transcribing,
.status-badge.status-generating {
    background: rgba(234,179,8,0.15);
    color: #facc15;
}

.status-badge.status-failed {
    background: rgba(239,68,68,0.15);
    color: #f87171;
}

.status-badge.processing {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ========== Dashboard History Item Links ========== */

.history-item-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.history-item-link:hover {
    color: inherit;
}

.history-item-link .history-item {
    cursor: pointer;
}

.history-item-link:hover .history-item {
    border-color: var(--accent);
    background: rgba(245,158,11,0.03);
}

.btn-details {
    pointer-events: none;
}

/* ========== Generation Page ========== */

.generation-page {
    padding: 100px 0 60px;
}

.gen-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 24px;
    transition: color 0.2s;
}

.gen-back-link:hover {
    color: var(--accent);
}

/* Header */
.gen-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 32px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.gen-header-left {
    display: flex;
    gap: 20px;
    flex: 1;
    min-width: 0;
}

.gen-header-thumb {
    width: 160px;
    height: 90px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-elevated);
}

.gen-header-info {
    flex: 1;
    min-width: 0;
}

.gen-header-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.3;
}

.gen-header-url {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gen-header-url:hover {
    color: var(--accent);
}

.gen-header-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.gen-header-date {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.gen-header-credits {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Tabs */
.gen-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-subtle);
    margin-bottom: 28px;
}

.gen-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.gen-tab:hover {
    color: var(--text-primary);
}

.gen-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Tab content */
.gen-tab-content {
    display: none;
}

.gen-tab-content.active {
    display: block;
}

/* Sections */
.gen-section {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 20px;
}

.gen-section:hover {
    border-color: var(--border-hover);
}

.gen-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.gen-section-header h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
}

.gen-section-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Settings read-only */
.settings-readonly {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.settings-row {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
    line-height: 1.6;
}

.settings-row:last-child {
    border-bottom: none;
}

.settings-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 8px;
}

.settings-examples {
    margin: 4px 0 0 20px;
    list-style: disc;
}

.settings-examples li {
    padding: 2px 0;
}

/* Title history toggle */
.title-history-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
}

.title-history-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.title-history-toggle:hover {
    color: var(--accent);
}

.title-history-toggle .toggle-arrow {
    transition: transform 0.2s;
}

.title-history-toggle.open .toggle-arrow {
    transform: rotate(90deg);
}

.title-history-rounds {
    margin-top: 16px;
}

/* Competitors container in generation page */
.gen-competitors-container {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.gen-competitors-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

#competitorContent {
    padding: 24px;
}

/* Processing loader on generation page */
.gen-processing-loader {
    text-align: center;
}

/* ========== Generation Page Responsive ========== */

@media (max-width: 768px) {
    .gen-header-left {
        flex-direction: column;
    }

    .gen-header-thumb {
        width: 100%;
        max-width: 240px;
        height: auto;
    }

    .gen-tabs {
        overflow-x: auto;
    }

    .gen-section {
        padding: 20px;
    }

    .gen-section-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .gen-header {
        padding: 16px;
    }

    .gen-tab {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}

/* =============================================
   Cookie Consent Banner
   ============================================= */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
    box-shadow: 0 -4px 32px rgba(0,0,0,0.5);
    padding: 20px 24px;
    animation: cookieSlideUp 0.4s ease-out;
}

@keyframes cookieSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.cookie-banner-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.cookie-banner-text {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex: 1;
}

.cookie-banner-text a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cookie-banner-text a:hover {
    text-decoration: underline;
}

.cookie-banner-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-btn {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cookie-btn-accept {
    background: var(--accent);
    color: #000;
}

.cookie-btn-accept:hover {
    background: var(--accent-light);
    box-shadow: var(--shadow-glow);
}

.cookie-btn-decline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-hover);
}

.cookie-btn-decline:hover {
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.25);
}

@media (max-width: 600px) {
    .cookie-banner { padding: 16px; }
    .cookie-banner-inner { flex-direction: column; text-align: center; gap: 16px; }
    .cookie-banner-actions { width: 100%; }
    .cookie-btn { flex: 1; }
}

/* ========== Guide / SEO Pages ========== */

.guide-page {
    padding: 120px 0 80px;
}

.guide-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

.guide-content h2 {
    font-size: 1.5rem;
    margin: 56px 0 20px;
}

.guide-content h3 {
    font-size: 1.15rem;
    margin: 32px 0 12px;
}

.guide-content p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 18px;
    font-size: 1rem;
}

/* Inline text links must be visually distinguishable without relying on color alone */
.guide-content p a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.guide-content ul, .guide-content ol {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 18px;
    padding-left: 24px;
}

.guide-content li {
    margin-bottom: 8px;
}

.guide-content strong {
    color: var(--text-primary);
}

/* Title example cards (Before/After) */
.title-examples {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 24px 0 32px;
}

.title-example {
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.title-example.bad {
    background: rgba(239,68,68,0.06);
    border-color: rgba(239,68,68,0.15);
}

.title-example.good {
    background: rgba(34,197,94,0.06);
    border-color: rgba(34,197,94,0.15);
}

.title-example-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
}

.title-example.bad .title-example-label { color: #f87171; }
.title-example.good .title-example-label { color: #4ade80; }

.title-example p {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 0;
    line-height: 1.5;
}

/* Callout box */
.guide-callout {
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: var(--radius-md);
    padding: 24px 28px;
    margin: 28px 0;
}

.guide-callout-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--accent);
    margin-bottom: 8px;
}

.guide-callout p {
    color: var(--text-secondary);
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* Mid-page CTA band */
.guide-cta-band {
    text-align: center;
    padding: 48px 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin: 48px 0;
}

.guide-cta-band h3 {
    margin: 0 0 12px;
    font-size: 1.3rem;
}

.guide-cta-band p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Related guides grid */
.related-guides {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 24px 0 48px;
}

.related-guide-card {
    display: block;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all 0.25s;
    text-decoration: none;
}

.related-guide-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.related-guide-card h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.related-guide-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0;
    line-height: 1.5;
}

/* Author block */
.author-block {
    margin: 48px 0;
    padding: 24px 28px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.author-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.author-main {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.author-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-subtle);
}

.author-info {
    flex: 1;
    min-width: 0;
}

.author-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.author-bio {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.author-linkedin {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.author-linkedin:hover {
    color: var(--accent);
}

@media (max-width: 768px) {
    .title-examples { grid-template-columns: 1fr; }
    .related-guides { grid-template-columns: 1fr; }
    .guide-page { padding: 100px 0 60px; }
    .author-block { gap: 16px; padding: 20px; }
    .author-avatar { width: 56px; height: 56px; }
}

@media (max-width: 480px) {
    .guide-content { padding: 0 16px; }
}

/* ========== Category Page ========== */

.category-hero {
    padding: 120px 0 60px;
    text-align: center;
    position: relative;
}

.category-hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%; transform: translateX(-50%);
    width: 80px; height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.category-page {
    padding: 60px 0 100px;
}

.pages-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.page-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px;
    text-decoration: none;
    transition: all 0.25s;
    gap: 12px;
}

.page-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.page-card-title {
    font-size: 1.1rem;
    color: var(--text-primary);
    line-height: 1.3;
    font-family: var(--font-display);
}

.page-card-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
}

.page-card-link {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
    margin-top: auto;
}

@media (max-width: 900px) {
    .pages-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .pages-grid { grid-template-columns: 1fr; }
    .category-hero { padding: 100px 0 40px; }
}

/* ========== Admin CMS Tabs ========== */

.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 6px;
    width: fit-content;
}

.admin-tab-btn {
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-tab-btn.active {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.admin-tab-panel { display: none; }
.admin-tab-panel.active { display: block; }

/* ========== Admin Page Editor Modal ========== */

.admin-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.admin-modal-overlay.open {
    display: flex;
}

.admin-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 820px;
    max-height: 92vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 20px;
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 10;
}

.admin-modal-header h2 {
    font-size: 1.2rem;
    font-family: var(--font-display);
}

.admin-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: color 0.2s;
}

.admin-modal-close:hover { color: var(--text-primary); }

.admin-modal-body {
    padding: 24px 28px;
    flex: 1;
}

.admin-modal-footer {
    padding: 16px 28px 24px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.admin-editor-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.admin-editor-tab {
    padding: 10px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.admin-editor-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.admin-editor-panel { display: none; }
.admin-editor-panel.active { display: block; }

.admin-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.admin-form-group {
    margin-bottom: 16px;
}

.admin-form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.admin-form-group .form-input,
.admin-form-group textarea,
.admin-form-group select {
    width: 100%;
}

.admin-form-group textarea {
    resize: vertical;
    min-height: 80px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.5;
    transition: border-color 0.2s;
}

.admin-form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

/* Quill editor container */
.admin-quill-wrap {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.admin-quill-wrap .ql-toolbar {
    background: var(--bg-elevated);
    border: none;
    border-bottom: 1px solid var(--border-subtle);
}

.admin-quill-wrap .ql-container {
    background: var(--bg-input);
    border: none;
    min-height: 200px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-primary);
}

.admin-quill-wrap .ql-editor { min-height: 200px; }

.admin-quill-wrap .ql-toolbar .ql-stroke { stroke: var(--text-secondary); }
.admin-quill-wrap .ql-toolbar .ql-fill { fill: var(--text-secondary); }
.admin-quill-wrap .ql-toolbar button:hover .ql-stroke,
.admin-quill-wrap .ql-toolbar button.ql-active .ql-stroke { stroke: var(--accent); }
.admin-quill-wrap .ql-toolbar button:hover .ql-fill,
.admin-quill-wrap .ql-toolbar button.ql-active .ql-fill { fill: var(--accent); }
.admin-quill-wrap .ql-toolbar .ql-picker-label { color: var(--text-secondary); }
.admin-quill-wrap .ql-toolbar .ql-picker-options {
    background: var(--bg-elevated);
    border-color: var(--border-subtle);
}

.admin-html-toggle {
    font-size: 0.75rem;
    padding: 4px 10px;
    margin-bottom: 6px;
}

.admin-html-textarea {
    display: none;
    width: 100%;
    min-height: 200px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 12px;
    resize: vertical;
    line-height: 1.5;
}

.admin-html-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

/* FAQ list */
.admin-faq-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }

.admin-faq-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-faq-item-header {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.admin-faq-item-header .admin-faq-remove {
    margin-bottom: 2px;
}

.admin-faq-remove {
    background: none;
    border: none;
    color: var(--error);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    line-height: 1;
    flex-shrink: 0;
}

.admin-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-toggle {
    width: 44px;
    height: 24px;
    appearance: none;
    background: var(--bg-elevated);
    border: 1px solid var(--border-hover);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.admin-toggle::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 16px; height: 16px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.2s;
}

.admin-toggle:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.admin-toggle:checked::after {
    left: 23px;
    background: #000;
}

.admin-char-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.admin-char-hint.warn { color: var(--warning); }
.admin-char-hint.over { color: var(--error); }

/* Pages table action buttons */
.admin-row-actions { display: flex; gap: 6px; }

/* Demo section label */
.demo-section-label {
    font-size: .85rem;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: 0;
}

/* Category small modal */
.admin-modal-sm .admin-modal { max-width: 500px; }
