/**
 * Teppich-Natur Designer Studio – Modern Responsive Stylesheet
 */

:root {
    --tnd-green: #139947;
    --tnd-green-dark: #0d7434;
    --tnd-green-soft: #eef7f1;
    --tnd-bg-warm: #f8f7f4;
    --tnd-surface: #ffffff;
    --tnd-border: #dce4de;
    --tnd-text: #1b2820;
    --tnd-muted: #5c6d62;
    --tnd-accent-amber: #d97706;
    --tnd-radius-lg: 18px;
    --tnd-radius-md: 12px;
    --tnd-radius-sm: 8px;
    --tnd-shadow: 0 10px 30px rgba(17, 43, 26, 0.07);
}

/* Native <dialog> Modal Rules (per modern-web-guidance) */
dialog.tnd-studio-dialog:modal,
dialog.tnd-modal-dialog:modal {
    overscroll-behavior: contain;
}

dialog.tnd-studio-dialog::backdrop,
dialog.tnd-modal-dialog::backdrop {
    background: rgba(15, 28, 20, 0.68);
    backdrop-filter: blur(4px);
    overflow: hidden;
    overscroll-behavior: contain;
}

dialog.tnd-studio-dialog {
    width: min(1480px, 96dvw);
    max-width: 96dvw;
    height: min(92dvh, 980px);
    max-height: 94dvh;
    margin: auto;
    padding: 0;
    border: 1px solid var(--tnd-border);
    border-radius: var(--tnd-radius-lg);
    background: var(--tnd-bg-warm);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.32);
    color: var(--tnd-text);
}

dialog.tnd-studio-dialog[open] {
    display: flex;
    flex-direction: column;
}

.tnd-dialog-topbar {
    display: flex;
    align-items: safe center;
    justify-content: space-between;
    gap: 1rem;
    padding: 12px 20px;
    background: #132a1c;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

.tnd-dialog-brand {
    display: flex;
    align-items: safe center;
    gap: 12px;
    flex-wrap: wrap;
}

.tnd-dialog-badge {
    background: var(--tnd-green);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    border-radius: 999px;
}

.tnd-dialog-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 17px !important;
    font-weight: 600 !important;
    color: #fff !important;
}

.tnd-dialog-close {
    display: inline-flex;
    align-items: safe center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.tnd-dialog-close:hover {
    background: rgba(255, 255, 255, 0.24);
}

.tnd-dialog-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px;
}

/* Main Designer Container */
.tnd-app-wrapper {
    container: tnd-app / inline-size;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--tnd-text);
    background: var(--tnd-bg-warm);
    border: 1px solid var(--tnd-border);
    border-radius: var(--tnd-radius-lg);
    padding: 18px;
    box-shadow: var(--tnd-shadow);
    box-sizing: border-box;
    width: 100%;
    max-width: 1440px;
    margin-inline: auto;
    overflow-x: clip;
}

.tnd-app-wrapper *,
.tnd-app-wrapper *::before,
.tnd-app-wrapper *::after {
    box-sizing: border-box;
}

/* Top Product Mode Tabs */
.tnd-header {
    margin-block-end: 16px;
    min-width: 0;
    max-width: 100%;
}

.tnd-mode-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(195px, 100%), 1fr));
    gap: 10px;
}

.tnd-mode-tab {
    display: flex;
    align-items: safe center;
    gap: 11px;
    padding: 11px 14px;
    background: var(--tnd-surface);
    border: 1.5px solid var(--tnd-border);
    border-radius: var(--tnd-radius-md);
    text-align: start;
    cursor: pointer;
    transition: all 0.16s ease;
    color: var(--tnd-text);
    min-width: 0;
    max-width: 100%;
}

.tnd-mode-tab:hover {
    border-color: var(--tnd-green);
    transform: translateY(-1px);
}

.tnd-mode-tab.is-active {
    background: linear-gradient(135deg, #139947 0%, #0e7a38 100%);
    border-color: #0e7a38;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(19, 153, 71, 0.24);
}

.tnd-mode-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--tnd-green-soft);
    color: var(--tnd-green-dark);
    flex-shrink: 0;
}

