:root{
  --bg:#07111f;
  --bg-soft:#0d1a2c;
  --card:#101b2c;
  --card-2:#0a1322;
  --line:rgba(138,169,210,.18);
  --line-strong:rgba(138,169,210,.32);
  --text:#edf4ff;
  --muted:#91a7c5;
  --muted-2:#6d809c;
  --green:#2ee6a6;
  --teal:#24d4d8;
  --amber:#ffca57;
  --orange:#ff934f;
  --red:#ff5d73;
  --blue:#5ea8ff;
}
*{box-sizing:border-box}
body{
  margin:0;
  color:var(--text);
  font-family:"Segoe UI",system-ui,sans-serif;
  background:
    radial-gradient(circle at top left,rgba(38,132,255,.28),transparent 24%),
    radial-gradient(circle at 90% 10%,rgba(46,230,166,.12),transparent 18%),
    linear-gradient(180deg,#08111e 0%,#060c16 52%,#040810 100%);
}
.hero{
  display:flex;
  gap:24px;
  justify-content:space-between;
  align-items:flex-end;
  padding:42px;
  max-width:1300px;
  margin:auto;
}
.eyebrow{
  color:var(--teal);
  font-weight:700;
  letter-spacing:.16em;
  text-transform:uppercase;
}
h1{
  font-size:52px;
  line-height:.95;
  margin:.15em 0;
  letter-spacing:-.04em;
}
h2{margin-top:0;font-size:28px;letter-spacing:-.03em}
h3{margin:0}
.hero p{color:var(--muted);max-width:680px}
.grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:18px;
  max-width:1300px;
  margin:0 auto 60px;
  padding:0 42px;
}
.card{
  position:relative;
  overflow:hidden;
  background:linear-gradient(180deg,rgba(17,27,44,.94),rgba(8,14,24,.96));
  border:1px solid var(--line);
  border-radius:26px;
  padding:22px;
  box-shadow:0 25px 80px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.03);
}
.card::before{
  content:"";
  position:absolute;
  inset:auto -40px -70px auto;
  width:160px;
  height:160px;
  background:radial-gradient(circle,rgba(94,168,255,.14),transparent 70%);
  pointer-events:none;
}
.wide{grid-column:1/-1}
.key-card{min-width:320px}
label,small{display:block}
small{color:var(--muted)}
input,textarea{
  width:100%;
  background:rgba(3,8,18,.94);
  color:var(--text);
  border:1px solid var(--line);
  border-radius:14px;
  padding:13px 14px;
  margin:10px 0;
  font-family:ui-monospace,SFMono-Regular,monospace;
}
input::placeholder,textarea::placeholder{color:var(--muted-2)}
textarea{min-height:110px;resize:vertical}
textarea,pre,.signal-list,.reason-timeline,.human-summary,.graph-metrics,.tab-panel,.network-list{
  scrollbar-width:thin;
  scrollbar-color:rgba(122,146,178,.55) transparent;
}
textarea::-webkit-scrollbar,
pre::-webkit-scrollbar,
.signal-list::-webkit-scrollbar,
.reason-timeline::-webkit-scrollbar,
.human-summary::-webkit-scrollbar,
.graph-metrics::-webkit-scrollbar,
.tab-panel::-webkit-scrollbar,
.network-list::-webkit-scrollbar{
  width:12px;
  height:12px;
}
textarea::-webkit-scrollbar-track,
pre::-webkit-scrollbar-track,
.signal-list::-webkit-scrollbar-track,
.reason-timeline::-webkit-scrollbar-track,
.human-summary::-webkit-scrollbar-track,
.graph-metrics::-webkit-scrollbar-track,
.tab-panel::-webkit-scrollbar-track,
.network-list::-webkit-scrollbar-track{
  background:transparent;
}
textarea::-webkit-scrollbar-thumb,
pre::-webkit-scrollbar-thumb,
.signal-list::-webkit-scrollbar-thumb,
.reason-timeline::-webkit-scrollbar-thumb,
.human-summary::-webkit-scrollbar-thumb,
.graph-metrics::-webkit-scrollbar-thumb,
.tab-panel::-webkit-scrollbar-thumb,
.network-list::-webkit-scrollbar-thumb{
  border-radius:999px;
  border:3px solid transparent;
  background-clip:padding-box;
  background:linear-gradient(180deg,rgba(164,181,205,.75),rgba(94,112,138,.85));
}
button{
  background:linear-gradient(90deg,var(--green),#56b4ff 55%,#7d46ff 100%);
  border:0;
  color:#031014;
  font-weight:800;
  border-radius:14px;
  padding:12px 16px;
  cursor:pointer;
  margin-right:8px;
  margin-top:8px;
  box-shadow:0 10px 28px rgba(39,220,190,.18);
}
button:hover{filter:brightness(1.05)}
.input-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
pre{
  background:#020817;
  border:1px solid var(--line);
  border-radius:18px;
  padding:16px;
  overflow:auto;
  max-height:520px;
  color:#cfe0ff;
  box-shadow:inset 0 18px 22px -22px rgba(255,255,255,.08), inset 0 -18px 22px -22px rgba(255,255,255,.08);
}
.summary{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:14px}
.pill{
  padding:9px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(2,8,23,.7);
  font-size:13px;
}
.critical{color:var(--red)}
.high{color:var(--orange)}
.medium{color:var(--amber)}
.low{color:var(--green)}
.hidden{display:none!important}

.result-empty{
  position:relative;
  min-height:280px;
  display:grid;
  place-items:center;
  text-align:center;
  border:1px dashed var(--line);
  border-radius:24px;
  background:
    radial-gradient(circle at center,rgba(46,230,166,.09),transparent 30%),
    linear-gradient(180deg,rgba(255,255,255,.02),rgba(255,255,255,0));
  padding:30px;
}
.result-empty h3{
  font-size:34px;
  letter-spacing:-.04em;
  margin:6px 0 8px;
}
.result-empty p{max-width:560px;color:var(--muted);margin:0 auto}
.result-empty-kicker,.section-kicker{
  color:var(--teal);
  text-transform:uppercase;
  letter-spacing:.16em;
  font-size:12px;
  font-weight:800;
}
.section-kicker{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.count-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:28px;
  padding:4px 8px;
  border-radius:999px;
  color:var(--text);
  background:rgba(94,168,255,.12);
  border:1px solid rgba(94,168,255,.2);
  letter-spacing:.04em;
  font-size:11px;
  line-height:1;
}
.result-empty-orbit{
  position:absolute;
  width:240px;
  height:240px;
  border:1px solid rgba(94,168,255,.14);
  border-radius:50%;
  animation:spin 18s linear infinite;
}
.result-empty-orbit::before,.result-empty-orbit::after{
  content:"";
  position:absolute;
  border-radius:50%;
}
.result-empty-orbit::before{
  width:14px;
  height:14px;
  top:20px;
  left:24px;
  background:var(--teal);
  box-shadow:0 0 20px rgba(36,212,216,.8);
}
.result-empty-orbit::after{
  width:10px;
  height:10px;
  right:28px;
  bottom:46px;
  background:var(--amber);
  box-shadow:0 0 20px rgba(255,202,87,.75);
}

.result-panel{display:grid;gap:22px}
.psbt-panel{
  border-radius:24px;
  border:1px solid var(--line);
  padding:18px;
  background:linear-gradient(180deg,rgba(255,255,255,.03),rgba(255,255,255,.01));
}
.psbt-grid{
  display:grid;
  grid-template-columns:1.4fr .8fr;
  gap:16px;
  margin-top:14px;
}
.psbt-hero-card{
  padding:18px;
  border-radius:20px;
  border:1px solid var(--line);
  background:
    radial-gradient(circle at 20% 15%,rgba(36,212,216,.12),transparent 24%),
    linear-gradient(180deg,rgba(255,255,255,.03),rgba(255,255,255,.01));
}
.psbt-hero-card h3{
  font-size:28px;
  letter-spacing:-.04em;
  margin:10px 0 8px;
}
.psbt-status-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.05);
}
.psbt-status-badge.safe{
  color:#d9fff2;
  background:rgba(46,230,166,.12);
  border-color:rgba(46,230,166,.22);
}
.psbt-status-badge.blocked{
  color:#ffe5cf;
  background:rgba(255,147,79,.12);
  border-color:rgba(255,147,79,.22);
}
.psbt-metrics{
  display:grid;
  gap:12px;
}
.result-hero{
  display:grid;
  grid-template-columns:220px 1fr;
  gap:24px;
  align-items:center;
  padding:4px 0 8px;
}
.result-risk{
  display:grid;
  gap:16px;
  justify-items:center;
}
.risk-ring{
  width:190px;
  height:190px;
  border-radius:50%;
  padding:14px;
  background:
    conic-gradient(var(--risk-color,#2ee6a6) calc(var(--risk-progress,0) * 1%), rgba(255,255,255,.06) 0);
  box-shadow:inset 0 0 24px rgba(255,255,255,.04),0 18px 40px rgba(0,0,0,.35);
}
.risk-ring-core{
  width:100%;
  height:100%;
  border-radius:50%;
  display:grid;
  place-items:center;
  text-align:center;
  background:
    radial-gradient(circle at 50% 35%,rgba(94,168,255,.18),transparent 42%),
    linear-gradient(180deg,#0f1a2b,#08111e);
  border:1px solid rgba(255,255,255,.05);
}
.risk-score-value{
  font-size:44px;
  line-height:1;
  font-weight:800;
  letter-spacing:-.05em;
}
.risk-score-label{color:var(--muted);font-size:13px;text-transform:uppercase;letter-spacing:.14em}
.risk-track{
  width:100%;
  height:12px;
  border-radius:999px;
  overflow:hidden;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.06);
}
.risk-bar-fill{
  width:0;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,var(--green),var(--amber),var(--red));
  transition:width .45s ease;
}
.result-story{
  display:grid;
  gap:10px;
  min-width:0;
}
.history-toolbar{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.history-btn{
  margin:0;
  padding:9px 12px;
  border-radius:12px;
  background:rgba(255,255,255,.05);
  color:var(--text);
  box-shadow:none;
}
.history-preview{
  min-height:40px;
  flex:1 1 260px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(2,8,23,.42);
  color:var(--muted);
  font-size:13px;
  overflow:auto;
  white-space:nowrap;
}
.history-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(94,168,255,.18);
  background:rgba(94,168,255,.08);
  color:var(--text);
}
.history-chip.active{
  background:rgba(46,230,166,.14);
  border-color:rgba(46,230,166,.24);
}
.result-headline{
  font-size:34px;
  letter-spacing:-.045em;
}
.result-narrative{
  margin:0;
  color:var(--muted);
  font-size:17px;
  max-width:760px;
}
.takeaway{
  display:inline-flex;
  align-items:center;
  gap:10px;
  width:fit-content;
  max-width:100%;
  padding:14px 16px;
  border-radius:18px;
  background:linear-gradient(90deg,rgba(46,230,166,.1),rgba(94,168,255,.08));
  border:1px solid rgba(46,230,166,.18);
  color:var(--text);
}
.takeaway::before{
  content:"";
  width:10px;
  height:10px;
  border-radius:50%;
  background:var(--teal);
  box-shadow:0 0 18px rgba(36,212,216,.85);
  flex:0 0 auto;
}

.metrics-grid{
  display:grid;
  grid-template-columns:repeat(6,1fr);
  gap:14px;
}
.metric-card{
  padding:16px;
  border-radius:20px;
  background:linear-gradient(180deg,rgba(255,255,255,.03),rgba(255,255,255,.01));
  border:1px solid var(--line);
}
.metric-label{
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.12em;
  font-size:11px;
  margin-bottom:10px;
}
.metric-value{
  font-size:24px;
  line-height:1.05;
  font-weight:800;
  letter-spacing:-.04em;
}
.metric-subvalue{
  margin-top:8px;
  color:var(--muted-2);
  font-size:12px;
}

.signal-layout,.insight-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}
.signal-card,.insight-card{
  border-radius:22px;
  padding:18px;
  background:linear-gradient(180deg,rgba(255,255,255,.03),rgba(255,255,255,.01));
  border:1px solid var(--line);
}
.muted-card{background:linear-gradient(180deg,rgba(255,255,255,.015),rgba(255,255,255,.005))}
.signal-list{
  display:grid;
  gap:10px;
  margin-top:14px;
  max-height:320px;
  overflow:auto;
  padding-right:4px;
  box-shadow:inset 0 16px 18px -18px rgba(255,255,255,.08), inset 0 -16px 18px -18px rgba(255,255,255,.08);
}
.signal-chip{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
  padding:14px 15px;
  border-radius:18px;
  background:rgba(2,8,23,.52);
  border:1px solid var(--line);
}
.signal-chip.active{border-color:rgba(255,202,87,.26);background:linear-gradient(180deg,rgba(255,202,87,.08),rgba(255,255,255,.01))}
.signal-chip.inactive{opacity:.9}
.signal-copy strong,.timeline-head strong{display:block;font-size:15px}
.signal-copy span,.timeline-head span{display:block;color:var(--muted);font-size:13px;margin-top:4px}
.signal-score{
  font-size:12px;
  font-weight:800;
  letter-spacing:.08em;
  color:var(--text);
  padding:7px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.06);
}

