/* Scoped styles for /dead-pixel-test.html so gallery and shared navigation styles stay intact. */
#deadPixelTest {
    --blue: #3558b4;
    --blue-dark: #28458f;
    --ink: #17263c;
    --muted: #53657a;
    --line: #dce2eb;
    --surface: #f4f7fb;
    max-width: 970px;
    margin: 0 auto 30px;
    padding: 34px 36px 32px;
    background: #fff;
    border: 1px solid #dedede;
    border-radius: 20px;
    color: var(--ink);
    font: 15px/1.55 var(--font-sans, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
    text-align: left;
}

#deadPixelTest *,
.screen-test-dialog * {
    box-sizing: border-box;
}

#deadPixelTest div,
#deadPixelTest p,
#deadPixelTest h1,
#deadPixelTest h2,
#deadPixelTest ul,
#deadPixelTest li,
#deadPixelTest dl,
#deadPixelTest dt,
#deadPixelTest dd {
    clear: none;
    margin: 0;
    padding: 0;
}

#deadPixelTest button {
    font: inherit;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}

#deadPixelTest button:focus-visible,
#deadPixelTest summary:focus-visible,
#deadPixelTest a:focus-visible,
.screen-test-dialog button:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
}

#deadPixelTest .eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.13em;
    color: var(--blue);
    margin: 0 0 8px;
}

#deadPixelTest h1 {
    margin: 0 0 10px;
    font-family: inherit;
    font-size: 33px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--ink);
}

#deadPixelTest .lead {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}

#deadPixelTest .no-script {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid #d5dff2;
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
}

#deadPixelTest .no-script a {
    color: var(--blue);
    font-weight: 600;
    text-decoration: underline;
}

#deadPixelTest .test-workspace {
    margin-top: 26px;
}

#deadPixelTest .mode-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

#deadPixelTest .mode-tab {
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
}

#deadPixelTest .mode-tab:hover {
    background: #eaf0fb;
    color: var(--blue);
}

#deadPixelTest .mode-tab[aria-pressed='true'] {
    background: #fff;
    border-color: #c8d5ec;
    color: var(--blue);
    box-shadow: 0 1px 4px rgba(23, 38, 60, 0.08);
}

#deadPixelTest .mode-summary {
    margin-top: 12px;
    color: var(--muted);
    font-size: 14px;
}

#deadPixelTest .workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 24px;
    margin-top: 18px;
    align-items: start;
}

#deadPixelTest .stage-preview-col,
#deadPixelTest .controls-col {
    min-width: 0;
}

#deadPixelTest .stage-preview {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    min-height: 270px;
    padding: 18px;
    border: 1px solid rgba(23, 38, 60, 0.22);
    border-radius: 14px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    text-align: left;
}

#deadPixelTest .stage-preview:hover .stage-preview-cta {
    background: rgba(23, 38, 60, 0.92);
}

#deadPixelTest .stage-preview-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

#deadPixelTest .stage-preview-badge strong {
    font-weight: 700;
}

#deadPixelTest .stage-preview-badge span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

#deadPixelTest .stage-preview-cta {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 8px;
    background: rgba(23, 38, 60, 0.78);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    backdrop-filter: blur(4px);
}

#deadPixelTest .stage-tip {
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

#deadPixelTest .primary-launch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 20px;
    border: 0;
    border-radius: 10px;
    background: var(--blue);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}

#deadPixelTest .primary-launch:hover {
    background: var(--blue-dark);
}

#deadPixelTest .shortcut-hint {
    margin-top: 10px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.55;
}

#deadPixelTest kbd {
    display: inline-block;
    padding: 1px 5px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #f8fafc;
    color: var(--ink);
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 700;
}

#deadPixelTest .swatch-section {
    margin-top: 18px;
}

#deadPixelTest .field-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 10px;
}

#deadPixelTest .swatch-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

#deadPixelTest .swatch-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
}

#deadPixelTest .swatch-btn:hover {
    border-color: #9cb2dc;
    background: var(--surface);
}

#deadPixelTest .swatch-btn[aria-pressed='true'] {
    border-color: var(--blue);
    background: #edf2ff;
    color: var(--blue-dark);
    font-weight: 700;
}

#deadPixelTest .swatch-chip {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    border: 1px solid rgba(23, 38, 60, 0.22);
}

#deadPixelTest .swatch-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#deadPixelTest .display-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

