/* T-Shirt Designer MC v20 */

#tsd-designer-wrapper {
    margin: 30px 0 24px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --acc: #111;
    --border: #ddd;
    color: #222;
}

/* LAYOUT */
.tsd-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
@media (max-width: 768px) { .tsd-layout { flex-direction: column; } }

/* CANVAS – groß */
.tsd-canvas-wrap {
    position: relative;
    flex: 2 1 auto;
    max-width: 680px;
    min-width: 0;
}
.tsd-canvas-container {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    height: 0;
    overflow: hidden;
    border-radius: 6px;
    background: transparent;
    touch-action: none;
}
#tsd-cm-label {
    display: none;
    position: absolute;
    transform: translate(4px, -100%);
    background: rgba(0,0,0,0.82);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 600;
}
#tsd-pa-outline {
    display: none;
    position: absolute;
    background: rgba(26,115,232,0.08);
    border: 2px dashed #1a73e8;
    pointer-events: none;
    z-index: 50;
}
#tsd-snap-line-v,
#tsd-snap-line-h {
    display: none;
    position: absolute;
    pointer-events: none;
    z-index: 610;
}
#tsd-snap-line-v {
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 2px dashed #ff1e6c;
}
#tsd-snap-line-h {
    left: 0;
    right: 0;
    height: 0;
    border-top: 2px dashed #ff1e6c;
}
.tsd-canvas-container > div:not(.tsd-side-thumb) {
    position: absolute !important;
    top: 0 !important; left: 0 !important;
    width: 100% !important; height: 100% !important;
}
.tsd-canvas-container canvas {
    position: absolute !important;
    top: 0 !important; left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    touch-action: none;
}

/* SIDEBAR */
.tsd-sidebar {
    width: 420px;
    flex: 0 0 420px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
@media (max-width: 768px) { .tsd-sidebar { width: 100%; flex: none; } }

/* Diese 4 Controls sind auch direkt im Canvas erreichbar (Kamera-Button, T-Button,
   Floating-Toolbar mit Farbe/Schriftart) - in der Sidebar wären sie nur Dopplung.
   Bleiben im DOM (wichtig, weil der JS-Code sie als Datenspeicher nutzt), werden
   nur optisch versteckt. Preis/Warenkorb/Aufpreis-Hinweis in der Sidebar bleiben sichtbar. */
.tsd-upload-zone,
#tsd-upload-progress,
#tsd-text-input,
#tsd-font-family,
#tsd-color-label,
.tsd-color-presets,
.tsd-effect-row,
#tsd-curve-options,
#tsd-size-label,
#tsd-font-size,
#tsd-spacing-label,
#tsd-letter-spacing,
#tsd-lineheight-label,
#tsd-line-height,
#tsd-color-tabs,
#tsd-stroke-controls,
#tsd-color-hint {
    display: none !important;
}

/* UPLOAD */
.tsd-upload-zone {
    min-height: 64px;
    border: 2px dashed var(--border);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px;
    cursor: pointer;
    background: #fafafa;
    transition: border-color .2s, background .2s;
    box-sizing: border-box;
}
.tsd-upload-zone:hover, .tsd-upload-zone.drag-over {
    border-color: var(--acc); background: #fff5f7;
}
.tsd-upload-zone svg { width: 22px; height: 22px; fill: #555; }
.tsd-upload-zone span { font-size: 13px; color: #444; font-weight: 500; }

.tsd-progress-bar { height: 4px; background: #eee; border-radius: 2px; overflow: hidden; }
.tsd-progress-fill { height: 100%; background: var(--acc); animation: tsd-prog 1s linear infinite; }
@keyframes tsd-prog { 0%{width:0%} 50%{width:70%} 100%{width:90%} }

/* TEXT INPUT */
#tsd-text-input {
    height: 46px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 16px;
    font-family: inherit;
    box-sizing: border-box;
    width: 100%;
    -webkit-text-size-adjust: 100%;
}
#tsd-text-input:focus { outline: none; border-color: var(--acc); }
#tsd-text-input::placeholder { color: #555; opacity: 1; }

/* SELECT */
#tsd-font-family {
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 16px;
    background: #fff;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

/* SLIDER LABELS */
.tsd-row-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #888;
    margin-bottom: -2px;
    margin-top: 2px;
}
input[type="range"] {
    width: 100%;
    height: 16px;
    margin: 0;
    accent-color: var(--acc);
}

/* FARBFELDER – viereckig */
.tsd-color-presets {
    display: flex;
    gap: 0;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 6px 0;
    width: 100%;
}
.tsd-color-dot {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    height: 32px !important;
    flex: 0 0 32px !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    border: 2px solid transparent !important;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.18) !important;
    transition: transform .15s, box-shadow .15s;
    display: block !important;
    margin: 0 2px !important;
}
#tsd-designer-wrapper span.tsd-color-dot,
#tsd-designer-wrapper .tsd-color-dot {
    border-radius: 5px !important;
    -webkit-border-radius: 5px !important;
}
.tsd-color-dot:hover {
    transform: scale(1.15) !important;
    box-shadow: 0 0 0 2px var(--acc) !important;
}
.tsd-color-dot.active {
    transform: scale(1.1) !important;
    box-shadow: 0 0 0 2px var(--acc), 0 0 0 4px rgba(17,17,17,0.2) !important;
    border-color: #fff !important;
}

