/* OfferPilots web pages — confidence-tuned palette, matching the extension panel:
   calm neutral base, gold as a sparing accent, green for "good", red for errors.
   The authenticated shell defaults to Light and exposes an explicit Dark preview. */

:root,
:root[data-app-theme="light"] {
    --surface: #ffffff;
    --surface-2: #f5f6f5;
    --surface-3: #eef0ee;
    --ink: #202a2d;
    --muted: #5f6a6c;
    --faint: #6b7678;
    --line: #e4e7e5;
    --line-2: #d5d9d6;
    --brand: #b9821a;
    --brand-ink: #8a6410;
    --brand-soft: #f6ecd0;
    --on-brand: #2a2113;
    --good: #2f9e58;
    --good-bg: #e7f5ec;
    --good-ink: #1c7a42;
    --bad: #cf4b5e;
    --bad-bg: #fbe9ec;
    --bad-ink: #a72d40;
    --shadow: 0 2px 6px rgba(28, 38, 38, .06), 0 12px 30px rgba(28, 38, 38, .10);
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

:root[data-app-theme="dark"] {
    --surface: #172020;
    --surface-2: #1e2827;
    --surface-3: #26302f;
    --ink: #e8ecea;
    --muted: #94a09f;
    --faint: #7f8c8a;
    --line: #283432;
    --line-2: #35423f;
    --brand: #d9a63a;
    --brand-ink: #e8bd5c;
    --brand-soft: #33280f;
    --on-brand: #241a06;
    --good: #4bb572;
    --good-bg: #14311f;
    --good-ink: #6fd096;
    --bad: #e26b7c;
    --bad-bg: #341a20;
    --bad-ink: #f0919e;
    --shadow: 0 2px 8px rgba(0, 0, 0, .4), 0 14px 34px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
    font-family: var(--sans);
    color: var(--ink);
    background: var(--surface-2);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-ink); }

:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    z-index: 1000;
    top: .5rem;
    left: .75rem;
    padding: .65rem .9rem;
    border-radius: 9px;
    color: var(--on-brand);
    background: var(--brand);
    font-weight: 750;
    text-decoration: none;
    transform: translateY(-150%);
    transition: transform .18s ease;
}
.skip-link:focus { transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
    .skip-link { transition: none; }
}

