/* GenyCaster browser chrome follows Theme.qml's semantic Light/Dark palette.
 * Superellipse(4) matches Theme.superellipseExponent; corner-shape is
 * progressive enhancement. Older browsers receive tuned continuous radii.
 * Every visible selector, option, focus state and CTA is product-owned. */
:root {
    --nd-canvas:#f1f1f3;
    --nd-surface:#fff;
    --nd-raised:#fff;
    --nd-muted:#f7f7f8;
    --nd-hover:#f1f2f4;
    --nd-pressed:#e9eaed;
    --nd-ink:#17181b;
    --nd-ink-muted:#60636a;
    --nd-danger:#b32138;
    --nd-border:#dfe1e5;
    --nd-border-soft:#eceDEF;
    --nd-accent:#315cf5;
    --nd-on-accent:#fff;
    --nd-scrim:rgba(10,12,19,.44);
    --nd-shadow:rgba(18,25,48,.20);
    --nd-glow:color-mix(in srgb,var(--nd-accent) 18%,transparent);
    --nd-scroll:rgba(95,100,112,.35);
}
:root[data-chrome-theme="dark"] {
    --nd-canvas:#0b0c0f;
    --nd-surface:#121317;
    --nd-raised:#1b1d23;
    --nd-muted:#17191e;
    --nd-hover:#23262d;
    --nd-pressed:#2a2d35;
    --nd-ink:#f7f7f8;
    --nd-ink-muted:#afb2ba;
    --nd-danger:#ff9da9;
    --nd-border:#292c33;
    --nd-border-soft:#22252b;
    --nd-accent:#829aff;
    --nd-on-accent:#111319;
    --nd-scrim:rgba(0,0,0,.66);
    --nd-shadow:rgba(0,0,0,.72);
    --nd-glow:color-mix(in srgb,var(--nd-accent) 24%,transparent);
    --nd-scroll:rgba(180,187,202,.4);
}
#native-downloads-trigger, #native-downloads-dialog,
#native-downloads-nudge, #native-downloads-backdrop {
    font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
    -webkit-font-smoothing:antialiased;
    color:var(--nd-ink);
    letter-spacing:normal;
}
#native-downloads-dialog *,
#native-downloads-nudge *,
#native-downloads-trigger {box-sizing:border-box}
#native-downloads-dialog button, #native-downloads-trigger,
#native-downloads-nudge button {
    appearance:none;-webkit-appearance:none;
    font-family:inherit;
    cursor:pointer;
    -webkit-tap-highlight-color:transparent;
}
#native-downloads-dialog button:focus-visible,
#native-downloads-dialog a:focus-visible,
#native-downloads-trigger:focus-visible,
#native-downloads-nudge button:focus-visible {
    outline:2px solid var(--nd-accent);
    outline-offset:3px;
}
#native-downloads-dialog[hidden],#native-downloads-backdrop[hidden],
#native-downloads-nudge[hidden],#native-downloads-action[hidden],
#native-downloads-options[hidden] {display:none!important}

/* The app itself owns guest, onboarding and Settings download entry points.
 * Keep legacy floating DOM controls inaccessible, including to keyboard and
 * touch users; the release selector remains available through the Qt bridge.
 * Do not reintroduce a floating download CTA when a session is authorized. */
#native-downloads-dock,
#native-downloads-nudge { display:none!important; }

