/* TrustLC — light theme, product prototype */
:root {
  --bg: #f2f5f9;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: #e6eaf1;
  --line-2: #eff3f8;
  --blue: #1d4ed8;
  --blue-ink: #163ca8;
  --blue-soft: #eef3ff;
  --teal: #0f766e;
  --teal-soft: #e9f7f3;
  --amber: #b45309;
  --amber-soft: #fff4e5;
  --red: #b42318;
  --red-soft: #fef3f2;
  --green: #067647;
  --green-soft: #ecfdf3;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px -24px rgba(16, 24, 40, .28);
  --font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 500px at 83% -12%, rgba(29, 78, 216, .075), transparent 62%),
    radial-gradient(900px 620px at -3% 2%, rgba(15, 118, 110, .055), transparent 58%);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
svg { display: block; }

.app {
  max-width: 1540px;
  margin: 0 auto;
  padding: 20px 26px 26px;
}

/* ---------- top bar ---------- */
.topbar {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  color: #fff;
  border-radius: 12px;
  background: linear-gradient(145deg, #12275f 0%, #1d4ed8 62%, #2f7cff 100%);
  box-shadow: 0 8px 18px -10px rgba(29, 78, 216, .8);
}
.brand-mark svg { width: 26px; height: 26px; }
.brand-name {
  font-size: 17px; font-weight: 760; letter-spacing: -.02em;
  display: flex; align-items: center; gap: 7px;
}
.brand-beta {
  font-size: 9px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--blue); background: var(--blue-soft);
  border: 1px solid #d7e2ff; border-radius: 5px; padding: 2px 5px;
}
.brand-sub { color: var(--muted); font-size: 11.5px; margin-top: 2px; letter-spacing: .01em; }
.topbar-right { display: flex; align-items: center; gap: 9px; }
.fx-chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255,255,255,.7);
  font-size: 11.5px; color: var(--ink-2);
  backdrop-filter: blur(4px);
}
.fx-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 620; line-height: 1;
  white-space: nowrap;
}
.pill-line { border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-weight: 600; }
.icon-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--muted);
  transition: .16s ease;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { color: var(--ink); border-color: #cfd7e4; background: #fbfcff; }
.icon-btn.soft { padding: 0; background: transparent; border-color: transparent; }
.icon-btn.soft:hover { background: var(--panel-soft); }

/* ---------- layout ---------- */
.workbench {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr) 358px;
  gap: 18px;
  align-items: start;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
}
.panel-head h2 { font-size: 16px; letter-spacing: -.025em; font-weight: 720; }
.panel-head h3 { font-size: 13.5px; font-weight: 700; letter-spacing: -.012em; }
.panel-head.compact { align-items: center; }
.eyebrow {
  font-size: 9.5px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted-2); margin-bottom: 5px;
}
.count {
  font-size: 10px; font-weight: 700; color: var(--muted);
  background: var(--panel-soft); border: 1px solid var(--line-2);
  padding: 2px 6px; border-radius: 5px; vertical-align: 2px;
  margin-left: 5px;
}
.tag {
  font-size: 10px; font-weight: 650; color: var(--muted);
  background: var(--panel-soft); border: 1px solid var(--line-2);
  border-radius: 5px; padding: 3px 7px;
}

