   :root {
    --bg-void:        #12161c;   /* was #0a0d12 */
    --bg-app:         #161b22;   /* was #0d1117 */
    --bg-panel:       #1a212c;   /* was #11161e */
    --bg-panel-raised:#1f2836;   /* was #151b25 */
    --bg-inset: rgba(0,0,0,0.25);

    --border-soft:    rgba(255,255,255,0.07);
    --border-med:     rgba(255,255,255,0.12);

    --text-primary:   #eef1f6;
    --text-secondary: #9aa3b5;
    --text-muted:     #5e6879;

    --accent-cyan:    #38c6d9;
    --accent-cyan-dim:rgba(56,198,217,0.14);
    --accent-green:   #2ecc71;
    --accent-green-dim:rgba(46,204,113,0.14);
    --accent-amber:   #e8a33d;
    --accent-red:     #e6484f;
    --accent-red-dim: rgba(230,72,79,0.14);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --header-h: 60px;
    --sidebar-w: 232px;
    --footer-h: 34px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    font-family: 'Ubuntu', sans-serif;
    color: var(--text-primary);
    background: var(--bg-void);
}


.app-shell {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background:
    radial-gradient(ellipse 900px 500px at 50% 38%, rgba(56,198,217,0.1), transparent 65%),
    linear-gradient(180deg, #1a212c 0%, #1f2836 50%, #161b22 100%);
}

.topbar {
    height: var(--header-h);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-soft);
    z-index: 2100;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 240px;
}

.brand-mark {
    height: 26px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.92;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.brand-title {
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-primary);
}

.brand-subtitle {
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.09em;
    color: var(--text-muted);
}

.topbar-center {
    display: flex;
    justify-content: center;
    flex: 1;
}

.conn-selector {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 16px;
    background: var(--bg-inset);
    border: 1px solid var(--border-soft);
    border-radius: 99px;
    color: var(--text-primary);
    cursor: pointer;
    font-family: 'Ubuntu', sans-serif;
    transition: border-color .2s ease, background .2s ease;
    margin-left: -220px;
}

.conn-selector:hover { border-color: var(--border-med); background: rgba(255,255,255,0.03); }

.conn-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
    transition: background .25s ease, box-shadow .25s ease;
}

.conn-dot.online {
    background: var(--accent-green);
    box-shadow: 0 0 8px rgba(46,204,113,0.7);
}

.conn-status-text {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.conn-dot.online + .conn-status-text { color: var(--accent-green); }

.conn-divider { color: var(--border-med); font-size: 12px; }

.conn-device-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.body-layout {
    flex: 1;
    display: flex;
    min-height: 0;
}

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-soft);
    padding: 18px 14px;
    z-index: 2100;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
    position: relative;
}

.nav-item .nav-icon { flex-shrink: 0; opacity: 0.85; }

.nav-item:hover {
    background: rgba(255,255,255,0.04);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-cyan-dim);
    border-color: rgba(56,198,217,0.35);
    color: var(--accent-cyan);
}

.nav-item.active .nav-icon { opacity: 1; color: var(--accent-cyan); }



.sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 6px 4px;
    border-top: 1px solid var(--border-soft);
}

.app-version {
    font-size: 11px;
    color: var(--text-muted);
    font-family: ui-monospace, Consolas, monospace;
    letter-spacing: 0.03em;
}

.sidebar-footer-icons { display: flex; gap: 4px; }

.icon-btn-sm {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all .18s ease;
}

.icon-btn-sm:hover { color: var(--text-secondary); background: rgba(255,255,255,0.05); }


.main-stage {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    overflow: hidden;
    padding-bottom: 34px;
}

.firmware-panel {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-app);
    padding: 28px 32px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform .38s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 60;
}
.firmware-panel.active { transform: translateX(0); }
/* ── Channel Configuration: slide-in panel (mirrors firmware-panel) ── */
.channels-panel {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-app);
    padding: 28px 32px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform .38s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 60;
}
.channels-panel.active { transform: translateX(0); }

.channels-panel-header { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }

.channels-table {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, var(--bg-panel-raised), var(--bg-panel));
    overflow: hidden;
}

.channels-table-row {
    display: grid;
    grid-template-columns: 50px 1fr 90px 2fr 80px;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-soft);
}
.channels-table-row:last-child { border-bottom: none; }

.channels-table-head {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: rgba(255,255,255,0.02);
}

.ch-col-ch    { color: var(--text-muted); font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.ch-col-name  { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.ch-col-value { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--text-secondary); text-align: right; }

/* Reverse toggle switch */
.ch-toggle {
    position: relative;
    width: 38px; height: 20px;
    border-radius: 99px;
    background: var(--bg-inset);
    border: 1px solid var(--border-soft);
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
    flex-shrink: 0;
}
.ch-toggle::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: transform .2s ease, background .2s ease;
}
.ch-toggle.on { background: var(--accent-cyan-dim); border-color: rgba(56,198,217,0.5); }
.ch-toggle.on::after {
    transform: translateX(18px);
    background: var(--accent-cyan);
    box-shadow: 0 0 6px rgba(56,198,217,0.7);
}

