/* Contract Room X — preview-exact layer (2026-10-14, PR1 fix).
   Tokens and component shapes copied from the contract-experience
   redesign drafts. ALL rules scoped under .crx / .crx-* / .crx-view so
   nothing leaks to other OS pages. Coins keep their own shipped look. */
.crx, .crx-modal, .crx-drawer, .crx-board, .crx-toast, .crx-view, .crx-overlay, .crx-kwpop {
  --bg: #eef2f3; --panel: #fff; --soft: #f5f7f7; --ink: #102428; --muted: #5f7175;
  --line: #d8e0e1; --navy: #123f4c; --teal: #0a806f; --mint: #d9f2ea;
  --amber: #c76a1d; --amber-soft: #fff0d8; --red: #ad3f3f;
  --shadow: 0 18px 55px rgba(25,52,58,.12);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
}
/* opportunities view page background (scoped to the .fx root) */
.crx-view { background: var(--bg); }
.crx-view .fx-panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 24px; box-shadow: var(--shadow); overflow: hidden;
}
.crx-view .fx-list, .crx-view section.fx-list { background: transparent; }

/* ---------- shared preview primitives ---------- */
.crx-badge {
  display: inline-flex; align-items: center; gap: 5px; background: var(--soft);
  padding: 6px 9px; border-radius: 7px; font-size: 11px; font-weight: 700; color: var(--ink);
}
.crx-badge.due { background: var(--amber-soft); color: var(--amber); }
.crx-score {
  border: 0; background: var(--mint); color: var(--teal); font-weight: 800;
  padding: 5px 7px; border-radius: 7px; cursor: pointer; font-size: 13px;
  font-family: "DM Sans", system-ui, sans-serif;
}
.crx-btn {
  border: 1px solid var(--line); color: var(--ink); background: var(--panel);
  border-radius: 10px; padding: 10px 13px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: "DM Sans", system-ui, sans-serif; font-size: 14px; text-decoration: none;
}
.crx-btn.primary { background: var(--teal); color: #fff; border-color: var(--teal); }
.crx-btn.dark { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.crx-btn.ghost { border-color: transparent; background: transparent; }
.crx-btn.small, .crx-btn.sm { padding: 7px 9px; font-size: 12px; }
.crx-btn.block { width: 100%; margin-top: 14px; }
.crx-btn.on { background: var(--mint); border-color: transparent; color: var(--teal); }
.crx-btn:disabled { opacity: .55; cursor: default; }
.crx-chip {
  border: 1px solid var(--line); background: var(--panel); border-radius: 99px;
  padding: 6px 9px; font-size: 12px; color: var(--ink); cursor: pointer;
  font-family: "DM Sans", system-ui, sans-serif;
}
.crx-chip.on { background: var(--mint); color: var(--teal); border-color: transparent; font-weight: 700; }

/* ---------- appbar / room bar ---------- */
.crx-roombar {
  min-height: 64px; border-bottom: 1px solid var(--line); display: flex;
  align-items: center; gap: 12px; padding: 10px 16px; background: var(--panel);
}
.crx-live {
  display: inline-flex; align-items: center; gap: 6px; color: var(--red);
  font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap;
}
.crx-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.crx-crumb { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crx-roombar .spacer { flex: 1; }
.crx-avatarbtn {
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--navy);
  color: var(--panel); font-weight: 800; cursor: pointer; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.crx-avatarbtn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* minimize bar (contract-room #cr-minibar) restyled to the preview appbar */
#cr-minibar {
  background: var(--panel) !important; border: 1px solid var(--line) !important;
  border-radius: 14px !important; box-shadow: var(--shadow) !important; color: var(--ink) !important;
  font-family: "DM Sans", system-ui, sans-serif;
}
#cr-minibar .fx-minibar-pct { background: var(--mint); color: var(--teal); font-weight: 800; border-radius: 7px; padding: 3px 7px; }

/* ---------- rail (opportunities list) ---------- */
.crx-view .fx-search { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; }
.crx-view .fx-cap { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink); }
.crx-matchsort { margin-left: auto; }
.crx-view .fx-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 13px;
  padding: 12px; margin-bottom: 9px; position: relative;
}
.crx-view .fx-card.sel { border-color: var(--teal); box-shadow: inset 3px 0 var(--teal); }
.crx-view .fx-card .fx-card-top, .crx-view .fx-card .fx-card-org, .crx-view .fx-card .fx-card-foot { display: none; }
.crx-cardx-topline { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; margin-bottom: 6px; gap: 8px; }
.crx-cardx-topline .crx-score { margin-left: auto; }
.crx-view .fx-card-title { display: block; font-size: 14px; line-height: 1.28; font-weight: 600; margin: 0 0 6px; color: var(--ink); }
.crx-cardx-meta { font-size: 12px; color: var(--muted); }
.crx-cardx-meta .who { display: block; margin-top: 2px; }
/* state chips from the multi-state picker, preview-shaped */
.crx-view .fx-wchips .fx-chip {
  border: 1px solid transparent; background: var(--mint); color: var(--teal);
  border-radius: 99px; padding: 6px 9px; font-size: 12px; font-weight: 700;
}
.crx-view .fx-wherebtn, .crx-view .fx-filterbtn {
  border: 1px solid var(--line); background: var(--panel); border-radius: 99px;
  padding: 6px 9px; font-size: 12px; color: var(--ink); cursor: pointer; font-weight: 600;
}

/* ---------- panel header (brief head) ---------- */
.crx .fx-p-head { padding: 18px 24px 0; }
.crx-confrow { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; width: 100%; }
.crx-conf {
  border: 0; background: var(--mint); color: var(--teal); border-radius: 11px;
  padding: 9px 12px; display: flex; align-items: baseline; gap: 5px; cursor: pointer; flex: none;
}
.crx-conf-pct { font-size: 22px; line-height: 1; font-weight: 800; }
.crx-conf-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.crx-confcopy { font-size: 12px; color: var(--muted); min-width: 0; }
.crx-confcopy strong { display: block; color: var(--ink); font-size: 13px; }
.crx .fx-pill.match { display: none; } /* JEV pill replaced by the confidence score */
/* badges row = stock pills restyled to preview .badge */
.crx .fx-card-top { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; align-items: center; }
.crx .fx-card-top .fx-pill, .crx .fx-card-top .fx-type {
  display: inline-flex; align-items: center; gap: 5px; background: var(--soft);
  padding: 6px 9px; border-radius: 7px; font-size: 11px; font-weight: 700; color: var(--ink); border: 0;
}
.crx .fx-card-top .fx-pill svg, .crx .fx-card-top .fx-type svg { display: none; }
.crx .fx-card-top .fx-pill.due { background: var(--amber-soft); color: var(--amber); }
.crx .fx-card-top .fx-pill.due.gone { background: #f6e3e3; color: var(--red); }
.crx .fx-p-title {
  font-family: "Newsreader", Georgia, serif; font-size: clamp(28px, 3vw, 42px);
  line-height: 1.03; margin: 0 0 7px; letter-spacing: -.025em; font-weight: 600; color: var(--ink);
}
.crx .fx-p-org { margin: 0; color: var(--muted); font-size: 15px; }
.crx .fx-acts { padding: 0 24px; }
.crx-actsbar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 17px; padding: 0 24px 18px; }
.crx-actsbar .crx-disc-n { font-weight: 800; }

/* ---------- tabs (preview text tabs) ---------- */
.crx .fx-dtabs { display: flex; gap: 25px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--panel); }
.crx .fx-dtab {
  border: 0; border-bottom: 3px solid transparent; background: transparent;
  padding: 14px 1px 12px; font-weight: 700; color: var(--muted); cursor: pointer;
  font-family: "DM Sans", system-ui, sans-serif; font-size: 14px; border-radius: 0;
}
.crx .fx-dtab[aria-selected="true"] { color: var(--teal); border-bottom-color: var(--teal); }
.crx .fx-tabpanel { background: var(--panel); padding: 22px 24px; }

