

.hosted-image-dropzone {
    position: relative;
    overflow: hidden;
    margin: 24px 0 16px;
    padding: 32px 28px;
    border: 2px dashed rgb(var(--purple-rgb) / .32);
    border-radius: var(--r-xl);
    background: linear-gradient(160deg, rgb(25 20 38 / .85), rgb(16 13 25 / .92));
    box-shadow: var(--sh-sm), inset 0 1px 0 rgb(255 255 255 / .05);
    cursor: pointer;
    outline: none;
    transition: border-color var(--t), box-shadow var(--t), transform var(--t), background var(--t);
    user-select: none;
}

.hosted-image-dropzone:hover,
.hosted-image-dropzone:focus-visible {
    border-color: rgb(var(--purple-rgb) / .7);
    background: linear-gradient(160deg, rgb(30 23 46 / .9), rgb(18 14 30 / .95));
    box-shadow: 0 12px 36px rgb(var(--accent-rgb) / .18), 0 0 0 2px rgb(var(--purple-rgb) / .15);
    transform: translateY(-1px);
}

.hosted-image-dropzone.is-dragover {
    border-color: var(--purple);
    border-style: solid;
    background: linear-gradient(160deg, rgb(38 27 64 / .98), rgb(24 17 42 / .98));
    box-shadow: 0 0 0 4px rgb(var(--purple-rgb) / .35), 0 22px 60px rgb(var(--accent-rgb) / .4);
    transform: scale(1.008);
}

.hosted-image-dropzone.is-uploading {
    pointer-events: none;
    opacity: 0.9;
    border-style: solid;
    border-color: rgb(var(--accent-rgb) / .5);
}

.hosted-image-dropzone.is-uploading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--purple), var(--accent), transparent);
    background-size: 200% 100%;
    animation: dropzone-progress 1.5s linear infinite;
}

@keyframes dropzone-progress {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes dropzone-flash {
    0% { box-shadow: 0 0 0 0 rgb(var(--good-rgb) / .8); }
    50% { box-shadow: 0 0 0 10px rgb(var(--good-rgb) / .25); }
    100% { box-shadow: var(--sh-sm); }
}

.hosted-image-dropzone.dropzone-flash {
    animation: dropzone-flash 0.9s cubic-bezier(.22, 1, .36, 1);
}

.hosted-image-dropzone.is-disabled {
    cursor: not-allowed;
    opacity: 0.6;
    border-color: var(--line);
}

.dropzone-ambient-glow {
    position: absolute;
    top: -50%;
    left: -20%;
    width: 140%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgb(var(--accent-rgb) / .08), transparent 60%);
    pointer-events: none;
    transition: opacity var(--t);
}

.hosted-image-dropzone:hover .dropzone-ambient-glow,
.hosted-image-dropzone.is-dragover .dropzone-ambient-glow {
    opacity: 1;
    background: radial-gradient(circle at 30% 30%, rgb(var(--accent-rgb) / .16), transparent 60%);
}

.dropzone-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 24px;
}

.dropzone-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    border-radius: var(--r-lg);
    background: linear-gradient(135deg, rgb(var(--accent-rgb) / .2), rgb(var(--purple-rgb) / .08));
    border: 1px solid rgb(var(--purple-rgb) / .25);
    color: var(--purple);
    flex-shrink: 0;
    transition: transform var(--t) var(--ease-spring), color var(--t);
}

.hosted-image-dropzone:hover .dropzone-icon-wrap {
    transform: scale(1.06);
    color: #fff;
    border-color: rgb(var(--purple-rgb) / .5);
}

.dropzone-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dropzone-lead {
    font-size: 1.15rem;
    color: var(--text);
}

.dropzone-lead strong {
    color: #fff;
    font-weight: 600;
}

.dropzone-browse-link {
    color: var(--purple);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 500;
}

.dropzone-sub {
    margin: 0;
    font-size: 0.92rem;
    color: var(--muted);
}

.dropzone-kbd {
    display: inline-block;
    padding: 2px 7px;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--purple);
    background: var(--surface-3);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    box-shadow: 0 1px 0 rgb(0 0 0 / .4);
    vertical-align: middle;
}