/* Live input bar */
.ch-input-bar-track {
    background: var(--bg-inset);
    border: 1px solid var(--border-soft);
    border-radius: 99px;
    height: 8px;
    overflow: hidden;
}

.ch-input-bar-fill {
    height: 100%;
    border-radius: 99px;         
    transition: width 0.12s ease; 
    
}
/* ── Live input bar colors (per channel) ── */
#ch-roll-bar     { background: #38c6d9; }   /* Cyan   – Roll      */
#ch-pitch-bar    { background: #2ecc71; }   /* Green  – Pitch     */
#ch-yaw-bar      { background: #e8a33d; }   /* Amber  – Yaw       */
#ch-throttle-bar { background: #e6484f; }   /* Red    – Throttle  */
#ch-aux1-bar     { background: #a78bfa; }   /* Purple – AUX1      */
#ch-aux2-bar     { background: #818cf8; }   /* Indigo – AUX2/3    */
#ch-aux4-bar     { background: #67e8f9; }   /* Light cyan – AUX4  */
#ch-aux5-bar     { background: #94a3b8; }   /* Slate  – AUX5      */
.fw-panel-header { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.fw-back-btn {
    width: 34px; height: 34px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm); color: var(--text-secondary); cursor: pointer;
    transition: all .18s ease;
}
.fw-back-btn:hover { color: var(--text-primary); border-color: var(--border-med); }
.fw-panel-title { flex: 1; }
.fw-panel-title h2 { margin: 0 0 2px; font-size: 15px; font-weight: 700; letter-spacing: .06em; color: var(--text-primary); }

.fw-panel-body {
    display: flex;
    flex-direction: column;
    gap: 22px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}
/* ── Firmware panel scrollbars (match portal design system) ── */
.fw-panel-body,
.dfu-log {
    scrollbar-width: thin;                                  /* Firefox */
    scrollbar-color: var(--border-med) transparent;         /* Firefox */
}
.fw-panel-body::-webkit-scrollbar,
.dfu-log::-webkit-scrollbar {
    width: 8px;
}
.fw-panel-body::-webkit-scrollbar-track,
.dfu-log::-webkit-scrollbar-track {
    background: transparent;
}
.fw-panel-body::-webkit-scrollbar-thumb,
.dfu-log::-webkit-scrollbar-thumb {
    background: var(--bg-panel-raised);
    border: 1px solid var(--border-med);
    border-radius: var(--radius-sm);
}
.fw-panel-body::-webkit-scrollbar-thumb:hover,
.dfu-log::-webkit-scrollbar-thumb:hover {
    background: var(--border-med);
    border-color: var(--accent-cyan);
}
/* ── Card shell ── */
.fw-card {
    position: relative;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 24px 24px 24px 30px;
    background: linear-gradient(180deg, var(--bg-panel-raised), var(--bg-panel));
    box-shadow: 0 0 0 1px rgba(255,255,255,0.02), 0 20px 40px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.fw-card-accent {
    position: absolute; top: 16px; bottom: 16px; left: 0; width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(56,198,217,0.6);
}
.fw-card-accent-blue { background: #4da3ff; box-shadow: 0 0 10px rgba(77,163,255,0.6); }

.fw-subtitle { font-size: 12px; color: var(--text-muted); }

.fw-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.fw-card-heading { display: flex; align-items: center; gap: 14px; }
.fw-icon-box {
    width: 40px; height: 40px; flex-shrink: 0; border-radius: var(--radius-sm);
    background: var(--accent-cyan-dim); color: var(--accent-cyan);
    display: flex; align-items: center; justify-content: center;
}
.fw-icon-box-blue { background: rgba(77,163,255,0.14); color: #4da3ff; }
.fw-card-title { margin: 0 0 2px; font-size: 15px; font-weight: 700; letter-spacing: .03em; color: var(--text-primary); }

.fw-conn-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-right: 8px; }
.dfu-status-pill, .wifi-status-pill {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 12px;
    border-radius: 99px;
    border: 1px solid var(--border-soft);
    background: var(--bg-inset);
    font-size: 12px; font-weight: 600; color: var(--text-secondary);
}
.dfu-dot, .wifi-status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--text-muted); flex-shrink: 0;
    transition: background .3s, box-shadow .3s;
}
.dfu-dot.connected { background: var(--accent-green); box-shadow: 0 0 8px var(--accent-green); }
.dfu-dot.error     { background: var(--accent-red); box-shadow: 0 0 8px var(--accent-red); }
.wifi-status-dot.connecting { background: var(--accent-amber); box-shadow: 0 0 8px var(--accent-amber); animation: pulse-dot 1s ease-in-out infinite; }
.wifi-status-dot.connected  { background: var(--accent-green); box-shadow: 0 0 8px var(--accent-green); }
.wifi-status-dot.error      { background: var(--accent-red); box-shadow: 0 0 8px var(--accent-red); }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