/* Floating affordance uses the exact same palette, not an OS-material chip. */
#native-downloads-trigger {
    position:fixed;
    right:calc(18px + env(safe-area-inset-right,0px));
    top:calc(18px + env(safe-area-inset-top,0px));
    z-index:13;
    display:flex;align-items:center;justify-content:center;gap:9px;
    min-height:44px;padding:9px 15px;
    background:var(--nd-raised);
    color:var(--nd-ink);
    border:1px solid var(--nd-border);
    border-radius:15px;
    corner-shape:superellipse(4);
    box-shadow:0 6px 22px var(--nd-shadow),inset 0 1px 0 color-mix(in srgb,var(--nd-ink) 6%,transparent);
    font-size:12px;font-weight:700;
    transition:background 120ms ease,border-color 120ms ease,color 120ms ease;
}
#native-downloads-trigger:hover {
    background:var(--nd-hover);
    border-color:color-mix(in srgb,var(--nd-accent) 55%,var(--nd-border));
}
#native-downloads-trigger[aria-expanded="true"] {
    background:color-mix(in srgb,var(--nd-accent) 12%,var(--nd-raised));
    border-color:var(--nd-accent);
}
#native-downloads-trigger svg:not(.nd-squircle-svg) {
    width:17px;height:17px;fill:none;stroke:currentColor;
    stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;
}
#native-downloads-backdrop {
    position:fixed;inset:0;z-index:118;
    background:var(--nd-scrim);
    backdrop-filter:blur(7px);
    -webkit-backdrop-filter:blur(7px);
}
#native-downloads-dialog {
    position:fixed;z-index:119;left:50%;top:50%;
    transform:translate(-50%,-50%);
    width:min(548px,calc(100vw - 32px));
    max-height:min(770px,calc(100dvh - 36px));
    overflow-y:auto;overscroll-behavior:contain;
    scrollbar-color:var(--nd-scroll) transparent;
    scrollbar-width:thin;
    padding:26px 26px 23px;
    background:var(--nd-surface);
    color:var(--nd-ink);
    border:1px solid color-mix(in srgb,var(--nd-accent) 18%,var(--nd-border));
    border-radius:30px;
    corner-shape:superellipse(4);
    box-shadow:0 24px 75px var(--nd-shadow),0 0 0 1px var(--nd-border-soft),
        inset 0 1px 0 color-mix(in srgb,var(--nd-ink) 5%,transparent);
    animation:nd-dialog-enter 210ms cubic-bezier(.2,.85,.3,1) both;
    isolation:isolate;
}
@keyframes nd-dialog-enter {
    from {opacity:.5;transform:translate(-50%,calc(-50% + 12px)) scale(.987)}
    to {opacity:1;transform:translate(-50%,-50%) scale(1)}
}
.native-downloads-header {
    display:flex;align-items:center;gap:12px;
}
.native-downloads-mark {
    width:44px;height:44px;object-fit:contain;flex:none;padding:6px;
    border-radius:15px;corner-shape:superellipse(4);
    background:var(--nd-muted);
    border:1px solid var(--nd-border);
}
.native-downloads-heading {flex:1;min-width:0}
.native-downloads-eyebrow {
    display:block;color:var(--nd-accent);font-size:10px;
    font-weight:750;letter-spacing:.11em;text-transform:uppercase;
    margin-bottom:4px;
}
#native-downloads-title {
    margin:0;font-size:21px;line-height:1.24;
    letter-spacing:-.035em;font-weight:750;
}
.native-downloads-description {
    margin:15px 0 20px;font-size:13px;line-height:1.65;
    color:var(--nd-ink-muted);
}
#native-downloads-close {
    display:grid;place-items:center;flex:none;
    min-width:42px;width:42px;height:42px;
    border:1px solid var(--nd-border);
    background:var(--nd-raised);
    color:var(--nd-ink-muted);
    border-radius:13px;corner-shape:superellipse(4);
    font-size:22px;line-height:1;
}
#native-downloads-close:hover {background:var(--nd-hover);color:var(--nd-ink)}
.native-downloads-tabs {
    display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;
    padding:5px;
    border:1px solid var(--nd-border);
    border-radius:17px;corner-shape:superellipse(4);
    background:var(--nd-muted);
}
.native-downloads-tabs button {
    border:1px solid transparent;
    border-radius:12px;corner-shape:superellipse(4);
    min-height:43px;padding:8px 2px;
    background:transparent;color:var(--nd-ink-muted);
    font-size:12px;font-weight:650;
}
.native-downloads-tabs button:hover:not(.selected) {
    background:var(--nd-hover);color:var(--nd-ink);
}
.native-downloads-tabs button.selected {
    color:var(--nd-on-accent);
    background:var(--nd-accent);border-color:var(--nd-accent);
    box-shadow:0 3px 11px var(--nd-glow);
}
.native-downloads-configuration {
    display:flex;align-items:center;justify-content:space-between;
    gap:12px;margin:20px 0 14px;
}
.native-downloads-label {
    min-width:0;font-size:13px;font-weight:650;color:var(--nd-ink);
}
.native-downloads-combobox {
    position:relative;flex:0 0 min(192px,50%);
    max-width:55%;min-width:132px;
}
#native-downloads-architecture {
    display:flex;align-items:center;justify-content:space-between;
    gap:10px;width:100%;min-height:46px;text-align:start;
    border:1px solid var(--nd-border);border-radius:14px;
    corner-shape:superellipse(4);
    padding:10px 12px;
    color:var(--nd-ink);background:var(--nd-raised);
    font-size:13px;font-weight:650;
    box-shadow:inset 0 1px 0 color-mix(in srgb,var(--nd-ink) 4%,transparent);
}
#native-downloads-architecture:hover {
    background:var(--nd-hover);border-color:var(--nd-accent);
}
#native-downloads-architecture.is-open {
    border-color:var(--nd-accent);
    box-shadow:0 0 0 3px var(--nd-glow);
}
#native-downloads-architecture svg:not(.nd-squircle-svg) {
    flex:none;width:17px;height:17px;
    fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;
    stroke-width:1.8;opacity:.65;
    transition:transform 140ms ease;
}
#native-downloads-architecture.is-open svg:not(.nd-squircle-svg) {transform:rotate(180deg)}
#native-downloads-options {
    position:absolute;top:calc(100% + 6px);right:0;left:0;z-index:122;
    padding:5px;max-height:220px;overflow-y:auto;
    background:var(--nd-raised);
    border:1px solid var(--nd-border);
    border-radius:16px;corner-shape:superellipse(4);
    box-shadow:0 15px 38px var(--nd-shadow),0 0 0 1px var(--nd-border-soft);
}
.native-downloads-option {
    display:block;width:100%;min-height:42px;text-align:start;
    padding:10px 13px;margin:1px 0;
    border:0;border-radius:11px;corner-shape:superellipse(4);
    background:transparent;color:var(--nd-ink);
    font-size:13px;font-weight:580;
}
.native-downloads-option:hover,
.native-downloads-option:focus-visible {
    background:var(--nd-hover);
}
.native-downloads-option[aria-selected="true"] {
    color:var(--nd-accent);
    background:color-mix(in srgb,var(--nd-accent) 11%,var(--nd-raised));
    font-weight:750;
}
.native-downloads-option[aria-selected="true"]:after {
    content:"✓";float:right;font-weight:750;color:var(--nd-accent);
}
.native-downloads-result {
    display:flex;align-items:flex-start;gap:11px;
    min-height:61px;margin:14px 0 16px;padding:14px 15px;
    background:var(--nd-muted);
    border:1px solid var(--nd-border);
    border-radius:16px;corner-shape:superellipse(4);
}
.native-downloads-dot {
    width:7px;height:7px;flex:none;margin-top:6px;border-radius:50%;
    background:var(--nd-accent);
    box-shadow:0 0 0 4px var(--nd-glow);
}
#native-downloads-status {
    font-size:12px;line-height:1.65;color:var(--nd-ink-muted);
    overflow-wrap:anywhere;
}
.native-downloads-actions {
    display:flex;align-items:center;flex-wrap:wrap;gap:10px;
}
#native-downloads-action,.native-downloads-secondary {
    display:inline-flex;align-items:center;justify-content:center;
    text-align:center;min-height:44px;padding:10px 17px;
    border-radius:13px;corner-shape:superellipse(4);
    text-decoration:none;font-size:12px;font-weight:750;
    transition:background 110ms ease,border-color 110ms ease;
}
#native-downloads-action {
    background:var(--nd-accent);color:var(--nd-on-accent);
    border:1px solid var(--nd-accent);
}
#native-downloads-action:hover {filter:brightness(1.06)}
.native-downloads-secondary {
    background:var(--nd-raised);color:var(--nd-ink);
    border:1px solid var(--nd-border);
}
.native-downloads-secondary:hover {background:var(--nd-hover);border-color:var(--nd-accent)}
.native-downloads-foot {
    font-size:11px;line-height:1.6;
    color:var(--nd-ink-muted);margin:13px 0 0;
}
/* Community CTA: authentic repo link, never an invented star count. */
.native-github-cta {
    display:flex;align-items:center;flex-wrap:wrap;gap:11px;
    margin-top:19px;padding:14px;
    border:1px solid var(--nd-border);
    border-radius:18px;corner-shape:superellipse(4);
    background:var(--nd-muted);
}
.native-github-cta-icon {
    flex:none;display:grid;place-items:center;
    width:38px;height:38px;
    border-radius:13px;corner-shape:superellipse(4);
    background:color-mix(in srgb,var(--nd-accent) 12%,var(--nd-surface));
    border:1px solid color-mix(in srgb,var(--nd-accent) 28%,var(--nd-border));
    color:var(--nd-accent);
}
.native-github-cta-icon svg:not(.nd-squircle-svg) {width:20px;height:20px;stroke:currentColor;stroke-width:1.75;stroke-linejoin:round}
.native-github-cta-copy {
    flex:1 1 152px;min-width:145px;display:flex;flex-direction:column;
    gap:2px;font-size:12px;line-height:1.45;
}
.native-github-cta-copy strong {color:var(--nd-ink);font-size:12px;font-weight:750}
.native-github-cta-copy span {color:var(--nd-ink-muted);font-size:11px}
#native-github-star {
    flex:none;display:inline-flex;justify-content:center;align-items:center;
    gap:7px;min-height:40px;padding:8px 11px;
    color:var(--nd-ink);background:var(--nd-surface);
    border:1px solid color-mix(in srgb,var(--nd-accent) 40%,var(--nd-border));
    border-radius:12px;corner-shape:superellipse(4);
    font-size:11px;font-weight:750;text-decoration:none;
    transition:background 100ms ease,border-color 100ms ease;
}
#native-github-star:hover {background:var(--nd-hover);border-color:var(--nd-accent)}
#native-github-star svg:not(.nd-squircle-svg) {width:14px;height:14px;stroke:var(--nd-accent);stroke-width:1.8;stroke-linejoin:round}
.native-cta-external {font-size:12px;color:var(--nd-ink-muted)}
/* Release-only nudge, closed via explicit user action. */
#native-downloads-nudge {
    position:fixed;z-index:14;
    right:calc(18px + env(safe-area-inset-right,0px));
    top:calc(76px + env(safe-area-inset-top,0px));
    display:flex;align-items:center;gap:9px;
    width:min(330px,calc(100vw - 32px));
    padding:12px;
    background:var(--nd-raised);
    border:1px solid var(--nd-border);
    border-radius:17px;corner-shape:superellipse(4);
    box-shadow:0 13px 36px var(--nd-shadow);
}
.native-downloads-nudge-copy {flex:1;font-size:12px;line-height:1.5}
#native-downloads-nudge-open {
    min-height:39px;border:1px solid var(--nd-accent);
    border-radius:11px;corner-shape:superellipse(4);
    padding:9px 12px;background:var(--nd-accent);
    color:var(--nd-on-accent);font-size:12px;font-weight:700;
}
#native-downloads-nudge-close {
    width:32px;height:39px;border:0;
    background:transparent;color:var(--nd-ink);
    font-size:20px;
}
@media(max-width:640px) {
    #native-downloads-trigger {
        top:auto;bottom:calc(82px + env(safe-area-inset-bottom,0px));
        right:calc(12px + env(safe-area-inset-right,0px));
        min-height:44px;padding:9px 13px;
    }
    #native-downloads-dialog {
        top:auto;bottom:0;left:0;
        transform:none;width:100%;max-height:min(88dvh,750px);
        border-radius:28px 28px 0 0;
        border-left:0;border-right:0;border-bottom:0;
        padding:21px 18px calc(22px + env(safe-area-inset-bottom,0px));
        animation:nd-sheet-enter 210ms cubic-bezier(.18,.85,.28,1) both;
    }
    #native-downloads-dialog:before {
        content:"";display:block;width:36px;height:4px;
        border-radius:8px;background:var(--nd-border);
        margin:-10px auto 17px;
    }
    #native-downloads-title {font-size:19px}
    .native-downloads-tabs {gap:3px}
    .native-downloads-tabs button {font-size:11px;min-height:44px}
    .native-downloads-configuration {flex-wrap:wrap}
    .native-downloads-combobox {min-width:142px}
    .native-github-cta {padding:12px}
    #native-downloads-nudge {
        top:auto;bottom:calc(140px + env(safe-area-inset-bottom,0px));
        right:12px;
    }
    @keyframes nd-sheet-enter {
        from {opacity:.75;transform:translateY(22px)}
        to {opacity:1;transform:translateY(0)}
    }
}
@media(max-width:360px) {
    #native-downloads-dialog {padding-left:13px;padding-right:13px}
    .native-downloads-tabs {grid-template-columns:repeat(2,minmax(0,1fr))}
    .native-github-cta-copy {flex-basis:130px}
}
@media(prefers-reduced-motion:reduce) {
    #native-downloads-dialog {animation:none}
    #native-downloads-trigger,#native-downloads-dialog button,
    #native-downloads-dialog a,#native-downloads-architecture svg:not(.nd-squircle-svg) {transition:none}
}

