:root {
  color-scheme: dark;
  --font-ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;

  --bg: #0e0e0f;
  --panel: #151516;
  --raised: #1c1c1e;
  --hover: #232326;
  --active: #2a2a2e;
  --line: #27272a;
  --line-strong: #3a3a3f;
  --fg: #f2f2f3;
  --fg-2: #a1a1a8;
  --fg-3: #6b6b73;
  --accent: #4f8ff7;
  --danger: #e5484d;
  --ok: #46a758;
  --warn: #f5a524;
  --primary-bg: #f2f2f3;
  --primary-fg: #0e0e0f;
  --check-a: #1c1c1e;
  --check-b: #262629;
  --focus: 0 0 0 2px rgba(79, 143, 247, 0.5);
  --shadow-pop: 0 4px 12px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--line);

  --text-xs: 12px;
  --text-sm: 14px;
  --text: 15px;
  --text-md: 17px;
  --text-lg: 22px;
  --text-xl: 30px;

  --radius: 6px;
  --radius-sm: 4px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --ctl: 32px;
  --header-h: 52px;
  --status-h: 28px;
  --rail-w: 72px;
  --panel-w: 272px;
  --sab: env(safe-area-inset-bottom, 0px);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f4f5;
  --panel: #ffffff;
  --raised: #fafafa;
  --hover: #f0f0f1;
  --active: #e8e8ea;
  --line: #e4e4e7;
  --line-strong: #d4d4d8;
  --fg: #18181b;
  --fg-2: #52525b;
  --fg-3: #a1a1aa;
  --accent: #2f6fe4;
  --primary-bg: #18181b;
  --primary-fg: #ffffff;
  --check-a: #ffffff;
  --check-b: #e6e6e8;
  --focus: 0 0 0 2px rgba(47, 111, 228, 0.35);
  --shadow-pop: 0 4px 12px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--line);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--text) / 1.45 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

button:disabled {
  cursor: default;
  opacity: 0.45;
}

a {
  color: inherit;
  text-decoration: none;
}

svg.i {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

kbd {
  font: 500 11px/1 var(--font-mono);
  color: var(--fg-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 3px 5px;
  min-width: 20px;
  text-align: center;
  display: inline-block;
}

.num {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

::selection {
  background: rgba(79, 143, 247, 0.35);
}

.bar {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 20;
}

.bar .progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--fg);
  transform-origin: 0 50%;
  transform: scaleX(0);
  opacity: 0;
  transition: transform 200ms var(--ease), opacity 300ms var(--ease);
  pointer-events: none;
}

.bar[data-loading="true"] .progress {
  opacity: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 500;
  font-size: var(--text-md);
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius);
  margin-left: -4px;
}

.brand:hover {
  background: var(--hover);
}

.brand .mark {
  width: 24px;
  height: 24px;
}

.bar .spacer {
  flex: 1;
}

.bar nav {
  display: flex;
  gap: 20px;
  margin-left: 16px;
}

.bar nav a {
  color: var(--fg-2);
  padding: 6px 0;
  position: relative;
  transition: color 120ms var(--ease);
}

.bar nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 220ms var(--ease);
}

.bar nav a:hover,
.bar nav a[aria-current="page"] {
  color: var(--fg);
}

.bar nav a:hover::after,
.bar nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.engine {
  color: var(--fg-3);
  font-size: var(--text-sm);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  padding: 0 4px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.engine[data-state="error"] {
  color: var(--danger);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: var(--ctl);
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--raised);
  color: var(--fg);
  font-weight: 500;
  font-size: var(--text-sm);
  white-space: nowrap;
  transition: background-color 120ms var(--ease), border-color 120ms var(--ease), color 120ms var(--ease);
  user-select: none;
  -webkit-user-select: none;
}

.btn:hover:not(:disabled) {
  background: var(--hover);
}

.btn:active:not(:disabled) {
  background: var(--active);
}

.btn.primary {
  background: var(--primary-bg);
  color: var(--primary-fg);
  border-color: transparent;
}

.btn.primary:hover:not(:disabled) {
  background: var(--primary-bg);
  opacity: 0.9;
}

.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--fg-2);
}

