.pin-dl-wrap {
    max-width: 640px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ── Form ── */
.pin-dl-form {
    margin-bottom: 20px;
}

.pin-dl-input-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pin-dl-input-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
}

.pin-dl-link-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    pointer-events: none;
}

.pin-dl-input-wrap input {
    width: 100%;
    height: 50px;
    padding: 0 14px 0 42px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    background: #fff;
    color: #1a1a1a;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.pin-dl-input-wrap input:focus {
    border-color: #e60023;
}

.pin-dl-input-wrap input:disabled {
    opacity: 0.55;
}

#pin-dl-btn {
    height: 50px;
    padding: 0 28px;
    border: none;
    border-radius: 12px;
    background: #e60023;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: background 0.2s, opacity 0.2s;
}

#pin-dl-btn:hover {
    background: #c5001e;
}

#pin-dl-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#pin-dl-btn .pin-dl-spinner {
    display: none;
    animation: pin-dl-spin 1s linear infinite;
}

#pin-dl-btn.is-loading .pin-dl-spinner {
    display: inline-block;
}

#pin-dl-btn.is-loading .pin-dl-btn-icon,
#pin-dl-btn.is-loading .pin-dl-btn-text {
    display: none;
}

#pin-dl-btn.is-loading::after {
    content: "Fetching...";
    font-weight: 600;
}

@keyframes pin-dl-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.pin-dl-hint {
    text-align: center;
    font-size: 12px;
    color: #999;
    margin: 8px 0 0;
}

/* ── Error ── */
.pin-dl-error {
    background: #fef2f2;
    color: #b91c1c;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #fecaca;
    font-size: 14px;
    margin-bottom: 16px;
}

/* ── Results card ── */
.pin-dl-results {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* ── Preview ── */
.pin-dl-media-wrap {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-dl-media-wrap video,
.pin-dl-media-wrap img {
    max-width: 100%;
    max-height: 400px;
    display: block;
    object-fit: contain;
    margin: 0 auto;
}

/* ── Info ── */
.pin-dl-info {
    padding: 18px 20px 4px;
}

.pin-dl-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.pin-dl-title {
    font-size: 17px;
    font-weight: 600;
    margin: 0;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

.pin-dl-badges {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.pin-dl-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
}

.badge-video {
    background: rgba(59,130,246,0.1);
    color: #3b82f6;
    border: 1px solid rgba(59,130,246,0.25);
}

.badge-image {
    background: rgba(34,197,94,0.1);
    color: #16a34a;
    border: 1px solid rgba(34,197,94,0.25);
}

.pin-dl-desc {
    font-size: 13px;
    color: #666;
    margin: 6px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Sections ── */
.pin-dl-section {
    padding: 0 20px 18px;
}

.pin-dl-section-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
}

.pin-dl-count {
    font-size: 10px;
    background: #f3f4f6;
    padding: 1px 7px;
    border-radius: 10px;
    color: #888;
}

.pin-dl-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0 20px 18px;
}

/* ── Variant rows ── */
.pin-dl-variant-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pin-dl-variant-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    text-decoration: none;
    color: #1a1a1a;
    transition: border-color 0.15s, background 0.15s;
}

.pin-dl-variant-row:hover {
    border-color: #e60023;
    background: #fef2f2;
}

.pin-dl-variant-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pin-dl-variant-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-dl-variant-icon.is-video {
    background: rgba(59,130,246,0.08);
}

.pin-dl-variant-icon.is-image {
    background: rgba(34,197,94,0.08);
}

.pin-dl-variant-quality {
    font-size: 14px;
    font-weight: 500;
}

.pin-dl-dims {
    font-size: 12px;
    color: #999;
    margin-left: 8px;
}

.pin-dl-dl-icon {
    color: #bbb;
    transition: color 0.15s;
    flex-shrink: 0;
}

.pin-dl-variant-row:hover .pin-dl-dl-icon {
    color: #e60023;
/* ── Responsive ── */
@media (max-width: 480px) {
    .pin-dl-input-row {
        flex-direction: column;
    }
    #pin-dl-btn {
        width: 100%;
        justify-content: center;
    }
} 