/* ============================================================
   Instant CV: /instant-cv (public page and form), the
   processing page and the review screen /instant-cv/{run}.
   Builds on the tokens in app.css; fills the width like every
   other page (owner rule).
   ============================================================ */

.icv-page { padding: 40px 0 72px; }
.icv-hero .ar-eyebrow { margin: 0 0 12px; }
.icv-hero h1 { margin: 0 0 20px; }
.icv-hero .ar-lead { max-width: 76ch; }
.icv-honest {
    margin: 24px 0 0;
    padding: 14px 18px;
    border-left: 3px solid var(--ar-accent);
    background: var(--ar-accent-soft);
    border-radius: 0 var(--ar-radius-sm) var(--ar-radius-sm) 0;
    color: var(--ar-body-strong);
    font-size: .9375rem;
    line-height: 1.55;
    max-width: 76ch;
}
.icv-recent { margin: 18px 0 0; color: var(--ar-body); }

/* ---------- The form ---------- */
.icv-formcard { margin-top: 40px; box-shadow: 0 1px 0 var(--ar-line), var(--ar-shadow-float); scroll-margin-top: calc(var(--ar-header-h) + 16px); }
.icv-formcard > h2 { margin-bottom: 20px; }
.icv-form fieldset { border: 0; padding: 0; margin: 0 0 28px; min-width: 0; }
.icv-form legend { font-weight: 700; color: var(--ar-ink); font-size: 1.0625rem; margin: 0 0 12px; padding: 0; float: none; width: auto; }
.icv-modes__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.icv-mode { display: block; cursor: pointer; margin: 0; }
.icv-mode input { position: absolute; opacity: 0; pointer-events: none; }
.icv-mode__body {
    display: flex; flex-direction: column; gap: 4px; height: 100%;
    padding: 16px 18px;
    border: 1px solid var(--ar-line); border-radius: var(--ar-radius);
    background: var(--ar-surface);
    transition: border-color var(--ar-dur) var(--ar-ease), background var(--ar-dur) var(--ar-ease);
}
.icv-mode__body strong { color: var(--ar-ink); font-size: 1rem; }
.icv-mode__body span { color: var(--ar-body); font-size: .9375rem; line-height: 1.45; }
.icv-mode input:checked + .icv-mode__body { border-color: var(--ar-accent); background: var(--ar-accent-soft); box-shadow: inset 0 0 0 1px var(--ar-accent); }
.icv-mode input:focus-visible + .icv-mode__body { outline: 2px solid var(--ar-accent); outline-offset: 2px; }

.icv-source { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.icv-pill {
    display: inline-flex; align-items: center; gap: 8px; margin: 0;
    padding: 10px 14px;
    border: 1px solid var(--ar-line); border-radius: var(--ar-radius-pill);
    font-weight: 600; font-size: .9375rem; color: var(--ar-body-strong);
    cursor: pointer; background: var(--ar-surface);
}
.icv-pill:has(input:checked) { border-color: var(--ar-accent); background: var(--ar-accent-soft); color: var(--ar-accent-ink); }
.icv-pill.is-empty { opacity: .55; cursor: not-allowed; }
.icv-pill input { margin: 0; accent-color: var(--ar-accent); }
.icv-opt { font-weight: 400; color: var(--ar-body); }
.icv-label { display: block; font-weight: 600; color: var(--ar-ink); margin-bottom: 8px; }

.icv-templates {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px;
    max-height: 520px; overflow-y: auto; padding: 4px; margin: 0 -4px 10px;
}
.icv-template { display: flex; flex-direction: column; gap: 4px; cursor: pointer; margin: 0; }
.icv-template input { position: absolute; opacity: 0; pointer-events: none; }
.icv-template__thumb {
    display: block; aspect-ratio: 210 / 297; overflow: hidden;
    border: 1px solid var(--ar-line); border-radius: var(--ar-radius-sm); background: var(--ar-surface-soft);
}
.icv-template__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.icv-template__name { font-weight: 600; color: var(--ar-ink); font-size: .875rem; line-height: 1.3; }
.icv-template__meta { color: var(--ar-body); font-size: .8125rem; }
.icv-template input:checked + .icv-template__thumb { border-color: var(--ar-accent); box-shadow: 0 0 0 3px var(--ar-accent); }
.icv-template input:focus-visible + .icv-template__thumb { outline: 2px solid var(--ar-ink); outline-offset: 3px; }

.icv-appearance { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; margin-top: 20px; align-items: start; }
.icv-swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.icv-swatch { margin: 0; cursor: pointer; display: inline-flex; }
.icv-swatch input { position: absolute; opacity: 0; pointer-events: none; }
.icv-swatch span { display: block; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--ar-surface); box-shadow: 0 0 0 1px var(--ar-line); }
.icv-swatch--auto span { width: auto; height: 32px; border-radius: var(--ar-radius-pill); padding: 0 12px; line-height: 28px; font-size: .8125rem; font-weight: 600; color: var(--ar-body-strong); background: var(--ar-surface); }
.icv-swatch input:checked + span { box-shadow: 0 0 0 2px var(--ar-ink); }
.icv-swatch input:focus-visible + span { outline: 2px solid var(--ar-accent); outline-offset: 3px; }

