/* Läxor: calm homework list, "Ny läxa" wizard, review screens (js/screens/lists.js).
   Everything is scoped to .lx-hw (the screen) or .lx-* classes, so other screens are untouched. */

.lx-hw { gap: 16px; max-width: 1040px; margin: 0 auto; }
.lx-hw > .lx-back { justify-self: start; }
.lx-hw h1 { font-size: clamp(30px, 4.2vw, 46px); }
.lx-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lx-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.lx-title h1 { min-width: 0; overflow-wrap: anywhere; }
.lx-h2 { margin-top: 10px; font-size: 24px; }
.lx-h3 { font-size: 20px; margin: 6px 0 2px; color: var(--ink2); }
.lx-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.lx-hw .muted { font-size: 16px; }
.lx-msg { color: #ffb0b2; font-weight: 800; min-height: 20px; margin: 0; }
.lx-msg:empty { min-height: 0; }
.lx-label { font-size: 13px; color: var(--ink3); font-weight: 800; }
.lx-note { display: flex; gap: 8px; align-items: center; color: #ffd27a; font-weight: 800; font-size: 15px; }
.lx-note svg.i { width: 20px; height: 20px; }

/* subject tile (icon in a coloured square) */
.subj-tile { display: inline-grid; place-items: center; flex: none; border-radius: 14px; background: var(--sc); color: #14183a; box-shadow: 0 3px 0 rgba(0, 0, 0, .28), inset 0 2px 0 rgba(255, 255, 255, .4); }
.subj-tile svg.i { width: 58%; height: 58%; stroke-width: 2.3; }

/* ---------- Läxor: list cards ---------- */
.lx-new { flex: none; }
.lx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 12px; }
.lx-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; border-radius: 20px; border: 2px solid var(--line);
  background: linear-gradient(100deg, color-mix(in srgb, var(--sc) 15%, rgba(30, 38, 104, .95)), rgba(26, 33, 92, .95) 60%); box-shadow: 0 8px 22px rgba(3, 6, 25, .35), inset 0 1px 0 rgba(255, 255, 255, .1); }
.lx-card-main { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 0; border: 0; background: none; text-align: left; color: inherit; }
.lx-card-txt { display: grid; gap: 6px; min-width: 0; flex: 1; justify-items: start; }
.lx-card-name { font-family: var(--font-display); font-weight: 400; font-size: 21px; line-height: 1.1; letter-spacing: .2px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lx-test { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 3px; border-radius: 999px; background: rgba(255, 207, 63, .16); color: var(--gold); font-size: 12px; font-weight: 900; }
.lx-test svg.i { width: 13px; height: 13px; }
.lx-bar { width: 100%; max-width: 220px; height: 8px; border-radius: 999px; background: rgba(0, 0, 0, .38); overflow: hidden; }
.lx-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), var(--green)); }
.lx-play { flex: none; }
.lx-more { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--line); background: rgba(255, 255, 255, .07); color: var(--ink); }
.lx-more svg.i { width: 24px; height: 24px; }
.lx-more:hover, .lx-more:focus-visible { background: rgba(255, 255, 255, .14); outline: none; }

.lx-empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 28px 18px; }
.lx-empty-ic { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 207, 63, .16); color: var(--gold); }
.lx-empty-ic svg.i { width: 36px; height: 36px; }