/* EFFEKT-BUTTONS */
.tsd-effect-row { display: flex; gap: 4px; padding-top: 2px; }
.tsd-effect-btn {
    flex: 1;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    font-size: 11px; font-weight: 600;
    color: #555; transition: all .15s;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    line-height: 32px !important;
    vertical-align: middle;
    white-space: nowrap;
    box-sizing: border-box;
}
.tsd-effect-btn:hover { border-color: var(--acc); color: var(--acc); }
.tsd-effect-btn.active { background: var(--acc); border-color: var(--acc); color: #fff; }

/* UNDO */
.tsd-btn-undo {
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    font-size: 12px; font-weight: 600;
    color: #555; width: 100%;
    transition: all .15s;
    margin-top: 4px;
}
.tsd-btn-undo:hover { border-color: var(--acc); color: var(--acc); }

/* WOOCOMMERCE IN SIDEBAR */
#tsd-wc-slot {
    margin-top: 12px;
    border-top: none;
    padding-top: 12px;
    width: 100%;
    box-sizing: border-box;
}
#tsd-wc-slot .cart,
#tsd-wc-slot form.cart {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: center !important;
    width: 100% !important;
}
#tsd-wc-slot .single_add_to_cart_button {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
}
#tsd-wc-slot .quantity { flex: 0 0 auto !important; }

/* FLATSOME-FIX */
body.tsd-active .woocommerce-product-gallery { display: none !important; }
body.tsd-active .woocommerce-breadcrumb { border-bottom: none !important; box-shadow: none !important; }
body.tsd-active .entry-summary > *:first-child { border-top: none !important; }
body.tsd-active .product .summary::before,
body.tsd-active .product .summary::after { display: none !important; }
body.tsd-active .product .col-left,
body.tsd-active .product .product-images { display: none !important; }
body.tsd-active .product .col-right,
body.tsd-active .product .entry-summary,
body.tsd-active .product div.summary {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    float: none !important;
    padding-left: 0 !important;
}

/* Variations-Preis über dem Counter ausblenden: rechnet den Designer-Aufpreis (beidseitiger
   Druck) nicht mit, zeigt also immer nur den Basispreis - verwirrt mehr als er hilft, weil
   oben schon der "ab"-Preis steht und weiter unten der Aufpreis-Hinweis. */
body.tsd-active .woocommerce-variation-price {
    display: none !important;
}

/* MOBILE */
@media (max-width: 600px) {
    .tsd-canvas-container { width: 100% !important; padding-bottom: 100% !important; }
    .tsd-canvas-wrap { width: 100% !important; max-width: 100% !important; }
}

/* SPINNER */
.tsd-loading {
    position: absolute; inset: 0;
    background: rgba(255,255,255,0.55);
    display: flex; align-items: center; justify-content: center; z-index: 10;
}
.tsd-spinner {
    width: 28px; height: 28px;
    border: 3px solid #eee; border-top-color: var(--acc);
    border-radius: 50%; animation: tsd-spin .7s linear infinite;
}
@keyframes tsd-spin { to { transform: rotate(360deg); } }

/* Pulsierender Farb-Badge über färbbarer Grafik */
.tsd-color-badge {
    position: absolute;
    z-index: 999;
    background: #111;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 20px;
    white-space: nowrap;
    cursor: pointer;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    animation: tsd-pulse-badge 1.4s ease-in-out infinite;
}
.tsd-color-badge::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #111;
    border-bottom: none;
}
@keyframes tsd-pulse-badge {
    0%, 100% { transform: scale(1);   box-shadow: 0 2px 8px rgba(17,17,17,0.4); }
    50%       { transform: scale(1.08); box-shadow: 0 4px 16px rgba(17,17,17,0.7); }
}

/* ================================================================
   SEITEN-THUMBNAIL (Vorne/Hinten umschalten) – v2.16
================================================================ */
.tsd-side-thumb {
    position: absolute !important;
    bottom: 10px !important;
    right: 10px !important;
    width: 68px !important;
    aspect-ratio: 1 !important;
    z-index: 20 !important;
    cursor: pointer !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    border: 2px solid #fff !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4) !important;
    background: #ccc !important;
    transition: transform .15s !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}
.tsd-side-thumb:hover {
    transform: scale(1.07) !important;
    box-shadow: 0 3px 14px rgba(0,0,0,0.5) !important;
}
.tsd-side-thumb img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}
.tsd-side-thumb-placeholder {
    width: 100% !important;
    aspect-ratio: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #888 !important;
    font-size: 20px !important;
    background: #e8e8e8 !important;
}
.tsd-side-thumb span {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    display: block !important;
    text-align: center !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    letter-spacing: .5px !important;
    text-transform: uppercase !important;
    color: #fff !important;
    background: rgba(0,0,0,0.6) !important;
    padding: 2px 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

/* ================================================================
   ANSICHTEN-MODAL (Vorne/Hinten/Rechts/Links umschalten) – Lumise-Style
================================================================ */
.tsd-view-modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9998 !important;
    background: transparent !important;
}
.tsd-view-modal-panel {
    position: absolute !important;
    bottom: 10px !important;
    right: 10px !important;
    width: 68px !important;
    z-index: 9999 !important;
    max-height: 70vh !important;
    overflow-y: auto !important;
    overflow-x: visible !important;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}
.tsd-view-modal-row {
    padding: 0 !important;
    margin-bottom: 8px !important;
    cursor: pointer !important;
}
.tsd-view-modal-row:last-child { margin-bottom: 0 !important; }

/* Mobile: schmaler, wie ursprünglich (Desktop bleibt bei 68px) */
@media (max-width: 768px) {
    .tsd-side-thumb { width: 52px !important; }
    .tsd-view-modal-panel { width: 52px !important; }
}

.tsd-view-modal-thumb {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    aspect-ratio: 1 !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    background: #ccc !important;
    border: 2px solid #fff !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}
.tsd-view-modal-thumb img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}
.tsd-view-modal-name {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    display: block !important;
    text-align: center !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    letter-spacing: .5px !important;
    text-transform: uppercase !important;
    color: #fff !important;
    background: rgba(0,0,0,0.6) !important;
    padding: 2px 0 !important;
}