.btn.ghost:hover:not(:disabled) {
  color: var(--fg);
  background: var(--hover);
}

.btn.icon {
  width: var(--ctl);
  padding: 0;
}

.btn.lg {
  height: 40px;
  padding: 0 16px;
  font-size: var(--text);
}

.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.seg button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--fg-2);
  font-weight: 500;
  font-size: var(--text-sm);
  transition: background-color 120ms var(--ease), color 120ms var(--ease);
}

.seg button:hover {
  color: var(--fg);
}

.seg button[aria-pressed="true"] {
  background: var(--active);
  color: var(--fg);
}

.seg.fill {
  display: flex;
}

.seg.fill button {
  flex: 1;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  background: transparent;
  margin: 0;
  touch-action: pan-y;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 2px;
  background: var(--line-strong);
}

input[type="range"]::-moz-range-track {
  height: 3px;
  border-radius: 2px;
  background: var(--line-strong);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--fg);
  border: 0;
  margin-top: -6.5px;
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--fg);
  border: 0;
}

.field {
  height: var(--ctl);
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--raised);
  color: var(--fg);
  width: 100%;
  min-width: 0;
  outline: none;
  font-size: var(--text-sm);
}

.field:focus {
  box-shadow: var(--focus);
  border-color: var(--accent);
}

select.field {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  color: var(--fg-2);
  user-select: none;
  font-size: var(--text-sm);
  min-height: 28px;
}

.check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.check:hover {
  color: var(--fg);
}

.app {
  height: calc(100dvh - var(--header-h));
  min-height: 480px;
  display: grid;
  grid-template-columns: var(--rail-w) 1fr var(--panel-w);
  grid-template-rows: 1fr var(--status-h);
  grid-template-areas:
    "rail stage panel"
    "status status status";
  background: var(--bg);
}

.app[data-view="empty"] {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr var(--status-h);
  grid-template-areas:
    "stage"
    "status";
}

.app[data-view="empty"] .rail,
.app[data-view="empty"] .panel,
.app[data-view="empty"] .tabbar {
  display: none;
}

.tabbar {
  display: none;
}

.rail {
  grid-area: rail;
  border-right: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.rail .list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
}

.thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background-color: var(--check-a);
  background-image: linear-gradient(45deg, var(--check-b) 25%, transparent 25%, transparent 75%, var(--check-b) 75%),
    linear-gradient(45deg, var(--check-b) 25%, transparent 25%, transparent 75%, var(--check-b) 75%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
  cursor: pointer;
  flex: none;
  transition: border-color 120ms var(--ease);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb:hover {
  border-color: var(--line-strong);
}

.thumb[aria-current="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.thumb .state {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
}

.thumb[data-state="queued"] .state,
.thumb[data-state="processing"] .state,
.thumb[data-state="error"] .state {
  display: flex;
}

.thumb[data-state="error"] .state {
  color: var(--danger);
}

.thumb .remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
}

.thumb .remove svg {
  width: 13px;
  height: 13px;
}

.thumb:hover .remove {
  display: flex;
}

.thumb .idx {
  position: absolute;
  left: 3px;
  bottom: 3px;
  font: 500 11px/1 var(--font-mono);
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  padding: 2px 4px;
  border-radius: 3px;
}

