/* ============================================================
   MATCHBOX — board activity dashboard + live popup
   Uses your existing custom properties throughout: --v --c --lime
   --good --bad --warn --panel --panel2 --line --line2 --txt --mut
   --dim --r --r2 --grad --shadow. Nothing new in the palette.
   ============================================================ */

/* ── panel ───────────────────────────────────────────────── */
.mb-panel {
  margin-top: 28px;
  padding: 0;                 /* head and body set their own */
  overflow: hidden;
}

.mb-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .022);
  align-items: center;
}
.mb-role {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.mb-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mb-live { display: inline-flex; align-items: center; gap: 6px; }
.mb-live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--lime);
  flex: 0 0 auto;
  animation: mb-pulse 2.4s ease-out infinite;
}
@keyframes mb-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(200, 249, 78, .45); }
  70%  { box-shadow: 0 0 0 7px rgba(200, 249, 78, 0); }
  100% { box-shadow: 0 0 0 0 rgba(200, 249, 78, 0); }
}

/* ── the four numbers ────────────────────────────────────── */
.mb-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 18px 22px 0;
}

.mb-stat-k {
  display: block;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
  margin-bottom: 4px;
}

.mb-stat-v {
  display: block;
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -.03em;
  line-height: 1.05;
  color: var(--txt);
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
}
/* in and out get the two ends of your gradient, so the pairing in the
   chart below reads as the same pairing up here */
.mb-stat-v.mb-in   { color: #67e8f9; }
.mb-stat-v.mb-out  { color: var(--mut); }
.mb-stat-v.mb-good { color: #6ee7b7; }

.mb-stat-v.mb-bump { animation: mb-bump .5s cubic-bezier(.2,.8,.2,1); }
@keyframes mb-bump {
  0%   { transform: translateY(0);    }
  35%  { transform: translateY(-3px); }
  100% { transform: translateY(0);    }
}

/* ── two columns ─────────────────────────────────────────── */
.mb-split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 12px;
  padding: 18px 22px 22px;
  align-items: stretch;
}

.mb-flow-card,
.mb-feed-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, .022);
}
.mb-feed-card { position: relative; overflow: hidden; }

.mb-card-head {
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  margin-bottom: 12px;
}

/* ── eight days of in and out ────────────────────────────── */
.mb-legend { display: inline-flex; align-items: center; gap: 12px; }
.mb-key { display: inline-flex; align-items: center; gap: 5px; color: var(--dim); }
.mb-key::before {
  content: "";
  width: 9px; height: 9px;
  border-radius: 3px;
  flex: 0 0 auto;
}
.mb-key.in::before  { background: var(--grad); }
.mb-key.out::before { background: rgba(255, 255, 255, .22); }

.mb-flow {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
  height: 108px;
  align-items: end;
}

.mb-day {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 7px;
  height: 100%;
  align-items: end;
  justify-items: center;
}

.mb-cols {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 100%;
  width: 100%;
}

.mb-col {
  display: block;
  width: 46%;
  max-width: 13px;
  height: var(--h, 0%);
  border-radius: 3px 3px 1px 1px;
  /* grows up when the panel is seen */
  transform: scaleY(0);
  transform-origin: bottom center;
  transition: transform .8s cubic-bezier(.2,.8,.2,1);
}
.mb-col.in  { background: var(--grad); }
.mb-col.out { background: rgba(255, 255, 255, .22); }

.mb-panel.mb-seen .mb-col { transform: scaleY(1); }

/* left to right, so the week reads as a week */
.mb-panel.mb-seen .mb-day:nth-child(1) .mb-col { transition-delay: .04s; }
.mb-panel.mb-seen .mb-day:nth-child(2) .mb-col { transition-delay: .09s; }
.mb-panel.mb-seen .mb-day:nth-child(3) .mb-col { transition-delay: .14s; }
.mb-panel.mb-seen .mb-day:nth-child(4) .mb-col { transition-delay: .19s; }
.mb-panel.mb-seen .mb-day:nth-child(5) .mb-col { transition-delay: .24s; }
.mb-panel.mb-seen .mb-day:nth-child(6) .mb-col { transition-delay: .29s; }
.mb-panel.mb-seen .mb-day:nth-child(7) .mb-col { transition-delay: .34s; }
.mb-panel.mb-seen .mb-day:nth-child(8) .mb-col { transition-delay: .39s; }

.mb-day-k { letter-spacing: .06em; }
.mb-day.now .mb-day-k {
  color: var(--lime);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: .1em;
}

