.ifkdb-pwa-push-host:empty {
    display: none;
}

.ifkdb-pwa-prompt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: .85rem 0 1rem;
    padding: .85rem .95rem;
    border: 1px solid rgba(29, 66, 137, .14);
    border-radius: .9rem;
    background: #fff;
    box-shadow: 0 .35rem 1rem rgba(16, 36, 59, .06);
    color: #10243b;
}

.ifkdb-pwa-prompt__copy {
    min-width: 0;
}

.ifkdb-pwa-prompt__copy strong {
    display: block;
    margin: 0 0 .12rem;
    color: #10243b;
    font-size: .92rem;
    line-height: 1.25;
}

.ifkdb-pwa-prompt__copy span {
    display: block;
    color: #66758a;
    font-size: .76rem;
    line-height: 1.35;
}

.ifkdb-pwa-prompt__actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .45rem;
}

.ifkdb-pwa-button {
    appearance: none;
    display: inline-flex;
    min-height: 2.35rem;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: .48rem .72rem;
    border: 1px solid rgba(29, 66, 137, .18);
    border-radius: .65rem;
    background: #fff;
    color: #1d4289;
    font: inherit;
    font-size: .75rem;
    font-weight: 850;
    line-height: 1.1;
    text-decoration: none;
    cursor: pointer;
}

.ifkdb-pwa-button:hover,
.ifkdb-pwa-button:focus-visible {
    background: #edf3fb;
    color: #153b7c;
    text-decoration: none;
}

.ifkdb-pwa-button--primary {
    border-color: #1d4289;
    background: #1d4289;
    color: #fff;
}

.ifkdb-pwa-button--primary:hover,
.ifkdb-pwa-button--primary:focus-visible {
    background: #16356f;
    color: #fff;
}

.ifkdb-pwa-button--danger {
    border-color: rgba(162, 45, 45, .22);
    color: #9e3434;
}

.ifkdb-pwa-button[disabled] {
    opacity: .55;
    cursor: wait;
}

.ifkdb-pwa-app-nav {
    display: none;
}

html.ifkdb-pwa-standalone body {
    padding-bottom: calc(4.4rem + env(safe-area-inset-bottom, 0px));
}

html.ifkdb-pwa-standalone .ifkdb-pwa-app-nav {
    position: fixed;
    right: max(.55rem, env(safe-area-inset-right, 0px));
    bottom: max(.55rem, env(safe-area-inset-bottom, 0px));
    left: max(.55rem, env(safe-area-inset-left, 0px));
    z-index: 9998;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid rgba(18, 54, 96, .16);
    border-radius: 1rem;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 .75rem 2.1rem rgba(8, 25, 52, .22);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.ifkdb-pwa-app-nav a {
    display: flex;
    min-width: 0;
    min-height: 3.4rem;
    align-items: center;
    justify-content: center;
    padding: .45rem .3rem;
    border-left: 1px solid rgba(18, 54, 96, .09);
    color: #5e6e82;
    font-size: .7rem;
    font-weight: 850;
    line-height: 1.1;
    text-align: center;
    text-decoration: none !important;
}

.ifkdb-pwa-app-nav a:first-child {
    border-left: 0;
}

.ifkdb-pwa-app-nav a.is-active {
    background: #edf3fb;
    color: #1d4289;
}

.ifkdb-pwa-modal[hidden] {
    display: none !important;
}

.ifkdb-pwa-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: grid;
    place-items: end center;
    padding: 1rem;
    background: rgba(5, 18, 39, .58);
}

.ifkdb-pwa-modal__panel {
    width: min(42rem, 100%);
    max-height: min(88vh, 50rem);
    overflow: auto;
    border-radius: 1.1rem;
    background: #fff;
    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, .28);
    color: #10243b;
}

.ifkdb-pwa-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1rem .8rem;
    border-bottom: 1px solid rgba(18, 54, 96, .12);
}

.ifkdb-pwa-modal__head h2 {
    margin: 0;
    color: #10243b;
    font-size: 1.25rem;
    line-height: 1.15;
}

.ifkdb-pwa-modal__head p {
    margin: .25rem 0 0;
    color: #65758a;
    font-size: .8rem;
    line-height: 1.4;
}

.ifkdb-pwa-modal__close {
    appearance: none;
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
    place-items: center;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(18, 54, 96, .14);
    border-radius: .65rem;
    background: #fff;
    color: #27476d;
    font: inherit;
    font-size: 1.15rem;
    cursor: pointer;
}

