/**
 * App Icon Generator.
 */

.em-ai__top {
    display: flex;
    flex-wrap: wrap;
    gap: 1.6em;
    align-items: flex-start;
}

/* ── The picture ───────────────────────────────────────────────────────── */

.em-ai__preview {
    flex: 0 0 auto;
    max-width: 100%;
}

/* The chequerboard shows see-through pixels for what they are — which is the
   whole point when Apple will reject them. */
.em-post-content .em-ai .em-ai__canvas {
    display: block;
    width: 192px;
    height: 192px;
    border: 1px solid var(--em-line, #e5e7eb);
    border-radius: 14px;
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #d7d7d7 25%, transparent 25%, transparent 75%, #d7d7d7 75%),
        linear-gradient(45deg, #d7d7d7 25%, transparent 25%, transparent 75%, #d7d7d7 75%);
    background-size: 16px 16px;
    background-position: 0 0, 8px 8px;
}

.em-ai__source {
    margin: .6em 0 0;
    max-width: 192px;
    font-size: .85rem;
    line-height: 1.45;
    color: var(--em-soft, #6b7280);
    overflow-wrap: anywhere;
}

/* ── The choices ───────────────────────────────────────────────────────── */

.em-ai__options {
    flex: 1 1 18em;
    min-width: 0;
}

.em-ai__group {
    margin: 0 0 1.1em;
    padding: .8em 1em;
    border: 1px solid var(--em-line, #e5e7eb);
    border-radius: 10px;
}

.em-ai__group legend {
    padding: 0 .4em;
    font-weight: 600;
    color: var(--em-ink, inherit);
}

.em-ai__check {
    display: inline-flex;
    align-items: center;
    gap: .45em;
    margin-right: 1.2em;
    color: var(--em-ink, inherit);
}

.em-ai__check input { accent-color: var(--em-brand, #2563eb); }

.em-ai__field {
    display: flex;
    align-items: center;
    gap: .7em;
    margin-bottom: .9em;
    color: var(--em-ink, inherit);
}

.em-ai__select,
.em-ai__colour {
    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-ai__colour { width: 3.4em; padding: .2em; }

.em-ai__field input[type="range"] { flex: 1 1 8em; accent-color: var(--em-brand, #2563eb); }

.em-ai__num {
    min-width: 3em;
    font-variant-numeric: tabular-nums;
    color: var(--em-brand, #2563eb);
}

/* The one thing people get rejected for, said before they find out. */
.em-ai__note {
    margin: 0;
    padding: .6em .85em;
    border-left: 3px solid #f59e0b;
    border-radius: 0 8px 8px 0;
    background: rgba(245, 158, 11, .10);
    font-size: .9rem;
    line-height: 1.5;
    color: var(--em-ink, inherit);
}

/* ── Doing it ──────────────────────────────────────────────────────────── */

.em-ai__go {
    display: flex;
    flex-wrap: wrap;
    gap: .8em;
    margin-top: 1.4em;
}

.em-ai__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-ai__button:disabled { opacity: .5; cursor: default; }

.em-ai__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;
}

.em-ai__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;
    color: var(--em-ink, inherit);
}

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

.em-ai__list { margin-top: 1.2em; }
.em-ai__list summary { cursor: pointer; font-weight: 600; color: var(--em-ink, inherit); }

.em-post-content .em-ai .em-ai__files {
    margin: .8em 0 0;
    padding: 0 0 0 1.1em;
    list-style: none;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .85rem;
    line-height: 1.75;
    color: var(--em-soft, #6b7280);
}

.em-ai__problem:empty { display: none; }
.em-ai__problem { margin-top: 1em; }
.em-ai__promise { margin-top: 1.4em; }

@media (max-width: 560px) {
    .em-ai__top { gap: 1.1em; }
    .em-post-content .em-ai .em-ai__canvas { width: 140px; height: 140px; }
    .em-ai__source { max-width: 140px; }
    .em-ai__go { flex-direction: column; }
    .em-ai__check { display: flex; margin: 0 0 .5em; }
}

/* ── What you will actually get ────────────────────────────────────────── */

.em-ai__sub {
    margin: .9em 0 .4em;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--em-soft, #6b7280);
}

.em-ai__sub:first-of-type { margin-top: 0; }

.em-ai__group .em-ai__check {
    display: flex;
    margin: 0 0 .45em;
    align-items: baseline;
}

.em-ai__check em {
    font-style: normal;
    font-size: .85rem;
    color: var(--em-soft, #6b7280);
}

/* The count answers "what happens if I press this" before it is pressed. */
.em-ai__tally {
    margin: 0 0 1em;
    font-size: .9rem;
    font-weight: 600;
    color: var(--em-brand, #2563eb);
}

.em-ai__tally.is-empty { color: var(--em-soft, #6b7280); font-weight: 400; }
