/* ═══════════════════════════════════════════════════════════════════
   THE DIAL — a soft-touch instrument, moulded rather than drawn.
   Everything is tone-on-tone blush: forms are read from light and
   shadow, never from colour contrast. The only saturated ink in the
   whole system is the needle and the type.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* the paper, sampled straight from the reference */
  --paper:      #FCE4E4;
  --paper-hi:   #FCEAEA;
  --paper-lo:   #FCDEDE;
  --sunk:       #F6D8D8;
  --sunk-deep:  #F6CCCC;
  --white:      #FFFFFF;

  /* the ink */
  --ink:        #9B2C3E;
  --accent:     #C9475A;
  --ink-60:     #B0616F;
  --ink-40:     #C68A94;

  /* moulded light: one source, upper-left */
  --lift:  -7px -7px 16px rgba(255,255,255,.92), 7px 7px 18px rgba(190,120,130,.26);
  --lift-s: -3px -3px 7px rgba(255,255,255,.85), 3px 3px 8px rgba(190,120,130,.22);
  --press: inset -4px -4px 9px rgba(255,255,255,.85), inset 4px 4px 10px rgba(190,120,130,.26);
  --press-s: inset -2px -2px 5px rgba(255,255,255,.8), inset 2px 2px 6px rgba(190,120,130,.24);

  --display: "Fraunces", Georgia, serif;
  --mono: "DM Mono", ui-monospace, monospace;
  --body: "Figtree", system-ui, sans-serif;

  --ease: cubic-bezier(.22, 1, .36, 1);
  /* the needle has mass: it overshoots a touch and settles */
  --settle: cubic-bezier(.34, 1.5, .5, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.55;
  overflow: hidden;
  position: relative;
}

/* the faint embossed arcs of the reference, ghosted into the corners */
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(1100px 780px at 50% 40%, rgba(255,255,255,.55), transparent 62%),
    radial-gradient(620px 620px at 96% 4%,  rgba(246,204,204,.5), transparent 60%),
    radial-gradient(700px 700px at 2% 98%,  rgba(246,204,204,.45), transparent 62%);
}

::selection { background: var(--accent); color: var(--white); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.label {
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-40);
}

/* ── shell ───────────────────────────────────────────────────────── */

.app { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100vh; }

.topbar {
  flex: none; height: 68px;
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
}
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand img {
  width: 40px; height: 40px; border-radius: 50%;
  /* the logo ships with a grey plate; crop to the disc and re-seat it */
  object-fit: cover; transform: scale(1.32);
  box-shadow: var(--lift-s);
}
.brand .n {
  font-family: var(--display);
  font-weight: 600; font-size: 1.22rem;
  font-variation-settings: "SOFT" 60, "WONK" 1;
  letter-spacing: .01em;
}
.brand .s { font-family: var(--mono); font-size: .56rem; letter-spacing: .19em; color: var(--ink-40); }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: .64rem; letter-spacing: .1em;
  padding: 9px 14px; border-radius: 999px;
  color: var(--ink-60); background: var(--paper);
  box-shadow: var(--press-s);
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-40); }
.chip.live .dot { background: var(--accent); animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

.btn {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .13em; text-transform: uppercase;
  padding: 12px 20px; border-radius: 999px;
  color: var(--ink); background: var(--paper);
  box-shadow: var(--lift-s);
  transition: box-shadow .22s var(--ease), transform .16s var(--ease), color .2s;
}
.btn:hover { color: var(--accent); transform: translateY(-1px); }
.btn:active { box-shadow: var(--press-s); transform: translateY(0); }
.btn.solid { color: var(--white); background: linear-gradient(145deg, var(--accent), var(--ink)); }
.btn.solid:hover { color: var(--white); filter: brightness(1.06); }

/* ── columns ─────────────────────────────────────────────────────── */

.main { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px 1fr 330px; gap: 22px; padding: 0 22px 22px; }
@media (max-width: 1240px) { .main { grid-template-columns: 270px 1fr; } .rail-right { display: none; } }
@media (max-width: 900px)  { .main { grid-template-columns: 1fr; } .rail-left { display: none; } }

.rail { overflow-y: auto; padding-right: 4px; }
.rail::-webkit-scrollbar { width: 5px; }
.rail::-webkit-scrollbar-thumb { background: var(--sunk-deep); border-radius: 3px; }

.stage { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* ── moulded panels ──────────────────────────────────────────────── */

.card {
  background: var(--paper); border-radius: 20px;
  box-shadow: var(--lift); padding: 17px 18px; margin-bottom: 16px;
}
.card.sunk { box-shadow: var(--press); }

.read + .read { margin-top: 15px; padding-top: 15px; border-top: 1px solid rgba(155,44,62,.09); }
.read .v {
  font-family: var(--mono); font-size: 1.3rem; font-variant-numeric: tabular-nums;
  letter-spacing: -.02em; margin-top: 5px;
}
.read .v small { font-size: .6rem; color: var(--ink-40); letter-spacing: .1em; margin-left: 6px; }
.read .hint { font-size: .74rem; color: var(--ink-40); margin-top: 4px; line-height: 1.5; }

/* imbalance: a channel cut into the surface */
.bar {
  height: 9px; border-radius: 999px; margin-top: 11px;
  background: var(--sunk); box-shadow: var(--press-s);
  position: relative; overflow: hidden;
}
.bar i {
  position: absolute; inset: 1px auto 1px 1px; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--ink-40), var(--accent) 70%, var(--ink));
  transition: width 1s var(--ease);
}

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── the gauge ───────────────────────────────────────────────────── */