/* ---------- Brief body ---------- */
.crx .fx-tabpanel h3.fx-kicker, .crx .fx-kicker {
  font-size: 12px; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 9px; color: var(--muted); font-weight: 700;
}
.crx-lede { display: flex; gap: 18px; align-items: flex-start; margin: 0 0 6px; }
.crx-lede-p { font-family: "Newsreader", Georgia, serif; font-size: 19px; line-height: 1.4; margin: 0; flex: 1; max-width: 760px; }
.crx-duecard {
  width: 76px; flex: 0 0 auto; background: var(--amber-soft); color: var(--amber);
  border-radius: 12px; padding: 10px; text-align: center;
}
.crx-due-mon { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.crx-due-day { display: block; font-size: 24px; font-weight: 800; line-height: 1.1; }
.crx-due-left { display: block; font-size: 11px; font-weight: 600; }
.crx-samlink { display: inline-block; margin: 8px 0 2px; font-weight: 700; font-size: 14px; color: var(--ink); }
.crx-storyrail { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
/* facts: preview hairline grid */
.crx .fx-facts {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-top: 20px;
}
.crx .fx-facts > div { background: var(--soft); padding: 13px; }
.crx .fx-facts dt { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; text-transform: none; }
.crx .fx-facts dd { font-size: 13px; font-weight: 700; margin: 0; }
/* fit callout */
.crx-fitcall {
  display: flex; align-items: center; gap: 12px; margin-top: 18px;
  background: var(--mint); padding: 13px; border-radius: 12px;
}
.crx-fitcall .crx-check {
  width: 22px; height: 22px; flex: none; color: var(--teal);
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.crx-fitcall-t { font-size: 14px; font-weight: 700; color: var(--ink); display: block; }
.crx-fitcall-p { margin: 0; font-size: 12px; color: var(--teal); }
.crx-fitcall .crx-btn { margin-left: auto; flex: none; }
/* channels */
.crx-channels { margin-top: 16px; display: grid; gap: 0; }
.crx-channel { padding: 14px; background: var(--soft); border-radius: 13px; margin: 8px 0; cursor: pointer; }
.crx-channel-head { display: flex; align-items: center; gap: 8px; }
.crx-channel-head strong { font-size: 14px; }
.crx-channel-head small { margin-left: auto; color: var(--muted); font-size: 12px; }
.crx-channel-b { margin: 7px 0 0; font-size: 14px; }
.crx-channel-m { display: none; }


/* ---------- Files ---------- */
.crx-files { padding: 0; }
.crx-file-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line); border-radius: 13px; padding: 10px 13px; margin-bottom: 8px; background: var(--panel);
}
.crx-file-main { display: flex; flex-direction: column; min-width: 0; }
.crx-file-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; }
.crx-file-sub { font-size: 12px; color: var(--muted); }
.crx-file-open { font-weight: 700; font-size: 13px; color: var(--teal); white-space: nowrap; }
.crx-note { color: var(--muted); font-size: 13px; }