.fw-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fw-btn-outline, .fw-btn-primary, .fw-btn-danger {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 16px; font-size: 12.5px; font-weight: 600; font-family: 'Ubuntu', sans-serif;
    border-radius: var(--radius-sm); cursor: pointer; transition: all .18s ease; white-space: nowrap;
}
.fw-btn-outline { background: transparent; border: 1px solid var(--border-med); color: var(--text-secondary); }
.fw-btn-outline:hover:not(:disabled) { color: var(--text-primary); border-color: var(--text-secondary); background: rgba(255,255,255,0.04); }
.fw-btn-primary { background: var(--accent-cyan-dim); border: 1px solid rgba(56,198,217,0.4); color: var(--accent-cyan); }
.fw-btn-primary:hover:not(:disabled) { background: rgba(56,198,217,0.24); }
.fw-btn-continue-blue { background: rgba(77,163,255,0.14); border-color: rgba(77,163,255,0.4); color: #4da3ff; }
.fw-btn-continue-blue:hover:not(:disabled) { background: rgba(77,163,255,0.26); }
.fw-btn-danger { background: var(--accent-red-dim); border: 1px solid rgba(230,72,79,0.4); color: var(--accent-red); }
.fw-btn-danger:hover:not(:disabled) { background: rgba(230,72,79,0.24); }
.fw-btn-outline:disabled, .fw-btn-primary:disabled, .fw-btn-danger:disabled { opacity: 0.35; cursor: not-allowed; }
#dfu-btn-disconnect:not(:disabled) {
    background: var(--accent-red-dim);
    border: 1px solid rgba(230,72,79,0.4);
    color: var(--accent-red);
}
#dfu-btn-disconnect:not(:disabled):hover {
    background: rgba(230,72,79,0.24);
}
/* ── 3-step row ── */
.fw-steps-row {
    display: grid;
    grid-template-columns: 1.1fr 0.85fr 1.3fr;
    gap: 20px;
    align-items: stretch;
}
.fw-step-block {
    display: flex;
    flex-direction: column;
    gap: 12px;

    padding: 18px;

    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);

    background: rgba(255, 255, 255, 0.015);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);

    min-width: 0;
    height: 100%;
    box-sizing: border-box;
}
.fw-step-block:first-child {
    min-height: 100%;
}
.fw-step-label {
    display: flex; align-items: center; gap: 9px;
    font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary);
}
.fw-step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 6px;
    background: var(--accent-cyan-dim); color: var(--accent-cyan);
    font-size: 10.5px; font-weight: 700;
}

/* Dropzone + file info */
.dfu-dropzone {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    min-height: 128px;
    border: 2px dashed var(--border-med); border-radius: var(--radius-md);
    padding: 18px; text-align: center; cursor: pointer;
    font-size: 13px; color: var(--text-secondary);
    transition: border-color .15s, background .15s;
    flex-shrink: 0;
}
.dfu-dropzone:hover, .dfu-dropzone.drag-over { border-color: var(--accent-cyan); background: var(--accent-cyan-dim); }
.dfu-dropzone.file-chosen { border-color: var(--accent-green); background: var(--accent-green-dim); color: var(--text-primary); }
.dfu-drop-icon { color: var(--text-muted); }
.dfu-dropzone.file-chosen .dfu-drop-icon { color: var(--accent-green); }
.dfu-drop-hint { font-size: 10.5px; color: var(--text-muted); }
#dfu-file-label strong { color: var(--text-primary); }

.dfu-file-info {
    display: flex;
    align-items: center;
    gap: 10px;

    min-height: 52px;
    padding: 9px 10px;

    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);

    background: var(--bg-inset);

    transition: border-color .18s ease, background .18s ease;
    flex-shrink: 0;
}

.dfu-file-icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 6px;

    background: var(--accent-green-dim);
    color: var(--accent-green);
}

.dfu-file-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.dfu-file-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dfu-file-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.dfu-file-check {
    display: none;
}

.dfu-file-remove {
    width: 24px;
    height: 24px;
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: transparent;
    border: none;
    border-radius: 5px;

    color: var(--text-muted);
    cursor: pointer;

    transition: all .15s ease;
}

.dfu-file-remove:hover {
    color: var(--accent-red);
    background: var(--accent-red-dim);
}