.gauge-wrap {
  position: relative; width: min(53vh, 100%); aspect-ratio: 1;
  border-radius: 50%; background: var(--paper);
  box-shadow: var(--lift);
  display: grid; place-items: center;
}
/* the bezel ring, seated in the face */
.gauge-wrap::before {
  content: ""; position: absolute; inset: 4.5%;
  border-radius: 50%; box-shadow: var(--press);
}
.gauge { position: relative; width: 88%; height: 88%; overflow: visible; }

/* The needle carries no CSS transform at all — its three points are computed
   from the angle in JS and eased frame by frame. Rotating an SVG child by CSS
   means depending on transform-box, and getting the pivot subtly wrong makes
   the needle swing from the wrong place or vanish outright. */

.readout { margin-top: 14px; text-align: center; }
.fee-now {
  font-family: var(--mono); font-weight: 500;
  font-size: clamp(2.3rem, 6vw, 3.7rem); line-height: 1;
  letter-spacing: -.055em; font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.fee-cap { margin-top: 4px; }

.verdict {
  margin-top: 12px; text-align: center; max-width: 46ch;
  font-family: var(--display); font-size: 1.02rem; line-height: 1.45;
  font-variation-settings: "SOFT" 60;
  color: var(--ink-60);
}
.verdict b { color: var(--ink); font-weight: 600; }

/* ── flow tape ───────────────────────────────────────────────────── */
/* Direction is encoded by POSITION, never by hue — the gauge already
   owns the one meaningful colour axis and must not be overloaded. */
.tape {
  width: min(53vh, 100%); height: 56px; margin-top: 16px;
  border-radius: 16px; background: var(--paper);
  box-shadow: var(--press); position: relative; overflow: hidden;
}
.tape::after {
  content: ""; position: absolute; left: 14px; right: 14px; top: 50%;
  border-top: 1px dashed rgba(155,44,62,.16);
}
.tape i { position: absolute; width: 3px; border-radius: 2px; background: var(--ink-40); }
.tape .resting {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--mono); font-size: .62rem; letter-spacing: .13em; color: var(--ink-40);
}
.tape i.buy  { bottom: 50%; background: linear-gradient(180deg, var(--accent), var(--ink-40)); }
.tape i.sell { top: 50%;    background: linear-gradient(0deg,  var(--accent), var(--ink-40)); }
.tape .tape-lab {
  position: absolute; left: 14px; top: 8px;
  font-family: var(--mono); font-size: .55rem; letter-spacing: .17em; color: var(--ink-40);
}
.tape .tape-lab.b { top: auto; bottom: 8px; }

/* ── simulator ───────────────────────────────────────────────────── */

.sim { margin-top: 16px; width: min(53vh, 100%); }
.sim-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sim-reset {
  font-family: var(--mono); font-size: .55rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-60);
  padding: 5px 11px; border-radius: 999px; box-shadow: var(--lift-s);
  transition: color .2s var(--ease);
}
.sim-reset:hover { color: var(--accent); }
.sim-tag {
  font-family: var(--mono); font-size: .55rem; letter-spacing: .16em;
  color: var(--white); background: var(--ink-40);
  padding: 4px 9px; border-radius: 999px;
}
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; background: transparent; }
input[type="range"]::-webkit-slider-runnable-track {
  height: 9px; border-radius: 999px; background: var(--sunk); box-shadow: var(--press-s);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; margin-top: -6.5px; border-radius: 50%;
  background: var(--paper-hi); box-shadow: var(--lift-s); cursor: grab;
  border: 2px solid var(--paper);
}
input[type="range"]::-webkit-slider-thumb:active { cursor: grabbing; }
input[type="range"]::-moz-range-track { height: 9px; border-radius: 999px; background: var(--sunk); }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--paper-hi); }

/* ── seals ───────────────────────────────────────────────────────── */

.seal {
  background: var(--paper); border-radius: 14px;
  box-shadow: var(--lift-s); padding: 12px 13px; margin-bottom: 10px;
  transition: box-shadow .22s var(--ease);
}
.seal:hover { box-shadow: var(--press-s); }
.seal .top { display: flex; justify-content: space-between; align-items: baseline; }
.seal .ep { font-family: var(--mono); font-size: .72rem; color: var(--ink-40); }
.seal .fee { font-family: var(--mono); font-size: .86rem; color: var(--ink); }
.seal .hash { font-family: var(--mono); font-size: .58rem; color: var(--ink-40); margin-top: 6px; word-break: break-all; }
.seal .rng { font-family: var(--mono); font-size: .6rem; color: var(--ink-40); margin-top: 4px; }

.empty {
  border-radius: 14px; padding: 18px; background: var(--paper);
  box-shadow: var(--press-s);
  font-size: .78rem; color: var(--ink-40); line-height: 1.6;
}

.note { font-size: .73rem; line-height: 1.65; color: var(--ink-40); margin-top: 14px; }
.note b { color: var(--ink-60); font-weight: 600; }

.addr {
  display: flex; justify-content: space-between; gap: 8px;
  font-family: var(--mono); font-size: .64rem; padding: 8px 0;
}
.addr + .addr { border-top: 1px solid rgba(155,44,62,.08); }
.addr span:first-child { color: var(--ink-40); }
.addr a { color: var(--ink-60); }
.addr a:hover { color: var(--accent); }

.sec { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }

/* ── entrance ────────────────────────────────────────────────────── */

.rise { opacity: 0; transform: translateY(13px); animation: rise .85s var(--ease) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
.d1 { animation-delay: .05s } .d2 { animation-delay: .14s } .d3 { animation-delay: .24s } .d4 { animation-delay: .34s }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rise { opacity: 1; transform: none; }
}
