:root {
    --v2-bg: #f7f7f2;
    --v2-panel: #ffffff;
    --v2-ink: #101010;
    --v2-muted: #6d6d68;
    --v2-line: #deded8;
    --v2-soft: #eeeeea;
    --v2-lime: #ccff00;
    --v2-danger: #b42318;
    --v2-shadow: 0 20px 60px rgba(16, 16, 16, 0.12);
    --v2-mobile-vh: 100dvh;
}

* {
    box-sizing: border-box;
}

.tshirt-designer-v2-body {
    margin: 0;
    background: var(--v2-bg);
    color: var(--v2-ink);
    font-family: Inter, Helvetica, Arial, sans-serif;
}

.tshirt-designer-v2-wrapper {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    background: var(--v2-bg);
    overflow: hidden;
}

.tshirt-design-tool-v2 {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: Inter, Helvetica, Arial, sans-serif;
}

/* ── Topbar ── */

.v2-topbar {
    flex: 0 0 auto;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 24px;
    border-bottom: 1px solid var(--v2-line);
    background: rgba(247, 247, 242, 0.94);
    backdrop-filter: blur(18px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.v2-brand {
    color: var(--v2-ink);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    text-decoration: none;
    text-transform: uppercase;
    min-width: 0;
}

/* Zentrierte Brand: Logo/Name mittig, Warenkorb bleibt rechts. */
.v2-topbar.is-brand-center {
    position: relative;
}

.v2-topbar.is-brand-center .v2-brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 140px);
}

.v2-topbar.is-brand-center .v2-cart-link {
    margin-left: auto;
}

.v2-brand-mark {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: inline-grid;
    place-items: center;
    color: var(--v2-ink);
    font-weight: 900;
}

.v2-brand-mark img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.v2-brand-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v2-cart-link {
    position: relative;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--v2-line);
    border-radius: 999px;
    background: var(--v2-panel);
    color: var(--v2-ink);
    text-decoration: none;
    transition: filter 0.15s, border-color 0.15s;
}

.v2-cart-link:hover {
    border-color: var(--v2-ink);
    filter: brightness(0.97);
}

.v2-cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--v2-lime);
    color: var(--v2-ink);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.v2-cart-count[hidden] {
    display: none;
}

/* ── Designer Split Layout (Desktop: 2 columns) ── */

.v2-designer-split {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 1fr 420px;
    min-height: 0;
    overflow: hidden;
}

/* LEFT: Preview */

.v2-designer-left {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: var(--v2-bg);
    overflow: hidden;
}

/* RIGHT: Controls column */

.v2-designer-right {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--v2-panel);
    border-left: 1px solid var(--v2-line);
    overflow: hidden;
}

/* ── Mode Tabs ("Mit Vorlage" / "Frei gestalten") ── */

.v2-mode-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 12px 16px 8px;
    height: 70px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.v2-mode-tab {
    background: var(--v2-soft);
    border: 1px solid var(--v2-line);
    border-radius: 12px;
    padding: 4px 14px;
    text-align: center;
    color: var(--v2-muted);
    font-weight: 500;
    font-size: 13px;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: all 0.15s;
    cursor: pointer;
}

.v2-mode-tab.is-active {
    background: var(--v2-ink);
    color: #fff;
    border-color: var(--v2-ink);
}

.v2-mode-tab-label {
    font-weight: 700;
    font-size: 13px;
}

/* ── Section Tabs ── */

.v2-sec-tabs {
    display: flex;
    align-items: stretch;
    gap: 4px;
    padding: 0 16px 10px;
    border-bottom: 1px solid var(--v2-line);
    flex-shrink: 0;
}

.v2-sec-tab {
    flex: 1;
    padding: 8px 6px;
    background: transparent;
    border: none;
    color: var(--v2-muted);
    font-size: 12px;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    position: relative;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: color 0.15s;
}

.v2-sec-tab.is-active {
    color: var(--v2-ink);
}

.v2-sec-tab.is-active::after {
    content: '';
    position: absolute;
    bottom: -11px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--v2-lime);
    border-radius: 2px;
}

.v2-sec-tab-label {
    font-weight: 700;
    font-size: 14px;
}

.v2-sec-tab-hint {
    font-size: 10.5px;
    color: var(--v2-muted);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Sec Toggle Button (mobile only, ein-/ausklappen) ── */

.v2-sec-toggle {
    display: none; /* hidden by default; shown via mobile media query */
    flex-shrink: 0;
    align-self: center;
    width: 32px;
    height: 32px;
    margin-left: 2px;
    background: var(--v2-soft);
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-muted);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font: inherit;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.v2-sec-toggle:hover {
    background: var(--v2-panel);
    color: var(--v2-ink);
    border-color: var(--v2-muted);
}

.v2-sec-toggle svg {
    transition: transform 0.2s ease;
    display: block;
}

/* ── Scrollable Content Area ── */

.v2-sec-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 16px 16px;
    -webkit-overflow-scrolling: touch;
}

.v2-sec-body::-webkit-scrollbar {
    width: 5px;
}

.v2-sec-body::-webkit-scrollbar-thumb {
    background: var(--v2-line);
    border-radius: 4px;
}

.v2-sec-body::-webkit-scrollbar-track {
    background: transparent;
}

/* ── Tab Panels ── */

.v2-tab-panel {
    display: none;
}

.v2-tab-panel.is-active {
    display: block;
}

/* ── Row Labels (product options) ── */

