.asd-widget {
    --asd-grad-start: #22d3ee;
    --asd-grad-end: #8b5cf6;
    --asd-ink: #0f172a;
    --asd-ink-soft: #334155;
    --asd-border: #e6e9f0;
    --asd-muted: #64748b;
    --asd-bg: #ffffff;
    --asd-panel: #f8fafc;
    --asd-radius-lg: 20px;
    --asd-radius-md: 14px;
    --asd-radius-sm: 10px;
    --asd-shadow: 0 10px 30px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.04);
    max-width: 680px;
    margin: 0 auto;
    font-family: inherit;
    box-sizing: border-box;
}

.asd-widget *,
.asd-widget *::before,
.asd-widget *::after {
    box-sizing: inherit;
}

.asd-widget img,
.asd-widget video {
    max-width: 100%;
}

/* ---------- admin notice ---------- */

.asd-admin-notice {
    background: #fff8e5;
    border: 1px solid #f0d999;
    color: #6b5300;
    padding: 10px 14px;
    border-radius: var(--asd-radius-sm);
    font-size: 14px;
    margin-bottom: 14px;
}

.asd-admin-notice a {
    color: inherit;
    text-decoration: underline;
}

/* ---------- input ---------- */

.asd-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--asd-bg);
    border: 1px solid var(--asd-border);
    border-radius: 999px;
    padding: 6px 6px 6px 18px;
    box-shadow: var(--asd-shadow);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.asd-input-row:focus-within {
    border-color: transparent;
    box-shadow: 0 0 0 2px var(--asd-grad-start), var(--asd-shadow);
}

.asd-link-icon {
    flex: 0 0 auto;
    display: flex;
    color: var(--asd-muted);
}

.asd-link-icon svg {
    width: 18px;
    height: 18px;
}

.asd-input {
    flex: 1 1 auto;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    padding: 12px 4px;
    color: var(--asd-ink);
    min-width: 0;
}

.asd-input::placeholder {
    color: #94a3b8;
}

.asd-paste-btn {
    flex: 0 0 auto;
    border: 1px solid var(--asd-border);
    background: var(--asd-panel);
    color: var(--asd-ink-soft);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.asd-paste-btn:hover {
    background: #eef2f7;
}

.asd-submit {
    flex: 0 0 auto;
    border: none;
    cursor: pointer;
    border-radius: 999px;
    padding: 13px 24px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--asd-grad-start), var(--asd-grad-end));
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.35);
    transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.asd-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(139, 92, 246, 0.42);
}

.asd-submit:active:not(:disabled) {
    transform: translateY(0);
}

.asd-submit:disabled {
    opacity: 0.7;
    cursor: default;
    box-shadow: none;
}

.asd-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    animation: asd-spin 0.7s linear infinite;
    flex: 0 0 auto;
}

.asd-widget.is-loading .asd-spinner {
    display: inline-block;
}

@keyframes asd-spin {
    to { transform: rotate(360deg); }
}

.asd-hint {
    margin: 22px 6px 0;
    font-size: 13px;
    color: var(--asd-muted);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.asd-hint .asd-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--asd-panel);
    border: 1px solid var(--asd-border);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--asd-ink-soft);
}

/* ---------- status / error ---------- */

.asd-status {
    margin-top: 16px;
}

.asd-status:empty {
    margin-top: 0;
}

.asd-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--asd-radius-md);
    font-size: 14px;
    line-height: 1.5;
    animation: asd-fade-in 0.25s ease;
}

.asd-alert-icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    margin-top: 1px;
}

.asd-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.asd-alert-error .asd-alert-icon {
    background: #ef4444;
    color: #fff;
}

/* ---------- skeleton loading ---------- */

.asd-skeleton {
    margin-top: 18px;
    border: 1px solid var(--asd-border);
    border-radius: var(--asd-radius-lg);
    overflow: hidden;
    background: var(--asd-bg);
    box-shadow: var(--asd-shadow);
    animation: asd-fade-in 0.2s ease;
}

.asd-skeleton-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(100deg, #eef1f6 30%, #f8fafc 45%, #eef1f6 60%);
    background-size: 200% 100%;
    animation: asd-shimmer 1.3s ease-in-out infinite;
}

.asd-skeleton-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.asd-skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(100deg, #eef1f6 30%, #f8fafc 45%, #eef1f6 60%);
    background-size: 200% 100%;
    animation: asd-shimmer 1.3s ease-in-out infinite;
}