.ifkdb-pwa-modal__body {
    display: grid;
    gap: .9rem;
    padding: 1rem;
}

.ifkdb-pwa-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: .7rem;
    padding: .8rem;
    border: 1px solid rgba(18, 54, 96, .12);
    border-radius: .8rem;
    background: #f8fafc;
}

.ifkdb-pwa-option input {
    width: 1.1rem;
    height: 1.1rem;
    margin: .08rem 0 0;
    accent-color: #1d4289;
}

.ifkdb-pwa-option strong {
    display: block;
    color: #10243b;
    font-size: .88rem;
    line-height: 1.25;
}

.ifkdb-pwa-option small {
    display: block;
    margin-top: .15rem;
    color: #6a798c;
    font-size: .74rem;
    line-height: 1.35;
}

.ifkdb-pwa-source-mode {
    display: grid;
    gap: .55rem;
    padding-left: 1.8rem;
}

.ifkdb-pwa-source-mode[hidden] {
    display: none;
}

.ifkdb-pwa-source-mode__radios {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem 1rem;
}

.ifkdb-pwa-source-mode__radios label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: #334b69;
    font-size: .76rem;
    font-weight: 750;
}

.ifkdb-pwa-source-mode__radios input {
    accent-color: #1d4289;
}

.ifkdb-pwa-sources {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .42rem;
    max-height: 16rem;
    overflow: auto;
    padding: .1rem;
}

.ifkdb-pwa-sources[hidden] {
    display: none;
}

.ifkdb-pwa-source {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: .45rem;
    padding: .52rem .58rem;
    border: 1px solid rgba(18, 54, 96, .11);
    border-radius: .65rem;
    background: #fff;
    color: #334b69;
    font-size: .73rem;
    font-weight: 750;
    line-height: 1.2;
}

.ifkdb-pwa-source input {
    flex: 0 0 auto;
    accent-color: #1d4289;
}

.ifkdb-pwa-source span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ifkdb-pwa-modal__status {
    min-height: 1.1rem;
    color: #53667f;
    font-size: .75rem;
    line-height: 1.35;
}

.ifkdb-pwa-modal__status.is-error {
    color: #9e3434;
}

.ifkdb-pwa-modal__status.is-success {
    color: #19784c;
}

.ifkdb-pwa-modal__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .5rem;
    padding: .85rem 1rem 1rem;
    border-top: 1px solid rgba(18, 54, 96, .12);
}

.ifkdb-pwa-ios-help {
    padding: .9rem;
    border: 1px solid rgba(29, 66, 137, .15);
    border-radius: .8rem;
    background: #edf3fb;
    color: #27476d;
    font-size: .8rem;
    line-height: 1.5;
}

.ifkdb-pwa-ios-help strong {
    color: #10243b;
}

