.himles-app {
    max-width: 680px;
    margin: 0 auto;
    padding: 14px 14px 28px;
}

.himles-app__hero {
    margin-bottom: 16px;
}

.himles-app__hero--compact {
    margin-bottom: 10px;
}

.himles-app__eyebrow {
    margin: 0 0 4px;
    font-size: 0.82rem;
    opacity: 0.72;
}

.himles-app__hero h1 {
    margin: 0;
    font-size: clamp(1.55rem, 5vw, 2.2rem);
}

.himles-status-strip {
    margin: 0 0 10px;
}

.himles-status-strip > :first-child {
    margin-top: 0;
}

.himles-status-strip > :last-child {
    margin-bottom: 0;
}

.himles-info-latest {
    margin: 0 0 10px;
    padding: 12px 13px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 14px;
    background: #fff;
}

.himles-info-latest--important {
    border-width: 2px;
}

.himles-info-latest__meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
    font-size: 0.78rem;
    opacity: 0.78;
}

.himles-info-latest h2 {
    margin: 0 0 5px;
    font-size: 1rem;
    line-height: 1.25;
}

.himles-info-latest__preview {
    display: -webkit-box;
    margin: 0 0 7px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    font-size: 0.9rem;
    line-height: 1.35;
}

.himles-info-latest__details > summary,
.himles-info-history > summary {
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 700;
}

.himles-info-latest__full {
    padding-top: 10px;
    font-size: 0.92rem;
}

.himles-info-latest__full > :first-child {
    margin-top: 0;
}

.himles-info-latest__full > :last-child {
    margin-bottom: 0;
}

.himles-info-history {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.himles-info-history__list {
    display: grid;
    gap: 7px;
    margin-top: 9px;
}

.himles-info-history__item {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.018);
}

.himles-info-history__item > summary {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px;
    cursor: pointer;
    list-style: none;
    font-size: 0.86rem;
}

.himles-info-history__item > summary::-webkit-details-marker {
    display: none;
}

.himles-info-history__item > summary small {
    flex: 0 0 auto;
    opacity: 0.65;
    font-size: 0.72rem;
}

.himles-info-history__content {
    padding: 0 10px 10px;
    font-size: 0.88rem;
}

.himles-info-history__content > :first-child {
    margin-top: 0;
}

.himles-info-history__content > :last-child {
    margin-bottom: 0;
}

.himles-hallkode {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
    padding: 10px 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 14px;
    background: #fff;
}

.himles-hallkode__label {
    font-size: 0.86rem;
    font-weight: 650;
    opacity: 0.74;
}

.himles-hallkode__code {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.06em;
    overflow-wrap: anywhere;
}

.himles-app__actions {
    display: grid;
    gap: 10px;
}

.himles-app__actions--grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.himles-app__button {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 72px;
    padding: 12px 13px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 16px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
}

.himles-app__button:hover,
.himles-app__button:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.08);
}

.himles-app__button--primary {
    border-width: 2px;
}

.himles-app__icon {
    flex: 0 0 auto;
    font-size: 1.45rem;
    line-height: 1;
}

