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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    color: #00d4ff;
}

header p {
    color: #888;
}

/* Upload */
.upload-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.upload-box {
    width: 100%;
    max-width: 500px;
    height: 300px;
    border: 2px dashed #444;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s;
    position: relative;
    overflow: hidden;
}

.upload-box:hover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.05);
}

.upload-box.dragover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
}

.upload-box.loading {
    pointer-events: none;
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.05);
}

.upload-box.loading .upload-content p {
    color: #00d4ff;
}

.upload-content {
    text-align: center;
}

.upload-icon {
    font-size: 48px;
    color: #444;
}

.preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.hidden {
    display: none !important;
}

/* Projects Gallery */
.projects-section {
    margin-top: 40px;
    text-align: center;
}

.projects-section h2 {
    font-size: 1.2rem;
    color: #888;
    margin-bottom: 20px;
    font-weight: normal;
}

.projects-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.project-card {
    position: relative;
    background: #2a2a4a;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.2);
}

.project-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #888;
    font-size: 16px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s, color 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.project-card:hover .project-delete {
    opacity: 1;
}

.project-delete:hover {
    background: #ff4444;
    color: #fff;
}

.project-thumbnail {
    width: 100%;
    aspect-ratio: 1;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.project-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-thumbnail .no-thumb {
    font-size: 32px;
    color: #444;
}

.project-info {
    padding: 10px;
    text-align: center;
}

.project-date {
    font-size: 12px;
    color: #666;
}

/* Options */
.options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.options label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.options select {
    background: #2a2a4a;
    color: #eee;
    border: 1px solid #444;
    padding: 8px 12px;
    border-radius: 6px;
}

.checkbox {
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    background: #333;
    color: #eee;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: #444;
}

.btn:active {
    transform: scale(0.98);
}

.btn.primary {
    background: #00d4ff;
    color: #000;
}

.btn.primary:hover {
    background: #00b8e6;
}

.btn.primary:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}

.btn.secondary {
    background: #4a4a6a;
}

.btn.small {
    padding: 8px 16px;
    font-size: 14px;
}

/* Progress */
.progress-section {
    margin: 40px 0;
    text-align: center;
}

.progress-bar {
    width: 100%;
    max-width: 500px;
    height: 8px;
    background: #333;
    border-radius: 4px;
    margin: 0 auto 16px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #00d4ff;
    width: 0%;
    transition: width 0.3s;
}

.progress-text {
    color: #888;
}

/* Results */
.results-section {
    margin-top: 40px;
}

.results-section h2 {
    text-align: center;
    margin-bottom: 24px;
}

.job-link-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #2a2a4a;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.job-link-box span {
    color: #888;
    white-space: nowrap;
}

.job-link-box input {
    flex: 1;
    min-width: 200px;
    background: #1a1a2e;
    border: 1px solid #444;
    color: #00d4ff;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: monospace;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-item {
    background: #2a2a4a;
    border-radius: 12px;
    padding: 16px;
}

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

.result-item h3 {
    font-size: 14px;
    color: #888;
    margin: 0;
}

.rerun-btn,
.download-btn {
    background: #333;
    border: 1px solid #444;
    color: #888;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.download-btn svg {
    flex-shrink: 0;
}

.rerun-btn:hover {
    background: #00d4ff;
    color: #000;
    border-color: #00d4ff;
}

.download-btn:hover {
    background: #00ff88;
    color: #000;
    border-color: #00ff88;
}

.rerun-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rerun-btn.loading {
    animation: spin 1s linear infinite;
}

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

.result-item.loading {
    opacity: 0.6;
}

.result-item.pending img {
    display: none;
}

.result-item img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #1a1a2e;
    border-radius: 8px;
}

/* Hide images without src or with empty src */
.result-item img:not([src]),
.result-item img[src=""] {
    display: none;
}

/* SVG images need white background */
.result-item img.result-svg {
    background: #fff;
}

.actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Crop */
.crop-section {
    text-align: center;
    margin: 20px 0;
}

.crop-section h2 {
    margin-bottom: 8px;
}

.crop-hint {
    color: #888;
    margin-bottom: 20px;
}

.crop-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
    margin: 0 auto;
}

.crop-container img {
    display: block;
    max-width: 100%;
    max-height: 500px;
    border-radius: 8px;
}

.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    cursor: crosshair;
}

