:root {
    --bg-color: #0d0d0d;
    --sidebar-bg: #000000;
    --card-bg: #171717;
    --text-primary: #ececec;
    --text-secondary: #b4b4b4;
    --text-typewriter: #f0f0f0;
    --accent: #2f2f2f;
    --accent-hover: #3f3f3f;
    --border-color: rgba(255, 255, 255, 0.1);
    --input-bg: #212121;
    --success: #10a37f;
    --sidebar-width: 260px;
    --max-width: 1200px;
    --scrollbar-thumb: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] {
    --bg-color: #ffffff;
    --sidebar-bg: #f9f9f9;
    --card-bg: #ffffff;
    --text-primary: #171717;
    --text-secondary: #676767;
    --text-typewriter: #171717;
    --border-color: #e5e5e5;
    --input-bg: #ffffff;
    --scrollbar-thumb: rgba(0, 0, 0, 0.2);
    --accent: #171717;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

.background-glow {
    display: none;
}

/* Navigation Bar */
.navbar {
    position: relative;
    width: 100%;
    height: 64px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 2000;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-theme-toggle,
.menu-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: 0.2s;
    width: 40px;
    height: 40px;
}

.nav-theme-toggle:hover,
.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .nav-theme-toggle:hover,
[data-theme="light"] .menu-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Mobile Menu Overlay */
.mobile-menu {
    position: fixed;
    top: 64px;
    left: 0;
    width: 100%;
    height: calc(100vh - 64px);
    background: var(--bg-color);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.menu-item {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: 0.2s;
}

.menu-item:hover {
    color: var(--accent);
}

.mobile-bottom-controls {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
}

.feedback-menu-item {
    background: rgba(124, 58, 237, 0.1);
    color: var(--accent);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 0.75rem;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle-mobile {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.logo-icon {
    width: 28px;
    height: 28px;
    transition: filter 0.3s ease;
}

[data-theme="dark"] .logo-icon {
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.1));
}

[data-theme="dark"] .logo-icon path {
    fill: #ffffff !important;
}

/* Page Scaffolding */
.page-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
}

/* Hero Section */
.app-hero {
    padding: 2.5rem 0 0;
    text-align: center;
}

/* Subpage Hero Adjustment */
.main-wrapper .app-hero {
    padding-top: 1.5rem;
}

.hero-badges {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

#status-container {
    margin: auto;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-style: italic;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
}

.stat-badge {
    padding: 0.35rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-text h1 {
    font-size: clamp(1.7rem, 5vw, 2.3rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 1.25rem;
    line-height: 1.1;
}

.gradient-text {
    color: var(--text-primary);
}

.hero-text p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin: 0 auto;
}

.brand-intro {
    font-size: 0.9rem !important;
    opacity: 0.8;
    margin-top: 0.75rem !important;
    font-weight: 500;
}

/* Dashboard Layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    background: var(--bg-color);
    border-radius: 0;
    border: none;
    min-height: 100vh;
    position: relative;
    z-index: 100;
    overflow: hidden;
}

/* Sidebar Tool */
.sidebar-panel {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 0.6rem 1.75rem;
    border-bottom: 1px solid var(--border-color);
    height: 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sidebar-header h3 {
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 0;
}

.sidebar-header p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.sidebar-content {
    padding: 1.75rem 1.75rem 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.section-title {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    display: block;
}

.sidebar-section+.sidebar-section {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.custom-instructions-container {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

.char-counter {
    position: absolute;
    bottom: -1.3rem;
    right: 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    opacity: 0.7;
    pointer-events: none;
    transition: color 0.2s;
}

.char-counter.near-limit {
    color: #ef4444;
    opacity: 1;
}

.refinement-header-group {
    display: flex;
    flex-direction: column;
}

.refinement-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.refinement-subtitle {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-weight: 500;
}

.feature-controls {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.toggle-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.toggle-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.slider {
    position: relative;
    width: 38px;
    height: 20px;
    background: var(--input-bg);
    border-radius: 20px;
    transition: 0.3s;
    border: 1px solid var(--border-color);
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background: var(--text-primary);
    border-radius: 50%;
    transition: 0.3s;
}

input:checked+.slider {
    background: var(--accent);
    border-color: var(--accent);
}

input:checked+.slider:before {
    transform: translateX(18px);
    background: white;
}

.toggle-switch input {
    display: none;
}

.instruction-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.info-tooltip {
    position: relative;
    display: flex;
    cursor: help;
    color: var(--text-secondary);
}

.tooltip-text {
    visibility: hidden;
    background: #000;
    color: #fff;
    text-align: left;
    border-radius: 0.75rem;
    padding: 1rem;
    position: absolute;
    z-index: 2000;
    top: 130%;
    right: -10px;
    left: auto;
    transform: translateY(-5px);
    width: 220px;
    font-size: 0.7rem;
    line-height: 1.5;
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    pointer-events: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.info-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

#custom-instructions {
    width: 100%;
    height: 100%;
    min-height: 140px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.875rem;
    color: var(--text-primary);
    font-size: 0.8125rem;
    resize: none;
    transition: 0.2s;
}

#custom-instructions:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(124, 58, 237, 0.05);
}

.sidebar-footer {
    padding: 1.75rem;
    border-top: 1px solid var(--border-color);
}

.generate-btn {
    width: 100%;
    padding: 1rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.generate-btn:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.generate-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Main Workspace */
.main-workspace {
    display: flex;
    flex-direction: column;
}

.workspace-header {
    padding: 0 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 52px;
}

.workspace-header h2 {
    font-size: 1rem;
    font-weight: 700;
}

.workspace-grid {
    padding: 2rem;
    display: grid;
    grid-template-columns: 0.9fr 1.2fr;
    gap: 2rem;
    flex: 1;
}

.canvas-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: 531px;
}

.upload-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    background: rgba(255, 255, 255, 0.01);
    transition: 0.2s;
}

.upload-area:hover {
    background: rgba(255, 255, 255, 0.02);
}

.upload-content {
    text-align: center;
    color: var(--text-secondary);
}

.upload-content p {
    margin-top: 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.image-preview {
    position: absolute;
    inset: 0;
    display: none;
    background: var(--bg-color);
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.remove-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: #000;
    color: white;
    border: 1px solid var(--border-color);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: 0.2s;
    z-index: 10;
}

/* Result Terminal */
.result-section {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
    justify-content: space-between;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.copy-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.copy-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* .typewriter {
    white-space: pre;
} */
.prompt-box {
    flex: 1;
    background: #000;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.25rem;
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-typewriter);
    overflow-y: auto;
    overflow-x: hidden;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 376px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.prompt-box .placeholder-text {
    margin: 0;
    text-align: center;
    opacity: 0.6;
    white-space: normal;
}

/* Loading State & Scanning Bar */
.loading-state {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin: 0 auto;
    max-width: 300px;
}

.scanning-bar {
    position: absolute;
    top: 0;
    left: -30%;
    width: 30%;
    height: 100%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    animation: scanAnimation 1.5s infinite linear;
    border-radius: 4px;
}

@keyframes scanAnimation {
    0% {
        left: -30%;
    }

    100% {
        left: 100%;
    }
}

.prompt-box #prompt-output {
    margin: 0;
}

.prompt-box #prompt-output.output {
    margin: auto;
}

.error-message {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* Scrollbar styling for prompt box */
.prompt-box::-webkit-scrollbar {
    width: 6px;
}

.prompt-box::-webkit-scrollbar-track {
    background: transparent;
}

.prompt-box::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

.prompt-box::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
}

.share-btn {
    flex: 1;
    padding: 0.65rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 0.65rem;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

/* Showcase Examples Styling */
.showcase-section {
    padding: 3rem 0;
    max-width: var(--max-width);
    margin: 0 auto;
}

.showcase-header {
    text-align: center;
    margin-bottom: 3rem;
}

.showcase-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.showcase-header p {
    color: var(--text-secondary);
}

.showcase-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}

.showcase-card {
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.showcase-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(124, 58, 237, 0.15);
}

.comparison-view {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.75rem;
    position: relative;
}

.comparison-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comparison-column img {
    width: 100%;
    border-radius: 1rem;
    aspect-ratio: 1;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.visual-badge {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
}

.result-badge {
    color: var(--accent);
}

.comparison-divider {
    color: var(--accent);
    opacity: 0.4;
    display: flex;
    align-items: center;
}

.card-content {
    padding: 1.75rem;
    border-top: 1px solid var(--border-color);
}

.prompt-preview .label {
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.prompt-preview p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.pulse-ring {
    position: absolute;
    inset: 0;
    border: 2px solid var(--accent);
    border-radius: 1.5rem;
    opacity: 0;
    pointer-events: none;
    display: none;
}

@keyframes pulse {
    0% {
        transform: scale(0.98);
        opacity: 0.4;
    }

    100% {
        transform: scale(1.02);
        opacity: 0;
    }
}

.showcase-card:hover .pulse-ring {
    animation: pulse 2s infinite;
}

/* SEO Content & Typography Styleguide */
.seo-layout {
    padding: 2.5rem 0;
    max-width: 800px;
    margin: 0 auto;
}

/* Reduced spacing for secondary pages */
.main-wrapper .seo-layout {
    padding: 1rem 0;
}

.seo-content article {
    line-height: 1.8;
}

.seo-content h2,
.prose h2 {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.seo-content h3,
.prose h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 1.75rem 0 0.75rem;
    letter-spacing: -0.01em;
}

.seo-content p,
.prose p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
}

.seo-content strong,
.prose strong {
    color: var(--text-primary);
    font-weight: 700;
}

.seo-content ul,
.prose ul {
    margin-bottom: 1.25rem;
    padding-left: 2rem;
    list-style: none;
}

.seo-content li,
.prose li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    position: relative;
    padding-left: 0.5rem;
}

.seo-content li:before,
.prose li:before {
    content: "→";
    color: var(--accent);
    position: absolute;
    left: -1.75rem;
    font-weight: 900;
    font-family: system-ui;
}

.seo-content a,
.prose a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s;
    border-bottom: 1px solid rgba(124, 58, 237, 0.2);
}

.seo-content a:hover,
.prose a:hover {
    color: var(--accent-hover);
    border-bottom-color: var(--accent-hover);
}

.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
    margin: 2.5rem 0;
}

@media (max-width: 640px) {
    .use-cases-grid {
        grid-template-columns: 1fr;
    }
}

.use-case-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    transition: 0.3s;
}

.use-case-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-hover);
    transform: translateY(-2px);
}