/* ---------- Team / people cards ---------- */
.crx-fchips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.crx-person { background: var(--panel); border: 1px solid var(--line); padding: 12px; border-radius: 12px; margin-bottom: 9px; }
.crx-person-top { display: flex; align-items: center; gap: 9px; }
.crx-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto; background: var(--navy);
  color: var(--panel); font-weight: 800; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center; border: 0;
}
.crx-person-who { flex: 1; min-width: 0; }
.crx-person-who strong { display: block; font-size: 14px; }
.crx-person-who span { display: block; font-size: 11px; color: var(--muted); }
.crx-person-blurb { font-size: 12px; color: var(--muted); margin: 8px 0; }
.crx-person-ask { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.crx-person-ask .crx-btn { padding: 8px 4px; font-size: 11px; }

/* ---------- modals ---------- */
.crx-scrim, .crx-dscrim { position: fixed; inset: 0; background: rgba(4,15,18,.52); z-index: 1200; }
.crx-modal {
  position: fixed; z-index: 1201; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 30px)); max-height: calc(100dvh - 30px); overflow: auto;
  background: var(--panel); border-radius: 18px; padding: 20px; box-shadow: var(--shadow);
}
.crx-modal-top { display: flex; align-items: center; gap: 8px; }
.crx-modal-top h2 { font-family: "Newsreader", Georgia, serif; font-size: 30px; margin: 0; font-weight: 600; }
.crx-modal-x {
  position: absolute; top: 14px; right: 14px; border: 0; background: var(--soft); color: var(--ink);
  border-radius: 50%; width: 36px; height: 36px; font-size: 20px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; z-index: 2;
}
.crx-drawer-head .crx-modal-x { position: static; }
.crx-modal-meta { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.crx-bar-row { margin: 17px 0; }
.crx-bar-top { display: flex; justify-content: space-between; font-size: 13px; }
.crx-bar-top strong { font-weight: 700; }
.crx-bar-top span { color: var(--muted); }
.crx-bar-track { height: 7px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 7px; }
.crx-bar-fill { display: block; height: 100%; background: var(--teal); border-radius: 99px; }
.crx-modal-foot { position: sticky; bottom: -20px; background: var(--panel); padding: 14px 0 0; border-top: 1px solid var(--line); margin-top: 18px; }
.crx-foot-note { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.crx-role-grid { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 18px; }
.crx-role-opt {
  border: 1px solid var(--line); padding: 8px 11px; border-radius: 9px; background: var(--panel);
  color: var(--ink); cursor: pointer; font: 600 14px "DM Sans", system-ui, sans-serif;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
}
.crx-role-opt.on { background: var(--teal); color: #fff; border-color: var(--teal); }
.crx-role-opt .crx-role-s { font-size: 11px; font-weight: 400; opacity: .75; }
.crx-role-opt.on .crx-role-s { color: #fff; }

/* ---------- drawer ---------- */
.crx-dscrim { z-index: 1190; opacity: 0; transition: opacity .2s; }
.crx-dscrim.on { opacity: 1; }
.crx-drawer {
  position: fixed; z-index: 1191; top: 0; right: 0; bottom: 0; width: min(440px, 100%);
  background: var(--panel); padding: 22px; box-shadow: var(--shadow); overflow: auto;
  transform: translateX(102%); transition: transform .22s ease;
}
.crx-drawer.on { transform: none; }
.crx-drawer-head { display: flex; align-items: center; }
.crx-drawer-head .crx-modal-x { position: static; }
.crx-drawer h2.crx-drawer-title { font-family: "Newsreader", Georgia, serif; font-size: 32px; margin: 15px 0 4px; font-weight: 600; }
.crx-drawer-sub { color: var(--muted); margin: 0 0 4px; }
.crx-field { margin-top: 18px; display: block; }
.crx-field-l { display: block; font-size: 12px; font-weight: 700; margin-bottom: 7px; color: var(--ink); text-transform: none; letter-spacing: 0; }
.crx-input {
  width: 100%; box-sizing: border-box; padding: 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--soft); color: var(--ink);
  font: 400 15px "DM Sans", system-ui, sans-serif;
}
.crx-states { display: flex; gap: 7px; flex-wrap: wrap; }
.crx-state {
  border: 1px solid var(--line); padding: 8px 11px; border-radius: 9px; background: var(--panel);
  color: var(--ink); cursor: pointer; font: 500 14px "DM Sans", system-ui, sans-serif;
}
.crx-state.on { background: var(--teal); color: #fff; border-color: var(--teal); }
.crx-drawer-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }

/* ---------- segmented + board ---------- */
.crx-seg { display: inline-flex; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 3px; margin: 10px 0 4px; gap: 3px; }
.crx-seg-b { border: 0; background: transparent; border-radius: 9px; padding: 6px 16px; cursor: pointer; font: 600 13px "DM Sans", system-ui, sans-serif; color: var(--muted); }
.crx-seg-b.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 4px rgba(16,36,40,.12); }
.crx-board { background: var(--panel); }
.crx-board-controls { display: flex; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.crx-board-controls .crx-input { width: auto; flex: 0 1 260px; background: var(--panel); padding: 9px 10px; border-radius: 10px; }
.crx-lanes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 18px; align-items: start; }
.crx-lane { background: var(--soft); border-radius: 15px; padding: 12px; }
.crx-lane-head { display: flex; align-items: center; margin-bottom: 10px; }
.crx-lane-head h2, .crx-lane-h { font-size: 14px; margin: 0; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--ink); }
.crx-lane-head span { margin-left: auto; color: var(--muted); font-size: 12px; }
.crx-card { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 13px; margin-bottom: 10px; }
.crx-card-t { font-size: 14px; margin: 8px 0 5px; font-weight: 600; line-height: 1.3; font-family: "DM Sans", system-ui, sans-serif; }
.crx-card-meta { font-size: 12px; color: var(--muted); }
.crx-card-foot { display: flex; align-items: center; margin-top: 12px; gap: 8px; }
.crx-card-foot .crx-score { margin-left: auto; }
.crx-tinyavatars { display: flex; }
.crx-tinyavatars .crx-avatar { width: 24px; height: 24px; font-size: 8px; margin-right: -6px; border: 2px solid var(--panel); }
.crx-tinyavatars .crx-avatar:last-child { margin-right: 0; }

/* ---------- nav merge ---------- */
.crx-nav-hide { display: none !important; }
.crx-nav-board.on { font-weight: 700; }

/* ---------- toast / dock ---------- */
.crx-toast {
  position: fixed; z-index: 1300; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--ink); color: var(--panel); padding: 11px 16px; border-radius: 10px;
  font: 600 13.5px "DM Sans", system-ui, sans-serif; opacity: 0; pointer-events: none; transition: .2s;
}
.crx-toast.on { opacity: 1; transform: translate(-50%, 0); }
.crx-dock { display: none; }

