:root {
    --its-primary: #0284c7;
    --its-primary-hover: #0369a1;
    --its-success: #10b981;
    --its-success-hover: #059669;
    --its-danger: #ef4444;
    --its-slate-50: #f8fafc;
    --its-slate-100: #f1f5f9;
    --its-slate-200: #e2e8f0;
    --its-slate-600: #475569;
    --its-slate-800: #1e293b;
    --its-radius: 8px;
}

.its-wrapper {
    max-width: 880px;
    margin: 30px auto 100px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--its-slate-800);
}

.its-card {
    background: #ffffff;
    border: 1px solid var(--its-slate-200);
    border-radius: var(--its-radius);
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.its-ad-slot-wrap {
    min-height: 20px;
    margin: 20px 0;
}

/* Dropzone */
.its-dropzone {
    border: 2px dashed #38bdf8;
    border-radius: var(--its-radius);
    background: #f0f9ff;
    padding: 35px 20px;
    text-align: center;
    cursor: pointer;
}

.its-dropzone:hover { background: #e0f2fe; }

.its-dropzone-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px 0;
}

.its-dropzone-subtitle {
    font-size: 14px;
    color: var(--its-slate-600);
    margin: 0 0 14px 0;
}

.its-security-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #0369a1;
    background: #e0f2fe;
    padding: 4px 12px;
    border-radius: 9999px;
    margin-bottom: 16px;
}

.its-file-input { display: none; }

/* Base64 Dedicated Area */
.its-base64-workspace {
    width: 100%;
}

.its-label-block {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--its-slate-800);
    margin-bottom: 8px;
}

.its-textarea {
    width: 100%;
    min-height: 160px;
    padding: 12px 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    color: var(--its-slate-800);
    background: #ffffff;
    border: 1px solid var(--its-slate-200);
    border-radius: 6px;
    box-sizing: border-box;
    resize: vertical;
    outline: none;
    line-height: 1.4;
}

.its-textarea:focus {
    border-color: var(--its-primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.its-base64-bar {
    margin-top: 14px;
    display: flex;
    justify-content: flex-start;
}

.its-button-cluster {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.its-error-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 10px;
}

/* Button Foundation */
.its-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 22px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
    box-sizing: border-box;
}

.its-btn-primary { background: var(--its-primary); color: #ffffff; border: none; }
.its-btn-primary:hover { background: var(--its-primary-hover); }

.its-btn-secondary {
    background: #ffffff;
    color: var(--its-slate-600);
    border: 1px solid var(--its-slate-200);
}
.its-btn-secondary:hover { background: #fee2e2; color: var(--its-danger); border-color: #fca5a5; }

.its-btn-accent { background: #2563eb; color: #ffffff; border: none; }
.its-btn-accent:hover { background: #1d4ed8; }

.its-btn-success { background: var(--its-success); color: #ffffff; border: none; }
.its-btn-success:hover { background: var(--its-success-hover); }

/* Options Bar */
.its-options-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding: 14px 18px;
    background: var(--its-slate-50);
    border: 1px solid var(--its-slate-200);
    border-radius: 8px;
}

.its-option-item { display: flex; align-items: center; gap: 10px; }
.its-label { font-size: 13px; font-weight: 600; color: var(--its-slate-600); }
.its-slider { accent-color: var(--its-primary); cursor: pointer; }
.its-input-inline { display: flex; align-items: center; gap: 8px; }
.its-input { width: 80px; padding: 6px 8px; border: 1px solid var(--its-slate-200); border-radius: 5px; font-size: 13px; }

/* Queue Output Item */
.its-queue { margin-top: 20px; display: flex; flex-direction: column; gap: 16px; }

.its-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--its-slate-50);
    border: 1px solid var(--its-slate-200);
    border-radius: 8px;
    padding: 14px 18px;
    gap: 16px;
}

.its-item-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    overflow: hidden;
}

.its-thumbnail {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    object-fit: cover;
    background: #ffffff;
    border: 1px solid var(--its-slate-200);
    flex-shrink: 0;
}

.its-meta-info { overflow: hidden; }
.its-filename {
    font-size: 14px;
    font-weight: 600;
    color: var(--its-slate-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}
.its-filesize { font-size: 12px; color: var(--its-slate-600); margin-top: 3px; }

.its-btn-download {
    background: #10b981 !important;
    color: #ffffff !important;
    padding: 8px 20px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    border: none !important;
    flex-shrink: 0;
    display: inline-block;
}
.its-btn-download:hover { background: #059669 !important; }

/* Action Footer */
.its-action-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--its-slate-200);
    gap: 16px;
}
.its-action-buttons { display: flex; align-items: center; gap: 12px; }

@media (max-width: 640px) {
    .its-item { flex-direction: column; align-items: stretch; }
    .its-btn-download { text-align: center; }
    .its-action-footer { flex-direction: column-reverse; align-items: stretch; }
    .its-action-buttons { flex-direction: column; width: 100%; }
    .its-action-buttons .its-btn, .its-action-footer #itsResetBtn { width: 100%; }
    .its-button-cluster { width: 100%; }
    .its-button-cluster button { flex: 1; text-align: center; }
}