.crop-selection {
    position: absolute;
    border: 2px solid #00d4ff;
    background: rgba(0, 212, 255, 0.1);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

/* Crop handles - corners */
.crop-handle {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #00d4ff;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
}

.crop-handle[data-handle="nw"] { top: -8px; left: -8px; cursor: nw-resize; }
.crop-handle[data-handle="ne"] { top: -8px; right: -8px; cursor: ne-resize; }
.crop-handle[data-handle="sw"] { bottom: -8px; left: -8px; cursor: sw-resize; }
.crop-handle[data-handle="se"] { bottom: -8px; right: -8px; cursor: se-resize; }

/* Crop handles - edges */
.crop-handle-edge {
    border-radius: 4px;
    width: 24px;
    height: 8px;
}

.crop-handle[data-handle="n"] { top: -4px; left: 50%; transform: translateX(-50%); cursor: n-resize; }
.crop-handle[data-handle="s"] { bottom: -4px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
.crop-handle[data-handle="w"] { left: -4px; top: 50%; transform: translateY(-50%); width: 8px; height: 24px; cursor: w-resize; }
.crop-handle[data-handle="e"] { right: -4px; top: 50%; transform: translateY(-50%); width: 8px; height: 24px; cursor: e-resize; }

/* Move area - center of selection */
.crop-move-area {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    cursor: move;
}

.crop-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 20px;
}

/* Options Section */
.options-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.preview-final {
    max-width: 300px;
    max-height: 300px;
    border-radius: 8px;
    border: 2px solid #444;
}

/* Editor */
.editor-section {
    margin-top: 40px;
}

.editor-section h2 {
    text-align: center;
    margin-bottom: 24px;
}

.editor-tools {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tool-btn {
    padding: 8px 16px;
    background: #333;
    border: 1px solid #444;
    color: #eee;
    border-radius: 6px;
    cursor: pointer;
}

.tool-btn.active {
    background: #00d4ff;
    color: #000;
    border-color: #00d4ff;
}

#editorCanvas {
    display: block;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    cursor: crosshair;
    max-width: 100%;
}

.editor-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 20px;
}

/* Subject Selector */
.subject-selector {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}

.subject-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 12px 24px;
    border: 2px solid #333;
    border-radius: 8px;
    transition: all 0.2s;
}

.subject-option:hover {
    border-color: #555;
}

.subject-option input[type="radio"] {
    display: none;
}

.subject-option input[type="radio"]:checked + .subject-label {
    color: #00d4ff;
}

.subject-option:has(input:checked) {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
}

.subject-label {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
}

.modal-content {
    position: relative;
    background: #2a2a4a;
    border-radius: 12px;
    min-width: 320px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #444;
}

.modal-header h3 {
    margin: 0;
    color: #00d4ff;
}

.modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #444;
}

/* Rerun params */
.rerun-params {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rerun-params label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #ccc;
}

.rerun-params input[type="range"] {
    width: 100%;
    accent-color: #00d4ff;
}

.rerun-params select {
    background: #1a1a2e;
    color: #eee;
    border: 1px solid #444;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
}

.rerun-params .param-value {
    color: #00d4ff;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.rerun-params .param-hint {
    color: #666;
    font-size: 12px;
    margin: 0;
}

/* Mask Editor */
.mask-editor {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mask-editor-tools {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    padding: 8px;
    background: #1a1a2e;
    border-radius: 8px;
}

.mask-editor-tools.common-tools {
    border-top: 1px solid #333;
    margin-top: -4px;
    border-radius: 0 0 8px 8px;
}

.mask-editor-tools .tool-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    font-size: 13px;
}

.mask-editor-tools .tool-slider {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #888;
    font-size: 12px;
    flex-direction: row;
    margin-left: 8px;
}

.mask-editor-tools .tool-slider input[type="range"] {
    width: 80px;
}

.mask-editor-tools .param-value {
    min-width: 35px;
    text-align: right;
}

.mask-editor-canvas-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #1a1a2e;
    border-radius: 8px;
    padding: 8px;
    min-height: 300px;
    overflow: hidden;
}

#maskEditorCanvas {
    max-width: 100%;
    max-height: 450px;
    border-radius: 4px;
    cursor: crosshair;
}

.mask-editor-cursor {
    position: absolute;
    border: 2px solid #00d4ff;
    border-radius: 50%;
    pointer-events: none;
    display: none;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}

.mask-editor-canvas-container:hover .mask-editor-cursor {
    display: block;
}

/* Advanced params accordion */
.advanced-params {
    margin-top: 12px;
    padding: 12px;
    background: #1a1a2e;
    border-radius: 8px;
}

.advanced-params summary {
    cursor: pointer;
    color: #888;
    font-size: 13px;
    padding: 4px 0;
}

.advanced-params summary:hover {
    color: #00d4ff;
}

.advanced-params[open] summary {
    margin-bottom: 12px;
    color: #ccc;
}

.advanced-params label {
    margin-top: 8px;
}

.advanced-params .btn {
    margin-top: 12px;
    width: 100%;
}

/* Wide modal for mask editor */
.modal-content.wide {
    width: 800px;
    max-width: 95vw;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    padding: 0 10px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 48px;
    cursor: pointer;
    padding: 20px 15px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s, background 0.2s;
    border-radius: 8px;
}

.lightbox-nav:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
    left: -80px;
}

.lightbox-next {
    right: -80px;
}

.lightbox-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    color: #fff;
}

.lightbox-title {
    font-size: 14px;
    color: #888;
}

.lightbox-copy {
    background: #00d4ff;
    color: #000;
}

.lightbox-copy:hover {
    background: #00b8e6;
}

.lightbox-copy.copied {
    background: #4caf50;
}