/* ================================================================
   ON-CANVAS FLOATING UI  (v3.4.9)
================================================================ */

/* ---- Kamera-Badge: oben rechts ---- */
#tsd-upload-badge {
    position: absolute;
    z-index: 190;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.35);
    border: none;
    transition: transform .15s, box-shadow .15s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    pointer-events: auto;
    /* Kein Überlappen mit Canvas-Handles durch klaren z-index-Bereich */
}
#tsd-upload-badge:hover,
#tsd-upload-badge:active {
    transform: scale(1.12);
    box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}

/* ---- Filter-Badge: direkt unter dem Kamera-Badge ---- */
#tsd-filter-badge {
    position: absolute;
    z-index: 190;
    top: 62px;
    right: 10px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.35);
    border: none;
    transition: transform .15s, box-shadow .15s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    pointer-events: auto;
}
#tsd-filter-badge:hover,
#tsd-filter-badge:active {
    transform: scale(1.12);
    box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}

/* ---- T-Badge: direkt unter dem Filter-Badge ---- */
#tsd-t-badge {
    position: absolute;
    z-index: 190;
    top: 116px;
    right: 10px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    color: #111;
    font-size: 20px;
    font-weight: 900;
    font-family: Georgia, serif;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.35);
    border: none;
    transition: transform .15s, box-shadow .15s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    pointer-events: auto;
}
#tsd-t-badge:hover,
#tsd-t-badge:active {
    transform: scale(1.12);
    box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}
/* Pulsierendes Glühen wenn noch kein Text vorhanden */
#tsd-t-badge.tsd-t-pulse {
    animation: tsd-t-pulse 2.2s ease-in-out infinite;
}
@keyframes tsd-t-pulse {
    0%, 100% { box-shadow: 0 2px 10px rgba(0,0,0,0.35); }
    50%       { box-shadow: 0 3px 18px rgba(17,17,17,0.6), 0 0 0 5px rgba(17,17,17,0.15); }
}

/* ---- Floating Toolbar (bei Text-Selektion) ---- */
#tsd-float-bar {
    position: absolute;
    z-index: 200;
    display: none;
    align-items: center;
    gap: 6px;
    background: rgba(30,30,30,0.92);
    border-radius: 22px;
    padding: 5px 8px;
    box-shadow: 0 3px 14px rgba(0,0,0,0.45);
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: opacity .15s, transform .15s;
    opacity: 0;
    transform: translateY(4px);
    touch-action: manipulation;
}
#tsd-float-bar.tsd-flt-visible {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}
#tsd-float-bar::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-bottom: none;
    border-top-color: rgba(30,30,30,0.92);
}

.tsd-flt-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .12s, background .12s;
    flex-shrink: 0;
}
.tsd-flt-btn:active { transform: scale(0.88); }
.tsd-flt-btn * { pointer-events: none; } /* Icon/Text innen darf nie selbst Klick-Ziel sein - nur der ganze Kreis */

#tsd-float-color {
    background: rgba(255,255,255,0.12);
    border: 2px solid rgba(255,255,255,0.25);
}
#tsd-float-color:hover { background: rgba(255,255,255,0.22); }
#tsd-float-color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.7);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2);
    display: block;
}

#tsd-float-font {
    background: rgba(255,255,255,0.12);
    border: 2px solid rgba(255,255,255,0.25);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    font-family: Georgia, serif;
    letter-spacing: -1px;
    line-height: 1;
}
#tsd-float-font:hover { background: rgba(255,255,255,0.22); }

/* ---- Compact Color Picker ---- */
#tsd-float-cpk {
    position: absolute;
    z-index: 100000;
    display: none;
    flex-direction: column;
    gap: 0;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.20);
    max-width: 272px;
    pointer-events: auto;
    animation: tsd-flt-fadein .12s ease;
}
#tsd-float-cpk.tsd-flt-open { display: flex; }
#tsd-float-cpk input[type="range"] { accent-color: #111; }
.tsd-flt-tabs {
    display: flex;
    justify-content: space-between;
    margin-bottom: 9px;
    padding-right: 34px;
}
.tsd-flt-tab {
    font-size: 21px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    padding-bottom: 3px;
    border-bottom: 2px solid transparent;
    transition: color .12s, border-color .12s;
    user-select: none;
}
.tsd-flt-tab.tsd-flt-tab-active {
    color: #111;
    border-bottom-color: #111;
    font-weight: 700;
}
.tsd-flt-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    position: relative;
}

.tsd-color-tooltip {
    position: absolute;
    display: none;
    top: 0;
    transform: translateX(-50%);
    background: #222;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 5;
}
.tsd-color-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: #222;
}

.tsd-flt-swatch {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    cursor: pointer;
    display: block;
    flex-shrink: 0;
    border: 2px solid transparent;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.12);
    transition: box-shadow .12s;
}
.tsd-flt-swatch:hover,
.tsd-flt-swatch:active {
    box-shadow: inset 0 0 0 3px #111;
}
.tsd-motiv-color-dot:hover,
.tsd-motiv-color-dot:active {
    transform: scale(1.15);
    box-shadow: 0 0 0 2px #111;
}
.tsd-fixedgfx-color-dot:hover,
.tsd-fixedgfx-color-dot:active {
    transform: scale(1.15);
    box-shadow: 0 0 0 2px #111;
}
@media (max-width: 768px) {
    .tsd-flt-swatch { width: 38px; height: 38px; }
    #tsd-float-cpk {
        /* 6 Swatches à 38px + 5×4px gap + 2×8px padding = 272px */
        max-width: 272px;
    }
}