.rail .foot {
  padding: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rail .foot .btn {
  width: 100%;
}

.spin {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.stage {
  grid-area: stage;
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  background-color: var(--check-a);
  background-image: linear-gradient(45deg, var(--check-b) 25%, transparent 25%, transparent 75%, var(--check-b) 75%),
    linear-gradient(45deg, var(--check-b) 25%, transparent 25%, transparent 75%, var(--check-b) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.stage[data-tool="erase"],
.stage[data-tool="restore"] {
  cursor: none;
}

.stage[data-tool="compare"] {
  cursor: ew-resize;
}

.stage.panning {
  cursor: grabbing !important;
}

.app[data-view="empty"] .stage {
  background: var(--bg);
  cursor: default;
  touch-action: pan-y;
  user-select: text;
  -webkit-user-select: text;
}

.drop {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
}

.drop-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
}

.drop .demo {
  display: none;
}

.drop .box {
  width: min(560px, 100%);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 44px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  transition: border-color 120ms var(--ease), background-color 120ms var(--ease);
  cursor: pointer;
}

.drop .box:hover,
body.dragging .drop .box {
  border-color: var(--fg-2);
}

body.dragging .drop .box {
  background: var(--raised);
}

.drop .box h2 {
  font-size: var(--text-md);
  font-weight: 500;
  margin: 4px 0 0;
}

.drop .hero {
  max-width: 720px;
}

.drop .hero h1 {
  font-size: var(--text-xl);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 8px;
}

.drop .hero p {
  color: var(--fg-2);
  font-size: var(--text-md);
  margin: 0;
}

.drop-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.drop p {
  margin: 0;
  color: var(--fg-2);
}

.drop .sub {
  color: var(--fg-3);
  font-size: var(--text-sm);
}

.drop .samples {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  color: var(--fg-3);
  font-size: var(--text-sm);
}

.drop .samples span {
  margin-right: 4px;
}

.drop .samples button {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--raised);
  transition: border-color 120ms var(--ease);
}

.drop .samples button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.drop .samples button:hover {
  border-color: var(--fg-2);
}

.drag-overlay {
  position: fixed;
  inset: 8px;
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  background: rgba(79, 143, 247, 0.06);
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-weight: 500;
}

body.dragging .drag-overlay {
  display: flex;
}

.view {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}

.view canvas,
.view img {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.view canvas.orig {
  pointer-events: none;
}

.stage:not([data-tool="compare"]) .view canvas.orig,
.stage:not([data-tool="compare"]) .divider {
  display: none;
}

.divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  pointer-events: none;
}

.divider::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(-1px * var(--inv, 1));
  width: calc(2px * var(--inv, 1));
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.divider .knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  transform: translate(-50%, -50%) scale(var(--inv, 1));
  background: #fff;
  color: #222;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.divider .knob svg {
  width: 16px;
  height: 16px;
}

.divider .lbl {
  position: absolute;
  top: 10px;
  transform: scale(var(--inv, 1));
  font: 500 12px/1 var(--font-ui);
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  padding: 5px 7px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.divider .lbl.l {
  right: 10px;
  transform-origin: 100% 0;
}

.divider .lbl.r {
  left: 10px;
  transform-origin: 0 0;
}

.cursor {
  position: fixed;
  left: -100px;
  top: -100px;
  pointer-events: none;
  border-radius: 50%;
  border: 1px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, -50%);
  z-index: 30;
  display: none;
}

.stage[data-tool="erase"] .cursor,
.stage[data-tool="restore"] .cursor {
  display: block;
}

.stage[data-tool="restore"] .cursor {
  border-color: var(--ok);
}

.zoom {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  z-index: 5;
}

.zoom .btn {
  border: 0;
  background: transparent;
  height: 28px;
  width: 28px;
  color: var(--fg-2);
}

.zoom .btn:hover:not(:disabled) {
  color: var(--fg);
  background: var(--hover);
}

.zoom .pct {
  min-width: 52px;
  text-align: center;
  font-size: 13px;
  color: var(--fg-2);
  cursor: pointer;
}

.zoom .pct:hover {
  color: var(--fg);
}

.hint {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--fg-2);
  font-size: var(--text-sm);
  padding: 6px 12px;
  border-radius: var(--radius);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms var(--ease);
  z-index: 5;
  white-space: nowrap;
}

.hint.show {
  opacity: 1;
}

.stage .working {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--fg-2);
  background: var(--bg);
}

.stage .working.show {
  display: flex;
}

.stage .working .spin {
  width: 22px;
  height: 22px;
  border-color: var(--line-strong);
  border-top-color: var(--fg);
}

.panel {
  grid-area: panel;
  border-left: 1px solid var(--line);
  background: var(--panel);
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
}

.group {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.group h2 {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--fg-3);
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
}

.row .lbl {
  color: var(--fg-2);
  width: 68px;
  flex: none;
  font-size: var(--text-sm);
}

.row .val {
  width: 44px;
  text-align: right;
  color: var(--fg-2);
  flex: none;
  font-size: var(--text-sm);
}