#deadPixelTest .display-facts > div {
    min-height: 40px;
}

#deadPixelTest .display-facts dt {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

#deadPixelTest .display-facts dd {
    margin-top: 2px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
}

/* Guide & FAQ sections matching transparent-generator.css */
#deadPixelTest .how {
    margin-top: 34px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

#deadPixelTest h2 {
    font-family: inherit;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.015em;
    color: var(--ink);
    margin: 0 0 12px;
}

#deadPixelTest .steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

#deadPixelTest .step {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

#deadPixelTest .step b {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 6px;
}

#deadPixelTest .step-number {
    color: var(--blue);
    font-size: 12px;
    font-weight: 700;
}

#deadPixelTest .step p {
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.5;
}

#deadPixelTest .reading {
    display: grid;
    gap: 24px;
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

#deadPixelTest .reading p {
    color: #35435a;
    line-height: 1.65;
}

#deadPixelTest .guide-list {
    margin-top: 10px;
    padding-left: 20px;
    color: #35435a;
}

#deadPixelTest .guide-list li {
    margin-bottom: 6px;
    line-height: 1.6;
}

#deadPixelTest .reading details {
    border-top: 1px solid var(--line);
    padding: 12px 0;
}

#deadPixelTest .reading details:last-child {
    border-bottom: 1px solid var(--line);
}

#deadPixelTest .reading summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.45;
    padding: 4px 0;
}

#deadPixelTest .reading details p {
    margin-top: 8px;
    font-size: 14.5px;
}

/* Fullscreen display test dialog */
html:has(.screen-test-dialog[open]) {
    overflow: hidden;
}

.screen-test-dialog {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    background: #000;
}

.screen-test-dialog:not([open]) {
    display: none;
}

.screen-test-dialog::backdrop {
    background: #000;
}

.screen-test-canvas {
    position: relative;
    width: 100%;
    height: 100%;
    forced-color-adjust: none;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.screen-test-canvas[data-hud-hidden='true'] {
    cursor: none;
}

.screen-test-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background-image:
        linear-gradient(to right, rgba(128, 128, 128, 0.35) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(128, 128, 128, 0.35) 1px, transparent 1px);
    background-size: 10% 10%;
    transition: opacity 0.15s;
}

.screen-test-canvas[data-grid='true'] .screen-test-grid {
    opacity: 1;
}

.screen-test-status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.screen-test-hud,
.screen-test-lock-bar {
    position: absolute;
    left: 50%;
    bottom: max(18px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 14px;
    max-width: calc(100vw - 24px);
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    background: rgba(18, 24, 34, 0.86);
    color: #f8fafc;
    font: 600 13px/1.35 var(--font-sans, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    transition: opacity 0.2s;
}

.screen-test-canvas[data-hud-hidden='true'] .screen-test-hud {
    opacity: 0;
    pointer-events: none;
}

.screen-test-lock-bar[hidden],
.screen-test-hud[hidden] {
    display: none;
}

.hud-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.hud-meta strong {
    font-weight: 700;
    color: #fff;
}

.hud-meta span {
    color: #cbd5e1;
    font-size: 12px;
}

.hud-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.hud-btn {
    min-height: 38px;
    padding: 6px 11px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font: 700 12.5px/1.25 var(--font-sans, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
    cursor: pointer;
    white-space: nowrap;
}

.hud-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.hud-btn[aria-pressed='true'] {
    background: #3558b4;
    border-color: #7da2ff;
}

.hud-btn--exit {
    background: #fff;
    border-color: #fff;
    color: #17263c;
}

.hud-btn--exit:hover {
    background: #e2e8f0;
}

.lock-hint {
    color: #e2e8f0;
    font-size: 12.5px;
}

@media (max-width: 860px) {
    #deadPixelTest {
        padding: 24px 20px 26px;
    }
    #deadPixelTest .mode-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    #deadPixelTest .workspace-grid {
        grid-template-columns: 1fr;
    }
    #deadPixelTest .steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    #deadPixelTest .display-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    #deadPixelTest {
        padding: 20px 14px 22px;
        border-radius: 14px;
    }
    #deadPixelTest h1 {
        font-size: 27px;
    }
    #deadPixelTest .stage-preview {
        min-height: 210px;
    }
    #deadPixelTest .steps {
        grid-template-columns: 1fr;
    }
    .hud-btn {
        min-height: 44px;
    }
}
