/* ---------------------------------------------------------------------------
   Cover Letter Generator - front end styles.

   The page is one column that you walk down, which is the thing about the old
   design worth keeping. What is added here is a visible spine: five numbered
   cards that are on screen from the start, locked until their turn, so the
   shape of the whole job is legible before any of it has been done.

   Everything is driven from the custom properties below, which is what makes
   the dark theme a dozen lines rather than a second stylesheet.
   --------------------------------------------------------------------------- */

:root {
    /* Warm paper neutrals against a cool indigo, so the reading surfaces feel
       like documents and only the things you can act on are coloured. */
    --bg: #f6f4f0;
    --bg-sunk: #efece6;
    --surface: #ffffff;
    --surface-soft: #faf9f6;
    --line: #e4dfd6;
    --line-strong: #cfc8bb;

    --ink: #14181f;
    --ink-soft: #3d4757;
    --muted: #5c6471;

    --brand: #4f46e5;
    --brand-strong: #4338ca;
    --brand-ink: #3730a3;
    --brand-soft: #eef0ff;
    --brand-line: #c9cdfb;

    --ok: #15803d;
    --ok-soft: #e6f5ea;
    --ok-line: #b7dfc4;
    --warn: #92580a;
    --warn-soft: #fdf3e0;
    --warn-line: #ecd9ae;
    --err: #b42318;
    --err-soft: #fdecea;
    --err-line: #f2c2bc;

    --radius: 14px;
    --radius-sm: 9px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(20, 24, 31, 0.05);
    --shadow: 0 1px 2px rgba(20, 24, 31, 0.05), 0 8px 22px -12px rgba(20, 24, 31, 0.18);
    --shadow-lg: 0 2px 4px rgba(20, 24, 31, 0.05), 0 24px 48px -24px rgba(20, 24, 31, 0.35);

    /* A serif for the headings and the letter, a sans for the interface. The
       pairing is the whole brand: this is a machine that makes documents, so
       the documents get the voice and the controls stay quiet. Both are
       already on every machine, so nothing is downloaded and no third-party
       origin has to be allowed through the content security policy. */
    --font-display: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
    --font-ui: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;

    --page: 780px;
    --step-duration: 0.22s;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0e1014;
        --bg-sunk: #090b0e;
        --surface: #171a21;
        --surface-soft: #1c2029;
        --line: #2a2f3a;
        --line-strong: #3a4150;

        --ink: #e9ebef;
        --ink-soft: #c2c8d2;
        --muted: #939bab;

        --brand: #8b93ff;
        --brand-strong: #a5abff;
        --brand-ink: #b9beff;
        --brand-soft: #1e2138;
        --brand-line: #3a3f6b;

        --ok: #6ee7a0;
        --ok-soft: #14261b;
        --ok-line: #2c4b37;
        --warn: #f0c274;
        --warn-soft: #2a2115;
        --warn-line: #4d3d20;
        --err: #ff9a90;
        --err-soft: #2c1614;
        --err-line: #5a2b26;

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 22px -12px rgba(0, 0, 0, 0.7);
        --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 24px 48px -24px rgba(0, 0, 0, 0.9);
    }
}

/* --------------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; overflow-x: clip; -webkit-text-size-adjust: 100%; }
html.is-in-flow { scroll-padding-top: 88px; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.22; margin: 0; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-strong); }

::selection { background: var(--brand-soft); color: var(--brand-ink); }

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 4px;
}

.skip {
    position: absolute;
    left: 50%;
    top: 8px;
    transform: translate(-50%, -160%);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    z-index: 60;
    transition: transform 0.15s ease;
}
.skip:focus { transform: translate(-50%, 0); }

.shell { max-width: var(--page); margin: 0 auto; padding: 0 20px; }

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

/* ------------------------------------------------------------------- topbar */

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.topbar.is-stuck { border-bottom-color: var(--line); }

.topbar-inner {
    max-width: var(--page);
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
}
.wordmark svg { width: 26px; height: 26px; flex: none; color: var(--brand); }

/* The second half of the name, in the brand colour. `BRAND_NAME=Letter|fit` is what puts
   anything in here; a name without a pipe leaves this element empty and it costs nothing. */
.wordmark b { color: var(--brand); font-weight: inherit; }

.topbar-spacer { flex: 1; }

.topbar-cta {
    flex: none;
    gap: 6px;
    white-space: nowrap;
}
.topbar-cta-narrow { display: none; }

/* The five pips make the job look long before anyone has started. They stay
   hidden until Import is clicked — then they are navigation, and Try now goes. */
.progress-nav[hidden] { display: none !important; }

/* The rail is the step list in miniature. It is navigation and status at once:
   where you are, what is finished, and how much is left. */
.rail { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; }
.rail li { display: flex; align-items: center; gap: 2px; }
.rail li::after {
    content: '';
    width: 14px;
    height: 1px;
    background: var(--line-strong);
}
.rail li:last-child::after { display: none; }