.tnd-mode-tab.is-active .tnd-mode-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.tnd-mode-text {
    display: flex;
    flex-direction: column;
    min-inline-size: 0;
}

.tnd-mode-text strong {
    font-size: 14px;
    line-height: 1.25;
}

.tnd-mode-text small {
    font-size: 11.5px;
    opacity: 0.78;
    white-space: nowrap;
    overflow: clip;
    text-overflow: ellipsis;
}

/* Main 2-Column Layout */
.tnd-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.22fr) minmax(0, 0.95fr);
    gap: 18px;
    align-items: start;
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 1024px) {
    .tnd-main-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Left Stage Column */
.tnd-stage-col {
    background: var(--tnd-surface);
    border: 1px solid var(--tnd-border);
    border-radius: var(--tnd-radius-lg);
    padding: 14px;
    position: sticky;
    top: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 1024px) {
    .tnd-stage-col {
        position: static;
    }
}

.tnd-stage-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: safe center;
    justify-content: space-between;
    gap: 10px;
    margin-block-end: 12px;
}

.tnd-view-switcher {
    display: inline-flex;
    flex-wrap: wrap;
    background: #eff3f0;
    padding: 4px;
    border-radius: 10px;
    gap: 4px;
}

.tnd-view-btn {
    display: inline-flex;
    align-items: safe center;
    gap: 6px;
    padding: 7px 12px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--tnd-muted);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tnd-view-btn.is-active {
    background: var(--tnd-surface);
    color: var(--tnd-green-dark);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.tnd-room-controls,
.tnd-photo-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: safe center;
    gap: 10px;
    background: var(--tnd-green-soft);
    padding: 6px 10px;
    border-radius: 9px;
    font-size: 12px;
}

.tnd-room-controls[hidden],
.tnd-photo-controls[hidden] {
    display: none !important;
}

.tnd-CtrlItem {
    display: inline-flex;
    align-items: safe center;
    gap: 6px;
    font-weight: 600;
    color: var(--tnd-text);
    margin: 0;
}

.tnd-color-input {
    width: 28px;
    height: 24px;
    padding: 0;
    border: 1px solid #bbb;
    border-radius: 4px;
    cursor: pointer;
    background: none;
}

.tnd-range-sm {
    width: 75px;
    accent-color: var(--tnd-green);
    cursor: pointer;
}

.tnd-btn-upload {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--tnd-green);
    color: #fff;
    padding: 5px 11px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 12px;
}

/* Canvas Stage */
.tnd-canvas-stage {
    position: relative;
    background: #eeece7;
    border-radius: var(--tnd-radius-md);
    border: 1px solid #d5d2ca;
    overflow: clip;
    width: 100%;
    max-width: 100%;
}

#tnd-main-canvas {
    display: block;
    inline-size: 100%;
    max-inline-size: 100%;
    block-size: auto;
    aspect-ratio: 16 / 9;
    cursor: crosshair;
    touch-action: manipulation;
}

.tnd-canvas-FloatingBar {
    display: flex;
    flex-wrap: wrap;
    align-items: safe center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(25, 38, 29, 0.88);
    color: #fff;
    font-size: 12px;
}

.tnd-canvas-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tnd-mini-btn {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    padding: 4px 9px;
    font-size: 11.5px;
    cursor: pointer;
    transition: background 0.15s;
}

.tnd-mini-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* Stage Footer */
.tnd-stage-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: safe center;
    justify-content: space-between;
    gap: 10px;
    margin-block-start: 12px;
    padding-block-start: 10px;
    border-top: 1px solid var(--tnd-border);
}

.tnd-active-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tnd-color-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    background: #f3f6f4;
    border: 1px solid var(--tnd-border);
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
}

.tnd-color-badge-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.2);
    background-size: cover;
}

.tnd-stage-utility-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tnd-util-btn {
    background: #f4f7f5;
    color: var(--tnd-text);
    border: 1px solid var(--tnd-border);
    border-radius: 7px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.tnd-util-btn:hover {
    border-color: var(--tnd-green);
    background: var(--tnd-green-soft);
}

/* Right Controls Column */
.tnd-controls-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    max-width: 100%;
}

.tnd-card {
    background: var(--tnd-surface);
    border: 1px solid var(--tnd-border);
    border-radius: var(--tnd-radius-md);
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    min-width: 0;
    max-width: 100%;
}

