/* for-dig.css — step 12: Läs in three tabs, För dig and Din vecka (design patch-steg12/design).
   Load after css/kom-igang.css. Uses only the app's tokens; light and dark follow them.
   Din vecka is a plan, not a reward: square boxes in a list, no seven-day row, no gold (Dagens paket owns those). */

/* ---- three tabs at 360 px: a filled track with a raised active tab, so new learners see them (2026-09-29) ---- */
.libhead .lasseg { display: flex; width: 100%; gap: 4px; padding: 4px; border: 0; border-radius: 14px; background: var(--sunk); }
.libhead .lasseg button { flex: 1 1 0; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; min-width: 0; border-radius: 10px; font-weight: 600; color: var(--granite); }
.libhead .lasseg button.on { background: var(--card); color: var(--blue-ink); box-shadow: 0 1px 3px rgba(0,0,0,.14), inset 0 -3px 0 var(--blue-ink); }
@media (prefers-color-scheme: dark) { .libhead .lasseg button.on { background: var(--blue-soft); } } /* --card is too close to --sunk in dark */
@media (max-width: 420px) {
  .libhead .lasseg button { padding: .5em .4em; font-size: .86rem; }
  .libhead .lasseg button svg { display: none; }
}

/* ---- the two cards above the tabs ---- */
.lasidag { display: grid; gap: 12px; margin: 12px 0 6px; }
.fordig, .dinvecka { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 10px; }
.fdhead, .dvhead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.fdhead h2, .dvhead h2 { margin: 0; font: 500 1.15rem/1.2 var(--serif, Charter, Georgia, serif); color: var(--ink); }

/* För dig (2026-09-29): a tip banner, not a button. Soft yellow with a stripe, so it never looks like the blue
   Fortsätt läsa; folded it is two lines (the serial, then Steg · situations); the header toggles it. */
:root { --tip-soft: #fbf3d9; --tip-line: #e6c65a; }
@media (prefers-color-scheme: dark) { :root { --tip-soft: #2b2616; --tip-line: #8a7224; } }
.lasidag > .fordig { background: var(--tip-soft); border: 1px solid var(--tip-line); border-left-width: 5px; border-radius: 12px; padding: 4px 10px; gap: 6px; }
.fordig .fdhead { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 4px 0; border: 0; background: transparent; color: var(--ink); text-align: left; }
.fdart { width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--card); display: grid; place-items: center; font-size: .78rem; line-height: 1; overflow: hidden; white-space: nowrap; }
.fdtext { flex: 1; min-width: 0; display: grid; gap: 1px; }
.fdkicker { font-size: .66rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--faint); }
.fdtext b { font-size: .92rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fdtext small { font-size: .78rem; line-height: 1.35; color: var(--granite); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fordig .fdhead .lasvik { margin: 0; }
.fdmer { display: grid; gap: 8px; padding-bottom: 8px; }
.fdunder { margin: 0; font-size: .82rem; color: var(--granite); }
.fordig.ihop .fdmer { display: none; }
.fdsit { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); text-align: left; }
.fdsit:hover, .fdsit:focus-visible { background: var(--blue-soft); }
.fdsit .fdtext small { color: var(--granite); opacity: 1; }
.fdsit .fdtext small.fden { font-style: italic; }
.fdsitart { width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--sunk); display: grid; place-items: center; }
.fdval { margin: 0; font-size: .82rem; color: var(--granite); }

/* the can-do mark, on För dig and on Situationer cards */
.nkan { flex: none; font-size: .7rem; font-weight: 700; padding: .2em .6em; border-radius: 999px; background: var(--sunk); color: var(--granite); white-space: nowrap; }
/* The answer is a prefixed class (kan-ja / kan-hjalp / kan-nej): a bare "hjalp" is the help sheet's class in
   css/hjalp.css (position: fixed; inset: 0), which turned a "Med hjälp" badge into a full-screen layer. */
.nkan.kan-nej { background: var(--blue-soft); color: var(--blue-ink); }

/* Din vecka */
.dvantal { font-size: .78rem; font-weight: 600; color: var(--granite); }
.dvmin, .dvdag, .dvvila, .dvrecept, .dvregel { margin: 0; font-size: .8rem; color: var(--granite); }
.dvdag { font-size: .66rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--faint); margin-top: 2px; }
.dvlista { list-style: none; margin: 0; padding: 0; display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.dvrad { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 6px 8px 12px; }
.dvrad + .dvrad { border-top: 1px solid var(--line); }
.dvbox { width: 22px; height: 22px; flex: none; border: 2px solid var(--line); border-radius: 6px; display: grid; place-items: center; }
.dvrad.klar .dvbox { background: var(--ok); border-color: var(--ok); }
.dvrad.klar .dvtext b { color: var(--granite); }
.dvrad.last .dvbox { border-style: dashed; color: var(--faint); }
.dvtext { flex: 1; min-width: 0; display: grid; gap: 2px; }
.dvtext b { font-size: .9rem; font-weight: 600; color: var(--ink); }
.dvtext small { font-size: .78rem; line-height: 1.35; color: var(--granite); }
.dvrad.last .dvtext small { color: var(--ink); }
.dvga { width: 44px; height: 44px; flex: none; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--blue-ink); display: grid; place-items: center; }
.dvga:hover, .dvga:focus-visible { background: var(--blue-soft); }
.dvrecept { padding-top: 8px; border-top: 1px dashed var(--line); }
.dvsr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Berättelser: the approximate badge for stories without a Steg ---- */
.nsteg.ca { background: transparent; border: 1px solid var(--line); color: var(--granite); }

