:root {
  --bg: #ffffff;
  --card: #ffffff;
  --ink: #16171c;
  --soft: rgba(22, 23, 28, 0.56);
  --faint: rgba(22, 23, 28, 0.36);
  --line: rgba(22, 23, 28, 0.09);
  --accent: #2f6bff;
  --warn: #d9790b;
  --row: 48px;
}

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

.cm { position: relative; width: min(326px, 100%); padding: 12px 12px 12px; border-radius: 24px; background: var(--card); box-shadow: 0 0 0 1px var(--line), 0 34px 54px -36px rgba(22, 23, 28, 0.5), 0 10px 18px -14px rgba(22, 23, 28, 0.22); }

.cm__head { display: flex; align-items: center; gap: 10px; padding: 2px 4px 10px; border-bottom: 1px solid var(--line); }
.cm__file { flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 9%, #ffffff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent); }
.cm__file svg { width: 20px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 1.500; stroke-linecap: round; stroke-linejoin: round; }
.cm__name { flex: 1 1 auto; min-width: 0; display: grid; }
.cm__name b { font-size: 13.500px; line-height: 18px; font-weight: 700; letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm__name span { font-size: 11.500px; line-height: 15px; font-weight: 540; color: var(--soft); font-variant-numeric: tabular-nums; }
.cm__left { flex: none; height: 16px; overflow: hidden; font-size: 11.500px; line-height: 16px; font-weight: 620; color: var(--soft); white-space: nowrap; transition: color 0.3s ease; }
.cm__left span { display: block; }
.cm.is-open .cm__left { color: var(--warn); }
.cm.is-ready .cm__left { color: var(--accent); }

.cm__list { list-style: none; margin: 4px 0 8px; }
.cm__row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); align-items: center; gap: 6px; height: var(--row); padding: 0 4px; border-radius: 12px; }
/* the light that passes over a row while the automatic match reads it */
.cm__row::before { content: ""; position: absolute; inset: 3px 0; border-radius: 12px; background: color-mix(in srgb, var(--accent) 8%, transparent); opacity: var(--scan, 0); pointer-events: none; }
.cm__src { position: relative; min-width: 0; display: grid; justify-items: start; gap: 2px; }
.cm__src code { max-width: 100%; height: 19px; padding: 0 6px; border-radius: 6px; background: #f2f3f6; box-shadow: inset 0 0 0 1px var(--line); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 11px; line-height: 19px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm__src span { max-width: 100%; padding-left: 2px; font-size: 11px; line-height: 14px; font-weight: 520; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cm__wire { position: relative; width: 44px; height: 12px; fill: none; stroke: var(--accent); stroke-width: 1.500; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.cm__wire .wl { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }
.cm__wire .wh { opacity: 0; }

.cm__dst { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 4px; width: 100%; height: 32px; padding: 0 8px 0 10px; border: 0; border-radius: 10px; background: #f2f3f6; color: var(--faint); font: inherit; font-size: 12.500px; font-weight: 640; text-align: left; cursor: pointer; outline: none; box-shadow: inset 0 0 0 1px var(--line); transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.cm__roll { flex: 1 1 auto; min-width: 0; height: 18px; line-height: 18px; overflow: hidden; }
.cm__roll span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm__dst svg { flex: none; width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.500; stroke-linecap: round; stroke-linejoin: round; opacity: 0.7; }
.cm__row.is-set .cm__dst { background: color-mix(in srgb, var(--accent) 9%, #ffffff); color: color-mix(in srgb, var(--accent) 78%, var(--ink)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 24%, transparent); }
.cm__row.is-open .cm__dst { background: color-mix(in srgb, var(--warn) 9%, #ffffff); color: var(--warn); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 34%, transparent); }
.cm__row.is-skip .cm__dst { color: var(--soft); }
.cm__row.is-skip .cm__src { opacity: 0.5; }
.cm__src { transition: opacity 0.3s ease; }
.cm__dst:focus-visible, .cm__go:focus-visible { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--ink); }
@media (hover: hover) { .cm__dst:hover { background: #e9ebf0; } .cm__row.is-set .cm__dst:hover { background: color-mix(in srgb, var(--accent) 15%, #ffffff); } .cm__row.is-open .cm__dst:hover { background: color-mix(in srgb, var(--warn) 15%, #ffffff); } }

.cm__go { position: relative; display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; height: 44px; border: 0; border-radius: 14px; background: #eef0f4; color: var(--faint); font: inherit; font-size: 13.500px; font-weight: 680; font-variant-numeric: tabular-nums; cursor: pointer; outline: none; overflow: hidden; transition: background-color 0.35s ease, color 0.35s ease, box-shadow 0.35s ease; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.cm__go:disabled { cursor: default; }
.cm.is-ready .cm__go { background: var(--accent); color: #ffffff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 12px 20px -12px color-mix(in srgb, var(--accent) 80%, transparent); }
.cm__fill { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.24); transform: scaleX(0); transform-origin: 0 50%; pointer-events: none; }
.cm__gotext { position: relative; height: 20px; line-height: 20px; overflow: hidden; }
.cm__gotext span { display: block; white-space: nowrap; }
.cm__check { position: relative; flex: none; width: 0; height: 16px; fill: none; stroke: #ffffff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: width 0.3s ease; }
.cm__check path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.cm.is-done .cm__check { width: 16px; }
@media (hover: hover) { .cm.is-ready .cm__go:not(:disabled):hover { background: color-mix(in srgb, var(--accent) 88%, #000000); } }

.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: #16171c; stroke: #ffffff; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(22, 23, 28, 0.3)); z-index: 5; }

@media (max-width: 360px) {
  .cm__row { grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr); }
  .cm__wire { width: 30px; }
}