.tnd-card--summary {
    background: linear-gradient(180deg, #ffffff 0%, #f3faf5 100%);
    border: 1.5px solid rgba(19, 153, 71, 0.35);
}

.tnd-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: safe center;
    gap: 10px;
    margin-block-end: 12px;
}

.tnd-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--tnd-green);
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
    flex-shrink: 0;
}

.tnd-card-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 15.5px !important;
    font-weight: 700 !important;
    color: var(--tnd-text) !important;
    min-width: 0;
}

/* Dynamic Form Controls */
.tnd-ctrl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(185px, 100%), 1fr));
    gap: 10px;
    margin-block-end: 10px;
}

.tnd-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
}

.tnd-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--tnd-muted);
}

.tnd-input,
.tnd-select,
.tnd-select-sm {
    padding: 8px 10px;
    border: 1px solid #c5d1c8;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--tnd-text);
    background: #fff;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.tnd-select-sm {
    padding: 5px 8px;
    font-size: 12px;
    width: auto;
    max-width: 100%;
}

.tnd-pattern-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-block-top: 6px;
}

.tnd-pat-btn {
    padding: 6px 11px;
    border: 1px solid var(--tnd-border);
    border-radius: 8px;
    background: #f7f9f7;
    color: var(--tnd-text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.14s;
}

.tnd-pat-btn:hover {
    border-color: var(--tnd-green);
}

.tnd-pat-btn.is-active {
    background: var(--tnd-green);
    border-color: var(--tnd-green);
    color: #fff;
}

/* Active Color Slots */
.tnd-slots-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    margin-block-end: 12px;
}

.tnd-slot-btn {
    display: flex;
    align-items: safe center;
    gap: 8px;
    padding: 7px 10px;
    border: 2px solid var(--tnd-border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    text-align: start;
    transition: all 0.15s;
}

.tnd-slot-btn.is-active {
    border-color: var(--tnd-green);
    background: var(--tnd-green-soft);
    box-shadow: 0 0 0 3px rgba(19, 153, 71, 0.16);
}

.tnd-slot-swatch {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.tnd-slot-meta {
    display: flex;
    flex-direction: column;
    min-inline-size: 0;
}

.tnd-slot-role {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--tnd-muted);
    font-weight: 700;
}

.tnd-slot-name {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--tnd-text);
    white-space: nowrap;
    overflow: clip;
    text-overflow: ellipsis;
}

/* Harmony Assistant */
.tnd-harmony-trigger {
    margin-inline-start: auto;
    background: #fff8eb;
    color: #9a5b06;
    border: 1px solid #f3d29c;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
}

.tnd-harmony-drawer {
    background: #fdfaf3;
    border: 1px solid #eee0c1;
    border-radius: 10px;
    padding: 10px 12px;
    margin-block-end: 12px;
}

.tnd-harmony-intro {
    margin: 0 0 8px !important;
    font-size: 12px;
    color: #5c4b28;
}

.tnd-harmony-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.tnd-harmony-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 7px 9px;
    background: #fff;
    border: 1px solid #e5d8bc;
    border-radius: 8px;
    cursor: pointer;
    text-align: start;
}

.tnd-harmony-card:hover {
    border-color: var(--tnd-green);
}

.tnd-harmony-dots {
    display: flex;
    gap: 4px;
}

.tnd-harmony-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

/* Palette Filter & Swatch Grid */
.tnd-palette-toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-block-end: 10px;
}

.tnd-family-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tnd-fam-pill {
    padding: 4px 9px;
    border: 1px solid var(--tnd-border);
    border-radius: 999px;
    background: #f5f7f5;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--tnd-muted);
    cursor: pointer;
}

.tnd-fam-pill.is-active {
    background: var(--tnd-text);
    color: #fff;
    border-color: var(--tnd-text);
}

.tnd-search-input {
    width: 100%;
    padding: 7px 11px;
    border: 1px solid var(--tnd-border);
    border-radius: 8px;
    font-size: 12.5px;
}

.tnd-swatch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(66px, 1fr));
    gap: 7px;
    max-block-size: 255px;
    overflow-y: auto;
    scrollbar-gutter: stable;
    overscroll-behavior: contain;
    padding: 4px 2px;
}

