/* ============================================================================
   firmware.css — the release card and the update explainer.
   ========================================================================= */

.fw-release {
    position: relative;
    overflow: hidden;
    padding: clamp(1.75rem, 4vw, 2.75rem);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.fw-release::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: var(--dawn);
}

/* Nothing to hand out — drop the brand gradient so it does not read as good news. */
.fw-release--empty::before { background: var(--line-strong); }

.fw-release__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--sp-4);
    margin-bottom: var(--sp-5);
}

.fw-release__version {
    font-family: var(--font-mono);
    font-size: var(--step-3);
    font-weight: 500;
    letter-spacing: -.01em;
    line-height: 1;
}

.fw-release__notes {
    max-width: var(--measure);
    color: var(--ink-soft);
}

.fw-release__problem {
    max-width: var(--measure);
    padding: var(--sp-4) var(--sp-5);
    border-left: 3px solid var(--warn);
    border-radius: var(--radius);
    background: var(--warn-wash);
    font-size: var(--step--1);
}

.fw-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
    gap: var(--sp-4) var(--sp-6);
    margin-top: var(--sp-6);
    padding-top: var(--sp-5);
    border-top: 1px solid var(--line);
}

/* The MD5 is far longer than the other facts and gets its own row. */
.fw-fact--wide { grid-column: 1 / -1; }

.fw-fact dt {
    font-family: var(--font-mono);
    font-size: var(--step--2);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.fw-fact dd {
    margin: .3rem 0 0;
    font-size: var(--step--1);
}

.fw-fact__hash {
    font-family: var(--font-mono);
    /* Long enough to overflow a phone; let it wrap rather than scroll the page. */
    word-break: break-all;
    color: var(--ink-soft);
}

.fw-release__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-4);
    margin-top: var(--sp-6);
}

.fw-release__hint {
    flex: 1 1 18rem;
    font-size: var(--step--2);
    color: var(--ink-muted);
}

.fw-section-head { margin-top: clamp(3rem, 7vw, 5rem); }

.fw-trouble {
    margin-top: clamp(3rem, 7vw, 5rem);
    padding-top: clamp(2rem, 5vw, 3rem);
    border-top: 1px solid var(--line);
}

/* ── Flash over USB (ESP Web Tools) ─────────────────────────────────────── */

.fw-flash {
    margin-top: clamp(3rem, 7vw, 5rem);
    padding-top: clamp(2rem, 5vw, 3rem);
    border-top: 1px solid var(--line);
    scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

.fw-flash .fw-section-head { margin-top: 0; }

.fw-flash__panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-5);
    padding: var(--sp-6);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.fw-flash__version {
    font-family: var(--font-mono);
    font-size: var(--step-1);
    font-weight: 500;
}

.fw-flash__meta {
    margin-top: .3rem;
    font-family: var(--font-mono);
    font-size: var(--step--2);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.fw-flash__note {
    margin-top: var(--sp-4);
    max-width: var(--measure);
    font-size: var(--step--2);
    color: var(--ink-muted);
}

.fw-flash__note code {
    padding: .12em .4em;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--line);
}

/* esp-web-install-button is a bare custom element with no shadow-DOM styling
   of its own for the parts we slot in — it just renders whatever we put in
   each slot, so our own .btn / .notice classes carry through unchanged. This
   only has to make the element itself behave in normal document flow. */
esp-web-install-button {
    display: inline-block;
}
