:root {
  --bg: #ffffff;
  --card: #ffffff;
  --ink: #15171a;
  --soft: rgba(21, 23, 26, 0.52);
  --line: rgba(21, 23, 26, 0.09);
  --accent: #f26a1b;
  --drum: 54px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 10px 16px;
}

.mr {
  width: min(332px, 100%);
  padding: 14px 14px 12px;
  border-radius: 28px;
  background: var(--card);
  box-shadow:
    0 0 0 1px rgba(21, 23, 26, 0.07),
    0 1px 2px rgba(21, 23, 26, 0.05),
    0 14px 28px -12px rgba(21, 23, 26, 0.16),
    0 44px 70px -34px color-mix(in srgb, var(--accent) 30%, rgba(21, 23, 26, 0.3));
}
.mr__head { display: flex; align-items: center; justify-content: space-between; height: 24px; padding: 0 2px; }
.mr__title { font-size: 15px; font-weight: 680; font-stretch: 108%; letter-spacing: -0.008em; }
.mr__kind { height: 22px; padding: 0 9px; border-radius: 11px; background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); font-size: 11.5px; line-height: 22px; font-weight: 660; }

/* the meter's window: a dark plate with five drums behind it */
.mr__window {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 10px;
  padding: 9px 34px 9px 12px;
  border-radius: 18px;
  background: #1a1c20;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6), inset 0 -1px 0 rgba(255, 255, 255, 0.07);
}
.mr__unit { position: absolute; right: 11px; bottom: 12px; font-size: 11px; font-weight: 640; color: rgba(255, 255, 255, 0.5); }
.drum {
  position: relative;
  width: 40px;
  height: var(--drum);
  border: 0;
  border-radius: 7px;
  background: #f4f3ef;
  color: var(--ink);
  font: inherit;
  overflow: hidden;
  cursor: ns-resize;
  outline: none;
  touch-action: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.drum__strip { position: absolute; left: 0; top: 0; width: 100%; }
.drum__strip b { display: block; height: var(--drum); font-size: 30px; line-height: var(--drum); font-weight: 620; font-stretch: 92%; text-align: center; }
/* the curve of the drum: darker at the top and bottom edges */
.drum::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(0, 0, 0, 0.42) 0%, rgba(0, 0, 0, 0) 26%, rgba(0, 0, 0, 0) 74%, rgba(0, 0, 0, 0.42) 100%); pointer-events: none; }
.drum:focus-visible { box-shadow: 0 0 0 2px #1a1c20, 0 0 0 4px var(--accent); }
.drum.is-changed .drum__strip { color: var(--accent); }

.mr__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; padding: 0 2px; }
.mr__facts dt { font-size: 11px; font-weight: 560; color: var(--soft); }
.mr__facts dd { height: 22px; overflow: hidden; font-size: 16px; line-height: 22px; font-weight: 660; white-space: nowrap; }
.mr__facts div:last-child { text-align: right; }
.mr__used span { display: block; }
.mr.is-low .mr__used { color: var(--accent); }

.mr__send {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 46px;
  margin-top: 10px;
  padding: 0 16px 0 18px;
  border: 0;
  border-radius: 23px;
  background: var(--ink);
  color: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 640;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color 0.3s ease, opacity 0.3s ease;
}
.mr__send:disabled { opacity: 0.35; cursor: default; }
.mr.is-sent .mr__send { background: #1f9d57; }
.mr__label { height: 20px; overflow: hidden; line-height: 20px; }
.mr__label span { display: block; white-space: nowrap; }
.mr__send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.900; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.mr__tick { stroke-dasharray: 1; stroke-dashoffset: 1; }
.mr__send:focus-visible { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--ink); }

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #15171a;
  stroke: #ffffff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}

@media (max-height: 380px) { :root { --drum: 46px; } .drum__strip b { font-size: 26px; } }
@media (max-width: 330px) { .drum { width: 36px; } .mr__window { gap: 4px; padding-left: 9px; padding-right: 30px; } }