.mb-flow-foot {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 10px;
}
.mb-flow-foot b { color: #6ee7b7; font-variant-numeric: tabular-nums; }

/* ── where they came from ────────────────────────────────── */
.mb-src {
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}
.mb-src .mb-card-head { margin-bottom: 10px; }

.mb-src-row {
  /* "Employer posted" is the longest label — give it room rather than
     letting it ellipsis, since it's the one that matters most */
  display: grid;
  grid-template-columns: minmax(0, 118px) minmax(0, 1fr) 26px;
  align-items: center;
  gap: 10px;
  padding: 3px 0;
}
.mb-src-row > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mb-src-n {
  text-align: right;
  font-weight: 700;
  color: var(--txt);
  font-variant-numeric: tabular-nums;
}

.mb-bar {
  display: block;
  height: 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .06);
  overflow: hidden;
}
.mb-bar-fill {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  border-radius: 99px;
  background: rgba(255, 255, 255, .16);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .9s cubic-bezier(.2,.8,.2,1);
}
.mb-bar-fill.hi   { background: var(--grad); }
.mb-bar-fill.lime { background: var(--lime); }

.mb-panel.mb-seen .mb-bar-fill { transform: scaleX(1); }
.mb-panel.mb-seen .mb-src-row:nth-child(2) .mb-bar-fill { transition-delay: .42s; }
.mb-panel.mb-seen .mb-src-row:nth-child(3) .mb-bar-fill { transition-delay: .47s; }
.mb-panel.mb-seen .mb-src-row:nth-child(4) .mb-bar-fill { transition-delay: .52s; }
.mb-panel.mb-seen .mb-src-row:nth-child(5) .mb-bar-fill { transition-delay: .57s; }
.mb-panel.mb-seen .mb-src-row:nth-child(6) .mb-bar-fill { transition-delay: .62s; }

.mb-note { margin: 12px 0 0; line-height: 1.55; }

/* ── the feed ────────────────────────────────────────────── */
.mb-feed {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 372px;
}

.mb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(255, 255, 255, .03);
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.mb-row:hover {
  border-color: var(--line2);
  background: rgba(255, 255, 255, .055);
}
.mb-row:focus-visible {
  outline: 2px solid var(--c);
  outline-offset: 2px;
}