/* ================================================================
   FARBE / KONTUR / RUNDTEXT / AA PANEL – ein gemeinsames Footer-Panel
   mit 4 Tabs. Positionierung 1:1 nach dem v70-Font-Modal-Vorbild: Mobile =
   festes Bottom-Sheet, Shirt bleibt sichtbar. Desktop = Popup neben dem
   Objekt. WICHTIG: kein touch-action:none hier (im Gegensatz zum alten
   Font-Modal) – das blockiert laut Spec sämtliche Touch-Gesten der Kinder,
   inkl. Slider-Ziehen und Textfeld-Tap. #tsd-fk-body regelt Scroll-Kapselung
   selbst über touch-action:pan-y.
================================================================ */
#tsd-fk-ov {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.08);
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    animation: tsd-flt-fadein .15s ease;
    overscroll-behavior: contain;
}
#tsd-fk-ov.tsd-fk-open { display: flex; }
/* 16.08. (Micha: nach Unterdrueckung der Panel-Slide-Animation flackert jetzt
   das Overlay selbst) - #tsd-fk-ov hat oben eine eigene Fade-In-Animation, die
   beim selben Schliessen+Neuoeffnen-Workaround (tsdSvgDotSwitching) genauso neu
   anspringt. Gleiche Klasse, gleicher Effekt, auch hier greifen lassen. */
#tsd-fk-ov.tsd-fk-noanim {
    animation: none !important;
}

/* Desktop: transparentes Overlay */
#tsd-fk-ov.tsd-fk-desktop {
    background: transparent;
    pointer-events: none;
    align-items: flex-start;
    justify-content: flex-start;
    touch-action: auto;
}
#tsd-fk-ov.tsd-fk-desktop #tsd-fk-panel {
    pointer-events: auto;
    box-shadow: 0 6px 30px rgba(0,0,0,0.3);
    border: 1px solid #e8e8e8;
}

/* v2.7.209: Text-Modus (Farbe/Kontur/Text/Aa fuer i-text/Bogentext) - Overlay-
   Hintergrund laesst Klicks/Taps zum Canvas durch, damit man bei offenem Panel
   direkt einen ANDEREN Text antippen kann (Zoom folgt dann automatisch, siehe
   designer.js onSel()/openFkPanel()). Bewusst NICHT fuer den Bild/Motiv-Modus
   (fkImageMode) mitgesetzt - dort bleibt das bisherige, bestaetigt funktionierende
   Verhalten (Overlay blockiert) unangetastet. Gilt auch am Desktop (deckt sich
   mit .tsd-fk-desktop oben, kein Widerspruch da beide pointer-events:none wollen).
   #tsd-fk-panel selbst bleibt in beiden Modi klickbar. */
#tsd-fk-ov.tsd-fk-textmode {
    pointer-events: none;
}
#tsd-fk-ov.tsd-fk-textmode #tsd-fk-panel {
    pointer-events: auto;
}

#tsd-fk-panel {
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 18px 18px 0 0;
    width: 100%;
    max-width: 520px;
    /* Zurückgesetzt auf den bestätigten Stand v2.7.80 (45vh) - die 58vh-Änderung
       aus v2.7.82 wurde nie von Micha getestet/bestätigt, deshalb raus. */
    max-height: 45vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.3);
    animation: tsd-fnt-slide .2s ease;
    position: relative;
    padding: 14px 14px 18px;
    box-sizing: border-box;
}
@media (min-width: 769px) {
    #tsd-fk-panel {
        /* 4 Tabs (Farbe/Kontur/Rundtext/Aa) + Platz fürs X brauchen mehr als
           die alten 260px des Einzel-Font-Modals */
        max-width: 320px;
        border-radius: 12px;
        max-height: 460px;
        animation: tsd-flt-fadein .15s ease;
    }
}
@keyframes tsd-fnt-slide {
    from { transform: translateY(60px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
/* 16.08. (Micha: Panel "zuckt" beim Wechseln zwischen Farbkreisen) - der
   Schliessen+Neuoeffnen-Workaround beim Farbkreis-Wechsel (siehe designer.js
   tsdSvgDotSwitching) toggelt #tsd-fk-panel kurz auf display:none und wieder
   zurueck - CSS-Animationen starten dabei jedesmal neu, sichtbar als Zucken.
   Diese Klasse unterdrueckt die Animation gezielt fuer genau diesen Fall. */
#tsd-fk-panel.tsd-fk-noanim {
    animation: none !important;
}

/* Schließen-Button schwebend oben rechts im Panel */
#tsd-fk-x {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(240,240,240,0.9);
    color: #555;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
}
#tsd-fk-x:hover { background: #e0e0e0; }

/* Platz für den X-Button reservieren, damit der letzte Tab ("Aa") nicht
   verdeckt wird */
#tsd-fk-tabs { padding: 0 44px 0 4px; }

#tsd-fk-body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

/* Genesteter Farbe/Kontur-Inhalt + Rundtext-Inhalt + Schriftliste: volle
   Breite, keine eigene Box – die äußere #tsd-fk-panel-Karte übernimmt
   Hintergrund/Schatten. Kein eigenes overflow/flex mehr (das übernimmt
   #tsd-fk-body), sonst gäbe es verschachteltes Scrollen. */
#tsd-fk-panel #tsd-float-cpk,
#tsd-fk-panel #tsd-float-arch-modal,
#tsd-fk-panel #tsd-font-modal-list {
    position: static;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    max-width: none;
    min-width: 0;
    width: 100%;
    animation: none;
    overflow-y: visible;
    flex: none;
}

#tsd-font-modal-list {
    padding: 4px 0 16px;
}

