:root {
    --cz-bg: #f3f4f6;
    --cz-surface: #ffffff;
    --cz-border: #e5e7eb;
    --cz-text: #111827;
    --cz-muted: #6b7280;
    --cz-primary: #dc2626;
    --cz-primary-hover: #b91c1c;
    --cz-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
}

* {
    box-sizing: border-box;
}

[v-cloak] {
    display: none;
}

body {
    margin: 0;
    font-family: Inter, system-ui, sans-serif;
    background: var(--cz-bg);
    color: var(--cz-text);
}

.cz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--cz-surface);
    border-bottom: 1px solid var(--cz-border);
}

.cz-header__brand {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.cz-header__logo {
    font-size: 1.25rem;
    font-weight: 700;
}

.cz-header__subtitle {
    color: var(--cz-muted);
    font-size: 0.95rem;
}

.cz-header__logo-link {
    color: inherit;
    text-decoration: none;
}

.cz-header__back {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    text-decoration: none;
    color: inherit;
    line-height: 1.25;
    font-style: italic;
}

.cz-header__back-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--cz-text);
    font-style: italic;
}

.cz-header__back-site {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--cz-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-style: italic;
}

.cz-header__back:hover .cz-header__back-site {
    color: var(--cz-text);
}

.cz-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
    min-height: calc(100vh - 73px);
}

.cz-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #e8e8ea;
    border: 1px solid var(--cz-border);
    border-radius: 16px;
    box-shadow: var(--cz-shadow);
    padding: 2rem;
}

.cz-preview__canvas {
    width: min(100%, 640px);
}

.cz-preview__stage {
    position: relative;
    width: 100%;
    line-height: 0;
}

.cz-preview__flat {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 1;
    vertical-align: top;
}

.cz-transform-hitlayer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    cursor: default;
    touch-action: none;
    user-select: none;
}

.cz-transform-overlay {
    position: absolute;
    z-index: 3;
    pointer-events: none;
    box-sizing: border-box;
}

.cz-transform-box {
    position: relative;
    width: 100%;
    height: 100%;
    border: 1.5px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
    pointer-events: auto;
    cursor: move;
    touch-action: none;
}

.cz-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #111827;
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
    pointer-events: auto;
    touch-action: none;
}

.cz-handle--corner {
    margin: -5px;
}

.cz-handle--nw {
    top: 0;
    left: 0;
    cursor: nwse-resize;
}

.cz-handle--ne {
    top: 0;
    right: 0;
    cursor: nesw-resize;
}

.cz-handle--se {
    bottom: 0;
    right: 0;
    cursor: nwse-resize;
}

.cz-handle--sw {
    bottom: 0;
    left: 0;
    cursor: nesw-resize;
}

.cz-handle--rotate {
    left: 50%;
    bottom: -28px;
    margin-left: -5px;
    border-radius: 999px;
    cursor: grab;
}

.cz-handle--rotate::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 100%;
    width: 1px;
    height: 18px;
    margin-left: -0.5px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.cz-handle--rotate:active {
    cursor: grabbing;
}

.cz-preview__controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.cz-panel {
    display: flex;
    flex-direction: column;
    background: var(--cz-surface);
    border: 1px solid var(--cz-border);
    border-radius: 16px;
    box-shadow: var(--cz-shadow);
    overflow: hidden;
}

.cz-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--cz-border);
    background: #fafafa;
}

.cz-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.65rem 0.35rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--cz-muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.72rem;
}