/* ── shared OfferPilots application shell ───────────────────────── */
.app-shell-head { position: sticky; top: 0; z-index: 100; }
.app-nav {
    min-height: 64px;
    display: grid;
    grid-template-columns: minmax(170px, 1fr) auto minmax(240px, 1fr);
    align-items: center;
    gap: 1rem;
    padding: .65rem 1.25rem;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(16px);
}
.app-brand {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: var(--ink);
    letter-spacing: -.025em;
    text-decoration: none;
}
.app-brand img { display: block; object-fit: contain; }
.op-wordmark { display: inline-flex; align-items: baseline; }
.op-wordmark-offer { font-weight: 850; }
.op-wordmark-pilots { font-weight: 400; }
.app-workflow-nav { display: flex; align-items: center; gap: .28rem; }
.app-workflow-nav a {
    min-height: 39px;
    display: inline-flex;
    align-items: center;
    padding: .48rem .78rem;
    border-radius: 9px;
    color: var(--muted);
    font-size: .88rem;
    font-weight: 650;
    text-decoration: none;
}
.app-workflow-nav a:hover { color: var(--ink); background: var(--surface-2); }
.app-workflow-nav a.active {
    color: var(--brand-ink);
    background: var(--brand-soft);
}
.app-nav-actions { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: .7rem; min-width: 0; }
.app-utility-link {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
}
.app-utility-link:hover { color: var(--ink); }
.app-selector-button {
    min-width: 34px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    padding: .35rem .5rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--muted);
    background: var(--surface);
    font: inherit;
    font-size: .76rem;
    font-weight: 750;
    cursor: pointer;
    list-style: none;
}
.app-selector-button::-webkit-details-marker { display: none; }
.app-selector-button:hover { color: var(--ink); background: var(--surface-2); }
.app-language-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: .28rem .66rem;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    color: var(--muted);
    background: var(--surface);
    font: inherit;
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
}
.app-language-toggle:hover { color: var(--ink); background: var(--surface-2); }
.app-language-short { display: none; }
.account-menu { position: relative; }
.account-menu > summary {
    max-width: 220px;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .3rem .45rem;
    border-radius: 10px;
    cursor: pointer;
    list-style: none;
}
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary:hover { background: var(--surface-2); }
.account-avatar {
    width: 30px;
    height: 30px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--on-brand);
    background: var(--brand);
    font-size: .76rem;
    font-weight: 850;
}
.account-email { overflow: hidden; color: var(--muted); font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.account-popover {
    position: absolute;
    top: calc(100% + .55rem);
    right: 0;
    width: 220px;
    display: grid;
    padding: .55rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.account-popover-email { padding: .45rem .55rem .6rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .73rem; overflow-wrap: anywhere; }
.account-popover a,.account-popover button {
    width: 100%;
    display: block;
    padding: .55rem;
    border: 0;
    border-radius: 8px;
    color: var(--ink);
    background: transparent;
    font: inherit;
    font-size: .82rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.account-popover a:hover,.account-popover button:hover { background: var(--surface-2); }
.account-popover form { margin: 0; border-top: 1px solid var(--line); }

@media (max-width: 980px) {
    .app-nav { grid-template-columns: auto 1fr auto; }
    .account-email,.app-utility-link { display: none; }
}
@media (max-width: 720px) {
    .app-nav {
        position: relative;
        grid-template-columns: 1fr auto;
        gap: .45rem;
        padding: .55rem .8rem .4rem;
    }
    .app-brand > .op-wordmark { font-size: .9rem; }
    .app-nav-actions { grid-column: 2; grid-row: 1; }
    .app-workflow-nav {
        grid-column: 1 / -1;
        grid-row: 2;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        width: 100%;
    }
    .app-workflow-nav a { justify-content: center; padding-inline: .35rem; font-size: .76rem; }
}
@media (max-width: 420px) {
    .app-language-toggle { min-width: 34px; padding-inline: .45rem; }
    .app-language-long { display: none; }
    .app-language-short { display: inline; }
}

/* ── nav ─────────────────────────────────────────────────────────── */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem 1.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-weight: 700;
    letter-spacing: -.01em;
    text-decoration: none;
    color: var(--ink);
}
.brand-mark { color: var(--brand); }
.nav-right { display: flex; align-items: center; gap: .6rem; }
.nav-user { color: var(--muted); font-size: .85rem; margin-right: .25rem; }
.inline { display: inline; margin: 0; }

/* ── buttons ─────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .55rem .9rem;
    border-radius: 10px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
}
.btn.primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn.primary:hover { filter: brightness(1.04); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--surface); color: #b42318; border-color: #f0c2bd; }
.btn.danger:hover { background: #fef3f2; border-color: #e0a29b; }
.clear-row { margin-top: .5rem; }
.btn.block { width: 100%; padding: .7rem; font-size: .95rem; }

/* ── layout ──────────────────────────────────────────────────────── */
.page { max-width: 880px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.page-head { margin-bottom: 1.5rem; }
.head-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .8rem; }
.head-actions .restore-form { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.head-actions .restore-form input[type=file] { font-size: .74rem; max-width: 13rem; }
.eyebrow {
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: .4rem;
}
h1 { font-size: 1.7rem; letter-spacing: -.02em; margin: .1rem 0 .3rem; text-wrap: balance; }
h2 { font-size: 1.15rem; letter-spacing: -.01em; margin: 0 0 .3rem; }
h3 { font-size: 1rem; margin: 0 0 .3rem; }
.muted { color: var(--muted); }
.center { text-align: center; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

/* ── auth pages ──────────────────────────────────────────────────── */
.auth {
    display: flex;
    justify-content: center;
    padding: 3rem 1.25rem;
}
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { margin-top: .1rem; }
.form { display: flex; flex-direction: column; gap: .8rem; margin-top: 1.2rem; }
.field { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--muted); }
.field input {
    padding: .6rem .7rem;
    border: 1px solid var(--line-2);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--ink);
    font: inherit;
}
.field input:focus {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
    background: var(--surface);
}
.auth-card .muted.center { margin-top: 1rem; }

/* "or with email" divider between the Google button and the form */
.or-sep { display: flex; align-items: center; gap: .6rem; margin: 1rem 0 .1rem; color: var(--faint); font-size: .72rem; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn.google { gap: .5rem; }

/* ── alerts ──────────────────────────────────────────────────────── */
.alert {
    margin-top: 1rem;
    padding: .55rem .7rem;
    border-radius: 10px;
    font-size: .85rem;
    border: 1px solid;
}
.alert.error { background: var(--bad-bg); color: var(--bad-ink); border-color: var(--bad); }
.alert.ok { background: var(--good-bg); color: var(--good-ink); border-color: var(--good); }

/* ── dashboard ───────────────────────────────────────────────────── */
.cta-card { display: flex; flex-direction: column; align-items: flex-start; gap: .6rem; }
.cta-card .btn { margin-top: .4rem; }
.ready { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--good-ink); margin-bottom: .3rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.ok { background: var(--good); }
.tile-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-top: 1rem; }
.tile {
    padding: .8rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
    font-size: .85rem;
    font-weight: 600;
    text-align: center;
}
.tile.disabled { color: var(--faint); }
.soon {
    font-family: var(--mono);
    font-size: .6rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--brand-ink);
    background: var(--brand-soft);
    border-radius: 999px;
    padding: .1rem .35rem;
    margin-left: .3rem;
    white-space: nowrap;
}

/* ── dashboard stats (C2) ────────────────────────────────────────── */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-bottom: 1rem; }
.stat { display: flex; flex-direction: column; gap: .2rem; padding: 1rem; }
.stat-n { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.stat-n-sm { font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-l { font-size: .8rem; color: var(--muted); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .6rem; }
.company-list, .recent-list { list-style: none; margin: .4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.company-list li, .recent-list li { display: flex; align-items: center; gap: .6rem; font-size: .92rem; }
.recent-list a { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; color: var(--ink); font-weight: 600; }
.recent-list a:hover { color: var(--brand-ink); }
.doc-chip { font-size: .68rem; font-weight: 600; padding: .12rem .45rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.company-list li span:first-child { font-weight: 600; }
@media (max-width: 720px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }

/* ── generate: fetch-by-URL row (D5) ─────────────────────────────── */
.fetch-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.fetch-row input[type=url] { flex: 1; min-width: 15rem; padding: .55rem .7rem; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); color: var(--ink); font: inherit; }

/* ── settings (D2) ───────────────────────────────────────────────── */
.settings-stack { display: flex; flex-direction: column; gap: .9rem; }
.app-preferences-card .section-head { margin-bottom: .25rem; }
.app-preference-list { margin-top: .8rem; border-top: 1px solid var(--line); }
.app-preference-row {
    display: grid;
    grid-template-columns: minmax(250px, 1fr) auto;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}
.app-preference-copy { display: grid; gap: .2rem; }
.app-segmented-control {
    display: inline-flex;
    gap: .25rem;
    padding: .25rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
}
.app-segmented-control button {
    min-width: 104px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .5rem .7rem;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
}
.app-segmented-control button[aria-checked="true"] {
    color: var(--brand-ink);
    border-color: var(--line-2);
    background: var(--surface);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}
.app-theme-swatch {
    width: .7rem;
    height: .7rem;
    margin-right: .35rem;
    border: 1px solid var(--line-2);
    border-radius: 50%;
}
.app-theme-swatch.light { background: #ffffff; }
.app-theme-swatch.dark { background: #172020; }
.meter-list { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.meter-list li { display: grid; grid-template-columns: 1fr 140px 56px; align-items: center; gap: .6rem; font-size: .85rem; }
.pm-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.pm-track { height: 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.pm-fill { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.pm-n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 560px) { .meter-list li { grid-template-columns: 1fr 80px 52px; } }
@media (max-width: 700px) {
    .app-preference-row { grid-template-columns: 1fr; }
    .app-segmented-control { width: 100%; }
    .app-segmented-control button { flex: 1; min-width: 0; }
}

/* ── system settings (DEV-only model routing, Task 6) ───────────── */
.sys-current-list { list-style: none; margin: .6rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.sys-current-list li { display: flex; justify-content: space-between; gap: .8rem; font-size: .9rem; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.sys-current-list li:last-child { border-bottom: none; }
.sys-check { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--muted); }
.sys-check input { width: auto; }
.sys-table-scroll { overflow-x: auto; margin-top: .6rem; }
.sys-keys-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.sys-keys-table th, .sys-keys-table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sys-keys-table th { color: var(--muted); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; }
.sys-keys-status { font-weight: 600; }
.sys-keys-status.ok { color: var(--good-ink); }
.sys-keys-status.missing { color: var(--bad-ink); }

/* ── hybrid onboarding ──────────────────────────────────────────── */
.onboarding-page { max-width: 1080px; }
.onboarding-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; }
.onboarding-head h1 { max-width: 700px; font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.08; }
.onboarding-overview { display: grid; grid-template-columns: 1.05fr .95fr; gap: 1.4rem; padding: 1rem; }
.onboarding-video-frame { min-height: 310px; overflow: hidden; border-radius: 12px; background: #172225; }
.onboarding-video-frame video { width: 100%; height: 100%; display: block; object-fit: cover; }
.onboarding-video-fallback {
    height: 100%;
    min-height: 310px;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: .45rem;
    padding: 1.5rem;
    color: #edf2f0;
    background: radial-gradient(circle at 50% 20%, #2d3d3c, #172225 70%);
    text-align: center;
}
.onboarding-video-fallback span { color: #e7b64f; font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }
.onboarding-video-fallback strong { font-size: 1.25rem; }
.onboarding-video-fallback p { max-width: 280px; margin: 0; color: #a8b5b2; font-size: .85rem; }
.onboarding-transcript { padding: 1rem .6rem; }
.onboarding-transcript h2 { margin-bottom: 1rem; font-size: 1.45rem; }
.onboarding-transcript ol { display: grid; gap: .7rem; margin: 0; padding: 0; list-style: none; }
.onboarding-transcript li { display: grid; grid-template-columns: 95px 1fr; gap: .8rem; padding-top: .7rem; border-top: 1px solid var(--line); }
.onboarding-transcript b { color: var(--brand-ink); }
.onboarding-transcript span { color: var(--muted); font-size: .84rem; }
.onboarding-steps { display: grid; gap: .9rem; margin-top: 2rem; }
.onboarding-section-head { margin-bottom: .2rem; }
.onboarding-step { display: grid; grid-template-columns: 48px 1fr; gap: 1rem; }
.onboarding-step .step-no { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); }
.onboarding-step-copy > h3 { font-size: 1.08rem; }
.onboarding-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin-top: 1rem; }
.onboarding-option { display: grid; gap: .35rem; padding: .9rem; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); text-decoration: none; }
.onboarding-option:hover { border-color: var(--brand); background: var(--brand-soft); }
.onboarding-option b { font-size: .86rem; }
.onboarding-option span { color: var(--muted); font-size: .76rem; }
.onboarding-inline-note { display: inline-flex; gap: .5rem; margin-top: .7rem; padding: .55rem .7rem; border-radius: 9px; color: var(--muted); background: var(--surface-2); font-size: .78rem; }
.onboarding-step-primary { border-color: var(--brand); background: linear-gradient(135deg, var(--surface), var(--brand-soft)); }
@media (max-width: 780px) {
    .onboarding-head { flex-direction: column; }
    .onboarding-overview { grid-template-columns: 1fr; }
    .onboarding-options { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .onboarding-step { grid-template-columns: 1fr; }
    .onboarding-transcript li { grid-template-columns: 1fr; gap: .2rem; }
}

/* ── welcome steps ───────────────────────────────────────────────── */
.steps { list-style: none; margin: 0 0 1.5rem; padding: 0; display: flex; flex-direction: column; gap: .8rem; }
.step { display: flex; align-items: flex-start; gap: 1rem; }
.step-no {
    font-family: var(--mono);
    font-weight: 700;
    color: var(--brand);
    font-size: 1.1rem;
    flex: none;
    width: 2rem;
}

/* ── home / hero ─────────────────────────────────────────────────── */
.hero { text-align: center; padding: 3rem 0 2.5rem; }
.hero-title { font-size: 2.4rem; letter-spacing: -.03em; margin: .3rem 0; }
.hero-sub { color: var(--muted); max-width: 34rem; margin: .5rem auto 0; }
.hero-cta { display: flex; gap: .6rem; justify-content: center; margin-top: 1.5rem; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.feature h3 { color: var(--ink); }

@media (max-width: 640px) {
    .tile-row, .feature-grid { grid-template-columns: 1fr; }
    .hero-title { font-size: 1.8rem; }
    .nav-user { display: none; }
}

/* ── profile page ────────────────────────────────────────────────── */
.profile-page { max-width: 1280px; }
.profile-workspace-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; }
.profile-workspace-head > div:first-child { max-width: 760px; }
.profile-strength-card {
    min-width: 250px;
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .85rem 1rem;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.profile-strength-ring {
    --profile-strength: 0;
    width: 64px;
    height: 64px;
    flex: none;
    display: grid;
    place-items: center;
    position: relative;
    border-radius: 50%;
    background: conic-gradient(var(--brand) calc(var(--profile-strength) * 1%), var(--surface-3) 0);
}
.profile-strength-ring::before { content: ""; position: absolute; inset: 6px; border-radius: inherit; background: var(--surface); }
.profile-strength-ring span { position: relative; z-index: 1; color: var(--ink); font-size: .82rem; font-weight: 850; }
.profile-strength-card b { display: block; font-size: .86rem; }
.profile-strength-card p { margin: .15rem 0 0; color: var(--muted); font-size: .75rem; }
.profile-section-nav {
    position: sticky;
    z-index: 30;
    top: 64px;
    display: flex;
    gap: .25rem;
    overflow-x: auto;
    margin: 0 0 1rem;
    padding: .45rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(12px);
    scrollbar-width: thin;
}
.profile-section-nav a { flex: none; padding: .42rem .65rem; border-radius: 8px; color: var(--muted); font-size: .76rem; font-weight: 650; text-decoration: none; }
.profile-section-nav a:hover { color: var(--ink); background: var(--surface-2); }
.profile-workspace { margin-top: 0; }
.profile-workspace .card[id], .profile-anchor { scroll-margin-top: 132px; }
.profile-anchor { position: absolute; }
.profile-tools { top: 124px; }
.optional-answers { border-style: dashed; }
.optional-answers > h2::after {
    content: "Not included in profile strength";
    display: inline-block;
    margin-left: .55rem;
    padding: .12rem .4rem;
    border-radius: 999px;
    color: var(--faint);
    background: var(--surface-2);
    font-family: var(--mono);
    font-size: .58rem;
    letter-spacing: .04em;
    vertical-align: middle;
}
.empty-brand-mark { display: block; margin: 0 auto .6rem; object-fit: contain; }
.profile-grid { display: grid; grid-template-columns: minmax(360px, 440px) 1fr; gap: 1.5rem; align-items: start; margin-top: 1rem; }
.build-col, .view-col, .view-stack { display: flex; flex-direction: column; gap: 1rem; }
.build-col { position: sticky; top: 1rem; }
.small { font-size: .82rem; }
.build-form { display: flex; flex-direction: column; gap: .8rem; margin-top: .9rem; }
.build-form .field span { font-size: .82rem; color: var(--muted); margin-bottom: .3rem; display: block; }
.build-form textarea,
.link-add input {
    width: 100%;
    padding: .6rem .7rem;
    border: 1px solid var(--line-2);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--ink);
    font: inherit;
    resize: vertical;
}
.build-form textarea:focus,
.link-add input:focus { outline: 2px solid var(--brand); outline-offset: 1px; background: var(--surface); }

/* material upload — drop zone, selected-file list, and the stored-materials list */
.upload-sep { display: flex; align-items: center; gap: .7rem; margin: 1rem 0 .2rem; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; }
.upload-sep::before, .upload-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.upload-form { display: flex; flex-direction: column; gap: .7rem; margin-top: .6rem; }
.upload-drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
    padding: 1.5rem 1rem; text-align: center; cursor: pointer;
    border: 1.5px dashed var(--line-2); border-radius: 12px; background: var(--surface-2);
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.upload-drop:hover { border-color: var(--brand); background: var(--surface); }
.upload-drop:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.upload-drop.is-dragover { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-1px); }
.upload-drop-icon { font-size: 1.4rem; color: var(--brand-ink); line-height: 1; }
.upload-drop-title { font-size: .9rem; font-weight: 600; color: var(--ink); }
.upload-drop-hint { font-size: .78rem; }

.upload-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.upload-item { display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); font-size: .84rem; }
.upload-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.upload-item-size { flex: none; }
.upload-item-remove, .materials-del { flex: none; border: none; background: none; cursor: pointer; color: var(--muted); font-size: .95rem; line-height: 1; padding: .1rem .3rem; border-radius: 6px; }
.upload-item-remove:hover, .materials-del:hover { color: #c0392b; background: var(--surface); }

.materials { margin-top: 1rem; }
.materials-title { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-ink); margin: 0 0 .5rem; border-top: 1px solid var(--line); padding-top: .7rem; }
.materials-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.materials-row { display: flex; align-items: center; gap: .5rem; font-size: .84rem; }
.materials-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--brand-ink); text-decoration: none; }
.materials-name:hover { text-decoration: underline; }
.materials-meta { flex: none; }
.materials-row .inline { flex: none; margin: 0; }

/* application answers — labelled selects + pronouns input, same field styling as the build form */
.answers-form { display: flex; flex-direction: column; gap: .7rem; margin-top: .9rem; }
.answers-form .field span { font-size: .82rem; color: var(--muted); margin-bottom: .3rem; display: block; }
.answers-form select,
.answers-form input {
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid var(--line-2);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--ink);
    font: inherit;
}
.answers-form select:focus,
.answers-form input:focus { outline: 2px solid var(--brand); outline-offset: 1px; background: var(--surface); }
.answers-form .btn { margin-top: .3rem; }
.answers-group-label { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-ink); margin-top: .5rem; border-top: 1px solid var(--line); padding-top: .7rem; }

.link-list { list-style: none; margin: .7rem 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.link-list li { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.link-label { font-weight: 600; min-width: 4.5rem; }
.link-url { color: var(--brand-ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.link-add { display: flex; gap: .4rem; margin-top: .6rem; flex-wrap: wrap; }
.link-add input { flex: 1; min-width: 8rem; }
.btn.tiny { padding: .3rem .5rem; font-size: .74rem; border-radius: 8px; }

.profile-header h2 { font-size: 1.55rem; margin-bottom: .1rem; }
.prole { color: var(--muted); margin: .1rem 0 .5rem; }
.yoe { color: var(--ink); font-weight: 600; }
.pmeta { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .92rem; color: var(--muted); }
.pmeta-item { display: inline-flex; align-items: center; gap: .35rem; }
.pmeta-item svg { width: 14px; height: 14px; color: var(--faint); flex: none; }

.entry { padding: .75rem 0; border-top: 1px solid var(--line); }
.entry:first-of-type { border-top: none; padding-top: .2rem; }
.entry-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.entry-title { font-weight: 700; font-size: 1.03rem; }
.entry-sub { color: var(--muted); font-size: .96rem; }
.entry-dates { font-size: .84rem; color: var(--faint); text-align: right; white-space: nowrap; }
.entry-loc { display: block; }
.bullets { margin: .5rem 0 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .35rem; font-size: .96rem; }
.entry-desc { font-size: .96rem; margin: .35rem 0 0; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { padding: .28rem .65rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .86rem; }
.skill-group + .skill-group { margin-top: .8rem; }
.skill-cat { font-size: .78rem; font-weight: 700; letter-spacing: .02em; color: var(--brand-ink); margin-bottom: .4rem; text-transform: uppercase; }

/* Origin tag on atoms (A5) — understated "Source: LinkedIn"-style pill next to a title / skill group. */
.src-badge {
    display: inline-block;
    margin-left: .45rem;
    padding: .06rem .42rem;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--faint);
    font-size: .66rem;
    font-weight: 600;
    letter-spacing: .01em;
    text-transform: none;
    vertical-align: middle;
    white-space: nowrap;
}
.view-stack h3 { font-size: 1.1rem; }

.empty { text-align: center; padding: 2.5rem 1.25rem; }
.empty-mark { font-size: 2rem; color: var(--brand); margin-bottom: .4rem; }

/* ── per-section editing (A4) ─────────────────────────────────────── */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.section-head h2, .section-head h3 { margin: 0; }
.entry-actions { display: flex; gap: .4rem; align-items: center; margin-top: .5rem; flex-wrap: wrap; }
.skill-cat-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .4rem; }
.skill-cat-row .skill-cat { margin-bottom: 0; }
.skill-cat-row .entry-actions { margin-top: 0; }

.edit-form { display: flex; flex-direction: column; gap: .6rem; margin: .2rem 0 .4rem; }
.edit-form .field { gap: .2rem; }
.edit-form .field span { font-size: .78rem; color: var(--muted); margin-bottom: .25rem; display: block; }
.edit-form input,
.edit-form textarea {
    width: 100%;
    padding: .5rem .6rem;
    border: 1px solid var(--line-2);
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--ink);
    font: inherit;
    resize: vertical;
}
.edit-form input:focus,
.edit-form textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; background: var(--surface); }
.edit-form .field-row { display: flex; gap: .6rem; }
.edit-form .field-row .field { flex: 1; }
.edit-form .check { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--muted); }
.edit-form .check input { width: auto; }
.edit-form .field em { font-style: normal; }
.edit-actions { display: flex; gap: .5rem; align-items: center; margin-top: .2rem; }

@media (max-width: 820px) {
    .profile-grid { grid-template-columns: 1fr; }
    .build-col { position: static; }
    .profile-workspace-head { flex-direction: column; }
    .profile-strength-card { width: 100%; }
    .profile-section-nav { top: 104px; }
}
@media (max-width: 560px) {
    .profile-section-nav { top: 100px; margin-inline: -1rem; border-radius: 0; }
    .optional-answers > h2::after { display: block; width: max-content; margin: .35rem 0 0; }
}

/* ── generate page (B3) ──────────────────────────────────────────── */
.generate-page { max-width: 1280px; }
.generate-grid { display: grid; grid-template-columns: minmax(360px, 460px) 1fr; gap: 1.5rem; align-items: start; margin-top: 1rem; }
.gen-col { display: flex; flex-direction: column; gap: 1rem; }
.gen-result-col { position: sticky; top: 1rem; }

.doctype-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-top: .8rem; }
.doctype-grid .tile { display: flex; align-items: center; justify-content: center; gap: .3rem; }
.tile.active { border-color: var(--brand); background: var(--brand-soft); color: var(--ink); }

.template-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-top: .8rem; }
.template-opt { display: flex; align-items: center; gap: .5rem; padding: .55rem .7rem; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); font-size: .9rem; cursor: pointer; }
.template-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.template-opt input { accent-color: var(--brand); }

