/* Skjerm 5 «Tekst og utheving». Fargetokener (--bg, --flate, ...) er definert i app.css. */

.tx-rot {
  display: flex;
  flex-direction: column;
  min-height: 0; /* høyden kommer fra .skjerm.arbeid i app.css */
  max-width: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--tekst);
}
.tx-rot [hidden] { display: none !important; }

.tx-forh { flex: 3 1 0; min-height: 140px; display: flex; justify-content: center; background: #000; position: relative; overflow: hidden; }
.tx-lerret { display: block; height: 100%; width: auto; max-width: 100%; object-fit: contain; }
/* panelet krymper aldri under innholdet (knapper + ordlista på minst 90 px); forhåndsvisningen tar det som blir igjen */
.tx-panel { flex: 2 0 auto; min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.tx-skjult-video { position: absolute; width: 2px; height: 2px; opacity: 0; pointer-events: none; left: 0; top: 0; }

.tx-kontroll { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 6px 12px; }
.tx-spill {
  flex: 0 0 auto; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: var(--aksent); color: #111; font-size: 16px; font-weight: 700; touch-action: manipulation;
}
.tx-glider { flex: 1 1 auto; min-width: 0; accent-color: var(--aksent); }
.tx-pos { flex: 0 0 auto; font-size: 13px; color: var(--dempet); font-variant-numeric: tabular-nums; }

.tx-status { flex: 0 0 auto; padding: 0 12px 4px; font-size: 13px; color: var(--usikker); white-space: pre-line; }

.tx-valg { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 12px; }
.tx-modusgruppe { display: flex; background: var(--flate); border-radius: 999px; padding: 3px; }
.tx-modus {
  border: 0; background: transparent; color: var(--tekst); padding: 8px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 600; touch-action: manipulation;
}
.tx-modus.valgt { background: var(--aksent); color: #111; }
.tx-aksent { font-size: 14px; display: flex; align-items: center; gap: 4px; }

.tx-bakrad { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 2px 12px; font-size: 13px; }
.tx-baktekst { flex: 1 1 auto; min-width: 0; color: var(--dempet); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-liten {
  flex: 0 0 auto; border: 1px solid var(--flate2); background: var(--flate); color: var(--tekst);
  border-radius: 999px; padding: 6px 10px; font-size: 13px; touch-action: manipulation;
}
.tx-liten.valgt { border-color: var(--aksent); color: var(--aksent); }

.tx-hjelp { flex: 0 0 auto; padding: 4px 12px; font-size: 12px; color: var(--dempet); }

.tx-scroll { flex: 1 1 auto; height: 90px; min-height: 90px; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 12px 12px; }
.tx-liste { list-style: none; margin: 0; padding: 0; }
.tx-linje { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--flate2); }
.tx-tid { flex: 0 0 34px; font-size: 12px; color: var(--dempet); padding-top: 8px; font-variant-numeric: tabular-nums; }
.tx-ordrad { display: flex; flex-wrap: wrap; gap: 6px; }
.tx-ord {
  border: 1px solid var(--flate2); background: var(--flate); color: var(--tekst);
  border-radius: 10px; padding: 7px 10px; font-size: 15px; touch-action: manipulation;
}
.tx-ord.slag { background: var(--tekst); color: #111; font-weight: 800; border-color: var(--tekst); }
.tx-ord.bak { outline: 3px solid var(--aksent); outline-offset: 1px; }

.tx-advarsler { margin-top: 10px; font-size: 13px; color: var(--usikker); }
.tx-advarsler ul { margin: 6px 0 0; padding-left: 18px; color: var(--dempet); }

.tx-bunn { flex: 0 0 auto; padding: 8px 12px calc(8px + var(--sikker-bunn)); background: var(--flate); }
.tx-stor {
  display: block; width: 100%; min-height: 52px; border: 0; border-radius: var(--radius);
  background: var(--flate2); color: var(--tekst); font-size: 17px; font-weight: 600; touch-action: manipulation;
}

/* Lag video (eksport.js) */
.tx-rot { position: relative; }
.tx-bunn { display: flex; gap: 8px; }
.tx-bunn .tx-stor { flex: 1 1 0; }
.tx-stor.tx-lag { background: var(--aksent); color: #111; }
.tx-eksport {
  position: absolute; inset: 0; z-index: 10; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--bg); padding: 16px 16px calc(16px + var(--sikker-bunn));
}
.tx-eksport h3 { margin: 0 0 8px; font-size: 20px; }
.tx-eks-status { font-size: 14px; margin: 0; font-variant-numeric: tabular-nums; }
.tx-eks-status.feil { color: var(--fare); }
.tx-eks-video { display: block; width: auto; max-width: 100%; max-height: 52dvh; margin: 12px auto; background: #000; border-radius: 10px; }
.tx-eks-sjekker { list-style: none; margin: 8px 0 12px; padding: 0; font-size: 13px; }
.tx-eks-sjekker li { padding: 3px 0; color: var(--dempet); }
.tx-eks-sjekker li.adv { color: var(--usikker); }
.tx-eks-sjekker li.feil { color: var(--fare); }
.tx-eks-knapper { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tx-eks-knapper .knapp { flex: 1 1 auto; text-align: center; text-decoration: none; }
.tx-eks-knapper .knapp { margin-top: 0; width: auto; }

/* Liggende telefon: forhåndsvisning til venstre, panelet til høyre (etter grunnreglene den overstyrer) */
@media (orientation: landscape) and (max-height: 540px) {
  .tx-rot { flex-direction: row; }
  .tx-forh { flex: 0 0 auto; min-height: 0; max-width: 40%; padding-bottom: var(--sikker-bunn); }
  .tx-panel { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .tx-stor { min-height: 44px; }
  .tx-spill { width: 38px; height: 38px; }
  /* lite høyde: hele panelet ruller, bunnknappene ligger fast nederst */
  .tx-scroll { flex: none; height: auto; min-height: auto; overflow: visible; }
  .tx-bunn { position: sticky; bottom: 0; z-index: 3; }
}