.cz-tab.is-active {
    background: #fff;
    color: var(--cz-primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.cz-tab__icon {
    font-size: 1rem;
    line-height: 1;
}

.cz-panel__body {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
}

.cz-tab-panel h2 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
}

.cz-panel-title {
    margin: 0 0 1rem;
    font-size: 1.35rem;
    font-weight: 400;
    font-style: italic;
    color: #9ca3af;
    border-bottom: 1px solid var(--cz-border);
    padding-bottom: 0.75rem;
}

.cz-preview__hint {
    margin: 0.75rem 0 0;
    font-size: 0.82rem;
    color: var(--cz-muted);
    text-align: center;
}

.cz-gadget {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cz-gadget__top {
    display: grid;
    grid-template-columns: 108px 1fr;
    gap: 0.85rem;
    align-items: start;
}

.cz-gadget__side {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
}

.cz-upload-box {
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
    border: 1px solid var(--cz-border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
}

.cz-upload-box input {
    display: none;
}

.cz-upload-box__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: var(--cz-muted);
    text-align: center;
    padding: 0.5rem;
}

.cz-upload-box__icon {
    font-size: 1.25rem;
    line-height: 1;
}

.cz-upload-box__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.35rem;
}

.cz-number-preview {
    position: relative;
    width: 108px;
    height: 108px;
    flex-shrink: 0;
    border: 1px solid #dfe3e8;
    border-radius: 10px;
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cz-number-preview:focus-within {
    border-color: #cbd5e1;
    box-shadow:
        inset 0 1px 2px rgba(15, 23, 42, 0.04),
        0 0 0 3px rgba(15, 23, 42, 0.06);
}

.cz-number-preview__display {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    user-select: none;
}

.cz-number-preview__text {
    font-family: "Bebas Neue", Impact, "Arial Narrow Bold", sans-serif;
    font-size: 2.85rem;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0.05em;
    transform: translateY(1px);
}

.cz-number-preview__input {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: transparent;
    color: transparent;
    -webkit-text-fill-color: transparent;
    caret-color: #374151;
    text-align: center;
    font-family: "Bebas Neue", Impact, "Arial Narrow Bold", sans-serif;
    font-size: 2.85rem;
    font-weight: 400;
    line-height: 108px;
    letter-spacing: 0.05em;
    outline: none;
    cursor: text;
}

.cz-number-preview__input::selection {
    background: rgba(59, 130, 246, 0.2);
}

.cz-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
}

.cz-check input {
    appearance: none;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 1px solid var(--cz-border);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    position: relative;
}

.cz-check input:checked {
    background: var(--cz-primary);
    border-color: var(--cz-primary);
}

.cz-check input:checked::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
}

.cz-btn--outline {
    background: #fff;
    border: 1px solid var(--cz-border);
    color: var(--cz-text);
}

.cz-btn--outline:hover:not(:disabled) {
    background: #f9fafb;
}

.cz-btn--danger {
    background: var(--cz-primary);
    color: #fff;
}

.cz-btn--danger:hover:not(:disabled) {
    background: var(--cz-primary-hover);
}

.cz-btn--sm {
    padding: 0.45rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 500;
    border-radius: 8px;
}

.cz-slider-row {
    display: grid;
    grid-template-columns: 52px 1fr 28px 44px;
    gap: 0.5rem;
    align-items: center;
}

.cz-slider-row__label {
    font-size: 0.85rem;
    color: var(--cz-muted);
}

.cz-slider {
    width: 100%;
    accent-color: #6b7280;
}

.cz-slider-row__value {
    width: 100%;
    padding: 0.35rem 0.25rem;
    border: 1px solid var(--cz-border);
    border-radius: 6px;
    font: inherit;
    font-size: 0.82rem;
    text-align: center;
}

.cz-reset {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--cz-muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.cz-reset:hover {
    background: #f3f4f6;
    color: var(--cz-text);
}

.cz-link-btn {
    margin-top: 0.75rem;
    padding: 0;
    border: none;
    background: none;
    color: var(--cz-primary);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.cz-link-btn:hover {
    text-decoration: underline;
}

.cz-logo-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.cz-logo-tab {
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--cz-border);
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
}

.cz-logo-tab.is-active {
    border-color: var(--cz-primary);
    color: var(--cz-primary);
    background: rgba(220, 38, 38, 0.05);
}

.cz-field--compact {
    margin-bottom: 0;
}

.cz-color-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.cz-color-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--cz-muted);
}

.cz-color-field--wide {
    margin-top: 0.25rem;
}

.cz-color-input {
    width: 100%;
    height: 38px;
    padding: 0;
    border: 1px solid var(--cz-border);
    border-radius: 999px;
    cursor: pointer;
    background: none;
}

.cz-color-hex {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--cz-text);
}

.cz-preset-row {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 0.5rem;
    align-items: center;
}

.cz-preset-row__label {
    font-size: 0.82rem;
    color: var(--cz-muted);
    font-style: italic;
}

.cz-preset-swatches {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.4rem;
}

.cz-preset-swatch {
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    padding: 0;
}

.cz-preset-swatch:hover {
    border-color: rgba(17, 24, 39, 0.25);
}

.cz-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.cz-field span {
    font-size: 0.9rem;
    font-weight: 500;
}

.cz-field select,
.cz-field input[type="text"] {
    width: 100%;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--cz-border);
    border-radius: 10px;
    font: inherit;
    background: #fff;
}

.cz-swatches {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}

.cz-swatches--round {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.65rem;
}

.cz-segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-bottom: 1.1rem;
}