.preset-links { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin: .6rem 0 .8rem; }
.section-checks { display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem .8rem; }
.section-check { display: flex; align-items: center; gap: .45rem; font-size: .88rem; color: var(--ink); }
.section-check input { accent-color: var(--brand); }

.generate-grid textarea {
    width: 100%;
    padding: .6rem .7rem;
    border: 1px solid var(--line-2);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--ink);
    font: inherit;
    resize: vertical;
}
.generate-grid textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; background: var(--surface); }
.generate-grid textarea[disabled] { opacity: .55; cursor: not-allowed; }
.generate-grid .field span { font-size: .82rem; color: var(--muted); margin-bottom: .3rem; display: block; }
.generate-grid .field em { font-style: normal; }

/* résumé preview canvas — the A4 page can be wider than the column, so it scrolls in place. */
.resume-canvas { overflow-x: auto; background: var(--surface-3); padding: 1rem; border-radius: 12px; margin: .3rem 0 .8rem; }
.gen-disclaimer { font-size: .8rem; color: var(--muted); border-left: 3px solid var(--brand); padding-left: .6rem; margin: .6rem 0; }
.md-copy { margin-top: .8rem; }
.md-source { width: 100%; padding: .6rem .7rem; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); color: var(--ink); font-family: var(--mono); font-size: .8rem; resize: vertical; }
.btn.disabled { opacity: .5; pointer-events: none; }