/* True Qt exponent-4 Superellipse contours on browser engines that lack
 * CSS corner-shape support. The SVG layer is noninteractive: semantic HTML,
 * resize behaviour, focus management and touch events stay unchanged.
 */
.nd-squircle {
    position:relative;
    isolation:isolate;
    background:transparent!important;
    border-color:transparent!important;
    corner-shape:round!important;
}
.nd-squircle > svg.nd-squircle-svg {
    position:absolute;inset:0;
    display:block;
    width:100%;height:100%;
    min-width:0;min-height:0;
    overflow:hidden;z-index:-1;
    pointer-events:none;
    stroke:none;fill:none;
    transform:none!important;
    transition:none!important;
    animation:none!important;
}
.nd-squircle > svg.nd-squircle-svg > path {
    fill:var(--nd-shape-fill,var(--nd-raised));
    stroke:var(--nd-shape-stroke,var(--nd-border));
    stroke-width:var(--nd-shape-width,1px);
    vector-effect:non-scaling-stroke;
    stroke-linejoin:round;
}
#native-downloads-dialog.nd-squircle {
    position:fixed;
    --nd-shape-fill:var(--nd-surface);
    --nd-shape-stroke:color-mix(in srgb,var(--nd-accent) 16%,var(--nd-border));
}
#native-downloads-trigger.nd-squircle {
    position:fixed;
    --nd-shape-fill:var(--nd-raised);
}
#native-downloads-trigger.nd-squircle:hover {--nd-shape-fill:var(--nd-hover);--nd-shape-stroke:var(--nd-accent)}
#native-downloads-trigger.nd-squircle[aria-expanded="true"] {
    --nd-shape-fill:color-mix(in srgb,var(--nd-accent) 12%,var(--nd-raised));
    --nd-shape-stroke:var(--nd-accent);
}
#native-downloads-close.nd-squircle {--nd-shape-fill:var(--nd-raised)}
#native-downloads-close.nd-squircle:hover {--nd-shape-fill:var(--nd-hover)}
.native-downloads-tabs.nd-squircle {--nd-shape-fill:var(--nd-muted)}
.native-downloads-tabs button.nd-squircle {
    --nd-shape-fill:transparent;
    --nd-shape-stroke:transparent;
}
.native-downloads-tabs button.nd-squircle:hover:not(.selected) {
    --nd-shape-fill:var(--nd-hover);
}
.native-downloads-tabs button.selected.nd-squircle {
    --nd-shape-fill:var(--nd-accent);
    --nd-shape-stroke:var(--nd-accent);
}
#native-downloads-architecture.nd-squircle {--nd-shape-fill:var(--nd-raised)}
#native-downloads-architecture.nd-squircle:hover {
    --nd-shape-fill:var(--nd-hover);--nd-shape-stroke:var(--nd-accent);
}
#native-downloads-architecture.is-open.nd-squircle {
    --nd-shape-stroke:var(--nd-accent);
}
#native-downloads-options.nd-squircle {
    position:absolute;
    --nd-shape-fill:var(--nd-raised);
}
.native-downloads-option.nd-squircle {
    --nd-shape-fill:transparent;
    --nd-shape-stroke:transparent;
}
.native-downloads-option.nd-squircle:hover,
.native-downloads-option.nd-squircle:focus-visible {--nd-shape-fill:var(--nd-hover)}
.native-downloads-option[aria-selected="true"].nd-squircle {
    --nd-shape-fill:color-mix(in srgb,var(--nd-accent) 11%,var(--nd-raised));
}
.native-downloads-result.nd-squircle {--nd-shape-fill:var(--nd-muted)}
#native-downloads-action.nd-squircle {
    --nd-shape-fill:var(--nd-accent);--nd-shape-stroke:var(--nd-accent);
}
.native-downloads-secondary.nd-squircle {--nd-shape-fill:var(--nd-raised)}
.native-downloads-secondary.nd-squircle:hover {
    --nd-shape-fill:var(--nd-hover);--nd-shape-stroke:var(--nd-accent);
}
.native-github-cta.nd-squircle {--nd-shape-fill:var(--nd-muted)}
.native-github-cta-icon.nd-squircle {
    --nd-shape-fill:color-mix(in srgb,var(--nd-accent) 12%,var(--nd-surface));
    --nd-shape-stroke:color-mix(in srgb,var(--nd-accent) 28%,var(--nd-border));
}
#native-github-star.nd-squircle {
    --nd-shape-fill:var(--nd-surface);
    --nd-shape-stroke:color-mix(in srgb,var(--nd-accent) 40%,var(--nd-border));
}
#native-github-star.nd-squircle:hover {
    --nd-shape-fill:var(--nd-hover);--nd-shape-stroke:var(--nd-accent);
}
#native-downloads-nudge.nd-squircle {
    position:fixed;--nd-shape-fill:var(--nd-raised);
}
#native-downloads-nudge-open.nd-squircle {
    --nd-shape-fill:var(--nd-accent);--nd-shape-stroke:var(--nd-accent);
}
@media (max-width:640px) {
    #native-downloads-dialog.nd-squircle {position:fixed}
}

