.wpiu-wrap {
    max-width: 720px;
    margin: 1.5em auto;
    padding: 1.5em;
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    color: #1d2327;
}

.wpiu-form .wpiu-field {
    margin-bottom: 1.2em;
}

.wpiu-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4em;
}

.wpiu-form small {
    display: block;
    color: #646970;
    margin-top: 0.3em;
    font-size: 0.85em;
}

.wpiu-dropzone {
    display: block;
    position: relative;
    border: 2px dashed #c3c4c7;
    border-radius: 8px;
    background: #f6f7f7;
    padding: 1.8em 1em;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.wpiu-dropzone:hover,
.wpiu-dropzone:focus-within {
    border-color: #2271b1;
    background: #f0f6fc;
}

.wpiu-dropzone.wpiu-dragging {
    border-color: #2271b1;
    background: #e8f3ff;
    transform: scale(1.01);
}

.wpiu-dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
    pointer-events: none;
}

.wpiu-dropzone-icon {
    color: #2271b1;
    opacity: 0.7;
}

.wpiu-dropzone-hint {
    margin: 0;
    text-align: center;
    line-height: 1.4;
}

.wpiu-dropzone-hint strong {
    display: block;
    font-size: 1.05em;
    color: #1d2327;
}

.wpiu-dropzone-hint span {
    display: block;
    font-size: 0.85em;
    color: #646970;
    font-weight: 400;
}

.wpiu-file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.wpiu-previews {
    margin: 1em 0;
}

.wpiu-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.8em;
}

.wpiu-preview-item {
    display: flex;
    flex-direction: column;
    gap: 0.35em;
    padding: 0.5em;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.wpiu-preview-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 4px;
    background: #f6f7f7;
}

.wpiu-preview-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1em;
    font-size: 0.75em;
    color: #50575e;
    overflow: hidden;
}

.wpiu-preview-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    color: #1d2327;
}

.wpiu-preview-size {
    color: #646970;
}

input[type="range"]#wpiu-maxwidth {
    width: 100%;
}

.wpiu-actions {
    text-align: center;
    margin-top: 1em;
}

.wpiu-button,
.wpiu-form button.wpiu-submit {
    display: inline-block;
    padding: 0.7em 1.6em;
    background: #2271b1;
    color: #fff;
    border: 0;
    border-radius: 4px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease;
}

.wpiu-button:hover,
.wpiu-form button.wpiu-submit:hover {
    background: #135e96;
}

.wpiu-progress {
    margin-top: 1.2em;
    text-align: center;
}

.wpiu-progress-bar {
    height: 10px;
    background: #e2e4e7;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.6em;
}

.wpiu-progress-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #2271b1, #72aee6);
    width: 0%;
    transition: width 0.2s ease;
}

.wpiu-errors {
    padding: 0.8em 1em;
    background: #fcf0f1;
    border-left: 4px solid #d63638;
    margin-bottom: 1em;
    border-radius: 4px;
}

.wpiu-errors ul {
    margin: 0;
    padding-left: 1.2em;
}

.wpiu-results .wpiu-uploaded-item {
    display: flex;
    gap: 1em;
    padding: 1em 0;
    border-bottom: 1px solid #f0f0f1;
}

.wpiu-results .wpiu-uploaded-item:last-child {
    border-bottom: 0;
}

.wpiu-uploaded-thumb {
    flex: 0 0 120px;
    text-align: center;
}

.wpiu-uploaded-thumb img {
    max-width: 110px;
    max-height: 110px;
    border: 1px solid #ddd;
    padding: 3px;
    background: #fff;
}

.wpiu-dimensions {
    margin: 0.4em 0 0;
    font-size: 0.85em;
    color: #646970;
}

.wpiu-uploaded-codes {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.wpiu-uploaded-codes label {
    display: block;
    font-size: 0.85em;
    font-weight: 600;
    color: #50575e;
}

.wpiu-code-label {
    display: block;
    margin-bottom: 0.2em;
}

.wpiu-code-row {
    display: flex;
    gap: 0.4em;
    align-items: stretch;
}

.wpiu-uploaded-codes input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.4em 0.6em;
    font-family: monospace;
    font-size: 0.9em;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    background: #f6f7f7;
}

.wpiu-copy {
    flex: 0 0 auto;
    padding: 0.4em 0.9em;
    background: #f6f7f7;
    color: #1d2327;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.wpiu-copy:hover,
.wpiu-copy:focus-visible {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
    outline: none;
}

.wpiu-copy.wpiu-copy-ok {
    background: #00a32a;
    border-color: #00a32a;
    color: #fff;
}

.wpiu-copy.wpiu-copy-err {
    background: #d63638;
    border-color: #d63638;
    color: #fff;
}

.wpiu-filesize {
    color: #50575e;
    font-weight: 400;
}

.wpiu-login-required {
    text-align: center;
}

.wpiu-results-container:empty {
    display: none;
}

.wpiu-results-container {
    margin-top: 1em;
}
