/* Northline on the live site: the preview strip, loading states, the real match form,
   streamed text and the correction form. Builds on the prototype's tokens. */

[hidden] { display: none !important; }

/* ---------- preview strip (only Northline visitors see it) ---------- */

.foot__nav { flex-wrap: wrap; }
.fload { margin-top: 28px; display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 14px; }
.ilink--btn { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }

/* ---------- match form ---------- */
.mid { border: 0; margin: 16px 0 0; padding: 0; min-width: 0; }
.mid .field__l small { font-weight: 400; color: var(--ink-3); }
.mid__c { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.idc { position: relative; display: inline-flex; }
.idc input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.idc span { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; background: var(--card); }
.idc input:checked + span { background: var(--sel); border-color: var(--sel-line); color: var(--ink); font-weight: 500; }
.idc input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.drop { cursor: pointer; }
.drop .btn { pointer-events: none; }
.merr { margin-top: 10px; color: var(--red); font-size: 14px; font-weight: 500; }
.mform textarea.input { min-height: 120px; padding: 10px 12px; line-height: 1.5; resize: vertical; }

/* ---------- results: streamed text, intro drafts ---------- */
.rstream { font-size: 14px; line-height: 1.6; color: var(--ink); }
.rstream:empty { display: none; }
.rstream p + p, .rstream ul + p, .rstream p + ul { margin-top: 8px; }
.rstream ul { padding-left: 18px; margin: 0; display: grid; gap: 4px; }
.rstream.mail { padding: 12px; background: var(--page); margin: 8px 0 10px; }
.rsec .btn + .btn { margin-left: 8px; }
.rsec label.btn { cursor: pointer; }
.rhelp { margin-top: 8px; font-size: 12.5px; }
.path { grid-template-columns: 32px 1fr auto; }
.path__d { grid-column: 2 / -1; justify-self: start; }
.path__msg { grid-column: 1 / -1; }
.path__msg:empty { display: none; }
.path__msg .mail__b { border: 1px solid var(--line); border-radius: 8px; }

/* ---------- correction form ---------- */
.rform { display: grid; gap: 14px; }
.rform textarea.input { min-height: 110px; padding: 10px 12px; line-height: 1.5; }
.rform small { font-weight: 400; color: var(--ink-3); }
.rform__err { color: var(--red); font-size: 14px; font-weight: 500; }
.rform .btn { justify-self: start; }

/* ---------- fund page, Orbit order: network beside related funds and portfolio ---------- */
.fnet .card__b { padding-top: 6px; }
.rel { list-style: none; margin: 0; padding: 0; display: grid; }
.rel a, .rel__x { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); min-height: 44px; }
.rel li:first-child a, .rel li:first-child .rel__x { border-top: 0; }
.rel b { display: block; font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel small { display: block; font-size: 12.5px; color: var(--ink-3); }
.rel a:hover b { text-decoration: underline; text-decoration-color: var(--line-2); }
.thesis__h { margin-top: 20px; font-size: 15.5px; }
.thesis__h + .thesis__u { margin-top: 6px; }
.compl__n { margin-top: 6px; font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
/* the header's "Find my funds" is redundant on the match pages themselves */
body[data-view="match"] .bar__cta { display: none; }
/* match drawer: who the fund is */
.rabout__b { font-size: 14px; line-height: 1.55; color: var(--ink); }
.rabout__kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 10px 0 0; }
.rabout__kv div { min-width: 0; }
.rabout__kv dt { font-size: 12px; color: var(--ink-3); }
.rabout__kv dd { margin: 1px 0 0; font-size: 13.5px; color: var(--ink); overflow-wrap: anywhere; }
/* fund page portfolio: logo rows, each linking to the company's site */
.port__i > a { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: inherit; }
.port__i > a:hover b { text-decoration: underline; text-decoration-color: var(--line-2); }
.port__i span { min-width: 0; }

/* fund page top: "At a glance" on the left, "Does it fit your round?" on the right */
.ftop { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; margin-top: 20px; align-items: stretch; }
.ftop > .fit { margin-top: 0; }
.snapcard { padding: 18px 20px; }
.snapcard h2 { font-size: 15.5px; }
.snap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 12px 0 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.snap__c { padding: 12px 14px; min-width: 0; border-top: 1px solid var(--line); }
.snap__c:nth-child(-n+2) { border-top: 0; }
.snap__c:nth-child(even) { border-left: 1px solid var(--line); }
/* five cards: the last one fills the row in both the two- and three-column grids */
.snap__c:nth-child(5):last-child { grid-column: span 2; }
.snap dt { font-size: 12px; color: var(--ink-3); }
.snap dd { margin: 3px 0 0; }
.snap dd b { display: block; font: 600 18px/1.25 var(--display); color: var(--ink); overflow-wrap: anywhere; }
.snap dd small { display: block; margin-top: 1px; font-size: 12px; color: var(--ink-3); }
/* the fit card in the right half: three tiles a row, the rule check below them */
.ftop .fit__tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ftop .fit__check { grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 861px) { .ftop .fit__t:nth-child(5) { grid-column: span 2; } .ftop .fit__t:nth-child(4) { border-left: 0; } .ftop .fit__t:nth-child(n+4) { border-top: 1px solid var(--line); } }
/* phones: two tiles a row (the borders in views.css assume two), pitch across the bottom */
@media (max-width: 860px) { .ftop .fit__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .ftop { grid-template-columns: 1fr; } .snap { grid-template-columns: repeat(3, minmax(0, 1fr)); } .snap__c:nth-child(-n+3) { border-top: 0; } .snap__c:nth-child(even) { border-left: 0; } .snap__c:not(:nth-child(3n+1)) { border-left: 1px solid var(--line); } }
@media (max-width: 560px) { .snapcard { padding: 14px; } .snap { grid-template-columns: repeat(2, minmax(0, 1fr)); } .snap__c:nth-child(3) { border-top: 1px solid var(--line); } .snap__c:not(:nth-child(3n+1)) { border-left: 0; } .snap__c:nth-child(even) { border-left: 1px solid var(--line); } .snap dd b { font-size: 16px; } }

/* ---------- fund page: who else backed a deal (sign-in gated) ---------- */
.bklink { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12.5px; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 2px; min-height: 24px; text-align: left; }
.bklink:hover { color: var(--ink); text-decoration-color: var(--ink-3); }
.bklink__n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--sel); border: 1px solid var(--sel-line); font-size: 11.5px; font-weight: 600; color: var(--ink); text-decoration: none; }
.bk { margin-top: 12px; }
.bk li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.bk li:first-child { border-top: 0; }
.bk li > a:first-child { border-top: 0; }
.bk__src { font-size: 12.5px; white-space: nowrap; }
.bk small { white-space: normal; }
.sgn__c { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-size: 13px; line-height: 1.45; color: var(--ink-2); cursor: pointer; }
.sgn__c input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--red); }
.sgn__code { font-family: 'Roboto Mono', ui-monospace, monospace; font-size: 20px; letter-spacing: 6px; max-width: 12ch; }
.bkacct { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }

