/* ============================================
   CSS VARIABLES - Light & Dark Themes
   ============================================ */
:root[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --border-color: #e2e8f0;
    --accent: #2563eb;
    /* slightly darker blue */
    --nav-height: 45px;
    --accent-hover: #1e40af;
    --btn-bg: #f1f5f9;
    --btn-bg-hover: #e2e8f0;
    --success: #047857;
    --error: #ef4444;
    --shadow: none;
    --shadow-lg: none;
}

/* Remove glow/box-shadow effects globally for a flat look */
:root {
    --shadow: none;
    --shadow-lg: none;
}

/* Neutralize remaining explicit box-shadows and pulsing animations used for glow */
.step.active .step-num,
.btn-primary.btn-ready,
.tool-mini-card,
.tool-mini-card:hover,
.tool-card,
.file-card-modern,
.file-card-modern:hover,
.upload-zone,
.tool-card:hover,
.download-file-card,
.download-file-card:hover,
.btn-convert-modern,
.tool-mini-icon,
.format-pill-modern .pill-content,
.format-pill-modern input:checked+.pill-content {
    box-shadow: none !important;
    animation: none !important;
}

/* Remove readyPulse and pulse keyframe effects by overriding animations */
.step.active .step-num {
    animation: none !important;
}

.btn-primary.btn-ready {
    animation: none !important;
}

/* Ensure format pills form a tidy 4-column grid on most viewports; small screens handled above */
.format-pills-modern {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}


:root[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border-color: #334155;
    --accent: #1e40af;
    /* darker blue for backgrounds */
    --accent-text: #6780fc;
    /* lighter blue for text and icons */
    --nav-height: 45px;
    --accent-hover: #133b8a;
    --btn-bg: rgba(255, 255, 255, 0.04);
    --btn-bg-hover: rgba(255, 255, 255, 0.06);
    --success: #059669;
    --error: #f87171;
    --shadow: none;
    --shadow-lg: none;
}

/* Dark mode: use lighter blue for text and icons */
:root[data-theme="dark"] a:not(.btn-primary):not(.btn-secondary):not(.btn-success):not(.btn-ghost):not(.tool-card):not(.tool-mini-card):not(.download-file-card) {
    color: var(--accent-text);
}

:root[data-theme="dark"] .hero-badge,
:root[data-theme="dark"] .nav-link.active,
:root[data-theme="dark"] .step.active .step-num,
:root[data-theme="dark"] .tool-card-svg,
:root[data-theme="dark"] .tool-mini-icon-svg,
:root[data-theme="dark"] .hero-feature-icon,
:root[data-theme="dark"] .promise-spotlight-svg,
:root[data-theme="dark"] .promise-stack-svg,
:root[data-theme="dark"] .story-step-svg,
:root[data-theme="dark"] .roadmap-icon,
:root[data-theme="dark"] .tool-header-icon-svg,
:root[data-theme="dark"] .quota-icon-svg,
:root[data-theme="dark"] .status-text.status-success,
:root[data-theme="dark"] .quality-value-modern,
:root[data-theme="dark"] .file-preview-icon,
:root[data-theme="dark"] .preview-icon,
:root[data-theme="dark"] .mode-icon,
:root[data-theme="dark"] .tool-card-icon,
:root[data-theme="dark"] .promise-spotlight-icon,
:root[data-theme="dark"] .promise-stack-icon,
:root[data-theme="dark"] .roadmap-marker,
:root[data-theme="dark"] .toggle-file-settings:hover,
:root[data-theme="dark"] .single-preview-icon,
:root[data-theme="dark"] .logo-icon,
:root[data-theme="dark"] .upload-icon,
:root[data-theme="dark"] .status-retry,
:root[data-theme="dark"] .rate-count {
    color: var(--accent-text) !important;
}

/* Border and hover colors for interactive elements in dark mode */
:root[data-theme="dark"] .status-retry {
    border-color: var(--accent-text) !important;
}

:root[data-theme="dark"] .status-retry:hover {
    background: var(--accent-text) !important;
    color: #fff !important;
}

:root[data-theme="dark"] .logo:hover .logo-icon {
    color: var(--accent-text) !important;
}

/* Ensure logo text is white in dark mode for maximum legibility */
:root[data-theme="dark"] .logo .logo-text {
    color: #ffffff !important;
}

/* Keep background colors using the darker blue */
:root[data-theme="dark"] .btn-primary,
:root[data-theme="dark"] .step.active .step-num,
:root[data-theme="dark"] .format-pill-modern input:checked+.pill-content {
    background: var(--accent);
}

