/* Web flasher. Builds on /styles.css: the same navigation, panels, type, and
   square buttons as the home page. */
[hidden] { display: none !important; }
.flasher-hero { padding-block: 150px 110px; }
.flasher-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 80px; align-items: start; }
.flasher-copy { position: sticky; top: 130px; }
.flasher-copy h1 { margin-top: 26px; }
.flasher-copy .intro { margin-top: 26px; max-width: 420px; }

.flash-steps { list-style: none; margin: 44px 0 0; padding: 0; max-width: 420px; }
.flash-steps li { display: flex; align-items: center; gap: 18px; padding: 15px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); transition: color .3s; }
.flash-steps li:last-child { border-bottom: 1px solid var(--line); }
.flash-steps li span { font: 10px monospace; color: #8d939f; width: 18px; }
.flash-steps li::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: transparent; transition: background .3s; }
.flash-steps li.is-active { color: var(--ink); }
.flash-steps li.is-active::after { background: var(--blue); animation: step-pulse 1.4s ease-in-out infinite; }
.flash-steps li.is-done { color: var(--ink); }
.flash-steps li.is-done::after { background: #1f8a4c; }
.flash-steps li.is-error { color: #d33c3c; }
.flash-steps li.is-error::after { background: #d33c3c; }
@keyframes step-pulse { 50% { opacity: .25; } }

.flash-card { border: 1px solid var(--line); border-radius: 2px; padding: 30px; background: var(--paper); box-shadow: 0 20px 50px rgb(16 17 18 / 6%); }
.board-picker { border: 0; margin: 0; padding: 0; min-width: 0; }
.board-picker legend, .channel-row label, .licence-panel label { font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; padding: 0; margin-bottom: 12px; }
/* Board pictures: one device at a time, swapped like the hero devices on the
   home page (the shown one turns away, the next comes forward). */
.board-carousel { margin: 2px 0 18px; }
.board-stage { position: relative; display: grid; place-items: center; height: 300px; overflow: hidden; background: radial-gradient(ellipse 70% 60% at 50% 55%, #fff 0%, #f3f4f6 70%, #eceef1 100%); outline: none; touch-action: pan-y; cursor: grab; }
.board-stage:focus-visible { box-shadow: inset 0 0 0 3px #8db4ff; }
.board-stage::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 34px; height: 18px; border-radius: 50%; background: radial-gradient(ellipse, rgb(16 17 18 / 16%), transparent 70%); pointer-events: none; }
/* Absolutely sized with object-fit: a percentage max-height inside a grid
   item has nothing definite to resolve against, so tall pictures overflowed. */
.board-slide { position: absolute; inset: 0; margin: 0; padding: 34px 44px 52px; transition: transform 1s cubic-bezier(.65, 0, .35, 1), opacity .7s ease, filter 1s ease; }
.board-slide img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 14px 18px rgb(16 17 18 / 14%)); user-select: none; -webkit-user-drag: none; pointer-events: none; }
.board-slide:not(.is-active) { opacity: 0; transform: perspective(1400px) translateX(var(--enter, 24%)) rotateY(var(--turn, 18deg)) scale(.86); filter: blur(6px); }
.board-slide.is-leaving { transform: perspective(1400px) translateX(var(--leave, -24%)) rotateY(var(--turn-out, -18deg)) scale(.86); }
.board-slide.is-active { transition-delay: .15s; }
.board-slide.is-resetting { transition: none; }
.board-slide.is-active img { animation: board-float 6s ease-in-out infinite; }
@keyframes board-float { 50% { transform: translateY(-6px); } }
.carousel-controls { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; }
.carousel-arrow { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 2px; background: var(--paper); color: var(--ink); font-size: 15px; transition: border-color .2s, background .2s; }
.carousel-arrow:hover { border-color: #a1a8b5; }
.carousel-dots { display: flex; gap: 8px; }
.carousel-dots button { width: 26px; height: 26px; border: 0; padding: 0; background: none; display: grid; place-items: center; }
.carousel-dots button::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #c9ccd2; transition: background .3s, transform .3s; }
.carousel-dots button[aria-pressed="true"]::before { background: var(--blue); transform: scale(1.35); }
@media (prefers-reduced-motion: reduce) {
  .board-slide, .board-slide:not(.is-active), .board-slide.is-leaving { transform: none; filter: none; transition: opacity .2s; }
  .board-slide.is-active img { animation: none; }
}
@media (max-width: 760px) {
  .board-stage { height: 230px; }
  .board-slide { padding: 26px 26px 42px; }
  .board-stage::after { bottom: 26px; }
}
.board-options .loading { color: var(--muted); font-size: 13px; padding: 18px 0; }
.board-option { position: relative; display: flex; align-items: center; gap: 16px; padding: 17px 14px; border-top: 1px solid var(--line); cursor: pointer; transition: background .2s; }
.board-option:last-child { border-bottom: 1px solid var(--line); }
.board-option:hover { background: #f7f8fa; }
.board-option input { position: absolute; opacity: 0; pointer-events: none; }
.board-option .radio { flex: none; width: 16px; height: 16px; border: 1.5px solid #9aa0aa; border-radius: 50%; display: grid; place-items: center; }
.board-option .radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.board-option input:checked ~ .radio { border-color: var(--blue); }
.board-option input:checked ~ .radio::after { background: var(--blue); }
.board-option input:focus-visible ~ .radio { outline: 3px solid #8db4ff; outline-offset: 3px; }
.board-option:has(input:checked) { background: #f3f6ff; }
.board-option:has(input:disabled) { cursor: default; opacity: .6; }
.board-option h3 { font-size: 16px; }
.board-option p { font-size: 11px; color: var(--muted); margin-top: 5px; line-height: 1.4; }
.board-option .board-chip { margin-left: auto; font: 9px monospace; color: #535a66; border: 1px solid #d9dadc; padding: 5px; white-space: nowrap; }
.board-option .board-version { font: 10px monospace; color: var(--muted); white-space: nowrap; }

.channel-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 20px; }
.channel-row label { margin: 0; }
select, .licence-panel input { font: inherit; font-size: 13px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 2px; padding: 11px 12px; }
select:focus, .licence-panel input:focus { outline: none; border-color: var(--blue); }

.browser-note { display: flex; gap: 10px; margin-top: 22px; padding: 14px; background: #fff4f2; color: #9b2c1f; }
.browser-note .square { margin-top: 7px; }
.browser-note p { font-size: 13px; }

.flash-button { width: 100%; margin-top: 24px; padding-block: 17px; font-size: 13px; }
.button:disabled { opacity: .45; cursor: default; transform: none; }
.button-line { background: var(--paper); color: var(--ink); border-color: var(--line); }
.button-line:hover { border-color: #a1a8b5; }

.progress { margin-top: 24px; }
.progress-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.progress-head span:last-child { font: 12px monospace; color: var(--muted); }
.progress-track { height: 4px; margin-top: 10px; background: #eceef1; overflow: hidden; }
.progress-track i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .3s ease; }
.progress.is-success .progress-track i { background: #1f8a4c; }
.progress.is-error .progress-track i { background: #d33c3c; }

.licence-panel { margin-top: 26px; padding-top: 26px; border-top: 1px solid var(--ink); display: grid; gap: 12px; }
.licence-panel h2 { font-size: 24px; letter-spacing: -.04em; }
.licence-panel > p { font-size: 13px; color: var(--muted); }
.licence-panel dl { display: flex; gap: 12px; margin: 6px 0 8px; font-size: 13px; }
.licence-panel dt { color: var(--muted); }
.licence-panel dd { margin: 0; font-family: monospace; }
.licence-panel label { margin: 4px 0 0; }
.licence-panel input { font: 15px monospace; letter-spacing: .5px; text-transform: uppercase; padding: 14px; }
.licence-panel input::placeholder { color: #b5b9c0; }
.licence-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.link-button { border: 0; background: none; color: var(--muted); font-size: 12px; padding: 10px 6px; }
.link-button:hover { color: var(--ink); }
.form-error { min-height: 20px; font-size: 13px; color: #d33c3c; }

.result { margin-top: 24px; padding: 16px 18px; font-size: 14px; line-height: 1.6; border-left: 3px solid var(--blue); background: #f3f6ff; }
.result.is-success { border-color: #1f8a4c; background: #f0f8f3; }
.result.is-error { border-color: #d33c3c; background: #fff4f2; }
.result strong { display: block; font-weight: 600; margin-bottom: 4px; }

.flash-log { margin-top: 26px; border-top: 1px solid var(--line); }
.flash-log summary { cursor: pointer; padding: 14px 0 0; font: 11px monospace; color: var(--muted); list-style-position: inside; }
.flash-log pre { margin: 14px 0 0; max-height: 280px; overflow: auto; padding: 14px; background: var(--ink); color: #c6c8cd; font: 11px/1.6 monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

.tips { display: grid; grid-template-columns: 1fr 1fr; gap: 0 80px; margin-top: 55px; }
.tips article { border-top: 1px solid var(--line); padding: 26px 0 34px; }
.tips h3 { font-size: 20px; }
.tips p { font-size: 14px; color: var(--muted); margin-top: 12px; max-width: 470px; }
.flasher-footer footer { border-top: 0; }

@media (max-width: 1050px) {
  .flasher-layout { gap: 45px; }
  .tips { column-gap: 45px; }
}
@media (max-width: 860px) {
  .flasher-layout { grid-template-columns: 1fr; }
  .flasher-copy { position: static; }
  .flash-steps { display: none; }
}
@media (max-width: 760px) {
  .flasher-hero { padding-block: 112px 60px; }
  .flash-card { padding: 20px; }
  .tips { grid-template-columns: 1fr; margin-top: 35px; }
  .tips article { padding: 22px 0 26px; }
  .tips h3 { font-size: 18px; }
  .tips p { font-size: 13px; }
}
@media (max-width: 420px) {
  .board-option { gap: 12px; padding-inline: 8px; }
  .board-option .board-chip { display: none; }
  .board-option .board-version { margin-left: auto; }
  .licence-actions .button { width: 100%; }
}

/* The D1: an extra action for its RP2040, the go-ahead before a full erase,
   and the RP2040 step's panel. */
.coprocessor-only { display: block; margin: 10px auto 0; }
.erase-panel, .cop-panel { margin-top: 26px; padding-top: 26px; border-top: 1px solid var(--ink); display: grid; gap: 12px; }
.erase-panel h2, .cop-panel h2 { font-size: 24px; letter-spacing: -.03em; }
.erase-panel > p, .cop-panel > p { font-size: 14px; color: var(--muted); }
.cop-howto { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.7; }
.link-button:disabled { opacity: .45; cursor: default; }