/* Lightbox params panel */
.lightbox-main {
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-params {
    position: fixed;
    right: 20px;
    bottom: 80px;
    width: 260px;
    background: rgba(42, 42, 74, 0.98);
    border-radius: 8px;
    padding: 16px;
    max-height: 60vh;
    overflow-y: auto;
    z-index: 1001;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-params.dragging {
    cursor: grabbing;
    user-select: none;
}

.lightbox-params h4 {
    margin: 0;
    color: #00d4ff;
    font-size: 14px;
}

.lb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lb-header:active {
    cursor: grabbing;
}

.lb-close {
    background: none;
    border: none;
    color: #888;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.lb-close:hover {
    color: #fff;
}

.lb-status {
    display: block;
    font-size: 12px;
    color: #00d4ff;
    margin-bottom: 8px;
    min-height: 16px;
}

/* Mobile: collapsible panel at bottom */
@media (max-width: 768px) {
    .lightbox-params {
        left: 10px;
        right: 10px;
        bottom: 10px;
        top: auto;
        width: auto;
        max-height: 50vh;
        transform: none;
    }

    /* Collapsed state on mobile - only show header */
    .lightbox-params.collapsed {
        max-height: none;
        overflow: visible;
        padding: 12px 16px;
    }

    .lightbox-params.collapsed .lb-params,
    .lightbox-params.collapsed .lb-status {
        display: none;
    }

    .lightbox-params.collapsed .lb-header {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
        cursor: pointer;
    }

    /* Make header look tappable on mobile */
    .lightbox-params .lb-header {
        cursor: pointer;
    }

    /* Toggle indicator */
    .lb-header .lb-toggle {
        display: inline-block;
        margin-left: 8px;
        font-size: 10px;
        color: #00d4ff;
        transition: transform 0.2s;
    }

    .lightbox-params.collapsed .lb-toggle {
        transform: rotate(180deg);
    }

    /* Hint text for collapsed state */
    .lightbox-params.collapsed .lb-header h4::after {
        content: " - tap to edit";
        font-size: 11px;
        color: #666;
        font-weight: normal;
    }

    /* Adjust lightbox image to leave space for collapsed panel */
    .lightbox-image {
        max-height: 65vh;
    }

    /* Navigation buttons closer on mobile */
    .lightbox-prev {
        left: 5px;
    }

    .lightbox-next {
        right: 5px;
    }
}

/* Hide toggle on desktop */
@media (min-width: 769px) {
    .lb-header .lb-toggle {
        display: none;
    }
}

.lightbox-params label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #888;
}

.lightbox-params input[type="range"] {
    width: 100%;
}

.lightbox-params select {
    width: 100%;
    padding: 6px;
    background: #1a1a2e;
    border: 1px solid #444;
    border-radius: 4px;
    color: #fff;
}

.lightbox-params .btn {
    width: 100%;
    margin-top: 8px;
}

.lb-params {
    border-top: 1px solid #444;
    padding-top: 12px;
}

.lb-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.lb-actions .btn {
    flex: 1;
    margin-top: 0;
}

.lb-params .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-direction: row;
}

.lb-params .checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.lb-vectorize-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #333;
}

.lb-vectorize-row .checkbox-label {
    flex: 1;
}

.lb-vectorize-row .btn {
    margin-top: 0;
}

/* Make result images clickable */
.result-item img {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.result-item img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

/* Result header buttons group */
.result-header-buttons {
    display: flex;
    gap: 4px;
}

.edit-btn {
    background: #333;
    border: 1px solid #444;
    color: #888;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.edit-btn:hover {
    background: #00d4ff;
    color: #000;
    border-color: #00d4ff;
}

/* ==================== Lineart Editor ==================== */

.lineart-editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    background: #1a1a2e;
}

.lineart-editor-overlay .editor-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
}

.lineart-editor-overlay .editor-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #2a2a4a;
    border-bottom: 1px solid #444;
    flex-wrap: wrap;
}

.lineart-editor-overlay .toolbar-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lineart-editor-overlay .toolbar-separator {
    width: 1px;
    height: 28px;
    background: #444;
    margin: 0 8px;
}

.lineart-editor-overlay .toolbar-spacer {
    flex: 1;
}

.lineart-editor-overlay .tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: #333;
    border: 1px solid #444;
    border-radius: 6px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s;
}

.lineart-editor-overlay .tool-btn:hover {
    background: #444;
    color: #fff;
}

.lineart-editor-overlay .tool-btn.active {
    background: #00d4ff;
    color: #000;
    border-color: #00d4ff;
}

.lineart-editor-overlay .tool-btn {
    position: relative;
}

.lineart-editor-overlay .tool-btn .key-hint {
    position: absolute;
    bottom: 2px;
    right: 3px;
    font-size: 8px;
    font-weight: bold;
    color: #666;
    line-height: 1;
    pointer-events: none;
}

.lineart-editor-overlay .tool-btn:hover .key-hint,
.lineart-editor-overlay .tool-btn.active .key-hint {
    color: #888;
}

.lineart-editor-overlay .tool-btn.active .key-hint {
    color: #006;
}

.lineart-editor-overlay .action-btn {
    padding: 6px 12px;
    background: #333;
    border: 1px solid #444;
    border-radius: 6px;
    color: #ccc;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.lineart-editor-overlay .action-btn:hover {
    background: #444;
    color: #fff;
}

.lineart-editor-overlay .action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.lineart-editor-overlay .action-btn.primary {
    background: #00d4ff;
    color: #000;
    border-color: #00d4ff;
}

.lineart-editor-overlay .action-btn.primary:hover {
    background: #00b8e6;
}

/* Icon action buttons with key hints */
.lineart-editor-overlay .action-btn.icon-btn {
    position: relative;
    padding: 6px 8px;
}

.lineart-editor-overlay .action-btn.icon-btn .key-hint {
    position: absolute;
    bottom: 1px;
    right: 2px;
    font-size: 7px;
    font-weight: bold;
    color: #666;
    line-height: 1;
    pointer-events: none;
}

