/* GlexScale PartnerMatch - application styles, matched to www.glexscale.com:
   charcoal #202020, cyan #75E9FC, purple #570185, logo green #70D050; Source Sans 3 throughout. */
:root {
  --brand: #570185; --brand-600: #6a1a99; --brand-50: #f5eefa; --brand-100: #ead9f5;
  --accent: #70D050; --accent-700: #3f8f1e;
  --dark: #202020; --dark-2: #2b2b2b; --cyan: #75E9FC;
  --ink: #1d1a22; --ink-2: #4a4552; --ink-3: #77717f; --line: #e4e0ea; --line-2: #f0edf4;
  --bg: #faf9fc; --card: #ffffff; --ok: #2e7d32; --warn: #b26a00; --bad: #c0392b; --info: #1f5fa8;
  --radius: 10px; --shadow: 0 1px 2px rgba(29,26,34,.06), 0 2px 8px rgba(29,26,34,.04);
  --font: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-weight: 700; letter-spacing: -.01em; }
h2 { font-weight: 600; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.08rem; } h4 { font-size: .95rem; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--ink-3); }
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.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)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } h1 { font-size: 1.4rem; } }

/* top bar */
.topbar { background: var(--dark); border-bottom: 1px solid #000; position: sticky; top: 0; z-index: 20; }
.topbar .container { display: flex; align-items: center; gap: 20px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #fff; font-size: 1.05rem; }
.logo:hover { text-decoration: none; }
.logo img { height: 38px; width: auto; display: block; }
.logo-mark { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--accent); color: var(--accent); display: grid; place-items: center; font-size: 14px; }
.logo span.sub { color: var(--cyan); font-weight: 600; font-size: .85rem; padding-left: 10px; border-left: 1px solid #444; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a { padding: 8px 12px; border-radius: 8px; color: #e9e9e9; font-weight: 600; font-size: .95rem; }
.nav a:hover, .nav a.on { background: rgba(255,255,255,.07); color: var(--cyan); text-decoration: none; }
.topbar .nav-right .btn { background: transparent; color: #e9e9e9; border-color: #4a4a4a; }
.topbar .nav-right .btn:hover { color: var(--cyan); border-color: var(--cyan); }
.topbar .nav-right .btn-primary { background: var(--cyan); color: var(--dark); border-color: var(--cyan); }
.topbar .nav-right .btn-primary:hover { background: #a3f1fd; color: var(--dark); }
.nav-right { display: flex; gap: 8px; align-items: center; }
.menu-toggle { display: none; background: none; color: #e9e9e9; border: 1px solid #4a4a4a; border-radius: 8px; padding: 6px 10px; }
@media (max-width: 860px) {
  .menu-toggle { display: block; margin-left: auto; }
  .nav, .nav-right { display: none; }
  .topbar.open .container { flex-wrap: wrap; height: auto; padding-bottom: 12px; }
  .topbar.open .nav, .topbar.open .nav-right { display: flex; width: 100%; flex-direction: column; align-items: stretch; }
}

main { padding: 28px 0 60px; min-height: 70vh; }
.footer { background: var(--dark); padding: 26px 0; color: #b9b9b9; font-size: .9rem; }
.footer a { color: #e9e9e9; margin-right: 16px; }
.footer a:hover { color: var(--cyan); }

/* cards, panels */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card.tight { padding: 14px 16px; }
.card h2, .card h3 { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.kpi { font-size: 1.8rem; font-weight: 700; color: var(--brand); line-height: 1.1; }
.kpi-label { color: var(--ink-3); font-size: .85rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--ink-2); margin: 0; }
.crumbs { font-size: .85rem; color: var(--ink-3); margin-bottom: 8px; }
.crumbs a { color: var(--ink-3); }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; border-radius: 8px; padding: 9px 16px;
       font-weight: 600; font-size: .92rem; cursor: pointer; font-family: inherit; line-height: 1.2; text-decoration: none !important; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-accent { background: var(--accent); color: #173d05; }
.btn-secondary { background: #fff; color: var(--brand); border-color: var(--brand-100); }
.btn-secondary:hover { background: var(--brand-50); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-danger { background: #fff; color: var(--bad); border-color: #f1c4bf; }
.btn-sm { padding: 6px 10px; font-size: .84rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }

/* badges and chips */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: #e6f4e6; color: var(--ok); } .badge.warn { background: #fff3e0; color: var(--warn); }
.badge.bad { background: #fdecea; color: var(--bad); } .badge.info { background: #e8f0fa; color: var(--info); }
.badge.brand { background: var(--brand-50); color: var(--brand); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--brand-50); color: var(--brand); font-size: .82rem; margin: 2px; }
.chip a { color: inherit; font-weight: 700; }
.score { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; padding: 3px 8px; border-radius: 8px; font-weight: 700; color: #fff; font-size: .9rem; }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tr:hover td { background: #fcfbfe; }
.table-wrap { overflow-x: auto; }

/* forms */
label { font-weight: 600; font-size: .9rem; display: block; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date],
input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #d6d0de; border-radius: 8px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-100); border-color: var(--brand); }
select.multi, select[multiple] { min-height: 150px; }
.field { margin-bottom: 16px; }
.field .help { color: var(--ink-3); font-size: .82rem; margin-top: 4px; }
.field .errorlist, ul.errorlist { color: var(--bad); font-size: .85rem; list-style: none; padding: 0; margin: 4px 0 0; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.checks label, .check { font-weight: 400; display: inline-flex; gap: 6px; align-items: center; margin: 0; font-size: .9rem; }
.checks ul, .checks div { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 4px; margin: 0 0 18px; background: #fff; }
legend { font-weight: 700; color: var(--brand); padding: 0 6px; }
.assume { font-size: .8rem; color: var(--ink-3); font-weight: 400; display: inline-flex; gap: 6px; align-items: center; margin-top: 4px; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line); }

/* messages */
.messages { list-style: none; padding: 0; margin: 0 0 18px; }
.msg { padding: 11px 14px; border-radius: 8px; margin-bottom: 8px; border: 1px solid; font-size: .93rem; }
.msg.success { background: #eef8ea; border-color: #cfe9c4; color: #24561a; }
.msg.error { background: #fdecea; border-color: #f4c7c1; color: #8a2419; }
.msg.warning { background: #fff6e5; border-color: #f6dfb2; color: #7a4a00; }
.msg.info { background: #eef3fb; border-color: #cfdcf1; color: #1c4475; }

/* progress */
.progress { height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.progress.green > span { background: var(--accent-700); }
.bar { height: 8px; border-radius: 4px; background: var(--line-2); position: relative; overflow: hidden; }
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; color: var(--ink-2); font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); text-decoration: none; }

/* timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 0 0 12px 18px; border-left: 2px solid var(--line); position: relative; font-size: .9rem; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }

/* landing */
.hero { background: radial-gradient(1200px 500px at 85% -10%, rgba(87,1,133,.55), transparent 60%), var(--dark); color: #fff; padding: 76px 0 68px; margin-top: -28px; }
.hero a:not(.btn) { color: var(--cyan); }
.hero .btn-primary { background: var(--cyan); color: var(--dark); }
.hero .btn-primary:hover { background: #a3f1fd; }
.hero .btn-secondary { background: transparent; color: #fff; border-color: #6b6b6b; }
.hero h1 { font-size: 2.6rem; max-width: 760px; }
.hero p.lead { font-size: 1.2rem; color: #d8d8d8; max-width: 680px; }
.hero .stats { display: flex; gap: 36px; margin-top: 34px; flex-wrap: wrap; }
.hero .stats b { display: block; font-size: 1.9rem; color: var(--cyan); font-weight: 700; }
.hero .stats span { color: #bdbdbd; font-size: .92rem; }
.section { padding: 56px 0; }
.section.alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.step { text-align: left; }
.step .n { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; margin-bottom: 10px; }
.diff .icon { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; font-weight: 800; margin-bottom: 10px; }
@media (max-width: 640px) { .hero h1 { font-size: 1.8rem; } }

/* partner cards */
.pcard { display: flex; flex-direction: column; gap: 10px; }
.pcard .head { display: flex; gap: 12px; align-items: center; }
.avatar { width: 46px; height: 46px; border-radius: 10px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; font-weight: 800; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.pcard .name { font-weight: 700; color: var(--ink); }
.pcard .tagline { color: var(--ink-2); font-size: .9rem; min-height: 2.6em; }
.pcard .meta { color: var(--ink-3); font-size: .82rem; }
.filters { position: sticky; top: 80px; }
.filters .group { margin-bottom: 14px; }
.filters .group > b { display: block; font-size: .82rem; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; letter-spacing: .03em; }
.filters .opts { max-height: 160px; overflow-y: auto; }
.filters .opts label { font-weight: 400; display: flex; gap: 6px; font-size: .88rem; margin: 2px 0; }
.dir-layout { display: grid; grid-template-columns: 250px 1fr; gap: 24px; }
@media (max-width: 860px) { .dir-layout { grid-template-columns: 1fr; } .filters { position: static; } }
.htmx-indicator { opacity: 0; transition: opacity .2s; } .htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* GCS breakdown */
.dim-row { display: grid; grid-template-columns: 210px 1fr 48px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.dim-row .txt { grid-column: 1 / -1; color: var(--ink-2); font-size: .88rem; margin-top: -2px; }
@media (max-width: 640px) { .dim-row { grid-template-columns: 1fr 48px; } .dim-row .bar { grid-column: 1 / -1; } }

/* console */
.console-layout { display: grid; grid-template-columns: 210px 1fr; gap: 24px; }
.side { position: sticky; top: 80px; align-self: start; }
.side a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: .92rem; }
.side .ico { width: 18px; height: 18px; flex: none; color: var(--ink-3); }
.side a.on .ico, .side a:hover .ico { color: var(--brand); }
.side a.on, .side a:hover { background: var(--brand-50); color: var(--brand); text-decoration: none; }
@media (max-width: 860px) { .console-layout { grid-template-columns: 1fr; } .side { position: static; display: flex; flex-wrap: wrap; gap: 4px; } }
.wb-sub { display: grid; grid-template-columns: 1fr 80px 70px; gap: 8px; align-items: center; padding: 4px 0; font-size: .9rem; }
.wb-sub input[type=number] { padding: 6px 8px; }
.issue-list { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.issue-list li { padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.issue-list .error { color: var(--bad); font-weight: 600; } .issue-list .warning { color: var(--warn); font-weight: 600; }
.cookie { position: fixed; bottom: 16px; left: 16px; right: 16px; max-width: 560px; background: var(--ink); color: #fff; padding: 14px 16px; border-radius: 10px; z-index: 50; display: none; font-size: .9rem; box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.cookie a { color: var(--accent); }
.empty { text-align: center; padding: 40px 20px; color: var(--ink-3); }
.kv { display: grid; grid-template-columns: 220px 1fr; gap: 10px 16px; font-size: .92rem; align-items: baseline; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; }
@media (max-width: 640px) { .kv { grid-template-columns: 1fr; } .kv dt { margin-top: 8px; } }
.ev { font-size: .82em; font-weight: 600; color: var(--ink-3); }
.ev-fact { color: #2f6e1f; } .ev-inference { color: #1f5fa8; } .ev-uncertain { color: #b26a00; }
.pill-reference { background: #fff3e0; color: #7a4a00; border: 1px solid #f6dfb2; padding: 8px 12px; border-radius: 8px; font-size: .88rem; }

/* intake steps */
.steps { display: flex; gap: 6px; margin: 0 0 18px; flex-wrap: wrap; }
.steps a { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); font-size: .85rem; font-weight: 600; text-decoration: none; background: #fff; }
.steps a .n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--line); color: var(--ink-2); font-size: .78rem; }
.steps a.done .n { background: var(--ok, #2e7d32); color: #fff; }
.steps a.on { border-color: var(--brand); color: var(--brand); }
.steps a.on .n { background: var(--brand); color: #fff; }
@media (max-width: 760px) { .steps a .t { display: none; } }
.checks-grid, .checks ul { display: flex; flex-wrap: wrap; gap: 4px 14px; }
/* country picker */
.picker { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; }
.picker-bar { display: flex; gap: 10px; align-items: center; }
.picker-search { flex: 1; }
.picker-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.picker-chips:empty { display: none; }
.chip { border: 1px solid var(--brand); color: var(--brand); background: #fff; border-radius: 999px; padding: 2px 10px; font-size: .82rem; cursor: pointer; }
.chip:hover { background: var(--brand); color: #fff; }
.picker-list { max-height: 210px; overflow-y: auto; margin-top: 8px; padding: 2px; }
.picker-list > div, .picker-list ul { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 12px; }
[data-other-for] { margin-left: 18px; padding-left: 12px; border-left: 3px solid var(--line); }
/* partner profile values */
.chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chip-v { display: inline-block; padding: 1px 9px; border-radius: 999px; background: #f4f3f7; border: 1px solid #dcd8e3; color: var(--ink-2); font-size: .88rem; line-height: 1.6; }
.chip-v small { color: var(--ink-3); }
.chip-fit { background: #e9f8e1; border: 1px solid #9bdc7c; color: #2c6b12; font-weight: 600; border-radius: 999px; padding: 1px 9px; }
.fit-legend { margin: 2px 0 -4px; font-size: .9rem; }
/* report upload and PDF choice */
.upload-box { border: 1px dashed var(--line); border-radius: 10px; padding: 14px 16px; margin: 4px 0 14px; background: #fcfbfe; }
.disclaimer { display: flex; gap: 8px; align-items: flex-start; font-size: .86rem; color: var(--ink-2); background: #fff8e6; border: 1px solid #f1d58a; border-radius: 8px; padding: 8px 10px; margin: 6px 0 12px; }
.pdf-choice { display: grid; gap: 10px; margin-bottom: 12px; }
.pdf-choice .check { align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.pdf-choice .check:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }

/* Staff guide (console > Help) */
.help { max-width: 860px; }
.help-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.help-head h1 { margin: 0 0 4px; }
.help-head > div { flex: 1 1 420px; }
.help-head .btn { white-space: nowrap; }
.help section { scroll-margin-top: 84px; padding-top: 8px; }
.help section > h2 { margin: 32px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.help h3 { margin: 22px 0 8px; font-size: 1.05rem; }
.help p, .help li, .help dd { color: var(--ink-2); }
.help li { margin: 4px 0; }
.help .small { font-size: .88rem; }
.help-toc { margin: 16px 0 8px; }
.help-toc h2 { font-size: 1rem; margin: 0 0 6px; }
.help-toc ol { columns: 2; column-gap: 28px; margin: 0; padding-left: 20px; }
.help-toc li { break-inside: avoid; margin: 0 0 6px; }
.help figure { margin: 14px 0 18px; }
.help figure img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: #fff; }
.help figcaption { font-size: .86rem; color: var(--ink-3); margin-top: 6px; }
.help .callout { background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 8px; padding: 10px 14px; margin: 12px 0; color: var(--ink-2); }
.help .callout.warn { background: #fff8e6; border-color: #f1d58a; }
.help .tag-admin { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--brand); background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 999px; padding: 0 8px; vertical-align: 2px; }
.help-table { margin: 10px 0 16px; }
.help-table td:first-child { white-space: nowrap; font-weight: 600; color: var(--ink); }
.help .faq dt { font-weight: 600; margin-top: 12px; color: var(--ink); }
.help .faq dd { margin: 2px 0 0; }
@media (max-width: 720px) { .help-toc ol { columns: 1; } .help-table td:first-child { white-space: normal; } }
@media print {
  .topbar, .footer, .cookie, .side, .no-print, .messages { display: none !important; }
  .console-layout { display: block; }
  body { background: #fff; font-size: 11pt; }
  .help { max-width: none; }
  .help figure, .help-table, .help .callout, .help .faq dt { break-inside: avoid; }
  .help .faq dt { break-after: avoid; }
  .help figure img { box-shadow: none; max-height: 125mm; width: auto; }
  .help section > h2 { break-after: avoid; }
  .help h3 { break-after: avoid; }
  .help-toc { break-after: page; }
  .help a { color: inherit; }
}