/* Enhanced download files grid: thumbnails + info + actions (touch-friendly) */
.download-files-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.download-file-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.file-preview-block {
    width: 70px;
    /* square preview as requested */
    height: 70px;
    flex: 0 0 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.download-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.download-preview-fallback {
    /* show fallback icon by default; hidden when image loads */
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
}

.file-info {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.file-title {
    font-weight: 600;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.file-meta {
    font-size: 12px;
    color: var(--text-tertiary);
}

.file-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    /* Constrain actions column to match preview height and keep controls centered */
    max-height: 70px;
    min-height: 70px;
    justify-content: space-between;
    overflow: hidden;
}

.file-select-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
}

.touch-checkbox {
    width: 22px;
    height: 22px;
    transform: scale(1.25);
    cursor: pointer;
}

.btn-download-individual {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
}

/* Unified small action buttons (select + download) */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 92px;
    /* equal width for both buttons */
    height: 40px;
    padding: 0 12px;
    /* added horizontal padding */
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
    border: 1px solid var(--border-color);
    gap: 8px;
    font-size: 13px;
    background: var(--btn-bg);
    transition: background 0.12s ease, color 0.12s ease, transform 0.08s ease;
    border-style: solid;
    border-width: 1px;
}

.select-btn {
    cursor: pointer;
}

