/* Messages, opportunities and business tokens. */
.market-inbox { display: grid; gap: 16px; margin-top: 16px; align-items: start; }
.market-threads { display: grid; gap: 6px; }
.market-threads::-webkit-scrollbar { display: none; }
.market-threads button { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; justify-items: start; gap: 2px; min-height: 0; text-align: left; line-height: 1.4; padding: 10px 14px; white-space: normal; border-color: var(--line); font-weight: 400; }
.market-threads small { font-size: 12px; color: var(--ink-3); }
.market-threads button[aria-current="true"] { border-color: var(--line-2); box-shadow: var(--shadow-1); }
.market-threads b { font-weight: 600; font-size: 15px; }
.market-threads span { font-size: 13px; color: var(--ink-2); }
.market-thread { min-width: 0; padding: 20px; background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.market-thread h2 { margin: 0 0 8px; font-size: 18px; text-wrap: balance; }
.market-thread-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 14px; }
.market-messages { display: grid; gap: 12px; margin: 20px 0; }
.market-message { max-width: 90%; justify-self: start; overflow-wrap: anywhere; animation: rise var(--t-med) var(--ease) both; }
.market-message small { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.market-message p { margin: 0; padding: 10px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); border-top-left-radius: 6px; line-height: 1.5; }
.market-message.mine { justify-self: end; }
.market-message.mine small { text-align: right; }
.market-message.mine p { background: var(--ink); border-color: transparent; color: #fff; border-radius: var(--r-lg); border-top-right-radius: 6px; }
.market-compose { display: grid; gap: 10px; }
.market-thread .mvp-actions button { flex: 1 1 auto; }
.market-refresh { margin-top: 12px; justify-self: start; }
.market-jobs { display: grid; gap: 12px; }
.market-jobs .assets-panel { display: grid; gap: 4px; }
.market-jobs h2 { margin: 6px 0 10px; }
.market-jobs h3 { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 12px 0 2px; }
.market-jobs p { margin: 0; overflow-wrap: anywhere; }
.market-jobs .assets-subtext { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }

/* tokens */
.tk-balance { display: grid; gap: 16px; }
.tk-number { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin: 6px 0 0; }
.tk-number strong { font-size: 56px; font-weight: 500; letter-spacing: -.04em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.tk-number span { font-size: 17px; color: var(--ink-2); }
.tk-facts { display: grid; gap: 6px; margin: 0; font-size: 15px; }
.tk-facts div { display: flex; justify-content: space-between; gap: 20px; padding: 6px 0; border-top: 1px solid var(--line); }
.tk-facts div:first-child { border-top: 0; padding-top: 0; }
.tk-facts dt { color: var(--ink-2); }
.tk-facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.tk-rules { list-style: none; counter-reset: rule; padding: 0; margin: 16px 0 24px; display: grid; gap: 8px; }
.tk-rules li { counter-increment: rule; display: grid; grid-template-columns: 32px minmax(0, 1fr); align-content: start; gap: 2px 8px; padding: 14px 16px; background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--r); font-size: 15px; color: var(--ink-2); line-height: 1.5; }
.tk-rules li::before { content: '0' counter(rule); grid-row: span 2; font: 12px var(--font-mono); color: var(--red); padding-top: 4px; }
.tk-rules b { color: var(--ink); font-weight: 600; font-size: 15px; }
.tk-section-title { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 28px 0 10px; }
.tk-packs { display: grid; gap: 12px; }
.tk-card.tk-pack { display: grid; gap: 4px; }
.tk-pack strong { font-size: 36px; font-weight: 500; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.tk-pack span { color: var(--ink-2); font-size: 14px; }
.tk-pack b { font-size: 18px; font-weight: 600; margin: 10px 0 8px; font-variant-numeric: tabular-nums; }
.tk-note { margin: 14px 0 0; font-size: 14px; color: var(--ink-2); }
.tk-terms { margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.tk-terms summary { cursor: pointer; color: var(--ink); font-weight: 600; }
.tk-terms p { margin: 8px 0 0; }
.tk-ledger { display: grid; padding: 4px 20px; background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--r-lg); }
.tk-entry { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 4px 12px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; }
.tk-entry:first-child { border-top: 0; }
.tk-entry b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tk-entry b[data-sign="+"] { color: var(--ok); }
.tk-entry time { grid-column: 2; font-size: 13px; color: var(--ink-3); }
@media (min-width: 900px) {
  .market-compose button { justify-self: end; min-width: 160px; }
  .market-message { max-width: 80%; }
  .tk-balance { grid-template-columns: minmax(0, 1fr) 280px; align-items: center; }
  .tk-number strong { font-size: 72px; }
  .tk-packs { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
  .tk-entry { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .tk-entry time { grid-column: auto; white-space: nowrap; }
}

/* The hero's consent: ticks, a live preview of the card this company will see, a greeting. */
.market-consent { display: grid; gap: 14px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.market-consent h3, .market-outcome h3 { margin: 0; font-size: 16px; font-weight: 600; }
.market-consent > p { margin: 0; }
/* Decline next to Approve at the end of the page, and the confirmation of what goes to the company, in the page. */
.market-consent-actions { margin: 0; }
.market-consent-confirm { display: grid; gap: 12px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--bg-raised); }
.market-consent-confirm h4 { margin: 0; font-size: 16px; }
.market-consent-points { display: grid; gap: 6px; margin: 0; padding-left: 20px; line-height: 1.5; }
.market-consent-confirm .mvp-actions { margin: 0; }
.market-choices { display: grid; gap: 12px; }
.market-choice-group { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); }
.market-choice-group legend { padding: 0 4px; color: var(--ink-2); font-size: 13px; }
.market-choice { display: flex; align-items: baseline; gap: 6px; padding: 4px 0; font-size: 15px; }
.market-preview { padding: 12px 14px; background: var(--bg); border-radius: var(--r); font-size: 14px; }
.market-preview h4 { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.market-preview p { margin: 4px 0; }
.market-card { margin: 12px 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r); font-size: 14px; }
.market-card summary { cursor: pointer; font-weight: 600; }
.market-outcome { display: grid; gap: 8px; margin: 12px 0; padding: 12px 14px; background: var(--bg); border-radius: var(--r); }
.market-outcome p { margin: 0; }
/* The outcome choices wrap inside the box; the phone-wide scrolling strip of the chat does not belong here. */
.market-outcome .chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; mask-image: none; -webkit-mask-image: none; }
.market-outcome button[aria-pressed="true"] { border-color: var(--ok); background: var(--ok-tint); color: var(--ok); font-weight: 600; }
.market-complaint { display: grid; gap: 8px; margin: 12px 0; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg-raised); }
.market-complaint h3 { margin: 0; font-size: 16px; font-weight: 600; }
.market-complaint p, .market-complaint ol { margin: 0; }
.market-complaint .mvp-actions { align-items: center; }
.market-choice-text { display: grid; gap: 2px; }
.market-hint { font-size: 12px; color: var(--ink-3); }
.market-hint.is-direct, .market-hint.is-transferable, .market-hint.is-positive { color: var(--ok); }
.market-hint.is-overqualified { color: var(--warn); }

/* Market fixes (13 Oct): the unread badge on «Сообщения», the new-mark on an inbox line, the in-page dialog, the full
   card inside a conversation. Visual polish is left to the layout pass. */
.journey-nav #inbox-count:empty { display: none; }
.journey-nav button.has-unread #inbox-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 600; top: 0; }
@media (max-width: 899px) {
  .journey-nav button.has-unread { position: relative; }
  .journey-nav button.has-unread #inbox-count { position: absolute; top: 2px; left: calc(50% + 6px); }
}
.market-threads button { position: relative; }
.market-threads button.is-unread b { font-weight: 700; }
.market-unread { position: absolute; top: 14px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.mvp-heading.market-heading { display: grid; }
.market-dialog { width: min(440px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-raised); color: var(--ink); box-shadow: var(--shadow-2); }
.market-dialog::backdrop { background: rgba(20, 23, 26, .32); }
.market-dialog h2 { margin: 0 0 8px; font-size: 18px; }
.market-dialog p { margin: 0 0 16px; line-height: 1.5; }
.market-dialog .mvp-actions { justify-content: flex-end; }
.market-card .market-card-rows { margin-top: 12px; }
.market-card .market-dimensions { margin-top: 14px; }
.market-thread[aria-busy="true"] .skeleton { margin-top: 12px; }
.market-card .chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

/* Fix round 2 (14 Oct): one look for what is fine on the card, rows of the criteria match without a verdict, the open
   conversation and the new-mark in the inbox, outcome choices that keep their outline when locked, suggestion labels. */
.chip.is-ok { background: var(--ok-tint); border-color: transparent; color: var(--ok); }
.market-dimensions .ba-match-dimension[data-status="info"]::before { background: var(--line-2); }
.market-dimensions .ba-match-dimension[data-status="missing"]::before { background: transparent; border: 1.5px dashed var(--ink-3); }
.market-threads button[aria-current="true"] { border-color: var(--line-2); background: var(--bg-raised); box-shadow: inset 3px 0 0 var(--ink-2), var(--shadow-1); }
.market-threads button.is-unread { padding-right: 28px; }
.market-unread { z-index: 1; }
.market-thread-intro { margin: 8px 0 0; color: var(--ink-2); }
/* The deadline in words under the stage chips: hours left and what silence means. */
.market-deadline { margin: 8px 0 0; padding: 10px 14px; border-left: 3px solid var(--warn); border-radius: var(--r); background: var(--bg-2); font-size: 14px; line-height: 1.45; }
.market-outcome .chips button:disabled { border-color: var(--line-2); background: transparent; opacity: .6; }
.market-outcome .chips button[aria-pressed="true"]:disabled { border-color: var(--ok); background: var(--ok-tint); color: var(--ok); }
.market-hint { display: grid; gap: 1px; }
.market-hint b { font-weight: 600; }
.market-hint-reason { color: var(--ink-2); }
/* The pay range a company chose to show candidates. */
.market-pay { margin: 0; font-weight: 600; }

/* Round 3 (MARKET): the rule under «Entire blocks» sits close to its legend. */
.market-choice-note { margin: 0 0 6px; font-size: 13px; }

/* Round 4 (MARKET): the stage chip in the tone connection-state.js gives it (the radar uses the same); an entry of the card
   with its description; the job opening inside a request. */
.chip.market-stage.is-turn { border-color: var(--ink-3); color: var(--ink); font-weight: 600; }
.chip.market-stage.is-open { background: var(--ok-tint); border-color: transparent; color: var(--ok); }
.chip.market-stage.is-closed { color: var(--ink-3); }
.chip.market-stage.is-alert { border-color: var(--warn); color: var(--warn); background: var(--warn-tint); }
.market-entry { flex: 1 1 100%; min-width: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-raised); }
.market-entry.is-potential { border-style: dashed; }
.market-entry strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
.market-entry p { margin: 4px 0 0; color: var(--ink-2); line-height: 1.5; }
.market-preview .ba-cand-rows { margin-top: 8px; }
.market-job-opening { margin: 12px 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r); font-size: 14px; }
.market-job-opening summary { cursor: pointer; font-weight: 600; }
.market-job-opening .market-job { margin-top: 10px; padding: 0; border: 0; box-shadow: none; background: transparent; display: grid; gap: 4px; }
.market-job h3 { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 12px 0 2px; }
.market-job p { margin: 0; overflow-wrap: anywhere; }