@media (max-width: 40rem) {
    .ifkdb-pwa-prompt {
        align-items: stretch;
        flex-direction: column;
        gap: .65rem;
        margin: .7rem 0 .85rem;
        padding: .72rem .75rem;
    }

    .ifkdb-pwa-prompt__actions {
        width: 100%;
    }

    .ifkdb-pwa-prompt__actions .ifkdb-pwa-button {
        flex: 1 1 0;
    }

    .ifkdb-pwa-modal {
        align-items: end;
        padding: .45rem;
    }

    .ifkdb-pwa-modal__panel {
        max-height: 92vh;
        border-radius: 1rem 1rem .8rem .8rem;
    }

    .ifkdb-pwa-sources {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* PWA UX refinement: contextual promotion + standalone settings. */
.ifkdb-pwa-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.ifkdb-pwa-push-host[hidden],
html.ifkdb-pwa-standalone [data-ifkdb-pwa-push-host] {
    display: none !important;
}

.ifkdb-pwa-prompt__dismiss {
    display: none;
}

/* Nyheter: desktop controls live inside the hero instead of adding a card above it. */
.ifk-news-archive__hero .ifk-news-archive__hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.ifkdb-pwa-push-host--news-hero {
    position: relative;
    z-index: 3;
    margin-left: auto;
}

.ifkdb-pwa-prompt--news-hero {
    gap: .45rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #fff;
}

.ifkdb-pwa-prompt--news-hero .ifkdb-pwa-prompt__copy {
    display: none;
}

.ifkdb-pwa-prompt--news-hero .ifkdb-pwa-prompt__actions {
    gap: .38rem;
}

.ifkdb-pwa-prompt--news-hero .ifkdb-pwa-button {
    min-height: 2.15rem;
    padding: .4rem .62rem;
    border-color: rgba(255, 255, 255, .28);
    background: rgba(5, 25, 58, .48);
    color: #fff;
    font-size: .68rem;
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.ifkdb-pwa-prompt--news-hero .ifkdb-pwa-button:hover,
.ifkdb-pwa-prompt--news-hero .ifkdb-pwa-button:focus-visible {
    background: rgba(5, 25, 58, .72);
    color: #fff;
}

.ifkdb-pwa-prompt--news-hero .ifkdb-pwa-button--primary {
    border-color: rgba(255, 255, 255, .86);
    background: #fff;
    color: #163b78;
}

.ifkdb-pwa-prompt--news-hero .ifkdb-pwa-button--primary:hover,
.ifkdb-pwa-prompt--news-hero .ifkdb-pwa-button--primary:focus-visible {
    background: #edf3fb;
    color: #102f68;
}

/* Dagens Blåvita: one native-looking action in the existing heading row. */
#dbq-app .ifkdb-pwa-push-host--daily-compact {
    display: inline-flex;
    margin: 0;
}

#dbq-app .ifkdb-pwa-daily-action {
    appearance: none;
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    gap: .42rem;
    margin: 0;
    padding: .5rem .72rem;
    border: 1px solid var(--dbq-line);
    border-radius: .65rem;
    background: rgba(8, 30, 67, .54);
    color: var(--dbq-text-soft);
    font: inherit;
    font-size: .78rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

#dbq-app .ifkdb-pwa-daily-action:hover,
#dbq-app .ifkdb-pwa-daily-action:focus-visible,
#dbq-app .ifkdb-pwa-daily-action.is-active {
    border-color: rgba(247, 197, 72, .42);
    color: var(--dbq-white);
}

#dbq-app .ifkdb-pwa-daily-action__icon {
    display: inline-flex;
    width: .95rem;
    height: .95rem;
    align-items: center;
    justify-content: center;
    color: var(--dbq-gold);
}

#dbq-app .ifkdb-pwa-daily-action__icon svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* Installed app: notifications move into a fourth bottom-nav settings control. */
html.ifkdb-pwa-standalone .ifkdb-pwa-app-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ifkdb-pwa-app-nav__settings {
    appearance: none;
    display: flex;
    min-width: 0;
    min-height: 3.4rem;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: .45rem .3rem;
    border: 0;
    border-left: 1px solid rgba(18, 54, 96, .09);
    background: transparent;
    color: #5e6e82;
    font: inherit;
    cursor: pointer;
}

.ifkdb-pwa-app-nav__settings:hover,
.ifkdb-pwa-app-nav__settings:focus-visible {
    background: #edf3fb;
    color: #1d4289;
}

.ifkdb-pwa-app-nav__settings svg {
    display: block;
    width: 1.18rem;
    height: 1.18rem;
    fill: currentColor;
}

@media (max-width: 46rem) {
    .ifk-news-archive__hero .ifk-news-archive__hero-top {
        flex-wrap: wrap;
        gap: .42rem .65rem;
    }

    .ifkdb-pwa-push-host--news-hero {
        width: 100%;
        margin-left: 0;
    }

    .ifkdb-pwa-prompt--news-hero {
        position: relative;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: .5rem;
        width: 100%;
        padding: .55rem 2rem .55rem .65rem;
        border: 1px solid rgba(255, 255, 255, .16);
        border-radius: .72rem;
        background: rgba(5, 25, 58, .48);
        box-shadow: none;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .ifkdb-pwa-prompt--news-hero .ifkdb-pwa-prompt__copy {
        display: block;
        color: #fff;
    }

    .ifkdb-pwa-prompt--news-hero .ifkdb-pwa-prompt__copy strong {
        margin: 0 0 .08rem;
        color: #fff;
        font-size: .72rem;
    }

    .ifkdb-pwa-prompt--news-hero .ifkdb-pwa-prompt__copy span {
        color: rgba(255, 255, 255, .72);
        font-size: .61rem;
        line-height: 1.25;
    }

    .ifkdb-pwa-prompt--news-hero .ifkdb-pwa-prompt__actions {
        width: auto;
        gap: .3rem;
    }

    .ifkdb-pwa-prompt--news-hero .ifkdb-pwa-prompt__actions .ifkdb-pwa-button {
        flex: 0 0 auto;
        min-height: 2rem;
        padding: .36rem .48rem;
        font-size: .61rem;
    }

    .ifkdb-pwa-prompt--news-hero .ifkdb-pwa-prompt__dismiss {
        position: absolute;
        top: .16rem;
        right: .18rem;
        display: grid;
        width: 1.6rem;
        height: 1.6rem;
        place-items: center;
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent;
        color: rgba(255, 255, 255, .62);
        font: inherit;
        font-size: 1rem;
        line-height: 1;
        cursor: pointer;
    }
}

@media (max-width: 640px) {
    #dbq-app .ifkdb-pwa-daily-action {
        width: 2.35rem;
        min-width: 2.35rem;
        min-height: 2.35rem;
        padding: 0;
    }

    #dbq-app .ifkdb-pwa-daily-action__label {
        display: none;
    }

    #dbq-app .ifkdb-pwa-daily-action__icon {
        width: .9rem;
        height: .9rem;
    }
}