.select-btn.selected {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.download-btn {
    cursor: pointer;
}

/* Hover interaction: do not change button color on hover; instead slightly scale the inner content */
.action-btn {
    will-change: transform;
}

.action-btn .select-icon,
.action-btn .download-icon,
.action-btn .select-text,
.action-btn .download-text {
    transition: transform 0.12s ease, opacity 0.12s ease;
}

.action-btn:hover .select-icon,
.action-btn:hover .download-icon,
.action-btn:hover .select-text,
.action-btn:hover .download-text {
    transform: scale(1.06);
}

/* Keep selected buttons' background/color stable; borders are fixed (no hover changes) */
.action-btn {
    border-color: var(--border-color);
}

.action-btn.selected,
.select-btn.selected {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

@media (max-width: 640px) {
    .action-btn {
        width: 70px;
        height: 34px;
    }
}

/* Icon visibility for select button: show unchecked by default, checked when selected */
.select-icon {
    vertical-align: middle;
    opacity: 0.9;
}

.select-btn .select-icon svg,
.download-icon svg {
    width: 16px;
    height: 16px;
}

.select-btn {
    color: var(--text-primary);
}

.select-btn.selected {
    color: #ffffff;
}

@media (max-width: 640px) {
    .download-file-card {
        padding: 10px;
    }

    .file-preview-block {
        width: 60px;
        height: 60px;
        flex: 0 0 60px;
    }

    .file-select-label {
        width: 48px;
        height: 48px;
    }
}


/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    transition: background 0.2s, color 0.2s;
}

.svg-icon {
    display: inline-block;
    vertical-align: middle;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.site-root {
    /* Make the page a column flex container so footer can be pushed to the bottom
       even when content is short. We'll keep header fixed and give `main` the
       necessary top padding to avoid overlap. */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body {
    margin: 0;
}

.main {
    /* Fill remaining space so footer stays at bottom. Add top padding equal to nav height
       so fixed header doesn't overlap content. */
    flex: 1 0 auto;
    padding-top: var(--nav-height);
    min-height: 0;
    /* allow flex children to size correctly */
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    height: var(--nav-height);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--nav-height);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 20px;
}

.logo-icon {
    width: 23px;
    height: 23px;
    color: var(--accent);
    transition: color 0.2s;
}

.logo:hover .logo-icon {
    color: var(--accent-hover);
}

.icon-btn .svg-icon {
    width: 18px;
    height: 18px;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rate-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    height: 27px;
}

.rate-indicator-top {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    line-height: 1;
}

.rate-indicator-bottom {
    font-size: 8px;
    color: var(--text-tertiary);
    line-height: 1;
    margin-top: 1px;
}

.rate-count {
    font-weight: 700;
    color: var(--accent);
}

.rate-label {
    color: var(--text-secondary);
}

.icon-btn {
    padding: 0;
    width: 27px;
    height: 27px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: var(--bg-tertiary);
}

/* Language Toggle Group */
.lang-toggle-group {
    display: flex;
    gap: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    height: 27px;
}

.lang-toggle-btn {
    padding: 0 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.lang-toggle-btn:not(:last-child) {
    border-right: 1px solid var(--border-color);
}

.lang-toggle-btn:hover:not(.active) {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.lang-toggle-btn.active {
    background: var(--accent);
    color: white;
    font-weight: 700;
}

[data-theme="light"] .icon-dark {
    display: none;
}

[data-theme="dark"] .icon-light {
    display: none;
}

.icon-light {
    color: #fbbf24;
}

.icon-dark {
    color: #6366f1;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    position: relative;
    padding: 140px 0 100px;
    overflow: hidden;
    background: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(37, 99, 235, 0.15), transparent);
}

.hero-glow {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle at center, rgba(37, 99, 235, 0.2), transparent 70%);
    filter: blur(60px);
    pointer-events: none;
    opacity: 0.6;
}

.hero-content {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 18px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.2);
    color: #fff;
    /* text should be white only — keep background/border as-is */
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.hero-title {
    font-size: clamp(40px, 6vw, 72px);
    font-weight: 800;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 50%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.hero-subtitle {
    font-size: 19px;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0;
}

.hero-actions {
    display: flex;
    gap: 14px;
    margin-top: 8px;
}

.hero-features {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 12px;
    justify-content: center;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.hero-feature-icon {
    color: var(--accent);
    opacity: 0.8;
}

/* ============================================
   TOOLS SECTION - GRID LAYOUT
   ============================================ */
.tools-section {
    padding: 100px 0 80px;
    background: var(--bg-primary);
}

.tools-header {
    max-width: 720px;
    margin: 0 auto 44px;
    text-align: center;
}

.tools-header h2 {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.tools-header p {
    font-size: 17px;
    color: var(--text-secondary);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.tool-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 32px 28px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 200px;
}

.tool-card:hover {
    transform: translateY(-4px);
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.tool-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 14px;
    color: var(--accent);
}

.tool-card-name {
    font-size: 19px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.tool-card-desc {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
    flex: 1;
}

.tool-card-arrow {
    position: absolute;
    bottom: 28px;
    right: 28px;
    color: var(--accent);
    opacity: 0;
    transform: translateX(-6px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-card:hover .tool-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

.tools-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 14px;
    color: var(--text-tertiary);
    font-style: italic;
}

/* ============================================
   PROMISE SECTION - SPLIT SPOTLIGHT LAYOUT
   ============================================ */
.promise-section {
    padding: 100px 0 80px;
    background: var(--bg-secondary);
}

.promise-header {
    max-width: 720px;
    margin: 0 auto 50px;
    text-align: center;
}

.promise-header h2 {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.promise-header p {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.promise-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: start;
}

/* On wide screens make the left spotlight match the combined height of the
   stacked cards on the right by stretching the grid row and sizing the
   spotlight card to 100%. */
@media (min-width: 1024px) {
    .promise-layout {
        align-items: stretch;
    }

    .promise-spotlight-card {
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    /* ensure the stack column grows naturally and preserves spacing */
    .promise-stack {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
}

.promise-spotlight {
    position: sticky;
    top: 120px;
}

.promise-spotlight-card {
    padding: 40px 36px;
    background: linear-gradient(150deg, rgba(37, 99, 235, 0.08) 0%, rgba(139, 92, 246, 0.06) 100%);
    border: 2px solid rgba(37, 99, 235, 0.2);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.promise-spotlight-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: rgba(37, 99, 235, 0.15);
    color: var(--accent);
}

.promise-spotlight-card h3 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.promise-spotlight-card p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0;
}

.promise-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.promise-stack-card {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 24px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.promise-stack-card:hover {
    transform: translateX(8px);
    border-color: rgba(37, 99, 235, 0.3);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.promise-stack-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent);
}

.promise-stack-content h4 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.promise-stack-content p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================
   STORY SECTION - COMPACT TIMELINE WITH NUMBERS
   ============================================ */
.story-section {
    padding: 80px 0 70px;
    background: var(--bg-primary);
}

.story-header {
    max-width: 720px;
    margin: 0 auto 40px;
    text-align: center;
}

.story-header h2 {
    font-size: clamp(28px, 3.5vw, 42px);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.story-header p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.story-timeline {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
}

.story-timeline::before {
    content: "";
    position: absolute;
    left: 38px;
    top: 45px;
    bottom: 45px;
    width: 2px;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.25) 0%, rgba(139, 92, 246, 0.15) 100%);
}

.story-step {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 24px;
    align-items: start;
    position: relative;
}

.story-step-number {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
    border-radius: 50%;
    font-size: 26px;
    font-weight: 800;
    color: white;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25);
}

.story-step-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.story-step:hover .story-step-content {
    transform: translateY(-3px);
    border-color: rgba(37, 99, 235, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.story-step-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent);
}

.story-step-content h3 {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.story-step-content p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================
   ROADMAP
   ============================================ */
.roadmap-section {
    padding: 90px 0 70px;
}

.roadmap-section .section-head {
    max-width: 720px;
    margin: 0 auto 28px;
    text-align: center;
}

.roadmap-section .section-head h2 {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.roadmap-section .section-head p {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 28px;
    /* add space between paragraph and roadmap items */
}

.roadmap-timeline {
    display: grid;
    gap: 20px;
}

.roadmap-item {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 16px;
    align-items: start;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 22px 26px;
}

.roadmap-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(37, 99, 235, 0.12);
    color: var(--accent);
}

.roadmap-content h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.roadmap-content p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ============================================
   FAQ Section
   ============================================ */
.faq-section {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.faq-section .section-head {
    text-align: center;
    margin-bottom: 48px;
}

.faq-section .section-head h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.faq-section .section-head p {
    font-size: 16px;
    color: var(--text-secondary);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.faq-item {
    padding: 28px;
    border-radius: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.08);
    transform: translateY(-2px);
}

.faq-item h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    line-height: 1.4;
}

.faq-item p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0;
}

/* Dark mode FAQ */
[data-theme="dark"] .faq-section {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .faq-item {
    background: var(--bg-secondary);
}

/* ============================================
   CTA
   ============================================ */
.cta-section {
    padding: 80px 0 100px;
}

.cta-card {
    position: relative;
    overflow: hidden;
    padding: 48px;
    border-radius: 26px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.75) 0%, rgba(75, 85, 200, 0.7) 100%);
    color: #ffffff;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.cta-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.18);
    pointer-events: none;
}

.cta-card h2 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
}

.cta-card p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.88);
}

.cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 1024px) {
    .hero {
        padding: 100px 0 70px;
    }

    .promise-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .promise-spotlight {
        position: static;
    }

    .story-timeline::before {
        left: 32px;
    }

    .story-step {
        grid-template-columns: 64px 1fr;
        gap: 20px;
    }

    .story-step-number {
        width: 64px;
        height: 64px;
        font-size: 22px;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 90px 0 60px;
    }

    .hero-title {
        font-size: 42px;
    }

    .hero-subtitle {
        font-size: 17px;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions a {
        width: 100%;
        justify-content: center;
    }

    .hero-features {
        flex-direction: column;
        align-items: flex-start;
    }

    .tools-header h2 {
        font-size: 32px;
    }

    .tools-grid {
        gap: 16px;
    }

    .promise-header h2,
    .story-header h2 {
        font-size: 28px;
    }

    .promise-spotlight-card {
        padding: 32px 28px;
    }

    .promise-stack-card {
        padding: 20px;
    }

    .story-timeline::before {
        left: 26px;
    }

    .story-step {
        grid-template-columns: 52px 1fr;
        gap: 18px;
    }

    .story-step-number {
        width: 52px;
        height: 52px;
        font-size: 20px;
    }

    .story-step-content {
        padding: 20px;
    }

    .roadmap-item {
        padding: 22px;
        grid-template-columns: 48px 1fr;
    }

    .cta-card {
        padding: 40px 28px;
    }
}

@media (max-width: 520px) {
    .hero-badge {
        align-self: center;
    }

    .hero-title {
        font-size: 36px;
    }

    .story-timeline::before {
        display: none;
    }

    .story-step {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .story-step-number {
        width: 48px;
        height: 48px;
        font-size: 18px;
        margin: 0 auto;
    }

    .roadmap-item {
        grid-template-columns: 1fr;
    }

    .roadmap-marker {
        margin-bottom: 12px;
    }
}

/* ============================================
   TOOL CONTAINER & STEPS
   ============================================ */
.tool-container {
    /* Reduce vertical spacing so steps sit closer to header */
    padding: 20px 0;
}

.steps {
    display: flex;
    justify-content: center;
    /* Reduced gap between circles for more compact layout */
    --step-gap: 12px;
    --circle-size: 26px;
    /* reduced from 28px */
    gap: var(--step-gap);
    margin: 8px 0 20px 0;
    align-items: center;
    position: relative;
    flex-wrap: nowrap;
    /* Always keep in a row */
    /* overflow-x: auto; */
    /* scrollbar-width: thin; */
    /* -webkit-overflow-scrolling: touch; */
    padding: 0 6px;
}

.steps::-webkit-scrollbar {
    height: 4px;
}

.steps::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 999px;
}

/* Modern circular step indicators: number inside a circle, label below */
.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0;
    background: transparent;
    border-radius: 8px;
    font-size: 10px;
    opacity: 0.95;
    width: 65px;
    /* reduced from 70px */
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.step:hover:not(.disabled) .step-num {
    transform: translateY(-3px) scale(1.08);
}

.step.disabled {
    cursor: not-allowed;
    opacity: 0.35;
    pointer-events: none;
}

/* Circle for the number - default state (not started) */
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--circle-size);
    height: var(--circle-size);
    border-radius: 50%;
    background: transparent;
    /* hollow by default */
    color: var(--text-tertiary);
    font-weight: 700;
    font-size: 15px;
    border: 3px solid var(--border-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    position: relative;
    /* for connector pseudo-element */
    z-index: 2;
    /* keep circle above connector */
}

.step-label {
    font-weight: 600;
    font-size: 9px;
    /* reduced from 10px */
    color: var(--text-tertiary);
    text-align: center;
    line-height: 1.2;
    transition: all 0.3s ease;
}

/* Active step: filled with vibrant accent color */
.step.active .step-num {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #ffffff;
    border-color: var(--accent);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
    }

    50% {
        box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
    }
}

.step.active .step-label {
    color: var(--text-primary);
    font-weight: 700;
}

/* Completed step: solid success color with checkmark */
.step.completed .step-num {
    background: var(--success);
    color: #ffffff;
    border-color: var(--success);
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.25);
}

