:root {
  --paper: #f2f1ed;        /* the soft page */
  --card: #fdfdfb;         /* the wallet card */
  --ink: #15171c;          /* titles, the needle, the figures */
  --muted: #8b8e95;        /* small print, the ticks still to go */
  --line: #e4e3de;         /* hairlines, the dial track */
  --accent: #4b4ff0;       /* the single accent: the lit ticks, the fill, the packet, the chosen speed */
  --busy: #c2552f;         /* only the word Busy when the network gets congested */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: radial-gradient(120% 90% at 50% 0%, #f8f7f4 0%, var(--paper) 60%);
  color: var(--ink);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: "JetBrains Mono Variable", ui-monospace, monospace; font-variant-numeric: tabular-nums; }

.stage {
  height: 100vh;
  display: grid;
  place-items: center;
  padding: 2vh 12px;
}

.fee {
  width: min(400px, 92vw);
  background: var(--card);
  border: 1px solid #e9e8e2;
  border-radius: min(22px, 4.6vh);
  padding: min(18px, 3.4vh) min(20px, 4.6vw) min(16px, 3vh);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .95) inset, 0 1px 2px rgba(20, 22, 40, .05), 0 12px 26px -16px rgba(20, 22, 40, .2), 0 34px 64px -34px rgba(20, 22, 40, .34);
  display: flex;
  flex-direction: column;
  gap: min(12px, 2.1vh);
}

.fee__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

.eyebrow { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 560; color: var(--muted); }
.eyebrow__mark { width: 13px; height: 13px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

h1 {
  font-size: clamp(15px, min(4.6vw, 3.4vh), 20px);
  font-weight: 640;
  font-variation-settings: "wdth" 94;
  letter-spacing: -.015em;
  margin-top: 3px;
  white-space: nowrap;
}

.net {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 560;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px 4px 9px;
  white-space: nowrap;
  margin-top: 2px;
}
.net__state { color: var(--ink); transition: color .3s; }
.net.is-busy .net__state { color: var(--busy); }

.dial { display: flex; flex-direction: column; align-items: center; gap: min(4px, .8vh); }

.dial__svg {
  width: 100%;
  height: clamp(84px, 29vh, 172px);
  overflow: visible;
}

.dial__track { fill: none; stroke: var(--line); stroke-width: 2; stroke-linecap: round; }
.dial__fill { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: .9; }

.tick { stroke: #cfd0d4; stroke-width: 1.4; stroke-linecap: round; transition: stroke .35s ease-out; }
.tick.is-lit { stroke: var(--accent); transition-duration: .12s; }
.tick--major { stroke-width: 1.8; }
.dial__labels text { font: 500 9.5px "JetBrains Mono Variable", ui-monospace, monospace; fill: var(--muted); text-anchor: middle; dominant-baseline: middle; }

.base__notch { fill: var(--ink); opacity: .85; }

.dial__glass { fill: none; stroke: #eef0ff; stroke-width: 3; stroke-linecap: round; opacity: .9; }

.needle-shadow path { fill: rgba(20, 22, 40, .28); }
.needle__body { fill: var(--ink); }
.needle__shine { stroke: rgba(255, 255, 255, .38); stroke-width: .8; stroke-linecap: round; fill: none; }
.pivot { fill: var(--card); stroke: var(--ink); stroke-width: 1.6; }
.pivot__dot { fill: var(--ink); }

.readout { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: min(-2px, -.2vh); }
.readout__time {
  font-size: clamp(22px, min(7vw, 5.6vh), 30px);
  font-weight: 660;
  font-variation-settings: "wdth" 92;
  letter-spacing: -.02em;
  line-height: 1;
}
.readout__cost { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; color: var(--muted); line-height: 1; }
.readout__cost .roll { color: var(--ink); font-weight: 520; }
.unit { font-size: 11.5px; }
.sep { width: 1px; height: 10px; background: var(--line); align-self: center; }

/* the rolling digits: one column per digit, a strip of 0-9 inside */
.roll { display: inline-flex; line-height: 1; height: 1em; overflow: hidden; vertical-align: top; font-variant-numeric: tabular-nums; }
.roll__ch { display: inline-block; height: 1em; }
.roll__col { display: inline-block; height: 1em; overflow: hidden; position: relative; }
.roll__strip { display: flex; flex-direction: column; }
.roll__strip span { height: 1em; display: block; text-align: center; }

.tx { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--muted); }
.tx__end { white-space: nowrap; }
.tx__block { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); }
.tx__block svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linejoin: round; }
.tx__line { position: relative; flex: 1; height: 1px; background: var(--line); }
.tx__done { position: absolute; left: 0; top: 0; height: 1px; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); opacity: .55; }
.tx__packet {
  position: absolute; left: 0; top: -2px; width: 12px; height: 5px; border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 1px 2px rgba(40, 44, 160, .25);
}

.speeds {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #f1f0ec;
  border: 1px solid #e7e6e0;
  border-radius: 13px;
  padding: 3px;
}
.speeds__pill {
  position: absolute; top: 3px; left: 0; bottom: 3px; width: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 1px 2px rgba(20, 22, 40, .08), 0 4px 10px -4px rgba(20, 22, 40, .16);
  pointer-events: none;
}
.speed {
  position: relative;
  appearance: none; border: 0; background: none; font: inherit; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: min(8px, 1.4vh) 4px;
  border-radius: 10px;
  cursor: pointer;
  transition: color .25s;
  -webkit-tap-highlight-color: transparent;
}
.speed__name { font-size: 13px; font-weight: 600; font-variation-settings: "wdth" 96; line-height: 1; }
.speed__eta { font-size: 10px; line-height: 1; opacity: .85; }
.speed[aria-checked="true"] { color: var(--ink); }
.speed[aria-checked="true"] .speed__eta { color: var(--accent); opacity: 1; }
.speed:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (hover: hover) {
  .speed:hover { color: var(--ink); }
}
.speed.is-preview { color: var(--ink); }

@media (max-width: 420px) {
  .tx__end.mono { display: none; }
}
