.output-device-lab,
.lcd-pixel-mixer,
.laser-printer-widget {
    margin: 2rem 0;
    padding: 1.25rem;
    border-radius: 24px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.07);
}

.odl-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.odl-header h3,
.lcd-widget-text h3 {
    margin: 0;
}

.odl-kicker {
    margin: 0 0 0.25rem;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #2563eb;
}

.odl-scenarios {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 1rem 0;
}

.odl-scenario-btn {
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    background: white;
    color: #334155;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.odl-scenario-btn:hover {
    transform: translateY(-1px);
    border-color: #0f172a;
}

.odl-scenario-btn.active {
    background: #0f172a;
    border-color: #0f172a;
    color: white;
}

.odl-panel {
    display: grid;
    grid-template-columns: 0.95fr 1.45fr;
    gap: 1rem;
    align-items: stretch;
}

.odl-choice,
.odl-metric-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 1rem;
}

.odl-label,
.odl-metric-card span {
    display: block;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.odl-device-name {
    margin: 0.4rem 0;
    font-size: 1.45rem;
    color: #0f172a;
}

.odl-reason {
    margin-bottom: 0;
    color: #475569;
}

.odl-comparison-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
}

.odl-metric-card strong {
    display: block;
    margin-top: 0.45rem;
    color: #0f172a;
    line-height: 1.35;
}

/* ===== LCD pixel mixer ===== */

.lcd-widget-grid {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1.2rem;
    align-items: center;
}

.lcd-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    height: 190px;
    overflow: hidden;
    border-radius: 26px;
    border: 1px solid #cbd5e1;
    box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.45);
}

.lcd-subpixel {
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.lcd-subpixel.red { background: rgb(240, 0, 0); }
.lcd-subpixel.green { background: rgb(0, 80, 0); }
.lcd-subpixel.blue { background: rgb(0, 0, 80); }

.lcd-controls {
    display: grid;
    gap: 0.8rem;
}

.lcd-controls label {
    display: grid;
    gap: 0.35rem;
    color: #334155;
    font-weight: 700;
}

.lcd-controls input[type="range"] {
    width: 100%;
}

.lcd-result {
    display: inline-flex;
    width: fit-content;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    background: white;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    font-weight: 800;
}

/* =========================================================
   Original laser-printing cycle dashboard
   The JS replaces the old internal SVG-based layout.
   ========================================================= */

.laser-printer-widget.laser-cycle-widget {
    --laser-accent: #2563eb;
    padding: clamp(1rem, 2.4vw, 1.8rem);
    border-radius: 30px;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 32%),
        #f8fafc;
    border: 1px solid #dbeafe;
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
}

.laser-cycle-widget *,
.laser-cycle-widget *::before,
.laser-cycle-widget *::after {
    box-sizing: border-box;
}

.laser-cycle-header {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.laser-cycle-header h3 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(1.55rem, 3vw, 2.35rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.laser-cycle-subtitle {
    margin: 0.45rem 0 0;
    color: #64748b;
}

.laser-cycle-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.55rem;
}

.laser-cycle-controls button,
.laser-cycle-challenge-actions button {
    min-height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 0.62rem 0.95rem;
    background: white;
    color: #1e293b;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease,
                border-color 0.18s ease, box-shadow 0.18s ease;
}

.laser-cycle-controls button:hover,
.laser-cycle-challenge-actions button:hover {
    transform: translateY(-1px);
    border-color: #2563eb;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
}

.laser-cycle-controls button:focus-visible,
.laser-cycle-stage:focus-visible,
.laser-cycle-timeline-btn:focus-visible,
.laser-cycle-challenge-card:focus-visible,
.laser-cycle-challenge-actions button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.28);
    outline-offset: 3px;
}

.laser-cycle-controls button:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.laser-cycle-controls .laser-cycle-next,
.laser-cycle-controls .laser-cycle-autoplay.active {
    border-color: #0f172a;
    background: #0f172a;
    color: white;
}

.laser-cycle-main {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
    gap: 1rem;
    align-items: stretch;
}