.icv-form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.icv-remaining { color: var(--ar-body); font-size: .9375rem; }
.icv-form .icv-gate { margin: 14px 0 0; color: var(--ar-body); line-height: 1.6; }
.icv-ai-off { margin-top: 14px; color: var(--ar-danger); }

/* ---------- Explainer sections ---------- */
.icv-section { margin-top: 64px; }
.icv-section > .ar-prose h2 { margin-top: 0; }
.icv-guards { list-style: none; counter-reset: guard; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.icv-guards li {
    counter-increment: guard;
    background: var(--ar-surface); border: 1px solid var(--ar-line); border-radius: var(--ar-radius);
    padding: 20px; color: var(--ar-body); line-height: 1.6; font-size: .9375rem;
}
.icv-guards li::before { content: counter(guard); display: block; font-weight: 800; font-size: 1.5rem; color: var(--ar-accent); margin-bottom: 6px; line-height: 1; }
.icv-guards strong { display: block; color: var(--ar-ink); font-size: 1rem; margin-bottom: 6px; }
.icv-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 24px 0 0; }
.icv-options > div { background: var(--ar-surface); border: 1px solid var(--ar-line); border-radius: var(--ar-radius); padding: 22px; }
.icv-options dt { font-weight: 700; color: var(--ar-ink); margin-bottom: 8px; }
.icv-options dd { margin: 0; color: var(--ar-body); line-height: 1.6; font-size: .9375rem; }

/* ---------- Processing ---------- */
.icv-processing { max-width: 880px; }
.icv-progress { list-style: none; margin: 32px 0; padding: 0; display: grid; gap: 14px; }
.icv-progress li { display: flex; align-items: center; gap: 14px; color: var(--ar-body); font-size: 1.0625rem; }
.icv-progress__dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ar-line); flex: none; background: var(--ar-surface); }
.icv-progress li.is-done { color: var(--ar-body-strong); }
.icv-progress li.is-done .icv-progress__dot { background: var(--ar-success); border-color: var(--ar-success); }
.icv-progress li.is-active { color: var(--ar-ink); font-weight: 600; }
.icv-progress li.is-active .icv-progress__dot { border-color: var(--ar-accent); border-top-color: transparent; animation: icv-spin .8s linear infinite; }
@keyframes icv-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .icv-progress li.is-active .icv-progress__dot { animation: none; background: var(--ar-accent); } }
/* A step that failed: the dot stops turning (a full ring, nothing is working) while the message and "Try again" show. */
.icv-processing.is-stalled .icv-progress li.is-active .icv-progress__dot { animation: none; border-top-color: var(--ar-accent); }

