#iid-wrapper {
    max-width: 820px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Cookie warning */
.iid-cookie-warning {
    background: #fff3e0;
    border: 1px solid #ffcc02;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13px;
    color: #e65100;
    margin-bottom: 16px;
}
.iid-cookie-warning a { color: #bf360c; font-weight: 600; }

/* Header */
.iid-header { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.iid-logo {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.iid-logo svg { width: 28px; height: 28px; stroke: white; }
.iid-header h2 { margin: 0 0 4px; font-size: 22px; font-weight: 700; color: #1a1a2e; }
.iid-header p { margin: 0; font-size: 14px; color: #666; }

/* Input */
.iid-input-box { background: #f8f9ff; border: 2px solid #e8eaf0; border-radius: 16px; padding: 20px; margin-bottom: 20px; }
.iid-input-row { display: flex; gap: 8px; flex-wrap: wrap; }
#iid-url {
    flex: 1; min-width: 200px;
    padding: 12px 16px; border: 2px solid #dde1f0; border-radius: 10px;
    font-size: 14px; outline: none; transition: border-color 0.2s; background: white; color: #1a1a2e;
}
#iid-url:focus { border-color: #dc2743; }

#iid-fetch-btn {
    padding: 12px 22px;
    background: linear-gradient(135deg, #dc2743, #cc2366);
    color: white; border: none; border-radius: 10px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    transition: opacity 0.2s, transform 0.1s; white-space: nowrap;
}
#iid-fetch-btn:hover { opacity: 0.9; }
#iid-fetch-btn:active { transform: scale(0.98); }
#iid-fetch-btn:disabled { opacity: 0.6; cursor: not-allowed; }

#iid-paste-btn {
    padding: 10px 14px; background: white; border: 2px solid #dde1f0;
    border-radius: 10px; font-size: 13px; cursor: pointer; color: #555;
    transition: border-color 0.2s; white-space: nowrap;
}
#iid-paste-btn:hover { border-color: #dc2743; color: #dc2743; }
.iid-hint { margin: 10px 0 0; font-size: 12px; color: #999; }

/* Spinner */
.spin { animation: iid-spin 0.8s linear infinite; }
@keyframes iid-spin { to { transform: rotate(360deg); } }

/* Message */
#iid-message { padding: 12px 18px; border-radius: 12px; font-size: 14px; margin-bottom: 16px; }
#iid-message.success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
#iid-message.error { background: #fdecea; color: #c62828; border: 1px solid #ef9a9a; }

/* Badge */
.iid-badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 20px; background: #e8f5e9; color: #2e7d32; margin-left: 6px; }
.iid-badge-warn { background: #fff3e0; color: #e65100; }

/* Results */
.iid-results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
#iid-count-label { font-size: 14px; font-weight: 600; color: #444; }
#iid-download-all {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; background: #1a1a2e; color: white;
    border: none; border-radius: 8px; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: opacity 0.2s;
}
#iid-download-all:hover { opacity: 0.85; }
#iid-download-all:disabled { opacity: 0.5; }

/* Grid */
#iid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }

.iid-card {
    background: white; border: 1px solid #eee; border-radius: 12px;
    overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s; position: relative;
}
.iid-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }

.iid-card-num {
    position: absolute; top: 8px; left: 8px;
    background: rgba(0,0,0,0.55); color: white;
    font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 10px;
}

.iid-card-img { width: 100%; height: 190px; object-fit: cover; display: block; background: #f0f0f0; }

.iid-img-error {
    height: 160px; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    font-size: 12px; color: #999; text-align: center;
    background: #f9f9f9; padding: 12px;
}

.iid-card-video-placeholder {
    width: 100%; height: 190px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: white; gap: 8px; font-size: 13px;
}
.iid-card-video-placeholder svg { width: 38px; height: 38px; opacity: 0.8; }

.iid-card-footer { padding: 10px 10px; display: flex; gap: 7px; }
.iid-btn-download, .iid-btn-open {
    flex: 1; padding: 7px 0; border: none; border-radius: 7px;
    font-size: 12px; font-weight: 600; cursor: pointer;
    text-align: center; text-decoration: none; transition: opacity 0.2s;
}
.iid-btn-download { background: linear-gradient(135deg, #dc2743, #cc2366); color: white; }
.iid-btn-open { background: #f0f0f5; color: #444; display: flex; align-items: center; justify-content: center; }
.iid-btn-download:hover, .iid-btn-open:hover { opacity: 0.8; }

/* Alternatives */
#iid-alternatives { margin-top: 16px; padding: 16px 20px; background: #fff8e1; border: 1px solid #ffe082; border-radius: 12px; }
.iid-alt-title { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: #5d4037; }
.iid-alt-links { display: flex; gap: 10px; flex-wrap: wrap; }
.iid-alt-links a {
    padding: 6px 14px; background: white; border: 1px solid #ffcc02;
    border-radius: 20px; font-size: 13px; font-weight: 600; color: #e65100; text-decoration: none;
}
.iid-alt-links a:hover { background: #fff3e0; }

@media (max-width: 540px) {
    .iid-input-row { flex-direction: column; }
    #iid-grid { grid-template-columns: 1fr 1fr; }
    .iid-header h2 { font-size: 18px; }
}