.lineart-editor-overlay .action-btn.icon-btn:hover .key-hint {
    color: #888;
}

/* Text action buttons with key hints */
.lineart-editor-overlay .action-btn.text-btn {
    position: relative;
    padding-right: 24px;
}

.lineart-editor-overlay .action-btn.text-btn .key-hint {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 9px;
    font-weight: bold;
    color: #666;
    background: #222;
    padding: 1px 3px;
    border-radius: 2px;
    line-height: 1;
    pointer-events: none;
}

.lineart-editor-overlay .action-btn.text-btn:hover .key-hint {
    color: #888;
    background: #333;
}

.lineart-editor-overlay .brush-size-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #888;
    font-size: 13px;
}

.lineart-editor-overlay .brush-size-label input[type="range"] {
    width: 80px;
    accent-color: #00d4ff;
}

.lineart-editor-overlay .brush-size-label span {
    min-width: 24px;
    text-align: right;
    color: #00d4ff;
}

.lineart-editor-overlay #editorZoomLevel {
    min-width: 50px;
    text-align: center;
    color: #888;
    font-size: 12px;
}

.lineart-editor-overlay .editor-canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lineart-editor-overlay #editorRefCanvas,
.lineart-editor-overlay #editorCanvas,
.lineart-editor-overlay #editorOverlay {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    image-rendering: pixelated;
}

.lineart-editor-overlay #editorRefCanvas {
    background: #fff;
}

.lineart-editor-overlay #editorCanvas {
    background: transparent;
    mix-blend-mode: multiply;  /* White becomes transparent, black stays */
}

.lineart-editor-overlay #editorOverlay {
    pointer-events: none;
    background: transparent;
}

/* Reference layer controls */
.lineart-editor-overlay .ref-layer-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lineart-editor-overlay .ref-layer-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #888;
    font-size: 13px;
}

.lineart-editor-overlay .ref-layer-label select {
    background: #333;
    border: 1px solid #444;
    color: #ccc;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    max-width: 120px;
}

.lineart-editor-overlay .ref-opacity-label {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #888;
    font-size: 12px;
}

.lineart-editor-overlay .ref-opacity-label input[type="range"] {
    width: 60px;
    accent-color: #00d4ff;
}

.lineart-editor-overlay .ref-opacity-label span {
    min-width: 35px;
    color: #00d4ff;
}

/* Clean Region Panel */
.lineart-editor-overlay .clean-region-panel {
    position: absolute;
    top: 60px;
    right: 20px;
    background: #2a2a4a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 16px;
    z-index: 100;
    min-width: 220px;
}

.lineart-editor-overlay .clean-region-panel h4 {
    margin: 0 0 12px 0;
    color: #00d4ff;
    font-size: 14px;
}

.lineart-editor-overlay .clean-params {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lineart-editor-overlay .clean-params label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #888;
    font-size: 12px;
}

.lineart-editor-overlay .clean-params input[type="range"] {
    width: 100%;
    accent-color: #00d4ff;
}

.lineart-editor-overlay .clean-params select {
    background: #333;
    border: 1px solid #444;
    color: #ccc;
    padding: 6px;
    border-radius: 4px;
    font-size: 12px;
}

.lineart-editor-overlay .clean-params span {
    color: #00d4ff;
    font-size: 11px;
    text-align: right;
}

.lineart-editor-overlay .clean-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.lineart-editor-overlay .clean-actions .action-btn {
    flex: 1;
    font-size: 12px;
    padding: 6px 10px;
}

/* Outline Panel */
.lineart-editor-overlay .outline-panel {
    position: absolute;
    top: 60px;
    right: 20px;
    background: #2a2a4a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 16px;
    z-index: 100;
    min-width: 220px;
}

.lineart-editor-overlay .outline-panel h4 {
    margin: 0 0 12px 0;
    color: #00d4ff;
    font-size: 14px;
}

.lineart-editor-overlay .outline-params {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lineart-editor-overlay .outline-params label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #888;
    font-size: 12px;
}

.lineart-editor-overlay .outline-params input[type="range"] {
    width: 100%;
    accent-color: #00d4ff;
}

.lineart-editor-overlay .outline-params span {
    color: #00d4ff;
    font-size: 11px;
    text-align: right;
}

.lineart-editor-overlay .outline-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.lineart-editor-overlay .outline-actions .action-btn {
    flex: 1;
    font-size: 12px;
    padding: 6px 10px;
}

.lineart-editor-overlay .editor-statusbar {
    display: flex;
    gap: 24px;
    padding: 6px 16px;
    background: #2a2a4a;
    border-top: 1px solid #444;
    font-size: 12px;
    color: #888;
}

.lineart-editor-overlay .editor-statusbar span {
    min-width: 80px;
}

/* Layers Panel */
.lineart-editor-overlay .layers-panel {
    position: absolute;
    top: 60px;
    right: 20px;
    width: 220px;
    background: #2a2a4a;
    border: 1px solid #444;
    border-radius: 8px;
    z-index: 90;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 140px);
}

.lineart-editor-overlay .layers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #444;
}

.lineart-editor-overlay .layers-header h4 {
    margin: 0;
    color: #00d4ff;
    font-size: 13px;
}

.lineart-editor-overlay .layers-actions {
    display: flex;
    gap: 4px;
}