@media (max-width: 900px) {
    .generate-grid { grid-template-columns: 1fr; }
    .gen-result-col { position: static; }
    .doctype-grid, .template-options, .section-checks { grid-template-columns: 1fr; }
}

/* ── editor page (B7) — document workspace: sidebar + main ─────────── */
.editor-page-main { max-width: 1280px; }
.editor-grid { display: grid; grid-template-columns: minmax(260px, 320px) 1fr; gap: 1.5rem; align-items: start; margin-top: 1rem; }
.editor-sidebar { display: flex; flex-direction: column; gap: .7rem; position: sticky; top: 1rem; }

.editor-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    padding: .7rem .8rem;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}
.editor-card.active { border-color: var(--brand); background: var(--brand-soft); }
.editor-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.editor-card-title { font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.editor-card-title:hover { text-decoration: underline; }
.editor-card-meta { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.editor-rename { display: flex; gap: .35rem; }
.editor-rename input {
    flex: 1; min-width: 0;
    padding: .3rem .45rem;
    border: 1px solid var(--line-2);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--ink);
    font: inherit;
    font-size: .8rem;
}
.editor-rename input:focus { outline: 2px solid var(--brand); outline-offset: 1px; background: var(--surface); }
.editor-delete { align-self: flex-start; }

.editor-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: .3rem 0 .5rem; }
.editor-tpl { display: flex; align-items: center; gap: .4rem; }
.editor-tpl-label { display: flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--muted); }
.editor-tpl select {
    padding: .35rem .5rem;
    border: 1px solid var(--line-2);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--ink);
    font: inherit;
    font-size: .82rem;
}
.editor-views { display: flex; gap: .3rem; }
.editor-views .btn.active { border-color: var(--brand); background: var(--brand-soft); color: var(--ink); }
.editor-filename { margin: 0 0 .8rem; }
.editor-filename .soon { margin-left: .3rem; }

.editor-source {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    margin: 0;
    padding: .8rem .9rem;
    border: 1px solid var(--line-2);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--ink);
    font-family: var(--mono);
    font-size: .82rem;
    line-height: 1.5;
    max-height: 70vh;
    overflow: auto;
}

@media (max-width: 900px) {
    .editor-grid { grid-template-columns: 1fr; }
    .editor-sidebar { position: static; }
}

/* ── connected workflow workspaces (OfferPilots guided UX) ───────── */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.tiny { font-size: .74rem; }
.alert.warning {
    color: var(--brand-ink);
    border-color: color-mix(in srgb, var(--brand) 48%, var(--line));
    background: var(--brand-soft);
}
.workflow-page { min-width: 0; }
.workflow-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
}
.workflow-page-head > div { max-width: 780px; }
.workflow-page-head p { max-width: 68ch; margin-bottom: 0; }
.workflow-kicker {
    display: block;
    margin-bottom: .28rem;
    color: var(--brand-ink);
    font-family: var(--mono);
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.workflow-error {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: .15rem .45rem;
    align-items: baseline;
}
.workflow-error p { grid-column: 1 / -1; margin: .25rem 0 0; }
.workflow-chip,
.workflow-state {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    width: max-content;
    max-width: 100%;
    padding: .3rem .55rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: var(--surface-2);
    font-size: .72rem;
    line-height: 1.2;
}
.workflow-chip.good,
.workflow-state.good {
    color: var(--good-ink);
    border-color: color-mix(in srgb, var(--good) 34%, var(--line));
    background: var(--good-bg);
}
.workflow-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin: .45rem 0 0;
    padding: 0;
    list-style: none;
}
.workflow-tags li {
    padding: .25rem .48rem;
    border-radius: 7px;
    color: var(--good-ink);
    background: var(--good-bg);
    font-size: .72rem;
}
.workflow-tags.gap li { color: var(--bad-ink); background: var(--bad-bg); }
.workflow-empty img { display: block; margin: 0 auto .8rem; object-fit: contain; }
.workspace-pane-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .85rem;
}
.workspace-pane-head h2 { margin: 0; }
.workspace-mobile-tabs { display: none; }

/* Tailor: captured-job context + progressive options + checked result. */
.tailor-page { max-width: 1380px; }
.tailor-capture-fallback {
    display: grid;
    grid-template-columns: minmax(260px, .8fr) minmax(360px, 1.2fr);
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: none;
}
.tailor-capture-fallback h2,
.tailor-capture-fallback p { margin-bottom: 0; }
.tailor-capture-fallback .fetch-row { margin: 0; }
.tailor-workspace {
    display: grid;
    grid-template-columns: minmax(370px, 470px) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}
.tailor-control-pane {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 1rem;
}
.tailor-job-context { box-shadow: none; }
.tailor-job-head {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: start;
    gap: .75rem;
}
.tailor-company-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: var(--surface);
    background: var(--ink);
    font-weight: 850;
}
.tailor-job-head h2 { margin: 0; overflow-wrap: anywhere; }
.tailor-job-head p { margin: .12rem 0 0; color: var(--muted); font-size: .85rem; }
.tailor-signals { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.tailor-evidence {
    margin: .85rem 0 0;
    padding: .7rem .8rem;
    border-left: 3px solid #5478a2;
    border-radius: 0 9px 9px 0;
    color: var(--muted);
    background: color-mix(in srgb, #5478a2 10%, var(--surface));
    font-size: .78rem;
}
.tailor-evidence strong { display: block; color: var(--ink); }
.tailor-match-evidence {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    margin-top: .85rem;
    padding-top: .85rem;
    border-top: 1px solid var(--line);
}
.tailor-match-evidence > div > strong { display: block; font-size: .76rem; }
.tailor-create-card { box-shadow: none; }
.tailor-document-choice {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .55rem;
    margin: .85rem 0 1rem;
}
.tailor-document-choice label {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    min-width: 0;
    padding: .75rem;
    border: 1px solid var(--line-2);
    border-radius: 11px;
    background: var(--surface-2);
    cursor: pointer;
}
.tailor-document-choice label.active,
.tailor-document-choice label:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-soft);
}
.tailor-document-choice input { margin-top: .2rem; accent-color: var(--brand); }
.tailor-document-choice span { display: grid; gap: .16rem; min-width: 0; }
.tailor-document-choice small { color: var(--muted); line-height: 1.35; }
.tailor-job-input { scroll-margin-top: 120px; }
.tailor-job-input textarea,
.ai-edit-form textarea {
    width: 100%;
    padding: .68rem .75rem;
    border: 1px solid var(--line-2);
    border-radius: 10px;
    color: var(--ink);
    background: var(--surface-2);
    font: inherit;
    resize: vertical;
}
.tailor-job-input textarea:focus,
.ai-edit-form textarea:focus { border-color: var(--brand); background: var(--surface); }
.tailor-job-input > span,
.ai-edit-form label { color: var(--ink); font-size: .82rem; font-weight: 700; }
.tailor-job-input small { color: var(--faint); }
.tailor-advanced {
    margin-top: 1rem;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-2);
}
.tailor-advanced > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem .85rem;
    cursor: pointer;
}
.tailor-advanced > summary span { display: grid; }
.tailor-advanced > summary small { color: var(--muted); }
.tailor-advanced-body {
    display: grid;
    gap: 1rem;
    padding: .2rem .85rem .9rem;
    border-top: 1px solid var(--line);
}
.tailor-advanced fieldset { min-width: 0; margin: .75rem 0 0; padding: 0; border: 0; }
.tailor-advanced legend { padding: 0; color: var(--ink); font-weight: 750; }
.workflow-credit-note { color: var(--muted); font-size: .75rem; }
.tailor-submit { min-height: 46px; }
.generation-safeguards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .45rem;
    margin: .9rem 0 0;
    padding: 0;
    list-style: none;
}
.generation-safeguards li {
    display: flex;
    align-items: center;
    gap: .45rem;
    color: var(--muted);
    font-size: .72rem;
}
/* Only the first span is the numbered badge; the second span is the label and
   must flow as normal text (scoping to :first-child stops it being squished into
   a 21px circle, which made the labels overlap). */