/* Keep the background Bezier fixed while the inner viewport scrolls.
 * In the previous structure, the background belonged to the scrolling
 * element; on short mobile viewports it moved out of sight with the text.
 */
#native-downloads-dialog {
    padding:0;
    overflow:visible;
    border-radius:43px;
}
#native-downloads-dialog .native-downloads-viewport {
    position:relative;
    max-height:min(770px,calc(100dvh - 36px));
    overflow-x:hidden;
    overflow-y:auto;
    overscroll-behavior:contain;
    padding:26px 26px 23px;
    scrollbar-width:thin;
    scrollbar-color:var(--nd-scroll) transparent;
    background:transparent;
    border-radius:43px;
    corner-shape:superellipse(4);
}
#native-downloads-dialog.nd-squircle {
    overflow:visible;
    --nd-shape-width:1px;
}
.native-downloads-tabs button.selected.nd-squircle {
    box-shadow:none;
}
#native-downloads-architecture.is-open.nd-squircle {
    box-shadow:none;
    --nd-shape-width:1.8px;
}
@media (max-width:640px) {
    #native-downloads-dialog {
        padding:0;
        overflow:visible;
        border-radius:41px 41px 0 0;
    }
    #native-downloads-dialog .native-downloads-viewport {
        max-height:min(88dvh,750px);
        padding:21px 18px calc(22px + env(safe-area-inset-bottom,0px));
        border-radius:41px 41px 0 0;
    }
    #native-downloads-dialog::before {display:none}
    #native-downloads-dialog .native-downloads-viewport::before {
        content:"";
        display:block;
        width:36px;
        height:4px;
        border-radius:8px;
        background:var(--nd-border);
        margin:-10px auto 17px;
    }
}
@media (max-width:360px) {
    #native-downloads-dialog .native-downloads-viewport {
        padding-left:13px;
        padding-right:13px;
    }
}


