/* ============================================================================
   Screenshot Studio — page styles.

   Built on the manuslabs.app design system (paper palette, Geist body,
   Fraunces display italic). Fonts are SELF-HOSTED so the canvas renderer can
   draw the exact same faces into the exported PNGs.
   ============================================================================ */

/* ---- Self-hosted fonts (subset to what this page uses) ---- */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./assets/fonts/geist-400.woff2") format("woff2");
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./assets/fonts/geist-500.woff2") format("woff2");
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./assets/fonts/geist-600.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url("./assets/fonts/fraunces-italic.woff2") format("woff2");
}

/* ==========================================================================
   Tokens — mirror /css/style.css so the page belongs to the site.

   The site runs dark. The token *names* are the original warm-paper ones so
   every rule below still reads the same, but the ladder is inverted: --ink is
   now the light ink, --paper the near-black page, and the --paper-* steps rise
   toward the viewer instead of sinking away from it.

   NOTE: these are page chrome only. The canvas render defaults in tool.js are
   the user's exported artwork and are deliberately left on the old palette.
   ========================================================================== */
:root {
  color-scheme: dark;

  --ink: #f1f4f9;
  --forest: #5b9dff;
  --terracotta: #f0a93c;
  --paper: #070a10;
  --paper-soft: #111826;
  --paper-deep: #18202f;
  --paper-deeper: #05070c;
  --stone: #a6b1c2;
  --rule: #212b3d;
  /* Edges that must survive *on top of* a raised dark surface — dashed drop
     targets and control chips. --rule reads as a seam there, not an
     affordance. */
  --rule-strong: rgba(241, 244, 249, 0.16);

  --h1-size: clamp(2.25rem, 5vw, 3.5rem);
  --lead-size: clamp(1.125rem, 2vw, 1.375rem);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 180ms;
  --dur: 240ms;

  --container: 1100px;
  --pad-x: 1.25rem;
  --radius: 16px;
  --radius-sm: 10px;
  --tap: 44px;
}

@media (min-width: 640px) {
  :root {
    --pad-x: 1.75rem;
  }
}
@media (min-width: 960px) {
  :root {
    --pad-x: 2.25rem;
  }
}

/* ==========================================================================
   Reset + base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body,
h1,
h2,
p,
figure,
dl,
dd,
ul,
ol,
fieldset,
legend {
  margin: 0;
  padding: 0;
}
ul,
ol {
  list-style: none;
}
img,
picture,
svg,
canvas {
  display: block;
  max-width: 100%;
  height: auto;
}
button,
input,
select,
output {
  font: inherit;
  color: inherit;
}
fieldset {
  border: 0;
}
[hidden] {
  display: none !important;
}

body {
  font-family:
    "Geist",
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* grain.svg is the white-speckle variant; noise.svg is black and does
     nothing on a near-black page. Opacity matches /css/style.css. */
  background-image: url("/assets/grain.svg");
  background-repeat: repeat;
  background-size: 120px 120px;
  opacity: 0.055;
  z-index: -1;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--pad-x);
}

a {
  color: var(--forest);
  text-decoration: none;
  text-underline-offset: 4px;
}
a:hover {
  text-decoration: underline;
}

:focus:not(:focus-visible) {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 3px;
  border-radius: 2px;
}

.eyebrow {
  display: inline-block;
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--forest);
  margin-bottom: 0.875rem;
}