.tnd-swatch-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px;
    border: 2px solid transparent;
    border-radius: 9px;
    background: #f9faf9;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.12s ease;
}

.tnd-swatch-item:hover {
    transform: translateY(-2px);
    border-color: #a3c9b0;
}

.tnd-swatch-item.is-selected {
    border-color: var(--tnd-green);
    background: var(--tnd-green-soft);
}

.tnd-swatch-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(0, 0, 0, 0.15);
    margin-block-end: 3px;
}

.tnd-swatch-code {
    font-size: 11px;
    font-weight: 700;
    color: var(--tnd-text);
    line-height: 1.1;
}

.tnd-swatch-label {
    font-size: 10px;
    color: var(--tnd-muted);
    max-width: 100%;
    white-space: nowrap;
    overflow: clip;
    text-overflow: ellipsis;
}

/* Breakdown & Summary */
.tnd-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-block-end: 12px;
}

.tnd-breakdown-row {
    display: flex;
    align-items: safe center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
    background: #fff;
    border: 1px solid var(--tnd-border);
    border-radius: 8px;
    font-size: 12.5px;
}

.tnd-breakdown-left {
    display: flex;
    align-items: safe center;
    gap: 8px;
}

.tnd-breakdown-dot {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    background-size: cover;
}

/* Sockelleisten Upsell Box */
.tnd-sockelleisten-box {
    background: #fff;
    border: 1px dashed #8bc49e;
    border-radius: 10px;
    padding: 10px 12px;
    margin-block-end: 12px;
}

.tnd-sockel-toggle {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-size: 12.5px;
}

.tnd-sockel-toggle span {
    display: flex;
    flex-direction: column;
}

.tnd-sockel-toggle small {
    color: var(--tnd-muted);
    font-size: 11px;
}

.tnd-sockel-details {
    margin-block-start: 8px;
    padding-block-start: 8px;
    border-top: 1px solid #e6efe8;
}

.tnd-sockel-row {
    display: flex;
    flex-wrap: wrap;
    align-items: safe center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
}

.tnd-input-xs {
    width: 58px;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* Total Price Bar & CTAs */
.tnd-total-bar {
    display: flex;
    align-items: safe center;
    justify-content: space-between;
    padding: 12px 14px;
    background: #132a1c;
    color: #fff;
    border-radius: 11px;
    margin-block-end: 12px;
}

.tnd-total-left {
    display: flex;
    flex-direction: column;
}

.tnd-total-label {
    font-size: 14px;
    font-weight: 700;
}

.tnd-total-label small {
    font-weight: 400;
    opacity: 0.8;
}

.tnd-total-sub {
    font-size: 11px;
    color: #a3d9b5;
}

.tnd-total-price {
    font-size: 24px;
    font-weight: 800;
    color: #6ee798;
}

.tnd-cta-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tnd-btn-primary {
    display: inline-flex;
    align-items: safe center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 13px 18px;
    background: linear-gradient(135deg, #139947 0%, #0d7a36 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(19, 153, 71, 0.28);
    transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.tnd-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(19, 153, 71, 0.36);
}

.tnd-btn-secondary {
    display: inline-flex;
    align-items: safe center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    background: #fff;
    color: var(--tnd-green-dark);
    border: 1.5px solid var(--tnd-green);
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.14s;
}

.tnd-btn-secondary:hover {
    background: var(--tnd-green-soft);
}

.tnd-cart-feedback {
    margin-block-start: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

.tnd-cart-feedback.is-success {
    background: #dcfce7;
    color: #14532d;
    border: 1px solid #86efac;
}

.tnd-cart-feedback.is-error {
    background: #fee2e2;
    color: #7f1d1d;
    border: 1px solid #fca5a5;
}

/* Sample Order Modal */
dialog.tnd-modal-dialog {
    width: min(560px, 94dvw);
    margin: auto;
    padding: 0;
    border: 1px solid var(--tnd-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.tnd-modal-inner {
    padding: 22px;
}

.tnd-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-block-end: 10px;
}

.tnd-modal-header h3 {
    margin: 0 !important;
    font-size: 18px !important;
}

.tnd-modal-close {
    background: #f1f5f2;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
}

.tnd-modal-desc {
    font-size: 13px;
    color: var(--tnd-muted);
    margin-block-end: 12px;
}

.tnd-sample-selected-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-block-end: 14px;
}

.tnd-sample-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tnd-form-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.tnd-sample-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12.5px;
    font-weight: 600;
}

.tnd-sample-form input {
    padding: 8px 10px;
    border: 1px solid #c5d1c8;
    border-radius: 8px;
    font-size: 13.5px;
}

.tnd-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-block-start: 10px;
}

.tnd-btn-ghost {
    background: #f2f4f3;
    border: 1px solid #d0d7d2;
    border-radius: 8px;
    padding: 9px 16px;
    font-weight: 600;
    cursor: pointer;
}

/* 10 Original Tretford Rooms Thumbnail Strip */
.tnd-room-thumb-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 12px;
    background: #f4f7f5;
    border-block-end: 1px solid var(--tnd-border);
    scrollbar-width: thin;
}

