:root {
    --bg-base: #f8fafc;
    --bg-panel: rgba(255, 255, 255, 0.85);
    --bg-panel-solid: #ffffff;
    --bg-darker: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: rgba(15, 23, 42, 0.08);
    --border-strong: rgba(15, 23, 42, 0.15);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.1);
    --success: #10b981;
    --danger: #ef4444;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    --shadow-glass: 0 10px 40px -10px rgba(31, 38, 135, 0.15);
    --glass-blur: blur(16px);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

[data-theme="dark"] {
    --bg-base: #0f172a;
    --bg-panel: rgba(30, 41, 59, 0.7);
    --bg-panel-solid: #1e293b;
    --bg-darker: #0b1120;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.15);
    --primary: #60a5fa;
    --primary-hover: #93c5fd;
    --primary-light: rgba(96, 165, 250, 0.15);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-glass: 0 10px 40px -10px rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    background-image: radial-gradient(at 0% 0%, hsla(253,16%,7%,0) 0, transparent 50%), 
                      radial-gradient(at 50% 0%, hsla(225,39%,30%,0.05) 0, transparent 50%), 
                      radial-gradient(at 100% 0%, hsla(339,49%,30%,0.05) 0, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.5;
    transition: var(--transition);
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
}

/* Utilities */
@keyframes blink {
    0% { opacity: 1; box-shadow: 0 0 0 0 var(--primary-light); }
    50% { opacity: 0.8; box-shadow: 0 0 15px 5px var(--primary-light); }
    100% { opacity: 1; box-shadow: 0 0 0 0 var(--primary-light); }
}
.blink-btn { animation: blink 1.5s infinite; }

@keyframes bounceRight {
    0%, 100% { left: -60px; }
    50% { left: -40px; }
}

.btn-indicator {
    position: absolute;
    left: -60px;
    top: 50%;
    margin-top: -24px;
    font-size: 3rem;
    color: var(--primary);
    pointer-events: none;
    animation: bounceRight 1.5s infinite;
    z-index: 10;
    transform: rotate(90deg);
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-auto { margin-top: auto; }
.mb-4 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-1 { margin-bottom: 0.25rem; }
.w-full { width: 100%; }
.clear-margin { margin: 0 !important; }
.block { display: block; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.flex-col { flex-direction: column; }
.gap-3 { gap: 0.75rem; }
.p-3 { padding: 0.75rem; }
.bg-darker { background-color: var(--bg-darker); }
.rounded-lg { border-radius: var(--radius-md); }
.border { border: 1px solid var(--border); }
.border-border { border-color: var(--border); }

/* Buttons */
.btn {
    display: inline-flex;
    position: relative;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: var(--font-heading);
}

.primary-btn {
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    color: #fff;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.3);
    border: 1px solid rgba(255,255,255,0.1);
}
.primary-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(59, 130, 246, 0.4);
}
.primary-btn:active {
    transform: translateY(0);
}

.action-btn {
    padding: 1.1rem 2.2rem !important;
    font-size: 1.1rem !important;
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.5) !important;
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.secondary-btn {
    background-color: var(--bg-panel-solid);
    color: var(--text-main);
    border: 1px solid var(--border);
}
.secondary-btn:hover {
    background-color: var(--bg-darker);
    border-color: var(--border-strong);
}

.outline-btn {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-strong);
}
.outline-btn:hover {
    background-color: var(--bg-panel-solid);
    border-color: var(--primary);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-panel-solid);
    border: 1px solid var(--border);
    color: var(--text-main);
    cursor: pointer;
    font-size: 1.25rem;
    transition: var(--transition);
}
.icon-btn:hover {
    background-color: var(--bg-darker);
    color: var(--primary);
    border-color: var(--primary);
    transform: scale(1.05);
}

/* Layout */
.app-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1rem;
    min-height: 100vh;
    height: auto !important;
    display: flex;
    flex-direction: column;
}

.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-md);
    animation: fadeIn 0.8s ease-out;
    position: sticky;
    top: 1rem;
    z-index: 100;
    margin-bottom: 2rem;
    background: var(--bg-panel);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
}
.logo i {
    color: var(--primary);
    font-size: 2rem;
}
.logo .highlight {
    color: var(--primary);
}

/* Stepper */
.stepper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    gap: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    background: var(--bg-panel);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    transition: var(--transition);
    opacity: 0.5;
    position: relative;
    flex: 1;
}
.step.active {
    color: var(--primary);
    opacity: 1;
    transform: scale(1.05);
}
.step.completed {
    color: var(--success);
    opacity: 1;
}