.i {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.sprite {
  position: absolute;
  width: 0;
  height: 0;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(-120%);
  background: var(--forest);
  color: var(--paper-soft);
  padding: 0.75rem 1.25rem;
  font-weight: 500;
  font-size: 0.875rem;
  border-bottom-right-radius: 4px;
  z-index: 100;
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: none;
  text-decoration: none;
}

/* ==========================================================================
   Site header / footer — copied from the main site for visual continuity
   ========================================================================== */
.site-header {
  padding-block: 1.25rem;
}
@media (min-width: 960px) {
  .site-header {
    padding-block: 1.75rem;
  }
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.brand:hover {
  text-decoration: none;
  color: var(--forest);
}
.brand img {
  width: auto;
  height: 28px;
  flex-shrink: 0;
}
@media (min-width: 640px) {
  .brand img {
    height: 32px;
  }
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9375rem;
}
.site-nav a {
  color: var(--stone);
  padding-block: 0.25rem;
}
.site-nav a:hover {
  color: var(--forest);
  text-decoration: none;
}
@media (max-width: 520px) {
  .site-nav {
    gap: 1rem;
    font-size: 0.875rem;
  }
}

.site-footer {
  background: rgba(2, 4, 9, 0.32);
  padding-block: 2.25rem;
  color: var(--stone);
  font-size: 0.875rem;
  border-top: 1px solid var(--rule);
  margin-top: auto;
}
.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.site-footer__row {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: flex-start;
}
@media (min-width: 640px) {
  .site-footer__row {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}
.site-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.9375rem;
}
.site-footer__brand:hover {
  text-decoration: none;
  color: var(--forest);
}
.site-footer__brand img {
  width: auto;
  height: 22px;
}
.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}
.site-footer__nav a {
  color: var(--stone);
  padding-block: 0.25rem;
}
.site-footer__nav a:hover {
  color: var(--forest);
  text-decoration: none;
}
.site-footer__base {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
}
@media (min-width: 640px) {
  .site-footer__base {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}
.site-footer__colophon {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
}

/* ==========================================================================
   Tool hero
   ========================================================================== */
.tool-hero {
  background: rgba(150, 185, 245, 0.035);  /* lets the page background through */
  padding-block: clamp(2.5rem, 7vw, 5rem);
}
.tool-hero__title {
  font-weight: 500;
  font-size: var(--h1-size);
  letter-spacing: -0.035em;
  line-height: 1.04;
  max-width: 18ch;
  margin-bottom: 1.25rem;
}
.tool-hero__title em {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "opsz" 72;
  color: var(--terracotta);
}
.tool-hero__lead {
  font-family: "Fraunces", Georgia, serif;
  font-variation-settings: "opsz" 36;
  font-size: var(--lead-size);
  line-height: 1.5;
  color: var(--stone);
  max-width: 46ch;
  margin-bottom: 1.5rem;
}
.tool-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--forest);
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
}
.tool-hero__badge .i {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   Tool
   ========================================================================== */
.tool {
  background: transparent;
  padding-block: clamp(2rem, 5vw, 3.5rem) clamp(3rem, 7vw, 5rem);
  flex: 1 0 auto;
}

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--tap);
  padding: 0 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 0.9375rem;
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn .i {
  width: 18px;
  height: 18px;
}
.btn-primary {
  background: var(--forest);
  color: var(--paper-soft);
}
.btn-primary:hover:not(:disabled) {
  /* Lifts toward the light on hover, as on the main site. The old #0f2a1f
     sank the button into the page now that --forest is the bright green. */
  background: #7bb1ff;
  text-decoration: none;
}
.btn-secondary {
  background: var(--paper-soft);
  color: var(--ink);
  border-color: var(--rule);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--paper-deep);
  text-decoration: none;
}
.btn-ghost {
  background: transparent;
  color: var(--stone);
}
.btn-ghost:hover:not(:disabled) {
  color: var(--ink);
  background: var(--paper-deep);
}
.btn--full {
  width: 100%;
  margin-top: 0.9rem;
}

.field-hint {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--stone);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
  background: var(--paper-soft);
  cursor: pointer;
  color: var(--ink);
  transition:
    background var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}
.icon-btn:hover:not(:disabled) {
  background: var(--paper-deep);
}
.icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.icon-btn .i {
  width: 16px;
  height: 16px;
}
.icon-btn--danger:hover:not(:disabled) {
  color: var(--terracotta);
  border-color: var(--terracotta);
}

