/**
 * Image to PDF.
 */

.em-i2p__head {
    display: flex;
    flex-wrap: wrap;
    gap: .8em;
    align-items: baseline;
    margin-bottom: .3em;
}

.em-i2p__count {
    margin: 0;
    font-size: 1.15rem;
    color: var(--em-ink, inherit);
}

.em-i2p__count:focus-visible { outline: 2px solid var(--em-brand, #2563eb); outline-offset: 3px; }

.em-i2p__add {
    margin-left: auto;
    padding: .45em 1em;
    border: 1px solid var(--em-brand, #2563eb);
    border-radius: 8px;
    background: transparent;
    color: var(--em-brand, #2563eb);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.em-i2p__howto {
    margin: 0 0 1em;
    font-size: .92rem;
    color: var(--em-soft, #6b7280);
}


/*
 * The picture is how you tell one IMG_2031 from another, so it earns room.
 *
 * The long selector is the theme's `img { height: auto }` being outranked.
 * With `auto` winning, every thumbnail keeps its own aspect and the rows come
 * out 77px, 103px, 77px — measured. A square crop keeps them even.
 */
.em-post-content .em-i2p .em-i2p__thumb {
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    border-radius: 6px;
    background: rgba(127, 127, 127, .15);
    object-fit: cover;
    cursor: grab;
}

.em-i2p__meta {
    flex: 1 1 auto;
    min-width: 0;
}

.em-i2p__filename {
    display: block;
    color: var(--em-ink, inherit);
    /* break-word, not anywhere: `anywhere` splits "photo-1.jpg" across two
       lines on a phone even when it would fit, because it is allowed to
       break before trying to use the space. */
    overflow-wrap: break-word;
}

.em-i2p__sub {
    display: block;
    font-size: .88rem;
    font-variant-numeric: tabular-nums;
    color: var(--em-soft, #6b7280);
}

.em-i2p__acts {
    display: flex;
    flex: 0 0 auto;
    gap: .3em;
}


/* ── Choices ───────────────────────────────────────────────────────────── */

.em-i2p__options {
    display: flex;
    flex-wrap: wrap;
    gap: .8em 1.4em;
    margin-top: 1.2em;
    padding: .85em 1em;
    border: 1px solid var(--em-line, #e5e7eb);
    border-radius: 10px;
    background: var(--em-surface, #fff);
}

.em-i2p__field {
    display: flex;
    align-items: center;
    gap: .6em;
    color: var(--em-ink, inherit);
}

.em-i2p__select,
.em-i2p__name {
    padding: .45em .65em;
    border: 1px solid var(--em-line, #e5e7eb);
    border-radius: 8px;
    background: var(--em-surface, #fff);
    color: var(--em-ink, inherit);
    font: inherit;
}

.em-i2p__name { width: 14em; }

.em-i2p__go {
    display: flex;
    flex-wrap: wrap;
    gap: .8em;
    align-items: center;
    margin-top: 1.1em;
}

.em-i2p__button {
    padding: .6em 1.3em;
    border: 1px solid var(--em-brand, #2563eb);
    border-radius: 8px;
    background: var(--em-brand, #2563eb);
    color: var(--em-on-brand, #fff);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.em-i2p__button:disabled { opacity: .5; cursor: default; }

.em-i2p__reset {
    padding: .6em 1em;
    border: 1px solid var(--em-line, #e5e7eb);
    border-radius: 8px;
    background: transparent;
    color: var(--em-soft, #6b7280);
    font: inherit;
    cursor: pointer;
}

/* ── What it has to say ────────────────────────────────────────────────── */

.em-i2p__status {
    margin: 1em 0 0;
    padding: .65em .9em;
    border-left: 3px solid var(--em-line, #e5e7eb);
    border-radius: 0 8px 8px 0;
    font-size: .92rem;
    line-height: 1.55;
    color: var(--em-ink, inherit);
}

.em-i2p__status.is-good { border-left-color: #16a34a; background: rgba(22, 163, 74, .10); }
.em-i2p__status.is-working { border-left-color: var(--em-brand, #2563eb); background: var(--em-tint, #f0f6ff); }

.em-i2p__problem:empty { display: none; }
.em-i2p__problem { margin-top: 1em; }

.em-i2p__promise { margin-top: 1.4em; }

@media (max-width: 560px) {
    .em-i2p__add { margin-left: 0; }
    .em-i2p__options { flex-direction: column; align-items: stretch; }
    .em-i2p__field { justify-content: space-between; }
    .em-i2p__go { flex-direction: column; align-items: stretch; }
    .em-i2p__name { width: 9em; }
    .em-post-content .em-i2p .em-i2p__thumb { width: 44px; height: 44px; }

    /* On a phone the row has about 150px for the name. Everything else gives
       ground so the filename and its size stay on one line each. */
    .em-i2p__item { gap: .55em; padding: .55em .6em; }
    .em-i2p__item::before { min-width: 1em; }
    .em-i2p__act { width: 1.85em; height: 1.85em; font-size: .95rem; }
    .em-i2p__acts { gap: .2em; }
    .em-i2p__sub { font-size: .8rem; }
}