/* ---------- header: sign in / account ---------- */
.acct-link { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500; }
.acct-link:hover, .acct-link[aria-current] { color: var(--ink); background: var(--sel); }
@media (max-width: 720px) { .acct-link span { display: none; } .acct-link { padding: 0 8px; } }

/* ---------- /account ---------- */
.acct { max-width: 520px; }
.acct h2 { font-size: 16px; margin-bottom: 8px; }
.acct__funds { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.acct__row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }

/* ---------- header fund search (nav-search.js) ---------- */
.nsb { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2); font-size: 13.5px; font-weight: 500; }
.nsb:hover, .nsb[aria-expanded="true"] { color: var(--ink); border-color: var(--ink-3); }
.nsb[aria-expanded="true"] { background: var(--sunk); }
.nsearch { border-top: 1px solid var(--line); background: var(--card); box-shadow: 0 12px 24px -18px rgba(13, 17, 23, .35); }
.nsearch[hidden] { display: none; }
.nsearch__in { position: relative; max-width: 640px; margin: 0 auto; padding: 10px var(--gut) 12px; }
.nsearch .input { min-height: 44px; font-size: 16px; }
.nsearch__list { list-style: none; margin: 8px 0 0; padding: 0; max-height: min(420px, 60vh); overflow-y: auto; overscroll-behavior: contain; }
.nsearch__list[hidden] { display: none; }
.nsearch__list li { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.nsearch__list li[aria-selected="true"], .nsearch__list li[data-i]:hover { background: var(--sel); }
.nsearch__logo { width: 28px; height: 28px; border-radius: 7px; font-size: 10.5px; }
.nsearch__n { flex: 1; min-width: 0; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nsearch__n em { font-style: normal; font-size: 12px; color: var(--ink-3); margin-left: 4px; }
.nsearch__c { flex: none; font-size: 13px; color: var(--ink-3); }
.nsearch__none { padding: 10px 8px; font-size: 14px; color: var(--ink-3); cursor: default; }
@media (max-width: 720px) {
  .nsb { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .nsb__t { display: none; }
}
/* Phones: the header buttons keep a full 44px touch size (no squeezing). The
   watchlist pill gives way to the search button: the bottom tab bar already
   carries Watchlist with its count. */
@media (max-width: 720px) {
  .bar__end > * { flex: none; }
  .bar__end .wl-pill { display: none; }
}