.use-case-item strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.faq-item {
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    gap: 1rem;
}

.faq-arrow {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary);
    min-width: 12px;
}

.faq-item.active .faq-arrow {
    transform: rotate(180deg);
    color: var(--accent);
}

.faq-answer {
    padding: 0 1.5rem 1.75rem;
    color: var(--text-secondary);
    display: none;
}

.faq-item.active .faq-answer {
    display: block;
}

/* Footer & Feedback */
.app-footer {
    background: var(--sidebar-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
}

.footer-nav {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.footer-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.2s;
}

.footer-nav a:hover {
    color: var(--accent);
}

.footer-nav a:hover {
    color: var(--accent);
}

#feedback-trigger {
    background: rgba(124, 58, 237, 0.1);
    color: var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(124, 58, 237, 0.2);
}

#feedback-trigger:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.footer-theme-toggle {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    height: 38px;
    width: 38px;
    line-height: 0.9rem;
    font-size: 1.2rem;
}

.footer-theme-toggle:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.related-keywords {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    opacity: 0.6;
}

.keyword {
    font-size: 0.75rem;
    background: var(--input-bg);
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
}

.footer-credit {
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.copyright {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.5;
}

/* Mobile Flow Refinement (Persistent Sidebar) */
@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
        margin-top: 1.5rem;
        height: auto;
        display: flex;
        flex-direction: column;
    }

    .workspace-header {
        padding: 0;
    }

    .main-workspace {
        order: 1;
        padding: 0 !important;
        /* Move Canvas first */
    }

    .prompt-box {
        min-height: 260px;
    }

    .sidebar-panel {
        order: 2;
        /* Move Control Panel after Canvas */
        width: 100%;
        max-width: none;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        position: relative;
    }

    .workspace-grid .sidebar-footer {
        padding: 0;
        border: none;
        margin-top: 0;
    }

    .workspace-grid {
        grid-template-columns: 1fr;
        padding: 1.5rem 0 !important;
    }

    .showcase-grid {
        grid-template-columns: 1fr;
        padding: 0 1.5rem;
    }

    .hero-text h1 {
        font-size: 2.25rem;
    }

    .seo-layout {
        padding: 2.5rem 1.5rem;
    }
}