/* Single-border superellipse repair.
 * Each surface owns exactly one QML-equivalent SVG path for its fill/stroke.
 * Remove the native CSS stroke, inset shadows and generic focus outline
 * on those components. Their SVG silhouette remains unchanged.
 */
.nd-squircle {
    border-color:transparent!important;
    background:transparent!important;
    box-shadow:none!important;
    outline:none;
}
.nd-squircle > svg.nd-squircle-svg > path {
    stroke-width:var(--nd-shape-width,1px);
}
/* Focus is indicated by a thicker *existing* contour for keyboard use.
 * Programmatic/pointer focus must not draw a second detached blue ring. */
.nd-squircle:focus,
.nd-squircle:focus-visible {
    outline:none!important;
    outline-offset:0!important;
}
.nd-keyboard-input .nd-squircle:focus-visible {
    --nd-shape-stroke:var(--nd-accent);
    --nd-shape-width:2px;
}
#native-downloads-dialog.nd-squircle {
    --nd-shape-stroke:var(--nd-border);
    filter:drop-shadow(0 18px 32px var(--nd-shadow));
}
#native-downloads-trigger.nd-squircle {
    filter:drop-shadow(0 5px 10px color-mix(in srgb,var(--nd-shadow) 55%,transparent));
}
#native-downloads-options.nd-squircle {
    --nd-shape-stroke:var(--nd-border);
    filter:drop-shadow(0 10px 18px color-mix(in srgb,var(--nd-shadow) 65%,transparent));
}
.native-downloads-tabs button.selected.nd-squircle {
    box-shadow:none!important;
}
#native-downloads-architecture.is-open.nd-squircle {
    box-shadow:none!important;
    --nd-shape-stroke:var(--nd-accent);
}
.native-downloads-option.nd-squircle {
    --nd-shape-stroke:transparent;
}
.native-downloads-option[aria-selected="true"].nd-squircle {
    --nd-shape-stroke:transparent;
}
.native-downloads-option.nd-squircle:focus-visible {
    outline:none!important;
}
/* Keep the architecture popup above the availability message, rather than
 * letting a container-level stacking context put the menu behind the card. */
.native-downloads-configuration {position:relative}
.native-downloads-configuration.is-dropdown-open {z-index:12}
/* A soft, single SVG frame, not nested browser border-radius outlines. */
#native-downloads-close.nd-squircle,
#native-downloads-action.nd-squircle,
.native-downloads-secondary.nd-squircle,
#native-github-star.nd-squircle {
    filter:none;
}
@media(prefers-reduced-motion:reduce) {
    .nd-squircle > svg.nd-squircle-svg {
        transition:none!important;
        animation:none!important;
    }
}


/* Popup geometry is anchored to the trigger by JS, but its DOM lives directly
 * inside the modal, OUTSIDE .native-downloads-viewport (overflow:auto).
 * Keeping its own full-height SVG frame in the overlay layer prevents the
 * second option from being cropped or painted below the status card. */