.asd-skeleton-line.short {
    width: 40%;
}

.asd-skeleton-line.btn {
    height: 42px;
    border-radius: 999px;
    margin-top: 4px;
}

@keyframes asd-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes asd-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- results ---------- */

.asd-results {
    margin-top: 0;
}

.asd-result-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 18px 2px 10px;
    font-size: 13px;
    color: var(--asd-muted);
}

.asd-platform-badge {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.asd-result-meta-row .asd-type {
    text-transform: capitalize;
    font-weight: 600;
    color: var(--asd-ink-soft);
}

.asd-cached-chip {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    color: #15803d;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 2px 8px;
    border-radius: 999px;
}

/* hero card: single media result */

.asd-hero-card {
    border: 1px solid var(--asd-border);
    border-radius: var(--asd-radius-lg);
    overflow: hidden;
    background: var(--asd-bg);
    box-shadow: var(--asd-shadow);
    animation: asd-fade-in 0.3s ease;
}

.asd-hero-media {
    position: relative;
    width: 100%;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 480px;
    overflow: hidden;
}

.asd-hero-media img,
.asd-hero-media video {
    width: 100%;
    max-height: 480px;
    object-fit: contain;
    display: block;
    background: #0f172a;
}

.asd-hero-body {
    padding: 16px 18px 18px;
}

.asd-hero-title {
    font-size: 15px;
    color: var(--asd-ink);
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.asd-quality-picker {
    margin: 0 0 12px;
}

.asd-quality-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--asd-ink-soft);
}

.asd-quality-select {
    flex: 1 1 auto;
    max-width: 60%;
    padding: 9px 12px;
    border-radius: var(--asd-radius-sm);
    border: 1px solid var(--asd-border);
    background: var(--asd-panel);
    color: var(--asd-ink);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.asd-quality-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--asd-grad-start);
}

.asd-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    padding: 13px 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--asd-grad-start), var(--asd-grad-end));
    color: #fff !important;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none !important;
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.32);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.asd-download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(139, 92, 246, 0.4);
}

.asd-download-btn svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.asd-hero-body .asd-download-btn {
    width: 100%;
}

/* multi-item gallery */

.asd-gallery-note {
    margin: 0 2px 10px;
    font-size: 13px;
    color: var(--asd-muted);
}

.asd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.asd-card {
    border: 1px solid var(--asd-border);
    border-radius: var(--asd-radius-md);
    overflow: hidden;
    background: var(--asd-bg);
    display: flex;
    flex-direction: column;
    box-shadow: var(--asd-shadow);
    animation: asd-fade-in 0.3s ease;
}

.asd-card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #0f172a;
    overflow: hidden;
}

.asd-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.asd-play-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.18);
    pointer-events: none;
}

.asd-play-badge svg {
    width: 34px;
    height: 34px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.asd-card-body {
    padding: 8px 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.asd-card-type {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--asd-muted);
}

.asd-card .asd-download-btn {
    padding: 9px 10px;
    font-size: 12px;
}

.asd-empty {
    text-align: center;
    color: var(--asd-muted);
    font-size: 14px;
    padding: 30px 0;
}

/* account tabs */

.asd-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 18px 2px 14px;
}

.asd-tab {
    border: 1px solid var(--asd-border);
    background: var(--asd-bg);
    border-radius: 999px;
    padding: 7px 15px;
    font-size: 13px;
    font-weight: 600;
    color: var(--asd-ink);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.asd-tab:hover {
    background: var(--asd-panel);
}

.asd-tab.is-active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--asd-grad-start), var(--asd-grad-end));
}

.asd-tab-panel {
    display: none;
}

.asd-tab-panel.is-active {
    display: block;
    animation: asd-fade-in 0.25s ease;
}

/* responsive */

@media (max-width: 480px) {
    .asd-input-row {
        flex-wrap: wrap;
        border-radius: var(--asd-radius-md);
        padding: 10px;
    }

    .asd-input {
        width: 100%;
        order: 1;
        padding: 6px 4px;
    }

    .asd-link-icon {
        order: 0;
    }

    .asd-paste-btn {
        order: 2;
    }

    .asd-submit {
        order: 3;
        flex: 1 1 auto;
        justify-content: center;
    }
}
