/* Focused preview workspace polish. Loaded after the shared IDPicMaker rules
   so the result view stays compact without changing the public content pages. */

.auto-result-heading {
    align-items: center;
}

.auto-result-heading h2 {
    max-width: none;
    font-size: clamp(1.45rem, 1.55vw, 1.9rem);
    line-height: 1.18;
    letter-spacing: -.035em;
}

.auto-result-details {
    padding: 18px 20px 20px;
}

.auto-result-grid {
    margin-top: 16px;
}

.auto-result-check {
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    min-height: 60px;
    padding: 7px 0;
    gap: 11px;
}

.auto-result-check > div {
    min-width: 0;
}

.auto-check-icon {
    display: grid;
    width: 38px;
    height: 38px;
    align-self: center;
    place-items: center;
    border-radius: 12px;
}

.auto-check-icon svg {
    width: 19px;
    height: 19px;
}

.auto-result-check span:not(.auto-check-icon) {
    font-size: 11px;
    line-height: 1.2;
}

.auto-result-check strong {
    font-size: 14px;
    line-height: 1.2;
}

.auto-result-check small {
    font-size: 10px;
    line-height: 1.2;
}

.auto-result-note,
.auto-result-alert {
    margin-top: 10px;
    margin-bottom: 9px;
    font-size: 11px;
    line-height: 1.45;
}

.auto-result-visual {
    min-width: 0;
    overflow: visible;
    padding: 0;
}

.auto-result-preview-shell {
    width: min(100%, 620px);
    padding: 12px;
    border-radius: 20px;
}

.auto-result-preview-frame {
    height: min(45vh, 470px);
    min-height: 300px;
    padding: 42px 66px 48px;
    overflow: visible;
}

.auto-result-photo-measure {
    position: relative;
    width: min(100%, 420px);
    height: auto;
    max-height: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    outline-offset: 5px;
}

.auto-result-photo-measure img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* The watermark is embedded in the preview PNG so saving the image cannot
   bypass it. The clean paid export is generated from the separate canvas. */
.auto-result-watermark {
    display: none;
}

.auto-result-controls {
    gap: 12px;
    margin-top: 8px;
}

.auto-result-controls button,
.auto-result-start-over,
.auto-result-download {
    transition: transform .18s ease, border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.auto-result-controls button {
    min-width: 48px;
    min-height: 48px;
    border: 1px solid #c6dbe4;
    background: #fff;
    box-shadow: 0 8px 18px -15px rgba(16,47,69,.9);
}

.auto-result-controls button:hover,
.auto-result-controls button:focus-visible,
.auto-result-start-over:hover,
.auto-result-start-over:focus-visible {
    transform: translateY(-2px);
    border-color: #2d82af;
    box-shadow: 0 10px 20px -15px rgba(16,47,69,.95);
}

.auto-result-controls .auto-result-reset {
    min-width: 190px;
    color: #315f75;
    background: #f4f9fb;
    font-weight: 700;
}

/* The shared control rule uses a grid for the compact zoom buttons. Keep the
 * wider reset action horizontal so its icon sits beside the label. */
.auto-result-controls .auto-result-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
}

.auto-result-controls .auto-result-reset svg {
    flex: 0 0 auto;
}

.auto-result-start-over {
    min-height: 44px;
    margin-top: 9px;
    padding: 8px 16px;
    border-color: #c6dbe4;
    background: #fff;
    font-weight: 700;
}

.auto-result-download {
    width: min(100%, 520px);
    min-height: 50px;
    margin-top: 12px;
    border-radius: 14px;
    background: #123a54;
    box-shadow: 0 14px 24px -17px rgba(16,47,69,.95);
}

.auto-result-download:disabled {
    cursor: not-allowed;
    background: #9cafb9;
    box-shadow: none;
    opacity: .78;
}

.auto-result-download:hover,
.auto-result-download:focus-visible {
    transform: translateY(-2px);
    background: #1f648d;
    box-shadow: 0 17px 28px -17px rgba(16,47,69,.95);
}

.auto-result-download:disabled:hover,
.auto-result-download:disabled:focus-visible {
    transform: none;
    background: #9cafb9;
    box-shadow: none;
}

.auto-result-local-download {
    width: min(100%, 520px);
    min-height: 44px;
    margin-top: 8px;
    border-radius: 14px;
    font-size: 13px;
}

.auto-result-local-download:disabled {
    cursor: not-allowed;
    opacity: .55;
}