.rail button {
    display: flex;
    align-items: center;
    gap: 7px;
    background: none;
    border: 0;
    padding: 5px 9px;
    border-radius: var(--radius-pill);
    font: inherit;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
}
.rail button:hover:not(:disabled) { background: var(--bg-sunk); color: var(--ink); }
.rail button:disabled { cursor: default; opacity: 0.65; }

.rail .pip {
    width: 20px; height: 20px; flex: none;
    border-radius: 50%;
    border: 1.5px solid var(--line-strong);
    display: grid; place-items: center;
    font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.rail .rail-name { display: none; }

.rail li.is-current button { color: var(--ink); font-weight: 600; }
.rail li.is-current .pip { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.rail li.is-current .rail-name { display: inline; }

.rail li.is-done button { color: var(--ink-soft); }
.rail li.is-done .pip { border-color: var(--ok); background: var(--ok); color: #fff; font-size: 0; }
.rail li.is-done .pip::after { content: '\2713'; font-size: 12px; }

@media (max-width: 720px) {
    .topbar-inner {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 8px;
        padding: 10px 16px 12px;
    }
    .topbar-spacer { display: none; }
    .topbar-cta { justify-self: end; align-self: center; }
    .topbar-cta-wide { display: none; }
    .topbar-cta-narrow { display: inline; }
    .topbar nav { grid-column: 1 / -1; }
    .rail { width: 100%; justify-content: space-between; }
    .rail li::after { display: none; }
    .rail li { flex: 1; min-width: 0; justify-content: center; }
    .rail button {
        flex-direction: column;
        gap: 3px;
        padding: 6px 2px;
        min-height: 44px;
        width: 100%;
        font-size: 10px;
    }
    .rail .rail-name,
    .rail li.is-current .rail-name {
        display: block;
        font-size: 10px;
        font-weight: 650;
        line-height: 1.15;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* --------------------------------------------------------------------- hero */

.hero {
    text-align: center;
    padding: 54px 0 48px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 18px;
    padding: 5px 13px 5px 8px;
    border-radius: var(--radius-pill);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-soft);
}
.eyebrow .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent);
}

.hero h1 {
    font-size: clamp(34px, 6vw, 52px);
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    text-wrap: balance;
}
.hero h1 em,
.lede em { font-style: italic; color: var(--brand); }

.lede {
    max-width: 34em;
    margin: 0 auto 26px;
    font-size: 17px;
    color: var(--ink-soft);
    text-wrap: pretty;
}

.hero-cta { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }

.trust {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13.5px;
    color: var(--muted);
}
.trust li { display: flex; align-items: center; gap: 7px; }
.trust svg { width: 15px; height: 15px; color: var(--ok); flex: none; }

/* Sample sits above the language box in the DOM so opening the example pushes
   languages down, instead of the language panel sitting between the headline
   and the preview. Height is animated with 0fr / 1fr — [hidden] cannot be used
   here because it forces display:none and kills the transition. */
.hero-stage {
    margin-top: 26px;
    overflow-anchor: none;
}
.sample-slot {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero-stage.is-showing-sample .sample-slot {
    grid-template-rows: 1fr;
}
.sample-slot > .sample {
    min-height: 0;
    overflow: hidden;
}

.hero-proof {
    margin-top: 0;
    transition: margin-top 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero-stage.is-showing-sample .hero-proof {
    margin-top: 28px;
}

.lang-proof {
    margin: 12px auto 0;
    text-align: center;
}
.lang-proof-line {
    display: flex;
    justify-content: center;
    margin: 0;
}
.lang-proof-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--muted);
    padding: 4px 10px 4px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface);
}
.lang-proof-count svg {
    width: 13px;
    height: 13px;
    color: var(--brand);
}

/* The example. Nobody pays for generated writing they have not seen, and the thing
   worth showing is not a nice letter - anything can produce one of those - but where
   each sentence came from. So the three inputs sit beside the two outputs and the
   shared phrases are marked in the same colour on both sides. */
.sample { margin: 0; text-align: left; }

.demo { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: start; position: relative; }
.demo-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.demo-tag {
    font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
    color: var(--muted); margin: 0 0 2px 2px;
}

.demo-flow { display: grid; place-items: center; align-self: center; color: var(--brand); }
.demo-flow svg { width: 26px; height: 26px; }

.demo-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 13px 15px 15px;
    font-size: 13.5px;
    line-height: 1.6;
}
.demo-card p { margin: 0 0 0.6em; }
.demo-card ul { margin: 0; padding-left: 18px; }
.demo-card li { margin-bottom: 3px; }

