/* ============================================
   GLOBALE STYLES & CSS VARIABLEN
   ============================================ */
:root {
    --color-bg: #f8f9fa;
    --color-surface: #ffffff;
    --color-text: #333;
    --color-text-muted: #666;
    --color-border: #ddd;
    --color-accent: #000;
    --shadow-sm: 0 4px 15px rgba(0,0,0,0.1);
    --shadow-md: 0 8px 25px rgba(0,0,0,0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 15px;
    --transition-base: 0.3s ease;
    --artwork-aspect-landscape: 7 / 5;
    --artwork-aspect-portrait: 5 / 7;
    --artwork-aspect: var(--artwork-aspect-landscape);
    --artwork-frame-width: clamp(280px, 60vw, 640px);
    --artwork-frame-max-height: clamp(320px, 65vh, 680px);
    --artwork-border-width: 6px;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
    line-height: 1.6; 
    color: var(--color-text); 
    background: var(--color-bg); 
}

body.artwork-orientation-landscape {
    --artwork-aspect: var(--artwork-aspect-landscape);
    --artwork-frame-width: clamp(280px, 60vw, 640px);
}

body.artwork-orientation-portrait {
    --artwork-aspect: var(--artwork-aspect-portrait);
    --artwork-frame-width: clamp(175px, 37.5vw, 400px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.hidden {
    display: none !important;
}
.visible {
    display: block;
}
.text-white {
    color: #fff !important;
}
.block {
    display: block !important;
}
.text-lg {
    font-size: 1.1em !important;
}
.no-pointer {
    pointer-events: none !important;
}

.post-gen-hint-wrap {
    margin: 0;
    text-align: center;
    max-width: 760px;
}
.post-gen-hint {
    margin: 0 0 10px;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
}
.color-flex {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* ============================================
   NAVIGATION & FORTSCHRITT
   ============================================ */
.progress-navigation { 
    background: var(--color-surface); 
    padding: 30px 0; 
    margin: 20px 0; 
    width: 100%;
    border-radius: var(--radius-lg); 
}

.progress-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.progress-step { 
    padding: 12px 20px; 
    background: var(--color-surface); 
    border-radius: var(--radius-sm); 
    font-size: 0.95rem; 
    color: var(--color-accent); 
    text-decoration: none; 
    transition: all var(--transition-base); 
    border: 1px solid var(--color-border); 
}

.progress-step:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.progress-step.active { 
    background: var(--color-accent); 
    color: #fff; 
    transform: translateY(-2px); 
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); 
    border: 1px solid var(--color-accent); 
}

.progress-step.completed {
    background: black;
    color: white;
    border: 1px solid black;
}

@media (max-width: 991.98px) {
}

/* ============================================
   SEKTIONEN
   ============================================ */
/* ============================================
   KUNSTWERK SEKTION - WOHNZIMMER DESIGN
   ============================================ */
#kunstwerk {
    min-height: 100vh;
    position: relative;
    padding: 20px 0;
}

.section-header {
    margin-bottom: 40px;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #333;
    font-family: 'Abril Fatface', serif;
}

.section-subtitle {
    font-size: 0.9rem;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ============================================
   SLIDER KOMPONENTEN
   ============================================ */
.slider-container { 
    --slide-w: 300px;
    position: relative; 
    max-width: 1000px; 
    margin: 0 auto; 
    overflow: hidden; 
    border-radius: var(--radius-lg); 
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(1px);
}

.slider-wrapper {
    display: flex;
    transition: transform 0.4s ease;
    will-change: transform;
    touch-action: pan-y;
    overscroll-behavior: contain;
}

.slide-item { 
    flex: 0 0 var(--slide-w);
    width: var(--slide-w);
    min-width: var(--slide-w);
    margin: 20px 10px; 
    background: var(--color-surface); 
    border-radius: var(--radius-md); 
    overflow: hidden; 
    box-shadow: var(--shadow-sm); 
    transition: transform var(--transition-base); 
    cursor: pointer; 
    position: relative; 
}

.slide-item:hover {
    transform: translateY(-5px);
}

.slide-item.active {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 3px solid #000;
}

.slide-image {
    width: 100%;
    height: 300px;
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #666;
}
.slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slide-content {
    padding: 20px;
}

.mt-8 {
    margin-top: 8px !important;
}
.mt-10 {
    margin-top: 10px !important;
}
.text-center {
    text-align: center !important;
}
.text-sm {
    font-size: 0.9rem !important;
}
.text-lg {
    font-size: 1.1rem !important;
}
.text-muted {
    color: #666 !important;
}
.cursor-pointer {
    cursor: pointer !important;
}

.suggestion-meta {
    font-size: 0.85rem;
    color: #666;
    margin: 10px 0;
}
.suggestion-desc {
    font-style: italic;
    font-size: 0.9rem;
    color: #666;
    margin: 10px 0;
}
.suggestion-example {
    font-style: italic;
    font-size: 0.85rem;
    color: #888;
    margin-top: 10px;
}
.suggestion-header {
    color: #fff;
    font-weight: 700;
}
.herang-harmonisch {
    background: linear-gradient(45deg, #8B4513, #F5F5DC) !important;
}
.herang-akzentuierend {
    background: linear-gradient(45deg, #FF6347, #FFD700) !important;
}
.herang-experimentell {
    background: linear-gradient(45deg, #2F4F4F, #483D8B) !important;
}

.img-btn {
    width: 100%;
    background: none;
    padding: 0;
    position: relative;
    border: none;
    margin: 0;
    display: block;
    line-height: 0;
}

.artwork-shell {
    width: 100%;
    max-width: var(--artwork-frame-width);
    margin: 0 auto;
    position: relative;
}

.artwork-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(12px, 2vw, 20px);
    width: 100%;
    max-width: var(--artwork-frame-width);
    line-height: 0;
}

.artwork-card--variant {
    width: 100%;
}

.img-wrap,
.artwork-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: var(--artwork-frame-width);
    aspect-ratio: var(--artwork-aspect);
    margin: 0;
    line-height: 0;
    border: var(--artwork-border-width) solid #000;
    background: #fff;
    overflow: hidden;
    transition: opacity var(--transition-base), transform var(--transition-base);
}

.artwork-frame.is-loading .artwork-image {
    opacity: 0;
}

.artwork-frame.is-partial .artwork-image {
    opacity: 0.45;
}

.img-main,
.variant-img,
.artwork-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #fff;
    transition: opacity var(--transition-base);
}

.artwork-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    text-align: center;
    background: rgba(255, 255, 255, 0.35);
    color: #333;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
    line-height: 1.6;
}

.artwork-frame.is-loading .artwork-overlay,
.artwork-frame.is-partial .artwork-overlay {
    opacity: 1;
}

.artwork-frame.is-partial .artwork-overlay {
    background: rgba(255, 255, 255, 0.25);
}

.image-card,
.image-card-primary,
.variant-card {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(12px, 2vw, 20px);
    width: 100%;
    max-width: var(--artwork-frame-width);
    line-height: 0;
}

.variant-card {
    border-radius: 0;
    box-shadow: none;
}

.mt-15 {
    margin-top: 15px !important;
}
.mt-20 {
    margin-top: 20px !important;
}
.mt-40 {
    margin-top: 40px !important;
}
.mt-60 {
    margin-top: 60px !important;
}
.my-60 {
    margin: 60px 0 !important;
}

.upload-text.loading {
    font-size: 1.1rem;
}
.upload-subtext.loading {
    margin-top: 8px;
    font-size: 0.8rem;
}
.error-text {
    color: #900;
    font-size: .9rem;
}
.mini-ring.ring-white {
    --ring-color: #fff;
}

#referenceImageInput,
#roomImageInput {
    position: absolute;
    opacity: 0;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.reference-image-preview {
    max-width: 300px;
    max-height: 300px;
    margin: 15px auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#analysisResult {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

#roomAnalysisError {
    color: red;
    margin-top: 10px;
}
#roomColorsText,
#roomDescription {
    text-align: center;
}

.analysis-button-stack {
    margin-top: 60px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px; 
}
#artworkActions { margin-top: 10px; }

#room-suggestions-slider { 
    --slide-w: 280px; 
}

