/* ===========================================================================
   TITTARSIDAN (2026-09-25, steg 4.6)
   ---------------------------------------------------------------------------
   Designversion 22 (telefon) och 23 (ett steg, dator). Samma material som
   panelen — tokens, mörk grund, 2 px hörn, 44 px minsta träffyta — men
   lugnare: större text, luftigare rader, inga räknare eller statuspiller
   utom LIVE. Rött bara i logotypen. 16 px i alla fält, annars zoomar iOS.
   Från 900 px: två kolumner, bläddraren (380 px) och spelaren (≤ 940 px).
   =========================================================================== */

/* Geist (designversion 25 §0.2), lokalt via /client/fonts/ — inget hämtas från nätet. */
@font-face { font-family: 'Geist'; src: url('fonts/Geist-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('fonts/Geist-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('fonts/Geist-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('fonts/Geist-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('fonts/GeistMono-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('fonts/GeistMono-Medium.woff2') format('woff2'); font-weight: 500 700; font-style: normal; font-display: swap; }

:root {
  --bg-chrome: #111418;
  --bg-panel: #16191e;
  --bg-editor: #1b1f25;
  --line: #2a2f37;
  --line-soft: #22262d;
  --line-strong: #3a414d;
  --text: #d7dce3;
  --text-strong: #f2f4f7;
  --text-2: #8b93a1;
  --accent: #2a6fc4;
  --accent-2: #3b8eea;
  --warn: #d29922;
  --warn-bg: #241f10;
  --video: #08090b;
  --live-bg: #15301d;
  --live-text: #7ee29b;
  --spärrad-bg: #1e2836;
  --spärrad-text: #5b6472;
  --font-ui: 'Geist','Segoe UI Variable Text','Segoe UI',system-ui,sans-serif;
  --font-mono: 'Geist Mono','Cascadia Mono',Consolas,ui-monospace,monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg-editor); color: var(--text); font-family: var(--font-ui); font-size: 15px;
  display: flex; flex-direction: column; min-height: 100vh; -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* --- Sidhuvudet: 60 px (telefon), 68 px (dator) ----------------------------- */
.kh {
  flex: none; height: 60px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-chrome); border-bottom: 1px solid var(--line); position: relative;
}
.kh-logo { width: 150px; height: auto; display: block; }
.kh-konto { display: flex; align-items: center; gap: 12px; }
.kh-namn, .kh-ut { display: none; }
.kh-meny {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: none; border: 0; color: var(--text-2); cursor: pointer; border-radius: 2px;
}
.kh-meny:hover { color: var(--text); }
.kh-menyruta {
  position: absolute; right: 12px; top: 56px; z-index: 10; min-width: 220px; padding: 4px 0;
  background: var(--bg-panel); border: 1px solid var(--line-strong); border-radius: 2px; box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  display: flex; flex-direction: column;
}
.kh-menyruta button { text-align: left; background: none; border: 0; padding: 0 16px; min-height: 44px; font-size: 15px; cursor: pointer; }
.kh-menyruta button:hover { background: var(--line-soft); }

/* --- Ytan ------------------------------------------------------------------- */
.yta { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.bl { flex: 1 1 auto; }
.sp { display: flex; flex-direction: column; }

/* --- Inloggningen ------------------------------------------------------------ */
.inl { width: 100%; max-width: 440px; margin: 0 auto; padding: 32px 20px; display: flex; flex-direction: column; gap: 16px; }
.inl h1 { margin: 0; font-size: 20px; font-weight: 600; color: var(--text-strong); }
.inl-intro { margin: -8px 0 0; font-size: 14px; color: var(--text-2); line-height: 1.45; }
.fält { display: flex; flex-direction: column; gap: 6px; }
.fält > span { font-size: 13px; color: var(--text-2); }
.fält input {
  height: 48px; padding: 0 14px; font-size: 16px; color: var(--text); background: var(--bg-panel);
  border: 1px solid var(--line-strong); border-radius: 2px; outline: none;
}
.fält input:focus { border-color: var(--accent-2); }
.fält input.kod { font-family: var(--font-mono); letter-spacing: .22em; }
.hjälp { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.45; }
.primär {
  height: 48px; border: 0; border-radius: 2px; background: var(--accent); color: #fff; font-size: 16px; font-weight: 600; cursor: pointer;
}
.primär:disabled { background: var(--spärrad-bg); color: var(--spärrad-text); cursor: default; }
.länk { align-self: center; background: none; border: 0; color: var(--accent-2); font-size: 14px; cursor: pointer; min-height: 44px; }
.besked {
  margin: 0; padding: 12px 14px; font-size: 14px; line-height: 1.45;
  background: var(--warn-bg); color: var(--warn); border-left: 3px solid var(--warn); border-radius: 2px;
}
.lugnt { margin: 0; font-size: 14px; color: var(--text-2); }

/* --- Bläddraren ---------------------------------------------------------------- */
.tillbaka {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 20px; width: 100%;
  background: none; border: 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; text-align: left;
  font-size: 17px; font-weight: 600; color: var(--text-strong);
}
.tillbaka svg { flex: none; color: var(--text-2); }
.sök { position: relative; margin: 16px 20px 4px; }
.sök input {
  width: 100%; height: 48px; padding: 0 64px 0 40px; font-size: 16px; color: var(--text);
  background: var(--bg-panel); border: 1px solid var(--line-strong); border-radius: 2px; outline: none;
}
.sök input:focus { border-color: var(--accent-2); }
.sök svg { position: absolute; left: 13px; top: 15px; color: var(--text-2); }
.sök-antal { position: absolute; right: 14px; top: 16px; font-family: var(--font-mono); font-size: 12px; color: var(--text-2); }
.avsnitt { margin: 22px 20px 6px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.rader { list-style: none; margin: 0; padding: 0; }
.rad {
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 8px 20px; width: 100%;
  background: none; border: 0; border-bottom: 1px solid var(--line-soft); text-align: left; cursor: pointer;
}
.rad:hover, .rad.is-vald { background: #1a2433; }
.bild {
  flex: none; width: 40px; height: 40px; border-radius: 2px; background: var(--bg-panel); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative;
  font-size: 14px; font-weight: 600; color: var(--text-2);
}
.bild img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--bg-panel); }
.rad-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rad-namn { font-size: 16px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rad-under { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rad-pil { flex: none; color: var(--text-2); }
.live {
  flex: none; display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 2px;
  background: var(--live-bg); color: var(--live-text); font-size: 11px; font-weight: 700; letter-spacing: .05em;
}
.mer {
  display: block; margin: 16px 20px; width: calc(100% - 40px); height: 48px; background: none;
  border: 1px solid var(--line-strong); border-radius: 2px; font-size: 16px; cursor: pointer;
}
.tomt { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 48px 32px; text-align: center; }
.tomt svg { color: var(--text-2); }
.tomt h2 { margin: 0; font-size: 18px; font-weight: 600; color: var(--text-strong); }
.tomt p { margin: 0; font-size: 15px; color: var(--text-2); line-height: 1.45; max-width: 360px; }

/* --- Spelaren ------------------------------------------------------------------ */
.bildruta { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--video); }
.bildruta video { position: absolute; inset: 0; width: 100%; height: 100%; background: var(--video); }
.bildruta-lager {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--text-2); font-size: 15px; background: var(--video); text-align: center;
}
.spela { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--text-2); background: none; color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sp-rad { display: flex; align-items: center; gap: 10px; margin: 18px 20px 12px; }
.sp-namn { margin: 0; font-size: 19px; font-weight: 600; color: var(--text-strong); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stäng {
  margin: 0 20px 20px; height: 48px; background: none; border: 1px solid var(--line-strong); border-radius: 2px; font-size: 16px; cursor: pointer;
}
.stoppkort { display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.stoppkort h2 { margin: 0; font-size: 19px; font-weight: 600; color: var(--text-strong); }

/* --- Dator: två kolumner -------------------------------------------------------- */
@media (min-width: 900px) {
  .kh { height: 68px; }
  .kh-logo { width: auto; height: 21px; }
  .kh-namn { display: inline; font-size: 13px; color: var(--text-2); }
  .kh-ut { display: inline; background: none; border: 0; color: var(--accent-2); font-size: 13px; cursor: pointer; min-height: 44px; }
  .kh-menyruta { top: 60px; }
  .yta.is-två { display: grid; grid-template-columns: 380px 1fr; }
  .yta.is-två .bl { border-right: 1px solid var(--line); overflow-y: auto; }
  .yta.is-två .sp { padding: 32px; }
  .yta.is-två .sp .bildruta { max-width: 940px; }
  .yta.is-två .sp-rad { margin: 16px 0 0; max-width: 940px; justify-content: space-between; }
  .yta.is-två .sp-rad-vänster { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .yta.is-två .stäng { margin: 0; height: 40px; padding: 0 16px; }
  .yta.is-två .stoppkort { max-width: 620px; padding: 0; }
  .sök { margin: 16px 16px 4px; }
  .sök input { height: 44px; }
  .sök svg { top: 13px; }
  .sök-antal { top: 14px; }
  .avsnitt { margin: 20px 16px 6px; }
  .rad { min-height: 60px; padding: 8px 16px; }
  .bild { width: 36px; height: 36px; }
  .tillbaka { padding: 0 16px; }
  .mer { margin: 16px; width: calc(100% - 32px); }
}