.step-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--bg-panel-solid);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: var(--transition);
    z-index: 2;
    box-shadow: var(--shadow-sm);
}
.step.active .step-icon {
    border-color: var(--primary);
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 15px var(--primary-light);
}
.step.completed .step-icon {
    border-color: var(--success);
    background-color: var(--success);
    color: #fff;
}

.step-connector {
    flex: 2;
    height: 4px;
    background-color: var(--border-strong);
    margin-top: -24px;
    z-index: 1;
    border-radius: 2px;
    position: relative;
    top: -12px;
    margin-left: -10px;
    margin-right: -10px;
}

/* Views Container */
.views-container {
    flex: 1;
    position: relative;
}

.view {
    display: none;
    min-height: 100%;
    height: auto;
    animation: fadeIn 0.4s ease forwards;
}
.view.active {
    display: block;
}

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

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 var(--primary-light); }
    70% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.animate-fade-in { animation: fadeIn 0.5s ease-out forwards; }
.animate-up { animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-scale { animation: scaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

/* Upload View */
.upload-area {
    min-height: 220px;
    height: auto;
    padding: 1.5rem 1rem;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: var(--transition);
    background: var(--bg-panel);
}
.upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-icon-wrapper {
    width: 80px;
    height: 80px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.supported-formats {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

/* Split Layouts */
.layout-split {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 1.5rem;
    min-height: 400px;
    height: auto;
}

.preview-panel, .editor-panel {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl);
    background-image: linear-gradient(45deg, var(--border) 25%, transparent 25%), linear-gradient(-45deg, var(--border) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--border) 75%), linear-gradient(-45deg, transparent 75%, var(--border) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Editor left column: cropper + toolbar stacked */
.editor-left-col {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.editor-left-col .editor-panel {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    flex: 1;
    min-height: 400px;
}

/* Crop toolbar bar below the cropper */
.crop-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    border-top: none;
}
.crop-toolbar .icon-btn {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
}
.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-strong);
    margin: 0 0.25rem;
}

/* Accordion sections in edit panel */
.edit-accordion {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 0.65rem;
    overflow: hidden;
    transition: border-color 0.3s;
}
.edit-accordion:hover,
.edit-accordion[open] {
    border-color: var(--primary);
}
.edit-accordion summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    user-select: none;
    list-style: none;
    background: var(--bg-darker);
    transition: background 0.2s;
}
.edit-accordion summary::-webkit-details-marker { display: none; }
.edit-accordion summary:hover { background: var(--primary-light); }
.edit-accordion summary .acc-arrow {
    margin-left: auto;
    font-size: 0.8rem;
    transition: transform 0.3s;
    color: var(--text-muted);
}
.edit-accordion[open] summary .acc-arrow {
    transform: rotate(180deg);
}
.edit-accordion .acc-body {
    padding: 0.875rem 1rem;
}
.gap-2 { gap: 0.5rem; }

.controls-panel {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-xl);
}

/* Form Groups & Inputs */
.form-group { margin-bottom: 0.5rem; }
.field-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.select-input, input[type="number"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.875rem;
    transition: var(--transition);
}
.select-input:focus, input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Sliders */
.slider-group { margin-bottom: 0.75rem; }
.slider-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}
input[type="range"] {
    width: 100%;
    height: 8px;
    background: var(--border-strong);
    border-radius: 4px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}
input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: var(--transition);
}
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 12px rgba(59, 130, 246, 0.4);
}

/* Color Picker */
.color-picker-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.color-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--bg-base), 0 0 0 4px var(--primary);
}
.color-custom {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
}
.color-custom input[type="color"] {
    position: absolute;
    top: -10px; left: -10px; width: 60px; height: 60px;
    cursor: pointer; border: none; padding: 0;
}

/* Image Comparing Slider */
.image-compare {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.image-compare img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.compare-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
    border-right: 2px solid #fff;
}
.compare-overlay img {
    left: 0;
    transform: translate(0, -50%);
    width: 200%;
    max-width: none;
}
.slider-handle {
    position: absolute;
    top: 50%;
    right: -15px;
    width: 30px;
    height: 30px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transform: translateY(-50%);
    cursor: ew-resize;
    z-index: 10;
}

/* Loading & Toast */
.divider {
    margin: 1rem 0;
    border-top: 1px solid var(--border);
}
.hidden { display: none !important; }