#room-suggestions-slider .slide-item {
    display: flex;
    flex-direction: column;
}

#room-suggestions-slider .slide-image {
    height: 60px; 
    font-size: 1.25rem; 
    font-weight: bold;
    flex-shrink: 0; 
}

#room-suggestions-slider .slide-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px;
}

#roomSuggestionsSection {
    margin: 12px 0; 
    padding: 0; 
}
#roomSuggestionsSection h3 {
    font-size: 1.8rem;
    margin-bottom: 16px; 
    font-family: 'Abril Fatface', serif;
}

.slide-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #333;
    font-family: 'Abril Fatface', serif;
}

.slide-description {
    font-size: 0.95rem;
    color: #666;
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #333;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
padding: 0; 
}

.slider-nav svg {
    width: 16px;
    height: 16px;
    color: #333;
    transition: color 0.3s ease;
}

.slider-nav:hover {
    background: #000;
    border-color: #000;
}

.slider-nav:hover svg {
    color: white;
}

.slider-nav.prev {
    left: 20px;
}

.slider-nav.next {
    right: 20px;
}

.slider-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
#app-toasts {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ============================================
   UPLOAD BEREICHE
   ============================================ */
.upload-area { 
    position: relative; 
    background: var(--color-surface); 
    border: 3px dashed var(--color-accent); 
    border-radius: var(--radius-lg); 
    padding: 20px; 
    margin: 40px auto; 
    max-width: 600px; 
    cursor: pointer; 
    transition: all var(--transition-base); 
    overflow: hidden; 
    text-align: center;
}