.step.completed .step-label {
    color: var(--text-primary);
    font-weight: 600;
}

/* Check icon styling for completed steps */
.step-check-icon {
    width: 16px;
    height: 16px;
}

@media (max-width: 480px) {
    .steps {
        gap: 8px;
        --circle-size: 22px;
        --step-gap: 10px;
    }

    .step {
        width: 50px;
    }

    .step-num {
        font-size: 11px;
    }

    .step-label {
        font-size: 8px;
    }

    .step-check-icon {
        width: 12px;
        height: 12px;
    }
}

/* Draw connectors between step circles */
.step:not(:last-child) .step-num::after {
    /* remove per-circle connector pieces because the baseline is now a single continuous line */
    display: none;
}

/* Make connector accent-colored for completed/active preceding steps */
.step.completed .step-num::after,
.step.active .step-num::after {
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
}

/* Reduce connector length on very small screens */
@media (max-width: 480px) {
    .step:not(:last-child) .step-num::after {
        width: 18px;
        height: 2px;
    }
}

/* ============================================
   UPLOAD ZONE
   ============================================ */
.upload-zone {
    max-width: 600px;
    margin: 0 auto;
    padding: 60px 40px;
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-zone:hover {
    border-color: var(--accent);
    background: var(--bg-tertiary);
}

/* Compact/Shrunk state */
.upload-zone.compact {
    padding: 24px 30px;
    margin-bottom: 20px;
}

.upload-zone.compact .upload-icon {
    display: none;
}

.upload-zone.compact h2 {
    font-size: 18px;
    margin-bottom: 4px;
}

.upload-zone.compact p {
    font-size: 13px;
    margin-bottom: 12px;
}

.upload-zone.compact .btn-primary {
    padding: 8px 16px;
    font-size: 14px;
}

.upload-zone.compact .upload-info {
    display: none;
}

.upload-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--accent);
}