#native-downloads-dialog > #native-downloads-options {
    position:absolute;
    z-index:320;
    right:auto;
    bottom:auto;
    box-sizing:border-box;
    min-width:0;
    overflow-x:hidden;
    overflow-y:auto;
    overscroll-behavior:contain;
    margin:0;
    padding:6px;
    box-shadow:none!important;
    border-color:transparent!important;
    background:transparent!important;
}
#native-downloads-options .native-downloads-option {
    position:relative;
    display:flex;
    align-items:center;
    justify-content:space-between;
    width:100%;
    height:44px;
    min-height:44px;
    margin:0;
    padding:0 13px;
    flex:none;
}
#native-downloads-options .native-downloads-option + .native-downloads-option {
    margin-top:3px;
}
#native-downloads-options .native-downloads-option[aria-selected="true"] {
    --nd-shape-stroke:transparent;
    outline:0!important;
}
#native-downloads-options .native-downloads-option[aria-selected="true"]::after {
    float:none;
    margin-left:8px;
}
/* The logo frame is an independent QML-equivalent Superellipse rather than
 * a hard-edged image border. Its image is deliberately borderless: the
 * continuous silhouette has exactly one stroke and one owner. */
.native-downloads-brand-frame {
    display:grid;
    place-items:center;
    width:44px;
    height:44px;
    flex:0 0 44px;
    position:relative;
    border:1px solid var(--nd-border);
    border-radius:15px;
    corner-shape:superellipse(4);
    background:var(--nd-muted);
    box-shadow:none;
}
.native-downloads-brand-frame.nd-squircle {
    --nd-shape-fill:var(--nd-muted);
    --nd-shape-stroke:var(--nd-border);
    --nd-shape-width:1px;
    border-color:transparent!important;
}
.native-downloads-brand-frame .native-downloads-mark {
    width:32px;
    height:32px;
    padding:0;
    margin:0;
    border:0;
    border-radius:0;
    background:transparent;
    box-shadow:none;
    object-fit:contain;
    display:block;
    position:relative;
    z-index:0;
    pointer-events:none;
}

/* Collapsed edge dock: the discovery affordance must never occupy the
 * dashboard's top-right header or cover My Assets. Open only on demand. */
#native-downloads-dock {
    position:fixed;
    z-index:17;
    /* Reserve the bottom-right for the application's real floating actions.
       A small top-edge chip stays visible without covering those controls. */
    right:calc(10px + env(safe-area-inset-right,0px));
    top:calc(86px + env(safe-area-inset-top,0px));
    bottom:auto;
    display:flex;
    gap:7px;
    align-items:center;
    padding:5px 8px 5px 5px;
    background:var(--nd-raised);
    border:1px solid var(--nd-border);
    border-radius:22px;
    corner-shape:superellipse(4);
    corner-shape:superellipse(4);
    color:var(--nd-ink);
    box-shadow:0 6px 24px var(--nd-shadow);
    font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
    -webkit-font-smoothing:antialiased;
    transition:width 150ms ease,background 150ms ease;
}
#native-downloads-dock[data-expanded="false"] {
    width:44px;
    min-height:44px;
    padding:3px;
}
#native-downloads-dock[data-expanded="true"] {max-width:calc(100vw - 24px)}
#native-downloads-dock-toggle {
    appearance:none;
    -webkit-appearance:none;
    flex:none;
    display:grid;
    place-items:center;
    width:36px;
    height:36px;
    padding:7px;
    border:0;
    border-radius:14px;
    corner-shape:superellipse(4);
    color:var(--nd-accent);
    background:transparent;
    cursor:pointer;
    -webkit-tap-highlight-color:transparent;
}
#native-downloads-dock-toggle:hover {background:var(--nd-hover)}
#native-downloads-dock-toggle:focus-visible {
    outline:2px solid var(--nd-accent);
    outline-offset:1px;
}
#native-downloads-dock-toggle svg:not(.nd-squircle-svg) {
    width:18px;height:18px;
    fill:none;stroke:currentColor;
    stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;
}
#native-downloads-dock[data-expanded="true"] #native-downloads-dock-toggle svg:not(.nd-squircle-svg) {display:none}
#native-downloads-dock[data-expanded="true"] #native-downloads-dock-toggle::before {
    content:"×";font-size:24px;line-height:1;color:var(--nd-ink-muted);
}
#native-downloads-dock #native-downloads-trigger,
#native-downloads-dock #native-downloads-trigger.nd-squircle {
    position:relative;
    top:auto;right:auto;bottom:auto;
    display:inline-flex;
    min-height:38px;
    padding:7px 12px;
    filter:none;
    box-shadow:none;
    white-space:nowrap;
}
#native-downloads-dock #native-downloads-trigger[hidden] {display:none!important}
#native-downloads-dock[data-expanded="true"] #native-downloads-trigger {margin-right:0}
@media(max-width:640px) {
    #native-downloads-dock {
        top:calc(76px + env(safe-area-inset-top,0px));
        bottom:auto;
    }
}

/* The two-row architecture list must be a real, completely painted popup.
 * Previous SVG paths in each option made transparent/negative stacking
 * contexts; selected rows painted but the Intel row looked outside the menu.
 * Use a single product-owned surface and smooth fallback corner geometry. */