.human-summary{
  margin-top:14px;
  display:grid;
  gap:12px;
  max-height:250px;
  overflow:auto;
  padding-right:4px;
  box-shadow:inset 0 14px 16px -16px rgba(255,255,255,.08), inset 0 -14px 16px -16px rgba(255,255,255,.08);
}
.summary-line{
  display:flex;
  gap:10px;
  align-items:flex-start;
  color:var(--text);
}
.summary-line::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--teal);
  margin-top:8px;
  box-shadow:0 0 18px rgba(36,212,216,.6);
  flex:0 0 auto;
}
.summary-line.muted::before{background:rgba(255,255,255,.2);box-shadow:none}
.graph-metrics{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:12px;
  margin-top:14px;
  max-height:250px;
  overflow:auto;
  padding-right:4px;
  box-shadow:inset 0 14px 16px -16px rgba(255,255,255,.08), inset 0 -14px 16px -16px rgba(255,255,255,.08);
}
.graph-node{
  border-radius:18px;
  border:1px solid var(--line);
  background:rgba(2,8,23,.5);
  padding:14px;
}
.graph-node strong{
  display:block;
  font-size:24px;
  letter-spacing:-.04em;
}
.graph-node span{
  display:block;
  color:var(--muted);
  margin-top:6px;
}

