.ie-page {
    padding: 2rem 0 2.5rem;
}

.ie-page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.ie-hero {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
    margin-bottom: 24px;
}

.ie-hero h1,
.ie-panel h2,
.ie-preview-section h2,
.ie-empty-state h3,
.ie-preview-card h3 {
    margin: 0;
}

.ie-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
    font-weight: 800;
}

.ie-hero-copy,
.ie-section-label,
.ie-support-text,
.ie-dropzone-meta,
.ie-dropzone-subtitle {
    color: #607086;
}

.ie-hero-copy {
    max-width: 700px;
    margin: 12px 0 0;
    line-height: 1.65;
}

.ie-hero-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ie-hero-badges span,
.ie-pill {
    padding: 8px 13px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #d9e3ef;
    font-weight: 700;
    font-size: 0.84rem;
}

.ie-flash-stack {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.ie-flash {
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 600;
}

.ie-flash-success {
    color: #0f6b42;
    background: #eaf8f0;
    border: 1px solid #c7ead7;
}

.ie-flash-error {
    color: #ab2e2e;
    background: #fff0f0;
    border: 1px solid #f4cdcd;
}

.ie-layout-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.ie-layout-grid.has-upload {
    grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
    align-items: start;
}

.ie-panel,
.ie-preview-section {
    background: #fff;
    border: 1px solid #d9e3ef;
    border-radius: 20px;
    padding: 20px;
}

.ie-upload-panel {
    position: sticky;
    top: 18px;
}

.ie-upload-panel .ie-panel-header {
    align-items: flex-start;
}

.ie-upload-panel .ie-panel-header h2 {
    max-width: none;
}

.ie-upload-panel .ie-support-text {
    text-align: right;
    min-width: 74px;
}

.ie-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.ie-panel h2,
.ie-preview-section h2 {
    font-size: clamp(1.35rem, 2vw, 1.85rem);
    font-weight: 700;
    line-height: 1.15;
}

.ie-dropzone {
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
    gap: 6px;
    min-height: 220px;
    padding: 24px;
    border: 2px dashed #b9d0ef;
    border-radius: 18px;
    background: #f6faff;
    text-align: center;
    cursor: pointer;
}

.ie-dropzone.is-compact {
    min-height: 180px;
    padding: 18px 18px 16px;
}

.ie-dropzone-preview-image {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 130px;
    height: 170px;
    object-fit: cover;
    border-radius: 14px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Keep Step 1 dropzone preview disabled to preserve existing workflow */
.ie-dropzone .ie-dropzone-preview-image {
    display: none !important;
}

.ie-dropzone.is-compact .ie-dropzone-preview-image {
    width: 92px;
    height: 124px;
    top: 14px;
    right: 14px;
}

.ie-dropzone.is-compact .ie-dropzone-icon {
    width: 46px;
    height: 46px;
    font-size: 1.45rem;
}

.ie-dropzone.is-compact .ie-dropzone-title {
    font-size: 1rem;
}

.ie-upload-preview-card {
    display: grid;
    gap: 12px;
    margin-top: 12px;
    padding: 14px;
    border-radius: 16px;
    background: #f7faff;
    border: 1px solid #dce7f3;
}

.ie-upload-preview-head {
    display: grid;
    gap: 4px;
}

.ie-upload-preview-head strong {
    color: #15263a;
}

.ie-upload-preview-head span {
    color: #607086;
    font-size: 0.92rem;
}

.ie-live-preview-upload .ie-live-preview-canvas {
    width: 100%;
    min-height: 220px;
    max-width: none;
}

.ie-live-preview-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ie-live-preview-stats div {
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e0e9f3;
}

.ie-live-preview-stats span {
    display: block;
    margin-bottom: 4px;
    color: #607086;
    font-size: 0.88rem;
}

.ie-live-preview-stats strong {
    color: #15263a;
}

.ie-upload-panel .ie-form-actions {
    grid-template-columns: 1fr;
}

.ie-dropzone-preview-image.is-visible {
    opacity: 1;
}

.ie-dropzone-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #e4efff;
    color: #2b70f8;
    font-size: 1.8rem;
}

.ie-dropzone-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.ie-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ie-chip-grid,
.ie-form-actions,
.ie-preview-grid,
.ie-stats {
    display: grid;
    gap: 10px;
}

.ie-chip-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 14px;
}