#native-downloads-dialog > #native-downloads-options {
    position:absolute;
    isolation:isolate;
    box-sizing:border-box;
    z-index:320;
    padding:6px;
    margin:0;
    background:var(--nd-raised)!important;
    color:var(--nd-ink);
    border:1px solid transparent!important;
    border-radius:20px;
    corner-shape:superellipse(4);
    box-shadow:none!important;
    filter:drop-shadow(0 10px 18px var(--nd-shadow));
    overflow-y:auto;
    overflow-x:hidden;
    scrollbar-width:thin;
    scrollbar-color:var(--nd-scroll) transparent;
}
#native-downloads-options .nd-popup-outline {
    position:absolute;
    inset:0;
    z-index:3;
    display:block;
    width:100%;
    height:100%;
    fill:none;
    overflow:visible;
    pointer-events:none;
}
#native-downloads-options .nd-popup-outline path {
    fill:none;
    stroke:var(--nd-border);
    stroke-width:1;
    stroke-linejoin:round;
}
#native-downloads-options .native-downloads-option {
    position:relative;
    z-index:1;
    box-sizing:border-box;
    display:flex;
    align-items:center;
    justify-content:space-between;
    width:100%;
    min-height:44px;
    height:44px;
    padding:0 14px;
    color:var(--nd-ink);
    background:transparent;
    border:0;
    border-radius:14px;
    corner-shape:superellipse(4);
    text-align:start;
    font-size:13px;
    line-height:1.4;
    font-weight:600;
    cursor:pointer;
    outline:none;
}
#native-downloads-options .native-downloads-option + .native-downloads-option {
    margin-top:3px;
}
#native-downloads-options .native-downloads-option:is(:hover,:focus-visible) {
    background:var(--nd-hover);
}
#native-downloads-options .native-downloads-option[aria-selected="true"] {
    color:var(--nd-accent);
    font-weight:750;
    background:color-mix(in srgb,var(--nd-accent) 13%,var(--nd-raised));
}
#native-downloads-options .native-downloads-option[aria-selected="true"]::after {
    content:"✓";
    margin-left:10px;
    font-weight:800;
    color:var(--nd-accent);
}
#native-downloads-options .native-downloads-option:focus-visible {
    outline:2px solid var(--nd-accent);
    outline-offset:-2px;
}
/* One mathematically consistent Superellipse, including the collapsed
   top-right chip; no hard-edged border or detached browser focus outline. */
#native-downloads-dock.nd-squircle {
    --nd-shape-fill:var(--nd-raised);
    --nd-shape-stroke:var(--nd-border);
    --nd-shape-width:1px;
    border-color:transparent!important;
    box-shadow:none;
    filter:drop-shadow(0 5px 12px var(--nd-shadow));
}
#native-downloads-dock-toggle.nd-squircle {
    --nd-shape-fill:transparent;
    --nd-shape-stroke:transparent;
}
#native-downloads-dock-toggle.nd-squircle:hover {
    --nd-shape-fill:var(--nd-hover);
}
#native-downloads-dock-toggle.nd-squircle:focus-visible {
    outline:none;
}
@media(prefers-reduced-motion:reduce) {
    #native-downloads-dock {transition:none}
}

/* Trusted browser wallet approval uses the same theme as app downloads. */
.wallet-connect-scrim {
    position:fixed;
    inset:0;
    z-index:2147483647;
    display:grid;
    place-items:center;
    box-sizing:border-box;
    padding:16px;
    background:var(--nd-scrim);
    backdrop-filter:blur(7px);
    -webkit-backdrop-filter:blur(7px);
}
.wallet-connect-dialog {
    display:flex;
    flex-direction:column;
    box-sizing:border-box;
    width:min(488px,100%);
    max-height:calc(100dvh - 32px);
    overflow:hidden;
    border:1px solid var(--nd-border);
    border-radius:24px;
    background:var(--nd-surface);
    color:var(--nd-ink);
    box-shadow:0 24px 75px var(--nd-shadow);
    font:400 14px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif;
}
.wallet-connect-heading {
    display:flex;
    align-items:center;
    gap:12px;
    padding:20px 24px 14px;
}
.wallet-connect-heading img {
    box-sizing:border-box;
    flex:none;
    width:42px;
    height:42px;
    padding:7px;
    border:1px solid var(--nd-border);
    border-radius:14px;
    background:var(--nd-raised);
}
.wallet-connect-heading h2 {
    margin:0;
    font-size:21px;
    line-height:1.25;
    font-weight:700;
    overflow-wrap:anywhere;
}
.wallet-connect-body {
    min-height:0;
    overflow-y:auto;
    overscroll-behavior:contain;
    padding:4px 24px 16px;
    scrollbar-color:var(--nd-scroll) transparent;
}
.wallet-connect-origin {
    display:block;
    padding:8px 12px;
    border:1px solid var(--nd-border);
    border-radius:13px;
    background:var(--nd-muted);
    color:var(--nd-ink);
    overflow-wrap:anywhere;
    font-size:13px;
}
.wallet-connect-details,
.wallet-connect-pairing p {
    margin:12px 0;
    color:var(--nd-ink-muted);
}
.wallet-connect-choices {
    display:grid;
    gap:6px;
    min-width:0;
    margin:0;
    padding:0;
    border:0;
}
.wallet-connect-choices legend {
    margin-block-end:6px;
    padding:0;
    font-size:13px;
    font-weight:650;
}
.wallet-connect-choice {
    display:flex;
    align-items:center;
    gap:10px;
    box-sizing:border-box;
    min-height:46px;
    padding:8px 12px;
    border:1px solid var(--nd-border);
    border-radius:13px;
    background:var(--nd-raised);
    cursor:pointer;
}
.wallet-connect-choice:hover {background:var(--nd-hover)}
.wallet-connect-choice:has(input:checked) {
    border-color:var(--nd-accent);
    background:color-mix(in srgb,var(--nd-accent) 9%,var(--nd-raised));
}
.wallet-connect-choice:has(input:disabled) {cursor:default}
.wallet-connect-choice input {margin:0;accent-color:var(--nd-accent)}
.wallet-connect-choice bdi {min-width:0;overflow-wrap:anywhere}
.wallet-connect-pairing {
    margin-block-start:14px;
    padding:0 12px 12px;
    border:1px solid var(--nd-border);
    border-radius:16px;
    background:var(--nd-muted);
    text-align:center;
}
.wallet-connect-pairing img {
    display:block;
    box-sizing:border-box;
    width:min(212px,100%);
    height:auto;
    margin:10px auto 0;
    padding:8px;
    border-radius:12px;
    background:#fff;
}
.wallet-connect-pairing [hidden],.wallet-connect-pairing[hidden] {display:none}
.wallet-connect-error {margin:12px 0 0;color:var(--nd-danger)}
.wallet-connect-error:empty {margin:0}
.wallet-connect-links,.wallet-connect-actions {display:flex;flex-wrap:wrap;gap:8px}
.wallet-connect-links {justify-content:center}
.wallet-connect-actions {
    justify-content:flex-end;
    padding:12px 24px 18px;
    border-block-start:1px solid var(--nd-border-soft);
}
.wallet-connect-dialog button,
.wallet-connect-links a {
    appearance:none;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    box-sizing:border-box;
    min-height:44px;
    padding:8px 14px;
    border:1px solid var(--nd-border);
    border-radius:13px;
    background:var(--nd-raised);
    color:var(--nd-ink);
    font:inherit;
    font-weight:650;
    text-align:center;
    text-decoration:none;
    cursor:pointer;
}
.wallet-connect-dialog .wallet-connect-primary {
    background:var(--nd-accent);
    border-color:var(--nd-accent);
    color:var(--nd-on-accent);
}
.wallet-connect-dialog :is(button,a):hover {background:var(--nd-hover)}
.wallet-connect-dialog .wallet-connect-primary:hover:not(:disabled) {
    background:color-mix(in srgb,var(--nd-accent) 90%,var(--nd-ink));
}
.wallet-connect-dialog button:disabled {
    background:var(--nd-muted);
    border-color:var(--nd-border);
    color:var(--nd-ink-muted);
    cursor:default;
}
.wallet-connect-dialog :is(button,a,input):focus-visible {
    outline:2px solid var(--nd-accent);
    outline-offset:2px;
}
.wallet-connect-dialog .wallet-connect-show-qr {margin-block-start:8px}

