
:root { color-scheme: dark; }
html, body { margin: 0; padding: 0; background: #1a1a1a; color: #ddd; }
body { font-family: system-ui, -apple-system, sans-serif; padding: 20px 24px 48px; }
h1 { color: #ffcc66; font-size: 22px; margin: 0 0 4px; font-weight: 600; }
.subtitle { color: #888; font-size: 13px; margin-bottom: 16px; max-width: 900px; line-height: 1.5; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; color: #ffcc66; }
a { color: #9ecaff; }
.breadcrumb { font-size: 12px; margin: 0 0 12px; }

.ff-banner {
  margin: 0 0 16px; padding: 10px 14px; border-radius: 3px;
  font-size: 13px; line-height: 1.5; max-width: 900px;
}
.ff-banner b { color: #fff; }
.ff-banner-aligned {
  background: #1d3a25; color: #c8e8c8; border-left: 4px solid #2d6b3a;
}
.ff-banner-skip {
  background: #3a1d1d; color: #ffbcb0; border-left: 4px solid #a83a2f;
}

.badge {
  display: inline-block; padding: 1px 6px; background: #2d6b3a;
  color: #fff; border-radius: 2px; font-size: 10px;
}
.badge-idct { background: #2d6b3a; }
.badge-skip { background: #a83a2f; }
kbd {
  background: #333; border: 1px solid #555; border-bottom-width: 2px;
  border-radius: 3px; padding: 1px 6px; font-family: ui-monospace, monospace;
  font-size: 12px; color: #ddd;
}

.toolbar {
  position: sticky; top: 0; background: #1a1a1a;
  padding: 10px 0; border-bottom: 1px solid #333; z-index: 10;
  margin-bottom: 20px; display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
}
.toolbar button {
  background: #2a2a2a; color: #ddd; border: 1px solid #555;
  padding: 7px 14px; font-size: 13px; cursor: pointer; font-family: inherit;
  border-radius: 3px;
}
.toolbar button:hover { background: #333; border-color: #777; }
.toolbar .hint { color: #888; font-size: 12px; }
.mode-indicator {
  display: inline-block; padding: 2px 8px; border-radius: 2px;
  font-family: ui-monospace, monospace; font-weight: bold; font-size: 12px;
  margin-left: 6px;
}
.mode-idct { background: #2d6b3a; color: #fff; }
.mode-pure { background: #2f5aa8; color: #fff; }

.config {
  margin-bottom: 36px; padding-top: 20px;
  border-top: 1px solid #333;
}
.config-header {
  display: flex; align-items: baseline; gap: 14px;
  flex-wrap: wrap; margin-bottom: 10px;
}
.config-title { font-size: 17px; font-weight: 600; color: #ffcc66; }
.config-target { color: #aaa; font-family: ui-monospace, monospace; font-size: 13px; }

.stats {
  font-family: ui-monospace, monospace; font-size: 12px; color: #bbb;
  display: grid; gap: 2px 18px;
  grid-template-columns: max-content max-content max-content max-content;
  margin-bottom: 14px;
}
.stats .row-label { color: #888; }
.stats .val-good { color: #8dca8d; }

.images { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }

.tile {
  position: relative; background: #000;
  border: 1px solid #333; padding: 0;
}
.tile img { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }

.pair { cursor: pointer; user-select: none; }
.pair .stack { position: relative; }
.pair .stack img.idct { position: relative; }
.pair .stack img.pure { position: absolute; top: 0; left: 0; }
.pair.show-idct img.pure { visibility: hidden; }
.pair.show-pure img.idct { visibility: hidden; }

.label {
  position: absolute; top: 4px; left: 4px;
  background: rgba(0,0,0,0.82); padding: 2px 7px;
  color: #ffcc66; font-size: 11px;
  font-family: ui-monospace, monospace;
  pointer-events: none; border-radius: 2px;
}
.label.diff { color: #6cf; }

.pair .mode-badge {
  position: absolute; bottom: 6px; left: 6px;
  padding: 2px 6px; font-family: ui-monospace, monospace;
  font-weight: normal; font-size: 10px; letter-spacing: 0.5px;
  color: #fff; pointer-events: none; border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.pair .badge-idct, .pair .badge-pure { display: none; }
.pair.show-idct .badge-idct { display: inline-block; background: #2d6b3a; }
.pair.show-pure .badge-pure { display: inline-block; background: #2f5aa8; }

.pair.show-idct { border-color: #2d6b3a; }
.pair.show-pure { border-color: #2f5aa8; }

.caption {
  font-size: 11px; color: #888; font-family: ui-monospace, monospace;
  padding: 4px 6px; background: #111;
}

footer { color: #666; font-size: 11px; margin-top: 48px; text-align: center; }
