/* Wisdompedia pages (/courses, /practice): on the after-login skin of app.css, light and dark.
   Phone first (390 px), then laptop. Every box 2px corners; nothing rounder. Big tap targets (44 px and more). */
.courses-main { width: min(100%, 46rem); }
.crumbs { display: flex; flex-wrap: wrap; gap: 0 .35rem; margin: 0 0 .9rem; font-size: .85rem; color: var(--muted); }
.crumbs a { color: var(--mint); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.crumbs a:hover { text-decoration: underline; }
.course-count, .lesson-meta { margin: .4rem 0 0; color: var(--muted); font-size: .85rem; }
.courses-main .qg-button { min-height: 48px; border-radius: 2px; }

/* Progress: a thin bar and "3 of 13 done" */
.qg-progress { display: flex; align-items: center; gap: .6rem; margin: .7rem 0 0; }
.qg-progress progress, .pq-top progress {
  flex: 1; height: 8px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 0;
  background: var(--surface-raised); color: var(--mint); overflow: hidden;
}
.qg-progress progress::-webkit-progress-bar, .pq-top progress::-webkit-progress-bar { background: var(--surface-raised); }
.qg-progress progress::-webkit-progress-value, .pq-top progress::-webkit-progress-value { background: var(--mint); }
.qg-progress progress::-moz-progress-bar, .pq-top progress::-moz-progress-bar { background: var(--mint); }
.qg-progress-line { flex: none; color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }

/* Continue where you stopped */
.resume { margin: 1.25rem 0 0; }
.resume h2 { margin: 0 0 .5rem; font-size: .85rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.resume-link {
  display: grid; gap: .15rem; padding: .9rem 1rem; min-height: 56px; border: 1px solid var(--mint); border-left-width: 4px;
  border-radius: 2px; background: var(--surface); color: var(--text); text-decoration: none; line-height: 1.4;
}
.resume-link span { color: var(--muted); font-size: .85rem; }
.resume-link strong { font-weight: 650; }
.resume-link strong::after { content: "  →"; color: var(--mint); }
.resume-link:hover { background: var(--surface-raised); }

/* Course cards: one column on the phone, two on the laptop */
.course-group { margin-top: 1.75rem; }
.course-group > h2 { margin: 0 0 .65rem; font-size: 1.05rem; }
.course-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; }
.course-card {
  display: flex; flex-direction: column; padding: 1rem; border: 1px solid var(--line); border-top: 2px solid var(--mint);
  border-radius: 2px; background: var(--surface); min-width: 0;
}
.cc-head { display: block; color: var(--text); text-decoration: none; }
.cc-head:hover h3 { color: var(--mint); }
.course-card h3 { margin: 0 0 .35rem; font-size: 1.1rem; line-height: 1.3; }
.course-card p { margin: 0; color: var(--muted); line-height: 1.5; font-size: .92rem; }
.course-card .course-count { margin-top: .6rem; color: var(--mint); font-weight: 600; }
.courses-main .cc-go { margin-top: .85rem; text-align: center; padding: .6rem 1rem; line-height: 1.35; overflow-wrap: anywhere; }
.course-top { margin-top: .9rem; }
.course-top .cc-go { margin-top: .75rem; }

/* Module and lesson lists, with done ticks */
.module { margin-top: 1.75rem; }
.module h2 { margin: 0; font-size: 1.05rem; line-height: 1.35; }
.module h3 { margin: 1rem 0 .3rem; font-size: .95rem; color: var(--muted); }
.lesson-list { margin: .5rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.lesson-list li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; border-bottom: 1px solid var(--line); line-height: 1.4; }
.lesson-list a { flex: 1; display: flex; align-items: center; gap: .7rem; min-height: 52px; padding: .45rem 0; color: var(--text); text-decoration: none; }
.lesson-list a:hover .ll-title { color: var(--mint); text-decoration: underline; }
.lesson-time { flex: none; color: var(--muted); font-size: .8rem; }
.tick { flex: none; position: relative; width: 22px; height: 22px; border: 2px solid var(--line); border-radius: 2px; }
.lesson-list li.is-done .tick { background: var(--mint); border-color: var(--mint); }
.lesson-list li.is-done .tick::after {
  content: ""; position: absolute; left: 5px; top: 1px; width: 6px; height: 11px;
  border: solid var(--bg); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.lesson-list li.is-done .ll-title { color: var(--muted); }

/* A lesson: plain reading, tables scroll sideways on the phone */
.lesson h1 { margin: 0; }
.lesson-body { margin-top: 1rem; font-size: 1.04rem; line-height: 1.72; overflow-wrap: anywhere; }
.lesson-body h2 { margin: 1.8rem 0 .5rem; font-size: 1.18rem; line-height: 1.35; }
.lesson-body h3, .lesson-body h4 { margin: 1.3rem 0 .4rem; font-size: 1.02rem; }
.lesson-body p { margin: 0 0 .9rem; }
.lesson-body ul, .lesson-body ol { margin: 0 0 .9rem; padding-left: 1.3rem; }
.lesson-body li { margin: .3rem 0; }
.lesson-body code { font: .9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 0 .2em; background: var(--surface-raised); border-radius: 2px; }
.lesson-body pre { margin: 0 0 .9rem; padding: .75rem; overflow-x: auto; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); }
.lesson-body pre code { padding: 0; background: none; }
.lesson-body blockquote { margin: 0 0 .9rem; padding: .5rem .85rem; border-left: 2px solid var(--mint); background: var(--surface); border-radius: 2px; }
.lesson-body blockquote p:last-child { margin: 0; }
.table-wrap { margin: 0 0 1rem; overflow-x: auto; border: 1px solid var(--line); border-radius: 2px; }
.lesson-body table { border-collapse: collapse; width: 100%; font-size: .9rem; line-height: 1.45; }
.lesson-body th, .lesson-body td { padding: .45rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.lesson-body th { background: var(--surface-raised); font-weight: 650; }
.lesson-body tr:last-child td { border-bottom: 0; }
.done-tag { color: var(--mint); font-weight: 650; }

/* Mark done, Practise this chapter */
.lesson-actions { display: grid; gap: .6rem; margin-top: 1.5rem; }
.lesson-actions:empty { display: none; }
.done-btn[aria-pressed="true"] { border-color: var(--mint); color: var(--mint); }

/* Previous and next: side by side, big */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: 1rem; }
.pager a {
  display: block; min-height: 64px; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 2px;
  background: var(--surface); color: var(--text); text-decoration: none; line-height: 1.35; font-size: .9rem;
  overflow: hidden; overflow-wrap: anywhere;
}
.pager a:hover { border-color: var(--mint); }
.pager span { display: block; color: var(--mint); font-size: .8rem; font-weight: 650; margin-bottom: .15rem; }
.pager a[rel="prev"] span::before { content: "← "; }
.pager a[rel="next"] span::after { content: " →"; }
.pager a[rel="next"] { text-align: right; grid-column: 2; }

/* The doubt bar: Video call, Voice call, Chat. Stays at the bottom of the screen while reading. */
.doubt-bar {
  position: sticky; bottom: 0; z-index: 5; margin: 1.5rem -1rem 0; padding: .5rem 1rem calc(.5rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--bg);
}
.doubt-title { margin: 0 0 .35rem; color: var(--muted); font-size: .78rem; font-weight: 650; }
.doubt-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; }
.doubt-btn {
  display: flex; align-items: center; justify-content: center; gap: .4rem; min-height: 48px; padding: 0 .4rem;
  border: 1px solid var(--line); border-radius: 2px; background: var(--surface); color: var(--text);
  font-family: inherit; font-size: .9rem; font-weight: 600; line-height: 1.2; cursor: pointer;
}
.doubt-btn:hover, .doubt-btn:focus-visible { border-color: var(--mint); color: var(--mint); }
.doubt-btn svg { flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.doubt-btn[data-qg-doubt="chat"] { background: var(--mint); border-color: var(--mint); color: var(--on-accent); }

/* Practice: without JavaScript every question is listed with its explanation in <details> */
.pq-links { margin: .85rem 0 0; }
.pq-top { display: flex; align-items: center; gap: .75rem; margin: 1rem 0 0; }
.pq-top progress { height: 6px; }
.pq-score { margin: 0; flex: none; font-weight: 650; color: var(--mint); font-size: .9rem; }
.pq-list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 1rem; }
.pq { padding: 1rem; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); }
.test-run .pq { margin-top: 1rem; }
.pq-count { margin: 0 0 .5rem; color: var(--muted); font-size: .82rem; }
.pq-text { margin: 0 0 .9rem; font-size: 1.05rem; font-weight: 600; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.pq-options { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.pq-option {
  display: flex; gap: .7rem; align-items: baseline; width: 100%; min-height: 52px; padding: .75rem .85rem;
  border: 1px solid var(--line); border-radius: 2px; background: var(--bg); color: var(--text);
  font: inherit; line-height: 1.45; text-align: left; cursor: pointer; overflow-wrap: anywhere;
}
.pq-option b { flex: none; color: var(--mint); }
.pq-option:hover:not(:disabled) { border-color: var(--mint); }
.pq-option:disabled { cursor: default; }
.pq-option[aria-pressed="true"] { border-color: var(--mint); border-left-width: 4px; background: var(--surface-raised); }
.pq-option.is-right { border-color: #3e9b6b; border-left-width: 4px; }
.pq-option.is-wrong { border-color: #d0614f; border-left-width: 4px; opacity: .85; }
.pq-option.is-right::after { content: "Right"; margin-left: auto; color: #3e9b6b; font-size: .8rem; font-weight: 650; }
.pq-option.is-wrong::after { content: "Your pick"; margin-left: auto; color: #d0614f; font-size: .8rem; font-weight: 650; }
.pq-explain { margin-top: .75rem; }
.pq-explain summary { min-height: 44px; display: flex; align-items: center; color: var(--mint); cursor: pointer; font-weight: 600; }
.pq-right { margin: .25rem 0 .4rem; }
.pq-steps { margin: 0; padding-left: 1.2rem; color: var(--muted); line-height: 1.6; }
.pq-nav { margin-top: .85rem; }
.pq-end { margin-top: 1rem; padding: 1rem; border: 1px solid var(--line); border-top: 2px solid var(--mint); border-radius: 2px; background: var(--surface); display: grid; gap: .6rem; }
.pq-end h2 { margin: 0; font-size: 1.25rem; }
.pq-end h3 { margin: .5rem 0 0; font-size: 1rem; }
.pq-end p { margin: 0; color: var(--muted); }

/* The weekly test */
.test-cta {
  display: grid; gap: .2rem; margin: 1.1rem 0 0; padding: .9rem 1rem; min-height: 56px; border: 1px solid var(--mint);
  border-left-width: 4px; border-radius: 2px; background: var(--surface); color: var(--text); text-decoration: none;
}
.test-cta span { color: var(--muted); font-size: .88rem; }
.test-cta strong::after { content: "  →"; color: var(--mint); }
.test-pick { margin-top: 1.1rem; display: grid; gap: .6rem; }
.test-pick h2 { margin: 1rem 0 0; font-size: 1rem; }
.test-scopes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.test-scopes .qg-button { font-size: .88rem; padding: .5rem; }
.test-none { margin: .25rem 0 0; padding: .7rem .85rem; border-left: 2px solid var(--mint); background: var(--surface); color: var(--text); }
.test-wait { margin-top: 1rem; color: var(--muted); }
.revise-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.revise-list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .45rem; padding: .75rem; border: 1px solid var(--line); border-radius: 2px; background: var(--bg); }
.revise-list strong { grid-column: 1 / -1; line-height: 1.4; }
.revise-list .qg-button { font-size: .85rem; padding: .4rem; text-align: center; }
.revise-list .qg-button:only-of-type { grid-column: 1 / -1; }
.test-review { margin: .5rem 0 0; padding-left: 1.2rem; display: grid; gap: .75rem; }
.test-review .pq-text { margin: 0 0 .25rem; font-size: .95rem; }
.is-right-line { color: #3e9b6b; font-weight: 600; }
.is-wrong-line { color: #d0614f; font-weight: 600; }

/* Ask QuantyGPT about this */
.course-ask { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); scroll-margin-top: 1rem; }
.ask-about { margin: 0 0 .6rem; color: var(--muted); font-size: .85rem; line-height: 1.45; overflow-wrap: anywhere; }
.ask-guest { margin: 0; }

/* Notes */
.course-notes { margin-top: 1.75rem; padding: .75rem .9rem; border: 1px solid var(--line); border-left: 2px solid var(--mint); border-radius: 2px; color: var(--muted); font-size: .8rem; line-height: 1.55; }
.course-notes p { margin: .15rem 0; }

/* Inside the one signed-in screen's frame: the crumbs stay (they are the way back) */
.qg-framed .courses-main { padding-top: .5rem; }

@media (min-width: 48rem) {
  .course-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .course-card .cc-go { margin-top: auto; }
  .course-card .cc-head + .course-count { margin-bottom: .85rem; }
  .lesson-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lesson-body { font-size: 1.08rem; }
  .test-scopes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .doubt-bar { margin: 1.5rem 0 0; padding: .6rem 0; }
  .doubt-buttons { max-width: 30rem; }
}

/* Small phones: the same header as the workspace, within 390 px (the "Courses" link is in the crumbs) */
@media (max-width: 25rem) { .courses-page .nav-about { display: none; } }