@media (max-width: 640px) {
    .page-wrapper {
        padding: 0 1rem 2rem;
    }



    .result-section {
        padding: 1rem;
        gap: 1rem;
    }

    .showcase-grid {
        padding: 0;
    }

    .seo-layout {
        padding: 1.5rem 0;
    }

    .sidebar-content {
        padding: 1rem 1rem 1.8rem;
        gap: 1.5rem;
    }

    .app-hero {
        padding: 1.5rem 0 0;
    }

    .hero-text h1 {
        font-size: 1.8rem;
    }

    .hero-badges {
        margin-bottom: 1.25rem;
    }

    .dashboard-layout {
        margin-top: 1rem;
    }

    .showcase-section {
        padding: 2.5rem 0;
    }

    .showcase-header {
        margin-bottom: 1.5rem;
    }

    .showcase-header h2 {
        font-size: 1.5rem;
    }

    .prose h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .footer-nav {
        gap: 1rem;
    }
}

/* Modals & Forms */
.modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    width: 100%;
    max-width: 500px;
    padding: 2.5rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 800;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.form-group {
    margin-bottom: 1.75rem;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    outline: none;
}

.submit-feedback-btn {
    width: 100%;
    padding: 1rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.submit-feedback-btn:hover {
    background: var(--accent-hover);
}



/* Loader */
.loader {
    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;
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.generate-btn.loading .loader {
    display: block;
}

/* ── Pro Scene Console ─────────────────────────────── */
.pro-console {
    margin-top: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
}

.pro-console.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.console-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.console-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.console-header p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.console-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.console-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.console-section.depth-0 {
    margin-bottom: 1rem;
}

.console-section.depth-1 {
    margin-left: 1rem;
    border-left: 2px solid var(--border-color);
    padding-left: 1rem;
    border-bottom: none;
    padding-bottom: 0.5rem;
}

.console-section.depth-2 {
    margin-left: 1rem;
    border-left: 1px dashed var(--border-color);
    padding-left: 1rem;
    border-bottom: none;
    padding-bottom: 0.25rem;
}

.section-title {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: 0.1em;
}

.depth-1 .section-title {
    font-size: 0.75rem;
}

.depth-2 .section-title {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.depth-3 .section-title {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.console-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

[data-theme="light"] .console-field-group {
    background: #fcfcfc;
}

.console-field-group label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.console-input {
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    border-bottom-color: var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 0;
    font-size: 0.9rem;
    transition: 0.2s;
}

.console-input:focus {
    outline: none;
    border-bottom-color: var(--success);
}

.console-footer {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
}

.pro-btn {
    background: var(--success);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.9rem;
}

.pro-btn:hover {
    background: #0e8a6b;
    transform: translateY(-1px);
}

.status-indicator {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ── Typography & Global Refinement ─────────────────────────────── */
h1,
h2,
h3,
h4 {
    letter-spacing: -0.02em;
}

.app-hero {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
    margin-bottom: 1.5rem;
}

.dashboard-layout {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
}

.sidebar-panel {
    border-right: 1px solid var(--border-color);
}

.main-workspace {
    padding: 0.75rem;
}

.workspace-grid {
    padding: 0.75rem;
    gap: 1.5rem;
}


.result-header {
    margin-bottom: 1rem;
}

.share-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.share-btn {
    flex: 1;
    padding: 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: 0.2s;
}

/* ChatGPT Style Overrides */
[data-theme="dark"] body {
    background-color: #0d0d0d;
}

[data-theme="light"] body {
    background-color: #ffffff;
}

[data-theme="dark"] .sidebar-panel {
    background: #000000;
}

[data-theme="light"] .sidebar-panel {
    background: #f9f9f9;
}

[data-theme="dark"] .prompt-box {
    background: #000000;
}

[data-theme="light"] .prompt-box {
    background: #f4f4f4;
    border-color: transparent;
}

/* ── Remaining Elements ─────────────────────────────── */
@media (max-width: 1024px) {
    .dashboard-layout {
        border-radius: 0;
        border: none;
        max-width: none;
    }

    .pro-console {
        margin: 0.75rem;
        margin-top: 1rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}

/* ── Featured On / Badges Section ─────────────────────────────── */
.badges-section {
    padding: 3rem 1.5rem;
    text-align: center;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
}

.badges-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.2em;
    margin-bottom: 2rem;
}

.badges-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.badge-link {
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s;
}

.badge-link:hover {
    transform: translateY(-2px);
}

.badge-img {
    height: 48px;
    width: auto;
    object-fit: contain;
}

/* Theme-based visibility */
.badge-img--dark {
    display: none;
}

[data-theme="dark"] .badge-img--light {
    display: none;
}

[data-theme="dark"] .badge-img--dark {
    display: inline-block;
}

[data-theme="light"] .badge-img--dark {
    display: none;
}

@media (max-width: 640px) {

    .badge-img {
        height: 30px;
    }
}