.v2-row-label {
    margin: 0 0 8px;
    color: var(--v2-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.v2-prod-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

/* ── Product Picker Button ── */

.v2-start-product {
    display: grid;
    gap: 18px;
}

.v2-product-picker-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 72px;
    border: 1px solid var(--v2-line);
    border-radius: 12px;
    background: var(--v2-soft);
    padding: 16px;
    color: var(--v2-ink);
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.v2-product-picker-button:hover {
    border-color: var(--v2-ink);
    background: #fff;
}

.v2-product-picker-button span {
    color: var(--v2-muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.v2-product-picker-button strong {
    font-size: 15px;
    display: block;
    margin-top: 2px;
}

.v2-product-options {
    display: grid;
    gap: 18px;
}

.v2-product-copy {
    display: grid;
    gap: 12px;
    text-align: left;
}

.v2-product-description,
.v2-product-delivery {
    text-align: left;
}

.v2-product-description-text {
    color: var(--v2-ink);
    font-size: 13px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.v2-product-description-text > *:first-child {
    margin-top: 0;
}

.v2-product-description-text > *:last-child {
    margin-bottom: 0;
}

.v2-product-description-text p,
.v2-product-description-text ul,
.v2-product-description-text ol {
    margin: 0 0 10px;
}

.v2-product-description-text ul,
.v2-product-description-text ol {
    padding-left: 20px;
}

.v2-product-description-text ul {
    list-style: disc;
}

.v2-product-description-text ol {
    list-style: decimal;
}

.v2-product-description-text li {
    margin: 4px 0;
}

.v2-product-description-text a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.v2-product-description-text strong,
.v2-product-description-text b {
    font-weight: 800;
}

.v2-product-delivery {
    color: var(--v2-muted);
    font-size: 13px;
    line-height: 1.45;
}

/* ── Swatches & Sizes ── */

.v2-swatch-row,
.v2-size-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.v2-swatch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    border: 1px solid var(--v2-line);
    border-radius: 999px;
    background: #fff;
    padding: 4px 12px 4px 4px;
    font: inherit;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.v2-swatch span {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 50%;
    flex-shrink: 0;
}

.v2-swatch em {
    font-size: 13px;
    font-style: normal;
    font-weight: 700;
}

.v2-size {
    min-width: 46px;
    min-height: 40px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: #fff;
    color: var(--v2-ink);
    font-weight: 900;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.v2-swatch.is-active,
.v2-size.is-active {
    border-color: var(--v2-ink);
    box-shadow: inset 0 0 0 2px var(--v2-lime);
}

.v2-validation-message,
.v2-error {
    color: var(--v2-danger);
    font-size: 13px;
    font-weight: 700;
    margin: 0;
}

/* ── Search Field ── */

.v2-search {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
}

.v2-search span {
    color: var(--v2-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.v2-search input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--v2-line);
    border-radius: 10px;
    color: var(--v2-ink);
    padding: 0 14px;
    font: inherit;
    font-size: 15px;
}

.v2-search input::placeholder {
    color: var(--v2-muted);
    opacity: 0.6;
}

/* Nativen "x"-Button (type=search) durch ein schwarzes X ersetzen,
   sonst zeigt der Browser ihn in der Akzentfarbe (blau). */
.v2-search input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    cursor: pointer;
    background-color: var(--v2-ink);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18 6 6 18M6 6l12 12' stroke='%23000' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18 6 6 18M6 6l12 12' stroke='%23000' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
    opacity: 0.55;
    transition: opacity 0.15s ease;
}

.v2-search input[type="search"]::-webkit-search-cancel-button:hover {
    opacity: 1;
}

.v2-search input:focus {
    outline: 2px solid var(--v2-lime);
    outline-offset: 2px;
    background: #fff;
}

/* ── Category Chips ── */

.v2-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.v2-chip {
    border: 1px solid var(--v2-line);
    border-radius: 999px;
    background: #fff;
    padding: 7px 13px;
    color: var(--v2-muted);
    font-size: 12.5px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}

.v2-chip.is-active {
    background: var(--v2-ink);
    border-color: var(--v2-ink);
    color: #fff;
}

/* ── Motif Grid ── */

.v2-motif-grid,
.v2-product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: start;
    grid-auto-rows: max-content;
}

.v2-motif-card,
.v2-product-card {
    min-width: 0;
    min-height: 300px;
    align-self: start;
    border: 1px solid var(--v2-line);
    border-radius: 12px;
    background: #fff;
    color: var(--v2-ink);
    padding: 6px;
    text-align: left;
    font: inherit;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s, transform 0.15s;
}

.v2-motif-card:hover,
.v2-product-card:hover {
    transform: translateY(-1px);
    border-color: var(--v2-muted);
}

.v2-motif-card.is-active,
.v2-product-card.is-active {
    border-color: var(--v2-ink);
    background: var(--v2-soft);
    box-shadow: 0 0 0 2px var(--v2-lime);
}

/* Motif thumbnail with checkmark badge */

.v2-motif-art,
.v2-product-image-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    background: var(--v2-soft);
    border-radius: 8px;
    overflow: hidden;
}

.v2-motif-art img,
.v2-product-image-wrap img {
    width: 82%;
    height: 82%;
    object-fit: contain;
}

.v2-product-image-wrap img {
    width: 100%;
    height: 100%;
}

.v2-motif-check {
    display: none;
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--v2-lime);
    color: var(--v2-ink);
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    z-index: 2;
}

.v2-motif-card.is-active .v2-motif-check {
    display: flex;
}

.v2-motif-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 3;
    max-width: calc(100% - 42px);
    padding: 3px 7px;
    border: 1px solid rgba(17, 24, 39, 0.16);
    border-radius: 4px;
    background: var(--v2-lime);
    color: var(--v2-ink);
    box-shadow: 0 4px 10px rgba(17, 24, 39, 0.16);
    font-size: 10px;
    font-weight: 900;
    line-height: 1.1;
    pointer-events: none;
}

.v2-motif-art-placeholder {
    display: grid;
    place-items: center;
    width: 82%;
    height: 82%;
    border: 1px dashed var(--v2-line);
    border-radius: 6px;
    color: var(--v2-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.v2-motif-card strong,
.v2-product-card strong {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.25;
}

.v2-motif-card strong {
    padding: 0 4px;
}

.v2-product-card strong {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.v2-motif-description {
    display: block;
    padding: 0 4px 4px;
    color: var(--v2-muted);
    font-size: 11px;
    font-style: normal;
}

.v2-motif-description {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.v2-product-card-body {
    display: grid;
    gap: 5px;
    min-width: 0;
    margin-top: auto;
    padding: 0 4px 4px;
}

.v2-product-card-subtitle,
.v2-product-card-badge {
    display: block;
    overflow: hidden;
    color: var(--v2-muted);
    font-size: 11px;
    font-style: normal;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-product-card-price {
    display: block;
    color: var(--v2-ink);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    text-align: end;
}

.v2-product-card-price del {
    color: var(--v2-muted);
    font-weight: 600;
}

.v2-product-card-price ins {
    color: var(--v2-ink);
    text-decoration: none;
}

.v2-product-card-colors {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    padding: 0 4px;
}

.v2-product-card-color-label {
    overflow: hidden;
    color: var(--v2-muted);
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-product-card-swatch-row {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 3px;
}

.v2-product-card-swatch {
    width: 14px;
    height: 14px;
    padding: 0;
    border: 1px solid rgba(16, 16, 16, 0.22);
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
    cursor: pointer;
}

.v2-product-card-swatch:hover,
.v2-product-card-swatch:focus {
    outline: 2px solid var(--v2-lime);
    outline-offset: 2px;
}

.v2-product-card-more {
    color: var(--v2-muted);
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1;
}

/* ── Text Slot Fields (new: label inside the box) ── */

.v2-slots-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.v2-slot {
    position: relative;
    background: var(--v2-panel);
    border: 1px solid var(--v2-line);
    border-radius: 12px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.v2-slot.is-focused {
    border-color: var(--v2-ink);
    box-shadow: 0 0 0 2px var(--v2-lime);
}

.v2-slot-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.v2-slot-label {
    font-size: 10.5px;
    font-weight: 900;
    color: var(--v2-muted);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.v2-slot-meta {
    font-size: 9.5px;
    color: var(--v2-muted);
    white-space: nowrap;
}

.v2-slot-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--v2-ink);
    font: inherit;
    font-size: 16px;
    padding: 2px 0;
    width: 100%;
}

.v2-slot-input::placeholder {
    color: var(--v2-muted);
    opacity: 0.5;
}

/* Free design layers */

.v2-free-catalog-hint {
    color: var(--v2-muted);
    font-size: 12px;
    margin: 0 0 10px;
}

.v2-free-area-empty {
    color: var(--v2-muted);
    font-size: 12px;
    text-align: center;
    margin: 30px 0 0;
}

.v2-free-add-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.v2-free-motif-catalog {
    border-top: 1px solid var(--v2-line);
    margin-top: 16px;
    padding-top: 16px;
}

.v2-free-layer-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.v2-free-layer {
    background: var(--v2-panel);
    border: 1px solid var(--v2-line);
    border-radius: 12px;
    padding: 10px 12px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.v2-free-layer.is-dragging {
    opacity: 0.72;
}

.v2-free-layer.is-active {
    border-color: var(--v2-lime);
    box-shadow: 0 0 0 1px var(--v2-lime);
}

.v2-free-layer-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    cursor: grab;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.v2-free-layer.is-dragging .v2-free-layer-head,
.v2-free-layer-list.is-reordering {
    cursor: grabbing;
}

.v2-free-layer-list.is-reordering,
.v2-free-layer-list.is-reordering * {
    -webkit-user-select: none;
    user-select: none;
}

.v2-free-layer-list.is-reordering img {
    -webkit-user-drag: none;
}

.v2-free-layer-actions {
    display: flex;
    align-items: center;
    gap: 3px;
}

.v2-free-layer-order {
    border: 0;
    background: transparent;
    color: var(--v2-muted);
    cursor: pointer;
    font-size: 15px;
    padding: 0 3px;
}

.v2-free-layer-order:disabled {
    cursor: default;
    opacity: 0.28;
}

.v2-free-layer-type {
    color: var(--v2-muted);
    font-size: 10px;
    font-weight: 700;
    margin-right: 5px;
}

.v2-free-layer-label {
    color: var(--v2-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.v2-free-layer-del {
    border: 0;
    background: transparent;
    color: var(--v2-muted);
    cursor: pointer;
    font: inherit;
    font-size: 18px;
    line-height: 1;
    padding: 0 2px;
}

.v2-free-layer-del:hover {
    color: var(--v2-danger);
}

.v2-free-layer-text-preview {
    width: 100%;
    color: var(--v2-ink);
    font: inherit;
    font-size: 16px;
    padding: 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-free-motif-thumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0 2px;
}

.v2-free-motif-thumb img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 6px;
    background: var(--v2-soft);
}

.v2-free-layer-editor {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
    border-radius: 10px;
    padding: 10px;
}

.v2-ctrl-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.v2-ctrl {
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: var(--v2-muted);
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
}

.v2-ctrl select {
    min-height: 30px;
    border: 1px solid var(--v2-line);
    border-radius: 6px;
    background: var(--v2-panel);
    color: var(--v2-ink);
    font: inherit;
    padding: 0 6px;
}

.v2-ctrl input[type="range"] {
    accent-color: var(--v2-lime);
    background: var(--v2-soft);
    border-radius: 12px;
}

.v2-ctrl input[type="color"] {
    width: 32px;
    height: 32px;
    border: 1px solid var(--v2-line);
    border-radius: 50%;
    background: var(--v2-panel);
    padding: 3px;
    cursor: pointer;
    overflow: hidden;
}

.v2-ctrl input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.v2-ctrl input[type="color"]::-webkit-color-swatch {
    border: 0;
    border-radius: 50%;
}

.v2-ctrl input[type="color"]::-moz-color-swatch {
    border: 0;
    border-radius: 50%;
}

.v2-distortion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(62px, 1fr));
    gap: 5px;
    margin-top: 4px;
}

.v2-distortion-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-soft);
    color: var(--v2-ink);
    cursor: pointer;
    font: inherit;
    padding: 6px 3px 4px;
}

.v2-distortion-btn.is-active {
    border-color: var(--v2-lime);
    background: var(--v2-panel);
    box-shadow: 0 0 0 1px var(--v2-lime);
}

.v2-distortion-btn svg {
    width: 100%;
    height: 18px;
}

.v2-distortion-btn svg text {
    fill: currentColor;
    font-family: Arial, sans-serif;
    font-weight: 800;
    dominant-baseline: middle;
}

.v2-distortion-btn span {
    font-size: 8px;
    text-align: center;
    white-space: nowrap;
}

.v2-preview-free-text-variable {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    white-space: nowrap;
}

.v2-distortion-strength {
    margin-top: 2px;
}

.v2-ctrl-label {
    display: block;
}

.v2-align-group {
    display: flex;
    gap: 4px;
    margin-top: 2px;
}

.v2-align-btn {
    flex: 1 1 0;
    display: grid;
    place-items: center;
    min-height: 30px;
    border: 1px solid var(--v2-line);
    border-radius: 6px;
    background: var(--v2-soft);
    color: var(--v2-ink);
    cursor: pointer;
    padding: 4px;
}

.v2-align-btn.is-active {
    border-color: var(--v2-lime);
    background: var(--v2-panel);
    box-shadow: 0 0 0 1px var(--v2-lime);
}

.v2-align-btn svg {
    width: 20px;
    height: 15px;
}

/* Kompakte Text-Werkzeugleiste: Farbe, Fett, Ausrichtung, Verzerrung in einer Zeile */
.v2-text-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.v2-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    min-width: 32px;
    padding: 0 6px;
    border: 1px solid var(--v2-line);
    border-radius: 6px;
    background: var(--v2-soft);
    color: var(--v2-ink);
    cursor: pointer;
    font: inherit;
}

.v2-tool-btn:hover:not(:disabled) {
    border-color: var(--v2-muted);
}

.v2-tool-btn.is-active {
    border-color: var(--v2-lime);
    background: var(--v2-panel);
    box-shadow: 0 0 0 1px var(--v2-lime);
}

.v2-tool-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.v2-weight-btn {
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
}

.v2-tool-btn svg {
    width: 20px;
    height: 15px;
}

.v2-distortion-picker-btn {
    gap: 2px;
}

.v2-distortion-picker-btn svg {
    width: 26px;
    height: 14px;
}

.v2-distortion-picker-btn svg text {
    fill: currentColor;
    font-family: Arial, sans-serif;
    font-weight: 800;
    dominant-baseline: middle;
}

.v2-tool-caret {
    font-size: 9px;
    color: var(--v2-muted);
}

/* Farbwähler als runder Swatch, passend zur Toolbar-Höhe */
.v2-tool-color {
    width: 32px;
    height: 32px;
    border: 1px solid var(--v2-line);
    border-radius: 50%;
    background: var(--v2-panel);
    padding: 3px;
    cursor: pointer;
    overflow: hidden;
}

.v2-tool-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

.v2-tool-color::-webkit-color-swatch {
    border: 0;
    border-radius: 50%;
}

.v2-tool-color::-moz-color-swatch {
    border: 0;
    border-radius: 50%;
}

.v2-add-layer-btn {
    width: 100%;
    border: 1.5px dashed var(--v2-line);
    border-radius: 10px;
    background: var(--v2-soft);
    color: var(--v2-muted);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 10px;
}

.v2-add-layer-btn:hover {
    border-color: var(--v2-lime);
    color: var(--v2-ink);
}

.v2-add-layer-btn.is-active {
    border-color: var(--v2-lime);
    background: var(--v2-soft);
    color: var(--v2-ink);
}

/* Field error state */

.v2-slot.has-error {
    border-color: var(--v2-danger);
}

.v2-slot-error {
    color: var(--v2-danger);
    font-size: 11px;
    font-weight: 700;
}

/* ── Font Card (inside Text tab) ── */

.v2-font-card {
    display: grid;
    gap: 14px;
    margin-top: 20px;
    border-top: 1px solid var(--v2-line);
    padding-top: 20px;
}

.v2-font-card.is-disabled {
    opacity: 0.72;
}

.v2-font-field {
    display: grid;
    gap: 6px;
}

.v2-font-field span {
    color: var(--v2-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.v2-font-field select,
.v2-font-field input[type="color"] {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-soft);
    color: var(--v2-ink);
    padding: 0 12px;
    font: inherit;
    font-size: 14px;
}

.v2-font-field select:focus {
    outline: 2px solid var(--v2-lime);
    outline-offset: 2px;
}

/* Font-Picker-Button (ersetzt das Schrift-Dropdown) */
.v2-font-picker-button {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-soft);
    color: var(--v2-ink);
    padding: 0 12px;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s;
}

.v2-font-picker-button:hover:not(:disabled) {
    border-color: var(--v2-muted);
}

.v2-font-picker-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.v2-font-picker-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 18px;
    line-height: 1.2;
}

.v2-font-picker-caret {
    flex-shrink: 0;
    color: var(--v2-muted);
    font-size: 12px;
}

/* Inline-Variante im Frei-Modus-Editor (kompakter) */
.v2-font-picker-button--inline {
    min-height: 38px;
}

.v2-font-picker-button--inline .v2-font-picker-value {
    font-size: 15px;
}

/* Font-Picker-Overlay: Grid + Kacheln */
/* Font-Panel: inline in der Seitenleiste (wie die Motiv-Auswahl), kein Vollbild. */
.v2-sec-body.is-font-picking .v2-tab-panel,
.v2-sec-body.is-distortion-picking .v2-tab-panel {
    display: none !important;
}

.v2-font-panel[hidden] {
    display: none;
}

/* Verzerrungs-Auswahl-Overlay: gleiche Panel-Optik, deutlich kleinere Kacheln */
.v2-distortion-grid--overlay {
    grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
    gap: 6px;
    margin-top: 8px;
}

.v2-distortion-grid--overlay .v2-distortion-btn {
    padding: 5px 2px 3px;
}

.v2-distortion-grid--overlay .v2-distortion-btn svg {
    height: 16px;
}

.v2-font-panel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.v2-font-panel-back {
    border: 1px solid var(--v2-line);
    border-radius: 999px;
    background: var(--v2-soft);
    color: var(--v2-ink);
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    padding: 6px 12px;
    cursor: pointer;
}

.v2-font-panel-back:hover {
    border-color: var(--v2-muted);
}

.v2-font-panel-title {
    font-size: 14px;
    font-weight: 800;
}

.v2-font-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.v2-font-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 110px;
    border: 1px solid var(--v2-line);
    border-radius: 12px;
    background: var(--v2-panel);
    padding: 16px 14px 12px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.v2-font-tile:hover {
    border-color: var(--v2-muted);
}

.v2-font-tile.is-active {
    border-color: var(--v2-ink);
    box-shadow: inset 0 0 0 1px var(--v2-lime);
}

.v2-font-tile-sample {
    flex: 1;
    display: flex;
    align-items: center;
    font-size: 28px;
    line-height: 1.15;
    color: var(--v2-ink);
    overflow: hidden;
    word-break: break-word;
}

.v2-font-tile-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid var(--v2-line);
    padding-top: 10px;
}

.v2-font-tile-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--v2-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-font-tile-cat {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--v2-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-left: auto;
}

.v2-font-tile-check {
    display: none;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--v2-ink);
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
}

.v2-font-tile.is-active .v2-font-tile-check {
    display: inline-block;
}

.v2-font-tile.is-active .v2-font-tile-cat {
    display: none;
}

/* Legacy field support (used by some areas in JS) */

.v2-field {
    position: relative;
    display: grid;
    gap: 6px;
}

.v2-field span {
    color: var(--v2-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.v2-field input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-soft);
    color: var(--v2-ink);
    padding: 0 14px;
    font: inherit;
    font-size: 15px;
}

.v2-field input:focus {
    outline: 2px solid var(--v2-lime);
    outline-offset: 2px;
}

.v2-field small,
.v2-field-error {
    color: var(--v2-muted);
    font-size: 11px;
}

.v2-field.has-error input {
    border-color: var(--v2-danger);
}

.v2-field.has-error .v2-field-error {
    color: var(--v2-danger);
}

/* ── Fixed Slots / Form Stack ── */

.v2-form-stack {
    display: grid;
    gap: 16px;
}

.v2-fixed-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.v2-fixed-slots span {
    border-radius: 999px;
    background: var(--v2-soft);
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 800;
}

/* ── Empty state ── */

.v2-empty-state {
    display: grid;
    gap: 6px;
    border: 1px solid var(--v2-line);
    border-radius: 10px;
    background: var(--v2-soft);
    padding: 18px;
    color: var(--v2-muted);
}

.v2-empty-state strong {
    color: var(--v2-ink);
}

/* ── CTA Bar (sticky bottom of right column) ── */

.v2-cta-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 16px 14px;
    background: var(--v2-panel);
    border-top: 1px solid var(--v2-line);
    box-shadow: 0 -4px 16px rgba(16, 16, 16, 0.06);
}