.dropzone-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.dropzone-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 0.78rem;
    color: var(--muted);
    background: rgb(var(--purple-rgb) / .06);
    border: 1px solid var(--line);
    border-radius: var(--r-full);
}

.dropzone-tag-highlight {
    color: var(--purple);
    background: rgb(var(--accent-rgb) / .14);
    border-color: rgb(var(--purple-rgb) / .3);
    font-weight: 500;
}

.dropzone-actions {
    flex-shrink: 0;
}

.dropzone-drag-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(16 13 25 / .88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-fast) var(--ease-out);
}

.hosted-image-dropzone.is-dragover .dropzone-drag-overlay {
    opacity: 1;
    pointer-events: auto;
}

.dropzone-drag-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 32px;
    border-radius: var(--r-lg);
    background: linear-gradient(135deg, rgb(var(--accent-rgb) / .28), rgb(35 24 60 / .9));
    border: 1px solid rgb(var(--purple-rgb) / .4);
    box-shadow: 0 12px 40px rgb(0 0 0 / .5);
    text-align: center;
    transform: scale(0.95);
    transition: transform var(--t) var(--ease-spring);
}

.hosted-image-dropzone.is-dragover .dropzone-drag-card {
    transform: scale(1);
}

.dropzone-drag-symbol {
    font-size: 2rem;
    animation: dropzone-pulse 1s ease-in-out infinite alternate;
}

@keyframes dropzone-pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.18); }
}

.dropzone-drag-card strong {
    font-size: 1.15rem;
    color: #fff;
}

.dropzone-drag-card small {
    color: var(--purple);
    font-size: 0.88rem;
}

.hosted-image-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 16px 0 14px;
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--grad-surface);
}

.hosted-image-toolbar p,
.hosted-image-empty {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.hosted-image-quick-tip {
    font-size: 0.88rem;
    color: var(--muted);
}

.hosted-image-quick-tip kbd {
    padding: 1px 5px;
    font-size: 0.75rem;
}

.hosted-image-pick {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 18px;
    font-weight: 600;
}

.hosted-image-status {
    min-height: 0;
    margin: 10px 0 18px;
    transition: all var(--t);
}

.hosted-image-status:not(:empty) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 18px;
    border-radius: var(--r-md);
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.95rem;
    box-shadow: var(--sh-sm);
    animation: fadeIn 0.2s ease-out;
}

.hosted-image-status.success {
    border-color: rgb(var(--good-rgb) / .35);
    background: linear-gradient(135deg, rgb(var(--good-rgb) / .12), rgb(16 13 25 / .9));
    color: #d1fae5;
}

.hosted-image-status.error {
    border-color: rgb(var(--bad-rgb) / .35);
    background: linear-gradient(135deg, rgb(var(--bad-rgb) / .12), rgb(16 13 25 / .9));
    color: var(--bad);
}

.hosted-status-copy {
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: 0.82rem;
    border-radius: var(--r-sm);
}

.hosted-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 16px;
}

.hosted-image-card {
    display: grid;
    gap: 12px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--grad-surface);
    transition: transform var(--t), border-color var(--t), box-shadow var(--t);
}

.hosted-image-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--sh-md);
    transform: translateY(-2px);
}

.hosted-image-preview {
    width: 100%;
    height: 190px;
    border-radius: var(--r-md);
    background: var(--surface-2);
    object-fit: contain;
    border: 1px solid var(--line);
}

.hosted-image-details {
    display: grid;
    gap: 4px;
    overflow-wrap: anywhere;
}

.hosted-image-details small {
    color: var(--muted);
}

.hosted-image-url {
    width: 100%;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    color: var(--text);
    background: var(--surface);
    font-size: 0.88rem;
    cursor: text;
}

.hosted-image-url:focus {
    border-color: var(--purple);
    outline: none;
    box-shadow: 0 0 0 2px rgb(var(--purple-rgb) / .25);
}

.hosted-image-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hosted-image-actions > * {
    flex: 1;
}

@media (max-width: 680px) {
    .dropzone-content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .dropzone-icon-wrap {
        margin: 0 auto;
    }
    .dropzone-specs {
        justify-content: center;
    }
    .dropzone-actions {
        display: flex;
        justify-content: center;
    }
    .hosted-image-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .hosted-image-status:not(:empty) {
        flex-direction: column;
        align-items: stretch;
    }
}