/* Version card */
.fw-version-card { display: flex; flex-direction: column; gap: 14px; }
.fw-version-row { display: flex; flex-direction: column; gap: 4px; }
.fw-version-tag { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.fw-version-val { font-family: ui-monospace, Consolas, monospace; font-size: 17px; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.fw-version-val-new { color: var(--accent-cyan); }
.fw-new-badge {
    font-family: 'Ubuntu', sans-serif; font-size: 9px; font-weight: 700; letter-spacing: .05em;
    padding: 2px 7px; border-radius: 99px;
    background: var(--accent-cyan); color: #05161a;
}
.fw-download-btn { justify-content: center; margin-top: 4px; }
.fw-check-updates-btn {
    width: 100%;
    justify-content: center;
    margin-top: 2px;
}
/* ── HUD ring ── */
.fw-step-block-hud {
    gap: 14px;
}

.fw-hud {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
}

.fw-hud-ring-wrap {
    position: relative;
    width: 140px;
    height: 140px;
    flex-shrink: 0;
}

.fw-hud-ring {
    width: 140px;
    height: 140px;
    transform: rotate(-90deg);
}

.fw-hud-ring-track {
    fill: none;
    stroke: var(--border-soft);
    stroke-width: 7;
}

.fw-hud-ring-fill {
    fill: none;
    stroke: var(--accent-cyan);
    stroke-width: 7;
    stroke-linecap: round;

    /*
     * 2 × PI × 60 ≈ 377
     */
    stroke-dasharray: 377;
    stroke-dashoffset: 377;

    transition:
        stroke-dashoffset .3s ease,
        stroke .3s ease;

    filter: drop-shadow(
        0 0 7px rgba(56, 198, 217, 0.6)
    );
}

.fw-hud-ring-fill.done {
    stroke: var(--accent-green);
    filter: drop-shadow(
        0 0 7px rgba(46, 204, 113, 0.6)
    );
}

.fw-hud-ring-fill.error {
    stroke: var(--accent-red);
    filter: drop-shadow(
        0 0 7px rgba(230, 72, 79, 0.6)
    );
}

.fw-hud-center {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;
}

.fw-hud-pct {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 25px;
    font-weight: 700;
    color: var(--text-primary);
}

.fw-hud-message {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.fw-hud-state {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--text-primary);
}

.fw-hud-description {
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--text-muted);
}

.dfu-log {
    background: #0a0c11; border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
    padding: 10px 12px; font-family: ui-monospace, Consolas, monospace; font-size: 10.5px;
    line-height: 1.6; height: 100px; overflow-y: auto; white-space: pre-wrap;
}
.dfu-log .ok   { color: var(--accent-green); }
.dfu-log .warn { color: var(--accent-amber); }
.dfu-log .err  { color: var(--accent-red); }
.dfu-log .info { color: var(--text-muted); }

.dfu-hint { font-size: 12px; color: var(--text-muted); }
.dfu-file-error {
    display: none;
    align-items: center;
    gap: 8px;

    padding: 9px 12px;

    border: 1px solid rgba(230, 72, 79, 0.35);
    border-radius: var(--radius-sm);

    background: var(--accent-red-dim);
    color: var(--accent-red);

    font-size: 11.5px;
    line-height: 1.4;
}

.dfu-file-error.visible {
    display: flex;
}

.dfu-dropzone.file-error {
    border-color: var(--accent-red);
    background: var(--accent-red-dim);
}

.dfu-dropzone.file-error .dfu-drop-icon {
    color: var(--accent-red);
}
.fw-warning-banner {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    border: 1px solid rgba(232,163,61,0.3);
    border-radius: var(--radius-sm);
    font-size: 12px; font-weight: 500; color: var(--accent-amber);
    background: rgba(232,163,61,0.07);
}


   .fw-card-elrs {
    position: relative;
}
   .elrs-layout {
    display: grid;

    grid-template-columns:
        minmax(180px, 1fr)
        1px
        minmax(180px, 1fr)
        1px
        330px
        1px
        minmax(180px, 1fr);

    align-items: stretch;

    width: 100%;
    margin-top: 24px;

    column-gap: 24px;
}


.elrs-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.elrs-col-connect,
.elrs-col-continue,
.elrs-col-why {
    justify-content: flex-start;
}
.elrs-col-phone {
    width: 330px;

    display: flex;
    align-items: flex-start;
    justify-content: center;

    min-width: 330px;
}

.elrs-col-divider {
    width: 1px;
    height: 100%;

    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(255,255,255,0.12) 12%,
        rgba(255,255,255,0.12) 88%,
        transparent 100%
    );
}

.elrs-col-divider-1 {
    transform: none;
}



.elrs-step-heading {
    display: flex;
    align-items: center;
    gap: 10px;

    min-height: 24px;
}

.elrs-step-heading h4 {
    margin: 0;

    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;

    letter-spacing: 0.055em;
    color: var(--text-primary);
}

.elrs-step-number {
    width: 24px;
    height: 24px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 7px;

    background: rgba(77,163,255,0.12);
    border: 1px solid rgba(77,163,255,0.3);

    color: #4da3ff;

    font-size: 11px;
    font-weight: 700;
}

.elrs-step-description {
    margin: 14px 0 0;

    font-size: 12.5px;
    line-height: 1.55;

    color: var(--text-secondary);
}

.elrs-step-description strong {
    color: var(--text-primary);
}