.himles-app__button span:last-child {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.himles-app__button strong {
    font-size: 0.98rem;
}

.himles-app__button small {
    opacity: 0.68;
    font-size: 0.78rem;
    line-height: 1.2;
}

.himles-calendar {
    max-width: 960px;
    margin: 0 auto;
    padding: 12px 0 32px;
}

.himles-calendar__privacy {
    margin: 0 0 12px;
    font-size: 0.95rem;
}

.himles-calendar__frame {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #fff;
}

.himles-calendar__frame iframe {
    display: block;
    width: 100%;
    min-height: 620px;
    border: 0;
}

@media (max-width: 349px) {
    .himles-app__actions--grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .himles-calendar__frame iframe {
        min-height: 560px;
    }
}

.himles-access-message {
    max-width: 680px;
    margin: 18px auto;
    padding: 16px;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 14px;
    background: #fff;
}

.himles-access-message strong {
    display: block;
    margin-bottom: 5px;
    font-size: 1.05rem;
}

.himles-access-message p {
    margin: 0 0 12px;
}

.himles-access-message__button {
    display: inline-block;
    padding: 9px 14px;
    border: 1px solid currentColor;
    border-radius: 10px;
    color: inherit;
    font-weight: 700;
    text-decoration: none;
}

/* App-sidene skal se ut som en app, ikke som en vanlig WordPress-side. */
body.himles-app-page .wp-block-post-title,
body.himles-app-page .wp-site-blocks > header,
body.himles-app-page header.wp-block-template-part,
body.himles-app-page .wp-site-blocks > footer,
body.himles-app-page footer.wp-block-template-part {
    display: none !important;
}

body.himles-app-page .wp-site-blocks,
body.himles-app-page main,
body.himles-app-page .wp-block-post-content {
    margin-block-start: 0 !important;
    padding-top: 0 !important;
}

body.himles-app-page .himles-app {
    width: min(100%, 680px);
    box-sizing: border-box;
}

/* Mobilopprydding på app-sidene. */
body.himles-app-page .wp-block-avatar,
body.himles-app-page .wp-block-user-avatar,
body.himles-app-page .wp-block-loginout {
    display: none !important;
}

@media (max-width: 700px) {
    body.himles-app-page .himles-app {
        padding-top: 8px;
    }

    body.himles-app-page .himles-app__hero--compact {
        margin-bottom: 8px;
    }

    body.himles-app-page .himles-status-strip {
        margin-bottom: 10px;
    }

    body.himles-app-page .himles-status-strip .status-mini {
        border-radius: 14px;
        overflow: hidden;
    }

    body.himles-app-page .himles-status-strip .status-mini-del {
        min-height: 36px;
        padding: 6px 9px;
        line-height: 1.2;
    }

    body.himles-app-page .himles-status-strip .status-mini-ikon {
        width: 22px;
        height: 22px;
    }

    body.himles-app-page .himles-status-strip .status-mini-prikk {
        width: 10px;
        min-width: 10px;
        height: 10px;
    }

    body.himles-app-page .himles-status-strip .status-mini-lenke {
        min-height: 34px;
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Vises bare når statussiden er åpnet fra Himles-appen. */
.himles-back-to-app {
    position: fixed;
    right: 14px;
    left: auto;
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 99999;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 9px 14px;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 999px;
    background: #fff;
    color: #222;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
}

.himles-back-to-app:hover,
.himles-back-to-app:focus-visible {
    color: #222;
    text-decoration: none;
}

/* Statusside åpnet fra appen: fjern vanlig nettside-footer. */
body.himles-status-from-app footer.wp-block-template-part,
body.himles-status-from-app .wp-site-blocks > footer {
    display: none !important;
}

/* Statusside åpnet fra appen: eldre temaheader hvis den finnes. */
body.himles-status-from-app .wp-site-blocks > header,
body.himles-status-from-app header.wp-block-template-part {
    display: none !important;
}

body.himles-status-from-app .wp-site-blocks,
body.himles-status-from-app main {
    margin-block-start: 0 !important;
}

/* Den synlige mobilheaderen på statussiden er en egen wrapper utenfor WordPress-treet. */
body.himles-status-from-app > div.h-16 {
    display: none !important;
}

/* La hele parkeringskartet kunne scrolles forbi den faste tilbakeknappen. */
body.himles-status-from-app main#wp--skip-link--target {
    padding-bottom: 180px !important;
}

/* Robust fallback for klassisk statusmal: tilbakeknappen finnes bare ved åpning fra appen. */
body.page-id-1900:has(.himles-back-to-app) header#masthead.site-header,
body.page-id-1900:has(.himles-back-to-app) footer#colophon.site-footer {
    display: none !important;
}

body.page-id-1900:has(.himles-back-to-app) #content.site-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.page-id-1900:has(.himles-back-to-app) #main.site-main,
body.page-id-1900:has(.himles-back-to-app) .entry-content {
    padding-bottom: calc(200px + env(safe-area-inset-bottom)) !important;
}

/* Navigasjon tilbake til appforsiden på alle app-undersider. */
.himles-app-home-nav {
    width: min(100% - 28px, 680px);
    margin: 10px auto 6px;
}

.himles-app-home-link {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 7px 11px;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.himles-app-home-link:hover,
.himles-app-home-link:focus-visible {
    color: inherit;
    text-decoration: none;
    transform: translateY(-1px);
}