/* the glyph tile — one per kind of event */
.mb-tile {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 15px;
  line-height: 1;
  border: 1px solid var(--line2);
  background: rgba(255, 255, 255, .05);
  color: var(--mut);
}
.mb-tile.k-in       { border-color: rgba(34,211,238,.45);  background: rgba(34,211,238,.13);  color: #67e8f9; }
.mb-tile.k-out      { border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.05); color: var(--mut); }
.mb-tile.k-applied  { border-color: rgba(124,92,255,.45);  background: rgba(124,92,255,.16);  color: #c4b5fd; }
.mb-tile.k-booked   { border-color: rgba(52,211,153,.45);  background: rgba(52,211,153,.14);  color: #6ee7b7; }
.mb-tile.k-alert    { border-color: rgba(200,249,78,.4);   background: rgba(200,249,78,.13);  color: var(--lime); }
.mb-tile.k-employer { border-color: rgba(251,191,36,.4);   background: rgba(251,191,36,.13);  color: #fcd34d; }
.mb-tile.k-system   { border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.04); color: var(--dim); }
.mb-tile.lg {
  width: 46px; height: 46px;
  border-radius: 13px;
  font-size: 19px;
}

.mb-row-mid { min-width: 0; flex: 1 1 auto; }
.mb-row-mid b {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mb-row-sub {
  font-size: 12px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mb-row .pill { flex: 0 0 auto; min-width: 112px; justify-content: center; }

.mb-row.mb-new { animation: mb-arrive .55s cubic-bezier(.2,.8,.2,1); }
@keyframes mb-arrive {
  from { opacity: 0; transform: translateY(-9px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

/* ── the drill-in ────────────────────────────────────────── */
.mb-detail {
  position: absolute;
  inset: 0;
  padding: 18px;
  background: var(--panel);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  transform: translateX(101%);
  opacity: 0;
  pointer-events: none;
  transition: transform .34s cubic-bezier(.2,.8,.2,1), opacity .22s;
}
.mb-detail.open { transform: none; opacity: 1; pointer-events: auto; }

.mb-back {
  align-self: start;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--c);
  cursor: pointer;
}
.mb-back:hover { color: var(--txt); }

.mb-detail-head {
  display: flex;
  align-items: center;
  gap: 13px;
}
.mb-detail-who { min-width: 0; flex: 1 1 auto; }
.mb-detail-who b { font-size: 15px; font-weight: 700; line-height: 1.25; }

/* ── key/value rows, whatever the event is ───────────────── */
.mb-kv {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px 16px;
  margin: 0;
  font-size: 12.5px;
  align-items: baseline;
}
.mb-kv dt {
  color: var(--dim);
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  font-weight: 700;
  white-space: nowrap;
}
.mb-kv dd {
  margin: 0;
  color: var(--txt);
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}

/* ── the scoring block, applications only ────────────────── */
.mb-score-block {
  padding-top: 13px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}
.mb-score-head { align-items: center; flex-wrap: nowrap; gap: 10px; }
.mb-break-head {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
}

.mb-score {
  flex: 0 0 auto;
  min-width: 42px;
  padding: 5px 10px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  border: 1px solid rgba(52,211,153,.45);
  background: rgba(52,211,153,.14);
  color: #6ee7b7;
}

.mb-skills { line-height: 1.9; }

.mb-detail-foot {
  margin-top: auto;
  padding-top: 4px;
  display: grid;
  gap: 11px;
}
.mb-detail-actions { display: flex; gap: 8px; }
.mb-detail-actions .btn { font-size: 13px; padding: 8px 16px; }

/* ── blurred surnames ────────────────────────────────────── */
/* The people in this feed stand in for real people looking for real
   work. Blurring the surname is the promise the product makes, shown
   rather than claimed — and it keeps the feed reading like people
   rather than reference numbers. */
.mb-redact {
  filter: blur(4.2px);
  -webkit-filter: blur(4.2px);
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
  display: inline-block;
  padding: 0 3px;
  vertical-align: baseline;
}
.mb-detail-who .mb-redact { filter: blur(5px); -webkit-filter: blur(5px); }
@supports (-webkit-touch-callout: none) {
  .mb-redact { filter: blur(5px); -webkit-filter: blur(5px); }
}

.mb-redact-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px 5px 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 12px;
  color: var(--mut);
}
.mb-redact-note::before {
  content: "";
  width: 22px; height: 8px;
  border-radius: 3px;
  background: var(--dim);
  filter: blur(3px);
  flex: 0 0 auto;
}

.mb-foot {
  margin-top: 14px;
  align-items: center;
  gap: 14px;
}

.mb-sr {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.mb-seed { display: none !important; }


/* ============================================================
   Bottom-left popup
   ============================================================ */
.mb-popup {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 60;
  max-width: min(350px, calc(100vw - 40px));
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 42px 13px 13px;
  border: 1px solid var(--line2);
  border-radius: var(--r);
  background: var(--panel2);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(14px) scale(.97);
  pointer-events: none;
  transition: opacity .4s ease, transform .45s cubic-bezier(.2,.8,.2,1);
}
.mb-popup.show { opacity: 1; transform: none; pointer-events: auto; }

.mb-popup-text { min-width: 0; display: grid; gap: 2px; }
.mb-popup-text b {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--txt);
  line-height: 1.3;
}
.mb-popup-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* the honesty tag — delete this block if you drop the tag */
.mb-popup-tag {
  position: absolute;
  top: 11px; right: 36px;
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 750;
  color: var(--lime);
  border: 1px solid rgba(200, 249, 78, .4);
  background: rgba(200, 249, 78, .12);
  border-radius: 99px;
  padding: 2px 7px;
}

.mb-popup-close {
  position: absolute;
  top: 8px; right: 8px;
  width: 22px; height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--dim);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: color .2s, background .2s;
}
.mb-popup-close:hover { color: var(--txt); background: rgba(255, 255, 255, .07); }


/* ============================================================
   Narrower screens
   ============================================================ */
@media (max-width: 980px) {
  .mb-stats { grid-template-columns: repeat(2, 1fr); }
  .mb-split { grid-template-columns: 1fr; }
  .mb-feed  { min-height: 0; }
  .mb-detail { position: static; transform: none; opacity: 1; pointer-events: auto;
               display: none; margin-top: 10px; }
  .mb-detail.open { display: flex; }
}

@media (max-width: 620px) {
  .mb-head, .mb-stats, .mb-split { padding-left: 16px; padding-right: 16px; }
  .mb-stat-v { font-size: 25px; }
  .mb-row .pill { min-width: 0; }
  .mb-popup { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .mb-kv { grid-template-columns: 1fr; gap: 2px 0; }
  .mb-kv dd { margin-bottom: 6px; }
}

@media (max-width: 460px) {
  .mb-head-right .mb-live { display: none; }
  .mb-row .pill { display: none; }
}


/* ============================================================
   Somebody who asked for less movement
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .mb-live-dot { animation: none; }
  .mb-col,
  .mb-bar-fill { transition: none; }
  .mb-col      { transform: scaleY(1); }
  .mb-bar-fill { transform: scaleX(1); }
  .mb-panel.mb-seen .mb-col,
  .mb-panel.mb-seen .mb-bar-fill { transition-delay: 0s; }
  .mb-row.mb-new { animation: none; }
  .mb-stat-v.mb-bump { animation: none; }
  .mb-detail { transition: opacity .01s; }
  .mb-popup  { transition: opacity .01s; }
}
