/* ============================================================
   Invoice-to-PO Reconciler — RMAI Decisioning reference shell
   Grounded in the RMAI design system (A3 Warm Editorial + Plum)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Epilogue:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* RMAI brand */
  --rmai-purple:   #A77ACD;
  --rmai-orange:   #F26541;   /* CTA only */
  --rmai-green:    #22C55E;   /* status / verified */
  --rmai-bg:       #FAFAFA;
  --rmai-white:    #FFFFFF;
  --rmai-stone:    #EDEBE8;
  --rmai-lavender: #F0EBF4;
  --rmai-fg-1:     #1A1B25;
  --rmai-fg-2:     #555555;
  --rmai-fg-mut:   #8D8D92;
  --rmai-border:   #E8E8EB;

  /* Decisioning semantic states (per brief §11) */
  --state-verified: #22C55E;
  --state-verified-bg: #ECFBF1;
  --state-warning:  #F59E0B;
  --state-warning-bg: #FEF6E7;
  --state-danger:   #EF4444;
  --state-danger-bg: #FDECEC;
  --state-pending:  #8D8D92;

  /* dark header / chrome */
  --chrome:        #1A1B25;
  --chrome-2:      #23242F;
  --chrome-line:   #33343E;
  --chrome-mut:    #9A9AA6;

  --font-sans: 'Epilogue', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;

  --r-sm: 4px; --r-md: 6px; --r-lg: 10px; --r-pill: 999px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--rmai-fg-1);
  background: var(--rmai-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
#root { height: 100vh; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--rmai-fg-mut);
}

/* ---------- App frame ---------- */
.app {
  display: flex; flex-direction: column;
  height: 100vh; min-width: 1080px;
}

/* ---------- Header (dark) ---------- */
.hdr {
  flex: 0 0 auto;
  background: var(--chrome);
  color: #fff;
  display: flex; align-items: center; gap: 22px;
  padding: 0 22px;
  height: 60px;
  border-bottom: 1px solid var(--chrome-line);
}
.hdr .wm { line-height: 1.05; }
.hdr .wm .l1 { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; color: #fff; }
.hdr .wm .l2 { font-size: 16px; font-weight: 500; letter-spacing: -0.02em; color: var(--rmai-purple); }
.hdr .sep { width: 1px; height: 30px; background: var(--chrome-line); }
.hdr .appname {
  display: flex; flex-direction: column; gap: 2px;
}
.hdr .appname .t { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.hdr .appname .s { font-size: 11px; color: var(--chrome-mut); letter-spacing: 0.01em; }
.hdr .spacer { flex: 1; }
.hdr .status {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; color: var(--chrome-mut);
  padding: 6px 12px; border: 1px solid var(--chrome-line); border-radius: var(--r-pill);
}
.hdr .status .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--rmai-green);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.18);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.55} }
.hdr .noledger {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 600; color: #CDB6E6;
  padding: 6px 12px; border: 1px solid #463a57; border-radius: var(--r-pill);
  background: rgba(167,122,205,0.10);
}
.hdr .noledger svg { width: 13px; height: 13px; }

/* ---------- Body: 3 panes ---------- */
.body3 {
  flex: 1 1 auto; min-height: 0;
  display: grid;
  grid-template-columns: 340px 1fr 372px;
}
.pane { min-height: 0; display: flex; flex-direction: column; background: var(--rmai-bg); }
.pane + .pane { border-left: 1px solid var(--rmai-border); }
.pane-hd {
  flex: 0 0 auto;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--rmai-border);
  background: var(--rmai-white);
}
.pane-hd .row { display: flex; align-items: baseline; justify-content: space-between; }
.pane-hd h2 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--rmai-fg-1); }
.pane-hd .sub { font-size: 11px; color: var(--rmai-fg-mut); margin-top: 3px; }
.pane-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }

/* scrollbars */
.pane-body::-webkit-scrollbar { width: 9px; }
.pane-body::-webkit-scrollbar-thumb { background: #DAD7D2; border-radius: 999px; border: 3px solid var(--rmai-bg); }
.pane-body::-webkit-scrollbar-thumb:hover { background: #c8c4bd; }

/* ---------- Queue ---------- */
.queue-meta {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px;
}
.qstat {
  font-size: 11px; font-weight: 600; color: var(--rmai-fg-2);
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--rmai-bg); border: 1px solid var(--rmai-border);
  padding: 3px 9px; border-radius: var(--r-pill);
}
.qstat .n { font-family: var(--font-mono); font-weight: 600; color: var(--rmai-fg-1); }
.qstat .d { width: 7px; height: 7px; border-radius: 50%; }

.qlist { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.qcard {
  position: relative;
  background: var(--rmai-white);
  border: 1px solid var(--rmai-border);
  border-radius: var(--r-lg);
  padding: 12px 13px 12px 15px;
  cursor: pointer;
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease), transform 140ms var(--ease);
}
.qcard:hover { border-color: #d9d4cd; box-shadow: 0 1px 8px rgba(26,27,37,0.06); }
.qcard.sel { border-color: var(--rmai-purple); box-shadow: 0 0 0 1px var(--rmai-purple); }
.qcard.sel::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px;
  background: var(--rmai-purple); border-radius: 999px;
}
.qcard .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qcard .vendor { font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; color: var(--rmai-fg-1); }
.qcard .meta { display: flex; align-items: center; gap: 7px; margin-top: 5px; }
.qcard .inv { font-family: var(--font-mono); font-size: 11px; color: var(--rmai-fg-2); }
.qcard .dot-sep { color: var(--rmai-border); }
.qcard .src {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; color: var(--rmai-fg-mut);
}
.qcard .src svg { width: 11px; height: 11px; }
.qcard .amt-row { display: flex; align-items: baseline; justify-content: space-between; margin-top: 10px; }
.qcard .amt { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--rmai-fg-1); }
.qcard .when { font-size: 10.5px; color: var(--rmai-fg-mut); }