/* The preview page keeps the processing canvas off-screen, but it must retain
   real dimensions so the automatic crop and paid export use the same geometry
   as the visible result. */
#idpicmaker-app.is-direct-preview > .idphoto-preview-engine {
    display: block !important;
}

.idphoto-preview-engine {
    display: block !important;
    position: fixed !important;
    z-index: -1 !important;
    top: -10000px !important;
    left: -10000px !important;
    width: 600px !important;
    height: 600px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.idphoto-preview-engine #idphoto-stage {
    width: 600px !important;
    height: 600px !important;
}

.idphoto-preview-engine #idphoto-canvas {
    display: block !important;
    width: 600px !important;
    height: 600px !important;
}

/* Keep the measurement lines outside the photo square. The photo itself is
   rendered with contain, so the subject cannot spill out of the output frame. */
.auto-result-preview-frame {
    overflow: visible !important;
}

.auto-result-photo-measure {
    overflow: visible !important;
    isolation: isolate;
    background: #fff;
}

.auto-result-photo-measure img {
    position: relative;
    z-index: 0;
    object-fit: contain !important;
}

.auto-result-dimension {
    z-index: 5 !important;
    display: grid !important;
    place-items: center !important;
    color: transparent !important;
    background-color: transparent !important;
    pointer-events: none;
}

.auto-result-dimension b {
    position: absolute !important;
    z-index: 1;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    min-height: 26px;
    padding: 4px 8px;
    border-radius: 8px;
    color: #fff !important;
    background: #123a54 !important;
    box-shadow: 0 5px 12px rgba(18,58,84,.22);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.auto-result-dimension-top {
    top: -34px !important;
    right: 0 !important;
    left: 0 !important;
    width: auto !important;
    height: 24px !important;
    background: linear-gradient(#2d82af, #2d82af) center 12px / 100% 2px no-repeat !important;
}

.auto-result-dimension-top b {
    top: 0 !important;
    left: 50% !important;
    transform: translateX(-50%);
}

.auto-result-dimension-side {
    top: 0 !important;
    right: -52px !important;
    bottom: 0 !important;
    width: 36px !important;
    height: auto !important;
    background: linear-gradient(90deg, #2d82af, #2d82af) 9px center / 2px 100% no-repeat !important;
}

.auto-result-dimension-side b {
    top: 50% !important;
    right: -5px !important;
    transform: translate(100%, -50%);
}

.auto-result-head-guide {
    z-index: 4 !important;
}

.auto-result-head-label {
    z-index: 6 !important;
    color: #fff !important;
    background: #2d82af !important;
    box-shadow: 0 5px 12px rgba(18,58,84,.22);
}

/* The icon column is a fixed grid track; this prevents the SVG from drifting
   when the value text wraps at smaller desktop widths. */
.auto-result-check {
    display: grid !important;
    align-items: center !important;
}

.auto-result-check > .auto-check-icon {
    display: grid !important;
    align-self: center !important;
    justify-self: center;
    place-items: center !important;
    margin: 0 !important;
    border: 1px solid #a9dfd5;
    background: linear-gradient(145deg, #f8fffd, #e8f8f6);
    box-shadow: inset 0 0 0 3px rgba(255,255,255,.6), 0 5px 12px -9px rgba(16,47,69,.75);
}

.auto-result-check > .auto-check-icon svg {
    display: block;
    margin: 0;
}

@media (min-width: 821px) {
    .auto-result-layout {
        grid-template-columns: minmax(500px, .98fr) minmax(520px, 1.02fr);
        gap: clamp(24px, 3vw, 48px);
        height: calc(100% - 64px);
        min-height: 0;
        padding-top: 14px;
    }

    .auto-result-details,
    .auto-result-visual {
        height: 100%;
    }
}

@media (max-width: 820px) {
    .auto-result-preview-frame {
        height: min(76vw, 560px);
        min-height: 280px;
        padding: 40px 54px 48px;
    }

    .auto-result-photo-measure {
        width: min(100%, 520px);
    }
}

@media (max-width: 560px) {
    .auto-result-heading {
        display: block;
    }

    .auto-result-heading h2 {
        font-size: 1.45rem;
    }

    .auto-result-preview-frame {
        height: min(84vw, 420px);
        min-height: 250px;
        padding: 34px 42px 44px;
    }

    .auto-result-controls .auto-result-reset {
        min-width: 0;
        padding: 0 14px;
    }

    .auto-result-dimension-side {
        right: -42px !important;
    }

    .auto-result-dimension-side b {
        right: -3px !important;
    }
}
