
@font-face {
    font-family: 'Aptos';
    src: url('/static/fonts/Aptos-Light.ttf') format('truetype');
    font-weight: 200;
    font-style: normal;
}

body {
    font-family: 'Aptos', Arial, sans-serif;
    background: #ffffff;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

.container {
    width: 98%;
    max-width: 1800px;
    display: flex;
    gap: 20px;
    margin: 40px 0;
    align-items: flex-start;
}

/* === Sidebar === */
.sidebar {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-left: 40px; /* Nur rechts eingerückt */
    z-index: 100;
}

/* === Sidebar === */
.sidebar-right {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 40px;
    margin-left: 20px; /* Nur rechts eingerückt */
    margin-right: 20px;
    z-index: 100;
}

#project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0px;
}

#project-header .project-title {
    color: #C3AB85;
    font-size: 1.0rem;
}

#sidebar-preview {
    width: 100%;
    display: none;
    margin-top: 0px;
    cursor: pointer;
}

#sidebar-preview img {
    width: 100%;
    aspect-ratio: 16 / 10; /* Fixes Seitenverhältnis (z.B. 16:10) */
    object-fit: cover;    /* Schneidet das Bild mittig zu, ohne es zu quetschen */
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    display: block;
}

.big-btn-main {
    width: 100%;
    height: 30px;
    background-color: #C3AB85;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 200;
    cursor: pointer;
    transition: background-color 0.2s;
}

.big-btn-main:hover { background-color: #D58618; }

.header-controls { display: flex; gap: 5px; }

.sq-btn {
    width: 30px; height: 30px;
    background-color: #C3AB85;
    border: none; border-radius: 6px;
    cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    font-size: 0.8rem; color: #ffffff !important;
    transition: background-color 0.2s;
}

.sq-btn:hover { background-color: #D58618; }
.white-icon { filter: brightness(0) invert(1); display: inline-block; }

.button-section { display: flex; align-items: center; gap: 0px; }
.button-section h3 { margin: 0; font-size: 0.7rem; font-weight: 200; min-width: 110px; color: #555; }

.button-grid { display: flex; flex: 1; gap: 5px; }

.option {
    flex: 1; display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; border: 1px solid #e0e0e0; background: #ffffff;
    border-radius: 6px; padding: 2px 2px; box-sizing: border-box;
    transition: all 0.12s; cursor: pointer; height: 18px;
    text-align: center; white-space: nowrap;
}

.option:hover { background-color: #D58618 !important; color: #ffffff; transform: translateY(-2px); }

.option.selected { background-color: #C3AB85 !important; box-shadow: 0 0 0 0px rgba(65,155,68,0.30); color: #ffffff; }

/* === Hauptbereich === */
.image-area { flex: 2; display: flex; flex-direction: column; gap: 10px; position: relative; }

.prompt-wrapper { position: relative; height: 30px; z-index: 100; }
.prompt-container {
    position: absolute; width: 100%; background: #fff;
    border: 1px solid #cfcfcf; border-radius: 6px;
    overflow: hidden; display: flex;
}

/* Das neue Loader-Overlay */
#prompt-loader-overlay {
    display: none; /* Standardmäßig versteckt */
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: calc(100% - 100px); /* Endet exakt vor dem Create-Button */
    background: #ffffff;
    z-index: 10;
    align-items: center;
    padding-left: 12px;
    box-sizing: border-box;
}

#prompt-loader-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background-color: #D58618; /* Sanftes Grün */
    border-right: 2px solid #D58618; /* Harte Kante vorne */
    transition: width 0.2s linear;
}

#prompt-loader-text {
    position: relative;
    z-index: 11;
    font-size: 0.65rem;
    color: #ffffff;
    font-family: 'Aptos', sans-serif;
}

#prompt-loader-pcnt {
    font-weight: 200;
    margin-left: 150px;
    }

#prompt {
    flex: 1; height: 30px; min-height: 30px; padding: 6px 10px;
    border: none; outline: none; font-family: 'Aptos', sans-serif;
    font-size: 0.65rem; resize: none; box-sizing: border-box; line-height: 18px;
}

/* Der Rahmen um das Eingabefeld, damit es wie ein Projekt-Item aussieht */
.new-project-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

/* Das Eingabefeld darin (unsichtbarer Rahmen, damit nur die Box wirkt) */
#newProjectName {
    flex: 1;
    border: none;       /* KORREKTUR: Kein eigener Rahmen */
    outline: none;      /* Verhindert den blauen Standard-Rahmen beim Klicken */
    background: transparent;
    font-family: 'Aptos', sans-serif;
    font-size: 0.65rem;
    padding: 10px 15px;
    box-sizing: border-box;
}

/* Der Speichern-Button in der Box */
.save-inline-btn {
    padding: 0 25px; background-color: #C3AB85; color: white;
    border: none; cursor: pointer; font-size: 0.65rem;
    font-weight: 200; transition: background-color 0.2s;
}

.save-inline-btn:hover {
    background-color: #D58618;
}

.create-btn {
    padding: 0 25px; background-color: #C3AB85; color: white;
    border: none; cursor: pointer; font-size: 0.65rem;
    font-weight: 200; transition: background-color 0.2s;
}

.create-btn:hover { background-color: #D58618; }

/* Projektverwaltung UI */
#project-management-area { display: none; margin-top: 0; padding-top: 7px; }
.project-list-item {
    padding: 10px 15px; border: 1px solid #eee; border-radius: 8px;
    margin-bottom: 8px; cursor: pointer; transition: background 0.2s;
    display: flex; justify-content: space-between; align-items: center;
}
.project-list-item:hover { background: #f9f9f9; }

.project-info { display: flex; align-items: center; gap: 20px; }
.project-thumb { width: 60px; height: 30px; border-radius: 6px; object-fit: cover; border: 1px solid #ddd; }

#images img { width: 100%; border-radius: 8px; border: 1px solid #ccc; margin-top: -5px; cursor: pointer; }

/* === Comparison UI Styles === */
.comparison-selection-area {
    display: flex;
    gap: 20px;
    width: 100%;
}

.comp-selection-box {
    flex: 1;
    aspect-ratio: 16/10;
    border: 2px dashed #C3AB85;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    background: #fcfcfc;
    transition: all 0.2s;
}

.comp-selection-box:hover { background: #f5f5f5; border-color: #D58618; }

.comp-selection-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
}

.comp-selection-box span {
    position: relative;
    z-index: 2;
    background: rgba(195, 171, 133, 0.9);
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.65rem;
}

.comparison-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #ccc;
    cursor: pointer;
}

.comparison-image {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    pointer-events: none;
}

#comparison-after {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 50%;
    /* Der Strich: Etwas dicker und mit Schatten für Kontrast */
    border-right: 4px solid #C3AB85; 
    box-shadow: 0px 0 0px rgba(0,0,0,0); 
    z-index: 5;
    overflow: hidden; /* Wichtig, damit das Bild abgeschnitten wird */
    box-sizing: border-box;
}

#slider-mode {
    position: relative;
    width: 100%;
    overflow: hidden; /* Dies schneidet das Bild an den Kanten ab */
    border-radius: 8px; /* Optional: behält die abgerundeten Ecken bei */
}

#active-main-img {
    transition: transform 0.1s ease-out;
    user-select: none;
    -webkit-user-drag: none;
    display: block;
    width: 100%;
    height: auto;
}

/* Aktiver Zustand für Side-Buttons */
.tool-btn.active {
    background-color: #D58618 !important; /* orange */
    color: white !important;
}

.tool-btn.active:hover {
    background-color: #D58618; /* bleibt orange beim Hover */
}


/* === Plan Layout Modus Styles === */
#plan-layout-mode {
    display: none;
    width: 100%;
    background: #ffffff;
    padding: 20px;
    box-sizing: border-box;
}

/* === CONTAINER LOGIK === */

/* Übersicht: Miniaturansichten nebeneinander */
#plan-container-scroll.overview-mode {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background: #ffffff;
    overflow-x: hidden; 
    overflow-y: auto;
    max-height: 80vh;
}

/* Editier-Modus: Ein Plan groß zentriert */
#plan-container-scroll.edit-mode {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 10px;
    background: #ffffff;
    overflow-y: auto;
}

.plan-wrapper {
    margin: 15px; /* Gleichmäßiger Abstand zu allen Seiten */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: width 0.3s ease, height 0.3s ease;
}

/* === PLAN CANVAS (BLATT) === */
.plan-canvas {
    background: white;
    position: relative;
    border: 2px solid #333;
    box-sizing: border-box;
    display: grid;
    grid-auto-columns: 1fr;
    grid-auto-rows: 1fr;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

/* Skalierung in der Übersicht */
.overview-mode .plan-canvas {
    transform: scale(0.2);
    transform-origin: center center; /* Zentral skalieren */
    flex-shrink: 0;
}

.overview-mode .plan-canvas:hover {
    border-color: #D58618;
    z-index: 10;
}

/* Skalierung im Edit-Modus */
.edit-mode .plan-canvas {
    transform: scale(1);
    transform-origin: center center;
}

/* === ZELLEN & INHALT === */
.plan-cell {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border: 1px dashed #bbb;
    background: #fff;
    position: relative;
}

.plan-cell:hover { background: #fdfdfd; }

.plan-cell img {
    cursor: grab;
    transform-origin: center center;
    user-select: none;
}

.plan-cell img.dragging {
    cursor: grabbing;
}


.cell-content-area {
    flex: 1;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cell-content-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cell-content-area textarea {
    width: 100%;
    height: 100%;
    border: none;
    padding: 12px;
    font-family: 'Aptos', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    resize: none;
    background: transparent;
    outline: none;
    color: #333;
}

.plan-footer-input {
    width: 100%;
    border: none;
    border-top: 1px solid #eee;
    text-align: center;
    font-family: 'Aptos', sans-serif;
    font-size: 11px;
    font-weight: bold;
    color: #555;
    background: #fff;
    padding: 8px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    outline: none;
}

/* === INTERAKTIVE ELEMENTE (STEUERUNG) === */

/* Verstecke UI-Elemente komplett im Übersichtsmodus */
.overview-mode .cell-overlay,
.overview-mode .mini-btn,
.overview-mode .plan-footer-input::placeholder {
    display: none !important;
}

.cell-overlay {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 3px;
    z-index: 10;
    opacity: 0.15;
    transition: opacity 0.2s;
}

.plan-cell:hover .cell-overlay { opacity: 1; }

.mini-btn {
    background: #C3AB85;
    color: white;
    border: none;
    padding: 3px 6px;
    font-size: 10px;
    cursor: pointer;
    border-radius: 3px;
}

.mini-btn:hover { background: #D58618; }

.layout-controls .mini-btn.active {
    background-color: #D58618 !important;
    border-color: #333 !important;
}

.camera-marker, .target-marker {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
    z-index: 1000;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.camera-marker { background: #D58618; }
.target-marker { background: #419B44; }

.camera-marker::after,
.target-marker::after {
    font-size: 14px;
    position: absolute;
    left: 20px;
    top: -2px;
    white-space: nowrap;
    text-shadow: 1px 1px 2px black;
}

.camera-marker::after { content: '📷'; }
.target-marker::after { content: '🎯'; }

.camera-line {
    position: absolute;
    height: 2px;
    background: repeating-linear-gradient(
        to right,
        #D58618,
        #D58618 5px,
        transparent 5px,
        transparent 10px
    );
    transform-origin: 0 50%;
    pointer-events: none;
    z-index: 998;
}

/* STYLE GRID — gleiches Layout, sauber zentriert */
.atmosphäre-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 600px;
    margin: 40px auto;
}

/* STYLE BUTTON — angepasst an Main Button Design */
.atmosphäre-btn {
    background: #C3AB85;
    color: white;
    border: none;
    padding: 16px 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s ease, transform 0.05s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.atmosphäre-btn:hover {
    background: #D58618;
}

.atmosphäre-btn:active {
    transform: translateY(1px);
}


/* Das Canvas für Lasso/Zeichnen innerhalb des Image-Area */
#lasso-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5; /* Über dem Bild, aber unter den Buttons */
    pointer-events: none; /* WICHTIG: Standardmäßig Klicks durchlassen */
}

/* Wenn das Tool aktiv ist, muss das Canvas Klicks fangen */
#lasso-canvas.active {
    pointer-events: auto;
    cursor: crosshair;
}

/* Die Tool-Leiste (falls sie über dem Bild schwebt) */
#drawing-tools {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-out, opacity 0.3s ease, padding 0.3s ease;
    opacity: 0;
    background-color: #ffffff; 
    border: 1px solid #C3AB85; /* Rundum-Rahmen */
    border-radius: 8px;        /* Alle Ecken abrunden */
    margin-top: -10px;          /* Normaler Abstand statt negativem Wert */
    margin-bottom: 15px;          /* Normaler Abstand statt negativem Wert */
    display: flex;
    flex-direction: column;
}

#drawing-tools.open {
    max-height: 500px; /* Ein Wert, der sicher größer als der Inhalt ist */
    opacity: 1;
    padding: 15px; /* Dein ursprüngliches Padding */
}

/* Aktiver Zustand für die weißen Werkzeug-Buttons */
#drawing-tools .tool-btn.active {
    background-color: #D58618 !important; /* Bleibt weiß */
    box-shadow: 0 0 5px rgba(195, 171, 133, 0.5);
    transform: scale(1.05);
}

/* Hover-Effekt */
#drawing-tools .tool-btn:hover {
    background-color: #D58618 !important;
}

/* --- Stil-Anpassung für die Auswahl-Buttons in den Panels --- */

/* Grundzustand der Buttons (überschreibt Inline-Farben bei Bedarf) */
.slide-panel .tool-btn.atmosphäre-selector {
    transition: all 0.2s ease !important;
    background-color: white !important;
    color: #000000 !important;
    border: 1px solid #ccc !important;
}

/* Hover-Effekt wie bei den Drawing-Tools */
.slide-panel .tool-btn.atmosphäre-selector:hover {
    background-color: #D58618 !important;
    color: white !important;
    border-color: #D58618 !important;
}

/* AKTIVER ZUSTAND (Wichtig: Höchste Spezifität) */
/* Verhindert das Verschwinden der Schrift durch erzwungenes Weiß auf Orange */
body .slide-panel .tool-btn.atmosphäre-selector.active {
    background-color: #D58618 !important;
    color: white !important; /* Schrift wird explizit weiß */
    border-color: #C3AB85 !important;
    box-shadow: 0 0 8px rgba(213, 134, 24, 0.4) !important;
    transform: scale(1.05);
}

/* Sorgt dafür, dass auch die Icons (SVG) weiß werden, wenn aktiv */
.slide-panel .tool-btn.atmosphäre-selector.active svg {
    stroke: white !important;
}

/* Erzwingt die Sichtbarkeit des Spans (Schrift) im aktiven Zustand */
.slide-panel .tool-btn.atmosphäre-selector.active span {
    color: white !important;
    display: inline-block !important;
}

/* --- Deine bestehende Logik (bleibt unberührt) --- */


.slide-panel {
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s ease-in-out, opacity 0.3s ease, padding 0.3s ease;
    pointer-events: none; /* Verhindert Klicks während es geschlossen ist */
}

.slide-panel.open {
    max-height: 500px; /* Groß genug für den Inhalt */
    opacity: 1;
    pointer-events: auto;
    padding-bottom: 15px;
}

/* Optional: Schöner Hover für die History-Boxen */
#history-boxes div:hover {
    transform: scale(1.1);
    border-color: #C3AB85 !important;
    transition: transform 0.1s ease;
}

