/*
 * 2026-07-21 — Latest institutional FX theory alignment.
 * Separates market-risk residual, legal fiat payment and Treasury pool rebalance.
 */

.netting-node div{flex-wrap:wrap}
.netting-node small{max-width:520px;margin-inline:auto}
.residual-label{flex-wrap:wrap;text-align:center}

.top-residual-hierarchy{
  --trh-blue:#175cff;
  --trh-cyan:#0d9fbe;
  --trh-green:#087f5b;
  --trh-amber:#b56b13;
  --trh-ink:#111827;
  --trh-muted:#617083;
  position:relative;
  overflow:hidden;
  margin:30px 0 24px;
  border:1px solid rgba(23,92,255,.15);
  border-radius:28px;
  background:#fff;
  box-shadow:0 24px 70px rgba(19,40,72,.08);
}

.top-residual-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:22px;
  padding:24px 25px 22px;
  border-bottom:1px solid #e5eaf1;
  background:linear-gradient(135deg,#fff 15%,#f4f8ff 100%);
}

.top-residual-head>div{min-width:0}
.top-residual-head .figure-claim-title{max-width:540px;font-size:20px;line-height:1.45}
.top-residual-head .figure-claim-note{max-width:150px;font-size:8px;line-height:1.55;text-align:right}

