/* DollarValue — dark instrument; BubblinCrude + GlobalFlows cues */
:root {
  --bg: #07090c;
  --bg2: #10141a;
  --bg3: #181e26;
  --line: rgba(255, 255, 255, 0.08);
  --text: #e8edf5;
  --muted: #8b97a8;
  --gold: #e6c15a;
  --gold-dim: rgba(230, 193, 90, 0.16);
  --blue: #6cb2f2;
  --green: #3d9a6a;
  --red: #d45b5b;
  --accent: #e6c15a;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --display: "Michroma", system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --pwa-fill-h: 100%;
  --pwa-extra-b: 0px;
  --vv-top: 0px;
  --vv-left: 0px;
  --vv-w: 100%;
  --vv-h: 100%;
  --drum-h: 6.6rem;
  --row-h: 1.32rem;
  --dv-css: 78;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
}

html.dv-live,
html.dv-live body {
  height: 100%;
  overflow: hidden;
}

/* Bug B: html/body grow IN FLOW. Never position:fixed on them. Never 100dvh. */
html.pwa-standalone,
html.pwa-standalone body {
  position: static;
  height: calc(var(--pwa-fill-h) + var(--pwa-extra-b));
  min-height: calc(var(--pwa-fill-h) + var(--pwa-extra-b));
  max-height: none;
}

/* HyperMiler fit-stage: pin to visualViewport (Safari) or fillH (PWA). */
.fit-stage {
  position: fixed;
  top: var(--vv-top, 0px);
  left: var(--vv-left, 0px);
  width: var(--vv-w, 100%);
  height: var(--vv-h, 100%);
  right: auto;
  bottom: auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) 0
    env(safe-area-inset-left, 0px);
  box-sizing: border-box;
  background: var(--bg);
}

html.pwa-standalone .fit-stage {
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  width: 100%;
  height: calc(var(--pwa-fill-h) + var(--pwa-extra-b));
  min-height: calc(var(--pwa-fill-h) + var(--pwa-extra-b));
}

.app {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  overflow: hidden;
  padding: 2px 4px 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Numbers can scroll. The wheels keep a real height, so a short
   window (Safari's top domain and bottom pill) cannot crush them. */
.readout {
  flex: 0 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  -webkit-overflow-scrolling: touch;
}

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px 2px;
}

.topbar-title {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.brand-title {
  margin: 0;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 22px;
  white-space: nowrap;
}

.about-i {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin-left: 2px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  font-style: italic;
  line-height: 1.15rem;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.about-i:active {
  color: var(--gold);
  border-color: rgba(230, 193, 90, 0.35);
}

@media (min-width: 700px) {
  .brand-title {
    font-size: 24px;
    line-height: 26px;
  }
}

.hero[hidden] {
  display: none !important;
}

.hero {
  flex-shrink: 0;
  height: auto;
  min-height: 68px;
  box-sizing: border-box;
  display: flex;
  gap: 3px;
  padding: 0;
  background: transparent;
  border: 0;
}

.hero-side {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 3px 3px;
  text-align: center;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.hero-side.is-empty {
  display: none;
}

.hero-amt {
  margin: 0;
  font-family: var(--display);
  font-size: 2.55rem;
  letter-spacing: -0.03em;
  line-height: 0.95;
  color: var(--text);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hero-amt-now {
  color: var(--gold);
}

.hero-unit {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.1;
  color: var(--muted);
  letter-spacing: 0.02em;
  max-width: 100%;
  overflow: hidden;
}

.hero-unit[hidden] {
  display: none !important;
}

.hero-cap {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.2;
  font-weight: 500;
  color: var(--text);
  text-align: center;
  white-space: normal;
  overflow: hidden;
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.hero-cap.is-hot {
  color: var(--red);
}
.hero-cap.is-cool {
  color: var(--green);
}

.hero-measure {
  flex-shrink: 0;
  margin: 0;
  padding: 0 2px;
  font-family: var(--mono);
  font-size: 0.58rem;
  line-height: 1.2;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
}

.hero-measure[hidden] {
  display: none !important;
}

.hero-counter {
  min-height: 52px;
}

.hero-counter .hero-amt {
  font-size: 1.7rem;
}

.plain {
  flex-shrink: 0;
  margin: 0;
  padding: 0 2px;
  max-height: 5.6em;
  overflow: hidden;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text);
}

.plain[hidden] {
  display: none !important;
}

/* Says what a row is, which no figure in it can. One line, always. */
.row-note {
  flex-shrink: 0;
  margin: 0;
  padding: 0 3px;
  font-size: 0.68rem;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-note[hidden] {
  display: none !important;
}

.chart {
  flex: 0 1 156px;
  min-height: 112px;
  max-height: 176px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.chart[hidden] {
  display: none !important;
}

.chart-plot {
  flex: 1 1 auto;
  min-height: 0;
}

.chart-plot svg {
  display: block;
  width: 100%;
  height: 100%;
}

.dials {
  flex: 1 1 auto;
  min-height: 18rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

html.pwa-standalone .dials {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.dial-pair {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.dial-row {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.dial-row.has-amt {
  grid-template-columns: 1.15fr 1.15fr 0.72fr;
}

.dial {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 2px 2px;
  min-width: 0;
}

.dial-label {
  flex-shrink: 0;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 6px 2px;
}

.dial > .drum-shell {
  flex: 1 1 auto;
  height: auto;
}

.drums {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  min-width: 0;
}

.drum-shell {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.drum-shell:focus-within::before {
  border-color: var(--gold);
}

.drum:focus {
  outline: none;
}

.drum-shell::before {
  content: "";
  pointer-events: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: var(--row-h);
  transform: translateY(-50%);
  border-top: 1px solid rgba(230, 193, 90, 0.28);
  border-bottom: 1px solid rgba(230, 193, 90, 0.28);
  background: var(--gold-dim);
  z-index: 1;
}

.drum {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 18%,
    #000 82%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 18%,
    #000 82%,
    transparent 100%
  );
}

.drum-fast {
  scroll-snap-type: none;
}

.drum-list {
  list-style: none;
  margin: 0;
  padding: calc(var(--drum-h) / 2 - var(--row-h) / 2) 0;
}

.drum-list li {
  height: var(--row-h);
  scroll-snap-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  padding: 0 2px;
}

.drum-list li.is-on {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.9rem;
}

#drumItem .drum-list li.is-on {
  color: var(--blue);
}

#drumItem.is-yard .drum-list li.is-on {
  color: var(--gold);
}

.drum-list li.is-dead {
  color: var(--muted);
  opacity: 0.28;
}

.drum.is-locked {
  opacity: 0.38;
  pointer-events: none;
}

.drum-wide .drum-list li {
  font-family: var(--sans);
  font-size: 0.72rem;
  justify-content: flex-start;
  padding: 0 8px;
}

.drum-wide .drum-list li.is-on {
  font-size: 0.78rem;
}

.dial-amt[hidden] {
  display: none !important;
}

.about-body {
  max-width: 36rem;
  margin: 0 auto;
  padding: calc(var(--safe-t) + 12px) 14px calc(24px + var(--safe-b));
}

.about-body h1 {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 400;
  margin-bottom: 0.7rem;
}

.about-lede {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.45;
}

.about-body h2 {
  margin: 1.5rem 0 0.5rem;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.about-key {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
}

.about-key li {
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
  margin: 0 0 0.35rem;
}

.about-key span {
  flex: 0 0 3.4rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}

.about-sources {
  margin-top: 1.35rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.about-body p,
.about-body li {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.about-body a {
  color: var(--gold);
}