.tnd-room-thumb-strip[hidden] {
    display: none !important;
}

.tnd-room-thumb-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
    width: 112px;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.tnd-room-thumb-btn:hover {
    border-color: #96cbb0;
    transform: translateY(-1px);
}

.tnd-room-thumb-btn.is-active {
    border-color: var(--tnd-green);
    background: var(--tnd-green-soft);
    box-shadow: 0 0 0 2px rgba(19, 153, 71, 0.2);
}

.tnd-room-thumb-btn img {
    width: 100%;
    height: 54px;
    object-fit: cover;
    border-radius: 5px;
    display: block;
}

.tnd-room-thumb-btn span {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--tnd-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Studio Photo Upload Dropzone Overlay */
.tnd-photo-dropzone {
    position: absolute;
    inset: 0;
    background: rgba(18, 34, 24, 0.62);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 12;
}

.tnd-photo-dropzone[hidden] {
    display: none !important;
}

.tnd-photo-dropzone-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 28px 32px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(19, 153, 71, 0.25);
}

.tnd-photo-dropzone-icon {
    font-size: 38px;
    margin-block-end: 8px;
}

.tnd-photo-dropzone-card h4 {
    margin: 0 0 8px !important;
    font-size: 19px !important;
    color: var(--tnd-text);
}

.tnd-photo-dropzone-card p {
    margin: 0 0 18px !important;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--tnd-muted);
}

.tnd-photo-dropzone-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.tnd-btn-upload-hero {
    cursor: pointer;
    width: 100%;
    justify-content: center;
}

/* Teppichdielen (25 x 100 cm) Visual Explainer & Pattern Cards */
.tnd-dielen-explainer {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f2f8f4;
    border: 1px solid #c5e2cf;
    border-radius: 10px;
    padding: 11px 14px;
    margin-block-end: 12px;
}