/* Entferne Border wenn Bilder angezeigt werden */
#primaryArtworkShell.upload-area {
    border: none;
    background: transparent;
    padding: 0;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

#primaryArtworkShell.upload-area.processing {
    border: 5px solid #000;
    background: #fff;
    padding: 0;
    border-radius: 0;
    animation: none;
    aspect-ratio: 3 / 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.upload-area:hover {
    border-color: #000;
    background: #f8f9ff;
}

.upload-area img {
    display: block;
    margin: 0 auto;
    max-width: calc(100% - 40px);
    max-height: calc(100vh - 200px);
    border-radius: 10px;
    margin-top: 20px;
    margin-bottom: 20px;
    object-fit: contain;
}

.upload-area.processing {
    border-color: #000;
    background: #e8f4ff;
    animation: pulse 1.5s infinite;
}

.upload-area.completed {
    border-color: #000;
    background: #f0f8ff;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #000;
    filter: grayscale(100%);
}

.upload-text {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 10px;
}

.upload-subtext {
    font-size: 0.95rem;
    color: #666;
}

/* ============================================
   KARTEN & ERGEBNISSE
   ============================================ */
.analysis-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 60px 0;
}

.analysis-card { 
    background: var(--color-surface); 
    border-radius: var(--radius-lg); 
    padding: 30px; 
    box-shadow: var(--shadow-md); 
    text-align: left; 
}

.analysis-card h3 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.analysis-card p {
    font-size: 1rem;
    line-height: 1.6;
}

.custom-input-area p.summary-helper {
    margin-bottom: 15px;
    color: #666;
    font-size: 0.9rem;
}
.custom-input-area label {
    display: block;
    margin-top: 20px;
    font-family: 'Abril Fatface', serif;
}
.custom-input-area select {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 1rem;
}
.artwork-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: clamp(20px, 4vw, 40px);
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 100px auto;
}

.artwork-primary-column {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
}

.artwork-secondary-column {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
}

.image-cards-grid {
    display: flex;
    flex-direction: column;
    gap: clamp(18px, 3vw, 28px);
    align-items: center;
    width: 100%;
    margin-top: 0;
}

#primaryArtworkShell {
    width: 100%;
    max-width: var(--artwork-frame-width);
    padding: 0;
    margin: 0 auto;
    min-height: auto !important;
    display: flex;
    justify-content: center;
}

#primaryArtworkShell.artwork-loaded {
    border: none;
    background: none;
    box-shadow: none;
    margin: 0 auto;
    padding: 0;
}

.artwork-actions-container {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    margin-top: 60px;
    opacity: 0;
    transform: translateY(40px);
    transition: none;
}

.artwork-actions-container.slide-in {
    animation: slideUp 0.6s ease-out forwards;
}

.artwork-actions-container.hidden { 
    display: none !important; 
}

.color-preview {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
}

.color-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ============================================
   ZUSAMMENFASSUNG
   ============================================ */
.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    max-width: 1000px;
    margin: 60px auto;
    align-items: start;
}

.summary-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
}

.custom-input-area { 
    background: var(--color-surface); 
    border-radius: var(--radius-lg); 
    padding: 30px; 
    box-shadow: var(--shadow-md); 
    height: 100%; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
}