.wifi-credentials {
    display: flex;
    flex-direction: column;
    gap: 13px;

    margin-top: 18px;
}

.wifi-cred-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wifi-cred-label {
    font-size: 10px;
    font-weight: 600;

    text-transform: uppercase;
    letter-spacing: 0.06em;

    color: var(--text-muted);
}

.wifi-cred-row strong {
    font-family: ui-monospace, Consolas, monospace;

    font-size: 14px;
    font-weight: 600;

    color: #4da3ff;
}

.elrs-col-continue {
    display: flex;
    flex-direction: column;
}

.elrs-continue-btn {
    width: fit-content;

    margin-top: 20px;
}

   .elrs-phone {
    width: 330px;
    margin: 0;
}

.elrs-phone img {
    display: block;
    width: 330px;
    height: auto;
}


.elrs-col-why {
    padding-left: 2px;
}

.elrs-why-title {
    margin: 2px 0 0;

    font-size: 11px;
    font-weight: 700;

    line-height: 1.3;
    letter-spacing: 0.07em;

    text-transform: uppercase;

    color: var(--text-muted);
}

.elrs-why-list {
    list-style: none;

    margin: 16px 0 0;
    padding: 0;

    display: flex;
    flex-direction: column;
    gap: 13px;
}

.elrs-why-list li {
    display: flex;
    align-items: center;
    gap: 9px;

    min-height: 24px;

    font-size: 12px;
    line-height: 1.4;

    color: var(--text-secondary);
}

.elrs-why-icon {
    width: 22px;
    height: 22px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    color: #4da3ff;
}

.elrs-why-icon svg {
    width: 14px;
    height: 14px;
}



.error-message {
    width: 100%;

    margin-top: 16px;
    padding: 10px 12px;

    background: var(--accent-red-dim);
    border: 1px solid rgba(230, 72, 79, 0.35);
    border-radius: var(--radius-sm);

    color: #ff8a8f;

    font-size: 12px;
    line-height: 1.4;

    text-align: center;
}


@media (max-width: 1150px) {
    .elrs-layout {
        grid-template-columns:
            minmax(160px, 1fr)
            1px
            minmax(170px, 1fr)
            1px
            190px
            1px
            minmax(160px, 1fr);

        column-gap: 18px;
    }

    .elrs-phone {
        width: 170px;
    }

    .elrs-step-heading h4 {
        font-size: 12px;
    }
}

@media (max-width: 950px) {
    .elrs-layout {
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .elrs-col-divider {
        display: none;
    }

    .elrs-col {
        width: 100%;
    }

    .elrs-col-phone {
        order: -1;
        align-items: flex-start;
    }

    .elrs-phone {
        width: 190px;
        margin: 0;
    }

    .elrs-continue-btn {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .elrs-layout {
        gap: 20px;
    }

    .elrs-phone {
        width: 170px;
    }
}

.fw-log-section {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.015);
    overflow: hidden;
}

.fw-log-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 12px 16px;

    background: transparent;
    border: none;

    color: var(--text-secondary);
    font-family: 'Ubuntu', sans-serif;
    font-size: 12px;
    font-weight: 600;

    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}

.fw-log-toggle:hover {
    background: rgba(255, 255, 255, 0.025);
    color: var(--text-primary);
}

.fw-log-toggle-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fw-log-chevron {
    transition: transform .2s ease;
}

.fw-log-section.open .fw-log-chevron {
    transform: rotate(180deg);
}

.fw-log-container {
    display: none;
    padding: 0 12px 12px;
}

.fw-log-section.open .fw-log-container {
    display: block;
}

.dfu-log {
    margin: 0;
    background: #0a0c11;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 10px 12px;

    font-family: ui-monospace, Consolas, monospace;
    font-size: 10.5px;
    line-height: 1.6;

    height: 140px;
    overflow-y: auto;
    white-space: pre-wrap;
}

@media (max-width: 1300px) {
    .fw-steps-row { grid-template-columns: 1fr; }
        
}

.three-container {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 0;
}
.three-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 480px;
    height: 480px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(56,198,217,0.35) 0%, rgba(56,198,217,0.12) 35%, transparent 70%);
    filter: blur(40px);
    z-index: -1;              /* ← was 0, now behind everything */
    pointer-events: none;
}

.three-container canvas {
    position: relative;
    z-index: 1;
}
.stage-rings {
    position: absolute;
    top: 52%;
    left: 50%;
    width: 720px;
    height: 720px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    border-radius: 50%;
    background:
        radial-gradient(circle, transparent 0 29%, rgba(56,198,217,0.05) 29.3% 29.6%, transparent 30%),
        radial-gradient(circle, transparent 0 39%, rgba(56,198,217,0.04) 39.3% 39.6%, transparent 40%),
        radial-gradient(circle, transparent 0 49%, rgba(255,255,255,0.025) 49.3% 49.6%, transparent 50%);
    z-index: 0;
    animation: ring-ripple 8s ease-out infinite;
}