.generation-safeguards li span:first-child {
    width: 21px;
    height: 21px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--brand-ink);
    background: var(--brand-soft);
    font-weight: 800;
}
.generation-safeguards li span:last-child { min-width: 0; }
.tailor-result-pane { min-width: 0; position: sticky; top: 82px; }
.tailor-empty-result {
    min-height: 560px;
    display: grid;
    place-content: center;
    justify-items: center;
    padding: 3rem;
    text-align: center;
}
.tailor-empty-result img { margin-bottom: .75rem; object-fit: contain; }
.tailor-empty-result p { max-width: 52ch; }
.tailor-empty-checks { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin-top: .5rem; }
.tailor-empty-checks span {
    padding: .34rem .55rem;
    border-radius: 999px;
    color: var(--good-ink);
    background: var(--good-bg);
    font-size: .7rem;
}
.tailor-result-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: .75rem;
}
.tailor-insights { margin-bottom: .8rem; border: 1px solid var(--line); border-radius: 10px; }
.tailor-insights > summary { padding: .65rem .75rem; cursor: pointer; font-weight: 700; }
.tailor-insights > div { padding: 0 .75rem .75rem; }
.tailor-insights h3 { margin-top: .65rem; }
.tailor-result .md-copy { border-top: 1px solid var(--line); padding-top: .75rem; }
.tailor-result .md-copy > summary { cursor: pointer; color: var(--brand-ink); font-weight: 700; }

/* Documents: persistent library, canvas, grounded assistant. */
.documents-page,
.interview-page-main { width: 100%; max-width: none; padding-bottom: 2rem; }
.documents-page-head,
.interview-page-head { max-width: 1480px; margin: 0 auto; padding-inline: 1.25rem; }
.documents-workspace {
    width: min(100% - 2rem, 1600px);
    min-height: calc(100vh - 210px);
    display: grid;
    grid-template-columns: minmax(230px, 290px) minmax(0, 1fr) minmax(265px, 325px);
    margin: 0 auto;
    overflow: clip;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.documents-list-pane,
.grounded-assistant-pane,
.prep-list-pane,
.interview-guide-pane {
    min-width: 0;
    padding: 1rem;
    background: var(--surface);
}
.documents-list-pane,
.prep-list-pane { border-right: 1px solid var(--line); }
.grounded-assistant-pane,
.interview-guide-pane { border-left: 1px solid var(--line); }
.document-search input {
    width: 100%;
    padding: .58rem .68rem;
    border: 1px solid var(--line-2);
    border-radius: 9px;
    color: var(--ink);
    background: var(--surface-2);
    font: inherit;
}
.document-list { display: grid; gap: .48rem; margin-top: .75rem; }
.document-list-card,
.prep-list-card {
    min-width: 0;
    padding: .7rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--surface-2);
}
.document-list-card.active,
.prep-list-card.active { border-color: var(--brand); background: var(--brand-soft); }
.document-list-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
}
.document-list-card-head > a,
.prep-list-card > a {
    min-width: 0;
    color: var(--ink);
    font-size: .84rem;
    font-weight: 750;
    overflow-wrap: anywhere;
    text-decoration: none;
}
.document-list-card-head > a:hover,
.prep-list-card > a:hover { text-decoration: underline; }
.document-list-meta,
.prep-list-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .45rem;
    margin-top: .45rem;
    color: var(--faint);
    font-size: .7rem;
}
.document-card-actions { margin-top: .55rem; border-top: 1px solid var(--line); padding-top: .45rem; }
.document-card-actions > summary { color: var(--muted); cursor: pointer; font-size: .72rem; font-weight: 700; }
.document-card-actions .editor-rename { margin-top: .5rem; }
.document-card-actions .editor-delete { display: block; margin-top: .4rem; }
.document-search-empty { padding: .7rem; text-align: center; }

/* ── grouped document library — one collapsible card per job, its document types inside ── */
.doc-group {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    overflow: hidden;
}
.doc-group[open] { box-shadow: var(--shadow); }
.doc-group-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .7rem;
    cursor: pointer;
    list-style: none;
    background: var(--surface-2);
}
.doc-group-head::-webkit-details-marker { display: none; }
.doc-group-head::marker { content: ""; }
.doc-group-head:hover { background: var(--surface-3); }
.doc-group-caret {
    flex: 0 0 auto;
    width: 0; height: 0;
    border-left: 5px solid var(--muted);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: transform .15s ease;
}
.doc-group[open] .doc-group-caret { transform: rotate(90deg); }
.doc-group-titles { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: .08rem; }
.doc-group-company {
    color: var(--ink);
    font-size: .82rem;
    font-weight: 750;
    line-height: 1.25;
    overflow-wrap: break-word;   /* NOT "anywhere" — no mid-word breaks */
    word-break: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.doc-group-role {
    color: var(--muted);
    font-size: .72rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.doc-group-count {
    flex: 0 0 auto;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 .38rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-ink);
    font-size: .72rem;
    font-weight: 800;
}
.doc-group-body { padding: .3rem; display: grid; gap: .18rem; }
.doc-child { border-radius: 8px; border-left: 3px solid transparent; }
.doc-child.active { background: var(--brand-soft); border-left-color: var(--brand); }
.doc-child-link {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .45rem .5rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--ink);
}
.doc-child-link:hover { background: var(--surface-2); }
.doc-child.active .doc-child-link:hover { background: transparent; }
.doc-child-icon { flex: 0 0 auto; display: inline-flex; color: var(--brand-ink); }
.doc-child-main { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: .05rem; }
.doc-child-type { font-size: .8rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-child-date { color: var(--muted); font-size: .68rem; }
.doc-child-open {
    flex: 0 0 auto;
    color: var(--brand-ink);
    font-size: .62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.doc-child .document-card-actions { margin: 0 .5rem .35rem; border-top: none; padding-top: .1rem; }

.document-canvas-pane {
    min-width: 0;
    padding: 1rem;
    background: var(--surface-2);
}
.document-context-bar,
.interview-context-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .75rem;
}
.document-context-bar h2,
.interview-context-bar h2 { margin: 0; overflow-wrap: anywhere; }
.document-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem;
    padding: .6rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}
.document-print { margin-left: auto; }
.document-filename { margin: .55rem 0; color: var(--muted); font-size: .72rem; }
.document-canvas {
    min-width: 0;
    padding: 1rem;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-3);
}
.document-canvas .resume-canvas { margin: 0; }

/* ── Manual edit (no AI, no credit) — refined-card direction ──────────────
   The structured, plain-text résumé editor. Each section renders as a card on
   the surface-3 canvas; identity fields sit in a responsive grid, bullets as
   rows with a compact delete. CSS only — the markup still posts plain text. */
.editor-manual-edit { display: flex; flex-direction: column; gap: 1.1rem; }
.editor-manual-edit > .workflow-state { margin: 0; }
.editor-manual-edit .field > span {
    font-size: .78rem;
    font-weight: 650;
    color: var(--muted);
    margin-bottom: .3rem;
}
.editor-manual-edit textarea,
.manual-identity input,
.manual-add-role input {
    width: 100%;
    padding: .55rem .68rem;
    border: 1px solid var(--line-2);
    border-radius: 9px;
    color: var(--ink);
    background: var(--surface-2);
    font: inherit;
    line-height: 1.5;
}
.editor-manual-edit textarea { resize: vertical; }
.editor-manual-edit textarea:focus,
.manual-identity input:focus,
.manual-add-role input:focus {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
    background: var(--surface);
}