/* ---------- Review ---------- */
.icv-review { padding-bottom: 140px; }
.icv-review__head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: start; margin-bottom: 28px; }
.icv-review__head h1 { margin: 8px 0 0; }
.icv-verdict { margin: 16px 0 0; padding: 14px 18px; background: var(--ar-surface); border: 1px solid var(--ar-line); border-left: 4px solid var(--ar-success); border-radius: var(--ar-radius); color: var(--ar-ink); font-size: 1.125rem; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.icv-verdict--weak, .icv-verdict--partial { border-left-color: #D08A00; }
@media (max-width: 575.98px) { .icv-verdict { font-size: 1rem; padding: 12px 14px; } }
.icv-verdict + .icv-honest { margin-top: 14px; }
.icv-review__meta { margin: 14px 0 0; color: var(--ar-body); font-size: .9375rem; }
.icv-match { background: var(--ar-surface); border: 1px solid var(--ar-line); border-radius: var(--ar-radius); padding: 20px 22px; }
.icv-match__title { margin: 0 0 12px; font-weight: 700; color: var(--ar-ink); }
.icv-match__scores { display: flex; align-items: center; gap: 18px; }
.icv-match__scores span { display: block; color: var(--ar-body); font-size: .8125rem; text-transform: uppercase; letter-spacing: .04em; }
.icv-match__scores strong { font-size: 2.5rem; line-height: 1.1; color: var(--ar-ink); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.icv-match__after strong { color: var(--ar-success); }
.icv-match__arrow { font-size: 1.5rem; color: var(--ar-body); }
.icv-match__note { margin: 12px 0 0; color: var(--ar-body); font-size: .875rem; line-height: 1.5; }
/* The job-match figure while a tick is being saved (instant-cv.js): dimmed until the server's number arrives. */
[data-match-after] { transition: opacity var(--ar-dur) ease; }
[data-match-after].is-updating { opacity: .55; }

.icv-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 20px; padding: 14px 18px; background: var(--ar-surface); border: 1px solid var(--ar-line); border-radius: var(--ar-radius); }
.icv-counter { margin: 0; color: var(--ar-body-strong); }
.icv-counter strong { color: var(--ar-ink); font-variant-numeric: tabular-nums; }
.icv-toolbar__actions { display: flex; gap: 8px; }
.icv-toolbar__actions .ar-btn { padding: 8px 14px; font-size: .875rem; }

.icv-sec { margin: 0 0 28px; }
.icv-sec > h2 { font-size: 1.25rem; margin: 0 0 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.icv-locked { margin: 0 0 14px; color: var(--ar-body); font-size: .875rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.icv-lock { width: 10px; height: 9px; border-radius: 2px; background: var(--ar-body); position: relative; flex: none; margin-top: 3px; }
.icv-lock::before { content: ""; position: absolute; left: 1px; top: -6px; width: 8px; height: 8px; border: 2px solid var(--ar-body); border-bottom: 0; border-radius: 4px 4px 0 0; box-sizing: border-box; }
.icv-plain { margin: 0; color: var(--ar-body); line-height: 1.6; background: var(--ar-surface); border: 1px solid var(--ar-line-soft); border-radius: var(--ar-radius-sm); padding: 14px 16px; }

.icv-chip { display: inline-block; padding: 3px 10px; border-radius: var(--ar-radius-pill); font-size: .75rem; font-weight: 700; letter-spacing: .01em; line-height: 1.5; white-space: nowrap; }
.icv-chip--changed { background: var(--ar-success-soft); color: #0F6B33; }
.icv-chip--reverted { background: var(--ar-danger-soft); color: var(--ar-danger); }
.icv-chip--same { background: var(--ar-line-soft); color: var(--ar-body-strong); }
.icv-change--undone .icv-chip--changed { background: var(--ar-line-soft); color: var(--ar-body-strong); }

.icv-change { background: var(--ar-surface); border: 1px solid var(--ar-line); border-radius: var(--ar-radius); padding: 16px 18px; margin: 0 0 12px; }
.icv-change--reverted { border-left: 3px solid var(--ar-danger); }
.icv-change--kept { border-left: 3px solid var(--ar-success); }
.icv-change--undone { border-left: 3px solid var(--ar-line); }
.icv-change__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.icv-change__kind { font-weight: 700; color: var(--ar-ink); font-size: .9375rem; }
.icv-change__cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.icv-change__col { border-radius: var(--ar-radius-sm); padding: 12px 14px; background: var(--ar-surface-soft); min-width: 0; }
.icv-change__col h3 { margin: 0 0 6px; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ar-body); font-weight: 700; }
.icv-change__col p, .icv-change__col ol { margin: 0; color: var(--ar-ink); line-height: 1.55; overflow-wrap: anywhere; }
.icv-change__col ol { padding-left: 20px; }
.icv-change__col ol li + li { margin-top: 4px; }
.icv-change--kept .icv-change__col--new { background: var(--ar-success-soft); }
.icv-change--undone .icv-change__col--new p, .icv-change--undone .icv-change__col--new ol,
.icv-change--reverted .icv-change__col--new p { color: var(--ar-body); text-decoration: line-through; text-decoration-color: rgba(74, 85, 104, .5); }
.icv-change--undone .icv-change__col--old, .icv-change--reverted .icv-change__col--old { background: var(--ar-accent-soft); }
.icv-change__foot { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; margin-top: 12px; }
.icv-change__why { flex: 1 1 320px; min-width: 0; color: var(--ar-body); font-size: .9375rem; line-height: 1.5; }
.icv-change__why p { margin: 0 0 6px; }
.icv-change__note { color: var(--ar-danger); font-weight: 600; }
.icv-change--kept .icv-change__note, .icv-change--undone .icv-change__note { color: var(--ar-body-strong); font-weight: 400; }
.icv-terms { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.icv-terms > span:first-child { font-size: .8125rem; color: var(--ar-body); }
.icv-term { background: var(--ar-accent-soft); color: var(--ar-accent-ink); border-radius: var(--ar-radius-pill); padding: 2px 10px; font-size: .8125rem; font-weight: 600; }

.icv-toggle { display: inline-flex; border: 1px solid var(--ar-line); border-radius: var(--ar-radius-pill); overflow: hidden; background: var(--ar-surface); flex: none; }
.icv-toggle label { margin: 0; cursor: pointer; }
.icv-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.icv-toggle span { display: block; padding: 9px 20px; font-weight: 700; font-size: .9375rem; color: var(--ar-body-strong); min-width: 76px; text-align: center; }
.icv-toggle input:checked + span { background: var(--ar-ink); color: #fff; }
.icv-toggle input:focus-visible + span { outline: 2px solid var(--ar-accent); outline-offset: -2px; }
.icv-toggle input:disabled + span { opacity: .6; cursor: default; }

.icv-rest { background: var(--ar-surface); border: 1px solid var(--ar-line-soft); border-radius: var(--ar-radius-sm); padding: 10px 16px; }
.icv-rest summary { cursor: pointer; font-weight: 600; color: var(--ar-body-strong); font-size: .9375rem; }
.icv-rest ul { margin: 10px 0 4px; padding-left: 20px; color: var(--ar-body); line-height: 1.55; }
.icv-rest li + li { margin-top: 4px; }

.icv-missing > p, .icv-unplaced > p { color: var(--ar-body); line-height: 1.6; max-width: 90ch; margin: 0 0 14px; }
.icv-missing__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.icv-missing__list > li > label {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "box phrase have" "box kind have"; align-items: center; column-gap: 12px;
    margin: 0; padding: 12px 14px; cursor: pointer;
    background: var(--ar-surface); border: 1px solid var(--ar-line); border-radius: var(--ar-radius-sm);
}
.icv-missing__list > li > label > input { grid-area: box; width: 20px; height: 20px; margin: 0; accent-color: var(--ar-accent); }
.icv-missing__phrase { grid-area: phrase; font-weight: 700; color: var(--ar-ink); overflow-wrap: anywhere; }
.icv-missing__kind { grid-area: kind; font-size: .8125rem; color: var(--ar-body); }
.icv-missing__have { grid-area: have; font-size: .8125rem; font-weight: 600; color: var(--ar-body-strong); white-space: nowrap; }
.icv-missing__list > li > label:has(input:checked) { border-color: var(--ar-accent); background: var(--ar-accent-soft); }
.icv-missing { margin: 0 0 28px; }
.icv-missing h2 { font-size: 1.25rem; margin: 0 0 6px; }
.icv-missing__list { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); align-items: stretch; }
.icv-missing__list > li > label { min-height: 56px; height: 100%; grid-template-areas: "box phrase have" "box kind kind"; align-content: center; row-gap: 2px; }
.icv-missing__list > li > label:focus-within { outline: 2px solid var(--ar-accent); outline-offset: 2px; }
.icv-missing__item--note { display: flex; flex-direction: column; }
.icv-missing__item--note > label { height: auto; }
.icv-missing__note { margin: 6px 0 0; padding: 0 2px; font-size: .8125rem; color: var(--ar-body); line-height: 1.45; }
.icv-missing__now { margin: 12px 0 0; color: var(--ar-body-strong); font-size: .9375rem; }
.icv-missing__now strong { color: var(--ar-success); font-variant-numeric: tabular-nums; }
.icv-missing__now span { color: var(--ar-body); }
.icv-missing-none { margin: 0 0 28px; color: var(--ar-body-strong); line-height: 1.6; }
/* A second group ("Your CV says part of this") under the first. */
.icv-missing h2.icv-missing__group { margin-top: 22px; font-size: 1.0625rem; }
/* "Which language, and how well?": under its row, only once the row is ticked. */
.icv-missing__item--ask { display: flex; flex-direction: column; gap: 8px; }
.icv-missing__item--ask > label { height: auto; }
.icv-ask { display: none; padding: 10px 14px 12px; background: var(--ar-surface); border: 1px solid var(--ar-accent); border-radius: var(--ar-radius-sm); }
.icv-missing__item--ask:has(> label input:checked) .icv-ask { display: block; }
/* A browser without :has() (older Android WebViews and Samsung Internet) would never show the question: show it always there. */
@supports not selector(:has(*)) { .icv-ask { display: block; } }
.icv-ask__q { display: block; margin: 0 0 6px; font-weight: 700; color: var(--ar-ink); font-size: .9375rem; }
.icv-ask__input { display: block; width: 100%; min-height: 44px; padding: 8px 12px; font: inherit; color: var(--ar-ink); background: var(--ar-surface); border: 1px solid var(--ar-line); border-radius: var(--ar-radius-sm); }
.icv-ask__input:focus { outline: 2px solid var(--ar-accent); outline-offset: 1px; border-color: var(--ar-accent); }
.icv-ask__note { margin: 6px 0 0; font-size: .8125rem; color: var(--ar-body); line-height: 1.45; }
/* What the advert also asks that is not a skill: a plain note, nothing to tick. */
/* "Check these first": the checker's rows (partials/knockouts), on the review page. */
.icv-knockouts { margin: 0 0 24px; padding: 18px 20px; background: var(--ar-surface); border: 1px solid var(--ar-line); border-radius: var(--ar-radius); }
.icv-knockouts h2 { font-size: 1.125rem; margin: 0 0 4px; color: var(--ar-ink); }
.icv-knockouts > p { margin: 0; color: var(--ar-body); font-size: .9375rem; line-height: 1.55; }
.icv-knock { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.icv-knock__item { font-size: .9375rem; line-height: 1.5; color: var(--ar-body); overflow-wrap: anywhere; }
.icv-knock__item > strong { display: block; color: var(--ar-ink); }
.icv-knock__item > span { display: block; margin-top: 4px; }
.icv-knock__item .icv-quote { color: var(--ar-body); font-size: .9rem; }
.icv-knock__item--no > span:not(.icv-quote) { color: var(--ar-danger); }
.icv-knock__item--ok > span:not(.icv-quote) { color: var(--ar-success); }
.icv-knock__item q { font-style: italic; quotes: "\201C" "\201D"; }
.icv-knock__item > span.icv-knock__note { color: var(--ar-body); font-size: .875rem; }

.icv-also { margin-top: 20px; padding: 14px 16px; background: var(--ar-line-soft); border-radius: var(--ar-radius-sm); }
.icv-also h3 { font-size: 1rem; margin: 0 0 4px; color: var(--ar-ink); }
.icv-also p { margin: 0 0 8px; color: var(--ar-body); line-height: 1.55; font-size: .9375rem; }
.icv-also ul { margin: 0; padding-left: 18px; color: var(--ar-body-strong); line-height: 1.6; }
.icv-also li span { color: var(--ar-body); font-size: .875rem; }
.icv-also li span::before { content: "· "; }
/* Why the match did not move. */
.icv-match__still { margin: 12px 0 0; padding: 10px 12px; background: var(--ar-line-soft); border-radius: var(--ar-radius-sm); color: var(--ar-body-strong); font-size: .9375rem; line-height: 1.5; }
.icv-match__still[hidden] { display: none; }
.icv-createbar__match { white-space: nowrap; }

.icv-unplaced { background: #FFF8E6; border: 1px solid #F0D9A0; border-radius: var(--ar-radius); padding: 18px 20px; margin: 0 0 28px; }
.icv-unplaced h2 { font-size: 1.125rem; margin: 0 0 8px; }
.icv-unplaced ul { margin: 0; padding-left: 20px; color: var(--ar-ink); line-height: 1.55; max-height: 260px; overflow-y: auto; }
.icv-copied ul { margin: 8px 0 0; padding-left: 20px; color: var(--ar-body); line-height: 1.6; }
.icv-copied strong { color: var(--ar-ink); }

.icv-createbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--ar-surface); border-top: 1px solid var(--ar-line); box-shadow: 0 -8px 32px rgba(16, 35, 58, .08); }
.icv-createbar__inner { max-width: var(--ar-container); margin: 0 auto; padding: 12px var(--ar-container-pad); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.icv-createbar__text { margin: 0; color: var(--ar-body-strong); font-size: .9375rem; line-height: 1.4; }
.icv-createbar__text strong { color: var(--ar-ink); font-variant-numeric: tabular-nums; }
.icv-createbar__note { display: block; color: var(--ar-body); font-size: .8125rem; }
.icv-delete { margin-top: 28px; color: var(--ar-body); font-size: .9375rem; }
.icv-delete button { background: none; border: 0; padding: 0; color: var(--ar-danger); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; }
#icv-retry { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; font: inherit; color: inherit; font-weight: 700; }

@media (min-width: 1100px) {
    .icv-review__head { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 48px; }
}
@media (max-width: 1099px) {
    .icv-guards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .icv-page { padding: 24px 0 48px; }
    .icv-review { padding-bottom: 170px; }
    .icv-modes__grid, .icv-options, .icv-guards, .icv-appearance { grid-template-columns: minmax(0, 1fr); }
    .icv-templates { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); max-height: 420px; }
    .icv-section { margin-top: 44px; }
    .icv-form__foot .ar-btn { width: 100%; justify-content: center; }
    /* Old above new on a phone. */
    .icv-change__cols { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .icv-change__foot { flex-direction: column; }
    .icv-toggle { width: 100%; }
    .icv-toggle label { flex: 1; }
    .icv-toggle span { min-width: 0; }
    .icv-createbar__inner { flex-direction: column; align-items: stretch; gap: 8px; padding-top: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
    .icv-createbar__inner .ar-btn { width: 100%; justify-content: center; }
    .icv-createbar__note { display: inline; }
    .icv-match__scores strong { font-size: 2rem; }
}

/* The delete control is a link-styled button: give it a full tap target. */
.icv-delete .ar-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }

.icv-nopaid { margin-top: 10px; }
.icv-free-move { margin-top: 8px; }

/* The failed page after a passing AI fault: "Try again" beside "Back to Instant CV". */
.icv-retry-form { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 12px; }
.icv-retry-form .ar-btn { flex: 1 1 220px; }
