:root {
  --bg: #ffffff;
  --card: #ffffff;
  --ink: #17181b;
  --soft: rgba(23, 24, 27, 0.58);
  --line: rgba(23, 24, 27, 0.1);
  --wood: #c9a36b;
  --accent: #2f6fed;
}

*, *::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: 8px 12px;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; outline: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; text-align: left; }
.live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.sd { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; width: min(348px, 100%); padding: 16px 16px 13px; border-radius: 26px; background: var(--card); box-shadow: inset 0 0 0 1.500px var(--line), 0 1px 2px rgba(23, 24, 27, 0.05), 0 30px 44px -30px rgba(23, 24, 27, 0.35); }
.sd__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sd__what { display: grid; gap: 1px; min-width: 0; }
.sd__what strong { font-size: 15px; line-height: 19px; font-weight: 720; }
.sd__what span { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd__clip { display: block; height: 16px; line-height: 16px; overflow: hidden; white-space: nowrap; }
.sd__clip span { display: block; overflow: hidden; text-overflow: ellipsis; }
.sd__pill { flex: none; height: 28px; min-width: 84px; padding: 6px 12px; border-radius: 14px; background: rgba(23, 24, 27, 0.06); font-size: 12px; font-weight: 700; text-align: center; color: var(--ink); transition: background-color 0.4s ease, color 0.4s ease; }
.sd.is-up .sd__pill { background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); }

/* the middle: what the desk reads, the desk itself in lines, and the rail you ask the height on */
.sd__mid { display: flex; align-items: stretch; gap: 10px; height: 130px; }
.sd__read { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; gap: 2px; }
.sd__label { font-size: 12px; line-height: 16px; font-weight: 640; color: var(--soft); }
.sd__big { display: flex; align-items: baseline; gap: 4px; height: 46px; }
.sd__big b { font-size: 44px; line-height: 46px; font-weight: 680; font-stretch: 84%; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.sd__big i { font-style: normal; font-size: 14px; font-weight: 680; color: var(--soft); }
.sd__clip--goal { font-size: 12px; font-weight: 620; color: var(--soft); }
.sd__desk { flex: none; display: block; width: 150px; height: 130px; overflow: visible; }
.sd__shade { fill: rgba(23, 24, 27, 0.1); }
.sd__floor { fill: none; stroke: var(--line); stroke-width: 1.500; stroke-linecap: round; }
.sd__inner { fill: #d3d6dc; }
.sd__outer { fill: #ffffff; stroke: var(--ink); stroke-width: 1.500; }
.sd__foot { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.sd__board { fill: var(--wood); stroke: var(--ink); stroke-width: 1.500; }
.sd__beam { fill: var(--ink); }
.sd__screen { fill: #ffffff; stroke: var(--ink); stroke-width: 1.500; }
.sd__stand { fill: none; stroke: var(--ink); stroke-width: 1.500; stroke-linecap: round; }
.sd__cup { fill: #ffffff; stroke: var(--ink); stroke-width: 1.500; stroke-linejoin: round; }
.sd__rail { position: relative; flex: none; width: 30px; height: 130px; border-radius: 15px; background: rgba(23, 24, 27, 0.06); cursor: grab; touch-action: none; outline: none; }
.sd__rail:focus-visible { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--ink); }
.sd__rail.is-held { cursor: grabbing; }
.sd__fill { position: absolute; inset: 0; border-radius: 15px; overflow: hidden; pointer-events: none; }
.sd__fill::before { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--accent) 22%, transparent); transform-origin: 50% 100%; transform: scaleY(var(--f, 0.2)); }
.sd__mark { position: absolute; left: 50%; bottom: 0; width: 10px; height: 2px; margin: 0 0 -1px -5px; border-radius: 1px; background: rgba(23, 24, 27, 0.28); pointer-events: none; }
.sd__knob { position: absolute; left: 2px; bottom: 2px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 13px; background: #ffffff; box-shadow: 0 1px 1px rgba(23, 24, 27, 0.14), 0 5px 10px -4px rgba(23, 24, 27, 0.45); pointer-events: none; }
.sd__knob i { display: block; width: 10px; height: 6px; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); border-radius: 1px; opacity: 0.55; transition: opacity 0.25s ease; }
.sd__rail.is-held .sd__knob i { opacity: 1; }

.sd__presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sd__preset { display: flex; justify-content: space-between; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 14px; background: rgba(23, 24, 27, 0.045); box-shadow: inset 0 0 0 1.500px transparent; transition: background-color 0.3s ease, box-shadow 0.3s ease; }
.sd__preset strong { font-size: 14px; font-weight: 720; }
.sd__preset span { font-size: 12px; font-weight: 640; color: var(--soft); white-space: nowrap; transition: color 0.3s ease; }
.sd__preset[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 9%, #ffffff); box-shadow: inset 0 0 0 1.500px var(--accent); }
.sd__preset[aria-pressed="true"] span { color: var(--accent); }
.sd__preset:focus-visible { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--ink); }
.sd__footline { font-size: 12px; font-weight: 620; color: var(--soft); text-align: center; }

.ghost { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -3px 0 0 -5px; transform-origin: 20% 15%; pointer-events: none; opacity: 0; fill: #17171a; stroke: #ffffff; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)); z-index: 6; }

@media (hover: hover) { .sd__preset:hover { background: rgba(23, 24, 27, 0.075); } .sd__preset[aria-pressed="true"]:hover { background: color-mix(in srgb, var(--accent) 13%, #ffffff); } }
@media (max-width: 350px) { .sd { padding: 14px 12px 11px; } .sd__mid { gap: 6px; } .sd__desk { width: 132px; } .sd__big b { font-size: 38px; } .sd__preset { padding: 0 11px; } }
@media (max-height: 400px) { .sd { gap: 10px; } .sd__preset { height: 38px; } }
@media (prefers-reduced-motion: reduce) { .sd__pill, .sd__preset, .sd__preset span, .sd__knob i { transition: none; } }
