/* Resume builder (/resume-builder): the page, layout variants, photo and entry cards.
   Stage, fields and buttons come from the app kit. Loaded only on this page.
   The drawn page (Save image, Save as PDF) follows these sizes in filter-engines/resume-builder.js (layout). */

.rb-landing-stage {
    align-items: center;
    background:
        radial-gradient(900px 280px at 50% -8%, color-mix(in srgb, var(--ak-accent, #2563eb) 16%, transparent), transparent 70%),
        var(--ak-bg, #f8fafc);
}

/* The page in the middle of the stage: the kit stretches the stage's children (align-self), which left the page
   against the left edge with an empty band beside it. */
.rb-paper {
    width: min(100%, 46rem);
}
.ak-app > .rb-landing-stage.ak-stage > .rb-paper { align-self: center; }

.rb-sheet {
    background: #fff;
    color: #0f172a;
    color-scheme: light;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    padding: 2rem 2.1rem 1.8rem;
    min-height: 36rem;
    overflow-wrap: anywhere;
}

.rb-muted-name { color: #94a3b8; }
.rb-name {
    margin: 0;
    font-size: 2rem;
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.rb-role {
    margin: 0.35rem 0 0;
    font-size: 1.05rem;
    color: var(--rb-accent, #0f766e);
    font-weight: 650;
}

.rb-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.85rem;
    margin: 0.7rem 0 0;
    padding: 0;
    list-style: none;
    color: #475569;
    font-size: 0.92rem;
}

/* The photo: a circle, beside the name (Modern, Compact), above it (Classic) or at the top of the column (Sidebar). */
.rb-photo {
    display: block;
    flex: none;
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 30%;
    background: #e2e8f0;
}

.rb-head {
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.1rem;
}
.rb-head-text { flex: 1 1 auto; min-width: 0; }

.rb-kicker {
    margin: 0 0 0.4rem;
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rb-accent, #0f766e);
}

.rb-section { margin-top: 1.15rem; }
.rb-summary { margin: 0; white-space: pre-wrap; line-height: 1.45; }

.rb-item { margin: 0 0 0.85rem; }
.rb-item-head {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: baseline;
}
.rb-item-title { margin: 0; font-size: 1.02rem; font-weight: 720; }
.rb-item-meta { margin: 0.12rem 0 0; color: #64748b; font-size: 0.9rem; }
.rb-dates { margin: 0; color: #64748b; font-size: 0.86rem; white-space: nowrap; }
.rb-bullets { margin: 0.28rem 0 0; padding: 0; padding-inline-start: 1.1rem; }
.rb-bullets li { margin: 0.12rem 0; }

.rb-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.rb-tag {
    border: 1px solid color-mix(in srgb, var(--rb-accent, #0f766e) 45%, #cbd5e1);
    color: #1e293b;
    border-radius: 999px;
    padding: 0.12rem 0.55rem;
    font-size: 0.84rem;
}

.rb-sheet--classic .rb-head {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
    padding-bottom: 0.9rem;
    border-bottom: 2px solid var(--rb-accent, #1e293b);
}
.rb-sheet--classic .rb-head-text { flex: none; max-width: 100%; }
.rb-sheet--classic .rb-name { font-family: Georgia, "Times New Roman", serif; font-weight: 700; }
.rb-sheet--classic .rb-contacts { justify-content: center; }
.rb-sheet--classic .rb-photo { width: 6rem; height: 6rem; }

.rb-sheet--modern { padding-top: 0; }
.rb-sheet--modern .rb-bar { height: 0.55rem; background: var(--rb-accent, #0f766e); margin: 0 -2.1rem 1.4rem; }
.rb-sheet--modern .rb-section { border-inline-start: 3px solid var(--rb-accent, #0f766e); padding-inline-start: 0.8rem; }

.rb-sheet--compact { padding: 1.25rem 1.4rem; min-height: 28rem; }
.rb-sheet--compact .rb-name { font-size: 1.45rem; }
.rb-sheet--compact .rb-section { margin-top: 0.75rem; }
.rb-sheet--compact .rb-item { margin-bottom: 0.5rem; }
.rb-sheet--compact .rb-photo { width: 4.4rem; height: 4.4rem; }

/* Timeline: the dates in a column, a line with a dot per entry. */
.rb-sheet--timeline .rb-item { margin: 0; }
.rb-tl-item {
    display: grid;
    grid-template-columns: 6.2rem 1fr;
    column-gap: 1.25rem;
}
.rb-tl-item .rb-dates { white-space: normal; font-size: 0.8rem; font-weight: 600; padding-top: 0.15rem; }
.rb-tl-body {
    position: relative;
    padding-inline-start: 1.25rem;
    padding-bottom: 0.9rem;
    border-inline-start: 2px solid color-mix(in srgb, var(--rb-accent, #0f766e) 35%, #ffffff);
    min-width: 0;
}
.rb-tl-body::before {
    content: "";
    position: absolute;
    top: 0.3rem;
    inset-inline-start: calc(-0.4rem - 1px);
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    background: var(--rb-accent, #0f766e);
}
.rb-tl-item:last-child .rb-tl-body { padding-bottom: 0.4rem; }

/* Executive: a centred serif name, the title in spaced capitals, a double rule; education and skills on the right. */
.rb-sheet--executive .rb-head {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 3px double #0f172a;
}
.rb-sheet--executive .rb-head-text { flex: none; max-width: 100%; }
.rb-sheet--executive .rb-name { font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 2.3rem; letter-spacing: 0; }
.rb-sheet--executive .rb-role { text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.8rem; font-weight: 700; }
.rb-sheet--executive .rb-contacts { justify-content: center; font-size: 0.86rem; }
.rb-sheet--executive .rb-kicker::after {
    content: "";
    display: block;
    width: 1.8rem;
    height: 2px;
    margin-top: 0.35rem;
    background: var(--rb-accent, #0f766e);
}
.rb-cols { display: grid; grid-template-columns: 1fr 34%; gap: 2.1rem; margin-top: 0.4rem; }
.rb-cols > .rb-main { padding: 0; }
.rb-aside > .rb-section:first-child { margin-top: 0; }
.rb-aside .rb-item-head { flex-direction: column; gap: 0.1rem; }
.rb-aside .rb-dates { white-space: normal; }
.rb-aside .rb-tags { display: block; }
.rb-aside .rb-tag { border: 0; border-radius: 0; padding: 0.1rem 0; display: flex; align-items: center; gap: 0.55rem; font-size: 0.9rem; }
.rb-aside .rb-tag::before { content: ""; flex: none; width: 0.32rem; height: 0.32rem; background: var(--rb-accent, #0f766e); }

/* Creative: a band in the accent with the name in white, the photo on its lower edge, filled skill pills. */
.rb-sheet--creative { padding-top: 0; }
.rb-band {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.2rem;
    margin: 0 -2.1rem;
    padding: 2.1rem 2.1rem 1.6rem;
    background: var(--rb-accent, #0f766e);
    color: #fff;
}
.rb-band .rb-name { font-size: 2.4rem; font-weight: 800; }
.rb-band .rb-muted-name { color: rgba(255, 255, 255, 0.65); }
.rb-band .rb-role { color: rgba(255, 255, 255, 0.88); }
.rb-band .rb-photo {
    width: 8rem;
    height: 8rem;
    margin-bottom: -5.6rem;
    border: 0.4rem solid #fff;
    background: #e2e8f0;
}
.rb-band-under { min-height: 1rem; padding-inline-end: 9.5rem; }
.rb-sheet--creative:not(.rb-sheet--photo) .rb-band-under { padding-inline-end: 0; }
.rb-sheet--creative .rb-kicker { color: #0f172a; display: flex; align-items: center; gap: 0.55rem; }
.rb-sheet--creative .rb-kicker::before { content: ""; flex: none; width: 0.6rem; height: 0.6rem; background: var(--rb-accent, #0f766e); }
.rb-sheet--creative .rb-tag {
    border: 0;
    background: color-mix(in srgb, var(--rb-accent, #0f766e) 13%, #ffffff);
    color: color-mix(in srgb, var(--rb-accent, #0f766e) 85%, #000000);
    font-weight: 600;
    padding: 0.2rem 0.7rem;
}
.rb-sheet--creative .rb-bullets li::marker { color: var(--rb-accent, #0f766e); }

/* Minimal: white space, hairlines, the section labels in a column of their own. */
.rb-sheet--minimal { padding: 2.6rem 2.7rem 2.2rem; }
.rb-sheet--minimal .rb-name { font-weight: 400; font-size: 2.1rem; letter-spacing: -0.01em; }
.rb-sheet--minimal .rb-role { color: #64748b; text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.74rem; font-weight: 600; }
.rb-sheet--minimal .rb-contacts { gap: 0.25rem 1.6rem; font-size: 0.86rem; }
.rb-sheet--minimal .rb-photo { width: 4.6rem; height: 4.6rem; }
.rb-sheet--minimal .rb-section {
    display: grid;
    grid-template-columns: 8.3rem 1fr;
    margin-top: 1.4rem;
    padding-top: 1.4rem;
    border-top: 1px solid #e2e8f0;
}
.rb-sheet--minimal .rb-kicker { font-size: 0.68rem; letter-spacing: 0.14em; padding-top: 0.2rem; }
.rb-sec-body { min-width: 0; }
.rb-sheet--minimal .rb-tags { display: block; }
.rb-sheet--minimal .rb-tag { display: inline; border: 0; padding: 0; font-size: 0.9rem; }
.rb-sheet--minimal .rb-tag + .rb-tag::before { content: "  ·  "; white-space: pre; color: #94a3b8; }

.rb-sheet--sidebar {
    display: grid;
    grid-template-columns: 34% 1fr;
    padding: 0;
    overflow: hidden;
}
.rb-side {
    background: var(--rb-accent, #0f766e);
    color: #fff;
    padding: 1.6rem 1.15rem;
    min-width: 0;
}
.rb-side .rb-photo { width: 7.5rem; height: 7.5rem; margin-bottom: 1rem; background: rgba(255, 255, 255, 0.2); }
.rb-side .rb-name { font-size: 1.55rem; }
.rb-side .rb-muted-name { color: rgba(255, 255, 255, 0.6); }
.rb-side .rb-role { color: rgba(255, 255, 255, 0.88); }
.rb-side .rb-contacts { color: rgba(255, 255, 255, 0.88); display: grid; gap: 0.2rem; }
.rb-side .rb-kicker { color: rgba(255, 255, 255, 0.72); margin-top: 1.2rem; }
.rb-side-skills { margin: 0; padding: 0; list-style: none; }
.rb-side-skills li { margin: 0.2rem 0; }
.rb-main { padding: 1.6rem 1.3rem 1.4rem; min-width: 0; }
.rb-main > .rb-section:first-child { margin-top: 0; }

/* Controls */

/* The layouts and the form's tabs as even grids: the words differ a lot in length between languages. */
.ak-app .rb-templates { display: grid; grid-template-columns: 1fr 1fr; }
.ak-app .rb-tabs { display: grid; grid-template-columns: repeat(3, 1fr); }
.ak-app .rb-templates .ak-seg-btn,
.ak-app .rb-tabs .ak-seg-btn { min-width: 0; padding-inline: 0.4rem; overflow-wrap: anywhere; }
.rb-swatches { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.2rem; }
.rb-swatch {
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 999px;
    background: var(--rb-swatch, #1e293b);
    border: 2px solid var(--ak-panel, #fff);
    box-shadow: 0 0 0 1px var(--ak-border, #cbd5e1);
    padding: 0;
    cursor: pointer;
}
.rb-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ak-text, #0f172a); }
.rb-swatch:focus-visible { outline: 2px solid var(--ak-accent, #2563eb); outline-offset: 3px; }

.rb-docs, .rb-cards, .rb-skills {
    list-style: none;
    margin: 0 0 0.55rem;
    padding: 0;
    display: grid;
    gap: 0.4rem;
}
.rb-docs:empty, .rb-cards:empty, .rb-skills:empty { display: none; }
.rb-doc { display: flex; align-items: center; gap: 0.35rem; }
.rb-doc-pick {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    background: none;
    border: 1px solid var(--ak-border, #e2e8f0);
    border-radius: 6px;
    padding: 0.35rem 0.55rem;
    text-align: start;
    cursor: pointer;
    color: inherit;
    font: inherit;
    overflow-wrap: anywhere;
}
.rb-doc-pick:focus-visible { outline: 2px solid var(--ak-accent, #2563eb); outline-offset: 1px; }
.rb-doc.is-on .rb-doc-pick {
    border-color: var(--ak-accent, #2563eb);
    box-shadow: 0 0 0 1px var(--ak-accent, #2563eb);
}
.rb-doc-sub { font-size: 0.8rem; color: var(--ak-muted, #64748b); }
.rb-doc-sub:empty { display: none; }
.rb-card {
    border: 1px solid var(--ak-border, #e2e8f0);
    border-radius: 8px;
    padding: 0.55rem;
    display: grid;
    gap: 0.35rem;
}
.rb-card-bar { display: flex; justify-content: flex-end; gap: 0.25rem; }
.rb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem 0.5rem; }
.rb-skill { display: flex; gap: 0.35rem; align-items: center; }
.rb-skill .ak-field { flex: 1 1 auto; min-width: 0; }
.rb-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; margin-bottom: 0.45rem; }

.rb-photo-row { display: flex; align-items: center; gap: 0.5rem; }
.rb-photo-thumb {
    flex: none;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    overflow: hidden;
    background: var(--ak-field, #fff);
    border: 1px solid var(--ak-border, #cbd5e1);
}
.rb-photo-thumb.is-empty { border-style: dashed; }
.rb-photo-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }

@media (max-width: 720px) {
    .rb-sheet { padding: 1.1rem 0.9rem; min-height: 0; }
    .rb-sheet--modern { padding-top: 0; }
    .rb-sheet--modern .rb-bar { margin-left: -0.9rem; margin-right: -0.9rem; }
    .rb-sheet--sidebar { grid-template-columns: 1fr; padding: 0; }
    .rb-cols { grid-template-columns: 1fr; gap: 0; }
    .rb-tl-item { grid-template-columns: 1fr; }
    .rb-tl-item .rb-dates { padding-inline-start: 1.25rem; border-inline-start: 2px solid color-mix(in srgb, var(--rb-accent, #0f766e) 35%, #ffffff); }
    .rb-sheet--minimal { padding: 1.3rem 1rem; }
    .rb-sheet--minimal .rb-section { grid-template-columns: 1fr; }
    .rb-band { margin: 0 -0.9rem; padding: 1.4rem 0.9rem 1.2rem; }
    .rb-band .rb-photo { width: 5.5rem; height: 5.5rem; margin-bottom: -3.6rem; }
    .rb-band-under { padding-inline-end: 6.5rem; }
    .rb-side { padding: 1.1rem 0.9rem; }
    .rb-main { padding: 1.1rem 0.9rem; }
    .rb-item-head { flex-direction: column; gap: 0.1rem; }
    .rb-dates { white-space: normal; }
    .rb-grid { grid-template-columns: 1fr; }
    .rb-grid-gap { display: none; }
    .rb-name { font-size: 1.55rem; }
    .rb-photo { width: 4.5rem; height: 4.5rem; }
    .rb-side .rb-photo { width: 5.5rem; height: 5.5rem; }
}

/* Print (the Print button, or the browser's own Print): only the resume, on white, without the site around it.
   The engine puts a copy of the page in table.rb-print at the end of the body and sets html.rb-printing while
   the print dialog is open. The page has no margin, so the browser adds no header or footer; the table's head
   and foot leave the same space at the top and bottom of every sheet of paper instead. */

.rb-print { display: none; }

@media print {
    @page { margin: 0; }

    html.rb-printing { font-size: 10pt !important; }    /* the page's sizes are in rem: 10 pt text on paper */
    html.rb-printing,
    html.rb-printing body {
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: #fff !important;
    }
    html.rb-printing body > *:not(.rb-print) { display: none !important; }

    .rb-print {
        display: table;
        width: 100%;
        border-collapse: collapse;
        table-layout: fixed;
        font-size: 1rem;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .rb-print td { padding: 0; }
    .rb-print .rb-print-edge { height: 13mm; }

    .rb-print .rb-sheet {
        min-height: 0;
        padding: 0 15mm;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
    }
    .rb-print .rb-item,
    .rb-print .rb-head,
    .rb-print .rb-bullets li,
    .rb-print .rb-tag { break-inside: avoid; }
    .rb-print .rb-kicker,
    .rb-print .rb-item-head { break-after: avoid; }

    /* The colour bar and the coloured column run to the paper's edge, on every sheet. */
    .rb-print .rb-sheet--modern .rb-bar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 4mm;
        margin: 0;
    }
    .rb-print .rb-sheet--creative .rb-band { margin: 0 -15mm; padding: 10mm 15mm 7mm; }
    .rb-print .rb-tl-body,
    .rb-print .rb-cols > * { break-inside: auto; }
    .rb-print .rb-sheet--minimal { padding: 0 18mm; }
    .rb-print .rb-sheet--sidebar { display: block; padding: 0; }
    .rb-print .rb-sheet--sidebar::before {
        content: "";
        position: fixed;
        top: 0;
        bottom: 0;
        inset-inline-start: 0;
        width: 34%;
        background: var(--rb-accent, #0f766e);
    }
    .rb-print .rb-side {
        position: relative;
        float: inline-start;
        width: 34%;
        box-sizing: border-box;
        padding: 0;
        padding-inline: 10mm 8mm;
        background: none;
    }
    .rb-print .rb-main {
        margin-inline-start: 34%;
        padding: 0;
        padding-inline: 9mm 12mm;
    }
}