.row input[type="range"] {
  flex: 1;
}

.tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.tools button {
  height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  color: var(--fg-2);
  font-size: var(--text-xs);
  font-weight: 500;
  position: relative;
  transition: background-color 120ms var(--ease), border-color 120ms var(--ease), color 120ms var(--ease);
}

.tools button:hover {
  color: var(--fg);
  background: var(--hover);
}

.tools button[aria-pressed="true"] {
  color: var(--fg);
  background: var(--active);
  border-color: var(--line-strong);
}

.tools button kbd {
  position: absolute;
  top: 4px;
  right: 5px;
  border: 0;
  padding: 0 3px;
  min-width: 0;
  background: transparent;
  color: var(--fg-3);
}

.swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.swatch {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  position: relative;
  overflow: hidden;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-2);
  background: var(--raised);
}

.swatch svg {
  width: 16px;
  height: 16px;
  position: relative;
}

.swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 1px var(--accent);
  border-color: var(--accent);
}

.swatch.trans {
  background-color: #fff;
  background-image: linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%),
    linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
}

.swatch.custom input {
  position: absolute;
  inset: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
  border: 0;
  padding: 0;
  cursor: pointer;
  background: none;
}

.swatch.custom::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: conic-gradient(#f43, #fc0, #3c6, #36f, #c3f, #f43);
}

.swatch.custom[data-set="true"]::after {
  display: none;
}

.swatch.image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.swatch.image[data-set="true"] svg {
  display: none;
}

.upscale .btn {
  width: 100%;
}

.stage[data-preview="true"] .view canvas#result {
  visibility: hidden;
}

.actions {
  display: flex;
  gap: 6px;
}

.actions .btn {
  flex: 1;
}

.export {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.export .split {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 6px;
}

.export .btn.primary {
  width: 100%;
}

.shortcuts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  color: var(--fg-3);
  font-size: var(--text-xs);
  align-items: center;
}

.status {
  grid-area: status;
  height: var(--status-h);
  border-top: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  font-size: var(--text-xs);
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
}

.status .spacer {
  flex: 1;
}

.status .name {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.toasts {
  position: fixed;
  bottom: calc(24px + var(--sab));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 60;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}

.toast {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  color: var(--fg);
  padding: 9px 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  font-size: var(--text-sm);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 150ms var(--ease), transform 150ms var(--ease);
}

.toast.show {
  opacity: 1;
  transform: none;
}

.toast.error {
  border-color: var(--danger);
}

dialog {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--fg);
  padding: 0;
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

dialog .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 12px 18px;
  border-bottom: 1px solid var(--line);
}

dialog h2 {
  margin: 0;
  font-size: var(--text-md);
  font-weight: 500;
}

dialog .body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

dialog .body h3 {
  margin: 0 0 8px;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--fg-3);
}

.opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 120ms var(--ease), background-color 120ms var(--ease);
}

.opt + .opt {
  margin-top: 6px;
}

.opt:hover {
  background: var(--hover);
}

.opt input {
  margin: 4px 0 0;
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.opt .t {
  font-weight: 500;
}

.opt .d {
  color: var(--fg-2);
  font-size: var(--text-sm);
}

.opt:has(input:checked) {
  border-color: var(--accent);
}

.note {
  color: var(--fg-3);
  font-size: var(--text-sm);
  margin: 0;
}

.about {
  border-top: 1px solid var(--line);
  background: var(--panel);
  font-size: 16px;
  line-height: 1.55;
}

.about .wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 72px 24px 40px;
}

.about .lede {
  max-width: 720px;
  margin-bottom: 64px;
}

.about .lede h2 {
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}

.about .lede p {
  margin: 0;
  color: var(--fg-2);
  font-size: var(--text-md);
}

.about h3 {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--fg-3);
  margin: 0 0 20px;
}

.about .steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 64px;
}