/* ---------- mobile ---------- */
@media (max-width: 720px) {
  .crx-view .fx-panel { border-radius: 16px; }
  .crx-roombar { padding: 9px 10px; min-height: 0; }
  .crx-roombar .crx-crumb { font-size: 12px; }
  .crx .fx-p-head { padding: 14px 16px 0; }
  .crx .fx-p-title { font-size: 30px; }
  .crx .fx-acts { padding: 0 16px; }
  .crx-actsbar { padding: 0 16px 14px; }
  .crx-actsbar .crx-btn { flex: 1; min-width: 125px; }
  .crx .fx-dtabs { padding: 0 16px; gap: 18px; overflow: hidden; }
  .crx .fx-dtab { font-size: 12px; white-space: nowrap; }
  .crx .fx-tabpanel { padding: 18px 16px 80px; }
  .crx .fx-facts { grid-template-columns: 1fr; }
  .crx .fx-facts > div { display: grid; grid-template-columns: 110px 1fr; align-items: baseline; }
  .crx-lede { flex-direction: column; }
  .crx-duecard { align-self: flex-end; }
  .crx-lanes { display: block; padding: 12px 12px 75px; }
  .crx-lane { margin-bottom: 12px; }
  .crx-board-controls .crx-input { flex: 1 1 100%; }
  .crx-person-ask .crx-btn { font-size: 11px; }
  .crx-drawer { padding: 18px; }
  .crx-modal { border-radius: 16px; padding: 17px; }
  .crx-dock {
    display: flex; position: sticky; bottom: 0; z-index: 5; background: var(--ink);
    padding: 6px 8px; gap: 4px;
  }
  .crx-dock-b {
    flex: 1; color: var(--panel); border: 0; background: transparent; font-size: 11px;
    padding: 9px 4px; font-weight: 700; cursor: pointer; font-family: "DM Sans", system-ui, sans-serif;
  }
  /* x01 (owner direction 2026-10-16): the room's phone dock has 44px tap targets and 13px words. */
  .crx-dock { padding: 6px 8px max(6px, env(safe-area-inset-bottom)); }
  .crx-dock-b { min-height: 44px; font-size: 13px; padding: 10px 6px; border-radius: 8px; }
  .crx-dock-b:focus-visible { outline: 2px solid var(--panel); outline-offset: -3px; }
}

