/* ============================================================
   The live readout.

   Every colour here is a shadcn token the theme already defines
   (--card, --border, --muted-foreground, --primary …), so the panel
   follows the theme into dark mode without a second palette and
   without a .dark block of its own.
   ============================================================ */

.ct-readout {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 0.5rem);
  overflow: hidden;
  margin: 1.75rem 0;
}

/* No script, no panel: an empty bordered box is worse than nothing. */
.ct-readout:empty,
[data-readout]:empty {
  display: none;
}

.ct-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.ct-top {
  display: flex;
  align-items: stretch;
  gap: 1.25rem 3rem;
  padding: 1.25rem 1.35rem 0.9rem;
  flex-wrap: wrap;
}

.ct-main,
.ct-side,
.ct-readout dd {
  margin: 0;
}

.ct-main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: none;
}

.ct-side {
  flex: 1 1 auto;
  display: flex;
  justify-content: space-between;
  gap: 1.25rem 1.6rem;
  flex-wrap: wrap;
}

@media (max-width: 45rem) {
  /* Spreading a half-empty wrapped row just scatters it. */
  .ct-side {
    justify-content: flex-start;
  }
}

.ct-cell {
  min-width: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* Optical: drops the small values onto the tick's baseline rather than
     the bottom of its line box. */
  padding-bottom: 0.4em;
}

.ct-lbl {
  font-family: var(--font-mono), monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  display: block;
  margin-bottom: 0.3rem;
}

.ct-val {
  font-family: var(--font-mono), monospace;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
}

.ct-tick {
  /* Width of one character cell. Geist Mono's digits are uniform, so this
     could be `auto` — it is kept explicit because the thousands gap below
     is drawn as a cell rather than as a space character, and the two want
     to stay in proportion. */
  --tick-cell: 0.62em;
  --tick-gap: 0.26em;

  font-family: var(--font-mono), monospace;
  font-size: clamp(1.7rem, 5.4vw, 2.9rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--foreground);
}

.ct-tick .ct-dg,
.ct-tick .ct-sep {
  display: inline-block;
  text-align: center;
}

.ct-tick .ct-dg {
  width: var(--tick-cell);
}

.ct-tick .ct-sep {
  width: var(--tick-gap);
}

.ct-sweep {
  height: 3px;
  background: var(--muted);
  position: relative;
}

.ct-sweep i {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--primary);
  width: 0;
}

.ct-form {
  padding: 0.8rem 1.35rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--muted);
  font-family: var(--font-mono), monospace;
  font-size: 0.85rem;
  color: var(--muted-foreground);
  overflow-x: auto;
  white-space: nowrap;
}

.ct-form b {
  color: var(--primary);
  font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
  .ct-sweep i {
    transition: none;
  }
}