.ai-loader {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Cropper specific */
.cropper-container {
    width: 100%;
    height: 100%;
}
.cropper-view-box, .cropper-face {
    border-radius: 0;
}
.cropper-dashed, .cropper-line {
    border-color: var(--primary);
}

/* Switch / Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider.round {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--border-strong);
    transition: .4s;
    border-radius: 24px;
}
.slider.round:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider.round { background-color: var(--primary); }
input:checked + .slider.round:before { transform: translateX(20px); }

/* Custom Scrollbar for panels */
.scrollable { overflow-y: auto; }
.scrollable::-webkit-scrollbar { width: 6px; }
.scrollable::-webkit-scrollbar-track { background: transparent; }
.scrollable::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

/* A4 Preview */
.a4-preview-wrapper {
    background: #fff;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    /* Standard A4 aspect ratio representation */
    aspect-ratio: 1 / 1.414;
    max-height: 90%;
    width: auto;
}
.a4-preview-wrapper canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}
.toast {
    background: var(--bg-panel-solid);
    color: var(--text-main);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    margin-top: 10px;
    border-left: 4px solid var(--primary);
    animation: slideIn 0.3s ease forwards;
}
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }

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

/* Radio Group & Cards */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.radio-card {
    flex: 1 1 calc(33.333% - 0.5rem);
    min-width: 80px;
    padding: 0.85rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    background: var(--bg-panel-solid);
    transition: var(--transition);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
    box-shadow: var(--shadow-sm);
}
.radio-card small {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 400;
}
.radio-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.radio-card:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary);
}

/* =========================================
   RESPONSIVE DESIGN (MOBILE & TABLET)
   ========================================= */

@media (max-width: 992px) {
    .app-container {
        height: auto;
        min-height: 100vh;
        padding: 1rem;
    }

    .layout-split {
        grid-template-columns: 1fr;
        height: auto;
        min-height: auto;
        gap: 1rem;
    }
    
    .editor-left-col .editor-panel,
    .editor-panel {
        aspect-ratio: 1; /* Keep cropper square on mobile */
        width: 100%;
        min-height: 350px;
    }
    
    .editor-left-col {
        width: 100%;
    }
    
    .crop-toolbar {
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }

    .preview-panel {
        aspect-ratio: 0.8; /* Slightly taller for A4 portrait preview */
        width: 100%;
        min-height: 350px;
    }

    .controls-panel {
        /* Allow controls panel to expand fully with its contents */
        overflow-y: visible;
        max-height: none;
    }
    
    .upload-area {
        height: auto;
        min-height: 300px;
        padding: 2rem 1rem;
    }

    .views-container {
        position: relative;
        flex: 1 1 auto;
        height: auto;
        padding-bottom: 2rem;
    }
    
    .view, .processing-container {
        height: auto;
    }

    /* Sticky Mobile Next Button */
    .actions {
        position: sticky;
        bottom: -1rem;
        background: var(--bg-panel-solid);
        margin: 0 -1rem -1rem -1rem;
        padding: 1rem;
        border-top: 1px solid var(--border);
        z-index: 100;
        box-shadow: 0 -10px 20px rgba(0,0,0,0.05);
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .stepper {
        padding: 0;
        margin-bottom: 2rem;
        gap: 0.5rem;
    }

    .step span {
        display: none; /* Hide labels on mobile for cleaner look */
    }

    .step-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .step-connector {
        margin-top: -20px;
    }
    
    .color-picker-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .radio-card {
        flex: 1 1 calc(50% - 0.5rem);
    }
    
    .step.active .step-icon {
        box-shadow: 0 0 10px var(--primary-light);
    }
}

@media (max-width: 480px) {
    .editor-panel, .preview-panel {
        min-height: 280px;
    }
    
    .color-picker-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .radio-card {
        flex: 1 1 100%;
    }
}

/* Marketing & FAQ Sections */
.marketing-section {
    padding: 80px 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.marketing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 80px;
}

.marketing-card {
    padding: 2.5rem;
    text-align: center;
    transition: var(--transition);
}
.marketing-card:hover { transform: translateY(-8px); border-color: var(--primary); }

.m-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.marketing-card h3 { margin-bottom: 1rem; color: var(--text-main); }
.marketing-card p { color: var(--text-muted); font-size: 0.95rem; }

.faq-container { max-width: 900px; margin: 0 auto; }
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
}

.faq-item h4 { margin-bottom: 0.75rem; color: var(--primary); font-family: var(--font-heading); }
.faq-item p { color: var(--text-muted); font-size: 0.9rem; }