.cz-segmented__btn {
    padding: 0.8rem 1rem;
    border: 1px solid var(--cz-border);
    border-radius: 10px;
    background: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.cz-segmented__btn.is-active {
    border-color: #111827;
    background: #111827;
    color: #fff;
}

.cz-color-field {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.65rem 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
}

.cz-color-field__label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--cz-muted);
}

.cz-color-picker {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--cz-border);
    border-radius: 999px;
    cursor: pointer;
    overflow: hidden;
}

.cz-color-picker input[type="color"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.cz-color-picker__hex {
    position: relative;
    z-index: 1;
    font-size: 0.92rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.cz-color-field__hex-input {
    grid-column: 2;
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--cz-border);
    border-radius: 10px;
    font: inherit;
    text-transform: uppercase;
}

.cz-field-hint {
    margin: 0 0 0.65rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--cz-muted);
}

.cz-swatch {
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
}

.cz-swatch.is-active {
    border-color: var(--cz-primary);
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

.cz-swatch--round {
    aspect-ratio: 1;
    border-radius: 999px;
}

.cz-options {
    display: grid;
    gap: 0.5rem;
}

.cz-option {
    padding: 0.85rem 1rem;
    border: 1px solid var(--cz-border);
    border-radius: 10px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.cz-option.is-active {
    border-color: var(--cz-primary);
    color: var(--cz-primary);
    background: rgba(220, 38, 38, 0.05);
}

.cz-upload {
    display: block;
    padding: 1.25rem;
    border: 2px dashed var(--cz-border);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
}

.cz-upload input {
    display: none;
}

.cz-hint {
    color: var(--cz-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.cz-panel__footer {
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid var(--cz-border);
}

.cz-btn {
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.cz-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cz-btn--ghost {
    background: #f3f4f6;
    color: var(--cz-text);
}

.cz-btn--ghost:hover:not(:disabled) {
    background: #e5e7eb;
}

.cz-btn--primary {
    background: var(--cz-primary);
    color: #fff;
}

.cz-btn--primary:hover:not(:disabled) {
    background: var(--cz-primary-hover);
}

.cz-btn--full {
    width: 100%;
    padding: 1rem;
}

.cz-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--cz-muted);
    font-size: 0.9rem;
}

.cz-error {
    color: #b91c1c;
    font-size: 0.9rem;
    margin: 0 0 0.75rem;
}

.cz-pending {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.cz-pending__card {
    width: min(100%, 560px);
    background: var(--cz-surface);
    border: 1px solid var(--cz-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--cz-shadow);
}

.cz-pending__list {
    margin: 1.5rem 0;
}

.cz-pending__list div {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--cz-border);
}

.cz-pending__list dt {
    font-weight: 600;
}

.cz-pending__list dd {
    margin: 0;
    color: var(--cz-muted);
}

.cz-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: rgba(17, 24, 39, 0.72);
    backdrop-filter: blur(4px);
}

.cz-modal__dialog {
    position: relative;
    width: min(100%, 760px);
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.cz-modal__close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.cz-modal__mode {
    position: absolute;
    top: 0.85rem;
    left: 0.85rem;
    z-index: 2;
    display: flex;
    gap: 0.35rem;
    padding: 0.2rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
}

.cz-modal__mode-btn {
    border: none;
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #4b5563;
    background: transparent;
    cursor: pointer;
}

.cz-modal__mode-btn.is-active {
    color: #fff;
    background: var(--cz-accent, #b91c1c);
}

.cz-modal__viewport {
    width: 100%;
    height: min(58vh, 520px);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cz-modal__viewport canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.cz-preview2d__canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.cz-modal__views {
    padding: 1rem 1.25rem 1.35rem;
    background: #111827;
    color: #fff;
}

.cz-modal__view-label {
    margin: 0 0 0.75rem;
    font-style: italic;
    color: #e5e7eb;
}

.cz-modal__thumbs {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cz-modal__thumb {
    min-width: 110px;
    padding: 0.65rem 0.85rem;
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
}

.cz-modal__thumb.is-active {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.18);
}

@media (max-width: 960px) {
    .cz-main {
        grid-template-columns: 1fr;
    }

    .cz-tabs {
        grid-template-columns: repeat(3, 1fr);
        overflow-x: auto;
    }
}

@media (max-width: 520px) {
    .cz-tabs {
        grid-template-columns: repeat(2, 1fr);
    }

    .cz-swatches {
        grid-template-columns: repeat(4, 1fr);
    }
}
