* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #fffaf7;
    color: #403e34;
}

.topbar {
    background: #ffffff;
    border-bottom: 1px solid #f0e3dc;
    padding: 18px 24px;
}

.brand {
    max-width: 1180px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo-text {
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-size: 36px;
    color: #c94718;
}

.logo-text small {
    display: block;
    font-family: Arial, Helvetica, sans-serif;
    font-style: normal;
    font-size: 10px;
    letter-spacing: 7px;
    color: #656252;
    margin-left: 8px;
}

.back {
    color: #7c776d;
    text-decoration: none;
    font-size: 14px;
}

.page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 36px 20px 60px;
}

.hero {
    text-align: center;
    margin-bottom: 30px;
}

.hero .tag {
    display: inline-block;
    background: #f8e5dc;
    color: #c94718;
    padding: 7px 13px;
    border-radius: 999px;
    font-weight: bold;
    font-size: 13px;
}

.hero h1 {
    margin: 14px 0 8px;
    font-size: clamp(28px, 5vw, 44px);
}

.hero p {
    color: #777268;
    margin: 0;
}

.editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr);
    gap: 28px;
    align-items: start;
}

.panel {
    background: #fff;
    border: 1px solid #efe2db;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 16px 45px rgba(88, 56, 38, .08);
}

.canvas-area {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 560px;
    border-radius: 20px;
    background:
        radial-gradient(circle at 15% 18%, rgba(224,178,207,.28) 0 50px, transparent 52px),
        radial-gradient(circle at 85% 80%, rgba(157,158,128,.22) 0 70px, transparent 72px),
        #fffdfc;
    overflow: hidden;
}

.canvas-wrap {
    width: min(86vw, 520px);
    aspect-ratio: 1;
    position: relative;
    touch-action: none;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 20px 45px rgba(60, 42, 32, .16);
    touch-action: none;
    cursor: grab;
    background: #f3eee9;
}

canvas.dragging {
    cursor: grabbing;
}

.controls h2 {
    margin-top: 0;
    font-size: 24px;
}

.spec {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 18px 0 24px;
}

.spec div {
    background: #fff7f2;
    border-radius: 14px;
    padding: 14px;
}

.spec small {
    color: #8b867d;
    display: block;
    margin-bottom: 4px;
}

.spec strong {
    color: #c94718;
}

.control-group {
    margin-bottom: 22px;
}

.control-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
}

input[type="file"] {
    width: 100%;
}

.upload-label {
    display: block;
    width: 100%;
    text-align: center;
    background: #c94718;
    color: #fff;
    padding: 15px 18px;
    border-radius: 14px;
    font-weight: bold;
    cursor: pointer;
}

.upload-label:hover {
    filter: brightness(.96);
}

#photoInput {
    display: none;
}

input[type="range"] {
    width: 100%;
    accent-color: #c94718;
}

.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

button {
    border: 0;
    padding: 13px 12px;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
}

button.secondary {
    background: #f2ece8;
    color: #575149;
}

button.primary {
    background: #c94718;
    color: white;
}

button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.guide {
    background: #fbf7f4;
    border-radius: 14px;
    padding: 14px;
    font-size: 13px;
    line-height: 1.55;
    color: #706b62;
}

.guide strong {
    color: #403e34;
}

.image-status {
    margin-top: 12px;
    font-size: 13px;
    padding: 12px;
    border-radius: 12px;
    display: none;
}

.image-status.ok {
    display: block;
    background: #edf7ef;
    color: #376a42;
}

.image-status.warn {
    display: block;
    background: #fff4dd;
    color: #8a6318;
}

.tip {
    font-size: 12px;
    color: #928c82;
    margin-top: 10px;
}

@media (max-width: 850px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }

    .canvas-area {
        min-height: auto;
        padding: 24px 0;
    }

    .controls {
        order: -1;
    }
}

@media (max-width: 500px) {
    .page {
        padding-left: 12px;
        padding-right: 12px;
    }

    .panel {
        padding: 16px;
        border-radius: 18px;
    }

    .actions {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   TAMARA ATELIE - EDITOR V2
   ===================================================== */

.canvas-wrap {
    width: min(74vw, 470px);
}

.canvas-area {
    min-height: 520px;
}

.zoom-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.zoom-value {
    font-size: 13px;
    font-weight: bold;
    color: #c94718;
    background: #fff1ea;
    padding: 5px 9px;
    border-radius: 999px;
}

.approval-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(39, 31, 27, .72);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.approval-overlay.open {
    display: flex;
}

.approval-modal {
    width: min(920px, 100%);
    max-height: 94vh;
    overflow: auto;
    background: #fffdfb;
    border-radius: 26px;
    padding: 26px;
    box-shadow: 0 30px 90px rgba(0,0,0,.28);
}

.approval-head {
    text-align: center;
    margin-bottom: 20px;
}

.approval-head .check {
    width: 52px;
    height: 52px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #edf7ef;
    color: #3d7748;
    font-size: 27px;
    font-weight: bold;
}

.approval-head h2 {
    margin: 0 0 7px;
    font-size: 28px;
}

.approval-head p {
    margin: 0;
    color: #777168;
}

.approval-content {
    display: grid;
    grid-template-columns: minmax(260px, 430px) 1fr;
    gap: 26px;
    align-items: center;
}

.final-preview-box {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

#finalPreview {
    display: block;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 1;
    border-radius: 50%;
    box-shadow: 0 18px 45px rgba(56, 40, 32, .18);
}

.approval-info {
    background: #fff7f2;
    border: 1px solid #f0ded4;
    border-radius: 18px;
    padding: 20px;
}

.approval-info h3 {
    margin-top: 0;
    margin-bottom: 14px;
}

.approval-info ul {
    padding-left: 20px;
    color: #69645b;
    line-height: 1.65;
}

.approval-confirm {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 18px 0;
    padding: 14px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #eaded8;
}

.approval-confirm input {
    margin-top: 3px;
    transform: scale(1.15);
    accent-color: #c94718;
}

.approval-confirm label {
    line-height: 1.45;
    font-size: 14px;
    cursor: pointer;
}

.approval-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.approved-message {
    display: none;
    margin-top: 18px;
    padding: 15px;
    border-radius: 14px;
    background: #edf7ef;
    color: #376a42;
    font-weight: bold;
    text-align: center;
}

.approved-message.show {
    display: block;
}

@media (max-width: 850px) {
    .canvas-wrap {
        width: min(88vw, 470px);
    }

    .canvas-area {
        min-height: auto;
    }

    .approval-content {
        grid-template-columns: 1fr;
    }

    #finalPreview {
        max-width: 330px;
    }
}

@media (max-width: 500px) {
    .approval-modal {
        padding: 18px;
        border-radius: 20px;
    }

    .approval-buttons {
        grid-template-columns: 1fr;
    }
}
