/* studiesprak.css — study languages (steg 16, design "Studiespråk - steg 16"): the Studiespråk row, the enrol flow's
   own parts (it reuses .kig* from kom-igang.css), the switcher chip and its sheet, the one-time toast.
   Load AFTER kom-igang.css and for-dig.css. Tokens only: flips with prefers-color-scheme. */

/* ============================================================ 1. the row in Inställningar → Lärande */
.stp { display: flex; flex-direction: column; gap: 10px; }
.stpseg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
#moreView .stpenhet { margin: -4px 0 0; font-size: .8rem; color: var(--granite); }
.stplista { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stprad { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 12px; }
.stprad + .stprad, .stpmer + .stprad { border-top: 1px solid var(--line); }
.stpradtext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.stpradtext b { font-size: .95rem; }
.stpradtext small { font-size: .8rem; color: var(--granite); line-height: 1.35; text-wrap: pretty; }
.stprad.arkiv .stpradtext b { color: var(--granite); }
.stplagg { flex: none; min-height: 40px; padding: 0 16px; border-radius: 20px; font-size: .88rem; font-weight: 600; }
.stpmer { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 4px 12px 12px; }
.stpmer > small { font-size: .76rem; color: var(--granite); line-height: 1.4; margin-bottom: 6px; text-wrap: pretty; }
.stplank { min-height: 40px; padding: 0; font-size: .88rem; font-weight: 600; color: var(--blue-ink, var(--blue)); }
.stpark-knapp { min-height: 44px; }
.stpfraga { align-self: stretch; border-color: var(--line); }
.stpradera { align-self: stretch; margin-top: 2px; }
.stpradera summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; cursor: pointer; font-size: .84rem; color: var(--granite); }
.stpradera summary::-webkit-details-marker { display: none; }
.stpradera summary::after { content: "›"; transition: transform .15s; }
.stpradera[open] summary::after { transform: rotate(90deg); }
.stpradera p { margin: 0; font-size: .8rem; line-height: 1.45; color: var(--granite); text-wrap: pretty; }

/* ============================================================ 2. the flow (on top of .kig) */
.kigbar.tre { grid-template-columns: repeat(3, 1fr); }
.stpord { text-align: center; align-items: stretch; }
.stpordbar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin-top: 6px; }
.stpordbar i { display: block; height: 100%; background: var(--blue-ink, var(--blue)); transition: width .2s; }
.stpordnr { margin: 0; font-size: .78rem; color: var(--granite); }
.stpordet { margin: 34px 0 0; font-family: var(--serif); font-size: 2.6rem; line-height: 1.1; overflow-wrap: anywhere; }
.stpjanej { align-self: stretch; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stpjanej button { min-height: 64px; border-radius: 14px; font-size: 1.1rem; font-weight: 600; }
.stplyssna { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; border-radius: 22px; padding: 0 16px; }
.stptext { font-family: var(--serif); font-size: 1.02rem; line-height: 1.6; }
.stpskal { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.stpskal li { position: relative; padding-left: 18px; font-size: .9rem; line-height: 1.4; text-wrap: pretty; }
.stpskal li::before { content: ""; position: absolute; left: 3px; top: .55em; width: 7px; height: 7px; border-radius: 50%; background: var(--blue-ink, var(--blue)); }
.stpstegval button:disabled { opacity: 1; background: transparent; border-style: dashed; color: var(--granite); cursor: default; }
.stpstegval button:disabled span { font-style: italic; }

/* ============================================================ 3. the switcher chip: never adds a line */
/* A 44 px tap target around a 28 px pill; the negative margin keeps the row's height as it was. */
.sprakchip { flex: none; display: inline-grid; place-items: center; min-height: 44px; margin: -8px 0; padding: 0 2px; border: 0; background: transparent; }
.sprakchipin { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px 0 12px; border-radius: 14px; font-size: .8rem; font-weight: 600; }
/* on the blue Din vecka header */
.dvkickrad { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dinvecka .dvhead .sprakchipin { background: rgba(255,255,255,.18); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.dinvecka .dvhead .sprakchip:focus-visible { outline: 3px solid var(--yellow); outline-offset: -4px; }
/* on the + Ny row of Läs, right-aligned */
.lashead { gap: 10px; }
.lashead .sprakchip { margin-left: auto; }
.lashead .sprakchipin { background: var(--card, var(--paper)); color: var(--blue-ink, var(--blue)); box-shadow: inset 0 0 0 1.5px var(--line); }

/* the sheet */
.stpbak { position: fixed; inset: 0; z-index: 130; background: rgba(10,14,22,.42); display: flex; align-items: flex-end; justify-content: center; }
.stpark { width: 100%; max-width: 460px; box-sizing: border-box; background: var(--paper); border-radius: 20px 20px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.stpark h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 1.3rem; }
.stpval { display: flex; flex-direction: column; gap: 8px; }
.stpval button { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 14px; text-align: left; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card, var(--paper)); color: var(--ink); }
.stpvalbox { flex: none; width: 22px; height: 22px; box-sizing: border-box; border-radius: 50%; border: 1.5px solid var(--line); }
.stpvaltext { display: flex; flex-direction: column; gap: 1px; }
.stpvaltext b { font-size: .98rem; }
.stpvaltext small { font-size: .8rem; color: var(--granite); }
.stpval button[aria-checked="true"] { border-color: var(--blue-ink, var(--blue)); background: var(--blue-soft); }
.stpval button[aria-checked="true"] .stpvalbox { border: 6px solid var(--blue-ink, var(--blue)); background: var(--card, var(--paper)); }
.stpvaltips { margin: 2px 0 0; font-size: .8rem; line-height: 1.4; color: var(--granite); text-wrap: pretty; }

/* the one-time toast, above the tab bar */
.stptoast { position: fixed; z-index: 140; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(420px, calc(100% - 32px)); box-sizing: border-box;
  background: var(--ink); color: var(--paper); border-radius: 14px; padding: 12px 16px; font-size: .88rem; line-height: 1.4; box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: stptoast .25s ease-out; }
@keyframes stptoast { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (prefers-reduced-motion: reduce) { .stptoast { animation: none; } .stpordbar i, .stpradera summary::after { transition: none; } }
