/* Display tests: the full-screen layer of tools/display-core.js, color
   swatches, and each page's own parts, scoped by its class on the .tool
   (dp: dead pixels, sp: stuck pixels, rr: refresh rate, mt: monitor test,
   sr: screen resolution, cs: white and black screens). Colors come from the
   site.css tokens, except the full-screen layers, previews and thumbnails,
   which show the exact colors under test. */

/* Shared parts */
.dc-start { display: grid; gap: 10px; justify-items: start; }
.dc-field { display: grid; gap: 8px; min-width: 0; }
.dc-label { margin: 0; font-size: 14px; font-weight: 600; }
.dc-options { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.dc-settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 16px 24px; }
.dc-after { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--sunk); }
.dc-after legend { padding: 0 6px; }
.dc-question { display: grid; gap: 6px; }
.dc-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.dc-swatch { gap: 8px; padding: 6px 12px 6px 6px; border-color: var(--line-strong); background: var(--panel); color: var(--ink); font-weight: 500; }
.dc-swatch:hover { background: var(--sunk); }
.dc-swatch[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.dc-chip { width: 22px; height: 22px; flex: none; border-radius: 6px; background: var(--c, #808080); box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .6); }
.dc-custom-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.dc-picker { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.dc-picker input[type=color] { width: 46px; height: 36px; padding: 2px; cursor: pointer; }

/* The full-screen layer: a .fs (site.css) holding the color or pattern and
   a hint that fades with the cursor after a pause. */
.dc-layer { overflow: hidden; outline: none; touch-action: none; user-select: none; -webkit-user-select: none; }
.dc-layer.is-idle { cursor: none; }
.dc-layer .fs-hint { z-index: 3; display: flex; gap: 12px; align-items: center; width: max-content; max-width: calc(100% - 32px); line-height: 1.45; white-space: normal; transition: opacity .3s; }
.dc-layer.is-idle .fs-hint { opacity: 0; pointer-events: none; }
.dc-exit { flex: none; padding: 6px 12px; border: 1px solid rgba(255, 255, 255, .6); border-radius: 8px; background: transparent; color: #fff; font-size: 14px; }
.dc-exit:hover { background: rgba(255, 255, 255, .18); }

/* Stuck pixel fixer */
.sp-layer { background: #000; }
.sp-canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.sp-layer.is-square .sp-canvas { display: none; }
.sp-square { position: absolute; top: 0; left: 0; display: none; cursor: grab; outline: 1px solid rgba(255, 255, 255, .45); outline-offset: 2px; touch-action: none; }
.sp-layer.is-square .sp-square { display: block; }
.sp-square:active { cursor: grabbing; }
.sp-square:focus-visible { outline: 2px solid #fff; }
.dc-layer.is-idle .sp-square { cursor: none; }
.sp-square canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.sp-status { margin: 0; font-weight: 600; }

/* Refresh rate test */
.rr-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px 24px; align-items: end; }
@media (max-width: 640px) { .rr-top { grid-template-columns: minmax(0, 1fr); } }
.rr-main .v { font-size: clamp(64px, 11vw, 112px); }
.rr-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rr-progress { height: 8px; }
.rr-rates { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.rr-rates li { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--sunk); color: var(--muted); font: 500 14px/1.4 var(--f-mono); }
.rr-rates li.is-pass { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.rr-rates li.is-pass::before { content: "\2713\00a0"; }
.rr-verdict { max-width: 70ch; margin: 0; }
.rr-verdict:empty { display: none; }
.rr-motion { display: grid; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.rr-motion-head { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.rr-motion-head .dc-label { margin-right: auto; font-size: 16px; }
.rr-lanes { display: grid; gap: 8px; }
.rr-lane { position: relative; height: 56px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--sunk); }
.rr-tag { position: absolute; top: 50%; right: 10px; z-index: 1; padding: 2px 6px; border-radius: 6px; background: var(--panel); color: var(--muted); font: 500 13px var(--f-mono); transform: translateY(-50%); }
.rr-block { position: absolute; top: 9px; left: 0; width: 40px; height: 36px; border-radius: 6px; background: var(--accent); will-change: transform; }

/* Monitor test: the cards */
.mt-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.mt-card { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
.mt-body { display: grid; gap: 8px; align-content: start; min-width: 0; }
.mt-body h2 { font-size: 18px; }
.mt-body p { margin: 0; font-size: 15px; }
.mt-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mt-mark button { padding: 6px 10px; font-size: 14px; }
.mt-thumb { position: relative; display: grid; width: 76px; height: 56px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 6px; background: #000; }
.mt-thumb i { display: block; font-style: normal; }
.mt-thumb.is-uniformity { grid-template-columns: repeat(5, 1fr); }
.mt-thumb.is-uniformity i:nth-child(1) { background: #1a1a1a; }
.mt-thumb.is-uniformity i:nth-child(2) { background: #404040; }
.mt-thumb.is-uniformity i:nth-child(3) { background: #808080; }
.mt-thumb.is-uniformity i:nth-child(4) { background: #bfbfbf; }
.mt-thumb.is-uniformity i:nth-child(5) { background: #fff; }
.mt-thumb.is-gradient { grid-template-rows: repeat(4, 1fr); }
.mt-thumb.is-gradient i:nth-child(1) { background: linear-gradient(90deg, #000, #fff); }
.mt-thumb.is-gradient i:nth-child(2) { background: linear-gradient(90deg, #000, #f00); }
.mt-thumb.is-gradient i:nth-child(3) { background: linear-gradient(90deg, #000, #0f0); }
.mt-thumb.is-gradient i:nth-child(4) { background: linear-gradient(90deg, #000, #00f); }
.mt-thumb.is-colors { grid-template-columns: repeat(7, 1fr); }
.mt-thumb.is-colors i:nth-child(1) { background: #f00; }
.mt-thumb.is-colors i:nth-child(2) { background: #0f0; }
.mt-thumb.is-colors i:nth-child(3) { background: #00f; }
.mt-thumb.is-colors i:nth-child(4) { background: #0ff; }
.mt-thumb.is-colors i:nth-child(5) { background: #f0f; }
.mt-thumb.is-colors i:nth-child(6) { background: #ff0; }
.mt-thumb.is-colors i:nth-child(7) { background: #fff; }
.mt-thumb.is-sharpness { grid-template-columns: 1fr 1fr; background: #fff; }
.mt-thumb.is-sharpness i:first-child { display: grid; place-items: center; color: #000; font: 600 20px/1 var(--f-body); }
.mt-thumb.is-sharpness i:last-child { background: repeating-linear-gradient(90deg, #000 0 1px, #fff 1px 2px); }
.mt-thumb.is-geometry { background: #000; background-image: linear-gradient(#5a5a5a 1px, transparent 1px), linear-gradient(90deg, #5a5a5a 1px, transparent 1px); background-size: 9px 9px; background-position: 2px 1px; }
.mt-thumb.is-geometry i { position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border: 2px solid #fff; border-radius: 50%; }
.mt-thumb.is-bleed { background: radial-gradient(circle at 0 0, rgba(255, 255, 255, .32), transparent 42%), radial-gradient(circle at 100% 100%, rgba(255, 255, 255, .22), transparent 36%), #000; }
.mt-thumb.is-motion i { position: absolute; top: 16px; left: 36px; width: 24px; height: 24px; background: #fff; box-shadow: -8px 0 0 rgba(255, 255, 255, .35), -16px 0 0 rgba(255, 255, 255, .15); }
@media (max-width: 520px) {
  .mt-card { grid-template-columns: minmax(0, 1fr); }
  .mt-thumb { width: 100%; height: 48px; }
}

/* Monitor test: the patterns in full screen */
.mt-stage { position: absolute; inset: 0; }
.mt-grad { display: grid; }
.mt-grad.is-h { grid-template-rows: repeat(4, 1fr); }
.mt-grad.is-v { grid-template-columns: repeat(4, 1fr); }
.mt-grad.is-h > i { background: linear-gradient(to right, #000, var(--to)); }
.mt-grad.is-v > i { background: linear-gradient(to bottom, #000, var(--to)); }
.mt-text { display: grid; grid-template-rows: 1fr 1fr; }
@media (orientation: landscape) { .mt-text { grid-template-columns: 1fr 1fr; grid-template-rows: none; } }
.mt-text-half { display: grid; gap: .5em; align-content: center; padding: 3vh 4vw; overflow: hidden; font-family: var(--f-body); }
.mt-text-half.is-light { background: #fff; color: #000; }
.mt-text-half.is-dark { background: #000; color: #fff; }
.mt-text p { margin: 0; overflow: hidden; line-height: 1.3; white-space: nowrap; }
.mt-text b { display: inline-block; min-width: 3.4em; font-weight: 600; }
.mt-canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.mt-block { position: absolute; top: 50%; left: 0; width: min(200px, 24vmin); aspect-ratio: 1; background: var(--fg); transform: translate3d(-100%, -50%, 0); will-change: transform; }
.mt-block::after { content: ""; position: absolute; inset: 30%; background: var(--inner); }

/* Screen resolution */
.sr-hero { display: grid; gap: 4px; }
.sr-k, .sr-s { margin: 0; color: var(--muted); }
.sr-big { margin: 0; font: 600 clamp(48px, 9vw, 96px)/1.05 var(--f-display); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sr-big .u { margin-left: 10px; color: var(--muted); font: 500 18px var(--f-body); }
.sr .readout .v.sr-v { font-size: clamp(28px, 4vw, 40px); }
.sr .kv th { width: 55%; }

/* White and black screens: a big preview of the color that opens it full
   screen. */
.cs-preview { display: grid; place-items: center; width: 100%; min-height: clamp(180px, 34vw, 320px); padding: 20px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--c); color: #fff; }
.cs-preview:hover { background: var(--c); }
.cs-preview-label { display: inline-flex; gap: 10px; align-items: center; padding: 10px 16px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 16px; font-weight: 600; }
.cs-preview.is-light .cs-preview-label { background: rgba(255, 255, 255, .75); color: #000; }