/* gap-close pass: rail column reads as the preview soft rail panel */
.crx-view section.fx-list { background: var(--soft); border: 1px solid var(--line); border-radius: 18px; padding: 12px; }
.crx .fx-want.crx-hide { display: none; }
.crx .fx-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.crx .fx-acts button, .crx .fx-acts .fx-btn, .crx .fx-acts .fx-btn-o {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 10px;
  padding: 7px 9px; font: 700 12px "DM Sans", system-ui, sans-serif; cursor: pointer;
}
.crx .fx-acts a.fx-samlink { font: 700 12px "DM Sans", system-ui, sans-serif; color: var(--teal); }
.crx .fx-hbtn { border: 1px solid var(--line); background: var(--panel); border-radius: 9px; }
/* gap-close pass 2: phone must never overflow horizontally */
@media (max-width: 720px) {
  .crx-view .fx-panel { min-width: 0; max-width: 100%; }
  .crx-view .fx-split > * { min-width: 0; }
  .crx .fx-p-head { flex-wrap: wrap; }
  .crx .fx-dtabs { max-width: 100%; overflow-x: auto; }
  .crx .fx-tabpanel { overflow-x: hidden; }
  .crx-roombar { flex-wrap: wrap; row-gap: 6px; }
  .crx-roombar .crx-crumb { flex: 1 1 40%; }
  .crx-lede { flex-direction: column; }
  .crx-lede-p { max-width: 100%; }
  .crx-confrow { flex-wrap: wrap; }
}

