/* Sömntestet: förlopp i fyra delar, bildkort, piller, klocka, staplar, kort mellan frågorna och analysen. */
.quiz-topp { gap: 12px; margin-bottom: 22px; }
.q-delar { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.q-del small { display: block; font-size: 10.5px; color: var(--text-3); margin-top: 5px; text-align: center; white-space: nowrap; font-weight: 600; transition: color .3s; }
.q-del.aktiv small { color: var(--accent); }
.q-fyllning { display: block; height: 6px; border-radius: 3px; background: var(--linje-2); overflow: hidden; position: relative; }
.q-fyllning i { position: absolute; inset: 0; background: linear-gradient(90deg, var(--twilight), var(--dusk)); transform-origin: left; transform: scaleX(0); transition: transform .6s cubic-bezier(.3, .9, .4, 1); border-radius: 3px; }
.q-del.klar .q-fyllning { box-shadow: 0 0 10px rgba(160, 132, 219, .7); }
@media (max-width: 340px) { .q-del small { display: none; } }

.q-bildkort { display: grid; gap: 10px; }
.q-bildkort button, .q-ikonkort button { position: relative; border: 1.5px solid var(--linje-2); background: var(--yta); border-radius: 22px; cursor: pointer; color: var(--text); transition: transform .25s cubic-bezier(.3, 1.6, .5, 1), border-color .2s, background .2s, box-shadow .2s; -webkit-tap-highlight-color: transparent; }
.q-bildkort button { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 8px 16px; font-size: 16px; }
.q-bildkort .q-illu { width: 72px; height: 72px; border-radius: 22px; background: var(--bg-2); color: var(--accent); display: grid; place-items: center; transition: background .2s, color .2s; }
.q-bildkort .q-illu svg { width: 46px; height: 46px; }
.q-ikonkort { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.q-ikonkort button { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; text-align: left; font-size: 15.5px; line-height: 1.3; min-height: 128px; }
.q-ikonkort .q-illu { width: 48px; height: 48px; border-radius: 15px; background: var(--bg-2); color: var(--accent); display: grid; place-items: center; }
.q-ikonkort .q-illu svg { width: 32px; height: 32px; }
.q-bildkort button[aria-pressed="true"], .q-ikonkort button[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--yta)); transform: scale(1.04); box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 25%, transparent); }
.q-bildkort button[aria-pressed="true"] .q-illu, .q-ikonkort button[aria-pressed="true"] .q-illu { background: var(--accent); color: #fff; }
.q-bock { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform .3s cubic-bezier(.3, 1.8, .5, 1); }
.q-bock::after { content: ""; position: absolute; left: 8px; top: 4px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
[aria-pressed="true"] > .q-bock { transform: scale(1); }

.q-piller { display: flex; flex-wrap: wrap; gap: 10px; }
.q-piller button { border: 1.5px solid var(--linje-2); background: var(--yta); border-radius: 999px; padding: 15px 22px; font-size: 17px; font-weight: 600; cursor: pointer; transition: all .25s cubic-bezier(.3, 1.6, .5, 1); color: var(--text); }
.q-piller button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; transform: scale(1.06); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 35%, transparent); }
.q-piller-flera button { font-size: 16px; padding: 13px 18px; }

.q-tidslinje { position: relative; display: grid; gap: 10px; padding-left: 26px; }
.q-tidslinje::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 22px; width: 3px; border-radius: 2px; background: linear-gradient(var(--dusk), var(--twilight)); opacity: .5; }
.q-tidslinje button { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 18px; border: 1.5px solid var(--linje-2); background: var(--yta); font-size: 17px; cursor: pointer; color: var(--text); text-align: left; transition: all .25s cubic-bezier(.3, 1.6, .5, 1); position: relative; }
.q-punkt { position: absolute; left: -23px; width: calc(12px + var(--i) * 3px); height: calc(12px + var(--i) * 3px); border-radius: 50%; background: var(--yta); border: 3px solid var(--dusk); transition: all .25s; }
.q-tidslinje button[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--yta)); transform: translateX(4px); }
.q-tidslinje button[aria-pressed="true"] .q-punkt { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 20%, transparent); }