.about .step {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.about .step .n {
  font-family: var(--font-mono);
  color: var(--fg-3);
  font-size: 13px;
  margin-bottom: 10px;
}

.about .step h4 {
  margin: 0 0 6px;
  font-size: var(--text-md);
  font-weight: 500;
}

.about .step p {
  margin: 0;
  color: var(--fg-2);
}

.about .faq {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 48px;
  margin-bottom: 64px;
}

.about details {
  border-top: 1px solid var(--line);
}

.about summary {
  cursor: pointer;
  padding: 14px 0;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 500;
}

.about summary::-webkit-details-marker {
  display: none;
}

.about summary svg {
  color: var(--fg-3);
  transition: transform 150ms var(--ease);
}

.about details[open] summary svg {
  transform: rotate(180deg);
}

.about details p {
  margin: 0;
  padding: 0 0 16px;
  color: var(--fg-2);
}

.about .foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 24px;
  color: var(--fg-3);
  font-size: var(--text-sm);
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.about .foot .brand {
  padding: 0;
  margin: 0;
  color: var(--fg);
  font-size: var(--text);
}

.about .foot .brand:hover {
  background: none;
}

.about .foot a:hover {
  color: var(--fg);
}

.about .foot .right {
  margin-left: auto;
}

@media (min-width: 1024px) {
  .app[data-view="empty"] .drop {
    justify-content: center;
    gap: 36px;
    padding: 32px 56px;
  }

  .drop .hero {
    text-align: center;
  }

  .drop-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 56px;
    align-items: center;
    max-width: 1360px;
  }

  .drop .demo {
    display: block;
    justify-self: end;
    width: min(100%, calc((100dvh - 360px) * 1.5));
    max-width: 720px;
  }

  .drop-main {
    justify-self: start;
    max-width: 520px;
  }
}

.demo .cmp {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background-color: #ffffff;
  animation: demo-bg 20s linear infinite;
  --split: 50%;
}

.demo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.demo img.before {
  clip-path: inset(0 calc(100% - var(--split)) 0 0);
  animation: demo-clip 7s ease-in-out infinite;
}

.demo .line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split);
  width: 2px;
  margin-left: -1px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  animation: demo-line 7s ease-in-out infinite;
  pointer-events: none;
}

.demo.manual img.before,
.demo.manual .line,
.demo:hover img.before,
.demo:hover .line {
  animation: none;
}

.demo .line::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff center / 16px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23222' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m8 8-4 4 4 4M16 8l4 4-4 4'/%3E%3C/svg%3E");
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.demo input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  touch-action: pan-y;
}

.demo .lbl {
  position: absolute;
  top: 12px;
  font: 500 12px/1 var(--font-ui);
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  pointer-events: none;
}

.demo .lbl.l {
  left: 12px;
}

.demo .lbl.r {
  right: 12px;
}

.demo p {
  margin: 12px 0 0;
  color: var(--fg-3);
  font-size: var(--text-sm);
  text-align: left;
}

@keyframes demo-clip {
  0%,
  100% {
    clip-path: inset(0 100% 0 0);
  }
  50% {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes demo-line {
  0%,
  100% {
    left: 0%;
  }
  50% {
    left: 100%;
  }
}

@keyframes demo-bg {
  0%,
  20% {
    background-color: #ffffff;
  }
  25%,
  45% {
    background-color: #111111;
  }
  50%,
  70% {
    background-color: #d9342b;
  }
  75%,
  95% {
    background-color: #f0862a;
  }
}

.page .steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin: 8px 0 24px;
}

.page .step {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.page .step .n {
  font-family: var(--font-mono);
  color: var(--fg-3);
  font-size: 13px;
  margin-bottom: 10px;
}

.page .step h4 {
  margin: 0 0 6px;
  font-size: var(--text-md);
  font-weight: 500;
}

.page .step p {
  margin: 0;
}

.page .faq {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 48px;
}

.page details {
  border-top: 1px solid var(--line);
}

.page summary {
  cursor: pointer;
  padding: 14px 0;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 500;
}

.page summary::-webkit-details-marker {
  display: none;
}

.page summary svg {
  color: var(--fg-3);
  transition: transform 150ms var(--ease);
}

.page details[open] summary svg {
  transform: rotate(180deg);
}

.page details p {
  padding: 0 0 16px;
}

.page .facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 8px 0 32px;
}

.page .fact {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.page .fact b {
  display: block;
  margin-bottom: 4px;
}

.page .fact span {
  color: var(--fg-2);
  font-size: var(--text-sm);
}

.page .cap-note {
  color: var(--fg-3);
  font-size: var(--text-sm);
  margin: -8px 0 24px;
}

@media (max-width: 600px) {
  .page .steps,
  .page .faq,
  .page .facts {
    grid-template-columns: 1fr;
  }

  .page .faq {
    gap: 0;
  }
}

.landing {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 24px 64px;
  font-size: 16px;
  line-height: 1.55;
}

.l-hero {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 56px;
  align-items: center;
  padding: 40px 0 56px;
}

.l-kicker {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--fg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 5px 10px;
  margin: 0 0 20px;
}

.l-hero h1 {
  font-size: 40px;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 18px;
}

.l-lede {
  color: var(--fg-2);
  font-size: var(--text-md);
  margin: 0 0 24px;
  max-width: 540px;
}

.l-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.l-ticks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--fg-2);
  font-size: var(--text-sm);
}

