:root {
  --bg: #000000;
  --ink: #f4f3ef;
  --soft: rgba(244, 243, 239, 0.55);
  --line: rgba(255, 255, 255, 0.1);
  --accent: #ffcf33;
}

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

.ds { position: relative; width: min(312px, 100%); }
/* the viewfinder: a dark desk seen from above */
.ds__view { position: relative; height: min(228px, 54vh); border-radius: 22px; background: radial-gradient(120% 100% at 30% 20%, #34302b 0%, #1d1b19 60%, #121110 100%); box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 30px 50px -30px rgba(0, 0, 0, 0.95); overflow: hidden; }
.ds__view svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ds__shadow { fill: rgba(0, 0, 0, 0.45); filter: blur(5px); }
.ds__paper { fill: #d9d3c6; stroke: rgba(255, 255, 255, 0.18); stroke-width: 0.600; stroke-linejoin: round; }
.ds__ink line, .ds__ink polygon { stroke: #6f695d; stroke-linecap: round; fill: none; }
.ds__ink .is-read { stroke: #17171a; }
.ds__outline { fill: color-mix(in srgb, var(--accent) 12%, transparent); stroke: var(--accent); stroke-width: 1.800; stroke-linejoin: round; opacity: 0; }
.ds__corners circle { fill: #1d1b19; stroke: var(--accent); stroke-width: 1.800; opacity: 0; }
.ds__beam { stroke: var(--accent); stroke-width: 2; stroke-linecap: round; opacity: 0; filter: drop-shadow(0 0 4px var(--accent)); }
.ds__hint { position: absolute; left: 50%; top: 10px; height: 24px; padding: 0 11px; border-radius: 12px; background: rgba(0, 0, 0, 0.55); font-size: 11.500px; line-height: 24px; font-weight: 600; overflow: hidden; transform: translateX(-50%); white-space: nowrap; }
.ds__hint span { display: block; }

.ds__row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: 14px; }
/* the pile of scanned pages */
.ds__tray { display: flex; align-items: center; gap: 9px; }
.ds__tray i { position: relative; display: block; width: 24px; height: 31px; border-radius: 4px; background: #ffffff; box-shadow: 3px -3px 0 -1px rgba(255, 255, 255, 0.5), 6px -6px 0 -2px rgba(255, 255, 255, 0.25); }
.ds__tray i::before { content: ""; position: absolute; left: 4px; right: 4px; top: 6px; height: 2px; border-radius: 1px; background: #17171a; box-shadow: 0 5px 0 rgba(23, 23, 26, 0.35), 0 10px 0 rgba(23, 23, 26, 0.35), 0 15px 0 rgba(23, 23, 26, 0.35); }
.ds__count { display: block; height: 16px; overflow: hidden; font-size: 12.500px; line-height: 16px; font-weight: 600; color: var(--soft); font-variant-numeric: tabular-nums; }
.ds__count span { display: block; white-space: nowrap; }
.ds__shutter { display: grid; place-items: center; width: 58px; height: 58px; border: 0; border-radius: 50%; background: none; box-shadow: inset 0 0 0 3px var(--ink); cursor: pointer; outline: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.ds__shutter i { display: block; width: 46px; height: 46px; border-radius: 50%; background: var(--ink); transition: background-color 0.3s ease; }
.ds[data-state="busy"] .ds__shutter { cursor: progress; }
.ds[data-state="busy"] .ds__shutter i { background: var(--accent); }
.ds__shutter:focus-visible { box-shadow: inset 0 0 0 3px var(--ink), 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
.ds__mode { justify-self: end; height: 24px; padding: 0 10px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font-size: 11.500px; line-height: 24px; font-weight: 700; }

.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: #ffffff; stroke: #101014; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)); z-index: 6; }