.tsd-fnt-item {
    display: flex;
    align-items: center;
    padding: 10px 40px 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    gap: 10px;
    min-height: 52px;
    transition: background .1s;
    touch-action: manipulation;
}
.tsd-fnt-item:hover,
.tsd-fnt-item:active { background: #fef6f7; }
.tsd-fnt-item.tsd-fnt-active { background: #fdeef1; }
.tsd-fnt-item.tsd-fnt-active .tsd-fnt-name { color: #111; font-weight: 700; }

.tsd-fnt-preview {
    font-size: 24px;
    line-height: 1.2;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #222;
}
.tsd-fnt-name {
    font-size: 10px;
    color: #aaa;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    flex-shrink: 0;
    min-width: 50px;
    text-align: right;
}
@media (min-width: 769px) {
    .tsd-fnt-item    { padding: 7px 36px 7px 12px; min-height: 44px; }
    .tsd-fnt-preview { font-size: 20px; }
    .tsd-fnt-name    { font-size: 10px; min-width: 44px; }
}
@media (max-width: 480px) {
    .tsd-fnt-item    { padding: 8px 44px 8px 14px; min-height: 48px; }
    .tsd-fnt-preview { font-size: 26px; }
}

@keyframes tsd-flt-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ================================================================
   BOGEN-MODAL (v3.4.11)
================================================================ */
/* Rundtext-Tab-Inhalt lebt jetzt im gemeinsamen #tsd-fk-panel – kein eigenes
   schwebendes Popup mehr, volle Breite, keine eigene Box/Schatten. */
#tsd-float-arch-modal {
    display: none;
    width: 100%;
    box-sizing: border-box;
    pointer-events: auto;
    touch-action: manipulation;
}

.tsd-arch-text-row {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}
.tsd-arch-text-row input,
.tsd-arch-text-row textarea {
    flex: 1;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 16px !important;
    outline: none;
}
.tsd-arch-text-row textarea {
    resize: none;
    line-height: 1.25;
    font-family: inherit;
    min-height: 68px;
}
.tsd-arch-text-row input:focus,
.tsd-arch-text-row textarea:focus { border-color: #111; }
#tsd-am-text-ok {
    background: #111;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    padding: 0 12px;
    cursor: pointer;
    line-height: 1;
    touch-action: manipulation;
}
.tsd-arch-row {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}
.tsd-arch-btn {
    flex: 1;
    height: 34px;
    margin: 0;
    padding: 0 2px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    background: #fff;
    font-size: 11px;
    font-weight: 600;
    color: #444;
    white-space: nowrap;
    cursor: pointer;
    transition: all .12s;
    touch-action: manipulation;
}
.tsd-arch-btn:hover  { border-color: #111; color: #111; }
.tsd-arch-btn.active { background: #111; border-color: #111; color: #fff; }

/* Nachbesserung 25.07. (Micha): Abstand innerhalb jedes Regler-Blocks leicht
   verringert (war padding-top:8px / margin-bottom:4px), nicht eng, nur kompakter,
   damit mehr Regler auf einen Blick passen. Bei Bedarf einfach zurückstellen. */
.tsd-arch-slider-wrap { padding-top: 5px; }
.tsd-arch-slider-wrap.tsd-arch-hidden { display: none; }
.tsd-arch-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #888;
    margin-bottom: 3px;
}
.tsd-arch-label span:last-child { font-weight: 600; color: #444; }
.tsd-arch-slider-wrap input[type="range"] {
    width: 100%;
    accent-color: #111;
}

/* Bogen-Icon in Floating Bar */
#tsd-float-arch {
    background: rgba(255,255,255,0.12);
    border: 2px solid rgba(255,255,255,0.25);
}
#tsd-float-arch:hover { background: rgba(255,255,255,0.22); }
#tsd-float-arch svg { pointer-events: none; }

/* ---- Produkt-wechseln-Badge: oben links, als Pille mit Text statt reinem Icon ---- */
#tsd-switch-badge {
    position: absolute;
    z-index: 190;
    top: 10px;
    left: 10px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.35);
    border: none;
    transition: transform .15s, box-shadow .15s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    pointer-events: auto;
}
#tsd-switch-badge:hover,
#tsd-switch-badge:active {
    transform: scale(1.12);
    box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}

/* ---- Produkt-wechseln-Modal ---- */
#tsd-switch-modal-ov {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.5);
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: tsd-flt-fadein .15s ease;
    touch-action: none;
    overscroll-behavior: contain;
}
#tsd-switch-modal-ov.tsd-sw-open { display: flex; }

#tsd-switch-modal {
    background: rgba(255,255,255,0.98);
    border-radius: 18px 18px 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.3);
    animation: tsd-fnt-slide .2s ease;
}
@media (min-width: 769px) {
    #tsd-switch-modal-ov { background: rgba(0,0,0,0.4); align-items: center; }
    #tsd-switch-modal { border-radius: 14px; max-height: 70vh; animation: tsd-flt-fadein .15s ease; }
}

#tsd-switch-modal .tsd-switch-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    padding: 0 14px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    box-sizing: border-box;
}
#tsd-switch-modal .tsd-switch-modal-header strong {
    font-size: 14px;
    line-height: 1;
    margin: 0;
    padding: 0;
    display: block;
}
#tsd-switch-modal-x {
    background: none !important;
    border: none !important;
    font-size: 22px;
    line-height: 1;
    color: #555;
    cursor: pointer;
    padding: 0 !important;
    margin: 0 !important;
    width: 28px;
    height: 28px;
    min-height: unset !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: none !important;
}