.lineart-editor-overlay .layer-action-btn {
    min-width: 26px;
    height: 26px;
    background: #333;
    border: 1px solid #444;
    border-radius: 4px;
    color: #ccc;
    cursor: pointer;
    font-size: 12px;
    padding: 0 6px;
}

.lineart-editor-overlay .layer-action-btn:hover {
    background: #444;
    color: #fff;
}

.lineart-editor-overlay .layer-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.lineart-editor-overlay .layers-blend-controls {
    padding: 8px 12px;
    border-bottom: 1px solid #444;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lineart-editor-overlay .layers-blend-controls select {
    background: #333;
    border: 1px solid #444;
    color: #ccc;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.lineart-editor-overlay .layer-opacity-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #888;
}

.lineart-editor-overlay .layer-opacity-label input[type="range"] {
    flex: 1;
    accent-color: #00d4ff;
}

.lineart-editor-overlay .layer-opacity-label span {
    min-width: 35px;
    color: #00d4ff;
    font-size: 11px;
}

.lineart-editor-overlay .layers-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    min-height: 100px;
    max-height: 300px;
}

.lineart-editor-overlay .layer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: #333;
    border: 1px solid transparent;
    border-radius: 4px;
    margin-bottom: 4px;
    cursor: grab;
    transition: border-color 0.15s, background 0.15s;
}

.lineart-editor-overlay .layer-item:hover {
    background: #3a3a5a;
}

.lineart-editor-overlay .layer-item.active {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
}

.lineart-editor-overlay .layer-item.dragging {
    opacity: 0.5;
}

.lineart-editor-overlay .layer-item.drag-over {
    border-color: #ff6600;
}

.lineart-editor-overlay .layer-visibility {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px;
    line-height: 1;
    min-width: 20px;
    text-align: center;
}

.lineart-editor-overlay .layer-visibility.is-visible {
    opacity: 1;
}

.lineart-editor-overlay .layer-visibility.is-hidden {
    opacity: 0.4;
}

.lineart-editor-overlay .layer-visibility:hover {
    opacity: 1;
    transform: scale(1.1);
}

.lineart-editor-overlay .layer-thumbnail canvas {
    border: 1px solid #444;
    border-radius: 2px;
    background: #fff;
}

.lineart-editor-overlay .layer-name {
    flex: 1;
    background: transparent;
    border: none;
    color: #ccc;
    font-size: 12px;
    padding: 2px 4px;
    min-width: 0;
}

.lineart-editor-overlay .layer-name:focus {
    background: #222;
    outline: 1px solid #00d4ff;
    border-radius: 2px;
}

.lineart-editor-overlay .layers-footer {
    padding: 8px;
    border-top: 1px solid #444;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.lineart-editor-overlay .layers-footer .layer-action-btn {
    font-size: 11px;
    padding: 4px 6px;
}

/* Draggable Panels */
.lineart-editor-overlay .draggable-panel {
    user-select: none;
}

.lineart-editor-overlay .draggable-panel.dragging {
    opacity: 0.9;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.lineart-editor-overlay .panel-drag-handle {
    cursor: move;
    cursor: grab;
}

.lineart-editor-overlay .panel-drag-handle:active {
    cursor: grabbing;
}

.lineart-editor-overlay .panel-drag-handle::before {
    content: "⋮⋮";
    margin-right: 6px;
    opacity: 0.5;
    font-size: 10px;
    letter-spacing: 1px;
}

/* Drop highlight for image import */
.lineart-editor-overlay .editor-canvas-container.drop-highlight {
    outline: 3px dashed #00d4ff;
    outline-offset: -3px;
}

/* ==================== NORMALIZED EDITOR ==================== */

.normalized-editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #1a1a2e;
    z-index: 2000;
}

.normalized-editor-overlay .normalized-editor {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.normalized-editor-overlay .editor-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 16px;
    background: #252540;
    border-bottom: 1px solid #333;
}

.normalized-editor-overlay .toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.normalized-editor-overlay .toolbar-right {
    margin-left: auto;
}

.normalized-editor-overlay .toolbar-divider {
    width: 1px;
    height: 24px;
    background: #444;
    margin: 0 8px;
}

.normalized-editor-overlay .tool-btn {
    min-width: 36px;
    height: 36px;
    background: #333;
    border: 1px solid #444;
    border-radius: 4px;
    color: #ccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.normalized-editor-overlay .tool-btn:hover {
    background: #444;
    color: #fff;
}

.normalized-editor-overlay .tool-btn.active {
    background: #00d4ff;
    border-color: #00d4ff;
    color: #000;
}

.normalized-editor-overlay .action-btn {
    padding: 6px 12px;
    background: #333;
    border: 1px solid #444;
    border-radius: 4px;
    color: #ccc;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}

.normalized-editor-overlay .action-btn:hover {
    background: #444;
    color: #fff;
}

.normalized-editor-overlay .action-btn.primary {
    background: #00d4ff;
    border-color: #00d4ff;
    color: #000;
    font-weight: 500;
}

.normalized-editor-overlay .action-btn.primary:hover {
    background: #00b8e6;
}

.normalized-editor-overlay .action-btn.danger {
    border-color: #ff4757;
    color: #ff4757;
}

.normalized-editor-overlay .action-btn.danger:hover {
    background: #ff4757;
    color: #fff;
}

.normalized-editor-overlay .brush-size-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #888;
    font-size: 12px;
}