.l-ticks li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.l-ticks svg {
  color: var(--ok);
  width: 16px;
  height: 16px;
}

.l-hero-demo {
  width: 100%;
}

.l-hero-demo p {
  margin: 12px 0 0;
  color: var(--fg-3);
  font-size: var(--text-sm);
}

.l-section {
  padding: 48px 0;
  border-top: 1px solid var(--line);
}

.l-head {
  max-width: 720px;
  margin-bottom: 28px;
}

.l-head h2 {
  font-size: var(--text-lg);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}

.l-head p {
  color: var(--fg-2);
  margin: 0;
}

.l-grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.l-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--panel);
}

.l-card.plain {
  background: transparent;
}

.l-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-3);
  margin-bottom: 12px;
}

.l-card h3 {
  font-size: var(--text-md);
  font-weight: 500;
  margin: 0 0 8px;
}

.l-card p {
  color: var(--fg-2);
  margin: 0;
  font-size: var(--text);
}

.l-compare {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}

.l-compare-head,
.l-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 12px;
  padding: 14px 20px;
  align-items: center;
}

.l-compare-head {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--fg-3);
  background: var(--raised);
  border-bottom: 1px solid var(--line);
}

.l-compare-head .us {
  color: var(--fg);
}

.l-row + .l-row {
  border-top: 1px solid var(--line);
}

.l-row .k {
  font-weight: 500;
}

.l-row span:not(.k) {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fg-2);
  font-size: var(--text);
}

.l-row svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.l-row .good svg {
  color: var(--ok);
}

.l-row .bad svg {
  color: var(--danger);
}

.l-row .mid svg {
  color: var(--fg-3);
}

.l-proof {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}

.l-proof img {
  display: block;
  width: 100%;
  height: auto;
}

.l-note {
  color: var(--fg-3);
  font-size: var(--text-sm);
  margin: 20px 0 0;
}

.landing .faq {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 48px;
}

.landing details {
  border-top: 1px solid var(--line);
}

.landing summary {
  cursor: pointer;
  padding: 14px 0;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 500;
}

.landing summary::-webkit-details-marker {
  display: none;
}

.landing summary svg {
  color: var(--fg-3);
  transition: transform 150ms var(--ease);
}

.landing details[open] summary svg {
  transform: rotate(180deg);
}

.landing details p {
  margin: 0;
  padding: 0 0 16px;
  color: var(--fg-2);
}

.l-cta {
  border-top: 1px solid var(--line);
  padding: 56px 0 40px;
  text-align: center;
}

.l-cta h2 {
  font-size: var(--text-lg);
  font-weight: 500;
  margin: 0 0 10px;
}

.l-cta p {
  color: var(--fg-2);
  max-width: 560px;
  margin: 0 auto 22px;
}

.l-meta {
  color: var(--fg-3);
  font-size: var(--text-xs);
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin: 0;
}

@media (max-width: 900px) {
  .l-hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 24px 0 40px;
  }

  .l-hero h1 {
    font-size: 30px;
  }

  .l-grid3 {
    grid-template-columns: 1fr;
  }

  .landing .faq {
    grid-template-columns: 1fr;
  }

  .l-compare-head {
    display: none;
  }

  .l-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 14px 16px;
  }

  .l-row span:not(.k)::before {
    content: "remove.bg";
    color: var(--fg-3);
    font-size: var(--text-xs);
    width: 76px;
    flex: none;
  }

  .l-row span:not(.k):last-child::before {
    content: "EraseBG";
  }
}

