/* ==========================================================================
   Montørappen på mobil (/app/...). Felles stil for alle sidene i appen,
   bygget på portalens farger (--itlock-*). Klassene starter med "ma-".
   ========================================================================== */
.ma {
    --ma-rod: #b4372b;
    --ma-bla: #2f5f8a;
    --ma-gronn: #2f7a3a;
    --ma-gul: #a3620c;
    --ma-lilla: #6a4c9c;
    --ma-flate2: color-mix(in srgb, var(--itlock-ink-muted) 7%, var(--itlock-surface));
    max-width: 640px;
    margin: -0.25rem auto 0;
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 5rem);
    color: var(--itlock-ink);
}

.ma .icon { width: 1.2rem; height: 1.2rem; flex: none; }

/* Toppfelt: tilbake, ikon, tittel og handlinger til høyre */
.ma-hode {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--itlock-surface);
    border: 1px solid var(--itlock-border);
    border-radius: 18px 18px 0 0;
    padding: 0.4rem 0.4rem 0.4rem 0.2rem;
    min-height: 3.9rem;
}

.ma-hode-ikon { width: 2.2rem; display: inline-flex; justify-content: center; color: var(--itlock-accent); flex: none; }
.ma-hode-ikon .icon { width: 1.6rem; height: 1.6rem; }