.laser-cycle-map-card,
.laser-cycle-detail-card {
    min-width: 0;
    border: 1px solid #dbe5f1;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.93);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.045);
}

.laser-cycle-map-card {
    position: relative;
    padding: 1rem;
    overflow: hidden;
}

.laser-cycle-hint {
    position: absolute;
    z-index: 4;
    top: 1rem;
    left: 1rem;
    max-width: 150px;
    padding: 0.55rem 0.72rem;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    color: #334155;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.35;
}

.laser-cycle-map {
    position: relative;
    width: min(100%, 600px);
    aspect-ratio: 1.4 / 1;
    min-height: 390px;
    margin: 0 auto;
}

.laser-cycle-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 58%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border: 3px dashed #bfdbfe;
    border-radius: 50%;
}

.laser-cycle-ring::after {
    content: "↻";
    position: absolute;
    right: 1%;
    top: 7%;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #eff6ff;
    color: #2563eb;
    font-size: 1.45rem;
    font-weight: 900;
}

.laser-cycle-centre {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 50%;
    width: 31%;
    min-width: 140px;
    aspect-ratio: 1.15 / 1;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid #bfdbfe;
    border-radius: 28px;
    background:
        radial-gradient(circle at 50% 25%, rgba(37, 99, 235, 0.11), transparent 44%),
        white;
    box-shadow: 0 18px 35px rgba(37, 99, 235, 0.12);
    color: #0f172a;
    text-align: center;
}

.laser-cycle-printer-icon {
    font-size: 3.15rem;
    color: #2563eb;
    line-height: 1;
}

.laser-cycle-centre strong {
    font-size: 1.02rem;
}

.laser-cycle-centre small {
    margin-top: 0.15rem;
    color: #64748b;
    font-weight: 700;
}

.laser-cycle-stage {
    position: absolute;
    z-index: 3;
    left: var(--stage-x);
    top: var(--stage-y);
    width: 92px;
    min-height: 92px;
    transform: translate(-50%, -50%);
    display: grid;
    grid-template-columns: auto auto;
    align-content: center;
    justify-content: center;
    gap: 0.1rem 0.25rem;
    border: 2px solid color-mix(in srgb, var(--stage-colour) 58%, white);
    border-radius: 50%;
    padding: 0.55rem;
    background: white;
    color: #334155;
    font: inherit;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease,
                border-color 0.2s ease, background 0.2s ease;
}

.laser-cycle-stage:hover {
    transform: translate(-50%, -53%);
    border-color: var(--stage-colour);
    box-shadow: 0 13px 28px color-mix(in srgb, var(--stage-colour) 18%, transparent);
}

.laser-cycle-stage.active {
    border-color: var(--stage-colour);
    background: color-mix(in srgb, var(--stage-colour) 8%, white);
    box-shadow:
        0 0 0 6px color-mix(in srgb, var(--stage-colour) 12%, transparent),
        0 15px 32px color-mix(in srgb, var(--stage-colour) 20%, transparent);
}

.laser-cycle-stage-number {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: var(--stage-colour);
    color: white;
    font-size: 0.75rem;
    font-weight: 900;
}

.laser-cycle-stage-icon {
    color: var(--stage-colour);
    font-size: 1rem;
    font-weight: 900;
}

.laser-cycle-stage-label {
    grid-column: 1 / -1;
    display: block;
    max-width: 76px;
    color: #334155;
    font-size: 0.66rem;
    font-weight: 850;
    line-height: 1.15;
    text-align: center;
}

.laser-cycle-timeline {
    display: grid;
    grid-template-columns: repeat(6, minmax(95px, 1fr));
    gap: 0.45rem;
    overflow-x: auto;
    padding: 0.55rem;
    border: 1px solid #e2e8f0;
    border-radius: 17px;
    background: #f8fafc;
    scrollbar-width: thin;
}

.laser-cycle-timeline-btn {
    min-width: 100px;
    display: flex;
    align-items: center;
    gap: 0.38rem;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 0.48rem 0.55rem;
    background: white;
    color: #475569;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
}