/* packs */
.lx-packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.lx-pack { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; border: 2px solid var(--line); background: rgba(0, 0, 0, .2); color: var(--ink); text-align: left; min-width: 0; }
.lx-pack .ic { width: 44px; height: 44px; flex: none; border-radius: 13px; display: grid; place-items: center; color: #11152e; }
.lx-pack-txt { display: grid; gap: 6px; min-width: 0; flex: 1; }
.lx-pack-txt b { font-size: 16px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lx-pack-txt .lx-bar { max-width: none; height: 6px; }
.lx-pack-sub { font-size: 13px; color: var(--ink3); font-weight: 800; }
.lx-pack:hover, .lx-pack:focus-visible { border-color: var(--line2); outline: none; }

/* the "⋯" menu (a bottom sheet on phones) */
.lx-menu { display: grid; gap: 8px; }
.lx-menu-head { display: flex; align-items: center; gap: 12px; padding: 2px 2px 8px; min-width: 0; }
.lx-menu-head b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 22px; line-height: 1.1; overflow-wrap: anywhere; }
.lx-menu-meta { display: block; margin-top: 3px; color: var(--ink3); font-size: 14px; font-weight: 800; }
.lx-menu-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: rgba(255, 255, 255, .06); color: var(--ink); font-size: 18px; font-weight: 800; text-align: left; }
.lx-menu-item svg.i { width: 22px; height: 22px; color: var(--ink2); }
.lx-menu-item:hover, .lx-menu-item:focus-visible { background: rgba(255, 255, 255, .12); outline: none; }
.lx-menu-item.danger { color: #ff9a9d; }
.lx-menu-item.danger svg.i { color: #ff7b7f; }
.modal.lx-sheet { width: min(440px, 100%); padding: 18px; }
@media (max-width: 760px) {
  .modal-back.lx-sheet-back { place-items: end center; padding: 0; }
  .modal.lx-sheet { width: 100%; max-width: 560px; border-radius: 24px 24px 0 0; padding: 16px 14px calc(16px + env(safe-area-inset-bottom, 0px)); animation: lxSheet .26s cubic-bezier(.2, .9, .3, 1); }
}
@keyframes lxSheet { from { transform: translateY(40%); opacity: .4; } to { transform: none; opacity: 1; } }

/* ---------- Ny läxa ---------- */
.lx-subjects { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lx-subjects .subject-opt { min-height: 168px; padding: 18px 16px; gap: 6px; }
.lx-subjects .subject-opt b { font-size: 28px; }
.lx-subjects .subject-opt .muted { font-size: 15px; }
.lx-ways { display: grid; gap: 12px; max-width: 600px; }
.lx-way { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; border: 2px solid var(--line); color: var(--ink); text-align: left;
  background: linear-gradient(100deg, color-mix(in srgb, var(--sc, var(--blue)) 16%, rgba(0, 0, 0, .25)), rgba(0, 0, 0, .22)); transition: transform .12s, border-color .15s; }
.lx-way .ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--sc, var(--blue)); color: #14183a; box-shadow: 0 3px 0 rgba(0, 0, 0, .28), inset 0 2px 0 rgba(255, 255, 255, .4); }
.lx-way .ic svg.i { width: 30px; height: 30px; stroke-width: 2.3; }
.lx-way b { font-family: var(--font-display); font-weight: 400; font-size: 24px; letter-spacing: .3px; line-height: 1.1; }
.lx-way .lx-go { width: 26px; height: 26px; color: var(--sc, var(--blue)); }
.lx-way:hover, .lx-way:focus-visible { transform: translateY(-2px); border-color: var(--sc, var(--blue)); outline: none; }
.lx-way-wide { max-width: 600px; }
.lx-glyph { font-family: var(--font-display); font-size: 32px; line-height: 1; }
.lx-pickfile { justify-self: start; font-size: 16px; }
.lx-hw.lx-drop { outline: 3px dashed var(--gold); outline-offset: 8px; border-radius: 20px; }
.lx-lang { flex: 1; min-width: 220px; }

/* typing with a live preview */
.lx-live-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.live-preview .lp-open { border-color: rgba(255, 154, 60, .7); background: rgba(255, 154, 60, .1); }
.lx-ocr-status { font-size: 16px; font-weight: 800; }

/* ---------- review ---------- */
.lx-count { font-size: 15px; }
.lx-name { max-width: 640px; }
.lx-filter { justify-self: start; cursor: pointer; }
.lx-rows { gap: 8px; }
.lx-rows .prow { grid-template-columns: 10px minmax(0, 1fr) minmax(0, 1fr) auto; }
.lx-rows .lx-x { width: 42px; height: 42px; border-radius: 12px; }
.lx-rows .why { color: #ffc48a; }
.lx-rows .why .snips canvas { height: auto; max-height: 64px; }
.lx-alt { font-size: 13px; color: var(--ink2); }
/* matte: task = answer */
.lx-rows.ma .prow { grid-template-columns: 10px minmax(0, 1fr) auto auto; }
.lx-eq { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 22px; color: var(--ink2); }
.lx-eq input { width: 92px; text-align: center; font-family: var(--font); color: var(--ink); }
/* förhör: the question on top, the answer below (phones), side by side on wide screens */
.lx-rows.fq .prow { grid-template-columns: 10px minmax(0, 1fr) auto; grid-template-areas: "st q x" "st a x"; row-gap: 6px; }
.lx-rows.fq .prow > .st { grid-area: st; }
.lx-rows.fq .prow > textarea { grid-area: q; }
.lx-rows.fq .prow > input { grid-area: a; }
.lx-rows.fq .prow > .lx-x { grid-area: x; align-self: start; }
.lx-rows.fq .prow > .why { grid-column: 2 / -1; }
textarea.lx-q { width: 100%; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--line); background: rgba(0, 0, 0, .3); font-weight: 800; font-size: 16px; line-height: 1.3; resize: none; overflow: hidden; display: block; }
textarea.lx-q:focus { border-color: var(--gold); outline: none; }
@media (min-width: 900px) {
  .lx-rows.fq .prow { grid-template-columns: 10px minmax(0, 1.7fr) minmax(0, 1fr) auto; grid-template-areas: "st q a x"; }
  .lx-rows.fq .prow > .lx-x { align-self: center; }
}
.prow.fresh { border-color: rgba(47, 224, 208, .55); background: rgba(47, 224, 208, .08); animation: lxFresh .9s ease-out; }
.prow.fresh .st { background: var(--teal); }
@keyframes lxFresh { from { box-shadow: 0 0 0 4px rgba(47, 224, 208, .35); } to { box-shadow: 0 0 0 0 rgba(47, 224, 208, 0); } }
/* förhör: add one question at a time */
.lx-compose { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px; border-color: rgba(79, 224, 124, .45); }
.lx-compose input { width: 100%; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--line); background: rgba(0, 0, 0, .3); font-weight: 800; font-size: 16px; }
.lx-compose input:focus { border-color: var(--gold); outline: none; }
.lx-add { justify-self: start; }
@media (min-width: 900px) { .lx-compose { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) auto; align-items: start; } }
.btn.lx-similar { --b1: #4ff0e0; --b2: var(--teal2); --b3: #0b6b62; }
.lx-skipped summary { cursor: pointer; font-weight: 800; color: var(--ink2); }
.lx-skiprow { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--line); }
.lx-skiprow span { overflow-wrap: anywhere; }
.lx-cols { display: grid; gap: 10px; }
.lx-save { margin-top: 4px; }