#tsd-switch-modal-list {
    overflow-y: auto;
    flex: 1;
    padding: 12px;
    -webkit-overflow-scrolling: touch;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tsd-switch-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    cursor: pointer;
    border: 1px solid #eee;
    border-radius: 12px;
    transition: background .1s, border-color .1s;
}
.tsd-switch-item:hover,
.tsd-switch-item:active { background: #fef6f7; border-color: #f3d4d9; }
.tsd-switch-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 8px;
    flex-shrink: 0;
    background: #fafafa;
}
.tsd-switch-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.tsd-switch-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    min-height: 2.6em;
}
.tsd-switch-item-price {
    font-size: 12px;
    color: #888;
}


/* ---- Lupe-Badge: oben links unter dem Produkt-Badge (getauscht mit KI) ---- */
#tsd-ki-badge {
    position: absolute;
    z-index: 190;
    top: 220px;
    right: 10px;
    left: auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    border: none;
    transition: transform .15s, box-shadow .15s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    pointer-events: auto;
}
#tsd-ki-badge svg path { stroke: #111; }
#tsd-ki-badge.tsd-ki-badge-up { top: 168px; } /* Motive deaktiviert -> Lücke schließen, eine Position hoch */
#tsd-ki-badge:hover,
#tsd-ki-badge:active {
    transform: scale(1.12);
    box-shadow: 0 3px 14px rgba(0,0,0,0.30);
    background: #f0f0f0;
}
#tsd-share-badge {
    position: absolute;
    z-index: 190;
    top: 116px;
    left: 10px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    border: none;
    transition: transform .15s, box-shadow .15s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    pointer-events: auto;
}
#tsd-share-badge:hover,
#tsd-share-badge:active {
    transform: scale(1.12);
    box-shadow: 0 3px 14px rgba(0,0,0,0.30);
    background: #f0f0f0;
}
#tsd-motive-badge {
    position: absolute;
    z-index: 190;
    top: 168px;
    right: 10px;
    left: auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    border: none;
    transition: transform .15s, box-shadow .15s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    pointer-events: auto;
}
#tsd-motive-badge:hover,
#tsd-motive-badge:active {
    transform: scale(1.12);
    box-shadow: 0 3px 14px rgba(0,0,0,0.30);
    background: #f0f0f0;
}

/* ---- KI-Badge (Sparkle): unter dem Produkt-Badge links (getauscht mit Lupe) ---- */
#tsd-lupe-badge {
    position: absolute;
    z-index: 190;
    top: 62px;
    left: 10px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    border: none;
    transition: transform .15s, box-shadow .15s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    pointer-events: auto;
}
#tsd-lupe-badge:hover,
#tsd-lupe-badge:active {
    transform: scale(1.12);
    box-shadow: 0 3px 14px rgba(0,0,0,0.30);
    background: #f0f0f0;
}
#tsd-shapes-badge {
    position: absolute;
    z-index: 190;
    top: 168px;
    left: 10px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    border: none;
    transition: transform .15s, box-shadow .15s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    pointer-events: auto;
}

/* Nachtrag 25.07.: Positionierung fehlte komplett (nur Form/Farbe inline gesetzt,
   kein position:absolute mit Koordinaten) - Button war dadurch faktisch unauffindbar/
   falsch im Layout. Naechster freier Slot in der rechten Spalte nach 220px (KI-Badge). */
#tsd-dtpl-save-badge {
    position: absolute;
    z-index: 190;
    top: 272px;
    right: 10px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    border: none;
    transition: transform .15s, box-shadow .15s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    pointer-events: auto;
}
#tsd-dtpl-save-badge:hover,
#tsd-dtpl-save-badge:active {
    transform: scale(1.12);
}
#tsd-shapes-badge:hover,
#tsd-shapes-badge:active {
    transform: scale(1.12);
    box-shadow: 0 3px 14px rgba(0,0,0,0.30);
    background: #f0f0f0;
}

/* ---- Formen v2: Anwenden/Abbrechen-Leiste unter der frei platzierten Maske ----
   Reine runde Icon-Badges (Haken/Kreuz), kein Text - fest unten zentriert am
   Canvas. Bewusst kompakt statt Text-Pillen, damit es auf Mobile nicht breiter
   wird als der Bildschirm. ---- */
#tsd-mask-apply-bar {
    position: absolute;
    z-index: 300;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}
#tsd-mask-apply-bar.tsd-mab-visible { display: flex; }
.tsd-mask-bar-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    transition: transform .15s, box-shadow .15s;
}
.tsd-mask-bar-badge:hover,
.tsd-mask-bar-badge:active {
    transform: scale(1.08);
    box-shadow: 0 3px 12px rgba(0,0,0,.24);
}
.tsd-mask-bar-badge svg { pointer-events: none; }

/* ---- Vollbild-Vorschau-Overlay ---- */
#tsd-fullscreen-preview-ov {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.88);
    align-items: center;
    justify-content: center;
    padding: 64px 24px 24px;
    box-sizing: border-box;
    touch-action: none;
}
#tsd-fullscreen-preview-ov.tsd-fsp-open {
    display: flex;
}
#tsd-fullscreen-preview-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 30px rgba(0,0,0,0.5);
    touch-action: none;
    transform-origin: center center;
    will-change: transform;
}
#tsd-fsp-pinch-hint {
    display: none;
    position: absolute;
    z-index: 100001;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    animation: tsd-fsp-hint-fade 3s ease forwards;
}
#tsd-fsp-pinch-hint.tsd-fsp-hint-show { display: flex; }
#tsd-fsp-pinch-hint span {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
@keyframes tsd-fsp-hint-fade {
    0%   { opacity: 0; }
    15%  { opacity: 1; }
    75%  { opacity: 1; }
    100% { opacity: 0; }
}
#tsd-fullscreen-preview-x {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 100000;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}
/* v2.7.246: Admin-only Upload-Icon in der Lupe-Vorschau - gleicher Stil wie das
   Schliessen-X, links davon positioniert. */