.v2-cta-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.v2-cta-price {
    font-weight: 800;
    font-size: 18px;
}

.v2-cta-sub {
    font-size: 10.5px;
    color: var(--v2-muted);
}

.v2-cta-btn {
    flex-shrink: 0;
    background: var(--v2-lime);
    color: var(--v2-ink);
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 12px 22px;
    font-weight: 800;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: filter 0.15s, opacity 0.15s;
}

.v2-cta-btn:hover:not(:disabled) {
    filter: brightness(0.94);
}

.v2-cta-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ── Preview Stage (desktop: left column, fills space) ── */

.v2-preview-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: white;
    -webkit-user-select: none;
    user-select: none;
}

.v2-preview-inner {
    position: relative;
    flex-shrink: 0;
    -webkit-user-select: none;
    user-select: none;
}

.v2-product-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    user-select: none;
}

.v2-print-area {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.v2-print-area.is-loading {
    visibility: hidden;
}

.v2-preview-stage:not(.has-product) .v2-print-area {
    width: 61.5238095%;
    height: 76%;
}

/* ── Preview Overlay Actions (Share + Maximize) ── */

.v2-preview-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 4;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.v2-preview-action {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(16, 16, 16, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--v2-ink);
    box-shadow: 0 4px 12px rgba(16, 16, 16, 0.1);
    cursor: pointer;
    font: inherit;
    transition: background 0.15s;
    pointer-events: auto;
}

.v2-preview-action:hover {
    background: #fff;
}

.v2-preview-share-toggle.is-busy {
    opacity: 0.6;
    pointer-events: none;
}

.v2-preview-share-status {
    position: absolute;
    top: 54px;
    right: 10px;
    z-index: 5;
    margin: 0;
    max-width: min(70%, 320px);
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(16, 16, 16, 0.88);
    color: #fff;
    font-size: 12.5px;
    line-height: 1.3;
    box-shadow: 0 6px 18px rgba(16, 16, 16, 0.22);
    pointer-events: none;
}

.v2-preview-share-status[hidden] {
    display: none;
}

.v2-preview-maximize-toggle span {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 3px;
    position: relative;
}

.v2-preview-maximize-toggle span::before,
.v2-preview-maximize-toggle span::after {
    content: "";
    width: 6px;
    height: 2px;
    background: currentColor;
    position: absolute;
    right: -3px;
    top: -5px;
}

.v2-preview-maximize-toggle span::after {
    width: 2px;
    height: 6px;
    right: -5px;
    top: -3px;
}

/* Maximized state (mobile) */

.tshirt-design-tool-v2.is-preview-maximized .v2-designer-left {
    position: fixed;
    inset: 0;
    z-index: 10000;
    padding: 0;
    background: var(--v2-bg);
    border: none;
}

.tshirt-design-tool-v2.is-preview-maximized .v2-preview-stage {
    flex: 1 1 auto;
    border-radius: 0;
}

.tshirt-design-tool-v2.is-preview-maximized .v2-preview-maximize-toggle span {
    border: 0;
}

.tshirt-design-tool-v2.is-preview-maximized .v2-preview-maximize-toggle span::before,
.tshirt-design-tool-v2.is-preview-maximized .v2-preview-maximize-toggle span::after {
    width: 18px;
    height: 2px;
    right: -1px;
    top: 6px;
    transform: rotate(45deg);
}

.tshirt-design-tool-v2.is-preview-maximized .v2-preview-maximize-toggle span::after {
    transform: rotate(-45deg);
}

.tshirt-design-tool-v2.is-preview-maximized .v2-preview-inner {
    width: 100vw !important;
    height: 100vw !important;
    max-width: 100%;
    max-height: 100%;
}

/* ── Motif image & text in preview ── */

.v2-preview-motif {
    position: absolute;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    object-fit: contain;
}

.v2-free-preview-layers {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.v2-preview-free-layer {
    position: absolute;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    pointer-events: none;
    cursor: grab;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.v2-preview-free-layer * {
    -webkit-user-drag: none;
    -webkit-user-select: none;
    user-select: none;
}

.v2-preview-free-layer.is-dragging {
    cursor: grabbing;
}

.v2-preview-free-motif img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.v2-preview-free-text {
    line-height: 1;
    white-space: nowrap;
}

.v2-preview-free-text-value {
    display: block;
    line-height: 1;
    white-space: nowrap;
}

.v2-preview-free-text-svg {
    display: block;
    overflow: visible;
}

.v2-preview-free-text-svg text {
    dominant-baseline: middle;
}

.v2-preview-text-line {
    position: absolute;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    max-width: 120%;
    line-height: 1;
    white-space: nowrap;
}

.v2-preview-text-line[data-align="left"],
.v2-preview-text-line[data-align="start"] {
    transform: translate(0, -50%);
    transform-origin: left center;
}

.v2-preview-text-line[data-align="right"],
.v2-preview-text-line[data-align="end"] {
    transform: translate(-100%, -50%);
    transform-origin: right center;
}

/* Central transform overlay */

.v2-preview-motif.is-transform-editable,
.v2-preview-text-line.is-transform-editable,
.v2-preview-free-layer.is-transform-editable {
    cursor: grab;
    pointer-events: auto;
    touch-action: none;
}

.v2-transform-layer {
    position: absolute;
    inset: 0;
    z-index: 50;
    pointer-events: none;
}

.v2-print-area-guide {
    position: absolute;
    inset: 0;
    opacity: 0;
    border: 1.5px dashed rgba(34, 113, 177, 0.9);
    box-shadow: inset 0 0 0 9999px rgba(34, 113, 177, 0.055);
    transition: opacity 0.12s;
}

.v2-print-area-guide.is-visible {
    opacity: 1;
}

.v2-selection-box {
    position: absolute;
    border: 1.25px solid #2d8cff;
    transform-origin: center center;
    pointer-events: auto;
    touch-action: none;
    z-index: 2;
}

.v2-hover-box {
    position: absolute;
    border: 1.25px solid rgba(45, 140, 255, 0.9);
    background: rgba(45, 140, 255, 0.045);
    transform-origin: center center;
    pointer-events: none;
}

.v2-hover-box[hidden] {
    display: none;
}

.v2-selection-box.v2-no-handles {
    cursor: text;
}

.v2-selection-box.v2-no-handles .v2-transform-handle,
.v2-selection-box.v2-no-handles .v2-rotation-handle {
    display: none;
}

.v2-transform-handle,
.v2-rotation-handle {
    position: absolute;
    z-index: 5;
    width: 12px;
    height: 12px;
    padding: 0;
    border: 2px solid #2d8cff;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9), 0 2px 7px rgba(16, 16, 16, 0.18);
    pointer-events: auto;
    touch-action: none;
}

.v2-transform-handle::before,
.v2-rotation-handle::before {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: 999px;
}

.v2-transform-handle.is-nw {
    left: 0;
    top: 0;
    transform: translate(-50%, -50%);
    cursor: nwse-resize;
}

.v2-transform-handle.is-ne {
    right: 0;
    top: 0;
    transform: translate(50%, -50%);
    cursor: nesw-resize;
}

.v2-transform-handle.is-sw {
    left: 0;
    bottom: 0;
    transform: translate(-50%, 50%);
    cursor: nesw-resize;
}

.v2-transform-handle.is-se {
    right: 0;
    bottom: 0;
    transform: translate(50%, 50%);
    cursor: nwse-resize;
}

/* Kleine Textfelder: nur der Griff oben links bleibt, damit die anderen
   Griffe den Text nicht verdecken. Oben links bleibt voll funktionsfähig. */
.v2-selection-box.v2-handles-min .v2-transform-handle.is-ne,
.v2-selection-box.v2-handles-min .v2-transform-handle.is-sw,
.v2-selection-box.v2-handles-min .v2-transform-handle.is-se {
    display: none;
}

.v2-rotation-handle {
    left: 50%;
    top: 100%;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    color: var(--v2-ink);
    transform: translate(-50%, 12px) rotate(var(--v2-selection-inverse-rotation, 0deg));
    cursor: grab;
}

.v2-rotation-handle::after {
    content: "\21bb";
    font-size: 21px;
    line-height: 1;
}

.v2-transform-actionbar {
    position: absolute;
    z-index: 6;
    left: 50%;
    bottom: calc(100% + 14px);
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(16, 16, 16, 0.18);
    transform: translateX(-50%) rotate(var(--v2-selection-inverse-rotation, 0deg));
    pointer-events: auto;
}

.v2-inline-text-input {
    position: fixed;
    left: 0;
    top: 0;
    width: 1px;
    height: 1px;
    opacity: 0.01;
    border: 0;
    padding: 0;
    background: transparent;
    color: transparent;
    caret-color: transparent;
    pointer-events: none;
    resize: none;
    overflow: hidden;
    white-space: pre;
    line-height: 1;
    z-index: 70;
}

.v2-inline-text-editor {
    position: absolute;
    z-index: 4;
    transform-origin: center center;
    pointer-events: auto;
    touch-action: none;
    cursor: text;
    -webkit-user-select: none;
    user-select: none;
}

.v2-inline-text-lines {
    position: absolute;
    inset: 0;
}

.v2-inline-text-line {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    line-height: 1;
    white-space: pre;
    transform: translateY(-50%);
}

.v2-inline-text-line.is-placeholder {
    opacity: 0.62;
}

.v2-inline-text-char {
    display: inline-block;
    min-width: 0.18em;
    line-height: 1.12;
}

.v2-inline-text-char.is-selected {
    background-color: rgba(45, 140, 255, 0.34);
}

.v2-inline-text-caret {
    position: absolute;
    top: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0;
    color: currentColor;
    font: inherit;
    line-height: 1;
    transform: translate(-50%, -50%);
    animation: v2-inline-caret-blink 1s steps(2, start) infinite;
    pointer-events: none;
}

@keyframes v2-inline-caret-blink {
    50% {
        opacity: 0;
    }
}

.v2-transform-actionbar button {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--v2-ink);
    cursor: pointer;
}

.v2-transform-actionbar button:hover {
    background: var(--v2-soft);
}

.v2-transform-actionbar svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.v2-snap-line {
    position: absolute;
    display: none;
    background: rgba(45, 140, 255, 0.95);
    pointer-events: none;
}

.v2-snap-line.is-visible {
    display: block;
}

.v2-snap-line.is-x {
    left: 50%;
    top: -200vh;
    bottom: -200vh;
    width: 1px;
}

.v2-snap-line.is-y {
    left: -200vw;
    right: -200vw;
    top: 50%;
    height: 1px;
}

/* ── Cart Notice Popup (Design noch nicht fertig) ── */

.v2-cart-notice {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(16, 16, 16, 0.72);
    z-index: 120;
}

.v2-cart-notice.is-open {
    display: flex;
}

.v2-cart-notice-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--v2-bg);
    border: 1px solid var(--v2-line);
    border-radius: 18px;
    padding: 30px 28px 26px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(16, 16, 16, 0.28);
}