@media (max-width:540px) {
    .wallet-connect-scrim {align-items:end;padding:0}
    .wallet-connect-dialog {
        width:100%;
        max-height:calc(100dvh - env(safe-area-inset-top,0px) - 12px);
        border-radius:29px 29px 0 0;
    }
    .wallet-connect-heading,.wallet-connect-body,.wallet-connect-actions {
        padding-inline:18px;
    }
    .wallet-connect-actions {padding-block-end:calc(16px + env(safe-area-inset-bottom,0px))}
    .wallet-connect-actions button {flex:1 1 120px}
}

/* v1.0.0 Native Editions: unmistakable primary download, secondary release link.
 * The browser's Qt Superellipse path remains the only visible shape border.
 * Green is reserved for the action, not operating-system selection or status. */
.native-downloads-actions {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:stretch;
    gap:12px;
    margin-block:4px 2px;
}
#native-downloads-action {
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:16px;
    min-width:0;
    min-height:78px;
    padding:16px 20px;
    border:1px solid #137842;
    border-radius:23px;
    corner-shape:superellipse(4);
    background:#157e44;
    color:#fff;
    text-align:start;
    text-decoration:none;
    font-weight:700;
    transition:background 150ms ease,border-color 150ms ease;
    -webkit-tap-highlight-color:transparent;
}
#native-downloads-action:hover {background:#106838;color:#fff;filter:none}
#native-downloads-action:active {background:#0f5c32}
#native-downloads-action.nd-squircle {
    --nd-shape-fill:#157e44;
    --nd-shape-stroke:#137842;
}
#native-downloads-action.nd-squircle:hover {
    --nd-shape-fill:#106838;
    --nd-shape-stroke:#106838;
}
#native-downloads-action.nd-squircle:active {
    --nd-shape-fill:#0f5c32;
    --nd-shape-stroke:#0f5c32;
}
.native-downloads-action-glyph {
    width:29px;
    height:29px;
    flex:0 0 29px;
    fill:none;
    stroke:#fff;
    stroke-width:1.95;
    stroke-linecap:round;
    stroke-linejoin:round;
    pointer-events:none;
}
.native-downloads-action-copy {
    display:flex;
    min-width:0;
    flex-direction:column;
    align-items:flex-start;
    justify-content:center;
    gap:4px;
    text-align:start;
}
#native-downloads-action-title {
    color:#fff;
    font-size:17px;
    font-weight:780;
    letter-spacing:-.016em;
    line-height:1.25;
}
#native-downloads-action-meta {
    color:rgba(255,255,255,.91);
    font-size:11.5px;
    font-weight:580;
    line-height:1.4;
    overflow-wrap:anywhere;
}
.native-downloads-secondary {
    align-self:center;
    min-height:48px;
    padding:11px 17px;
    font-size:12px;
    font-weight:650;
    color:var(--nd-ink-muted);
}
.native-downloads-secondary.nd-squircle {
    --nd-shape-fill:var(--nd-raised);
    --nd-shape-stroke:var(--nd-border);
}
.native-downloads-secondary:hover {color:var(--nd-ink)}
@media(max-width:480px) {
    .native-downloads-actions {
        grid-template-columns:minmax(0,1fr);
        gap:9px;
    }
    #native-downloads-action {min-height:72px;padding:14px 17px}
    .native-downloads-secondary {
        width:100%;
        min-height:44px;
        font-size:12px;
    }
}
@media(prefers-reduced-motion:reduce) {
    #native-downloads-action {transition:none}
}