.upload-icon .svg-icon {
    width: 64px;
    height: 64px;
}

.upload-zone h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.upload-zone p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Tool header: title + short description shown between steps and upload zone */
.tool-header {
    max-width: 600px;
    margin: 6px auto 18px;
    text-align: center;
    padding: 0 12px;
}

/* Header for each tool: icon + title + description */
.tool-header {
    max-width: 600px;
    margin: 6px auto 18px;
    text-align: center;
    padding: 0 12px;
}

.tool-header-flex {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.tool-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    color: var(--accent);
}

.tool-header-icon .svg-icon {
    width: 34px;
    height: 34px;
}

.tool-title {
    font-size: 30px;
    /* increased title size for upload pages */
    font-weight: 700;
    margin-bottom: 5px;
    display: inline-block;
    /* keep it inline with icon */
}

.tool-desc {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.upload-info {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.upload-info small {
    color: var(--text-tertiary);
    font-size: 12px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary,
.btn-secondary,
.btn-download,
.btn-ghost {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary.btn-ready {
    background: var(--accent);
    animation: readyPulse 1.6s ease-in-out infinite;
}

@keyframes readyPulse {

    0%,
    100% {
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.28);
    }

    50% {
        box-shadow: 0 6px 18px rgba(59, 130, 246, 0.45);
    }
}

.btn-primary.btn-ready:hover {
    background: var(--accent-hover);
    opacity: 1;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(148, 163, 184, 0.55);
}

.btn-ghost:hover {
    background: var(--bg-secondary);
}

.btn-download {
    background: var(--success);
    color: white;
    padding: 8px 16px;
    font-size: 14px;
    gap: 8px;
}

.btn-download:hover {
    opacity: 0.9;
}

.btn-icon {
    flex-shrink: 0;
}

/* ============================================
   FORMS
   ============================================ */
.setup-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 32px;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.uploaded-files-panel {
    margin: 24px 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.uploaded-files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
}

.uploaded-files-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.uploaded-files-count {
    font-size: 14px;
    color: var(--text-secondary);
}

.uploaded-files-list {
    list-style: none;
    padding: 0 24px 18px;
}

.uploaded-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.uploaded-file-item:last-child {
    border-bottom: none;
}

.uploaded-file-name {
    font-weight: 600;
    color: var(--text-primary);
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.uploaded-file-meta {
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', 'Fira Code', 'SFMono-Regular', monospace;
}

.setup-form h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.setup-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 14px;
}

.format-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.format-option {
    position: relative;
    cursor: pointer;
}

.format-option input {
    position: absolute;
    opacity: 0;
}

.format-label {
    display: block;
    padding: 10px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
}

.format-option input:checked+.format-label {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.quality-options {
    display: flex;
    gap: 12px;
}

.quality-options label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.quality-options input {
    margin: 0;
}

/* ============================================
   FILES LIST
   ============================================ */
.files-list {
    max-width: 600px;
    margin: 0 auto 40px;
}

.files-list h3 {
    font-size: 18px;
    margin-bottom: 16px;
}

.files-list>.btn-primary {
    display: block;
    margin-left: auto;
    margin-right: 0;
    width: fit-content;
}

#files-container {
    margin-bottom: 20px;
    /* Allow the page to scroll instead of the inner files container.
       Removing fixed max-height and overflow prevents an inner scrollbar
       so long lists will grow the page height and the main page scrolls. */
    max-height: none;
    overflow: visible;
    padding: 2px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s;
    gap: 12px;
}

.file-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
}

.file-preview-img {
    width: 85px;
    height: 85px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.file-icon {
    width: 85px;
    height: 85px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.file-info-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 12px;
    color: var(--text-tertiary);
}

.file-progress-container {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.file-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.file-progress-bar.complete {
    background: var(--success);
}

.file-status {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
    font-weight: 600;
}

.status-text {
    color: var(--text-secondary);
}

.status-success {
    color: var(--success);
}

.status-error {
    color: var(--error);
}

.status-retry {
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.status-retry:hover {
    background: var(--accent);
    color: #fff;
}

.files-list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.files-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 6px;
}

.upload-summary {
    text-align: right;
    min-width: 160px;
}

.upload-summary.hidden {
    display: none;
}

.upload-summary.has-error #upload-summary-text {
    color: var(--error);
}

#upload-summary-text {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

#upload-summary-hint {
    display: block;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.file-remove {
    padding: 6px 10px;
    background: transparent;
    color: var(--text-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    transition: all 0.2s;
    flex-shrink: 0;
}

.file-remove:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
    transform: scale(1.1);
}

/* Upload Progress */
#upload-progress-container {
    display: none;
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.upload-progress-bar-container {
    position: relative;
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 12px;
}

#upload-progress-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    border-radius: 20px;
    transition: width 0.3s ease;
}

#upload-progress-text {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ============================================
   DOWNLOAD SECTION
   ============================================ */
.download-section {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    padding: 40px 24px;
}

.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--success);
    margin-bottom: 24px;
    animation: successPop 0.5s ease;
}