@keyframes ring-ripple {
    0% {
        transform: translate(-50%, -50%) scale(0.92);
        opacity: 0.55;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.92);
        opacity: 0.55;
    }
}
/* ── Connect / Disconnect ── */
.connect-container {
    display: flex;
    gap: 16px;
    z-index: 50;
}

.conn-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 13px 34px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Ubuntu', sans-serif;
    letter-spacing: 0.02em;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .18s ease;
}

.conn-btn-connect {
    background: var(--accent-cyan-dim);
    border: 1px solid rgba(56,198,217,0.4);
    color: var(--accent-cyan);
}

.conn-btn-connect:hover:not(.disabled) {
    background: rgba(56,198,217,0.24);
    border-color: rgba(56,198,217,0.65);
}

.conn-btn-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
    filter: invert(100%);
}

.disconn-btn-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
    filter: invert(100%);
}

.conn-btn-disconnect {
    background: var(--accent-red-dim);
    border: 1px solid rgba(230,72,79,0.4);
    color: var(--accent-red);
}

.conn-btn-disconnect:hover:not(.disabled) {
    background: rgba(230,72,79,0.24);
    border-color: rgba(230,72,79,0.65);
}

.conn-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Bottom Branding  */
   .bottom-branding {
    height: var(--footer-h);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-soft);
    color: var(--text-muted);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.14em;
    width: 100%;
}

.bottom-branding .footer-logo-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 45px; /* bumped up further */
    margin: 0 auto;
}

.bottom-branding .footer-logo {
    height: 100%;
    width: auto;
    max-width: 100%;
    flex-shrink: 0;
    display: block;
}

.bottom-branding .footer-logo-wrap::after {
    content: "";
    position: absolute;
    inset: 0;

    -webkit-mask-image: url('../assets/edith_fpv_grey.png');
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;

    mask-image: url('../assets/edith_fpv_grey.png');
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-mode: alpha;

    background: linear-gradient(
        105deg,
        transparent 25%,
        rgba(255, 255, 255, 0.08) 38%,
        rgba(255, 255, 255, 0.35) 46%,
        rgba(255, 255, 255, 0.75) 50%,
        rgba(255, 255, 255, 0.35) 54%,
        rgba(255, 255, 255, 0.08) 62%,
        transparent 75%
    );

    background-size: 250% 100%;
    background-position: 200% 0;

    mix-blend-mode: screen;

    animation: footer-logo-shine 4.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes footer-logo-shine {
    0% {
        background-position: 200% 0;
        opacity: 0;
    }

    10% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }

    90% {
        opacity: 0.4;
    }

    100% {
        background-position: -100% 0;
        opacity: 0;
    }
}
/* LOADER */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-void);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity .5s ease, visibility .5s ease;
}

.loader-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loader-logo {
    width: 90px;
    height: auto;
    /* filter: brightness(0) invert(1); */
    animation: breathe 2s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50%      { transform: scale(1.05); opacity: 1; }
}


@media (max-width: 1100px) {
    :root { --sidebar-w: 76px; }
    .nav-item span { display: none; }
    .nav-item { justify-content: center; padding: 12px; }
    .brand-subtitle { display: none; }
        .topbar-center { display: none; }
}

@media (max-width: 760px) {
        .conn-btn { padding: 12px 20px; font-size: 13px; }
    .connect-container { gap: 10px; }
}


/* ── Device Info: slide-in panel (overrides base popup animation) ── */
#device-popup-overlay {
    justify-content: flex-end;   /* dock right instead of centering */
    background: rgba(0, 0, 0, 0.55);
}

/* ── RF Module Setup: slide-in panel (same treatment as Device Info) ── */
#rf-module-popup-overlay {
    justify-content: flex-end;
    background: rgba(0, 0, 0, 0.55);
}

#rf-module-popup-overlay .popup-container.rf-module-popup {
    width: 640px;
    max-width: 92vw;
    height: 100vh;
    min-height: 100vh;
    margin: 0;
    border-radius: 0;
    /* padding: 32px 32px 28px; */
    padding: calc(var(--header-h) + 24px) 32px 28px;
    overflow-y: auto;
    transform: translateX(100%);
    opacity: 1;
    box-shadow: -24px 0 60px rgba(0,0,0,.55), inset 0 0 80px rgba(56,198,217,.04);
    transition: transform .4s cubic-bezier(0.4, 0, 0.2, 1);
}

#rf-module-popup-overlay .popup-close {
    top: calc(var(--header-h) + 16px);
}

#rf-module-popup-overlay.active .popup-container.rf-module-popup {
    transform: translateX(0);
}

.rf-popup-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .04em;
    margin: 0 0 4px;
    color: var(--text-primary);
}

.rf-popup-subtitle {
    display: block;
    margin-bottom: 22px;
}