.laser-cycle-timeline-btn span {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--stage-colour);
    color: white;
    font-size: 0.7rem;
}

.laser-cycle-timeline-btn.active {
    border-color: var(--stage-colour);
    background: color-mix(in srgb, var(--stage-colour) 8%, white);
    color: #0f172a;
}

.laser-cycle-detail-card {
    display: flex;
    flex-direction: column;
    padding: 1.15rem;
}

.laser-cycle-detail-header {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: center;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid #e2e8f0;
    color: #2563eb;
}

.laser-cycle-detail-progress {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.laser-cycle-detail-count {
    margin-right: 0.3rem;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 800;
}

.laser-cycle-progress-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #e2e8f0;
}

.laser-cycle-progress-dot.active {
    background: var(--laser-accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--laser-accent) 13%, transparent);
}

.laser-cycle-detail-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 145px;
    gap: 1rem;
    align-items: center;
    flex: 1;
    padding: 1.25rem 0;
}

.laser-cycle-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.laser-cycle-detail-number {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--laser-accent);
    color: white;
    font-size: 1.3rem;
    font-weight: 900;
    box-shadow: 0 9px 22px color-mix(in srgb, var(--laser-accent) 22%, transparent);
}

.laser-cycle-detail-title {
    margin: 0;
    color: #0f172a;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    line-height: 1.15;
}

.laser-cycle-detail-text {
    margin: 1rem 0 0;
    color: #475569;
    line-height: 1.62;
}

.laser-cycle-detail-visual {
    width: 135px;
    height: 135px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle, color-mix(in srgb, var(--laser-accent) 16%, white) 0 42%,
        color-mix(in srgb, var(--laser-accent) 7%, white) 43% 64%, transparent 65%);
}

.laser-cycle-detail-icon {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border: 3px solid color-mix(in srgb, var(--laser-accent) 65%, white);
    border-radius: 50%;
    background: white;
    color: var(--laser-accent);
    font-size: 2.15rem;
    font-weight: 900;
    box-shadow: 0 12px 28px color-mix(in srgb, var(--laser-accent) 18%, transparent);
}

.laser-cycle-why-box {
    margin-top: auto;
    padding: 0.9rem 1rem;
    border: 1px solid color-mix(in srgb, var(--laser-accent) 26%, white);
    border-radius: 17px;
    background: color-mix(in srgb, var(--laser-accent) 6%, white);
}

.laser-cycle-why-box strong {
    color: var(--laser-accent);
}

.laser-cycle-why-box p {
    margin: 0.35rem 0 0;
    color: #475569;
    line-height: 1.5;
}

.laser-cycle-challenge {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) auto;
    gap: 0.85rem;
    align-items: center;
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid #e9d5ff;
    border-radius: 22px;
    background:
        radial-gradient(circle at left, rgba(124, 58, 237, 0.08), transparent 35%),
        #faf5ff;
}

.laser-cycle-challenge-intro {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
}

.laser-cycle-trophy {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #ede9fe;
    color: #7c3aed;
    font-size: 1.15rem;
}

.laser-cycle-challenge h4 {
    margin: 0;
    color: #6d28d9;
}

.laser-cycle-challenge-intro p {
    margin: 0.25rem 0 0;
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.4;
}

.laser-cycle-challenge-list {
    display: flex;
    gap: 0.45rem;
    min-width: 0;
    overflow-x: auto;
    padding: 0.25rem;
    scrollbar-width: thin;
}

.laser-cycle-challenge-card {
    min-width: 125px;
    min-height: 62px;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 0.35rem;
    border: 1px solid #ddd6fe;
    border-radius: 13px;
    padding: 0.5rem;
    background: white;
    color: #334155;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: left;
    cursor: grab;
    transition: border-color 0.18s ease, transform 0.18s ease,
                box-shadow 0.18s ease, background 0.18s ease;
}