/* Section card — one job, education entry or project. */
.manual-section {
    padding: 1rem 1.05rem;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.manual-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .85rem;
    padding-bottom: .7rem;
    border-bottom: 1px solid var(--line);
}
.manual-section-head > strong {
    flex: 1 1 auto;
    min-width: 0;
    font-size: .98rem;
    font-weight: 750;
    letter-spacing: -.01em;
    overflow-wrap: anywhere;
}

/* Identity fields — responsive grid; the first field (company / institution /
   name) spans the full row, dates and shorter fields pair up beneath it. */
.manual-identity > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
    margin-bottom: 1rem;
}
.manual-identity > div > input:first-child { grid-column: 1 / -1; }

/* Bullet rows. */
.manual-bullet {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    margin-bottom: .5rem;
}
.manual-bullet > textarea { flex: 1 1 auto; min-height: 2.4rem; }
.manual-bullet-controls {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .3rem;
    padding-top: .15rem;
}

/* Delete affordance — the checkbox stays (structured, JS-free), styled compact. */
.manual-del {
    display: inline-flex;
    align-items: center;
    gap: .32rem;
    color: var(--muted);
    font-size: .72rem;
    white-space: nowrap;
    cursor: pointer;
}
.manual-del input[type="checkbox"] { accent-color: var(--bad); cursor: pointer; }
.manual-del:hover { color: var(--bad-ink); }

/* Add-your-own-line — a dashed ghost input under each section's bullets. */
.manual-add { margin-top: .35rem; }
.editor-manual-edit .manual-add > span { font-size: .74rem; font-weight: 650; color: var(--brand-ink); }
.editor-manual-edit .manual-add > span::before { content: "+ "; }
.manual-add > textarea {
    border-style: dashed;
    background: transparent;
}

/* "Add a role / education / project not in your profile" — softer sub-cards. */
.manual-add-role {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .55rem;
    padding: .9rem 1rem;
    border: 1px dashed var(--line-2);
    border-radius: 12px;
    background: var(--surface-2);
}
.manual-add-role > strong { grid-column: 1 / -1; font-size: .88rem; }
.manual-add-role > p { grid-column: 1 / -1; margin: -.15rem 0 .1rem; }
.manual-add-role > textarea { grid-column: 1 / -1; }
.manual-add-role input,
.manual-add-role textarea { background: var(--surface); }

/* Save-to-profile opt-in — highlighted brand row. */
.manual-save-profile {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    padding: .7rem .85rem;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand-ink);
    font-size: .82rem;
    line-height: 1.45;
}
.manual-save-profile input[type="checkbox"] { margin-top: .12rem; accent-color: var(--brand); cursor: pointer; }
.editor-manual-edit > .btn.primary { align-self: flex-start; margin-top: .2rem; }

.document-source-wrap { display: grid; gap: .6rem; }
.document-proof {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    margin-top: .65rem;
    color: var(--good-ink);
    font-size: .73rem;
    text-align: center;
}
.document-proof span { color: var(--muted); }
.grounded-assistant-pane {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 210px);
    overflow: auto;
}
.assistant-body { display: grid; gap: 1rem; }
.assistant-guidance,
.follow-up-guide {
    padding: .75rem;
    border-radius: 10px;
    color: var(--muted);
    background: var(--surface-2);
    font-size: .78rem;
}
.assistant-guidance.success { color: var(--good-ink); background: var(--good-bg); }
.assistant-guidance strong,
.follow-up-guide strong { display: block; color: var(--ink); }
.assistant-guidance.success strong { color: var(--good-ink); }
.assistant-guidance p,
.follow-up-guide p { margin: .28rem 0 0; }
.ai-edit-form { display: grid; gap: .55rem; }
.assistant-quick-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.assistant-quick-actions .workflow-kicker { width: 100%; }
.assistant-quick-actions form { margin: 0; }
.assistant-history { padding-top: .8rem; border-top: 1px solid var(--line); }
.assistant-history > p { color: var(--muted); font-size: .75rem; }
.assistant-history > div { display: flex; flex-wrap: wrap; gap: .4rem; }

/* Interview: application list, real question groups, evidence guide. */
.interview-workspace {
    width: min(100% - 2rem, 1600px);
    min-height: calc(100vh - 210px);
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(260px, 320px);
    margin: 0 auto;
    overflow: clip;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.pane-intro { margin: 0 0 .8rem; color: var(--muted); font-size: .75rem; }
.prep-list-card { margin-bottom: .45rem; }
.prep-list-card p { margin: .2rem 0 0; color: var(--muted); font-size: .7rem; }
.interview-question-pane {
    min-width: 0;
    padding: 1rem;
    overflow: auto;
    background: var(--surface-2);
}
.interview-no-prep {
    min-height: 360px;
    display: grid;
    place-content: center;
    justify-items: start;
    max-width: 680px;
    margin: 1rem auto;
}
.interview-outlook {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: .8rem;
    padding: .85rem 1rem;
    border-radius: 11px;
    color: #eef2f0;
    background: var(--ink);
}
.interview-outlook .workflow-kicker { color: var(--brand); }
.interview-outlook p { margin: 0; font-size: .82rem; }
.interview-category-links {
    display: flex;
    gap: .4rem;
    margin: .8rem 0;
    padding-bottom: .2rem;
    overflow-x: auto;
}
.interview-category-links a {
    flex: none;
    padding: .4rem .62rem;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    color: var(--muted);
    background: var(--surface);
    font-size: .72rem;
    font-weight: 650;
    text-decoration: none;
}
.interview-category { scroll-margin-top: 92px; }
.interview-category + .interview-category { margin-top: 1.25rem; }
.interview-question-card {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}
.interview-question-card + .interview-question-card { margin-top: .75rem; }
.interview-question-number {
    color: var(--brand-ink);
    font-family: var(--mono);
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.interview-question-card h3 { margin: .4rem 0 .7rem; font-size: 1.18rem; line-height: 1.35; }
.interview-why { padding: .65rem .75rem; border-radius: 9px; background: var(--surface-2); }
.interview-why strong { font-size: .75rem; }
.interview-why p { margin: .2rem 0 0; color: var(--muted); font-size: .78rem; }
.interview-answer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .7rem;
    margin: .8rem 0 .45rem;
}
.interview-answer {
    padding: .75rem .85rem;
    border-left: 3px solid var(--brand);
    border-radius: 0 9px 9px 0;
    background: var(--brand-soft);
}
.interview-answer p { margin: 0; }
.interview-answer small { display: block; margin-top: .55rem; color: var(--muted); }
.interview-guide-pane {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 210px);
    overflow: auto;
}
.interview-guide-body { display: grid; gap: .8rem; }
.grounding-checklist { margin: 0; padding: 0; list-style: none; }
.grounding-checklist li {
    padding: .5rem 0;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: .76rem;
}
.grounding-checklist li::before { content: "✓"; margin-right: .4rem; color: var(--good-ink); font-weight: 850; }
.questions-to-ask { scroll-margin-top: 92px; }
.questions-to-ask h3 { margin-bottom: .55rem; }
.questions-to-ask ol { display: grid; gap: .5rem; margin: 0; padding-left: 1.25rem; }
.questions-to-ask li { padding-left: .2rem; color: var(--muted); font-size: .78rem; }
.interview-regenerate { display: grid; gap: .45rem; margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); }
.interview-regenerate small { color: var(--faint); text-align: center; }

