/* Dead & Stuck Pixel Test — /tools/dead-pixel-test */
.dp-wide { grid-column: 1 / -1; min-width: 0; }
.dp-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dp-small { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; margin: 6px 0; }
.dp-note { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; margin: 8px 0 0; padding: 8px 10px; border-left: 3px solid var(--accent); background: var(--bg-input); border-radius: 4px; }
.dp-note--warn { border-left-color: #d9534f; }
#build-msg { margin-top: 10px; font-size: 0.85rem; color: var(--text-secondary); }
#build-msg.is-warn { color: #e0a800; }

.dp-swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dp-swatch { min-height: 44px; border: 2px solid var(--border); border-radius: 6px; cursor: pointer; font-size: 0.72rem; font-weight: 600; padding: 4px; }
.dp-swatch.is-on { outline: 3px solid var(--accent); outline-offset: 2px; }
.dp-swatch:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.dp-seq { font-size: 0.78rem; color: var(--text-tertiary); margin-top: 6px; overflow-wrap: anywhere; }
.dp-check { display: flex; gap: 8px; align-items: flex-start; font-size: 0.85rem; color: var(--text-secondary); margin-top: 10px; cursor: pointer; }
.dp-check input { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px; }
.dp-keys { font-size: 0.78rem; color: var(--text-tertiary); margin: 10px 0 0; padding-left: 18px; line-height: 1.6; }
.dp-keys kbd { font-family: var(--font-mono); font-size: 0.72rem; border: 1px solid var(--border); border-radius: 3px; padding: 0 4px; background: var(--bg-input); }

.dp-tests { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.dp-tests .ub-tool-btn.is-active { border-color: var(--accent); color: var(--accent); }
.dp-presets { margin-top: 14px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-input); }
.dp-presets__title { font-size: 0.75rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; font-weight: 600; }
.dp-presets__row { display: flex; gap: 6px; flex-wrap: wrap; }

.dp-svg { width: 100%; height: auto; display: block; }
.dp-verdict { margin: 8px 16px 4px; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; }
.dp-tag { display: inline-block; margin-left: 6px; font-size: 0.62rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: #e8a317; border: 1px solid #e8a317; border-radius: 3px; padding: 0 4px; vertical-align: middle; }

.dp-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md, 8px); padding: 16px 18px; margin-bottom: 16px; }
.dp-card__title { font-size: 1rem; font-weight: 700; margin: 0 0 10px; color: var(--text-primary); }
.dp-card__bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.dp-card__bar .dp-card__title { margin: 0; flex: 1 1 auto; }
.dp-empty, .dp-example-note { font-size: 0.85rem; color: var(--text-secondary); margin: 0 0 10px; }
.dp-example-note { padding: 6px 10px; border: 1px dashed #e8a317; border-radius: 6px; }

.dp-mark { border: 1px solid var(--border-subtle); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.dp-mark.is-example { border-style: dashed; }
.dp-mark__head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 0.85rem; color: var(--text-primary); }
.dp-mark__pos { font-family: var(--font-mono); font-weight: 600; color: var(--accent); }
.dp-mark__sub, .dp-mark__on { font-size: 0.75rem; color: var(--text-tertiary); }
.dp-mark__btns { margin-left: auto; display: flex; gap: 6px; }
.dp-mini { min-height: 32px; padding: 4px 10px; font-size: 0.75rem; border: 1px solid var(--border); border-radius: 5px; background: var(--bg-input); color: var(--text-primary); cursor: pointer; }
.dp-mini:hover { border-color: var(--accent); color: var(--accent); }
.dp-q { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 8px; }
.dp-q__label { font-size: 0.78rem; color: var(--text-secondary); min-width: 170px; }
.dp-q__opts { display: flex; flex-wrap: wrap; gap: 5px; }
.dp-chip { min-height: 36px; padding: 4px 10px; font-size: 0.75rem; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-input); color: var(--text-primary); cursor: pointer; }
.dp-chip.is-on { background: var(--accent); border-color: var(--accent); color: #0c0e11; font-weight: 700; }
.dp-chip:disabled { cursor: default; opacity: 0.85; }
.dp-verdict-line { margin-top: 8px; font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; }
.dp-verdict-line strong { color: var(--text-primary); }
.dp-verdict-line.is-guess strong { color: #e8a317; }

.dp-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dp-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.dp-table th, .dp-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; color: var(--text-secondary); }
.dp-table th { color: var(--text-primary); font-weight: 600; background: var(--bg-input); }
.dp-table td:first-child { color: var(--text-primary); font-weight: 600; }
.dp-table__you td { color: var(--accent); font-weight: 700; }
.dp-table a { word-break: break-word; }
.dp-report { width: 100%; min-height: 220px; font-family: var(--font-mono); font-size: 0.75rem; background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border); border-radius: 6px; padding: 10px; resize: vertical; }