.tnd-dielen-plank-diagram {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.tnd-dielen-plank-box {
    width: 88px;
    height: 22px;
    background: repeating-linear-gradient(90deg, #139947 0px, #139947 2px, #0e7a36 2px, #0e7a36 4px);
    border: 1.5px solid #0a5827;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.03em;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
}

.tnd-dielen-plank-sub {
    font-size: 10px;
    font-weight: 700;
    color: #0e6b32;
}

.tnd-dielen-explainer-text {
    font-size: 12px;
    line-height: 1.42;
    color: #1f3528;
}

.tnd-dielen-explainer-text strong {
    color: #0d5f2c;
}

.tnd-dielen-pattern-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
    margin-block-top: 6px;
}

.tnd-dielen-pat-card {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border: 1.5px solid var(--tnd-border);
    border-radius: 9px;
    background: #fafcfa;
    cursor: pointer;
    text-align: start;
    transition: all 0.14s ease;
}

.tnd-dielen-pat-card:hover {
    border-color: var(--tnd-green);
    background: #f2f8f4;
}

.tnd-dielen-pat-card.is-active {
    border-color: var(--tnd-green);
    background: var(--tnd-green-soft);
    box-shadow: 0 0 0 2px rgba(19, 153, 71, 0.16);
}

.tnd-dielen-pat-icon {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    background: #e5efe9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #0e6b32;
}

.tnd-dielen-pat-info {
    display: flex;
    flex-direction: column;
    min-inline-size: 0;
}

.tnd-dielen-pat-info strong {
    font-size: 12px;
    color: var(--tnd-text);
    line-height: 1.2;
}

.tnd-dielen-pat-info small {
    font-size: 10.5px;
    color: var(--tnd-muted);
    line-height: 1.25;
}

/* KI-Bodenerkennung Lade-Badge & Masken-Pinsel-Werkzeuge */
.tnd-ai-loading-badge {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(19, 42, 28, 0.94);
    color: #ffffff;
    border: 1.5px solid #22c55e;
    border-radius: 999px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 15;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    max-width: 92%;
}

.tnd-ai-loading-badge[hidden] {
    display: none !important;
}

.tnd-ai-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #4ade80;
    border-radius: 50%;
    animation: tnd-spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes tnd-spin {
    to {
        transform: rotate(360deg);
    }
}

.tnd-ai-loading-text {
    display: flex;
    flex-direction: column;
    font-size: 12.5px;
    line-height: 1.3;
}

.tnd-ai-loading-text small {
    font-size: 11px;
    color: #a7f3d0;
}

.tnd-photo-brush-group {
    display: inline-flex;
    background: #ffffff;
    border: 1px solid #bcdbc6;
    border-radius: 7px;
    padding: 2px;
    gap: 2px;
}

.tnd-brush-btn {
    border: none;
    background: transparent;
    color: var(--tnd-text);
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.14s ease;
}

.tnd-brush-btn:hover {
    background: #eef7f1;
}

.tnd-brush-btn.is-active {
    background: var(--tnd-green);
    color: #ffffff;
}

/* Portrait & Landscape Custom Photo Adaptive Stage */
.tnd-canvas-stage--portrait {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #1b241e;
}

.tnd-canvas-stage--portrait #tnd-main-canvas {
    width: auto !important;
    max-width: 100% !important;
    max-height: 740px;
    margin-inline: auto;
    box-shadow: 0 0 36px rgba(0, 0, 0, 0.45);
}

/* Mobile & Small Screen Optimizations (verhindert jegliches seitliches Ausbrechen) */
@media (max-width: 767px) {
    .tnd-app-wrapper {
        padding: 10px;
        border-radius: 12px;
    }

    .tnd-mode-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .tnd-mode-tab {
        padding: 9px 10px;
        gap: 8px;
    }

    .tnd-mode-icon {
        width: 30px;
        height: 30px;
    }

    .tnd-mode-text strong {
        font-size: 12.5px;
    }

    .tnd-mode-text small {
        font-size: 10.5px;
    }

    .tnd-stage-col,
    .tnd-card {
        padding: 11px;
        border-radius: 12px;
    }

    .tnd-view-switcher {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .tnd-view-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 8px 10px;
        font-size: 12px;
    }

    .tnd-room-controls,
    .tnd-photo-controls {
        width: 100%;
        gap: 8px;
    }

    .tnd-CtrlItem {
        flex-wrap: wrap;
        max-width: 100%;
    }

    .tnd-room-thumb-strip {
        padding: 6px 8px;
        gap: 6px;
        max-width: 100%;
    }

    .tnd-room-thumb-btn {
        width: 96px;
    }

    .tnd-photo-dropzone {
        position: static;
        padding: 12px;
        background: #1b241e;
    }

    .tnd-photo-dropzone-card {
        padding: 16px 14px;
        width: 100%;
    }

    .tnd-photo-dropzone-card h4 {
        font-size: 15.5px !important;
    }

    .tnd-photo-dropzone-card p {
        font-size: 12.5px;
    }

    .tnd-btn-primary,
    .tnd-btn-secondary {
        font-size: 13.5px;
        padding: 11px 12px;
        white-space: normal;
        text-align: center;
        line-height: 1.3;
    }

    .tnd-total-bar {
        flex-wrap: wrap;
        gap: 6px;
    }

    .tnd-total-price {
        font-size: 20px;
    }

    .tnd-breakdown-row {
        flex-wrap: wrap;
    }

    .tnd-form-row2 {
        grid-template-columns: 1fr;
    }
}


