/* ============================================================
   Demo — RFI Triage Brief
   BPS-04 RFI-register coordinator brief inside the Asite CDE
   chrome. A real agent writes the weekly RFI brief on demand;
   every claim is cited, a Top-5 of actions is proposed, and the
   draft emails are shown ready to review — sending is the human
   step. Selectors prefixed `rtb-`. Builds on main.css.
   ============================================================ */

.rtb-app {
  position: relative;
  min-height: 520px;
  --rtb: #4F46E5;
  --rtb-d: #3730A3;
  --rtb-l: #EEF0FE;
}

/* ---- CDE shell ---- */
.rtb-cde {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  box-shadow: var(--sh-1);
  overflow: hidden;
  font-size: 12.5px;
}

/* ---- dark top bar ---- */
.rtb-top {
  display: flex; align-items: center; gap: 14px;
  height: 46px; padding: 0 14px; color: #fff;
  background: linear-gradient(90deg, #2a6db5, #15375f);
}
.rtb-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.rtb-logo {
  width: 26px; height: 26px; border-radius: 6px; background: #fff;
  display: flex; align-items: center; justify-content: center;
}
.rtb-brandtx { letter-spacing: .04em; font-size: 14px; }
.rtb-topsearch {
  display: flex; align-items: center; gap: 8px;
  width: 220px; height: 28px; padding: 0 11px; border-radius: 6px;
  background: rgba(255,255,255,.92); color: var(--text-3); font-size: 12.5px;
}
.rtb-proj { display: flex; align-items: center; gap: 6px; opacity: .96; }
.rtb-proj strong { font-weight: 700; }
.rtb-tools { margin-left: auto; display: flex; align-items: center; gap: 11px; }
.rtb-ic { opacity: .9; display: inline-flex; }
.rtb-ava {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 24px; height: 24px; border-radius: 50%; font-size: 9.5px; font-weight: 800;
  color: #fff; background: var(--rtb-d);
}

/* ---- nav tabs ---- */
.rtb-tabs {
  display: flex; align-items: center; gap: 2px; padding: 0 12px;
  border-bottom: 1px solid var(--line); background: #fff; overflow-x: auto;
}
.rtb-tab {
  padding: 11px 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  color: var(--text-2); border-bottom: 2px solid transparent;
}
.rtb-tab.active { color: var(--rtb-d); border-bottom-color: var(--rtb); font-weight: 700; }

/* ---- body ---- */
.rtb-body { padding: 16px; background: #fafbfc; }

/* ---- brief head ---- */
.rtb-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.rtb-head-id { display: flex; align-items: center; gap: 11px; }
.rtb-head-orb {
  width: 38px; height: 38px; flex: none; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; color: #fff; background: linear-gradient(120deg, var(--rtb), var(--rtb-d));
  box-shadow: 0 6px 14px -6px rgba(0,0,0,.32);
}
.rtb-head-name { font-size: 16px; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.rtb-head-sub { font-size: 12px; color: var(--text-3); font-weight: 600; }
.rtb-head .rtb-btn { margin-left: auto; }

/* ---- buttons ---- */
.rtb-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: 7px; font-size: 12.5px; font-weight: 600; cursor: pointer; border: 1px solid transparent;
  transition: filter .14s ease, background .14s ease, transform .12s ease;
}
.rtb-btn.ghost { background: #fff; border-color: var(--line-strong); color: var(--text-2); }
.rtb-btn.ghost:hover { border-color: var(--rtb); color: var(--rtb-d); }
.rtb-btn.primary {
  background: linear-gradient(120deg, var(--rtb), var(--rtb-d)); color: #fff;
  box-shadow: 0 6px 14px -6px rgba(0,0,0,.32);
}
.rtb-btn.primary:hover { filter: brightness(1.07); }
.rtb-btn.primary:active { transform: translateY(1px); }
.rtb-btn:disabled { opacity: .5; cursor: default; filter: none; box-shadow: none; }

/* ---- idle state ---- */
.rtb-idle {
  border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; box-shadow: var(--sh-1);
  padding: 38px 28px 30px; text-align: center;
}
.rtb-idle-t { font-size: 18px; font-weight: 800; color: var(--text); margin: 0 0 8px; letter-spacing: -.01em; }
.rtb-idle-p { font-size: 13px; line-height: 1.6; color: var(--text-2); margin: 0 auto 20px; max-width: 58ch; }
.rtb-gen {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border: none;
  border-radius: 9px; background: linear-gradient(120deg, var(--rtb), var(--rtb-d)); color: #fff;
  font-size: 13.5px; font-weight: 700; cursor: pointer;
  box-shadow: 0 8px 18px -10px rgba(0,0,0,.45); transition: filter .14s ease, transform .12s ease;
}
.rtb-gen:hover { filter: brightness(1.07); }
.rtb-gen:active { transform: translateY(1px); }
.rtb-idle-hint {
  display: flex; align-items: flex-start; justify-content: center; gap: 7px; margin: 14px auto 0;
  font-size: 11.5px; line-height: 1.5; color: var(--text-3); max-width: 54ch;
}
.rtb-idle-hint .ico { color: var(--rtb); flex: none; margin-top: 1px; }

/* ---- loading ---- */
.rtb-loading {
  border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; box-shadow: var(--sh-1);
  padding: 22px 20px;
}
.rtb-loading-t { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 16px; }
.rtb-cklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.rtb-ck { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-3); }
.rtb-ck.active { color: var(--text); font-weight: 600; }
.rtb-ck.done { color: var(--text-2); }
.rtb-ck-mark { display: inline-flex; }
.rtb-ck-mark.ok { color: var(--ok); }
.rtb-dot { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--line-strong); display: inline-block; }
.rtb-spin {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(0,0,0,.14); border-top-color: var(--rtb);
  display: inline-block; animation: rtb-spin .65s linear infinite;
}
.rtb-spin.sm { width: 13px; height: 13px; }
@keyframes rtb-spin { to { transform: rotate(360deg); } }

/* ---- brief ---- */
.rtb-brief { display: flex; flex-direction: column; gap: 14px; animation: rtb-fade .4s ease; }
@keyframes rtb-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* summary strip */
.rtb-summary {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; box-shadow: var(--sh-1); padding: 12px 14px;
}
.rtb-stat { display: flex; align-items: baseline; gap: 7px; padding: 4px 12px; border-radius: 999px; background: var(--bg-sunken); }
.rtb-stat-n { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rtb-stat-l { font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.rtb-stat-changed .rtb-stat-n { color: var(--rtb-d); }
.rtb-stat-due .rtb-stat-n { color: var(--err); }
.rtb-stat-attention .rtb-stat-n { color: var(--warn); }
.rtb-stat-actions .rtb-stat-n { color: var(--rtb-d); }
.rtb-summary-note { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.rtb-summary-note .ico { color: var(--rtb); }

/* sections */
.rtb-secs { display: flex; flex-direction: column; gap: 14px; }
.rtb-sec { border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; box-shadow: var(--sh-1); overflow: hidden; }
.rtb-sec-head { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--bg-sunken); }
.rtb-sec-ic { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: 7px; }
.rtb-sec-changed .rtb-sec-ic { color: var(--rtb-d); background: var(--rtb-l); }
.rtb-sec-due .rtb-sec-ic { color: var(--err); background: #FBEAEE; }
.rtb-sec-attention .rtb-sec-ic { color: var(--warn); background: var(--warn-bg); }
.rtb-sec-actions .rtb-sec-ic { color: var(--rtb-d); background: var(--rtb-l); }
.rtb-sec-title { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--text); }
.rtb-sec-count { font-size: 11px; font-weight: 700; color: var(--text-3); padding: 1px 8px; border-radius: 999px; background: #eef2f7; }

.rtb-list { list-style: none; margin: 0; padding: 0; }
.rtb-item { display: flex; gap: 11px; padding: 13px 14px; border-bottom: 1px solid var(--line-soft); }
.rtb-item:last-child { border-bottom: none; }
.rtb-item-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 6px; }
.rtb-dot-changed { background: var(--rtb); }
.rtb-dot-due { background: var(--err); }
.rtb-dot-attention { background: var(--warn); }
.rtb-item-main { flex: 1; min-width: 0; }
.rtb-item-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.rtb-item-title { font-size: 13px; font-weight: 700; color: var(--text); }
.rtb-item-detail { margin: 4px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--text-2); }
.rtb-item-cite { margin-top: 7px; }
.rtb-cite {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums; color: var(--rtb-d); background: var(--rtb-l);
  padding: 2px 8px 2px 6px; border-radius: 6px;
}
.rtb-cite .ico { opacity: .8; }

/* pills */
.rtb-pill { font-size: 10.5px; font-weight: 800; letter-spacing: .02em; padding: 2px 8px; border-radius: 999px; white-space: nowrap; text-transform: uppercase; }
.rtb-pill-overdue { background: #FBEAEE; color: var(--err); }
.rtb-pill-due { background: var(--warn-bg); color: var(--warn); }
.rtb-sev-high { background: #FBEAEE; color: var(--err); }
.rtb-sev-medium { background: var(--warn-bg); color: var(--warn); }
.rtb-sev-low { background: #eef2f7; color: var(--text-2); }

/* Top-5 suggested actions */
.rtb-actlist { list-style: none; margin: 0; padding: 0; }
.rtb-act { display: flex; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line-soft); }
.rtb-act:last-child { border-bottom: none; }
.rtb-act-rank {
  flex: none; width: 24px; height: 24px; border-radius: 7px; margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums;
  color: var(--rtb-d); background: var(--rtb-l);
}
.rtb-act-main { flex: 1; min-width: 0; }
.rtb-act-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.rtb-act-title { font-size: 13px; font-weight: 700; color: var(--text); }
.rtb-act-detail { margin: 4px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--text-2); }
.rtb-act-foot { margin-top: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rtb-act-owner {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700;
  color: var(--text-2); background: #eef2f7; padding: 2px 8px 2px 6px; border-radius: 6px;
}
.rtb-act-owner .ico { opacity: .75; }

/* draft emails (ready to review; sending is the human approval step) */
.rtb-drafts { display: flex; flex-direction: column; gap: 12px; }
.rtb-drafts-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding: 2px 2px 0; }
.rtb-drafts-ic {
  display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center;
  border-radius: 7px; color: var(--rtb-d); background: var(--rtb-l);
}
.rtb-drafts-title { margin: 0; font-size: 13.5px; font-weight: 800; color: var(--text); }
.rtb-drafts-note {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; color: var(--ok); background: var(--ok-bg);
  padding: 4px 10px; border-radius: 999px;
}
.rtb-drafts-note .ico { opacity: .9; }

.rtb-draft { border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; box-shadow: var(--sh-1); overflow: hidden; }
.rtb-draft-head { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--bg-sunken); }
.rtb-draft-ic { width: 30px; height: 30px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--rtb-d); background: var(--rtb-l); }
.rtb-draft-id { flex: 1; min-width: 0; }
.rtb-draft-name { font-size: 13.5px; font-weight: 700; color: var(--text); }
.rtb-draft-sub { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rtb-draft-ok { display: inline-flex; align-items: center; gap: 5px; flex: none; font-size: 11px; font-weight: 700; color: var(--ok); background: var(--ok-bg); padding: 4px 10px; border-radius: 999px; }

.rtb-draft-bodywrap { position: relative; }
.rtb-draft-body { margin: 0; padding: 16px; font-family: inherit; font-size: 12.5px; line-height: 1.6; color: var(--text); white-space: pre-wrap; word-wrap: break-word; }

.rtb-draft-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 12px 14px; border-top: 1px solid var(--line); background: #fff; }

/* ---- clickable citation chip ---- */
.rtb-cite-link {
  border: 0; cursor: pointer; font-family: inherit; line-height: 1.4;
  transition: background .12s ease, color .12s ease, box-shadow .12s ease;
}
.rtb-cite-link:hover { background: var(--rtb-d); color: #fff; }
.rtb-cite-link:hover .ico { opacity: 1; }
.rtb-cite-link:focus-visible { outline: 2px solid var(--rtb); outline-offset: 2px; }

/* ---- sample source-record document (shown in modal) ---- */
/* modal renders on <body>, outside .rtb-app — redeclare brand tokens so colors resolve */
.rtb-doc {
  --rtb: #4F46E5; --rtb-d: #3730A3; --rtb-l: #EEF0FE;
  position: relative; overflow: hidden; border-radius: 10px; background: #fff;
}
.rtb-doc-inner { position: relative; z-index: 1; }
.rtb-doc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.rtb-doc-kind {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--rtb-d);
}
.rtb-doc-kind .ico { opacity: .85; }
.rtb-doc-status { font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.rtb-doc-ok { background: var(--ok-bg); color: var(--ok); }
.rtb-doc-open { background: var(--rtb-l); color: var(--rtb-d); }
.rtb-doc-warn { background: var(--warn-bg); color: var(--warn); }
.rtb-doc-overdue { background: var(--err-bg); color: var(--err); }
.rtb-doc-id {
  font-size: 12px; font-weight: 800; letter-spacing: .04em;
  font-variant-numeric: tabular-nums; color: var(--text-2);
}
.rtb-doc-title { margin: 2px 0 14px; font-size: 18px; font-weight: 800; color: var(--text); }
.rtb-doc-meta {
  display: grid; grid-template-columns: 1fr 1fr; gap: 9px 22px;
  padding: 12px 14px; margin-bottom: 14px;
  background: #F7F8FC; border: 1px solid var(--line); border-radius: 10px;
}
.rtb-doc-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rtb-doc-k { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.rtb-doc-v { font-size: 13px; font-weight: 600; color: var(--text); }
.rtb-doc-summary { margin: 0 0 14px; font-size: 13.5px; line-height: 1.6; color: var(--text); }
.rtb-doc-foot { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); border-top: 1px dashed var(--line); padding-top: 10px; }
.rtb-doc-foot .ico { opacity: .8; }

/* diagonal SAMPLE watermark tiled across the record */
.rtb-doc-wm {
  position: absolute; inset: -40% -10%; z-index: 0; pointer-events: none;
  display: flex; flex-wrap: wrap; align-content: center; justify-content: center;
  gap: 26px 40px; transform: rotate(-24deg); opacity: .08;
}
.rtb-doc-wm span { font-size: 30px; font-weight: 900; letter-spacing: .14em; color: var(--rtb-d); white-space: nowrap; user-select: none; }

/* ---- responsive ---- */
@media (max-width: 720px) {
  .rtb-topsearch { display: none; }
  .rtb-summary-note { margin-left: 0; }
  .rtb-drafts-note { margin-left: 0; }
  .rtb-draft-actions { flex-wrap: wrap; }
  .rtb-doc-meta { grid-template-columns: 1fr; }
}
