:root {
  --bg: #ffffff;
  --pill: #f3f3f1;
  --ink: #17171a;
  --soft: rgba(23, 23, 26, 0.52);
  --line: rgba(23, 23, 26, 0.1);
  --accent: #1f9d61;
  --busy: #e8890c;
}

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

/* the box keeps room on the right for the drive, so button and drive sit centred together */
.ej { position: relative; display: inline-block; padding-right: 44px; }

.ej__btn { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 12px; height: 64px; padding: 0 26px 0 8px; border: 0; border-radius: 32px; background: var(--pill); color: var(--ink); font: inherit; text-align: left; cursor: pointer; outline: none; box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 #ffffff, 0 14px 24px -16px rgba(23, 23, 26, 0.4); transition: background-color 0.35s ease, box-shadow 0.35s ease; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.ej__btn[data-state="busy"] { cursor: progress; }
.ej__btn[data-state="done"] { background: color-mix(in srgb, var(--accent) 9%, #ffffff); box-shadow: inset 0 0 0 1.500px color-mix(in srgb, var(--accent) 40%, transparent), 0 14px 26px -16px color-mix(in srgb, var(--accent) 70%, #000000); }
.ej__btn:focus-visible { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
/* the port on the right edge, where the drive plugs in */
.ej__btn::after { content: ""; position: absolute; right: 0; top: 50%; width: 7px; height: 22px; margin-top: -11px; border-radius: 4px 0 0 4px; background: rgba(23, 23, 26, 0.2); box-shadow: inset 1px 1px 2px rgba(23, 23, 26, 0.35); }
@media (hover: hover) { .ej__btn[data-state="idle"]:hover { background: #ebebe8; } }

.ej__ico { position: relative; flex: none; display: block; width: 48px; height: 48px; border-radius: 50%; background: #ffffff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line), 0 2px 4px -2px rgba(23, 23, 26, 0.3); transition: background-color 0.35s ease, color 0.35s ease, box-shadow 0.35s ease; }
.ej__btn[data-state="done"] .ej__ico { background: var(--accent); color: #ffffff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 12px -6px color-mix(in srgb, var(--accent) 80%, #000000); }
.ej__ico svg { position: absolute; left: 0; top: 0; display: block; }
/* the ring that fills while the last writes finish */
.ej__ring { width: 48px; height: 48px; transform: rotate(-90deg); opacity: 0; fill: none; stroke: var(--busy); stroke-width: 2.500; stroke-linecap: round; }
.ej__ring circle { stroke-dasharray: 1; stroke-dashoffset: 1; }
.ej__glyph { width: 24px; height: 24px; margin: 12px; fill: currentColor; stroke: currentColor; stroke-width: 1.400; stroke-linejoin: round; }
.ej__glyph rect { stroke: none; }
.ej__check { width: 24px; height: 24px; margin: 12px; fill: none; stroke: #ffffff; stroke-width: 2.300; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.ej__check path { stroke-dasharray: 1; stroke-dashoffset: 1; }

.ej__text { display: grid; gap: 3px; min-width: 148px; }
.ej__label { display: block; height: 21px; overflow: hidden; font-size: 16px; line-height: 21px; font-weight: 700; font-stretch: 104%; letter-spacing: -0.008em; }
.ej__label span { display: block; white-space: nowrap; }
.ej__sub { display: block; font-size: 12px; line-height: 15px; font-weight: 500; color: var(--soft); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* the drive: it sits behind the button with its plug inside the port */
.ej__drive { position: absolute; z-index: 1; right: 0; top: 50%; width: 58px; height: 36px; margin-top: -18px; display: block; pointer-events: none; }
.ej__plug { position: absolute; left: 0; top: 50%; width: 14px; height: 16px; margin-top: -8px; border-radius: 2px 0 0 2px; background: linear-gradient(180deg, #e9eaec 0%, #b9bcc2 48%, #d7d9dd 52%, #a4a7ae 100%); box-shadow: inset 0 0 0 0.500px rgba(23, 23, 26, 0.35); }
.ej__body { position: absolute; left: 13px; right: 0; top: 0; bottom: 0; border-radius: 9px; background: linear-gradient(160deg, #3a3c44 0%, #1d1e23 62%, #131317 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 10px 14px -8px rgba(23, 23, 26, 0.55), 0 2px 3px -1px rgba(23, 23, 26, 0.4); overflow: hidden; }
/* a soft diagonal sheen on the shell */
.ej__body::before { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.1) 46%, transparent 58%); }
.ej__body b { position: absolute; left: 9px; top: 9px; font-size: 6.500px; line-height: 8px; font-weight: 700; letter-spacing: 0.14em; color: rgba(255, 255, 255, 0.72); }
/* how full the drive is; while writing a light runs along it */
.ej__body i { position: absolute; left: 9px; bottom: 9px; width: 27px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, rgba(255, 255, 255, 0.7) 0 40%, rgba(255, 255, 255, 0.18) 40% 100%); overflow: hidden; }
.ej__body i::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: linear-gradient(90deg, transparent, var(--busy), transparent); opacity: 0; }
.ej__body i.is-writing::after { opacity: 1; animation: ej-run 0.7s linear infinite; }
@keyframes ej-run { to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .ej__body i.is-writing::after { animation: none; left: 30%; } }

.live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.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; }