.rf-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rf-card {
    position: relative;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    background: linear-gradient(180deg, var(--bg-panel-raised), var(--bg-panel));
    box-shadow: 0 0 0 1px rgba(255,255,255,0.02), 0 12px 26px rgba(0,0,0,0.22);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rf-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rf-card-icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    background: var(--accent-cyan-dim);
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rf-card-head h3 {
    margin: 0;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: .03em;
    color: var(--text-primary);
}

.rf-seg-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 8px;
}

.rf-seg-btn {
    padding: 10px 8px;
    font-size: 12.5px;
    font-weight: 600;
    font-family: 'Ubuntu', sans-serif;
    color: var(--text-secondary);
    background: var(--bg-inset);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .15s ease;
    text-align: center;
}

.rf-seg-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-med);
    background: rgba(255,255,255,0.05);
}

.rf-seg-btn.selected {
    background: var(--accent-cyan-dim);
    border-color: rgba(56,198,217,0.5);
    color: var(--accent-cyan);
    box-shadow: 0 0 0 1px rgba(56,198,217,0.25), 0 0 12px rgba(56,198,217,0.25);
}

.rf-seg-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}


#device-popup-overlay .popup-container {
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    min-height: 100vh;
    margin: 0;
    border-radius: 0;
    /* padding: 32px 28px; */
    padding: calc(var(--header-h) + 24px) 28px 32px;
    overflow-y: auto;
    transform: translateX(100%);
    opacity: 1;
    box-shadow: -24px 0 60px rgba(0,0,0,.55), inset 0 0 80px rgba(56,198,217,.04);
    transition: transform .4s cubic-bezier(0.4, 0, 0.2, 1);
}
#device-popup-overlay .popup-close {
    top: calc(var(--header-h) + 16px);
}

#device-popup-overlay.active .popup-container {
    transform: translateX(0);
}
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.popup-overlay.active {
    opacity: 1;
    pointer-events: auto;
}


.popup-container {
    position: relative;
    width: 500px;
    min-height: 350px;
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    padding: 40px;
    border-radius: 14px;
    box-shadow:
        0 0 60px rgba(56, 198, 217, 0.12),
        0 0 100px rgba(0, 0, 0, 0.8),
        inset 0 0 80px rgba(56, 198, 217, 0.04);
    border: 1px solid rgba(255,255,255,0.08);
    transform: scale(0.96) translateY(-20px);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.popup-overlay.active .popup-container {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.popup-close img {
    width: 18px;
    height: 18px;
    opacity: 0.8;
    transition: opacity 0.2s;
    filter: invert(1);
}

.popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.popup-close:hover img {
    opacity: 1;
}

.popup-content {
    color: #fff;
    font-family: 'Ubuntu', sans-serif;
}

.popup-content h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 26px 0;
    color: var(--text-primary);
}

.popup-content p { margin: 20px 0 15px 0; font-size: 15px; color: #e0e0e0; }
.popup-content p strong { color: var(--accent-cyan); font-weight: 600; }

.rf-module-popup { width: 900px; max-width: 95%; }

.device-info-box {
    margin-top: 25px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    border: 1px solid rgba(56, 198, 217, 0.2);
}

.info-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.info-row:last-child { border-bottom: none; }

.info-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    font-family: 'Ubuntu', sans-serif;
}

.info-value {
    font-size: 14px;
    color: #e0e0e0;
    text-align: right;
    max-width: 55%;
    line-height: 1.4;
}


/* ── Moving shine on footer text ── */



.fw-conn-status {
    display: flex;
    align-items: center;
    gap: 10px;
}


/* ── Firmware update banner (proactive notification) ── */
.fw-update-banner {
    position: fixed;
    top: 76px;
    right: 24px;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #14172a;
    border: 1px solid #2e3248;
    border-left: 3px solid #5c6ef8;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
    max-width: 380px;
    transform: translateX(420px);
    opacity: 0;
    pointer-events: none;
    transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .35s ease;
}

.fw-update-banner.visible {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.fw-update-banner-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(92,110,248,.12);
    color: #5c6ef8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fw-update-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.fw-update-banner-title {
    font-size: 13px;
    font-weight: 600;
    color: #e2e4f0;
}

.fw-update-banner-sub {
    font-size: 11.5px;
    color: #7b7f9e;
}

.fw-update-banner-sub strong {
    color: #b7bad6;
    font-weight: 600;
}

.fw-banner-view-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    background: #5c6ef8;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.fw-banner-view-btn:hover { background: #4a5ce0; }

.fw-banner-dismiss {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: #7b7f9e;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
}
.fw-banner-dismiss:hover { color: #e2e4f0; background: rgba(255,255,255,.06); }

@media (max-width: 640px) {
    .fw-update-banner { left: 16px; right: 16px; max-width: none; top: 70px; }
}


/* notification dot */

.nav-dot,
.fw-check-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(56,198,217,0.5);          /* or #ef4444 for stronger attention */
  pointer-events: none;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity .2s, transform .2s;
}

.nav-dot.visible,
.fw-check-dot.visible {
  opacity: 1;
  transform: scale(1);
}

/* Position on the nav item */
#nav-firmware .nav-dot {
  top: 10px;
  right: 12px;
}