.top-residual-stage{
  position:relative;
  display:grid;
  gap:14px;
  padding:24px;
  isolation:isolate;
  background:
    radial-gradient(circle at 50% 34%,rgba(23,92,255,.08),transparent 27%),
    linear-gradient(rgba(23,92,255,.035) 1px,transparent 1px),
    linear-gradient(90deg,rgba(23,92,255,.035) 1px,transparent 1px),
    linear-gradient(180deg,#fbfdff,#f2f7fa);
  background-size:auto,24px 24px,24px 24px,auto;
}

.trh-execution-deck{
  position:relative;
  z-index:2;
  display:grid;
  grid-template-columns:74px minmax(0,1fr) auto;
  gap:15px;
  align-items:center;
  min-height:102px;
  padding:14px 16px;
  border:1px solid rgba(23,92,255,.18);
  border-radius:18px;
  background:rgba(255,255,255,.96);
  box-shadow:0 14px 30px rgba(24,57,104,.08);
}

.trh-execution-deck span,
.trh-book header span,
.trh-treasury-lab span,
.trh-route-yard header span{
  color:var(--trh-blue);
  font-size:8px;
  font-weight:900;
  letter-spacing:.09em;
}

.trh-execution-deck strong{display:block;margin-top:4px;font-size:14px}
.trh-execution-deck small{display:block;margin-top:4px;color:var(--trh-muted);font-size:9px;line-height:1.5}
.trh-execution-deck em{padding:7px 10px;border-radius:999px;color:#fff;background:#172a43;font-size:8px;font-style:normal;font-weight:850;text-align:center}

.trh-order-art{
  position:relative;
  width:70px;
  height:64px;
  border:5px solid #31506e;
  border-radius:12px;
  background:#071827;
  box-shadow:0 10px 20px rgba(17,36,61,.18);
}

.trh-order-art::before{
  content:"QUOTE";
  position:absolute;
  top:8px;
  left:8px;
  color:#72d9f0;
  font-size:8px;
  font-weight:900;
}

.trh-order-art::after{
  content:"";
  position:absolute;
  right:8px;
  bottom:9px;
  left:8px;
  height:18px;
  background:linear-gradient(145deg,transparent 0 12%,#4bcda3 13% 18%,transparent 19% 38%,#e7a13f 39% 44%,transparent 45% 65%,#678ff4 66% 72%,transparent 73%);
}

.trh-order-art i{position:absolute;top:10px;width:5px;height:5px;border-radius:50%;background:#5fe1ea;animation:trhPulse 2s ease-in-out infinite}
.trh-order-art i:nth-child(1){right:9px}.trh-order-art i:nth-child(2){right:18px;animation-delay:-.7s}.trh-order-art i:nth-child(3){right:27px;animation-delay:-1.4s}

.trh-split-pipe{position:relative;height:42px;margin:-5px 15% -7px}
.trh-split-pipe::before{content:"";position:absolute;top:0;left:50%;height:19px;border-left:3px solid #7694c8}
.trh-split-pipe::after{content:"";position:absolute;right:17%;bottom:0;left:17%;height:23px;border:3px solid #7694c8;border-bottom:0;border-radius:16px 16px 0 0}
.trh-split-pipe i{position:absolute;z-index:2;bottom:-3px;width:9px;height:9px;border-radius:50%;background:var(--trh-blue);box-shadow:0 0 0 5px rgba(23,92,255,.12);animation:trhPulse 2.2s ease-in-out infinite}
.trh-split-pipe i:first-child{left:16%}.trh-split-pipe i:nth-child(2){right:16%;animation-delay:-1.1s}
.trh-split-pipe b{position:absolute;top:4px;left:50%;width:8px;height:8px;transform:translateX(-50%);border-radius:50%;background:#fff;box-shadow:0 0 0 4px rgba(23,92,255,.2)}

.trh-books{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.trh-book{position:relative;display:grid;grid-template-rows:auto 82px auto auto;min-width:0;overflow:hidden;padding:17px;border:1px solid #d5dfe8;border-radius:19px;background:rgba(255,255,255,.97);box-shadow:0 13px 27px rgba(24,54,80,.07)}
.trh-book::before{content:"";position:absolute;inset:0 auto 0 0;width:5px;background:var(--trh-cyan)}
.trh-payment-book::before{background:var(--trh-green)}
.trh-book header{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.trh-book header strong{font-size:11px;text-align:right}
.trh-book>p{margin:8px 0 13px;color:var(--trh-muted);font-size:9px;line-height:1.65}
.trh-book footer{display:grid;grid-template-columns:auto 1fr;gap:8px;align-items:center;padding:9px 10px;border-radius:11px;background:#edf8fb}
.trh-payment-book footer{background:#ebf7f2}
.trh-book footer span{padding:4px 6px;border-radius:999px;color:#fff;background:var(--trh-cyan);font-size:8px;font-weight:900}
.trh-payment-book footer span{background:var(--trh-green)}
.trh-book footer strong{font-size:10px;text-align:right}

.trh-machine-art{position:relative;align-self:center;justify-self:center;width:74px;height:74px;border:9px solid #9ad6e0;border-radius:50%;background:#fff;box-shadow:inset 0 0 0 5px #e8f8fa,0 10px 20px rgba(13,159,190,.12)}
.trh-machine-art i{position:absolute;inset:7px;border:2px dashed var(--trh-cyan);border-radius:50%;animation:trhSpin 7s linear infinite}
.trh-machine-art b{position:absolute;inset:0;display:grid;place-items:center;color:var(--trh-cyan);font-size:20px}
.trh-machine-art.is-payment{border-color:#a9d8c8;box-shadow:inset 0 0 0 5px #e9f7f2,0 10px 20px rgba(8,127,91,.11)}
.trh-machine-art.is-payment i{border-color:var(--trh-green);animation-direction:reverse}.trh-machine-art.is-payment b{color:var(--trh-green)}

.trh-fiat-complete{display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 14px;align-items:center;padding:13px 16px;border:1px solid #ccd6df;border-radius:15px;color:#fff;background:linear-gradient(135deg,#172b43,#0f1f33)}
.trh-fiat-complete span{grid-row:1 / span 2;padding:6px 8px;border-radius:999px;color:#98c4ff;background:rgba(255,255,255,.08);font-size:8px;font-weight:900;letter-spacing:.06em}
.trh-fiat-complete strong{font-size:11px}.trh-fiat-complete small{color:#bac7d4;font-size:8px;line-height:1.45}

.trh-treasury-lab{display:grid;grid-template-columns:78px minmax(0,1fr) auto;gap:15px;align-items:center;min-height:116px;padding:16px;border:1px solid rgba(181,107,19,.22);border-radius:19px;background:linear-gradient(135deg,#fff,#fff8ec);box-shadow:0 13px 28px rgba(120,78,23,.06)}
.trh-treasury-lab span{color:var(--trh-amber)}
.trh-treasury-lab strong{display:block;margin-top:4px;font-size:13px}
.trh-treasury-lab p{margin:5px 0 0;color:#756248;font-size:9px;line-height:1.55}
.trh-treasury-lab>em{padding:8px 10px;border-radius:999px;color:#fff;background:var(--trh-amber);font-size:8px;font-style:normal;font-weight:900;white-space:nowrap}
.trh-pool-art{position:relative;width:76px;height:76px;border:8px solid #e8bd80;border-radius:50%;background:#fff;box-shadow:inset 0 0 0 5px #fff4df}
.trh-pool-art i{position:absolute;bottom:12px;width:18px;border-radius:4px 4px 8px 8px;background:#ffcf7a}
.trh-pool-art i:first-child{left:13px;height:26px}.trh-pool-art i:nth-child(2){right:13px;height:39px;background:#f0a93e}
.trh-pool-art b{position:absolute;inset:0;display:grid;place-items:center;color:#9b5a0c;font-size:14px}

.trh-new-order{position:relative;display:grid;grid-template-columns:auto 1fr 42px;gap:12px;align-items:center;overflow:hidden;padding:12px 15px;border-radius:14px;color:#fff;background:linear-gradient(90deg,#3b267c,#694bd5)}
.trh-new-order span{font-size:8px;font-weight:900;letter-spacing:.08em}.trh-new-order strong{font-size:10px}
.trh-new-order i{position:relative;width:37px;height:8px;border-radius:999px;background:rgba(255,255,255,.25)}
.trh-new-order i::after{content:"";position:absolute;top:-1px;left:0;width:10px;height:10px;border-radius:50%;background:#fff;animation:trhPacket 2.5s ease-in-out infinite}

.trh-route-yard{padding:16px;border:1px solid #d5dfe8;border-radius:19px;background:#fff}
.trh-route-yard header{display:flex;align-items:flex-start;justify-content:space-between;gap:15px}.trh-route-yard header strong{font-size:11px;text-align:right}
.trh-route-yard>div{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin-top:13px}
.trh-route-yard article{position:relative;display:grid;justify-items:center;min-height:105px;padding:12px 8px;border:1px solid #dce4ea;border-radius:14px;background:#f5f7f9;text-align:center}
.trh-route-yard article>i{display:grid;place-items:center;width:39px;height:39px;border:5px solid #c8d4de;border-radius:50%;color:#4e6478;background:#fff;font-size:9px;font-style:normal;font-weight:900}
.trh-route-yard article>b{margin-top:7px;font-size:10px}.trh-route-yard article>small{margin-top:3px;color:var(--trh-muted);font-size:8px}
.trh-route-yard article.is-xrp{border-color:rgba(23,92,255,.38);background:#eef3ff;box-shadow:0 11px 24px rgba(23,92,255,.08)}
.trh-route-yard article.is-xrp>i{border-color:#8caeff;color:#fff;background:var(--trh-blue);animation:trhGlow 2.8s ease-in-out infinite}
.trh-route-yard article>em{position:absolute;top:7px;right:7px;padding:3px 5px;border-radius:999px;color:var(--trh-blue);background:#fff;font-size:8px;font-style:normal;font-weight:900}

.top-residual-verdict{display:grid;grid-template-columns:auto 1fr;gap:14px;align-items:center;margin:0;padding:16px 20px;color:#fff;background:#111d2d}
.top-residual-verdict span{padding:5px 8px;border-radius:999px;color:#9fc0ff;background:rgba(255,255,255,.08);font-size:8px;font-weight:900;white-space:nowrap}
.top-residual-verdict strong{font-size:10px;line-height:1.65}

.prime-inventory-clarifier{display:grid;grid-template-columns:auto 1fr;gap:6px 13px;padding:16px 18px;border-top:1px solid #e3e9f0;background:linear-gradient(135deg,#f8fbff,#f4f8f6)}
.prime-inventory-clarifier>span{grid-row:1 / span 3;align-self:start;padding:5px 7px;border-radius:999px;color:#fff;background:#172a43;font-size:8px;font-weight:900;letter-spacing:.06em}
.prime-inventory-clarifier>strong{font-size:11px;line-height:1.55}
.prime-inventory-clarifier>p{display:flex;flex-wrap:wrap;gap:5px;align-items:center;margin:0}
.prime-inventory-clarifier>p b{padding:4px 6px;border-radius:7px;color:#175cff;background:#fff;font-size:8px;box-shadow:0 5px 12px rgba(23,92,255,.07)}
.prime-inventory-clarifier>p i{width:10px;height:1px;background:#9fb0c0}
.prime-inventory-clarifier>small{color:#5e7081;font-size:8px;line-height:1.55}

.inventory-access-rails{display:grid;grid-template-columns:1fr auto 1fr;gap:12px;align-items:center;padding:16px 18px;border-top:1px solid #dfe6ed;background:#f6f9fb}
.inventory-access-rails>div{display:grid;gap:3px;padding:12px 14px;border:1px solid #d6e0e8;border-radius:13px;background:#fff}
.inventory-access-rails span{color:#175cff;font-size:8px;font-weight:900;letter-spacing:.08em}
.inventory-access-rails strong{font-size:11px}.inventory-access-rails small{color:#607184;font-size:8px;line-height:1.5}
.inventory-access-rails>b{color:#718295;font-size:8px;text-align:center}

@keyframes trhPulse{0%,100%{transform:scale(.82);opacity:.55}50%{transform:scale(1.16);opacity:1}}
@keyframes trhSpin{to{transform:rotate(360deg)}}
@keyframes trhPacket{0%{transform:translateX(0);opacity:0}18%,82%{opacity:1}100%{transform:translateX(27px);opacity:0}}
@keyframes trhGlow{0%,100%{box-shadow:0 0 0 0 rgba(23,92,255,0)}50%{box-shadow:0 0 0 8px rgba(23,92,255,.13)}}

@media (max-width:620px){
  .top-residual-hierarchy{border-radius:23px}
  .top-residual-head{display:grid;gap:6px;padding:18px 17px}
  .top-residual-head .figure-claim-title{font-size:17px}
  .top-residual-head .figure-claim-note{max-width:none;text-align:left}
  .top-residual-stage{gap:10px;padding:13px}
  .trh-execution-deck{grid-template-columns:58px 1fr;gap:10px;min-height:112px;padding:12px}
  .trh-execution-deck>em{grid-column:1 / -1;justify-self:stretch}
  .trh-order-art{width:56px;height:54px;border-width:4px}
  .trh-split-pipe{height:37px;margin:-5px 8% -6px}
  .trh-books{grid-template-columns:1fr;gap:9px}
  .trh-book{grid-template-rows:auto 69px auto auto;padding:14px}
  .trh-machine-art{width:64px;height:64px;border-width:8px}
  .trh-fiat-complete{grid-template-columns:1fr;gap:5px;padding:13px}.trh-fiat-complete span{grid-row:auto;justify-self:start}
  .trh-treasury-lab{grid-template-columns:64px 1fr;gap:11px;padding:13px}.trh-treasury-lab>em{grid-column:1 / -1;text-align:center}
  .trh-pool-art{width:62px;height:62px;border-width:7px}.trh-pool-art i{bottom:9px}.trh-pool-art i:first-child{left:9px}.trh-pool-art i:nth-child(2){right:9px}
  .trh-new-order{grid-template-columns:1fr 34px;gap:5px 10px;padding:12px}.trh-new-order span{grid-column:1}.trh-new-order strong{grid-column:1;grid-row:2}.trh-new-order i{grid-column:2;grid-row:1 / span 2;width:32px}
  .trh-route-yard{padding:13px}.trh-route-yard header{display:grid;gap:4px}.trh-route-yard header strong{text-align:left}
  .trh-route-yard>div{gap:5px}.trh-route-yard article{min-height:101px;padding:10px 4px}.trh-route-yard article>em{position:static;margin-top:4px;font-size:8px}
  .top-residual-verdict{grid-template-columns:1fr;gap:7px;padding:14px 15px}.top-residual-verdict span{justify-self:start;white-space:normal}
  .prime-inventory-clarifier{grid-template-columns:1fr;padding:14px}.prime-inventory-clarifier>span{grid-row:auto;justify-self:start}.prime-inventory-clarifier>p i{display:none}
  .inventory-access-rails{grid-template-columns:1fr;gap:7px;padding:13px}.inventory-access-rails>b{padding:2px}
}

@media (max-width:390px){
  .top-residual-head .figure-claim-title{font-size:16px}
  .trh-execution-deck strong{font-size:12px}.trh-execution-deck small{font-size:8px}
  .trh-book header{display:grid;gap:3px}.trh-book header strong{text-align:left}
  .trh-treasury-lab strong{font-size:11px}.trh-treasury-lab p{font-size:8px}
  .trh-route-yard article>i{width:34px;height:34px}.trh-route-yard article>b{font-size:9px}
  .fx-world-principle{grid-template-columns:1fr!important}.fx-world-principle>div{padding:8px!important}
}

@media (prefers-reduced-motion:reduce){
  .top-residual-hierarchy *,
  .top-residual-hierarchy *::before,
  .top-residual-hierarchy *::after{
    animation:none!important;
    transition:none!important;
  }
}