/* --- Spezifische Styles NUR für die rechte Sidebar --- */

/* Das neue statische Element */
.static-header {
    margin-top: 10px;
    font-size: 0.80rem;
    font-weight: 400; /* Etwas dicker als die h3, da es ein Haupttitel ist */
    color: #C3AB85; /* Goldton passend zum Projekt-Header */
    text-align: center;
    width: calc(100% - 25px);
}

/* Der Container der Sektion in der rechten Sidebar */
.sidebar-right .button-section {
    display: flex;
    flex-direction: column;
    align-items: center; 
    gap: 5px;
    margin-bottom: 0px; /* Erhöht für bessere Trennung der offenen Sektionen */
    width: calc(100% - 25px); 
}

/* Die Überschriften in der rechten Sidebar */
.sidebar-right .button-section h3 {
    margin: 0;
    font-size: 0.50rem;
    font-weight: 200;
    color: #C3AB85;
    cursor: pointer;
    padding: 0px 0;
    width: 100%;
    display: block;
    text-align: center;
}

/* Accordion Logik: STANDARDMÄSSIG GEÖFFNET */
.sidebar-right .button-grid-container {
    /* Ein sehr hoher Wert sorgt dafür, dass der Inhalt sofort sichtbar ist */
    max-height: 2000px; 
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
    width: 100%;
}

/* Umkehrlogik: Nur wenn die Klasse .closed hinzugefügt wird, klappt es zu */
.sidebar-right .button-section.closed .button-grid-container {
    max-height: 0;
}

/* Das Grid in der rechten Sidebar */
.sidebar-right .button-grid {
    display: flex;
    flex-wrap: wrap; 
    gap: 5px;
    padding: 5px 0 5px 0;
    justify-content: center;
}

/* Die Buttons (Options) in der rechten Sidebar */
.sidebar-right .option {
    /* 20% sorgt für 5 Spalten, sofern der Platz reicht */
    flex: 1 0 calc(20% - 8px); 
    min-width: 80px; /* Leicht reduziert, damit 5 Spalten nebeneinander Platz finden */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.50rem;
    border: 1px solid #e0e0e0;
    background: #ffffff;
    border-radius: 6px;
    padding: 2px 2px;
    box-sizing: border-box;
    transition: all 0.12s;
    cursor: pointer;
    min-height: 18px;
    text-align: center;
    font-weight: 200;
}

/* Hover-Effekt nur für rechts */
.sidebar-right .option:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
    transform: translateY(-1px);
}


.lib-category-card {
    background: #ffffff;
    border: 1px solid #eee;
    padding: 30px 10px;
    border-radius: 8px;
    text-align: center;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.lib-category-card:hover {
    border-color: #C3AB85;
    background: #fdfbf8;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}


/* Haupt-Container für das Grid */
#grid-mode {
    display: none;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
    position: relative;
    /* Verhindert, dass Kinder den Container aufblähen */
    min-width: 0; 
}

/* Die Kategorie-Leiste - JETZT MIT UMBRUCH */
#grid-category-bar {
    display: flex;
    flex-wrap: wrap; /* Erlaubt mehrere Zeilen statt Scrollen */
    gap: 8px; /* Etwas kompakterer Abstand */
    padding: 5px 0 15px 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    width: 100%;
    box-sizing: border-box;
}

#grid-category-bar::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

/* Die einzelnen Tabs */
.grid-tab, .project-sort {
    /* white-space: nowrap; kann bleiben, damit ein Wort nicht zerrissen wird */
    white-space: nowrap; 
    padding: 6px 12px; /* Etwas flacher für den Zeilenumbruch-Look */
    background: #f8f8f8;
    border-radius: 4px;
    cursor: pointer;
    font-size: 9px; /* Minimal kleiner für bessere Übersicht in Zeilen */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    border: 1px solid #eee; /* Leichter Rahmen für bessere Trennung */
    color: #666;
    /* Verhindert, dass Buttons sich extrem in die Breite ziehen */
    flex: 0 1 auto; 
}

.grid-tab:hover, .project-sort:hover {
    background: #f0f0f0;
}

.grid-tab.active, .project-sort.active {
    background: #ffffff;
    border-color: #C3AB85;
    color: #C3AB85;
    font-weight: bold;
}

/* Das eigentliche Bild-Grid */
#grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

/* Style für die Bilder im Grid (wird via JS genutzt) */
.grid-item {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #eee;
    transition: opacity 0.2s;
}

.grid-item:hover {
    opacity: 0.8;
}


.export-format {
    flex:1;
    text-align:center;
    padding:20px;
    border:1px solid #ccc;
    border-radius:8px;
    cursor:pointer;
    font-weight:500;
    transition:all 0.2s ease;
}

.export-format:hover {
    background:#D58618;
    color:white;
    border-color:#D58618;
}

.export-format.active {
    background:#C3AB85;
    color:white;
    border-color:#C3AB85;
}


/* Custom Cursors für die Werkzeuge */
/* Weiße Custom Cursors mit Outline */
/* Weißer Stift mit roter Spitze */
/* Weißer Stift mit roter Spitze */
.cursor-pen {
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'> \
        <path d='M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z' fill='white' stroke='black' stroke-width='0.5'/> \
        \
        <circle cx='3.5' cy='20.5' r='1.5' fill='red'/> \
    </svg>") 3 21, crosshair;
}


.cursor-eraser {
    /* Ein weißer Schwamm, leicht geneigt mit Poren-Struktur */
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='25' height='25' viewBox='0 0 28 28'> \
        <g transform='rotate(-45, 14, 14)'> \
            \
            <path d='M5 8c0-1.1.9-2 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V8z' fill='white' stroke='black' stroke-width='0.5'/> \
            \
            <circle cx='9' cy='10' r='1.2' fill='black' fill-opacity='0.2'/> \
            <circle cx='13' cy='14' r='1.5' fill='black' fill-opacity='0.15'/> \
            <circle cx='18' cy='10' r='0.8' fill='black' fill-opacity='0.25'/> \
            <circle cx='16' cy='16' r='1.1' fill='black' fill-opacity='0.15'/> \
            <circle cx='10' cy='16' r='0.9' fill='black' fill-opacity='0.2'/> \
            <circle cx='20' cy='15' r='1.3' fill='black' fill-opacity='0.1'/> \
        </g> \
    </svg>") 4 24, cell;
}

.cursor-lasso {
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'><path d='M7.5 16.5L4 7L13.5 11L20 4V14.5L13.5 17.5M7.5 16.5C7.5 18.5 9 20 11 20C13 20 14.5 18.5 14.5 16.5C14.5 14.5 13 13 11 13C9 13 7.5 14.5 7.5 16.5ZM7.5 16.5L11 22' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/><path d='M7.5 16.5L4 7L13.5 11L20 4V14.5L13.5 17.5M7.5 16.5C7.5 18.5 9 20 11 20C13 20 14.5 18.5 14.5 16.5C14.5 14.5 13 13 11 13C9 13 7.5 14.5 7.5 16.5ZM7.5 16.5L11 22' stroke='black' stroke-width='0.5' stroke-linecap='round' stroke-linejoin='round'/></svg>") 11 16, crosshair;
}

/* Die Klasse wird dem Parent (main-view) gegeben */
.cursor-picker, 
.cursor-picker * {
    cursor: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M17.5 3c-.8 0-1.5.3-2.1.9L12.5 6.8l1.4 1.4 2.9-2.9c.2-.2.5-.2.7 0l1.4 1.4c.2.2.2.5 0 .7l-2.9 2.9 1.4 1.4 2.9-2.9c1.2-1.2 1.2-3.1 0-4.3-.6-.5-1.3-.8-2.1-.8zM11.1 8.2L3 16.3V21h4.7l8.1-8.1-4.7-4.7z' fill='white' stroke='black' stroke-width='0.5'/%3E%3C/svg%3E") 3 21, crosshair !important;
}