@media (max-width: 27rem) {
    .ifkdb-pwa-prompt--news-hero {
        grid-template-columns: 1fr;
        padding-right: 2rem;
    }

    .ifkdb-pwa-prompt--news-hero .ifkdb-pwa-prompt__actions {
        width: 100%;
    }

    .ifkdb-pwa-prompt--news-hero .ifkdb-pwa-prompt__actions .ifkdb-pwa-button {
        flex: 1 1 0;
    }
}


/* Nyheter mobile: keep PWA discovery outside the hero and outside document flow. */
.ifkdb-pwa-push-host--news-floating {
    display: none;
}

@media (max-width: 46rem) {
    .ifkdb-pwa-push-host--news-hero {
        display: none !important;
    }

    .ifkdb-pwa-push-host--news-floating:not([hidden]) {
        position: fixed;
        right: max(.72rem, env(safe-area-inset-right));
        bottom: max(.78rem, env(safe-area-inset-bottom));
        z-index: 10020;
        display: block;
        width: auto;
        max-width: calc(100vw - 1.44rem);
        margin: 0;
        pointer-events: none;
    }

    .ifkdb-pwa-prompt--news-floating {
        position: relative;
        display: flex;
        align-items: center;
        gap: .28rem;
        margin: 0;
        padding: .28rem 1.68rem .28rem .3rem;
        border: 1px solid rgba(16, 47, 104, .16);
        border-radius: 999px;
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 .48rem 1.35rem rgba(10, 31, 63, .18);
        color: #163b78;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        pointer-events: auto;
    }

    .ifkdb-pwa-prompt--news-floating .ifkdb-pwa-prompt__copy {
        display: none;
    }

    .ifkdb-pwa-prompt--news-floating .ifkdb-pwa-prompt__actions {
        display: flex;
        width: auto;
        gap: .22rem;
    }

    .ifkdb-pwa-prompt--news-floating .ifkdb-pwa-button {
        min-height: 2rem;
        margin: 0;
        padding: .36rem .56rem;
        border: 0;
        border-radius: 999px;
        background: transparent;
        color: #1d4289;
        font-size: .67rem;
        font-weight: 850;
        line-height: 1;
        box-shadow: none;
    }

    .ifkdb-pwa-prompt--news-floating .ifkdb-pwa-button:hover,
    .ifkdb-pwa-prompt--news-floating .ifkdb-pwa-button:focus-visible {
        background: #edf3fb;
        color: #173c7e;
    }

    .ifkdb-pwa-prompt--news-floating .ifkdb-pwa-button--primary {
        background: #1d4289;
        color: #fff;
    }

    .ifkdb-pwa-prompt--news-floating .ifkdb-pwa-button--primary:hover,
    .ifkdb-pwa-prompt--news-floating .ifkdb-pwa-button--primary:focus-visible {
        background: #173a78;
        color: #fff;
    }

    .ifkdb-pwa-prompt--news-floating .ifkdb-pwa-prompt__dismiss {
        position: absolute;
        top: 50%;
        right: .26rem;
        display: grid;
        width: 1.34rem;
        height: 1.34rem;
        place-items: center;
        margin: 0;
        padding: 0;
        transform: translateY(-50%);
        border: 0;
        border-radius: 50%;
        background: transparent;
        color: #8492a4;
        font: inherit;
        font-size: .9rem;
        line-height: 1;
        cursor: pointer;
    }

    .ifkdb-pwa-prompt--news-floating .ifkdb-pwa-prompt__dismiss:hover,
    .ifkdb-pwa-prompt--news-floating .ifkdb-pwa-prompt__dismiss:focus-visible {
        background: #edf1f6;
        color: #42546b;
    }
}
