.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.p2i-privacy,
.p2i-formats,
.p2i-limitations,
.p2i-jpeg-note,
.p2i-zip-hint {
    max-width: 42em;
    margin: 0 0 8px;
    color: var(--ut-brown-muted, #8B7355);
    font-size: 13px;
    line-height: 1.55;
    text-align: center;
    overflow-wrap: anywhere;
}

.p2i-drop {
    border: 1px dashed var(--ut-border, rgba(92, 74, 58, 0.24));
    border-radius: 12px;
    padding: 18px 16px;
    text-align: center;
    cursor: pointer;
    background: #fff;
}

.p2i-drop:focus,
.p2i-drop:focus-visible,
.p2i-field select:focus-visible,
.p2i-field input:focus-visible,
.p2i-page:focus-visible,
.ut-btn:focus-visible {
    outline: 3px solid #4f46e5;
    outline-offset: 2px;
}

.p2i-drop.is-over {
    border-color: #4f46e5;
    background: #eef2ff;
}

.p2i-summary,
.p2i-count {
    margin: 10px 0 0;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.p2i-thumbs {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 10px;
}

.p2i-page {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border: 2px solid var(--ut-border, rgba(92, 74, 58, 0.18));
    border-radius: 12px;
    background: #fff;
    min-width: 0;
    cursor: pointer;
    text-align: left;
}

.p2i-page.is-selected {
    border-color: #4f46e5;
    box-shadow: inset 0 0 0 1px #4f46e5;
}

.p2i-page.is-selected::after {
    content: '';
    display: block;
    height: 4px;
    border-radius: 2px;
    background: #4f46e5;
}

.p2i-thumb {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
}

.p2i-page-meta {
    font-size: 12px;
    overflow-wrap: anywhere;
    color: var(--ut-brown-muted, #8B7355);
}

.p2i-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.p2i-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.p2i-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    min-width: 0;
}

.p2i-field select,
.p2i-field input[type='text'] {
    min-height: 48px;
    width: 100%;
    max-width: 100%;
}

.p2i-radios {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.p2i-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
}

.p2i-radio input {
    width: 20px;
    height: 20px;
}

.p2i-check {
    width: 18px;
    height: 18px;
}

.ut-btn:disabled {
    opacity: 0.45;
}

.p2i-quality.is-hidden {
    display: none;
}

@media (prefers-color-scheme: dark) {
    .ut-tool-page { background: #0b1220; color: #e2e8f0; }
    .container.ut-page { background: #111827; border-color: #334155; }
    .p2i-drop, .p2i-page { background: #1e293b; color: #e2e8f0; }
    .p2i-thumb { background: #fff; }
}

html.fw-theme-dark .p2i-drop,
html.fw-theme-dark .p2i-page {
    background: var(--fw-surface-2, #1e293b);
    color: var(--fw-text, #f1f5f9);
}

html.fw-theme-dark .p2i-thumb {
    background: #fff;
}