.laser-cycle-challenge-card:hover {
    border-color: var(--stage-colour);
    transform: translateY(-1px);
}

.laser-cycle-challenge-card.dragging {
    opacity: 0.48;
    cursor: grabbing;
}

.laser-cycle-challenge-card.selected {
    border-color: var(--stage-colour);
    background: color-mix(in srgb, var(--stage-colour) 8%, white);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--stage-colour) 12%, transparent);
}

.laser-cycle-drag-handle {
    color: #c4b5fd;
    font-size: 1rem;
}

.laser-cycle-card-number {
    width: 23px;
    height: 23px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--stage-colour);
    color: white;
    font-size: 0.7rem;
}

.laser-cycle-challenge-card.correct {
    border-color: #16a34a;
    background: #f0fdf4;
}

.laser-cycle-challenge-card.incorrect {
    border-color: #f97316;
    background: #fff7ed;
}

.laser-cycle-challenge-actions {
    display: grid;
    gap: 0.45rem;
}

.laser-cycle-challenge-actions .laser-cycle-check {
    border-color: #7c3aed;
    background: #7c3aed;
    color: white;
}

.laser-cycle-feedback {
    grid-column: 2 / -1;
    min-height: 1.25rem;
    margin: 0;
    color: #5b21b6;
    font-size: 0.82rem;
    font-weight: 800;
}

/* ===== Responsive laser widget ===== */

@media (max-width: 1050px) {
    .laser-cycle-main {
        grid-template-columns: 1fr;
    }

    .laser-cycle-detail-body {
        min-height: 250px;
    }

    .laser-cycle-challenge {
        grid-template-columns: 1fr;
    }

    .laser-cycle-challenge-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .laser-cycle-feedback {
        grid-column: 1;
    }
}

@media (max-width: 760px) {
    .odl-header,
    .odl-panel,
    .lcd-widget-grid {
        display: grid;
        grid-template-columns: 1fr;
    }

    .odl-comparison-grid {
        grid-template-columns: 1fr;
    }

    .lcd-preview {
        height: 140px;
    }

    .laser-cycle-header {
        display: grid;
    }

    .laser-cycle-controls {
        justify-content: flex-start;
    }

    .laser-cycle-map {
        min-height: 365px;
    }

    .laser-cycle-stage {
        width: 78px;
        min-height: 78px;
    }

    .laser-cycle-stage-label {
        max-width: 64px;
        font-size: 0.59rem;
    }

    .laser-cycle-detail-body {
        grid-template-columns: 1fr;
    }

    .laser-cycle-detail-visual {
        width: 110px;
        height: 110px;
        justify-self: center;
    }
}

@media (max-width: 520px) {
    .laser-printer-widget.laser-cycle-widget {
        padding: 0.8rem;
        border-radius: 22px;
    }

    .laser-cycle-controls {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        width: 100%;
    }

    .laser-cycle-controls button {
        padding-inline: 0.55rem;
        font-size: 0.78rem;
    }

    .laser-cycle-hint {
        display: none;
    }

    .laser-cycle-map {
        min-height: 330px;
        aspect-ratio: 1 / 1;
    }

    .laser-cycle-ring {
        width: 54%;
    }

    .laser-cycle-centre {
        min-width: 112px;
        width: 34%;
    }

    .laser-cycle-printer-icon {
        font-size: 2.45rem;
    }

    .laser-cycle-stage {
        width: 69px;
        min-height: 69px;
        padding: 0.35rem;
    }

    .laser-cycle-stage-number {
        width: 20px;
        height: 20px;
        font-size: 0.62rem;
    }

    .laser-cycle-stage-label {
        font-size: 0.53rem;
        max-width: 58px;
    }

    .laser-cycle-detail-header {
        align-items: flex-start;
    }

    .laser-cycle-detail-progress {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .laser-cycle-title-row {
        align-items: flex-start;
    }

    .laser-cycle-detail-number {
        width: 42px;
        height: 42px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .laser-cycle-widget *,
    .laser-cycle-widget *::before,
    .laser-cycle-widget *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