/* Modal (photosensitivity warning) */
.dp-modal { position: fixed; inset: 0; z-index: 2147483600; background: rgba(0, 0, 0, 0.7); display: flex; align-items: center; justify-content: center; padding: 16px; }
.dp-modal__box { background: var(--bg-card); color: var(--text-primary); border: 2px solid #d9534f; border-radius: 10px; max-width: 520px; width: 100%; max-height: 90vh; overflow: auto; padding: 18px 20px; }
.dp-modal__title { margin: 0 0 10px; font-size: 1.15rem; color: #ff6b6b; }
.dp-modal__body { font-size: 0.9rem; line-height: 1.55; color: var(--text-secondary); }
.dp-modal__body ul { padding-left: 18px; }
.dp-modal__btns { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }

/* Full-screen stage */
html.dp-locked, html.dp-locked body { overflow: hidden; }
.dp-stage { position: fixed; inset: 0; z-index: 2147483500; background: #000; touch-action: none; user-select: none; -webkit-user-select: none; cursor: none; outline: none; overflow: hidden; }
.dp-stage.is-chrome { cursor: default; }
.dp-stage--fix { cursor: default; }
.dp-stage__layer { position: absolute; inset: 0; }
.dp-stage__canvas { position: absolute; left: 0; top: 0; display: block; }
.dp-stage__bar, .dp-stage__hint { position: absolute; left: 50%; transform: translateX(-50%); opacity: 0; pointer-events: none; transition: opacity 0.4s; max-width: calc(100% - 24px); }
.dp-stage.is-chrome .dp-stage__bar, .dp-stage.is-chrome .dp-stage__hint { opacity: 1; pointer-events: auto; }
.dp-stage__bar { top: 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; align-items: center; background: rgba(20, 20, 20, 0.88); border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 10px; padding: 6px; }
.dp-stage__bar button { min-height: 40px; min-width: 40px; padding: 6px 12px; font-size: 0.85rem; color: #fff; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 7px; cursor: pointer; }
.dp-stage__bar button[aria-pressed="true"], .dp-stage__bar button.is-primary { background: #e8a317; color: #111; border-color: #e8a317; font-weight: 700; }
.dp-stage__bar button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.dp-stage__count { color: #fff; font-size: 0.85rem; padding: 0 6px; white-space: nowrap; }
.dp-stage__count--dim { color: rgba(255, 255, 255, 0.6); }
.dp-stage__hint { bottom: 16px; color: #fff; background: rgba(20, 20, 20, 0.85); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; padding: 8px 12px; font-size: 0.85rem; line-height: 1.45; text-align: center; width: max-content; }
.dp-stage__hint:empty { display: none; }
.dp-stage.is-flashing.is-chrome .dp-stage__bar { background: rgba(0, 0, 0, 0.6); }

.dp-ring { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 2px #000, inset 0 0 0 2px #000; pointer-events: none; }
.dp-ring::after { content: attr(data-n); position: absolute; left: 22px; top: -16px; font: 700 12px system-ui, sans-serif; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }

.dp-fix-sq { position: absolute; box-sizing: border-box; border: 1px dashed rgba(232, 163, 23, 0.9); background: #333; cursor: move; touch-action: none; }
.dp-fix-sq.is-running { border: none; cursor: none; }
.dp-fix-sq.is-whole { border: none; cursor: default; }
.dp-fix-sq__noise { position: absolute; inset: 0; width: 100%; height: 100%; display: none; image-rendering: pixelated; }
.dp-fix-sq__cross { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -5px 0 0 -5px; border: 1px solid #e8a317; border-radius: 50%; pointer-events: none; }
.dp-fix-sq__grip { position: absolute; right: -12px; bottom: -12px; width: 24px; height: 24px; background: #e8a317; border-radius: 4px; cursor: nwse-resize; }
.dp-fix-sq.is-running .dp-fix-sq__cross, .dp-fix-sq.is-running .dp-fix-sq__grip, .dp-fix-sq.is-whole .dp-fix-sq__grip, .dp-fix-sq.is-whole .dp-fix-sq__cross { display: none; }

.dp-sharp { position: absolute; left: 16px; top: 16px; bottom: 16px; overflow: hidden; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
.dp-sharp__cap { font-size: 13px; margin: 0 0 10px; opacity: 0.8; }

@media (max-width: 800px) {
    .dp-row2 { grid-template-columns: 1fr; }
    .dp-q__label { min-width: 0; width: 100%; }
    .dp-mark__btns { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .dp-stage__bar, .dp-stage__hint { transition: none; }
}
.dp-nowrap { white-space: nowrap; }

/* ── Instant start ─────────────────────────────────────────── */
.dp-hero { margin: 0 0 16px; padding: 14px; border: 1px solid var(--accent); border-radius: 10px; background: var(--bg-input); }
.dp-hero__go { width: 100%; min-height: 56px; font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; }
.dp-hero__sub { margin: 10px 0 0; font-size: 0.8rem; color: var(--text-secondary); line-height: 1.45; }
.dp-hero__more { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dp-hero__more .ub-tool-btn { min-height: 44px; width: 100%; }
.dp-modes { flex-wrap: wrap; }
.dp-tests { grid-template-columns: repeat(2, 1fr); }
.dp-src a, .dp-small a { word-break: break-word; }

/* Line marks in the test screen: brackets either side, never over the line. */
.dp-lmark { position: absolute; pointer-events: none; box-sizing: border-box; }
.dp-lmark--vline { top: 0; bottom: 0; border-left: 1px dashed #e8a317; border-right: 1px dashed #e8a317; box-shadow: -1px 0 0 #000, 1px 0 0 #000; }
.dp-lmark--hline { left: 0; right: 0; border-top: 1px dashed #e8a317; border-bottom: 1px dashed #e8a317; box-shadow: 0 -1px 0 #000, 0 1px 0 #000; }
.dp-lmark::after { content: attr(data-n); position: absolute; font: 700 12px system-ui, sans-serif; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.dp-lmark--vline::after { top: 50%; left: calc(100% + 4px); }
.dp-lmark--hline::after { left: 50%; top: calc(100% + 2px); }
.dp-mark__kind { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-tertiary); border: 1px solid var(--border); border-radius: 3px; padding: 0 4px; }
.dp-mark.is-line { border-left: 3px solid #e8a317; }

/* Fixer regions */
.dp-regbox { margin: 12px 0; padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
.dp-meter { height: 10px; border-radius: 5px; background: var(--border-subtle); overflow: hidden; margin: 4px 0 2px; }
.dp-meter span { display: block; height: 100%; background: #3fb950; }
.dp-meter.is-over span { background: #d9534f; }
.dp-regions td { vertical-align: middle; }
.dp-num { width: 84px; min-height: 36px; padding: 4px 6px; background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border); border-radius: 5px; }
.dp-regions select { min-height: 36px; max-width: 170px; background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border); border-radius: 5px; }
.dp-inline { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.dp-fix-sq.is-active { outline: 2px solid #e8a317; outline-offset: 2px; }
.dp-fix-sq.is-running.is-active { outline: none; }
.dp-fix-sq.is-thin { border-width: 0; outline: 1px dashed rgba(232, 163, 23, 0.9); outline-offset: 3px; }
.dp-fix-sq.is-thin .dp-fix-sq__cross { display: none; }
.dp-fix-sq__n { position: absolute; left: 100%; top: 0; margin-left: 6px; font: 700 12px system-ui, sans-serif; color: #e8a317; text-shadow: 0 0 2px #000; pointer-events: none; }
.dp-fix-sq.is-running .dp-fix-sq__n, .dp-fix-sq.is-whole .dp-fix-sq__n { display: none; }

/* Line diagnosis */
.dp-steps { margin: 8px 0; padding-left: 0; list-style: none; }
.dp-steps li { padding: 10px 0; border-bottom: 1px solid var(--border-subtle); }
.dp-steps__q { margin: 0 0 6px; font-size: 0.88rem; color: var(--text-primary); line-height: 1.5; }
.dp-ldverdict { margin: 10px 0; padding: 10px 12px; border-radius: 8px; border-left: 4px solid #e8a317; background: var(--bg-input); font-size: 0.88rem; line-height: 1.5; color: var(--text-secondary); }
.dp-ldverdict strong { color: var(--text-primary); }
.dp-ldverdict--panel { border-left-color: #d9534f; }
.dp-ldverdict--cable, .dp-ldverdict--computer { border-left-color: #3fb950; }
.dp-srcs summary, .dp-mapcard > summary { cursor: pointer; }
.dp-srcs summary { font-size: 0.82rem; color: var(--accent); margin: 8px 0 4px; }
.dp-mapcard > summary { list-style: revert; }
.dp-compare li.is-gone { color: #3fb950; }
.dp-compare li.is-still { color: #d9534f; }
.dp-compare li.is-new { color: #e8a317; }
.dp-filebtn { cursor: pointer; display: inline-flex; align-items: center; }

/* Camera scan */
.dp-camwrap { margin: 10px 0; max-width: 720px; }
.dp-cam { display: block; max-width: 100%; touch-action: none; background: #111; border-radius: 6px; }
.dp-cam:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
#dp-scan-status.is-warn { color: #e0a800; }
.dp-scanfig { margin: 12px 0 0; }
.dp-scanmap { width: 100%; max-width: 720px; height: auto; image-rendering: pixelated; border: 1px solid var(--border); border-radius: 6px; }
.dp-layouts { margin-bottom: 8px; }

@media (max-width: 800px) {
    .dp-hero { padding: 10px; }
    .dp-hero__go { min-height: 50px; }
    .dp-num { width: 70px; }
}