.normalized-editor-overlay .brush-size-label input[type="range"] {
    width: 80px;
    accent-color: #00d4ff;
}

.normalized-editor-overlay .brush-size-label span:last-child {
    min-width: 28px;
    color: #00d4ff;
}

.normalized-editor-overlay .editor-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.normalized-editor-overlay .editor-canvas-area {
    flex: 1;
    overflow: hidden;
    background: #222;
    position: relative;
}

.normalized-editor-overlay .editor-canvas-container {
    position: absolute;
    transform-origin: 0 0;
}

.normalized-editor-overlay .editor-canvas-container canvas {
    display: block;
    image-rendering: pixelated;
}

.normalized-editor-overlay .editor-sidebar {
    width: 240px;
    background: #252540;
    border-left: 1px solid #333;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.normalized-editor-overlay .adjustment-panel {
    background: #2a2a4a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 12px;
}

.normalized-editor-overlay .adjustment-panel h4 {
    margin: 0 0 12px 0;
    color: #00d4ff;
    font-size: 13px;
    cursor: move;
}

.normalized-editor-overlay .adjustment-params {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.normalized-editor-overlay .adjustment-params label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #aaa;
}

.normalized-editor-overlay .adjustment-params input[type="range"] {
    flex: 1;
    min-width: 100px;
    accent-color: #00d4ff;
}

.normalized-editor-overlay .adjustment-params span {
    min-width: 30px;
    text-align: right;
    color: #00d4ff;
    font-size: 11px;
}

.normalized-editor-overlay .adjustment-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.normalized-editor-overlay .adjustment-actions .action-btn {
    flex: 1;
    font-size: 12px;
    padding: 6px 8px;
}

.normalized-editor-overlay .adjustment-info {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #444;
}

.normalized-editor-overlay .adjustment-info small {
    color: #666;
    font-size: 11px;
}

.normalized-editor-overlay .mask-preview-panel {
    background: #2a2a4a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 12px;
}

.normalized-editor-overlay .mask-preview-panel h4 {
    margin: 0 0 8px 0;
    color: #888;
    font-size: 12px;
}

.normalized-editor-overlay .mask-preview-panel canvas {
    width: 100%;
    border: 1px solid #444;
    border-radius: 4px;
    background: #222;
}

.normalized-editor-overlay .editor-statusbar {
    display: flex;
    gap: 24px;
    padding: 6px 16px;
    background: #252540;
    border-top: 1px solid #333;
    font-size: 12px;
    color: #888;
}

.normalized-editor-overlay .editor-statusbar span {
    min-width: 80px;
}

/* ==================== LANDING PAGE ==================== */

.landing-page {
    min-height: 100vh;
}

/* Container */
.landing-page .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    min-height: 90vh;
    padding: 60px 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-content {
    text-align: left;
}

.hero h1 {
    font-size: 3.2rem;
    line-height: 1.15;
    margin-bottom: 24px;
    color: #fff;
    font-weight: 700;
}

.hero h1 .highlight {
    background: linear-gradient(135deg, #00d4ff 0%, #0099ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #aaa;
    line-height: 1.6;
    margin-bottom: 40px;
}

/* Hero Upload Box */
.hero-upload {
    margin-bottom: 32px;
}

.upload-box-hero {
    max-width: 100%;
    height: 220px;
    border: 2px dashed #444;
    border-radius: 16px;
    background: rgba(42, 42, 74, 0.5);
    transition: all 0.3s;
}

.upload-box-hero:hover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 212, 255, 0.15);
}

.upload-box-hero .upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.upload-icon-large {
    color: #00d4ff;
    margin-bottom: 8px;
}

.upload-text-main {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.upload-text-sub {
    font-size: 1rem;
    color: #b0b0b0;
    margin: 0;
}

.upload-formats {
    font-size: 0.85rem;
    color: #9a9a9a;
    margin-top: 8px;
}

/* Hero Features Pills */
.hero-features {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-size: 0.9rem;
    color: #ccc;
}

.hero-feature .feature-icon {
    font-size: 1.1rem;
}

.hero-feature-link {
    text-decoration: none;
    border: 1px solid #333;
    transition: all 0.2s;
}

.hero-feature-link:hover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
}

/* Hero Visual - Before/After */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.before-after {
    display: flex;
    align-items: center;
    gap: 24px;
}

.before-after-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.ba-image {
    width: 200px;
    height: 200px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.ba-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ba-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2a2a4a 0%, #1a1a2e 100%);
    color: #666;
    font-size: 0.9rem;
    text-align: center;
    padding: 20px;
}

.ba-before {
    border: 2px solid #444;
}

.ba-after {
    border: 2px solid #00d4ff;
    background: #fff;
}

.ba-after .ba-placeholder {
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    color: #666;
}