/* ---- notices ---- */
.persist-note,
.restore-note {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.875rem;
  color: var(--stone);
  background: var(--paper-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  margin-bottom: 1rem;
}
.persist-note .i,
.restore-note .i {
  width: 17px;
  height: 17px;
  margin-top: 0.2em;
  color: var(--forest);
}
.restore-note {
  flex-wrap: wrap;
  align-items: center;
  color: var(--ink);
  background: var(--paper-deep);
}
.restore-note__actions {
  display: inline-flex;
  gap: 0.5rem;
  margin-left: auto;
}
.restore-note__actions .btn {
  min-height: 36px;
  font-size: 0.8125rem;
  padding-inline: 0.9rem;
}

/* ---- drop zone ---- */
.dropzone {
  width: 100%;
  min-height: clamp(300px, 48vh, 460px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--paper-soft);
  border: 2px dashed var(--rule-strong);
  border-radius: var(--radius);
  color: var(--ink);
  cursor: pointer;
  transition:
    border-color var(--dur) var(--ease),
    background var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}
.dropzone:hover {
  border-color: var(--forest);
  background: var(--paper-deep);
}
.dropzone.is-dragover {
  border-color: var(--forest);
  background: var(--paper-deep);
  transform: scale(1.005);
}
.dz-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  /* A brand-tinted disc: --paper-deep is only one step off the drop zone
     itself on dark and the icon lost its plate. */
  background: rgba(91, 157, 255, 0.13);
  color: var(--forest);
  margin-bottom: 0.5rem;
}
.dz-icon .i {
  width: 30px;
  height: 30px;
}
.dz-title {
  font-weight: 500;
  font-size: clamp(1.25rem, 2.4vw, 1.625rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.dz-sub {
  color: var(--stone);
}
.dz-browse {
  margin-top: 0.5rem;
  pointer-events: none;
}
.dz-formats {
  margin-top: 0.75rem;
  color: var(--stone);
  font-size: 0.8125rem;
}

/* ==========================================================================
   Studio layout — controls sidebar + live preview
   ========================================================================== */
.studio {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (min-width: 960px) {
  .studio {
    grid-template-columns: minmax(300px, 360px) 1fr;
    gap: 2rem;
  }
}

.studio__controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel {
  background: var(--paper-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.panel__title {
  font-weight: 500;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--forest);
  margin-bottom: 1rem;
}
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.panel__head .panel__title {
  margin-bottom: 0;
}
.panel__tools {
  display: inline-flex;
  gap: 0.4rem;
}

.mini-drop {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--tap);
  padding: 0.6rem 1rem;
  background: var(--paper);
  border: 2px dashed var(--rule-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 500;
  font-size: 0.9375rem;
  cursor: pointer;
  transition:
    border-color var(--dur) var(--ease),
    background var(--dur) var(--ease);
}
.mini-drop:hover,
.mini-drop.is-dragover {
  border-color: var(--forest);
  background: var(--paper-deep);
}
.mini-drop .i {
  width: 18px;
  height: 18px;
  color: var(--forest);
}
.mini-drop__hint {
  color: var(--stone);
  font-weight: 400;
  font-size: 0.8125rem;
}

/* ---- fields ---- */
.field {
  margin-bottom: 0.9rem;
}
.field:last-child {
  margin-bottom: 0;
}
.field > label,
.field > legend {
  display: block;
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--ink);
  margin-bottom: 0.35rem;
}
.field label small {
  color: var(--stone);
  font-weight: 400;
}
.field input[type="text"],
.field select {
  width: 100%;
  min-height: 42px;
  padding: 0.45rem 0.75rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
}
.field input[type="text"]:focus-visible,
.field select:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 1px;
}
/* Ranges are drawn by hand rather than left native: Chrome pairs
   accent-color with a near-white unfilled track, which on these panels was
   the brightest element on the page. The paired <output> carries the value,
   so a plain rail with a brand thumb loses nothing. */
.field input[type="range"] {
  width: 100%;
  height: 20px;
  accent-color: var(--forest);
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
.field input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: var(--rule);
}
.field input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: var(--rule);
}
.field input[type="range"]::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--forest);
}
.field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px; /* (track 4px − thumb 16px) ÷ 2 */
  border: none;
  border-radius: 50%;
  background: var(--forest);
}
.field input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: var(--forest);
}
.field output {
  float: right;
  color: var(--stone);
  font-size: 0.8125rem;
  font-weight: 400;
}