@media (max-width: 1180px) {
    .documents-workspace,
    .interview-workspace {
        grid-template-columns: minmax(215px, 270px) minmax(0, 1fr);
    }
    .grounded-assistant-pane,
    .interview-guide-pane {
        grid-column: 1 / -1;
        max-height: none;
        border-top: 1px solid var(--line);
        border-left: 0;
    }
    .grounded-assistant-pane .assistant-body,
    .interview-guide-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grounded-assistant-pane .assistant-history,
    .interview-guide-pane .questions-to-ask,
    .interview-guide-pane .interview-regenerate { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    .workflow-page-head { align-items: flex-start; flex-direction: column; }
    .tailor-capture-fallback,
    .tailor-workspace { grid-template-columns: 1fr; }
    .tailor-result-pane { position: static; }
    .tailor-empty-result { min-height: 360px; }
}

@media (max-width: 760px) {
    .workspace-mobile-tabs {
        position: sticky;
        top: 64px;
        z-index: 20;
        width: calc(100% - 2rem);
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: .35rem;
        margin: 0 auto .65rem;
        padding: .4rem;
        border: 1px solid var(--line);
        border-radius: 11px;
        background: color-mix(in srgb, var(--surface) 94%, transparent);
        backdrop-filter: blur(12px);
    }
    .workspace-mobile-tabs a {
        padding: .45rem;
        border-radius: 7px;
        color: var(--muted);
        font-size: .72rem;
        font-weight: 750;
        text-align: center;
        text-decoration: none;
    }
    .workspace-mobile-tabs a:hover { color: var(--ink); background: var(--brand-soft); }
    .documents-workspace,
    .interview-workspace {
        width: calc(100% - 1rem);
        grid-template-columns: minmax(0, 1fr);
        overflow: visible;
    }
    .documents-list-pane,
    .prep-list-pane,
    .document-canvas-pane,
    .interview-question-pane,
    .grounded-assistant-pane,
    .interview-guide-pane {
        grid-column: auto;
        border: 0;
        border-bottom: 1px solid var(--line);
        scroll-margin-top: 122px;
    }
    .grounded-assistant-pane .assistant-body,
    .interview-guide-body { grid-template-columns: 1fr; }
    .tailor-document-choice,
    .tailor-match-evidence,
    .generation-safeguards,
    .template-options,
    .section-checks { grid-template-columns: 1fr; }
    .document-proof { align-items: flex-start; flex-direction: column; text-align: left; }
    .document-print { margin-left: 0; }
    .interview-outlook { grid-template-columns: 1fr; gap: .25rem; }
}

@media (max-width: 720px) {
    .workspace-mobile-tabs { top: 104px; }
    .documents-list-pane,
    .prep-list-pane,
    .document-canvas-pane,
    .interview-question-pane,
    .grounded-assistant-pane,
    .interview-guide-pane { scroll-margin-top: 164px; }
}

@media (max-width: 520px) {
    .documents-page-head,
    .interview-page-head { padding-inline: .75rem; }
    .tailor-job-head { grid-template-columns: 38px minmax(0, 1fr); }
    .tailor-job-head > .btn { grid-column: 1 / -1; }
    .tailor-company-mark { width: 38px; height: 38px; }
    .workflow-error { grid-template-columns: 1fr; }
    .document-toolbar,
    .editor-tpl { align-items: stretch; flex-direction: column; }
    .editor-tpl-label { justify-content: space-between; }
    .document-toolbar .editor-views,
    .document-toolbar .editor-views a,
    .document-toolbar .document-print { width: 100%; }
    .interview-question-card h3 { font-size: 1.02rem; }
}

@media print {
    .documents-list-pane,
    .grounded-assistant-pane,
    .workspace-mobile-tabs,
    .document-context-bar,
    .document-toolbar,
    .document-filename,
    .document-proof,
    .documents-page-head { display: none !important; }
    .documents-workspace,
    .document-canvas-pane,
    .document-canvas { display: block; width: 100%; min-height: 0; padding: 0; border: 0; box-shadow: none; }
}

/* ── Home command center ─────────────────────────────────────────── */
.dashboard-page { max-width: 1480px; }
.dashboard-command-center { display: grid; gap: 1rem; }
.dashboard-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    padding-bottom: .5rem;
}
.dashboard-head p { margin-bottom: 0; }
.dashboard-primary-action { min-height: 44px; padding-inline: 1.15rem; }
.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.dashboard-metric {
    min-width: 0;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: .7rem;
    padding: 1rem;
}
.dashboard-metric + .dashboard-metric { border-left: 1px solid var(--line); }
.dashboard-metric-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: var(--brand-ink);
    background: var(--brand-soft);
    font-family: var(--mono);
    font-size: .62rem;
    font-weight: 850;
}
.dashboard-metric-value {
    display: block;
    color: var(--ink);
    font-size: 1.55rem;
    font-weight: 850;
    letter-spacing: -.04em;
    line-height: 1;
}
.dashboard-metric h2 { margin: .35rem 0 .18rem; font-size: .78rem; }
.dashboard-metric p { margin: 0; color: var(--muted); font-size: .68rem; line-height: 1.4; }
.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
    gap: 1rem;
    align-items: start;
}
.dashboard-main-column,
.dashboard-side-column { display: grid; min-width: 0; gap: 1rem; }
.dashboard-card {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.dashboard-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .85rem;
}
.dashboard-section-head h2 { margin: 0; }
.pipeline-stages {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.pipeline-stages li {
    position: relative;
    min-width: 0;
    display: grid;
    gap: .18rem;
    padding: .75rem;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-2);
}
.pipeline-stages li.complete { border-color: color-mix(in srgb, var(--good) 30%, var(--line)); }
.pipeline-stages li.unavailable { border-style: dashed; }
.pipeline-index {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--muted);
    background: var(--surface);
    font-size: .65rem;
    font-weight: 800;
}
.pipeline-stages li.complete .pipeline-index { color: var(--good-ink); background: var(--good-bg); }
.pipeline-value { margin-top: .35rem; font-size: 1.4rem; font-weight: 850; line-height: 1; }
.pipeline-stages strong { font-size: .78rem; }
.pipeline-stages small { color: var(--muted); font-size: .65rem; }
.dashboard-accuracy-note {
    margin: .75rem 0 0;
    padding-top: .65rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .7rem;
}
.weekly-chart {
    height: 175px;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    align-items: end;
    gap: .55rem;
    padding: .75rem .6rem .2rem;
    border-radius: 11px;
    background:
        repeating-linear-gradient(to top, transparent 0 37px, var(--line) 38px),
        var(--surface-2);
}
.weekly-day {
    height: 100%;
    display: grid;
    grid-template-rows: 20px minmax(0, 1fr) 20px;
    justify-items: center;
    align-items: end;
    gap: .25rem;
}
.weekly-count { color: var(--muted); font-size: .65rem; }
.weekly-bar {
    width: min(28px, 72%);
    height: var(--activity-height);
    min-height: 2px;
    border-radius: 6px 6px 2px 2px;
    background: linear-gradient(180deg, var(--brand), color-mix(in srgb, var(--brand) 72%, var(--ink)));
}
.weekly-label { color: var(--muted); font-size: .65rem; }
.dashboard-empty-inline {
    padding: 1.15rem;
    border: 1px dashed var(--line-2);
    border-radius: 11px;
    color: var(--muted);
    background: var(--surface-2);
    text-align: center;
}
.dashboard-empty-inline p { margin: .3rem auto; max-width: 58ch; font-size: .78rem; }
.activity-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.activity-list li {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) max-content;
    align-items: center;
    gap: .75rem;
    padding: .7rem 0;
    border-top: 1px solid var(--line);
}
.activity-list li:first-child { border-top: 0; padding-top: 0; }
.activity-kind {
    width: max-content;
    padding: .26rem .45rem;
    border-radius: 999px;
    color: var(--brand-ink);
    background: var(--brand-soft);
    font-size: .66rem;
    font-weight: 750;
}
.activity-list a { color: var(--ink); font-weight: 750; text-decoration: none; }
.activity-list a:hover { text-decoration: underline; }
.activity-list p { margin: .12rem 0 0; color: var(--muted); font-size: .72rem; }
.activity-list time { color: var(--faint); font-size: .68rem; white-space: nowrap; }
.dashboard-recommendation {
    padding: 1.15rem;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--brand) 60%, var(--line));
    border-radius: 14px;
    color: #eef2f0;
    background:
        radial-gradient(circle at 92% 10%, rgba(217, 166, 58, .18), transparent 35%),
        #172020;
    box-shadow: var(--shadow);
}
.dashboard-recommendation .workflow-kicker { color: #e4b247; }
.dashboard-recommendation h2 { color: #fff; font-size: 1.25rem; }
.dashboard-recommendation p { color: #bdc7c5; font-size: .8rem; }
.dashboard-improvements ul,
.usage-meter-list { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.dashboard-improvements li { padding-top: .7rem; border-top: 1px solid var(--line); }
.dashboard-improvements li:first-child { padding-top: 0; border-top: 0; }
.dashboard-improvements strong { display: block; font-size: .8rem; }
.dashboard-improvements p { margin: .18rem 0; color: var(--muted); font-size: .72rem; }
.dashboard-improvements a { font-size: .72rem; font-weight: 750; }
.dashboard-usage details { margin: .7rem 0; }
.dashboard-usage summary { cursor: pointer; color: var(--brand-ink); font-size: .75rem; font-weight: 750; }
.usage-meter-list { margin-top: .75rem; }
.usage-meter-list li > div { display: flex; justify-content: space-between; gap: .6rem; font-size: .68rem; }
.usage-meter-list li strong { white-space: nowrap; }
.usage-meter-track {
    height: 5px;
    display: block;
    margin-top: .28rem;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-3);
}
.usage-meter-track > span { height: 100%; display: block; border-radius: inherit; background: var(--brand); }
.dashboard-quick-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .35rem;
}
.dashboard-quick-links a {
    padding: .5rem .25rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: var(--surface);
    font-size: .68rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}
.dashboard-quick-links a:hover { color: var(--ink); border-color: var(--brand); }

@media (max-width: 1100px) {
    .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-metric:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
    .dashboard-metric:nth-child(4) { border-top: 1px solid var(--line); }
    .dashboard-layout { grid-template-columns: 1fr; }
    .dashboard-side-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-recommendation,
    .dashboard-quick-links { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
    .dashboard-command-center { gap: .75rem; }
    .dashboard-head { align-items: flex-start; flex-direction: column; }
    .dashboard-primary-action { width: 100%; }
    .pipeline-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-side-column { grid-template-columns: 1fr; }
    .dashboard-recommendation,
    .dashboard-quick-links { grid-column: auto; }
    .activity-list li { grid-template-columns: 68px minmax(0, 1fr); }
    .activity-list time { grid-column: 2; }
}

@media (max-width: 520px) {
    .dashboard-metrics { grid-template-columns: 1fr; }
    .dashboard-metric + .dashboard-metric { border-left: 0; border-top: 1px solid var(--line); }
    .pipeline-stages { grid-template-columns: 1fr; }
    .weekly-chart { gap: .25rem; padding-inline: .25rem; }
    .weekly-bar { width: 60%; }
    .dashboard-quick-links { grid-template-columns: repeat(2, 1fr); }
}

/* ── contextual product tours ───────────────────────────────────── */
.op-tour-root { display: contents; }
.op-tour-layer { position: fixed; inset: 0; z-index: 1200; pointer-events: none; }
.op-tour-spotlight {
    position: fixed;
    z-index: 1201;
    border: 3px solid var(--brand);
    border-radius: 13px;
    box-shadow: 0 0 0 9999px rgba(11, 19, 20, .68), 0 0 0 6px rgba(217, 166, 58, .18);
    pointer-events: none;
    transition: top .18s ease, left .18s ease, width .18s ease, height .18s ease;
}
.op-tour-target-active { scroll-margin: 7rem 1rem 18rem; }
.op-tour-coachmark {
    position: fixed;
    z-index: 1202;
    width: min(360px, calc(100vw - 32px));
    max-height: min(560px, calc(100vh - 32px));
    overflow: auto;
    padding: 1rem;
    border: 1px solid color-mix(in srgb, var(--brand) 66%, var(--line));
    border-radius: 15px;
    color: var(--ink);
    background: var(--surface);
    box-shadow: 0 22px 60px rgba(8, 15, 16, .32);
    pointer-events: auto;
    overscroll-behavior: contain;
}
.op-tour-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.op-tour-step {
    color: var(--brand-ink);
    font-family: var(--mono);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.op-tour-close {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-size: 1.25rem;
    cursor: pointer;
}
.op-tour-close:hover { color: var(--ink); background: var(--surface-2); }
.op-tour-progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: .28rem; margin: .7rem 0 .9rem; }
.op-tour-progress span { height: 3px; border-radius: 999px; background: var(--line-2); }
.op-tour-progress span.active { background: var(--brand); }
.op-tour-coachmark h2 { margin-bottom: .35rem; font-size: 1.08rem; }
.op-tour-copy { margin: 0; color: var(--muted); font-size: .83rem; }
.op-tour-nav { display: flex; align-items: center; gap: .5rem; margin-top: 1rem; }
.op-tour-nav-spacer { flex: 1; }
.op-tour-skip {
    padding: .3rem .15rem;
    border: 0;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-size: .72rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.op-tour-action-hint {
    max-width: 150px;
    color: var(--brand-ink);
    font-size: .7rem;
    font-weight: 750;
    text-align: right;
}
.op-tour-launcher {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 110;
    display: inline-flex;
    align-items: center;
    gap: .38rem;
    padding: .55rem .75rem;
    border: 1px solid color-mix(in srgb, var(--brand) 60%, var(--line));
    border-radius: 999px;
    color: var(--ink);
    background: var(--surface);
    box-shadow: var(--shadow);
    font: inherit;
    font-size: .72rem;
    font-weight: 750;
    cursor: pointer;
}
.op-tour-launcher:hover { border-color: var(--brand); background: var(--brand-soft); }
.op-tour-banner {
    position: fixed;
    top: 78px;
    left: 50%;
    z-index: 1150;
    width: min(540px, calc(100vw - 24px));
    display: flex;
    gap: .45rem;
    padding: .75rem .9rem;
    border: 1px solid var(--good);
    border-radius: 12px;
    color: var(--good-ink);
    background: var(--good-bg);
    box-shadow: var(--shadow);
    font-size: .78rem;
    transform: translateX(-50%);
}
.tour-settings-list { display: grid; gap: .5rem; margin: .8rem 0; padding: 0; list-style: none; }
.tour-settings-list li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .65rem 0; border-top: 1px solid var(--line); }
.tour-settings-list li > div { display: grid; gap: .1rem; }
.tour-settings-list a { color: var(--ink); font-size: .86rem; font-weight: 750; text-decoration: none; }
.tour-settings-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }

@media (max-width: 600px) {
    .op-tour-coachmark {
        position: fixed;
        right: 12px;
        bottom: 12px;
        left: 12px;
        width: auto;
        max-width: none;
        max-height: min(46vh, 430px);
        border-radius: 16px;
    }
    .op-tour-nav { flex-wrap: wrap; }
    .op-tour-nav-spacer { display: none; }
    .op-tour-action-hint { margin-left: auto; }
    .op-tour-launcher { right: .75rem; bottom: .75rem; }
    .op-tour-banner { top: 112px; align-items: flex-start; flex-direction: column; }
    .tour-settings-list li { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    .op-tour-spotlight,
    .op-tour-coachmark,
    .op-tour-banner { transition: none; scroll-behavior: auto; }
}

@media print {
    .op-tour-root,
    .op-tour-layer,
    .op-tour-spotlight,
    .op-tour-coachmark,
    .op-tour-launcher,
    .op-tour-banner { display: none !important; }
}

/* fragment-router: load-failure toast */
.op-fragment-error {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #1f2430;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  z-index: 1000;
}

/* fragment-router data-goto links carry no href (frozen-URL shell); restore the anchor affordances */
a[data-goto] { cursor: pointer; }

/* ── DEV admin (/admin) — spec 2026-07-20 ─────────────────────────── */
.admin-wrap { display: grid; grid-template-columns: 190px 1fr; gap: 1.2rem; }
.admin-side { position: sticky; top: 70px; align-self: start; }
.admin-side-label { font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-ink); margin: .2rem 0 .6rem; }
.admin-side a { display: block; padding: .55rem .7rem; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: .9rem; transition: background .25s cubic-bezier(.16,1,.3,1), color .2s, transform .25s cubic-bezier(.16,1,.3,1); }
.admin-side a:hover { background: var(--surface-3); transform: translateX(3px); }
.admin-side a.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 650; }
.admin-main > .settings-stack > .card { animation: adminRise .5s cubic-bezier(.16,1,.3,1) both; }
.admin-main > .settings-stack > .card:nth-child(2) { animation-delay: .09s; }
.admin-main > .settings-stack > .card:nth-child(3) { animation-delay: .18s; }
@keyframes adminRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.admin-gen { display: flex; align-items: center; gap: .6rem; margin-top: .8rem; padding: .6rem .8rem; background: var(--good-bg); border: 1px solid var(--good); border-radius: 10px; animation: adminPop .45s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes adminPop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }
.admin-gen svg { width: 20px; height: 20px; }
.admin-gen svg path { stroke: var(--good-ink); stroke-width: 2.4; fill: none; stroke-dasharray: 24; stroke-dashoffset: 24; animation: adminDraw .5s .15s cubic-bezier(.16,1,.3,1) forwards; }
@keyframes adminDraw { to { stroke-dashoffset: 0; } }
.admin-code { font-family: var(--mono); font-weight: 700; letter-spacing: .06em; }
.admin-dim { opacity: .45; }
.admin-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.admin-big { font-size: 1.7rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.admin-trend { color: var(--good-ink); font-size: .78rem; font-weight: 600; }
.admin-bars { display: flex; align-items: flex-end; gap: 6px; height: 110px; padding-top: .4rem; }
.admin-bar { flex: 1; background: linear-gradient(180deg, var(--brand), var(--brand-ink)); border-radius: 5px 5px 2px 2px; transform-origin: bottom; animation: adminGrow .7s cubic-bezier(.16,1,.3,1) both; }
@keyframes adminGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.admin-axis { display: flex; gap: 6px; margin-top: .3rem; }
.admin-axis span { flex: 1; text-align: center; font-family: var(--mono); font-size: .6rem; color: var(--faint); }
.admin-split { display: flex; gap: .4rem; height: 10px; border-radius: 99px; overflow: hidden; margin-top: .5rem; }
.admin-split i { display: block; height: 100%; }
.admin-legend { display: flex; gap: 1rem; font-size: .75rem; color: var(--muted); margin-top: .45rem; flex-wrap: wrap; }
@media (max-width: 720px) { .admin-wrap { grid-template-columns: 1fr; } .admin-side { position: static; display: flex; gap: .4rem; flex-wrap: wrap; } }
@media (prefers-reduced-motion: reduce) {
  .admin-main > .settings-stack > .card, .admin-gen, .admin-gen svg path, .admin-bar { animation: none; }
  .admin-side a { transition: none; }
}
.admin-main .mlabel { font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-ink); margin: 0 0 .55rem; }