@keyframes successPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-icon .svg-icon {
    width: 64px;
    height: 64px;
}

.download-section h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.download-section p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.download-bulk-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.btn-select-all,
.btn-download-selected {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-download-selected:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-success {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    background: var(--success);
    color: white;
}

.btn-success:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.selected-count {
    font-size: 12px;
    opacity: 0.9;
}

.download-files {
    margin-bottom: 32px;
    text-align: left;
}

/* Single-file simplified download view */
.single-download-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    max-width: 500px;
    margin: 0 auto 32px;
    padding: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.single-preview {
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.single-preview .preview-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.single-preview-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
}

.single-info {
    text-align: center;
    width: 100%;
}

.single-info .file-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    word-break: break-word;
}

.conversion-info {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-weight: 600;
}

.btn-download-single {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 32px;
    font-size: 16px;
}

@media (max-width: 640px) {
    .single-download-view {
        padding: 24px 16px;
    }

    .single-preview {
        width: 150px;
        height: 150px;
    }
}

.download-file-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
}

.download-file-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
}

.download-file-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.download-file-info {
    flex: 1;
    min-width: 0;
}

.file-name-download {
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-download-individual {
    padding: 8px 12px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-download-individual:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.download-file {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 8px;
}

.file-name {
    font-weight: 600;
    font-size: 14px;
}

.download-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

/* ============================================
   OTHER TOOLS
   ============================================ */
.other-tools {
    padding: 60px 0;
    /* Remove the section background so it blends with surrounding layout */
    background: transparent;
}

.other-tools h3 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 32px;
}

.tools-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
}

.tool-mini-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: linear-gradient(180deg, var(--bg-primary) 0%, rgba(0, 0, 0, 0.02) 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 15px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    box-shadow: var(--shadow);
    align-items: center;
    min-height: 64px;
}

.tool-mini-card:hover {
    border-color: var(--accent);
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.tool-mini-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: transparent;
    color: var(--accent);
    flex: 0 0 44px;
}