.result-tabs{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.tab{
  background:rgba(255,255,255,.04);
  color:var(--text);
  box-shadow:none;
}
.tab.active{
  background:linear-gradient(90deg,rgba(46,230,166,.22),rgba(94,168,255,.22));
  border:1px solid rgba(94,168,255,.2);
}
.tab-panel{display:none}
.tab-panel.active{display:block}
.network-stage{
  display:grid;
  gap:18px;
}
.network-hero{
  display:grid;
  grid-template-columns:220px 1fr;
  gap:22px;
  align-items:center;
  padding:18px;
  border-radius:24px;
  border:1px solid var(--line);
  background:
    radial-gradient(circle at 20% 20%,rgba(94,168,255,.14),transparent 28%),
    linear-gradient(180deg,rgba(255,255,255,.03),rgba(255,255,255,.01));
}
.network-orbit{
  width:190px;
  height:190px;
  border-radius:50%;
  margin:auto;
  display:grid;
  place-items:center;
  border:1px solid rgba(94,168,255,.18);
  box-shadow:inset 0 0 30px rgba(94,168,255,.08),0 22px 60px rgba(0,0,0,.25);
  position:relative;
}
.network-orbit-button{
  padding:0;
  background:transparent;
  margin:0 auto;
  cursor:pointer;
}
.network-orbit-button:hover{
  filter:none;
  border-color:rgba(94,168,255,.22);
  box-shadow:inset 0 0 30px rgba(94,168,255,.12),0 22px 60px rgba(0,0,0,.25),0 0 0 1px rgba(94,168,255,.18);
}
.network-orbit::before,.network-orbit::after{
  content:"";
  position:absolute;
  border-radius:50%;
  border:1px dashed rgba(255,255,255,.08);
}
.network-orbit::before{inset:18px}
.network-orbit::after{inset:38px}
.network-core{
  width:92px;
  height:92px;
  border-radius:50%;
  display:grid;
  place-items:center;
  text-align:center;
  background:linear-gradient(180deg,#13233c,#08111e);
  border:1px solid rgba(255,255,255,.06);
  box-shadow:0 0 28px rgba(36,212,216,.14);
}
.network-core span{
  font-size:28px;
  font-weight:800;
  letter-spacing:-.04em;
}
.network-core small{
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.12em;
  font-size:10px;
}
.network-copy h3{
  font-size:32px;
  letter-spacing:-.04em;
  margin:6px 0 10px;
}
.network-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:16px;
}
.network-card{
  border-radius:22px;
  border:1px solid var(--line);
  padding:18px;
  background:linear-gradient(180deg,rgba(255,255,255,.03),rgba(255,255,255,.01));
}
.wide-network{grid-column:1/-1}
.network-list{
  margin-top:14px;
  display:grid;
  gap:10px;
  max-height:300px;
  overflow:auto;
  padding-right:4px;
  scrollbar-width:thin;
  scrollbar-color:rgba(122,146,178,.55) transparent;
  box-shadow:inset 0 14px 16px -16px rgba(255,255,255,.08), inset 0 -14px 16px -16px rgba(255,255,255,.08);
}
.network-item{
  display:grid;
  gap:6px;
  padding:14px;
  border-radius:18px;
  border:1px solid var(--line);
  background:rgba(2,8,23,.5);
}
.network-item-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.network-item strong{
  font-size:14px;
  color:var(--text);
  word-break:break-all;
}
.network-item span{
  color:var(--muted);
  font-size:12px;
}
.edge-list .network-item{
  grid-template-columns:minmax(0,1fr) auto;
  align-items:start;
}
.edge-route{
  display:grid;
  gap:4px;
}
.edge-route code{
  color:#d9e7ff;
  font-family:ui-monospace,SFMono-Regular,monospace;
  font-size:12px;
}
.trace-actions{
  display:flex;
  gap:8px;
  flex:0 0 auto;
}
.icon-btn{
  width:34px;
  height:34px;
  border-radius:12px;
  padding:0;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.05);
  color:var(--text);
  border:1px solid rgba(255,255,255,.08);
  box-shadow:none;
  font-size:15px;
}
.input-icon-btn{
  margin:0;
}
.icon-btn:hover{
  background:rgba(94,168,255,.14);
  border-color:rgba(94,168,255,.22);
}
.edge-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:8px;
}
.edge-action-group{
  display:flex;
  align-items:center;
  gap:8px;
}
.edge-action-group small{
  color:var(--muted-2);
  text-transform:uppercase;
  letter-spacing:.12em;
  font-size:10px;
}
.edge-value{
  padding:7px 10px;
  border-radius:999px;
  background:rgba(94,168,255,.12);
  border:1px solid rgba(94,168,255,.2);
  color:#dceaff;
  font-size:12px;
  font-weight:800;
}
.toast-stack{
  position:fixed;
  top:22px;
  right:22px;
  z-index:9999;
  display:grid;
  gap:12px;
  width:min(380px,calc(100vw - 32px));
}
.toast{
  padding:16px 18px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg,rgba(22,30,47,.96),rgba(10,16,27,.98));
  box-shadow:0 24px 60px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.04);
  transform:translateY(-8px);
  opacity:0;
  animation:toast-in .24s ease forwards;
}
.toast-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}
.toast-title strong{
  font-size:14px;
  letter-spacing:.02em;
}
.toast-title button{
  margin:0;
  padding:0;
  width:26px;
  height:26px;
  border-radius:999px;
  background:rgba(255,255,255,.06);
  color:var(--text);
  box-shadow:none;
}
.toast p{
  margin:0;
  color:var(--muted);
  line-height:1.45;
}
.toast.error{border-color:rgba(255,93,115,.24)}
.toast.error strong{color:#ffd8de}
.toast.success{border-color:rgba(46,230,166,.24)}
.toast.success strong{color:#d9fff2}
.toast.info{border-color:rgba(94,168,255,.24)}
.toast.info strong{color:#dceaff}
.loading-overlay{
  position:fixed;
  inset:0;
  z-index:9998;
  display:grid;
  place-items:center;
  padding:24px;
  background:
    radial-gradient(circle at center,rgba(94,168,255,.12),transparent 32%),
    rgba(4,8,16,.78);
  backdrop-filter:blur(10px);
  pointer-events:auto;
}
.loading-shell{
  width:min(460px,100%);
  text-align:center;
  padding:28px 26px;
  border-radius:28px;
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg,rgba(15,24,40,.96),rgba(8,14,24,.98));
  box-shadow:0 30px 90px rgba(0,0,0,.48), inset 0 1px 0 rgba(255,255,255,.04);
}
.loading-spinner{
  width:108px;
  height:108px;
  margin:0 auto 20px;
  border-radius:50%;
  padding:10px;
  background:
    conic-gradient(from 0deg,#2ee6a6,#56b4ff,#7d46ff,#2ee6a6);
  animation:spin 1.1s linear infinite;
  box-shadow:0 0 35px rgba(94,168,255,.24);
}
.loading-spinner-core{
  width:100%;
  height:100%;
  border-radius:50%;
  background:
    radial-gradient(circle at 50% 35%,rgba(94,168,255,.22),transparent 34%),
    linear-gradient(180deg,#0f1a2b,#08111e);
  border:1px solid rgba(255,255,255,.06);
}
.loading-kicker{
  margin:0 0 8px;
  color:var(--teal);
  text-transform:uppercase;
  letter-spacing:.18em;
  font-size:12px;
  font-weight:800;
}
.loading-shell h3{
  margin:0 0 10px;
  font-size:30px;
  letter-spacing:-.04em;
}
.loading-copy{
  margin:0;
  color:var(--muted);
  line-height:1.5;
}
.graph-modal{
  position:fixed;
  inset:0;
  z-index:10000;
  padding:24px;
  display:grid;
  place-items:center;
  background:rgba(4,8,16,.84);
  backdrop-filter:blur(12px);
}
.graph-modal-shell{
  width:min(1180px,100%);
  max-height:min(92vh,980px);
  overflow:auto;
  border-radius:28px;
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg,rgba(13,21,35,.98),rgba(7,12,20,.99));
  box-shadow:0 35px 100px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.04);
  padding:24px;
}
.graph-modal-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:18px;
}
.graph-modal-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.graph-modal-head h3{
  margin:6px 0 0;
  font-size:34px;
  letter-spacing:-.04em;
}
.graph-modal-shell.fullscreen{
  width:100%;
  max-height:100%;
  height:calc(100vh - 48px);
}
.graph-modal-grid{
  display:grid;
  grid-template-columns:1.4fr .8fr;
  gap:16px;
}
.graph-visual-card{
  border-radius:24px;
  border:1px solid var(--line);
  padding:18px;
  background:linear-gradient(180deg,rgba(255,255,255,.03),rgba(255,255,255,.01));
}
.graph-visual-wide{
  grid-row:span 2;
  min-height:520px;
}
.graph-svg{
  width:100%;
  height:460px;
  margin-top:14px;
  border-radius:18px;
  background:
    radial-gradient(circle at center,rgba(94,168,255,.08),transparent 42%),
    linear-gradient(180deg,rgba(2,8,23,.85),rgba(2,8,23,.96));
  border:1px solid rgba(255,255,255,.05);
  cursor:grab;
  user-select:none;
  touch-action:none;
}
.graph-svg.dragging{cursor:grabbing}
.flow-bars{
  margin-top:14px;
  display:grid;
  gap:12px;
}
.flow-bar{
  display:grid;
  gap:8px;
}
.flow-bar-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  color:var(--text);
  font-size:13px;
}
.flow-route{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  align-items:center;
}
.trace-link{
  border:0;
  padding:0;
  margin:0;
  color:#dceaff;
  background:none;
  box-shadow:none;
  font-size:13px;
  font-weight:700;
}
.trace-link:hover{
  filter:none;
  color:var(--teal);
  text-decoration:underline;
}
.flow-track{
  height:12px;
  border-radius:999px;
  overflow:hidden;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.05);
}
.flow-fill{
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#24d4d8,#56b4ff,#7d46ff);
}
.graph-mix-stats{
  margin-top:14px;
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:12px;
}
.mix-stat{
  padding:16px;
  border-radius:18px;
  border:1px solid var(--line);
  background:rgba(2,8,23,.52);
}
.mix-stat strong{
  display:block;
  font-size:26px;
  letter-spacing:-.04em;
}
.mix-stat span{
  display:block;
  color:var(--muted);
  margin-top:6px;
}
.graph-node-circle{cursor:pointer}
.graph-node-label{
  cursor:pointer;
  fill:#dceaff;
}
.reason-timeline{
  display:grid;
  gap:12px;
  max-height:300px;
  overflow:auto;
  padding-right:4px;
  box-shadow:inset 0 14px 16px -16px rgba(255,255,255,.08), inset 0 -14px 16px -16px rgba(255,255,255,.08);
}
.timeline-item{
  display:grid;
  grid-template-columns:42px 1fr;
  gap:14px;
  align-items:flex-start;
  padding:14px 0;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.timeline-item:last-child{border-bottom:0}
.timeline-badge{
  width:42px;
  height:42px;
  border-radius:14px;
  display:grid;
  place-items:center;
  font-size:12px;
  font-weight:900;
  color:#04111d;
}
.timeline-text{
  color:var(--muted);
  margin-top:7px;
  font-size:14px;
  line-height:1.5;
}
#signalOutput,#output{max-height:420px}

@keyframes spin{
  from{transform:rotate(0deg)}
  to{transform:rotate(360deg)}
}
@keyframes toast-in{
  from{opacity:0;transform:translateY(-8px) scale(.98)}
  to{opacity:1;transform:translateY(0) scale(1)}
}

@media(max-width:1100px){
  .metrics-grid{grid-template-columns:repeat(3,1fr)}
  .result-hero{grid-template-columns:1fr}
  .network-hero{grid-template-columns:1fr}
}
@media(max-width:900px){
  .hero{display:block;padding:24px}
  .grid{grid-template-columns:1fr;padding:24px}
  h1{font-size:36px}
  .signal-layout,.insight-grid{grid-template-columns:1fr}
  .metrics-grid{grid-template-columns:repeat(2,1fr)}
  .network-grid{grid-template-columns:1fr}
  .psbt-grid{grid-template-columns:1fr}
  .graph-modal-grid{grid-template-columns:1fr}
  .graph-visual-wide{grid-row:auto;min-height:auto}
  .history-toolbar{align-items:stretch}
}
@media(max-width:640px){
  .metrics-grid,.graph-metrics{grid-template-columns:1fr}
  .result-headline{font-size:28px}
  .risk-ring{width:160px;height:160px}
  .network-item-head{flex-direction:column}
  .edge-list .network-item{grid-template-columns:1fr}
}
