/* Version notices: editor (vn-), dashboard view (vnv-) and the public firmware-notice page (fw-, own light theme). */

/* ── Editor ──────────────────────────────────────────────────────────────── */

#vn-feedback { position: sticky; top: var(--app-sticky-top); z-index: 5; }

/* Version list */
.vn-search { margin: 0 4px 8px; }
.vn-filter { display: flex; margin: 0 4px 10px; }
.vn-item-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vn-fill { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: var(--legacy, #d97706); }
.vn-fill.is-empty { background: #cbd5e1; }
.vn-fill.is-full { background: var(--success, #059669); }

/* Selected version */
.vn-panel { display: flex; flex-direction: column; gap: 14px; }
.vn-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vn-title { margin: 0; font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
.vn-preview { margin-left: auto; }
.vn-switch { gap: 10px; }
.vn-dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #cbd5e1; vertical-align: middle; }
.vn-dot.is-filled { background: var(--success, #059669); }
.vn-dot.is-inherited { background: color-mix(in srgb, var(--success, #059669) 45%, #fff); }
.vn-dot.is-dirty { background: var(--legacy, #d97706); }
.vn-field { display: flex; flex-direction: column; gap: 8px; }
.vn-inherit-note { display: none; }
.vn-field.vn-inherited .vn-inherit-note { display: flex; }
.vn-textarea { min-height: 360px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.84rem; line-height: 1.55; }
.vn-textarea[readonly] { background: var(--bg, #f6f7f9); }
.vn-field.is-dirty .vn-textarea { border-color: var(--legacy, #d97706); }
.vn-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border, #e5e7eb); }

/* ── Dashboard view (rendered Markdown) ──────────────────────────────────── */

.vnv-content { font-size: 0.88rem; line-height: 1.6; }
.vnv-content > :first-child { margin-top: 0; }
.vnv-content > :last-child { margin-bottom: 0; }
.vnv-content h1, .vnv-content h2, .vnv-content h3 { margin: 1.2em 0 0.5em; font-size: 0.95rem; }
.vnv-content ul, .vnv-content ol { padding-left: 1.4em; }
.vnv-content a { color: var(--accent, #2563eb); }
.vnv-content code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; }
.vnv-content pre { padding: 12px 14px; border-radius: var(--ui-radius-sm, 9px); background: var(--bg, #f6f7f9); overflow-x: auto; }
.vnv-content blockquote { margin: 14px 0; padding: 10px 12px; border-radius: var(--ui-radius-sm, 9px); background: var(--legacy-bg, #fef3c7); color: #78350f; }
.vnv-content blockquote > :first-child { margin-top: 0; }
.vnv-content blockquote > :last-child { margin-bottom: 0; }
.vnv-content table { width: 100%; margin: 14px 0; border-collapse: collapse; }
.vnv-content th, .vnv-content td { padding: 7px 11px; border: 1px solid var(--border, #e5e7eb); text-align: left; }
.vnv-content th { background: var(--bg, #f6f7f9); }

/* ── Public firmware-notice page (light theme only) ──────────────────────── */

.firmware-notice .badge {
    font-size: 0.72rem;
    padding: 2px 9px;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.firmware-notice .badge.release { background: var(--success-bg, #dcfce7); color: var(--success, #166534); }
.firmware-notice .badge.alpha { background: var(--danger-bg, #fee2e2); color: var(--danger, #991b1b); }
.firmware-notice .badge.legacy { background: var(--legacy-bg, #f1f5f9); color: var(--legacy, #64748b); }

.firmware-notice {
    --fw-accent: var(--behnke-design, #2f6df6);
    --fw-page: #f4f6fa;
    --fw-surface: #ffffff;
    --fw-border: #e3e7ee;
    --fw-ink: #1f2733;
    --fw-muted: #6b7280;

    max-width: 860px;
    margin: 0 auto;
    padding: 28px 20px 64px;
    color: var(--fw-ink);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

/* ── Hero header card ─────────────────────────────────────────────────── */

.firmware-notice .fw-hero {
    background: var(--fw-surface);
    border: 1px solid var(--fw-border);
    border-radius: 16px;
    padding: 26px 28px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
    margin-bottom: 30px;
}

.firmware-notice .fw-eyebrow {
    margin: 0 0 10px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--fw-accent);
}

.firmware-notice .fw-hero-title {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.firmware-notice .fw-hero-title h1 {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.firmware-notice .fw-version {
    font-size: 1.7rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--fw-accent);
}

.firmware-notice .vn-platform-tag {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 6px;
    background: #eef1f6;
    color: var(--fw-muted);
}

.firmware-notice .fw-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 34px;
    margin: 22px 0 0;
    padding: 18px 0 0;
    border-top: 1px solid var(--fw-border);
}

.firmware-notice .fw-meta-item { margin: 0; }

.firmware-notice .fw-meta dt {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fw-muted);
    margin-bottom: 3px;
}

.firmware-notice .fw-meta dd {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.firmware-notice .fw-meta-item--file dd code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85rem;
    font-weight: 500;
    background: #f3f5f9;
    padding: 2px 7px;
    border-radius: 5px;
    color: #384150;
}

/* ── Action buttons ───────────────────────────────────────────────────── */

.firmware-notice .fw-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.firmware-notice .fw-ico {
    width: 18px;
    height: 18px;
    flex: none;
}

.firmware-notice .fw-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    border-radius: 10px;
    background: var(--fw-accent);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    border: 1px solid transparent;
    box-shadow: 0 2px 8px rgba(47, 109, 246, 0.28);
    transition: filter 0.12s ease, transform 0.12s ease;
}

.firmware-notice .fw-download-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }

.firmware-notice .fw-download-size {
    font-weight: 600;
    font-size: 0.82rem;
    opacity: 0.85;
    padding-left: 10px;
    margin-left: 2px;
    border-left: 1px solid rgba(255, 255, 255, 0.4);
}

.firmware-notice .fw-print-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 12px 20px;
    border-radius: 10px;
    background: var(--fw-surface);
    color: var(--fw-ink);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid var(--fw-border);
    transition: background 0.12s ease, border-color 0.12s ease;
}

.firmware-notice .fw-print-btn:hover { background: #f6f8fc; border-color: #cdd4df; }

/* ── Intro + notes ────────────────────────────────────────────────────── */

.firmware-notice .vn-intro {
    color: var(--fw-muted);
    margin: 0 0 20px;
    max-width: 70ch;
}

.firmware-notice .vn-empty {
    font-style: italic;
    color: var(--fw-muted);
}

.firmware-notice .fw-notes-section { margin-bottom: 8px; }

.firmware-notice .fw-notes-heading {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 4px;
}

.firmware-notice .fw-notes-card {
    background: var(--fw-surface);
    border: 1px solid var(--fw-border);
    border-left: 4px solid var(--fw-accent);
    border-radius: 14px;
    padding: 22px 26px 6px;
    margin-top: 14px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 6px 18px rgba(16, 24, 40, 0.06);
}

.firmware-notice .fw-langtablist {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--fw-border);
}

.firmware-notice .fw-langtab {
    appearance: none;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 8px 14px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--fw-muted);
    cursor: pointer;
}

.firmware-notice .fw-langtab:hover { color: var(--fw-ink); }

.firmware-notice .fw-langtab.is-active {
    color: var(--fw-accent);
    border-bottom-color: var(--fw-accent);
}

.firmware-notice .fw-langpanel { margin-bottom: 28px; }

.firmware-notice .fw-langpanel-title {
    font-size: 1.05rem;
    border-bottom: 1px solid var(--fw-border);
    padding-bottom: 6px;
    margin-bottom: 14px;
}

.firmware-notice .fw-notes.is-tabbed .fw-langpanel { display: none; }
.firmware-notice .fw-notes.is-tabbed .fw-langpanel.is-active { display: block; }
.firmware-notice .fw-notes.is-tabbed .fw-langpanel-title { display: none; }

.firmware-notice .vn-rendered-content {
    line-height: 1.7;
    font-size: 1.02rem;
    color: #232b36;
    background: #fff8e6;
    border: 1px solid #f2d074;
    border-left: 4px solid #e0a300;
    border-radius: 10px;
    padding: 18px 22px;
}
.firmware-notice .vn-rendered-content > :first-child { margin-top: 0; }
.firmware-notice .vn-rendered-content > :last-child { margin-bottom: 0; }
.firmware-notice .vn-rendered-content h1,
.firmware-notice .vn-rendered-content h2,
.firmware-notice .vn-rendered-content h3 { margin-top: 1.3em; margin-bottom: 0.5em; }
.firmware-notice .vn-rendered-content h2 { font-size: 1.2rem; }
.firmware-notice .vn-rendered-content h3 { font-size: 1.05rem; }
.firmware-notice .vn-rendered-content ul,
.firmware-notice .vn-rendered-content ol { padding-left: 1.4em; }
.firmware-notice .vn-rendered-content li { margin: 4px 0; }
.firmware-notice .vn-rendered-content a { color: var(--fw-accent); }
.firmware-notice .vn-rendered-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.88em;
    background: #f3f5f9;
    padding: 1px 6px;
    border-radius: 5px;
}
.firmware-notice .vn-rendered-content pre {
    background: #f6f8fa;
    padding: 12px 14px;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid var(--fw-border);
}
.firmware-notice .vn-rendered-content pre code { background: none; padding: 0; }
.firmware-notice .vn-rendered-content blockquote {
    margin: 18px 0;
    padding: 14px 18px;
    border: 1px solid #f2d074;
    border-left: 4px solid #e0a300;
    background: #fff8e6;
    border-radius: 10px;
    color: #5a4708;
    font-weight: 500;
}
.firmware-notice .vn-rendered-content blockquote p { margin: 0; }
.firmware-notice .vn-rendered-content blockquote :last-child { margin-bottom: 0; }
.firmware-notice .vn-rendered-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 14px 0;
}
.firmware-notice .vn-rendered-content th,
.firmware-notice .vn-rendered-content td {
    border: 1px solid var(--fw-border);
    padding: 7px 11px;
    text-align: left;
}
.firmware-notice .vn-rendered-content th { background: #f6f8fc; }

/* ── Related downloads ────────────────────────────────────────────────── */

.firmware-notice .fw-related {
    margin-top: 36px;
    padding-top: 26px;
    border-top: 1px solid var(--fw-border);
}

.firmware-notice .fw-related-title {
    font-size: 1.05rem;
    margin: 0 0 16px;
}

.firmware-notice .fw-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.firmware-notice .fw-related-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--fw-border);
    border-radius: 12px;
    background: var(--fw-surface);
    text-decoration: none;
    color: var(--fw-ink);
    transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

.firmware-notice .fw-related-card:hover {
    border-color: var(--fw-accent);
    box-shadow: 0 4px 14px rgba(47, 109, 246, 0.14);
    transform: translateY(-1px);
}

.firmware-notice .fw-related-ico {
    width: 26px;
    height: 26px;
    flex: none;
    color: var(--fw-accent);
}

.firmware-notice .fw-related-label {
    flex: 1;
    font-weight: 600;
    font-size: 0.93rem;
    line-height: 1.25;
}

.firmware-notice .fw-related-size {
    font-size: 0.78rem;
    color: var(--fw-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ── Newsletter hint ──────────────────────────────────────────────────── */

.firmware-notice .nl-hint {
    margin-top: 32px;
}

.firmware-notice .nl-hint-cta {
    background: none;
    color: var(--fw-accent);
    border: 1px solid color-mix(in srgb, var(--fw-accent) 45%, transparent);
}

.firmware-notice .nl-hint-cta:hover {
    background: color-mix(in srgb, var(--fw-accent) 8%, transparent);
    box-shadow: none;
    filter: none;
}

/* ── Footer download ──────────────────────────────────────────────────── */

.firmware-notice .fw-download--footer {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 2px solid var(--fw-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
}

.firmware-notice .fw-download-hint {
    margin: 0;
    color: var(--fw-muted);
    font-size: 0.95rem;
}

.firmware-notice .fw-download-btn--lg {
    padding: 15px 30px;
    font-size: 1.05rem;
}

.firmware-notice .fw-accept-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 20px;
    border-radius: 10px;
    background: var(--fw-surface);
    color: var(--fw-ink);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid var(--fw-border);
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.firmware-notice .fw-accept-btn:hover {
    background: #f6f8fc;
    border-color: #cdd4df;
}

.firmware-notice .fw-accept-btn .fw-accept-check {
    color: var(--fw-muted);
    transition: color 0.12s ease;
}

.firmware-notice .fw-accept-btn.is-accepted {
    background: color-mix(in srgb, #16a34a 12%, transparent);
    border-color: color-mix(in srgb, #16a34a 40%, transparent);
    color: #166534;
    cursor: default;
}

.firmware-notice .fw-accept-btn.is-accepted .fw-accept-check { color: #16a34a; }

.firmware-notice .fw-download-btn.is-locked {
    background: #e5e8ee;
    color: var(--fw-muted);
    box-shadow: none;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.85;
}

.firmware-notice .fw-download-btn.is-locked:hover { filter: none; transform: none; }

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 560px) {
    .firmware-notice .fw-hero { padding: 20px; }
    .firmware-notice .fw-hero-title h1,
    .firmware-notice .fw-version { font-size: 1.4rem; }
    .firmware-notice .fw-actions { flex-direction: column; align-items: stretch; }
    .firmware-notice .fw-download-btn,
    .firmware-notice .fw-print-btn { justify-content: center; }
}

/* ── Print / save-as-PDF ──────────────────────────────────────────────── */

@media print {
    .header,
    #page_progress_bar,
    .legal-footer,
    footer,
    .fw-actions,
    .fw-langtablist,
    .fw-download--footer {
        display: none !important;
    }

    body { background: #fff !important; }

    .firmware-notice {
        max-width: none;
        margin: 0;
        padding: 0;
        color: #000;
        font-size: 11pt;
    }

    .firmware-notice .fw-hero {
        border: none;
        box-shadow: none;
        padding: 0 0 12px;
        border-bottom: 2px solid #000;
        border-radius: 0;
        margin-bottom: 18px;
    }

    .firmware-notice .fw-notes-card {
        border: none;
        border-left: none;
        box-shadow: none;
        padding: 0;
        margin-top: 8px;
    }

    .firmware-notice .fw-notes.is-tabbed .fw-langpanel { display: none !important; }
    .firmware-notice .fw-notes.is-tabbed .fw-langpanel.is-active { display: block !important; }

    .firmware-notice .fw-related-card {
        break-inside: avoid;
        box-shadow: none;
    }

    .firmware-notice .vn-rendered-content a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #555;
        word-break: break-all;
    }
    .firmware-notice .fw-related-card[href]::after { content: ""; }
}