#tsd-lupe-upload-icon {
    position: absolute;
    top: 14px;
    right: 64px;
    z-index: 100000;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: background 0.2s;
}
#tsd-lupe-upload-icon.tsd-lupe-uploading {
    animation: tsd-lupe-upload-spin 0.8s linear infinite;
}
#tsd-lupe-upload-icon.tsd-lupe-upload-ok {
    background: rgba(40,170,90,0.85) !important;
    animation: none;
}
@keyframes tsd-lupe-upload-spin {
    to { transform: rotate(360deg); }
}
/* Upload-Spinner */
#tsd-upload-spinner {
    display: none;
    position: absolute;
    z-index: 500;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tsd-spin-centered .7s linear infinite;
    pointer-events: none;
}
@keyframes tsd-spin-centered { to { transform: translate(-50%, -50%) rotate(360deg); } }

#tsd-png-fal-badge.tsd-badge-loading,
#tsd-png-color-badge.tsd-badge-loading,
#tsd-share-badge.tsd-badge-loading {
    pointer-events: none;
    position: relative;
}
#tsd-png-fal-badge.tsd-badge-loading::after,
#tsd-png-color-badge.tsd-badge-loading::after,
#tsd-share-badge.tsd-badge-loading::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 36px; height: 36px;
    margin: -18px 0 0 -18px;
    border: 3px solid #e0e0e0;
    border-top-color: #111;
    border-radius: 50%;
    animation: tsd-badge-spin .7s linear infinite;
    pointer-events: none;
}
@keyframes tsd-badge-spin { to { transform: rotate(360deg); } }

/* ---- KI-Bildgenerator-Modal ---- */
#tsd-ki-modal-ov {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.5);
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
#tsd-ki-modal-ov.tsd-ki-open { display: flex; }
#tsd-ki-modal {
    background: #fff;
    border-radius: 18px 18px 0 0;
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.3);
}
@media (min-width: 769px) {
    #tsd-ki-modal-ov { align-items: center; }
    #tsd-ki-modal { border-radius: 14px; max-width: 440px; }
}
#tsd-ki-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    padding: 0 14px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    box-sizing: border-box;
}
#tsd-ki-modal-header strong {
    font-size: 14px;
    margin: 0; padding: 0;
}
#tsd-ki-modal-x {
    background: none !important;
    border: none !important;
    font-size: 22px;
    line-height: 1;
    color: #555;
    cursor: pointer;
    padding: 0 !important;
    margin: 0 !important;
    width: 28px;
    height: 28px;
    min-height: unset !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: none !important;
}
#tsd-ki-modal-body {
    padding: 14px 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#tsd-ki-hint {
    font-size: 13px;
    color: #666;
    margin: 0;
}
#tsd-ki-prompt-wrap {
    position: relative;
}
#tsd-ki-prompt {
    width: 100%;
    height: 100px;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px 46px 10px 10px;
    font-size: 16px;
    resize: none;
    box-sizing: border-box;
    font-family: inherit;
}
#tsd-ki-prompt:focus { outline: none; border-color: #111; }
#tsd-ki-mic {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0 !important;
    border: 1px solid #ddd !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #444;
    padding: 0 !important;
    box-shadow: none !important;
    min-height: unset !important;
    transition: background .15s, color .15s;
}
#tsd-ki-mic:hover { background: #e0e0e0 !important; }
#tsd-ki-mic.tsd-ki-mic-active {
    background: #111 !important;
    border-color: #111 !important;
    color: #fff;
    animation: tsd-ki-mic-pulse 1s ease-in-out infinite;
}
@keyframes tsd-ki-mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(17,17,17,0.4); }
    50%       { box-shadow: 0 0 0 6px rgba(17,17,17,0); }
}
#tsd-ki-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
#tsd-ki-counter {
    font-size: 12px;
    color: #888;
}
#tsd-ki-generate {
    background: #111 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 9px 20px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer;
    min-height: unset !important;
    box-shadow: none !important;
    transition: background .15s;
}
#tsd-ki-generate:hover:not(:disabled) { background: #333 !important; }
#tsd-ki-generate:disabled { background: #cc0000 !important; cursor: not-allowed; }
.tsd-ki-spin { animation: tsd-ki-spin-rotate .9s linear infinite; transform-origin: 50% 50%; }
@keyframes tsd-ki-spin-rotate {
    0%   { transform: rotate(0deg)   scale(0.9); }
    50%  { transform: rotate(180deg) scale(1.15); }
    100% { transform: rotate(360deg) scale(0.9); }
}

#tsd-ki-example {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #f8f8f8;
    border-radius: 10px;
    border: 1px solid #eee;
}
#tsd-ki-example-img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: #fff;
}
#tsd-ki-example-caption {
    font-size: 12px;
    color: #777;
    line-height: 1.35;
}
#tsd-ki-status {
    display: none;
    font-size: 13px;
    padding: 8px 10px;
    background: #f8f8f8;
    border-radius: 6px;
}

/* Stil-Auswahl Chips */
#tsd-ki-styles {
    display: flex;
    gap: 8px;
    padding: 2px 0 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
#tsd-ki-styles::-webkit-scrollbar { display: none; }
.tsd-ki-style-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    flex-shrink: 0;
    width: 72px;
}
.tsd-ki-style-chip svg {
    width: 72px;
    height: 56px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    background: #f5f5f5;
    transition: border-color .15s;
    display: block;
}
.tsd-ki-style-chip span {
    font-size: 11px;
    color: #555;
    text-align: center;
    transition: color .15s;
}
.tsd-ki-style-chip.tsd-ki-style-active svg {
    border-color: #111;
    box-shadow: 0 0 0 1px #111;
}
.tsd-ki-style-chip.tsd-ki-style-active span {
    color: #111;
    font-weight: 700;
}