.tool-mini-icon .svg-icon {
    width: 100%;
    height: 100%;
}

/* Slightly larger icon spacing on small screens */
@media (max-width: 480px) {
    .tool-mini-card {
        gap: 12px;
        padding: 14px;
    }

    .tool-mini-icon {
        width: 40px;
        height: 40px;
    }
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    padding: 32px 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
}

.footer-content {
    text-align: center;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
}

.footer-links {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent);
}

/* Footer Install Button */
.footer-install-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.footer-install-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.footer-install-btn svg {
    flex-shrink: 0;
}

.footer-install-btn.hidden {
    display: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .hero-title {
        font-size: 36px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    /* Keep steps in a row, but make them smaller */
    .steps {
        gap: 6px;
        --circle-size: 24px;
        --step-gap: 12px;
    }

    .step {
        width: 55px;
    }

    .step-num {
        font-size: 11px;
    }

    .step-label {
        font-size: 8px;
    }

    .setup-form {
        padding: 24px;
    }

    .format-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
}

/* Make download section use only the container's padding on small screens so it matches Other tools */
@media (max-width: 640px) {
    .download-section {
        /* remove internal padding so the outer .container 0 16px provides the single padding */
        padding: 0;
    }

    /* slightly tighten spacing inside download section for mobile */
    .download-section h2 {
        margin-top: 12px;
        margin-bottom: 8px;
    }

    .download-section p {
        margin-bottom: 12px;
    }
}

/* ============================================
   COMPACT SETUP FORM - BULK/INDIVIDUAL MODE
   ============================================ */
.setup-form-compact {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.setup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.setup-header h2 {
    font-size: 22px;
    margin: 0;
}

.settings-mode-toggle {
    display: flex;
    gap: 8px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 8px;
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.mode-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.mode-btn.active {
    background: var(--accent);
    color: white;
}

.mode-icon {
    width: 16px;
    height: 16px;
}

.settings-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.settings-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-compact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.form-group-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group-compact label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group-compact select {
    padding: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.format-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 6px;
}

.format-option-compact {
    position: relative;
    cursor: pointer;
}

.format-option-compact input {
    position: absolute;
    opacity: 0;
}

.format-option-compact .format-label {
    display: block;
    padding: 8px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.2s;
}

.format-option-compact input:checked+.format-label {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.quality-options-compact {
    display: flex;
    gap: 8px;
}

.quality-options-compact label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.quality-options-compact label:has(input:checked) {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.quality-options-compact input {
    margin: 0;
}

/* Individual Settings Panel */
.files-settings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.file-settings-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
}

.file-settings-item:hover {
    border-color: var(--accent);
}

.file-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
}

.file-info-compact {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.file-name-compact {
    font-size: 14px;
    font-weight: 600;
}

.file-size-compact {
    font-size: 12px;
    color: var(--text-tertiary);
}

.toggle-file-settings {
    padding: 6px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-file-settings:hover {
    color: var(--accent);
}

.toggle-file-settings.expanded {
    transform: rotate(180deg);
}

.file-settings-body {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.btn-convert {
    width: 100%;
    margin-top: 20px;
    position: relative;
}

.spinner-small {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 640px) {
    .settings-mode-toggle {
        width: 100%;
    }

    .mode-btn {
        flex: 1;
        justify-content: center;
    }

    .settings-compact-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   LOADING OVERLAYS & SPINNERS
   ============================================ */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-message {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    animation: pulse 2s ease-in-out infinite;
}

.spinner-large {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   MODERN SETUP PAGE STYLES
   ============================================ */
.setup-modern-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px;
}

/* On small screens keep only the container padding (16px) and remove any extra internal padding
   from children so the setup section aligns with Other tools behavior */
@media (max-width: 640px) {
    .setup-modern-container {
        padding: 0;
        /* remove container padding on mobile so inner cards retain their padding */
    }

    /* Restore internal card padding (no double gutters) and tighten vertical spacing */
    .file-card-modern {
        margin-bottom: 10px;
    }

    .setup-action-selector {
        width: 100%;
    }

    .action-pills {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }
}

.setup-modern-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.setup-modern-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.setup-title-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.setup-action-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 240px;
}

.action-pills {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.setting-static-value {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-secondary);
    width: fit-content;
}

.action-helper-text {
    font-size: 13px;
    color: var(--text-tertiary);
    line-height: 1.5;
}

.mode-toggle-modern {
    display: flex;
    gap: 0;
    /* Render buttons visually in reverse order so "Apply to All" appears on the right
       while keeping DOM order intact for accessibility and event handlers. */
    flex-direction: row-reverse;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.mode-btn-modern {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.mode-btn-modern+.mode-btn-modern {
    /* Use adjacent selector to draw a divider between the two buttons. This
       plays nicely with row-reverse since it targets the second button in DOM
       order and results in a single divider between them visually. */
    border-left: 1px solid var(--border-color);
}

.mode-btn-modern:hover:not(.active) {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.mode-btn-modern.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
}

.mode-btn-modern .mode-icon {
    transition: transform 0.3s ease;
}

.mode-btn-modern.active .mode-icon {
    transform: scale(1.1);
}

/* Settings Mode Panels */
.settings-mode-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.settings-mode-panel.active {
    display: block;
}

.bulk-settings-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

/* Modern Settings Grid */
.settings-grid-modern {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.setting-group-modern {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-label-modern {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.optional-tag {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    font-style: italic;
}

/* Format Pills (Modern Radio Buttons) */
.format-pills-modern {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.format-pill-modern {
    position: relative;
    cursor: pointer;
}

.format-pill-modern input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.format-pill-modern .pill-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1;
    text-align: center;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.format-pill-modern:hover .pill-content {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.format-pill-modern input:checked+.pill-content {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border-color: var(--accent);
    color: white;
    transform: translateY(-1px);
}

/* Quality Slider */
.quality-slider-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quality-slider-modern {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right,
            #991b1b 0%,
            #9a3412 33%,
            #065f46 66%,
            #064e3b 100%);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.quality-slider-modern::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
}

.quality-slider-modern::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.quality-slider-modern::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
}

.quality-slider-modern::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.quality-labels-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-tertiary);
}

.quality-value-modern {
    font-weight: 700;
    color: var(--accent);
    font-size: 14px;
}

/* Modern Select Dropdown */
.select-modern {
    width: 100%;
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.select-modern:hover {
    border-color: var(--accent);
}

.select-modern:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* File Cards */
.files-cards-modern {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

/* Responsive grid for setup file cards: 1 column on small screens, 3 columns on wide screens */
@media (min-width: 900px) {
    .files-cards-modern {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }
}

@media (min-width: 640px) and (max-width: 899px) {
    .files-cards-modern {
        grid-template-columns: repeat(2, 1fr);
    }
}

.file-card-modern {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.file-card-modern:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.file-card-header-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-primary);
}

.file-preview-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.file-preview-placeholder {
    width: 85px;
    height: 85px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    overflow: hidden;
}

.file-preview-image-modern {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-meta-modern {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.file-name-modern {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.file-size-modern {
    font-size: 12px;
    color: var(--text-tertiary);
}

.file-extra-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.file-extra-meta.meta-visible {
    color: var(--text-secondary);
}

.audio-preview-player {
    width: 100%;
    height: 32px;
}

.audio-preview-player::-webkit-media-controls-panel {
    background: transparent;
}

.expand-btn-modern {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.expand-btn-modern:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.expand-btn-modern.expanded .expand-icon {
    transform: rotate(180deg);
}

.expand-icon {
    transition: transform 0.3s ease;
}

.file-card-body-modern {
    padding: 16px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

/* Convert Button */
.convert-action-modern {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn-convert-modern {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-convert-modern:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-convert-modern:active:not(:disabled) {
    transform: translateY(0);
}

.btn-convert-modern:disabled {
    opacity: 0.6;
    cursor: not-started;
}

.btn-convert-modern.loading {
    background: linear-gradient(135deg, var(--success), #059669);
}

.convert-progress-text {
    font-size: 14px;
}

.btn-icon-modern {
    transition: transform 0.3s ease;
}

.btn-convert-modern:hover:not(:disabled) .btn-icon-modern {
    transform: translateX(4px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .setup-modern-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .mode-toggle-modern {
        width: 100%;
    }

    .mode-btn-modern {
        flex: 1;
        justify-content: center;
    }

    .file-preview-placeholder {
        width: 50px;
        height: 50px;
    }

    .format-pills-modern {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }

    .convert-action-modern {
        justify-content: stretch;
    }

    .btn-convert-modern {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   COOKIE CONSENT BANNER
   ============================================ */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 16px 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-consent-message {
    margin: 0;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    flex: 1;
    min-width: 200px;
}

.cookie-consent-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cookie-btn {
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.cookie-btn-accept {
    background-color: var(--accent);
    color: white;
}

.cookie-btn-accept:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.cookie-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.cookie-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .cookie-consent-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .cookie-consent-actions {
        width: 100%;
        justify-content: space-between;
    }

    .cookie-btn {
        flex: 1;
    }
}

/* ============================================
   QUOTA BADGE STATES
   ============================================ */
.tool-quota-badge {
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.tool-quota-badge.quota-low {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #d97706;
}

.tool-quota-badge.quota-exhausted {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #dc2626;
}

:root[data-theme="dark"] .tool-quota-badge.quota-low {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

:root[data-theme="dark"] .tool-quota-badge.quota-exhausted {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}