/* Position on the Check for Updates button */
.fw-check-updates-btn {
  position: relative;
}
.fw-check-updates-btn .fw-check-dot {
  top: 6px;
  right: 8px;
}


            /* ── DFU flasher inline styles (unchanged from base app; scoped to STM32 popup) ── */
            .dfu-dot {
                width: 9px; height: 9px; border-radius: 50%;
                background: var(--muted-color, #555); flex-shrink: 0;
                transition: background .3s, box-shadow .3s;
            }
            .dfu-dot.connected { background: #22c55e; box-shadow: 0 0 8px #22c55e; }
            .dfu-dot.error     { background: #ef4444; }
            .dfu-device-name   { font-size: 14px; font-weight: 500; }
            .dfu-hint          { font-size: 12px; color: #7b7f9e; margin-bottom: 14px; }
            .dfu-dropzone {
                border: 2px dashed #2e3248; border-radius: 8px;
                padding: 18px; text-align: center; cursor: pointer;
                font-size: 13px; color: #7b7f9e;
                transition: border-color .15s, background .15s;
                margin-bottom: 12px;
            }
            .dfu-dropzone:hover, .dfu-dropzone.drag-over {
                border-color: #5c6ef8; background: rgba(92,110,248,.06);
            }
            .dfu-dropzone.file-chosen {
                border-color: #22c55e; background: rgba(34,197,94,.06); color: #e2e4f0;
            }
            .dfu-log {
                background: #0f1117; border: 1px solid #2e3248; border-radius: 8px;
                padding: 10px 12px; font-family: 'Consolas', monospace; font-size: 11px;
                line-height: 1.7; height: 140px; overflow-y: auto; white-space: pre-wrap;
            }
            .dfu-log .ok   { color: #22c55e; }
            .dfu-log .warn { color: #f59e0b; }
            .dfu-log .err  { color: #ef4444; }
            .dfu-log .info { color: #9ca3c8; }


/* flash popup */

.flash-success-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .4s cubic-bezier(0.4, 0, 0.2, 1);
}

.flash-success-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.flash-success-modal {
    position: relative;
    width: 440px;
    max-width: 90%;
    padding: 36px 32px 30px 36px;
    text-align: center;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    background: linear-gradient(180deg, var(--bg-panel-raised), var(--bg-panel));
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.02),
        0 20px 40px rgba(0,0,0,0.45),
        0 0 60px rgba(46,204,113,0.10);
    font-family: 'Ubuntu', sans-serif;
    transform: scale(0.96) translateY(-20px);
    transition: transform .35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.flash-success-overlay.active .flash-success-modal {
    transform: scale(1) translateY(0);
}

/* left accent bar (same as .fw-card-accent, green for success) */
.flash-success-modal::before {
    content: '';
    position: absolute;
    top: 16px; bottom: 16px; left: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--accent-green);
    box-shadow: 0 0 10px rgba(46,204,113,0.6);
}

.flash-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--accent-green-dim);
    border: 1px solid rgba(46,204,113,0.4);
    color: var(--accent-green);
    font-size: 32px;
    font-weight: 700;
    box-shadow: 0 0 20px rgba(46,204,113,0.25);
}

.flash-success-modal h2 {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--text-primary);
}

.flash-success-modal p {
    margin: 0 0 26px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}

#flash-success-return {
    width: 100%;
    padding: 12px 20px;
    font-family: 'Ubuntu', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .18s ease;
    background: var(--accent-green-dim);
    border: 1px solid rgba(46,204,113,0.4);
    color: var(--accent-green);
}

#flash-success-return:hover {
    background: rgba(46,204,113,0.26);
    border-color: rgba(46,204,113,0.65);
}


/* ── Desktop-only gate ── */
.desktop-only-screen {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(ellipse 600px 400px at 50% 40%, rgba(56,198,217,0.1), transparent 65%),
        var(--bg-void);
}

.desktop-only-card {
    position: relative;
    max-width: 380px;
    padding: 32px 28px 28px 32px;
    text-align: center;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, var(--bg-panel-raised), var(--bg-panel));
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    font-family: 'Ubuntu', sans-serif;
}

.desktop-only-card::before {
    content: '';
    position: absolute;
    top: 16px; bottom: 16px; left: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(56,198,217,0.6);
}

.desktop-only-icon {
    width: 60px; height: 60px;
    margin: 0 auto 18px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-md);
    background: var(--accent-cyan-dim);
    color: var(--accent-cyan);
}

.desktop-only-card h2 {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--text-primary);
}

.desktop-only-card p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Show the gate below 900px wide (adjust to your minimum supported width) */
@media (max-width: 900px) {
    .desktop-only-screen { display: flex; }
}