:root {
  --bg: #ffffff;
  --ink: #14151a;
  --muted: #7d808c;
  --line: #e8e8ed;
  --track: #eeeef2;
  --accent: #4a5cff;
  --warn: #f08c00;
}

*, *::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: 16px;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- the card ---- */
.card {
  position: relative;
  width: min(388px, 100%);
  min-width: 0;
  padding: clamp(12px, 3.6vh, 20px) 10px clamp(6px, 1.6vh, 10px);
  border-radius: 24px;
  background: #ffffff;
  box-shadow:
    0 0 0 1px var(--line),
    0 1px 1px rgba(20, 21, 26, 0.04),
    0 12px 26px -12px rgba(20, 21, 26, 0.14),
    0 36px 64px -32px rgba(20, 21, 26, 0.22);
}
.head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px clamp(6px, 2vh, 12px);
}
.head h2 { font-size: 16px; font-weight: 640; letter-spacing: -0.01em; }
.head__plan {
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, #ffffff);
  color: color-mix(in srgb, var(--accent) 86%, #14151a);
  font-size: 11.5px;
  font-weight: 620;
  line-height: 22px;
  white-space: nowrap;
}
.head__reset { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* ---- one meter ---- */
.meter {
  --c: var(--accent);
  padding: clamp(6px, 1.9vh, 10px) 10px clamp(8px, 2.3vh, 12px);
  border-radius: 14px;
  cursor: default;
  transition: background-color 0.25s ease;
}
.meter.is-hot { background: #f6f6f9; }
.meter.is-near { --c: var(--warn); }
.meter__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  line-height: 20px;
}
.meter__name { font-weight: 560; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.meter__val {
  position: relative;
  display: grid;
  justify-items: end;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}
.meter__now, .meter__pace { grid-area: 1 / 1; transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.3, 1.3, 0.5, 1); }
.meter__now b { font-weight: 620; color: var(--ink); transition: color 0.4s ease; }
.meter.is-near .meter__now b { color: color-mix(in srgb, var(--warn) 80%, #14151a); }
.meter__pace { opacity: 0; transform: translateY(6px); color: color-mix(in srgb, var(--c) 80%, #14151a); font-weight: 560; }
.meter.is-hot .meter__now { opacity: 0; transform: translateY(-6px); }
.meter.is-hot .meter__pace { opacity: 1; transform: none; }

.meter__track {
  position: relative;
  height: 8px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--track);
  box-shadow: inset 0 1px 1px rgba(20, 21, 26, 0.05);
}
.meter__fill, .meter__proj {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  border-radius: 999px;
}
.meter__fill {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 60%),
    var(--c);
  box-shadow: 0 2px 6px -2px color-mix(in srgb, var(--c) 70%, transparent);
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}
.meter__proj {
  background: repeating-linear-gradient(115deg, color-mix(in srgb, var(--c) 30%, #ffffff) 0 4px, color-mix(in srgb, var(--c) 16%, #ffffff) 4px 8px);
  opacity: 0;
}
/* the mark of the limit */
.meter__mark {
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: 90%;
  width: 2px;
  margin-left: -1px;
  border-radius: 2px;
  background: #b9bbc6;
  transition: background-color 0.4s ease;
}
.meter.is-near .meter__mark { background: var(--warn); }

/* ---- the warning that opens below ---- */
.warn { height: 0; overflow: hidden; }
.warn__in {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 4px 0 4px;
  padding: 8px 8px 8px 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--warn) 10%, #ffffff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 22%, #ffffff);
}
.warn__icon {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: color-mix(in srgb, var(--warn) 88%, #14151a);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.warn__text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 540;
  color: color-mix(in srgb, var(--warn) 55%, #14151a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.warn__go {
  flex: none;
  height: 30px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #ffffff;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: font-stretch 0.35s cubic-bezier(0.3, 1.4, 0.5, 1), background-color 0.25s ease;
}
.warn__go:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (hover: hover) {
  .warn__go:hover { font-stretch: 112%; background: #2a2c35; }
}

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

@media (max-width: 360px) {
  .head__reset { font-size: 12px; }
  .warn__text { font-size: 12.5px; }
}