.summary-item { 
    background: var(--color-surface); 
    border-radius: var(--radius-md); 
    padding: 20px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
}

.summary-label {
    font-weight: bold;
    color: #333;
}

.summary-value {
    color: #666;
}

.summary-value-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.summary-edit { 
    border: none; 
    background: transparent; 
    padding: 4px; 
    border-radius: 6px; 
    cursor: pointer; 
    color: #666; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    transition: background .2s ease, color .2s ease; 
}
.summary-edit:hover {
    background: #f1f1f1;
    color: #000;
}
.summary-edit:focus {
    outline: 2px solid #000;
    outline-offset: 1px;
}
.summary-edit svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.summary-missing {
    opacity: .6;
    font-style: italic;
}

.custom-textarea {
    width: 100%;
    min-height: 120px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    margin: 20px 0;
}

.custom-textarea:focus {
    outline: none;
    border-color: #000;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1.1rem;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    min-width: 200px;
}

.btn-primary { 
    background: var(--color-accent); 
    color: #fff; 
}

.btn-primary:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-outline-primary {
    background: #fff;
    color: #0d6efd;
    border: 1px solid #0d6efd;
}

.btn-outline-primary:hover {
    background: #0d6efd;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.btn-outline-secondary {
    background: #fff;
    color: #444;
    border: 2px solid #666;
}

.btn-outline-secondary:hover {
    background: #666;
    color: #fff;
}

.btn-warning {
    background: #fff;
    color: #d97706;
    border: 1px solid #d97706;
}

.btn-warning:hover {
    background: #d97706;
    border-color: #d97706;
    color: #fff;
}

.btn.disabled,
.btn:disabled {
    background: #ccc !important;
    color: #999 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    transform: none !important;
    box-shadow: none !important;
    border-color: #ccc !important;
}

/* ============================================
   UTILITIES
   ============================================ */
.loading-spinner {
    display: block;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-in;
}

.divider-section {
    text-align: center;
    margin: 30px 0;
    position: relative;
}

.divider-section::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
}

.divider-text {
    background: #fff;
    padding: 0 20px;
    position: relative;
    display: inline-block;
    color: #666;
    border-radius: 20px;
}

/* ============================================
   MODAL SYSTEM
   ============================================ */
#iframeModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}
#iframeModal.visible {
    display: flex;
}

#modalContent {
    background: white;
    padding: 1rem;
    margin: 1rem;
    position: relative;
    width: 100%;
    max-width: 1000px;
    border-radius: 10px;
}

#closeiframeModalBtn {
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: bold;
    color: #999;
}

#closeiframeModalBtn:hover {
    color: #000;
}

.info-icon {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
    font-size: 0.875rem;
    color: white;
    font-weight: bold;
}

.info-icon:hover {
    background: rgba(0, 0, 0, 1);
    transform: scale(1.1);
}

.info-icon::before {
    content: 'i';
    font-style: italic;
}

/* ============================================
   ARTWORK GENERATION STYLES
   ============================================ */
.version-thumbs {
    display: flex;
    flex-direction: row;
    gap: clamp(8px, 2vw, 16px);
    overflow-x: auto;
    overflow-y: visible;
    padding: 0;
    margin-top: clamp(8px, 1.5vw, 12px);
    scrollbar-width: none;
    justify-content: center;
    align-items: center;
}

.version-thumbs::-webkit-scrollbar {
    display: none;
}

.version-thumb {
    flex: 0 0 auto;
    width: clamp(40px, 6vw, 60px);
    height: clamp(40px, 6vw, 60px);
    border: 2px solid #000;
    border-radius: 0;
    position: relative;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    box-shadow: none;
}

.version-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: none;
    border-radius: 0;
    display: block;
}

.image-result { 
    background: none; 
    border-radius: 0; 
    padding: 0; 
    box-shadow: none; 
    border: none; 
}

.image-result.selected {
    border: none;
    background: none;
}

.edit-icon-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 14px -4px rgba(0,0,0,0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .25s, transform .25s;
}

.edit-icon-btn:hover {
    background: #000;
    color: #fff;
    transform: scale(1.05);
}

.edit-icon-btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

#primaryArtworkShell .image-card-primary .edit-icon-btn {
    position: absolute;
    top: 15px;
    right: 15px;
}