/* ---------- content-width pass, 15 October ---------- */
/* Like the business pages (business-assets.css): the thread list stands beside the thread, the consent choices go to two
   columns and the token rules to three only when the content itself has the room, not whenever the screen passes 900px
   next to the sidebar (chat bubbles of 200px, consent chips broken letter by letter, rule cards of 140px). */
@container surface (min-width: 900px) {
  .market-inbox { grid-template-columns: 240px minmax(0, 1fr); gap: 32px; }
  .market-threads { position: sticky; top: 0; }
  .market-threads button { max-width: none; border-color: transparent; background: transparent; }
  .market-threads button[aria-current="true"] { background: var(--bg-raised); }
  .tk-rules { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
}
.market-thread { container: thread / inline-size; }
@container thread (min-width: 440px) { .market-thread .mvp-actions button { flex: 0 1 auto; } }
/* A one-item group keeps its own height instead of stretching to its neighbour's. */
.market-choices { align-items: start; }
.market-consent { container: consent / inline-size; }
@container consent (min-width: 560px) { .market-choices { grid-template-columns: 1fr 1fr; } }
/* An invite row is not a ledger line: the code and its state on the left, «Copy» on the right. The ledger's 36px first
   column squeezed the code into three lines over the date. */
.tk-entry.tk-invite { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.tk-invite b { white-space: nowrap; }
.tk-invite span { grid-column: 1; }
.tk-invite button { grid-column: 2; grid-row: 1 / span 2; }