/* ============================================================
   PR2 — 3-tab chat, overlays, mini coins, keyword popovers
   Same preview tokens as the rest of this file (see :root above).
   ============================================================ */


.crx-chat { background: var(--soft); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.crx-chat-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 4px; }
.crx-chat-head strong { font-size: 14px; }
.crx-chat-refresh { margin-left: auto; }
.crx-chat-tabs {
  display: inline-flex; gap: 2px; margin: 8px 14px 0; padding: 3px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 99px;
}
.crx-chat-tab {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font: 700 12px "DM Sans", system-ui, sans-serif; padding: 6px 11px; border-radius: 99px; white-space: nowrap;
}
.crx-chat-tab.on { background: var(--mint); color: var(--teal); }
.crx-chat-body { padding: 6px 14px 10px; }

/* ---------- A24: persistent 3-pane room (wide screens) ----------
   .crx-wide3 is added by contract-room-x.js only at >=1100px (its
   WIDE_ROOM_MQ). The panel becomes a grid: every direct child spans
   both columns except the brief tabpanel (column 1) and the chat
   column (column 2), which share a row and scroll independently.
   Below the breakpoint none of these rules apply and the chat node
   lives in the tabpanel exactly as before. */
.crx-chat-col { display: none; }
@media (min-width: 1100px) {
  .crx-panel.crx-wide3 { overflow: hidden; }
  .crx-panel.crx-wide3 > .crx-room-cols {
    display: flex; flex: 1; min-height: 0; gap: 0;
  }
  .crx-room-cols > .fx-tabpanel {
    flex: 1; min-width: 0; overflow-y: auto; min-height: 0;
  }
  .crx-room-cols > .crx-chat-col {
    flex: 0 0 380px; display: flex; flex-direction: column;
    min-height: 0; overflow-y: auto; border-left: 1px solid var(--line);
    background: var(--soft); padding: 12px;
  }
  .crx-chat-col .crx-chat {
    flex: 1; display: flex; flex-direction: column; min-height: 0;
  }
  .crx-chat-col .crx-chat-body {
    flex: 1; overflow-y: auto; min-height: 0;
  }
}

/* ---------- A20: Gap Radar lines in the room ---------- */
.crx-gap-sugg { display: flex; flex-direction: column; gap: 6px; margin-top: 9px; }
.crx-fill-line {
  display: flex; align-items: center; gap: 8px; text-align: left; width: 100%;
  border: 1px solid var(--line); background: var(--panel); border-radius: 10px;
  padding: 8px 10px; cursor: pointer; font: 600 13px "DM Sans", system-ui, sans-serif; color: var(--ink);
}
.crx-fill-line .fmc-minirow { margin-left: auto; }

