.flash-shell {
    width: min(720px, calc(100% - 48px));
    margin-inline: auto;
}

.flash-intro { padding-block: clamp(40px, 7vw, 76px) 30px; }
.flash-intro h1 { font-size: clamp(40px, 7vw, 66px); margin-bottom: 16px; }
.flash-intro .eyebrow { margin-bottom: 12px; }

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 20px;
    color: var(--accent);
    font-size: 14px;
}

.flash-panel, dialog {
    padding: clamp(18px, 4vw, 30px);
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

.flash-panel { margin-bottom: 16px; scroll-margin-top: 16px; }
.flash-panel h2 {
    margin: 0 0 10px;
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -.025em;
}

.photo-step, .hardware-examples, .download-options {
    display: grid;
    align-items: start;
    gap: 20px;
}

.photo-step { grid-template-columns: minmax(0, 1fr) minmax(0, .75fr); }
.hardware-examples { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.download-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hardware-figure { margin: 0; }
.hardware-figure img { display: block; max-width: 100%; height: auto; border-radius: 8px; }
.hardware-figure figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; }
.hardware-photo { position: relative; width: fit-content; }
.hardware-photo img { width: 100%; }
.s3-photo { max-width: 165px; margin-inline: auto; }
#flash-s3 figcaption { text-align: center; }
.jumper-photos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: 16px;
    max-width: 480px;
    margin-top: 12px;
}

.jumper-photos img { width: auto; max-height: 360px; }
.jumper-photos .hardware-photo { display: block; }

.photo-marker {
    position: absolute;
    border: clamp(2px, .4vw, 4px) solid #d98900;
    box-shadow: 0 0 0 1px #231600;
    border-radius: 5px;
    pointer-events: none;
}

.s3-com-marker { left: 60%; top: 84%; width: 31%; height: 14%; }
.s2-boot-marker { left: 42%; top: 28%; width: 13%; height: 20%; }
.otg-pad-marker { left: 56.5%; top: 73.6%; width: 6%; height: 5.2%; border-width: 2px; }
.flash-panel p { color: var(--muted); }
.flash-panel strong { color: var(--text); }
.flash-panel > p:last-child { margin-bottom: 0; }
#browser-help:empty { margin: 0; }
#browser-help { color: #ffd1bf; }
.firmware-label { color: var(--muted); font-size: 14px; }
.download-options h3 { font-size: 17px; margin-bottom: 8px; }
.download-options ul { margin: 0 0 8px; padding-left: 20px; }
.download-options a { color: var(--accent); }
.download-options code { overflow-wrap: anywhere; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.flash-button {
    border: 1px solid transparent;
    border-radius: 7px;
    min-height: 44px;
    padding: 8px 15px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.flash-button:focus-visible, summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.flash-button.primary { background: var(--accent); color: #161205; }
.flash-button.primary:hover:not(:disabled) { background: #f4d781; }
.flash-button.secondary { background: #1b1a18; border-color: #57544a; color: var(--text); }
.flash-button.secondary:hover:not(:disabled) { background: #292724; }
.flash-button.danger { background: #f4aa92; color: #24130f; }
.flash-button:disabled { cursor: default; opacity: .55; }

.flash-status {
    margin-top: 21px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #171714;
}

.flash-status p { margin: 0; color: inherit; }
.flash-status[data-state="error"] { border-color: #8c5645; color: #ffd1bf; }
.flash-status[data-state="success"] { border-color: #4b7155; color: #c1eccb; }
.flash-status[data-state="erase-required"] { border-color: var(--accent); color: #f7de97; }
progress { width: 100%; accent-color: var(--accent); }

.flash-details { padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line); }
.flash-details summary { cursor: pointer; }
.flash-details p, .flash-details pre { margin: 10px 0 0; }
.flash-details .flash-button { margin-top: 12px; }
.flash-details pre { max-height: 18rem; overflow: auto; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }

dialog { width: min(430px, calc(100% - 48px)); color: var(--text); }
dialog::backdrop { background: rgb(0 0 0 / 75%); }
.device-id { color: var(--accent); }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }

@media (max-width: 560px) {
    .photo-step, .hardware-examples, .download-options { grid-template-columns: 1fr; }
    .hardware-examples figure:last-child img { max-width: min(100%, 250px); }
}