/* Ladebalken */
#tsd-ki-loadbar-wrap {
    display: none;
    height: 4px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
}
#tsd-ki-loadbar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #111 0%, #555 100%);
    border-radius: 2px;
}

/* Bildergalerie */
#tsd-ki-gallery {
    display: none;
    padding-top: 10px;
    border-top: 1px solid #eee;
}
#tsd-ki-gallery::before {
    content: 'Meine generierten Bilder';
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tsd-ki-thumb {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    width: 80px;
    margin: 0 6px 8px 0;
    vertical-align: top;
}
.tsd-ki-thumb img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border: 2px solid #eee;
    border-radius: 8px;
    background: #fafafa;
    transition: border-color .15s;
}
.tsd-ki-thumb:hover img { border-color: #111; }
.tsd-ki-thumb-label {
    font-size: 10px;
    color: #888;
    text-align: center;
    line-height: 1.3;
    word-break: break-word;
}
.canvas-container textarea {
    font-size: 16px !important;
    opacity: 0 !important;
}

/* ── Mobile Text-Edit Modal ── */
#tsd-mobile-text-ov {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}
#tsd-mobile-text-modal {
    background: #fff;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 600px;
    padding: 20px 20px calc(36px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 14px;
}
#tsd-mobile-text-input {
    font-size: 28px !important;
    font-weight: 600;
    -webkit-text-size-adjust: 100%;
    padding: 14px 16px;
    border: 2px solid #111;
    border-radius: 12px;
    outline: none;
    width: 100%;
    height: 66px;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.2;
    resize: none;
    display: block;
}
#tsd-mobile-text-btns {
    display: flex;
    gap: 10px;
}
#tsd-mobile-text-btns button {
    flex: 1;
    height: 46px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
#tsd-mobile-text-cancel {
    background: #f0f0f0;
    color: #555;
}
#tsd-mobile-text-ok {
    background: #111;
    color: #fff;
}

/* Rundtext-Tab-Inhalt lebt jetzt im gemeinsamen #tsd-fk-panel (siehe FARBE/
   KONTUR/RUNDTEXT/AA PANEL weiter unten) – eigene Fixed-Positionierung entfällt. */


/* fal.ai Flux Tab */
#tsd-ki-tabs { display:flex; gap:6px; margin-bottom:12px; }
.tsd-ki-tab { background:#f0f0f0; border:1px solid #ddd; border-radius:6px; padding:4px 10px; font-size:12px; font-weight:600; cursor:pointer; color:#555; white-space:nowrap; }
.tsd-ki-tab-active { background:#2d2d2d; color:#fff; border-color:#2d2d2d; }

/* ---- Feste Bedien-Leiste beim Skalieren ausblenden ----
   Verhindert, dass HINTEN-Thumbnail/Farbe/Freistellen/Anwenden-Badges in die
   Quere kommen, wenn Anfasser bei großen Bildern/Masken unten landen. Opacity
   statt display:none, damit kein Layout-Sprung entsteht. */
.tsd-hide-while-scaling { opacity: 0 !important; pointer-events: none !important; }

/* ---- Mobile Textbearbeitung: OK- und Bogen/Gerade-Buttons schwarz statt rot ----
   Nur auf Mobile - Desktop behält weiterhin die Akzentfarbe. */
@media (max-width: 768px) {
    #tsd-mobile-text-ok { background: #111 !important; }
    #tsd-mobile-text-cancel { background: #f0f0f0 !important; color: #555 !important; }
    .tsd-effect-btn { border-color: #ddd !important; color: #555 !important; background: #fff !important; }
    .tsd-effect-btn.active { background: #111 !important; border-color: #111 !important; color: #fff !important; }
    .tsd-effect-btn:hover { border-color: #111 !important; color: #111 !important; }
}

/* v2.7.263 (Micha: 7 Farben pro Reihe statt nur 4, Desktop hat mehr Platz -
   Mobil (max-width des Popups per Inline-Style auf 220px) muss bei 4 bleiben,
   wegen Platz). Ueberschreibt die feste Inline-max-width nur ab Desktop-
   Breite (769px, gleicher Breakpoint wie im Rest des Plugins), Mobil bleibt
   unangetastet. #tsd-svgcolor-popup selbst wird per JS mit Inline-Style
   erzeugt (siehe #tsd-svgcolor-badge-Klick-Handler in designer.js) - !important
   noetig, um die Inline-max-width zu ueberstimmen. */
@media (min-width: 769px) {
    #tsd-svgcolor-popup { max-width: 320px !important; }
}

/* v2.7.270 (Micha: leerer weisser "Punkt" trotz mehrerer JS-Fixes - #tsd-svgcolor-popup
   blieb in seltenen Faellen leer, aber auf display:flex stehen. Statt weiter am JS-
   Timing zu suchen: reine CSS-Absicherung, die IMMER greift, unabhaengig von der
   eigentlichen Ursache. :empty matcht das Element nur, wenn es WIRKLICH keine Kind-
   Elemente hat (siehe tsdUpdateSvgColorBadge() - das Popup enthaelt ausschliesslich
   .tsd-svgcolor-dot-Farbkreise, keine feste Struktur/Header/Close-Button) - sobald
   echte Farbkreise drin sind (normale SVG-Umfaerben-Funktion), hat es Kind-Elemente,
   :empty greift dann automatisch nicht mehr, die Funktion bleibt unangetastet. */
#tsd-svgcolor-popup:empty {
    display: none !important;
}
