html.file-creation-page-locked,
body.file-creation-page-locked {
    overflow: hidden !important;
    overscroll-behavior: none !important;
    touch-action: none !important;
}

.file-create-drawer.history-drawer {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147482500 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom)) !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, visibility .18s ease;
}

.file-create-drawer.history-drawer.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.file-create-drawer .history-backdrop {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    background: rgba(1, 7, 18, .76) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.file-create-drawer .history-panel {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    width: min(520px, 100%) !important;
    height: auto !important;
    max-height: min(78vh, 680px) !important;
    margin: 0 !important;
    padding-bottom: 16px !important;
    overflow: hidden !important;
    border: 1px solid rgba(112, 162, 255, .28) !important;
    border-radius: 22px !important;
    background: linear-gradient(180deg, rgba(13, 29, 55, .99), rgba(6, 18, 37, .99)) !important;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .48), 0 0 0 1px rgba(255, 255, 255, .02) inset !important;
}

.file-create-drawer .history-panel-head {
    padding: 15px 16px 12px !important;
}

.file-create-drawer .history-panel > .muted {
    margin: 0;
    padding: 0 16px 12px;
    color: #92a8c9;
    font-size: 12px;
}

.file-create-drawer #create-file-formats {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px !important;
    max-height: min(54vh, 460px);
    padding: 2px 16px 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.file-create-drawer .create-file-format {
    display: flex !important;
    align-items: center;
    gap: 12px;
    min-height: 88px;
    margin: 0 !important;
    padding: 13px !important;
    border: 1px solid rgba(111, 158, 226, .2) !important;
    border-radius: 14px !important;
    background: rgba(9, 25, 49, .72) !important;
    text-align: left;
    transition: transform .14s ease, border-color .14s ease, background .14s ease;
}

.file-create-drawer .file-format-icon {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 48px;
    place-items: center;
    border-radius: 9px 9px 12px 9px;
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -.05em;
    line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}

.file-create-drawer .file-format-icon.word {
    background: linear-gradient(145deg, #2d78d6, #124a9c);
}

.file-create-drawer .file-format-icon.pdf {
    background: linear-gradient(145deg, #ea615d, #a4222c);
    font-size: 11px;
    letter-spacing: .02em;
}

.file-create-drawer .file-format-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.file-create-drawer .create-file-format:active {
    transform: scale(.985);
    border-color: rgba(92, 149, 255, .72) !important;
    background: rgba(21, 48, 86, .9) !important;
}

.file-create-drawer .create-file-format h3 {
    margin: 0 !important;
    font-size: 15px !important;
    line-height: 1.25;
}

.file-create-drawer .create-file-format p {
    margin: 0 !important;
    color: #8ca4c8 !important;
    font-size: 11px !important;
    font-weight: 600;
    letter-spacing: 0;
}

.file-create-drawer #create-file-progress {
    display: none !important;
}


.file-creation-json-loading {
    position: fixed;
    inset: 0;
    z-index: 2147482600;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(2, 8, 19, .72);
    opacity: 0;
    pointer-events: auto;
    touch-action: none;
    overscroll-behavior: none;
    user-select: none;
    -webkit-user-select: none;
    transition: opacity .16s ease;
}

.file-creation-json-loading[hidden] {
    display: none !important;
}

.file-creation-json-loading.is-visible {
    opacity: 1;
}

.file-creation-loading-card {
    width: min(320px, 88vw);
    padding: 22px 18px 18px;
    contain: layout paint style;
    border: 1px solid rgba(112, 162, 255, .24);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(12, 28, 53, .99), rgba(6, 18, 37, .99));
    box-shadow: 0 18px 52px rgba(0, 0, 0, .38);
    text-align: center;
}

.creation-native-loader {
    position: relative;
    width: 92px;
    height: 92px;
    margin: 0 auto 13px;
}

.creation-native-ring {
    position: absolute;
    inset: 6px;
    border: 3px solid rgba(84, 145, 255, .18);
    border-top-color: #70a8ff;
    border-right-color: #45d7d0;
    border-radius: 50%;
    animation: creation-native-spin 1.05s linear infinite;
}

.creation-native-orbit {
    position: absolute;
    inset: 18px;
    border: 2px solid rgba(91, 206, 222, .17);
    border-left-color: #61d6d0;
    border-radius: 50%;
    animation: creation-native-spin-reverse 1.55s linear infinite;
}

.creation-native-core {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff 0 7%, #91c4ff 25%, #4384ef 58%, #173f86 100%);
    box-shadow: 0 0 0 7px rgba(63, 125, 237, .08), 0 0 30px rgba(77, 149, 255, .48);
    animation: creation-native-pulse 1.35s ease-in-out infinite;
}

.creation-native-dots::after {
    content: '';
    display: inline-block;
    width: 1.6em;
    text-align: left;
    animation: creation-native-dots 1.15s steps(4, end) infinite;
}

.file-creation-loading-card strong {
    display: block;
    font-size: 17px;
    letter-spacing: -.01em;
}

.file-creation-loading-card small {
    display: block;
    margin-top: 6px;
    color: #8fa6c7;
    font-size: 12px;
}

@keyframes creation-native-spin { to { transform: rotate(360deg); } }
@keyframes creation-native-spin-reverse { to { transform: rotate(-360deg); } }
@keyframes creation-native-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(.88); opacity: .8; }
    50% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}
@keyframes creation-native-dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75%, 100% { content: '...'; }
}

@media (max-width: 520px) {
    .file-create-drawer #create-file-formats {
        grid-template-columns: 1fr;
    }

    .file-create-drawer .history-panel {
        max-height: 82vh !important;
    }

    .creation-native-loader {
        width: 82px;
        height: 82px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .file-create-drawer.history-drawer,
    .file-creation-json-loading,
    .file-create-drawer .create-file-format {
        transition: none !important;
    }

    .creation-native-ring,
    .creation-native-orbit,
    .creation-native-core,
    .creation-native-dots::after {
        animation: none !important;
    }

    .creation-native-dots::after { content: '...'; }
}


.creation-plan-image-count {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0 10px;
    padding: 10px 12px;
    border: 1px solid rgba(77, 211, 199, .24);
    border-radius: 12px;
    background: rgba(27, 180, 165, .08);
    color: #b6d2dd;
    font-size: 13px;
}

.creation-plan-image-count > div {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.creation-plan-image-count button {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid rgba(103, 220, 207, .4);
    border-radius: 8px;
    background: rgba(6, 28, 47, .72);
    color: #6fe0d3;
    font: 700 18px/1 inherit;
    cursor: pointer;
}

.creation-plan-image-count button:active {
    transform: scale(.94);
    background: rgba(42, 202, 186, .22);
}

.creation-plan-image-count strong {
    min-width: 18px;
    color: #fff;
    text-align: center;
    font-size: 15px;
}


.creation-plan-presentation-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0 10px;
}

.creation-plan-presentation-options label {
    display: grid;
    gap: 6px;
    color: #b6d2dd;
    font-size: 12px;
}

.creation-plan-presentation-options select {
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid rgba(77, 211, 199, .3);
    border-radius: 10px;
    outline: none;
    background: rgba(6, 28, 47, .72);
    color: #fff;
    font: 700 14px/1 inherit;
}

.creation-plan-presentation-options select:focus {
    border-color: rgba(103, 220, 207, .72);
    box-shadow: 0 0 0 3px rgba(42, 202, 186, .12);
}

/* Legacy chat helpers may append this control after the presentation card has rendered. */
.creation-plan-card .creation-inline-settings {
    display: none !important;
}