/* ============================================
   LIGHTBOX FÜR BILDVERGRÖSSERUNG
   ============================================ */
.image-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: zoom-out;
    animation: fadeIn 0.3s ease;
}

.image-lightbox.active {
    display: flex;
}

.image-lightbox img {
    max-width: 95vw !important;
    max-height: 95vh !important;
    width: auto;
    height: auto;
    object-fit: contain;
    border: 5px solid #fff;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
    animation: zoomIn 0.3s ease;
}

@media (min-width: 1024px) {
    .image-lightbox img {
        max-width: 1200px !important;
        max-height: 98vh !important;
    }
}

.image-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #000;
    transition: all 0.2s ease;
    z-index: 10000;
}

.image-lightbox-close:hover {
    background: #fff;
    transform: scale(1.1);
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.img-main {
    cursor: zoom-in;
}

@media (max-width: 480px) {
    .version-thumb {
        width: 60px;
        height: 60px;
    }
}

 /* ============================================
     VEREINHEITLICHTES DIALOGSYSTEM
     ============================================ */
.dialog-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20,20,25,.55);
    backdrop-filter: blur(4px);
    z-index: 2000;
    padding: 40px;
    transition: opacity .25s ease;
}

.dialog-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.dialog-overlay.visible {
    opacity: 1;
}

.dialog-panel {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    position: relative;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.dialog-overlay.visible .dialog-panel {
    transform: scale(1);
}

.dialog-title {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    font-weight: 400;
    color: white;
    text-align: center;
}

.dialog-text {
    margin: 0 0 20px 0;
    line-height: 1.5;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.08);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    text-align: center;
}

.dialog-options {
    margin: 16px 0 24px 0;
    padding-left: 0;
    list-style: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.9rem;
    line-height: 1.5;
}

.dialog-options li {
    margin-bottom: 12px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border-left: 3px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}

.dialog-options li:last-child {
    margin-bottom: 0;
}

.dialog-options li:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: rgba(255, 255, 255, 0.5);
}

.dialog-options strong {
    color: white;
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

.dialog-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.dialog-btn {
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    min-width: 120px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.dialog-btn.secondary {
    background: transparent;
    font-weight: 500;
}

.dialog-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.dialog-btn.primary {
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.dialog-btn.primary:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.dialog-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dialog-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.style-change-prompt {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20,20,25,.55);
    backdrop-filter: blur(4px);
    z-index: 2000;
    padding: 40px;
    transition: opacity .25s ease;
}

.style-change-prompt.hidden {
    opacity: 0;
    pointer-events: none;
}

.style-change-prompt.visible {
    opacity: 1;
}

.style-change-prompt .scp-panel {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    position: relative;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.style-change-prompt.visible .scp-panel {
    transform: scale(1);
}

.style-change-prompt .scp-title {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    font-weight: 400;
    color: white;
    text-align: center;
}

.style-change-prompt .scp-text {
    margin: 0 0 20px 0;
    line-height: 1.5;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.08);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    text-align: center;
}

.style-change-prompt .scp-options {
    margin: 16px 0 24px 0;
    padding-left: 0;
    list-style: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.9rem;
    line-height: 1.5;
}

.style-change-prompt .scp-options li {
    margin-bottom: 12px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border-left: 3px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}

.style-change-prompt .scp-options li:last-child {
    margin-bottom: 0;
}

.style-change-prompt .scp-options li:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: rgba(255, 255, 255, 0.5);
}

.style-change-prompt .scp-options strong {
    color: white;
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

.style-change-prompt .scp-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.style-change-prompt .dialog-btn.secondary {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 120px;
}

.style-change-prompt .dialog-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.style-change-prompt .dialog-btn.primary {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    min-width: 120px;
}

.style-change-prompt .dialog-btn.primary:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.style-change-prompt .scp-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.style-change-prompt .scp-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

 /* ============================================
     EDITIER-OVERLAY: STYLES
     ============================================ */
#primaryArtworkShell.editing-active {
    position: relative;
    filter: blur(4px);
    animation: pulse 2.2s ease-in-out infinite;
}

.image-card.editing-active {
    position: relative;
    filter: blur(4px);
    animation: pulse 2.2s ease-in-out infinite;
}

.edit-floating-overlay {
    position: absolute;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    font-family: inherit;
    background: transparent;
    backdrop-filter: none;
    color: #fff;
    text-align: center;
}

.edit-floating-overlay .status-text {
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: .2px;
}

.edit-floating-overlay .mini-ring {
    margin-bottom: 10px;
}

.mini-ring {
    width: 46px;
    height: 46px;
    border: 4px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .9s linear infinite;
}

.inline-edit-panel {
    animation: fadeIn 0.3s ease-in;
}

.edit-card-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 10001;
    overflow-y: auto;
    border-radius: 0;
    animation: fadeIn 0.2s ease-out;
}