/* Ordkoll */
.lx-wordlist { display: grid; gap: 6px; }
.lx-word { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, .22); }
.lx-word b, .lx-word span { overflow-wrap: anywhere; }
.lx-word > span:nth-child(2) { color: var(--ink2); }
.lx-word .stars { color: var(--gold); letter-spacing: 1px; white-space: nowrap; }
.lx-wordlist.long .lx-word { grid-template-columns: minmax(0, 1fr) auto; }
.lx-wordlist.long .lx-word > span:nth-child(2) { grid-row: 2; }
.lx-wordlist.long .lx-word .stars { grid-row: 1 / span 2; grid-column: 2; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .lx-hw { gap: 14px; }
  .lx-cards { grid-template-columns: 1fr; gap: 10px; }
  .lx-card { gap: 8px; padding: 10px 8px 10px 10px; border-radius: 18px; }
  .lx-card-main { gap: 10px; }
  .lx-card .subj-tile { width: 42px !important; height: 42px !important; border-radius: 12px; }
  .lx-card-name { font-size: 19px; }
  .lx-play.btn.small { padding: 8px 12px 10px; font-size: 15px; }
  .lx-more { width: 38px; height: 38px; }
  .lx-packs { grid-template-columns: 1fr; }
  .lx-subjects { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lx-subjects .subject-opt { display: grid; grid-template-columns: 1fr; justify-items: start; align-content: start; min-height: 150px; padding: 14px; gap: 6px; }
  .lx-subjects .subject-opt .ic { grid-row: auto; width: 52px; height: 52px; }
  .lx-subjects .subject-opt b { font-size: 24px; }
  .lx-subjects .subject-opt .muted { font-size: 14px; }
  .lx-way { grid-template-columns: 50px minmax(0, 1fr) auto; padding: 12px 14px; gap: 12px; }
  .lx-way .ic { width: 50px; height: 50px; }
  .lx-way b { font-size: 21px; }
  .lx-rows .prow { grid-template-columns: 8px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px; padding: 5px; }
  .lx-rows.ma .prow { grid-template-columns: 8px minmax(0, 1fr) auto auto; }
  .lx-rows.fq .prow { grid-template-columns: 8px minmax(0, 1fr) auto; }
  .lx-rows .prow input, textarea.lx-q { padding: 9px 10px; }
  .lx-eq input { width: 78px; }
  .lx-rows .lx-x { width: 38px; height: 38px; }
  .lx-save .btn.big { flex: 1; font-size: 22px; padding: 14px 18px 16px; }
}
@media (max-width: 380px) { .lx-play.btn.small { padding: 8px 10px 10px; } .lx-play svg.i { display: none; } }
.lx-hw .ocr-progress .btn { justify-self: start; }
@media (max-width: 760px) { .lx-hw .crop-wrap canvas { max-height: 46vh; } }
/* opaque card backgrounds (no see-through layers to composite) */
.lx-subjects .subject-opt { background: linear-gradient(180deg, color-mix(in srgb, var(--sc) 24%, #1c2263), #161b4c 75%); }
.lx-way { background: linear-gradient(100deg, color-mix(in srgb, var(--sc, var(--blue)) 20%, #1a1f5a), #161b4c 70%); }