/* ---- Situationer: one section per life area ---- */
.libsek[data-omrade] { margin-top: 1.2em; }
.libsek[data-omrade]:first-of-type { margin-top: .6em; }
.ncard .nkan { align-self: flex-start; }

/* ---- folding (Linh, 2026-09-28): each card keeps its main line when folded ---- */
.fdhead .nsteg { margin-left: auto; }
.lasvik { flex: none; width: 36px; height: 36px; margin: -6px -6px -6px 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--granite); display: grid; place-items: center; transform: rotate(90deg); transition: transform .15s; }
.lasvik:hover, .lasvik:focus-visible { background: var(--sunk); }
.ihop .lasvik { transform: rotate(0deg); }
.dvhead .dvantal { margin-left: auto; }
.dinvecka.ihop > :not(.dvhead):not(.dvkort) { display: none; }
.dinvecka:not(.ihop) > .dvkort { display: none; }
.dinvecka.ihop { gap: 6px; }
.dvkort { margin: 0; display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: .9rem; font-weight: 600; color: var(--ink); }
.dvkorttext { flex: 1; min-width: 0; }
.dvkort.klar { color: var(--granite); }
.dvkort.klar .dvbox { background: var(--ok); border-color: var(--ok); }

/* ---- the story's introduction in the reader (2026-09-29): a quiet card above episode 1, not an episode ---- */

/* ---- Vill du ha mer? (step 13): a quiet row under För dig, neither the blue path nor the yellow tip ---- */
.fdmerkort { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 10px; border: 1.5px dashed var(--blue-line); border-radius: 12px; background: var(--card); color: var(--ink); text-align: left; }
.fdmerkort:hover, .fdmerkort:focus-visible { background: var(--blue-soft); }
.fdmerikon { width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--blue-soft); color: var(--blue-ink); display: grid; place-items: center; }
.fdmerpil { flex: none; color: var(--blue-ink); display: grid; place-items: center; }
.jamfor { display: grid; gap: 6px; margin-top: 10px; }
.jamfortext { font-size: .82rem; color: var(--granite); }
.jamfor .valseg { display: flex; width: 100%; }
.jamfor .valseg button { flex: 1 1 0; }
.franprofil { display: block; margin-top: 6px; font-size: .78rem; color: var(--granite); }

/* ---- Din vecka as a card (Linh, 2026-09-29): a coloured header with a ring, the next row highlighted.
   Blue to teal while rows are left, green when the day is done; the ring fills with the ticks. ---- */