@media (max-width: 600px) {
  .landing {
    padding: 16px 20px 48px;
  }
}

@media (pointer: coarse) {
  :root {
    --ctl: 40px;
  }

  .field,
  input,
  select {
    font-size: 16px; }

  .tools button {
    height: 64px;
  }

  .tools button kbd,
  .shortcuts {
    display: none;
  }

  .thumb .remove {
    display: flex;
  }

  .swatch {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 1100px) {
  :root {
    --panel-w: 256px;
    --rail-w: 68px;
  }

  .bar nav {
    display: none;
  }

  .about .steps {
    gap: 24px;
  }

  .about .faq {
    gap: 0 32px;
  }
}

@media (max-width: 600px) {
  .bar {
    padding: 0 12px;
  }

  .brand span {
    display: none;
  }

  .bar {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    gap: 8px;
  }

  .bar .spacer,
  .bar nav,
  #btn-settings ~ .progress ~ #btn-theme,
  .bar:has(#btn-settings) #btn-theme {
    display: none;
  }

  .bar:not(:has(#btn-settings)) {
    grid-template-columns: 40px 1fr 40px;
  }

  .bar:not(:has(#btn-settings)) #btn-theme {
    grid-column: 3;
  }

  .brand {
    margin: 0;
    padding: 4px;
  }

  .engine {
    text-align: center;
    padding: 0;
    font-size: 13px;
    justify-self: center;
    max-width: 100%;
  }

  .app {
    height: calc(100dvh - var(--header-h));
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto auto auto;
    grid-template-areas:
      "stage"
      "rail"
      "panel"
      "tabbar";
  }

  .app[data-view="empty"] {
    grid-template-rows: 1fr;
    grid-template-areas: "stage";
  }

  .status {
    display: none;
  }

  .rail {
    grid-area: rail;
    border-right: 0;
    border-top: 1px solid var(--line);
    flex-direction: row;
    height: 66px;
  }

  .rail .list {
    flex-direction: row;
    padding: 9px 10px;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .rail .list::-webkit-scrollbar {
    display: none;
  }

  .thumb {
    width: 46px;
    height: 46px;
  }

  .thumb .remove {
    width: 18px;
    height: 18px;
    top: 2px;
    right: 2px;
  }

  .rail .foot {
    border-top: 0;
    border-left: 1px solid var(--line);
    flex-direction: row;
    padding: 9px 10px;
    align-items: center;
  }

  .rail .foot .btn {
    width: 46px;
    height: 46px;
  }

  .panel {
    grid-area: panel;
    border-left: 0;
    border-top: 1px solid var(--line);
    overflow: visible;
  }

  .panel .group {
    display: none;
    border-bottom: 0;
    padding: 12px 14px;
  }

  .panel .group h2 {
    display: none;
  }

  .panel[data-tab="brush"] .group[data-tab="brush"],
  .panel[data-tab="bg"] .group[data-tab="bg"],
  .panel[data-tab="export"] .group[data-tab="export"] {
    display: flex;
  }

  .tools {
    gap: 8px;
  }

  .tools button {
    height: 52px;
    flex-direction: row;
    gap: 8px;
    font-size: var(--text-sm);
  }

  .row .lbl {
    width: 64px;
  }

  .swatches {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .swatches::-webkit-scrollbar {
    display: none;
  }

  .swatch {
    width: 44px;
    height: 44px;
  }

  .tabbar {
    grid-area: tabbar;
    display: flex;
    border-top: 1px solid var(--line);
    background: var(--panel);
    padding: 6px 8px calc(6px + var(--sab));
    gap: 4px;
  }

  .tabbar button {
    flex: 1;
    height: 46px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 500;
    color: var(--fg-3);
    border-radius: var(--radius);
    transition: color 120ms var(--ease), background-color 120ms var(--ease);
  }

  .tabbar button[aria-pressed="true"] {
    color: var(--fg);
    background: var(--active);
  }

  .divider .lbl,
  .zoom,
  .hint {
    display: none;
  }

  .drop {
    padding: 16px;
    gap: 16px;
  }

  .drop .box {
    padding: 32px 18px;
  }

  .drop .box h2 {
    font-size: var(--text);
  }

  .drop .hero h1 {
    font-size: 24px;
  }

  .drop .hero p {
    font-size: var(--text);
  }

  .drop .samples button {
    width: 52px;
    height: 52px;
  }

  .about .wrap {
    padding: 48px 20px 32px;
  }

  .about .lede {
    margin-bottom: 40px;
  }

  .about .lede h2 {
    font-size: 24px;
  }

  .about .steps,
  .about .faq {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 40px;
  }

  .about .faq {
    gap: 0;
  }

  .about .faq details:last-child {
    border-bottom: 1px solid var(--line);
  }

  .about .foot .right {
    margin-left: 0;
  }
}

@media (max-width: 950px) and (max-height: 500px) {
  .app {
    min-height: 0;
    grid-template-columns: 1fr var(--panel-w);
    grid-template-rows: 1fr;
    grid-template-areas: "stage panel";
  }

  .rail,
  .status,
  .tabbar {
    display: none;
  }

  .panel {
    border-left: 1px solid var(--line);
    border-top: 0;
    overflow-y: auto;
  }

  .panel .group {
    display: flex;
    border-bottom: 1px solid var(--line);
  }
}

@media (prefers-reduced-motion: reduce) {
  *:not(.spin):not(.demo img.before):not(.demo .line):not(.demo .cmp),
  *::before,
  *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 72px;
  font-size: 16px;
  line-height: 1.6;
}

.page.wide {
  max-width: 1120px;
}

.page h1 {
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}

.page .lede {
  color: var(--fg-2);
  font-size: var(--text-md);
  margin: 0 0 48px;
  max-width: 640px;
}

.page h2 {
  font-size: var(--text-lg);
  font-weight: 500;
  margin: 48px 0 12px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.page h3 {
  font-size: var(--text-md);
  font-weight: 500;
  margin: 28px 0 8px;
}

.page p,
.page li {
  color: var(--fg-2);
  margin: 0 0 12px;
}

.page ul,
.page ol {
  padding-left: 22px;
  margin: 0 0 12px;
}

.page li {
  margin-bottom: 6px;
}

.page b {
  color: var(--fg);
  font-weight: 500;
}

.page kbd {
  font-size: 12px;
}

.page .quote {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg-2);
  border-left: 2px solid var(--line-strong);
  padding: 4px 0 4px 16px;
  margin: 16px 0;
  white-space: pre-wrap;
}

.page .meta {
  color: var(--fg-3);
  font-size: var(--text-sm);
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.page table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  margin: 12px 0 20px;
}

.page th,
.page td {
  text-align: left;
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--fg-2);
}

.page th {
  font-weight: 500;
  color: var(--fg-3);
  font-size: var(--text-xs);
}

.page td:first-child {
  color: var(--fg);
  font-weight: 500;
  white-space: nowrap;
}

.samples-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 8px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}

.card .cmp {
  position: relative;
  aspect-ratio: 4 / 3;
  background-color: var(--check-a);
  background-image: linear-gradient(45deg, var(--check-b) 25%, transparent 25%, transparent 75%, var(--check-b) 75%),
    linear-gradient(45deg, var(--check-b) 25%, transparent 25%, transparent 75%, var(--check-b) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

.card .cmp img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.card .cmp img.before {
  clip-path: inset(0 50% 0 0);
}

.card .cmp .line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.card .cmp .line::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23222' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m8 8-4 4 4 4M16 8l4 4-4 4'/%3E%3C/svg%3E");
  background-size: 14px;
  background-repeat: no-repeat;
  background-position: center;
}

.card .cmp input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}

.card .cap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.card .cap b {
  font-weight: 500;
}

.card .cap span {
  color: var(--fg-3);
  font-size: var(--text-sm);
}

.page .cta {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .page {
    padding: 32px 20px 56px;
  }

  .page h1 {
    font-size: 24px;
  }

  .samples-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}