.demo-card-head {
    display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
    gap: 4px 10px; margin-bottom: 8px;
}
.demo-what { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.demo-src { font-size: 11.5px; color: var(--muted); }

.demo-paper {
    font-family: var(--font-display);
    font-size: 14px;
    line-height: 1.7;
    box-shadow: var(--shadow);
}
.demo-paper .demo-card-head { font-family: var(--font-ui); }

.demo-cv-role { font-weight: 650; }
.demo-cv-head {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
    color: var(--brand-ink); margin: 10px 0 3px;
}
.demo-ask { color: var(--muted); font-style: italic; }
.demo-said { margin: 0; }
.demo-moved { font-size: 12px; color: var(--muted); font-style: italic; margin: 10px 0 0; }

/* One colour per source, used identically on the input and the output, because the
   claim being made is that the two are the same words. */
.sample mark {
    background: none;
    color: inherit;
    padding: 1px 2px;
    border-radius: 3px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}
.sample .m-job { background: #e3ecff; box-shadow: inset 0 -1px 0 #93b0f0; }
.sample .m-cv  { background: #dff3e6; box-shadow: inset 0 -1px 0 #8ec9a4; }
.sample .m-you { background: #fdeccd; box-shadow: inset 0 -1px 0 #e2b96a; }

.sample mark[data-trace] {
    cursor: pointer;
    transition: box-shadow 0.18s ease, filter 0.18s ease;
}
.sample mark[data-trace]:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}
.demo.is-tracing mark[data-trace]:not(.is-traced) { opacity: 0.42; }
.sample mark.is-traced {
    position: relative;
    z-index: 2;
    filter: saturate(1.15);
}
.sample .m-job.is-traced {
    box-shadow: inset 0 -1px 0 #93b0f0, 0 0 0 3px color-mix(in srgb, #4f7fe8 38%, transparent),
        0 0 18px color-mix(in srgb, #4f7fe8 55%, transparent);
}
.sample .m-cv.is-traced {
    box-shadow: inset 0 -1px 0 #8ec9a4, 0 0 0 3px color-mix(in srgb, #2f8a54 38%, transparent),
        0 0 18px color-mix(in srgb, #2f8a54 50%, transparent);
}
.sample .m-you.is-traced {
    box-shadow: inset 0 -1px 0 #e2b96a, 0 0 0 3px color-mix(in srgb, #c4891a 38%, transparent),
        0 0 18px color-mix(in srgb, #c4891a 50%, transparent);
}

.demo-links {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 1;
}
.demo-links path {
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-dasharray: 7 8;
    animation: demo-dash 0.85s linear infinite;
}
.demo-links .demo-link-job { stroke: #4f7fe8; }
.demo-links .demo-link-cv { stroke: #2f8a54; }
.demo-links .demo-link-you { stroke: #c4891a; }

@keyframes demo-dash {
    to { stroke-dashoffset: -30; }
}

@media (prefers-reduced-motion: reduce) {
    .demo-links path { animation: none; stroke-dasharray: none; }
    .sample mark[data-trace] { transition: none; }
    .sample-slot,
    .hero-proof { transition: none; }
}

@media (prefers-color-scheme: dark) {
    .sample .m-job { background: #1e2a4a; box-shadow: inset 0 -1px 0 #40598f; }
    .sample .m-cv  { background: #182f22; box-shadow: inset 0 -1px 0 #326348; }
    .sample .m-you { background: #33280f; box-shadow: inset 0 -1px 0 #6b552a; }
    .sample .m-job.is-traced {
        box-shadow: inset 0 -1px 0 #40598f, 0 0 0 3px color-mix(in srgb, #8b93ff 40%, transparent),
            0 0 18px color-mix(in srgb, #8b93ff 50%, transparent);
    }
    .sample .m-cv.is-traced {
        box-shadow: inset 0 -1px 0 #326348, 0 0 0 3px color-mix(in srgb, #4ade80 32%, transparent),
            0 0 18px color-mix(in srgb, #4ade80 40%, transparent);
    }
    .sample .m-you.is-traced {
        box-shadow: inset 0 -1px 0 #6b552a, 0 0 0 3px color-mix(in srgb, #e2b96a 40%, transparent),
            0 0 18px color-mix(in srgb, #e2b96a 45%, transparent);
    }
    .demo-links .demo-link-job { stroke: #8b93ff; }
    .demo-links .demo-link-cv { stroke: #4ade80; }
    .demo-links .demo-link-you { stroke: #e2b96a; }
}

.demo-legend {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px;
    font-size: 12.5px; color: var(--muted);
    margin: 16px 0 0;
}
.demo-legend .key {
    display: inline-block; width: 13px; height: 13px; border-radius: 3px;
    vertical-align: -2px; margin-right: 3px;
}
.demo-hint {
    width: 100%;
    text-align: center;
    font-style: italic;
    color: var(--muted);
}

.sample-note {
    font-size: 13.5px; color: var(--muted); margin-top: 12px;
    text-align: center; max-width: 46em; margin-left: auto; margin-right: auto;
}

@media (max-width: 720px) {
    .demo { grid-template-columns: 1fr; gap: 10px; }
    .demo-flow { transform: rotate(90deg); margin: 2px 0; }
    .demo-links { display: none; }
}

/* ------------------------------------------------------------- how it works */

.how { margin: 0; }
.how-flow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
    position: relative;
}
.how-flow::before {
    content: "";
    position: absolute;
    top: 27px;
    left: calc(16.666% + 28px);
    right: calc(16.666% + 28px);
    height: 2px;
    background: var(--brand-line);
    pointer-events: none;
}
.how-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 0;
    position: relative;
    z-index: 1;
}
.how-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--surface);
    border: 1.5px solid var(--brand-line);
    color: var(--brand);
    box-shadow: var(--shadow-sm);
}
.how-icon svg { width: 22px; height: 22px; }
.how-label {
    font-family: var(--font-ui);
    font-size: 13.5px;
    font-weight: 650;
    letter-spacing: -0.015em;
    color: var(--ink);
    text-align: center;
    max-width: 9.5em;
    line-height: 1.25;
}

@media (max-width: 640px) {
    .how-flow { max-width: 100%; }
    .how-icon { width: 48px; height: 48px; }
    .how-flow::before { top: 24px; }
    .how-label { font-size: 12.5px; }
}

/* --------------------------------------------------------------- step cards */

/* `hidden` is used for anything that is genuinely not there yet, so it has to win
   against the display rules further down. */
[hidden] { display: none !important; }

.steps { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 96px; }

/* Steps one and two share a form, which would otherwise swallow the gap between
   their two cards. */
.steps > form { display: flex; flex-direction: column; gap: 14px; }

.step-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    scroll-margin-top: 84px;
    transition: box-shadow var(--step-duration) ease, border-color var(--step-duration) ease;
}
.step-card.is-open { box-shadow: var(--shadow); }
.step-card.is-current { border-color: var(--brand-line); box-shadow: var(--shadow), 0 0 0 4px var(--brand-soft); }

.step-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
}
.step-card.is-open .step-head { padding-bottom: 4px; }

.step-num {
    width: 30px; height: 30px; flex: none;
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
    background: var(--bg-sunk);
    color: var(--muted);
    border: 1px solid var(--line);
}
.step-card.is-current .step-num,
.step-card.is-open .step-num { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); }
.step-card.is-done .step-num { background: var(--ok); border-color: var(--ok); color: #fff; font-size: 0; }
.step-card.is-done .step-num::after { content: '\2713'; font-size: 15px; }

.step-title { flex: 1; min-width: 0; }
.step-title h2 {
    font-family: var(--font-ui);
    font-size: 16.5px;
    font-weight: 650;
    letter-spacing: -0.01em;
}
.step-title .step-sub {
    font-size: 13.5px;
    color: var(--muted);
    margin: 1px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.step-body { padding: 14px 22px 22px; }
.step-card:not(.is-open) .step-body { display: none; }
.step-card:not(.is-open) .step-head { padding: 18px 22px; }

.step-card.is-locked { display: none; }

.lock-icon { width: 16px; height: 16px; color: var(--muted); flex: none; }
.step-card:not(.is-locked) .lock-icon { display: none; }
html:not(.is-in-flow) .step-num { display: none; }

/* ---------------------------------------------------------------- typography */

.section-label {
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    margin: 0 0 10px;
}

.note { font-size: 13.5px; color: var(--muted); margin: 0 0 14px; }
.note-tight { margin-bottom: 0; }
.note-spaced { margin-top: 10px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 7px; }
.hint-center { text-align: center; }

.divider { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

/* -------------------------------------------------------------------- forms */

.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }

label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }

input[type="url"], input[type="text"], input[type="email"], input[type="tel"], textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { resize: vertical; }

input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }

input:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--brand) 18%, transparent);
}

.row { display: flex; gap: 9px; }
@media (max-width: 520px) {
    .row { flex-direction: column; }
    .row .btn { width: 100%; }
}

/* ------------------------------------------------------------------ buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--brand);
    color: #fff;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 11px 18px;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.06s ease, box-shadow 0.15s ease;
}
.btn:hover:not(:disabled) { background: var(--brand-strong); color: #fff; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn svg { width: 16px; height: 16px; flex: none; }

.btn-lg { padding: 14px 26px; font-size: 16px; border-radius: 11px; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn, .lang-chip, a.btn { touch-action: manipulation; }

.btn-secondary {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-soft); color: var(--ink); border-color: var(--muted); }

.btn-quiet { background: transparent; color: var(--ink); border-color: transparent; }
.btn-quiet:hover:not(:disabled) { background: var(--bg-sunk); color: var(--ink); }

.btn-link {
    background: none; border: 0; padding: 0;
    color: var(--brand); font: inherit; font-size: 13.5px; font-weight: 500;
    cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.btn-link:hover { color: var(--brand-strong); }

/* The primary action of a step, given its own line and a little air, so there
   is never a question about which of five buttons moves you forward. */
.actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.actions-main { margin-top: 18px; }

/* ------------------------------------------------------------------- badges */

.badge {
    display: none;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 650;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    margin-left: 8px;
    vertical-align: 2px;
}
.badge.known { display: inline-flex; background: var(--brand-soft); color: var(--brand-ink); }
.badge.blocked { display: inline-flex; background: var(--warn-soft); color: var(--warn); }
.badge.generic { display: inline-flex; background: var(--bg-sunk); color: var(--muted); }

/* ------------------------------------------------------------------- status */

.status {
    display: none;
    margin-top: 11px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 13.5px;
}
.status.loading {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface-soft); border-color: var(--line); color: var(--ink-soft);
}
.status.loading::before {
    content: '';
    width: 14px; height: 14px; flex: none;
    border: 2px solid var(--line-strong);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.status.success { display: block; background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.status.ok { display: block; background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.status.error { display: block; background: var(--err-soft); border-color: var(--err-line); color: var(--err); }

@keyframes spin { to { transform: rotate(360deg); } }

.notice {
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 14px 18px;
    font-size: 14px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
}
.notice.good { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.notice.bad { background: var(--err-soft); border-color: var(--err-line); color: var(--err); }
.notice code { font-family: var(--font-mono); font-size: 0.9em; }

/* --------------------------------------------------------------- job import */

.imported {
    display: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    padding: 13px 15px;
    margin-top: 12px;
}
.imported.visible { display: block; }
.imported .imported-head { display: flex; gap: 12px; align-items: flex-start; }
.imported-tick { width: 18px; height: 18px; flex: none; margin-top: 3px; color: var(--ok); }
.imported .imported-title { flex: 1; min-width: 0; font-weight: 650; font-size: 14.5px; }
.imported .imported-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* The description is long, and once it has been read there is nothing to do
   with it but confirm it arrived. So it folds away and takes its wall of text
   with it, which is most of what made the first screen feel like paperwork. */
.disclosure { margin-top: 12px; }
.disclosure > summary {
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--brand);
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before {
    content: '';
    width: 0; height: 0;
    border-left: 5px solid currentColor;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: transform 0.15s ease;
}
.disclosure[open] > summary::before { transform: rotate(90deg); }
.disclosure > .disclosure-body { padding-top: 12px; }

/* ----------------------------------------------------------------- dropzone */

.dropzone {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface-soft);
    padding: 20px 22px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone:hover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone.is-dragging { border-color: var(--brand); background: var(--brand-soft); border-style: solid; }
.dropzone.has-file { border-style: solid; border-color: var(--ok-line); background: var(--ok-soft); }

.dropzone input[type="file"] {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}
.dropzone input[type="file"]:focus-visible + .dz-icon { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }

.dz-icon { width: 26px; height: 26px; flex: none; color: var(--muted); }
.dropzone.has-file .dz-icon { color: var(--ok); }
.dz-text { flex: 1; min-width: 0; }
.dz-main { font-size: 14.5px; font-weight: 600; }
.dz-main u { text-decoration-color: var(--brand-line); text-underline-offset: 3px; }
.dz-sub { font-size: 13px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-swap { font-size: 12.5px; font-weight: 600; color: var(--brand); flex: none; }
.dropzone:not(.has-file) .dz-swap { display: none; }

/* ------------------------------------------------------------- the pipeline */

.pipeline { display: none; margin-top: 18px; }
.pipeline.visible { display: block; }

.pipeline-inner {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    padding: 16px 18px;
}

.step-row {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    font-size: 14px;
    padding: 4px 0;
    color: var(--muted);
}
.step-row .icon {
    flex: 0 0 18px;
    height: 18px;
    margin-top: 3px;
    border-radius: 50%;
    border: 2px solid var(--line-strong);
    font-size: 11px;
    line-height: 15px;
    text-align: center;
    color: #fff;
}
.step-row.active { color: var(--ink); font-weight: 600; }
.step-row.active .icon { border-color: var(--brand); border-top-color: transparent; animation: spin 0.8s linear infinite; }
.step-row.done { color: var(--ink-soft); }
.step-row.done .icon { background: var(--ok); border-color: var(--ok); }
.step-row.done .icon::after { content: '\2713'; }

.pipeline-foot {
    display: flex; justify-content: space-between; gap: 12px;
    font-size: 12.5px; color: var(--muted);
    border-top: 1px solid var(--line);
    margin-top: 12px; padding-top: 10px;
}
.elapsed { font-variant-numeric: tabular-nums; }

/* A shape where the answer will be, rather than a spinner over nothing. */
.skeleton { display: none; margin-top: 16px; }
.skeleton.visible { display: block; }
.skeleton-line {
    height: 11px;
    border-radius: 5px;
    margin-bottom: 11px;
    background: linear-gradient(90deg, var(--bg-sunk) 25%, var(--line) 37%, var(--bg-sunk) 63%);
    background-size: 400% 100%;
    animation: shimmer 1.5s ease infinite;
}
/* Ragged, like a letter rather than a paragraph of filler. */
.skeleton-line:nth-child(1) { width: 38%; }
.skeleton-line:nth-child(2) { width: 100%; }
.skeleton-line:nth-child(3) { width: 96%; }
.skeleton-line:nth-child(4) { width: 99%; }
.skeleton-line:nth-child(5) { width: 64%; }
.skeleton-line:nth-child(6) { width: 98%; }
.skeleton-line:nth-child(7) { width: 91%; }
.skeleton-line:nth-child(8) { width: 43%; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* --------------------------------------------------------- analysis summary */

.result {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    padding: 20px 22px;
    margin-bottom: 20px;
}
.result-head { display: flex; gap: 20px; align-items: flex-start; }
.result-head .who { flex: 1; min-width: 0; }
.result h3 { font-size: 20px; letter-spacing: -0.01em; }
.result .meta { font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.result .lang {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 10px; padding: 4px 11px;
    border-radius: var(--radius-pill);
    background: var(--brand-soft); color: var(--brand-ink);
    font-size: 12.5px; font-weight: 600;
}

/* The match figure is the free thing this app gives away, so it is drawn like
   a result rather than filed away as another grey line of text. */
.ring { flex: none; width: 84px; height: 84px; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.ring .track { stroke: var(--line); }
.ring .value { stroke: var(--brand); transition: stroke-dashoffset 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.ring .pct {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
.ring-caption { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); text-align: center; margin-top: 4px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 18px 0 4px; }
.stat {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 11px 13px;
}
.stat .n { font-size: 22px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.strong .n { color: var(--ok); }
.stat.partial .n { color: var(--warn); }
.stat.missing .n { color: var(--err); }

@media (max-width: 560px) {
    .result-head { flex-direction: column-reverse; align-items: flex-start; gap: 14px; }
    .ring { width: 68px; height: 68px; }
    .ring .pct { font-size: 16px; }
    .ring-caption { display: none; }
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    font-size: 12.5px;
    padding: 4px 11px;
    border-radius: var(--radius-pill);
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink-soft);
}
.chip.strong { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.chip.partial { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.chip.missing { background: var(--err-soft); border-color: var(--err-line); color: var(--err); }
.chip-label {
    font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--muted); margin: 16px 0 7px;
}

/* ---------------------------------------------------------------- questions */

.identity { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.identity .field { margin-bottom: 14px; }
@media (max-width: 560px) { .identity { grid-template-columns: 1fr; } }

.question {
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand-line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 15px 17px;
    margin-bottom: 11px;
}
.question .req {
    font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--brand-ink); margin-bottom: 5px;
}
.question .q { font-weight: 600; font-size: 14.5px; margin-bottom: 3px; }
.question .why { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.question textarea { font-size: 16px; }

/* --------------------------------------------------------------- language */

.language-picker {
    margin: 22px 0 8px;
    padding: 14px 16px 12px;
    border: 1.5px solid var(--brand-line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.lang-kicker {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--brand-ink);
    margin: 0 0 4px;
}
.lang-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 10px;
}
.lang-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    margin: 0;
    padding: 8px 12px 7px;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    cursor: pointer;
    text-align: left;
    min-height: 44px;
    justify-content: center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.lang-chip:hover { border-color: var(--brand-line); }
.lang-chip.is-on {
    border-color: var(--brand);
    background: var(--brand-soft);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent);
}
.lang-native { font-size: 13.5px; font-weight: 650; line-height: 1.2; }
.lang-name { font-size: 11px; color: var(--muted); }
.lang-chip.is-on .lang-name { color: var(--brand-ink); }
.lang-more { margin-top: 4px; }
.lang-more summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand);
    list-style: none;
    padding: 8px 0;
}
.lang-more summary::-webkit-details-marker { display: none; }
.lang-custom { margin-top: 8px; max-width: 22em; }
.lang-custom.is-on input {
    border-color: var(--brand);
    box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--brand) 18%, transparent);
}

.archetype-picker {
    margin: 16px 0 20px;
    padding: 14px 16px 12px;
    border: 1.5px solid var(--brand-line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.archetype-kicker {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--brand-ink);
    margin: 0 0 4px;
}
.archetype-picker h3 { font-size: 16px; font-weight: 650; margin: 0 0 5px; }
.archetype-picker .note { margin-bottom: 10px; }
.archetype-picker select {
    width: 100%;
    max-width: 34em;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
}
.archetype-guidance { margin-top: 10px; font-size: 13px; color: var(--muted); }
.archetype-guidance p { margin: 0 0 7px; }
.archetype-guidance .archetype-subtitle { color: var(--ink); font-weight: 650; }

/* ------------------------------------------------------------------- gate */

.trial-row { display: flex; gap: 9px; margin: 12px 0 8px; flex-wrap: wrap; }
.trial-row input { flex: 1 1 220px; }
.trial-row .btn { flex: none; }

/* The door before the five steps. Tinted rather than numbered, so it does not read as a
   sixth step in a flow the rail says has five. */
.gate-card { border-color: var(--brand-line); }
.gate-card.is-open { background: linear-gradient(180deg, var(--brand-soft), var(--surface) 96px); }

.gate-icon {
    width: 34px; height: 34px; flex: none;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--brand-soft);
    border: 1px solid var(--brand-line);
    color: var(--brand);
}
.gate-icon svg { width: 17px; height: 17px; }
.gate-card.is-done .gate-icon {
    background: var(--ok); border-color: var(--ok); color: #fff;
}
.gate-card.is-done .gate-icon svg { display: none; }
.gate-card.is-done .gate-icon::after { content: '\2713'; font-size: 16px; font-weight: 700; }

/* ------------------------------------------------------------------ paywall */

.paywall {
    display: none;
    border: 1px solid var(--brand-line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--brand-soft), var(--surface) 130px);
    padding: 20px 22px 22px;
    margin: 22px 0;
}
.paywall.visible { display: block; }
.paywall h3 { font-family: var(--font-ui); font-size: 16px; font-weight: 650; margin-bottom: 4px; }

.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 16px 0; }
.product {
    position: relative;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 14px 15px;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: var(--ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}
.product:hover { border-color: var(--brand-line); transform: translateY(-1px); }
.product.chosen { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }
.product .price { font-weight: 650; font-size: 15px; margin-top: 2px; }
.product .name { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-family: var(--font-display); }
.product .detail { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.product .tick {
    position: absolute; top: 11px; right: 11px;
    width: 17px; height: 17px; border-radius: 50%;
    border: 1.5px solid var(--line-strong);
}
.product.chosen .tick { background: var(--brand); border-color: var(--brand); }
.product.chosen .tick::after { content: '\2713'; color: #fff; font-size: 11px; display: grid; place-items: center; height: 100%; }

.pass-held {
    display: none;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 6px;
    background: var(--ok-soft);
    border: 1px solid var(--ok-line);
    color: var(--ok);
    font-size: 14px;
}
.pass-held.visible { display: block; }
.pass-held a { word-break: break-all; color: inherit; }
.pass-note { margin-top: 8px; }

.paywall-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-top: 12px; font-size: 12.5px; color: var(--muted); }

/* ------------------------------------------------------------------ recover */

.recover-card { margin-top: 14px; }
.recover-card .step-body { padding-top: 18px; }
.recover-row { display: flex; gap: 9px; margin-top: 10px; flex-wrap: wrap; }
.recover-row input { flex: 1 1 240px; }
@media (max-width: 460px) { .recover-row .btn { width: 100%; } }

/* ------------------------------------------------------------- the documents */

/* Both outputs are shown as pages, because that is what they will be when they
   are downloaded, and because a document that looks like a document is the one
   thing on the screen worth paying for. */
.paper {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 34px 38px;
}
@media (max-width: 560px) { .paper { padding: 22px 20px; } }

#letter {
    white-space: pre-wrap;
    font-family: var(--font-display);
    font-size: 15.5px;
    line-height: 1.75;
    outline: none;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
#letter:hover { border-color: var(--line-strong); }
#letter:focus { border-color: var(--brand); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--brand) 15%, transparent); }
.paper-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 9px;
}
.editable-pill {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; color: var(--muted);
}
.editable-pill svg { width: 13px; height: 13px; }
.saved-note { font-size: 12px; color: var(--ok); opacity: 0; transition: opacity 0.3s ease; }
.saved-note.on { opacity: 1; }
.saved-note.warn { color: var(--warn); }

.warnings {
    display: none;
    margin-bottom: 14px;
    padding: 13px 15px;
    border-radius: var(--radius-sm);
    background: var(--warn-soft);
    border: 1px solid var(--warn-line);
    font-size: 13.5px;
    color: var(--warn);
}
.warnings.visible { display: block; }
.warnings strong { display: block; margin-bottom: 6px; }
.warnings ul { margin: 0; padding-left: 20px; }
.warnings li { margin-bottom: 3px; }

/* A wrong fact is a different kind of problem from a style nit, so it does not
   share the amber used for things that are merely worth a look. */
.warnings.serious { background: var(--err-soft); border-color: var(--err-line); color: var(--err); }

/* --------------------------------------------------------- CV suggestions */

.suggestion {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 15px 17px;
    margin-bottom: 11px;
}
.suggestion .head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.suggestion .where {
    font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--brand-ink);
}
.suggestion .line {
    white-space: pre-wrap;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 11px 13px;
}
.suggestion .replaces { font-size: 12.5px; color: var(--muted); margin-top: 9px; }
.suggestion .replaces q { color: var(--warn); font-style: italic; }
.suggestion .why { font-size: 13px; color: var(--muted); margin-top: 8px; }
.suggestion .source { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* -------------------------------------------------------------- the CV plan */

.plan-section {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 13px 15px;
    margin-bottom: 9px;
    transition: opacity 0.15s ease;
}
.plan-section.excluded { opacity: 0.45; }
.plan-section .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-section label { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 650; font-size: 14.5px; cursor: pointer; }
.plan-section input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--brand); margin: 0; flex: none; }
.plan-section .move { display: flex; gap: 4px; flex-shrink: 0; }
.plan-section .move .btn { padding: 3px 10px; font-size: 13px; }
.plan-section .meta {
    font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--brand-ink); margin: 8px 0 0 27px;
}
.plan-section .detail { font-size: 13px; color: var(--muted); margin: 4px 0 0 27px; }

.cuts {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    padding: 13px 15px;
    margin-bottom: 14px;
    font-size: 13px;
}
.cuts strong {
    display: block; margin-bottom: 6px;
    font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted);
}
.cuts ul { margin: 0; padding-left: 20px; color: var(--muted); }
.cuts li { margin-bottom: 3px; }

/* ---------------------------------------------------------- the tailored CV */

.cv-section { margin-bottom: 24px; }
.cv-section:last-child { margin-bottom: 0; }
.cv-section h3 {
    font-family: var(--font-ui);
    font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--brand-ink);
    border-bottom: 1px solid var(--line);
    padding-bottom: 6px;
    margin-bottom: 11px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.cv-entry { margin-bottom: 13px; }
.cv-entry .cv-label { font-weight: 650; font-size: 14px; margin-bottom: 4px; }
.cv-entry ul { margin: 0; padding-left: 20px; }
.cv-entry li { font-size: 14px; line-height: 1.6; margin-bottom: 3px; }
.cv-section .note { font-size: 12.5px; color: var(--muted); font-style: italic; margin-top: 6px; }
.cv-section .cv-lines { margin: 0; }
.cv-section .cv-lines p { margin: 0 0 4px; font-size: 14px; line-height: 1.6; }

.cv-header { border-bottom: 2px solid var(--ink); padding-bottom: 13px; margin-bottom: 20px; }
.cv-header .cv-name { font-family: var(--font-display); font-size: 27px; font-weight: 700; line-height: 1.15; letter-spacing: -0.015em; }
.cv-header .cv-standing { font-size: 14px; color: var(--muted); margin-top: 3px; }
.cv-header .cv-row { font-size: 13px; color: var(--muted); }
.cv-header .cv-missing { font-size: 12.5px; color: var(--warn); margin-top: 7px; }

/* ---------------------------------------------------------------------- FAQ */

.faq { margin: 50px 0 0; }
.faq h2 { font-size: 25px; text-align: center; margin-bottom: 20px; letter-spacing: -0.015em; }
.faq details {
    border-bottom: 1px solid var(--line);
    padding: 4px 0;
}
.faq summary {
    cursor: pointer;
    list-style: none;
    padding: 14px 34px 14px 2px;
    font-size: 15px;
    font-weight: 600;
    position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: '+';
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    font-size: 19px; font-weight: 400; color: var(--muted);
}
.faq details[open] summary::after { content: '\2212'; }
.faq details > p { padding: 0 34px 16px 2px; font-size: 14.5px; color: var(--ink-soft); margin: 0; }

/* ------------------------------------------------------------------- footer */

.site-foot {
    margin-top: 56px;
    border-top: 1px solid var(--line);
    padding: 26px 0 44px;
    font-size: 13px;
    color: var(--muted);
    text-align: center;
}
.site-foot .foot-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 8px; }
.site-foot a { color: var(--ink-soft); }

/* ---------------------------------------------------- mobile action docking */

/* On a phone the primary button of the open step scrolls out of reach behind a
   long form, so it is pinned instead. Desktop keeps it inline where it reads. */
@media (max-width: 640px) {
    html { scroll-padding-top: 72px; }
    html.is-in-flow { scroll-padding-top: 118px; }
    .shell { padding: 0 14px; }
    .hero { padding: 28px 0 22px; }
    .hero h1 { font-size: clamp(28px, 8vw, 40px); }
    .lede { font-size: 16px; }
    .hero-cta { flex-direction: column; align-items: stretch; }
    .hero-cta .btn { width: 100%; }
    .topbar { padding-top: env(safe-area-inset-top); }
    .topbar-inner {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 8px;
        padding: 10px 14px 12px;
    }
    .topbar-spacer { display: none; }
    .topbar-cta { justify-self: end; align-self: center; }
    .topbar nav { grid-column: 1 / -1; }
    .rail { width: 100%; justify-content: space-between; }
    .wordmark { font-size: 16px; }
    .step-head { padding: 15px 16px; }
    .step-body { padding: 12px 16px 18px; }
    .step-card:not(.is-open) .step-head { padding: 15px 16px; }
    .step-card { scroll-margin-top: 118px; }
    .step-title .step-sub { white-space: normal; }
    .result { padding: 16px 17px; }
    .lang-chip { min-height: 48px; flex: 1 1 calc(50% - 8px); }
    .trial-row .btn { width: 100%; }
    .products { grid-template-columns: 1fr; }
    .paper { padding: 20px 16px; overflow-wrap: anywhere; }
    .cv-header .cv-name { font-size: 22px; }
    .paywall { padding: 16px 16px 18px; }
    .step-card.is-open .actions-main {
        position: sticky;
        bottom: 0;
        z-index: 8;
        margin: 16px -16px -18px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        background: color-mix(in srgb, var(--surface) 92%, transparent);
        backdrop-filter: saturate(1.2) blur(14px);
        border-top: 1px solid var(--line);
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    .topbar, .hero, .how, .faq, .site-foot, .actions, .paywall, .pipeline { display: none !important; }
    .step-card { border: 0; box-shadow: none; }
    body { background: #fff; }
}