.edit-card-inner {
    background: #fff;
    width: 100%;
    max-width: 540px;
    padding: 26px 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.35);
    position: relative;
    max-height: calc(100vh - 48px);
    overflow: auto;
    animation: fadeIn 0.22s ease-out;
}

body.modal-open {
    overflow: hidden;
    touch-action: none;
}

@media (max-width: 480px) {
    .edit-card-overlay {
        padding: 16px;
    }
    .edit-card-inner {
        padding: 20px;
        border-radius: 16px;
        max-height: calc(100vh - 32px);
    }
}

.edit-card-inner h3 {
    margin: 0 0 12px;
    font-size: 1.1rem;
}

.edit-card-inner textarea {
    width: 100%;
    min-height: 140px;
    padding: 14px 16px;
    border: 2px dashed #bbb;
    border-radius: 14px;
    background: #fafafa;
    resize: vertical;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.4;
    outline: none;
    transition: border-color .25s, background .25s;
}

.edit-card-inner textarea:focus {
    border-color: #000;
    background: #fff;
}

.edit-actions {
    display: flex;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
    justify-content: center;
}

.edit-card-inner .edit-actions .btn {
    width: auto;                  
    min-width: 120px;            
    flex: 0 0 auto;              
    display: inline-flex;         
    align-items: center;          
    justify-content: center;      
    text-align: center;           
}

.edit-meta-tip {
    margin-top: 10px;
    font-size: 0.65rem;
    letter-spacing: .5px;
    color: #666;
    text-transform: uppercase;
}

.edit-card-inner .edit-close-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #999;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
}
.edit-card-inner .edit-close-btn:hover {
    background: #f3f3f3;
    color: #333;
}

 /* ============================================
     TOAST-BENACHRICHTIGUNGEN
     ============================================ */