/* messages — preview anatomy: 30px avatar grid, head, body, reactions */
.crx-msg { display: grid; grid-template-columns: 30px 1fr; gap: 8px; margin: 12px 0; }
.crx-avatar {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--mint); color: var(--teal); font: 800 10px "DM Sans", system-ui, sans-serif;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; flex: none;
}
.crx-avatar.lg { width: 52px; height: 52px; font-size: 16px; }
.crx-avatar.ai { background: var(--navy); color: #fff; cursor: default; }
.crx-msg-main { min-width: 0; }
.crx-msg-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.crx-msg-name {
  border: 0; background: transparent; padding: 0; cursor: pointer;
  font: 700 12px "DM Sans", system-ui, sans-serif; color: var(--ink);
}
.crx-msg-name.static { cursor: default; font-weight: 700; font-size: 12px; }
.crx-msg-time { color: var(--muted); font-weight: 400; }
.crx-rolepill { font-size: 9px; padding: 3px 5px; background: var(--mint); color: var(--teal); border-radius: 5px; font-weight: 700; }
.crx-aibadge { font-size: 9px; padding: 3px 5px; background: var(--amber-soft); color: var(--amber); border-radius: 5px; font-weight: 700; }
.crx-srcchip {
  display: inline-block; margin-top: 4px; border: 1px solid var(--line); background: var(--panel);
  color: var(--navy); border-radius: 99px; padding: 3px 8px; cursor: pointer;
  font: 700 11px "DM Sans", system-ui, sans-serif; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crx-msg-ctx { font-size: 11px; color: var(--muted); margin: 4px 0 0; }
.crx-msg-body { font-size: 13px; margin: 3px 0 7px; line-height: 1.45; overflow-wrap: anywhere; }
.crx-reactions { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 11px; }
.crx-reactions button {
  border: 0; background: transparent; color: var(--muted); padding: 0; cursor: pointer;
  font: 700 11px "DM Sans", system-ui, sans-serif;
}
.crx-reactions button.on { color: var(--teal); }
.crx-score-static { font-weight: 700; }
.crx-thread.d1 { margin-left: 14px; }
.crx-thread.d2 { margin-left: 24px; }
.crx-thread.d3 { margin-left: 32px; }
.crx-thread.d1, .crx-thread.d2, .crx-thread.d3 {
  border-left: 2px solid var(--line); padding-left: 8px;
}

/* composer — preview anatomy: boxed, identity line left, Comment right */
.crx-composer { padding: 10px 14px 14px; border-top: 1px solid var(--line); }
.crx-composer-box { border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 10px; }
.crx-composer-ta {
  resize: vertical; border: 0; outline: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 13px; width: 100%; min-height: 42px;
}
.crx-composer-row { display: flex; align-items: center; gap: 7px; margin-top: 6px; }
.crx-identity { font-size: 11px; color: var(--muted); }
.crx-composer-row .crx-btn { margin-left: auto; }
.crx-ack { display: flex; gap: 7px; align-items: flex-start; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.crx-ack input { accent-color: var(--olive, #526547); }
.crx-replyctx {
  display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--teal);
  background: var(--mint); border-radius: 7px; padding: 5px 8px; margin-bottom: 8px;
}
.crx-replyctx-x { margin-left: auto; border: 0; background: transparent; cursor: pointer; font-size: 14px; color: var(--teal); }
.crx-locknote {
  border: 1px solid var(--line); background: var(--amber-soft); color: var(--amber);
  border-radius: 12px; padding: 10px 12px; font-size: 12.5px; font-weight: 600; margin: 0;
}

/* cross-reference text taps */
.crx-xref {
  border: 0; background: transparent; padding: 0; cursor: pointer; color: inherit;
  font: inherit; text-decoration: underline dotted var(--teal) 1px; text-underline-offset: 3px;
}
.crx-xref:hover { color: var(--teal); }

/* overlays — right sheet on desktop, full sheet on phone */
.crx-oscrim { position: fixed; inset: 0; background: rgba(16,36,40,.42); z-index: 90; }
.crx-overlay {
  box-sizing: border-box;
  position: fixed; top: 0; right: 0; height: 100dvh; width: min(430px, 100vw);
  background: var(--bg); z-index: 91; overflow-y: auto; padding: 20px 18px 40px;
  box-shadow: var(--shadow); border-left: 1px solid var(--line);
  font-family: "DM Sans", system-ui, sans-serif; color: var(--ink);
}
.crx-ov-head { margin-bottom: 12px; padding-right: 30px; }
.crx-ov-title { font-family: "Newsreader", serif; font-size: 26px; margin: 0 0 4px; letter-spacing: -.02em; }
.crx-ov-sub { color: var(--muted); font-size: 13px; margin: 0; }
.crx-ov-headline { font-size: 14px; font-weight: 600; margin: 8px 0 0; }
.crx-ov-summary { font-size: 13.5px; line-height: 1.5; color: var(--ink); }
.crx-ov-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.crx-chip.plain { cursor: default; }
.crx-ov-stats { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.crx-ov-review {
  margin: 10px 0; padding: 10px 12px; background: var(--soft); border: 1px solid var(--line);
  border-radius: 12px; font-size: 13px;
}
.crx-ov-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.crx-ov-coins { margin: 14px 0; }
.crx-ov-coins-note { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.crx-ov-list { display: grid; gap: 9px; margin: 14px 0; }
.crx-ov-feed { margin-top: 18px; }
.crx-ov-h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 6px; }
.crx-miniopp {
  text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 13px;
  padding: 12px; cursor: pointer; display: grid; gap: 3px; width: 100%;
  font-family: "DM Sans", system-ui, sans-serif; color: var(--ink);
}
.crx-miniopp-t { font-size: 13.5px; line-height: 1.3; }
.crx-miniopp-m { font-size: 12px; color: var(--muted); }
.crx-person-namerow { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.crx-mini-label { font-size: 11px; font-weight: 700; color: var(--muted); }

/* keyword popover + gloss academy footer */
.crx-kw {
  border: 0; background: transparent; padding: 0; cursor: pointer; color: inherit; font: inherit;
  border-bottom: 1px dotted var(--teal);
}
.crx-kwpop {
  box-sizing: border-box;
  position: absolute; z-index: 95; width: min(300px, calc(100vw - 16px));
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 12px 14px; font-family: "DM Sans", system-ui, sans-serif;
}
.crx-kwpop-t { font-size: 13px; }
.crx-kwpop-d { font-size: 12.5px; color: var(--ink); line-height: 1.45; margin: 5px 0 0; }
.crx-acad { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line, #d8e0e1); }
.crx-acad-link { color: var(--teal, #0a806f); font-weight: 700; font-size: 12.5px; text-decoration: none; }
.crx-acad-link:hover { text-decoration: underline; }

@media (max-width: 720px) {
  .crx-overlay { width: 100vw; border-left: 0; }
  .crx-chat-tabs { display: flex; margin-right: 14px; }
  .crx-chat-tab { flex: 1; padding: 6px 4px; font-size: 11.5px; }
  .crx-thread.d1 { margin-left: 8px; }
  .crx-thread.d2 { margin-left: 14px; }
  .crx-thread.d3 { margin-left: 18px; }
}

/* Honest chat states (owner direction 2026-10-16, r11): one line when chat
   cannot load, a Try again button, and the unsent draft marked as kept. */
.crx-chat-fail {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 4px 0 10px;
  padding: 12px 14px; border: 1px solid #e3c9a6; border-radius: 6px; background: #fbf4e8; color: #5b3a12;
}
.crx-chat-fail-line { margin: 0; flex: 1 1 220px; font-size: 13px; line-height: 1.45; color: #5b3a12; }
.crx-chat-retry {
  min-height: 44px; padding: 8px 16px; border-radius: 5px; border: 1px solid var(--fd-green, #526547);
  background: var(--fd-green, #526547); color: #fff; font-weight: 600; cursor: pointer;
}
.crx-chat-retry:focus-visible { outline: 3px solid #1f6fb5; outline-offset: 2px; }
.crx-notsent {
  display: inline-block; margin: 6px 0 0; padding: 3px 9px; border-radius: 999px;
  background: #fff3d6; border: 1px solid #e8cf94; color: #6b4a0c; font-size: 11.5px; font-weight: 600;
}
.crx-notsent[hidden], .crx-post-status[hidden] { display: none; }
.crx-post-status {
  margin: 8px 0 0; padding: 9px 11px; border-radius: 5px; background: #fbf4e8;
  border: 1px solid #e3c9a6; color: #5b3a12; font-size: 12.5px; line-height: 1.45;
}
.crx-draft-only .crx-composer-ta {
  width: 100%; min-height: 64px; max-height: 220px; field-sizing: content; box-sizing: border-box; padding: 10px 12px; resize: vertical;
  border: 1px solid #cbd4bf; border-radius: 5px; background: var(--fd-paper, #fffef9); color: var(--fd-ink, #29372e); font: inherit; font-size: 13px;
}
@media (max-width: 760px) { .crx-draft-only .crx-composer-ta { font-size: 16px; } }
/* r14: the set-aside line points to the certification room. */
.crx-cert-note { margin: 0 0 8px; padding: 8px 10px; border: 1px solid #cbd4bf; border-radius: 6px; background: #f3f5ec; color: #29372e; font-size: 12.5px; line-height: 1.45; }
.crx-cert-note .crx-cert-link { color: #344b2c; font-weight: 600; text-decoration: underline; display: inline-flex; align-items: center; min-height: 32px; }
@media (max-width: 760px) { .crx-cert-note .crx-cert-link { min-height: 44px; } }
/* r15 (owner direction 2026-10-16): one join control. The stock "Add my role" button gives way to the
   "I'm in as Prime / Sub / 1099" control in the actions row (assets/teaming.js). */
.crx .fx-acts .fx-imin { display: none; }
.crx-actsbar .tm-join-control { flex: 0 1 auto; }
.crx-chat .tm-here-host { margin: 0 0 8px; }
.crx-chat .tm-here { margin: 0; }