/* status pill */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em;
  padding: 3px 9px 3px 8px; border-radius: var(--r-pill);
  white-space: nowrap;
}
.pill .d { width: 6px; height: 6px; border-radius: 50%; }
.pill--verified { background: var(--state-verified-bg); color: #15803d; }
.pill--verified .d { background: var(--state-verified); }
.pill--discrepancy { background: var(--state-danger-bg); color: #b91c1c; }
.pill--discrepancy .d { background: var(--state-danger); }
.pill--pending { background: var(--rmai-stone); color: var(--rmai-fg-2); }
.pill--pending .d { background: var(--state-pending); }
.pill--review { background: var(--state-warning-bg); color: #b45309; }
.pill--review .d { background: var(--state-warning); }
.pill--cleared { background: var(--rmai-lavender); color: var(--rmai-purple); }
.pill--cleared .d { background: var(--rmai-purple); }
.pill--disputed { background: #FDECEC; color: #b91c1c; }
.pill--disputed .d { background: var(--state-danger); }

/* upload row */
.q-upload {
  margin: 2px 8px 10px; padding: 13px;
  border: 1px dashed #cfcabf; border-radius: var(--r-lg);
  background: var(--rmai-white);
  text-align: center; cursor: pointer;
  transition: border-color 140ms var(--ease), background 140ms var(--ease);
}
.q-upload:hover { border-color: var(--rmai-purple); background: var(--rmai-lavender); }
.q-upload .t { font-size: 12px; font-weight: 600; color: var(--rmai-fg-1); }
.q-upload .s { font-size: 10.5px; color: var(--rmai-fg-mut); margin-top: 2px; }
.q-upload svg { width: 16px; height: 16px; color: var(--rmai-purple); margin-bottom: 5px; }

/* ---------- Analysis pane ---------- */
.an-empty {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: var(--rmai-fg-mut); padding: 40px; gap: 14px;
}
.an-empty .glyph { width: 56px; height: 56px; color: #d8d3cb; }
.an-empty .t { font-size: 15px; font-weight: 600; color: var(--rmai-fg-2); }
.an-empty .s { font-size: 12.5px; max-width: 300px; line-height: 1.5; }

.an-wrap { padding: 18px 20px 28px; }
.an-doc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.an-doc-head .l h3 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.an-doc-head .l .m { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 12px; color: var(--rmai-fg-2); }
.an-doc-head .l .m .mono { font-size: 11.5px; }

/* scanned-paper preview */
.scan {
  position: relative; display: grid; grid-template-columns: 196px 1fr; gap: 16px;
  margin-bottom: 18px;
}
.paper {
  position: relative; background: #fdfcf8; border: 1px solid #e6e1d6;
  border-radius: var(--r-md); padding: 16px 15px; overflow: hidden;
  box-shadow: 0 1px 8px rgba(26,27,37,0.06);
  font-family: var(--font-mono); font-size: 8px; line-height: 1.6; color: #5b554a;
  height: 248px;
  transform: rotate(-0.5deg);
}
.paper.digital { transform: none; background: #fff; font-family: var(--font-sans); color: var(--rmai-fg-2); }
.paper::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 80% 10%, rgba(120,110,90,0.10), transparent 55%),
    radial-gradient(80% 60% at 10% 90%, rgba(120,110,90,0.08), transparent 50%);
  pointer-events: none;
}
.paper.scanned { filter: contrast(1.04) saturate(0.9); }
.paper .ph-h { font-size: 9px; font-weight: 700; color: #3a3528; letter-spacing: 0.04em; }
.paper .ph-sub { font-size: 7px; color: #8a8270; margin-top: 1px; }
.paper .smudge { position: absolute; background: rgba(90,80,60,0.10); border-radius: 50%; filter: blur(3px); }
.paper .scanline { position: absolute; left: 0; right: 0; height: 22px; background: linear-gradient(180deg, transparent, rgba(167,122,205,0.16), transparent); }
.paper .crease { position: absolute; left: 0; right: 0; height: 1px; background: rgba(0,0,0,0.06); }
.paper hr { border: 0; border-top: 1px dashed #cfc8b6; margin: 5px 0; }
.paper .ln { display: flex; justify-content: space-between; gap: 8px; }
.paper .faint { color: #a59c87; }

.scan .side { display: flex; flex-direction: column; gap: 9px; }
.scan .side .lbl { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rmai-fg-mut); }
.docchip {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; background: var(--rmai-white); border: 1px solid var(--rmai-border);
  border-radius: var(--r-md);
}
.docchip svg { width: 15px; height: 15px; color: var(--rmai-purple); flex: 0 0 auto; }
.docchip .dc-t { font-size: 11.5px; font-weight: 600; }
.docchip .dc-s { font-family: var(--font-mono); font-size: 10px; color: var(--rmai-fg-mut); }
.docchip.missing { border-style: dashed; border-color: var(--state-warning); background: var(--state-warning-bg); }
.docchip.missing svg { color: var(--state-warning); }

/* processing shimmer */
.proc {
  display: flex; flex-direction: column; gap: 13px; padding: 8px 2px;
}
.proc .pstat { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--rmai-fg-1); }
.proc .pstat .spin {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--rmai-lavender); border-top-color: var(--rmai-purple);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.proc .pstat .mono { font-size: 11px; color: var(--rmai-fg-mut); font-weight: 400; }
.shimmer-row { height: 34px; border-radius: var(--r-sm); background: linear-gradient(90deg, #efece6 25%, #f7f5f1 50%, #efece6 75%); background-size: 200% 100%; animation: sh 1.3s ease-in-out infinite; }
@keyframes sh { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.proc-steps { display: flex; flex-direction: column; gap: 7px; margin-top: 2px; }
.proc-steps .st { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--rmai-fg-mut); transition: color 200ms var(--ease); }
.proc-steps .st.done { color: var(--rmai-fg-1); }
.proc-steps .st.active { color: var(--rmai-purple); font-weight: 600; }
.proc-steps .st .ic { width: 15px; height: 15px; flex: 0 0 auto; }

/* lines table */
.lines-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 9px; }
.lines-head .t { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--rmai-fg-1); }
.lines-head .legend { display: flex; gap: 12px; font-size: 11px; color: var(--rmai-fg-mut); }
.lines-head .legend i { font-style: normal; display: inline-flex; align-items: center; gap: 5px; }
.lines-head .legend .sw { width: 8px; height: 8px; border-radius: 2px; }

table.lines { width: 100%; border-collapse: collapse; background: var(--rmai-white); border: 1px solid var(--rmai-border); border-radius: var(--r-lg); overflow: hidden; }
table.lines thead th {
  background: #faf9f7; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--rmai-fg-2); text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--rmai-border);
}
table.lines thead th.num { text-align: right; }
table.lines tbody td { padding: 11px 12px; border-bottom: 1px solid var(--rmai-border); font-size: 12.5px; vertical-align: middle; }
table.lines tbody tr:last-child td { border-bottom: none; }
table.lines td.num { font-family: var(--font-mono); text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
table.lines .svc { font-weight: 600; color: var(--rmai-fg-1); }
table.lines .svc .qty { display: block; font-weight: 400; font-size: 10.5px; color: var(--rmai-fg-mut); margin-top: 2px; font-family: var(--font-mono); }
table.lines td.ref { color: var(--rmai-fg-2); }
.delta { font-weight: 600; }
.delta.zero { color: var(--rmai-green); }
.delta.pos { color: var(--state-danger); }
tr.exc { background: var(--state-danger-bg) !important; }
tr.exc td { border-bottom-color: #f6d6d6; }
tr.exc.flash { animation: flashred 0.9s var(--ease) 1; }
@keyframes flashred { 0%{ background:#fff } 35%{ background:#fbd5d5 } 100%{ background:var(--state-danger-bg) } }
tr.exc .svc { color: #b91c1c; }
.ev-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: var(--rmai-purple);
  cursor: pointer; border: none; background: none; padding: 2px 0;
  border-bottom: 1px solid transparent;
}
.ev-link:hover { color: var(--rmai-fg-1); border-bottom-color: var(--rmai-fg-1); }
.ev-link svg { width: 12px; height: 12px; }
.ev-dash { color: var(--rmai-fg-mut); font-size: 12px; }
.verdict-ic { display: inline-flex; }
.verdict-ic svg { width: 16px; height: 16px; }
.verdict-ic.ok { color: var(--rmai-green); }
.verdict-ic.bad { color: var(--state-danger); }

/* table foot */
table.lines tfoot td { padding: 11px 12px; font-size: 12px; border-top: 1px solid var(--rmai-border); background: #faf9f7; }
table.lines tfoot .lab { font-weight: 600; color: var(--rmai-fg-2); }
table.lines tfoot .num { font-family: var(--font-mono); text-align: right; font-weight: 600; }

/* ---------- Resolution pane ---------- */
.res-empty { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--rmai-fg-mut); font-size: 12.5px; text-align: center; padding: 40px; }
.res-wrap { padding: 16px 18px 26px; display: flex; flex-direction: column; gap: 16px; }

.totals { background: var(--rmai-white); border: 1px solid var(--rmai-border); border-radius: var(--r-lg); overflow: hidden; }
.totals .trow { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 16px; }
.totals .trow + .trow { border-top: 1px solid var(--rmai-border); }
.totals .trow .lab { font-size: 12px; color: var(--rmai-fg-2); font-weight: 500; }
.totals .trow .val { font-family: var(--font-mono); font-size: 14px; font-weight: 500; color: var(--rmai-fg-1); }
.totals .trow.exception { background: var(--state-danger-bg); }
.totals .trow.exception .lab { color: #b91c1c; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.totals .trow.exception .val { color: var(--state-danger); font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.totals .trow.verified-tot { background: var(--state-verified-bg); }
.totals .trow.verified-tot .lab { color: #15803d; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 12px; }
.totals .trow.verified-tot .val { color: #15803d; font-size: 20px; font-weight: 600; }

.section-lbl { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rmai-fg-mut); margin-bottom: 9px; display: flex; align-items: center; gap: 7px; }
.section-lbl .cnt { font-family: var(--font-mono); background: var(--state-danger-bg); color: #b91c1c; font-size: 10px; padding: 1px 7px; border-radius: 999px; }

.why { display: flex; flex-direction: column; gap: 8px; }
.why .item {
  background: var(--rmai-white); border: 1px solid var(--rmai-border);
  border-left: 3px solid var(--state-danger); border-radius: var(--r-md);
  padding: 11px 13px;
}
.why .item .h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.why .item .h .name { font-size: 12.5px; font-weight: 600; color: var(--rmai-fg-1); }
.why .item .h .amt { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--state-danger); }
.why .item .desc { font-size: 11.5px; line-height: 1.5; color: var(--rmai-fg-2); margin-top: 5px; }
.why .item .ev {
  margin-top: 8px; display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 600; color: var(--rmai-purple); cursor: pointer;
}
.why .item .ev:hover { color: var(--rmai-fg-1); }
.why .item .ev svg { width: 11px; height: 11px; }

/* draft dispute note */
.draft {
  background: var(--chrome); border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--chrome-line);
}
.draft .dh { display: flex; align-items: center; justify-content: space-between; padding: 9px 13px; border-bottom: 1px solid var(--chrome-line); }
.draft .dh .t { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 600; color: #fff; letter-spacing: 0.02em; }
.draft .dh .t svg { width: 13px; height: 13px; color: var(--rmai-purple); }
.draft .dh .copy { font-size: 10px; color: var(--chrome-mut); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; background: none; border: none; }
.draft .dh .copy:hover { color: #fff; }
.draft .dh .copy svg { width: 11px; height: 11px; }
.draft .dbody {
  padding: 12px 14px; font-family: var(--font-mono); font-size: 11px; line-height: 1.65; color: #d7d6de;
  white-space: pre-wrap; min-height: 90px;
}
.draft .dbody .cur { display: inline-block; width: 7px; height: 13px; background: var(--rmai-purple); vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.draft .dbody .hl { color: #fff; font-weight: 500; }

/* actions */
.actions { display: flex; flex-direction: column; gap: 9px; }
.actions .label { font-size: 11px; color: var(--rmai-fg-mut); display: flex; align-items: center; gap: 6px; }
.actions .label svg { width: 13px; height: 13px; }
.act-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn {
  font-family: var(--font-sans); font-weight: 600; font-size: 13px;
  padding: 11px 14px; border-radius: var(--r-md); border: 1px solid transparent;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: background 140ms var(--ease), border-color 140ms var(--ease), transform 80ms var(--ease);
}
.btn svg { width: 15px; height: 15px; }
.btn:active { transform: translateY(1px); }
.btn--clear { background: var(--rmai-fg-1); color: #fff; grid-column: 1 / -1; }
.btn--clear:hover { background: #33343E; }
.btn--dispute { background: var(--rmai-orange); color: #fff; }
.btn--dispute:hover { background: #DA5939; }
.btn--flag { background: var(--rmai-white); color: var(--rmai-fg-1); border-color: var(--rmai-border); }
.btn--flag:hover { background: var(--rmai-bg); border-color: var(--state-warning); color: #b45309; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn--ghost { background: none; color: var(--rmai-fg-2); border-color: var(--rmai-border); }
.btn--ghost:hover { background: var(--rmai-bg); border-color: var(--rmai-fg-mut); }

.res-foot {
  font-size: 10.5px; color: var(--rmai-fg-mut); line-height: 1.5;
  display: flex; gap: 7px; padding: 2px 2px 0;
}
.res-foot svg { width: 13px; height: 13px; flex: 0 0 auto; color: var(--rmai-purple); margin-top: 1px; }

/* resolved banner */
.resolved-banner {
  display: flex; align-items: center; gap: 11px; padding: 13px 15px;
  border-radius: var(--r-lg); font-size: 13px; font-weight: 600;
}
.resolved-banner svg { width: 19px; height: 19px; flex: 0 0 auto; }
.resolved-banner.cleared { background: var(--rmai-lavender); color: var(--rmai-purple); }
.resolved-banner.disputed { background: var(--state-danger-bg); color: #b91c1c; }
.resolved-banner.flagged { background: var(--state-warning-bg); color: #b45309; }
.resolved-banner .sub { display: block; font-weight: 400; font-size: 11px; color: var(--rmai-fg-2); margin-top: 2px; }

/* clean-match callout */
.clean {
  background: var(--state-verified-bg); border: 1px solid #bdecCB; border-radius: var(--r-lg);
  padding: 16px; display: flex; gap: 12px; align-items: flex-start;
}
.clean svg { width: 22px; height: 22px; color: var(--rmai-green); flex: 0 0 auto; }
.clean .t { font-size: 14px; font-weight: 700; color: #15803d; }
.clean .s { font-size: 12px; color: #166534; line-height: 1.5; margin-top: 3px; }

/* missing-doc callout */
.missing-doc {
  background: var(--state-warning-bg); border: 1px solid #f6dca0; border-radius: var(--r-lg);
  padding: 15px; display: flex; gap: 12px; align-items: flex-start;
}
.missing-doc svg { width: 20px; height: 20px; color: var(--state-warning); flex: 0 0 auto; }
.missing-doc .t { font-size: 13.5px; font-weight: 700; color: #b45309; }
.missing-doc .s { font-size: 11.5px; color: #92400e; line-height: 1.5; margin-top: 3px; }

/* ---------- Evidence slide-over ---------- */
.scrim {
  position: fixed; inset: 0; background: rgba(26,27,37,0.32);
  opacity: 0; pointer-events: none; transition: opacity 200ms var(--ease); z-index: 40;
}
.scrim.open { opacity: 1; pointer-events: auto; }
.slideover {
  position: fixed; top: 0; right: 0; height: 100vh; width: 720px; max-width: 92vw;
  background: var(--rmai-bg); z-index: 50;
  transform: translateX(100%); transition: transform 240ms var(--ease);
  display: flex; flex-direction: column; box-shadow: -2px 0 24px rgba(26,27,37,0.12);
}
.slideover.open { transform: translateX(0); }
.so-hd {
  flex: 0 0 auto; background: var(--chrome); color: #fff;
  padding: 16px 20px; display: flex; align-items: center; justify-content: space-between;
}
.so-hd .l .e { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--rmai-purple); }
.so-hd .l h3 { margin: 4px 0 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.so-hd .x { background: none; border: 1px solid var(--chrome-line); color: #fff; width: 32px; height: 32px; border-radius: var(--r-md); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.so-hd .x:hover { background: var(--chrome-2); }
.so-hd .x svg { width: 16px; height: 16px; }
.so-body { flex: 1 1 auto; overflow-y: auto; padding: 20px; }
.so-body::-webkit-scrollbar { width: 10px; }
.so-body::-webkit-scrollbar-thumb { background: #DAD7D2; border-radius: 999px; border: 3px solid var(--rmai-bg); }

.so-summary {
  background: var(--state-danger-bg); border: 1px solid #f6d6d6; border-radius: var(--r-lg);
  padding: 14px 16px; margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.so-summary .txt { font-size: 13px; color: #7f1d1d; line-height: 1.5; }
.so-summary .txt b { color: #b91c1c; }
.so-summary .big { font-family: var(--font-mono); font-size: 26px; font-weight: 600; color: var(--state-danger); white-space: nowrap; }

.ev-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.ev-col { background: var(--rmai-white); border: 1px solid var(--rmai-border); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; }
.ev-col .ech { padding: 10px 13px; border-bottom: 1px solid var(--rmai-border); background: #faf9f7; }
.ev-col .ech .k { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rmai-purple); }
.ev-col .ech .src { font-family: var(--font-mono); font-size: 10.5px; color: var(--rmai-fg-mut); margin-top: 3px; }
.ev-col .ebody { padding: 13px; font-size: 12px; line-height: 1.55; color: var(--rmai-fg-2); flex: 1; }
.ev-col .ebody .clause { font-family: var(--font-mono); font-size: 11px; background: var(--rmai-bg); border: 1px solid var(--rmai-border); border-radius: var(--r-sm); padding: 9px 10px; color: var(--rmai-fg-1); margin: 4px 0 9px; line-height: 1.6; }
.ev-col .ebody .hit { background: #fff2c8; padding: 0 3px; border-radius: 2px; font-weight: 600; color: #1A1B25; }
.ev-col .ebody .ok { color: var(--rmai-green); font-weight: 600; }
.ev-col .ebody .kv { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--rmai-border); }
.ev-col .ebody .kv:last-child { border-bottom: none; }
.ev-col .ebody .kv .vk { color: var(--rmai-fg-mut); }
.ev-col .ebody .kv .vv { font-family: var(--font-mono); color: var(--rmai-fg-1); }
.ev-reasoning { margin-top: 18px; background: var(--rmai-lavender); border-radius: var(--r-lg); padding: 15px 17px; }
.ev-reasoning .h { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rmai-purple); margin-bottom: 7px; display: flex; align-items: center; gap: 7px; }
.ev-reasoning .h svg { width: 14px; height: 14px; }
.ev-reasoning p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--rmai-fg-1); }
.ev-reasoning p .mono { font-size: 12px; color: var(--rmai-purple); }

/* ---------- Toast ---------- */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 9px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 11px;
  background: var(--chrome); color: #fff; padding: 12px 17px; border-radius: var(--r-lg);
  box-shadow: 0 6px 28px rgba(26,27,37,0.22); font-size: 13px; font-weight: 500;
  animation: toastin 240ms var(--ease);
  min-width: 280px;
}
@keyframes toastin { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.toast.out { animation: toastout 240ms var(--ease) forwards; }
@keyframes toastout { to { opacity: 0; transform: translateY(12px); } }
.toast .ic { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.toast .ic svg { width: 16px; height: 16px; }
.toast .ic.cleared { background: rgba(167,122,205,0.18); color: var(--rmai-purple); }
.toast .ic.disputed { background: rgba(242,101,65,0.18); color: var(--rmai-orange); }
.toast .ic.flagged { background: rgba(245,158,11,0.18); color: var(--state-warning); }
.toast .ic.ok { background: rgba(34,197,94,0.18); color: var(--rmai-green); }
.toast .tx .t { font-weight: 600; }
.toast .tx .s { font-size: 11px; color: var(--chrome-mut); margin-top: 1px; }
.toast .led { margin-left: 6px; font-size: 10px; font-family: var(--font-mono); color: #CDB6E6; border-left: 1px solid var(--chrome-line); padding-left: 11px; }

/* upload modal */
.modal-scrim { position: fixed; inset: 0; background: rgba(26,27,37,0.40); z-index: 70; display: flex; align-items: center; justify-content: center; padding: 30px; opacity: 0; pointer-events: none; transition: opacity 180ms var(--ease); }
.modal-scrim.open { opacity: 1; pointer-events: auto; }
.modal { background: var(--rmai-white); border-radius: var(--r-lg); width: 560px; max-width: 100%; box-shadow: 0 12px 48px rgba(26,27,37,0.24); overflow: hidden; transform: translateY(8px); transition: transform 180ms var(--ease); }
.modal-scrim.open .modal { transform: translateY(0); }
.modal .mh { padding: 18px 20px 14px; border-bottom: 1px solid var(--rmai-border); }
.modal .mh h3 { margin: 0; font-size: 16px; font-weight: 700; }
.modal .mh p { margin: 5px 0 0; font-size: 12px; color: var(--rmai-fg-mut); line-height: 1.5; }
.modal .mb { padding: 16px 20px; }
.modal .mb textarea { width: 100%; min-height: 168px; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.6; padding: 12px; border: 1px solid var(--rmai-border); border-radius: var(--r-md); resize: vertical; color: var(--rmai-fg-1); }
.modal .mb textarea:focus { outline: none; border-color: var(--rmai-purple); box-shadow: 0 0 0 2px rgba(167,122,205,0.2); }
.modal .mb .ex { margin-top: 8px; font-size: 11px; color: var(--rmai-fg-mut); }
.modal .mb .ex button { background: none; border: none; color: var(--rmai-purple); cursor: pointer; font-size: 11px; font-weight: 600; padding: 0; text-decoration: underline; }
.modal .mf { padding: 14px 20px 18px; display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--rmai-border); }

.fade-in { animation: fadeIn 280ms var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
