/* Pätches Sömnklubben. Ljust på dagen (Linen/Halo), mörkt på kvällen och natten (Midnight).
   Temat styrs av klassen .natt på <body>, som appen sätter efter klockan. */

:root {
  --midnight: #2A1B4D;
  --djup: #1A0F33;
  --deep: #4A2F85;
  --twilight: #6E4FBF;
  --dusk: #A084DB;
  --halo: #F2EAFA;
  --linen: #FBF8FE;
  --ljus-text: #D4C9E8;
  --varm: #F4C9A0;

  --bg: var(--linen);
  --bg-2: var(--halo);
  --yta: #ffffff;
  --yta-2: #F7F1FC;
  --text: var(--midnight);
  --text-2: #5B4787;
  --text-3: #8E7DB0;
  --linje: rgba(42, 27, 77, .1);
  --linje-2: rgba(42, 27, 77, .18);
  --accent: var(--twilight);
  --knapp: var(--midnight);
  --knapp-text: #fff;
  --skugga: 0 1px 2px rgba(42, 27, 77, .06), 0 8px 28px rgba(42, 27, 77, .08);
  --skugga-stor: 0 24px 70px rgba(42, 27, 77, .18);

  --r: 22px;
  --r-s: 14px;
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bredd: 560px;
  --flik-h: 74px;
  --sakert-under: env(safe-area-inset-bottom, 0px);
  --sakert-over: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

body.natt {
  --bg: #170D2E;
  --bg-2: #1F1340;
  --yta: #241650;
  --yta-2: #2C1C5C;
  --text: var(--linen);
  --text-2: var(--ljus-text);
  --text-3: #9C8CC4;
  --linje: rgba(242, 234, 250, .09);
  --linje-2: rgba(242, 234, 250, .16);
  --accent: var(--dusk);
  --knapp: var(--halo);
  --knapp-text: var(--midnight);
  --skugga: 0 1px 2px rgba(0, 0, 0, .25), 0 10px 30px rgba(0, 0, 0, .25);
  --skugga-stor: 0 24px 70px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .6s ease, color .6s ease;
  min-height: 100dvh;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
/* Ikoner utan egen storlek: lagom stora överallt */
svg[aria-hidden] { width: 22px; height: 22px; flex: none; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: var(--dusk); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.laddar-start { min-height: 100dvh; display: grid; place-items: center; animation: puls 1.8s ease-in-out infinite; }

/* ---------- Typografi ---------- */
h1, h2, h3, h4 { margin: 0; line-height: 1.12; letter-spacing: -.02em; font-weight: 700; }
.jatte { font-size: clamp(40px, 9vw, 76px); letter-spacing: -.035em; line-height: 1.02; font-weight: 800; }
.stor { font-size: clamp(30px, 6.5vw, 44px); letter-spacing: -.03em; font-weight: 750; }
.mellan { font-size: 24px; letter-spacing: -.02em; }
.liten-rubrik { font-size: 15px; font-weight: 600; color: var(--text-3); }
.ingress { font-size: 19px; color: var(--text-2); line-height: 1.5; }
.dampad { color: var(--text-2); }
.svag { color: var(--text-3); font-size: 14px; }
.kursiv { font-style: italic; }
p { margin: 0 0 .9em; }
p:last-child { margin-bottom: 0; }

/* ---------- Layout ---------- */
.sida { max-width: var(--bredd); margin: 0 auto; padding: calc(18px + var(--sakert-over)) 18px calc(var(--flik-h) + 34px + var(--sakert-under)); }
.sida.utan-flik { padding-bottom: calc(40px + var(--sakert-under)); }
.bred { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.stapel > * + * { margin-top: 14px; }
.stapel-stor > * + * { margin-top: 28px; }
.rad { display: flex; align-items: center; gap: 10px; }
.rad-mellan { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rutnat-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mitten { text-align: center; }
.fyll { flex: 1; }
.dold { display: none !important; }

/* ---------- Topp ---------- */
.topp { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; min-height: 44px; }
.topp .logga { height: 22px; width: auto; }
body.natt .topp .logga-lila { display: none; }
body:not(.natt) .topp .logga-vit { display: none; }
.ikonknapp {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--linje-2); background: var(--yta);
  display: grid; place-items: center; cursor: pointer; color: var(--text); text-decoration: none; flex: none;
  transition: transform .15s ease, background .2s;
}
.ikonknapp:active { transform: scale(.94); }
.ikonknapp svg { width: 20px; height: 20px; }
.tillbaka { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--text-2); font-weight: 600; font-size: 15px; background: none; border: 0; padding: 8px 0; cursor: pointer; }
.tillbaka svg { width: 18px; height: 18px; }

/* ---------- Knappar ---------- */
.knapp {
  appearance: none; border: 0; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 28px; border-radius: 999px;
  background: var(--knapp); color: var(--knapp-text); font-weight: 650; font-size: 17px; letter-spacing: -.01em;
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s;
  box-shadow: 0 6px 20px rgba(42, 27, 77, .22);
  -webkit-tap-highlight-color: transparent;
}
.knapp:hover { box-shadow: 0 10px 28px rgba(42, 27, 77, .3); }
.knapp:active { transform: scale(.97); }
.knapp[disabled] { opacity: .45; pointer-events: none; }
.knapp.hel { width: 100%; }
.knapp.lila { background: linear-gradient(135deg, #7C5CD6, var(--deep)); color: #fff; }
.knapp.ljus { background: var(--halo); color: var(--midnight); box-shadow: none; }
.knapp.kontur { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--linje-2); }
.knapp.text { background: none; box-shadow: none; color: var(--text-2); min-height: 44px; padding: 0 12px; font-weight: 600; }
.knapp.liten { min-height: 42px; padding: 0 18px; font-size: 15px; }
.knapp svg { width: 20px; height: 20px; }
.knapp .snurr { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: snurr .8s linear infinite; }

/* ---------- Kort ---------- */
.kort { background: var(--yta); border-radius: var(--r); padding: 20px; box-shadow: var(--skugga); border: 1px solid var(--linje); position: relative; }
.kort.platt { box-shadow: none; }
.kort.lank { display: block; text-decoration: none; transition: transform .15s ease; cursor: pointer; }
.kort.lank:active { transform: scale(.985); }
.kort.mork { background: linear-gradient(160deg, #35225F, var(--midnight) 60%, #1E1240); color: var(--linen); border-color: rgba(255, 255, 255, .06); --text-2: var(--ljus-text); --text-3: #A99BCF; --accent: var(--dusk); }
.kort.halo { background: var(--halo); border-color: transparent; box-shadow: none; }
body.natt .kort.halo { background: var(--yta-2); }
.kort h3 { font-size: 20px; }
.kort .ovanfor { font-size: 14.5px; font-weight: 600; color: var(--text-3); margin-bottom: 4px; }

.bildkort { position: relative; border-radius: var(--r); overflow: hidden; min-height: 220px; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; padding: 22px; text-decoration: none; box-shadow: var(--skugga); isolation: isolate; }
.bildkort > img.bg, .bildkort > video.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 6s ease; }
.bildkort:hover > img.bg, .bildkort:hover > video.bg { transform: scale(1.04); }
.bildkort::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(23, 13, 46, .05) 20%, rgba(23, 13, 46, .82)); }
.bildkort .ovanfor { color: #E8DDFA; font-size: 15px; font-weight: 600; }
.bildkort h3 { font-size: 26px; margin-top: 4px; }
.bildkort p { color: #E4DAF5; margin-top: 6px; font-size: 15px; }

/* ---------- Formulär ---------- */
.falt { display: block; width: 100%; min-height: 56px; padding: 14px 18px; border-radius: var(--r-s); border: 1.5px solid var(--linje-2); background: var(--yta); font-size: 17px; outline: none; transition: border-color .2s, box-shadow .2s; }
.falt:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
textarea.falt { min-height: 110px; resize: vertical; line-height: 1.5; }
.etikett { display: block; font-weight: 600; font-size: 15px; margin-bottom: 8px; color: var(--text-2); }
.kodfalt { font-size: 32px; letter-spacing: .4em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.kryss { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; font-size: 15px; line-height: 1.45; color: var(--text-2); }
.kryss input { appearance: none; flex: none; width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid var(--linje-2); background: var(--yta); margin: 0; cursor: pointer; display: grid; place-items: center; transition: all .15s; }
.kryss input:checked { background: var(--accent); border-color: var(--accent); }
.kryss input:checked::after { content: ''; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.fel-text { color: #C0396B; font-size: 15px; font-weight: 600; }
body.natt .fel-text { color: #FF9EC4; }

/* Val (quiz, logg) */
.val-lista { display: grid; gap: 10px; }
.val {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  min-height: 62px; padding: 14px 18px; border-radius: 18px; border: 1.5px solid var(--linje-2);
  background: var(--yta); font-size: 17px; font-weight: 550; transition: all .18s ease; -webkit-tap-highlight-color: transparent;
}
.val:hover { border-color: var(--dusk); }
.val:active { transform: scale(.985); }
.val[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--yta)); box-shadow: 0 0 0 1px var(--accent) inset; }
.val .val-ikon { width: 40px; height: 40px; border-radius: 12px; background: var(--bg-2); display: grid; place-items: center; flex: none; color: var(--accent); }
.val .val-ikon svg { width: 22px; height: 22px; }
.val small { display: block; font-weight: 400; color: var(--text-3); font-size: 14px; margin-top: 2px; }
.val .bock { margin-left: auto; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--linje-2); flex: none; display: grid; place-items: center; }
.val[aria-pressed="true"] .bock { background: var(--accent); border-color: var(--accent); }
.val[aria-pressed="true"] .bock::after { content: ''; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.4px 2.4px 0; transform: rotate(45deg) translate(-1px, -1px); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--linje-2); background: var(--yta); border-radius: 999px; padding: 10px 16px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all .15s; min-height: 44px; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.bildval { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bildval button { position: relative; aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden; border: 0; padding: 0; cursor: pointer; color: #fff; isolation: isolate; box-shadow: var(--skugga); transition: transform .2s; }
.bildval button img, .bildval button video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.bildval button::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 45%, rgba(23, 13, 46, .78)); }
.bildval button span { position: absolute; left: 14px; bottom: 12px; font-weight: 700; font-size: 17px; text-align: left; }
.bildval button[aria-pressed="true"] { outline: 3px solid var(--accent); outline-offset: 3px; }
.bildval button[aria-pressed="true"]::before { content: ''; position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 16px no-repeat; }

/* Tidsväljare */
.tidval { display: flex; align-items: center; justify-content: center; gap: 8px; }
.tidval .tidtal { font-size: 56px; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; min-width: 190px; text-align: center; }
.tidval button { width: 56px; height: 56px; border-radius: 50%; border: 1.5px solid var(--linje-2); background: var(--yta); cursor: pointer; font-size: 26px; font-weight: 500; display: grid; place-items: center; }
.tidval button:active { transform: scale(.92); }
.reglage { width: 100%; accent-color: var(--accent); height: 36px; }

/* ---------- Flikrad ---------- */
.flikar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--sakert-under)); z-index: 50;
  width: min(calc(100% - 24px), 520px); height: var(--flik-h); padding: 8px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
  background: color-mix(in srgb, var(--yta) 88%, transparent); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--linje); border-radius: 26px; box-shadow: var(--skugga-stor);
}
.flikar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-decoration: none; color: var(--text-3); font-size: 11.5px; font-weight: 650; border-radius: 18px; position: relative; -webkit-tap-highlight-color: transparent; transition: color .2s, background .2s; }
.flikar a svg { width: 24px; height: 24px; }
.flikar a[aria-current="page"] { color: var(--text); background: var(--bg-2); }
.flikar a .prick { position: absolute; top: 8px; right: calc(50% - 18px); width: 8px; height: 8px; border-radius: 50%; background: #E0558C; border: 2px solid var(--yta); }

/* ---------- Idag ---------- */
.halsning { margin: 6px 0 22px; }
.halsning .dag { color: var(--text-3); font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.fasband { display: flex; gap: 4px; margin: 12px 0 2px; }
.fasband span { height: 5px; flex: 1; border-radius: 3px; background: var(--linje-2); overflow: hidden; position: relative; }
.fasband span i { position: absolute; inset: 0; background: var(--accent); transform-origin: left; }
.uppgift { display: flex; align-items: flex-start; gap: 14px; padding: 13px 0; border-top: 1px solid var(--linje); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.uppgift:first-child { border-top: 0; }
.uppgift .ruta { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--linje-2); flex: none; display: grid; place-items: center; transition: all .25s cubic-bezier(.3, 1.6, .5, 1); }
.uppgift.klar .ruta { background: var(--accent); border-color: var(--accent); transform: scale(1.05); }
.uppgift.klar .ruta::after { content: ''; width: 6px; height: 12px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.uppgift .uppgift-text { flex: 1; }
.uppgift .uppgift-text b { display: block; font-weight: 600; font-size: 16px; }
.uppgift .uppgift-text small { display: block; color: var(--text-3); font-size: 13.5px; line-height: 1.4; margin-top: 2px; }
.uppgift.klar .uppgift-text b { color: var(--text-3); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.tidsmarke { font-size: 13px; font-weight: 600; color: var(--text-3); padding: 3px 9px; border-radius: 999px; background: var(--bg-2); }

.fonsterkort { display: flex; align-items: center; gap: 18px; }
.fonsterkort .klockor { font-size: 34px; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.fonsterkort .klockor span { color: var(--text-3); font-weight: 400; margin: 0 6px; }

.saga-bubbla { display: flex; gap: 14px; align-items: flex-start; }
.saga-bubbla .text { flex: 1; font-size: 16px; color: var(--text); }

/* Sagas ansikte: en mjuk ljusboll, aldrig en fejkad människa */
.orb { width: 44px; height: 44px; border-radius: 50%; flex: none; position: relative;
  background: radial-gradient(circle at 35% 30%, #fff 0, #E9DEFF 12%, #B79CF0 38%, #6E4FBF 70%, #3B2672 100%);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--dusk) 20%, transparent), 0 6px 22px rgba(110, 79, 191, .5); }
.orb.stor { width: 140px; height: 140px; }
.orb.andas { animation: andas 6s ease-in-out infinite; }
.orb.pratar { animation: pratar 1.2s ease-in-out infinite; }
.orb.lyssnar { animation: lyssnar 1.6s ease-in-out infinite; }

/* ---------- Saga (chatt) ---------- */
.chatt { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; }
.bubbla { max-width: 86%; padding: 12px 16px; border-radius: 20px; font-size: 16px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; animation: upp .3s ease both; }
.bubbla.saga { background: var(--yta); border: 1px solid var(--linje); border-bottom-left-radius: 6px; align-self: flex-start; box-shadow: var(--skugga); }
.bubbla.jag { background: var(--twilight); color: #fff; border-bottom-right-radius: 6px; align-self: flex-end; }
.bubbla.auto { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.bubbla .tid { display: block; font-size: 11.5px; opacity: .55; margin-top: 4px; }
.skriver span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); margin-right: 4px; animation: hopp 1.2s infinite; }
.skriver span:nth-child(2) { animation-delay: .15s; }
.skriver span:nth-child(3) { animation-delay: .3s; }
.skrivrad { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--flik-h) + 22px + var(--sakert-under)); width: min(calc(100% - 24px), 536px); z-index: 40;
  display: flex; gap: 8px; align-items: flex-end; padding: 8px; border-radius: 28px; background: color-mix(in srgb, var(--yta) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--linje-2); box-shadow: var(--skugga); }
.skrivrad textarea { flex: 1; border: 0; background: transparent; resize: none; outline: none; padding: 10px 12px; max-height: 140px; min-height: 44px; font-size: 16px; line-height: 1.45; }
.skrivrad button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--twilight); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.skrivrad button.sekundar { background: var(--bg-2); color: var(--text); }
.skrivrad button svg { width: 20px; height: 20px; }
.forslag { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.forslag::-webkit-scrollbar { display: none; }
.forslag button { flex: none; border: 1px solid var(--linje-2); background: var(--yta); border-radius: 999px; padding: 9px 14px; font-size: 14px; cursor: pointer; white-space: nowrap; font-weight: 550; }

/* Röstsamtal */
.samtal { position: fixed; inset: 0; z-index: 90; background: radial-gradient(ellipse at 50% 30%, #3A2570, #170D2E 70%); color: var(--linen); display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: calc(30px + var(--sakert-over)) 24px calc(40px + var(--sakert-under)); text-align: center; animation: in .4s ease; }
.samtal .status { font-size: 15px; color: var(--ljus-text); letter-spacing: .02em; min-height: 24px; }
.samtal .undertext { max-width: 440px; font-size: 19px; line-height: 1.5; min-height: 90px; color: #fff; }
.samtal .undertext.du { color: var(--ljus-text); font-style: italic; }
.samtal .knappar { display: flex; gap: 22px; align-items: center; }
.samtal .rund { width: 72px; height: 72px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; }
.samtal .rund svg { width: 28px; height: 28px; }
.samtal .rund.lagg { background: #D2416E; color: #fff; }
.samtal .rund.tyst { background: rgba(255, 255, 255, .12); color: #fff; }

/* ---------- Kvällen / hypnos ---------- */
.spelare { position: fixed; inset: 0; z-index: 80; color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: calc(18px + var(--sakert-over)) 22px calc(36px + var(--sakert-under)); overflow: hidden; background: #0E0820; }
.spelare .bg { position: absolute; inset: -4%; width: 108%; height: 108%; object-fit: cover; z-index: -2; filter: saturate(.9); animation: drift 60s ease-in-out infinite alternate; transition: opacity 3s ease; }
.spelare::after { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 50% 40%, rgba(14, 8, 32, .25), rgba(14, 8, 32, .85) 80%); transition: background 4s; }
.spelare.dimmad::after { background: rgba(6, 3, 14, .94); }
.spelare.dimmad .bg { opacity: .35; }
.spelare .mitt { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.spelare .titel { font-size: 30px; font-weight: 750; letter-spacing: -.02em; }
.spelare .under { color: #DCD0F2; }
.andning { width: 180px; height: 180px; border-radius: 50%; position: relative; display: grid; place-items: center; }
.andning::before, .andning::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, rgba(200, 180, 255, .35), rgba(160, 132, 219, 0) 70%); animation: andning 10s ease-in-out infinite; }
.andning::after { inset: 30px; background: radial-gradient(circle, rgba(255, 255, 255, .55), rgba(200, 180, 255, .05) 70%); animation-delay: -.4s; }
.spelknapp { width: 84px; height: 84px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .95); color: var(--midnight); display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 40px rgba(0, 0, 0, .4); z-index: 1; }
.spelknapp svg { width: 32px; height: 32px; }
.forlopp { width: 100%; max-width: 420px; margin: 0 auto; }
.forlopp .bar { height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.forlopp .bar i { display: block; height: 100%; background: rgba(255, 255, 255, .85); width: 0; transition: width 1s linear; }
.forlopp .tider { display: flex; justify-content: space-between; font-size: 13px; color: #CFC2EA; margin-top: 8px; font-variant-numeric: tabular-nums; }
.spelare .kontroller { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.spelare .kontroller button { background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .15); border-radius: 999px; padding: 10px 16px; font-size: 14px; font-weight: 600; cursor: pointer; backdrop-filter: blur(10px); }

/* ---------- Nattläget ---------- */
.nattlage { position: fixed; inset: 0; z-index: 85; background: #000; color: #5E4D86; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 18px; padding: 30px 26px calc(30px + var(--sakert-under)); text-align: center; animation: in 1.2s ease; }
.nattlage h2 { color: #6C5A96; font-size: 22px; font-weight: 600; }
.nattlage p { color: #4F4170; font-size: 16px; max-width: 360px; }
.nattlage .nattval { display: grid; gap: 12px; width: min(100%, 360px); margin-top: 12px; }
.nattlage .nattval button { background: #0B0716; border: 1px solid #1C1430; color: #7A68A8; border-radius: 22px; padding: 20px; font-size: 18px; font-weight: 600; cursor: pointer; text-align: left; }
.nattlage .nattval button small { display: block; color: #4C3F6E; font-weight: 400; font-size: 14px; margin-top: 3px; }
.nattlage .stang { position: absolute; top: calc(18px + var(--sakert-over)); right: 18px; background: none; border: 0; color: #3E3360; font-size: 15px; cursor: pointer; padding: 10px; }
.nattlage .ordet { font-size: 34px; color: #6A5896; font-weight: 600; min-height: 50px; transition: opacity 1.5s ease; }

/* ---------- Resan ---------- */
.tidslinje { position: relative; padding-left: 28px; }
.tidslinje::before { content: ''; position: absolute; left: 9px; top: 8px; bottom: 8px; width: 2px; background: var(--linje-2); border-radius: 1px; }
.tidslinje .steg { position: relative; padding-bottom: 22px; }
.tidslinje .steg::before { content: ''; position: absolute; left: -26px; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 2px solid var(--linje-2); }
.tidslinje .steg.klar::before { background: var(--accent); border-color: var(--accent); }
.tidslinje .steg.nu::before { background: var(--bg); border: 4px solid var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 20%, transparent); }
.tidslinje .steg h4 { font-size: 18px; }
.tidslinje .steg .svag { margin-top: 2px; }
.statrad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--yta); border: 1px solid var(--linje); border-radius: 18px; padding: 14px; }
.stat b { display: block; font-size: 26px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--text-3); }
.diagram svg { width: 100%; height: auto; overflow: visible; }
.diagram .axel { stroke: var(--linje-2); stroke-width: 1; }
.diagram text { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.manad { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.manad span { aspect-ratio: 1; border-radius: 9px; background: var(--bg-2); }
.manad span.l1 { background: color-mix(in srgb, var(--accent) 30%, var(--bg-2)); }
.manad span.l2 { background: color-mix(in srgb, var(--accent) 60%, var(--bg-2)); }
.manad span.l3 { background: var(--accent); }
.manad span.idag { outline: 2px solid var(--text); outline-offset: 1px; }

/* Märken */
.marken { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.marke { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px 12px; border-radius: 20px; border: 1px solid var(--linje); background: var(--yta); cursor: pointer; font-size: 13px; font-weight: 650; color: var(--text); text-align: center; transition: transform .15s; }
.marke:active { transform: scale(.96); }
.marke svg { width: 84px; height: 84px; filter: drop-shadow(0 6px 14px rgba(42, 27, 77, .25)); }
.marke.last { color: var(--text-3); }
.marke.last svg { filter: none; opacity: .7; }
.medalj-stor { display: grid; place-items: center; margin: 6px 0 4px; }
.medalj-stor svg { width: 200px; height: 200px; filter: drop-shadow(0 18px 40px rgba(110, 79, 191, .45)); animation: medalj 1.1s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes medalj { from { transform: scale(.4) rotate(-25deg); opacity: 0; } }

/* Lektioner */
.lektion-lista { display: grid; gap: 10px; }
.lektion-rad { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 18px; background: var(--yta); border: 1px solid var(--linje); text-decoration: none; }
.lektion-rad .nr { width: 42px; height: 42px; border-radius: 13px; background: var(--bg-2); display: grid; place-items: center; font-weight: 750; color: var(--accent); flex: none; }
.lektion-rad.last .nr { background: var(--accent); color: #fff; }
.lektion-rad.last .nr svg { width: 20px; height: 20px; }
.lektion-rad.last-ej { opacity: .55; }
.artikel h1 { font-size: 34px; letter-spacing: -.03em; }
.artikel h2 { font-size: 21px; margin: 28px 0 8px; }
.artikel p { font-size: 18px; line-height: 1.65; color: var(--text); }
.testa { border-radius: var(--r); padding: 20px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--yta)), var(--yta)); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }

/* Kullen */
.inlagg { padding: 16px 0; border-top: 1px solid var(--linje); }
.inlagg:first-child { border-top: 0; }
.inlagg .vem { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--text-3); margin-bottom: 6px; }
.inlagg .vem b { color: var(--text); font-weight: 650; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex: none; }
.mentor-tagg { font-size: 12.5px; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); padding: 2px 8px; border-radius: 999px; }
.inlagg .text { white-space: pre-wrap; font-size: 16px; }
.inlagg .atgarder { display: flex; gap: 16px; margin-top: 8px; }
.inlagg .atgarder button { background: none; border: 0; padding: 6px 0; font-size: 14px; color: var(--text-3); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.inlagg .atgarder button.aktiv { color: #D2416E; }
.inlagg .atgarder svg { width: 17px; height: 17px; }
.svar { margin-left: 42px; border-left: 2px solid var(--linje); padding-left: 14px; }
.svar .inlagg { padding: 12px 0; }
.vantar { font-size: 13px; color: var(--text-3); font-style: italic; }

/* Oroslådan */
.lada { position: relative; border-radius: var(--r); padding: 26px 22px; background: linear-gradient(170deg, #3B2770, #231549); color: var(--linen); overflow: hidden; }
.lada::before { content: ''; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(160, 132, 219, .35), transparent 70%); }
.oro-rad { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--linje); align-items: flex-start; }
.oro-rad:first-child { border-top: 0; }
.oro-rad .innehall { flex: 1; }
.oro-rad .steg-text { font-size: 14px; color: var(--accent); margin-top: 3px; }
.oro-rad.klar .innehall { opacity: .5; text-decoration: line-through; }
.flytta-ner { animation: ner .9s cubic-bezier(.5, 0, .7, .4) forwards; }

/* Toast och ark */
.toast { position: fixed; left: 50%; bottom: calc(var(--flik-h) + 30px + var(--sakert-under)); transform: translateX(-50%); z-index: 200; background: var(--midnight); color: #fff; padding: 13px 20px; border-radius: 999px; font-size: 15px; font-weight: 600; box-shadow: var(--skugga-stor); animation: toast 3.2s ease forwards; max-width: calc(100% - 32px); text-align: center; }
body.natt .toast { background: var(--halo); color: var(--midnight); }
.ark-bakgrund { position: fixed; inset: 0; z-index: 150; background: rgba(15, 8, 32, .5); backdrop-filter: blur(3px); animation: in .25s ease; display: flex; align-items: flex-end; justify-content: center; }
.ark { width: min(100%, 560px); max-height: 92dvh; overflow: auto; background: var(--bg); border-radius: 28px 28px 0 0; padding: 14px 20px calc(26px + var(--sakert-under)); animation: arkupp .35s cubic-bezier(.2, .9, .3, 1); }
.ark .handtag { width: 42px; height: 5px; border-radius: 3px; background: var(--linje-2); margin: 0 auto 16px; }
@media (min-width: 700px) { .ark-bakgrund { align-items: center; } .ark { border-radius: 28px; } }

/* ---------- Landningssidan ---------- */
.landning { background: var(--linen); color: var(--midnight); }
.landning header.navrad { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--linen) 85%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--linje); }
.landning .navrad .bred { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.landning .navrad img { height: 22px; width: auto; }
.hjalte { position: relative; overflow: hidden; color: #fff; isolation: isolate; min-height: min(88dvh, 820px); display: flex; align-items: flex-end; }
.hjalte > img, .hjalte > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; animation: drift 40s ease-in-out infinite alternate; }
.hjalte::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(23, 13, 46, .25) 0%, rgba(23, 13, 46, .35) 40%, rgba(23, 13, 46, .92) 100%); }
.hjalte .bred { padding-top: 120px; padding-bottom: 64px; width: 100%; }
.hjalte .jatte { max-width: 760px; }
.hjalte .ingress { color: #E4DAF5; max-width: 560px; margin-top: 18px; font-size: 20px; }
.hjalte .knapp { margin-top: 30px; }
.hjalte .lugnande { margin-top: 14px; font-size: 14px; color: #CFC2EA; }
.sektion { padding: 88px 0; }
.sektion.mork { background: var(--midnight); color: var(--linen); --text-2: var(--ljus-text); --text-3: #A99BCF; --accent: var(--dusk); }
.sektion.halo { background: var(--halo); }
.sektion .stor { max-width: 720px; }
.tre { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 40px; }
.tre .kort h3 { margin: 14px 0 8px; }
.siffra { width: 44px; height: 44px; border-radius: 14px; background: var(--halo); color: var(--twilight); font-weight: 800; display: grid; place-items: center; font-size: 18px; }
.funktioner { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 40px; }
.funktion { border-radius: 26px; overflow: hidden; background: #fff; border: 1px solid var(--linje); box-shadow: var(--skugga); display: flex; flex-direction: column; }
.funktion .bild { aspect-ratio: 16 / 10; position: relative; overflow: hidden; background: var(--midnight); }
.funktion .bild img, .funktion .bild video { display: block; width: 100%; height: 100%; object-fit: cover; }
.natt-mock { height: 100%; background: #000; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; padding: 18px 24px; }
.natt-mock b { color: #6C5A96; font-size: 15px; font-weight: 600; margin-bottom: 4px; text-align: center; }
.natt-mock span { width: min(100%, 240px); padding: 9px 14px; border-radius: 14px; background: #0B0716; border: 1px solid #1C1430; color: #7A68A8; font-size: 14px; font-weight: 600; }
.funktion .innehall { padding: 22px; }
.funktion h3 { font-size: 21px; margin-bottom: 8px; }
.funktion p { color: var(--text-2); font-size: 16px; }
.lofte { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 40px; }
.lofte div { border-top: 1px solid rgba(255, 255, 255, .15); padding-top: 18px; }
.lofte b { display: block; font-size: 19px; margin-bottom: 6px; }
.prislapp { max-width: 460px; margin: 40px auto 0; text-align: center; }
.prislapp .belopp { font-size: 64px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.prislapp .belopp small { font-size: 20px; font-weight: 600; color: var(--text-3); letter-spacing: 0; }
.prislapp ul { list-style: none; padding: 0; margin: 26px 0; text-align: left; display: grid; gap: 12px; }
.prislapp li { display: flex; gap: 12px; align-items: flex-start; }
.prislapp li svg { width: 22px; height: 22px; color: var(--twilight); flex: none; margin-top: 1px; }
.fragor details { border-bottom: 1px solid var(--linje); padding: 20px 0; }
.fragor summary { cursor: pointer; font-weight: 650; font-size: 18px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.fragor summary::-webkit-details-marker { display: none; }
.fragor summary::after { content: '+'; font-size: 24px; line-height: 1; color: var(--twilight); transition: transform .2s; }
.fragor details[open] summary::after { transform: rotate(45deg); }
.fragor details p { margin-top: 12px; color: var(--text-2); }
.sidfot { padding: 48px 0 60px; font-size: 14px; color: var(--text-3); }
.sidfot a { color: var(--text-2); }
.telefon { width: 300px; height: 620px; border-radius: 46px; background: #0d0820; padding: 12px; box-shadow: 0 40px 90px rgba(23, 13, 46, .45), inset 0 0 0 2px #2f2550; margin: 0 auto; }
.telefon .skarm { width: 100%; height: 100%; border-radius: 36px; overflow: hidden; background: var(--linen); position: relative; }
.telefon .skarm img { width: 100%; height: 100%; object-fit: cover; }
.delad { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .delad { grid-template-columns: 1fr; } .sektion { padding: 64px 0; } }

/* Quiz */
.quiz-topp { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.framsteg { flex: 1; height: 6px; border-radius: 3px; background: var(--linje-2); overflow: hidden; }
.framsteg i { display: block; height: 100%; background: linear-gradient(90deg, var(--twilight), var(--dusk)); border-radius: 3px; transition: width .5s cubic-bezier(.3, .9, .4, 1); }
.fraga { animation: in-hoger .45s cubic-bezier(.2, .9, .3, 1) both; }
.fraga.bakat { animation-name: in-vanster; }
.fraga h2 { font-size: 28px; letter-spacing: -.025em; margin-bottom: 8px; }
.fraga .ingress { font-size: 17px; margin-bottom: 22px; }
.quiz-fot { position: sticky; bottom: 0; padding: 16px 0 calc(16px + var(--sakert-under)); background: linear-gradient(180deg, transparent, var(--bg) 30%); margin-top: 24px; }
.analys { min-height: 70dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 28px; }
.analys .rader { display: grid; gap: 10px; min-height: 120px; }
.analys .rader div { animation: upp .5s ease both; color: var(--text-2); }

/* Profil */
.profilhuvud { border-radius: 30px; overflow: hidden; position: relative; color: #fff; padding: 28px 22px; isolation: isolate; min-height: 300px; display: flex; flex-direction: column; justify-content: flex-end; }
.profilhuvud img, .profilhuvud video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.profilhuvud::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(23, 13, 46, .1), rgba(23, 13, 46, .88)); }
.citat { font-size: 20px; line-height: 1.45; font-weight: 500; letter-spacing: -.01em; }
.schema { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 16px; }
.schema div { border-radius: 14px; padding: 12px 10px; background: var(--bg-2); font-size: 13px; }
.schema div b { display: block; font-size: 14px; margin-bottom: 2px; }
.schema div.aktiv { background: var(--midnight); color: #fff; }
@media (max-width: 480px) { .schema { grid-template-columns: 1fr 1fr; } }
body.natt .schema div.aktiv { background: var(--halo); color: var(--midnight); }

/* Rapport (utskrift) */
.rapport table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.rapport th, .rapport td { padding: 7px 6px; border-bottom: 1px solid var(--linje); text-align: left; }
.rapport th { font-size: 12.5px; font-weight: 600; color: var(--text-3); }
@media print {
  body { background: #fff !important; color: #000 !important; }
  .flikar, .topp, .ej-utskrift, .toast { display: none !important; }
  .sida { padding: 0; max-width: none; }
  .kort { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  body.natt { --bg: #fff; --yta: #fff; --text: #000; --text-2: #333; --text-3: #555; --linje: #ddd; }
}

/* Admin */
.admin { max-width: 1180px; }
.admin .kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.admin table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin th, .admin td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--linje); vertical-align: top; }
.admin th { font-size: 13px; font-weight: 600; color: var(--text-3); }
.stapel-rad { display: grid; grid-template-columns: 150px 1fr 48px; gap: 10px; align-items: center; font-size: 14px; padding: 4px 0; }
.stapel-rad .stang { height: 10px; border-radius: 5px; background: var(--bg-2); overflow: hidden; }
.stapel-rad .stang i { display: block; height: 100%; background: var(--twilight); border-radius: 5px; }

/* ---------- Rörelse ---------- */
@keyframes puls { 50% { opacity: .45; } }
@keyframes snurr { to { transform: rotate(360deg); } }
@keyframes upp { from { opacity: 0; transform: translateY(10px); } }
@keyframes in { from { opacity: 0; } }
@keyframes in-hoger { from { opacity: 0; transform: translateX(28px); } }
@keyframes in-vanster { from { opacity: 0; transform: translateX(-28px); } }
@keyframes arkupp { from { transform: translateY(100%); } }
@keyframes andas { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes pratar { 0%, 100% { transform: scale(1); filter: brightness(1); } 50% { transform: scale(1.08); filter: brightness(1.15); } }
@keyframes lyssnar { 0%, 100% { box-shadow: 0 0 0 0 rgba(160, 132, 219, .5), 0 6px 22px rgba(110, 79, 191, .5); } 50% { box-shadow: 0 0 0 26px rgba(160, 132, 219, 0), 0 6px 22px rgba(110, 79, 191, .5); } }
@keyframes andning { 0%, 100% { transform: scale(.72); opacity: .55; } 40% { transform: scale(1.05); opacity: 1; } 60% { transform: scale(1.05); opacity: 1; } }
@keyframes drift { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.1) translate(-1.5%, -1%); } }
@keyframes hopp { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 12px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 6px); } }
@keyframes ner { to { opacity: 0; transform: translateY(60px) scale(.9); } }
.tona-in { animation: upp .5s ease both; }
.tona-in-2 { animation: upp .5s .08s ease both; }
.tona-in-3 { animation: upp .5s .16s ease both; }
.tona-in-4 { animation: upp .5s .24s ease both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Kullen: läge, resa, reaktioner, dagens fråga, märken */
.kull-lage { gap: 12px; }
.kull-lage .rad-mellan { font-size: 14px; font-weight: 600; opacity: .85; }
.kull-spar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.14); overflow: hidden; }
.kull-spar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #A084DB, #F2EAFA); animation: kull-fyll 1.2s cubic-bezier(.2,.8,.2,1) both; }
@keyframes kull-fyll { from { width: 0 !important; } }
.kull-tal { display: flex; gap: 22px; }
.kull-tal div { display: flex; flex-direction: column; }
.kull-tal b { font-size: 26px; font-weight: 700; line-height: 1.1; }
.kull-tal span { font-size: 13px; opacity: .75; }
.inlagg .vem { align-items: flex-start; }
.vem-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vem-text > div:first-child { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vem-under { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.resa-tagg { font-size: 12px; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); padding: 1px 8px; border-radius: 999px; }
.resa-tagg.saga { color: #fff; background: var(--accent); }
.mini-medalj { display: inline-flex; }
.inlagg .atgarder { flex-wrap: wrap; gap: 6px 14px; }
.inlagg .atgarder button.aktiv[data-typ="samma"] { color: var(--accent); }
.inlagg .atgarder button.aktiv[data-typ="heja"] { color: #C98A1C; }
.inlagg .atgarder button.puls svg { animation: reak-puls .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes reak-puls { 0% { transform: scale(1); } 45% { transform: scale(1.45); } 100% { transform: scale(1); } }
.inlagg .atgarder .anmal { margin-left: auto; opacity: .6; }
.marke-inlagg .marke-rad { display: flex; gap: 14px; align-items: center; padding: 10px 12px; border-radius: 16px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent); }
.marke-inlagg .marke-rad svg { flex: none; animation: medalj-in .7s cubic-bezier(.2,1.4,.4,1) both; }
.marke-inlagg .marke-rad p { margin: 2px 0 0; font-size: 14px; color: var(--text-3); }
@keyframes medalj-in { from { transform: scale(.6) rotate(-12deg); opacity: 0; } }
.saga-inlagg .text { background: color-mix(in srgb, var(--accent) 7%, transparent); border-radius: 14px; padding: 12px 14px; }
.dagens-fraga { border: 1.5px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.dagens-fraga .inlagg:first-of-type { border-top: 1px solid var(--linje); }
.nattsallskap { display: flex; align-items: center; gap: 10px; justify-content: center; font-size: 15px; opacity: .85; margin-top: 4px; }
.nattsallskap i { width: 8px; height: 8px; border-radius: 50%; background: #A9C8F0; box-shadow: 0 0 0 0 rgba(169,200,240,.6); animation: natt-puls 2.4s infinite; }
@keyframes natt-puls { 70% { box-shadow: 0 0 0 10px rgba(169,200,240,0); } 100% { box-shadow: 0 0 0 0 rgba(169,200,240,0); } }

/* Looparna tonar in över stillbilden när de börjar spelas, så det aldrig blinkar. */
video.bg, .bildval button video, .hjalte > video, .funktion .bild video, .profilhuvud video { opacity: 0; transition: opacity .8s ease; background: transparent; }
video.spelar { opacity: 1; }
.bildval button video { z-index: -1; }

/* Profilen: utgångsläget som bild, resan som tidslinje med datum. */
.p-lage { display: flex; gap: 20px; align-items: center; }
.p-ring-yta { width: 128px; flex: none; }
.p-ring-yta svg { width: 100%; height: auto; display: block; }
.p-ring { animation: p-ring 1.4s cubic-bezier(.2, .8, .2, 1) both .3s; }
@keyframes p-ring { from { stroke-dasharray: 0 314; } }
.p-stort { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.p-natt { display: grid; gap: 6px; font-size: 13px; color: #CDBFEA; }
.p-natt-stapel { display: flex; height: 14px; border-radius: 99px; overflow: hidden; gap: 3px; }
.p-natt-stapel i { display: block; border-radius: 99px; animation: kull-fyll 1.2s cubic-bezier(.2, .8, .2, 1) both .4s; }
.p-natt-stapel .sov { background: linear-gradient(90deg, #A084DB, #E2D5FA); }
.p-natt-stapel .vaken { background: #E0558C; }
.p-vaken-text { color: #F4A3C0; font-weight: 600; }
.p-tidslinje { list-style: none; margin: 18px 0 0; padding: 0; position: relative; display: grid; gap: 18px; }
.p-tidslinje::before { content: ''; position: absolute; left: 21px; top: 22px; bottom: 22px; width: 2px; background: linear-gradient(var(--twilight), var(--linje-2)); }
.p-tidslinje li { display: flex; gap: 14px; align-items: flex-start; position: relative; animation: upp .45s ease both; animation-delay: calc(var(--i) * .12s + .2s); }
.p-prick { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--yta); border: 2px solid var(--linje-2); color: var(--accent); }
.p-prick svg { width: 20px; height: 20px; }
.p-tidslinje li:last-child .p-prick { border: 0; background: none; }
.p-tidslinje li:last-child .p-prick svg { width: 44px; height: 44px; }
.p-tidslinje li.nu .p-prick { background: var(--twilight); border-color: var(--twilight); color: #fff; box-shadow: 0 0 0 6px color-mix(in srgb, var(--twilight) 18%, transparent); }
.p-datum { font-size: 13px; font-weight: 700; color: var(--accent); }
.p-tidslinje b { display: block; font-size: 17px; margin-top: 1px; }
.p-tidslinje p { margin: 2px 0 0; font-size: 15px; color: var(--text-3); }
.p-tva { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.p-tva .kort { gap: 6px; padding: 16px; }
.p-tva .analys-folk i { border-color: var(--yta); width: 26px; height: 26px; }
.p-tillbaka { display: flex; gap: 14px; align-items: flex-start; }
.p-tillbaka-ikon { width: 46px; height: 46px; flex: none; border-radius: 15px; background: color-mix(in srgb, #E0558C 14%, transparent); color: #D2416E; display: grid; place-items: center; }
.p-tillbaka-ikon svg { width: 22px; height: 22px; }
.p-tillbaka h3 { font-size: 20px; margin: 2px 0 4px; }
