.label-preview-canvas {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.label-preview-surface {
    width: 100%;
}

.label-preview-empty,
.label-preview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    color: #94a3b8;
    font-weight: 600;
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
    border-radius: 12px;
}

.label-preview-ruler {
    position: relative;
    display: flex;
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.8rem;
}

.label-preview-ruler--top {
    height: 24px;
    align-items: center;
}

.label-preview-ruler--top span {
    position: absolute;
    transform: translateX(-50%);
}

.label-preview-ruler--left {
    flex-direction: column;
    min-height: 80px;
    padding-left: 0.25rem;
}

.label-preview-ruler--left span {
    position: absolute;
    transform: translateY(-50%);
}

.design-canvas {
    transform-origin: top left;
    position: relative;
    width: var(--canvas-width-px, 100%);
    height: var(--canvas-height-px, auto);
    aspect-ratio: var(--canvas-ratio, 1 / 1);
    background-color: #f7f7f7;
    --grid-step: calc(var(--px-per-mm, 3.78px) * var(--canvas-zoom, 1));
    background-image: linear-gradient(to right, rgba(148, 163, 184, 0.25) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(148, 163, 184, 0.25) 1px, transparent 1px);
    background-size: var(--grid-step) var(--grid-step);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
    overflow: visible;
    margin: 0;
    transform: scale(var(--canvas-zoom, 1));
}

.design-canvas--static {
    cursor: default;
}

.label-preview-canvas--values .design-canvas {
    border: none;
    box-shadow: none;
    background-image: none;
}

.design-element {
    position: absolute;
    border: 1px solid #d3d7df;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    padding: 0.5rem 0.65rem 0.85rem;
    color: #0f172a;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.2s ease, background-color 0.25s ease;
}

.design-element--static {
    cursor: default;
    border: none;
    box-shadow: none;
    background: #ffffff;
    padding: 0.5rem 0.65rem 0.85rem;
}

.design-element--pattern,
.design-element--image {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.element-body {
    font-weight: 700;
    color: #0f172a;
    word-break: break-word;
    margin-bottom: 0.35rem;
    line-height: 1.35;
    font-size: 1rem;
}

.design-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.pattern-swatch {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: repeating-linear-gradient(45deg, #f1f5f9, #f1f5f9 6px, #e2e8f0 6px, #e2e8f0 12px);
}

.pattern-dots {
    background-image: radial-gradient(#2563eb 1.5px, transparent 1.5px);
    background-size: 12px 12px;
    background-color: #eef2ff;
}

.pattern-grid {
    background-image: linear-gradient(#e5e7eb 1px, transparent 1px), linear-gradient(90deg, #e5e7eb 1px, transparent 1px);
    background-size: 16px 16px;
    background-color: #ffffff;
}

.pattern-wave {
    background: repeating-linear-gradient(90deg, #e0f2fe, #e0f2fe 6px, #bfdbfe 6px, #bfdbfe 12px);
}

.pattern-stripes {
    background-image: linear-gradient(135deg, #c7d2fe 25%, transparent 25%), linear-gradient(225deg, #c7d2fe 25%, transparent 25%), linear-gradient(45deg, #c7d2fe 25%, transparent 25%), linear-gradient(315deg, #c7d2fe 25%, #eef2ff 25%);
    background-position: 10px 0, 10px 0, 0 0, 0 0;
    background-size: 10px 10px;
    background-repeat: repeat;
}

.nutrition-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.nutrition-table th,
.nutrition-table td {
    padding: 0.35rem 0.55rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.nutrition-table th {
    background: #f8fafc;
    font-weight: 700;
    color: #0f172a;
}

.nutrition-table tr:last-child td {
    border-bottom: none;
}

.label-preview-canvas--values .design-element--static {
    background: transparent;
}