/* Preserve desktop styling while allowing compact browser windows. */
#app-status{font-size:12px;color:#666;margin:0 0 10px;overflow-wrap:anywhere}
#app-status.error{color:#a32b22}
.project-backup-tools,.map-toolbar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}
.project-open{border:0;background:none;font:inherit;text-align:left;cursor:pointer;flex:1;min-width:0;padding:0;display:flex;align-items:center;gap:15px;overflow-wrap:anywhere}
.project-open .project-thumb{flex:none}
.project-name{min-width:0}
.media-card{border:1px solid #ccc;border-radius:4px;background:white;padding:0;aspect-ratio:1;overflow:hidden;cursor:pointer;color:#333;white-space:pre-wrap}
.media-card img{width:100%;height:100%;object-fit:cover}
.export-plan-row{display:flex;justify-content:space-between;align-items:center;gap:15px;padding:12px 0;border-bottom:1px solid #eee}
.export-plan-row button{width:140px}
.export-format.disabled{opacity:.45;cursor:not-allowed}
button:focus-visible,[tabindex]:focus-visible{outline:2px solid #8b714e;outline-offset:3px}
.sq-btn-nav{border:1px solid #C3AB85;border-radius:4px;background:white;color:#745e3f;padding:6px 9px;font:inherit;font-size:12px;cursor:pointer}
.project-list-item{gap:8px}
#lasso-canvas{touch-action:none}
@media(max-width:850px){.container{flex-direction:column;gap:12px;margin:15px auto}.sidebar{flex:initial;width:100%;box-sizing:border-box}.image-area{width:100%;min-width:0}#text-mode,#export-mode{padding:15px!important}.plan-canvas-wrapper{max-width:100%}#custom-modal>div{max-width:90vw}#grid-container{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:850px){.container>*{max-width:100%;min-width:0;box-sizing:border-box}.project-list-item{flex-wrap:wrap}.project-info{min-width:0}.prompt-container{box-sizing:border-box}#plan-container-scroll{max-width:100%;overflow:auto}#grid-category-bar{flex-wrap:wrap}#project-header{flex-wrap:wrap}.button-section h3{min-width:0}.export-plan-row{flex-wrap:wrap}}
@media(max-width:850px){body{flex-direction:column;align-items:center}.sidebar-right{flex:initial;width:98%;max-width:98%;margin:0 auto 20px;box-sizing:border-box}.sidebar-right .button-section,.sidebar-right .static-header{width:100%;box-sizing:border-box}}
@media(max-width:850px){.sidebar{margin-left:0}#sidebar-preview img{box-sizing:border-box}.prompt-container textarea{min-width:0}.header-controls{flex-wrap:wrap}}

#access-gate{position:fixed;inset:0;z-index:100000;background:#f6f8fa;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:32px;text-align:center;color:#172a3b;font-family:Arial,sans-serif}#access-gate p{max-width:560px;line-height:1.6}#access-gate a{padding:12px 20px;border-radius:8px;background:#285de5;color:#fff;text-decoration:none}

/* Text navigation, export groups and the collapsible preset column. */
.image-area{min-width:0}
.project-sort{font-family:inherit}
#concept-text-display{box-sizing:border-box;height:clamp(300px,50vh,560px);overflow-y:auto;overflow-wrap:anywhere;overscroll-behavior:contain;scrollbar-gutter:stable}
.text-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid #eee;margin-bottom:12px}
.text-heading h2{margin:0 0 10px;color:#C3AB85;font-weight:200}
.text-navigation{display:flex;align-items:center;gap:8px;white-space:nowrap;color:#745e3f;font-size:12px}
.media-arrow{border:1px solid #C3AB85;background:white;color:#745e3f;border-radius:4px;font-size:26px;line-height:1;width:32px;height:32px;cursor:pointer}
.media-arrow[hidden]{display:none}
.presets-heading{position:relative;min-height:28px;display:flex;align-items:center;justify-content:center}
.presets-toggle{position:absolute;left:0;top:0;width:28px;height:28px;padding:0;border:1px solid #C3AB85;border-radius:4px;background:white;color:#745e3f;font-size:24px;line-height:1;cursor:pointer}
.sidebar-right.is-collapsed{flex:0 0 32px;width:32px;min-width:32px;margin-left:12px;margin-right:12px}
.sidebar-right.is-collapsed>.button-section,.sidebar-right.is-collapsed .presets-heading span{display:none}
.sidebar-right.is-collapsed .presets-heading{width:32px}
.export-section{border-top:1px solid #e8e2d8;margin-top:22px;padding-top:18px}
.export-section h3{margin:0 0 8px;font-size:16px;font-weight:400;color:#745e3f}
.export-section p,.export-description{font-size:12px;line-height:1.5;color:#666;margin:0 0 12px}
.export-category-list{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.export-actions,.export-formats{display:flex;flex-wrap:wrap;gap:8px}
.export-actions .sq-btn-nav{white-space:normal;text-align:left}
.export-formats{margin:12px 0}
.export-formats .export-format{font-family:inherit}
#archive-status{font-size:12px;line-height:1.5;margin-top:12px;overflow-wrap:anywhere}
[data-archive]:disabled{opacity:.55;cursor:wait}
@media(max-width:600px){.export-category-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:850px){.sidebar-right.is-collapsed{flex:initial;width:98%;max-width:98%;margin:0 auto 20px}.text-heading h2{font-size:18px}.text-heading{gap:6px}.export-section .big-btn-main{max-width:100%;white-space:normal}}

/* Shared spacing and controls across library, projects and text. */
.image-area{gap:12px}
#main-controls{height:auto;min-height:30px;margin-bottom:0}
#project-management-area{padding-top:0}
#main-view{margin-top:0!important}
#grid-category-bar{padding:0;margin-bottom:12px;border-bottom:0}
.project-backup-tools{padding:0;margin:0 0 12px}
.grid-tab,.project-sort{box-sizing:border-box;font-family:inherit;font-size:9px;line-height:12px;padding:6px 12px;min-height:26px;margin:0}
.media-arrow,.presets-toggle{border:0;background:transparent;color:#C3AB85;box-shadow:none}
.media-arrow:hover,.presets-toggle:hover{color:#a68b60;background:#faf8f4}
.sketch-toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:12px}
.sketch-toolbar button{min-height:36px;touch-action:manipulation}
.sketch-toolbar button[aria-pressed="true"]{background:#C3AB85;color:white}
.sketch-toolbar label{font-size:12px;display:flex;gap:6px;align-items:center}
.sketch-paper{position:relative;background:white;box-shadow:0 0 0 1px #ddd;width:100%;aspect-ratio:3/2}
.sketch-paper canvas{position:absolute;inset:0;width:100%;height:100%;touch-action:none}
.sketch-paper canvas:first-child{pointer-events:none}
.sketch-note{font-size:12px;color:#777;margin:12px 0}
.sketch-swatches{display:flex;gap:6px}
.sketch-swatches button{width:28px;min-height:28px;border:1px solid #ddd;border-radius:50%;padding:0}

/* Sketch tools share the editing panel's sidebar placement and dimensions. */
#sketch-tools{flex-direction:row;flex-wrap:wrap;gap:8px;padding:15px;background:white;border:1px solid #C3AB85;border-radius:8px;margin-top:-10px;margin-bottom:15px;box-sizing:border-box}
#sketch-tools [data-tool]{display:flex;align-items:center;justify-content:center;flex:1 0 26%;height:36px;padding:0;background:white;border:1px solid #ccc;color:#333}
#sketch-tools [data-tool][aria-pressed=true]{background:#D58618;box-shadow:0 0 5px #c3ab8580}
#sketch-tools .sketch-setting{width:100%;display:grid;grid-template-columns:1fr auto;font-size:.55rem;font-weight:bold;color:#666;gap:4px}
#sketch-tools .sketch-setting input{grid-row:2;grid-column:1/3;width:100%;accent-color:#C3AB85;margin:0}
#sketch-tools .sketch-setting output{grid-row:1;grid-column:2;color:#C3AB85}
#sketch-tools .sketch-swatches{flex-wrap:wrap}
#sketch-tools button:not([data-tool]){font-size:.65rem}
#text-mode{padding-left:60px!important;padding-right:60px!important}
.text-page-arrow{position:absolute;top:50%;transform:translateY(-50%);background:transparent!important;color:#C3AB85!important;border:0;font-size:2rem;width:45px;height:45px;border-radius:50%;z-index:10;padding:2px 6px}
#text-prev-btn{left:10px}#text-next-btn{right:10px}
.presets-toggle{font-size:0}
.presets-toggle::after{content:'';display:block;width:8px;height:8px;border-top:1px solid #C3AB85;border-right:1px solid #C3AB85;transform:rotate(45deg);margin:auto}
.sidebar-right.is-collapsed .presets-toggle::after{transform:rotate(-135deg)}

#sketch-tools{max-height:none;opacity:1;pointer-events:auto}

#concept-text-display{overflow-x:hidden;overflow-y:auto;white-space:pre-wrap!important;overflow-wrap:anywhere;max-width:100%;scrollbar-width:thin;scrollbar-color:#C3AB85 transparent}
#concept-text-display::-webkit-scrollbar{width:6px;height:0}
#concept-text-display::-webkit-scrollbar-thumb{background:#C3AB85;border-radius:3px}
#concept-text-display::-webkit-scrollbar-track{background:transparent}
#concept-text-display *{max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere}
.new-project-stage{min-height:clamp(320px,60vh,650px);display:flex;align-items:center;width:100%}
.new-project-row{width:100%;box-sizing:border-box;min-height:52px;margin:0;cursor:default}
.new-project-row input{outline:none;color:inherit;cursor:text;width:0}
.new-project-row input::placeholder{color:inherit;opacity:.65}
#text-title{overflow-wrap:anywhere;min-width:0}

/* Keep the scrollbar gutter stable while showing its thumb only during scrolling. */
#concept-text-display{scrollbar-color:transparent transparent}
#concept-text-display::-webkit-scrollbar-thumb{background:transparent}
#concept-text-display.is-scrolling{scrollbar-color:#C3AB85 transparent}
#concept-text-display.is-scrolling::-webkit-scrollbar-thumb{background:#C3AB85}

.project-name{color:#C3AB85}
.media-card.text-card{padding:12px;text-align:left;vertical-align:top;font-family:inherit;display:flex;flex-direction:column;gap:10px;min-width:0}
.text-heading h2,.text-card-title{font-family:'Aptos',Arial,sans-serif;font-size:24px;font-weight:200;color:#C3AB85;line-height:normal}
.text-card-title{display:block;overflow-wrap:anywhere;flex:none}
.text-card-preview{display:block;overflow:hidden;overflow-wrap:anywhere;font-size:.65rem;line-height:1.6;color:#333}
@media(max-width:850px){.text-heading h2,.text-card-title{font-size:18px}}

.sidebar-toggle{align-self:flex-end;flex:none;width:28px;height:28px;padding:0;border:0;background:transparent;cursor:pointer}
.sidebar-toggle::after{content:'';display:block;width:8px;height:8px;border-top:1px solid #C3AB85;border-right:1px solid #C3AB85;transform:rotate(-135deg);margin:auto}
.sidebar.is-collapsed{flex:0 0 140px;width:140px;min-width:0}
.sidebar.is-collapsed>:not(#project-header):not(#sidebar-toggle){display:none!important}
.sidebar.is-collapsed #project-header .header-controls{display:none}
.sidebar.is-collapsed #current-title{overflow-wrap:anywhere;max-width:100%;min-width:0}
.sidebar.is-collapsed .sidebar-toggle::after{transform:rotate(45deg)}
@media(max-width:850px){.sidebar.is-collapsed{flex:initial;width:100%}.sidebar.is-collapsed #project-header{margin-top:-33px;padding-right:36px;min-height:28px}}

/* Desktop: shared header baseline; collapse controls occupy the column gaps. */
@media(min-width:851px){
 .container{gap:28px}
 .sidebar{position:relative}
 #project-header{min-height:32px}
 #sidebar-toggle{position:absolute;right:-28px;top:2px;width:28px;height:28px}
 #main-controls{min-height:32px}
 #app-status{position:absolute;bottom:100%;left:0;right:0;margin:0 0 8px;font-size:11px}
 .sidebar-right{margin-left:28px}
 .presets-heading{height:32px;min-height:32px;box-sizing:border-box;margin-top:0}
 #presets-toggle{left:-28px;top:2px;width:28px;height:28px}
 .sidebar-right.is-collapsed{margin-left:28px}
}
@media(max-width:850px){
 .sidebar{position:relative;padding-top:0}
 #sidebar-toggle{position:absolute;right:0;top:1px}
 #project-header{padding-right:32px;min-height:30px}
 .sidebar.is-collapsed #project-header{margin-top:0}
}

/* Matching collapse controls and an upright character-by-character project title. */
.presets-toggle:hover{background:transparent;color:#C3AB85}
@media(min-width:851px){
 .sidebar.is-collapsed{flex-basis:32px;width:32px}
 .sidebar.is-collapsed #project-header{align-items:flex-start;justify-content:center}
 .sidebar.is-collapsed #current-title{writing-mode:vertical-rl;text-orientation:upright;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.4;max-height:calc(100vh - 90px);overflow-y:auto;scrollbar-width:thin;scrollbar-color:#C3AB85 transparent}
}
@media(max-width:850px){
 .sidebar.is-collapsed #current-title{writing-mode:vertical-rl;text-orientation:upright;white-space:pre-wrap;max-height:55vh;overflow-y:auto}
}

#text-mode{border-width:1px!important;box-shadow:none!important}
#text-title[contenteditable]{cursor:text;outline:none;min-width:1em}
#text-title[contenteditable]:focus{outline:1px dotted #C3AB85;outline-offset:3px}

#access-gate.is-loading{display:flex;align-items:center;justify-content:center;background:white;padding:24px;box-sizing:border-box}
.scitect-loading-logo{width:min(640px,calc(100vw - 48px),calc(100dvh - 48px));height:min(640px,calc(100vw - 48px),calc(100dvh - 48px));object-fit:contain;display:block;flex:none}

@media(prefers-reduced-motion:reduce){.scitect-loading-logo{animation:none}}

.grid-page-button{display:flex;align-items:center;gap:10px;background:transparent;border:0;box-shadow:none;color:#C3AB85;font:inherit;font-size:.7rem;cursor:pointer;padding:8px}
.thin-chevron{display:block;width:8px;height:8px;border-top:1px solid #C3AB85;border-right:1px solid #C3AB85;transform:rotate(45deg)}
.previous .thin-chevron{transform:rotate(-135deg)}
#text-tools{flex-direction:column;gap:12px;padding:15px;border:1px solid #C3AB85;border-radius:8px;background:white;margin-top:-10px;margin-bottom:15px}
#text-tools label{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:.65rem;color:#666}
#text-tools input,#text-tools select{min-width:0;max-width:65%;border:1px solid #ccc;border-radius:4px;background:white;padding:4px;font:inherit}
#text-tools input[type=number]{width:70px}#text-tools input[type=color]{height:30px;width:55px;padding:2px}
.text-tools-label{font-size:.55rem;color:#666;font-weight:bold}
.text-style-buttons{display:flex;gap:8px}.text-style-buttons button{flex:1;height:36px}.text-style-buttons [aria-pressed=true]{background:#C3AB85;color:white}

#text-title[contenteditable]:focus{outline:none;box-shadow:none}
.sidebar-tool-close,#sketch-tools .sidebar-tool-close{background:#eee!important;color:#000!important;border:none!important;font-size:.7rem!important;font-family:inherit;width:100%;height:30px;min-height:30px;padding:0;border-radius:4px;cursor:pointer;margin-bottom:15px;flex:none}
.text-style-buttons button{display:flex;align-items:center;justify-content:center}

#credit-balance{flex:none;align-self:flex-start;line-height:30px;padding:0 10px 0 5px;color:#C3AB85;font-size:.65rem;white-space:nowrap;font-variant-numeric:tabular-nums}
#prompt{min-width:0}
#custom-preset-add{flex:0 0 100%;width:100%}
#custom-presets{display:flex;flex-wrap:wrap;gap:5px;width:100%}
.custom-preset-row{position:relative;flex:1 0 calc(33.333% - 5px);min-width:80px;display:flex}
.sidebar-right .custom-preset-row .option{font-family:inherit;width:100%;padding-right:17px;overflow-wrap:anywhere}
.custom-preset-delete{background:none;border:0;color:#a68b64;cursor:pointer;font:14px Aptos,sans-serif;padding:0 4px}
.custom-preset-row .custom-preset-delete{position:absolute;right:0;top:0;bottom:0}
#modal-body label{display:block;text-align:left;margin:10px 0 5px}#preset-title,#preset-body{box-sizing:border-box;width:100%;font:inherit;border:1px solid #d9cbb5;border-radius:4px;padding:8px}#preset-body{resize:vertical}
#text-languages{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin-bottom:12px}#text-languages [aria-pressed=true]{background:#C3AB85;color:white}#text-languages button:disabled{opacity:.5}.language-note,#text-languages>span{font-size:11px;color:#9a805d}
#merge-tools{flex-direction:column;gap:12px;padding:15px;border:1px solid #C3AB85;border-radius:8px;background:white;margin-top:-10px;margin-bottom:15px}#merge-tools p{font-size:11px;line-height:1.5;color:#806c50;margin:0}.merge-original{height:95px;width:100%;object-fit:contain}.merge-references{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.merge-references>div{position:relative;min-width:0}.merge-references img{height:70px;width:100%;object-fit:contain}.merge-references span{display:block;font-size:10px;color:#9a805d}.merge-references .custom-preset-delete{position:absolute;top:0;right:0;background:white}.merge-pick{display:flex;flex-direction:column;align-items:center}.merge-pick img{width:100%;height:100px;object-fit:contain}
@media(max-width:450px){#credit-balance{padding-right:6px;font-size:.6rem}#main-controls .create-btn{padding:0 12px}}

#custom-modal{z-index:20000!important}

.video-card{position:relative;background:#252525!important}
.video-card .video-play{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);color:#fff;font-size:38px;text-shadow:0 1px 8px #0008;pointer-events:none}
#video-toggle-surface{position:absolute;inset:0 0 52px;border:0;background:transparent;z-index:6;cursor:pointer}
#video-maximize{position:absolute;right:12px;top:12px;z-index:12;border:0;background:#0005;color:white;font-size:25px;cursor:pointer;border-radius:4px;width:36px;height:36px}
#slider-mode.video-expanded,#slider-mode:fullscreen{position:fixed!important;inset:0;z-index:30000;background:#111;display:flex!important;align-items:center;justify-content:center}
#slider-mode.video-expanded video,#slider-mode:fullscreen video{height:100%;width:100%;object-fit:contain;border:0!important;border-radius:0!important}

.media-chevron{font-size:0!important;border:0!important;background:transparent!important;padding:0!important}
.media-chevron::after{content:'';display:block;width:13px;height:13px;border-top:1px solid currentColor;border-right:1px solid currentColor;transform:rotate(45deg);margin:auto}
.media-chevron.back::after{transform:rotate(-135deg)}
.video-preset-title{position:absolute;top:calc(50% + 28px);left:10px;right:10px;color:white;font:12px Aptos,Arial,sans-serif;text-align:center;text-shadow:0 1px 5px #000}
#preset-output{width:100%;padding:7px;border:1px solid #d9cbb5;background:white;border-radius:4px}

.media-chevron::after{border-width:2px}
#prev-btn,#next-btn{z-index:25!important;pointer-events:auto!important}
#video-toggle-surface{left:65px;right:65px}
#grid-category-bar{flex-wrap:nowrap!important;gap:3px;overflow-x:auto;align-items:center}
#grid-category-bar .grid-tab{flex:1 1 auto;min-width:0;padding:5px 3px;font-size:clamp(7px,.65vw,11px)}
#library-trash-button{flex:0 0 24px!important;margin-left:auto;display:flex;justify-content:center}
.media-maximize{position:absolute;right:12px;top:12px;z-index:30;border:0;background:#0004;color:white;width:36px;height:36px;font-size:25px;cursor:pointer}
#text-mode .media-maximize{color:#C3AB85;background:transparent}
.media-expanded{position:fixed!important;inset:0!important;z-index:30000!important;width:100vw!important;height:100vh!important;max-width:none!important;margin:0!important;box-sizing:border-box;overflow:auto;background:white}
#slider-mode.media-expanded{display:flex!important;align-items:center;justify-content:center;background:#111}
#slider-mode.media-expanded #active-main-img{width:100%;height:100%;object-fit:contain;transform:none!important}
#text-mode.media-expanded #concept-text-display{max-height:calc(100vh - 230px)}
.sidebar-editor-panel{border:1px solid #C3AB85;border-radius:8px;padding:12px;margin:12px 0;font-size:12px;max-height:70vh;overflow:auto}
.sidebar-editor-panel button,.sidebar-editor-panel input,.sidebar-editor-panel select{max-width:100%;box-sizing:border-box;margin:4px 0}
.sidebar-editor-panel article{border-bottom:1px solid #ddd;padding:8px 0}
.sidebar-editor-panel input[type=number]{width:70px}

#grid-category-bar{align-items:stretch}#grid-category-bar .grid-tab{font-size:9px;display:flex;align-items:center;justify-content:center}
@media(max-width:850px){#grid-category-bar .grid-tab{font-size:8px}}

.sidebar-editor-panel{color:#806c50}
.sidebar-editor-panel h3{font-size:11px;font-weight:400;text-transform:uppercase;letter-spacing:.5px;color:#a68b64;margin:4px 0 12px}
.sidebar-editor-panel button{border:1px solid #C3AB85;border-radius:4px;background:white;color:#806c50;font:inherit;font-size:11px;padding:6px 8px;cursor:pointer}
.sidebar-editor-panel button:hover{background:#f6f1eb}
.sidebar-editor-panel input,.sidebar-editor-panel select{font:inherit;font-size:11px;border:1px solid #d9cbb5;border-radius:4px;background:white;color:#555;padding:6px;width:100%}
#video-editor-tools article{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
#video-editor-tools article strong{grid-column:span 4;font-weight:400;color:#a68b64}
#video-editor-tools article label{grid-column:span 2;font-size:10px;display:flex;flex-direction:column;gap:3px}
#video-editor-tools article input{width:100%;margin:0}
#video-editor-tools article button{margin:0;padding:5px 2px;font-size:10px}
#video-editor-tools>button{margin-right:5px}
#video-editor-tools>p{line-height:1.5}
#slider-mode:fullscreen #active-main-img{width:100%;height:100%;object-fit:contain;transform:none!important}

.media-card[draggable=true]{cursor:grab}.media-card[draggable=true]:active{cursor:grabbing}
.media-card.media-drop-target{outline:2px solid #C3AB85;outline-offset:-3px}
.media-drag-ghost{position:fixed;left:-1000px;top:0;padding:10px 16px;border:1px solid #C3AB85;border-radius:6px;background:white;color:#a68b64;font:14px Aptos,Arial,sans-serif;pointer-events:none}
#library-trash-button{color:#666;font-weight:inherit}#library-trash-button.active{color:#C3AB85;border-color:#C3AB85;background:white}
#trash-selection-controls{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0}
#trash-selection-controls button{flex:1}#trash-selection-controls button:disabled{opacity:.45;cursor:default}

#sketch-mode{position:relative}#sketch-mode>.media-maximize{background:#fff9;color:#C3AB85}
#sketch-mode.media-expanded{padding:50px 16px 16px;overflow:hidden;display:flex!important;flex-direction:column;align-items:center}
#sketch-mode.media-expanded .sketch-paper{width:min(100%,calc((100vh - 110px)*1.5));flex:none}
#sketch-floating-tools{position:fixed;left:24px;top:65px;width:250px;max-width:calc(100vw - 24px);max-height:calc(100vh - 90px);overflow:auto;z-index:45;background:white;border:1px solid #C3AB85;border-radius:8px;box-shadow:0 4px 18px #0002}
.sketch-window-handle{padding:10px;color:#a68b64;font-size:12px;cursor:move;touch-action:none;user-select:none;border-bottom:1px solid #e7dfd3}
#sketch-floating-tools #sketch-tools{margin:0;border:0;padding:10px}

#sketch-style{width:100%;padding:5px;border:1px solid #d9cbb5;border-radius:4px;font:11px Aptos,Arial,sans-serif;background:white;color:#806c50}
#sketch-floating-tools[data-dock=left],#sketch-floating-tools[data-dock=right]{width:210px;border-radius:0 8px 8px 0}
#sketch-floating-tools[data-dock=top],#sketch-floating-tools[data-dock=bottom]{width:min(850px,95vw);max-height:220px;transform:translateX(-50%)!important}
#sketch-floating-tools[data-dock=top] #sketch-tools,#sketch-floating-tools[data-dock=bottom] #sketch-tools{gap:5px}
#sketch-floating-tools[data-dock=top] #sketch-tools>*,#sketch-floating-tools[data-dock=bottom] #sketch-tools>*{flex:0 0 auto;width:auto;max-width:180px;margin:0}
#sketch-floating-tools[data-dock=top] #sketch-tools [data-tool],#sketch-floating-tools[data-dock=bottom] #sketch-tools [data-tool]{width:32px;height:30px;min-height:30px}
#grid-container .media-card-shell,#grid-container>.media-card{transition:transform 180ms ease,opacity 180ms ease}
@media(prefers-reduced-motion:reduce){#grid-container .media-card-shell,#grid-container>.media-card{transition:none}}

/* Reserve permanent docking rails on entry: docking never changes paper geometry. */
#sketch-mode.media-expanded{--rail-x:clamp(80px,16vw,220px);--rail-y:170px;padding:var(--rail-y) var(--rail-x);justify-content:center}
#sketch-mode.media-expanded .sketch-paper{width:min(100%,calc((100vh - 340px)*1.5))}
#sketch-floating-tools[data-dock=left],#sketch-floating-tools[data-dock=right]{box-sizing:border-box;width:var(--rail-x);max-height:calc(100vh - 70px)}
#sketch-floating-tools[data-dock=top],#sketch-floating-tools[data-dock=bottom]{box-sizing:border-box;max-height:160px}
.brush-style-picker{width:100%;position:relative;font-size:11px;color:#806c50}
.brush-style-picker summary{display:flex;align-items:center;gap:8px;cursor:pointer;padding:5px;border:1px solid #d9cbb5;border-radius:4px;list-style:none}
.brush-style-picker summary::after{content:'⌄';margin-left:auto}
.brush-style-picker canvas{width:70px;height:25px;flex:none}
.brush-style-list{display:flex;flex-direction:column;max-height:240px;overflow:auto;background:white;border:1px solid #d9cbb5;border-radius:4px}
#sketch-tools .brush-style-list button{display:flex;align-items:center;gap:8px;background:white;border:0;border-bottom:1px solid #eee;width:100%;padding:3px 5px;text-align:left;color:#806c50}
#sketch-tools .brush-style-list button[aria-selected=true]{background:#f1e9db}
.brush-style-picker[inert]{opacity:.4}
@media(max-height:500px){#sketch-mode.media-expanded{--rail-y:100px}#sketch-mode.media-expanded .sketch-paper{width:min(100%,calc((100vh - 200px)*1.5))}#sketch-floating-tools[data-dock=top],#sketch-floating-tools[data-dock=bottom]{max-height:90px}}

#sketch-mode.media-expanded>.sketch-note{display:none}

/* Compact tools: reserve only narrow docking strips. */
#sketch-mode.media-expanded{--rail-x:100px;--rail-y:60px;padding:60px 100px}
#sketch-mode.media-expanded .sketch-paper{width:min(100%,calc((100vh - 120px)*1.5))}
#sketch-floating-tools{display:flex;flex-direction:column;width:320px;min-width:0;overflow:visible;box-sizing:border-box}
#sketch-floating-tools .sketch-window-handle{flex:none;padding:7px 10px}
#sketch-floating-tools #sketch-tools{flex:1;min-height:0;overflow:auto;align-content:flex-start;align-items:center;gap:5px;padding:7px}
#sketch-floating-tools #sketch-tools>*{flex:0 0 auto;max-width:100%;margin:0}
#sketch-floating-tools #sketch-tools [data-tool]{flex:0 0 32px;height:30px;min-height:30px}
#sketch-floating-tools #sketch-tools .sketch-setting{width:130px}
#sketch-floating-tools #sketch-tools .brush-style-picker{width:175px}
#sketch-floating-tools #sketch-tools .sidebar-tool-close{width:auto;min-width:65px}
#sketch-floating-tools[data-dock=top],#sketch-floating-tools[data-dock=bottom]{width:calc(100vw - 16px);height:54px;max-height:54px;flex-direction:row;border-radius:5px}
#sketch-floating-tools[data-dock=top] .sketch-window-handle,#sketch-floating-tools[data-dock=bottom] .sketch-window-handle{width:24px;padding:0;font-size:0;display:flex;align-items:center;justify-content:center;border:0;border-right:1px solid #ddd}
#sketch-floating-tools[data-dock=top] .sketch-window-handle::after,#sketch-floating-tools[data-dock=bottom] .sketch-window-handle::after{content:'✥';font-size:16px}
#sketch-floating-tools[data-dock=top] #sketch-tools,#sketch-floating-tools[data-dock=bottom] #sketch-tools{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;padding:4px}
#sketch-floating-tools[data-dock=left],#sketch-floating-tools[data-dock=right]{width:94px;max-height:calc(100vh - 70px)}
#sketch-floating-tools[data-dock=left] #sketch-tools,#sketch-floating-tools[data-dock=right] #sketch-tools{justify-content:center}
#sketch-floating-tools[data-dock=left] .brush-style-picker canvas,#sketch-floating-tools[data-dock=right] .brush-style-picker canvas{display:none}
#sketch-floating-tools[data-dock=left] .brush-style-picker summary,#sketch-floating-tools[data-dock=right] .brush-style-picker summary{overflow-wrap:anywhere;font-size:9px}
#sketch-floating-tools .brush-style-picker[open]{position:relative}
#sketch-floating-tools .brush-style-picker[open] .brush-style-list{position:fixed;z-index:100;max-width:260px;width:230px;box-shadow:0 3px 15px #0003}
.sketch-resize{position:absolute;z-index:110;touch-action:none}
.sketch-resize-e,.sketch-resize-w{top:8px;bottom:8px;width:6px;cursor:ew-resize}.sketch-resize-e{right:0}.sketch-resize-w{left:0}
.sketch-resize-n,.sketch-resize-s{left:8px;right:8px;height:6px;cursor:ns-resize}.sketch-resize-n{top:0}.sketch-resize-s{bottom:0}
.sketch-resize-ne,.sketch-resize-nw,.sketch-resize-se,.sketch-resize-sw{width:12px;height:12px}.sketch-resize-ne{right:0;top:0;cursor:nesw-resize}.sketch-resize-nw{left:0;top:0;cursor:nwse-resize}.sketch-resize-se{right:0;bottom:0;cursor:nwse-resize}.sketch-resize-sw{left:0;bottom:0;cursor:nesw-resize}
#sketch-floating-tools[data-dock]:not([data-dock=""]) .sketch-resize{display:none}

.brush-style-list[popover]:not(:popover-open){display:none}
.brush-style-list:popover-open{position:fixed;inset:auto;margin:0;width:230px;max-height:240px;padding:0;box-shadow:0 3px 15px #0003}

.sketch-paper{overflow:hidden;touch-action:none;overscroll-behavior:contain}

/* Zoom the A4 sheet itself, including its white surface and edge, on a neutral desk. */
.sketch-viewport{position:relative;width:100%;aspect-ratio:297/210;overflow:hidden;background:#e8e6e2;touch-action:none;flex:none}
.sketch-viewport .sketch-paper{position:absolute;left:5%;top:5%;width:90%;height:90%;aspect-ratio:297/210;box-shadow:0 1px 8px #0002}
#sketch-mode.media-expanded .sketch-viewport{width:min(100%,calc((100vh - 120px)*297/210))}
#sketch-mode.media-expanded .sketch-viewport .sketch-paper{width:90%}

/* Expanded sketch desk reaches the screen edges; only the sheet is transformed. */
#sketch-mode.media-expanded{padding:0}
#sketch-mode.media-expanded .sketch-viewport{position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto}
#sketch-mode.media-expanded .sketch-viewport .sketch-paper{--sheet-width:min(calc(100vw - clamp(24px,13.34vw,200px)),calc((100dvh - 120px)*297/210));width:var(--sheet-width);height:auto;left:calc((100% - var(--sheet-width))/2);top:calc((100% - var(--sheet-width)*210/297)/2)}
.sketch-zoom-controls{display:none}
.media-expanded>.sketch-zoom-controls{display:flex;position:absolute;top:12px;left:50%;transform:translateX(-50%);gap:6px;z-index:35;background:#fffffff0;border-radius:6px;padding:4px}
.sketch-zoom-controls button{border:0;background:transparent;color:#a88b63;font:inherit;cursor:pointer;min-width:36px;min-height:36px}
.sketch-zoom-controls button:first-child,.sketch-zoom-controls button:nth-child(2){font-size:24px}
.sketch-zoom-controls button:hover{background:#c3ab8520}

#live-link{color:white}#live-link[data-role=viewer]{color:#c3ab85}#live-link[data-role=sender]{background:#a88b63}
.live-link-status{position:fixed;bottom:12px;left:50%;transform:translateX(-50%);z-index:100000;background:#fff;color:#806949;box-shadow:0 2px 12px #0002;border-radius:6px;padding:8px 14px;font-size:12px;pointer-events:none}
.live-sketch-video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none;background:white}
.live-viewing #sketch-canvas{visibility:hidden}.live-readonly{opacity:.45;pointer-events:none}

#live-link[data-role=viewer],#live-link[data-role=viewer]:hover{background:#e8872d;color:#fff}
#live-link[data-role=sender],#live-link[data-role=sender]:hover{background:#398653;color:#fff}

.media-maximize,#sketch-mode>.media-maximize{background:transparent!important}
.optimize-btn{border-right:1px solid #ffffff60;padding:0 16px;flex-shrink:0}
#optimize-preset{padding:8px 12px;border-radius:4px}
.optimize-btn:disabled,#optimize-preset:disabled{opacity:.65;cursor:wait}

#video-edit-mode{width:100%;min-width:0}#video-edit-preview{display:block;width:100%;max-height:60vh;object-fit:contain;background:#191919;aspect-ratio:16/9}#video-edit-transport{display:flex;gap:12px;align-items:center;padding:12px 0;flex-wrap:wrap;color:#9b8260;font-size:12px}#video-edit-timeline{display:flex;gap:10px;overflow-x:auto;padding:12px 4px;min-height:150px}.cut-tile{position:relative;flex:none;background:#f5f2ee;border:1px solid #c3ab85;border-radius:5px;padding:12px 16px;box-sizing:border-box;cursor:grab;transition:width .15s}.cut-tile strong,.cut-tile span{display:block;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cut-tile img{height:70px;width:100%;object-fit:cover;margin:6px 0}.cut-trim{position:absolute;top:0;bottom:0;width:13px;border:0;background:#c3ab85;color:white;cursor:ew-resize;touch-action:none;padding:0}.cut-trim.start{left:0}.cut-trim.end{right:0}

#video-edit-mode{position:relative}.cut-tile{background:white;border-width:1px;padding-left:10px;padding-right:10px}.cut-trim{width:5px;font-size:0}#video-edit-preview{cursor:pointer}#cut-playhead{flex:1;min-width:150px;accent-color:#c3ab85}.cut-caption-row{border-top:1px solid #ddd;padding-top:8px}.cut-caption-row input[type=number]{width:45%}
#video-edit-mode.cut-expanded{position:fixed;inset:0;z-index:10000;background:white;display:grid!important;grid-template-columns:260px minmax(0,1fr);grid-template-rows:minmax(0,1fr) 60px 160px;gap:0;padding:0}
.cut-expanded #video-editor-tools{grid-column:1;grid-row:1/4;overflow-y:auto;box-sizing:border-box;margin:0;padding:18px;width:100%}.cut-expanded #video-edit-preview{grid-column:2;grid-row:1;max-height:none;width:100%;height:100%;min-height:0;object-fit:contain}.cut-expanded #video-edit-transport{grid-column:2;grid-row:2;padding:6px 16px;margin:0}.cut-expanded #video-edit-timeline{grid-column:2;grid-row:3;min-height:0;margin:0}.cut-expanded .media-maximize{grid-column:2;grid-row:1;color:#c3ab85}
@media(max-width:650px){#video-edit-mode.cut-expanded{grid-template-columns:180px minmax(0,1fr);grid-template-rows:minmax(0,1fr) 70px 130px}.cut-expanded #video-editor-tools{padding:8px}.cut-expanded #video-edit-transport span:not(#cut-time){display:none}}

.cut-trim{width:14px;background:transparent}.cut-trim.start{border-left:3px solid #c3ab85}.cut-trim.end{border-right:3px solid #c3ab85}

/* Viewport-sized cutting desk; only the tool rail and timeline scroll internally. */
#video-edit-transport{display:grid;grid-template-columns:minmax(0,1fr);gap:5px;box-sizing:border-box}
#cut-playhead{display:block;width:100%;min-width:0;margin:0;box-sizing:border-box}
.cut-transport-details{display:flex;gap:6px 16px;flex-wrap:wrap;align-items:center;min-width:0}
#cut-time{white-space:nowrap;font-variant-numeric:tabular-nums}
#video-edit-mode.cut-expanded{height:100dvh;max-height:100dvh;min-height:0;box-sizing:border-box;overflow:hidden;grid-template-columns:230px minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto 140px}
.cut-expanded #video-editor-tools{min-height:0;padding:10px;overscroll-behavior:contain}
.cut-expanded #video-edit-preview{min-width:0;aspect-ratio:auto;max-width:100%;align-self:stretch}
.cut-expanded #video-edit-transport{padding:8px 0;font-size:11px}
.cut-expanded #video-edit-timeline{overflow-y:hidden;box-sizing:border-box;padding:8px 4px}
.cut-tile{transition:none;padding:6px 15px;min-width:38px;overflow:hidden}
.cut-tile img{height:64px;object-fit:contain;background:#fff}
.cut-trim{z-index:1;width:14px;background:transparent}
@media(max-height:700px){#video-edit-mode.cut-expanded{grid-template-rows:minmax(0,1fr) auto 120px}.cut-expanded .cut-tile img{height:45px}.cut-expanded #video-editor-tools{font-size:12px}}
@media(max-width:650px){#video-edit-mode.cut-expanded{grid-template-columns:170px minmax(0,1fr)}}

/* Keep long timelines out of the flex-column intrinsic width calculation. */
#main-view,#video-edit-mode,#video-edit-transport,#video-edit-timeline{min-width:0;max-width:100%;box-sizing:border-box}
#video-edit-timeline{width:100%;overflow-x:auto;contain:inline-size}
#video-edit-mode:not(.cut-expanded){overflow:hidden}
#video-edit-mode.cut-expanded,#video-edit-mode:fullscreen{width:100%;height:100dvh;margin:0;max-width:none;max-height:100dvh}

/* Consistent inset and black letterboxing in the video cutting desk. */
#video-edit-mode.cut-expanded{padding:5mm;column-gap:5mm;grid-template-rows:minmax(0,1fr) auto 140px}
.cut-expanded #video-editor-tools{height:100%;max-height:none;align-self:stretch}
#video-edit-preview{background:#000}
.cut-expanded #video-edit-preview{padding:5mm 0;box-sizing:border-box;background:#000}
#video-editor-tools,#video-edit-timeline{scrollbar-width:thin;scrollbar-color:transparent transparent}
#video-editor-tools::-webkit-scrollbar,#video-edit-timeline::-webkit-scrollbar{width:6px;height:6px}
#video-editor-tools::-webkit-scrollbar-thumb,#video-edit-timeline::-webkit-scrollbar-thumb{background:transparent;border-radius:3px}
#video-editor-tools::-webkit-scrollbar-track,#video-edit-timeline::-webkit-scrollbar-track{background:transparent}
#video-editor-tools.is-scrolling,#video-edit-timeline.is-scrolling{scrollbar-color:#C3AB85 transparent}
#video-editor-tools.is-scrolling::-webkit-scrollbar-thumb,#video-edit-timeline.is-scrolling::-webkit-scrollbar-thumb{background:#C3AB85}
#video-editor-tools textarea{width:100%;box-sizing:border-box;resize:vertical;min-height:65px;border:1px solid #d9cbb5;border-radius:4px;font:inherit;padding:6px;color:#555;background:white}
.cut-text-style{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
.cut-text-style label{display:flex;flex-direction:column;font-size:10px;min-width:0}
.cut-text-style input[type=number]{width:100%}
.cut-text-style input[type=color]{height:28px;padding:2px}

.cut-text-style input[type=checkbox]{width:16px;height:16px;accent-color:#C3AB85}.cut-text-style input[type=range]{width:100%;padding:0;accent-color:#C3AB85}.cut-text-style output{font-size:10px;color:#806c50}

#video-edit-timeline{overflow-x:scroll;scrollbar-color:#C3AB85 transparent}#video-edit-timeline::-webkit-scrollbar-thumb{background:#C3AB85}

@font-face{font-family:ScitectVideoNormal;src:url('/static/fonts/Aptos-Light.ttf') format('truetype');font-weight:400}
@font-face{font-family:ScitectVideoBold;src:url('/static/fonts/Aptos-SemiBold.ttf') format('truetype');font-weight:400}
.cut-style-buttons{grid-column:1/-1;display:flex;gap:4px;flex-wrap:wrap}
#video-editor-tools .cut-style-buttons button[aria-pressed=true]{background:#C3AB85;color:white}
.cut-scrub-row{display:flex;align-items:center;gap:10px;min-width:0;width:100%}
.cut-scrub-row #cut-playhead{flex:1;width:0}
#cut-sound{flex:none;background:transparent;border:0;cursor:pointer;color:#806c50;font-size:18px;padding:3px}

.cut-text-style .cut-background-toggle{grid-column:1/-1;flex-direction:row;align-items:center;gap:8px}.cut-background-toggle input{order:-1}#cut-sound{display:flex;align-items:center;justify-content:center;width:32px;height:32px;padding:4px;color:#333;border-radius:50%}#cut-sound:hover{background:#0000000d}#cut-sound svg{display:block;pointer-events:none}

.sidebar.is-collapsed #current-title{display:none!important}
#cut-sound svg{width:19px;height:19px}#cut-sound,#cut-more{width:28px;height:28px}
#cut-more{background:transparent;border:0;font-size:24px;color:#333;cursor:pointer;padding:0}
.cut-scrub-row{position:relative}.cut-video-menu{position:absolute;right:0;bottom:35px;z-index:50;background:white;border:1px solid #ddd;border-radius:6px;padding:8px;box-shadow:0 3px 12px #0002;min-width:190px}.cut-video-menu button,.cut-video-menu label{display:block;width:100%;padding:8px;box-sizing:border-box;text-align:left;font:12px Arial;color:#333}.cut-video-menu select{display:block;width:100%;margin-top:6px}
#video-edit-mode:not(.video-controls-visible) #video-cut-maximize,#slider-mode:has(#active-main-video:not([style*="display: none"])):not(.video-controls-visible) #video-maximize{opacity:0;pointer-events:none}
#slider-mode.video-controls-hidden #prev-btn,#slider-mode.video-controls-hidden #next-btn{opacity:0;pointer-events:none!important}
#video-cut-maximize:focus-visible,#video-maximize:focus-visible,#prev-btn:focus-visible,#next-btn:focus-visible{opacity:1!important;pointer-events:auto!important}

#video-cut-maximize,#video-maximize{pointer-events:auto!important}

#voice-button[data-state=active]{background:#388354!important;color:white!important}#voice-button[data-state=ready]{background:#D58618!important;color:white!important}#voice-button[data-state=connecting]{opacity:.65}
#voice-panel{position:fixed;right:15px;bottom:15px;z-index:11000;width:290px;max-width:85vw;padding:12px;background:white;border:1px solid #C3AB85;border-radius:8px;box-shadow:0 3px 14px #0002;color:#806c50;font:12px Arial}#voice-panel strong,#voice-panel small,#voice-panel [role=status]{display:block;margin-bottom:8px}#voice-panel select{margin-bottom:8px;width:100%}#voice-panel button{background:white;border:1px solid #C3AB85;border-radius:4px;padding:5px;color:#806c50;margin:2px}#voice-panel small{font-size:10px;line-height:1.4}

/* Guided help: compact callout, highlighted target, no blocking backdrop. */
.help-highlight{outline:2px solid #C3AB85!important;outline-offset:4px}
#workflow-help{position:fixed;z-index:2147483647;width:min(320px,calc(100vw - 40px));padding:18px;box-sizing:border-box;background:white;color:#333;border:1px solid #C3AB85;border-radius:8px;box-shadow:0 5px 24px #0002;font:14px/1.5 Arial,sans-serif}
#workflow-help p{margin:10px 0}#workflow-help .help-note{font-size:12px;color:#777}
#workflow-help button{border:1px solid #C3AB85;background:white;color:#6b5940;padding:7px 10px;margin:4px 5px 0 0;border-radius:4px;cursor:pointer}#workflow-help button:disabled{opacity:.4}

#workflow-help::before{content:"";position:absolute;top:18px;width:10px;height:10px;background:white;border-left:1px solid #C3AB85;border-bottom:1px solid #C3AB85;transform:rotate(45deg);left:-6px}#workflow-help[data-side="left"]::before{left:auto;right:-6px;transform:rotate(225deg)}

#help-settings{width:min(680px,calc(100vw - 32px));max-height:85vh;box-sizing:border-box;border:1px solid #C3AB85;border-radius:12px;padding:26px;color:#403b34;background:#fff;font:14px/1.5 Arial,sans-serif;overflow:auto}#help-settings::backdrop{background:#0003}#help-settings h2{margin:0 0 20px;font-size:20px;font-weight:500}#help-settings nav{display:flex;gap:8px;border-bottom:1px solid #eee;padding-bottom:14px}#help-settings button,#help-settings select{font:inherit;padding:8px 12px;border:1px solid #d7c7af;border-radius:5px;background:#fff;color:#725e42;cursor:pointer}#help-settings button:hover,#help-settings button.active{background:#f3eee7}#help-settings .help-close{position:absolute;right:18px;top:18px;border:0}.shortcut-row{display:grid;grid-template-columns:1fr 150px 40px;gap:8px;align-items:center;padding:9px 0;border-bottom:1px solid #eee}.shortcut-row small{display:block;font-size:11px;color:#999}#help-settings section>button{margin-top:18px}#shortcut-status{color:#916324;min-height:20px}.workflow-tooltip{position:fixed;z-index:2147483647;pointer-events:none;max-width:min(330px,85vw);padding:9px 12px;background:#fff;border:1px solid #C3AB85;border-radius:5px;color:#514637;box-shadow:0 3px 14px #0002;font:12px/1.5 Arial,sans-serif}@media(max-width:500px){.shortcut-row{grid-template-columns:1fr 115px 34px}#help-settings{padding:18px}.shortcut-row button{padding:6px!important;font-size:11px!important}}

#voice-button[data-state=listening],#voice-button[data-state=connecting]{background:#c39136!important;color:white!important;opacity:1}#voice-button[data-state=error]{background:#a54e3e!important;color:white!important}#voice-panel [role=status]{line-height:1.5;font-size:13px;font-weight:600}

#voice-panel{bottom:auto;max-height:calc(100vh - 90px);overflow:auto;z-index:31000}#voice-panel[hidden]{display:none!important}

#prepared-tools{flex-direction:column;gap:10px;padding:15px;margin-bottom:15px;border:1px solid #c3ab85;border-radius:8px;background:#fff;box-sizing:border-box}#prepared-tools p{margin:0;font-size:12px;line-height:1.5}#research-button{overflow-wrap:normal}
#design-main{position:relative;min-width:0;max-width:100%;padding:12px;box-sizing:border-box}#design-main pre{white-space:pre-wrap;font:14px/1.6 Arial,sans-serif}#design-main a{display:block;color:#806c50;margin:8px 0;overflow-wrap:anywhere}#design-tools{display:flex;flex-direction:column;gap:10px;padding:12px;max-height:75vh;overflow:auto;border:1px solid #c3ab85;border-radius:8px;background:white;font:12px Arial,sans-serif}#design-tools label{display:flex;flex-direction:column;gap:5px}#design-tools input,#design-tools textarea,#design-tools select{box-sizing:border-box;max-width:100%;width:100%;border:1px solid #d4c5af;border-radius:4px;padding:6px;font:inherit}#design-tools input[type=checkbox]{width:auto;align-self:flex-start}#design-tools textarea{min-height:75px;resize:vertical}#design-tools fieldset{border:1px solid #ded6c9;min-width:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}#design-tools input[type=range]{accent-color:#c3ab85}.design-four{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.design-four article{min-width:0;min-height:160px;border:1px solid #d4c5af;padding:8px}.design-four img{width:100%;aspect-ratio:3/2;object-fit:contain;cursor:pointer}.design-four small{display:block}.design-image,.design-canvas{width:100%;max-height:75vh;object-fit:contain}.design-guide:after{content:'';position:absolute;inset:12px;pointer-events:none;background:repeating-linear-gradient(90deg,transparent 0,transparent calc(10% - 1px),#c3ab8577 10%),repeating-linear-gradient(0deg,transparent 0,transparent calc(10% - 1px),#c3ab8577 10%)}
/* Filter workspace: same 230 px tool rail and 5 mm surround as video editor. */
#design-main.filter-workspace{padding:0;min-width:0;overflow:hidden}
.filter-stage{position:relative;display:flex;align-items:center;justify-content:center;min-width:0;min-height:0;width:100%;background:#000;overflow:hidden}
.filter-surface{position:relative;flex:none;line-height:0;overflow:hidden}
.filter-surface .design-canvas{display:block;width:100%;height:auto;max-height:none;object-fit:initial}
#design-main.filter-expanded{position:fixed!important;inset:0!important;z-index:30000;width:100%;height:100dvh;max-height:100dvh;max-width:none;box-sizing:border-box;padding:5mm;display:grid!important;grid-template-columns:230px minmax(0,1fr);gap:5mm;background:white;overflow:hidden}
.filter-expanded #design-tools{grid-column:1;grid-row:1;height:100%;max-height:none;min-height:0;margin:0;padding:10px;box-sizing:border-box;overscroll-behavior:contain}
.filter-expanded .filter-stage{grid-column:2;grid-row:1;height:100%;padding:5mm 0;box-sizing:border-box}
.filter-workspace>.media-maximize{z-index:10;color:#c3ab85;background:none;border:0}
#design-tools output{align-self:flex-end;font-variant-numeric:tabular-nums;color:#806c50;margin-top:-3px;line-height:1.2}
#design-tools{scrollbar-width:thin;scrollbar-color:#c3ab85 transparent}
#design-tools::-webkit-scrollbar{width:6px}#design-tools::-webkit-scrollbar-thumb{background:#c3ab85;border-radius:3px}
.filter-grid{position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(90deg,transparent 0,transparent calc(2.5% - 1px),#ffffff99 2.5%),repeating-linear-gradient(0deg,transparent 0,transparent calc(2.5% - 1px),#ffffff99 2.5%);filter:drop-shadow(0 1px 1px #000);z-index:2}
.filter-crop{position:absolute;box-sizing:border-box;border:1px solid white;box-shadow:0 0 0 2000px #0008;cursor:move;touch-action:none;z-index:3;background:linear-gradient(90deg,transparent 33%,#ffffff88 33%,#ffffff88 33.3%,transparent 33.3%,transparent 66.6%,#ffffff88 66.6%,#ffffff88 67%,transparent 67%),linear-gradient(transparent 33%,#ffffff88 33%,#ffffff88 33.3%,transparent 33.3%,transparent 66.6%,#ffffff88 66.6%,#ffffff88 67%,transparent 67%)}
.filter-crop-handle{position:absolute;width:22px;height:22px;border:3px solid white;box-sizing:border-box;touch-action:none}.filter-crop-handle.nw{left:0;top:0;border-right:0;border-bottom:0;cursor:nwse-resize}.filter-crop-handle.ne{right:0;top:0;border-left:0;border-bottom:0;cursor:nesw-resize}.filter-crop-handle.sw{left:0;bottom:0;border-right:0;border-top:0;cursor:nesw-resize}.filter-crop-handle.se{right:0;bottom:0;border-left:0;border-top:0;cursor:nwse-resize}
.filter-grid[hidden],.filter-crop[hidden]{display:none}
@media(max-width:650px){#design-main.filter-expanded{grid-template-columns:170px minmax(0,1fr);padding:8px;gap:8px}}
#design-tools input.filter-value{width:70px;align-self:flex-end;text-align:right;padding:3px 5px;color:#806c50;font-variant-numeric:tabular-nums;background:white;cursor:text}#design-tools input.filter-value:focus{outline:1px solid #c3ab85}#design-tools input.filter-value[aria-invalid=true]{border-color:#b33}

/* Fourteen primary tools in two consistent rows. */
.sidebar-primary-tools{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;width:100%;align-items:stretch}
.sidebar-primary-tools>.tool-btn{min-width:0;box-sizing:border-box;padding:2px!important;margin:0!important;white-space:normal;overflow-wrap:normal;line-height:1.1;font-size:.65rem!important;min-height:30px;height:30px!important}
/* Thin white range rails; keep a generous pointer/touch target. */
body input[type=range]{-webkit-appearance:none!important;appearance:none!important;background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;min-height:24px;height:24px;cursor:pointer;accent-color:#C3AB85}
body input[type=range]::-webkit-slider-runnable-track{height:2px;box-sizing:border-box;background:#fff;border:.5px solid #C3AB85;border-radius:2px;box-shadow:none}
body input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:12px;height:12px;margin-top:-5.5px;border:1px solid #C3AB85;border-radius:50%;background:#C3AB85;box-shadow:none}
body input[type=range]::-moz-range-track{height:2px;box-sizing:border-box;background:#fff;border:.5px solid #C3AB85;border-radius:2px;box-shadow:none}
body input[type=range]::-moz-range-progress{height:2px;background:#C3AB85;border:0;border-radius:2px}
body input[type=range]::-moz-range-thumb{width:10px;height:10px;border:1px solid #C3AB85;border-radius:50%;background:#C3AB85;box-shadow:none}
body input[type=range]:focus-visible{outline:1px solid #C3AB85;outline-offset:3px}
body input[type=range]:disabled{opacity:.45;cursor:default}

/* Keep the header aligned regardless of project-name length or tool rows. */
#main-sidebar:not(.is-collapsed) #project-header{height:32px;min-height:32px;flex:none;flex-wrap:nowrap;gap:5px;align-items:center}
#project-header #current-title{font-size:.8rem;line-height:1.15;min-width:0;flex:1;max-height:30px;overflow:hidden;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
#project-header .header-controls{flex:none;flex-wrap:nowrap;align-items:center}
#project-header .sq-btn{flex:none}
#sidebar-preview{flex:none;width:100%}
#sidebar-preview img{width:100%;height:auto;aspect-ratio:16/10;object-fit:cover}

/* Project name sits in the status row; image rows share the main-view baseline. */
#main-sidebar:not(.is-collapsed) #project-header{position:relative;justify-content:flex-start;padding-right:0;margin-bottom:7px}
#main-sidebar:not(.is-collapsed) #project-header #current-title{position:absolute;left:0;bottom:100%;margin-bottom:12px;width:100%;max-height:20px;font-size:1rem;line-height:20px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(min-width:851px){#app-status{margin-bottom:12px}}
@media(max-width:850px){#main-sidebar:not(.is-collapsed){padding-top:28px}#main-sidebar:not(.is-collapsed) #project-header{padding-right:32px}}

#prompt{padding-top:7px;padding-bottom:5px}
#credit-balance{align-self:center;position:relative;top:1px}
body input[type=range]::-webkit-slider-runnable-track{background:linear-gradient(to right,#fff 0 var(--range-a,0%),#C3AB85 var(--range-a,0%) var(--range-b,0%),#fff var(--range-b,0%) 100%)}
body input[type=range]::-moz-range-track{background:linear-gradient(to right,#fff 0 var(--range-a,0%),#C3AB85 var(--range-a,0%) var(--range-b,0%),#fff var(--range-b,0%) 100%)}
body input[type=range]::-moz-range-progress{background:transparent}
body input[type=range]:active::-webkit-slider-thumb,body input[type=range]:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 6px #c3ab8533}
body input[type=range]:active::-moz-range-thumb,body input[type=range]:focus-visible::-moz-range-thumb{box-shadow:0 0 0 6px #c3ab8533}
#design-tools input.filter-value{border:0;background:transparent;box-shadow:none}#design-tools input.filter-value:focus{outline:none}
.filter-preset-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}.filter-preset-grid>div{position:relative;min-width:0}#design-tools .filter-preset-grid button{width:100%;height:auto;margin:0;padding:0;border:0;background:none;font-size:8px;line-height:1.2;overflow-wrap:anywhere}.filter-preset-grid canvas{display:block;width:100%;height:auto;aspect-ratio:3/2;border-radius:3px}.filter-preset-grid span{display:block;margin-top:3px}.filter-preset-grid button:hover canvas{outline:1px solid #C3AB85}#design-tools .filter-preset-grid .filter-preset-delete{position:absolute;right:0;top:0;width:14px;height:14px;background:white;border-radius:50%;font-size:12px}

/* Compact filter adjustments with the value beside the rail. */
#design-tools .filter-adjustment{display:grid;grid-template-columns:minmax(0,1fr) 48px;gap:0 6px;align-items:center;margin:0;line-height:1.2}
#design-tools .filter-adjustment input[type=range]{grid-column:1;grid-row:2;margin:0;min-height:22px;height:22px}
#design-tools .filter-adjustment .filter-value{grid-column:2;grid-row:2;width:48px;margin:0;padding:0;text-align:right;align-self:center}
#design-tools .filter-adjustment small{grid-column:2;grid-row:1;text-align:right;font-size:9px}
.filter-preset-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}

/* Prevent fullscreen canvas intrinsic widths from widening the restored columns. */
#main-sidebar{min-width:0}
#design-tools{min-width:0;width:100%;box-sizing:border-box}
#design-main.filter-workspace,.filter-stage,.filter-surface{min-width:0;max-width:100%}
.filter-preset-grid canvas{min-width:0;max-width:100%}
.presentation-body{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;height:65vh;min-height:260px}.presentation-body.presentation-split{grid-template-columns:minmax(0,3fr) minmax(0,2fr)}.presentation-slide{min-width:0;min-height:0;background:#fff;border:1px solid #d9cbb5;padding:12px;overflow:auto;display:flex;flex-direction:column;justify-content:center}.presentation-slide img{width:100%;height:100%;min-height:0;object-fit:contain}.presentation-slide pre{white-space:pre-wrap;overflow-wrap:anywhere}.presentation-right{display:grid;grid-template-rows:minmax(0,3fr) minmax(0,2fr);gap:12px;min-width:0;min-height:0}.presentation-right[hidden]{display:none}.presentation-sketch{width:100%;height:100%;object-fit:fill;background:white;border:1px solid #c3ab85;touch-action:none;box-sizing:border-box}.presentation-right textarea{width:100%;height:100%;box-sizing:border-box;border:1px solid #c3ab85;resize:none;padding:12px;font:inherit}.presentation-nav{display:flex;gap:12px;align-items:center;margin-top:8px}.presentation-nav button{width:40px}.presentation-folder{border:1px dashed #c3ab85;min-height:80px;padding:6px}.presentation-folder>div{display:flex;gap:4px}.presentation-folder>div button:last-child{width:24px;flex:none}.presentation-sources{max-height:200px;overflow:auto}#design-main.presentation-expanded{position:fixed;inset:0;width:100%;height:100dvh;max-width:none;z-index:30000;background:white;padding:18px;box-sizing:border-box}.presentation-expanded .presentation-body{height:calc(100dvh - 85px)}
#design-main.presentation-expanded{display:grid!important;grid-template-columns:230px minmax(0,1fr);grid-template-rows:minmax(0,1fr) 38px;gap:12px 5mm;padding:5mm;overflow:hidden;height:100dvh;max-height:100dvh;min-height:0}
.presentation-expanded #design-tools{grid-column:1;grid-row:1/3;height:100%;max-height:none;min-height:0;margin:0;overflow:auto}
.presentation-expanded .presentation-body{grid-column:2;grid-row:1;height:100%;min-height:0;overflow:hidden}
.presentation-expanded .presentation-nav{grid-column:2;grid-row:2;margin:0;min-height:0}
.presentation-slide{box-sizing:border-box}.presentation-slide video{width:100%;height:100%;min-height:0;object-fit:contain;background:black}.presentation-right{overflow:hidden}.presentation-slide h1{font-size:clamp(22px,3vw,48px);color:#806c50}.presentation-expanded .presentation-slide{overflow:auto}
@media(max-width:650px){#design-main.presentation-expanded{grid-template-columns:150px minmax(0,1fr);gap:8px;padding:8px}}

#design-tools:has(.presentation-folder)>*{flex-shrink:0}.presentation-sources{min-height:40px}
.sidebar-primary-tools>.tool-btn,.sidebar-primary-tools>.tool-btn.active{background:white!important;color:#806c50!important;border:1px solid #C3AB85!important}
.sidebar-primary-tools>.tool-btn.tool-current{background:#C3AB85!important;color:white!important}
.sidebar-primary-tools>.tool-btn:hover{background:#D58618!important;color:white!important}
.header-controls .sq-btn.icon-current{background:#D58618!important}
#design-tools>h3,#video-editor-tools>h3,#merge-tools>h3,#text-tools>.text-tools-label,#sketch-tools>h3,#drawing-tools>h3,#atmosphäre-panel>h3,#layout-panel>h3,#comparison-panel>h3{display:none!important}
.sidebar-tool-close{order:9999!important;flex-shrink:0!important;margin-top:12px!important;margin-bottom:0!important}
#design-main.presentation-expanded{height:100dvh!important;max-height:100dvh!important;overflow:hidden!important;grid-template-rows:minmax(0,1fr) 34px!important}
#design-main.presentation-expanded .presentation-body{height:auto!important;min-height:0!important;max-height:100%;overflow:hidden}
.presentation-workspace>.media-maximize{position:absolute;top:8px;right:8px;z-index:40;background:none;border:0;color:#C3AB85}
.presentation-slide{overflow:hidden!important}.presentation-slide li{margin:0 0 .8em;line-height:1.4}.presentation-slide h1,.presentation-slide h2,.presentation-text-pane h2{font-size:var(--presentation-title-size,32px);color:var(--presentation-title-color,#806c50)}
.presentation-sketch-pane,.presentation-text-pane{position:relative;min-width:0;min-height:0;overflow:hidden;background:white;border:1px solid #C3AB85;box-sizing:border-box}
.presentation-text-pane{display:flex;flex-direction:column;padding:18px}.presentation-text-pane h2{margin:0 30px 12px 0;outline:none}.presentation-notes{flex:1;min-height:0;overflow:auto;white-space:pre-wrap;outline:none;scrollbar-width:thin;scrollbar-color:#C3AB85 transparent}
.presentation-pane-expanded{position:fixed!important;inset:18px!important;z-index:31000!important;background:white!important;width:auto!important;height:auto!important}
.presentation-pane-expanded .media-maximize{z-index:32000}
.presentation-embedded{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;min-height:0!important;padding:0!important;overflow:hidden!important}
.presentation-embedded .sketch-viewport{position:absolute!important;inset:0;width:100%!important;height:100%!important;aspect-ratio:auto!important}
.presentation-embedded .sketch-paper{width:90%!important;max-width:none!important;left:5%!important;top:5%!important}
.presentation-embedded .sketch-note{display:none}
.presentation-workspace #sketch-tools{max-height:none;flex-shrink:0}
.presentation-workspace .cut-text-style label[hidden]{display:none!important}

.presentation-pane-expanded{left:266px!important}.presentation-workspace .presentation-slide h2{margin:0 0 20px}.presentation-workspace .presentation-slide ul{margin:0;padding-left:1.2em}

.presentation-workspace #sketch-tools>.sidebar-tool-close{display:none!important}.presentation-expanded>.media-maximize{top:22px;right:22px}
/* Presentation playback is distinct from the full-screen editor. */
.presentation-slide{position:relative}.presentation-slide>.media-maximize,.presentation-sketch-pane>.media-maximize,.presentation-text-pane>.media-maximize{position:absolute;top:8px;right:8px;z-index:45;background:none;border:0;color:#C3AB85}
.presentation-nav{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;font-size:.7rem;color:#806c50}.presentation-nav .grid-page-button{width:auto!important;font-size:.7rem!important;background:transparent!important;border:0!important;color:#C3AB85!important;box-shadow:none!important}.presentation-nav .previous{justify-self:start}.presentation-nav .next{justify-self:end}
.presentation-show-controls{display:none}#design-main.presentation-show{grid-template-columns:minmax(0,1fr)!important;grid-template-rows:30px minmax(0,1fr) 34px!important}.presentation-show #design-tools{display:none!important}.presentation-show .presentation-show-controls{display:flex;grid-column:1;grid-row:1;justify-content:flex-end;gap:15px}.presentation-show-controls button{background:none;border:0;color:#806c50;cursor:pointer;font:inherit;font-size:.7rem}.presentation-show .presentation-body{grid-column:1;grid-row:2}.presentation-show .presentation-nav{grid-column:1;grid-row:3}.presentation-show>.media-maximize{display:none}.presentation-show .presentation-pane-expanded{left:18px!important}.presentation-show .presentation-slide{border:0}.presentation-right:has(.presentation-pane-expanded){overflow:visible}
.presentation-ai-slide{display:flex;flex-direction:column;justify-content:flex-start;padding:clamp(12px,2vw,30px);gap:12px}.presentation-ai-slide>h2{flex:none;margin:0!important;padding-right:26px}.presentation-ai-content{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr);gap:24px;align-items:center}.presentation-ai-slide[data-layout=split] .presentation-ai-content{grid-template-columns:minmax(0,3fr) minmax(0,2fr)}.presentation-ai-visuals{display:flex;gap:12px;min-height:0;height:100%;overflow:hidden}.presentation-ai-visuals>*{flex:1;min-width:0;max-width:100%;object-fit:contain}.presentation-ai-slide[data-layout=pair] .presentation-ai-content{grid-template-rows:minmax(0,1fr) auto}.presentation-ai-content ul{overflow:auto;max-height:100%;scrollbar-width:thin;scrollbar-color:#C3AB85 transparent}.presentation-ai-slide[data-layout=text] .presentation-ai-content{align-content:center}.presentation-workspace details label{display:flex;gap:8px;font-size:.75rem}.presentation-workspace details input{width:auto}#design-tools details{max-height:200px;overflow:auto}
#design-main.presentation-workspace:not(.presentation-expanded){position:relative;padding-top:40px}#design-main.presentation-expanded{padding-top:56px!important}.presentation-expanded>.media-maximize{top:12px;right:22px}#design-main.presentation-show{padding-top:18px!important}
.presentation-nav{display:flex!important;justify-content:space-between;position:relative}.presentation-nav>span{position:absolute;left:50%;transform:translateX(-50%);font-size:.7rem;pointer-events:none}.presentation-show-controls button{width:auto!important;flex:0 0 auto!important;padding:4px 12px}.presentation-ai-slide[data-layout=text] .presentation-ai-content{align-content:start;padding-top:24px}
/* One shared sketch toolbar, available only in the enlarged presentation pad. */
.presentation-embedded>#sketch-maximize{display:none!important}
.presentation-sketch-pane:not(.presentation-pane-expanded) #sketch-tools{display:none!important}
.presentation-sketch-pane #sketch-floating-tools{z-index:32001;left:24px;top:65px}
.presentation-sketch-pane.presentation-pane-expanded{left:18px!important}
/* Match the existing right-hand preset outlines; retain tool dimensions. */
.sidebar-primary-tools>.tool-btn,.sidebar-primary-tools>.tool-btn.active{border:1px solid #e0e0e0!important;font-size:.58rem!important}
.sidebar-primary-tools>.tool-btn:hover{border-color:#ccc!important}
.presentation-library-card{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:10px;overflow:hidden;background:white;color:#806c50}
.presentation-library-card img{width:100%;height:70%;object-fit:contain;min-height:0}
.presentation-library-title{font-size:.85rem;max-width:95%;overflow-wrap:anywhere}.presentation-library-count{font-size:.65rem;color:#806c50}

/* Shared type size for the architecture prompt and primary tools. */
:root{--prompt-tool-font-size:.65rem}
#prompt{font-size:var(--prompt-tool-font-size)}
.sidebar-primary-tools>.tool-btn,.sidebar-primary-tools>.tool-btn.active{font-size:var(--prompt-tool-font-size)!important}

/* Primary tool labels: independent of the prompt typography. */
.sidebar-primary-tools>.tool-btn,.sidebar-primary-tools>.tool-btn.active{font-family:'Aptos',Arial,sans-serif;font-weight:200;font-size:.50rem!important;color:#000000!important}
.sidebar-primary-tools>.tool-btn.tool-current,.sidebar-primary-tools>.tool-btn:hover{color:#ffffff!important}

#presets-sections-toggle{appearance:none;background:transparent;border:0;padding:0;color:inherit;font:inherit;cursor:pointer}
#presets-sections-toggle:focus-visible{outline:1px solid #C3AB85;outline-offset:4px;border-radius:2px}

/* Large plan sheets scroll within the centre column, never size the page. */
.image-area{min-width:0}
#main-view,#plan-layout-mode,#plan-container-scroll,#board-workspace{min-width:0;max-width:100%;box-sizing:border-box}
#plan-layout-mode{overflow:hidden}
.container{min-width:0;box-sizing:border-box}
.sidebar,.sidebar-right{min-width:0}

/* Shared sidebar tool inset, based on Atmosphere. Floating tools remain independent. */
#main-sidebar>:is(.slide-panel,.sidebar-editor-panel,#merge-tools,#text-tools,#sketch-tools){margin-top:-10px!important;margin-bottom:15px!important;padding:15px 10px!important;box-sizing:border-box;width:100%}
#main-sidebar>:is(.slide-panel,.sidebar-editor-panel,#merge-tools,#text-tools,#sketch-tools)>:first-child{margin-top:0!important}
#main-sidebar>:is(.slide-panel,.sidebar-editor-panel,#merge-tools,#text-tools,#sketch-tools)>.sidebar-tool-close{margin-bottom:0!important}
#model-tools{flex-direction:column;gap:12px}#model-tools .map-toolbar{display:flex;flex-direction:column;gap:12px;min-width:0;width:100%}#address-search{width:100%;min-width:0}#address-search gmp-place-autocomplete{width:100%;max-width:100%;box-sizing:border-box}

#address-search gmp-place-autocomplete{border:1px solid #C3AB85;border-radius:4px;background:white;color-scheme:light}
#address-search gmp-place-autocomplete:focus-within{outline:1px solid #C3AB85;outline-offset:1px}
#address-search .model-search-icon{color:#C3AB85;display:inline-flex;align-items:center}
#address-search gmp-place-autocomplete::part(focus-ring){outline-color:#C3AB85}

.font-weight-buttons{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}.font-weight-buttons button{width:auto!important;min-width:0!important;font-size:.55rem!important;padding:5px 2px!important}.font-weight-buttons button:disabled{opacity:.3;cursor:not-allowed}.font-weight-buttons button[aria-pressed=true]{background:#C3AB85!important;color:white!important}

.presentation-slide h1,.presentation-slide h2,.presentation-slide h3{font-weight:inherit;font-style:inherit}

.sketch-image-picker{width:min(760px,90vw);max-height:85dvh;overflow:auto}.sketch-image-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:10px}.sketch-image-grid button{background:white;border:1px solid #C3AB85;padding:6px;color:#333;font-size:.65rem}.sketch-image-grid img{display:block;width:100%;height:100px;object-fit:contain;margin-bottom:5px}

.brush-preview-size{margin-left:auto;white-space:nowrap;font-size:.55rem;color:#806c50}.brush-style-picker summary{gap:6px}

#sketch-floating-tools[data-dock=left] .brush-style-picker canvas,#sketch-floating-tools[data-dock=right] .brush-style-picker canvas{display:block;width:48px;height:17px}

.presentation-slide [data-slide-text][contenteditable=true]{cursor:text;outline:none;min-height:1em}.presentation-slide [data-slide-text]:focus{outline:none}.presentation-slide [data-slide-text]:empty:before{content:"Text eingeben";opacity:.35}.presentation-show [data-slide-text]:empty:before{content:none}

.live3d-workspace{min-width:0;min-height:320px;display:grid;place-items:center}.live3d-empty{text-align:center;padding:30px;color:#806c50}.live3d-empty h2{font-weight:400}.live3d-workspace p{line-height:1.6}

.cad3d-references{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}.cad3d-references label{border:1px solid #c3ab85;border-radius:5px;padding:10px;cursor:pointer;min-width:0}.cad3d-references img{width:100%;height:120px;object-fit:contain;background:white}.cad3d-references p{height:120px;overflow:auto;font-size:13px}.cad3d-references span{display:block;font-size:13px;overflow-wrap:anywhere}

.panorama-stage{position:relative;width:100%;height:60vh;min-height:280px;background:#eee;overflow:hidden}.panorama-stage canvas{width:100%;height:100%;display:block;touch-action:none;cursor:grab}.panorama-stage.panorama-full{position:fixed;inset:0;width:100vw;height:100dvh;z-index:10000}.panorama-workspace{min-width:0}

.panorama-stage{border-radius:12px;border:1px solid #c3ab85;box-sizing:border-box;height:68vh;background:#34302b}.panorama-header{position:absolute;top:0;left:0;right:0;display:flex;align-items:center;gap:12px;padding:18px 20px;color:white;background:linear-gradient(#24201ac9,transparent);pointer-events:none}.panorama-header button{pointer-events:auto}.panorama-project{font-size:12px;max-width:30%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.panorama-heading{position:absolute;left:50%;transform:translateX(-50%);font-size:14px}.panorama-badge{margin-left:auto;border:1px solid #c3ab85;border-radius:50%;padding:10px;font-size:12px}.panorama-stage button{border:0;background:transparent;color:white;cursor:pointer}.panorama-header button{font-size:30px;width:auto;padding:0}.panorama-hint{position:absolute;top:80px;left:50%;transform:translateX(-50%);padding:12px 18px;border-radius:30px;background:#30291fc9;color:white;font-size:12px;max-width:70%;text-align:center;pointer-events:none}.panorama-hint[hidden]{display:none}.panorama-arrow{position:absolute;top:45%;border:1px solid #c3ab85!important;border-radius:50%;background:#30291f99!important;width:40px;height:40px;font-size:28px}.panorama-arrow.previous{left:14px}.panorama-arrow.next{right:14px}.panorama-controls{position:absolute;bottom:118px;left:50%;transform:translateX(-50%);display:flex;background:#30291fcc;border:1px solid #c3ab8580;border-radius:24px;padding:4px 10px}.panorama-controls button{font-size:23px;width:38px;height:34px;padding:0}.panorama-stage button:hover{color:#e1bd87}.panorama-filmstrip{position:absolute;bottom:0;left:0;right:0;display:flex;gap:10px;padding:12px;background:#30291fc9;overflow-x:auto;box-sizing:border-box;min-height:100px}.panorama-filmstrip .panorama-thumb{flex:0 0 130px;overflow:hidden;padding:0;border:1px solid #ffffff44;border-radius:7px;display:block;width:130px;background:#30291f}.panorama-thumb[aria-pressed=true]{border:2px solid #c3ab85}.panorama-thumb img{display:block;width:100%;height:62px;object-fit:cover;background:white}.panorama-thumb span{display:block;font-size:11px;padding:4px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.panorama-full{border-radius:0}.panorama-stage>.media-maximize{top:74px;right:18px}.panorama-stage button:focus-visible{outline:2px solid #c3ab85;outline-offset:2px}@media(max-width:600px){.panorama-project{max-width:35%;font-size:10px}.panorama-heading{font-size:11px}.panorama-header{padding:10px}.panorama-filmstrip .panorama-thumb{flex-basis:100px}.panorama-hint{top:65px;font-size:10px}.panorama-stage{height:65vh}}

.panorama-stage{height:auto;min-height:0;aspect-ratio:3/2;border-radius:8px;border:1px solid #ccc}.panorama-stage canvas{position:absolute;inset:0}.panorama-stage.panorama-full{height:100dvh;aspect-ratio:auto;border-radius:0}.panorama-stage>.media-maximize{top:12px;right:12px;width:36px;height:36px}.panorama-stage .panorama-arrow{border:0!important;background:transparent!important;border-radius:50%}.panorama-hint{top:18px}.panorama-hotspot{position:absolute;transform:translate(-50%,-50%);width:22px;height:22px;border:2px solid white!important;border-radius:50%;background:#ffffff30!important;padding:4px;box-shadow:0 1px 5px #0008;z-index:5}.panorama-hotspot:after{content:'';display:block;background:white;border-radius:50%;width:10px;height:10px}.panorama-hotspot[hidden]{display:none}.panorama-hotspot:hover{outline:2px solid #c3ab85}.panorama-controls{bottom:118px}

.panorama-controls{padding:2px 6px;gap:1px;border-radius:18px}.panorama-controls button{width:28px;height:26px;font-size:18px}.panorama-arrow{touch-action:none;user-select:none}.panorama-expanded{position:fixed!important;inset:0;z-index:10000;background:white;padding:18px;box-sizing:border-box;display:grid!important;grid-template-columns:260px minmax(0,1fr);gap:18px;width:100vw;height:100dvh;overflow:hidden;min-height:0}.panorama-expanded>#design-tools{display:flex!important;flex-direction:column;box-sizing:border-box;width:100%;height:100%;min-height:0;margin:0!important;overflow:auto}.panorama-expanded>.panorama-stage.panorama-full{position:relative;inset:auto;width:100%;height:100%;min-width:0;min-height:0;aspect-ratio:auto;border-radius:8px;box-sizing:border-box}.panorama-expanded .panorama-filmstrip{max-height:106px}.panorama-expanded .panorama-controls{bottom:118px}@media(max-width:650px){.panorama-expanded{padding:8px;gap:8px;grid-template-columns:150px minmax(0,1fr)}.panorama-expanded>#design-tools{padding:8px;font-size:11px}}

#design-main.panorama-expanded{margin:0!important;max-width:none!important;max-height:100dvh!important;height:100dvh!important;min-height:0!important}.panorama-stage{aspect-ratio:auto;box-sizing:border-box}.panorama-stage .panorama-arrow{display:flex!important;align-items:center;justify-content:center;position:absolute;top:50%;transform:translateY(-50%);width:45px;height:45px;color:white;z-index:30;opacity:1!important;filter:drop-shadow(0 1px 2px #0008)}.panorama-arrow.previous{left:10px}.panorama-arrow.next{right:10px}.panorama-hotspot-row{display:grid;grid-template-columns:minmax(0,1fr) 28px;gap:5px;border-bottom:1px solid #ddd;padding:8px 0}.panorama-hotspot-row label{grid-column:1}.panorama-hotspot-row>button{grid-column:2;grid-row:1/3;padding:0!important}.panorama-hotspot-row input,.panorama-hotspot-row select{width:100%;box-sizing:border-box}[aria-pressed=true].big-btn-main{outline:1px solid #c3ab85}

/* Keep the icon row aligned to the reference preview and upload width. */
#main-sidebar:not(.is-collapsed) #project-header{padding-right:0;width:100%;box-sizing:border-box}
#main-sidebar:not(.is-collapsed) #project-header .header-controls{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);width:100%;gap:5px;min-width:0}
#main-sidebar:not(.is-collapsed) #project-header .header-controls .sq-btn{width:100%;min-width:0;padding:0;box-sizing:border-box}
#design-main.panorama-workspace:not(.panorama-expanded)>.panorama-stage{aspect-ratio:3/2;height:auto;min-height:0}
#design-main.panorama-expanded{grid-template-rows:minmax(0,1fr);min-width:0}
#design-main.panorama-expanded>.panorama-stage{height:100%;max-height:100%;min-height:0;overflow:hidden}
#sidebar-preview img{box-sizing:border-box}

/* Panorama uses the same full-width main-view frame as the image viewer. */
#design-main.panorama-workspace:not(.panorama-expanded){padding:0;width:100%}

html.app-expanded{overflow:hidden}html.app-expanded body{height:100dvh;overflow:auto}#app-fullscreen svg{display:block;flex:none}

/* Use the video editor's fullscreen dimensions, including embedded WordPress views. */
#design-main.panorama-expanded{inset:0!important;width:100%;padding:5mm;column-gap:5mm;grid-template-columns:230px minmax(0,1fr);grid-template-rows:minmax(0,1fr)}
#design-main.panorama-expanded>#design-tools{height:100%;max-height:none;min-height:0;padding:10px;align-self:stretch;overscroll-behavior:contain}
@media(max-width:650px){#design-main.panorama-expanded{grid-template-columns:170px minmax(0,1fr)}}

/* Panorama identity, using the same font family as video preview captions. */
.panorama-grid-badge{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:64px;height:64px;color:#fff;pointer-events:none;filter:drop-shadow(0 1px 5px #0008)}
.panorama-grid-badge svg{display:block;width:100%;height:100%}.panorama-grid-badge>span{position:absolute;left:0;right:0;top:18px;text-align:center;color:#fff;font:18px Aptos,Arial,sans-serif;line-height:22px}
.marketing-library-card{background:#f6f3ee}

.panorama-set-title{position:absolute;top:16px;left:18px;z-index:35;color:white;font:300 14px Inter,Arial,sans-serif;text-shadow:0 1px 4px #0008;pointer-events:none;max-width:70%;overflow-wrap:anywhere}.panorama-hotspot-label{position:absolute;bottom:calc(100% + 10px);left:50%;transform:translateX(-50%);white-space:nowrap;color:white;font:300 12px Inter,Arial,sans-serif;text-shadow:0 1px 4px #000;opacity:0;pointer-events:none;transition:opacity .15s}.panorama-hotspot:hover .panorama-hotspot-label,.panorama-hotspot:focus-visible .panorama-hotspot-label{opacity:1}

.camera-workspace video{display:block;width:100%;max-height:75dvh;object-fit:contain;border-radius:8px;background:#111}.camera-workspace{min-width:0}

#app-fullscreen[aria-pressed="true"]{background:#D58618!important;color:#fff!important}

/* Grid delete controls: reveal on pointer hover or keyboard focus; accessible on touch. */
@media(hover:hover) and (pointer:fine){
 .media-card-shell>.media-delete,.qr-card>.qr-card-delete,.filter-preset-grid>div>.filter-preset-delete{opacity:0!important;pointer-events:none;transition:opacity .15s ease}
 .media-card-shell:hover>.media-delete,.media-card-shell:focus-within>.media-delete,.qr-card:hover>.qr-card-delete,.qr-card:focus-within>.qr-card-delete,.filter-preset-grid>div:hover>.filter-preset-delete,.filter-preset-grid>div:focus-within>.filter-preset-delete{opacity:1!important;pointer-events:auto}
}
@media(hover:none),(pointer:coarse){.media-card-shell>.media-delete,.qr-card>.qr-card-delete,.filter-preset-grid>div>.filter-preset-delete{opacity:1!important;pointer-events:auto}}
