/* Bonaccord partner sponsor portal. Colors, type and layout follow Paolo's prototype v0.2. */

:root {
  --bg: #f1f5f8;
  --surface: #ffffff;
  --surface-2: #e8eef3;
  --line: #d1d9e0;
  --fg: #031e30;
  --muted: #5a6b79;
  --accent: #246287;
  --accent-2: #a9c4d8;
  --hl: #e3edf5;
  --gold: #b7791f;
  --gold-soft: #fbf3e4;
  --gold-fg: #7a4e0e;
  --ok: #2e7d5b;
  --ok-soft: #e3f2eb;
  --warn-soft: #fff4e5;
  --band: #031e30;
  --band-muted: #a9c4d8;
  --median: #b7791f;
  --c1: #031e30;
  --c2: #246287;
  --c3: #6fa3c7;
  --c4: #c6d1da;
  --c5: #3f7f6e;
  --c6: #8a97a2;
  --c7: #d9b84a;
  --c8: #a9c4d8;
  --c9: #7a5c8a;
  --font: "Bierstadt", "Public Sans", "Segoe UI", Arial, sans-serif;
  --r: 8px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 14px; line-height: 1.45; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.note { color: var(--muted); font-size: 12.5px; }
.small { font-size: 12px; }
.lbl { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.lbl.on-band { color: var(--band-muted); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: 6px; }
.js-only { display: none; }
.js .js-only { display: revert; }
.js .picker-bar.js-only { display: flex; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 13.5px; border-radius: 6px; padding: 9px 16px; cursor: pointer; border: 1px solid transparent; text-decoration: none; white-space: nowrap; }
.btn.pri { background: var(--accent); color: #fff; }
.btn.pri:hover { filter: brightness(1.08); }
.btn.sec { background: var(--surface); border-color: var(--line); color: var(--fg); }
.btn.sec:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--accent); padding: 6px 8px; }
.btn.lg { padding: 11px 18px; font-size: 14.5px; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; }
.linkbtn.on-band { color: var(--band-muted); }

/* Sign-in and error pages */
body.gate { display: grid; place-items: center; min-height: 100%; padding: 24px 16px; background: linear-gradient(180deg, var(--band) 0 38%, var(--bg) 38%); }
.gcard { width: min(460px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 28px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 10px 40px rgba(3, 30, 48, .18); }
.gcard h1 { font-size: 21px; }
.gatelogo { background: var(--band); margin: -28px -28px 4px; padding: 22px 28px; border-radius: 12px 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.gatelogo img { width: 170px; height: auto; }
.gatelogo small, .raillogo small { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--band-muted); }
.sso { display: flex; flex-direction: column; gap: 10px; }
.notice { margin: 0; padding: 10px 12px; border-radius: 6px; background: var(--hl); font-size: 13px; }
.notice.warn { background: var(--warn-soft); color: var(--gold-fg); }

/* Portal frame */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100%; }
.rail { background: var(--band); color: #fff; display: flex; flex-direction: column; gap: 6px; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.raillogo { padding: 4px 10px 20px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; }
.raillogo img { width: 150px; height: auto; }
.navb { display: flex; align-items: center; gap: 11px; color: var(--band-muted); padding: 9px 10px; border-radius: 7px; font-size: 13.5px; font-weight: 500; text-decoration: none; }
.navb:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.navb[aria-current="page"] { background: rgba(169, 196, 216, .18); color: #fff; font-weight: 600; }
.navb svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rail .sep { height: 1px; background: rgba(169, 196, 216, .2); margin: 10px 6px; }
.rail .foot { margin-top: auto; font-size: 11.5px; color: var(--band-muted); padding: 10px; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.rail .foot .who-name { color: #fff; font-weight: 600; font-size: 12.5px; }
.rail .foot form { margin-top: 8px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.view { padding: 24px 24px 40px; max-width: 1320px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.ft { margin-top: auto; padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11.5px; border-top: 1px solid var(--line); }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 10px; }
  .raillogo { padding: 4px 8px; }
  .rail .foot { margin-top: 0; }
}

/* Page parts */
.vh { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.vh h1 { font-size: 24px; font-weight: 600; }
.vh p { margin: 4px 0 0; color: var(--muted); max-width: 80ch; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; min-width: 0; }
.card h2 { font-size: 16px; font-weight: 600; }
.card h3 { font-size: 14px; font-weight: 600; margin: 14px 0 8px; }
.card .sub { color: var(--muted); font-size: 12.5px; margin: 4px 0 0; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 860px) { .g2 { grid-template-columns: 1fr; } }
.tag { display: inline-flex; align-items: center; font-size: 11px; border-radius: 4px; padding: 2px 7px; background: var(--surface-2); color: var(--muted); white-space: nowrap; margin-left: 6px; }
.tag:first-child { margin-left: 0; }
.tag.live { background: var(--ok-soft); color: var(--ok); }
.tag.sp { background: var(--gold-soft); color: var(--gold-fg); }
.empty, .empty-card { color: var(--muted); }
.empty { font-size: 13px; padding: 22px; text-align: center; border: 1px dashed var(--line); border-radius: var(--r); }
.empty-card { border-style: dashed; }
.empty-card h2 { color: var(--fg); margin-bottom: 6px; }
.empty-card p { margin: 6px 0 0; max-width: 75ch; }
.welcome { background: var(--band); color: #fff; border-radius: 12px; padding: 26px; }
.welcome h1 { font-size: 26px; margin: 6px 0 6px; }
.welcome p { margin: 0; color: var(--band-muted); max-width: 70ch; }
.link-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--fg); }
.link-card:hover { border-color: var(--accent-2); box-shadow: 0 2px 10px rgba(3, 30, 48, .06); }
.link-card .tag { align-self: flex-start; }
.link-card .go { margin-top: auto; color: var(--accent); font-weight: 600; font-size: 13px; }
.muted-card { opacity: .75; }
.search-bar input { width: 100%; max-width: 560px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 9px 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.tile { background: var(--surface-2); border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.tile span { font-size: 11.5px; color: var(--muted); }
.tile b { font-size: 17px; font-variant-numeric: tabular-nums; }
.crumbs { margin: 0; font-size: 12.5px; color: var(--muted); }
.kv { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px; }
.kv li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--surface-2); padding: 3px 0; font-size: 13px; }
.facts { margin: 0; padding: 12px 16px 12px 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); font-size: 12.5px; color: var(--muted); display: grid; gap: 4px; }
.facts b { color: var(--fg); font-weight: 600; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab { padding: 8px 12px; border-bottom: 2px solid transparent; color: var(--muted); text-decoration: none; font-weight: 500; }
.tab[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent); font-weight: 600; }
.tcount { font-size: 11px; background: var(--surface-2); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }

/* Team Lens setup */
.setup .steps { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 18px; counter-reset: step; }
.setup .step { display: grid; gap: 8px; counter-increment: step; position: relative; padding-left: 38px; }
.setup .step::before { content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--band); color: #fff; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; }
.setup select, .setup input[type="search"], .picker-bar input[type="search"] { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: var(--surface); max-width: 520px; width: 100%; }
.picker-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.picker-bar input[type="search"] { flex: 1; min-width: 200px; }
.picker-bar select { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: var(--surface); }
.peer-list { list-style: none; margin: 0; padding: 4px; border: 1px solid var(--line); border-radius: 6px; max-height: 360px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 2px 12px; }
.peer-list label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 5px; cursor: pointer; }
.peer-list label:hover { background: var(--hl); }
.peer-list .peer-name { flex: 1; min-width: 0; }
.peer-list .raised { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.peer-list li.self { opacity: .45; }
.refcard { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; max-width: 620px; cursor: pointer; }
.refcard span { display: flex; flex-direction: column; gap: 2px; }
.opt { text-transform: none; letter-spacing: 0; }
.go-row { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }

/* Team Lens results */
.bar { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.bar .who { margin: 4px 0; font-size: 18px; font-weight: 600; }
.bar-actions { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.profile-links { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 8px 0 0; }
.pchip { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; text-decoration: none; color: var(--fg); }
.pchip.you { background: var(--hl); border-color: var(--accent-2); font-weight: 600; }
.snav { display: flex; gap: 6px; flex-wrap: wrap; position: sticky; top: 0; z-index: 3; background: var(--bg); padding: 8px 0; }
.snav a { font-size: 12.5px; padding: 5px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--fg); }
.chart-toggle { margin: 0; font-size: 12.5px; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1000px) { .kpis { grid-template-columns: 1fr; } }
.scard { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--fg); }
.scard .ssec { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); }
.scard .sm { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; border-top: 1px solid var(--surface-2); padding-top: 5px; }
.scard .sm > span:first-child { color: var(--muted); }
.scard .sm > span:last-child { text-align: right; white-space: nowrap; }
.section { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 52px; }
.sect { font-size: 19px; margin-top: 10px; }
.sdesc { margin: -8px 0 0; color: var(--muted); font-size: 13px; }
.exhibit { scroll-margin-top: 52px; }
.exhibit h3 { font-size: 15px; font-weight: 500; margin: 0; }
.exhibit h3 b { font-weight: 700; }
.rk { margin: 6px 0 4px; font-size: 13px; }
.how { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.how summary, .as-table summary { cursor: pointer; color: var(--accent); }
.srcl { margin-top: 8px; }

/* Charts */
.chart-scroll, .table-scroll { overflow-x: auto; }
.chart-svg { display: block; max-width: 100%; height: auto; font-family: var(--font); }
.chart-scroll .chart-svg { max-width: none; }
.chart-svg text { font-size: 10.5px; fill: var(--fg); }
.chart-svg .axis { font-size: 11px; font-weight: 700; }
.chart-svg .muted { fill: var(--muted); }
.chart-svg .focus-band { fill: var(--hl); }
.chart-svg .seg.c1 { fill: var(--c1); } .chart-svg .seg.c2 { fill: var(--c2); } .chart-svg .seg.c3 { fill: var(--c3); }
.chart-svg .seg.c4 { fill: var(--c4); } .chart-svg .seg.c5 { fill: var(--c5); } .chart-svg .seg.c6 { fill: var(--c6); }
.chart-svg .seg.c7 { fill: var(--c7); } .chart-svg .seg.c8 { fill: var(--c8); } .chart-svg .seg.c9 { fill: var(--c9); }
.chart-svg .hatched { stroke: var(--c6); stroke-width: 1; stroke-dasharray: 3 2; }
.chart-svg .hatch-bg { fill: #fff; }
.chart-svg .hatch-line { stroke: var(--c6); stroke-width: 2; }
.chart-svg .median-line { stroke: rgba(255, 255, 255, .55); stroke-width: 1.5; }
.chart-svg .median-divider { stroke: var(--c6); stroke-width: 1.2; stroke-dasharray: 2 3; }
.chart-svg .seg-label { font-size: 9.5px; }
.chart-svg .seg-label.on-dark { fill: #fff; }
.chart-svg .seg-side { font-size: 8.5px; fill: var(--muted); }
.chart-svg .top { font-size: 11px; font-weight: 700; }
.chart-svg .name { font-size: 10.5px; }
.chart-svg .name.focus { font-weight: 700; }
.chart-svg .name.focus-sub { font-size: 9px; fill: var(--accent); font-weight: 700; }
.chart-svg .name.median { font-style: italic; fill: var(--muted); }
.chart-svg .baseline { stroke: var(--c6); stroke-width: 1; }
.chart-svg .row-line { stroke: var(--line); }
.chart-svg .row-label { font-size: 9.5px; fill: var(--muted); }
.chart-svg .row-value { font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-svg .row-value.focus { font-weight: 700; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0; margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.swatch.c1 { background: var(--c1); } .swatch.c2 { background: var(--c2); } .swatch.c3 { background: var(--c3); }
.swatch.c4 { background: var(--c4); } .swatch.c5 { background: var(--c5); } .swatch.c6 { background: var(--c6); }
.swatch.c7 { background: var(--c7); } .swatch.c8 { background: var(--c8); } .swatch.c9 { background: var(--c9); }
.swatch.hatched { background: repeating-linear-gradient(45deg, var(--c6) 0 2px, #fff 2px 5px); outline: 1px dashed var(--c6); }
.swatch.median { background: repeating-linear-gradient(45deg, var(--c6) 0 2px, #e9edf0 2px 5px); }
.as-table { margin-top: 8px; font-size: 12.5px; }

/* Tables */
table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--surface-2); vertical-align: top; }
thead th { color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.focus th, tr.focus td, td.focus, th.focus { background: var(--hl); }
tr.median th { font-style: italic; color: var(--muted); }
.ladder td .title { display: block; }
.ladder td .title.strong { font-weight: 700; }
.ladder .tenure { display: block; font-style: italic; color: var(--accent); font-size: 11.5px; }
.ladder .focus-sub { display: block; font-size: 10.5px; color: var(--accent); }
.ladder tfoot th, .ladder tfoot td { font-weight: 700; border-top: 1px solid var(--line); }
.roster td.spec { color: var(--accent); font-weight: 600; }
.roster .ext { color: var(--muted); font-style: italic; }
.rcount { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 8px; }
.funds tr.raising td { background: var(--gold-soft); }
.adj { color: var(--gold-fg); cursor: help; }

/* Profile */
.profile-head h1 { font-size: 24px; margin: 4px 0; }
.profile-head .pf { margin: 2px 0; font-size: 13px; }
.profile-head .tabs { margin-top: 12px; }
.profile-grid { margin-top: 8px; }
.vc p { margin: 6px 0; }

/* Managers */
.mgrgrid { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.mgr { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; color: var(--fg); height: 100%; }
.mgr:hover { border-color: var(--accent-2); background: var(--hl); }
.mgr-figures { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Forms */
.form { display: grid; gap: 14px; max-width: 620px; }
.field { display: grid; gap: 6px; font-weight: 600; font-size: 13px; }
.field input, .field textarea, .field select { font-weight: 400; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: var(--surface); }
.field.invalid input, .field.invalid textarea { border-color: var(--gold); }
.field .error { color: var(--gold-fg); font-weight: 400; font-size: 12.5px; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }

/* Connect to AI */
.numbered { margin: 10px 0 0; padding-left: 22px; display: grid; gap: 10px; }
.numbered li { padding-left: 2px; }
.copy-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; max-width: 560px; }
.copy-row input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: var(--surface-2); }
.plain-list { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.consent-actions { display: flex; justify-content: flex-end; gap: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Admin */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 16px; margin-top: 12px; }
.form-grid .field { align-content: end; }
.field.check { display: flex; align-items: center; gap: 8px; font-weight: 500; align-self: end; padding-bottom: 8px; }
td.val { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; overflow-wrap: anywhere; max-width: 320px; }
.file { display: block; }