.v2-cart-notice-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--v2-muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
}

.v2-cart-notice-close:hover {
    color: var(--v2-ink);
    background: var(--v2-panel);
}

.v2-cart-notice-icon {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 12px;
}

.v2-cart-notice-title {
    margin: 0 0 10px;
    font-size: 20px;
    line-height: 1.2;
}

.v2-cart-notice-text {
    margin: 0 0 22px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--v2-muted);
}

.v2-cart-notice-ok {
    width: 100%;
    justify-content: center;
}

/* Erfolgs-Icon (grüner Checkmark statt Emoji) */
.v2-cart-notice-icon--success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1a9d4f;
    margin-bottom: 14px;
}

.v2-cart-notice-icon--success svg {
    display: block;
}

/* Button-Reihe im Erfolgs-Dialog */
.v2-cart-notice-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* "Zur Kasse" – Akzentfarbe */
.v2-cart-notice-checkout {
    width: 100%;
    justify-content: center;
    text-decoration: none;
}

/* "Weiter gestalten" – sekundär/outline */
.v2-cart-notice-secondary {
    width: 100%;
    border: 1px solid var(--v2-line);
    border-radius: 999px;
    background: var(--v2-soft);
    color: var(--v2-ink);
    padding: 12px 22px;
    font-weight: 700;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.v2-cart-notice-secondary:hover {
    background: var(--v2-soft);
    border-color: var(--v2-muted);
}

/* ── Product Overlay (fullscreen modal, unchanged) ── */

.v2-product-overlay {
    position: fixed;
    inset: 0;
    display: none;
    background: rgba(16, 16, 16, 0.72);
    z-index: 100;
}

.v2-product-overlay.is-open {
    display: flex;
}

.v2-product-overlay-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: var(--v2-bg);
    padding: 32px;
    box-sizing: border-box;
    overflow: hidden;
}

