/* 1080p TV-canvas. Avur navy. RiksTV-/streaming-stil: topbar → hero → rader. */
html, body {
    margin: 0;
    padding: 0;
    width: 1920px;
    height: 1080px;
    background: #0a1733; /* Avur navy (BackgroundPrimary) */
    color: #ffffff;
    font-family: "Samsung One", "Tizen", sans-serif;
    overflow: hidden;
}

/* --- Splash --- */
#splash {
    position: fixed; left: 0; top: 0;
    width: 1920px; height: 1080px;
    background: #0a1733;
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}
#splash img { width: 420px; height: auto; }
#splash.hidden { opacity: 0; }

#app { position: relative; height: 100%; }
#home-view {
    display: flex;
    flex-direction: row;
    height: 100%;
    box-sizing: border-box;
}
.screen {
    display: none;
    position: absolute;
    left: 0; top: 0;
    width: 1920px; height: 1080px;
    box-sizing: border-box;
    padding: 40px 64px;
    overflow-y: auto;
}

/* --- Sticky venstre master-meny (ikon-rail, utvides ved fokus) + hovedområde --- */
.sidebar {
    width: 104px; flex: none; box-sizing: border-box;
    display: flex; flex-direction: column;
    padding: 30px 0 18px;
    background: #0b1730; border-right: 1px solid rgba(255,255,255,0.06);
}
.sidebar-logo { height: 40px; width: auto; margin: 0 auto 26px; }
.sidebar-menu { flex: 1; display: flex; flex-direction: column; }
.menu-spacer { flex: 1; min-height: 16px; }   /* dytter TV-guide/Arkiv/Innstillinger ned */
.menu-label { display: none; }   /* navnet vises som overskrift i hovedområdet */
.menu-item {
    display: flex; align-items: center; justify-content: center;
    height: 62px; margin: 6px 16px; border-radius: 14px; color: #7f8fb8;
}
.menu-icon { width: 32px; height: 32px; flex: none; }
.menu-item.active .menu-icon { color: #ffffff; }              /* gjeldende seksjon */
.menu-item.focused { background: #ffffff; }                    /* tydelig hvit fokus-chip */
.menu-item.focused .menu-icon { color: #0b1730; }
.auth-state { display: none; }

#home-main {
    flex: 1; min-width: 0; box-sizing: border-box;
    padding: 32px 48px 0; overflow: hidden;
    display: flex; flex-direction: column;
    background-color: #0a1733; background-size: cover; background-position: center;
}
.section-title { font-size: 40px; font-weight: 700; margin: 0 0 16px; flex: none; }
/* Tittel + hero står fast øverst; kun rutenettet scroller. */
/* Rutenett-modus: kun kort-radens høyde (ligger i bunn, hero vokser over).
   Verktøy-modus: fyll hele content-rammen. */
.home-content { flex: none; min-height: 0; overflow-y: auto; padding-bottom: 20px; scrollbar-width: none; display: flex; flex-direction: column; }
.home-content::-webkit-scrollbar { display: none; }
.home-content.tool-active { flex: 1; overflow: hidden; padding-bottom: 0; }
.tool-host { height: 100%; min-height: 0; display: flex; flex-direction: column; }
.tool-loading { font-size: 26px; opacity: 0.55; padding: 48px 8px; }
/* Én horisontal rad med kort (som Programdetalj), scroller sideveis.
   margin-top:auto skyver raden til BUNNEN av content-vinduet → mer av hero-bildet vises. */
.home-grid { display: flex; flex-wrap: nowrap; gap: 24px; padding: 8px 0 16px; overflow-x: auto; scrollbar-width: none; flex: none; margin-top: auto; }
.home-grid::-webkit-scrollbar { display: none; }

/* --- Hero --- */
.hero {
    flex: 1;            /* vokser → tekst (justify-end) havner nederst, rett over kort-raden */
    min-height: 0;
    margin: 0 0 16px;
    padding: 8px 4px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: transparent;   /* bildet er nå full-vindu-bakgrunn på #home-main */
}
.hero-text { max-width: 62%; }
.hero-img {
    flex: none; width: 604px; height: 340px; align-self: center;
    background-size: cover; background-position: center; border-radius: 12px;
}
.hero-meta { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.hero-badge {
    font-size: 20px; font-weight: 700; letter-spacing: 0.05em;
    background: #e2342f; padding: 4px 12px; border-radius: 6px;
}
.hero-channel { font-size: 24px; opacity: 0.8; }
.hero-title { font-size: 52px; font-weight: 700; margin-bottom: 10px; }
.hero-desc {
    font-size: 24px; opacity: 0.75; max-width: 1100px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-progress {
    margin-top: 16px; width: 360px; height: 5px;
    background: rgba(255,255,255,0.12); border-radius: 3px; overflow: hidden;
}
.hero-progress-fill { height: 100%; background: #e2342f; }

/* --- Rader (rails) --- */
.rails { flex: 1; overflow-y: auto; padding-bottom: 16px; }
.rail { margin-top: 22px; }
.rail-title { font-size: 28px; font-weight: 600; margin: 0 0 12px 64px; }
.rail-row {
    display: flex;
    gap: 18px;
    padding: 6px 64px;
    overflow-x: auto;
    scrollbar-width: none;
}
.rail-row::-webkit-scrollbar { display: none; }

/* --- Kanal-kort --- */
.card {
    flex: 0 0 auto;
    width: 280px;
    height: 168px;
    box-sizing: border-box;
    padding: 18px 20px;
    background: #15244a;
    border: 3px solid transparent;
    border-radius: 12px;
    position: relative;
    display: flex;
    flex-direction: column;
    outline: none;
}
.card.focused { border-color: #ffffff; transform: scale(1.04); background: #20356b; }
/* Kanalen som vises nå i detalj-bunnen — subtil markør (fokus-ramma vinner) */
.det-rec-cur:not(.focused) { border-color: rgba(226,52,47,0.8); }
/* Kompakte bilde-forward kanal-kort i Programdetalj-bunnen */
.det-rec-card { width: 244px; }
.det-rec-card .col-img { height: 137px; }
.det-rec-card .col-meta { padding: 8px 12px 12px; }
.det-rec-card .col-title { font-size: 19px; }
.det-rec-card .col-sub { font-size: 15px; }
.det-rec-card .ch-logo { height: 22px; max-width: 74px; padding: 3px 6px; top: 8px; left: 8px; }
.det-rec-card .ch-mark { font-size: 22px; top: 8px; right: 10px; }
.card-top { display: flex; justify-content: space-between; align-items: center; }
.card-num { font-size: 26px; font-weight: 700; opacity: 0.7; }
.card-ext { font-size: 24px; color: #7fb0ff; }
.card-brand {
    flex: 1; min-height: 0; padding: 6px 0;
    display: flex; align-items: center; justify-content: center;
}
.card-logo { max-width: 84%; max-height: 66px; object-fit: contain; }
.card-name { font-size: 30px; font-weight: 600; }
.card-now {
    font-size: 22px; opacity: 0.8;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-progress {
    position: absolute; left: 0; bottom: 0; height: 4px; width: 100%;
    background: rgba(255,255,255,0.08); border-radius: 0 0 12px 12px; overflow: hidden;
}
.card-progress-fill { height: 100%; background: #e2342f; }

/* Collection-kort (kuraterte temarader): liggende bilde + tittel/undertittel */
.col-card {
    width: 360px; flex: none; box-sizing: border-box;
    border: 3px solid transparent; border-radius: 12px; overflow: hidden;
    background: #15244a; transition: transform 0.12s ease;
}
.col-card.focused { border-color: #ffffff; transform: scale(1.04); }
.col-img { width: 100%; height: 203px; background-size: cover; background-position: center; background-color: #0e1c3d; }
.col-img-none { display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 600; color: #aab6d4; }
.col-meta { padding: 12px 16px 16px; }
.col-title { font-size: 24px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-sub { font-size: 18px; opacity: 0.6; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Live TV-kort: kanallogo-badge + progress oppå now-playing-bildet */
.ch-imgwrap { position: relative; }
.ch-logo {
    position: absolute; top: 10px; left: 10px; height: 28px; max-width: 96px; object-fit: contain;
    background: rgba(11,23,48,0.68); padding: 5px 8px; border-radius: 7px;
}
.ch-mark { position: absolute; top: 10px; right: 12px; font-size: 26px; }
.ch-prog { margin-top: 10px; }

/* --- Status + diagnostikk --- */
.status { margin: 12px 64px 0; font-size: 20px; opacity: 0.6; min-height: 26px; }
#diag { margin: 6px 64px 0; font-size: 15px; opacity: 0.35; }

/* --- Skjermer: Innstillinger --- */
.screen-title { font-size: 42px; font-weight: 700; margin: 0 0 20px; }
.set-section {
    font-size: 24px; font-weight: 600; color: #7fb0ff;
    margin: 22px 0 8px;
}
.set-row {
    width: 760px; box-sizing: border-box;
    display: flex; align-items: center; gap: 16px;
    padding: 16px 22px; margin-bottom: 8px;
    background: #15244a; border: 3px solid transparent; border-radius: 10px;
    outline: none;
}
.set-row.focused { border-color: #ffffff; background: #20356b; }
.set-row-main { flex: 1; }
.set-row-title { font-size: 26px; font-weight: 600; }
.set-row-caption { font-size: 18px; opacity: 0.6; margin-top: 2px; }
.set-row-value { font-size: 26px; font-weight: 700; color: #7fb0ff; }

.profile-card {
    width: 760px; box-sizing: border-box;
    background: #15244a; border-radius: 12px; padding: 22px;
}
.profile-line { display: flex; font-size: 22px; margin-bottom: 8px; }
.profile-label { width: 240px; opacity: 0.6; }

/* --- Skjerm: TV-guide (EPG) --- */
#epg { display: flex; flex-direction: column; overflow: hidden; }
.epg-msg { font-size: 24px; opacity: 0.6; margin-top: 16px; }
.epg-axis-row { display: flex; height: 28px; }
.epg-corner { width: 160px; flex: none; }
.epg-axis-vp { flex: 1; overflow: hidden; position: relative; height: 28px; }
.epg-axis-track { position: relative; height: 28px; will-change: transform; }
.epg-tick { position: absolute; top: 0; font-size: 18px; opacity: 0.55; }

.epg-body { flex: 1; overflow-y: auto; margin-top: 6px; }
.epg-lane { display: flex; height: 138px; margin-bottom: 10px; align-items: center; }
.epg-chan {
    width: 160px; flex: none; padding-right: 12px; box-sizing: border-box;
    display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px;
}
.epg-chan-num { font-size: 24px; font-weight: 700; opacity: 0.7; }
.epg-chan-logo { max-width: 132px; max-height: 54px; object-fit: contain; }
.epg-chan-name { font-size: 18px; opacity: 0.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.epg-lane-vp { flex: 1; overflow: hidden; position: relative; height: 138px; }
.epg-lane-track { position: relative; height: 138px; will-change: transform; }

.epg-cell {
    /* Bunn-padding 30px reserverer en sone for progressbar/«Arkiv» SLIK AT den aldri
       ligger oppå tittelen (som flyter i innholdsboksen over). */
    position: absolute; top: 8px; height: 122px; box-sizing: border-box;
    padding: 12px 16px 30px; background: #15244a;
    border: 2px solid transparent; border-radius: 8px; overflow: hidden;
    background-size: cover; background-position: center;
}
.epg-cell.focused { border-color: #ffffff; background-color: #20356b; z-index: 3; }
.epg-cell-time { font-size: 16px; opacity: 0.6; }
.epg-cell-title {
    font-size: 21px; margin-top: 3px; line-height: 1.2;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.epg-cell.live .epg-cell-title { font-weight: 700; }
.epg-cell-prog { position: absolute; left: 16px; right: 16px; bottom: 14px; height: 5px; background: rgba(255,255,255,0.18); border-radius: 3px; }
.epg-cell-prog-fill { height: 100%; background: #e2342f; border-radius: 3px; }
.epg-cell-arkiv { position: absolute; bottom: 10px; left: 16px; font-size: 16px; color: #7fb0ff; }
.epg-empty { display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.45); font-size: 18px; }

/* --- Skjerm: Arkiv (catchup) --- */
#catchup { display: flex; flex-direction: column; overflow: hidden; }
.ar-sub { font-size: 20px; opacity: 0.6; margin-bottom: 16px; }
.ar-panes { flex: 1; display: flex; gap: 24px; overflow: hidden; }
.ar-chan-pane { width: 280px; flex: none; overflow-y: auto; }
.ar-chan {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px; margin-bottom: 6px;
    background: #15244a; border: 2px solid transparent; border-radius: 8px;
}
.ar-chan.focused { border-color: #ffffff; background: #20356b; }
.ar-chan-num { width: 36px; font-size: 24px; font-weight: 700; color: #7fb0ff; }
.ar-chan-name { font-size: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ar-events-pane { flex: 1; overflow-y: auto; padding-right: 24px; }
.ar-events-title { font-size: 30px; font-weight: 700; margin-bottom: 12px; }
.ar-events-ret { font-size: 18px; font-weight: 500; color: #7fb0ff; margin-left: 12px; }
.ar-day { font-size: 20px; font-weight: 600; color: #7fb0ff; margin: 14px 0 6px; }
.ar-empty { font-size: 22px; opacity: 0.6; margin-top: 24px; }
.ar-event {
    display: flex; align-items: center; gap: 16px;
    padding: 12px 18px; margin-bottom: 6px;
    background: #15244a; border: 2px solid transparent; border-radius: 8px;
}
.ar-event.focused { border-color: #ffffff; background: #20356b; }
.ar-event-time { width: 72px; flex: none; font-size: 22px; opacity: 0.7; }
.ar-event-img { width: 116px; height: 65px; flex: none; object-fit: cover; border-radius: 6px; }
.ar-event-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ar-event-title { font-size: 23px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-event-desc { font-size: 17px; opacity: 0.55; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- Skjerm: Programdetalj --- */
#details { padding: 0; }
.det-msg { font-size: 24px; opacity: 0.6; padding: 48px; }
/* Full-skjerm 16:9-hero: bilde fyller hele skjermen uten beskjæring (16:9-bilde
   på 16:9-skjerm). Body + anbefalinger ligger i bunn over en scrim. */
.det-hero { position: relative; height: 1080px; background: linear-gradient(180deg, #1b2c54 0%, #0a1733 100%); }
.det-hero-scrim { position: absolute; left: 0; top: 0; right: 0; bottom: 0; background: linear-gradient(180deg, rgba(10,23,51,0) 45%, rgba(10,23,51,0.85) 80%, #0a1733 100%); }
.det-hero-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 48px; }
/* Svak transparent panel bak detalj-teksten → lesbar over varierte bilder */
.det-hero-body {
    display: inline-block; max-width: 66%;
    background: rgba(8, 17, 38, 0.5); border-radius: 16px; padding: 26px 32px; margin-bottom: 22px;
}
.det-meta-top { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.det-title { font-size: 56px; font-weight: 700; margin-bottom: 8px; }
.det-metaline { font-size: 22px; opacity: 0.7; margin-bottom: 10px; }
.det-quality { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.q-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 18px; font-weight: 700; letter-spacing: 0.04em;
    padding: 3px 11px; border-radius: 5px;
    background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.22);
}
.q-drm { background: rgba(226,52,47,0.22); border-color: rgba(226,52,47,0.55); }
.q-lock { width: 16px; height: 16px; fill: currentColor; }
.det-desc {
    font-size: 24px; opacity: 0.8; max-width: 980px; margin-bottom: 6px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.det-actions { display: flex; gap: 16px; margin-top: 20px; }
.det-btn {
    font-size: 26px; font-weight: 600; padding: 14px 38px;
    border: 3px solid transparent; border-radius: 10px;
    background: #1b2c54; color: #ffffff; outline: none; cursor: default;
}
.det-btn.focused { border-color: #ffffff; background: #2c4a8c; }
.det-btn-back { background: #0f1d3d; }
.det-btn-back.focused { background: #24416f; }
.det-recs { margin-top: 24px; }

/* --- Spiller (AVPlay + rx-player) --- */
#player { display: none; }
#av-player { position: fixed; left: 0; top: 0; width: 1920px; height: 1080px; }
/* rx-player <video> fyller skjermen; skjult til rx-motoren er aktiv (engine.use). */
.rx-video { position: fixed; left: 0; top: 0; width: 1920px; height: 1080px; background: #000; display: none; }
/* rx-player html-tekst-overlay: NØYAKTIG samme størrelse som videoen (rx-player
   posisjonerer cues absolutt inni den). pointer-events:none så den ikke fanger fokus. */
.rx-text-track { position: fixed; left: 0; top: 0; width: 1920px; height: 1080px; display: none; pointer-events: none; z-index: 55; }
body.engine-rx .rx-video { display: block; }
body.engine-rx .rx-text-track { display: block; }
body.engine-rx #av-player { display: none; }
/* Motor-indikator (test): liten badge øverst til høyre mens vi spiller. */
.engine-badge { display: none; position: fixed; top: 14px; right: 18px; z-index: 60;
  font: 600 20px/1 sans-serif; color: #fff; background: rgba(10,23,51,0.78);
  padding: 8px 14px; border-radius: 8px; letter-spacing: 0.5px; }
/* Motor-indikator = test-verktøy under rx-migrasjonen; skjult i produksjon. */
body.playing .engine-badge { display: none; }
body.engine-rx .engine-badge { background: rgba(20,90,40,0.82); }
body.playing { background: transparent; }
body.playing #app { display: none; }
body.playing #player { display: block; }
body.playing #debug-overlay { display: none !important; }

/* Undertekst-overlay — AVPlay tegner ikke eksterne subs selv; rendres her over
   videoen (som ligger på et hw-plan bak den transparente WebView-en). */
#subtitle {
    display: none; position: fixed; left: 0; right: 0; bottom: 90px; z-index: 900;
    text-align: center; padding: 0 8%; box-sizing: border-box;
    font-size: 40px; font-weight: 600; line-height: 1.35; color: #ffffff;
    text-shadow: 0 0 4px rgba(0,0,0,0.95), 0 2px 8px rgba(0,0,0,0.95);
    pointer-events: none;
}

.osd {
    position: fixed; left: 64px; right: 64px; bottom: 56px; box-sizing: border-box;
    min-height: 150px;
    padding: 20px 28px; background: rgba(10, 23, 51, 0.78);
    border-radius: 12px; opacity: 0; transition: opacity 0.3s ease;
}
.osd.visible { opacity: 1; }
.osd-row { display: flex; align-items: center; gap: 20px; }
.osd-logo { position: absolute; right: 28px; bottom: 18px; height: 30px; width: auto; opacity: 0.9; pointer-events: none; }
/* Status-badgen (rød boks venstre) er fjernet: «DIREKTE» vises allerede til høyre,
   og vi viser ikke buffring. Beholdt regelen skjult for å unngå markup-endring. */
.osd-badge { display: none; }   /* legacy — status vises i .osd-pos */
.osd-channel { font-size: 30px; font-weight: 600; }
/* Status-pille (DIREKTE/ARKIV/PAUSE/…) øverst til høyre; farge settes i JS. */
.osd-pos { margin-left: auto; font-size: 22px; font-weight: 700; padding: 5px 16px; border-radius: 7px; letter-spacing: 0.5px; }
.osd-prog { font-size: 30px; font-weight: 700; color: #ffffff; margin-top: 10px; }
.osd-timeline { display: flex; align-items: center; gap: 18px; margin-top: 12px; }
.osd-t-start, .osd-t-end { font-size: 22px; color: #aab6d4; white-space: nowrap; min-width: 64px; }
.osd-t-end { text-align: right; }
.osd-track { position: relative; flex: 1; height: 8px; background: rgba(255,255,255,0.18); border-radius: 4px; }
.osd-fill { position: absolute; left: 0; top: 0; height: 100%; background: #e2342f; border-radius: 4px; }
.osd-head {
    position: absolute; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px;
    background: #ffffff; border-radius: 50%; box-shadow: 0 0 0 4px rgba(226,52,47,0.45);
}
/* Klokkeslett for nåværende strømposisjon — flyter over spillehodet */
.osd-headtime {
    position: absolute; bottom: 20px; transform: translateX(-50%);
    font-size: 22px; font-weight: 700; color: #fff; white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0,0,0,0.85); pointer-events: none;
}
/* Program-strukturmarkører på tidslinja (tv-markers-kontrakt) */
.osd-markers { position: absolute; left: 0; top: 0; right: 0; bottom: 0; pointer-events: none; }
.osd-mk { position: absolute; top: -3px; width: 3px; height: 14px; margin-left: -1px; border-radius: 2px; background: #ffffff; }
.osd-mk-span { top: 0; height: 8px; margin-left: 0; border-radius: 0; opacity: 0.55; }
.mk-chapter { background: #ffffff; }
.mk-highlight { top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #16d97f; box-shadow: 0 0 0 2px rgba(0,0,0,0.4); }
.mk-ad { background: #ffb300; }
.mk-intro, .mk-recap, .mk-credits { background: rgba(255,255,255,0.85); }
.osd-mk-span.mk-intro, .osd-mk-span.mk-recap, .osd-mk-span.mk-credits { background: #8aa0ff; }
/* Live-indikator: ren status ved kanten (.on, rød), ellers «Hopp til nå»-knapp. */
.osd-live { font-size: 20px; font-weight: 700; white-space: nowrap; letter-spacing: 0.04em;
    color: #cdd6ee; background: rgba(255,255,255,0.12); padding: 5px 14px; border-radius: 6px; }
.osd-live.on { color: #e2342f; background: transparent; padding: 0; }
/* «Hopp over intro/reklame»-knapp (Regel 4) — vises når spillehodet er i et
   skippable intervall; OK aktiverer. Sitter til venstre i raden (etter kanalnavn);
   .osd-pos beholder sin margin-left:auto og blir høyre-justert som før. */
.osd-skip {
    font-size: 22px; font-weight: 700; color: #0a1733;
    background: #16d97f; padding: 6px 16px; border-radius: 6px; white-space: nowrap;
}
.osd-hint { display: block; margin-top: 14px; font-size: 20px; color: #aab6d4; }

/* Numerisk kanalinntasting (talltastatur under direkte) — overlegg øverst til venstre */
#number-entry {
    display: none; position: fixed; left: 64px; top: 56px; z-index: 60;
    font-size: 84px; font-weight: 800; color: #ffffff; letter-spacing: 0.08em;
    padding: 14px 36px; background: rgba(10, 23, 51, 0.82); border-radius: 14px;
    text-shadow: 0 3px 10px rgba(0,0,0,0.7); min-width: 120px; text-align: center;
}

/* --- App-versjonssjekk: full-skjerm blokkering (must_update) + banner (update_available) --- */
#force-update {
    display: none; position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 2000;
    background: #0a1733; align-items: center; justify-content: center;
}
#force-update .fu-box { width: 1000px; max-width: 80%; text-align: center; padding: 40px; }
#force-update .fu-title { font-size: 48px; font-weight: 700; color: #ffffff; margin-bottom: 28px; }
#force-update .fu-msg { font-size: 30px; line-height: 1.5; color: #d7e0f4; }
#force-update .fu-hint { margin-top: 36px; font-size: 24px; color: #aab6d4; }
/* «Ingen nettverkstilkobling»-skjerm (full blokkering ved oppstart uten nett) */
#no-network {
    display: none; position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 2100;
    background: #0a1733; align-items: center; justify-content: center;
}
#no-network .nn-box { width: 1000px; max-width: 80%; text-align: center; padding: 40px; }
#no-network .nn-title { font-size: 48px; font-weight: 700; color: #ffffff; margin-bottom: 28px; }
#no-network .nn-msg { font-size: 30px; line-height: 1.5; color: #d7e0f4; }
#no-network .nn-hint { margin-top: 36px; font-size: 24px; color: #aab6d4; }

#update-banner {
    position: fixed; left: 0; right: 0; top: 0; z-index: 1500;
    background: rgba(20, 42, 87, 0.96); color: #ffffff; text-align: center;
    font-size: 24px; padding: 16px; transition: opacity 0.5s ease;
}
#update-banner.hidden { opacity: 0; }

/* --- Info-modal (utilgjengelig kanal, f.eks. TV 2 under reforhandling) --- */
.modal {
    display: none; position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 1000;
    background: rgba(0,0,0,0.66); align-items: center; justify-content: center;
}
.modal.visible { display: flex; }
.modal-box {
    width: 820px; max-width: 80%; padding: 52px; box-sizing: border-box;
    background: #15244a; border-radius: 16px; text-align: center;
}
.modal-title { font-size: 36px; font-weight: 700; margin-bottom: 20px; }
.modal-msg { font-size: 28px; line-height: 1.45; color: #d7e0f4; margin-bottom: 40px; }
.modal-ok {
    font-size: 26px; font-weight: 600; padding: 14px 60px;
    border: 3px solid #ffffff; border-radius: 10px; background: #2c4a8c; color: #ffffff; outline: none;
}
.modal-ok.focused { background: #3a5cab; }

/* "ⓘ"-merke på utilgjengelige kanal-kort */
.card-info, .card-ext { font-size: 26px; }
.card-info { color: #ffd34d; }

/* Lyd/tekst-meny (pil ned under avspilling) */
.trackmenu {
    display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: 44px 64px 60px;
    background: linear-gradient(180deg, rgba(10,23,51,0) 0%, rgba(10,23,51,0.92) 38%);
}
.trackmenu.visible { display: block; }
.tm-hint { font-size: 20px; color: #aab6d4; margin-top: 20px; text-align: center; }
/* Bunnlinje-layout (paritet med avspillings-OSD): programinfo venstre, Lyd/Teksting
   sammenfoldet høyre, oppløsning+DRM-badge nederst høyre. */
.tm-bar { display: flex; align-items: flex-start; gap: 64px; }
.tm-left { flex: 1; min-width: 0; }
.tm-right { width: 460px; flex: none; display: flex; flex-direction: column; gap: 14px; }
/* Programinfo (venstre) */
.tm-info-ch { font-size: 24px; font-weight: 600; color: #ffd34d; margin-bottom: 10px; letter-spacing: 0.03em; }
.tm-info-title { font-size: 40px; font-weight: 700; color: #ffffff; line-height: 1.15; }
.tm-info-meta { font-size: 23px; color: #aab6d4; margin-top: 10px; }
.tm-info-desc {
    font-size: 24px; line-height: 1.45; color: #d7e0f4; margin-top: 18px;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden;
}
/* Lyd/Teksting-gruppe (sammenfoldet rad / utvidet liste) */
.tm-grp { border-radius: 10px; background: rgba(255,255,255,0.06); padding: 6px; }
.tm-grp-foc { background: rgba(44,74,140,0.55); box-shadow: 0 0 0 2px #4f74d8; }
.tm-grp-exp { background: rgba(255,255,255,0.08); }
.tm-grp-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; }
.tm-grp-title { font-size: 26px; font-weight: 700; color: #ffd34d; }
.tm-grp-val { font-size: 26px; color: #ffffff; font-weight: 600; }
.tm-grp-open { border-bottom: 2px solid rgba(255,255,255,0.14); margin-bottom: 4px; }
.tm-item { font-size: 25px; padding: 10px 16px; border-radius: 8px; color: #d7e0f4; }
.tm-item.tm-sel { color: #ffffff; font-weight: 600; }
.tm-item.tm-foc { background: #2c4a8c; color: #ffffff; }
.tm-empty { opacity: 0.5; }
/* Oppløsning- + DRM-badge nederst høyre */
.tm-badges { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.tm-badge {
    font-size: 20px; font-weight: 700; padding: 5px 14px; border-radius: 6px;
    background: rgba(255,255,255,0.16); color: #ffffff; letter-spacing: 0.03em;
}
.tm-badge-drm { background: #b4862a; }


/* Innlogging (credentials-fallback) */
.login-wrap {
    max-width: 760px; margin: 0 auto; padding: 96px 0 0;
    display: flex; flex-direction: column;
}
.login-title { font-size: 48px; font-weight: 700; margin: 0 0 12px; }
.login-sub { font-size: 24px; color: #aab6d4; margin: 0 0 40px; line-height: 1.4; }
.login-field { margin: 0 0 24px; }
.login-label { display: block; font-size: 22px; color: #aab6d4; margin: 0 0 10px; }
.login-input {
    width: 100%; box-sizing: border-box;
    font-size: 30px; color: #ffffff; font-family: inherit;
    padding: 18px 22px; background: #15244a;
    border: 3px solid transparent; border-radius: 10px; outline: none;
}
.login-input.focused { border-color: #ffffff; background: #20356b; }
.login-error {
    display: none; font-size: 22px; color: #ff8a85;
    margin: 0 0 20px; min-height: 26px;
}
.login-btn {
    align-self: flex-start; margin-top: 8px;
    font-size: 28px; font-weight: 700; color: #ffffff; font-family: inherit;
    padding: 16px 40px; background: #1b2c54;
    border: 3px solid transparent; border-radius: 999px; outline: none; cursor: default;
}
.login-btn.focused { border-color: #ffffff; background: #2c4a8c; }