/* ---------- queue ---------- */
.queue-panel {
  height: calc(100vh - 120px);
  min-height: 560px;
  position: sticky; top: 16px;
  padding: 17px 13px 12px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.queue-panel .panel-head { padding: 0 5px; }
.search-row {
  position: relative;
  margin: 13px 4px 10px;
}
.search-row svg { position: absolute; left: 10px; top: 9px; width: 15px; height: 15px; color: var(--muted-2); }
.search-row input {
  width: 100%; height: 34px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel-soft);
  padding: 0 10px 0 31px;
  color: var(--ink); font-size: 12px;
  outline: none; transition: .16s;
}
.search-row input::placeholder { color: var(--muted-2); }
.search-row input:focus { border-color: #b9c9f5; background: #fff; box-shadow: 0 0 0 3px rgba(29, 78, 216, .08); }
.filters {
  display: flex; gap: 4px; overflow-x: auto; padding: 0 3px 8px;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filter {
  border: 1px solid transparent; background: transparent; color: var(--muted);
  font-size: 10.5px; font-weight: 620; padding: 4px 7px; border-radius: 6px;
  white-space: nowrap; transition: .15s;
}
.filter:hover { color: var(--ink); background: var(--panel-soft); }
.filter.active { color: var(--blue-ink); background: var(--blue-soft); border-color: #dbe7ff; }
.case-list {
  flex: 1; overflow-y: auto; padding: 1px 3px 6px;
  scrollbar-width: thin; scrollbar-color: #d5dde8 transparent;
}
.case-list::-webkit-scrollbar { width: 4px; }
.case-list::-webkit-scrollbar-thumb { background: #d5dde8; border-radius: 4px; }
.case-item {
  width: 100%; display: block; text-align: left;
  padding: 10px 10px 9px; margin-bottom: 2px;
  border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--ink);
  transition: background .14s, border-color .14s, transform .14s;
}
.case-item:hover { background: #f8fafc; }
.case-item.active { background: #f5f8ff; border-color: #dbe7ff; }
.case-item.active .case-name { color: var(--blue-ink); }
.case-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.case-name {
  font-size: 13px; font-weight: 650; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.case-score {
  flex: 0 0 auto; min-width: 25px; text-align: center;
  font-size: 9.5px; font-weight: 750;
  padding: 2.5px 5px; border-radius: 5px;
  color: var(--muted); background: var(--panel-soft);
}
.case-score.good { color: var(--green); background: var(--green-soft); }
.case-score.mid { color: var(--amber); background: var(--amber-soft); }
.case-score.bad { color: var(--red); background: var(--red-soft); }
.case-meta {
  display: flex; align-items: center; gap: 5px;
  font-size: 10.5px; color: var(--muted);
  margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.case-meta .dot { width: 2px; height: 2px; border-radius: 50%; background: var(--muted-2); flex: 0 0 auto; }
.case-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 6px;
}
.case-reason {
  font-size: 10px; color: var(--muted-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.case-amount {
  font-size: 11px; font-weight: 650; color: var(--ink-2);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.queue-foot {
  padding: 11px 6px 2px; border-top: 1px solid var(--line-2);
  margin-top: 4px;
}
.dataset-stat {
  display: flex; align-items: center; gap: 6px;
  font-size: 10.5px; color: var(--muted);
}
.dataset-stat b { color: var(--ink-2); font-weight: 650; }
.dataset-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .09);
}
.tiny-note { font-size: 9.5px; color: var(--muted-2); line-height: 1.4; margin-top: 5px; }

/* ---------- case hero ---------- */
.center-column { min-width: 0; }
.case-hero {
  position: relative; overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 22px 17px;
  box-shadow: var(--shadow);
  min-height: 176px;
}
.case-hero::before {
  content: ""; position: absolute; right: -40px; top: -70px;
  width: 290px; height: 290px; pointer-events: none;
  background: radial-gradient(circle, rgba(29, 78, 216, .105), transparent 68%);
}
.case-hero::after {
  content: ""; position: absolute; left: 42%; bottom: -105px;
  width: 300px; height: 180px; pointer-events: none;
  background: radial-gradient(ellipse, rgba(15, 118, 110, .07), transparent 70%);
}
.hero-kicker { display: flex; align-items: center; gap: 8px; position: relative; z-index: 1; }
.scenario-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 650; letter-spacing: .02em;
  color: var(--blue-ink); background: var(--blue-soft);
  border: 1px solid #dbe7ff; border-radius: 999px; padding: 3px 8px;
}
.case-id {
  font-family: var(--mono); font-size: 10px; color: var(--muted-2); letter-spacing: .02em;
}
.hero-title {
  display: flex; align-items: baseline; gap: 13px; flex-wrap: wrap;
  font-size: 22px; letter-spacing: -.035em; font-weight: 770;
  margin: 10px 0 0; position: relative; z-index: 1;
}
.hero-amount {
  font-size: 17px; color: var(--blue); font-weight: 720;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.hero-amount small { font-size: 10px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: 5px; }
.hero-sub {
  margin-top: 5px; color: var(--muted); font-size: 12px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  position: relative; z-index: 1;
}
.hero-sub .sep { color: var(--line-2); }
.hero-facts {
  display: flex; align-items: center; gap: 0; flex-wrap: wrap;
  margin-top: 17px; position: relative; z-index: 1;
}
.hero-fact {
  min-width: 0; padding-right: 18px; margin-right: 18px;
  border-right: 1px solid var(--line-2);
}
.hero-fact:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.hero-fact dt { font-size: 9px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); margin-bottom: 3px; }
.hero-fact dd { margin: 0; font-size: 11.8px; font-weight: 620; color: var(--ink-2); }
.hero-flag { display: inline-flex; align-items: center; gap: 5px; }
.flag {
  width: 15px; height: 10px; border-radius: 2px;
  border: 1px solid rgba(16, 24, 40, .12); background: #e7edf5;
  display: inline-block;
}
.hero-skeleton { color: var(--muted); font-size: 13px; padding: 60px 0; text-align: center; }

/* ---------- runbar ---------- */
.runbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 12px 2px;
}
.runbar-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 14px;
  border-radius: 9px; border: 1px solid transparent;
  font-size: 12px; font-weight: 650; letter-spacing: -.005em;
  transition: .16s ease; white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary {
  background: linear-gradient(180deg, #2c5ae9, #1d4ed8);
  color: #fff; border-color: #1e4bd2;
  box-shadow: 0 6px 14px -8px rgba(29, 78, 216, .75), inset 0 1px 0 rgba(255,255,255,.15);
}
.btn-primary:hover { filter: brightness(1.035); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .6; cursor: wait; transform: none; }
.btn-ghost {
  background: var(--panel); border-color: var(--line); color: var(--ink-2);
}
.btn-ghost:hover { border-color: #cfd8e6; background: #fbfcff; }
.btn-ghost:disabled { opacity: .6; cursor: wait; }
.btn-soft {
  background: var(--blue-soft); border-color: #d8e3ff; color: var(--blue-ink);
}
.btn-soft:hover { background: #e5edff; }
.run-status { font-size: 10.5px; color: var(--muted); padding-left: 4px; }
.status-idle { display: inline-flex; align-items: center; gap: 6px; }
.status-idle::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent, var(--teal));
}
.run-meta { font-size: 10px; color: var(--muted-2); text-align: right; }
.run-meta b { color: var(--muted); font-weight: 650; }
.dot-count {
  display: inline-grid; place-items: center;
  min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 4px; background: var(--blue-soft); color: var(--blue-ink);
  font-size: 8.5px; font-weight: 750; margin-left: 1px;
}

/* ---------- chat ---------- */
.chat-panel { overflow: hidden; display: flex; flex-direction: column; }
.chat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 15px 20px 12px; border-bottom: 1px solid var(--line-2);
}
.chat-title { display: flex; align-items: center; gap: 8px; }
.chat-title h2 { font-size: 13.5px; letter-spacing: -.02em; font-weight: 720; }
.live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
}
.chat-badge {
  font-size: 9px; font-weight: 650; color: var(--muted);
  background: var(--panel-soft); border: 1px solid var(--line-2);
  border-radius: 4px; padding: 2px 5px;
}
.agents { display: flex; align-items: center; gap: 7px; }
.agent-chip { display: flex; align-items: center; gap: 6px; }
.agent-avatar {
  width: 24px; height: 24px; border-radius: 7px;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 750;
}
.agent-avatar.client { background: var(--teal-soft); color: var(--teal); }
.agent-avatar.bank { background: var(--blue-soft); color: var(--blue); }
.agent-chip b { display: block; font-size: 9.5px; font-weight: 700; color: var(--ink-2); line-height: 1.1; }
.agent-chip small { display: block; font-size: 8px; color: var(--muted-2); margin-top: 2px; }
.agent-swap { color: var(--muted-2); }
.agent-swap svg { width: 15px; height: 15px; }

.chat { flex: 1; padding: 18px 20px 6px; overflow-y: auto; min-height: 480px; max-height: 610px; scroll-behavior: smooth; }
.chat::-webkit-scrollbar { width: 5px; }
.chat::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; }
.chat-empty {
  min-height: 390px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; padding: 25px 20px;
}
.chat-art { position: relative; width: 178px; height: 54px; margin-bottom: 15px; }
.orb {
  position: absolute; top: 6px; width: 42px; height: 42px;
  display: grid; place-items: center; border-radius: 14px;
  font-size: 15px; font-weight: 750;
}
.orb-a { left: 0; background: var(--teal-soft); color: var(--teal); box-shadow: 0 0 0 5px rgba(15, 118, 110, .06); }
.orb-b { right: 0; background: var(--blue-soft); color: var(--blue); box-shadow: 0 0 0 5px rgba(29, 78, 216, .06); }
.orb-path {
  position: absolute; left: 48px; right: 48px; top: 26px;
  display: flex; align-items: center; justify-content: space-between;
}
.orb-path::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  border-top: 1px dashed #c8d3e6;
}
.orb-path i {
  position: relative; width: 5px; height: 5px; border-radius: 50%;
  background: #9db6df;
}
.orb-path i:nth-child(2) { background: var(--blue); }
.chat-empty h3 { font-size: 14px; font-weight: 720; letter-spacing: -.02em; }
.chat-empty p {
  max-width: 330px; font-size: 11.5px; line-height: 1.65; color: var(--muted);
  margin: 7px 0 15px;
}
.chat-empty .btn { height: 32px; font-size: 11px; }

.turn {
  display: grid; grid-template-columns: 31px minmax(0, 1fr); gap: 10px;
  margin-bottom: 18px;
  opacity: 0; transform: translateY(7px);
  animation: turn-in .34s cubic-bezier(.22,.8,.3,1) forwards;
}
@keyframes turn-in { to { opacity: 1; transform: translateY(0); } }
.turn-avatar {
  width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center;
  font-size: 11px; font-weight: 750; flex: 0 0 auto;
}
.turn.agent-client .turn-avatar { background: var(--teal-soft); color: var(--teal); }
.turn.agent-bank .turn-avatar { background: var(--blue-soft); color: var(--blue); }
.turn-head { display: flex; align-items: baseline; gap: 7px; min-height: 17px; flex-wrap: wrap; }
.turn-name { font-size: 11px; font-weight: 750; }
.turn-name.client { color: var(--teal); }
.turn-name.bank { color: var(--blue); }
.turn-role { font-size: 9px; color: var(--muted-2); }
.turn-phase {
  font-size: 8.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); background: var(--panel-soft); border: 1px solid var(--line-2);
  border-radius: 4px; padding: 2px 5px;
}
.turn-time { margin-left: auto; font-family: var(--mono); font-size: 8.5px; color: var(--muted-2); }
.turn-body {
  margin-top: 5px; border: 1px solid var(--line-2); border-radius: 12px;
  background: #fbfcfe; padding: 12px 14px;
}
.turn.agent-bank .turn-body { background: #fafcff; border-color: #e4ecfb; }
.msg-title { font-size: 12px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 6px; }
.msg-text p { font-size: 12.5px; line-height: 1.63; color: var(--ink-2); margin: 0 0 7px; }
.msg-text p:last-child { margin-bottom: 0; }
.msg-text b { color: var(--ink); font-weight: 650; }
.msg-evidence { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.evidence {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line-2); border-radius: 6px;
  background: #fff; padding: 4px 7px;
  font-size: 9.5px; color: var(--ink-2);
}
.evidence .ev-label { color: var(--muted-2); }
.evidence .ev-value { font-weight: 650; }
.evidence.ok { border-color: #d5f0e4; background: #fbfefc; }
.evidence.ok .ev-dot { background: var(--green); }
.evidence.warn { border-color: #fbe3c8; background: #fffcf8; }
.evidence.warn .ev-dot { background: var(--amber); }
.evidence.fail { border-color: #f9d8d6; background: #fff8f7; }
.evidence.fail .ev-dot { background: var(--red); }
.evidence.neutral .ev-dot { background: var(--muted-2); }
.ev-dot { width: 5px; height: 5px; border-radius: 50%; }
.msg-cites { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 9px; }
.msg-cites span { font-size: 8.5px; color: var(--muted-2); }
.msg-cites .cite {
  font-size: 8.5px; color: var(--muted);
  background: var(--panel-soft); border-radius: 4px; padding: 2px 5px;
}
.typing {
  display: flex; align-items: center; gap: 7px; padding: 4px 0 9px;
  font-size: 10px; color: var(--muted-2);
}
.typing .dots { display: inline-flex; gap: 3px; }
.typing .dots i {
  width: 4px; height: 4px; border-radius: 50%; background: #9fb0c3;
  animation: typing 1s infinite ease-in-out;
}
.typing .dots i:nth-child(2) { animation-delay: .14s; }
.typing .dots i:nth-child(3) { animation-delay: .28s; }
@keyframes typing { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }
.chat-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-top: 1px solid var(--line-2); padding: 10px 20px 10px;
}
.foot-note { display: inline-flex; align-items: center; gap: 6px; font-size: 9.5px; color: var(--muted-2); }
.dot-live { width: 5px; height: 5px; border-radius: 50%; background: var(--teal); }
.text-link { font-size: 10px; font-weight: 600; color: var(--blue); text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.text-link.disabled { color: var(--muted-2); pointer-events: none; }

/* ---------- right column ---------- */
.right-column { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.score-panel { padding: 16px 17px 13px; }
.score-panel .panel-head h2 { font-size: 14px; }
.score-panel .score { font-family: var(--mono); font-size: 18px; color: var(--blue); margin-left: 3px; }
.verdict-pill { font-size: 10px; font-weight: 680; }
.verdict-pill.approve { color: var(--green); background: var(--green-soft); }
.verdict-pill.approve_with_conditions { color: var(--amber); background: var(--amber-soft); }
.verdict-pill.manual_review { color: var(--blue-ink); background: var(--blue-soft); }
.verdict-pill.decline { color: var(--red); background: var(--red-soft); }
.score-main { display: flex; align-items: center; gap: 12px; margin-top: 13px; }
.score-ring { position: relative; width: 112px; height: 112px; flex: 0 0 auto; }
.score-ring svg { width: 112px; height: 112px; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: #edf1f6; stroke-width: 8; }
.ring-value {
  fill: none; stroke: var(--blue); stroke-width: 8; stroke-linecap: round;
  stroke-dasharray: 314.16; stroke-dashoffset: 314.16;
  transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1), stroke .3s;
}
.score-ring {
  --ring: var(--blue);
}
.score-text {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.score-text b { font-size: 28px; line-height: 1; letter-spacing: -.06em; font-weight: 760; color: var(--ink); }
.score-text span { font-size: 8.5px; color: var(--muted-2); margin-top: 4px; letter-spacing: .02em; }
.score-side { min-width: 0; }
.grade-line { display: flex; align-items: baseline; gap: 6px; }
.grade { font-family: var(--mono); font-size: 16px; font-weight: 700; color: var(--muted); }
.grade-label { font-size: 9.5px; color: var(--muted); }
.score-side p { margin: 4px 0 0; font-size: 10.8px; line-height: 1.5; color: var(--ink-2); }
.delta-line { margin-top: 6px; font-size: 9px; color: var(--muted-2); display: flex; gap: 4px; flex-wrap: wrap; }
.delta-line b { color: var(--green); font-weight: 650; }
.delta-line .down { color: var(--red); font-weight: 650; }

.dimensions { margin-top: 13px; border-top: 1px solid var(--line-2); padding-top: 4px; }
.dim { padding: 7px 0; border-bottom: 1px solid var(--line-2); }
.dim:last-child { border-bottom: 0; }
.dim-head { display: flex; align-items: center; gap: 7px; font-size: 10px; }
.dim-label { flex: 1; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.dim-weight { color: var(--muted-2); font-size: 8.5px; }
.dim-score { font-family: var(--mono); font-size: 10px; font-weight: 650; color: var(--ink-2); min-width: 21px; text-align: right; }
.dim-bar { height: 3px; background: var(--line-2); border-radius: 3px; margin-top: 5px; overflow: hidden; }
.dim-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--teal); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.dim.score.warn .dim-bar i { background: var(--amber); }
.dim.score.risk .dim-bar i { background: var(--red); }
.dim-signals { margin-top: 5px; display: none; }
.dim.open .dim-signals { display: block; }
.dim-signal { display: flex; gap: 5px; font-size: 9px; line-height: 1.4; color: var(--muted); padding: 2px 0; }
.dim-signal .sig-dot { width: 4px; height: 4px; border-radius: 50%; margin-top: 4px; flex: 0 0 auto; background: var(--muted-2); }
.dim-signal.ok .sig-dot { background: var(--green); }
.dim-signal.warn .sig-dot { background: var(--amber); }
.dim-signal.risk .sig-dot { background: var(--red); }
.dim { cursor: pointer; }
.dim:hover .dim-label { color: var(--blue); }
.dim-chev { font-size: 8px; color: var(--muted-2); }
.howto {
  margin-top: 10px; width: 100%; border: 1px dashed var(--line); background: transparent;
  border-radius: 8px; padding: 7px 8px;
  font-size: 9.5px; color: var(--muted); display: flex; align-items: center; justify-content: space-between;
}
.howto:hover { color: var(--blue); border-color: #c9d6f4; background: #fbfcff; }

/* conditions-panel */
.conditions-panel { padding: 14px 16px 12px; }
.conditions-list { margin-top: 8px; }
.cond-item {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 10.5px; line-height: 1.45; color: var(--ink-2);
  padding: 7px 0; border-bottom: 1px solid var(--line-2);
}
.cond-item:last-child { border-bottom: 0; }
.cond-icon { width: 13px; height: 13px; border-radius: 4px; flex: 0 0 auto; display: grid; place-items: center; margin-top: 1px; font-size: 8px; font-weight: 800; }
.cond-icon.cond { color: var(--amber); background: var(--amber-soft); }
.cond-icon.block { color: var(--red); background: var(--red-soft); }
.cond-icon.manual { color: var(--blue-ink); background: var(--blue-soft); }
.cond-empty { color: var(--muted-2); font-size: 10px; padding: 6px 0; }
.cond-kind { font-size: 8px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .07em; margin-left: 4px; }

/* sources */
.sources-panel { padding: 14px 16px 9px; }
.source-list { margin-top: 9px; max-height: 332px; overflow-y: auto; padding-right: 1px; }
.source-list::-webkit-scrollbar { width: 3px; }
.source-list::-webkit-scrollbar-thumb { background: #d9e1eb; }
.source-row {
  display: grid; grid-template-columns: 6px minmax(0, 1fr) auto;
  gap: 7px; align-items: start;
  padding: 6px 0; border-bottom: 1px solid var(--line-2);
}
.source-row:last-child { border-bottom: 0; }
.source-status { width: 5px; height: 5px; border-radius: 50%; margin-top: 3px; }
.source-status.ok { background: var(--green); }
.source-status.warn { background: var(--amber); }
.source-status.fail { background: var(--red); }
.source-status.info { background: var(--muted-2); }
.source-name { font-size: 9.5px; font-weight: 650; color: var(--ink-2); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.source-detail { font-size: 8.3px; color: var(--muted-2); line-height: 1.35; margin-top: 1px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.source-source { font-size: 7.5px; color: #a6b1c1; margin-top: 1px; }
.source-kind {
  font-size: 7px; font-weight: 700; letter-spacing: .04em;
  padding: 2px 4px; border-radius: 3px; margin-top: 1px;
  color: var(--muted-2); background: var(--panel-soft); border: 1px solid var(--line-2);
}
.source-kind.live { color: var(--teal); background: var(--teal-soft); border-color: #d5eee0; }
.source-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding-top: 8px; border-top: 1px solid var(--line-2);
}
.source-foot .tiny-note { margin: 0; }
.link-btn { border: 0; background: none; color: var(--blue); font-size: 9.5px; font-weight: 650; padding: 2px }
.link-btn:hover { text-decoration: underline; }
.page-foot {
  display: flex; justify-content: space-between; gap: 18px;
  font-size: 9px; color: var(--muted-2); padding: 18px 4px 0;
}

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .38); backdrop-filter: blur(3px); }
.modal-card {
  position: relative; width: 660px; max-width: 100%; max-height: 88vh; overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 30px 80px -30px rgba(15, 23, 42, .45);
  padding: 22px 24px 20px;
  animation: modal-in .3s cubic-bezier(.22,.8,.3,1);
}
@keyframes modal-in { from { transform: translateY(12px) scale(.99); opacity: 0; } }
.modal-head { display: flex; justify-content: space-between; gap: 18px; }
.modal-head h2 { font-size: 20px; letter-spacing: -.035em; font-weight: 760; }
.modal-lede { font-size: 12px; line-height: 1.6; color: var(--muted); margin: 13px 0 18px; }
.weight-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 18px; }
.weight-item { border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; background: var(--panel-soft); }
.weight-item { font-size: 9px; color: var(--muted); }
.weight-item b { display: flex; justify-content: space-between; font-size: 10px; color: var(--ink-2); margin-bottom: 4px; }
.weight-item b span { color: var(--blue); font-family: var(--mono); }
.method-steps { display: flex; flex-direction: column; gap: 7px; }
.method-step { display: grid; grid-template-columns: 27px 1fr; gap: 9px; align-items: start; }
.method-num { font-family: var(--mono); font-size: 10px; color: var(--blue); background: var(--blue-soft); border-radius: 6px; width: 25px; height: 25px; display: grid; place-items: center; }
.method-step b { display: block; font-size: 10.5px; color: var(--ink); }
.method-step span { font-size: 10px; color: var(--muted); line-height: 1.45; }
.modal-note { margin-top: 18px; background: var(--amber-soft); border: 1px solid #fde5c8; border-radius: 9px; padding: 10px 11px; font-size: 9.5px; color: #8a4b0a; line-height: 1.5; }
.modal-note b { color: var(--amber); }

/* skeletons */
.skeleton-list { display: flex; flex-direction: column; gap: 7px; }
.skeleton-list::before {
  content: ""; display: block; height: 73px; border-radius: 8px;
  background: linear-gradient(90deg, #f4f6f9 25%, #f8fafc 50%, #f4f6f9 75%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite;
}
.skeleton-list::after {
  content: ""; display: block; height: 73px; border-radius: 8px;
  background: linear-gradient(90deg, #f4f6f9 25%, #f8fafc 50%, #f4f6f9 75%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite;
}
@keyframes shimmer { 0% { background-position: 120% 0; } 100% { background-position: -100% 0; } }

/* toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(12px);
  background: #101828; color: #fff; font-size: 11px; padding: 9px 14px;
  border-radius: 8px; opacity: 0; pointer-events: none; transition: .2s; z-index: 20;
  box-shadow: 0 12px 30px -12px rgba(0,0,0,.4);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.dim.good .dim-bar i { background: var(--teal); }
.dim.warn .dim-bar i { background: var(--amber); }
.dim.risk .dim-bar i { background: var(--red); }
.empty-list { color: var(--muted); font-size: 11px; text-align: center; padding: 34px 8px; line-height: 1.6; }
.empty-list span { color: var(--muted-2); font-size: 10px; }
.muted { color: var(--muted); font-weight: 500; }
.spin {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1.6px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.btn-ghost .spin { border-color: rgba(16,24,40,.16); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- counterparties modal ---------- */
.counter-card { width: 900px; padding: 22px 24px 20px; }
.counter-summary {
  display: flex; align-items: center; gap: 16px;
  padding: 15px 16px; margin: 15px 0 12px;
  border: 1px solid #e1e9f5; border-radius: 12px;
  background: linear-gradient(135deg, #f8fbff 0%, #f8f8fc 58%, #f1f8f5 100%);
}
.counter-overall {
  width: 70px; height: 70px; flex: 0 0 auto; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: conic-gradient(var(--level-color, var(--green)) 0 var(--pct, 93%), #e6edf4 var(--pct, 93%) 100%);
  position: relative;
}
.counter-overall.high { --level-color: var(--green); }
.counter-overall.medium { --level-color: var(--amber); }
.counter-overall.low, .counter-overall.blocked { --level-color: var(--red); }
.counter-overall::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #fff; }
.counter-overall-num { position: relative; z-index: 1; font-size: 21px; font-weight: 760; letter-spacing: -.05em; line-height: 1; }
.counter-overall-label { position: relative; z-index: 1; font-size: 7.5px; color: var(--muted-2); margin-top: 2px; }
.counter-overall-main { flex: 1; min-width: 0; }
.counter-overall-main h3 { font-size: 12.5px; letter-spacing: -.02em; margin-top: 5px; }
.counter-overall-main p { font-size: 10px; color: var(--muted); line-height: 1.45; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.counter-pill { font-size: 8px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; }
.counter-pill.high { color: var(--green); background: var(--green-soft); }
.counter-pill.medium { color: var(--amber); background: var(--amber-soft); }
.counter-pill.low, .counter-pill.blocked { color: var(--red); background: var(--red-soft); }
.counter-stats { display: flex; gap: 14px; margin-left: auto; }
.counter-stats span { display: flex; flex-direction: column; align-items: flex-end; }
.counter-stats b { font-size: 15px; font-family: var(--mono); color: var(--ink-2); }
.counter-stats small { font-size: 8px; color: var(--muted-2); white-space: nowrap; }
.counter-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.counter-tab {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel-soft); padding: 8px 9px; text-align: left;
  transition: .14s ease;
}
.counter-tab:hover { border-color: #cfd9ea; background: #fff; }
.counter-tab.active { background: #f4f8ff; border-color: #bcd0f7; box-shadow: inset 0 0 0 1px rgba(29, 78, 216, .05); }
.ct-avatar { width: 25px; height: 25px; flex: 0 0 auto; border-radius: 7px; display: grid; place-items: center; font-size: 9px; font-weight: 750; background: var(--blue-soft); color: var(--blue); }
.ct-avatar.beneficiary { background: #f3efff; color: #6d4ac2; }
.ct-avatar.bank { background: var(--teal-soft); color: var(--teal); }
.ct-copy { min-width: 0; flex: 1; }
.ct-copy b { display: block; font-size: 9.5px; color: var(--ink-2); }
.ct-copy small { display: block; font-size: 8px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-score { font-family: var(--mono); font-size: 10px; font-weight: 700; }
.ct-score.high { color: var(--green); }
.ct-score.medium { color: var(--amber); }
.ct-score.low, .ct-score.blocked { color: var(--red); }
.counter-detail { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.counter-party { padding: 15px 16px 14px; }
.cp-head { display: flex; align-items: flex-start; gap: 11px; }
.cp-avatar { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-size: 14px; font-weight: 750; }
.cp-avatar.beneficiary { background: #f3efff; color: #6d4ac2; }
.cp-avatar.bank { background: var(--teal-soft); color: var(--teal); }
.cp-title { flex: 1; min-width: 0; }
.cp-eyebrow { font-size: 8px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; color: var(--muted-2); }
.cp-title h3 { font-size: 15px; letter-spacing: -.025em; margin-top: 2px; }
.cp-type { font-size: 9.5px; color: var(--muted); margin-top: 2px; }
.cp-score { text-align: right; flex: 0 0 auto; }
.cp-score b { display: block; font-family: var(--mono); font-size: 20px; letter-spacing: -.05em; line-height: 1; }
.cp-score span { font-size: 8px; color: var(--muted-2); }
.cp-score.high b { color: var(--green); }
.cp-score.medium b { color: var(--amber); }
.cp-score.low b, .cp-score.blocked b { color: var(--red); }
.cp-summary { font-size: 10.5px; line-height: 1.55; color: var(--ink-2); margin-top: 10px; max-width: 680px; }
.cp-signals { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.cp-signal { display: inline-flex; align-items: center; gap: 4px; font-size: 8.5px; color: var(--muted); background: var(--panel-soft); border: 1px solid var(--line-2); border-radius: 5px; padding: 3px 6px; }
.cp-signal i { width: 4px; height: 4px; border-radius: 50%; background: var(--muted-2); }
.cp-signal.ok i { background: var(--green); }
.cp-signal.warn i { background: var(--amber); }
.cp-signal.risk i, .cp-signal.fail i { background: var(--red); }
.cp-sources-title { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line-2); margin-top: 13px; padding-top: 11px; }
.cp-sources-title span { font-size: 9px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; color: var(--muted-2); }
.cp-sources-title small { font-size: 8px; color: var(--muted-2); }
.cp-sources { margin-top: 5px; }
.cp-source { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.cp-source:last-child { border-bottom: 0; }
.cp-source-dot { width: 5px; height: 5px; border-radius: 50%; margin-top: 3px; background: var(--muted-2); }
.cp-source-dot.ok { background: var(--green); }
.cp-source-dot.warn { background: var(--amber); }
.cp-source-dot.fail { background: var(--red); }
.cp-source-copy b { display: block; font-size: 9px; color: var(--ink-2); font-weight: 650; }
.cp-source-copy span { display: block; font-size: 8.5px; color: var(--muted); line-height: 1.4; margin-top: 1px; }
.cp-source-status { font-size: 7.5px; font-weight: 650; color: var(--muted-2); white-space: nowrap; margin-top: 2px; }
.cp-source-status.ok { color: var(--green); }
.cp-source-status.warn { color: var(--amber); }
.cp-source-status.fail { color: var(--red); }
.counter-disclaimer { margin-top: 13px; font-size: 8.5px; line-height: 1.5; color: var(--muted-2); border-top: 1px solid var(--line-2); padding-top: 10px; }
.counter-disclaimer b { color: var(--muted); }
@media (max-width: 720px) {
  .counter-card { padding: 16px; }
  .counter-summary { flex-wrap: wrap; gap: 10px; }
  .counter-stats { width: 100%; justify-content: flex-start; margin-left: 0; border-top: 1px solid var(--line-2); padding-top: 8px; }
  .counter-stats span { align-items: flex-start; }
  .counter-tabs { grid-template-columns: 1fr; }

}

/* ---------- responsive ---------- */
@media (max-width: 1320px) {
  .workbench { grid-template-columns: 270px minmax(0, 1fr) 330px; gap: 14px; }
  .app { padding: 18px 18px 24px; }
  .hero-fact { padding-right: 13px; margin-right: 13px; }
}
@media (max-width: 1120px) {
  .workbench { grid-template-columns: 266px minmax(0, 1fr); }
  .right-column { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .right-column .score-panel { grid-row: span 1; grid-column: 1; }
  .right-column .conditions-panel { grid-column: 2; }
  .right-column .sources-panel { grid-column: 1 / -1; }
  .queue-panel { height: calc(100vh - 100px); }
}
@media (max-width: 900px) {
  .right-column { grid-template-columns: 1fr; }
  .right-column .conditions-panel { grid-column: auto; }
  .right-column .sources-panel { grid-column: auto; }
  .workbench { grid-template-columns: 1fr; }
  .queue-panel { height: auto; position: static; min-height: 0; }
  .case-list { max-height: 264px; }
  .topbar { flex-wrap: wrap; height: auto; }
  .fx-chip { display: none; }
}
@media (max-width: 640px) {
  .app { padding: 10px 10px 22px; }
  .topbar { padding: 2px 4px 4px; }
  .brand-sub { display: none; }
  .case-hero { padding: 15px; }
  .hero-title { font-size: 19px; }
  .hero-facts { gap: 8px 0; }
  .hero-fact { min-width: 46%; }
  .runbar { flex-wrap: wrap; }
  .run-meta { width: 100%; text-align: left; }
  .chat-head { padding: 12px 15px 10px; }
  .agents { display: none; }
  .chat { max-height: none; min-height: 430px; padding: 14px 12px; }
  .chat-foot { padding: 10px 12px; }
  .page-foot { flex-direction: column; gap: 4px; }
  .weight-grid { grid-template-columns: 1fr 1fr; }
}