.app-toast {
    backdrop-filter: blur(6px);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: .85rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    color: #fff;
    cursor: pointer;
    max-width: 340px;
    line-height: 1.3;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .25s, transform .25s;
}
.app-toast.visible {
    opacity: 1;
    transform: translateY(0);
}
.app-toast-info {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}
.app-toast-success {
    background: linear-gradient(135deg, #15803d, #166534);
}
.app-toast-warn {
    background: linear-gradient(135deg, #d97706, #b45309);
}
.app-toast-error {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
}
.toast-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 14px;
    margin-left: 8px;
    cursor: pointer;
    font-weight: 600;
}
.toast-msg {
    display: inline-block;
}

 /* ============================================
     RESPONSIVE-ANPASSUNGEN
     ============================================ */

.btn:not(.edit-dialog-btn) {
    min-width: min(350px, 90vw);
    width: 100%;
    max-width: 350px;
}

@media (max-width: 400px) {
    .btn:not(.edit-dialog-btn) {
        min-width: auto;
        width: 100%;
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    h1, .section-title {
        font-size: clamp(1.5rem, 5vw, 2.5rem);
    }
    
    h2 {
        font-size: clamp(1.25rem, 4vw, 1.8rem);
    }
    
    h3 {
        font-size: clamp(1.125rem, 3vw, 1.5rem);
    }
    
    p, .upload-text {
        font-size: clamp(0.875rem, 2.5vw, 1rem);
    }
    
    .section {
        padding: clamp(20px, 5vw, 60px) 0;
        margin: clamp(10px, 3vw, 30px) 0;
    }
    
    .analysis-card, .summary-item, .custom-input-area {
        padding: clamp(15px, 4vw, 30px);
    }
    
    .summary-grid {
        gap: clamp(15px, 4vw, 40px);
        margin: clamp(30px, 6vw, 60px) auto;
    }
    
    .dialog-panel {
        width: 95%;
        max-width: 400px;
        padding: clamp(16px, 4vw, 24px);
        margin: 10px;
    }
    
    .dialog-title {
        font-size: clamp(1rem, 3vw, 1.1rem);
    }
    
    .dialog-text {
        font-size: clamp(0.875rem, 2.5vw, 0.95rem);
    }
    
    .dialog-btn {
        padding: clamp(8px, 2vw, 12px) clamp(16px, 4vw, 24px);
        font-size: clamp(0.875rem, 2.5vw, 0.95rem);
    }
    
    .dialog-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .dialog-actions .dialog-btn {
        width: 100%;
    }
    
    .upload-area {
        min-height: clamp(200px, 25vh, 300px);
        padding: clamp(20px, 5vw, 40px);
    }
    
    .upload-icon {
        font-size: clamp(2rem, 8vw, 3rem);
        margin-bottom: clamp(10px, 3vw, 20px);
    }
    
    .upload-text {
        font-size: clamp(1rem, 3.5vw, 1.2rem);
        margin-bottom: clamp(8px, 2vw, 10px);
    }
    
    .upload-subtext {
        font-size: clamp(0.8rem, 2.5vw, 0.95rem);
    }
    
    .upload-area, .upload-area input[type="file"] {
        min-height: 44px; 
    }
    
    .slider-container {
        margin: clamp(20px, 5vw, 40px) 0;
    }
    
    .slide-item {
        min-height: clamp(120px, 20vw, 200px);
        padding: clamp(10px, 3vw, 20px);
        font-size: clamp(0.8rem, 2.5vw, 1rem);
    }               
    
    .version-thumb {
        width: clamp(50px, 12vw, 80px);
        height: clamp(50px, 12vw, 80px);
        min-width: 44px; 
        min-height: 44px;
    }
    
    #referenceImagePreview {
        max-width: 100%;
        height: auto;
        max-height: clamp(200px, 40vh, 400px);
    }
    
    .artwork-card img {
        width: 100%;
        height: auto;
        max-height: clamp(300px, 50vh, 600px);
        object-fit: contain;
    }
    
    .progress-nav {
        gap: clamp(10px, 3vw, 20px);
        padding: clamp(8px, 2vw, 12px) clamp(15px, 4vw, 20px);
    }
    
    .analysis-container, .summary-container {
        margin: clamp(20px, 5vw, 60px) auto;
        padding: clamp(15px, 4vw, 30px);
    }
    
    .slide-info {
        padding: clamp(15px, 3vw, 20px);
        margin: clamp(10px, 2vw, 20px) clamp(5px, 2vw, 10px);
    }
    
    .summary-left {
        gap: clamp(15px, 3vw, 20px);
    }
    
    .color-preview {
        gap: clamp(8px, 2vw, 15px);
        padding: clamp(10px, 3vw, 22px);
    }
}
@media (max-width: 1024px) {
    .analysis-cards {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }

    .artwork-display {
        flex-direction: column;
        align-items: center;
        gap: clamp(24px, 5vw, 48px);
    }

    .artwork-primary-column,
    .artwork-secondary-column {
        width: 100%;
        max-width: 600px;
    }
}

@media (max-width: 991px) {
    .summary-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .progress-nav {
        flex-direction: column;
        gap: 10px;
    }
    
    .progress-step {
        text-align: center;
        padding: 15px 20px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .analysis-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Ladezustand Texte für Mobile halbieren */
    .artwork-overlay .upload-text.text-lg,
    .artwork-frame.is-loading .upload-text.text-lg {
        font-size: 0.55rem !important;
    }
    
    .artwork-overlay .upload-subtext,
    .artwork-frame.is-loading .upload-subtext {
        font-size: 0.45rem !important;
        line-height: 1.3;
    }
}

@media (max-width: 480px) {
    .analysis-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .analysis-card {
        padding: 15px;
    }
}

@media (max-width: 640px) {
    #room-suggestions-slider { 
        overflow: hidden; 
    }
    
    #room-suggestions-slider { 
        --slide-w: 300px;
    }
    
    #room-suggestions-slider {
        padding: 20px 0 !important;
    }
}

@media (max-width: 480px) {
    #room-suggestions-slider { 
        --slide-w: 300px; 
    }
}

@media (max-width: 320px) {
    #room-suggestions-slider { 
        --slide-w: 300px; 
    }
}