.ma-hode-tekst { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.ma-hode-tekst b { font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ma-hode-tekst small { color: var(--itlock-ink-muted); font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ma-ikonknapp {
    width: 2.9rem;
    height: 2.9rem;
    flex: none;
    border: 0;
    border-radius: 12px;
    background: none;
    color: var(--itlock-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
}

    .ma-ikonknapp .icon { width: 1.5rem; height: 1.5rem; }
    .ma-ikonknapp:active { background: var(--ma-flate2); }

.ma-skille { width: 1px; align-self: stretch; background: var(--itlock-border); margin: 0.3rem 0; }

/* Filterlinje: trakt + valg med etikett over */
.ma-filter {
    display: flex;
    align-items: stretch;
    background: var(--itlock-surface);
    border: 1px solid var(--itlock-border);
    border-top: 0;
}

.ma-trakt { width: 3rem; display: flex; align-items: center; justify-content: center; color: var(--itlock-ink-muted); flex: none; }

.ma-filter label {
    border-left: 1px solid var(--itlock-border);
    padding: 0.35rem 0.6rem 0.45rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

    .ma-filter label span { font-size: 0.72rem; color: var(--itlock-ink-muted); font-style: italic; }

    .ma-filter select,
    .ma-filter input {
        border: 0;
        background: transparent;
        font: inherit;
        font-size: 0.95rem;
        color: var(--itlock-ink);
        padding: 0.1rem 0;
        width: 100%;
        min-width: 0;
    }

/* Søk med visning (mine / alle) */
.ma-sok {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    padding: 0.55rem 0.6rem;
    background: var(--itlock-surface);
    border: 1px solid var(--itlock-border);
    border-top: 0;
}

    .ma-sok input {
        flex: 1;
        min-width: 0;
        font: inherit;
        padding: 0.65rem 0.75rem;
        border: 1px solid var(--itlock-border);
        border-radius: 10px;
        background: var(--ma-flate2);
        color: var(--itlock-ink);
    }

.ma-modus {
    width: 2.8rem;
    height: 2.7rem;
    border-radius: 10px;
    border: 1px solid var(--itlock-border);
    background: var(--itlock-surface);
    color: var(--itlock-ink-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .ma-modus.aktiv { background: color-mix(in srgb, var(--itlock-accent) 12%, var(--itlock-surface)); border-color: var(--itlock-accent); color: var(--itlock-accent); }

/* Liste */
.ma-liste {
    flex: 1;
    background: var(--itlock-surface);
    border: 1px solid var(--itlock-border);
    border-top: 0;
    border-radius: 0 0 18px 18px;
    overflow: hidden;
}

.ma-gruppe {
    padding: 0.45rem 0.85rem;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--itlock-ink-muted);
    background: var(--itlock-bg);
    border-bottom: 1px solid var(--itlock-border);
}

.ma-kort {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 0.75rem 0.8rem 0.9rem;
    border-bottom: 1px solid var(--itlock-border);
    color: var(--itlock-ink);
    text-decoration: none;
    background: var(--itlock-surface);
    cursor: pointer;
}

    .ma-kort:last-child { border-bottom: 0; }
    .ma-kort:active { background: var(--ma-flate2); }
    .ma-kort.aktiv { background: color-mix(in srgb, var(--itlock-accent) 9%, var(--itlock-surface)); }
    .ma-kort.innrykk { padding-left: 2rem; background: var(--ma-flate2); }

.ma-kort-tekst { flex: 1; min-width: 0; display: grid; gap: 0.1rem; }

    .ma-kort-tekst h3 { margin: 0 0 0.15rem; font-size: 1.02rem; font-weight: 750; }
    .ma-kort-tekst h3 em { font-style: normal; font-weight: 500; color: var(--itlock-ink-muted); font-size: 0.82rem; margin-left: 0.3rem; }

.ma-linje { display: flex; align-items: center; gap: 0.55rem; font-size: 0.92rem; min-width: 0; }
    .ma-linje .icon { width: 1.15rem; height: 1.15rem; color: var(--itlock-ink-muted); }
    .ma-linje span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ma-linje.dempet { color: var(--itlock-ink-muted); }

.ma-prikk { width: 0.7rem; height: 0.7rem; border-radius: 50%; flex: none; display: inline-block; }
.ma-prikk-ny { background: #f0a030; }
.ma-prikk-klar { background: #9aa3ab; }
.ma-prikk-pagaende { background: #4a9be0; }
.ma-prikk-ferdig { background: #3aa655; }

.ma-info {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 0;
    background: var(--ma-bla);
    color: #fff;
    font: 800 1.15rem Georgia, serif;
    flex: none;
    cursor: pointer;
}

.ma-pilknapp {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 10px;
    background: var(--ma-flate2);
    border: 1px solid var(--itlock-border);
    color: var(--itlock-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.ma-boks {
    min-width: 2.4rem;
    height: 1.9rem;
    padding: 0 0.4rem;
    border: 1.5px solid var(--itlock-ink);
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    flex: none;
}

    .ma-boks.gronn { border-color: var(--ma-gronn); color: var(--ma-gronn); }
    .ma-boks.gul { border-color: var(--ma-gul); color: var(--ma-gul); }

.ma-bunnlinje {
    text-align: center;
    padding: 0.6rem;
    font-weight: 650;
    font-size: 0.92rem;
    color: var(--itlock-ink-muted);
}

.ma-tom { padding: 1.6rem 1rem; text-align: center; color: var(--itlock-ink-muted); }

/* Meny-rader (ordremeny, prosjekt) og timetyper */
.ma-rad {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 0.9rem;
    border-bottom: 1px solid var(--itlock-border);
    color: var(--itlock-ink);
    text-decoration: none;
    background: var(--itlock-surface);
    width: 100%;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

    .ma-rad:last-child { border-bottom: 0; }
    .ma-rad:active { background: var(--ma-flate2); }
    .ma-rad > .icon:first-child { width: 1.55rem; height: 1.55rem; color: var(--itlock-ink-muted); }
    .ma-rad-tekst { flex: 1; min-width: 0; display: grid; }
    .ma-rad-tekst b { font-weight: 600; font-size: 1.04rem; }
    .ma-rad-tekst small { color: var(--itlock-ink-muted); font-size: 0.84rem; }
    .ma-rad .ma-pil { color: var(--itlock-ink-muted); }

/* Skjema */
.ma-felt {
    background: var(--ma-flate2);
    padding: 0.6rem 0.75rem 0.85rem;
    border-bottom: 1px solid var(--itlock-border);
}

    .ma-felt > b { display: block; font-size: 0.98rem; margin-bottom: 0.45rem; }

    .ma-felt select,
    .ma-felt textarea,
    .ma-felt input[type=text],
    .ma-felt input[type=date] {
        width: 100%;
        font: inherit;
        padding: 0.75rem 0.7rem;
        border: 1px solid var(--itlock-border);
        border-radius: 10px;
        background: var(--itlock-surface);
        color: var(--itlock-ink);
    }

.ma-felt-rad { display: flex; align-items: center; gap: 0.6rem; }
    .ma-felt-rad > b { margin: 0; width: 4.2rem; flex: none; }

.ma-teller-tekst { text-align: right; font-size: 0.78rem; color: var(--itlock-ink-muted); font-style: italic; margin-top: 0.2rem; }

.ma-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--itlock-border);
    border-radius: 10px;
    background: var(--itlock-surface);
    height: 3.1rem;
}

    .ma-stepper button { width: 2.8rem; height: 100%; border: 0; background: none; font-size: 1.5rem; color: var(--itlock-ink); cursor: pointer; }
    .ma-stepper span { min-width: 3.4rem; text-align: center; font-size: 1.02rem; font-variant-numeric: tabular-nums; }

.ma-hurtig {
    height: 3.1rem;
    min-width: 3rem;
    border-radius: 10px;
    border: 0;
    background: color-mix(in srgb, var(--itlock-accent) 12%, var(--itlock-surface));
    color: var(--itlock-accent);
    font: inherit;
    font-size: 1.02rem;
    font-weight: 700;
    margin-left: 0.4rem;
    cursor: pointer;
}

.ma-knapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 3.1rem;
    border-radius: 14px;
    border: 0;
    background: var(--itlock-accent);
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

    .ma-knapp.sek { background: var(--itlock-surface); color: var(--itlock-ink); border: 1px solid var(--itlock-border); }
    .ma-knapp.rod { background: var(--ma-rod); }
    .ma-knapp:disabled { opacity: 0.6; }

.ma-feil { color: var(--ma-rod); font-size: 0.88rem; margin: 0.5rem 0.2rem 0; }

/* Faner (Timer / Detaljer / Sum) */
.ma-faner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--itlock-surface);
    border: 1px solid var(--itlock-border);
    border-top: 0;
}

    .ma-faner button { border: 0; background: none; font: inherit; padding: 0.7rem 0.3rem; color: var(--itlock-ink); border-bottom: 3px solid transparent; cursor: pointer; }
    .ma-faner button.aktiv { color: var(--itlock-accent); border-bottom-color: var(--itlock-accent); background: var(--ma-flate2); font-weight: 650; }

.ma-sum {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 0.9rem;
    font-weight: 700;
    border-bottom: 1px solid var(--itlock-border);
    background: var(--itlock-surface);
}

    .ma-sum span:first-child { display: flex; align-items: center; gap: 0.45rem; }

.ma-dag {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 0.9rem;
    border-bottom: 1px solid var(--itlock-border);
    background: var(--itlock-surface);
    cursor: pointer;
    width: 100%;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    font: inherit;
    color: var(--itlock-ink);
    text-align: left;
}

    .ma-dag .ma-snu { transition: transform 0.15s; color: var(--itlock-ink-muted); display: inline-flex; }
    .ma-dag.apen .ma-snu { transform: rotate(90deg); }
    .ma-dag-navn { flex: 1; color: var(--itlock-ink-muted); }

.ma-fremdrift { height: 6px; background: var(--ma-flate2); border-radius: 3px; overflow: hidden; margin-top: 0.4rem; }
    .ma-fremdrift i { display: block; height: 100%; background: var(--ma-gronn); border-radius: 3px; }

.ma-hake {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 9px;
    border: 2px solid var(--itlock-border);
    background: var(--itlock-surface);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    cursor: pointer;
}

    .ma-hake.paa { background: var(--ma-gronn); border-color: var(--ma-gronn); }

.ma-merke { display: inline-flex; align-items: center; font-size: 0.74rem; font-weight: 700; padding: 0.15rem 0.6rem; border-radius: 99px; white-space: nowrap; }
.ma-merke.gronn { background: color-mix(in srgb, var(--ma-gronn) 13%, var(--itlock-surface)); color: var(--ma-gronn); }
.ma-merke.gul { background: color-mix(in srgb, #c98a1e 16%, var(--itlock-surface)); color: var(--ma-gul); }
.ma-merke.rod { background: color-mix(in srgb, var(--ma-rod) 12%, var(--itlock-surface)); color: var(--ma-rod); }
.ma-merke.gra { background: var(--ma-flate2); color: var(--itlock-ink-muted); }

/* Ark nedenfra (info, ny søknad) */
.ma-ark-bak { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 1000; display: flex; align-items: flex-end; justify-content: center; }
.ma-ark {
    background: var(--itlock-surface);
    width: 100%;
    max-width: 640px;
    border-radius: 22px 22px 0 0;
    padding: 0.6rem 1rem calc(1.4rem + env(safe-area-inset-bottom, 0px));
    max-height: 90dvh;
    overflow-y: auto;
}

    .ma-ark h2 { font-size: 1.2rem; margin: 0.3rem 0 0.8rem; }
    .ma-ark-handtak { width: 2.6rem; height: 0.3rem; border-radius: 3px; background: var(--itlock-border); margin: 0.1rem auto 0.6rem; }
    .ma-ark .ma-felt { background: none; padding: 0 0 0.75rem; border: 0; }

.ma-melding {
    margin: 0.6rem 0 0;
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    font-size: 0.9rem;
    background: color-mix(in srgb, var(--ma-gronn) 12%, var(--itlock-surface));
    color: var(--ma-gronn);
}

.ma-under { padding: 0.8rem 0.2rem 0; display: grid; gap: 0.5rem; }

.ma-status-gronn { color: var(--ma-gronn); }
.ma-status-gul { color: var(--ma-gul); }
.ma-status-rod { color: var(--ma-rod); }
.ma-kort-tekst h3 { display: flex; align-items: center; }
.ma-kort-tekst h3 .icon { width: 1.25rem; height: 1.25rem; }

/* Fargene trengs også utenfor .ma (personmenyen på Hjem og i kalenderen). */
.mh, .mk, .ma-ark-bak {
    --ma-rod: #b4372b;
    --ma-bla: #2f5f8a;
    --ma-gronn: #2f7a3a;
    --ma-gul: #a3620c;
    --ma-flate2: color-mix(in srgb, var(--itlock-ink-muted) 7%, var(--itlock-surface));
}

/* Personknappen (AppMeny) */
.ma-person {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    background: color-mix(in srgb, var(--itlock-accent) 12%, #fff);
    color: var(--itlock-accent);
    font: inherit;
    font-weight: 800;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    cursor: pointer;
}

    .ma-person.stor { width: 3rem; height: 3rem; border-color: var(--itlock-border); cursor: default; margin-right: 0.3rem; }
    .ma-person.mork { border-color: var(--itlock-border); }

.ma-ark .ma-rad { width: 100%; font: inherit; color: var(--itlock-ink); text-align: left; background: var(--itlock-surface); border-left: 0; border-right: 0; border-top: 0; }
.ma-ark form.ma-under { padding: 0.8rem 0 0; }

/* ---------- Appen på mobil: helt hvit flate kant til kant ----------
   Portalens toppfelt skjules (personknappen på Hjem har menyen), og siden
   kan ikke dras til siden eller sprette når man drar forbi toppen. */
@media (max-width: 640.98px) {
    html:has(.ma, .mh, .mk, .mp),
    html:has(.ma, .mh, .mk, .mp) body,
    html:has(.ma, .mh, .mk, .mp) .page,
    html:has(.ma, .mh, .mk, .mp) main {
        background: var(--itlock-surface) !important;
        background-image: none !important;
        overscroll-behavior: none;
        overflow-x: hidden;
        max-width: 100vw;
    }

    html:has(.ma, .mh, .mk, .mp) body { touch-action: pan-y; }

    main:has(.ma, .mh, .mk, .mp) > .top-row { display: none !important; }

    main:has(.ma, .mh, .mk, .mp) > .content {
        padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px) !important;
        background: var(--itlock-surface) !important;
        margin: 0 !important;
    }

    .ma { margin: 0; max-width: none; min-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }

    .ma-hode, .ma-filter, .ma-sok, .ma-liste, .ma-faner, .ma-sum, .ma-felt {
        border-left: 0 !important;
        border-right: 0 !important;
        border-radius: 0 !important;
    }

    .ma-hode { border-top: 0; }
    .ma-liste { flex: 1; }
    .ma-bunnlinje { border-top: 1px solid var(--itlock-border); background: var(--itlock-surface); }
    .ma-under { padding: 0.8rem 0.9rem 1rem; }
    .ma-melding { margin: 0.6rem 0.9rem !important; }
}

/* Fullversjon på mobil: tilbake- og hjem-knappene skyver avataren mot
   midten, så tittelen legges til høyre i stedet for oppå avataren. */
@media (max-width: 640.98px) {
    .top-row:has(.mobil-tilbake-knapp) .mobil-topptittel {
        left: auto !important;
        right: 0.9rem;
        transform: translateY(-50%) !important;
        text-align: right;
        max-width: 34% !important;
    }
}

/* Mobilvisning bruker telefonens vanlige skrift overalt, ikke portalens
   Fraunces. Velger med flere elementer enn regelen i app.css, så den vinner
   uten å endre PC og fullversjon (som tegnes med PC-bredde). */
@media (max-width: 640.98px) {
    html body,
    html body *:not(code):not(pre):not(kbd):not(samp):not(svg):not(svg *) {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif !important;
    }
}

/* Kart i montørappen (/app/kart): kartet fyller resten av skjermen. */
.mkt { height: 100dvh; min-height: 0; }
.mkt-tall { flex: 1; text-align: right; color: var(--itlock-ink-muted); font-size: 0.85rem; padding-right: 0.3rem; }
.mkt-kart { position: relative; flex: 1; min-height: 300px; border-top: 1px solid var(--itlock-border); }
.mkt-flate { position: absolute; inset: 0; z-index: 0; }
.mkt-knapper { position: absolute; right: 0.7rem; top: 0.7rem; display: grid; gap: 0.4rem; z-index: 500; }

    .mkt-knapper button {
        width: 2.7rem;
        height: 2.7rem;
        border-radius: 12px;
        border: 1px solid var(--itlock-border);
        background: var(--itlock-surface);
        color: var(--itlock-ink);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
        cursor: pointer;
    }

.mkt-legende {
    position: absolute;
    left: 0.7rem;
    bottom: calc(0.7rem + env(safe-area-inset-bottom, 0px));
    z-index: 500;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--itlock-border);
    border-radius: 12px;
    padding: 0.4rem 0.65rem;
    font-size: 0.78rem;
    display: flex;
    gap: 0.7rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

    .mkt-legende span { display: inline-flex; align-items: center; gap: 0.3rem; }

/* Strekkodeskanner på Produkter (/app/ordre/{id}/produkter). */
.mpk-video { position: relative; border-radius: 16px; overflow: hidden; background: #111; aspect-ratio: 4 / 3; }
.mpk-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mpk-laser { position: absolute; left: 12%; right: 12%; height: 2px; background: #ff4b3e; box-shadow: 0 0 10px #ff4b3e; animation: mpk-laser 1.6s ease-in-out infinite alternate; }
@keyframes mpk-laser { from { top: 20%; } to { top: 80%; } }

/* Sandfarget toppfelt (ordrelista og ordren), som forsiden. */
.ma-hode.sand {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, #ead7c2 0%, #f4e6d6 100%);
    border-color: transparent;
    color: #3b2717;
}

    .ma-hode.sand::after {
        content: "";
        position: absolute;
        right: -80px;
        top: -90px;
        width: 220px;
        height: 220px;
        border-radius: 50%;
        border: 22px solid rgba(163, 106, 62, 0.07);
        box-shadow: 0 0 0 32px rgba(163, 106, 62, 0.04);
        pointer-events: none;
    }

    .ma-hode.sand > * { position: relative; z-index: 1; }
    .ma-hode.sand .ma-hode-ikon { color: #86532c; }
    .ma-hode.sand .ma-hode-tekst small { color: #7d6250; }
    .ma-hode.sand .ma-skille { background: rgba(163, 106, 62, 0.25); }
    .ma-hode.sand .ma-ikonknapp { color: #3b2717; }

.ma-brune-ikoner .ma-rad > .icon:first-child { color: #a36a3e; }

/* Søknader: ferie med ring (som fraværssiden i portalen). */
.msk-ferie { display: flex; align-items: center; gap: 1rem; padding: 0.4rem 1rem 1rem; }
.msk-ferie ul { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; gap: 0.6rem; }
.msk-ferie li { display: flex; align-items: center; gap: 0.5rem; }
.msk-ferie li span { flex: 1; }
.msk-ferie li i { width: 0.65rem; height: 0.65rem; border-radius: 50%; flex: none; }
.msk-gronn { background: #2b7a4b; }
.msk-gul { background: #d9a520; }
.msk-gra { background: #c7c2b6; }
.msk-ring { width: 6rem; height: 6rem; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; }
.msk-ring > span { width: 4.3rem; height: 4.3rem; border-radius: 50%; background: var(--itlock-surface); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.msk-ring b { font-size: 1.3rem; }
.msk-ring small { font-size: 0.7rem; color: var(--itlock-ink-muted); }
.ma-gruppe .icon { width: 0.95rem; height: 0.95rem; vertical-align: -2px; }

/* Ordredetaljer i appen */
.mod-status { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.9rem 1rem 0.3rem; }
.mod-rutenett { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--itlock-border); }
.mod-rutenett div { padding: 0.65rem 1rem; border-top: 1px solid var(--itlock-border); display: grid; }
.mod-rutenett div:nth-child(odd) { border-right: 1px solid var(--itlock-border); }
.mod-rutenett small { color: var(--itlock-ink-muted); font-size: 0.78rem; }
.mod-rutenett b { font-size: 0.98rem; }
.mod-tekst { padding: 0.6rem 1rem 1rem; white-space: pre-line; font-size: 0.95rem; line-height: 1.5; }
.mod-merknad { margin: 0 1rem 0.9rem; padding: 0.65rem 0.8rem; border-radius: 12px; background: #fdf1dc; color: #7a5414; display: flex; gap: 0.55rem; font-size: 0.9rem; }
.mod-merknad .icon { flex: none; margin-top: 2px; }
.mod-merknad b { display: block; }
.mod-merknad span { white-space: pre-line; }
.mod-merknad.mod-bla { background: #e8f0f8; color: #2f5f8a; }
.mpk-video > div { width: 100%; height: 100%; }
.mpk-video > div video { width: 100% !important; height: 100% !important; object-fit: cover; }

/* Skjema: avhaking som på PC */
.msj-rad { width: 100%; font: inherit; color: inherit; text-align: left; background: var(--itlock-surface); border: 0; border-bottom: 1px solid var(--itlock-border); min-height: 4rem; cursor: pointer; }
.msj-rad:disabled { cursor: default; }

/* Vedlegg */
.mvl-knapper { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; padding: 0.75rem 1rem; }
.mvl-knapper label { position: relative; overflow: hidden; }
.mvl-fil { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.mvl-rutenett { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.35rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--itlock-border); }
.mvl-rutenett img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; background: var(--ma-flate2); }


/* Info-arket på ordrelista («i») */
.moi { display: flex; flex-direction: column; max-height: 92dvh; }
.moi-under { margin: 0 0 0.6rem; color: var(--itlock-ink-muted); font-size: 0.88rem; }
.moi-innhold { overflow-y: auto; margin: 0 -1rem; border-top: 1px solid var(--itlock-border); }
.moi-innhold section { padding: 0.75rem 1rem 0.85rem; border-bottom: 1px solid var(--itlock-border); }
.moi-innhold h3 { margin: 0 0 0.45rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--itlock-ink-muted); }
.moi-linje { display: flex; align-items: center; gap: 0.5rem; padding: 0.2rem 0; }
.moi-linje > span { color: var(--itlock-ink-muted); min-width: 7.3rem; flex: none; }
.moi-linje > b { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.moi-knapp { width: 2.6rem; height: 2.6rem; border-radius: 12px; background: #f8efe5; color: #86532c; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.moi-tekst { margin: 0; white-space: pre-line; line-height: 1.5; }
.moi-vare { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0; border-bottom: 1px solid var(--itlock-border); }
.moi-vare:last-child { border-bottom: 0; }
.moi-vare > span:first-child { flex: 1; min-width: 0; display: grid; }
.moi-vare small { color: var(--itlock-ink-muted); font-size: 0.75rem; }
.moi-vare b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Ordrekort med «i» ved siden av lenken (MontorOrdre). */
.ma-kort-ramme { position: relative; }
.ma-kort-ramme .ma-kort { padding-right: 4rem; border-bottom: 1px solid var(--itlock-border); }
.ma-kort-ramme:last-child .ma-kort { border-bottom: 0; }
.ma-kort-ramme > .ma-info { position: absolute; right: 0.8rem; top: 50%; transform: translateY(-50%); }

/* ---------- Verktøy (felles for verktøysidene i appen) ---------- */
.mv { --mv-aks: #a36a3e; --mv-aks2: #86532c; --mv-aks-lys: #f8efe5; padding-bottom: 1.5rem; }
.mv-sok-ramme { background: linear-gradient(160deg, #efdfcc 0%, #f4e6d6 100%); padding: 0 0.75rem 0.85rem; border: 1px solid var(--itlock-border); border-top: 0; }
.mv-sok { box-sizing: border-box; width: 100%; height: 2.7rem; border: 1px solid rgba(163, 106, 62, 0.18); background: rgba(255, 255, 255, 0.65); border-radius: 12px; padding: 0 0.85rem; font: inherit; color: var(--itlock-ink); }
.mv-gruppe { margin: 1.1rem 1rem 0.5rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--itlock-ink-muted); }
.mv-kort { margin: 0 0.75rem; background: var(--itlock-surface); border: 1px solid var(--itlock-border); border-radius: 18px; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 18px rgba(0, 0, 0, 0.05); }
.mv-kort + .mv-kort { margin-top: 0.75rem; }
.mv-rad { box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 0.85rem; padding: 0.8rem 0.9rem; border: 0; border-bottom: 1px solid var(--itlock-border); background: var(--itlock-surface); color: var(--itlock-ink); text-decoration: none; font: inherit; text-align: left; cursor: pointer; }
.mv-rad:last-child { border-bottom: 0; }
.mv-rad:active { background: color-mix(in srgb, var(--mv-aks) 6%, var(--itlock-surface)); }
.mv-rad.statisk { cursor: default; }
.mv-ik { width: 2.6rem; height: 2.6rem; flex: none; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; color: var(--mv-aks); background: var(--mv-aks-lys); }
.mv-ik .icon { width: 1.25rem; height: 1.25rem; }
.mv-tekst { flex: 1; min-width: 0; display: grid; gap: 1px; }
.mv-tekst b { font-size: 0.98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-tekst small { color: var(--itlock-ink-muted); font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-pil { color: var(--itlock-ink-muted); display: inline-flex; flex: none; }
.mv-pil .icon { width: 1.1rem; height: 1.1rem; }
.mv-chips { display: flex; gap: 0.4rem; padding: 0.9rem 0.75rem 0.2rem; overflow-x: auto; scrollbar-width: none; flex-wrap: wrap; }
.mv-chips button { border: 1px solid var(--itlock-border); background: var(--itlock-surface); border-radius: 99px; padding: 0.4rem 0.85rem; font: inherit; font-size: 0.84rem; font-weight: 650; color: var(--itlock-ink); cursor: pointer; white-space: nowrap; }
.mv-chips button.paa { background: var(--mv-aks-lys); border-color: var(--mv-aks); color: var(--mv-aks2); }
.mv-felt { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.3rem; margin: 0 0.75rem 0.75rem; }
.mv-felt > span { font-weight: 700; font-size: 0.86rem; }
.mv-felt input, .mv-felt textarea, .mv-felt select { box-sizing: border-box; width: 100%; min-width: 0; border: 1px solid var(--itlock-border); border-radius: 12px; padding: 0.7rem 0.8rem; font: inherit; background: var(--itlock-surface); color: var(--itlock-ink); }
.mv-to { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 0.5rem; margin: 0 0.75rem; }
.mv-to .mv-felt { margin: 0 0 0.75rem; }
.mv-seksjon { margin: 1rem 1rem 0.5rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--itlock-ink-muted); display: flex; justify-content: space-between; }
.mv-resultat { margin: 0.9rem 0.75rem 0; border-radius: 18px; background: #e6f3e6; border: 1px solid #c8e3cb; padding: 0.9rem; }
.mv-resultat-tittel { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #2f7a3a; margin-bottom: 0.4rem; }
.mv-res-rad { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0; border-bottom: 1px solid #d6ebd8; }
.mv-res-rad:last-child { border-bottom: 0; }
.mv-res-rad span { flex: 1; color: var(--itlock-ink); }
.mv-res-rad b { font-size: 1rem; text-align: right; }
.mv-bunn { position: sticky; bottom: 0; padding: 0.8rem 0.75rem 1rem; background: linear-gradient(transparent, var(--itlock-surface) 30%); display: grid; gap: 0.5rem; z-index: 2; }
.mv-bunn.to { grid-template-columns: 1fr 1fr; }
.mv-segment { display: grid; grid-template-columns: 1fr 1fr; background: color-mix(in srgb, var(--itlock-ink-muted) 7%, var(--itlock-surface)); border: 1px solid var(--itlock-border); border-radius: 12px; padding: 3px; }
.mv-segment button { border: 0; background: none; border-radius: 9px; padding: 0.5rem; font: inherit; font-weight: 700; font-size: 0.88rem; color: var(--itlock-ink-muted); cursor: pointer; }
.mv-segment button.paa { background: var(--itlock-surface); color: var(--itlock-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.mv-info { display: flex; gap: 0.6rem; align-items: center; margin: 0.9rem 0.75rem 0; padding: 0.7rem 0.85rem; border-radius: 14px; background: #e8f0f8; color: #2f5f8a; font-size: 0.84rem; font-weight: 600; }
.mv-info .icon { width: 1.2rem; height: 1.2rem; flex: none; }
.mv-signatur { margin: 0 0.75rem; border: 2px dashed #d6c8b6; border-radius: 16px; background: #fff; position: relative; height: 12rem; overflow: hidden; }
.mv-signatur canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.mv-signatur .linje { position: absolute; left: 1.1rem; right: 1.1rem; bottom: 2.4rem; border-top: 1.5px solid #e2d8cc; pointer-events: none; }
.mv-signatur .hint { position: absolute; left: 0; right: 0; bottom: 0.8rem; text-align: center; color: #b3a594; font-size: 0.8rem; pointer-events: none; }
.mv-bilder { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; margin-top: 0.6rem; }
.mv-bilder img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--itlock-border); }
.mv-merke-tall { font-size: 0.74rem; font-weight: 700; padding: 0.15rem 0.6rem; border-radius: 99px; background: var(--ma-flate2, #f5f1ec); color: var(--itlock-ink-muted); flex: none; }

@media (max-width: 640.98px) {
    .mv-sok-ramme { border-left: 0; border-right: 0; }
}

/* Verktøysidene: befaring, utskifting av lås, låskasse, systemregister, guide og dørmiljø. */
.mb-dor { padding-bottom: 0; }
.mb-kamera { position: relative; width: 100%; box-sizing: border-box; overflow: hidden; }
.mb-skjult { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.mb-hint { display: block; color: var(--itlock-ink-muted); font-size: 0.78rem; margin-top: 0.35rem; }

.mlu-tegning { position: relative; margin: 0.9rem 0.75rem 0; background: #fff; border: 1px solid var(--itlock-border); border-radius: 18px; overflow: hidden; max-height: 22rem; overflow-y: auto; }
.mlu-indre { position: relative; }
.mlu-tegning img { display: block; width: 100%; height: auto; }
.mlu-punkt { position: absolute; width: 1.1rem; height: 1.1rem; margin: -0.55rem 0 0 -0.55rem; border-radius: 50%; border: 2px solid #fff; background: rgba(163, 106, 62, 0.35); cursor: pointer; padding: 0; }
.mlu-punkt.aktiv { background: #a36a3e; box-shadow: 0 0 0 5px rgba(163, 106, 62, 0.3); }
.mlu-valgt { margin: 0.5rem 1rem 0; font-weight: 700; color: #86532c; font-size: 0.88rem; }

.mlk-kode { display: flex; align-items: center; gap: 0.6rem; margin: 0.9rem 0.75rem 0; padding: 0.6rem 0.8rem; border: 2px solid #a36a3e; border-radius: 16px; background: var(--itlock-surface); }
.mlk-kode input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 1.5rem; font-weight: 700; letter-spacing: 0.04em; color: var(--itlock-ink); outline: none; }
.mlk-ik { color: var(--itlock-ink-muted); display: inline-flex; }
.mlk-ik .icon { width: 1.3rem; height: 1.3rem; }
.mlk-merknad { margin: 0.5rem 0 0; font-size: 0.8rem; color: #2f5f2f; }

.msy-signatur { width: 4.2rem; height: 1.8rem; object-fit: contain; border: 1px solid var(--itlock-border); border-radius: 6px; background: #fff; flex: none; }
.msy-lbl { display: block; font-weight: 700; font-size: 0.86rem; }
.msy-tom { border: 1px solid var(--itlock-border); background: var(--itlock-surface); border-radius: 99px; padding: 0.15rem 0.7rem; font: inherit; font-size: 0.78rem; cursor: pointer; }
.msy-hint { display: block; color: var(--itlock-ink-muted); font-size: 0.78rem; margin-top: 0.5rem; }

.mop-overskrift { padding: 0.8rem 0.9rem 0.4rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--itlock-ink-muted); background: color-mix(in srgb, var(--itlock-ink-muted) 5%, var(--itlock-surface)); border-bottom: 1px solid var(--itlock-border); }
.mop-steg { align-items: flex-start; }
.mop-tekst { flex: 1; font-size: 0.92rem; line-height: 1.4; padding-top: 0.2rem; }
.mop-steg.ok .mop-tekst { color: var(--itlock-ink-muted); text-decoration: line-through; }
.mop-meta { margin: 0.6rem 1rem; color: var(--itlock-ink-muted); font-size: 0.78rem; }

.mdm-tilbake { display: inline-flex; align-items: center; gap: 0.3rem; margin: 0.7rem 0.75rem 0.4rem; border: 0; background: none; font: inherit; font-weight: 650; font-size: 0.88rem; color: #86532c; cursor: pointer; padding: 0; }
.mdm-tilbake .icon { width: 1rem; height: 1rem; }
.mdm-visning { margin: 0 0.75rem; background: #fff; border: 1px solid var(--itlock-border); border-radius: 18px; overflow: hidden; }
.mdm-visning img { display: block; width: 100%; height: auto; }
.mdm-visning iframe { display: block; width: 100%; height: 70dvh; border: 0; }

.mabc { margin: 0.9rem 0.75rem 0; }

/* Søknader */
.mv .msk-ferie { padding: 1rem; }
.msk-teller { display: inline-flex; align-items: center; justify-content: center; min-width: 1.2rem; margin-left: 0.35rem; padding: 0 0.35rem; border-radius: 99px; background: #d79b2c; color: #fff; font-size: 0.72rem; font-weight: 700; }
.msk-varsel { box-sizing: border-box; display: flex; align-items: center; gap: 0.6rem; width: calc(100% - 1.5rem); margin: 0.75rem 0.75rem 0; padding: 0.75rem 0.9rem; border: 0; border-radius: 14px; background: #fdf1dc; color: #8a5a12; font: inherit; font-weight: 650; font-size: 0.9rem; text-align: left; cursor: pointer; }
.msk-varsel span { flex: 1; }
.msk-varsel .icon { width: 1.15rem; height: 1.15rem; }
.msk-typer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.5rem; margin: 0 0.75rem; }
.msk-typer button { box-sizing: border-box; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; padding: 0.8rem; border: 1px solid var(--itlock-border); border-radius: 16px; background: var(--itlock-surface); font: inherit; color: var(--itlock-ink); text-align: left; cursor: pointer; }
.msk-typer button.paa { border-color: #a36a3e; background: #f8efe5; box-shadow: inset 0 0 0 1px #a36a3e; }
.msk-typer b { display: block; font-size: 0.92rem; }
.msk-typer small { display: block; color: var(--itlock-ink-muted); font-size: 0.76rem; line-height: 1.3; }
.msk-oppsum { box-sizing: border-box; display: flex; align-items: center; gap: 0.75rem; margin: 0 0.75rem; padding: 0.8rem 0.9rem; border-radius: 14px; background: color-mix(in srgb, var(--itlock-ink-muted) 6%, var(--itlock-surface)); border: 1px solid var(--itlock-border); }
.msk-oppsum b { display: block; font-size: 1.25rem; }
.msk-oppsum small { display: block; color: var(--itlock-ink-muted); font-size: 0.8rem; }
.msk-advarsel { margin: 0.6rem 0.75rem 0; padding: 0.6rem 0.8rem; border-radius: 12px; background: #fbe9e6; color: #b4372b; font-size: 0.82rem; }
.msk-ark-topp { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.8rem; }
.msk-ark-tittel { flex: 1; min-width: 0; display: grid; }
.msk-ark-tittel b { font-size: 1.15rem; }
.msk-ark-tittel small { color: var(--itlock-ink-muted); font-size: 0.85rem; }
.msk-steg { display: grid; margin: 0.2rem 0 0.4rem; }
.msk-steg > div { display: flex; gap: 0.6rem; align-items: flex-start; position: relative; padding-bottom: 0.9rem; }
.msk-steg > div::before { content: ""; position: absolute; left: 0.65rem; top: 1.4rem; bottom: 0; width: 2px; background: var(--itlock-border); }
.msk-steg > div:last-child::before { display: none; }
.msk-steg i { width: 1.35rem; height: 1.35rem; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; z-index: 1; background: var(--itlock-border); }
.msk-steg .ferdig i { background: #2f7a3a; }
.msk-steg .avslatt i { background: #b4372b; }
.msk-steg .venter i { background: #fff; border: 2px solid #d79b2c; }
.msk-steg i .icon { width: 0.8rem; height: 0.8rem; }
.msk-steg b { display: block; font-size: 0.9rem; }
.msk-steg small { color: var(--itlock-ink-muted); font-size: 0.8rem; }
.msk-lbl { display: block; font-size: 0.86rem; margin-top: 0.3rem; }
.msk-tekst { margin: 0.15rem 0 0.4rem; color: var(--itlock-ink-muted); }
.msk-svar { margin-top: 0.6rem; padding: 0.7rem 0.85rem; border-radius: 12px; background: #fbe9e6; color: #b4372b; font-size: 0.86rem; }
.msk-svar b { display: block; margin-bottom: 0.15rem; }
.msk-rod { color: #b4372b !important; }

/* Tegninger og PDF-sider som kan knipes (koblingsskjema, dørmiljø, dokumenter). */
.zoom-ramme { position: relative; margin: 0.9rem 0.75rem 0; background: #fff; border: 1px solid var(--itlock-border); border-radius: 18px; overflow: hidden; }
.zoom-rull { overflow: auto; max-height: 72dvh; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; }
.zoom-flate { min-width: 100%; }
.zoom-flate img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.zoom-flate img + img { border-top: 1px solid var(--itlock-border); }
.zoom-knapper { position: absolute; right: 0.6rem; bottom: 0.6rem; display: grid; gap: 0.3rem; }
.zoom-knapper button { width: 2.4rem; height: 2.4rem; border-radius: 10px; border: 1px solid var(--itlock-border); background: rgba(255, 255, 255, 0.95); font: inherit; font-size: 1.2rem; font-weight: 700; color: #86532c; cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12); }
.zoom-hint { margin: 0.5rem 1rem 0; color: var(--itlock-ink-muted); font-size: 0.78rem; }

/* Befaring: dørfeltet i seksjoner som åpnes og lukkes, og faste valg som knapper. */
.mbd-seksjon { margin: 0.75rem 0.75rem 0; background: var(--itlock-surface); border: 1px solid var(--itlock-border); border-radius: 16px; overflow: hidden; }
.mbd-seksjon > summary { list-style: none; display: flex; align-items: center; gap: 0.6rem; padding: 0.85rem 0.95rem; cursor: pointer; font-weight: 700; font-size: 0.98rem; }
.mbd-seksjon > summary::-webkit-details-marker { display: none; }
.mbd-seksjon > summary span { flex: 1; }
.mbd-seksjon > summary small { color: var(--itlock-ink-muted); font-weight: 600; font-size: 0.78rem; }
.mbd-seksjon > summary::after { content: ""; width: 0.55rem; height: 0.55rem; border-right: 2px solid var(--itlock-ink-muted); border-bottom: 2px solid var(--itlock-ink-muted); transform: rotate(45deg); margin: -0.25rem 0.2rem 0 0; transition: transform 0.15s; }
.mbd-seksjon[open] > summary::after { transform: rotate(225deg); margin-top: 0.2rem; }
.mbd-seksjon[open] > summary { border-bottom: 1px solid var(--itlock-border); margin-bottom: 0.75rem; }
.mbd-seksjon .mv-to { margin: 0 0.75rem; }
.mbd-valg { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.mbd-valg button { flex: 1; min-width: 4.5rem; border: 1px solid var(--itlock-border); background: var(--itlock-surface); border-radius: 11px; padding: 0.6rem 0.5rem; font: inherit; font-size: 0.9rem; font-weight: 650; color: var(--itlock-ink); cursor: pointer; }
.mbd-valg button.paa { background: #f8efe5; border-color: #a36a3e; color: #86532c; box-shadow: inset 0 0 0 1px #a36a3e; }

/* Annenhver grå og hvit rad, som på PC (ordre, prosjekter og serviceavtaler). */
.ma-liste.ma-sebra > .ma-kort-ramme:nth-child(even) .ma-kort:not(.aktiv):not(.innrykk) { background: color-mix(in srgb, var(--itlock-ink) 4%, var(--itlock-surface)); }