.field--row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}
.swatch-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.swatch-field label {
  font-weight: 500;
  font-size: 0.8125rem;
}
.swatch-field input[type="color"] {
  width: 58px;
  height: 38px;
  padding: 2px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.field--check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.25rem;
}
.field--check input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--forest);
  cursor: pointer;
}
.field--check label {
  font-size: 0.875rem;
  margin: 0;
  cursor: pointer;
}

#override-fields {
  border-top: 1px dashed var(--rule);
  padding-top: 0.9rem;
  margin-top: 0.9rem;
}

/* ---- segmented control ---- */
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.seg > legend {
  width: 100%;
}
.seg__opt {
  position: relative;
  cursor: pointer;
}
.seg__opt input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.seg__opt span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.2rem 0.8rem;
  /* The preview-size segment sits straight on --paper, so an unchecked pill
     is defined by its border alone — --rule is too close to the page there. */
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--stone);
  transition:
    background var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}
.seg__opt input:checked + span {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--paper-soft);
}
.seg__opt input:focus-visible + span {
  outline: 2px solid var(--forest);
  outline-offset: 2px;
}

/* ---- preview column ---- */
.studio__preview {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
@media (min-width: 960px) {
  .studio__preview {
    position: sticky;
    top: 1rem;
  }
}

.preview-bar {
  display: flex;
  justify-content: center;
}

.preview-stage {
  display: flex;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2rem);
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.canvas-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
}
#preview {
  width: auto;
  max-width: 100%;
  max-height: min(72vh, 640px);
  border-radius: 6px;
  box-shadow: 0 18px 50px -22px rgba(0, 0, 0, 0.75);
}
/* Transparent handle/interaction layer, pixel-matched to #preview. */
.overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  touch-action: none;
  cursor: default;
}
.overlay-canvas:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 3px;
}

/* device-position preset chips + overlay element rows */
.field__label {
  display: block;
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--ink);
  margin-bottom: 0.35rem;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.chip {
  min-height: 34px;
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--stone);
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}
.chip:hover {
  border-color: var(--forest);
  color: var(--forest);
}

.overlay-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.75rem 0 0;
}
.overlay-list:empty {
  margin: 0;
}
.overlay-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--paper);
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.overlay-row[aria-current="true"] {
  border-color: var(--forest);
  background: var(--paper-deep);
}
.overlay-row__thumb {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 6px;
  border: 1px solid var(--rule);
  /* Deliberately a *light* plate: the elements users add are logos and app
     icons, usually dark or coloured artwork on transparency. A dark backing
     swallows them. */
  background: var(--ink) center / contain no-repeat;
}
.overlay-row__name {
  font-size: 0.8125rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- thumbnail strip ---- */
.thumbs {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.25rem 0.25rem 0.5rem;
  scrollbar-width: thin;
}
.thumb {
  position: relative;
  flex: none;
  border: 2px solid var(--rule);
  border-radius: 10px;
  background: var(--paper-soft);
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}
.thumb:hover {
  transform: translateY(-2px);
}
.thumb[aria-current="true"] {
  border-color: var(--forest);
}
.thumb canvas {
  width: 72px;
  height: auto;
  display: block;
}
.thumb__num {
  position: absolute;
  top: 4px;
  left: 4px;
  min-width: 20px;
  padding: 0 4px;
  border-radius: 6px;
  /* Sits over the rendered frame, so it needs its own scrim — --paper-soft is
     now dark and would have vanished into this pill. */
  background: rgba(0, 0, 0, 0.62);
  color: var(--ink);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.6;
  text-align: center;
  pointer-events: none;
}
.thumb--missing::after {
  content: "missing";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--terracotta);
  color: var(--paper-soft);
  font-size: 0.625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  padding-block: 2px;
  pointer-events: none;
}

/* ---- action bar / status ---- */
.actionbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.actionbar--stack {
  flex-direction: column;
  align-items: stretch;
}
.status {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--stone);
  min-height: 1.2em;
}
.status.is-error {
  color: var(--terracotta);
  font-weight: 500;
}

.tool-note {
  margin-top: 1.75rem;
  max-width: 60ch;
  font-size: 0.875rem;
  color: var(--stone);
}

/* ==========================================================================
   a11y / motion
   ========================================================================== */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