.app-footer {
    padding: 60px 1.5rem;
    color: var(--text-muted);
}

.mt-12 { margin-top: 3rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.border-t { border-top: 1px solid var(--border); }

/* Animation delay utility */
.animate-up { opacity: 0; }
.animate-up.visible {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media (max-width: 768px) {
    .marketing-grid { grid-template-columns: 1fr; }
    .marketing-card { padding: 1.5rem; }
    .marketing-section { padding: 40px 1.5rem; }
}

/* Premium Feedback System */
.feedback-container {
    margin-top: 80px;
}

.feedback-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    align-items: start;
}

.fb-form-card {
    position: sticky;
    top: 2rem;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.fb-list-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.fb-card {
    background: var(--bg-panel-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.fb-card:hover { border-color: var(--primary); transform: translateX(5px); }

.fb-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.fb-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.fb-name {
    font-weight: 700;
    color: var(--text-main);
    font-family: var(--font-heading);
}

.fb-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

.fb-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-main);
}

.fb-admin-reply {
    margin-top: 1.25rem;
    padding: 1.25rem;
    background: var(--bg-darker);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
}

.fb-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.fb-reply-txt {
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.5;
}

@media (max-width: 992px) {
    .feedback-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .fb-form-card {
        position: static;
        padding: 1.5rem;
    }
}

/* =========================================
   MODE-CHOICE MODAL
   ========================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-card {
    width: 100%;
    max-width: 480px;
    padding: 2.5rem 2rem;
    border-radius: var(--radius-xl);
    animation: scaleIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.modal-icon {
    width: 64px;
    height: 64px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1rem;
    animation: pulse-glow 2s infinite;
}

.modal-header h3 {
    font-size: 1.35rem;
    line-height: 1.3;
    margin-bottom: 0.4rem;
}

.modal-choices {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-choice-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius-md);
    border: 2px solid var(--border);
    background: var(--bg-panel-solid);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    width: 100%;
    font-family: var(--font-heading);
    position: relative;
    overflow: hidden;
}

.modal-choice-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.25s;
}

.modal-choice-btn:hover::before { opacity: 0.06; }
.modal-choice-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--primary-light);
}

.modal-choice-btn.primary {
    border-color: var(--primary);
    background: var(--primary-light);
}
.modal-choice-btn.primary .choice-icon {
    background: var(--primary);
    color: #fff;
}

.choice-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--bg-darker);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    color: var(--primary);
    transition: var(--transition);
}

.choice-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.choice-content strong {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.choice-content span {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-body);
}

.choice-arrow {
    font-size: 1.25rem;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: var(--transition);
}
.modal-choice-btn:hover .choice-arrow {
    color: var(--primary);
    transform: translateX(4px);
}

/* Original-mode notice badge in editor panel */
.original-notice {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    background: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 1rem;
}
.original-notice i { font-size: 1.1rem; flex-shrink: 0; }

@media (max-width: 480px) {
    .modal-card {
        padding: 2rem 1.25rem;
    }
    .modal-choice-btn {
        padding: 0.9rem 1rem;
    }
}

/* =========================================
   SEO SECTIONS & FAQ ACCORDION
   ========================================= */

.seo-section h2 {
    font-family: var(--font-heading);
    color: var(--text-main);
}

.seo-section h3 {
    font-family: var(--font-heading);
    color: var(--text-main);
}

/* FAQ Accordion */
details.glass-panel {
    transition: var(--transition);
}
details.glass-panel:hover {
    border-color: var(--primary);
}
details.glass-panel[open] {
    border-color: var(--primary);
    background: var(--bg-panel);
}
details.glass-panel summary {
    user-select: none;
    color: var(--text-main);
}
details.glass-panel summary::-webkit-details-marker {
    display: none;
}
details.glass-panel[open] summary i.ph-caret-down {
    transform: rotate(180deg);
}

/* Sizes Table */
.seo-section table {
    color: var(--text-main);
}
.seo-section table td {
    color: var(--text-muted);
}
.seo-section table th {
    color: var(--text-main);
    font-family: var(--font-heading);
}
.seo-section table tr:hover td {
    color: var(--text-main);
    background: var(--primary-light);
}

/* Print hide SEO sections */
@media print {
    .seo-section,
    .marketing-section,
    .feedback-container,
    .app-footer {
        display: none !important;
    }
}

.mb-12 { margin-bottom: 3rem; }
.mb-2 { margin-bottom: 0.5rem; }
