/* ============================================================
   RFQ-to-Quote Drafter — app styles (RMAI design system)
   ============================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--rmai-font-sans);
  font-size: var(--rmai-fs-body);
  color: var(--rmai-fg-1);
  background: var(--rmai-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
#root { height: 100%; }
.mono { font-family: var(--rmai-font-mono); }
.eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: var(--rmai-ls-eyebrow);
  text-transform: uppercase; color: var(--rmai-fg-mut);
}
button { font-family: inherit; }
::selection { background: rgba(167,122,205,0.22); }

/* ---- App shell ---- */
.app { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.appbar {
  flex: 0 0 auto; height: 60px; background: var(--rmai-fg-1); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; gap: 20px;
}
.appbar .wm-l1 { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; color: #fff; line-height: 1.05; }
.appbar .wm-l2 { font-size: 16px; font-weight: 500; letter-spacing: -0.02em; color: var(--rmai-purple); line-height: 1.05; }
.appbar-left { display: flex; align-items: center; gap: 16px; }
.appbar-sep { width: 1px; height: 26px; background: rgba(255,255,255,0.14); }
.appbar-ctx { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #B7B7BA; }
.appbar-ctx .crumb { color: #fff; font-weight: 500; }
.appbar-right { display: flex; align-items: center; gap: 14px; }
.livedot {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: #B7B7BA;
  font-family: var(--rmai-font-mono);
}
.livedot .d { width: 7px; height: 7px; border-radius: 50%; background: var(--rmai-green);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.18); }

/* ---- Buttons ---- */
.btn {
  font-weight: 600; font-size: 14px; padding: 10px 18px; border-radius: 6px;
  border: 1px solid transparent; cursor: pointer; line-height: 1.2;
  transition: background var(--rmai-dur-base) var(--rmai-ease), color var(--rmai-dur-base) var(--rmai-ease),
              border-color var(--rmai-dur-base) var(--rmai-ease), transform var(--rmai-dur-fast) var(--rmai-ease);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn--cta { background: var(--rmai-orange); color: #fff; }
.btn--cta:hover { background: #DA5939; }
.btn--cta:active { background: #C84F30; transform: translateY(1px); }
.btn--primary { background: var(--rmai-fg-1); color: #fff; }
.btn--primary:hover { background: #33343E; }
.btn--secondary { background: #fff; color: var(--rmai-fg-1); border-color: var(--rmai-border); }
.btn--secondary:hover { background: var(--rmai-bg); border-color: var(--rmai-fg-1); }
.btn--ghost { background: transparent; color: var(--rmai-purple); padding: 8px 10px; }
.btn--ghost:hover { color: var(--rmai-fg-1); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn--sm { font-size: 12px; padding: 6px 12px; }
.btn:focus-visible { outline: 2px solid var(--rmai-purple); outline-offset: 2px; border-radius: 2px; }

/* ---- Cards ---- */
.card { background: var(--rmai-white); border: 1px solid var(--rmai-border); border-radius: var(--rmai-radius-lg); }

/* ---- Badges / pills ---- */
.badge {
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px; letter-spacing: 0.02em; white-space: nowrap;
}
.badge--lavender { background: var(--rmai-lavender); color: var(--rmai-purple); }
.badge--stone { background: var(--rmai-stone); color: var(--rmai-fg-1); }
.badge--outline { background: transparent; color: var(--rmai-fg-2); border: 1px solid var(--rmai-border); }
.badge--status { background: transparent; color: var(--rmai-fg-2); border: 1px solid var(--rmai-border); }
.badge--status .d { width: 7px; height: 7px; border-radius: 50%; }
.badge--new .d { background: var(--rmai-purple); }
.badge--ready { background: rgba(34,197,94,0.10); color: #15803D; border-color: rgba(34,197,94,0.30); }
.badge--ready .d { background: var(--rmai-green); box-shadow: 0 0 0 3px rgba(34,197,94,0.16); }
.badge--drafted { background: var(--rmai-lavender); color: var(--rmai-purple); border: none; }
.badge--drafted .d { background: var(--rmai-purple); }

/* ============================================================
   INBOX
   ============================================================ */
.inbox-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.inbox { max-width: 920px; margin: 0 auto; padding: 40px 28px 64px; }
.inbox-head { margin-bottom: 6px; }
.inbox-head h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 6px; }
.inbox-head p { font-size: 15px; color: var(--rmai-fg-2); margin: 0; max-width: 64ch; line-height: 1.5; }
.inbox-meta { display: flex; align-items: center; gap: 10px; margin: 22px 0 14px; }
.inbox-meta .seg { font-size: 12px; color: var(--rmai-fg-mut); font-family: var(--rmai-font-mono); }
.rfq-list { display: flex; flex-direction: column; gap: 10px; }
.rfq-row {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 16px; align-items: center;
  padding: 16px 18px; background: #fff; border: 1px solid var(--rmai-border);
  border-radius: var(--rmai-radius-lg); cursor: pointer; text-align: left;
  transition: border-color var(--rmai-dur-base) var(--rmai-ease), box-shadow var(--rmai-dur-base) var(--rmai-ease),
              transform var(--rmai-dur-base) var(--rmai-ease);
}
.rfq-row:hover { border-color: #D8D2E0; box-shadow: var(--rmai-shadow-2); transform: translateY(-1px); }
.rfq-row:focus-visible { outline: 2px solid var(--rmai-purple); outline-offset: 2px; }
.rfq-ava {
  width: 44px; height: 44px; border-radius: 50%; background: var(--rmai-lavender);
  color: var(--rmai-purple); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; letter-spacing: -0.01em;
}
.rfq-main { min-width: 0; display: flex; flex-direction: column; }
.rfq-from { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.rfq-subj { display: block; }
.rfq-from .co { white-space: nowrap; }
.rfq-from .co { font-weight: 600; font-size: 15px; color: var(--rmai-fg-1); }
.rfq-from .who { font-size: 12px; color: var(--rmai-fg-mut); white-space: nowrap; }
.rfq-subj { font-size: 14px; color: var(--rmai-fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rfq-tags { display: flex; gap: 7px; margin-top: 9px; flex-wrap: wrap; }
.rfq-chip {
  font-size: 11px; font-family: var(--rmai-font-mono); color: var(--rmai-fg-2);
  background: var(--rmai-bg); border: 1px solid var(--rmai-border);
  padding: 2px 8px; border-radius: var(--rmai-radius-sm); display: inline-flex; align-items: center; gap: 5px;
}
.rfq-aside { display: flex; flex-direction: column; align-items: flex-end; gap: 9px; }
.rfq-time { font-size: 12px; color: var(--rmai-fg-mut); font-family: var(--rmai-font-mono); }

/* ============================================================
   DRAFTER — two-pane
   ============================================================ */
.drafter { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 40fr 60fr; }
.pane { min-height: 0; overflow-y: auto; }
.pane--source { background: var(--rmai-bg); border-right: 1px solid var(--rmai-border); }
.pane--draft { background: #fff; }
.pane-inner { padding: 26px 28px 80px; }
.pane-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.pane-head .eyebrow { color: var(--rmai-purple); }

/* Source: RFQ email card */
.mail {
  background: #fff; border: 1px solid var(--rmai-border); border-radius: var(--rmai-radius-lg);
  overflow: hidden; margin-bottom: 18px;
}
.mail-hd { padding: 14px 16px; border-bottom: 1px solid var(--rmai-border); }
.mail-from { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.mail-ava { width: 30px; height: 30px; border-radius: 50%; background: var(--rmai-stone);
  color: var(--rmai-fg-1); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.mail-from .nm { font-weight: 600; font-size: 13px; }
.mail-from .em { font-size: 11px; color: var(--rmai-fg-mut); font-family: var(--rmai-font-mono); }
.mail-subj { font-size: 14px; font-weight: 600; color: var(--rmai-fg-1); }
.mail-body {
  width: 100%; border: 0; resize: vertical; min-height: 132px; padding: 14px 16px;
  font-family: var(--rmai-font-sans); font-size: 13.5px; line-height: 1.55; color: var(--rmai-fg-1);
  background: #fff; outline: none;
}
.mail-body:focus { background: #FEFDFB; box-shadow: inset 3px 0 0 var(--rmai-purple); }
.mail-foot { padding: 9px 16px; border-top: 1px solid var(--rmai-border); display: flex; align-items: center;
  justify-content: space-between; background: var(--rmai-bg); }
.mail-foot .hint { font-size: 11px; color: var(--rmai-fg-mut); }

/* Drawing block */
.dwg-wrap { margin-bottom: 18px; }
.dwg-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.dwg-bar .lbl { font-size: 12px; font-weight: 600; color: var(--rmai-fg-1); display: flex; align-items: center; gap: 8px; }
.dwg {
  position: relative; background: #fff; border: 1px solid var(--rmai-border); border-radius: var(--rmai-radius-lg);
  overflow: hidden; aspect-ratio: 4 / 3;
}
.dwg.drag { border-color: var(--rmai-purple); box-shadow: 0 0 0 2px rgba(167,122,205,0.18); }
.dwg svg { display: block; width: 100%; height: 100%; }
.dwg-photo { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.dwg-drop {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; background: rgba(240,235,244,0.86); color: var(--rmai-purple); font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity var(--rmai-dur-base) var(--rmai-ease);
}
.dwg.drag .dwg-drop { opacity: 1; }
.dwg-replace {
  position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 600; color: var(--rmai-fg-2);
  background: rgba(255,255,255,0.92); border: 1px solid var(--rmai-border); border-radius: 999px;
  padding: 4px 10px; cursor: pointer; backdrop-filter: blur(2px);
}
.dwg-replace:hover { border-color: var(--rmai-fg-1); color: var(--rmai-fg-1); }
.dwg-thumbs { display: flex; gap: 8px; margin-top: 10px; }
.dwg-thumb {
  width: 56px; height: 44px; border-radius: var(--rmai-radius-md); border: 1px solid var(--rmai-border);
  background: #fff; cursor: pointer; overflow: hidden; display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: var(--rmai-fg-mut); font-family: var(--rmai-font-mono);
}
.dwg-thumb.active { border-color: var(--rmai-purple); box-shadow: 0 0 0 1px var(--rmai-purple); }

/* Annotation callouts on the drawing */
.anno { position: absolute; pointer-events: none; opacity: 0; transition: opacity 360ms var(--rmai-ease), transform 360ms var(--rmai-ease); }
.anno.show { opacity: 1; }
.anno-dot { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--rmai-purple);
  box-shadow: 0 0 0 4px rgba(167,122,205,0.18); transform: translate(-50%, -50%); }
.anno-tag {
  position: absolute; font-family: var(--rmai-font-mono); font-size: 10.5px; font-weight: 500; color: #fff;
  background: var(--rmai-purple); padding: 2px 7px; border-radius: var(--rmai-radius-sm); white-space: nowrap;
  transform: translateY(-50%);
}
.anno-line { position: absolute; height: 1px; background: var(--rmai-purple); opacity: 0.55; transform-origin: left center; }

/* Spec accordion */
.spec { background: #fff; border: 1px solid var(--rmai-border); border-radius: var(--rmai-radius-lg); overflow: hidden; }
.spec-row { border-bottom: 1px solid var(--rmai-border); }
.spec-row:last-child { border-bottom: 0; }
.spec-q { width: 100%; text-align: left; background: #fff; border: 0; cursor: pointer;
  padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 13px; font-weight: 600; color: var(--rmai-fg-1); }
.spec-q:hover { background: var(--rmai-bg); }
.spec-q .chev { color: var(--rmai-fg-mut); transition: transform var(--rmai-dur-base) var(--rmai-ease); }
.spec-row.open .chev { transform: rotate(90deg); }
.spec-a { padding: 0 16px 14px; font-size: 13px; line-height: 1.55; color: var(--rmai-fg-2); }
.spec-a .mono { font-size: 12px; color: var(--rmai-fg-1); }

/* ============================================================
   DRAFT PANE states
   ============================================================ */
/* Ready / empty */
.draft-ready { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; padding-top: 18px; }
.draft-ready .lede { font-size: 16px; line-height: 1.55; color: var(--rmai-fg-2); max-width: 52ch; }
.draft-ready .lede b { color: var(--rmai-fg-1); font-weight: 600; }
.ready-points { display: flex; flex-direction: column; gap: 10px; margin: 2px 0 4px; }
.ready-point { display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px; color: var(--rmai-fg-2); }
.ready-point .n { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: var(--rmai-lavender);
  color: var(--rmai-purple); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* Processing shimmer */
.shimmer-wrap { padding-top: 8px; }
.shim-status { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600;
  color: var(--rmai-purple); margin-bottom: 20px; }
.shim-status .spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(167,122,205,0.25);
  border-top-color: var(--rmai-purple); animation: shim-spin 0.8s linear infinite; }
@keyframes shim-spin { to { transform: rotate(360deg); } }
.shimline { height: 14px; border-radius: 4px; margin-bottom: 12px;
  background: linear-gradient(90deg, #EFEDEA 25%, #F6F4F1 37%, #EFEDEA 63%);
  background-size: 400% 100%; animation: shim 1.4s ease infinite; }
.shimblock { height: 64px; border-radius: 10px; margin: 18px 0;
  background: linear-gradient(90deg, #EFEDEA 25%, #F6F4F1 37%, #EFEDEA 63%);
  background-size: 400% 100%; animation: shim 1.4s ease infinite; }
@keyframes shim { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* Result */
.result { opacity: 0; }
.result.in { opacity: 1; transition: opacity var(--rmai-dur-slow) var(--rmai-ease); }
.draft-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
.draft-toolbar .meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* line rows */
.lines { border: 1px solid var(--rmai-border); border-radius: var(--rmai-radius-lg); overflow: hidden; }
.lines-hd, .line {
  display: grid; grid-template-columns: 1fr 42px 78px 92px 96px; align-items: center; gap: 10px;
  padding: 11px 14px;
}
.lines-hd { background: var(--rmai-bg); border-bottom: 1px solid var(--rmai-border);
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rmai-fg-mut); }
.lines-hd .r, .line .r { text-align: right; }
.lines-hd .c { text-align: center; }
.line { border-bottom: 1px solid var(--rmai-border); position: relative;
  transition: background var(--rmai-dur-base) var(--rmai-ease); }
.line:last-child { border-bottom: 0; }
.line.material { background: var(--rmai-lavender); }
.line.rejected { opacity: 0.42; }
.line.rejected .op-name { text-decoration: line-through; }
.line.approved { background: rgba(34,197,94,0.05); }
.line:hover { background: var(--rmai-bg); }
.line.material:hover { background: #E9E1F1; }
.op { min-width: 0; }
.op-name { font-size: 13.5px; font-weight: 600; color: var(--rmai-fg-1); display: flex; align-items: center; gap: 7px; }
.op-src { font-size: 10.5px; color: var(--rmai-purple); font-family: var(--rmai-font-mono); margin-top: 3px;
  display: inline-flex; align-items: center; gap: 4px; cursor: help; }
.op-src .ic { opacity: 0.7; }
.edited-dot { font-size: 9px; color: var(--rmai-orange); font-weight: 700; letter-spacing: 0.04em;
  background: rgba(242,101,65,0.12); padding: 1px 6px; border-radius: 999px; }
.line .qty, .line .rate { font-family: var(--rmai-font-mono); font-size: 13px; text-align: right; color: var(--rmai-fg-2); }
.rate-input, .qty-input {
  width: 100%; font-family: var(--rmai-font-mono); font-size: 13px; text-align: right; color: var(--rmai-fg-1);
  border: 1px solid var(--rmai-border); border-radius: var(--rmai-radius-sm); padding: 5px 7px; outline: none; background: #fff;
}
.rate-input:focus, .qty-input:focus { border-color: var(--rmai-purple); box-shadow: 0 0 0 2px rgba(167,122,205,0.20); }

/* confidence pill */
.conf { justify-self: center; }
.conf-pill {
  font-family: var(--rmai-font-mono); font-size: 11px; font-weight: 500; padding: 3px 9px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.conf-pill .d { width: 6px; height: 6px; border-radius: 50%; }
/* pill style: filled */
.conf-pill.filled.good { background: rgba(34,197,94,0.14); color: #15803D; }
.conf-pill.filled.good .d { background: var(--rmai-green); }
.conf-pill.filled.mid { background: var(--rmai-lavender); color: var(--rmai-purple); }
.conf-pill.filled.mid .d { background: var(--rmai-purple); }
.conf-pill.filled.low { background: rgba(245,158,11,0.16); color: #B45309; }
.conf-pill.filled.low .d { background: #F59E0B; }
.conf-pill.filled.vlow { background: rgba(239,68,68,0.14); color: #DC2626; }
.conf-pill.filled.vlow .d { background: #EF4444; }
/* pill style: outline */
.conf-pill.outline { background: transparent; border: 1px solid var(--rmai-border); color: var(--rmai-fg-2); }
.conf-pill.outline.good .d { background: var(--rmai-green); }
.conf-pill.outline.mid .d { background: var(--rmai-purple); }
.conf-pill.outline.low .d { background: #F59E0B; }
.conf-pill.outline.vlow .d { background: #EF4444; }
/* pill style: bar */
.conf-bar { width: 64px; height: 7px; border-radius: 999px; background: var(--rmai-border); position: relative; overflow: hidden; justify-self: center; }
.conf-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; transition: width 500ms var(--rmai-ease); }
.conf-bar.good .fill { background: var(--rmai-green); }
.conf-bar.mid .fill { background: var(--rmai-purple); }
.conf-bar.low .fill { background: #F59E0B; }
.conf-bar.vlow .fill { background: #EF4444; }
.conf-bar-num { font-family: var(--rmai-font-mono); font-size: 10px; color: var(--rmai-fg-mut); text-align: center; margin-top: 3px; }

.line.lowconf::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #F59E0B;
}

/* per-line action buttons */
.line-acts { display: flex; gap: 4px; justify-content: flex-end; }
.iact {
  width: 28px; height: 28px; border-radius: var(--rmai-radius-md); border: 1px solid var(--rmai-border);
  background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--rmai-fg-mut);
  transition: all var(--rmai-dur-fast) var(--rmai-ease);
}
.iact:hover { border-color: var(--rmai-fg-2); color: var(--rmai-fg-1); }
.iact.on-approve { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.4); color: #15803D; }
.iact.on-reject { background: rgba(239,68,68,0.10); border-color: rgba(239,68,68,0.4); color: #DC2626; }
.iact.on-edit { background: var(--rmai-lavender); border-color: var(--rmai-purple); color: var(--rmai-purple); }

/* totals block */
.totals { margin-top: 20px; }
.tot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tot-cell { background: var(--rmai-bg); border: 1px solid var(--rmai-border); border-radius: var(--rmai-radius-md); padding: 12px 14px; }
.tot-cell .k { font-size: 11px; color: var(--rmai-fg-mut); letter-spacing: 0.03em; margin-bottom: 5px; }
.tot-cell .v { font-family: var(--rmai-font-mono); font-size: 17px; font-weight: 500; color: var(--rmai-fg-1); }
.tot-cell .v .sub { font-size: 11px; color: var(--rmai-fg-mut); margin-left: 4px; }

.headline {
  margin-top: 12px; background: var(--rmai-fg-1); color: #fff; border-radius: var(--rmai-radius-lg);
  padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.headline .k { font-size: 12px; color: #B7B7BA; letter-spacing: 0.03em; margin-bottom: 4px; }
.headline .big { font-family: var(--rmai-font-mono); font-size: 34px; font-weight: 500; letter-spacing: -0.01em; line-height: 1; }
.headline .big .cur { font-size: 18px; color: var(--rmai-purple); vertical-align: top; margin-right: 2px; }
.headline .unit { font-size: 13px; color: #B7B7BA; margin-top: 6px; }
.headline-right { text-align: right; }
.qtybreaks { display: flex; gap: 7px; }
.qb { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: var(--rmai-radius-md);
  padding: 7px 11px; text-align: center; cursor: pointer; transition: all var(--rmai-dur-fast) var(--rmai-ease); }
.qb:hover { background: rgba(255,255,255,0.12); }
.qb.active { background: var(--rmai-purple); border-color: var(--rmai-purple); }
.qb .qn { font-family: var(--rmai-font-mono); font-size: 11px; color: #B7B7BA; }
.qb.active .qn { color: rgba(255,255,255,0.85); }
.qb .qp { font-family: var(--rmai-font-mono); font-size: 13px; font-weight: 500; color: #fff; margin-top: 2px; }

/* margin slider */
.margin { margin-top: 18px; background: var(--rmai-bg); border: 1px solid var(--rmai-border);
  border-radius: var(--rmai-radius-lg); padding: 16px 18px; }
.margin-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.margin-top .lbl { font-size: 13px; font-weight: 600; }
.margin-top .val { font-family: var(--rmai-font-mono); font-size: 20px; font-weight: 500; color: var(--rmai-purple); }
.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px;
  background: var(--rmai-border); outline: none; cursor: pointer; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 2px solid var(--rmai-purple); box-shadow: var(--rmai-shadow-2); cursor: grab; }
.slider::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--rmai-purple); cursor: grab; }
.slider:focus-visible { outline: 2px solid var(--rmai-purple); outline-offset: 4px; }
.margin-scale { display: flex; justify-content: space-between; margin-top: 8px; font-family: var(--rmai-font-mono);
  font-size: 10px; color: var(--rmai-fg-mut); }

/* clarifying questions */
.clarify { margin-top: 22px; }
.clarify-hd { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.clarify-hd .t { font-size: 13px; font-weight: 700; color: var(--rmai-fg-1); }
.clarify-hd .n { font-family: var(--rmai-font-mono); font-size: 11px; color: #B45309; background: rgba(245,158,11,0.16);
  padding: 2px 8px; border-radius: 999px; }
.cq { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: #fff;
  border: 1px solid var(--rmai-border); border-left: 3px solid #F59E0B; border-radius: var(--rmai-radius-md); margin-bottom: 8px; }
.cq.resolved { border-left-color: var(--rmai-green); background: rgba(34,197,94,0.04); }
.cq .qn { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; background: rgba(245,158,11,0.16); color: #B45309;
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.cq.resolved .qn { background: rgba(34,197,94,0.16); color: #15803D; }
.cq-body { flex: 1; min-width: 0; }
.cq-q { font-size: 13px; font-weight: 600; color: var(--rmai-fg-1); line-height: 1.4; }
.cq-assume { font-size: 12px; color: var(--rmai-fg-2); margin-top: 4px; }
.cq-assume .mono { color: var(--rmai-purple); }
.cq-answer { margin-top: 9px; width: 100%; font-family: var(--rmai-font-sans); font-size: 12.5px; color: var(--rmai-fg-1);
  border: 1px solid var(--rmai-border); border-radius: var(--rmai-radius-sm); padding: 7px 9px; outline: none; }
.cq-answer:focus { border-color: var(--rmai-purple); box-shadow: 0 0 0 2px rgba(167,122,205,0.18); }

/* footer actions */
.draft-actions { display: flex; gap: 10px; align-items: center; margin-top: 26px; padding-top: 20px;
  border-top: 1px solid var(--rmai-border); }
.draft-actions .spacer { flex: 1; }
.draft-actions .note { font-size: 11.5px; color: var(--rmai-fg-mut); max-width: 30ch; line-height: 1.4; }

/* approved banner */
.approved-banner { margin-top: 20px; background: rgba(34,197,94,0.07); border: 1px solid rgba(34,197,94,0.28);
  border-radius: var(--rmai-radius-lg); padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; }
.approved-banner .ic { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; background: rgba(34,197,94,0.16);
  color: #15803D; display: flex; align-items: center; justify-content: center; }
.approved-banner h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; color: #15803D; }
.approved-banner p { margin: 0; font-size: 13px; color: var(--rmai-fg-2); line-height: 1.5; }
.approved-banner .ref { font-family: var(--rmai-font-mono); color: var(--rmai-fg-1); }

/* ---- Toast ---- */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 9000;
  display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  background: var(--rmai-fg-1); color: #fff; border-radius: var(--rmai-radius-lg); padding: 14px 18px;
  display: flex; align-items: center; gap: 12px; box-shadow: var(--rmai-shadow-3); min-width: 320px; max-width: 460px;
  animation: toast-in 280ms var(--rmai-ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.toast.out { animation: toast-out 240ms var(--rmai-ease) forwards; }
@keyframes toast-out { to { opacity: 0; transform: translateY(12px); } }
.toast .ic { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: rgba(34,197,94,0.18);
  color: var(--rmai-green); display: flex; align-items: center; justify-content: center; }
.toast .tx { font-size: 13.5px; line-height: 1.4; }
.toast .tx b { font-weight: 600; }
.toast .tx .sub { color: #B7B7BA; font-size: 12px; }

/* staggered row entrance — pure CSS so it survives React re-renders */
.stagger { animation: rowin 320ms var(--rmai-ease) both; }
@keyframes rowin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* density: compact */
.app.compact .pane-inner { padding: 18px 20px 70px; }
.app.compact .lines-hd, .app.compact .line { padding: 8px 12px; }
.app.compact .mail-body { min-height: 104px; }
.app.compact .rfq-row { padding: 12px 14px; }

@media (max-width: 900px) {
  .drafter { grid-template-columns: 1fr; }
  .pane--source { border-right: 0; border-bottom: 1px solid var(--rmai-border); }
}
