.app-download {
    --app-blue: #0f52ba;
    --app-navy: #0a192f;
    --app-muted: #64748b;
    --app-ice: #f0f5fc;
    --app-ice-border: #d6e4f7;
    --app-line: #e2e8f0;
    background: #f8fafc;
    color: #0f172a;
    font-family: "Noto Sans SC", system-ui, sans-serif;
}

.app-download *, .app-download *::before, .app-download *::after { box-sizing: border-box; }
.app-download :is(h1, h2, p, figure, ol) { margin: 0; }
.app-download [hidden] { display: none; }
.app-download a:focus-visible { outline: 2px solid var(--app-blue); outline-offset: 3px; }

.app-download svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-download-frame {
    width: min(100%, 1168px);
    margin-inline: auto;
    container: app-download / inline-size;
}

/* The H5 host keeps the narrow composition on tablets as well. */
.mobile-header ~ main .app-download-frame { max-width: 390px; }

.app-download-content {
    position: relative;
    isolation: isolate;
    max-width: 390px;
    margin-inline: auto;
    padding: 32px 20px;
    overflow: hidden;
}

.app-download-content::before {
    position: absolute;
    z-index: -1;
    inset: -64px 0 auto;
    height: 320px;
    background: radial-gradient(circle at 50% 30%, #0f52ba1f, #f8fafc00 70%);
    content: "";
    pointer-events: none;
}

.app-download-brand { margin: 16px 0 8px; text-align: center; }
.app-download-brand h1 { color: var(--app-navy); font-size: 24px; font-weight: 700; line-height: 32px; letter-spacing: -.025em; }
.app-download-icon { position: relative; width: 96px; margin: 0 auto 24px; }

.app-download-icon::before {
    position: absolute;
    inset: -10px;
    border: 1px solid #dbeafe;
    border-radius: 28px;
    background: #eff6ff99;
    content: "";
}

.app-download-icon img {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    border-radius: 22px;
    background: white;
    box-shadow: 0 10px 25px #0f52ba2e;
}

.app-download-copy { margin: 0 0 32px; padding-inline: 8px; text-align: center; }
.app-download-copy .app-download-tagline { color: #1e293b; font-size: 16px; font-weight: 600; line-height: 1.375; }
.app-download-copy .app-download-description { margin-top: 8px; color: var(--app-muted); font-size: 12px; line-height: 1.625; }
:where(.app-download) :is(.app-download-badge, .app-download-qr, .app-download-version small, .app-download-guide strong),
.app-download-guide .app-download-step-wide { display: none; }
.app-download-platforms { display: grid; gap: 12px; }
.app-download-android { display: grid; gap: 16px; }

.app-download .app-download-button {
    display: flex;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 12px;
    background: var(--app-blue);
    box-shadow: 0 6px 18px #0f52ba40;
    color: white;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    text-decoration: none;
    transition: background-color .2s, box-shadow .2s;
}

.app-download .app-download-button:hover { background: #0d47a1; color: white; box-shadow: 0 8px 25px #0f52ba5c; }
.app-download .app-download-button:active { background: #0b3c8a; }
.app-download[data-app-device="ios"] .app-download-button:not(.app-download-button--ios) { background: var(--app-ice); color: var(--app-blue); box-shadow: none; }
.app-download[data-app-device="ios"] .app-download-button:not(.app-download-button--ios):hover { background: #dbeafe; }

.app-download-version {
    color: var(--app-muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    letter-spacing: .025em;
    text-align: center;
    overflow-wrap: anywhere;
}

.app-download .app-download-home {
    display: flex;
    width: fit-content;
    min-height: 44px;
    margin: 12px auto 0;
    padding-inline: 12px;
    align-items: center;
    gap: 4px;
    color: var(--app-muted);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
}

.app-download .app-download-home:hover { color: var(--app-blue); text-decoration: underline; }
.app-download-home svg { width: 14px; height: 14px; }

.app-download-status, .app-browser-hint {
    padding: 12px 14px;
    border: 1px solid var(--app-line);
    border-radius: 12px;
    background: var(--app-ice);
    color: #475569;
    font-size: 13px;
    line-height: 1.5;
}

.app-download-status { text-align: center; }
.app-browser-hint { margin-bottom: 12px; border-color: #f2dfb8; background: #fff9ec; color: #704a1e; }

.app-download-guide {
    margin-top: 40px;
    padding: 20px;
    border: 1px solid #e2e8f0e6;
    border-radius: 16px;
    background: white;
    box-shadow: 0 1px 2px #0000000d;
}

.app-download-guide h2 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
}

.app-download-guide h2 svg { width: 14px; height: 14px; color: var(--app-blue); }
.app-download-guide ol { display: grid; gap: 12px; padding: 0; list-style: none; }
.app-download-guide li { display: flex; align-items: flex-start; gap: 10px; color: #475569; font-size: 12px; line-height: 1.625; }

.app-download-step {
    display: grid;
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    place-items: center;
    margin-top: 2px;
    border: 1px solid var(--app-ice-border);
    border-radius: 50%;
    background: var(--app-ice);
    color: var(--app-blue);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

@container app-download (min-width: 900px) {
    .app-download-content { max-width: none; padding: 64px 24px; overflow: visible; }
    .app-download-content::before { display: none; }

    .app-download-hero {
        position: relative;
        isolation: isolate;
        display: grid;
        grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
        align-items: center;
        gap: 56px;
        padding: clamp(40px, 5.5cqi, 64px);
        border: 1px solid #e2e8f0cc;
        border-radius: 24px;
        background: radial-gradient(#0f52ba0c 1px, transparent 1px) 0 0 / 24px 24px, white;
        box-shadow: 0 20px 50px #0f52ba0f;
        overflow: hidden;
    }

    .app-download-hero::before, .app-download-hero::after {
        position: absolute;
        z-index: -1;
        border-radius: 50%;
        background: radial-gradient(circle at 50% 20%, #0f52ba2e, #f0f5fc00 65%);
        content: "";
        pointer-events: none;
    }

    .app-download-hero::before { inset: -128px auto auto -128px; width: 384px; height: 384px; }
    .app-download-hero::after { inset: auto -96px -96px auto; width: 320px; height: 320px; }

    .app-download-brand { display: flex; align-items: center; gap: 24px; margin: 0 0 32px; text-align: left; }
    .app-download-brand h1 { font-size: 36px; line-height: 40px; }
    .app-download-icon { width: 80px; flex: 0 0 auto; margin: 0; }
    .app-download-icon::before { inset: -8px; border-color: #0f52ba1f; background: #eff6ff80; }
    .app-download-icon img { box-shadow: 0 8px 20px #0f52ba2e; }

    .app-download .app-download-badge {
        display: inline-flex;
        margin-top: 8px;
        padding: 2px 10px;
        border: 1px solid var(--app-ice-border);
        border-radius: 999px;
        background: var(--app-ice);
        color: var(--app-blue);
        font-size: 12px;
        font-weight: 500;
        line-height: 16px;
    }

    .app-download-copy { padding: 0; text-align: left; }
    .app-download-copy .app-download-tagline { font-size: clamp(24px, 2.4cqi, 28px); font-weight: 700; letter-spacing: -.025em; }
    .app-download-copy .app-download-description { margin-top: 12px; font-size: 16px; }
    .app-download-platforms { justify-items: start; padding-top: 8px; }
    .app-download-android { display: flex; flex-wrap: wrap; align-items: center; }
    .app-download .app-download-button { gap: 12px; padding: 16px 32px; font-size: 18px; line-height: 28px; box-shadow: 0 6px 20px #0f52ba47; }
    .app-download-version { padding-inline: 8px; color: #334155; font-size: 14px; font-weight: 600; line-height: 20px; text-align: left; }
    .app-download-version small { display: block; margin-top: 2px; color: var(--app-muted); font-size: 12px; font-weight: 400; line-height: 16px; letter-spacing: normal; }
    .app-download .app-download-home { display: none; }

    .app-download .app-download-qr {
        display: grid;
        width: min(100%, 310px);
        justify-items: center;
        justify-self: end;
        gap: 16px;
        padding: 24px;
        border: 1px solid #e2e8f0e6;
        border-radius: 16px;
        background: #f8fafce6;
        box-shadow: 0 1px 2px #0000000d;
        text-align: center;
    }

    .app-download-qr-image { max-width: 100%; padding: 12px; border: 1px solid var(--app-line); border-radius: 12px; background: white; box-shadow: 0 1px 2px #0000000d; }
    .app-download-qr-image img { display: block; max-width: 100%; height: auto; border-radius: 8px; }
    .app-download-qr strong { display: flex; align-items: center; justify-content: center; gap: 6px; color: #334155; font-size: 14px; font-weight: 500; line-height: 20px; }
    .app-download-qr svg { width: 16px; height: 16px; color: var(--app-blue); }
    .app-download-qr p { margin-top: 4px; color: var(--app-muted); font-size: 12px; line-height: 16px; }

    .app-download-guide { padding: 24px; border-color: #e2e8f0cc; background: #ffffffb3; box-shadow: none; }
    .app-download-guide h2 { gap: 8px; margin-bottom: 16px; font-size: 14px; line-height: 20px; }
    .app-download-guide h2 svg { width: 16px; height: 16px; }
    .app-download-guide ol { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
    .app-download-guide li { gap: 14px; }
    .app-download-guide li.app-download-step-wide { display: flex; }
    .app-download-guide span.app-download-step-wide { display: inline; }
    .app-download-guide .app-download-step-narrow { display: none; }
    .app-download-guide strong { display: block; margin-bottom: 2px; color: #1e293b; font-weight: 500; }
    .app-download-step { width: 24px; height: 24px; margin-top: 0; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .app-download .app-download-button { transition: none; }
}