.ie-chip {
    border: 1px solid #bad0ef;
    background: #edf4ff;
    color: #1e4ea6;
    border-radius: 12px;
    padding: 10px;
    font-weight: 700;
}

.ie-chip.is-active {
    color: #fff;
    background: linear-gradient(135deg, #2b70f8, #1e4ea6);
    border-color: #2b70f8;
}

.ie-chip-muted {
    background: #f5f7fa;
    color: #44576d;
    border-color: #d4deea;
}

.ie-editor-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.ie-editor-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.9rem;
    border-radius: 14px;
    background: #f4f8fc;
    border: 1px solid #dbe6f2;
    color: #516477;
    font-size: 0.92rem;
}

.ie-editor-chip strong {
    color: #16314d;
}

.ie-crop-editor {
    margin-bottom: 14px;
}

.ie-crop-instruction {
    margin-bottom: 10px;
    color: #607086;
    font-size: 0.92rem;
}

.ie-crop-stage {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid #dbe6f2;
    background:
        linear-gradient(45deg, #edf3f9 25%, transparent 25%, transparent 75%, #edf3f9 75%, #edf3f9),
        linear-gradient(45deg, #edf3f9 25%, #f8fbff 25%, #f8fbff 75%, #edf3f9 75%, #edf3f9);
    background-size: 24px 24px;
    background-position: 0 0, 12px 12px;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    touch-action: none;
}

.ie-crop-image {
    display: block;
    max-width: 100%;
    max-height: 420px;
    width: auto;
    height: auto;
    border-radius: 14px;
}

.ie-crop-selection {
    position: absolute;
    border: 2px solid #2b70f8;
    border-radius: 14px;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.46);
    cursor: move;
    min-width: 36px;
    min-height: 36px;
}

.ie-crop-grid {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        linear-gradient(to right, transparent 33.33%, rgba(255, 255, 255, 0.45) 33.33%, rgba(255, 255, 255, 0.45) 34%, transparent 34%, transparent 66.66%, rgba(255, 255, 255, 0.45) 66.66%, rgba(255, 255, 255, 0.45) 67.33%, transparent 67.33%),
        linear-gradient(to bottom, transparent 33.33%, rgba(255, 255, 255, 0.45) 33.33%, rgba(255, 255, 255, 0.45) 34%, transparent 34%, transparent 66.66%, rgba(255, 255, 255, 0.45) 66.66%, rgba(255, 255, 255, 0.45) 67.33%, transparent 67.33%);
}

.ie-crop-handle {
    position: absolute;
    border: 0;
    background: #2b70f8;
    box-shadow: 0 8px 16px rgba(43, 112, 248, 0.24);
}

.ie-crop-handle-top,
.ie-crop-handle-bottom {
    left: 50%;
    width: 54px;
    height: 10px;
    border-radius: 999px;
    transform: translateX(-50%);
}

.ie-crop-handle-top {
    top: -6px;
    cursor: ns-resize;
}

.ie-crop-handle-bottom {
    bottom: -6px;
    cursor: ns-resize;
}

.ie-crop-handle-corner {
    right: -10px;
    bottom: -10px;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    cursor: nwse-resize;
}

.ie-crop-handle-corner-top-left {
    top: -10px;
    left: -10px;
    right: auto;
    bottom: auto;
    cursor: nwse-resize;
}

.ie-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.ie-field-group {
    margin-bottom: 14px;
}

.ie-field-group-label {
    display: inline-block;
    margin-bottom: 8px;
    font-weight: 600;
}

.ie-chip-grid-4 {
    margin-bottom: 0;
}

.ie-field {
    display: grid;
    gap: 7px;
}

.ie-edit-fieldset {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.ie-edit-fieldset.is-disabled {
    opacity: 0.58;
}

.ie-field span,
.ie-toggle span {
    font-weight: 600;
}

.ie-field input,
.ie-field select {
    width: 100%;
    min-height: 40px;
    border: 1px solid #d3dde8;
    border-radius: 12px;
    padding: 0 14px;
    font-size: 0.98rem;
}

.ie-field input[type="range"] {
    padding: 0;
    min-height: auto;
}

.ie-range-value {
    color: #1e4ea6;
}

.ie-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    cursor: pointer;
}

.ie-form-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ie-upload-form .ie-form-actions {
    margin-top: 12px;
}

.ie-upload-secondary-actions {
    margin-top: 10px;
}

.ie-download-slot {
    margin-top: 14px;
}

.ie-btn {
    border: 0;
    border-radius: 12px;
    min-height: 46px;
    padding: 10px 14px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.ie-btn:disabled {
    opacity: 0.55;
}

.ie-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #2b70f8, #1e4ea6);
}

.ie-btn-secondary {
    color: #25384d;
    background: #eef2f7;
}

.ie-btn-block {
    width: 100%;
    margin-top: 12px;
}

.ie-disabled-note {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f5f8fc;
    border: 1px dashed #c8d5e4;
    color: #607086;
    font-weight: 600;
    text-align: center;
}

.is-hidden {
    display: none;
}

.ie-preview-section {
    margin-top: 20px;
}

.ie-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ie-preview-card {
    padding: 18px;
    border-radius: 16px;
    border: 1px solid #d9e3ef;
}

.ie-preview-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.ie-pill-accent {
    background: #eaf8f0;
}

.ie-preview-frame {
    min-height: 280px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #f4f8fc;
    padding: 14px;
}

.ie-live-preview {
    width: 100%;
    display: grid;
    place-items: center;
}

.ie-live-preview-canvas {
    position: relative;
    overflow: hidden;
    width: min(100%, 420px);
    min-height: 180px;
    border-radius: 14px;
    background:
        linear-gradient(45deg, #edf3f9 25%, transparent 25%, transparent 75%, #edf3f9 75%, #edf3f9),
        linear-gradient(45deg, #edf3f9 25%, #f8fbff 25%, #f8fbff 75%, #edf3f9 75%, #edf3f9);
    background-size: 24px 24px;
    background-position: 0 0, 12px 12px;
}

.ie-live-preview-canvas img {
    position: absolute;
    top: 0;
    left: 0;
    max-width: none;
    max-height: none;
    transform-origin: top left;
    border-radius: 0;
}

.ie-preview-note {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f5f8fc;
    border: 1px dashed #c8d5e4;
    color: #607086;
    font-size: 0.92rem;
}

.ie-preview-frame img {
    max-width: 100%;
    max-height: 360px;
    object-fit: contain;
    border-radius: 12px;
}

.ie-placeholder-copy {
    display: grid;
    gap: 6px;
    text-align: center;
    color: #607086;
}

.ie-stats {
    margin: 14px 0 0;
}

.ie-stats div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid #e7edf4;
}

.ie-stats dt {
    color: #607086;
}

.ie-stats dd {
    margin: 0;
    text-align: right;
    font-weight: 700;
    color: #15263a;
}

.ie-empty-state {
    display: grid;
    gap: 10px;
    place-items: center;
    min-height: 220px;
    border: 1px dashed #cbd8e5;
    border-radius: 18px;
    background: #fbfdff;
    text-align: center;
    padding: 24px;
}

@media (max-width: 991.98px) {
    .ie-layout-grid,
    .ie-preview-grid {
        grid-template-columns: 1fr 1fr;
    }

    .ie-layout-grid.has-upload {
        grid-template-columns: 1fr;
    }

    .ie-upload-panel {
        position: static;
    }

    .ie-hero {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 767.98px) {
    .ie-page-shell {
        width: min(100% - 24px, 1180px);
    }

    .ie-field-grid,
    .ie-chip-grid,
    .ie-form-actions,
    .ie-preview-grid {
        grid-template-columns: 1fr;
    }

    .ie-editor-meta {
        flex-direction: column;
        align-items: stretch;
    }

    .ie-panel-header,
    .ie-preview-head,
    .ie-stats div {
        align-items: flex-start;
        flex-direction: column;
    }

    .ie-stats dd {
        text-align: left;
    }
}
