/* Catalyst Sourcing Solutions - RFP Builder
   Palette and type taken from catalystsourcing.com */
:root {
    --ink: #263248;
    --ink-deep: #172436;
    --slate: #6e728d;
    --muted: #66748a;
    --text-2: #536176;
    --blue: #0c9cd1;
    --blue-soft: #e3f4fb;
    --orange: #f19a50;
    --orange-hover: #e7893c;
    --orange-deep: #d47829;
    --orange-soft: #fff1e4;
    --pale: #edf1f5;
    --pale-2: #f6f8fa;
    --line: #dce2e9;
    --white: #fff;
    --green: #166534;
    --green-soft: #dcfce7;
    --red: #dc2626;
    --red-soft: #fee2e2;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(23, 36, 54, .06), 0 4px 16px rgba(23, 36, 54, .06);
    /* Century Gothic everywhere. Fallbacks are the closest matches, for devices without it installed. */
    --font: "Century Gothic", CenturyGothic, "URW Gothic", "URW Gothic L", AppleGothic, "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; }
/* Form controls don't inherit the page font by default. */
button, input, select, textarea, optgroup, table, .rte-area { font-family: var(--font); }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--pale);
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: 1.75rem; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
small, .muted { color: var(--muted); }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .78rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2.25rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.hidden { display: none !important; }
.pre { white-space: pre-line; }

/* ---------- Header ---------- */
.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
    max-width: 1240px; margin: 0 auto; padding: 0 16px;
    height: 68px; display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none !important; }
.brand img { height: 40px; width: auto; display: block; }
.brand-tag {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--slate);
    border-left: 1px solid var(--line); padding-left: 12px; line-height: 1.2;
}
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
    color: var(--text-2); padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: .92rem;
}
.nav a:hover { background: var(--pale); text-decoration: none; color: var(--ink); }
.nav a.active { color: var(--ink); background: var(--pale); box-shadow: inset 0 -3px 0 var(--orange); }
.user-menu { display: flex; align-items: center; gap: 12px; font-size: .88rem; color: var(--muted); }
.user-menu form { margin: 0; }
.accent-bar { height: 4px; background: linear-gradient(90deg, var(--orange) 0 22%, var(--blue) 22% 100%); }

/* ---------- Layout ---------- */
.container { max-width: 1240px; margin: 0 auto; padding: 28px 16px 64px; }
.container-narrow { max-width: 880px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.eyebrow { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--blue); font-weight: 700; margin-bottom: 4px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.card {
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 22px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
.card.flush { padding: 0; overflow: hidden; }

/* ---------- Line item CSV import ---------- */
[hidden] { display: none !important; }
.csv-import { margin-top: 12px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 8px; background: var(--pale-2); display: grid; gap: 10px; }
.csv-import.is-drop { border-color: var(--blue); background: var(--blue-soft); }
.csv-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .9rem; }
.csv-choice span { flex-basis: 100%; font-weight: 700; }
.csv-result:empty { display: none; }
.csv-result.is-ok { color: var(--green); }
.csv-result.is-error { color: #991b1b; }
.csv-result ul { margin: 4px 0 0; padding-left: 18px; color: var(--text-2); }

/* ---------- Templates ---------- */
.section-title { font-size: 1.1rem; margin: 8px 0 12px; }
.template-card { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; }
.template-card:hover { border-color: var(--slate); }
.template-card h3 { margin: 0; font-size: 1.08rem; }
.template-card h3 a { color: var(--ink); text-decoration: none; }
.template-card h3 a:hover { color: var(--blue); }
.template-card p { margin: 0; flex: 1; }
.template-top { display: flex; align-items: center; gap: 8px; }
.template-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.template-actions { margin-top: 4px; }
.template-actions form { margin: 0; }
.template-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.template-strip form { margin: 0; }
.template-strip button {
    width: 100%; text-align: left; font: inherit; cursor: pointer; padding: 12px 14px;
    background: var(--white); border: 1px solid var(--line); border-radius: 8px; color: var(--ink);
}
.template-strip button:hover { border-color: var(--orange); }
.template-strip button:focus-visible { outline: 3px solid rgba(12, 156, 209, .3); }
.template-strip strong { display: block; font-size: .92rem; }
.template-strip span { font-size: .75rem; color: var(--muted); }
.save-template summary { cursor: pointer; }
.save-template[open] { flex-basis: 100%; }
.save-template form { margin-top: 12px; max-width: 560px; display: grid; gap: 10px; }

.stat { padding: 18px 20px; }
.stat-num { font-size: 2rem; font-weight: 700; color: var(--ink); line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .85rem; }
.stat.accent-orange { border-top: 4px solid var(--orange); }
.stat.accent-blue { border-top: 4px solid var(--blue); }
.stat.accent-slate { border-top: 4px solid var(--slate); }
.stat.accent-green { border-top: 4px solid #22a06b; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: inherit; font-weight: 700; font-size: .92rem;
    padding: 10px 18px; border-radius: 8px; border: 1px solid transparent;
    cursor: pointer; text-decoration: none !important; line-height: 1.2; white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--orange); color: var(--white); }
.btn-primary:hover { background: var(--orange-hover); }
.btn-blue { background: var(--blue); color: var(--white); }
.btn-blue:hover { background: #0a88b6; }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: var(--ink-deep); }
.btn-outline { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--slate); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--pale); color: var(--ink); }
.btn-danger { background: var(--white); color: var(--red); border-color: #f3c4c4; }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { padding: 6px 12px; font-size: .82rem; }
.btn-lg { padding: 14px 24px; font-size: 1rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--red); }