.ba-label {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.before-after-arrow {
    color: #00d4ff;
    animation: pulse-arrow 2s infinite;
}

@keyframes pulse-arrow {
    0%, 100% { opacity: 0.5; transform: translateX(0); }
    50% { opacity: 1; transform: translateX(5px); }
}

/* Section Styles */
.how-it-works,
.features-section,
.use-cases-section,
.faq-section,
.cta-section {
    padding: 80px 24px;
}

.how-it-works {
    background: linear-gradient(180deg, #1a1a2e 0%, #16162a 100%);
}

.features-section {
    background: #1a1a2e;
}

.use-cases-section {
    background: linear-gradient(180deg, #16162a 0%, #1a1a2e 100%);
}

.faq-section {
    background: #1a1a2e;
}

/* Trust Section (E-E-A-T) */
.trust-section {
    padding: 60px 24px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16162a 100%);
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.trust-item {
    text-align: center;
    padding: 24px;
}

.trust-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00d4ff;
}

.trust-item h3 {
    font-size: 1rem;
    color: #fff;
    margin-bottom: 8px;
}

.trust-item p {
    font-size: 0.9rem;
    color: #888;
    line-height: 1.5;
}

.cta-section {
    background: linear-gradient(135deg, #1a3a5c 0%, #1a1a2e 50%, #2a1a4a 100%);
    text-align: center;
}

.landing-page h2 {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 16px;
    color: #fff;
}

.section-subtitle {
    text-align: center;
    color: #888;
    font-size: 1.1rem;
    margin-bottom: 48px;
}

/* How It Works - Steps */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.step-card {
    background: rgba(42, 42, 74, 0.5);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 212, 255, 0.1);
}

.step-number {
    position: absolute;
    top: -12px;
    left: 24px;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #00d4ff 0%, #0099ff 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #000;
    font-size: 0.9rem;
}

.step-icon {
    color: #00d4ff;
    margin-bottom: 16px;
}

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

.step-card p {
    font-size: 0.95rem;
    color: #888;
    line-height: 1.6;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: rgba(42, 42, 74, 0.4);
    border: 1px solid #333;
    border-radius: 16px;
    padding: 32px;
    transition: all 0.3s;
}

.feature-card:hover {
    border-color: #00d4ff;
    box-shadow: 0 8px 32px rgba(0, 212, 255, 0.1);
    transform: translateY(-2px);
}

.feature-card.feature-highlight {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(42, 42, 74, 0.5) 100%);
    border-color: rgba(0, 212, 255, 0.3);
}

.feature-card-icon {
    color: #00d4ff;
    margin-bottom: 16px;
}

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

.feature-card p {
    color: #b0b0b0;
    line-height: 1.6;
}

/* Use Cases */
.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.use-case {
    text-align: center;
    padding: 32px 20px;
    background: rgba(42, 42, 74, 0.3);
    border-radius: 16px;
    transition: transform 0.3s;
}

.use-case:hover {
    transform: translateY(-4px);
}

.use-case-icon {
    color: #00d4ff;
    margin-bottom: 16px;
}

.use-case h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #fff;
}

.use-case p {
    font-size: 0.9rem;
    color: #888;
    line-height: 1.5;
}

/* FAQ */
.faq-grid {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: rgba(42, 42, 74, 0.5);
    border-radius: 12px;
    overflow: hidden;
}