.q-klocka { display: grid; justify-items: center; gap: 18px; padding: 10px 0; }
.q-klocka-ikon { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #fff, var(--halo) 40%, color-mix(in srgb, var(--dusk) 50%, var(--halo))); color: var(--twilight); box-shadow: 0 12px 34px rgba(110, 79, 191, .3); }
.q-klocka-ikon svg { width: 42px; height: 42px; }
.tidtal.puls { animation: tidpuls .3s ease; }
@keyframes tidpuls { 50% { transform: scale(1.06); color: var(--accent); } }

.q-staplar { display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: 260px; gap: 8px; }
.q-staplar button { min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer; color: var(--text); padding: 0; }
.q-stapel { width: 100%; height: var(--h); border-radius: 14px 14px 8px 8px; background: linear-gradient(180deg, color-mix(in srgb, var(--dusk) 55%, var(--yta)), var(--bg-2)); border: 1.5px solid var(--linje-2); transition: all .3s cubic-bezier(.3, 1.6, .5, 1); transform-origin: bottom; animation: stapel .6s cubic-bezier(.3, 1.3, .5, 1) both; }
.q-staplar button:nth-child(2) .q-stapel { animation-delay: .05s; } .q-staplar button:nth-child(3) .q-stapel { animation-delay: .1s; }
.q-staplar button:nth-child(4) .q-stapel { animation-delay: .15s; } .q-staplar button:nth-child(5) .q-stapel { animation-delay: .2s; } .q-staplar button:nth-child(6) .q-stapel { animation-delay: .25s; }
.q-staplar button b { font-size: 13px; font-weight: 650; text-align: center; line-height: 1.2; min-height: 32px; }
.q-staplar button[aria-pressed="true"] .q-stapel { background: linear-gradient(180deg, var(--dusk), var(--twilight)); border-color: var(--twilight); transform: scaleY(1.06); box-shadow: 0 10px 26px rgba(110, 79, 191, .4); }
@keyframes stapel { from { transform: scaleY(0); } }

.q-samtycke { display: grid; gap: 10px; margin-top: 6px; padding: 14px 16px; border-radius: 16px; background: var(--bg-2); }
.q-samtycke .kryss { font-size: 14px; align-items: center; }
.q-samtycke .kryss input { width: 22px; height: 22px; }

.sprak { position: fixed; z-index: 300; width: 7px; height: 7px; border-radius: 50%; background: var(--dusk); pointer-events: none; animation: sprak .6s cubic-bezier(.2, .8, .3, 1) forwards; }
.sprak:nth-of-type(3n) { background: var(--twilight); }
.sprak:nth-of-type(3n+1) { background: #F4C9A0; }
@keyframes sprak { to { transform: translate(var(--vx), var(--vy)) scale(.2); opacity: 0; } }

.q-info { display: grid; gap: 16px; padding: 22px; border-radius: 26px; background: linear-gradient(170deg, var(--yta), var(--bg-2)); border: 1px solid var(--linje); box-shadow: var(--skugga); }
.q-info h2 { font-size: 26px; }
.q-personer { display: flex; gap: 6px; justify-content: center; }
.q-personer span { width: 64px; height: 64px; border-radius: 20px; background: var(--bg-2); color: var(--text-3); display: grid; place-items: center; animation: upp .5s ease both; }
.q-personer span:nth-child(2) { animation-delay: .1s; } .q-personer span:nth-child(3) { animation-delay: .2s; }
.q-personer span.markerad { background: var(--accent); color: #fff; box-shadow: 0 10px 24px rgba(110, 79, 191, .4); }
.q-personer svg { width: 40px; height: 40px; }
.q-matare { max-width: 260px; margin: 0 auto; width: 100%; }
.q-matare svg { width: 100%; height: auto; }
.q-nal { transform-origin: 100px 100px; animation: nal 1.6s cubic-bezier(.3, 1.4, .5, 1) both .3s; }
@keyframes nal { from { transform: rotate(-120deg); } }
.q-natt { display: grid; gap: 10px; padding: 16px; border-radius: 18px; background: var(--midnight); color: #fff; }
.q-natt-tider { display: flex; justify-content: space-between; font-weight: 700; font-size: 18px; }
.q-natt-tider span { display: flex; align-items: center; gap: 6px; }
.q-natt-tider svg { width: 20px; height: 20px; color: var(--dusk); }
.q-natt-band { display: flex; height: 26px; border-radius: 13px; overflow: hidden; background: rgba(255, 255, 255, .08); }
.q-natt-band i { display: block; height: 100%; width: var(--w); animation: band 1.2s cubic-bezier(.3, .9, .4, 1) both .2s; transform-origin: left; }
.q-natt-band i.sov { background: linear-gradient(90deg, #6E4FBF, #A084DB); }
.q-natt-band i.vaken { background: repeating-linear-gradient(45deg, rgba(244, 201, 160, .55) 0 6px, rgba(244, 201, 160, .3) 6px 12px); animation-delay: .9s; }
@keyframes band { from { transform: scaleX(0); } }
.q-etikett { font-size: 13px; font-weight: 650; }
.q-etikett.sov { color: var(--dusk); } .q-etikett.vaken { color: #F4C9A0; }
.q-lista { display: grid; gap: 10px; }
.q-lista-rad { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--text-2); animation: upp .5s ease both; }
.q-lista-rad:nth-child(2) { animation-delay: .15s; } .q-lista-rad:nth-child(3) { animation-delay: .3s; } .q-lista-rad:nth-child(4) { animation-delay: .45s; }
.q-kryss, .q-ja { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.q-kryss { background: rgba(224, 85, 140, .14); color: #D2416E; }
.q-kryss svg, .q-ja svg { width: 15px; height: 15px; }
.q-ja { background: var(--accent); color: #fff; }
.q-lista-ja { color: var(--text); padding-top: 12px; border-top: 1px solid var(--linje); animation-delay: .6s; }
.q-kurva svg { width: 100%; height: auto; }
.q-kurvlinje { stroke-dasharray: 400; stroke-dashoffset: 400; animation: rita 1.8s ease forwards .2s; }
@keyframes rita { to { stroke-dashoffset: 0; } }
.q-kurva-etiketter { display: grid; grid-template-columns: 1fr 1fr 1fr; font-size: 11.5px; color: var(--text-3); line-height: 1.3; margin-top: 4px; }
.q-kurva-etiketter .mitt { text-align: center; color: #D2416E; }
.q-kurva-etiketter .hoger { text-align: right; color: var(--accent); font-weight: 650; }

.analys-ring { --p: 0; width: 180px; height: 180px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--twilight) calc(var(--p) * 360deg), var(--bg-2) 0); position: relative; transition: transform .4s, box-shadow .4s; }
.analys-ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--bg); }
.analys-ring b { position: relative; font-size: 40px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.analys-ring.klar { transform: scale(1.08); box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 15%, transparent), 0 20px 50px rgba(110, 79, 191, .4); }
.analys-steg { display: grid; gap: 12px; width: min(100%, 360px); text-align: left; min-height: 260px; }
.analys-steg > div { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--text-2); animation: upp .4s ease both; }
.analys-ikon { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--linje-2); border-top-color: var(--accent); animation: snurr .8s linear infinite; }
.analys-steg .klar { color: var(--text); }
.analys-steg .klar .analys-ikon { animation: none; border: 0; background: var(--accent); position: relative; }
.analys-steg .klar .analys-ikon::after { content: ""; position: absolute; left: 7px; top: 4px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.2px 2.2px 0; transform: rotate(45deg); }
.q-nal-ner { animation-name: nalner; } @keyframes nalner { from { transform: rotate(80deg); } }
.coach-kort { display: block; font-size: 13px; font-weight: 500; color: var(--text-3); margin-top: 2px; }

/* Orsakskortet: den onda cirkeln ritas upp, sedan dyker brytpunkten upp. */
.q-cirkel { max-width: 320px; margin: 0 auto; width: 100%; }
.q-cirkel svg { width: 100%; height: auto; overflow: visible; }
.q-cirkel .q-sen { animation-delay: .9s; }
.q-cirkel .q-senare { animation-delay: 1.6s; }
.q-bryt { opacity: 0; transform-origin: 236px 96px; animation: bryt .6s cubic-bezier(.3, 1.6, .5, 1) forwards 2.6s; }
@keyframes bryt { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: scale(1); } }
/* Udda antal ikonkort: det sista tar hela raden. */
.q-ikonkort button:last-child:nth-child(odd) { grid-column: 1 / -1; flex-direction: row; align-items: center; min-height: 0; }

.q-samtycke > p { font-size: 14px; color: var(--text-3); margin: 0 0 10px; line-height: 1.45; }

/* Analysen: en andande måne i ringen, små resultat per rad och frågor som dyker upp. */
.analys-ring { position: relative; }
.analys-ring .orb { position: absolute; width: 96px; height: 96px; opacity: .22; }
.analys-steg > div { align-items: flex-start; }
.analys-text { display: grid; gap: 8px; min-width: 0; flex: 1; padding-top: 1px; }
.analys-resultat { animation: upp .35s ease both; }
.analys-natt { display: grid; gap: 4px; }
.analys-natt > div { height: 10px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.analys-natt i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--twilight), var(--dusk)); animation: kull-fyll 1s cubic-bezier(.2, .8, .2, 1) both; }
.analys-natt span, .analys-folk span, .analys-plats span { font-size: 13px; color: var(--text-3); }
.analys-folk { display: flex; align-items: center; }
.analys-folk i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--bg); margin-left: -6px; animation: upp .3s ease both; }
.analys-folk i:first-child { margin-left: 0; }
.analys-folk i:nth-child(2) { animation-delay: .06s; } .analys-folk i:nth-child(3) { animation-delay: .12s; } .analys-folk i:nth-child(4) { animation-delay: .18s; } .analys-folk i:nth-child(5) { animation-delay: .24s; }
.analys-folk span { margin-left: 10px; }
.analys-chip { display: inline-flex; align-items: center; gap: 6px; width: max-content; padding: 4px 12px; border-radius: 99px; font-size: 14px; font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.analys-chip svg { width: 16px; height: 16px; }
.analys-plats { display: flex; align-items: center; gap: 10px; }
.analys-plats img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; }
.analys-fraga { position: fixed; inset: 0; z-index: 50; background: rgba(23, 13, 46, .45); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; padding: 16px; animation: tona .25s ease both; }
.analys-fraga.ut { opacity: 0; transition: opacity .25s ease; }
.analys-fraga-kort { width: min(100%, 460px); background: var(--yta); border-radius: 26px; padding: 24px 22px 20px; box-shadow: 0 30px 80px rgba(23, 13, 46, .35); animation: upp .35s cubic-bezier(.2, 1.2, .4, 1) both; }
.analys-fraga-etikett { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 700; color: var(--accent); }
.analys-fraga-etikett svg { width: 16px; height: 16px; }
.analys-fraga-kort h3 { font-size: 22px; margin: 10px 0 6px; line-height: 1.2; }
.analys-fraga-kort p { color: var(--text-3); font-size: 15px; margin: 0 0 18px; }
.analys-fraga-knappar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@keyframes tona { from { opacity: 0; } }
