:root {
  --bg: #f6f3ee;
  --ink: #171a19;
  --soft: rgba(23, 26, 25, 0.55);
  --line: rgba(23, 26, 25, 0.12);
  --accent: #0f9d8a;
  --warm: #d9542b;
}

*, *::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 20px;
}

.gl { --tone: var(--ink); width: min(316px, 100%); }

.gl__read { display: flex; align-items: baseline; gap: 6px; height: clamp(44px, 13vh, 54px); }
.gl__num { font-size: clamp(40px, 12vh, 50px); line-height: clamp(44px, 13vh, 54px); font-weight: 400; letter-spacing: -0.04em; font-variation-settings: "wght" var(--w, 600), "wdth" 94; font-variant-numeric: tabular-nums; color: var(--tone); min-width: 1.850em; }
.gl__unit { font-size: 12.5px; font-weight: 620; color: var(--soft); }
.gl__arrow { align-self: center; width: 28px; height: 28px; margin-left: auto; padding: 0; border-radius: 14px; background: color-mix(in srgb, var(--tone) 10%, transparent); fill: none; stroke: var(--tone); stroke-width: 1.900; stroke-linecap: round; stroke-linejoin: round; }
.gl__state { display: flex; align-items: center; justify-content: space-between; height: 18px; font-size: 12.5px; line-height: 18px; }
.gl__word { display: block; height: 18px; overflow: hidden; font-weight: 700; color: var(--tone); }
.gl__word span { display: block; }
.gl__time { font-weight: 600; color: var(--soft); font-variant-numeric: tabular-nums; }

/* the chart: the soft band is the target range, the curve is teal inside it and warm outside */
.gl__chart { position: relative; height: clamp(104px, 32vh, 132px); margin-top: clamp(8px, 2.600vh, 14px); cursor: ew-resize; outline: none; touch-action: none; -webkit-tap-highlight-color: transparent; }
.gl__chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.gl__band { fill: color-mix(in srgb, var(--accent) 9%, transparent); }
.gl__edge { stroke: color-mix(in srgb, var(--accent) 46%, transparent); stroke-width: 1; stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.gl__line { fill: none; stroke-width: 2.400; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.gl__line--in { stroke: var(--accent); }
.gl__line--out { stroke: var(--warm); }
.gl__rule { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.gl__dot { position: absolute; left: 0; top: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 3px var(--dot, var(--accent)), 0 2px 6px rgba(23, 26, 25, 0.18); pointer-events: none; }
.gl__lim { position: absolute; right: 0; padding: 0 0 0 4px; font-size: 10px; line-height: 12px; font-weight: 640; color: color-mix(in srgb, var(--accent) 80%, var(--ink)); font-variant-numeric: tabular-nums; pointer-events: none; }
.gl__lim--high { transform: translateY(-13px); }
.gl__lim--low { transform: translateY(2px); }
.gl__chart:focus-visible { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); border-radius: 6px; }

.gl__hours { position: relative; height: 16px; margin-top: 4px; font-size: 10px; line-height: 16px; font-weight: 600; color: var(--soft); font-variant-numeric: tabular-nums; }
.gl__hours span { position: absolute; top: 0; transform: translateX(-50%); }
.gl__hours span:first-child { transform: none; }
.gl__hours span:last-child { transform: translateX(-100%); }

.gl__tir { display: flex; align-items: baseline; justify-content: space-between; margin-top: clamp(6px, 2.400vh, 14px); padding-top: clamp(6px, 2vh, 10px); border-top: 1px solid var(--line); font-size: 12.5px; line-height: 18px; font-weight: 580; color: var(--soft); }
.gl__tir b { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
/* how the day so far is shared: low, in range, high */
.gl__share { display: flex; gap: 2px; height: 4px; margin-top: 6px; }
.gl__share i { display: block; height: 100%; min-width: 0; border-radius: 2px; background: color-mix(in srgb, var(--warm) 70%, transparent); }
.gl__share i:nth-child(2) { background: var(--accent); }

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

@media (min-width: 700px) and (min-height: 500px) {
  .gl { zoom: 1.45; }
  .ghost { width: 30px; height: 30px; }
}
@media (min-width: 1100px) and (min-height: 760px) {
  .gl { zoom: 2.1; }
  .ghost { width: 40px; height: 40px; }
}