.lasidag > .dinvecka { padding: 0; gap: 0; border: 0; border-radius: 18px; overflow: hidden; box-shadow: 0 6px 20px rgba(116, 63, 142,.16), 0 1px 3px rgba(0,0,0,.08); }
.dinvecka .dvhead { align-items: center; gap: 12px; padding: 14px 12px 14px 16px; background: linear-gradient(135deg, #743f8e 0%, #5a2f73 100%); color: #fff; }
.dinvecka.alla .dvhead { background: linear-gradient(135deg, #2f7d4f 0%, #3f9a6a 100%); }
.dvtitel { flex: 1; min-width: 0; display: grid; gap: 3px; }
.dinvecka .dvhead h2 { color: #fff; font-size: 1.3rem; }
.dinvecka .dvhead .dvmin { color: rgba(255,255,255,.88); }
.dinvecka .dvhead .link { color: #fff; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.dinvecka .dvhead .lasvik { color: #fff; }
.dinvecka .dvhead .lasvik:hover, .dinvecka .dvhead .lasvik:focus-visible { background: rgba(255,255,255,.18); }
.dvring { position: relative; width: 48px; height: 48px; flex: none; display: grid; place-items: center; }
.dvring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.dvringbak { fill: rgba(255,255,255,.12); stroke: rgba(255,255,255,.28); stroke-width: 4; }
.dvringfram { fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; transition: stroke-dasharray .4s; }
.dvring b { position: relative; font-size: .82rem; font-weight: 700; }
.dinvecka > .dvlista { margin: 12px; }
.dinvecka > .dvkort { padding: 6px 12px 6px 16px; }
.dinvecka > .dvvila { padding: 0 16px 12px; }
.dvrad.nu { background: var(--blue-soft); }
.dvrad.nu .dvbox { border-color: var(--blue-ink); }
.dvrad.nu .dvga { width: 40px; height: 40px; margin-right: 4px; background: var(--blue); color: var(--on-blue); box-shadow: 0 2px 6px rgba(116, 63, 142,.35); }
.dvrad.nu .dvga:hover, .dvrad.nu .dvga:focus-visible { background: var(--blue); filter: brightness(1.12); }
@media (prefers-color-scheme: dark) { .lasidag > .dinvecka { background: var(--card); box-shadow: 0 6px 20px rgba(0,0,0,.4); } }

@media (prefers-reduced-motion: reduce) { .dvringfram { transition: none; } }
@media (prefers-reduced-motion: reduce) { .fdserie, .fdsit, .dvga, .lasvik { transition: none; } }

/* För dig opens its story, and För dig and Vill du ha mer? can be closed (Linh, 2026-09-29). */
.fordig .fdhead { display: flex; align-items: center; gap: 6px; min-height: 48px; padding: 0; }
.fordig .fdheadknapp { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; min-height: 48px; padding: 4px 0; border: 0; background: transparent; color: var(--ink); text-align: left; }
.fordig .fdspela, .lasstart .fdspela { flex: none; width: 36px; height: 36px; padding: 0; border-radius: 50%; display: grid; place-items: center; }
/* Berättelser for a learner who has chosen nothing yet (DV-1): one quiet line instead of the För dig banner. */
.lasstart { display: flex; align-items: center; justify-content: space-between; gap: .75em; margin: .4em 0 .8em; padding: .55em .7em .55em .9em; border: 1px dashed var(--line); border-radius: 12px; color: var(--granite); }
.fdstang { flex: none; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--granite); font-size: 1.25rem; line-height: 1; }
.fdmerrad { display: flex; align-items: center; gap: 6px; }
.fdmerrad .fdmerkort { flex: 1; min-width: 0; }
/* The serial's name may take two lines now that the row also holds ▶ and × (2026-09-29). */
.fordig .fdheadknapp .fdserie { white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-overflow: clip; }

/* Episode 0, the introduction (2026-09-29): its stop in the line, and the English version folded. */
.line .stop.intro { font-style: italic; }
.epintroen { margin: 8px 0; font-size: .9rem; color: var(--granite); }
.epintroen summary { cursor: pointer; font-weight: 600; }
.epintroen p { margin: 6px 0 0; line-height: 1.45; }
.introslut { display: flex; justify-content: center; }
.introslut button { min-height: 48px; padding: 0 24px; }

/* The day's plan done (Linh, 2026-10-01): the folded card turns gold */
.dinvecka.alla { background: linear-gradient(135deg, #fff6d6 0%, #ffe9a8 100%); border-color: #e3c25a; }
.dinvecka.alla .dvhead { background: linear-gradient(135deg, #b8860b 0%, #d9a826 100%); }
.dinvecka.alla > .dvkort.klar { color: #5a3e05; }
.dinvecka.alla > .dvkort.klar .dvbox { background: #c9960f; border-color: #c9960f; }
.dvguld { margin-left: auto; font-size: 1.1rem; animation: dvguld 1.6s ease-in-out infinite alternate; }
@keyframes dvguld { from { transform: scale(.9) rotate(-8deg); opacity: .7; } to { transform: scale(1.15) rotate(8deg); opacity: 1; } }
@media (prefers-color-scheme: dark) { .dinvecka.alla { background: linear-gradient(135deg, #3a2e0f 0%, #4a3a12 100%); border-color: #8a6d1c; } .dinvecka.alla > .dvkort.klar { color: #f3d98a; } }
@media (prefers-reduced-motion: reduce) { .dvguld { animation: none; } }

/* A brand-new learner (no study session yet): one line that says what the card is (Linh, 2026-10-03) */
.dinvecka .dvny { margin: 0; padding: 8px 16px; font-size: .9rem; color: var(--ink); background: #fff8e1; border-top: 1px solid #f0dfa0; border-bottom: 1px solid #f0dfa0; }
@media (prefers-color-scheme: dark) { .dinvecka .dvny { background: #3a2e0f; border-color: #6b531a; color: #f3d98a; } }

/* ---- Din vecka as the hero (Linh, 2026-10-03: it should look like the important thing, for everyone) ----
   A kicker over the title, a taller header with a bigger ring and a soft highlight, a hairline of blue around the
   card, the next step with an accent bar and a slow pulse on its button. The pulse stops with reduced motion. */
.lasidag > .dinvecka { box-shadow: 0 10px 28px rgba(116, 63, 142,.22), 0 1px 3px rgba(0,0,0,.08); outline: 1.5px solid rgba(116, 63, 142,.25); outline-offset: 0; }
.lasidag > .dinvecka.alla { outline-color: rgba(47,125,79,.3); box-shadow: 0 10px 28px rgba(47,125,79,.2), 0 1px 3px rgba(0,0,0,.08); }
.dinvecka .dvhead { padding: 16px 14px 16px 18px; background: radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 55%), linear-gradient(135deg, #17458f 0%, #2a78a8 100%); }
.dinvecka.alla .dvhead { background: radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 55%), linear-gradient(135deg, #2b7449 0%, #3f9a6a 100%); }
.dvkicker { font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.8); }
.dinvecka .dvhead h2 { font-size: 1.5rem; letter-spacing: -.01em; }
.dinvecka .dvring { width: 56px; height: 56px; }
.dinvecka .dvring b { font-size: .9rem; }
.dinvecka .dvringbak { stroke-width: 4.5; } .dinvecka .dvringfram { stroke-width: 4.5; }
.dinvecka .dvrad { min-height: 56px; }
.dinvecka .dvrad.nu { position: relative; background: var(--blue-soft); }
.dinvecka .dvrad.nu::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--blue); }
.dinvecka .dvrad.nu .dvtext b { font-size: 1.02rem; color: var(--blue-ink); }
.dinvecka .dvrad.nu .dvga { width: 44px; height: 44px; animation: dvpuls 2.6s ease-in-out infinite; }
@keyframes dvpuls { 0%, 100% { box-shadow: 0 2px 6px rgba(116, 63, 142,.35), 0 0 0 0 rgba(116, 63, 142,.35); } 55% { box-shadow: 0 2px 6px rgba(116, 63, 142,.35), 0 0 0 9px rgba(116, 63, 142,0); } }
.framrubrik { margin: 1.1em 0 .3em; font-size: 1.25rem; }
@media (prefers-color-scheme: dark) { .lasidag > .dinvecka { outline-color: rgba(120,170,230,.3); } .dinvecka .dvrad.nu .dvtext b { color: #cfe3ff; } }
@media (prefers-reduced-motion: reduce) { .dinvecka .dvrad.nu .dvga { animation: none; } }
body.stilla .dinvecka .dvrad.nu .dvga { animation: none; }

/* The slot's placeholder before the first card (js/glosor.js, 2026-10-04): the card's size, a quiet shimmer */
.dinvecka.dvskelett { min-height: 196px; padding: 0; border: 0; background: linear-gradient(90deg, var(--line) 25%, var(--card) 50%, var(--line) 75%); background-size: 200% 100%; opacity: .5; animation: dvskelett 1.4s linear infinite; }
@keyframes dvskelett { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .dinvecka.dvskelett { animation: none; } }

/* The adaptive plan (DV-2): the day's line, the once-only goal note, and the 'om du hinner' rows (never counted in the ring). */
.dinvecka .dvlage { margin: 0; padding: 8px 16px; font-size: .9rem; color: var(--ink); }
.dinvecka .dvmal { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin: 0; padding: 8px 16px; font-size: .85rem; color: var(--granite); border-bottom: 1px solid var(--line); }
.dinvecka .dvmal .dvmalok { margin-left: auto; background: none; border: 0; color: var(--granite); font-size: 1.1rem; padding: 0 4px; min-height: 0; }
.dvrad.valfri .dvtext b { font-weight: 500; }
.dvrad .dvvalfri { font-size: .75rem; font-weight: 400; color: var(--granite); white-space: nowrap; }