/* ---------- Badges ---------- */
.badge {
    display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.badge-gray { background: var(--pale); color: var(--text-2); }
.badge-blue { background: var(--blue-soft); color: #08739b; }
.badge-orange { background: var(--orange-soft); color: var(--orange-deep); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: #b91c1c; }
.badge-ink { background: var(--ink); color: var(--white); }
.pill-type { font-size: .7rem; font-weight: 700; letter-spacing: .08em; padding: 2px 7px; border-radius: 5px; background: var(--ink); color: #fff; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; border: 1px solid; font-size: .93rem; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert-success { background: #ecfdf3; border-color: #b7ebc9; color: var(--green); }
.alert-info { background: var(--blue-soft); border-color: #b6e2f3; color: #075e80; }
.alert-error { background: var(--red-soft); border-color: #f6c1c1; color: #991b1b; }
.alert-warn { background: var(--orange-soft); border-color: #ffd2ab; color: #8a4a12; }

/* ---------- Forms ---------- */
label, .label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; color: var(--ink); }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .82rem; margin-top: 2px; }
.field { margin-bottom: 20px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=url],
input[type=date], input[type=datetime-local], input[type=search], select, textarea {
    width: 100%; font: inherit; font-size: .95rem; color: var(--ink);
    padding: 10px 12px; border: 1px solid #c5d0da; border-radius: 8px; background: var(--white);
    transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(12, 156, 209, .15); }
input.is-invalid, select.is-invalid, textarea.is-invalid { border-color: var(--red); }
.error-text { color: var(--red); font-size: .82rem; margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; cursor: pointer; margin-bottom: 0; }
.check input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--orange); flex-shrink: 0; }
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-prefix input { padding-left: 26px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th {
    text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
    font-weight: 700; padding: 10px 14px; background: var(--pale-2); border-bottom: 1px solid var(--line);
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbfc; }
.table .title-cell a { font-weight: 700; color: var(--ink); }
.table input, .table select, .table textarea { padding: 7px 9px; font-size: .9rem; }
.table textarea { min-height: 38px; }

/* ---------- Wizard ---------- */
.wizard { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.steps { position: sticky; top: 92px; }
.steps-card { padding: 14px; }
.steps-title { padding: 8px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.steps-title strong { display: block; font-size: .95rem; line-height: 1.3; }
.step-link {
    display: flex; align-items: center; gap: 12px; width: 100%;
    background: none; border: 0; text-align: left; font: inherit; cursor: pointer;
    padding: 9px 10px; border-radius: 8px; color: var(--text-2); font-weight: 600; font-size: .92rem;
}
.step-link:hover { background: var(--pale); color: var(--ink); }
.step-num {
    width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
    font-size: .8rem; font-weight: 700; border: 2px solid var(--line); color: var(--muted); background: var(--white);
}
.step-link.done .step-num { background: var(--blue); border-color: var(--blue); color: #fff; }
.step-link.current { background: var(--orange-soft); color: var(--ink); }
.step-link.current .step-num { border-color: var(--orange); background: var(--orange); color: #fff; }
.step-link.skipped { color: #a3adbb; }
.step-link.skipped .step-num { border-style: dashed; color: #a3adbb; }
.step-off { margin-left: auto; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #a3adbb; }

/* WYSIWYG editor */
.rte { border: 1px solid var(--line); border-radius: 8px; background: var(--white); overflow: hidden; }
.rte:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 5px 6px; background: var(--pale-2); border-bottom: 1px solid var(--line); }
.rte-btn {
    font: inherit; font-size: .8rem; min-width: 30px; height: 28px; padding: 0 8px; border: 1px solid transparent;
    border-radius: 6px; background: none; color: var(--text-2); cursor: pointer;
}
.rte-btn:hover { background: var(--white); border-color: var(--line); color: var(--ink); }
.rte-btn.is-on { background: var(--ink); color: #fff; }
.rte-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.rte-area { padding: 10px 12px; font-size: .95rem; line-height: 1.55; color: var(--ink); outline: none; overflow-wrap: anywhere; }
.rte-area.is-invalid { background: var(--red-soft); }
.rte-area:empty::before { content: attr(data-placeholder); color: #a3adbb; pointer-events: none; }
.rte-area p, .rich p { margin: 0 0 .6em; }
.rte-area ul, .rte-area ol, .rich ul, .rich ol { margin: 0 0 .7em; padding-left: 1.4em; }
.rte-area li, .rich li { margin-bottom: .2em; }
.rte-area h3, .rte-area h4, .rich h3, .rich h4 { font-size: 1rem; margin: .8em 0 .35em; color: var(--ink); }
.rte-area blockquote, .rich blockquote { margin: 0 0 .7em; padding-left: 12px; border-left: 3px solid var(--line); color: var(--text-2); }
.rich > :last-child, .rte-area > :last-child { margin-bottom: 0; }

/* Contract term choices */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.choice { margin: 0; cursor: pointer; font-weight: 600; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); text-align: center; font-size: .9rem; }
.choice:hover span { border-color: var(--blue); }
.choice input:checked + span { border-color: var(--orange); background: var(--orange-soft); box-shadow: inset 0 0 0 1px var(--orange); }
.choice input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Custom sections */
.custom-row { display: block; padding: 14px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; background: var(--pale-2); }
.custom-row-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.custom-row-head input { font-weight: 700; }

.doc-meta a { display: block; }

.progress { height: 6px; border-radius: 999px; background: var(--pale); overflow: hidden; margin: 12px 10px 4px; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--blue)); }

.question { padding: 22px 24px; margin-bottom: 18px; }
.question-label { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.q-icon {
    width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; display: grid; place-items: center;
    background: var(--ink); color: #fff; font-weight: 700; font-size: .85rem;
}
.question-label h3 { margin: 3px 0 2px; font-size: 1.05rem; }
.question-label p { margin: 0; color: var(--muted); font-size: .88rem; }
.starter-btn {
    font: inherit; font-size: .8rem; font-weight: 700; color: var(--orange-deep); background: var(--orange-soft);
    border: 1px dashed #f5bb87; border-radius: 6px; padding: 4px 10px; cursor: pointer;
}
.starter-btn:hover { background: #ffe6cf; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    font: inherit; font-size: .82rem; border: 1px solid var(--line); background: var(--white); color: var(--text-2);
    padding: 6px 12px; border-radius: 999px; cursor: pointer;
}
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.used { opacity: .45; pointer-events: none; }

.type-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.type-option { position: relative; }
.type-option input { position: absolute; opacity: 0; }
.type-option .tile {
    border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; cursor: pointer; background: var(--white);
    height: 100%; transition: border-color .15s, box-shadow .15s;
}
.type-option .tile:hover { border-color: var(--slate); }
.type-option input:checked + .tile { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(241, 154, 80, .18); }
.type-option input:focus-visible + .tile { box-shadow: 0 0 0 3px rgba(12, 156, 209, .3); }
.tile-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.tile p { margin: 0; color: var(--muted); font-size: .88rem; }

.wizard-actions {
    position: sticky; bottom: 0; z-index: 10; margin-top: 8px;
    background: rgba(237, 241, 245, .92); backdrop-filter: blur(6px);
    padding: 14px 0; border-top: 1px solid var(--line);
    display: flex; gap: 10px; align-items: center;
}

.repeater-row { display: grid; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.repeater-row:last-child { border-bottom: 0; }
.items-row { grid-template-columns: minmax(0, 3fr) 90px 110px minmax(0, 3fr) 34px; }
.criteria-row { grid-template-columns: minmax(0, 1fr) 110px 34px; }
.question-row { grid-template-columns: minmax(0, 1fr) auto 34px; align-items: center; }
.repeater-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; padding-bottom: 0; border: 0; }
.remove-row {
    width: 34px; height: 38px; border: 1px solid var(--line); background: var(--white); border-radius: 8px;
    cursor: pointer; color: var(--muted); font-size: 1.1rem; line-height: 1;
}
.remove-row:hover { color: var(--red); border-color: #f3c4c4; }
.weight-total { font-weight: 700; }
.weight-total.ok { color: var(--green); }
.weight-total.bad { color: var(--orange-deep); }

.checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.checklist .check { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.checklist .check:has(input:checked) { border-color: var(--orange); background: #fffaf5; }

/* ---------- Vendor picker ---------- */
.vendor-list { max-height: 520px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.vendor-item { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: flex-start; font-weight: 400; margin: 0; }
.vendor-item:last-child { border-bottom: 0; }
.vendor-item:hover { background: var(--pale-2); }
.vendor-item:has(input:checked) { background: #fffaf5; }
.vendor-item input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--orange); }
.vendor-item .v-name { font-weight: 700; }
.vendor-item .v-meta { color: var(--muted); font-size: .84rem; }
.star { color: var(--orange); }

/* ---------- Document ---------- */
.doc { background: var(--white); max-width: 900px; margin: 0 auto; box-shadow: var(--shadow); border: 1px solid var(--line); }
.doc-cover { padding: 44px 56px 34px; border-bottom: 6px solid var(--orange); position: relative; }
.doc-cover::after { content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 4px; background: var(--blue); }
.doc-cover img { height: 46px; margin-bottom: 36px; }
.doc-type { color: var(--blue); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: .85rem; }
.doc-title { font-size: 2rem; margin: 6px 0 10px; }
.doc-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-top: 24px; }
.doc-meta div { background: var(--pale-2); border-radius: 8px; padding: 10px 12px; overflow-wrap: anywhere; }
.doc-meta span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.doc-meta strong { font-size: .95rem; display: block; }
.doc-meta .doc-meta-sub { font-size: .85rem; text-transform: none; letter-spacing: 0; }
.doc-body { padding: 34px 56px 44px; }
.doc-section { margin-bottom: 28px; break-inside: avoid-page; }
.doc-section h2 {
    font-size: 1.1rem; border-bottom: 2px solid var(--pale); padding-bottom: 6px; margin-bottom: 12px;
    display: flex; gap: 10px; align-items: baseline;
}
.doc-section h2 .num { color: var(--orange); font-weight: 700; }
.doc-section p, .doc-section li { color: #2f3b51; }
.doc-footer { padding: 18px 56px; background: var(--ink); color: #c5d0da; font-size: .8rem; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.doc-footer a { color: #fff; }
.timeline-table td:first-child { color: var(--muted); width: 45%; }
.empty-note { color: var(--muted); font-style: italic; }

/* ---------- Comparison ---------- */
.compare th.vendor-col { min-width: 180px; text-transform: none; letter-spacing: 0; font-size: .88rem; color: var(--ink); }
.best { background: #ecfdf3 !important; color: var(--green); font-weight: 700; }
.score-input { width: 70px !important; text-align: center; }
.award-ribbon { background: var(--green-soft); color: var(--green); border: 1px solid #b7ebc9; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side {
    background: var(--ink); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
    position: relative; overflow: hidden;
}
.auth-side::before {
    content: ""; position: absolute; right: -120px; bottom: -80px; width: 420px; height: 420px;
    background: var(--slate); clip-path: polygon(0 10%, 100% 0, 45% 100%); opacity: .55;
}
.auth-side::after {
    content: ""; position: absolute; right: 150px; bottom: -40px; width: 140px; height: 300px;
    background: var(--orange); clip-path: polygon(0 0, 30% 0, 100% 100%, 85% 100%); opacity: .9;
}
.auth-side h1 { color: #fff; font-size: 2.2rem; max-width: 460px; }
.auth-side p { color: #c5d0da; max-width: 440px; }
.auth-side img { height: 48px; width: auto; align-self: flex-start; position: relative; z-index: 1; }
.auth-side > * { position: relative; z-index: 1; }
.auth-main { display: grid; place-items: center; padding: 40px 16px; background: var(--white); }
.auth-card { width: 100%; max-width: 400px; }
.auth-points { list-style: none; padding: 0; margin: 24px 0 0; }
.auth-points li { padding: 6px 0 6px 28px; position: relative; color: #dce4ec; }
.auth-points li::before { content: ""; position: absolute; left: 0; top: 12px; width: 14px; height: 10px; background: var(--orange); clip-path: polygon(0 0, 100% 0, 40% 100%); }

/* ---------- Portal ---------- */
.portal-hero { background: var(--ink); color: #fff; }
.portal-hero-inner { max-width: 1100px; margin: 0 auto; padding: 30px 16px; display: flex; gap: 24px; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; }
.portal-hero h1 { color: #fff; margin: 4px 0 6px; }
.portal-hero .eyebrow { color: var(--orange); }
.portal-hero .muted { color: #aab6c3; }
.countdown { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .15); border-radius: 10px; padding: 12px 18px; text-align: right; }
.countdown strong { display: block; font-size: 1.15rem; color: #fff; }
.countdown span { font-size: .8rem; color: #aab6c3; }
.portal-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.side-sticky { position: sticky; top: 92px; }

.footer { text-align: center; padding: 24px 16px 36px; color: var(--muted); font-size: .8rem; }
.footer strong { color: var(--text-2); }

.empty { text-align: center; padding: 48px 20px; }
.empty .icon { width: 56px; height: 56px; margin: 0 auto 14px; background: var(--orange); clip-path: polygon(0 12%, 100% 0, 45% 100%); }

.copy-field { display: flex; gap: 6px; }
.copy-field input { font-size: .78rem; padding: 6px 8px; color: var(--muted); background: var(--pale-2); }

/* ---------- Vendor tracking ---------- */
.stat.accent-red { border-top: 4px solid var(--red); }
.tracking-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.stat-link { display: block; color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s; }
.stat-link:hover { box-shadow: 0 6px 18px rgba(38, 50, 72, .12); text-decoration: none; }
.stat-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.stat-link.is-active { outline: 2px solid var(--ink); outline-offset: -2px; }
.tracking-table td:first-child { min-width: 170px; }
.tracking-table .title-cell { min-width: 230px; }
.history-toggle { display: block; margin-top: 4px; }
.history-row td { background: var(--pale-2); }
.table tbody tr.history-row:hover td { background: var(--pale-2); }
.history-panel { padding: 4px 6px 8px; }
.history-panel h3 { margin: 0 0 10px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; display: flex; gap: 12px; padding: 0 0 14px; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: 0; width: 2px; background: var(--line); }
.timeline-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; background: var(--slate); position: relative; z-index: 1; }
.timeline-body { min-width: 0; }
.timeline-what { color: var(--text-2); }
.dot-gray { background: #b5bccb; }
.dot-orange { background: var(--orange); }
.dot-blue { background: var(--blue); }
.dot-green { background: #22a06b; }
.dot-red { background: var(--red); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .tracking-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .wizard, .portal-grid { grid-template-columns: 1fr; }
    .steps, .side-sticky { position: static; }
    .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-side { padding: 32px 20px; min-height: 0; }
    .auth-side h1 { font-size: 1.6rem; }
    .items-row { grid-template-columns: 1fr 1fr; }
    .items-row > :first-child, .items-row > :nth-child(4) { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .topbar-inner { gap: 12px; height: auto; padding: 10px 16px; flex-wrap: wrap; }
    .brand-tag { display: none; }
    .nav { order: 3; width: 100%; overflow-x: auto; }
    .grid-2, .grid-3, .grid-4, .type-choice, .checklist, .doc-meta { grid-template-columns: 1fr; }
    .tracking-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .doc-cover, .doc-body { padding-left: 22px; padding-right: 22px; }
    .doc-footer { padding: 16px 22px; }
    .question { padding: 18px 16px; }
    .card { padding: 16px; }
}

/* ---------- Print (document view) ---------- */
/* ---------- Sourcing summary report (matches Catalyst's summary documents) ---------- */
.summary-page { background: var(--pale); }
.print-bar { background: var(--ink); color: #fff; }
.print-bar-inner { max-width: 1100px; margin: 0 auto; padding: 12px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.print-bar-inner > a:first-child { color: #fff; }
.btn-outline-light { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .45); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .1); text-decoration: none; }
.sum { max-width: 1100px; margin: 20px auto 40px; padding: 28px 32px; background: #fff; box-shadow: var(--shadow); border-radius: 6px; color: #1f2633; }
.sum-head { display: grid; grid-template-columns: 160px 1fr 160px; align-items: center; gap: 12px; margin-bottom: 18px; }
.sum-head img { width: 150px; }
.sum-head h1 { text-align: center; font-size: 1.35rem; margin: 0; color: #000; }
.sum-head-ref { text-align: right; font-size: .78rem; color: var(--muted); }
.sum-section { margin-bottom: 22px; overflow-x: auto; }
.sum-bar {
    background: var(--slate); color: #fff; font-size: .95rem; font-weight: 700; letter-spacing: .1em;
    padding: 4px 8px; margin: 0 0 8px; -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.sum-sub { font-size: .9rem; margin: 16px 0 6px; color: var(--ink); }
.sum-text { font-size: .9rem; padding: 2px 8px; }
.sum-muted { color: var(--muted); }
.sum-na { color: var(--muted); font-style: italic; }
.sum-list { margin: 0; padding-left: 1.3em; }
.sum-list li { margin: 2px 0; }
.sum-foot { font-size: .78rem; color: var(--muted); margin: 4px 0 0; font-style: italic; }

.sum table { width: 100%; border-collapse: collapse; font-size: .84rem; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sum-info th, .sum-info td { border: 1px solid #222; padding: 5px 10px; }
.sum-info th { background: #f2f2f2; text-align: right; width: 17%; white-space: nowrap; }
.sum-info td { text-align: center; width: 33%; }
.sum-info td.sum-left { text-align: left; }

.sum-table { margin-bottom: 12px; table-layout: auto; }
.sum-table th, .sum-table td { border: 1px solid #6b6b6b; padding: 6px 8px; text-align: center; vertical-align: middle; }
.sum-table thead th { background: #000; color: #fff; font-weight: 700; }
.sum-table thead th.sum-subhead { font-size: .76rem; }
.sum-table tbody td { background: #fff; }
.sum-table .sum-vendor { color: #fff; text-align: right; font-weight: 700; white-space: nowrap; }
.sum-table .sum-desc { text-align: right; background: #f2f2f2; min-width: 180px; }
.sum-table thead .sum-desc { background: #000; text-align: center; }
.sum-table .sum-question { background: #f2f2f2; text-align: right; font-weight: 400; width: 24%; min-width: 180px; }
.sum-table thead .sum-question { background: #000; text-align: center; font-weight: 700; }
.sum-strong td { font-weight: 700; }
.sum-best { font-weight: 700; color: #000; }
.sum-neg { color: var(--red); }
.sum-flag, .sum-award {
    display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    padding: 1px 6px; border-radius: 4px; margin-left: 4px; vertical-align: 1px;
}
.sum-flag { background: #1f7a3d; color: #fff; }
.sum-award { background: #fff; color: var(--ink); }
.sum-table tfoot th, .sum-table tfoot td { font-weight: 700; font-size: .9rem; }
.sum-table tfoot .sum-total-label { background: #7f7f7f; color: #fff; text-align: right; }
.sum-baseline-row th { background: #f2f2f2; text-align: right; }
.sum-baseline-row td { font-weight: 700; }
.sum-qa td { text-align: left; vertical-align: top; font-size: .8rem; }
.sum-qa td.rich p { margin: 0 0 .4em; }
.sum-qa td.rich ul, .sum-qa td.rich ol { margin: 0 0 .4em; }

.sum-chart { margin: 6px 0 4px; }
.sum-chart svg { width: 100%; max-width: 860px; height: auto; display: block; font-family: var(--font); }
.sum-chart-label { font-size: 13px; fill: #1f2633; }
.sum-chart-value { font-size: 13px; font-weight: 700; fill: #1f2633; }
.sum-chart-tag { font-weight: 400; fill: var(--muted); }
.sum-chart-divider { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 3; }
.sum-chart-label.is-baseline { font-style: italic; fill: var(--muted); }
.sum-narrow { width: auto; min-width: 55%; }

.sum-footer { text-align: center; font-size: .75rem; font-style: italic; font-weight: 700; color: #333; margin-top: 26px; padding-top: 10px; border-top: 1px solid var(--line); }
.sum-edit { margin-top: 28px; padding: 22px; border: 2px dashed var(--line); box-shadow: none; }
.sum-edit h2 { font-size: 1.1rem; }

@media screen and (max-width: 760px) {
    .sum { padding: 16px; margin: 0; border-radius: 0; }
    .sum-head { grid-template-columns: 1fr; text-align: center; }
    .sum-head img { margin: 0 auto; }
    .sum-head-ref { text-align: center; }
    .sum-info th, .sum-info td { display: block; width: auto; text-align: left; }
}

@media print {
    @page { size: letter; margin: .45in; }
    .summary-page { background: #fff; }
    .sum { box-shadow: none; margin: 0; padding: 0; max-width: none; border-radius: 0; font-size: 11px; }
    .sum-section { break-inside: auto; overflow: visible; }
    .sum-table, .sum-chart { break-inside: avoid; }
    .sum-table thead { display: table-header-group; }
    .sum-bar { break-after: avoid; }
}

@media print {
    body { background: #fff; font-size: 12px; }
    .no-print, .topbar, .accent-bar, .footer, .print-bar { display: none !important; }
    .container { padding: 0; max-width: none; }
    .doc { box-shadow: none; border: 0; max-width: none; }
    .doc-cover, .doc-body { padding-left: 0; padding-right: 0; }
    .doc-footer { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .doc-cover { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    a { color: inherit; }
}