.faq-item summary {
    padding: 20px 24px;
    cursor: pointer;
    font-size: 1.05rem;
    color: #fff;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.5rem;
    color: #00d4ff;
    font-weight: 300;
    transition: transform 0.3s;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item summary:hover {
    background: rgba(0, 212, 255, 0.05);
}

.faq-answer {
    padding: 0 24px 20px;
}

.faq-answer p {
    color: #888;
    line-height: 1.7;
}

/* CTA Section */
.cta-section h2 {
    margin-bottom: 12px;
}

.cta-section p {
    color: #888;
    font-size: 1.1rem;
    margin-bottom: 32px;
}

.btn-large {
    padding: 16px 40px;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

/* Footer */
.site-footer {
    background: #0d0d1a;
    padding: 60px 24px 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 40px;
    border-bottom: 1px solid #222;
}

.footer-brand h3 {
    font-size: 1.5rem;
    color: #00d4ff;
    margin-bottom: 12px;
}

.footer-brand p {
    color: #9a9a9a;
    line-height: 1.6;
}

.footer-links h4 {
    font-size: 1rem;
    color: #b0b0b0;
    margin-bottom: 16px;
}

.footer-links a {
    display: block;
    color: #9a9a9a;
    text-decoration: none;
    padding: 6px 0;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #00d4ff;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 24px;
    text-align: center;
}

.footer-bottom p {
    color: #808080;
    font-size: 0.9rem;
}

/* Projects Section in Landing */
.landing-page .projects-section {
    padding: 60px 24px;
    background: rgba(42, 42, 74, 0.2);
}

.landing-page .projects-section h2 {
    font-size: 1.4rem;
    color: #888;
    margin-bottom: 24px;
}

/* ==================== APP CONTAINER ==================== */

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    background: #1a1a2e;
    border-bottom: 1px solid #333;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #00d4ff;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

.app-logo:hover {
    opacity: 0.8;
}

.app-main {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Final result highlight */
.result-item-final {
    border: 2px solid #00d4ff;
    box-shadow: 0 4px 24px rgba(0, 212, 255, 0.2);
}

/* Button with icon */
.btn svg {
    flex-shrink: 0;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
        padding: 40px 24px;
        min-height: auto;
    }

    .hero-content {
        text-align: center;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-features {
        justify-content: center;
    }

    .steps-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-grid {
        grid-template-columns: 1fr 1fr;
    }

    .feature-card.feature-highlight {
        grid-column: span 2;
    }

    .use-cases-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .trust-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .before-after {
        flex-direction: column;
        gap: 16px;
    }

    .before-after-arrow {
        transform: rotate(90deg);
    }

    .ba-image {
        width: 160px;
        height: 160px;
    }

    .steps-grid,
    .features-grid,
    .use-cases-grid,
    .trust-grid {
        grid-template-columns: 1fr;
    }

    .trust-section {
        padding: 40px 16px;
    }

    .feature-card.feature-highlight {
        grid-column: span 1;
    }

    .landing-page h2 {
        font-size: 1.8rem;
    }

    .how-it-works,
    .features-section,
    .use-cases-section,
    .faq-section,
    .cta-section {
        padding: 48px 16px;
    }
}

@media (max-width: 600px) {
    .hero {
        padding: 24px 16px;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .upload-box-hero {
        height: 180px;
    }

    .hero-feature {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .btn-large {
        padding: 14px 28px;
        font-size: 1rem;
    }

    /* Keep old responsive rules for app */
    .upload-box {
        height: 200px;
    }

    .options {
        flex-direction: column;
        align-items: center;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .subject-selector {
        flex-direction: column;
        gap: 10px;
    }

    .lineart-editor-overlay .editor-toolbar {
        padding: 6px 8px;
    }

    .lineart-editor-overlay .toolbar-separator {
        display: none;
    }
}

/* ==================== NAVIGATION ==================== */

.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0 24px;
}

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

.nav-logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: #00d4ff;
    text-decoration: none;
    transition: opacity 0.2s;
}

.nav-logo:hover {
    opacity: 0.85;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links > a {
    padding: 8px 16px;
    color: #ccc;
    text-decoration: none;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.nav-links > a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    color: #ccc;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.nav-dropdown-trigger:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-dropdown-trigger svg {
    transition: transform 0.2s;
}

.nav-dropdown:hover .nav-dropdown-trigger svg {
    transform: rotate(180deg);
}

.nav-dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}

.nav-dropdown:hover .nav-dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-content a {
    display: block;
    padding: 10px 20px;
    color: #aaa;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s, background 0.2s;
}

.nav-dropdown-content a:hover {
    color: #fff;
    background: rgba(0, 212, 255, 0.1);
}

/* ==================== INDUSTRIES SECTION ==================== */

.industries-section {
    padding: 80px 24px;
    background: rgba(42, 42, 74, 0.2);
}

.industries-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 48px auto 0;
}

.industry-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    text-decoration: none;
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.industry-card:hover {
    transform: translateY(-4px);
    background: rgba(0, 212, 255, 0.05);
    border-color: rgba(0, 212, 255, 0.3);
}

.industry-icon {
    color: #00d4ff;
    margin-bottom: 16px;
}

.industry-card h3 {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 8px;
}

.industry-card p {
    font-size: 0.85rem;
    color: #b0b0b0;
    line-height: 1.5;
}

/* ==================== SEO LANDING PAGES ==================== */

.seo-hero {
    padding-top: 80px;
}

.seo-hero .hero-content h1 {
    font-size: 3rem;
}

/* What Is Section */
.content-section {
    padding: 80px 24px;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    max-width: 1200px;
    margin: 32px auto 0;
    align-items: center;
}

.content-text {
    color: #bbb;
    line-height: 1.8;
    font-size: 1.1rem;
}

.content-text p {
    margin-bottom: 16px;
}

.content-text p:last-child {
    margin-bottom: 0;
}

.content-image .image-placeholder {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

/* Compatibility Section */
.compatibility-section {
    padding: 60px 24px;
    background: rgba(42, 42, 74, 0.2);
}

.compatibility-section h2 {
    text-align: center;
    margin-bottom: 32px;
}

.compat-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-width: 900px;
    margin: 0 auto;
}

.compat-item {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: background 0.2s, border-color 0.2s;
}

.compat-item:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
}

.compat-name {
    color: #ccc;
    font-size: 0.95rem;
}

/* Related Pages */
.related-section {
    padding: 60px 24px;
}

.related-section h2 {
    text-align: center;
    margin-bottom: 32px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.related-card {
    display: block;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    text-decoration: none;
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.related-card:hover {
    transform: translateY(-2px);
    background: rgba(0, 212, 255, 0.05);
    border-color: rgba(0, 212, 255, 0.3);
}

.related-card h3 {
    color: #00d4ff;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.related-card p {
    color: #888;
    font-size: 0.9rem;
}

/* Use Case Links */
.use-case-link {
    display: inline-block;
    margin-top: 12px;
    color: #00d4ff;
    font-size: 0.9rem;
    text-decoration: none;
    transition: opacity 0.2s;
}

.use-case-link:hover {
    opacity: 0.8;
}

/* ==================== RESPONSIVE - NAV & INDUSTRIES ==================== */

@media (max-width: 1024px) {
    .industries-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .site-nav .container {
        flex-direction: column;
        gap: 16px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-dropdown-content {
        position: static;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        margin-top: 8px;
    }

    .nav-dropdown:hover .nav-dropdown-content,
    .nav-dropdown:focus-within .nav-dropdown-content {
        display: block;
    }

    .nav-dropdown-content a {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .industries-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .industry-card {
        padding: 24px 16px;
    }

    .seo-hero .hero-content h1 {
        font-size: 2.2rem;
    }
}

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

    .related-grid {
        grid-template-columns: 1fr;
    }

    .compat-grid {
        gap: 8px;
    }

    .compat-item {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}

/* ==================== MODAL LARGE ==================== */

.modal-content.modal-large {
    width: 900px;
    max-width: 95vw;
}