.v2-overlay-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    background: var(--v2-bg);
}

.v2-product-overlay header {
    margin-bottom: 20px;
}

.v2-eyebrow {
    margin: 0 0 10px;
    color: var(--v2-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.v2-product-overlay h2 {
    margin: 0;
    font-size: 32px;
    line-height: 1;
}

.v2-icon-button {
    width: 44px;
    height: 44px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: #fff;
    color: var(--v2-ink);
    font-size: 28px;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.v2-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    margin-top: 24px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* ── Autocomplete ── */

.v2-autocomplete {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 12;
    display: grid;
    gap: 4px;
    border: 1px solid var(--v2-line);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--v2-shadow);
    padding: 6px;
}

.v2-autocomplete button {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    padding: 10px;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.v2-autocomplete button:hover {
    background: var(--v2-soft);
}

.v2-autocomplete span,
.v2-muted {
    color: var(--v2-muted);
}

[hidden] {
    display: none !important;
}

/* ════════════════════════════════════════════════════
   MOBILE LAYOUT  (≤ 980px)
   Stack order: header → mode-tabs → preview → sec-tabs → content → cta
   ════════════════════════════════════════════════════ */

@media (max-width: 980px) {

    .tshirt-designer-v2-wrapper {
        height: var(--v2-mobile-vh, 100dvh);
    }

    .v2-topbar {
        height: auto;
        min-height: 48px;
        padding: 8px 14px;
    }

    .v2-brand-name {
        max-width: 44vw;
    }

    /* Turn split into a flex column,
       dissolve the right wrapper so its children join the outer flex */
    .v2-designer-split {
        display: flex;
        flex-direction: column;
        overflow: visible;
        overflow-y: visible;
        flex: 1 1 auto;
        min-height: 0;
    }

    .v2-designer-right {
        display: contents; /* dissolve — children join v2-designer-split flex */
    }

    /* Re-order children for mobile stacking */
    .v2-mode-tabs   { order: 1; flex-shrink: 0; }
    .v2-designer-left { order: 2; flex: 0 0 auto; padding: 0; }
    .v2-sec-tabs    { order: 3; }
    .v2-sec-body    { order: 4; flex: 1 1 auto; }
    .v2-cta-bar     { order: 5; }

    /* Mode tabs: more compact on mobile */
    .v2-mode-tabs {
        padding: 8px 12px 6px;
        gap: 5px;
        background: var(--v2-panel);
        border-bottom: 1px solid var(--v2-line);
    }

    .v2-mode-tab {
        border-radius: 10px;
        padding: 8px 12px;
    }

    /* Preview area on mobile */
    .v2-designer-left {
        background: var(--v2-bg);
        border-bottom: 1px solid var(--v2-line);
    }

    .v2-preview-stage {
        height: clamp(160px, 32dvh, 260px);
        flex: none;
    }

    /* Section tabs */
    .v2-sec-tabs {
        background: var(--v2-panel);
        padding: 8px 8px 0 12px;
        gap: 2px;
    }

    .v2-sec-tab {
        padding: 7px 4px;
    }

    .v2-sec-tab.is-active::after {
        bottom: -1px;
    }

    /* Toggle button: visible on mobile */
    .v2-sec-toggle {
        display: inline-flex;
    }

    /* Scrollable body */
    .v2-sec-body {
        background: var(--v2-panel);
        padding: 16px 14px calc(8px + env(safe-area-inset-bottom));
        overscroll-behavior: contain;
    }

    /* ── Collapsed state ── */
    .tshirt-design-tool-v2.is-tabs-collapsed .v2-sec-body {
        display: none;
    }

    .tshirt-design-tool-v2.is-tabs-collapsed .v2-designer-left {
        flex: 1 1 auto;
    }

    .tshirt-design-tool-v2.is-tabs-collapsed .v2-preview-stage {
        height: 100%;
    }

    .tshirt-design-tool-v2.is-tabs-collapsed .v2-sec-toggle svg {
        transform: rotate(180deg);
    }

    /* CTA bar */
    .v2-cta-bar {
        padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
        background: var(--v2-panel);
    }

    .v2-cta-btn {
        padding: 11px 18px;
        font-size: 14px;
    }

    .v2-cta-price {
        font-size: 16px;
    }

    /* Maximize toggle: visible on mobile */
    .v2-preview-maximize-toggle {
        display: grid;
    }

    /* Product overlay: kompakter auf Mobile */
    .v2-product-overlay-inner {
        padding: 20px 18px 18px;
    }

    .v2-product-overlay header {
        max-height: 120px;
        overflow: hidden;
        opacity: 1;
        transition: max-height 0.25s ease, opacity 0.2s ease, margin 0.2s ease;
    }

    .v2-product-overlay-inner.is-scrolled header {
        max-height: 0;
        opacity: 0;
        margin: 0;
    }
}

/* ════════════════════════════════════════════════════
   NARROW MOBILE  (≤ 560px)
   ════════════════════════════════════════════════════ */

@media (max-width: 560px) {

    .v2-brand-name {
        max-width: 38vw;
        font-size: 11px;
    }

    .v2-mode-tab-label {
        font-size: 12px;
    }

    .v2-preview-stage {
        height: clamp(145px, 28dvh, 220px);
    }

    .v2-sec-tab-label {
        font-size: 12px;
    }

    .v2-motif-grid {
        grid-template-columns: 1fr 1fr;
    }

    .v2-product-grid {
        grid-template-columns: 1fr;
    }

    .v2-font-grid {
        grid-template-columns: 1fr;
    }

    .v2-cta-btn {
        padding: 10px 16px;
        font-size: 13.5px;
    }
}

/* ════════════════════════════════════════════════════
   TABLET / WIDE DESKTOP  (> 980px)
   ════════════════════════════════════════════════════ */

@media (min-width: 981px) {

    /* Maximize toggle: hide on desktop (not needed) */
    .v2-preview-maximize-toggle {
        display: none;
    }

    .v2-designer-left {
        min-height: 0;
    }

    /* Wider right panel on larger screens */
    @media (min-width: 1280px) {
        .v2-designer-split {
            grid-template-columns: 1fr 480px;
        }
    }

    @media (min-width: 1600px) {
        .v2-designer-split {
            grid-template-columns: 1fr 520px;
        }
    }
}
